mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for wave imports - invoice date
This commit is contained in:
parent
77199fc697
commit
1668a3b684
@ -35,7 +35,8 @@ class InvoiceTransformer extends BaseTransformer {
|
|||||||
'company_id' => $this->maps['company']->id,
|
'company_id' => $this->maps['company']->id,
|
||||||
'client_id' => $this->getClient( $customer_name = $this->getString( $invoice_data, 'Customer' ), null ),
|
'client_id' => $this->getClient( $customer_name = $this->getString( $invoice_data, 'Customer' ), null ),
|
||||||
'number' => $invoice_number = $this->getString( $invoice_data, 'Invoice Number' ),
|
'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' ),
|
'currency_id' => $this->getCurrencyByCode( $invoice_data, 'Currency' ),
|
||||||
'status_id' => Invoice::STATUS_SENT,
|
'status_id' => Invoice::STATUS_SENT,
|
||||||
];
|
];
|
||||||
|
@ -1383,6 +1383,12 @@ class CompanyImport implements ShouldQueue
|
|||||||
$new_obj->save(['timestamps' => false]);
|
$new_obj->save(['timestamps' => false]);
|
||||||
$new_obj->number = $this->getNextRecurringExpenseNumber($new_obj);
|
$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{
|
else{
|
||||||
$new_obj = $class::withTrashed()->firstOrNew(
|
$new_obj = $class::withTrashed()->firstOrNew(
|
||||||
[$match_key => $obj->{$match_key}, 'company_id' => $this->company->id],
|
[$match_key => $obj->{$match_key}, 'company_id' => $this->company->id],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user