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

This commit is contained in:
Dillon Ngo
2025-12-02 16:59:12 +08:00
@@ -129,18 +129,16 @@ class CreateInvoiceTransactionV2Processor
// return;
}
if($generateEInvoiceRefund){
$purchaseOrder = $booking->transactions()
->where('type', TransactionType::PURCHASE_ORDER)
->complete()
->first();
if(!$purchaseOrder && $generateEInvoiceRefund){
$purchaseOrder = $booking->transactions()
->where('type', TransactionType::PURCHASE_ORDER)
->where('status', ApprovalStatus::PENDING_SUBMISSION)
->first();
}
else{
$purchaseOrder = $booking->transactions()
->where('type', TransactionType::PURCHASE_ORDER)
->complete()
->first();
}
$constants = SegmentConstant::where('reference', SegmentConstants::SERVICE_TYPE)->where('detail->id', $booking->service->id)->first();