ALTER TABLE `Orders` CHANGE `SubTotal` `SubTotal` DECIMAL(20,4) NOT NULL DEFAULT '0.00';
ALTER TABLE `Orders` CHANGE `CostTotal` `CostTotal` DECIMAL(20,4) NOT NULL DEFAULT '0.00';
ALTER TABLE `Orders` CHANGE `OriginalAmount` `OriginalAmount` DECIMAL(20,4) NOT NULL DEFAULT '0.00';
ALTER TABLE `Orders` CHANGE `DiscountTotal` `DiscountTotal` DECIMAL(20,4) NOT NULL DEFAULT '0.00';
ALTER TABLE `Orders` CHANGE `AffiliateCommission` `AffiliateCommission` DECIMAL(20,4) NOT NULL DEFAULT '0.00';
ALTER TABLE `Orders` CHANGE `ShippingCost` `ShippingCost` DECIMAL(20,4) NOT NULL DEFAULT '0.00';
ALTER TABLE `Orders` CHANGE `VAT` `VAT` DECIMAL(20,4) NOT NULL DEFAULT '0.00';
ALTER TABLE `Orders` CHANGE `VATPercent` `VATPercent` DOUBLE UNSIGNED NOT NULL DEFAULT '0.00';

INSERT INTO ConfigurationAdmin VALUES ('MaxAddresses', 'la_Text_Orders', 'la_MaxAddresses', 'text', NULL, NULL, 10.10, 0, 0);
INSERT INTO ConfigurationValues VALUES (NULL, 'MaxAddresses', '0', 'In-Commerce', 'in-commerce:general');

ALTER TABLE ProductsPricing ADD `GroupId` INT NOT NULL DEFAULT '0';
UPDATE ProductsPricing SET GroupId = 15;

INSERT INTO ConfigurationAdmin ( `VariableName` , `heading` , `prompt` , `element_type` , `validation` , `ValueList` , `DisplayOrder` , `GroupDisplayOrder` , `Install` ) VALUES ('Comm_PriceBracketCalculation', 'la_Text_PricingCalculation', 'la_prompt_PriceBracketCalculation', 'radio', NULL , '1=lu_price_calc_primary,2=lu_price_calc_optimal', '50', '0', '1');
INSERT INTO ConfigurationValues ( `VariableId` , `VariableName` , `VariableValue` , `ModuleOwner` , `Section` ) VALUES (NULL , 'Comm_PriceBracketCalculation', '2', 'In-Commerce', 'in-commerce:general');

ALTER TABLE PaymentTypes ADD `PortalGroups` TEXT NOT NULL ;
UPDATE PaymentTypes SET `PortalGroups` = ",15," ;

ALTER TABLE ShippingType ADD `PortalGroups` TEXT NOT NULL ;
UPDATE ShippingType SET `PortalGroups` = ",15," ;

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