E-Invoice - Fix a problem reported by Eileen about Generate Proforma Invoice somehow can bypass filling up E-Invoice info

This commit is contained in:
Dillon Ngo
2025-07-19 14:41:50 +08:00
parent c64ebeddde
commit b67a85a95c
3 changed files with 62 additions and 8 deletions
@@ -151,7 +151,8 @@ class CreateProformaInvoiceTransactionProcessor
$payable_amount = $booking->transactions()->payments()->where(function ($query) {
return $query->where(function ($query) {
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString());
// return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString());
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->where('expires_on', '>=', Carbon::now());
})->orWhere(function ($query) {
return $query->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
});
@@ -164,7 +165,8 @@ class CreateProformaInvoiceTransactionProcessor
$paymentAmount = $booking->transactions()->payments()->where(function ($query) {
return $query->where(function ($query) {
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString());
// return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->whereDate('expires_on', '>=', Carbon::now())->where('expires_on', '>', Carbon::now()->toTimeString());
return $query->where('status', ApprovalStatus::PENDING_SUBMISSION)->where('expires_on', '>=', Carbon::now());
})->orWhere(function ($query) {
return $query->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
});