From 42b481ed7679ad645266ef587886999d919c1ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:16:16 +0300 Subject: [PATCH] account seeperformance filter issue --- app/Http/Controllers/Banking/Accounts.php | 7 ++++++- app/Listeners/Report/AddSearchString.php | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Banking/Accounts.php b/app/Http/Controllers/Banking/Accounts.php index 1d48ef5e3..03f3b4e75 100644 --- a/app/Http/Controllers/Banking/Accounts.php +++ b/app/Http/Controllers/Banking/Accounts.php @@ -12,6 +12,7 @@ use App\Models\Banking\Transaction; use App\Models\Banking\Transfer; use App\Utilities\Reports as Utility; use App\Models\Setting\Currency; +use Date; class Accounts extends Controller { @@ -244,7 +245,11 @@ class Accounts extends Controller public function seePerformance(Account $account) { - $data['account_id'] = $account->id; + $data = [ + 'year' => Date::now()->year, + 'basis' => 'accrual', + 'account_id' => $account->id, + ]; $report = Utility::getClassInstance('App\Reports\IncomeExpenseSummary'); diff --git a/app/Listeners/Report/AddSearchString.php b/app/Listeners/Report/AddSearchString.php index 1e655395e..bad9f0c85 100644 --- a/app/Listeners/Report/AddSearchString.php +++ b/app/Listeners/Report/AddSearchString.php @@ -40,7 +40,11 @@ class AddSearchString extends Listener } foreach ($old as $key => $value) { - $filters[] = $key . ':' . $value; + $filter = $key . ':' . $value; + + if (!in_array($filter, $filters)) { + $filters[] = $filter; + } } foreach ($request as $key => $value) {