UPDATE ConfigurationAdmin SET VariableName = 'Product_MinPopVotes', prompt = 'la_fld_Product_MinPopVotes' WHERE VariableName = 'Product_VotesToPop';
UPDATE ConfigurationAdmin SET VariableName = 'Product_MinPopRating', prompt = 'la_fld_Product_MinPopRating' WHERE VariableName = 'Product_RatingToPop';
UPDATE ConfigurationAdmin SET VariableName = 'Product_MaxHotNumber', prompt = 'la_fld_Product_MaxHotNumber' WHERE VariableName = 'Product_HotCount';

UPDATE ConfigurationValues SET VariableName = 'Product_MinPopVotes' WHERE VariableName = 'Product_VotesToPop';
UPDATE ConfigurationValues SET VariableName = 'Product_MinPopRating' WHERE VariableName = 'Product_RatingToPop';
UPDATE ConfigurationValues SET VariableName = 'Product_MaxHotNumber' WHERE VariableName = 'Product_HotCount';

UPDATE ConfigurationAdmin SET DisplayOrder = '10.01' WHERE VariableName = 'Comm_RequireLoginBeforeCheckout';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.02' WHERE VariableName = 'Comm_Allow_Order_Different_Types';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.03' WHERE VariableName = 'Comm_Enable_Backordering';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.04' WHERE VariableName = 'Comm_Process_Backorders_Auto';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.05' WHERE VariableName = 'Comm_Next_Order_Number';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.06' WHERE VariableName = 'Comm_Order_Number_Format_P';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.07' WHERE VariableName = 'Comm_Order_Number_Format_S';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.08' WHERE VariableName = 'Comm_RecurringChargeInverval';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.09' WHERE VariableName = 'Comm_AutoProcessRecurringOrders';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.01' WHERE VariableName = 'Comm_AllowOrderingInNonPrimaryCurrency';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.02' WHERE VariableName = 'Comm_ExchangeRateSource';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.01' WHERE VariableName = 'Comm_DefaultCouponDuration';
UPDATE ConfigurationAdmin SET DisplayOrder = '40.01' WHERE VariableName = 'Comm_RegisterAsAffiliate';
UPDATE ConfigurationAdmin SET DisplayOrder = '40.02' WHERE VariableName = 'Comm_AffiliateStorageMethod';
UPDATE ConfigurationAdmin SET DisplayOrder = '40.03' WHERE VariableName = 'Comm_AffiliateCookieDuration';

UPDATE ConfigurationAdmin SET DisplayOrder = '10.01', GroupDisplayOrder = 1 WHERE VariableName = 'product_OrderProductsBy';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.01', GroupDisplayOrder = 2 WHERE VariableName = 'product_OrderProductsByDir';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.02', GroupDisplayOrder = 1 WHERE VariableName = 'product_OrderProductsThenBy';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.02', GroupDisplayOrder = 2 WHERE VariableName = 'product_OrderProductsThenByDir';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.03' WHERE VariableName = 'Comm_Perpage_Products';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.04' WHERE VariableName = 'Comm_Perpage_Products_Short';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.05' WHERE VariableName = 'Product_NewDays';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.06' WHERE VariableName = 'Product_MinPopRating';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.07' WHERE VariableName = 'Product_MinPopVotes';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.08' WHERE VariableName = 'Product_MaxHotNumber';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.09' WHERE VariableName = 'products_EditorPicksAboveRegular';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.10', GroupDisplayOrder = 1 WHERE VariableName = 'product_RatingDelay_Value';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.10', GroupDisplayOrder = 2 WHERE VariableName = 'product_RatingDelay_Interval';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.01' WHERE VariableName = 'Comm_Perpage_Reviews';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.02', GroupDisplayOrder = 1 WHERE VariableName = 'product_ReviewDelay_Value';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.02', GroupDisplayOrder = 2 WHERE VariableName = 'product_ReviewDelay_Interval';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.01' WHERE VariableName = 'Comm_Perpage_Manufacturers';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.02' WHERE VariableName = 'Comm_Perpage_Manufacturers_Short';
UPDATE ConfigurationAdmin SET DisplayOrder = '40.01' WHERE VariableName = 'p_CategoryTemplate';
UPDATE ConfigurationAdmin SET DisplayOrder = '40.02' WHERE VariableName = 'p_ItemTemplate';

UPDATE ConfigurationAdmin SET DisplayOrder = '10.01' WHERE VariableName = 'Comm_StoreName';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.02' WHERE VariableName = 'Comm_Contacts_Phone';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.03' WHERE VariableName = 'Comm_Contacts_Fax';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.04' WHERE VariableName = 'Comm_Contacts_Email';
UPDATE ConfigurationAdmin SET DisplayOrder = '10.05' WHERE VariableName = 'Comm_Contacts_Additional';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.01' WHERE VariableName = 'Comm_AddressLine1';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.02' WHERE VariableName = 'Comm_AddressLine2';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.03' WHERE VariableName = 'Comm_City';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.04' WHERE VariableName = 'Comm_ZIP';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.05' WHERE VariableName = 'Comm_Country';
UPDATE ConfigurationAdmin SET DisplayOrder = '20.06' WHERE VariableName = 'Comm_State';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.01' WHERE VariableName = 'Comm_Shipping_AddressLine1';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.02' WHERE VariableName = 'Comm_Shipping_AddressLine2';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.03' WHERE VariableName = 'Comm_Shipping_City';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.04' WHERE VariableName = 'Comm_Shipping_ZIP';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.05' WHERE VariableName = 'Comm_Shipping_Country';
UPDATE ConfigurationAdmin SET DisplayOrder = '30.06' WHERE VariableName = 'Comm_Shipping_State';

ALTER TABLE Orders CHANGE VAT VAT FLOAT NOT NULL DEFAULT 0, CHANGE VATPercent VATPercent FLOAT NOT NULL DEFAULT 0;

INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'p_ItemTemplate', 'p_ItemTemplate', 'la_title_SystemCF', 'p_ItemTemplate', 'text', NULL, 0, 0, 1);

UPDATE Modules SET Version = '1.1.1' WHERE Name = 'In-Commerce';