mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Fix an export problem with Sales Invoice Report (with refund) + Import
This commit is contained in:
@@ -73,18 +73,7 @@ class ProcessSalesInvoiceReportV2CommandJob implements ShouldQueue
|
||||
'EInvoiceValidationLink' => $eInvoiceValidationLink,
|
||||
]);
|
||||
|
||||
// $booking = Booking::where('marking', $ref)->first();
|
||||
// if($booking){
|
||||
// if($docNo != "" && $docNo != "<<New>>"){
|
||||
// $this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_DOCNO_INVOICE, $docNo);
|
||||
// }
|
||||
// if($eInvoiceValidationLink){
|
||||
// $this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK, $eInvoiceValidationLink);
|
||||
// }
|
||||
// if($docDate){
|
||||
// $this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_DOCDATE_INVOICE, is_numeric($docDate) ? $this->convertDocDateToString($docDate) : $docDate);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
$transaction = Transaction::where('bill_no', $ref)->first();
|
||||
if($transaction){
|
||||
@@ -98,6 +87,20 @@ class ProcessSalesInvoiceReportV2CommandJob implements ShouldQueue
|
||||
$this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_DOCDATE_INVOICE, is_numeric($docDate) ? $this->convertDocDateToString($docDate) : $docDate);
|
||||
}
|
||||
}
|
||||
else{
|
||||
$booking = Booking::where('marking', $shipInfo)->first();
|
||||
if($booking){
|
||||
if($docNo != "" && $docNo != "<<New>>"){
|
||||
$this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_DOCNO_INVOICE, $docNo);
|
||||
}
|
||||
if($eInvoiceValidationLink){
|
||||
$this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK, $eInvoiceValidationLink);
|
||||
}
|
||||
if($docDate){
|
||||
$this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_DOCDATE_INVOICE, is_numeric($docDate) ? $this->convertDocDateToString($docDate) : $docDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
|
||||
@@ -100,6 +100,10 @@ class ExportsSalesInvoiceWithRefundReport implements FromQuery, WithHeadings, Wi
|
||||
$invoiceTransaction = $booking->transactions()->where('type', TransactionType::INVOICE)->complete()->first();
|
||||
// $invoiceTransaction = $booking->transactions()->where('type', TransactionType::INVOICE)->first();
|
||||
|
||||
if (!$invoiceTransaction) {
|
||||
Log::info('ExportsSalesInvoiceWithRefundReport booking NO invoice : ' . json_encode($booking));
|
||||
}
|
||||
|
||||
$currencyId = $booking->fix_currency_id;
|
||||
|
||||
$subtotal = 0;
|
||||
@@ -152,7 +156,7 @@ class ExportsSalesInvoiceWithRefundReport implements FromQuery, WithHeadings, Wi
|
||||
$firstItem ? '<<New>>' : '',
|
||||
$formattedDocumentDate,
|
||||
$company->debtor,
|
||||
$booking->marking,
|
||||
$invoiceTransaction ? $invoiceTransaction->bill_no : '',
|
||||
$booking->marking,
|
||||
'500-0000',
|
||||
'PRODUCT NAME :',
|
||||
@@ -189,7 +193,7 @@ class ExportsSalesInvoiceWithRefundReport implements FromQuery, WithHeadings, Wi
|
||||
'',
|
||||
$formattedDocumentDate,
|
||||
$company->debtor,
|
||||
$booking->marking,
|
||||
$invoiceTransaction ? $invoiceTransaction->bill_no : '',
|
||||
$booking->marking,
|
||||
'500-0000',
|
||||
'PRODUCT NAME :',
|
||||
@@ -236,7 +240,7 @@ class ExportsSalesInvoiceWithRefundReport implements FromQuery, WithHeadings, Wi
|
||||
'',
|
||||
$formattedDocumentDate,
|
||||
$company->debtor,
|
||||
$booking->marking,
|
||||
$invoiceTransaction ? $invoiceTransaction->bill_no : '',
|
||||
$booking->marking,
|
||||
'500-0000',
|
||||
'PRODUCT NAME :',
|
||||
@@ -257,7 +261,7 @@ class ExportsSalesInvoiceWithRefundReport implements FromQuery, WithHeadings, Wi
|
||||
'<<New>>',
|
||||
$formattedDocumentDate,
|
||||
$company->debtor,
|
||||
$booking->marking,
|
||||
$invoiceTransaction ? $invoiceTransaction->bill_no: '',
|
||||
$booking->marking,
|
||||
'500-0000',
|
||||
'PRODUCT NAME :',
|
||||
|
||||
Reference in New Issue
Block a user