Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix broken query "created_at_before" and "updated_at_before"
James Cole0fea3a5a85a7
diff --git a/app/Helpers/Collector/Extensions/TimeCollection.php b/app/Helpers/Collector/Extensions/TimeCollection.phpindex bcedb18ae9..cca0a7855d 100644--- a/app/Helpers/Collector/Extensions/TimeCollection.php+++ b/app/Helpers/Collector/Extensions/TimeCollection.php@@ -555,7 +555,9 @@ trait TimeCollection*/public function setObjectBefore(Carbon $date, string $field): GroupCollectorInterface{- die('a');+ $afterStr = $date->format('Y-m-d 00:00:00');+ $this->query->where(sprintf('transaction_journals.%s', $field), '<=', $afterStr);+ return $this;}/**diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.phpindex 510d2b2c9f..b905734676 100644--- a/app/Support/Search/OperatorQuerySearch.php+++ b/app/Support/Search/OperatorQuerySearch.php@@ -1374,7 +1374,7 @@ class OperatorQuerySearch implements SearchInterfaceforeach ($range as $key => $value) {switch ($key) {default:- throw new FireflyException(sprintf('Cannot handle key "%s" in setDateAfterParams()', $key));+ throw new FireflyException(sprintf('Cannot handle key "%s" in setObjectDateBeforeParams()', $key));case 'exact':$this->collector->setObjectBefore($value, $field);$this->operators->push(['type' => sprintf('%s_before', $field), 'value' => $value->format('Y-m-d'),]);@@ -1413,7 +1413,7 @@ class OperatorQuerySearch implements SearchInterfaceforeach ($range as $key => $value) {switch ($key) {default:- throw new FireflyException(sprintf('Cannot handle key "%s" in setDateAfterParams()', $key));+ throw new FireflyException(sprintf('Cannot handle key "%s" in setObjectDateAfterParams()', $key));case 'exact':$this->collector->setObjectAfter($value, $field);$this->operators->push(['type' => sprintf('%s_after', $field), 'value' => $value->format('Y-m-d'),]);