E-Invoice - Fix a problem reported by Mira some transfer E-Invoice cannot be generated

This commit is contained in:
Dillon Ngo
2026-02-05 15:54:22 +08:00
parent dcc71c504c
commit 154b3c6b9f
2 changed files with 3 additions and 4 deletions
@@ -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();
+1 -1
View File
@@ -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;
}