1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Updates for payment filters

This commit is contained in:
David Bomba 2022-12-16 10:39:21 +11:00
parent 7ca4e27059
commit 0399e7ce6d

View File

@ -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()->find($inputs['transactions'][$key]['payment_id']);
$p = Payment::withTrashed()->where('company_id', auth()->user()->company()->id)->where($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()->find($inputs['transactions'][$key]['expense_id']);
$e = Expense::withTrashed()->where('company_id', auth()->user()->company()->id)->where($inputs['transactions'][$key]['expense_id'])->first();
/*Ensure we don't relink an existing expense*/
if(!$e || is_numeric($e->transaction_id))