Fix monthly price rounding for yearly subscriptions

This commit is contained in:
ellite 2023-11-25 10:29:39 +01:00
parent 6e5bbc46b1
commit 1aaf043d89
2 changed files with 5 additions and 9 deletions

View File

@ -32,8 +32,8 @@
return $price * $numberOfPaymentsPerMonth;
break;
case 4:
$numberOfPaymentsPerMonth = (0.083 / $frequency);
return $price * $numberOfPaymentsPerMonth;
$numberOfMonths = (12 * $frequency);
return $price / $numberOfMonths;
break;
}
}

View File

@ -16,13 +16,9 @@
return $price * $numberOfPaymentsPerMonth;
break;
case 4:
if ($frequency === 1) {
return $price / 12;
break;
}
$numberOfPaymentsPerMonth = (0.0833310 / $frequency);
return $price * $numberOfPaymentsPerMonth;
break;
$numberOfMonths = (12 * $frequency);
return $price / $numberOfMonths;
break;
}
}