[-] BO : FixBug #PSCFV-9613 Fix product tax to be shop dependent

This commit is contained in:
Jérôme Nadaud
2013-07-17 17:33:53 +02:00
parent 6884d7c5de
commit 458838e598
2 changed files with 16 additions and 7 deletions
+15 -6
View File
@@ -53,13 +53,22 @@ class TaxRulesGroupCore extends ObjectModel
protected static $_taxes = array();
public static function getTaxRulesGroups($only_active = true)
public static function getTaxRulesGroups($only_active = true, $multiShop = false)
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'tax_rules_group` g'
.($only_active ? ' WHERE g.`active` = 1' : '').'
ORDER BY name ASC');
if ((bool)$multiShop) {
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'tax_rules_group` g'
.Shop::addSqlAssociation('tax_rules_group', 'g')
.($only_active ? ' WHERE g.`active` = 1' : '').'
ORDER BY name ASC');
} else {
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'tax_rules_group` g'
.($only_active ? ' WHERE g.`active` = 1' : '').'
ORDER BY name ASC');
}
}
/**
@@ -3001,7 +3001,7 @@ class AdminProductsControllerCore extends AdminController
$data->assign(array(
'link' => $this->context->link,
'currency' => $currency = $this->context->currency,
'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true),
'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true),
'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id),
'ecotaxTaxRate' => Tax::getProductEcotaxRate(),
'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),