changes2
This commit is contained in:
+7
-2
@@ -127,7 +127,8 @@ def _scheduled_overpayment_for_month(req: SimulationRequest, month: int) -> tupl
|
||||
active = True
|
||||
if active:
|
||||
total += op.amount
|
||||
fee += op.amount * op.commission_percent / 100
|
||||
if op.commission_until_month is None or month <= op.commission_until_month:
|
||||
fee += op.amount * op.commission_percent / 100
|
||||
return total, fee
|
||||
|
||||
|
||||
@@ -144,9 +145,13 @@ def _overpayment_for_month(req: SimulationRequest, month: int, historical: dict[
|
||||
return scheduled_amount + hist_amount, scheduled_fee + hist_fee
|
||||
|
||||
|
||||
def _term_months(req: SimulationRequest) -> int:
|
||||
return int(req.term_months or req.years * 12)
|
||||
|
||||
|
||||
def _simulate_raw(req: SimulationRequest, include_overpayments: bool = True) -> list[ScheduleRow]:
|
||||
balance = float(req.principal)
|
||||
total_months = int(req.years * 12)
|
||||
total_months = _term_months(req)
|
||||
rows: list[ScheduleRow] = []
|
||||
fixed_payment: float | None = None
|
||||
month = 1
|
||||
|
||||
Reference in New Issue
Block a user