E-Invoice - Update to Sales Invoice Report template ref column

This commit is contained in:
Dillon Ngo
2025-09-24 09:50:58 +08:00
parent b9bdf088f7
commit 1441cbcec9
2 changed files with 7 additions and 4 deletions
@@ -14,6 +14,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Models\Booking;
use App\Models\Transaction;
use Illuminate\Support\Facades\Log;
use PhpOffice\PhpSpreadsheet\Shared\Date;
@@ -73,7 +74,9 @@ class ProcessSalesInvoiceReportV2CommandJob implements ShouldQueue
'EInvoiceValidationLink' => $eInvoiceValidationLink,
]);
$booking = Booking::where('marking', $ref)->first();
// $booking = Booking::where('marking', $ref)->first();
$transaction = Transaction::where('bill_no', $ref)->first();
$booking = $transaction->owner;
if($booking){
if($docNo != "" && $docNo != "<<New>>"){
$this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_DOCNO_INVOICE, $docNo);
@@ -163,7 +163,7 @@ class ExportsSalesInvoiceReport implements FromQuery, WithHeadings, WithHeadingR
$firstItem ? '<<New>>' : '',
$formattedDocumentDate,
$company->debtor,
$booking->marking,
$invoiceTransaction->bill_no,
$booking->marking,
'500-0000',
'PRODUCT NAME :',
@@ -200,7 +200,7 @@ class ExportsSalesInvoiceReport implements FromQuery, WithHeadings, WithHeadingR
'',
$formattedDocumentDate,
$company->debtor,
$booking->marking,
$invoiceTransaction->bill_no,
$booking->marking,
'500-0000',
'PRODUCT NAME :',
@@ -246,7 +246,7 @@ class ExportsSalesInvoiceReport implements FromQuery, WithHeadings, WithHeadingR
'',
$formattedDocumentDate,
$company->debtor,
$booking->marking,
$invoiceTransaction->bill_no,
$booking->marking,
'500-0000',
'PRODUCT NAME :',