Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #204 from classyllama/feature/AVS-421_88-fix-submi…
Browse files Browse the repository at this point in the history
…t-vat-number

AVS-421_88 - Fix Submit VAT Number
  • Loading branch information
rsisco authored Oct 25, 2018
2 parents 891c034 + 983a7e2 commit 36aa6c8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Framework/Interaction/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,19 @@ protected function retrieveGetTaxRequestFields(StoreInterface $store, $address,
*/
protected function getBusinessIdentificationNumber($store, $address, $customer)
{
if ($customer && $customer->getTaxvat()) {
return $customer->getTaxvat();
if (!$this->config->getUseBusinessIdentificationNumber($store)) {
// 'Include VAT Tax' setting is disabled
return null;
}
if ($this->config->getUseBusinessIdentificationNumber($store)) {
if ($address->getVatId()) {
// Using the VAT ID has been assigned to the address
return $address->getVatId();
}
if ($customer && $customer->getTaxvat()) {
// Using the VAT ID assigned to the customer account
return $customer->getTaxvat();
}
// No VAT ID available to use
return null;
}

Expand Down

0 comments on commit 36aa6c8

Please sign in to comment.