// 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:
@@ -71,8 +71,8 @@ class AdminControllerCore extends Controller
|
|||||||
/** @var string Default ORDER BY clause when $_orderBy is not defined */
|
/** @var string Default ORDER BY clause when $_orderBy is not defined */
|
||||||
protected $_defaultOrderBy = false;
|
protected $_defaultOrderBy = false;
|
||||||
|
|
||||||
public $tpl_form_vars;
|
public $tpl_form_vars = array();
|
||||||
public $tpl_list_vars;
|
public $tpl_list_vars = array();
|
||||||
|
|
||||||
/** @var array Errors displayed after post processing */
|
/** @var array Errors displayed after post processing */
|
||||||
public $_errors = array();
|
public $_errors = array();
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* 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
|
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);
|
$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 (Configuration::get('VATNUMBER_MANAGEMENT'))
|
||||||
if (file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php') && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT')))
|
if (file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php') && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT')))
|
||||||
$vat = 'is_applicable';
|
$vat = 'is_applicable';
|
||||||
else
|
else
|
||||||
$vat = 'management';
|
$vat = 'management';
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->tpl_form_vars = array(
|
||||||
'vat' => isset($vat) ? $vat : null,
|
'vat' => isset($vat) ? $vat : null,
|
||||||
'customer' => isset($customer) ? $customer : null,
|
'customer' => isset($customer) ? $customer : null,
|
||||||
'tokenCustomer' => isset ($tokenCustomer) ? $tokenCustomer : null
|
'tokenCustomer' => isset ($tokenCustomer) ? $tokenCustomer : null
|
||||||
));
|
);
|
||||||
|
|
||||||
// Order address fields depending on country format
|
// Order address fields depending on country format
|
||||||
$addresses_fields = $this->processAddressFormat();
|
$addresses_fields = $this->processAddressFormat();
|
||||||
@@ -389,4 +390,4 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class VatNumber extends TaxManagerModule
|
|||||||
public static function isApplicable($id_country)
|
public static function isApplicable($id_country)
|
||||||
{
|
{
|
||||||
return (((int)$id_country AND in_array(Country::getIsoById($id_country), self::getPrefixIntracomVAT())) ? 1 : 0);
|
return (((int)$id_country AND in_array(Country::getIsoById($id_country), self::getPrefixIntracomVAT())) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function WebServiceCheck($vatNumber)
|
public static function WebServiceCheck($vatNumber)
|
||||||
{
|
{
|
||||||
@@ -180,4 +180,4 @@ class VatNumber extends TaxManagerModule
|
|||||||
</fieldset>';
|
</fieldset>';
|
||||||
return $echo;
|
return $echo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user