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