diff --git a/src/pages/Account/invoice.vue b/src/pages/Account/invoice.vue index b818674..d9ce2e1 100644 --- a/src/pages/Account/invoice.vue +++ b/src/pages/Account/invoice.vue @@ -1137,10 +1137,10 @@ export default { getAmmountDetails(feeTyp) { let feeType = { - amount: "", - discount: "", - subTotal: "", - subParticularTotal: "", + amount: "0.00", + discount: "0.00", + subTotal: "0.00", + subParticularTotal: "0.00", paidAmount: "" }; for (let i = 0; i < this.feeTypeData.length; i++) { @@ -1155,18 +1155,18 @@ export default { // *********** DISCOUNT *********** - // if (this.feeTypeData[i].discount) { - feeType.discount = - Number(feeType.discount) + Number(this.feeTypeData[i].discount); - // console.log("feeType.discount", feeType.discount); - this.feeType.discount = feeType.discount; - console.log("feeType.discount", this.feeType.discount); + if (this.feeTypeData[i].discount) { + feeType.discount = + Number(feeType.discount) + Number(this.feeTypeData[i].discount); + // console.log("feeType.discount", feeType.discount); + this.feeType.discount = feeType.discount; + console.log("feeType.discount", this.feeType.discount); - feeType.subParticularTotal = - this.feeTypeData[i].amount - - (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100; - this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2); - // } + feeType.subParticularTotal = + this.feeTypeData[i].amount - + (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100; + this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2); + } // *********** SUBTOTAL *********** @@ -1175,11 +1175,11 @@ export default { this.feeType.subTotal = feeType.subTotal.toFixed(2); // *********** PAID-AMOUNT *********** - - feeType.paidAmount = - Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); - this.feeType.paidAmount = feeType.paidAmount.toFixed(2); - + if (this.feeTypeData[i].paidAmount) { + feeType.paidAmount = + Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); + this.feeType.paidAmount = feeType.paidAmount.toFixed(2); + } // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value. if (feeType.paidAmount > feeType.subTotal) { this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal;