master
parent
0b87f9f290
commit
2d5e5a609f
|
|
@ -15,14 +15,11 @@ class DepositService
|
|||
$lastKnownRate = 15.20;
|
||||
$ndsRate = 0.12;
|
||||
$total = 0;
|
||||
|
||||
for ($i = 0; $i < $days; $i++) {
|
||||
$percent = $percentRates[$i] ?? $lastKnownRate;
|
||||
$percent = $percentRates[$days] ?? $lastKnownRate;
|
||||
if ($percent !== null) {
|
||||
$sumForDay = $deposit * ($percent / 100) * (1 + $ndsRate);
|
||||
$total += $sumForDay;
|
||||
}
|
||||
}
|
||||
|
||||
return round($total, 2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue