update debtors import

This commit is contained in:
omair saleh
2022-03-19 16:23:59 +08:00
parent c5b329dd41
commit 86f800fca2
@@ -23,7 +23,7 @@ class ImportsDebtor implements ToModel, WithHeadingRow, WithBatchInserts, WithVa
foreach ($matches[0] as $match){
$reference = $match;
$debtor = $row['code'];
$company = Company::where('reference', $reference)->first();
$company = Company::where('reference', $reference)->whereNull('debtor')->first();
if ($company) {
$company->debtor = $debtor;