mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-27 08:24:14 +00:00
E-Invoice - Amendment for storage invoice to generate E-Invoice
This commit is contained in:
+30
-30
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user