mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-30 18:03:59 +00:00
import bank record
This commit is contained in:
@@ -39,24 +39,24 @@ class ImportsBankRecord implements ToModel, WithHeadingRow, WithBatchInserts, Wi
|
||||
'payments' => $transaction->pluck('owner.marking')
|
||||
]);
|
||||
|
||||
try {
|
||||
preg_match_all('/([0-9]{3,4}[a-zA-Z]{3,4})/', $row['desc2'], $matches);
|
||||
|
||||
foreach ($matches[0] as $match){
|
||||
$reference = $match;
|
||||
$debtor = $row['code'];
|
||||
$company = Company::where('reference', $reference)->whereNull('debtor')->first();
|
||||
|
||||
if ($company) {
|
||||
$company->debtor = $debtor;
|
||||
$company->update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (\Exception $exception){
|
||||
dd($exception);
|
||||
}
|
||||
// try {
|
||||
// preg_match_all('/([0-9]{3,4}[a-zA-Z]{3,4})/', $row['desc2'], $matches);
|
||||
//
|
||||
// foreach ($matches[0] as $match){
|
||||
// $reference = $match;
|
||||
// $debtor = $row['code'];
|
||||
// $company = Company::where('reference', $reference)->whereNull('debtor')->first();
|
||||
//
|
||||
// if ($company) {
|
||||
// $company->debtor = $debtor;
|
||||
// $company->update();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// } catch (\Exception $exception){
|
||||
// dd($exception);
|
||||
// }
|
||||
}
|
||||
|
||||
public function batchSize(): int
|
||||
|
||||
Reference in New Issue
Block a user