[+] Core : products and carriers tax rules are associated to shop

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13586 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-02-24 09:26:18 +00:00
parent 6d87094802
commit 2408b4ac5f
20 changed files with 250 additions and 69 deletions
@@ -190,7 +190,9 @@ class AdminProductsControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (a.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang`)
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` AND i.`cover` = 1)
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (a.`id_tax_rules_group` = tr.`id_tax_rules_group`
LEFT JOIN `'._DB_PREFIX_.'product_tax_rules_group_shop` ptrgs ON (a.`id_product` = ptrgs.`id_product`
AND ptrgs.id_shop='.(int)$this->context->shop->id.')
LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (ptrgs.`id_tax_rules_group` = tr.`id_tax_rules_group`
AND tr.`id_country` = '.(int)$this->context->country->id.' AND tr.`id_state` = 0)
LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`)';
@@ -427,6 +429,7 @@ class AdminProductsControllerCore extends AdminController
&& Product::duplicateCustomizationFields($id_product_old, $product->id)
&& Product::duplicateTags($id_product_old, $product->id)
&& Product::duplicateDownload($id_product_old, $product->id)
&& Product::duplicateTaxRulesGroup((int)$id_product_old, (int)$product->id)
&& $product->duplicateShops($id_product_old))
{
if ($product->hasAttributes())
@@ -1412,6 +1415,7 @@ class AdminProductsControllerCore extends AdminController
if (!$this->updatePackItems($this->object))
$this->errors[] = Tools::displayError('An error occurred while adding products to the pack.');
$this->updateDownloadProduct($this->object);
$this->object->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group'), true);
if (!count($this->errors))
{
@@ -1506,7 +1510,7 @@ class AdminProductsControllerCore extends AdminController
$this->processProductAttribute($token);
$this->processPriceAddition($token);
$this->processSpecificPricePriorities($token);
$this->object->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group'));
if (!$this->updatePackItems($object))
$this->errors[] = Tools::displayError('An error occurred while adding products to the pack.');
elseif (!$object->updateCategories(Tools::getValue('categoryBox'), true))