Typo caused EU TaxDriver to not charge taxes for shipping addresses in France.

This commit is contained in:
Martin Kamerbeek 2010-01-28 10:39:40 +01:00
parent 27df0d537d
commit 02f4211f12
3 changed files with 20 additions and 3 deletions

View file

@ -8,6 +8,8 @@
- fixed #11044: Optionally include hidden pages in sitemap.xml
- fixed #11379: Certain fields in some Assets cannot be overridden in the config file
- fixed #11380: "Use this Address" button in Shop needs to be green!
- fixed: Due to a typo France was not considered part of the EU by the EU
TaxDriver. ( Martin Kamerbeek / Oqapi )
7.8.10
- fixed #11332: Pagination in webgui.org forum urls

View file

@ -62,7 +62,7 @@ tie my %EU_COUNTRIES, 'Tie::IxHash', (
EL => 'Greece',
ES => 'Spain',
FI => 'Finland',
FR => 'France ',
FR => 'France',
GB => 'United Kingdom',
HU => 'Hungary',
IE => 'Ireland',

View file

@ -44,6 +44,14 @@ my $noServiceVAT= 'NotGonnaWork';
my $invalidVAT = 'ByNoMeansAllowed';
my $visitorUser = WebGUI::User->new( $session, 1 );
my @EU_COUNTRIES = (
'Austria', 'Belgium', 'Bulgaria', 'Cyprus', 'Czech Republic',
'Germany', 'Denmark', 'Estonia', 'Greece', 'Spain', 'Finland',
'France', 'United Kingdom', 'Hungary', 'Ireland', 'Italy',
'Lithuania', 'Luxembourg', 'Latvia', 'Malta', 'Netherlands',
'Poland', 'Portugal', 'Romania', 'Sweden', 'Slovenia', 'Slovakia',
);
# Test SKU
my $sku = WebGUI::Asset->getRoot($session)->addChild( {
className => 'WebGUI::Asset::Sku::Donation',
@ -79,7 +87,7 @@ my $cart;
#----------------------------------------------------------------------------
# Tests
my $tests = 317;
my $tests = 342;
plan tests => 1 + $tests;
#----------------------------------------------------------------------------
@ -428,8 +436,15 @@ SKIP: {
$taxer->deleteVATNumber( $testVAT_BE, $taxUser );
# Addresses inside EU without VAT number
is( $taxer->getTaxRate( $sku, $beAddress ), 100, 'getTaxRate: shipping addresses inside EU w/o VAT number pay tax' );
foreach my $country ( @EU_COUNTRIES ) {
next if $country eq $nlAddress->get('country'); # Residents of merchant country should be checked separately.
$beAddress->update( { country => $country } );
is( $taxer->getTaxRate( $sku, $beAddress ), 100, "getTaxRate: shipping addresses in $country w/o VAT number pay tax" );
}
$beAddress->update( { country => 'Belgium' } );
is( $taxer->getTaxRate( $sku, $nlAddress ), 100, 'getTaxRate: shipping addresses in country of merchant w/o VAT number pay tax' );
# Address outside EU
is( $taxer->getTaxRate( $sku, $usAddress ), 0, 'getTaxRate: shipping addresses outside EU are tax exempt' );