Merge pull request #4627 from devfaz/add_bill_nobill

added has_no_bill and has_any_bill search parameters
This commit is contained in:
James Cole
2021-04-10 12:01:43 +02:00
committed by GitHub
6 changed files with 36 additions and 0 deletions

View File

@@ -269,6 +269,19 @@ trait MetaCollection
return $this;
}
/**
* Limit results to transactions without a bill..
*
* @return GroupCollectorInterface
*/
public function withBill(): GroupCollectorInterface
{
$this->withBillInformation();
$this->query->whereNotNull('transaction_journals.bill_id');
return $this;
}
/**
* Will include bill name + ID, if any.
*

View File

@@ -520,6 +520,13 @@ interface GroupCollectorInterface
*/
public function withTagInformation(): GroupCollectorInterface;
/**
* Limit results to transactions without a bill..
*
* @return GroupCollectorInterface
*/
public function withBill(): GroupCollectorInterface;
/**
* Limit results to a transactions without a bill.
*

View File

@@ -476,6 +476,12 @@ class OperatorQuerySearch implements SearchInterface
//
// bill
//
case 'has_no_bill':
$this->collector->withoutBill();
break;
case 'has_any_bill':
$this->collector->withBill();
break;
case 'bill_is':
$result = $this->billRepository->searchBill($value, 25);
if ($result->count() > 0) {