used amount_due
attribute
This commit is contained in:
parent
5b731c3373
commit
94e02f2594
@ -192,9 +192,7 @@ class Contact extends Model
|
|||||||
$collection = $this->isCustomer() ? 'invoices' : 'bills';
|
$collection = $this->isCustomer() ? 'invoices' : 'bills';
|
||||||
|
|
||||||
$this->$collection->whereNotIn('status', ['draft', 'cancelled', 'paid'])->each(function ($item) use (&$amount) {
|
$this->$collection->whereNotIn('status', ['draft', 'cancelled', 'paid'])->each(function ($item) use (&$amount) {
|
||||||
$unpaid = $item->amount - $item->paid;
|
$amount += $this->convertToDefault($item->amount_due, $item->currency_code, $item->currency_rate);
|
||||||
|
|
||||||
$amount += $this->convertToDefault($unpaid, $item->currency_code, $item->currency_rate);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $amount;
|
return $amount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user