added helper functions
This commit is contained in:
@ -133,7 +133,7 @@ class Contact extends Model
|
||||
{
|
||||
$amount = 0;
|
||||
|
||||
$collection = in_array($this->type, $this->getCustomerTypes()) ? 'invoices' : 'bills';
|
||||
$collection = $this->isCustomer() ? 'invoices' : 'bills';
|
||||
|
||||
$this->$collection->whereNotIn('status', ['draft', 'cancelled', 'paid'])->each(function ($item) use (&$amount) {
|
||||
$unpaid = $item->amount - $item->paid;
|
||||
|
Reference in New Issue
Block a user