# |
@@ -870,6 +690,12 @@ export default {
this.editedIndex = this.invoiceList.indexOf(item);
this.editPayment = Object.assign({}, item);
this.editPayment.date = this.editPayment.date.slice(0, 10);
+ if (this.editPayment.paymentStatus == "NOT_PAID") {
+ for (let i = 0; i < this.editPayment.feeType.length; i++) {
+ this.editPayment.feeType[i].paidAmount = "0.00";
+ }
+ }
+ // console.log("this.editPayment", this.editPayment);
this.paymentFeeTypeData = this.editPayment.feeType;
this.paymentInvoiceDialog = true;
},
@@ -955,24 +781,25 @@ export default {
paymentStatus: this.invoiceData.paymentStatus,
paymentMethod: this.invoiceData.paymentMethod,
feeType: this.feeTypeData,
- totalAmount: this.feeType.amount,
- totalDiscount: this.feeType.discount,
+ totalAmount: this.feeType.amount.toString(),
+ totalDiscount: this.feeType.discount.toString(),
totalSubTotal: this.feeType.subTotal,
totalPaidAmount: this.feeType.paidAmount
};
- console.log("invoiceData", invoiceData);
- if (invoiceData.paymentStatus == "NOT_PAID") {
- delete invoiceData.totalPaidAmount;
- }
- if (this.feeType.subTotal == this.feeType.paidAmount) {
- invoiceData.paymentStatus = "FULLY_PAID";
- // console.log("FULLY_PAID");
- }
- if (invoiceData.totalPaidAmount) {
- if (this.feeType.subTotal != this.feeType.paidAmount) {
- invoiceData.paymentStatus = "PARTIALLY_PAID";
- // console.log("PARTIALLY_PAID");
+ // console.log("invoiceData", invoiceData);
+ if (this.feeType.paidAmount != "0.00") {
+ if (this.feeType.subTotal == this.feeType.paidAmount) {
+ invoiceData.paymentStatus = "FULLY_PAID";
+ console.log("FULLY_PAID");
+ }
+ if (invoiceData.totalPaidAmount) {
+ if (this.feeType.subTotal != this.feeType.paidAmount) {
+ invoiceData.paymentStatus = "PARTIALLY_PAID";
+ console.log("PARTIALLY_PAID");
+ }
}
+ } else if (this.feeType.paidAmount === "0.00") {
+ invoiceData.paymentStatus = "NOT_PAID";
}
http()
.post("/createInvoice", invoiceData)
@@ -1003,40 +830,6 @@ export default {
});
}
},
- // add() {
- // var updatePayment = {
- // invoiceId: this.editPayment._id,
- // // totalPaidAmount: this.editPayment.paidAmount
- // classId: this.editPayment.classNum,
- // students: this.editPayment.students,
- // date: this.editPayment.date,
- // paymentStatus: this.editPayment.paymentStatus,
- // paymentMethod: this.editPayment.paymentMethod,
- // feeType: this.feeTypeData,
- // totalAmount: this.feeType.amount,
- // totalDiscount: this.feeType.discount,
- // totalSubTotal: this.feeType.subTotal,
- // totalPaidAmount: this.feeType.paidAmount
- // };
- // http()
- // .put("/updateInvoice", updatePayment, {
- // headers: {
- // Authorization: "Bearer " + this.token
- // }
- // })
- // .then(response => {
- // this.getInvoiceList();
- // this.snackbar = true;
- // this.text = response.data.message;
- // this.color = "green";
- // this.paymentInvoiceDialog = false;
- // })
- // .catch(error => {
- // console.log("error", error);
- // this.snackbar = true;
- // this.color = "red";
- // });
- // },
clear() {
this.$refs.form.reset();
},
@@ -1066,9 +859,25 @@ export default {
this.feeTypeData.push({ feeTypeName: this.feeType.feeTypeName });
},
deleteSelectFee: function(index) {
+ console.log("---index----", index);
this.feeTypeData.splice(index, 1);
for (let i = 0; i < this.feeTypeData.length; i++) {
- this.feeType = this.feeTypeData[i];
+ console.log("this.feeTypeData[i]", this.feeTypeData[i]);
+ if (this.feeTypeData[i].paidAmount) {
+ this.feeType = {
+ amount: this.feeTypeData[i].amount,
+ discount: this.feeTypeData[i].discount,
+ subTotal: this.feeTypeData[i].subTotal,
+ paidAmount: this.feeTypeData[i].paidAmount
+ };
+ } else {
+ this.feeType = {
+ amount: this.feeTypeData[i].amount,
+ discount: this.feeTypeData[i].discount,
+ subTotal: this.feeTypeData[i].subTotal,
+ paidAmount: "0.00"
+ };
+ }
}
if (this.feeTypeData.length == 0) {
this.feeType = {
@@ -1145,16 +954,25 @@ export default {
};
for (let i = 0; i < this.feeTypeData.length; i++) {
// *********** AMOUNT ***********
-
- feeType.amount =
- Number(feeType.amount) + Number(this.feeTypeData[i].amount);
- // console.log("feeType.amount ", feeType.amount);
- this.feeType.amount = feeType.amount;
- this.feeType.subTotal = feeType.amount;
- this.feeTypeData[i].subTotal = this.feeTypeData[i].amount;
-
+ if (this.feeTypeData[i].amount) {
+ feeType.amount =
+ Number(feeType.amount) + Number(this.feeTypeData[i].amount);
+ this.feeType.amount = feeType.amount;
+ this.feeType.subTotal = feeType.amount;
+ this.feeTypeData[i].subTotal = this.feeTypeData[i].amount;
+ } else if (this.feeTypeData[0].amount == "") {
+ this.feeType.amount = "0.00";
+ this.feeTypeData[i].subTotal = "0.00";
+ this.feeType.subTotal = "0.00";
+ } else if (this.feeTypeData[i].amount == "") {
+ this.feeType.amount =
+ Number(feeType.amount) + Number(this.feeTypeData[i].amount);
+ this.feeTypeData[i].subTotal =
+ Number(feeType.amount) + Number(this.feeTypeData[i].amount);
+ this.feeType.subTotal =
+ Number(feeType.amount) + Number(this.feeTypeData[i].amount);
+ }
// *********** DISCOUNT ***********
-
if (this.feeTypeData[i].discount) {
feeType.discount =
Number(feeType.discount) + Number(this.feeTypeData[i].discount);
@@ -1163,20 +981,32 @@ export default {
this.feeTypeData[i].amount -
(this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100;
this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2);
+ } else if (this.feeTypeData[0].discount == "") {
+ this.feeType.discount = "0.00";
+ } else if (this.feeTypeData[i].discount == "") {
+ this.feeType.discount =
+ Number(feeType.discount) + Number(this.feeTypeData[i].discount);
}
// *********** SUBTOTAL ***********
-
- feeType.subTotal =
- Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal);
- this.feeType.subTotal = feeType.subTotal.toFixed(2);
+ if (this.feeTypeData[i].subTotal) {
+ feeType.subTotal =
+ Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal);
+ this.feeType.subTotal = feeType.subTotal.toFixed(2);
+ }
// *********** PAID-AMOUNT ***********
if (this.feeTypeData[i].paidAmount) {
feeType.paidAmount =
Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
+ } else if (this.feeTypeData[0].paidAmount == "") {
+ this.feeType.paidAmount = "0.00";
+ } else if (this.feeTypeData[i].paidAmount == "") {
+ this.feeType.paidAmount = feeType.paidAmount =
+ Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
}
+
// 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;
@@ -1189,21 +1019,16 @@ export default {
this.showPayMethods = true;
} else if (this.invoiceData.paymentStatus == "FULLY_PAID") {
this.showPayMethods = true;
- } else {
- this.showPayMethods = false;
- }
- },
- getPaymentMethod() {
- if (this.editData.paymentStatus == "PARTIALLY_PAID") {
- this.showPayMethods = true;
- } else if (this.editData.paymentStatus == "FULLY_PAID") {
- this.showPayMethods = true;
+ } else if (this.invoiceData.paymentStatus == "NOT_PAID") {
+ for (let i = 0; i < this.feeTypeData.length; i++) {
+ this.feeTypeData[i].paidAmount = "0.00";
+ this.feeType.paidAmount = "0.00";
+ }
} else {
this.showPayMethods = false;
}
},
selectAllStudent() {
- // console.log("this.studentId", this.invoiceData.studentId);
this.invoiceData.students = [];
if (this.invoiceData.studentId === "Select All") {
for (let i = 1; i < this.studentList.length; i++) {
@@ -1217,7 +1042,8 @@ export default {
}
},
displaySearch() {
- (this.show = false), (this.showSearch = true);
+ this.show = false;
+ this.showSearch = true;
},
closeSearch() {
this.showSearch = false;
diff --git a/src/pages/Account/paymentTemplate.vue b/src/pages/Account/paymentTemplate.vue
index 2eb2743..287b140 100644
--- a/src/pages/Account/paymentTemplate.vue
+++ b/src/pages/Account/paymentTemplate.vue
@@ -154,7 +154,7 @@
type="number"
>
-
+ |
feeType.subTotal) {
diff --git a/src/pages/Report/progressCardReport.vue b/src/pages/Report/progressCardReport.vue
index 86396d4..8320d27 100644
--- a/src/pages/Report/progressCardReport.vue
+++ b/src/pages/Report/progressCardReport.vue
@@ -58,7 +58,6 @@
item-text="name"
item-value="_id"
:rules="studentRules"
- @change="selectAllStudent()"
required
>
@@ -90,6 +89,7 @@
-->
+
@@ -344,7 +344,7 @@
|
- Average Mark
+ Average Mark
|
|
- GPA
+ GPA
|
{
@@ -571,15 +579,12 @@ export default {
i < this.filterData[data][item].studentsMarks.length;
i++
) {
- // console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i]
- // .marksScored)
totalMarks += this.filterData[data][item].studentsMarks[i]
.marksScored;
}
this.filterData[data][item].totalMarks = totalMarks;
console.log("totalMarks", totalMarks);
this.totalMarks = totalMarks;
- // console.log("this.filterData[data][item].grade", this.filterData[data][item].grade);
if (totalMarks > 90) {
this.filterData[data][item].grade = this.gradeAPlus;
} else if (totalMarks > 80 && totalMarks < 90) { |