Improve late fee calculation

This commit is contained in:
Hillel Coren 2018-04-29 09:02:34 +03:00
parent fd2bed9351
commit 37775a1d33

View File

@ -1290,8 +1290,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 = [];