ALTER TABLE `ShopOrder`
	ADD COLUMN `ShopOrder_GrandTotalExcl` DECIMAL(10,2) NOT NULL AFTER `ShopOrder_GrandTotalWithoutVAT`,
	ADD COLUMN `ShopOrder_GrandTotalIncl` DECIMAL(10,2) NOT NULL AFTER `ShopOrder_GrandTotal`
;
UPDATE ShopOrder SET ShopOrder.ShopOrder_GrandTotalExcl = ShopOrder.ShopOrder_GrandTotalWithoutVAT, ShopOrder.ShopOrder_GrandTotalIncl = ShopOrder.ShopOrder_GrandTotal;
ALTER TABLE `ShopOrder`
	DROP COLUMN `ShopOrder_GrandTotalWithoutVAT`,
	DROP COLUMN `ShopOrder_GrandTotal`
;

ALTER TABLE `ShopOrderItem`
	ADD COLUMN `ShopOrderItem_PriceExcl` DECIMAL(10,2) NOT NULL COMMENT 'Wert der Bestellposition (1 Einheit, netto)' AFTER `ShopOrderItem_Price`,
	ADD COLUMN `ShopOrderItem_PriceIncl` DECIMAL(10,2) NOT NULL COMMENT 'Wert der Bestellposition (1 Einheit, brutto)' AFTER `ShopOrderItem_PriceExcl`,
	ADD COLUMN `ShopOrderItem_ListPriceExcl` DECIMAL(10,2) NOT NULL DEFAULT 0 COMMENT 'Listenpreis (1 Einheit, netto) zum Zeitpunkt des Verkaufs' AFTER `ShopOrderItem_ListPrice`,
	ADD COLUMN `ShopOrderItem_ListPriceIncl` DECIMAL(10,2) NOT NULL DEFAULT 0 COMMENT 'Listenpreis (1 Einheit, brutto) zum Zeitpunkt des Verkaufs' AFTER `ShopOrderItem_ListPriceExcl`
;
UPDATE ShopOrderItem SET ShopOrderItem.ShopOrderItem_PriceExcl = ShopOrderItem.ShopOrderItem_Price, ShopOrderItem.ShopOrderItem_PriceIncl = (ShopOrderItem.ShopOrderItem_PriceExcl * ((100.0 + ShopOrderItem.ShopOrderItem_VAT) / 100.0));
UPDATE ShopOrderItem SET ShopOrderItem.ShopOrderItem_ListPriceExcl = ShopOrderItem.ShopOrderItem_ListPrice, ShopOrderItem.ShopOrderItem_ListPriceIncl = (ShopOrderItem.ShopOrderItem_ListPriceExcl * ((100.0 + ShopOrderItem.ShopOrderItem_VAT) / 100.0));
ALTER TABLE `ShopOrderItem`
	DROP COLUMN `ShopOrderItem_Price`,
	DROP COLUMN `ShopOrderItem_ListPrice`
;


ALTER TABLE `ShopAccountJournal`
	ADD COLUMN `ShopAccountJournal_GrandTotalExcl` DECIMAL(10,2) AFTER `ShopAccountJournal_GrandTotalWithoutVAT`,
	ADD COLUMN `ShopAccountJournal_GrandTotalIncl` DECIMAL(10,2) AFTER `ShopAccountJournal_GrandTotal`
;
UPDATE ShopAccountJournal SET ShopAccountJournal.ShopAccountJournal_GrandTotalExcl = ShopAccountJournal.ShopAccountJournal_GrandTotalWithoutVAT, ShopAccountJournal.ShopAccountJournal_GrandTotalIncl = ShopAccountJournal.ShopAccountJournal_GrandTotal;
ALTER TABLE `ShopAccountJournal`
	DROP COLUMN `ShopAccountJournal_GrandTotalWithoutVAT`,
	DROP COLUMN `ShopAccountJournal_GrandTotal`
;

ALTER TABLE `ShopAccountJournalLine`
	ADD COLUMN `ShopAccountJournalLine_PriceExcl` DECIMAL(10,2) COMMENT 'Wert der Position (1 Einheit, netto)' AFTER `ShopAccountJournalLine_VAT`,
	ADD COLUMN `ShopAccountJournalLine_PriceIncl` DECIMAL(10,2) COMMENT 'Wert der Position (1 Einheit, brutto)' AFTER `ShopAccountJournalLine_PriceExcl`
;
UPDATE ShopAccountJournalLine SET ShopAccountJournalLine.ShopAccountJournalLine_PriceExcl = ShopAccountJournalLine.ShopAccountJournalLine_Value, ShopAccountJournalLine.ShopAccountJournalLine_PriceIncl = (ShopAccountJournalLine.ShopAccountJournalLine_PriceExcl * ((100.0 + ShopAccountJournalLine.ShopAccountJournalLine_VAT) / 100.0));
ALTER TABLE `ShopAccountJournalLine`
	DROP COLUMN `ShopAccountJournalLine_Value`
;


