From 26751e10eec00ed732bfb5f2013c605ec8abb93c Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 19 Feb 2017 12:12:24 +0100 Subject: [PATCH] Expand modifiers --- app/Support/Search/Modifier.php | 3 +++ config/firefly.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Support/Search/Modifier.php b/app/Support/Search/Modifier.php index fe6bb2d851..3f1e514686 100644 --- a/app/Support/Search/Modifier.php +++ b/app/Support/Search/Modifier.php @@ -45,14 +45,17 @@ class Modifier default: throw new FireflyException(sprintf('Search modifier "%s" is not (yet) supported. Sorry!', $modifier['type'])); break; + case 'amount': case 'amount_is': $res = Modifier::amountCompare($transaction, $modifier['value'], 0); Log::debug(sprintf('Amount is %s? %s', $modifier['value'], var_export($res, true))); break; + case 'amount_min': case 'amount_less': $res = Modifier::amountCompare($transaction, $modifier['value'], 1); Log::debug(sprintf('Amount less than %s? %s', $modifier['value'], var_export($res, true))); break; + case 'amount_max': case 'amount_more': $res = Modifier::amountCompare($transaction, $modifier['value'], -1); Log::debug(sprintf('Amount more than %s? %s', $modifier['value'], var_export($res, true))); diff --git a/config/firefly.php b/config/firefly.php index 3d4d28d6d7..0172e2d6ea 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -209,7 +209,7 @@ return [ ], 'default_currency' => 'EUR', 'default_language' => 'en_US', - 'search_modifiers' => ['amount_is', 'amount_less', 'amount_more', 'source', 'destination', 'category', 'budget', 'bill', 'type', 'date', - 'date_before', 'date_after'], + 'search_modifiers' => ['amount_is', 'amount', 'amount_max', 'amount_min', 'amount_less', 'amount_more', 'source', 'destination', 'category', + 'budget', 'bill', 'type', 'date', 'date_before', 'date_after'], // tag notes has_attachments ];