Jump to content

Price without VAT amount on the invoice is wrong if coupon in percentage


Recommended Posts

Posted

Hello,

 

Is there anyone else having strange numbers on the renewal invoice?

My case... I have a customer with two services (domain 15,86 with VAT and hosting 134,20 with VAT) and a discount coupon 15% on hosting only (-20,13 with VAT).

Total with VAT is 129,93 in this amount the VAT is 23,43.

Price without VAT is calculated wrong. It is not 99,24, but 129,93 - 23,43 = 106,5.

 

slika.png.a6c1c35111852de8abb9c42856cedd8c.png

Anyone else with this problem? What am I doing wrong?

 

Thank you for help.

 

Tomaz

 

Posted

I've found a bug in vendors/blesta/pricing/src/Type/ItemPrice.php line #158:

-return parent::total() - abs($this->taxAmount(null, TaxPrice::INCLUSIVE_CALCULATED));
+return parent::total() - ($this->taxAmount(null, TaxPrice::INCLUSIVE_CALCULATED));

If price is negative (with discount coupon), tax is negative and should not be absolute.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...