E-Invoice - Amendment for storage invoice to generate E-Invoice

This commit is contained in:
Dillon Ngo
2025-10-05 12:12:45 +08:00
parent ce6b47763c
commit 6a4570442a
@@ -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)) && invoiceDate">{{ invoiceDate }}</div>
<div v-if="(item.type === 1 || (item.type === 16 && item.status === 3)) && invoiceDate(item)">{{ invoiceDate(item) }}</div>
<div v-else>-</div>
</div>
<div class="col-auto">
@@ -509,34 +509,6 @@
}
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) {
@@ -587,7 +559,35 @@
paymentOutdated(){
this.showPaymentProceedModal = false;
this.showPaymentOutdatedModal = true;
}
},
invoiceDate(item) {
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 item.created_at;
},
}
}
</script>