// duplication of tax_rules_group on adminproducts with multishop

This commit is contained in:
Rémi Gaillard committed 2013-08-22 10:53:50 +02:00
1 parent 099baaef70
commit 907d81c32e
2 files changed
+5 -12

No files matched your search

+4 -11
View File
@@ -53,22 +53,15 @@ class TaxRulesGroupCore extends ObjectModel
protected static $_taxes = array(); protected static $_taxes = array();
public static function getTaxRulesGroups($only_active = true, $multiShop = false) public static function getTaxRulesGroups($only_active = true)
{ {
if ((bool)$multiShop) { return Db::getInstance()->executeS('
return Db::getInstance()->executeS(' SELECT DISTINCT g.id_tax_rules_group, g.name, g.active
SELECT *
FROM `'._DB_PREFIX_.'tax_rules_group` g' FROM `'._DB_PREFIX_.'tax_rules_group` g'
.Shop::addSqlAssociation('tax_rules_group', 'g') .Shop::addSqlAssociation('tax_rules_group', 'g')
.($only_active ? ' WHERE g.`active` = 1' : '').' .($only_active ? ' WHERE g.`active` = 1' : '').'
ORDER BY name ASC'); 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');
}
} }
/** /**
@@ -2993,7 +2993,7 @@ class AdminProductsControllerCore extends AdminController
$data->assign(array( $data->assign(array(
'link' => $this->context->link, 'link' => $this->context->link,
'currency' => $currency = $this->context->currency, 'currency' => $currency = $this->context->currency,
'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true), 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true),
'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id), 'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id),
'ecotaxTaxRate' => Tax::getProductEcotaxRate(), 'ecotaxTaxRate' => Tax::getProductEcotaxRate(),
'tax_exclude_taxe_option' => Tax::excludeTaxeOption(), 'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),