[-] Project : #PSCFV-2633 #PSCFV-2622 - Fix problems with multishipping and order payment & invoice

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15797 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-06-01 15:40:32 +00:00
parent 54fd1c0dcb
commit d02787dc97
15 changed files with 376 additions and 54 deletions
+30
View File
@@ -5,3 +5,33 @@ DROP TABLE `PREFIX_discount_type`;
DROP TABLE `PREFIX_discount_type_lang`;
/* PHP:add_missing_image_key(); */;
-- Update order_payment structure for multishipping
-- Step 1: Add the table ps_order_invoice_payment and populate it
CREATE TABLE `PREFIX_order_invoice_payment` (
`id_order_invoice` int(11) unsigned NOT NULL,
`id_order_payment` int(11) unsigned NOT NULL,
`id_order` int(11) unsigned NOT NULL,
PRIMARY KEY (`id_order_invoice`,`id_order_payment`),
KEY `order_payment` (`id_order_payment`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
INSERT INTO `PREFIX_order_invoice_payment`
(SELECT id_order_invoice, id_order_payment, id_order FROM `PREFIX_order_payment` WHERE id_order_invoice > 0);
-- Step 2: Add the collumn id_order_reference
ALTER TABLE `PREFIX_order_payment`
ADD COLUMN `order_reference` VARCHAR(9) AFTER `id_order`,
ADD INDEX `order_reference`(`order_reference`);
-- Step 3: Fill in id_order_reference and merge duplicate lines
/* PHP:add_order_reference_in_order_payment(); */;
-- Step 4: Drop collumn id_order
ALTER TABLE `PREFIX_order_payment`
DROP COLUMN `id_order`,
DROP COLUMN `id_order_invoice`;