juntagrico / juntagrico-billing

GNU Lesser General Public License v3.0
2 stars 3 forks source link

Vat #22

Closed samuel-iseli closed 1 year ago

samuel-iseli commented 1 year ago

Added VAT support

When generating bills and vat_percent is configured in settings, each new bill is initialized with the vat rate from settings. Only the subscription items on bills get an vat_amount.

The total VAT amount and number is shown for an invoice in the user web view and the PDF file, if the invoice contains VAT.

The bookings export has a new column for VAT amounts of subscription items.

Additional change:

samuel-iseli commented 1 year ago

@nixnuex do you know why the codeclimate checks are not running? Added support for VAT needed by ortoloco. Could you deploy after reviewing?

nixnuex commented 1 year ago

Thanks a lot! Migration runs through, but for a bill amount of 1000.00 I get:

Inklusive MWST von 2.5% (24.39)

is there some issue with the rounding? Is this a float vs decimal issue?

And: with the VAT amount in brackets without unit, it's kind of hard to interpret. How could we add a configurable unit everywhere?

samuel-iseli commented 1 year ago

The VAT calculation is correct as 1000 is the amount including VAT. The VAT amount is then x/(1+r)*r where r is the VAT rate, eg 0.025.

nixnuex commented 1 year ago

Ah sorry, so everything looks good. Do we need to bump the version somewhere? In the past, updates were not pulled correctly otherwise.

Regarding CodeClimate, @motu55 might be able to help.