close #129 Fixed: Invoice not marked automatically as paid, same modify Bill.

This commit is contained in:
Cüneyt Şentürk
2017-12-07 00:13:15 +03:00
parent 098ed4b26a
commit 7f40a5857f
7 changed files with 137 additions and 50 deletions

View File

@ -67,4 +67,15 @@ class InvoicePayment extends Model
{
$this->attributes['currency_rate'] = (double) $value;
}
/**
* Scope paid invoice.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePaid($query)
{
return $query->sum('amount');
}
}