From 1fedad96c9cceb76fd44fb2a187e199d5dcee96b Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Wed, 28 Jan 2026 13:56:56 +0800 Subject: [PATCH 1/2] E-Invoice - minor update on Sales Invoice Report Export data --- .../Modules/Exports/Services/ExportsSalesInvoiceReport.php | 2 +- .../Exports/Services/ExportsSalesInvoiceWithRefundReport.php | 2 +- app/Http/Resources/AutocountSalesInvoiceBookingResource.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php index 7257daec..54706de9 100644 --- a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php +++ b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceReport.php @@ -214,7 +214,7 @@ class ExportsSalesInvoiceReport implements FromQuery, WithHeadings, WithHeadingR $company->debtor, $invoiceTransaction ? $invoiceTransaction->bill_no : '', $booking->marking, - $category === 'Compensation Voucher' ? '1000-000' : '949-2000', + $category === 'Compensation Voucher' ? '920-0000' : '949-2000', 'PRODUCT NAME :', $voucher->code, '022', diff --git a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php index 9f134a04..6a7232d8 100644 --- a/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php +++ b/app/Classes/Modules/Exports/Services/ExportsSalesInvoiceWithRefundReport.php @@ -221,7 +221,7 @@ class ExportsSalesInvoiceWithRefundReport implements FromQuery, WithHeadings, Wi $company->debtor, $invoiceTransaction ? $invoiceTransaction->bill_no : '', $booking->marking, - $category === 'Compensation Voucher' ? '1000-000' : '949-2000', + $category === 'Compensation Voucher' ? '920-0000' : '949-2000', 'PRODUCT NAME :', $voucher->code, '022', diff --git a/app/Http/Resources/AutocountSalesInvoiceBookingResource.php b/app/Http/Resources/AutocountSalesInvoiceBookingResource.php index 8c134967..19cb2aab 100644 --- a/app/Http/Resources/AutocountSalesInvoiceBookingResource.php +++ b/app/Http/Resources/AutocountSalesInvoiceBookingResource.php @@ -140,7 +140,7 @@ class AutocountSalesInvoiceBookingResource extends JsonResource 'DebtorCode' => $company->debtor, 'Ref' => $invoiceTransaction ? $invoiceTransaction->bill_no : '', 'ShipInfo' => $this->marking, - 'AccNo' => $category === 'Compensation Voucher' ? '1000-000' : '949-2000', + 'AccNo' => $category === 'Compensation Voucher' ? '920-0000' : '949-2000', 'DetailDescription' => 'PRODUCT NAME :', 'FurtherDescription' => $voucher->code, 'Classification' => '022', From 154b3c6b9f64f06256dca8c4e71e3ccb37825187 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 5 Feb 2026 15:54:22 +0800 Subject: [PATCH 2/2] E-Invoice - Fix a problem reported by Mira some transfer E-Invoice cannot be generated --- .../Processors/CreateInvoiceTransactionV2Processor.php | 5 ++--- app/Http/Resources/BookingResource.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php b/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php index fd6cf765..027b4f76 100644 --- a/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php +++ b/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php @@ -162,9 +162,8 @@ class CreateInvoiceTransactionV2Processor $eInvoiceStartDate = Carbon::parse(env('E_INVOICE_START_DATE', '2025-07-01 00:00:00')); $bookingCreatedDate = Carbon::parse($booking->created_at); $eInvoiceRequestedDate = Carbon::parse($supplier->e_invoice_requested_at); - - // if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->isAfter($eInvoiceRequestedDate) && $supplier->e_invoice === 1) - if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 60 && $supplier->e_invoice === 1) { + + if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && ($bookingCreatedDate->isAfter($eInvoiceRequestedDate) || $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 60) && $supplier->e_invoice === 1) { $eInvoice = true; } $kvp = $booking->attributesKVP()->where('key', KVPKey::BOOKING_EINVOICE_ELIGIBLE)->first(); diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index ec6089f5..340ee964 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -32,7 +32,7 @@ class BookingResource extends JsonResource $eInvoiceRequestedDate = Carbon::parse($this->company->e_invoice_requested_at); // if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->isAfter($eInvoiceRequestedDate) && $this->company->e_invoice === 1) { - if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 60 && $this->company->e_invoice === 1) { + if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && ($bookingCreatedDate->isAfter($eInvoiceRequestedDate) || $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 60) && $this->company->e_invoice === 1) { $eInvoice = true; }