Adding not paid amount column for customers and vendors

This commit is contained in:
Batuhan Baş
2018-10-09 23:15:47 +03:00
parent 8315665daf
commit 6df3e35c09
4 changed files with 19 additions and 1 deletions

View File

@ -64,4 +64,11 @@ class Customer extends Model
{
$this->user_id = null;
}
public function getAmountAttribute()
{
$invoice_total = $this->invoices()->notPaid()->sum('amount');
return $invoice_total;
}
}