diff --git a/app/Import/Transformers/Waveaccounting/InvoiceTransformer.php b/app/Import/Transformers/Waveaccounting/InvoiceTransformer.php index 701e4c6ff6f5..4d83651a58bc 100644 --- a/app/Import/Transformers/Waveaccounting/InvoiceTransformer.php +++ b/app/Import/Transformers/Waveaccounting/InvoiceTransformer.php @@ -35,7 +35,8 @@ class InvoiceTransformer extends BaseTransformer { 'company_id' => $this->maps['company']->id, 'client_id' => $this->getClient( $customer_name = $this->getString( $invoice_data, 'Customer' ), null ), 'number' => $invoice_number = $this->getString( $invoice_data, 'Invoice Number' ), - 'date' => isset( $invoice_data['Invoice Date'] ) ? date( 'Y-m-d', strtotime( $invoice_data['Transaction Date'] ) ) : null, + 'date' => date( 'Y-m-d', strtotime( $invoice_data['Transaction Date'] ) ) ?: now()->format('Y-m-d'), //27-01-2022 + // 'date' => isset( $invoice_data['Invoice Date'] ) ? date( 'Y-m-d', strtotime( $invoice_data['Transaction Date'] ) ) : null, 'currency_id' => $this->getCurrencyByCode( $invoice_data, 'Currency' ), 'status_id' => Invoice::STATUS_SENT, ]; diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index bb3edf03b09f..5150740c8e84 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -1383,6 +1383,12 @@ class CompanyImport implements ShouldQueue $new_obj->save(['timestamps' => false]); $new_obj->number = $this->getNextRecurringExpenseNumber($new_obj); } + elseif($class == 'App\Models\CompanyLedger'){ + $new_obj = $class::firstOrNew( + [$match_key => $obj->{$match_key}, 'company_id' => $this->company->id], + $obj_array, + ); + } else{ $new_obj = $class::withTrashed()->firstOrNew( [$match_key => $obj->{$match_key}, 'company_id' => $this->company->id],