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

get_sale_vat_charge raise NotImplementedError for Danish electronic services #9

Open
dtrinchet opened this issue Sep 8, 2015 · 8 comments

Comments

@dtrinchet
Copy link

As the doc says "Currently only supports determination of the VAT charge for telecommunications, broadcasting and electronic services in the EU." I expected to get the right vat rate doing:

import pyvat
import datetime
pyvat.get_sale_vat_charge(datetime.datetime.now(), pyvat.ItemType.generic_electronic_service, pyvat.Party("DK", True), pyvat.Party("DK", False))

but I'm getting:

NotImplementedError: cannot determine VAT charge for a sale of item ItemType.generic_electronic_service: 2 between pyvat.Party: country code = DK, is business = False and pyvat.Party: country code = DK, is business = True

shouldn't I get a valid VAT charge for this case?

@kdeldycke
Copy link
Contributor

Third argument of get_sale_vat_charge(date, item_type, buyer, seller) is the customer while the last is the seller. So your code is about a C2B transaction in Denmark. If you're looking for the VAT of a B2C transaction, reverse the two last parameters.

Source: https://github.com/iconfinder/pyvat/blob/v1.3.1/pyvat/__init__.py#L208-L211

But I agree, I found this convention quite unnatural. I propose to change get_sale_vat_chargesignature from (date, item_type, buyer, seller) to (date, item_type, seller, buyer).

@martinleblanc
Copy link
Member

I don't think this change will make it more natural. Wouldn't better error handling be the best way forward?

@dtrinchet
Copy link
Author

What i want is exactly what i wrote, figure out the vat rate charge for a transaction where the buyer is a business and the seller is an individual, in Denmark. Isn't that supported?

@martinleblanc
Copy link
Member

I'm pretty sure that is supported. We have that scenario quite often at Iconfinder.

@dtrinchet
Copy link
Author

Why i got the exception so? Could you please give it a try? Thanks. You can see the traceback in my first post.

@phidah
Copy link

phidah commented Sep 11, 2015

@martinleblanc yeah seemed like a bug when I tried

import pyvat
import datetime
pyvat.get_sale_vat_charge(datetime.datetime.now(), pyvat.ItemType.generic_electronic_service, pyvat.Party("DK", True), pyvat.Party("DK", False))

and it seemed to be unsupported.

We'd love to be able to use this in Saxo. @dtrinchet perhaps you can check if you can find the bug and do a PR for the Iconfinder guys?

@dtrinchet
Copy link
Author

Yeah, I will check @phidah if i can find the bug and do a PR :)

@dtrinchet
Copy link
Author

@phidah @martinleblanc @kdeldycke I have checked and this is not a bug, just it is not supported, although the docs says another thing :( It seems we should add some financial-economic data to support this, constants, etc I would like to be cautious around, I would rather someone in the team checks that.

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

4 participants