Improve late fee calculation

This commit is contained in:
Hillel Coren 2018-04-29 09:00:22 +03:00
parent aa6be32495
commit f64a2583b8

View File

@ -1285,8 +1285,8 @@ class InvoiceRepository extends BaseRepository
$data = $invoice->toArray();
$fee = $amount;
if ($invoice->balance > 0) {
$fee += round($invoice->balance * $percent / 100, 2);
if ($invoice->getRequestedAmount() > 0) {
$fee += round($invoice->getRequestedAmount() * $percent / 100, 2);
}
$item = [];