Commit de5a79260c4f0b056fcf6d7817ac9e3651e1562e
1 parent
da153da773
Exists in
master
and in
3 other branches
solve bugs empty field
Showing
1 changed file
with
20 additions
and
20 deletions
Show diff stats
src/pages/Account/invoice.vue
... | ... | @@ -1137,10 +1137,10 @@ export default { |
1137 | 1137 | |
1138 | 1138 | getAmmountDetails(feeTyp) { |
1139 | 1139 | let feeType = { |
1140 | - amount: "", | |
1141 | - discount: "", | |
1142 | - subTotal: "", | |
1143 | - subParticularTotal: "", | |
1140 | + amount: "0.00", | |
1141 | + discount: "0.00", | |
1142 | + subTotal: "0.00", | |
1143 | + subParticularTotal: "0.00", | |
1144 | 1144 | paidAmount: "" |
1145 | 1145 | }; |
1146 | 1146 | for (let i = 0; i < this.feeTypeData.length; i++) { |
... | ... | @@ -1155,18 +1155,18 @@ export default { |
1155 | 1155 | |
1156 | 1156 | // *********** DISCOUNT *********** |
1157 | 1157 | |
1158 | - // if (this.feeTypeData[i].discount) { | |
1159 | - feeType.discount = | |
1160 | - Number(feeType.discount) + Number(this.feeTypeData[i].discount); | |
1161 | - // console.log("feeType.discount", feeType.discount); | |
1162 | - this.feeType.discount = feeType.discount; | |
1163 | - console.log("feeType.discount", this.feeType.discount); | |
1158 | + if (this.feeTypeData[i].discount) { | |
1159 | + feeType.discount = | |
1160 | + Number(feeType.discount) + Number(this.feeTypeData[i].discount); | |
1161 | + // console.log("feeType.discount", feeType.discount); | |
1162 | + this.feeType.discount = feeType.discount; | |
1163 | + console.log("feeType.discount", this.feeType.discount); | |
1164 | 1164 | |
1165 | - feeType.subParticularTotal = | |
1166 | - this.feeTypeData[i].amount - | |
1167 | - (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100; | |
1168 | - this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2); | |
1169 | - // } | |
1165 | + feeType.subParticularTotal = | |
1166 | + this.feeTypeData[i].amount - | |
1167 | + (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100; | |
1168 | + this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2); | |
1169 | + } | |
1170 | 1170 | |
1171 | 1171 | // *********** SUBTOTAL *********** |
1172 | 1172 | |
... | ... | @@ -1175,11 +1175,11 @@ export default { |
1175 | 1175 | this.feeType.subTotal = feeType.subTotal.toFixed(2); |
1176 | 1176 | |
1177 | 1177 | // *********** PAID-AMOUNT *********** |
1178 | - | |
1179 | - feeType.paidAmount = | |
1180 | - Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); | |
1181 | - this.feeType.paidAmount = feeType.paidAmount.toFixed(2); | |
1182 | - | |
1178 | + if (this.feeTypeData[i].paidAmount) { | |
1179 | + feeType.paidAmount = | |
1180 | + Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); | |
1181 | + this.feeType.paidAmount = feeType.paidAmount.toFixed(2); | |
1182 | + } | |
1183 | 1183 | // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value. |
1184 | 1184 | if (feeType.paidAmount > feeType.subTotal) { |
1185 | 1185 | this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal; | ... | ... |