Tax details are now stored with the transaction items they belong to.
This commit is contained in:
parent
cf98c81461
commit
9d90b92629
7 changed files with 133 additions and 7 deletions
|
|
@ -507,6 +507,37 @@ sub getTaxRate {
|
|||
return $taxRate;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getTransactionTaxData ( sku, address )
|
||||
|
||||
See WebGUI::Shop::TaxDriver->getTransactionTaxData.
|
||||
|
||||
=cut
|
||||
|
||||
sub getTransactionTaxData {
|
||||
my $self = shift;
|
||||
my $sku = shift;
|
||||
my $address = shift;
|
||||
my $countryCode = $self->getCountryCode( $address->get( 'country' ) );
|
||||
|
||||
my $config = $self->SUPER::getTransactionTaxData( $sku, $address );
|
||||
|
||||
if ( ! $countryCode ) {
|
||||
$config->{ outsideEU } = 1;
|
||||
}
|
||||
elsif ( $self->hasVATNumber( $countryCode ) ) {
|
||||
$config->{ useVATNumber } = 1;
|
||||
$config->{ VATNumber } = $self->getVATNumbers( $countryCode )->[0]->{ vatNumber };
|
||||
}
|
||||
else {
|
||||
$config->{ useVATNumber } = 0;
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getVATNumbers ( $countryCode )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue