mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
import bank record
This commit is contained in:
@@ -49,19 +49,24 @@ class ImportBankRecordController
|
||||
$credit = (float) $row['credit'];
|
||||
$systemReference = null;
|
||||
|
||||
$transaction = Transaction::whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
$transactions = Transaction::whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->where('type', TransactionType::PAYMENT)->WhereDate('created_at', $date->format('Y-m-d'))
|
||||
->where('amount', '>=', $credit)->where('amount', '<', ($credit + 0.01))
|
||||
->get();
|
||||
|
||||
if(count($transaction)) {
|
||||
if($transaction->owner instanceof Booking){
|
||||
$systemReference = $transaction->pluck('owner.marking')->flatten()->implode(', ');
|
||||
if(count($transactions)) {
|
||||
foreach ($transactions as $transaction){
|
||||
if($transaction->owner instanceof Booking){
|
||||
$systemReference[] = $transaction->pluck('owner.marking');
|
||||
}
|
||||
|
||||
if($transaction->owner instanceof Wallet){
|
||||
$systemReference[] = $transaction->bill_no;
|
||||
}
|
||||
}
|
||||
|
||||
if($transaction->owner instanceof Wallet){
|
||||
$systemReference = $transaction->bill_no;
|
||||
}
|
||||
$systemReference = implode(',', $systemReference);
|
||||
|
||||
}
|
||||
|
||||
$matches = $systemReference === $row['remarkreferences'] ? 'Yes' : 'No';
|
||||
|
||||
Reference in New Issue
Block a user