From 070793da86f60a329bee3f06b6ee9cda77a2e538 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Mon, 31 Aug 2020 15:51:46 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20bogue=20sur=20mon=20module=20NoVat?= =?UTF-8?q?ForCompanies=20(on=20ne=20v=C3=A9rifiait=20pas=20si=20le=20n?= =?UTF-8?q?=C2=B0=20de=20TVA=20intra=20=C3=A9tait=20vide).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- local/modules/CustomerVatNumber/I18n/fr_FR.php | 2 +- .../modules/NoVatForCompanies/TaxType/PricePercentTaxType.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/local/modules/CustomerVatNumber/I18n/fr_FR.php b/local/modules/CustomerVatNumber/I18n/fr_FR.php index 5bc00198..df2d2555 100755 --- a/local/modules/CustomerVatNumber/I18n/fr_FR.php +++ b/local/modules/CustomerVatNumber/I18n/fr_FR.php @@ -1,7 +1,7 @@ 'Si vous êtres un professionnel, indiquez votre N° de TVA Intracommunautaire', + 'Please enter a valid VAT number.' => 'Si vous êtes un professionnel, indiquez votre N° de TVA Intracommunautaire', 'VAT Number' => 'N° de TVA Intracommunautaire', 'Your VAT Number' => 'Votre N° de TVA', ); diff --git a/local/modules/NoVatForCompanies/TaxType/PricePercentTaxType.php b/local/modules/NoVatForCompanies/TaxType/PricePercentTaxType.php index 9ae0cb83..26426ae8 100644 --- a/local/modules/NoVatForCompanies/TaxType/PricePercentTaxType.php +++ b/local/modules/NoVatForCompanies/TaxType/PricePercentTaxType.php @@ -49,7 +49,9 @@ class PricePercentTaxType extends BaseTaxType // Ne sont soumis à une TVA réduite que les pros en Europe (hors France) possédant une n° de TVA intracommunautaire if (null == $reseller && null == $company) return ($this->getRequirement("percent_france") * 0.01); - if (null == CustomerVatNumberQuery::create()->findOneById($customer->getId())) return ($this->getRequirement("percent_france") * 0.01); + + $customerVatNumber = CustomerVatNumberQuery::create()->findOneById($customer->getId())->getVatNumber(); + if ((null == $customerVatNumber) || !isset($customerVatNumber)) return ($this->getRequirement("percent_france") * 0.01); } return ($this->getRequirement("percent_zero") * 0.01);