Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VAT in Norway #97

Open
mmihalev opened this issue Oct 15, 2024 · 1 comment
Open

VAT in Norway #97

mmihalev opened this issue Oct 15, 2024 · 1 comment

Comments

@mmihalev
Copy link

Hello,
The code bellow produces empty results var_dump($amounts) when store and customer addresses are in Norway.
Am I doing something wrong here?

$taxTypeRepository = new TaxTypeRepository();
$chainTaxTypeResolver = new ChainTaxTypeResolver();
$chainTaxTypeResolver->addResolver(new CanadaTaxTypeResolver($taxTypeRepository));
$chainTaxTypeResolver->addResolver(new EuTaxTypeResolver($taxTypeRepository));
$chainTaxTypeResolver->addResolver(new DefaultTaxTypeResolver($taxTypeRepository));
$chainTaxRateResolver = new ChainTaxRateResolver();
$chainTaxRateResolver->addResolver(new DefaultTaxRateResolver());
$resolver = new TaxResolver($chainTaxTypeResolver, $chainTaxRateResolver);

$customerAddress = new Address();
$storeAddress = new Address();

$storeAddress = $storeAddress->withCountryCode('NO');
$customerAddress = $customerAddress->withCountryCode('NO');

$context = new Context($customerAddress, $storeAddress);
$taxable = new MyTaxable();

$amounts = $resolver->resolveAmounts($taxable, $context);
@dmnc
Copy link
Collaborator

dmnc commented Feb 24, 2025

Right now this package doesn't have any tax data for Norway. From a quick look, it appears that it is a fairly standard approach with a main rate and a couple of reduced rates that will only apply for items going direct from Norway to Norway.

If you wanted to create a PR, it would look very similar to this one: https://github.com/commerceguys/tax/pull/85/files

It would then need the multiple rates. Sweden is an example of where this is the case https://github.com/commerceguys/tax/blob/master/resources/tax_type/se_vat.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants