solve duplicate statement transaction created upon import bank statement

This commit is contained in:
JiaSheng
2023-09-12 19:55:14 +08:00
parent b854fd5bdc
commit 88119b4f95
@@ -98,7 +98,7 @@ class ImportBankStatementLogic extends AbstractControllerLogic
$tellerId = $row[19];
$branchChannel = $row[20];
$transactionCode = $row[21];
$endBalance = $row[22];
$endBalance = ((float) str_replace(',', '', $row[22]));
$description2 = $row[25];
$description3 = $row[26];
$description4 = $row[27];
@@ -123,11 +123,10 @@ class ImportBankStatementLogic extends AbstractControllerLogic
$existingTransaction = StatementTransaction::where('transaction_ref', $transactionRef)
->where('posting_date', $postingDate)
->where('amount', $amount)
->where('transaction_description', $transactionDescription)
->where('teller_id', $tellerId)
->where('branch_channel', $branchChannel)
->where('transaction_code', $transactionCode)
->where('end_balance', $endBalance)
->whereRaw("CAST(REPLACE(end_balance,',','') AS DECIMAL(15,2)) = ?",[$endBalance])
->first();
if (!$existingTransaction) {