// bugfix vatnumber

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9867 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mMarinetti
2011-11-03 18:03:29 +00:00
parent 9c0f70d68b
commit 4d9c71b4a6
3 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ class AdminControllerCore extends Controller
/** @var string Default ORDER BY clause when $_orderBy is not defined */
protected $_defaultOrderBy = false;
public $tpl_form_vars;
public $tpl_list_vars;
public $tpl_form_vars = array();
public $tpl_list_vars = array();
/** @var array Errors displayed after post processing */
public $_errors = array();
@@ -24,9 +24,6 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
//include_once(_PS_ADMIN_DIR_.'/../classes/AdminTab.php');
if (Configuration::get('VATNUMBER_MANAGEMENT') AND file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php'))
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
class AdminAddressesControllerCore extends AdminController
{
@@ -142,17 +139,21 @@ class AdminAddressesControllerCore extends AdminController
$tokenCustomer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id);
}
// @todo in 1.4, this include was done before the class declaration
// We should use a hook now
if (Configuration::get('VATNUMBER_MANAGEMENT') AND file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php'))
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
if (Configuration::get('VATNUMBER_MANAGEMENT'))
if (file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php') && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT')))
$vat = 'is_applicable';
else
$vat = 'management';
$this->context->smarty->assign(array(
$this->tpl_form_vars = array(
'vat' => isset($vat) ? $vat : null,
'customer' => isset($customer) ? $customer : null,
'tokenCustomer' => isset ($tokenCustomer) ? $tokenCustomer : null
));
);
// Order address fields depending on country format
$addresses_fields = $this->processAddressFormat();
@@ -389,4 +390,4 @@ class AdminAddressesControllerCore extends AdminController
return $out;
}
}
}
+2 -2
View File
@@ -106,7 +106,7 @@ class VatNumber extends TaxManagerModule
public static function isApplicable($id_country)
{
return (((int)$id_country AND in_array(Country::getIsoById($id_country), self::getPrefixIntracomVAT())) ? 1 : 0);
}
}
public static function WebServiceCheck($vatNumber)
{
@@ -180,4 +180,4 @@ class VatNumber extends TaxManagerModule
</fieldset>';
return $echo;
}
}
}