added filters to reports

This commit is contained in:
denisdulici
2018-11-01 16:58:31 +03:00
parent de7dd930ab
commit 6c95593082
15 changed files with 303 additions and 112 deletions

View File

@ -127,4 +127,31 @@ class Model extends Eloquent
{
return $query->where('reconciled', $value);
}
public function scopeAccount($query, $accounts)
{
if (empty($accounts)) {
return;
}
return $query->whereIn('account_id', (array) $accounts);
}
public function scopeCustomer($query, $customers)
{
if (empty($customers)) {
return;
}
return $query->whereIn('customer_id', (array) $customers);
}
public function scopeVendor($query, $vendors)
{
if (empty($vendors)) {
return;
}
return $query->whereIn('vendor_id', (array) $vendors);
}
}