first commit

This commit is contained in:
Mateusz Gruszczyński
2026-07-13 13:19:26 +02:00
commit bd562b3da6
50 changed files with 2221 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
from decimal import Decimal, ROUND_HALF_UP
def money(value):
return Decimal(str(value)).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
def calculate_costs(gross, vat_rate=23, vat_deduction_percent=50):
gross = Decimal(str(gross)); rate = Decimal(str(vat_rate))
deduction = Decimal(str(vat_deduction_percent)) / Decimal("100")
net = gross / (Decimal("1") + rate / Decimal("100")); vat = gross - net
deductible_vat = vat * deduction
return {"gross": money(gross), "net": money(net), "vat": money(vat),
"deductible_vat": money(deductible_vat), "final_cost": money(gross - deductible_vat)}