1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Add transaction filters for payments and expenses

This commit is contained in:
David Bomba 2022-12-08 14:35:10 +11:00
parent 70db8052c0
commit ecb4ee7b8f
2 changed files with 28 additions and 0 deletions

View File

@ -92,6 +92,20 @@ class ExpenseFilters extends QueryFilters
return $this->builder;
}
/**
* Returns a list of expenses that can be matched to bank transactions
*/
public function match_transactions($value = '')
{
if($value == 'true')
{
return $this->builder->where('is_deleted',0)->whereNull('transaction_id');
}
return $this->builder;
}
/**
* Filters the list based on the status

View File

@ -81,6 +81,20 @@ class PaymentFilters extends QueryFilters
});
}
/**
* Returns a list of payments that can be matched to bank transactions
*/
public function match_transactions($value = '')
{
if($value == 'true')
{
return $this->builder->where('is_deleted',0)->whereNull('transaction_id');
}
return $this->builder;
}
/**
* Sorts the list based on $sort.
*