From beec9aef2465ae6c5653d6ca09ac5effa8cd3f87 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Fri, 26 Sep 2025 09:04:39 +0800 Subject: [PATCH] E-Invoice - Amendment for storage invoice to generate E-Invoice (partial completion) --- ...merPaymentsBillingWithStorageComponent.vue | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingWithStorageComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingWithStorageComponent.vue index 9e592546..0b06985a 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingWithStorageComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingWithStorageComponent.vue @@ -15,7 +15,7 @@

Invoice Date

-
{{ item.created_at }}
+
{{ invoiceDate }}
-
@@ -508,7 +508,35 @@ } } return false; - } + }, + invoiceDate() { + if (this.isEinvoiceApplicable) { + for (let i = 0; i < this.items.length; i++) { + const history = this.items[i].payment_history; + if (history && history.length > 0) { + for (let j = 0; j < history.length; j++) { + let dateStr = history[j].created_at; + const [day, month, year] = dateStr.split("-").map(Number); + const lastDay = new Date(year, month, 0).getDate(); + return `${lastDay}-${String(month).padStart(2, "0")}-${year}`; + } + } + } + } + else{ + for (let i = 0; i < this.items.length; i++) { + const history = this.items[i].payment_history; + if (history && history.length > 0) { + for (let j = 0; j < history.length; j++) { + return history[j].created_at;; + } + } + return this.items[i].created_at; + } + } + + return null; + }, }, methods: { getLatestComment(item) {