fix w kalkulacji last price

This commit is contained in:
Mateusz Gruszczyński
2026-07-14 13:43:27 +02:00
parent d2f0077e86
commit 6f46508da4
4 changed files with 73 additions and 16 deletions
+13
View File
@@ -349,3 +349,16 @@ def test_orlen_comparison_filters_to_one_fuel(tmp_path):
assert '4.5000' in html
assert '4.1000' in html
assert '>DIESEL</td>' not in html
def test_last_price_uses_only_non_deductible_vat():
from app.domain.costs import calculate_net_price_costs
result = calculate_net_price_costs(5.484, 23, 50)
assert round(float(result["invoice_gross"]), 4) == 6.7453
assert round(float(result["effective_cost"]), 4) == 6.1147
def test_last_price_zero_and_full_vat_deduction():
from app.domain.costs import calculate_net_price_costs
assert round(float(calculate_net_price_costs(10, 23, 0)["effective_cost"]), 2) == 12.30
assert round(float(calculate_net_price_costs(10, 23, 100)["effective_cost"]), 2) == 10.00