// Fixes to upgrader upgrade scripts
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11620 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
public function migrate_orders()
|
||||
function migrate_orders()
|
||||
{
|
||||
if (!defined('PS_TAX_EXC'))
|
||||
define('PS_TAX_EXC', 1);
|
||||
@@ -84,10 +84,10 @@ public function migrate_orders()
|
||||
$wrapping_tax_rate = 1 + ((float)Configuration::get('PS_GIFT_WRAPPING_TAX') / 100);
|
||||
$carrier_tax_rate = 1 + ((float)$order['carrier_tax_rate'] / 100);
|
||||
|
||||
$total_discount_tax_excl = $order['total_discount'] / $average_tax_used;
|
||||
$total_discount_tax_excl = $order['total_discounts'] / $average_tax_used;
|
||||
|
||||
$sql = 'UPDATE `'._DB_PREFIX_.'orders`
|
||||
SET `total_discount_tax_incl` = '.(float)$order['total_discount'].',
|
||||
SET `total_discount_tax_incl` = '.(float)$order['total_discounts'].',
|
||||
`total_discount_tax_excl` = '.(float)$total_discount_tax_excl.',
|
||||
`total_paid_tax_incl` = '.(float)$order['total_paid'].',
|
||||
`total_paid_tax_excl` = '.(float)$order['total_paid'].',
|
||||
|
||||
@@ -82,25 +82,27 @@ function update_stock_mvt_reason()
|
||||
");
|
||||
|
||||
//Add custom movements
|
||||
foreach ($mvts as $mvt)
|
||||
if (is_array($mvts))
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `PREFIX_stock_mvt_reason` (`sign`, `date_add`, `date_upd`)
|
||||
VALUES ("'.(int)$mvt['sign'].'", "'.pSQL($mvt['date_add']).'", "'.pSQL($mvt['date_upd']).'")
|
||||
');
|
||||
|
||||
$row_id = Db::getInstance()->Insert_ID();
|
||||
|
||||
foreach ($mvts_lang as $mvt_lang)
|
||||
foreach ($mvts as $mvt)
|
||||
{
|
||||
if ($mvt_lang['id_stock_mvt_reason'] != $mvt['id'])
|
||||
continue;
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `name`)
|
||||
VALUES ("'.(int)$row_id.'", "'.(int)$mvt_lang['id_lang'].'", "'.pSQL($mvt_lang['name']).'")
|
||||
INSERT INTO `PREFIX_stock_mvt_reason` (`sign`, `date_add`, `date_upd`)
|
||||
VALUES ("'.(int)$mvt['sign'].'", "'.pSQL($mvt['date_add']).'", "'.pSQL($mvt['date_upd']).'")
|
||||
');
|
||||
|
||||
$row_id = Db::getInstance()->Insert_ID();
|
||||
|
||||
foreach ($mvts_lang as $mvt_lang)
|
||||
{
|
||||
if ($mvt_lang['id_stock_mvt_reason'] != $mvt['id'])
|
||||
continue;
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `name`)
|
||||
VALUES ("'.(int)$row_id.'", "'.(int)$mvt_lang['id_lang'].'", "'.pSQL($mvt_lang['name']).'")
|
||||
');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user