Merge branch 'dillon/90-e-invoice-e' into vapor/development

This commit is contained in:
Dillon Ngo
2026-02-05 11:06:38 +08:00
2 changed files with 6 additions and 3 deletions
@@ -162,7 +162,9 @@ 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->isAfter($eInvoiceRequestedDate) && $supplier->e_invoice === 1)
if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 60 && $supplier->e_invoice === 1) {
$eInvoice = true;
}
$kvp = $booking->attributesKVP()->where('key', KVPKey::BOOKING_EINVOICE_ELIGIBLE)->first();
+3 -2
View File
@@ -30,8 +30,9 @@ class BookingResource extends JsonResource
$eInvoiceStartDate = Carbon::parse(env('E_INVOICE_START_DATE', '2025-07-01 00:00:00'));
$bookingCreatedDate = Carbon::parse($this->created_at);
$eInvoiceRequestedDate = Carbon::parse($this->company->e_invoice_requested_at);
//cief todo: 90 - for testing
if ($bookingCreatedDate->isAfter($eInvoiceStartDate) && $bookingCreatedDate->isAfter($eInvoiceRequestedDate) && $this->company->e_invoice === 1) { //&& $bookingCreatedDate->diffInMinutes($eInvoiceRequestedDate) <= 480 cief todo: 90
// 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) {
$eInvoice = true;
}