From 6ecfa8e031a4177ba60b90839e8b0786f560fc72 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Mon, 10 Oct 2022 17:43:32 +0800 Subject: [PATCH] fix invoice date --- app/Http/Resources/PackingListResource.php | 6 +-- app/Http/Resources/TransactionResource.php | 2 +- .../AdminPaymentsBillingComponent.vue | 54 +++++++++---------- .../DeleteShippingInvoiceFormComponent.vue | 4 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/app/Http/Resources/PackingListResource.php b/app/Http/Resources/PackingListResource.php index 7dcd6a68..462e4cdd 100644 --- a/app/Http/Resources/PackingListResource.php +++ b/app/Http/Resources/PackingListResource.php @@ -35,9 +35,9 @@ class PackingListResource extends JsonResource $this->mergeWhen($this->owner instanceof Order, [ 'order' => New OrderResource($this->owner) ]), - 'shippng_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first()), - 'suspended_invoice' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->first()), - // 'suspended_invoices' => TransactionResource::collection($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->get()), + 'shipping_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first()), + 'suspended_invoice' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->first()), + // 'suspended_invoices' => TransactionResource::collection($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->get()), ]; } } diff --git a/app/Http/Resources/TransactionResource.php b/app/Http/Resources/TransactionResource.php index f68fe54a..26d3ab86 100644 --- a/app/Http/Resources/TransactionResource.php +++ b/app/Http/Resources/TransactionResource.php @@ -53,7 +53,7 @@ class TransactionResource extends JsonResource ), 'remarks' => RemarkResource::collection($this->remarks), 'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:s:i'), - 'updated_at' => Carbon::parse($this->update_at)->format('d-m-Y') + 'updated_at' => Carbon::parse($this->updated_at)->format('d-m-Y') ]; } } diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index f2785e18..0d430ccd 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -20,8 +20,8 @@

Invoice Date

-
n/a
-
{{ item.shippng_transaction.updated_at }}
+
n/a
+
{{ item.shipping_transaction.updated_at }}
@@ -37,13 +37,13 @@

Amount

-
n/a
-
MYR {{ item.shippng_transaction.amount.toFixed(2) }}
+
n/a
+
MYR {{ item.shipping_transaction.amount.toFixed(2) }}
-
-
-
+
+
+