[-] Installer : fixed warnings #PSCFV-3633
This commit is contained in:
@@ -1085,7 +1085,7 @@ CREATE TABLE `PREFIX_order_detail_tax` (
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_order_invoice` (
|
||||
`id_order_invoice` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_order_invoice` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`number` int(11) NOT NULL,
|
||||
`delivery_number` int(11) NOT NULL,
|
||||
|
||||
@@ -86,7 +86,15 @@ INSERT INTO `PREFIX_stock` (id_product, id_product_attribute, id_shop, quantity)
|
||||
) FROM PREFIX_product p);
|
||||
|
||||
ALTER TABLE PREFIX_stock_mvt ADD id_stock INT UNSIGNED NOT NULL AFTER id_stock_mvt;
|
||||
UPDATE PREFIX_stock_mvt sm SET sm.id_stock = (SELECT s.id_stock FROM PREFIX_stock s WHERE s.id_product = sm.id_product AND s.id_product_attribute = sm.id_product_attribute ORDER BY s.id_shop LIMIT 1);
|
||||
UPDATE PREFIX_stock_mvt sm SET sm.id_stock = (
|
||||
SELECT IFNULL(s.id_stock, 0)
|
||||
FROM PREFIX_stock s
|
||||
WHERE s.id_product = sm.id_product
|
||||
AND s.id_product_attribute = sm.id_product_attribute
|
||||
ORDER BY s.id_shop
|
||||
LIMIT 1
|
||||
);
|
||||
DELETE FROM PREFIX_stock_mvt WHERE id_stock = 0;
|
||||
ALTER TABLE PREFIX_stock_mvt DROP id_product, DROP id_product_attribute;
|
||||
|
||||
CREATE TABLE `PREFIX_country_shop` (
|
||||
|
||||
@@ -20,17 +20,17 @@ ALTER TABLE `PREFIX_tax_rule` CHANGE `zipcode_from` `zipcode_from` VARCHAR(12) N
|
||||
|
||||
UPDATE PREFIX_order_detail_tax odt
|
||||
LEFT JOIN PREFIX_tax t ON (t.id_tax = odt.id_tax)
|
||||
SET unit_amount = ROUND((t.rate / 100) * (
|
||||
SET unit_amount = IFNULL(ROUND((t.rate / 100) * (
|
||||
SELECT od.unit_price_tax_excl - ( o.total_discounts_tax_excl * ( od.unit_price_tax_excl / o.total_products ))
|
||||
FROM PREFIX_order_detail od
|
||||
LEFT JOIN PREFIX_orders o ON ( o.id_order = od.id_order)
|
||||
WHERE odt.id_order_detail = od.id_order_detail
|
||||
), 2);
|
||||
), 2), 0);
|
||||
|
||||
|
||||
UPDATE PREFIX_order_detail_tax odt
|
||||
LEFT JOIN PREFIX_order_detail od ON (od.id_order_detail = odt.id_order_detail)
|
||||
SET total_amount = odt.unit_amount * od.product_quantity;
|
||||
SET total_amount = IFNULL(odt.unit_amount * od.product_quantity, 0);
|
||||
|
||||
/* PHP:add_missing_shop_column_pagenotfound(); */;
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ ALTER TABLE `PREFIX_order_payment`
|
||||
|
||||
-- update for all employee the last ids for notifications
|
||||
UPDATE `PREFIX_employee`
|
||||
SET `id_last_order`= (SELECT max(`id_order`) FROM `PREFIX_orders`),
|
||||
`id_last_customer_message`= (SELECT max(`id_customer_message`) FROM `PREFIX_customer_message`),
|
||||
`id_last_customer`= (SELECT max(`id_customer`) FROM `PREFIX_customer`);
|
||||
SET `id_last_order`= (SELECT IFNULL(MAX(`id_order`), 0) FROM `PREFIX_orders`),
|
||||
`id_last_customer_message`= (SELECT IFNULL(MAX(`id_customer_message`), 0) FROM `PREFIX_customer_message`),
|
||||
`id_last_customer`= (SELECT IFNULL(MAX(`id_customer`), 0) FROM `PREFIX_customer`);
|
||||
|
||||
UPDATE `PREFIX_category_shop` cs
|
||||
SET `position` = (SELECT `position` FROM `PREFIX_category` c WHERE cs.`id_category` = c.`id_category`);
|
||||
|
||||
@@ -323,7 +323,7 @@ ADD `total_wrapping_tax_excl` decimal(17,2) NOT NULL AFTER `total_wrapping`,
|
||||
ADD `total_wrapping_tax_incl` decimal(17,2) NOT NULL AFTER `total_wrapping_tax_excl`;
|
||||
|
||||
ALTER TABLE `PREFIX_order_cart_rule` ADD `value_tax_excl` DECIMAL(17, 2) NOT NULL DEFAULT '0.00';
|
||||
ALTER TABLE `PREFIX_order_cart_rule` ADD `id_order_invoice` INT NOT NULL DEFAULT '0' AFTER `id_cart_rule`;
|
||||
ALTER TABLE `PREFIX_order_cart_rule` ADD `id_order_invoice` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `id_cart_rule`;
|
||||
|
||||
ALTER TABLE `PREFIX_specific_price` ADD `id_group_shop` INT(11) UNSIGNED NOT NULL AFTER `id_shop`;
|
||||
|
||||
@@ -346,7 +346,7 @@ INSERT INTO `PREFIX_order_invoice` (`id_order`, `number`, `total_discount_tax_ex
|
||||
ALTER TABLE `PREFIX_tab` ADD `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1';
|
||||
|
||||
UPDATE `PREFIX_order_detail` od
|
||||
SET od.`id_order_invoice` = (
|
||||
SET od.`id_order_invoice` = (
|
||||
SELECT oi.`id_order_invoice`
|
||||
FROM `PREFIX_order_invoice` oi
|
||||
WHERE oi.`id_order` = od.`id_order`
|
||||
|
||||
Reference in New Issue
Block a user