Added Ezypayment next payment check
This commit is contained in:
@@ -36,6 +36,11 @@ class Account extends Model
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
|
||||
public function invoices()
|
||||
{
|
||||
return $this->hasMany(Invoice::class);
|
||||
}
|
||||
|
||||
public function language()
|
||||
{
|
||||
return $this->belongsTo(Language::class);
|
||||
@@ -114,4 +119,16 @@ class Account extends Model
|
||||
return join("\n",$this->_address());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the due invoices on an account
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function dueInvoices()
|
||||
{
|
||||
return $this->invoices->filter(function($item) {
|
||||
return $item->active AND $item->due > 0;
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user