From 8bd3f54bb09da9ace0884226e8625839f39187f7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 29 Jun 2022 10:38:48 +1000 Subject: [PATCH] Minor fixes for company imports --- app/Jobs/Company/CompanyImport.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 3a8529262d43..1d411abf5a4e 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -1423,21 +1423,21 @@ class CompanyImport implements ShouldQueue $new_obj->company_id = $this->company->id; $new_obj->fill($obj_array); $new_obj->save(['timestamps' => false]); - $new_obj->number = $this->getNextInvoiceNumber($client = Client::find($obj_array['client_id']),$new_obj); + $new_obj->number = $this->getNextInvoiceNumber($client = Client::withTrashed()->find($obj_array['client_id']),$new_obj); } elseif($class == 'App\Models\Payment' && is_null($obj->{$match_key})){ $new_obj = new Payment(); $new_obj->company_id = $this->company->id; $new_obj->fill($obj_array); $new_obj->save(['timestamps' => false]); - $new_obj->number = $this->getNextPaymentNumber($client = Client::find($obj_array['client_id']), $new_obj); + $new_obj->number = $this->getNextPaymentNumber($client = Client::withTrashed()->find($obj_array['client_id']), $new_obj); } elseif($class == 'App\Models\Quote' && is_null($obj->{$match_key})){ $new_obj = new Quote(); $new_obj->company_id = $this->company->id; $new_obj->fill($obj_array); $new_obj->save(['timestamps' => false]); - $new_obj->number = $this->getNextQuoteNumber($client = Client::find($obj_array['client_id']), $new_obj); + $new_obj->number = $this->getNextQuoteNumber($client = Client::withTrashed()->find($obj_array['client_id']), $new_obj); } elseif($class == 'App\Models\ClientContact'){ $new_obj = new ClientContact();