From 17622f4c93b393925ff008ba8ddb5950f07ea68d Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Wed, 28 Jan 2026 13:34:46 +0800 Subject: [PATCH] Fix an issue reported by Joanne on banking invoice cannot be downloaded --- app/Http/Resources/BookingResource.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Resources/BookingResource.php b/app/Http/Resources/BookingResource.php index e118f2e9..cdc46d71 100644 --- a/app/Http/Resources/BookingResource.php +++ b/app/Http/Resources/BookingResource.php @@ -66,6 +66,8 @@ class BookingResource extends JsonResource 'supplier_delivery_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->latest()->first()), 'proforma_invoice' => new DocumentResource($this->documents()->where('document_type', DocumentType::PROFORMA_INVOICE)->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::EXPIRED])->latest()->first()), 'ecommerce_purchase_order' => new DocumentResource($this->documents()->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->latest()->first()), + 'banking_invoice' => new DocumentResource($this->documents()->where('document_type', DocumentType::BANKING_INVOICE)->whereNotIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::EXPIRED])->orderByDesc('id')->first()), + 'delivery_order_banking' => new DocumentResource($this->documents()->where('document_type', DocumentType::DELIVER_ORDER_BANKING)->orderByDesc('id')->first()), ], 'order_reference_no' => $this->modelAttributes()->where('name', BookingAttributeNames::ORDER_REFERENCE_NO)->get()->map(function ($attr) { return [