Skip to content

Commit

Permalink
Update BillPayments.php
Browse files Browse the repository at this point in the history
Fix `grand_total` calculation. No $paid variable existed
  • Loading branch information
sausin committed Dec 20, 2018
1 parent c809e94 commit 4a67b52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Modals/BillPayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function create(Bill $bill)

$bill->grand_total = money($total, $currency->code)->getAmount();

if (!empty($paid)) {
$bill->grand_total = $bill->total - $paid;
if ($bill->paid > 0) {
$bill->grand_total = $bill->total - $bill->paid;
}

$html = view('modals.bills.payment', compact('bill', 'accounts', 'currencies', 'currency', 'payment_methods'))->render();
Expand Down

0 comments on commit 4a67b52

Please sign in to comment.