added has_no_bill and has_any_bill search parameters

This commit is contained in:
Fabian Zimmermann
2021-04-08 16:07:07 +02:00
parent 56b2fa69bc
commit 185e9b66d6
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) {

View File

@@ -476,6 +476,8 @@ return [
'has_any_category' => ['alias' => false, 'needs_context' => false,],
'has_no_budget' => ['alias' => false, 'needs_context' => false,],
'has_any_budget' => ['alias' => false, 'needs_context' => false,],
'has_no_bill' => ['alias' => false, 'needs_context' => false,],
'has_any_bill' => ['alias' => false, 'needs_context' => false,],
'has_no_tag' => ['alias' => false, 'needs_context' => false,],
'has_any_tag' => ['alias' => false, 'needs_context' => false,],
'notes_contain' => ['alias' => false, 'needs_context' => true,],

View File

@@ -338,6 +338,8 @@ function updateTriggerInput(selectList) {
case 'has_any_category':
case 'has_no_budget':
case 'has_any_budget':
case 'has_no_bill':
case 'has_any_bill':
case 'has_no_tag':
case 'no_notes':
case 'any_notes':

View File

@@ -298,6 +298,8 @@ return [
'search_modifier_has_any_category' => 'The transaction must have a (any) category',
'search_modifier_has_no_budget' => 'The transaction must have no budget',
'search_modifier_has_any_budget' => 'The transaction must have a (any) budget',
'search_modifier_has_no_bill' => 'The transaction must have no bill',
'search_modifier_has_any_bill' => 'The transaction must have a (any) bill',
'search_modifier_has_no_tag' => 'The transaction must have no tags',
'search_modifier_has_any_tag' => 'The transaction must have a (any) tag',
'search_modifier_notes_contain' => 'The transaction notes contain ":value"',
@@ -524,6 +526,10 @@ return [
'rule_trigger_has_no_budget' => 'Transaction has no budget',
'rule_trigger_has_any_budget_choice' => 'Has a (any) budget',
'rule_trigger_has_any_budget' => 'Transaction has a (any) budget',
'rule_trigger_has_no_bill_choice' => 'Has no bill',
'rule_trigger_has_no_bill' => 'Transaction has no bill',
'rule_trigger_has_any_bill_choice' => 'Has a (any) bill',
'rule_trigger_has_any_bill' => 'Transaction has a (any) bill',
'rule_trigger_has_no_tag_choice' => 'Has no tag(s)',
'rule_trigger_has_no_tag' => 'Transaction has no tag(s)',
'rule_trigger_has_any_tag_choice' => 'Has one or more (any) tags',