master
Rustem 2025-05-24 09:38:23 +05:00
parent 0b87f9f290
commit 2d5e5a609f
1 changed files with 4 additions and 7 deletions

View File

@ -15,14 +15,11 @@ 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++) {
$percent = $percentRates[$i] ?? $lastKnownRate;
if ($percent !== null) { if ($percent !== null) {
$sumForDay = $deposit * ($percent / 100) * (1 + $ndsRate); $sumForDay = $deposit * ($percent / 100) * (1 + $ndsRate);
$total += $sumForDay; $total += $sumForDay;
} }
}
return round($total, 2); return round($total, 2);
} }