negative prices vat should do correct calculation
negative prices like -0.1 should not be increased by vat, say 25%, to become -0.125 because this is not how it is billed, as it is currently implemented negative prices lead to even more negative "cost". utility companies instead do -0.1*(1-0.25) to result in -0.075 as price, they move to zero rather than further into negative. VAT must always increase never decrease :D
Wait, what? That is exactly how VAT is calculated. VAT on a negative amount makes it even more negative. 25% VAT on -100 SEK will be -125 SEK including VAT.
If you have ever experienced any utility company to reverse VAT on negative prices, please provide a link, because they're doing it wrong.
I sincerely ask you to prove your case here before implementing any changes to this integration.
The answer I got from my utility company; 25% VAT on -100 SEK will be -125 SEK including VAT.
As I see it, this request is wrong
This is wrong for NL. A kWh price of €-0.10 (ex VAT) makes the price including VAT €-0.121
Negative price VAT calculation is exactly the same as it is for positive price. The only exception could be that the price is negative almost all the time and thus consumer would be paid and they are not VAT-liable. In practice the VAT is calculated for the total of monthly (or whatever the billing period is) VATless sum and it is always positive (the other case is merely theoretical). It is possible that some utility companies exist that interpret the sales hour-by-hour but they are definitely the minority. In that case there could be an option for alternative calculation.
Thanks for the pr but I’m gonna keep the code as is. If your energy provider is handling this differently, please do the vat calculation in the template