Open dtrinchet opened 9 years ago
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_charge
signature from (date, item_type, buyer, seller)
to (date, item_type, seller, buyer)
.
I don't think this change will make it more natural. Wouldn't better error handling be the best way forward?
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?
I'm pretty sure that is supported. We have that scenario quite often at Iconfinder.
Why i got the exception so? Could you please give it a try? Thanks. You can see the traceback in my first post.
@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?
Yeah, I will check @phidah if i can find the bug and do a PR :)
@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.
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:
but I'm getting:
shouldn't I get a valid VAT charge for this case?