From 36a0d63069afe759280f0fab0972398e5b9ad89a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 16 Dec 2022 10:40:03 +1100 Subject: [PATCH] Updates for payment filters --- .../Requests/BankTransaction/MatchBankTransactionRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php b/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php index bdd2bf3df9f8..b687b0f84bb2 100644 --- a/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php +++ b/app/Http/Requests/BankTransaction/MatchBankTransactionRequest.php @@ -64,7 +64,7 @@ class MatchBankTransactionRequest extends Request if(array_key_exists('payment_id', $inputs['transactions'][$key]) && strlen($inputs['transactions'][$key]['payment_id']) >= 1){ $inputs['transactions'][$key]['payment_id'] = $this->decodePrimaryKey($inputs['transactions'][$key]['payment_id']); - $p = Payment::withTrashed()->where('company_id', auth()->user()->company()->id)->where($inputs['transactions'][$key]['payment_id'])->first(); + $p = Payment::withTrashed()->where('company_id', auth()->user()->company()->id)->where('id', $inputs['transactions'][$key]['payment_id'])->first(); /*Ensure we don't relink an existing payment*/ if(!$p || is_numeric($p->transaction_id)){ @@ -75,7 +75,7 @@ class MatchBankTransactionRequest extends Request if(array_key_exists('expense_id', $inputs['transactions'][$key]) && strlen($inputs['transactions'][$key]['expense_id']) >= 1){ $inputs['transactions'][$key]['expense_id'] = $this->decodePrimaryKey($inputs['transactions'][$key]['expense_id']); - $e = Expense::withTrashed()->where('company_id', auth()->user()->company()->id)->where($inputs['transactions'][$key]['expense_id'])->first(); + $e = Expense::withTrashed()->where('company_id', auth()->user()->company()->id)->where('id', $inputs['transactions'][$key]['expense_id'])->first(); /*Ensure we don't relink an existing expense*/ if(!$e || is_numeric($e->transaction_id))