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

This commit is contained in:
Dillon Ngo
2025-08-01 11:25:04 +08:00
@@ -88,7 +88,28 @@ class GenerateCreditNotePdfV2Logic
if ($bookingCreatedDate->isAfter($eInvoiceStartDate)) {
$eInvoiceStarted = true;
}
// $eInvoiceStarted = false; //cief todo: 90 - for testing
if($eInvoiceStarted) {
$eInvoiceStarted = false; //reset to re-evaluate second time
$autoCountInvoiceId = '';
$autoCountEInvoiceValidationLink = '';
$metadata = $booking->attributesKVP()->where('key', KVPKey::AUTOCOUNT_DOCNO)->first();
if($metadata){
$autoCountInvoiceId = $metadata->value;
}
$metadata = $booking->attributesKVP()->where('key', KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK)->first();
if($metadata){
$autoCountEInvoiceValidationLink = $metadata->value;
}
Log::info('autoCountInvoiceId: ' . $autoCountInvoiceId);
Log::info('autoCountEInvoiceValidationLink: ' . $autoCountEInvoiceValidationLink);
if($autoCountInvoiceId && $autoCountEInvoiceValidationLink){
$eInvoiceStarted = true;
}
}
if($eInvoiceStarted)
{
@@ -103,7 +124,7 @@ class GenerateCreditNotePdfV2Logic
}
}
else{
Log::info('Based on booking created date, E-Credit Note not yet started');
Log::info('Based on booking created date, E-Credit Note not yet started. / Not Yet Ready.');
}
$pdf = LaravelMpdf::loadView($pdfTemplateName, ['transaction' => $transaction, 'booking' => $booking, 'supplier' => $supplier, 'date' => $date, 'brn' => $brn,]);