E-Invoice - Amendment for storage invoice to generate E-Invoice (partial completion)

This commit is contained in:
Dillon Ngo
2025-09-26 09:04:39 +08:00
parent fcd6f2d6a8
commit beec9aef24
@@ -15,7 +15,7 @@
<div class="row padding-20 align-items-center">
<div class="col-auto">
<p class="no-margin fs-10 all-caps">Invoice Date</p>
<div v-if="item.type === 1 || (item.type === 16 && item.status === 3)">{{ item.created_at }}</div>
<div v-if="(item.type === 1 || (item.type === 16 && item.status === 3)) && invoiceDate">{{ invoiceDate }}</div>
<div v-else>-</div>
</div>
<div class="col-auto">
@@ -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) {