From 30c516619d7eb24239ef00249b1620d5f3300089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 17 Jan 2013 17:27:59 +0100 Subject: [PATCH] // Something was missing in commit ee62ed8d27c0cf545e8064a6dd613296782d4b88 --- controllers/admin/AdminTaxRulesGroupController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php index c28e1ad86..50fe62107 100644 --- a/controllers/admin/AdminTaxRulesGroupController.php +++ b/controllers/admin/AdminTaxRulesGroupController.php @@ -398,11 +398,16 @@ class AdminTaxRulesGroupControllerCore extends AdminController if (empty($this->selected_states) || count($this->selected_states) == 0) $this->selected_states = array(0); - + $tax_rules_group = new TaxRulesGroup((int)$id_tax_rules_group); foreach ($this->selected_countries as $id_country) { foreach ($this->selected_states as $id_state) { + if ($tax_rules_group->hasUniqueTaxRuleForCountry($id_country, $id_state)) + { + $this->errors[] = Tools::displayError('A tax rule already exists for this country/state with tax only behavior'); + continue; + } $tr = new TaxRule(); // update or creation?