Commit c765369af9d3fba09ecb5fd93969e107305a9b1d

Authored by Neeraj Sharma
1 parent a4fce59de4

solve bugs

src/pages/Account/editInvoice.vue
1 <template> 1 <template>
2 <v-app id="pages-dasboard"> 2 <v-app id="pages-dasboard">
3 <!-- ****** Edit multiple INVOICE ****** --> 3 <!-- ****** Edit multiple INVOICE ****** -->
4 4
5 <v-snackbar 5 <v-snackbar
6 :timeout="timeout" 6 :timeout="timeout"
7 :top="y === 'top'" 7 :top="y === 'top'"
8 :right="x === 'right'" 8 :right="x === 'right'"
9 :vertical="mode === 'vertical'" 9 :vertical="mode === 'vertical'"
10 v-model="snackbar" 10 v-model="snackbar"
11 color="success" 11 color="success"
12 >{{ text }}</v-snackbar> 12 >{{ text }}</v-snackbar>
13 <v-flex xs12 sm12> 13 <v-flex xs12 sm12>
14 <v-container fluid grid-list-md> 14 <v-container fluid grid-list-md>
15 <v-layout wrap> 15 <v-layout wrap>
16 <v-flex xs12 sm12 md5 class="mt-4"> 16 <v-flex xs12 sm12 md5 class="mt-4">
17 <v-card flat> 17 <v-card flat>
18 <v-toolbar dark class="card-styles" flat> 18 <v-toolbar dark class="card-styles" flat>
19 <v-spacer></v-spacer> 19 <v-spacer></v-spacer>
20 <v-toolbar-title> 20 <v-toolbar-title>
21 <h3>Invoice</h3> 21 <h3>Invoice</h3>
22 </v-toolbar-title> 22 </v-toolbar-title>
23 <v-spacer></v-spacer> 23 <v-spacer></v-spacer>
24 </v-toolbar> 24 </v-toolbar>
25 <v-form ref="form" v-model="valid" lazy-validation class="py-4"> 25 <v-form ref="form" v-model="valid" lazy-validation class="py-4">
26 <v-layout> 26 <v-layout>
27 <v-flex xs4 class="pt-4 subheading"> 27 <v-flex xs4 class="pt-4 subheading">
28 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 28 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
29 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 29 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
30 </v-flex> 30 </v-flex>
31 <v-flex xs6 class="ml-3"> 31 <v-flex xs6 class="ml-3">
32 <v-select 32 <v-select
33 :items="addclass" 33 :items="addclass"
34 label="Select Class" 34 label="Select Class"
35 v-model="editData.classId" 35 v-model="editData.classId"
36 item-text="classNum" 36 item-text="classNum"
37 item-value="_id" 37 item-value="_id"
38 @change="getAllStudents()" 38 @change="getAllStudents(editData.classId)"
39 ></v-select> 39 ></v-select>
40 </v-flex> 40 </v-flex>
41 </v-layout> 41 </v-layout>
42 <v-layout> 42 <v-layout>
43 <v-flex xs4 class="pt-4 subheading"> 43 <v-flex xs4 class="pt-4 subheading">
44 <label class="right hidden-xs-only hidden-sm-only">Select Student:</label> 44 <label class="right hidden-xs-only hidden-sm-only">Select Student:</label>
45 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Student:</label> 45 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Student:</label>
46 </v-flex> 46 </v-flex>
47 <v-flex xs6 class="ml-3"> 47 <v-flex xs6 class="ml-3">
48 <v-select 48 <v-select
49 :items="studentList" 49 :items="studentList"
50 label="Select Incharge"
51 v-model="editData.studentId" 50 v-model="editData.studentId"
51 :label="editData.studentId.name"
52 item-text="name" 52 item-text="name"
53 item-value="_id" 53 item-value="_id"
54 @change="getStudentId(editData.studentId)"
54 ></v-select> 55 ></v-select>
55 </v-flex> 56 </v-flex>
56 </v-layout> 57 </v-layout>
57 <v-layout> 58 <v-layout>
58 <v-flex xs4 class="pt-4 subheading"> 59 <v-flex xs4 class="pt-4 subheading">
59 <label class="right">Date:</label> 60 <label class="right">Date:</label>
60 </v-flex> 61 </v-flex>
61 <v-flex xs6 class="ml-3"> 62 <v-flex xs6 class="ml-3">
62 <v-menu 63 <v-menu
63 ref="menu1" 64 ref="menu1"
64 :close-on-content-click="false" 65 :close-on-content-click="false"
65 v-model="menu1" 66 v-model="menu1"
66 :nudge-right="40" 67 :nudge-right="40"
67 lazy 68 lazy
68 :return-value.sync="editData.date" 69 :return-value.sync="editData.date"
69 transition="scale-transition" 70 transition="scale-transition"
70 offset-y 71 offset-y
71 full-width 72 full-width
72 min-width="290px" 73 min-width="290px"
73 > 74 >
74 <v-text-field 75 <v-text-field
75 slot="activator" 76 slot="activator"
76 v-model="editData.date" 77 v-model="editData.date"
77 placeholder="Select date" 78 placeholder="Select date"
78 ></v-text-field> 79 ></v-text-field>
79 <v-date-picker 80 <v-date-picker
80 v-model="editData.date" 81 v-model="editData.date"
81 @input="$refs.menu1.save(editData.date)" 82 @input="$refs.menu1.save(editData.date)"
82 ></v-date-picker> 83 ></v-date-picker>
83 </v-menu> 84 </v-menu>
84 </v-flex> 85 </v-flex>
85 </v-layout> 86 </v-layout>
86 <v-layout> 87 <v-layout>
87 <v-flex xs4 class="pt-4 subheading"> 88 <v-flex xs4 class="pt-4 subheading">
88 <label class="right hidden-xs-only hidden-sm-only">Payment Status:</label> 89 <label class="right hidden-xs-only hidden-sm-only">Payment Status:</label>
89 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Payment:</label> 90 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Payment:</label>
90 </v-flex> 91 </v-flex>
91 <v-flex xs6 class="ml-3"> 92 <v-flex xs6 class="ml-3">
92 <v-select 93 <v-select
93 :items="paymentStatus" 94 :items="paymentStatus"
94 v-model="editData.paymentStatus" 95 v-model="editData.paymentStatus"
95 item-text="name" 96 item-text="name"
96 item-value="value" 97 item-value="value"
97 label="Select Payment Status" 98 label="Select Payment Status"
98 @change="getPayMethodList" 99 @change="getPayMethodList"
99 ></v-select> 100 ></v-select>
100 </v-flex> 101 </v-flex>
101 </v-layout> 102 </v-layout>
102 <v-layout v-show="showPayMethods"> 103 <v-layout v-show="showPayMethods">
103 <v-flex xs4 class="pt-4 subheading"> 104 <v-flex xs4 class="pt-4 subheading">
104 <label class="right">Payment Method:</label> 105 <label class="right">Payment Method:</label>
105 </v-flex> 106 </v-flex>
106 <v-flex xs6 class="ml-3"> 107 <v-flex xs6 class="ml-3">
107 <v-select 108 <v-select
108 :items="paymentMethods" 109 :items="paymentMethods"
109 v-model="editData.paymentMethod" 110 v-model="editData.paymentMethod"
110 label="Select Payment Method" 111 label="Select Payment Method"
111 ></v-select> 112 ></v-select>
112 </v-flex> 113 </v-flex>
113 </v-layout> 114 </v-layout>
114 <v-layout> 115 <v-layout>
115 <v-flex xs12 sm11> 116 <v-flex xs12 sm11>
116 <v-card-actions> 117 <v-card-actions>
117 <v-spacer></v-spacer> 118 <v-spacer></v-spacer>
118 <v-btn 119 <v-btn
119 @click="update(editData)" 120 @click="update(editData)"
120 round 121 round
121 dark 122 dark
122 :loading="loading" 123 :loading="loading"
123 class="add-button" 124 class="add-button"
124 >Update</v-btn> 125 >Update</v-btn>
125 </v-card-actions> 126 </v-card-actions>
126 </v-flex> 127 </v-flex>
127 </v-layout> 128 </v-layout>
128 </v-form> 129 </v-form>
129 </v-card> 130 </v-card>
130 </v-flex> 131 </v-flex>
131 <v-flex xs12 sm12 md7 class="mt-4"> 132 <v-flex xs12 sm12 md7 class="mt-4">
132 <v-card> 133 <v-card>
133 <v-toolbar dark class="card-styles" flat> 134 <v-toolbar dark class="card-styles" flat>
134 <v-spacer></v-spacer> 135 <v-spacer></v-spacer>
135 <v-toolbar-title> 136 <v-toolbar-title>
136 <h3>Fee Type List</h3> 137 <h3>Fee Type List</h3>
137 </v-toolbar-title> 138 </v-toolbar-title>
138 <v-spacer></v-spacer> 139 <v-spacer></v-spacer>
139 </v-toolbar> 140 </v-toolbar>
140 <v-layout wrap> 141 <v-layout wrap>
141 <v-flex xs12> 142 <v-flex xs12>
142 <v-layout wrap> 143 <v-layout wrap>
143 <v-flex xs12 sm2 class="mt-3"> 144 <v-flex xs12 sm2 class="mt-3">
144 <label class="right title hidden-sm-only hidden-xs-only">Fee Type:</label> 145 <label class="right title hidden-sm-only hidden-xs-only">Fee Type:</label>
145 <label 146 <label
146 class="left pl-2 title hidden-xl-only hidden-lg-only hidden-md-only" 147 class="left pl-2 title hidden-xl-only hidden-lg-only hidden-md-only"
147 >Fee Type:</label> 148 >Fee Type:</label>
148 </v-flex> 149 </v-flex>
149 <v-flex xs12 sm4> 150 <v-flex xs12 sm4>
150 <v-select 151 <v-select
151 :items="feeTypes" 152 :items="feeTypes"
152 v-model="feeType.feeTypeName" 153 v-model="feeType.feeTypeName"
153 item-text="feeType" 154 item-text="feeType"
154 item-value="feeType" 155 item-value="feeType"
155 label="Select Fee Type" 156 label="Select Fee Type"
156 class="px-2" 157 class="px-2"
157 ></v-select> 158 ></v-select>
158 </v-flex> 159 </v-flex>
159 <v-flex xs12 sm6> 160 <v-flex xs12 sm6>
160 <v-btn 161 <v-btn
161 dark 162 dark
162 class="right mt-3 hidden-sm-only hidden-xs-only" 163 class="right mt-3 hidden-sm-only hidden-xs-only"
163 color="open-dialog-button" 164 color="open-dialog-button"
164 @click="selectFeeType" 165 @click="selectFeeType"
165 >ADD</v-btn> 166 >ADD</v-btn>
166 <v-btn 167 <v-btn
167 dark 168 dark
168 class="mt-3 hidden-xl-only hidden-lg-only hidden-md-only" 169 class="mt-3 hidden-xl-only hidden-lg-only hidden-md-only"
169 color="open-dialog-button" 170 color="open-dialog-button"
170 @click="selectFeeType" 171 @click="selectFeeType"
171 >ADD</v-btn> 172 >ADD</v-btn>
172 </v-flex> 173 </v-flex>
173 </v-layout> 174 </v-layout>
174 </v-flex> 175 </v-flex>
175 </v-layout> 176 </v-layout>
176 <table class="feeTypeTable tableRsponsive"> 177 <table class="feeTypeTable tableRsponsive">
177 <tr class="info white--text"> 178 <tr class="info white--text">
178 <th>#</th> 179 <th>#</th>
179 <th>Fee Type</th> 180 <th>Fee Type</th>
180 <th>Amount</th> 181 <th>Amount</th>
181 <th>Discount(%)</th> 182 <th>Discount(%)</th>
182 <th>Subtotal</th> 183 <th>Subtotal</th>
183 <th>Paid Amount</th> 184 <th>Paid Amount</th>
184 <th>Action</th> 185 <th>Action</th>
185 </tr> 186 </tr>
186 <tr 187 <tr
187 v-for="(feeType, index) in editData.feeType" 188 v-for="(feeType, index) in editData.feeType"
188 :key="index" 189 :key="index"
189 v-on:keyup="getAmmountDetails(feeType,editData.feeType)" 190 v-on:keyup="getAmmountDetails(feeType,editData.feeType)"
190 > 191 >
191 <td style="width:40px">{{ index + 1 }}</td> 192 <td style="width:40px">{{ index + 1 }}</td>
192 <td style="width:120px">{{ feeType.feeTypeName }}</td> 193 <td style="width:120px">{{ feeType.feeTypeName }}</td>
193 <td> 194 <td>
194 <v-text-field 195 <v-text-field
195 placeholder="fill your Amount" 196 placeholder="fill your Amount"
196 v-model="feeType.amount" 197 v-model="feeType.amount"
197 type="number" 198 type="number"
198 ></v-text-field> 199 ></v-text-field>
199 </td> 200 </td>
200 <td> 201 <td>
201 <v-text-field 202 <v-text-field
202 placeholder="fill your Discount" 203 placeholder="fill your Discount"
203 v-model="feeType.discount" 204 v-model="feeType.discount"
204 type="number" 205 type="number"
205 ></v-text-field> 206 ></v-text-field>
206 </td> 207 </td>
207 <td>{{ feeType.subTotal }}</td> 208 <td>{{ feeType.subTotal }}</td>
208 <td v-if="editData.paymentStatus === 'NOT_PAID'"> 209 <td v-if="editData.paymentStatus === 'NOT_PAID'">
209 <v-text-field 210 <v-text-field
210 placeholder="fill your Paid Amount" 211 placeholder="fill your Paid Amount"
211 v-model="feeType.paidAmount" 212 v-model="feeType.paidAmount"
212 type="number" 213 type="number"
213 :disabled="disabled" 214 :disabled="disabled"
214 ></v-text-field> 215 ></v-text-field>
215 </td> 216 </td>
216 <td v-if="editData.paymentStatus != 'NOT_PAID'"> 217 <td v-if="editData.paymentStatus != 'NOT_PAID'">
217 <v-text-field 218 <v-text-field
218 placeholder="fill your Paid Amount" 219 placeholder="fill your Paid Amount"
219 v-model="feeType.paidAmount" 220 v-model="feeType.paidAmount"
220 type="number" 221 type="number"
221 ></v-text-field> 222 ></v-text-field>
222 </td> 223 </td>
223 <td> 224 <td>
224 <v-icon 225 <v-icon
225 color="error" 226 color="error"
226 @click="deleteSelectFee(feeType,editData.feeType,index)" 227 @click="deleteSelectFee(feeType,editData.feeType,index)"
227 >delete</v-icon> 228 >delete</v-icon>
228 </td> 229 </td>
229 </tr> 230 </tr>
230 <tfoot v-if="feeType.amount != 0.00"> 231 <tfoot v-if="feeType.amount != 0.00">
231 <tr> 232 <tr>
232 <td colspan="2">Total:</td> 233 <td colspan="2">Total:</td>
233 <td>{{ feeType.amount }}</td> 234 <td>{{ feeType.amount }}</td>
234 <td>{{ feeType.discount }}</td> 235 <td>{{ feeType.discount }}</td>
235 <td>{{ feeType.subTotal }}</td> 236 <td>{{ feeType.subTotal }}</td>
236 <td>{{ feeType.paidAmount }}</td> 237 <td>{{ feeType.paidAmount }}</td>
237 </tr> 238 </tr>
238 </tfoot> 239 </tfoot>
239 <tfoot v-else-if="feeType.amount == 0.00"> 240 <tfoot v-else-if="feeType.amount == 0.00">
240 <tr> 241 <tr>
241 <td colspan="2">Total:</td> 242 <td colspan="2">Total:</td>
242 <td>{{ editData.totalAmount }}</td> 243 <td>{{ editData.totalAmount }}</td>
243 <td>{{ editData.totalDiscount }}</td> 244 <td>{{ editData.totalDiscount }}</td>
244 <td>{{ editData.totalSubTotal }}</td> 245 <td>{{ editData.totalSubTotal }}</td>
245 <td>{{ editData.totalPaidAmount }}</td> 246 <td>{{ editData.totalPaidAmount }}</td>
246 </tr> 247 </tr>
247 </tfoot> 248 </tfoot>
248 </table> 249 </table>
249 </v-card> 250 </v-card>
250 </v-flex> 251 </v-flex>
251 </v-layout> 252 </v-layout>
252 </v-container> 253 </v-container>
253 </v-flex> 254 </v-flex>
254 <div class="loader" v-if="showLoader"> 255 <div class="loader" v-if="showLoader">
255 <v-progress-circular indeterminate color="white"></v-progress-circular> 256 <v-progress-circular indeterminate color="white"></v-progress-circular>
256 </div> 257 </div>
257 </v-app> 258 </v-app>
258 </template> 259 </template>
259 260
260 <script> 261 <script>
261 import http from "@/Services/http.js"; 262 import http from "@/Services/http.js";
262 import moment from "moment"; 263 import moment from "moment";
263 264
264 export default { 265 export default {
265 props: ["editData"], 266 props: ["editData"],
266 data: () => ({ 267 data: () => ({
267 snackbar: false, 268 snackbar: false,
268 showPayMethods: false, 269 showPayMethods: false,
269 y: "top", 270 y: "top",
270 x: "right", 271 x: "right",
271 mode: "", 272 mode: "",
272 timeout: 3000, 273 timeout: 3000,
273 text: "", 274 text: "",
274 showLoader: false, 275 showLoader: false,
275 loading: false, 276 loading: false,
276 date: null, 277 date: null,
277 search: "", 278 search: "",
278 // dialog: false, 279 // dialog: false,
279 // dialog1: false, 280 // dialog1: false,
280 valid: true, 281 valid: true,
281 validEdit: true, 282 validEdit: true,
282 // isActive: true, 283 // isActive: true,
283 // newActive: false, 284 // newActive: false,
284 showFeeType: false, 285 showFeeType: false,
285 disabled: true, 286 disabled: true,
286 details: [], 287 details: [],
287 feeTypes: [], 288 feeTypes: [],
288 menu1: false, 289 menu1: false,
289 // invoiceData: {}, 290 // invoiceData: {},
290 paymentMethods: ["Cash", "Cheque"], 291 paymentMethods: ["Cash", "Cheque"],
291 feeType: { 292 feeType: {
292 amount: "0.00", 293 amount: "0.00",
293 discount: "0.00", 294 discount: "0.00",
294 paidAmount: "0.00", 295 paidAmount: "0.00",
295 subTotal: "0.00", 296 subTotal: "0.00",
296 feeTypeName: "" 297 feeTypeName: ""
297 }, 298 },
298 feeTypeData: [], 299 feeTypeData: [],
299 pagination: { 300 pagination: {
300 rowsPerPage: 15 301 rowsPerPage: 15
301 }, 302 },
302 token: "", 303 token: "",
303 editedItem: {}, 304 editedItem: {},
304 invoiceParticularData: {}, 305 invoiceParticularData: {},
305 addclass: [], 306 addclass: [],
306 studentList: [], 307 studentList: [],
307 paymentStatus: [ 308 paymentStatus: [
308 { 309 {
309 name: "Not Paid", 310 name: "Not Paid",
310 value: "NOT_PAID" 311 value: "NOT_PAID"
311 }, 312 },
312 { 313 {
313 name: "Partially Paid", 314 name: "Partially Paid",
314 value: "PARTIALLY_PAID" 315 value: "PARTIALLY_PAID"
315 }, 316 },
316 { 317 {
317 name: "Fully Paid", 318 name: "Fully Paid",
318 value: "FULLY_PAID" 319 value: "FULLY_PAID"
319 } 320 }
320 ] 321 ],
322 editDataObj: {}
321 }), 323 }),
322 // watch: { 324 // watch: {
323 // menu1(val) { 325 // menu1(val) {
324 // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); 326 // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
325 // } 327 // }
326 // }, 328 // },
327 methods: { 329 methods: {
328 save(date) { 330 save(date) {
329 this.$refs.menu1.save(date); 331 this.$refs.menu1.save(date);
330 }, 332 },
331 dates: function(date) { 333 dates: function(date) {
332 return moment(date).format("MMMM DD, YYYY"); 334 return moment(date).format("MMMM DD, YYYY");
333 }, 335 },
334 update(editData) { 336 update(editData) {
335 // console.log("editData-----------", editData); 337 console.log("editData-----------", editData);
338 if (editData.classId._id) {
339 this.editDataObj.classNum = editData.classId._id;
340 }
341 if (editData.studentId._id) {
342 this.editDataObj.studentId = editData.studentId._id;
343 }
336 let feeTypeId = ""; 344 let feeTypeId = "";
337 for (let i = 0; i < this.feeTypes.length; i++) { 345 for (let i = 0; i < this.feeTypes.length; i++) {
338 if (this.feeTypes[i].feeType === this.feeType.feeTypeName) { 346 if (this.feeTypes[i].feeType === this.feeType.feeTypeName) {
339 feeTypeId = this.feeTypes[i]._id; 347 feeTypeId = this.feeTypes[i]._id;
340 } 348 }
341 } 349 }
342 // console.log(editData);
343 let editInvoiceData = { 350 let editInvoiceData = {
344 invoiceId: editData._id, 351 invoiceId: editData._id,
345 classId: editData.classNum, 352 classId: this.editDataObj.classNum,
346 studentId: editData.sectionId, 353 studentId: this.editDataObj.studentId,
347 date: editData.date, 354 date: editData.date,
348 paymentStatus: editData.paymentStatus, 355 paymentStatus: editData.paymentStatus,
349 paymentMethod: editData.paymentMethod, 356 paymentMethod: editData.paymentMethod,
350 feeType: editData.feeType, 357 feeType: editData.feeType,
351 totalAmount: this.feeType.amount, 358 totalAmount: this.feeType.amount,
352 totalDiscount: this.feeType.discount, 359 totalDiscount: this.feeType.discount,
353 totalSubTotal: this.feeType.subTotal, 360 totalSubTotal: this.feeType.subTotal,
354 totalPaidAmount: this.feeType.paidAmount 361 totalPaidAmount: this.feeType.paidAmount
355 }; 362 };
356 if (editInvoiceData.paymentStatus == "NOT_PAID") { 363 // console.log(editInvoiceData, editInvoiceData);
357 delete editInvoiceData.totalPaidAmount;
358 }
359 if (feeTypeId == "") { 364 if (feeTypeId == "") {
360 delete editInvoiceData.feeType[0].feeTypeId; 365 delete editInvoiceData.feeType[0].feeTypeId;
361 } 366 }
362 if (editInvoiceData.paymentStatus == "NOT_PAID") { 367 if (this.feeType.paidAmount != "0.00") {
363 delete editInvoiceData.paymentMethod; 368 if (this.feeType.subTotal == this.feeType.paidAmount) {
364 } 369 editInvoiceData.paymentStatus = "FULLY_PAID";
365 if (this.feeType.subTotal == this.feeType.paidAmount) { 370 console.log("FULLY_PAID");
366 editInvoiceData.paymentStatus = "FULLY_PAID";
367 // console.log("FULLY_PAID");
368 }
369 if (editInvoiceData.totalPaidAmount) {
370 if (this.feeType.subTotal != this.feeType.paidAmount) {
371 editInvoiceData.paymentStatus = "PARTIALLY_PAID";
372 // console.log("PARTIALLY_PAID");
373 } 371 }
372 if (editInvoiceData.totalPaidAmount) {
373 if (this.feeType.subTotal != this.feeType.paidAmount) {
374 editInvoiceData.paymentStatus = "PARTIALLY_PAID";
375 console.log("PARTIALLY_PAID");
376 }
377 }
378 } else if (this.feeType.paidAmount === "0.00") {
379 editInvoiceData.paymentStatus = "NOT_PAID";
374 } 380 }
381 console.log("editInvoiceData", editInvoiceData);
382
375 http() 383 http()
376 .put("/updateInvoice", editInvoiceData) 384 .put("/updateInvoice", editInvoiceData)
377 .then(response => { 385 .then(response => {
378 // this.getInvoiceList(); 386 // this.getInvoiceList();
379 this.snackbar = true; 387 this.snackbar = true;
380 this.text = "New Invoice added successfully"; 388 this.text = "Edit Invoice successfully";
381 this.loading = false; 389 this.loading = false;
390 color: "red";
382 this.$emit("update-editInvoice"); 391 this.$emit("update-editInvoice");
383 }) 392 })
384 .catch(error => { 393 .catch(error => {
385 console.log(error); 394 console.log(error);
386 if ((this.snackbar = true)) { 395 this.snackbar = true;
387 this.text = error.response.data.message; 396 this.text = error.response.data.message;
388 } 397 color: "red";
389 this.loading = false; 398 this.loading = false;
390 }); 399 });
391 }, 400 },
392 clear() { 401 clear() {
393 this.$refs.form.reset(); 402 this.$refs.form.reset();
394 }, 403 },
395 selectFeeType() { 404 selectFeeType() {
396 // console.log("clckkkkkkkkkkkkkkkkkk", this.feeType.feeTypeName);
397 this.showFeeType = true; 405 this.showFeeType = true;
398 this.editData.feeType.push({ feeTypeName: this.feeType.feeTypeName }); 406 this.editData.feeType.push({ feeTypeName: this.feeType.feeTypeName });
399 }, 407 },
400 deleteSelectFee: function(feeTyp, feeTypeList, index) { 408 deleteSelectFee: function(feeTyp, feeTypeList, index) {
401 this.editData.feeType.splice(index, 1); 409 this.editData.feeType.splice(index, 1);
402 this.getAmmountDetails(feeTyp, feeTypeList); 410 this.getAmmountDetails(feeTyp, feeTypeList);
403 if (this.feeTypeData.length == 0) { 411 if (this.feeTypeData.length == 0) {
404 this.feeType = { 412 this.feeType = {
405 amount: "0.00", 413 amount: "0.00",
406 discount: "0.00", 414 discount: "0.00",
407 paidAmount: "0.00", 415 paidAmount: "0.00",
408 subTotal: "0.00", 416 subTotal: "0.00",
409 feeTypeList: "" 417 feeTypeList: ""
410 }; 418 };
411 } 419 }
412 }, 420 },
413 getAllClasses() { 421 getAllClasses() {
414 http() 422 http()
415 .get("/getClassesList", { 423 .get("/getClassesList", {
416 headers: { Authorization: "Bearer " + this.token } 424 headers: { Authorization: "Bearer " + this.token }
417 }) 425 })
418 .then(response => { 426 .then(response => {
419 this.addclass = response.data.data; 427 this.addclass = response.data.data;
420 this.getAllStudents();
421 }) 428 })
422 .catch(error => { 429 .catch(error => {
423 // console.log("err====>", err); 430 // console.log("err====>", err);
424 this.showLoader = false; 431 this.showLoader = false;
425 if (error.response.status === 401) { 432 if (error.response.status === 401) {
426 this.$router.replace({ path: "/" }); 433 this.$router.replace({ path: "/" });
427 this.$store.dispatch("setToken", null); 434 this.$store.dispatch("setToken", null);
428 this.$store.dispatch("Id", null); 435 this.$store.dispatch("Id", null);
429 this.$store.dispatch("Role", null); 436 this.$store.dispatch("Role", null);
430 } 437 }
431 }); 438 });
432 }, 439 },
433 getAllStudents() { 440 getAllStudents(classId) {
441 // console.log("classId", classId);
442 this.editDataObj.classNum = classId;
443 this.editDataObj.studentId = "";
444 this.studentList = [];
445 this.showLoader = true;
434 http() 446 http()
435 .get("/getStudentsList", { 447 .get("/getStudentsList", {
436 params: { classId: this.editData.classNum }, 448 params: { classId: classId },
437 headers: { Authorization: "Bearer " + this.token } 449 headers: { Authorization: "Bearer " + this.token }
438 }) 450 })
439 .then(response => { 451 .then(response => {
440 this.studentList = response.data.data; 452 for (let i = 0; i < response.data.data.length; i++) {
453 this.studentList.push({
454 name: response.data.data[i].name,
455 _id: response.data.data[i]._id
456 });
457 }
458 this.showLoader = false;
441 }) 459 })
442 .catch(err => { 460 .catch(err => {
443 // console.log("err====>", err); 461 // console.log("err====>", err);
462 this.showLoader = false;
444 }); 463 });
445 }, 464 },
465 getStudentId(studentId) {
466 // console.log("studentId", studentId);
467 this.editDataObj.studentId = studentId;
468 },
446 getfeeType() { 469 getfeeType() {
447 http() 470 http()
448 .get("/getFeesList", { 471 .get("/getFeesList", {
449 headers: { Authorization: "Bearer " + this.token } 472 headers: { Authorization: "Bearer " + this.token }
450 }) 473 })
451 .then(response => { 474 .then(response => {
452 this.feeTypes = response.data.data; 475 this.feeTypes = response.data.data;
453 }) 476 })
454 .catch(err => { 477 .catch(err => {
455 // console.log("err====>", err); 478 // console.log("err====>", err);
456 }); 479 });
457 }, 480 },
458 getAmmountDetails(feeTyp, feeTypeList) { 481 getAmmountDetails(feeTyp, feeTypeList) {
459 this.feeTypeData = feeTypeList; 482 this.feeTypeData = feeTypeList;
460 let feeType = { 483 let feeType = {
461 amount: "", 484 amount: "",
462 discount: "", 485 discount: "",
463 subTotal: "", 486 subTotal: "",
464 subParticularTotal: "", 487 subParticularTotal: "",
465 paidAmount: "" 488 paidAmount: ""
466 }; 489 };
467 for (let i = 0; i < this.feeTypeData.length; i++) { 490 for (let i = 0; i < this.feeTypeData.length; i++) {
468 // *********** AMOUNT *********** 491 // *********** AMOUNT ***********
469 feeType.amount = 492 if (this.feeTypeData[i].amount) {
470 Number(feeType.amount) + Number(this.feeTypeData[i].amount); 493 feeType.amount =
471 console.log("feeType.amount ", feeType.amount); 494 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
472 this.feeType.amount = feeType.amount; 495 this.feeType.amount = feeType.amount;
473 this.feeType.subTotal = feeType.amount; 496 this.feeType.subTotal = feeType.amount;
474 this.feeTypeData[i].subTotal = this.feeTypeData[i].amount; 497 this.feeTypeData[i].subTotal = this.feeTypeData[i].amount;
498 } else if (this.feeTypeData[0].amount == "") {
499 this.feeType.amount = "0.00";
500 this.feeTypeData[i].subTotal = "0.00";
501 this.feeType.subTotal = "0.00";
502 } else if (this.feeTypeData[i].amount == "") {
503 this.feeType.amount =
504 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
505 this.feeTypeData[i].subTotal =
506 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
507 this.feeType.subTotal =
508 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
509 }
475 // *********** DISCOUNT *********** 510 // *********** DISCOUNT ***********
476 if (this.feeTypeData[i].discount) { 511 if (this.feeTypeData[i].discount) {
477 feeType.discount = 512 feeType.discount =
478 Number(feeType.discount) + Number(this.feeTypeData[i].discount); 513 Number(feeType.discount) + Number(this.feeTypeData[i].discount);
479 console.log("feeType.discount", feeType.discount);
480 this.feeType.discount = feeType.discount; 514 this.feeType.discount = feeType.discount;
481 feeType.subParticularTotal = 515 feeType.subParticularTotal =
482 this.feeTypeData[i].amount - 516 this.feeTypeData[i].amount -
483 (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100; 517 (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100;
484 console.log("feeType.subTotal", feeType.subTotal);
485 this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2); 518 this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2);
519 } else if (this.feeTypeData[0].discount == "") {
520 this.feeType.discount = "0.00";
521 } else if (this.feeTypeData[i].discount == "") {
522 this.feeType.discount =
523 Number(feeType.discount) + Number(this.feeTypeData[i].discount);
486 } 524 }
525
487 // *********** SUBTOTAL *********** 526 // *********** SUBTOTAL ***********
488 feeType.subTotal = 527 if (this.feeTypeData[i].subTotal) {
489 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal); 528 feeType.subTotal =
490 this.feeType.subTotal = feeType.subTotal.toFixed(2); 529 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal);
530 this.feeType.subTotal = feeType.subTotal.toFixed(2);
531 }
532
491 // *********** PAID-AMOUNT *********** 533 // *********** PAID-AMOUNT ***********
492 feeType.paidAmount = 534 if (this.feeTypeData[i].paidAmount) {
493 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); 535 feeType.paidAmount =
494 this.feeType.paidAmount = feeType.paidAmount.toFixed(2); 536 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
537 this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
538 } else if (this.feeTypeData[0].paidAmount == "") {
539 this.feeType.paidAmount = "0.00";
540 } else if (this.feeTypeData[i].paidAmount == "") {
541 this.feeType.paidAmount = feeType.paidAmount =
542 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
543 }
495 544
496 // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value. 545 // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value.
497 if (feeType.paidAmount > feeType.subTotal) { 546 if (feeType.paidAmount > feeType.subTotal) {
498 this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal; 547 this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal;
499 this.feeType.paidAmount = feeType.subTotal; 548 this.feeType.paidAmount = feeType.subTotal;
500 } 549 }
501 } 550 }
502 }, 551 },
503 getPayMethodList() { 552 getPayMethodList() {
504 if (this.editData.paymentStatus == "PARTIALLY_PAID") { 553 if (this.editData.paymentStatus == "PARTIALLY_PAID") {
505 this.showPayMethods = true; 554 this.showPayMethods = true;
506 } else if (this.editData.paymentStatus == "FULLY_PAID") { 555 } else if (this.editData.paymentStatus == "FULLY_PAID") {
507 this.showPayMethods = true; 556 this.showPayMethods = true;
557 } else if (this.editData.paymentStatus == "NOT_PAID") {
558 for (let i = 0; i < this.feeTypeData.length; i++) {
559 this.feeTypeData[i].paidAmount = "0.00";
560 this.feeType.paidAmount = "0.00";
561 }
508 } else { 562 } else {
509 this.showPayMethods = false; 563 this.showPayMethods = false;
510 } 564 }
511 } 565 }
512 }, 566 },
513 mounted() { 567 mounted() {
514 this.token = this.$store.state.token; 568 this.token = this.$store.state.token;
515 this.getAllClasses(); 569 this.getAllClasses();
516 this.getfeeType(); 570 this.getfeeType();
517 }, 571 },
518 created() { 572 created() {
519 this.$root.$on("app:search", search => { 573 this.$root.$on("app:search", search => {
520 this.search = search; 574 this.search = search;
521 }); 575 });
522 }, 576 },
523 beforeDestroy() { 577 beforeDestroy() {
524 // dont forget to remove the listener 578 // dont forget to remove the listener
525 this.$root.$off("app:search"); 579 this.$root.$off("app:search");
526 } 580 }
527 }; 581 };
528 </script> 582 </script>
529 583
530 584
531 <style scoped> 585 <style scoped>
532 .active { 586 .active {
533 background-color: gray; 587 background-color: gray;
534 color: white !important; 588 color: white !important;
535 } 589 }
536 .activebtn { 590 .activebtn {
537 color: black !important; 591 color: black !important;
538 } 592 }
539 table { 593 table {
540 border-collapse: collapse; 594 border-collapse: collapse;
541 border: 1px solid #e2e7eb; 595 border: 1px solid #e2e7eb;
542 } 596 }
543 597
544 th, 598 th,
545 td { 599 td {
546 border: 1px solid #e2e7eb; 600 border: 1px solid #e2e7eb;
src/pages/Account/invoice.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** Edit INVOICE ****** --> 3 <!-- ****** Edit INVOICE ****** -->
4 <v-dialog v-model="editInvoiceDialog"> 4 <v-dialog v-model="editInvoiceDialog">
5 <v-card flat class="text-xs-center white--text"> 5 <v-card flat class="text-xs-center white--text">
6 <v-layout> 6 <v-layout>
7 <v-flex xs12 class="card-styles pa-2"> 7 <v-flex xs12 class="card-styles pa-2">
8 <label class="title text-xs-center">Edit Invoice</label> 8 <label class="title text-xs-center">Edit Invoice</label>
9 <v-icon size="24" class="right white--text" @click="editInvoiceDialog = false">cancel</v-icon> 9 <v-icon size="24" class="right white--text" @click="editInvoiceDialog = false">cancel</v-icon>
10 </v-flex> 10 </v-flex>
11 </v-layout> 11 </v-layout>
12 <editInvoice :editData="editData" @update-editInvoice="updateDoneInvoice" /> 12 <editInvoice :editData="editData" @update-editInvoice="updateDoneInvoice" />
13 </v-card> 13 </v-card>
14 </v-dialog> 14 </v-dialog>
15 15
16 <!-- ****PAYMENT INVOICE DIALOG --> 16 <!-- ****PAYMENT INVOICE DIALOG -->
17 <v-dialog v-model="paymentInvoiceDialog"> 17 <v-dialog v-model="paymentInvoiceDialog">
18 <v-card flat class="text-xs-center white--text"> 18 <v-card flat class="text-xs-center white--text">
19 <v-layout> 19 <v-layout>
20 <v-flex xs12 class="card-styles pa-2"> 20 <v-flex xs12 class="card-styles pa-2">
21 <label class="title text-xs-center">Payment Template</label> 21 <label class="title text-xs-center">Payment Template</label>
22 <v-icon size="24" class="right white--text" @click="paymentInvoiceDialog = false">cancel</v-icon> 22 <v-icon size="24" class="right white--text" @click="paymentInvoiceDialog = false">cancel</v-icon>
23 </v-flex> 23 </v-flex>
24 </v-layout> 24 </v-layout>
25 <!-- <v-flex xs12 sm12>
26 <v-container fluid grid-list-md>
27 <v-layout wrap>
28 <v-flex xs12 sm12 md4>
29 <v-card flat>
30 <v-toolbar dark class="card-styles" flat>
31 <v-spacer></v-spacer>
32 <h3>Profile</h3>
33 <v-spacer></v-spacer>
34 </v-toolbar>
35 <v-card-text>
36 <v-container>
37 <v-layout wrap>
38 <v-flex xs12>
39 <v-layout>
40 <v-flex
41 xs12
42 class="text-xs-center text-sm-center text-md-center text-lg-center"
43 >
44 <v-avatar size="80px">
45 <img src="/static/icon/user.png" v-if="!editPayment.profilePicUrl" />
46 <img
47 :src="editPayment.profilePicUrl"
48 v-else-if="editPayment.profilePicUrl"
49 />
50 </v-avatar>
51 </v-flex>
52 </v-layout>
53 <v-layout>
54 <v-flex xs12 sm12>
55 <h3 class="text-xs-center">
56 <b>{{ editPayment.studentId.name }}</b>
57 </h3>
58 <p class="text-xs-center grey--text">Student</p>
59 </v-flex>
60 </v-layout>
61 <v-layout style="border: 1px solid lightgrey;">
62 <v-flex xs6 sm6 class="pa-0">
63 <h4 class="right">
64 <b>Roll No :</b>
65 </h4>
66 </v-flex>
67 <v-flex sm6 xs6 class="pa-0">
68 <h4>{{ editPayment.studentId.rollNo }}</h4>
69 </v-flex>
70 </v-layout>
71 <v-layout style="border: 1px solid lightgrey;">
72 <v-flex xs6 sm6 class="pa-0">
73 <h4 class="right">
74 <b>Class :</b>
75 </h4>
76 </v-flex>
77 <v-flex sm6 xs6 class="pa-0">
78 <h4>{{ editPayment.classId.classNum }}</h4>
79 </v-flex>
80 </v-layout>
81 </v-flex>
82 </v-layout>
83 </v-container>
84 </v-card-text>
85 </v-card>
86 <v-flex>
87 <v-card>
88 <v-flex xs12 sm12 md12 style="padding-top: 1%;">
89 <v-card flat>
90 <v-toolbar dark class="card-styles" flat>
91 <v-spacer></v-spacer>
92 <h3>Invoice</h3>
93 <v-spacer></v-spacer>
94 </v-toolbar>
95 </v-card>
96 <v-layout>
97 <v-flex xs12>
98 <v-layout>
99 <v-flex xs4 class="pt-4 subheading">
100 <label class="right">Payment Method:</label>
101 </v-flex>
102 <v-flex xs6 class="ml-3">
103 <v-select
104 :items="paymentMethods"
105 v-model="editPayment.paymentMethod"
106 label="Select Payment Method"
107 required
108 ></v-select>
109 </v-flex>
110 </v-layout>
111 <v-card-actions>
112 <v-spacer class="hidden-xs-only"></v-spacer>
113 <v-btn
114 color="open-dialog-button"
115 dark
116 class="right mt-3"
117 @click="add"
118 >Add Payment</v-btn>
119 </v-card-actions>
120 </v-flex>
121 </v-layout>
122 </v-flex>
123 </v-card>
124 </v-flex>
125 </v-flex>
126 <v-flex xs12 sm12 md8>
127 <v-card>
128 <v-toolbar dark class="card-styles" flat>
129 <v-spacer></v-spacer>
130 <h3>Fee Type List</h3>
131 <v-spacer></v-spacer>
132 </v-toolbar>
133 <table class="feeTypeTable tableRsponsive">
134 <tr class="info white--text">
135 <th>#</th>
136 <th>Fee Type</th>
137 <th>Amount</th>
138 <th>Discount(%)</th>
139 <th>Subtotal</th>
140 <th>Paid Amount</th>
141 <th>Action</th>
142 </tr>
143 <tr
144 v-for="(feeType,index) in paymentFeeTypeData"
145 :key="index"
146 v-on:keyup="getAmmountDetails(feeType)"
147 >
148 <td style="width:40px" class="tdFeeType">{{index + 1}}</td>
149 <td style="width:120px" class="tdFeeType" disabled>{{ feeType.feeTypeName }}</td>
150 <td class="tdFeeType" style="width:120px" disabled>{{feeType.amount}}</td>
151 <td class="tdFeeType">
152 <v-text-field
153 placeholder="fill your Discount"
154 v-model="feeType.discount"
155 type="number"
156 ></v-text-field>
157 </td>
158 <td class="tdFeeType" disabled>{{ feeType.subTotal }}</td>
159 <td class="tdFeeType" v-if="invoiceData.paymentStatus === 'NOT_PAID'">
160 <v-text-field
161 placeholder="fill your Paid Amount"
162 v-model="feeType.paidAmount"
163 type="number"
164 ></v-text-field>
165 </td>
166 <td class="tdFeeType" v-if="invoiceData.paymentStatus == ''">
167 <v-text-field
168 placeholder="fill your Paid Amount"
169 v-model="feeType.paidAmount"
170 type="number"
171 ></v-text-field>
172 </td>
173 <td
174 class="tdFeeType"
175 v-if="invoiceData.paymentStatus != 'NOT_PAID' && invoiceData.paymentStatus != ''"
176 >
177 <v-text-field
178 placeholder="fill your Paid Amount"
179 v-model="feeType.paidAmount"
180 type="number"
181 ></v-text-field>
182 </td>
183 <td class="tdFeeType">
184 <v-icon color="error" @click="deleteSelectFee(index)">delete</v-icon>
185 </td>
186 </tr>
187 <tfoot>
188 <tr>
189 <td colspan="2" class="tdFeeType">Total:</td>
190 <td class="tdFeeType">{{ feeType.amount }}</td>
191 <td class="tdFeeType">{{ feeType.discount }}</td>
192 <td class="tdFeeType">{{ feeType.subTotal }}</td>
193 <td class="tdFeeType">{{ feeType.paidAmount }}</td>
194 <td class="tdFeeType">
195 <v-icon color="error" @click="deleteSelectFee(index)">delete</v-icon>
196 </td>
197 </tr>
198 </tfoot>
199 </table>
200 </v-card>
201 </v-flex>
202 </v-layout>
203 </v-container>
204 </v-flex>-->
205 <paymentTemplate :editPayment="editPayment" @update-Payment="updatePayment" /> 25 <paymentTemplate :editPayment="editPayment" @update-Payment="updatePayment" />
206 </v-card> 26 </v-card>
207 </v-dialog> 27 </v-dialog>
208 28
209 <!-- ****** PROFILE VIEW SECTION DATA ****** --> 29 <!-- ****** PROFILE VIEW SECTION DATA ****** -->
30
210 <v-dialog v-model="dialog1" max-width="800px"> 31 <v-dialog v-model="dialog1" max-width="800px">
211 <v-card flat class="text-xs-center white--text"> 32 <v-card flat class="text-xs-center white--text">
212 <v-layout> 33 <v-layout>
213 <v-flex xs12 class="card-style pa-2"> 34 <v-flex xs12 class="card-style pa-2">
214 <label class="title text-xs-center">View Payments</label> 35 <label class="title text-xs-center">View Payments</label>
215 <v-icon size="24" class="right" color="white" @click="dialog1 = false">cancel</v-icon> 36 <v-icon size="24" class="right" color="white" @click="dialog1 = false">cancel</v-icon>
216 </v-flex> 37 </v-flex>
217 </v-layout> 38 </v-layout>
218 <!-- <p>{{editedItem}}</p> -->
219 <table class="feeTypeTable tableRsponsive"> 39 <table class="feeTypeTable tableRsponsive">
220 <tr style="color: black"> 40 <tr style="color: black">
221 <th>#</th> 41 <th>#</th>
222 <th>Date</th> 42 <th>Date</th>
223 <th>Paid By</th> 43 <th>Paid By</th>
224 <th>Payment Amount</th> 44 <th>Payment Amount</th>
225 <th>Weaver</th> 45 <th>Weaver</th>
226 <th>Action</th> 46 <th>Action</th>
227 </tr> 47 </tr>
228 <tr v-if="editedItem.paymentStatus !== 'NOT_PAID'"> 48 <tr v-if="editedItem.paymentStatus !== 'NOT_PAID'">
229 <td style="width:40px ; color:black" class="tdFeeType">1</td> 49 <td style="width:40px ; color:black" class="tdFeeType">1</td>
230 <td style="width:120px; color:black" class="tdFeeType">{{dates( editedItem.date) }}</td> 50 <td style="width:120px; color:black" class="tdFeeType">{{dates( editedItem.date) }}</td>
231 <td style="width:120px; color:black" class="tdFeeType">{{ editedItem.paymentMethod }}</td> 51 <td style="width:120px; color:black" class="tdFeeType">{{ editedItem.paymentMethod }}</td>
232 <td style="width:120px; color:black" class="tdFeeType">{{ editedItem.totalPaidAmount }}</td> 52 <td style="width:120px; color:black" class="tdFeeType">{{ editedItem.totalPaidAmount }}</td>
233 <td style="width:120px; color:black" class="tdFeeType">{{ editedItem.totalDiscount}}</td> 53 <td style="width:120px; color:black" class="tdFeeType">{{ editedItem.totalDiscount}}</td>
234 <td class="text-xs-center td td-row"> 54 <td class="text-xs-center td td-row">
235 <router-link 55 <router-link
236 :to="{ name:'View Payment Invoice',params: { viewPaymentInvoiceId:editedItem._id } }" 56 :to="{ name:'View Payment Invoice',params: { viewPaymentInvoiceId:editedItem._id } }"
237 > 57 >
238 <v-tooltip top> 58 <v-tooltip top>
239 <img 59 <img
240 slot="activator" 60 slot="activator"
241 style="cursor:pointer; width:25px; height:25px; " 61 style="cursor:pointer; width:25px; height:25px; "
242 class="mr-3" 62 class="mr-3"
243 src="/static/icon/view.png" 63 src="/static/icon/view.png"
244 /> 64 />
245 <span>View</span> 65 <span>View</span>
246 </v-tooltip> 66 </v-tooltip>
247 </router-link> 67 </router-link>
248 <v-tooltip top> 68 <v-tooltip top>
249 <img 69 <img
250 slot="activator" 70 slot="activator"
251 style="cursor:pointer;width:20px; height:20px; " 71 style="cursor:pointer;width:20px; height:20px; "
252 class="mr-3" 72 class="mr-3"
253 @click="deletePayment(editedItem)" 73 @click="deletePayment(editedItem)"
254 src="/static/icon/delete.png" 74 src="/static/icon/delete.png"
255 /> 75 />
256 <span>Delete</span> 76 <span>Delete</span>
257 </v-tooltip> 77 </v-tooltip>
258 </td> 78 </td>
259 </tr> 79 </tr>
260 </table> 80 </table>
261 </v-card> 81 </v-card>
262 </v-dialog> 82 </v-dialog>
263 83
264 <!-- ****** Invoice Table ****** --> 84 <!-- ****** Invoice Table ****** -->
265 <v-toolbar color="transparent" flat> 85 <v-toolbar color="transparent" flat>
266 <v-btn 86 <v-btn
267 fab 87 fab
268 dark 88 dark
269 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" 89 class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
270 small 90 small
271 @click="addInvoiceDialog = true" 91 @click="addInvoiceDialog = true"
272 > 92 >
273 <v-icon dark>add</v-icon> 93 <v-icon dark>add</v-icon>
274 </v-btn> 94 </v-btn>
275 <v-btn 95 <v-btn
276 round 96 round
277 class="open-dialog-button hidden-sm-only hidden-xs-only" 97 class="open-dialog-button hidden-sm-only hidden-xs-only"
278 dark 98 dark
279 @click="addInvoiceDialog = true" 99 @click="addInvoiceDialog = true"
280 > 100 >
281 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Invoice 101 <v-icon class="white--text pr-1" size="20">add</v-icon>Add Invoice
282 </v-btn> 102 </v-btn>
283 <v-spacer></v-spacer> 103 <v-spacer></v-spacer>
284 <v-card-title class="body-1" v-show="show"> 104 <v-card-title class="body-1" v-show="show">
285 <v-btn icon large flat @click="displaySearch"> 105 <v-btn icon large flat @click="displaySearch">
286 <v-avatar size="27"> 106 <v-avatar size="27">
287 <img src="/static/icon/search.png" alt="icon" /> 107 <img src="/static/icon/search.png" alt="icon" />
288 </v-avatar> 108 </v-avatar>
289 </v-btn> 109 </v-btn>
290 </v-card-title> 110 </v-card-title>
291 <v-flex xs8 sm8 md3 lg2 v-show="showSearch"> 111 <v-flex xs8 sm8 md3 lg2 v-show="showSearch">
292 <v-layout> 112 <v-layout>
293 <v-text-field v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> 113 <v-text-field v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field>
294 <v-icon @click="closeSearch" color="error">close</v-icon> 114 <v-icon @click="closeSearch" color="error">close</v-icon>
295 </v-layout> 115 </v-layout>
296 </v-flex> 116 </v-flex>
297 </v-toolbar> 117 </v-toolbar>
298 <v-data-table 118 <v-data-table
299 :headers="headers" 119 :headers="headers"
300 :items="invoiceList" 120 :items="invoiceList"
301 :pagination.sync="pagination" 121 :pagination.sync="pagination"
302 :search="search" 122 :search="search"
303 > 123 >
304 <template slot="items" slot-scope="props"> 124 <template slot="items" slot-scope="props">
305 <tr class="tr"> 125 <tr class="tr">
306 <td class="td td-row">{{ props.index + 1 }}</td> 126 <td class="td td-row">{{ props.index + 1 }}</td>
307 <td class="text-xs-center td td-row">{{ props.item.studentId.name }}</td> 127 <td class="text-xs-center td td-row">{{ props.item.studentId.name }}</td>
308 <td class="text-xs-center td td-row">{{ props.item.classId.classNum }}</td> 128 <td class="text-xs-center td td-row">{{ props.item.classId.classNum }}</td>
309 <td class="text-xs-center td td-row">{{ props.item.totalAmount }}</td> 129 <td class="text-xs-center td td-row">{{ props.item.totalAmount }}</td>
310 <td class="text-xs-center td td-row">{{ props.item.totalDiscount}}</td> 130 <td class="text-xs-center td td-row">{{ props.item.totalDiscount}}</td>
311 <td 131 <td
312 class="text-xs-center td td-row" 132 class="text-xs-center td td-row"
313 >{{ props.item.totalPaidAmount ? props.item.totalPaidAmount : 0}}</td> 133 >{{ props.item.totalPaidAmount ? props.item.totalPaidAmount : 0}}</td>
314 <td 134 <td
315 class="text-xs-center td td-row" 135 class="text-xs-center td td-row"
316 >{{ props.item.totalPaidAmount ? props.item.totalSubTotal - props.item.totalPaidAmount : props.item.totalSubTotal }}</td> 136 >{{ props.item.totalPaidAmount ? props.item.totalSubTotal - props.item.totalPaidAmount : props.item.totalSubTotal }}</td>
317 <td class="text-xs-center td td-row" v-if="props.item.paymentStatus === 'NOT_PAID'"> 137 <td class="text-xs-center td td-row" v-if="props.item.paymentStatus === 'NOT_PAID'">
318 <span 138 <span
319 class="red lighten-1 py-1 px-2 white--text paymentStatus" 139 class="red lighten-1 py-1 px-2 white--text paymentStatus"
320 >{{ props.item.paymentStatus }}</span> 140 >{{ props.item.paymentStatus }}</span>
321 </td> 141 </td>
322 <td class="text-xs-center td td-row" v-if="props.item.paymentStatus === 'FULLY_PAID'"> 142 <td class="text-xs-center td td-row" v-if="props.item.paymentStatus === 'FULLY_PAID'">
323 <span 143 <span
324 class="green lighten-1 py-1 px-2 white--text paymentStatus" 144 class="green lighten-1 py-1 px-2 white--text paymentStatus"
325 >{{ props.item.paymentStatus }}</span> 145 >{{ props.item.paymentStatus }}</span>
326 </td> 146 </td>
327 <td class="text-xs-center td td-row" v-if="props.item.paymentStatus === 'PARTIALLY_PAID'"> 147 <td class="text-xs-center td td-row" v-if="props.item.paymentStatus === 'PARTIALLY_PAID'">
328 <span 148 <span
329 class="yellow darken-3 py-1 px-2 white--text paymentStatus" 149 class="yellow darken-3 py-1 px-2 white--text paymentStatus"
330 >{{ props.item.paymentStatus }}</span> 150 >{{ props.item.paymentStatus }}</span>
331 </td> 151 </td>
332 <td class="text-xs-center td td-row">{{ dates(props.item.date) }}</td> 152 <td class="text-xs-center td td-row">{{ dates(props.item.date) }}</td>
333 <td class="text-xs-center td td-row"> 153 <td class="text-xs-center td td-row">
334 <router-link :to="{ name:'View Invoice',params: { viewInvoiceId:props.item._id } }"> 154 <router-link :to="{ name:'View Invoice',params: { viewInvoiceId:props.item._id } }">
335 <v-tooltip top> 155 <v-tooltip top>
336 <img 156 <img
337 slot="activator" 157 slot="activator"
338 style="cursor:pointer; width:25px; height:25px; " 158 style="cursor:pointer; width:25px; height:25px; "
339 class="mr-3" 159 class="mr-3"
340 src="/static/icon/view.png" 160 src="/static/icon/view.png"
341 /> 161 />
342 <span>View</span> 162 <span>View</span>
343 </v-tooltip> 163 </v-tooltip>
344 </router-link> 164 </router-link>
345 <span v-if="props.item.paymentStatus === 'NOT_PAID'"> 165 <span v-if="props.item.paymentStatus === 'NOT_PAID'">
346 <!-- <router-link :to="{ name: 'Edit Invoice',params: { invoiceid: editData._id } }"> 166 <!-- <router-link :to="{ name: 'Edit Invoice',params: { invoiceid: editData._id } }">
347 <v-tooltip top> 167 <v-tooltip top>
348 <img 168 <img
349 slot="activator" 169 slot="activator"
350 style="cursor:pointer; width:20px; height:18px; " 170 style="cursor:pointer; width:20px; height:18px; "
351 class="mr-3" 171 class="mr-3"
352 @click="editItem(props.item)" 172 @click="editItem(props.item)"
353 src="/static/icon/edit.png" 173 src="/static/icon/edit.png"
354 /> 174 />
355 <span>Edit</span> 175 <span>Edit</span>
356 </v-tooltip> 176 </v-tooltip>
357 </router-link>--> 177 </router-link>-->
358 <v-tooltip top> 178 <v-tooltip top>
359 <img 179 <img
360 slot="activator" 180 slot="activator"
361 style="cursor:pointer; width:20px; height:18px; " 181 style="cursor:pointer; width:20px; height:18px; "
362 class="mr-3" 182 class="mr-3"
363 @click="editItem(props.item)" 183 @click="editItem(props.item)"
364 src="/static/icon/edit.png" 184 src="/static/icon/edit.png"
365 /> 185 />
366 <span>Edit</span> 186 <span>Edit</span>
367 </v-tooltip> 187 </v-tooltip>
368 <v-tooltip top> 188 <v-tooltip top>
369 <img 189 <img
370 slot="activator" 190 slot="activator"
371 style="cursor:pointer;width:20px; height:20px; " 191 style="cursor:pointer;width:20px; height:20px; "
372 class="mr-3" 192 class="mr-3"
373 @click="deleteItem(props.item)" 193 @click="deleteItem(props.item)"
374 src="/static/icon/delete.png" 194 src="/static/icon/delete.png"
375 /> 195 />
376 <span>Delete</span> 196 <span>Delete</span>
377 </v-tooltip> 197 </v-tooltip>
378 <v-tooltip top> 198 <v-tooltip top>
379 <img 199 <img
380 slot="activator" 200 slot="activator"
381 style="cursor:pointer; width:20px; height:18px; " 201 style="cursor:pointer; width:20px; height:18px; "
382 class="mr-3" 202 class="mr-3"
383 @click="paymentItem(props.item)" 203 @click="paymentItem(props.item)"
384 src="/static/schoolIcons/Account.png" 204 src="/static/schoolIcons/Account.png"
385 /> 205 />
386 <span>Payment</span> 206 <span>Payment</span>
387 </v-tooltip> 207 </v-tooltip>
388 </span> 208 </span>
389 <span v-if="props.item.paymentStatus === 'PARTIALLY_PAID'"> 209 <span v-if="props.item.paymentStatus === 'PARTIALLY_PAID'">
390 <v-tooltip top> 210 <v-tooltip top>
391 <img 211 <img
392 slot="activator" 212 slot="activator"
393 style="cursor:pointer; width:20px; height:18px; " 213 style="cursor:pointer; width:20px; height:18px; "
394 class="mr-3" 214 class="mr-3"
395 @click="paymentItem(props.item)" 215 @click="paymentItem(props.item)"
396 src="/static/schoolIcons/Account.png" 216 src="/static/schoolIcons/Account.png"
397 /> 217 />
398 <span>Payment</span> 218 <span>Payment</span>
399 </v-tooltip> 219 </v-tooltip>
400 </span> 220 </span>
401 <v-tooltip top> 221 <v-tooltip top>
402 <img 222 <img
403 slot="activator" 223 slot="activator"
404 style="cursor:pointer; width:19px; height:19px;" 224 style="cursor:pointer; width:19px; height:19px;"
405 class="mr-3" 225 class="mr-3"
406 @click="profile(props.item)" 226 @click="profile(props.item)"
407 src="/static/icon/eye1.png" 227 src="/static/icon/eye1.png"
408 /> 228 />
409 <span>View Payment</span> 229 <span>View Payment</span>
410 </v-tooltip> 230 </v-tooltip>
411 </td> 231 </td>
412 </tr> 232 </tr>
413 </template> 233 </template>
414 <v-alert 234 <v-alert
415 slot="no-results" 235 slot="no-results"
416 :value="true" 236 :value="true"
417 color="error" 237 color="error"
418 icon="warning" 238 icon="warning"
419 >Your search for "{{ search }}" found no results.</v-alert> 239 >Your search for "{{ search }}" found no results.</v-alert>
420 </v-data-table> 240 </v-data-table>
421 241
422 <!-- ****** ADD INVOICE ****** --> 242 <!-- ****** ADD INVOICE ****** -->
423 <v-snackbar 243 <v-snackbar
424 :timeout="timeout" 244 :timeout="timeout"
425 :top="y === 'top'" 245 :top="y === 'top'"
426 :right="x === 'right'" 246 :right="x === 'right'"
427 :vertical="mode === 'vertical'" 247 :vertical="mode === 'vertical'"
428 v-model="snackbar" 248 v-model="snackbar"
429 :color="color" 249 :color="color"
430 >{{ text }}</v-snackbar> 250 >{{ text }}</v-snackbar>
431 <v-dialog v-model="addInvoiceDialog"> 251 <v-dialog v-model="addInvoiceDialog">
432 <v-card flat class="text-xs-center white--text"> 252 <v-card flat class="text-xs-center white--text">
433 <v-layout> 253 <v-layout>
434 <v-flex xs12 class="card-styles pa-2"> 254 <v-flex xs12 class="card-styles pa-2">
435 <label class="title text-xs-center">Add Invoice</label> 255 <label class="title text-xs-center">Add Invoice</label>
436 <v-icon size="24" class="right white--text" @click="addInvoiceDialog = false">cancel</v-icon> 256 <v-icon size="24" class="right white--text" @click="addInvoiceDialog = false">cancel</v-icon>
437 </v-flex> 257 </v-flex>
438 </v-layout> 258 </v-layout>
439 <v-flex xs12 sm12> 259 <v-flex xs12 sm12>
440 <v-container fluid grid-list-md> 260 <v-container fluid grid-list-md>
441 <v-layout wrap> 261 <v-layout wrap>
442 <v-flex xs12 sm12 md5> 262 <v-flex xs12 sm12 md5>
443 <v-card flat> 263 <v-card flat>
444 <v-toolbar dark class="card-styles" flat> 264 <v-toolbar dark class="card-styles" flat>
445 <v-spacer></v-spacer> 265 <v-spacer></v-spacer>
446 <h3>Invoice</h3> 266 <h3>Invoice</h3>
447 <v-spacer></v-spacer> 267 <v-spacer></v-spacer>
448 </v-toolbar> 268 </v-toolbar>
449 <v-form ref="form" v-model="valid" lazy-validation class="py-4"> 269 <v-form ref="form" v-model="valid" lazy-validation class="py-4">
450 <v-layout> 270 <v-layout>
451 <v-flex xs4 class="pt-4 subheading"> 271 <v-flex xs4 class="pt-4 subheading">
452 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> 272 <label class="right hidden-xs-only hidden-sm-only">Select Class:</label>
453 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> 273 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label>
454 </v-flex> 274 </v-flex>
455 <v-flex xs6 class="ml-3"> 275 <v-flex xs6 class="ml-3">
456 <v-select 276 <v-select
457 :items="addclass" 277 :items="addclass"
458 label="Select Class" 278 label="Select Class"
459 v-model="invoiceData.classNum" 279 v-model="invoiceData.classNum"
460 item-text="classNum" 280 item-text="classNum"
461 item-value="_id" 281 item-value="_id"
462 @change="getAllStudents()" 282 @change="getAllStudents()"
463 :rules="classRules" 283 :rules="classRules"
464 required 284 required
465 ></v-select> 285 ></v-select>
466 </v-flex> 286 </v-flex>
467 </v-layout> 287 </v-layout>
468 <v-layout> 288 <v-layout>
469 <v-flex xs4 class="pt-4 subheading"> 289 <v-flex xs4 class="pt-4 subheading">
470 <label class="right hidden-xs-only hidden-sm-only">Select Student:</label> 290 <label class="right hidden-xs-only hidden-sm-only">Select Student:</label>
471 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Student:</label> 291 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Student:</label>
472 </v-flex> 292 </v-flex>
473 <v-flex xs6 class="ml-3"> 293 <v-flex xs6 class="ml-3">
474 <v-select 294 <v-select
475 :items="studentList" 295 :items="studentList"
476 label="Select Student" 296 label="Select Student"
477 v-model="invoiceData.studentId" 297 v-model="invoiceData.studentId"
478 item-text="name" 298 item-text="name"
479 item-value="_id" 299 item-value="_id"
480 :rules="inchargeRules" 300 :rules="inchargeRules"
481 @change="selectAllStudent()" 301 @change="selectAllStudent()"
482 required 302 required
483 ></v-select> 303 ></v-select>
484 </v-flex> 304 </v-flex>
485 </v-layout> 305 </v-layout>
486 <v-layout> 306 <v-layout>
487 <v-flex xs4 class="pt-4 subheading"> 307 <v-flex xs4 class="pt-4 subheading">
488 <label class="right">Date:</label> 308 <label class="right">Date:</label>
489 </v-flex> 309 </v-flex>
490 <v-flex xs6 class="ml-3"> 310 <v-flex xs6 class="ml-3">
491 <v-menu 311 <v-menu
492 ref="menu1" 312 ref="menu1"
493 :close-on-content-click="false" 313 :close-on-content-click="false"
494 v-model="menu1" 314 v-model="menu1"
495 :nudge-right="40" 315 :nudge-right="40"
496 lazy 316 lazy
497 :return-value.sync="invoiceData.date" 317 :return-value.sync="invoiceData.date"
498 transition="scale-transition" 318 transition="scale-transition"
499 offset-y 319 offset-y
500 full-width 320 full-width
501 min-width="290px" 321 min-width="290px"
502 > 322 >
503 <v-text-field 323 <v-text-field
504 slot="activator" 324 slot="activator"
505 :rules="dateRules" 325 :rules="dateRules"
506 v-model="invoiceData.date" 326 v-model="invoiceData.date"
507 placeholder="Select date" 327 placeholder="Select date"
508 ></v-text-field> 328 ></v-text-field>
509 <v-date-picker 329 <v-date-picker
510 v-model="invoiceData.date" 330 v-model="invoiceData.date"
511 @input="$refs.menu1.save(invoiceData.date)" 331 @input="$refs.menu1.save(invoiceData.date)"
512 ></v-date-picker> 332 ></v-date-picker>
513 </v-menu> 333 </v-menu>
514 </v-flex> 334 </v-flex>
515 </v-layout> 335 </v-layout>
516 <v-layout> 336 <v-layout>
517 <v-flex xs4 class="pt-4 subheading"> 337 <v-flex xs4 class="pt-4 subheading">
518 <label class="right hidden-xs-only hidden-sm-only">Payment Status:</label> 338 <label class="right hidden-xs-only hidden-sm-only">Payment Status:</label>
519 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Payment:</label> 339 <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Payment:</label>
520 </v-flex> 340 </v-flex>
521 <v-flex xs6 class="ml-3"> 341 <v-flex xs6 class="ml-3">
522 <v-select 342 <v-select
523 :items="paymentStatus" 343 :items="paymentStatus"
524 v-model="invoiceData.paymentStatus" 344 v-model="invoiceData.paymentStatus"
525 item-text="name" 345 item-text="name"
526 item-value="value" 346 item-value="value"
527 label="Select Payment Status" 347 label="Select Payment Status"
528 @change="getPayMethodList" 348 @change="getPayMethodList"
529 :rules="paymentStatusRules" 349 :rules="paymentStatusRules"
530 required 350 required
531 ></v-select> 351 ></v-select>
532 </v-flex> 352 </v-flex>
533 </v-layout> 353 </v-layout>
534 <v-layout v-show="showPayMethods"> 354 <v-layout v-show="showPayMethods">
535 <v-flex xs4 class="pt-4 subheading"> 355 <v-flex xs4 class="pt-4 subheading">
536 <label class="right">Payment Method:</label> 356 <label class="right">Payment Method:</label>
537 </v-flex> 357 </v-flex>
538 <v-flex xs6 class="ml-3"> 358 <v-flex xs6 class="ml-3">
539 <v-select 359 <v-select
540 :items="paymentMethods" 360 :items="paymentMethods"
541 v-model="invoiceData.paymentMethod" 361 v-model="invoiceData.paymentMethod"
542 label="Select Payment Method" 362 label="Select Payment Method"
543 required 363 required
544 ></v-select> 364 ></v-select>
545 </v-flex> 365 </v-flex>
546 </v-layout> 366 </v-layout>
547 <v-layout> 367 <v-layout>
548 <v-flex xs12 sm11> 368 <v-flex xs12 sm11>
549 <v-card-actions> 369 <v-card-actions>
550 <v-spacer></v-spacer> 370 <v-spacer></v-spacer>
551 <v-btn @click="clear" round dark class="clear-button">clear</v-btn> 371 <v-btn @click="clear" round dark class="clear-button">clear</v-btn>
552 <v-btn 372 <v-btn
553 @click="submit" 373 @click="submit"
554 round 374 round
555 dark 375 dark
556 :loading="loading" 376 :loading="loading"
557 class="add-button" 377 class="add-button"
558 >Add</v-btn> 378 >Add</v-btn>
559 </v-card-actions> 379 </v-card-actions>
560 </v-flex> 380 </v-flex>
561 </v-layout> 381 </v-layout>
562 </v-form> 382 </v-form>
563 </v-card> 383 </v-card>
564 </v-flex> 384 </v-flex>
565 <v-flex xs12 sm12 md7> 385 <v-flex xs12 sm12 md7>
566 <v-card> 386 <v-card>
567 <v-toolbar dark class="card-styles" flat> 387 <v-toolbar dark class="card-styles" flat>
568 <v-spacer></v-spacer> 388 <v-spacer></v-spacer>
569 <h3>Fee Type List</h3> 389 <h3>Fee Type List</h3>
570 <v-spacer></v-spacer> 390 <v-spacer></v-spacer>
571 </v-toolbar> 391 </v-toolbar>
572 <v-layout> 392 <v-layout>
573 <v-flex xs4 sm2 class="mt-4 hidden-xs-only hidden-sm-only"> 393 <v-flex xs4 sm2 class="mt-4 hidden-xs-only hidden-sm-only">
574 <label class="right title">Fee Type:</label> 394 <label class="right title">Fee Type:</label>
575 </v-flex> 395 </v-flex>
576 <v-flex xs8 sm4> 396 <v-flex xs8 sm4>
577 <v-select 397 <v-select
578 :items="feeTypes" 398 :items="feeTypes"
579 v-model="feeType.feeTypeName" 399 v-model="feeType.feeTypeName"
580 item-text="feeType" 400 item-text="feeType"
581 item-value="feeType" 401 item-value="feeType"
582 label="Select Fee Type" 402 label="Select Fee Type"
583 required 403 required
584 ></v-select> 404 ></v-select>
585 </v-flex> 405 </v-flex>
586 <v-flex xs4 sm6> 406 <v-flex xs4 sm6>
587 <v-btn 407 <v-btn
588 color="open-dialog-button" 408 color="open-dialog-button"
589 round 409 round
590 dark 410 dark
591 class="right mt-3" 411 class="right mt-3"
592 @click="selectFeeType" 412 @click="selectFeeType"
593 >ADD</v-btn> 413 >ADD</v-btn>
594 </v-flex> 414 </v-flex>
595 </v-layout> 415 </v-layout>
596 <table class="feeTypeTable tableRsponsive"> 416 <table class="feeTypeTable tableRsponsive">
597 <tr class="info white--text"> 417 <tr class="info white--text">
598 <th>#</th> 418 <th>#</th>
599 <th>Fee Type</th> 419 <th>Fee Type</th>
600 <th>Amount</th> 420 <th>Amount</th>
601 <th>Discount(%)</th> 421 <th>Discount(%)</th>
602 <th>Subtotal</th> 422 <th>Subtotal</th>
603 <th>Paid Amount</th> 423 <th>Paid Amount</th>
604 <th>Action</th> 424 <th>Action</th>
605 </tr> 425 </tr>
606 <tr 426 <tr
607 v-show="showFeeType" 427 v-show="showFeeType"
608 v-for="(feeType, index) in feeTypeData" 428 v-for="(feeType, index) in feeTypeData"
609 :key="index" 429 :key="index"
610 v-on:keyup="getAmmountDetails(feeType)" 430 v-on:keyup="getAmmountDetails(feeType)"
611 > 431 >
612 <td style="width:40px" class="tdFeeType">{{ index + 1 }}</td> 432 <td style="width:40px" class="tdFeeType">{{ index + 1 }}</td>
613 <td 433 <td
614 style="width:120px" 434 style="width:120px"
615 class="tdFeeType" 435 class="tdFeeType"
616 :rules="feeTypeNameRules" 436 :rules="feeTypeNameRules"
617 >{{ feeType.feeTypeName }}</td> 437 >{{ feeType.feeTypeName }}</td>
618 <td class="tdFeeType"> 438 <td class="tdFeeType">
619 <v-text-field 439 <v-text-field
620 placeholder="fill your Amount" 440 placeholder="fill your Amount"
621 v-model="feeType.amount" 441 v-model="feeType.amount"
622 type="number" 442 type="number"
623 :rules="amountRules" 443 :rules="amountRules"
624 required 444 required
625 ></v-text-field> 445 ></v-text-field>
626 </td> 446 </td>
627 <td class="tdFeeType"> 447 <td class="tdFeeType">
628 <v-text-field 448 <v-text-field
629 placeholder="fill your Discount" 449 placeholder="fill your Discount"
630 v-model="feeType.discount" 450 v-model="feeType.discount"
631 type="number" 451 type="number"
632 :rules="discountRules" 452 :rules="discountRules"
633 required 453 required
634 ></v-text-field> 454 ></v-text-field>
635 </td> 455 </td>
636 <td class="tdFeeType" :rules="subtotalRules">{{ feeType.subTotal }}</td> 456 <td class="tdFeeType" :rules="subtotalRules">{{ feeType.subTotal }}</td>
637 <td class="tdFeeType" v-if="invoiceData.paymentStatus === 'NOT_PAID'"> 457 <td class="tdFeeType" v-if="invoiceData.paymentStatus === 'NOT_PAID'">
638 <v-text-field 458 <v-text-field
639 placeholder="fill your Paid Amount" 459 placeholder="fill your Paid Amount"
640 v-model="feeType.paidAmount" 460 v-model="feeType.paidAmount"
641 type="number" 461 type="number"
642 :disabled="disabled" 462 :disabled="disabled"
643 ></v-text-field> 463 ></v-text-field>
644 </td> 464 </td>
645 <td class="tdFeeType" v-if="invoiceData.paymentStatus == ''"> 465 <td class="tdFeeType" v-if="invoiceData.paymentStatus == ''">
646 <v-text-field 466 <v-text-field
647 placeholder="fill your Paid Amount" 467 placeholder="fill your Paid Amount"
648 v-model="feeType.paidAmount" 468 v-model="feeType.paidAmount"
649 type="number" 469 type="number"
650 :disabled="disabled" 470 :disabled="disabled"
651 ></v-text-field> 471 ></v-text-field>
652 </td> 472 </td>
653 <td 473 <td
654 class="tdFeeType" 474 class="tdFeeType"
655 v-if="invoiceData.paymentStatus != 'NOT_PAID' && invoiceData.paymentStatus != ''" 475 v-if="invoiceData.paymentStatus != 'NOT_PAID' && invoiceData.paymentStatus != ''"
656 > 476 >
657 <v-text-field 477 <v-text-field
658 placeholder="fill your Paid Amount" 478 placeholder="fill your Paid Amount"
659 v-model="feeType.paidAmount" 479 v-model="feeType.paidAmount"
660 type="number" 480 type="number"
661 ></v-text-field> 481 ></v-text-field>
662 </td> 482 </td>
663 <td class="tdFeeType"> 483 <td class="tdFeeType">
664 <v-icon color="error" @click="deleteSelectFee(index)">delete</v-icon> 484 <v-icon color="error" @click="deleteSelectFee(index)">delete</v-icon>
665 </td> 485 </td>
666 </tr> 486 </tr>
667 <tfoot> 487 <tfoot>
668 <tr> 488 <tr>
669 <td colspan="2" class="tdFeeType">Total:</td> 489 <td colspan="2" class="tdFeeType">Total:</td>
670 <td class="tdFeeType">{{ feeType.amount }}</td> 490 <td class="tdFeeType">{{ feeType.amount }}</td>
671 <td class="tdFeeType">{{ feeType.discount }}</td> 491 <td class="tdFeeType">{{ feeType.discount }}</td>
672 <td class="tdFeeType">{{ feeType.subTotal }}</td> 492 <td class="tdFeeType">{{ feeType.subTotal }}</td>
673 <td class="tdFeeType">{{ feeType.paidAmount }}</td> 493 <td class="tdFeeType">{{ feeType.paidAmount }}</td>
674 <td class="tdFeeType"> 494 <td class="tdFeeType">
675 <v-icon color="error" @click="deleteSelectFee(index)">delete</v-icon> 495 <v-icon color="error" @click="deleteSelectFee(index)">delete</v-icon>
676 </td> 496 </td>
677 </tr> 497 </tr>
678 </tfoot> 498 </tfoot>
679 </table> 499 </table>
680 </v-card> 500 </v-card>
681 </v-flex> 501 </v-flex>
682 </v-layout> 502 </v-layout>
683 </v-container> 503 </v-container>
684 </v-flex> 504 </v-flex>
685 </v-card> 505 </v-card>
686 </v-dialog> 506 </v-dialog>
687 <div class="loader" v-if="showLoader"> 507 <div class="loader" v-if="showLoader">
688 <v-progress-circular indeterminate color="white"></v-progress-circular> 508 <v-progress-circular indeterminate color="white"></v-progress-circular>
689 </div> 509 </div>
690 </v-container> 510 </v-container>
691 </template> 511 </template>
692 512
693 <script> 513 <script>
694 import http from "@/Services/http.js"; 514 import http from "@/Services/http.js";
695 import editInvoice from "./editInvoice"; 515 import editInvoice from "./editInvoice";
696 import paymentTemplate from "./paymentTemplate.vue"; 516 import paymentTemplate from "./paymentTemplate.vue";
697 import moment from "moment"; 517 import moment from "moment";
698 518
699 export default { 519 export default {
700 components: { 520 components: {
701 editInvoice: editInvoice, 521 editInvoice: editInvoice,
702 paymentTemplate: paymentTemplate 522 paymentTemplate: paymentTemplate
703 }, 523 },
704 data: () => ({ 524 data: () => ({
705 snackbar: false, 525 snackbar: false,
706 showPayMethods: false, 526 showPayMethods: false,
707 y: "top", 527 y: "top",
708 x: "right", 528 x: "right",
709 mode: "", 529 mode: "",
710 timeout: 5000, 530 timeout: 5000,
711 text: "", 531 text: "",
712 color: "", 532 color: "",
713 show: true, 533 show: true,
714 showSearch: false, 534 showSearch: false,
715 showLoader: false, 535 showLoader: false,
716 loading: false, 536 loading: false,
717 date: null, 537 date: null,
718 search: "", 538 search: "",
719 dialog: false, 539 dialog: false,
720 dialog1: false, 540 dialog1: false,
721 valid: true, 541 valid: true,
722 validEdit: true, 542 validEdit: true,
723 isActive: true, 543 isActive: true,
724 newActive: false, 544 newActive: false,
725 showFeeType: true, 545 showFeeType: true,
726 addInvoiceDialog: false, 546 addInvoiceDialog: false,
727 editInvoiceDialog: false, 547 editInvoiceDialog: false,
728 paymentInvoiceDialog: false, 548 paymentInvoiceDialog: false,
729 disabled: true, 549 disabled: true,
730 details: [], 550 details: [],
731 feeTypes: [], 551 feeTypes: [],
732 invoiceData: [], 552 invoiceData: [],
733 editData: [], 553 editData: [],
734 invoiceList: [], 554 invoiceList: [],
735 editPayment: { 555 editPayment: {
736 studentId: { 556 studentId: {
737 name: "", 557 name: "",
738 rollNo: "" 558 rollNo: ""
739 }, 559 },
740 classId: { 560 classId: {
741 classNum: "" 561 classNum: ""
742 } 562 }
743 }, 563 },
744 menu1: false, 564 menu1: false,
745 paymentMethods: ["Cash", "Cheque"], 565 paymentMethods: ["Cash", "Cheque"],
746 feeType: { 566 feeType: {
747 amount: "0.00", 567 amount: "0.00",
748 discount: "0.00", 568 discount: "0.00",
749 subTotal: "0.00", 569 subTotal: "0.00",
750 paidAmount: "0.00", 570 paidAmount: "0.00",
751 feeTypeName: "" 571 feeTypeName: ""
752 }, 572 },
753 573
754 feeTypeData: [], 574 feeTypeData: [],
755 editFeeTypeData: [], 575 editFeeTypeData: [],
756 paymentFeeTypeData: [], 576 paymentFeeTypeData: [],
757 pagination: { 577 pagination: {
758 rowsPerPage: 10 578 rowsPerPage: 10
759 }, 579 },
760 classRules: [v => !!v || " Class Name is required"], 580 classRules: [v => !!v || " Class Name is required"],
761 inchargeRules: [v => !!v || "Student Name is required"], 581 inchargeRules: [v => !!v || "Student Name is required"],
762 dateRules: [v => !!v || " Date is required"], 582 dateRules: [v => !!v || " Date is required"],
763 paymentStatusRules: [v => !!v || "Payment Status is required"], 583 paymentStatusRules: [v => !!v || "Payment Status is required"],
764 paymentMethodsRules: [v => !!v || "payment Method is required"], 584 paymentMethodsRules: [v => !!v || "payment Method is required"],
765 feeTypeRules: [v => !!v || "Fee Type is required"], 585 feeTypeRules: [v => !!v || "Fee Type is required"],
766 feeTypeNameRules: [v => !!v || "Fee Type Name is required"], 586 feeTypeNameRules: [v => !!v || "Fee Type Name is required"],
767 amountRules: [v => !!v || "Amount is required"], 587 amountRules: [v => !!v || "Amount is required"],
768 discountRules: [v => !!v || "Discount is required"], 588 discountRules: [v => !!v || "Discount is required"],
769 subtotalRules: [v => !!v || "Subtotal is required"], 589 subtotalRules: [v => !!v || "Subtotal is required"],
770 paymentRules: [v => !!v || "Payment is required"], 590 paymentRules: [v => !!v || "Payment is required"],
771 paidAmountRules: [v => !!v || "Paid Amount is required"], 591 paidAmountRules: [v => !!v || "Paid Amount is required"],
772 headers: [ 592 headers: [
773 { 593 {
774 text: "No", 594 text: "No",
775 align: "", 595 align: "",
776 sortable: false, 596 sortable: false,
777 value: "No" 597 value: "No"
778 }, 598 },
779 { 599 {
780 text: "Student", 600 text: "Student",
781 value: "name", 601 value: "name",
782 sortable: false, 602 sortable: false,
783 align: "center" 603 align: "center"
784 }, 604 },
785 { text: "Class", value: "class", sortable: false, align: "center" }, 605 { text: "Class", value: "class", sortable: false, align: "center" },
786 { text: "Total", value: "subtotal", sortable: false, align: "center" }, 606 { text: "Total", value: "subtotal", sortable: false, align: "center" },
787 { 607 {
788 text: "Discount(%)", 608 text: "Discount(%)",
789 value: "discount", 609 value: "discount",
790 sortable: false, 610 sortable: false,
791 align: "center" 611 align: "center"
792 }, 612 },
793 { 613 {
794 text: "Paid Amount", 614 text: "Paid Amount",
795 value: "paidAmount", 615 value: "paidAmount",
796 sortable: false, 616 sortable: false,
797 align: "center" 617 align: "center"
798 }, 618 },
799 { 619 {
800 text: "Balance", 620 text: "Balance",
801 value: "Balance", 621 value: "Balance",
802 sortable: false, 622 sortable: false,
803 align: "center" 623 align: "center"
804 }, 624 },
805 { 625 {
806 text: "Status", 626 text: "Status",
807 value: "paymentStatus", 627 value: "paymentStatus",
808 sortable: false, 628 sortable: false,
809 align: "center" 629 align: "center"
810 }, 630 },
811 { 631 {
812 text: "Date", 632 text: "Date",
813 value: "date", 633 value: "date",
814 sortable: false, 634 sortable: false,
815 align: "center" 635 align: "center"
816 }, 636 },
817 { text: "Action", value: "", sortable: false, align: "center" } 637 { text: "Action", value: "", sortable: false, align: "center" }
818 ], 638 ],
819 639
820 studentId: { 640 studentId: {
821 name: "" 641 name: ""
822 }, 642 },
823 token: "", 643 token: "",
824 editedItem: {}, 644 editedItem: {},
825 invoiceData: { 645 invoiceData: {
826 paymentStatus: "", 646 paymentStatus: "",
827 students: [] 647 students: []
828 }, 648 },
829 addclass: [], 649 addclass: [],
830 studentList: [], 650 studentList: [],
831 paymentStatus: [ 651 paymentStatus: [
832 { 652 {
833 name: "Not Paid", 653 name: "Not Paid",
834 value: "NOT_PAID" 654 value: "NOT_PAID"
835 }, 655 },
836 { 656 {
837 name: "Partially Paid", 657 name: "Partially Paid",
838 value: "PARTIALLY_PAID" 658 value: "PARTIALLY_PAID"
839 }, 659 },
840 { 660 {
841 name: "Fully Paid", 661 name: "Fully Paid",
842 value: "FULLY_PAID" 662 value: "FULLY_PAID"
843 } 663 }
844 ] 664 ]
845 }), 665 }),
846 methods: { 666 methods: {
847 save(date) { 667 save(date) {
848 this.$refs.menu1.save(date); 668 this.$refs.menu1.save(date);
849 }, 669 },
850 dates: function(date) { 670 dates: function(date) {
851 return moment(date).format("MMMM DD, YYYY"); 671 return moment(date).format("MMMM DD, YYYY");
852 }, 672 },
853 profile(item) { 673 profile(item) {
854 // console.log("item", item); 674 // console.log("item", item);
855 this.editedIndex = this.invoiceList.indexOf(item); 675 this.editedIndex = this.invoiceList.indexOf(item);
856 this.editedItem = Object.assign({}, item); 676 this.editedItem = Object.assign({}, item);
857 console.log("editedItem", this.editedItem); 677 console.log("editedItem", this.editedItem);
858 this.dialog1 = true; 678 this.dialog1 = true;
859 }, 679 },
860 editItem(item) { 680 editItem(item) {
861 this.editedIndex = this.invoiceList.indexOf(item); 681 this.editedIndex = this.invoiceList.indexOf(item);
862 this.editData = Object.assign({}, item); 682 this.editData = Object.assign({}, item);
863 this.editData.date = this.editData.date.slice(0, 10); 683 this.editData.date = this.editData.date.slice(0, 10);
864 // console.log("invoiceData", this.editData); 684 // console.log("invoiceData", this.editData);
865 this.editFeeTypeData = this.editData.feeType; 685 this.editFeeTypeData = this.editData.feeType;
866 this.editInvoiceDialog = true; 686 this.editInvoiceDialog = true;
867 }, 687 },
868 paymentItem(item) { 688 paymentItem(item) {
869 // console.log("item", item); 689 // console.log("item", item);
870 this.editedIndex = this.invoiceList.indexOf(item); 690 this.editedIndex = this.invoiceList.indexOf(item);
871 this.editPayment = Object.assign({}, item); 691 this.editPayment = Object.assign({}, item);
872 this.editPayment.date = this.editPayment.date.slice(0, 10); 692 this.editPayment.date = this.editPayment.date.slice(0, 10);
693 if (this.editPayment.paymentStatus == "NOT_PAID") {
694 for (let i = 0; i < this.editPayment.feeType.length; i++) {
695 this.editPayment.feeType[i].paidAmount = "0.00";
696 }
697 }
698 // console.log("this.editPayment", this.editPayment);
873 this.paymentFeeTypeData = this.editPayment.feeType; 699 this.paymentFeeTypeData = this.editPayment.feeType;
874 this.paymentInvoiceDialog = true; 700 this.paymentInvoiceDialog = true;
875 }, 701 },
876 deleteItem(item) { 702 deleteItem(item) {
877 let deleteInvoice = { 703 let deleteInvoice = {
878 invoiceId: item._id 704 invoiceId: item._id
879 }; 705 };
880 http() 706 http()
881 .delete( 707 .delete(
882 "/deleteInvoice", 708 "/deleteInvoice",
883 confirm("Are you sure you want to delete this?") && { 709 confirm("Are you sure you want to delete this?") && {
884 params: deleteInvoice 710 params: deleteInvoice
885 } 711 }
886 ) 712 )
887 .then(response => { 713 .then(response => {
888 this.snackbar = true; 714 this.snackbar = true;
889 this.text = "Successfully delete Existing Invoice"; 715 this.text = "Successfully delete Existing Invoice";
890 this.color = "green"; 716 this.color = "green";
891 this.dialog1 = false; 717 this.dialog1 = false;
892 this.getInvoiceList(); 718 this.getInvoiceList();
893 }) 719 })
894 .catch(error => { 720 .catch(error => {
895 // console.log(error); 721 // console.log(error);
896 }); 722 });
897 }, 723 },
898 deletePayment(editedItem) { 724 deletePayment(editedItem) {
899 let deleteInvoice = { 725 let deleteInvoice = {
900 invoiceId: editedItem._id 726 invoiceId: editedItem._id
901 }; 727 };
902 http() 728 http()
903 .put( 729 .put(
904 "/removePayment", 730 "/removePayment",
905 deleteInvoice, 731 deleteInvoice,
906 confirm("Are you sure you want to delete this?") && { 732 confirm("Are you sure you want to delete this?") && {
907 headers: { 733 headers: {
908 Authorization: "Bearer " + this.token 734 Authorization: "Bearer " + this.token
909 } 735 }
910 } 736 }
911 ) 737 )
912 .then(response => { 738 .then(response => {
913 this.snackbar = true; 739 this.snackbar = true;
914 this.text = "Successfully delete Existing Invoice"; 740 this.text = "Successfully delete Existing Invoice";
915 this.color = "green"; 741 this.color = "green";
916 this.dialog1 = false; 742 this.dialog1 = false;
917 this.getInvoiceList(); 743 this.getInvoiceList();
918 }) 744 })
919 .catch(error => { 745 .catch(error => {
920 // console.log(error); 746 // console.log(error);
921 }); 747 });
922 }, 748 },
923 close() { 749 close() {
924 this.dialog = false; 750 this.dialog = false;
925 }, 751 },
926 // totalAmount() { 752 // totalAmount() {
927 // // console.log("this.feeType.paidAmount ", this.feeType.paidAmount); 753 // // console.log("this.feeType.paidAmount ", this.feeType.paidAmount);
928 // // console.log( 754 // // console.log(
929 // // "this.feeType.subTotalAAAAAAAAAAAAAAA ", 755 // // "this.feeType.subTotalAAAAAAAAAAAAAAA ",
930 // // this.feeType.subTotal 756 // // this.feeType.subTotal
931 // // ); 757 // // );
932 758
933 // if (this.feeType.paidAmount < this.feeType.subTotal) { 759 // if (this.feeType.paidAmount < this.feeType.subTotal) {
934 // console.log("this.feeType.subTotalBBBBBBBBBBB ", this.feeType.subTotal); 760 // console.log("this.feeType.subTotalBBBBBBBBBBB ", this.feeType.subTotal);
935 761
936 // this.feeType.paidAmount = this.feeType.subTotal; 762 // this.feeType.paidAmount = this.feeType.subTotal;
937 // console.log( 763 // console.log(
938 // "this.feeType.paidAmount BBBBBBBBBBB", 764 // "this.feeType.paidAmount BBBBBBBBBBB",
939 // this.feeType.paidAmount 765 // this.feeType.paidAmount
940 // ); 766 // );
941 // } 767 // }
942 // }, 768 // },
943 submit() { 769 submit() {
944 let feeTypeId = ""; 770 let feeTypeId = "";
945 for (let i = 0; i < this.feeTypes.length; i++) { 771 for (let i = 0; i < this.feeTypes.length; i++) {
946 if (this.feeTypes[i].feeType === this.feeType.feeTypeName) { 772 if (this.feeTypes[i].feeType === this.feeType.feeTypeName) {
947 feeTypeId = this.feeTypes[i]._id; 773 feeTypeId = this.feeTypes[i]._id;
948 } 774 }
949 } 775 }
950 if (this.$refs.form.validate()) { 776 if (this.$refs.form.validate()) {
951 let invoiceData = { 777 let invoiceData = {
952 classId: this.invoiceData.classNum, 778 classId: this.invoiceData.classNum,
953 students: this.invoiceData.students, 779 students: this.invoiceData.students,
954 date: this.invoiceData.date, 780 date: this.invoiceData.date,
955 paymentStatus: this.invoiceData.paymentStatus, 781 paymentStatus: this.invoiceData.paymentStatus,
956 paymentMethod: this.invoiceData.paymentMethod, 782 paymentMethod: this.invoiceData.paymentMethod,
957 feeType: this.feeTypeData, 783 feeType: this.feeTypeData,
958 totalAmount: this.feeType.amount, 784 totalAmount: this.feeType.amount.toString(),
959 totalDiscount: this.feeType.discount, 785 totalDiscount: this.feeType.discount.toString(),
960 totalSubTotal: this.feeType.subTotal, 786 totalSubTotal: this.feeType.subTotal,
961 totalPaidAmount: this.feeType.paidAmount 787 totalPaidAmount: this.feeType.paidAmount
962 }; 788 };
963 console.log("invoiceData", invoiceData); 789 // console.log("invoiceData", invoiceData);
964 if (invoiceData.paymentStatus == "NOT_PAID") { 790 if (this.feeType.paidAmount != "0.00") {
965 delete invoiceData.totalPaidAmount; 791 if (this.feeType.subTotal == this.feeType.paidAmount) {
966 } 792 invoiceData.paymentStatus = "FULLY_PAID";
967 if (this.feeType.subTotal == this.feeType.paidAmount) { 793 console.log("FULLY_PAID");
968 invoiceData.paymentStatus = "FULLY_PAID"; 794 }
969 // console.log("FULLY_PAID"); 795 if (invoiceData.totalPaidAmount) {
970 } 796 if (this.feeType.subTotal != this.feeType.paidAmount) {
971 if (invoiceData.totalPaidAmount) { 797 invoiceData.paymentStatus = "PARTIALLY_PAID";
972 if (this.feeType.subTotal != this.feeType.paidAmount) { 798 console.log("PARTIALLY_PAID");
973 invoiceData.paymentStatus = "PARTIALLY_PAID"; 799 }
974 // console.log("PARTIALLY_PAID");
975 } 800 }
801 } else if (this.feeType.paidAmount === "0.00") {
802 invoiceData.paymentStatus = "NOT_PAID";
976 } 803 }
977 http() 804 http()
978 .post("/createInvoice", invoiceData) 805 .post("/createInvoice", invoiceData)
979 .then(response => { 806 .then(response => {
980 this.getInvoiceList(); 807 this.getInvoiceList();
981 this.snackbar = true; 808 this.snackbar = true;
982 this.text = "New Invoice added successfully"; 809 this.text = "New Invoice added successfully";
983 this.color = "green"; 810 this.color = "green";
984 this.clear(); 811 this.clear();
985 this.feeTypeData = []; 812 this.feeTypeData = [];
986 if (this.feeTypeData.length == 0) { 813 if (this.feeTypeData.length == 0) {
987 this.feeType = { 814 this.feeType = {
988 amount: "0.00", 815 amount: "0.00",
989 discount: "0.00", 816 discount: "0.00",
990 paidAmount: "0.00", 817 paidAmount: "0.00",
991 subTotal: "0.00", 818 subTotal: "0.00",
992 feeTypeList: "" 819 feeTypeList: ""
993 }; 820 };
994 } 821 }
995 this.loading = false; 822 this.loading = false;
996 this.addInvoiceDialog = false; 823 this.addInvoiceDialog = false;
997 }) 824 })
998 .catch(error => { 825 .catch(error => {
999 this.snackbar = true; 826 this.snackbar = true;
1000 this.text = error.response.data.errors[0].messages[0]; 827 this.text = error.response.data.errors[0].messages[0];
1001 this.color = "error"; 828 this.color = "error";
1002 this.loading = false; 829 this.loading = false;
1003 }); 830 });
1004 } 831 }
1005 }, 832 },
1006 // add() {
1007 // var updatePayment = {
1008 // invoiceId: this.editPayment._id,
1009 // // totalPaidAmount: this.editPayment.paidAmount
1010 // classId: this.editPayment.classNum,
1011 // students: this.editPayment.students,
1012 // date: this.editPayment.date,
1013 // paymentStatus: this.editPayment.paymentStatus,
1014 // paymentMethod: this.editPayment.paymentMethod,
1015 // feeType: this.feeTypeData,
1016 // totalAmount: this.feeType.amount,
1017 // totalDiscount: this.feeType.discount,
1018 // totalSubTotal: this.feeType.subTotal,
1019 // totalPaidAmount: this.feeType.paidAmount
1020 // };
1021 // http()
1022 // .put("/updateInvoice", updatePayment, {
1023 // headers: {
1024 // Authorization: "Bearer " + this.token
1025 // }
1026 // })
1027 // .then(response => {
1028 // this.getInvoiceList();
1029 // this.snackbar = true;
1030 // this.text = response.data.message;
1031 // this.color = "green";
1032 // this.paymentInvoiceDialog = false;
1033 // })
1034 // .catch(error => {
1035 // console.log("error", error);
1036 // this.snackbar = true;
1037 // this.color = "red";
1038 // });
1039 // },
1040 clear() { 833 clear() {
1041 this.$refs.form.reset(); 834 this.$refs.form.reset();
1042 }, 835 },
1043 getInvoiceList() { 836 getInvoiceList() {
1044 this.showLoader = true; 837 this.showLoader = true;
1045 http() 838 http()
1046 .get("/getInvoicesList", { 839 .get("/getInvoicesList", {
1047 params: { schoolId: this.$store.state.schoolId }, 840 params: { schoolId: this.$store.state.schoolId },
1048 headers: { Authorization: "Bearer " + this.token } 841 headers: { Authorization: "Bearer " + this.token }
1049 }) 842 })
1050 .then(response => { 843 .then(response => {
1051 this.invoiceList = response.data.data; 844 this.invoiceList = response.data.data;
1052 this.showLoader = false; 845 this.showLoader = false;
1053 }) 846 })
1054 .catch(error => { 847 .catch(error => {
1055 // console.log("err====>", err); 848 // console.log("err====>", err);
1056 this.showLoader = false; 849 this.showLoader = false;
1057 if (error.response.status === 401) { 850 if (error.response.status === 401) {
1058 this.$router.replace({ path: "/" }); 851 this.$router.replace({ path: "/" });
1059 this.$store.dispatch("setToken", null); 852 this.$store.dispatch("setToken", null);
1060 this.$store.dispatch("Id", null); 853 this.$store.dispatch("Id", null);
1061 } 854 }
1062 }); 855 });
1063 }, 856 },
1064 selectFeeType() { 857 selectFeeType() {
1065 this.showFeeType = true; 858 this.showFeeType = true;
1066 this.feeTypeData.push({ feeTypeName: this.feeType.feeTypeName }); 859 this.feeTypeData.push({ feeTypeName: this.feeType.feeTypeName });
1067 }, 860 },
1068 deleteSelectFee: function(index) { 861 deleteSelectFee: function(index) {
862 console.log("---index----", index);
1069 this.feeTypeData.splice(index, 1); 863 this.feeTypeData.splice(index, 1);
1070 for (let i = 0; i < this.feeTypeData.length; i++) { 864 for (let i = 0; i < this.feeTypeData.length; i++) {
1071 this.feeType = this.feeTypeData[i]; 865 console.log("this.feeTypeData[i]", this.feeTypeData[i]);
866 if (this.feeTypeData[i].paidAmount) {
867 this.feeType = {
868 amount: this.feeTypeData[i].amount,
869 discount: this.feeTypeData[i].discount,
870 subTotal: this.feeTypeData[i].subTotal,
871 paidAmount: this.feeTypeData[i].paidAmount
872 };
873 } else {
874 this.feeType = {
875 amount: this.feeTypeData[i].amount,
876 discount: this.feeTypeData[i].discount,
877 subTotal: this.feeTypeData[i].subTotal,
878 paidAmount: "0.00"
879 };
880 }
1072 } 881 }
1073 if (this.feeTypeData.length == 0) { 882 if (this.feeTypeData.length == 0) {
1074 this.feeType = { 883 this.feeType = {
1075 amount: "0.00", 884 amount: "0.00",
1076 discount: "0.00", 885 discount: "0.00",
1077 paidAmount: "0.00", 886 paidAmount: "0.00",
1078 subTotal: "0.00", 887 subTotal: "0.00",
1079 feeTypeName: "" 888 feeTypeName: ""
1080 }; 889 };
1081 } 890 }
1082 }, 891 },
1083 getAllClasses() { 892 getAllClasses() {
1084 http() 893 http()
1085 .get("/getClassesList", { 894 .get("/getClassesList", {
1086 params: { schoolId: this.$store.state.schoolId }, 895 params: { schoolId: this.$store.state.schoolId },
1087 headers: { Authorization: "Bearer " + this.token } 896 headers: { Authorization: "Bearer " + this.token }
1088 }) 897 })
1089 .then(response => { 898 .then(response => {
1090 this.addclass = response.data.data; 899 this.addclass = response.data.data;
1091 }) 900 })
1092 .catch(err => { 901 .catch(err => {
1093 // console.log("err====>", err); 902 // console.log("err====>", err);
1094 // this.$router.replace({ path: "/" }); 903 // this.$router.replace({ path: "/" });
1095 }); 904 });
1096 }, 905 },
1097 getAllStudents() { 906 getAllStudents() {
1098 this.showLoader = true; 907 this.showLoader = true;
1099 http() 908 http()
1100 .get("/getStudentsList", { 909 .get("/getStudentsList", {
1101 params: { 910 params: {
1102 classId: this.invoiceData.classNum, 911 classId: this.invoiceData.classNum,
1103 schoolId: this.$store.state.schoolId 912 schoolId: this.$store.state.schoolId
1104 }, 913 },
1105 headers: { Authorization: "Bearer " + this.token } 914 headers: { Authorization: "Bearer " + this.token }
1106 }) 915 })
1107 .then(response => { 916 .then(response => {
1108 response.data.data.unshift({ 917 response.data.data.unshift({
1109 name: "Select All", 918 name: "Select All",
1110 _id: "Select All" 919 _id: "Select All"
1111 }); 920 });
1112 this.studentList = response.data.data; 921 this.studentList = response.data.data;
1113 this.showLoader = false; 922 this.showLoader = false;
1114 }) 923 })
1115 .catch(err => { 924 .catch(err => {
1116 this.showLoader = false; 925 this.showLoader = false;
1117 // console.log("err====>", err); 926 // console.log("err====>", err);
1118 // this.$router.replace({ path: "/" }); 927 // this.$router.replace({ path: "/" });
1119 }); 928 });
1120 }, 929 },
1121 getfeeType() { 930 getfeeType() {
1122 http() 931 http()
1123 .get("/getFeesList", { 932 .get("/getFeesList", {
1124 params: { 933 params: {
1125 schoolId: this.$store.state.schoolId 934 schoolId: this.$store.state.schoolId
1126 }, 935 },
1127 headers: { Authorization: "Bearer " + this.token } 936 headers: { Authorization: "Bearer " + this.token }
1128 }) 937 })
1129 .then(response => { 938 .then(response => {
1130 this.feeTypes = response.data.data; 939 this.feeTypes = response.data.data;
1131 }) 940 })
1132 .catch(err => { 941 .catch(err => {
1133 // console.log("err====>", err); 942 // console.log("err====>", err);
1134 // this.$router.replace({ path: "/" }); 943 // this.$router.replace({ path: "/" });
1135 }); 944 });
1136 }, 945 },
1137 946
1138 getAmmountDetails(feeTyp) { 947 getAmmountDetails(feeTyp) {
1139 let feeType = { 948 let feeType = {
1140 amount: "0.00", 949 amount: "0.00",
1141 discount: "0.00", 950 discount: "0.00",
1142 subTotal: "0.00", 951 subTotal: "0.00",
1143 subParticularTotal: "0.00", 952 subParticularTotal: "0.00",
1144 paidAmount: "" 953 paidAmount: ""
1145 }; 954 };
1146 for (let i = 0; i < this.feeTypeData.length; i++) { 955 for (let i = 0; i < this.feeTypeData.length; i++) {
1147 // *********** AMOUNT *********** 956 // *********** AMOUNT ***********
1148 957 if (this.feeTypeData[i].amount) {
1149 feeType.amount = 958 feeType.amount =
1150 Number(feeType.amount) + Number(this.feeTypeData[i].amount); 959 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
1151 // console.log("feeType.amount ", feeType.amount); 960 this.feeType.amount = feeType.amount;
1152 this.feeType.amount = feeType.amount; 961 this.feeType.subTotal = feeType.amount;
1153 this.feeType.subTotal = feeType.amount; 962 this.feeTypeData[i].subTotal = this.feeTypeData[i].amount;
1154 this.feeTypeData[i].subTotal = this.feeTypeData[i].amount; 963 } else if (this.feeTypeData[0].amount == "") {
1155 964 this.feeType.amount = "0.00";
965 this.feeTypeData[i].subTotal = "0.00";
966 this.feeType.subTotal = "0.00";
967 } else if (this.feeTypeData[i].amount == "") {
968 this.feeType.amount =
969 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
970 this.feeTypeData[i].subTotal =
971 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
972 this.feeType.subTotal =
973 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
974 }
1156 // *********** DISCOUNT *********** 975 // *********** DISCOUNT ***********
1157
1158 if (this.feeTypeData[i].discount) { 976 if (this.feeTypeData[i].discount) {
1159 feeType.discount = 977 feeType.discount =
1160 Number(feeType.discount) + Number(this.feeTypeData[i].discount); 978 Number(feeType.discount) + Number(this.feeTypeData[i].discount);
1161 this.feeType.discount = feeType.discount; 979 this.feeType.discount = feeType.discount;
1162 feeType.subParticularTotal = 980 feeType.subParticularTotal =
1163 this.feeTypeData[i].amount - 981 this.feeTypeData[i].amount -
1164 (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100; 982 (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100;
1165 this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2); 983 this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2);
984 } else if (this.feeTypeData[0].discount == "") {
985 this.feeType.discount = "0.00";
986 } else if (this.feeTypeData[i].discount == "") {
987 this.feeType.discount =
988 Number(feeType.discount) + Number(this.feeTypeData[i].discount);
1166 } 989 }
1167 990
1168 // *********** SUBTOTAL *********** 991 // *********** SUBTOTAL ***********
1169 992 if (this.feeTypeData[i].subTotal) {
1170 feeType.subTotal = 993 feeType.subTotal =
1171 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal); 994 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal);
1172 this.feeType.subTotal = feeType.subTotal.toFixed(2); 995 this.feeType.subTotal = feeType.subTotal.toFixed(2);
996 }
1173 997
1174 // *********** PAID-AMOUNT *********** 998 // *********** PAID-AMOUNT ***********
1175 if (this.feeTypeData[i].paidAmount) { 999 if (this.feeTypeData[i].paidAmount) {
1176 feeType.paidAmount = 1000 feeType.paidAmount =
1177 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); 1001 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
1178 this.feeType.paidAmount = feeType.paidAmount.toFixed(2); 1002 this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
1003 } else if (this.feeTypeData[0].paidAmount == "") {
1004 this.feeType.paidAmount = "0.00";
1005 } else if (this.feeTypeData[i].paidAmount == "") {
1006 this.feeType.paidAmount = feeType.paidAmount =
1007 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
1179 } 1008 }
1009
1180 // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value. 1010 // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value.
1181 if (feeType.paidAmount > feeType.subTotal) { 1011 if (feeType.paidAmount > feeType.subTotal) {
1182 this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal; 1012 this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal;
1183 this.feeType.paidAmount = feeType.subTotal; 1013 this.feeType.paidAmount = feeType.subTotal;
1184 } 1014 }
1185 } 1015 }
1186 }, 1016 },
1187 getPayMethodList() { 1017 getPayMethodList() {
1188 if (this.invoiceData.paymentStatus == "PARTIALLY_PAID") { 1018 if (this.invoiceData.paymentStatus == "PARTIALLY_PAID") {
1189 this.showPayMethods = true; 1019 this.showPayMethods = true;
1190 } else if (this.invoiceData.paymentStatus == "FULLY_PAID") { 1020 } else if (this.invoiceData.paymentStatus == "FULLY_PAID") {
1191 this.showPayMethods = true; 1021 this.showPayMethods = true;
1192 } else { 1022 } else if (this.invoiceData.paymentStatus == "NOT_PAID") {
1193 this.showPayMethods = false; 1023 for (let i = 0; i < this.feeTypeData.length; i++) {
1194 } 1024 this.feeTypeData[i].paidAmount = "0.00";
1195 }, 1025 this.feeType.paidAmount = "0.00";
1196 getPaymentMethod() { 1026 }
1197 if (this.editData.paymentStatus == "PARTIALLY_PAID") {
1198 this.showPayMethods = true;
1199 } else if (this.editData.paymentStatus == "FULLY_PAID") {
1200 this.showPayMethods = true;
1201 } else { 1027 } else {
1202 this.showPayMethods = false; 1028 this.showPayMethods = false;
1203 } 1029 }
1204 }, 1030 },
1205 selectAllStudent() { 1031 selectAllStudent() {
1206 // console.log("this.studentId", this.invoiceData.studentId);
1207 this.invoiceData.students = []; 1032 this.invoiceData.students = [];
1208 if (this.invoiceData.studentId === "Select All") { 1033 if (this.invoiceData.studentId === "Select All") {
1209 for (let i = 1; i < this.studentList.length; i++) { 1034 for (let i = 1; i < this.studentList.length; i++) {
1210 this.invoiceData.students.push(this.studentList[i]._id); 1035 this.invoiceData.students.push(this.studentList[i]._id);
1211 console.log("data", this.invoiceData.students); 1036 console.log("data", this.invoiceData.students);
1212 // data.push(this.studentList[i]._id); 1037 // data.push(this.studentList[i]._id);
1213 // console.log("data", data); 1038 // console.log("data", data);
1214 } 1039 }
1215 } else { 1040 } else {
1216 this.invoiceData.students.push(this.invoiceData.studentId); 1041 this.invoiceData.students.push(this.invoiceData.studentId);
1217 } 1042 }
1218 }, 1043 },
1219 displaySearch() { 1044 displaySearch() {
src/pages/Account/paymentTemplate.vue
1 <template> 1 <template>
2 <v-app id="pages-dasboard"> 2 <v-app id="pages-dasboard">
3 <!-- ****** Edit multiple INVOICE ****** --> 3 <!-- ****** Edit multiple INVOICE ****** -->
4 4
5 <v-snackbar 5 <v-snackbar
6 :timeout="timeout" 6 :timeout="timeout"
7 :top="y === 'top'" 7 :top="y === 'top'"
8 :right="x === 'right'" 8 :right="x === 'right'"
9 :vertical="mode === 'vertical'" 9 :vertical="mode === 'vertical'"
10 v-model="snackbar" 10 v-model="snackbar"
11 color="success" 11 color="success"
12 >{{ text }}</v-snackbar> 12 >{{ text }}</v-snackbar>
13 <v-flex xs12 sm12> 13 <v-flex xs12 sm12>
14 <v-container fluid grid-list-md> 14 <v-container fluid grid-list-md>
15 <v-layout wrap> 15 <v-layout wrap>
16 <v-flex xs12 sm12 md4> 16 <v-flex xs12 sm12 md4>
17 <v-card flat class="mb-4"> 17 <v-card flat class="mb-4">
18 <v-toolbar dark class="card-styles" flat> 18 <v-toolbar dark class="card-styles" flat>
19 <v-spacer></v-spacer> 19 <v-spacer></v-spacer>
20 <h3>Profile</h3> 20 <h3>Profile</h3>
21 <v-spacer></v-spacer> 21 <v-spacer></v-spacer>
22 </v-toolbar> 22 </v-toolbar>
23 <!-- Profile User--> 23 <!-- Profile User-->
24 <v-card-text> 24 <v-card-text>
25 <v-container> 25 <v-container>
26 <v-layout wrap> 26 <v-layout wrap>
27 <v-flex xs12> 27 <v-flex xs12>
28 <v-layout> 28 <v-layout>
29 <v-flex 29 <v-flex
30 xs12 30 xs12
31 class="text-xs-center text-sm-center text-md-center text-lg-center" 31 class="text-xs-center text-sm-center text-md-center text-lg-center"
32 > 32 >
33 <v-avatar size="80px"> 33 <v-avatar size="80px">
34 <img src="/static/icon/user.png" v-if="!editPayment.profilePicUrl" /> 34 <img src="/static/icon/user.png" v-if="!editPayment.profilePicUrl" />
35 <img 35 <img
36 :src="editPayment.profilePicUrl" 36 :src="editPayment.profilePicUrl"
37 v-else-if="editPayment.profilePicUrl" 37 v-else-if="editPayment.profilePicUrl"
38 /> 38 />
39 </v-avatar> 39 </v-avatar>
40 </v-flex> 40 </v-flex>
41 </v-layout> 41 </v-layout>
42 <v-layout> 42 <v-layout>
43 <v-flex xs12 sm12> 43 <v-flex xs12 sm12>
44 <h3 class="text-xs-center"> 44 <h3 class="text-xs-center">
45 <b>{{ editPayment.studentId.name }}</b> 45 <b>{{ editPayment.studentId.name }}</b>
46 </h3> 46 </h3>
47 <p class="text-xs-center grey--text">Student</p> 47 <p class="text-xs-center grey--text">Student</p>
48 </v-flex> 48 </v-flex>
49 </v-layout> 49 </v-layout>
50 <v-layout style="border: 1px solid lightgrey;"> 50 <v-layout style="border: 1px solid lightgrey;">
51 <v-flex xs6 sm6 class="pa-0"> 51 <v-flex xs6 sm6 class="pa-0">
52 <h4 class="right"> 52 <h4 class="right">
53 <b>Roll No :</b> 53 <b>Roll No :</b>
54 </h4> 54 </h4>
55 </v-flex> 55 </v-flex>
56 <v-flex sm6 xs6 class="pa-0"> 56 <v-flex sm6 xs6 class="pa-0">
57 <h4>{{ editPayment.studentId.rollNo }}</h4> 57 <h4>{{ editPayment.studentId.rollNo }}</h4>
58 </v-flex> 58 </v-flex>
59 </v-layout> 59 </v-layout>
60 <v-layout style="border: 1px solid lightgrey;"> 60 <v-layout style="border: 1px solid lightgrey;">
61 <v-flex xs6 sm6 class="pa-0"> 61 <v-flex xs6 sm6 class="pa-0">
62 <h4 class="right"> 62 <h4 class="right">
63 <b>Class :</b> 63 <b>Class :</b>
64 </h4> 64 </h4>
65 </v-flex> 65 </v-flex>
66 <v-flex sm6 xs6 class="pa-0"> 66 <v-flex sm6 xs6 class="pa-0">
67 <h4>{{ editPayment.classId.classNum }}</h4> 67 <h4>{{ editPayment.classId.classNum }}</h4>
68 </v-flex> 68 </v-flex>
69 </v-layout> 69 </v-layout>
70 </v-flex> 70 </v-flex>
71 </v-layout> 71 </v-layout>
72 </v-container> 72 </v-container>
73 </v-card-text> 73 </v-card-text>
74 </v-card> 74 </v-card>
75 <!-- Account Fee Type List User--> 75 <!-- Account Fee Type List User-->
76 <v-card flat> 76 <v-card flat>
77 <v-toolbar dark class="card-styles" flat> 77 <v-toolbar dark class="card-styles" flat>
78 <v-spacer></v-spacer> 78 <v-spacer></v-spacer>
79 <v-toolbar-title> 79 <v-toolbar-title>
80 <h3>Invoice</h3> 80 <h3>Invoice</h3>
81 </v-toolbar-title> 81 </v-toolbar-title>
82 <v-spacer></v-spacer> 82 <v-spacer></v-spacer>
83 </v-toolbar> 83 </v-toolbar>
84 <v-form ref="form" v-model="valid" lazy-validation class="py-4"> 84 <v-form ref="form" v-model="valid" lazy-validation class="py-4">
85 <v-layout> 85 <v-layout>
86 <v-flex xs4 class="pt-4 subheading"> 86 <v-flex xs4 class="pt-4 subheading">
87 <label class="right">Payment Method:</label> 87 <label class="right">Payment Method:</label>
88 </v-flex> 88 </v-flex>
89 <v-flex xs7 class="ml-3"> 89 <v-flex xs7 class="ml-3">
90 <v-select 90 <v-select
91 :items="paymentMethods" 91 :items="paymentMethods"
92 v-model="editPayment.paymentMethod" 92 v-model="editPayment.paymentMethod"
93 label="Select Payment Method" 93 label="Select Payment Method"
94 ></v-select> 94 ></v-select>
95 </v-flex> 95 </v-flex>
96 </v-layout> 96 </v-layout>
97 <v-card-actions> 97 <v-card-actions>
98 <v-spacer class="hidden-xs-only"></v-spacer> 98 <v-spacer class="hidden-xs-only"></v-spacer>
99 <v-btn 99 <v-btn
100 color="open-dialog-button" 100 color="open-dialog-button"
101 dark 101 dark
102 class="right mt-3" 102 class="right mt-3"
103 @click="update(editPayment)" 103 @click="update(editPayment)"
104 >Add Payment</v-btn> 104 >Add Payment</v-btn>
105 </v-card-actions> 105 </v-card-actions>
106 </v-form> 106 </v-form>
107 </v-card> 107 </v-card>
108 </v-flex> 108 </v-flex>
109 <v-flex xs12 sm12 md8> 109 <v-flex xs12 sm12 md8>
110 <v-card> 110 <v-card>
111 <v-toolbar dark class="card-styles" flat> 111 <v-toolbar dark class="card-styles" flat>
112 <v-spacer></v-spacer> 112 <v-spacer></v-spacer>
113 <v-toolbar-title> 113 <v-toolbar-title>
114 <h3>Fee Type List</h3> 114 <h3>Fee Type List</h3>
115 </v-toolbar-title> 115 </v-toolbar-title>
116 <v-spacer></v-spacer> 116 <v-spacer></v-spacer>
117 </v-toolbar> 117 </v-toolbar>
118 <table class="feeTypeTable tableRsponsive"> 118 <table class="feeTypeTable tableRsponsive">
119 <tr class="info white--text"> 119 <tr class="info white--text">
120 <th>#</th> 120 <th>#</th>
121 <th>Fee Type</th> 121 <th>Fee Type</th>
122 <th>Amount</th> 122 <th>Amount</th>
123 <th>Discount(%)</th> 123 <th>Discount(%)</th>
124 <th>Subtotal</th> 124 <th>Subtotal</th>
125 <th>Paid Amount</th> 125 <th>Paid Amount</th>
126 <th>Action</th> 126 <th>Action</th>
127 </tr> 127 </tr>
128 <tr 128 <tr
129 v-for="(feeType, index) in editPayment.feeType" 129 v-for="(feeType, index) in editPayment.feeType"
130 :key="index" 130 :key="index"
131 v-on:keyup="getAmmountDetails(feeType,editPayment.feeType)" 131 v-on:keyup="getAmmountDetails(feeType,editPayment.feeType)"
132 > 132 >
133 <td style="width:40px">{{ index + 1 }}</td> 133 <td style="width:40px">{{ index + 1 }}</td>
134 <td style="width:120px">{{ feeType.feeTypeName }}</td> 134 <td style="width:120px">{{ feeType.feeTypeName }}</td>
135 <td> 135 <td>
136 <v-text-field 136 <v-text-field
137 placeholder="fill your Amount" 137 placeholder="fill your Amount"
138 v-model="feeType.amount" 138 v-model="feeType.amount"
139 type="number" 139 type="number"
140 ></v-text-field> 140 ></v-text-field>
141 </td> 141 </td>
142 <td> 142 <td>
143 <v-text-field 143 <v-text-field
144 placeholder="fill your Discount" 144 placeholder="fill your Discount"
145 v-model="feeType.discount" 145 v-model="feeType.discount"
146 type="number" 146 type="number"
147 ></v-text-field> 147 ></v-text-field>
148 </td> 148 </td>
149 <td>{{ feeType.subTotal }}</td> 149 <td>{{ feeType.subTotal }}</td>
150 <td> 150 <td>
151 <v-text-field 151 <v-text-field
152 placeholder="fill your Paid Amount" 152 placeholder="fill your Paid Amount"
153 v-model="feeType.paidAmount" 153 v-model="feeType.paidAmount"
154 type="number" 154 type="number"
155 ></v-text-field> 155 ></v-text-field>
156 </td> 156 </td>
157 <td> 157 <td v-if="!editPayment.feeType">
158 <v-icon 158 <v-icon
159 color="error" 159 color="error"
160 @click="deleteSelectFee(feeType,editPayment.feeType,index)" 160 @click="deleteSelectFee(feeType,editPayment.feeType,index)"
161 >delete</v-icon> 161 >delete</v-icon>
162 </td> 162 </td>
163 </tr> 163 </tr>
164 <tfoot v-if="feeType.amount != 0.00"> 164 <tfoot v-if="feeType.amount != 0.00">
165 <tr> 165 <tr>
166 <td colspan="2">Total:</td> 166 <td colspan="2">Total:</td>
167 <td>{{ feeType.amount }}</td> 167 <td>{{ feeType.amount }}</td>
168 <td>{{ feeType.discount }}</td> 168 <td>{{ feeType.discount }}</td>
169 <td>{{ feeType.subTotal }}</td> 169 <td>{{ feeType.subTotal }}</td>
170 <td>{{ feeType.paidAmount }}</td> 170 <td>{{ feeType.paidAmount }}</td>
171 </tr> 171 </tr>
172 </tfoot> 172 </tfoot>
173 <tfoot v-else-if="feeType.amount == 0.00"> 173 <tfoot v-else-if="feeType.amount == 0.00">
174 <tr> 174 <tr>
175 <td colspan="2">Total:</td> 175 <td colspan="2">Total:</td>
176 <td>{{ editPayment.totalAmount }}</td> 176 <td>{{ editPayment.totalAmount }}</td>
177 <td>{{ editPayment.totalDiscount }}</td> 177 <td>{{ editPayment.totalDiscount }}</td>
178 <td>{{ editPayment.totalSubTotal }}</td> 178 <td>{{ editPayment.totalSubTotal }}</td>
179 <td>{{ editPayment.totalPaidAmount }}</td> 179 <td>{{ editPayment.totalPaidAmount }}</td>
180 </tr> 180 </tr>
181 </tfoot> 181 </tfoot>
182 </table> 182 </table>
183 </v-card> 183 </v-card>
184 </v-flex> 184 </v-flex>
185 </v-layout> 185 </v-layout>
186 </v-container> 186 </v-container>
187 </v-flex> 187 </v-flex>
188 <div class="loader" v-if="showLoader"> 188 <div class="loader" v-if="showLoader">
189 <v-progress-circular indeterminate color="white"></v-progress-circular> 189 <v-progress-circular indeterminate color="white"></v-progress-circular>
190 </div> 190 </div>
191 </v-app> 191 </v-app>
192 </template> 192 </template>
193 193
194 <script> 194 <script>
195 import http from "@/Services/http.js"; 195 import http from "@/Services/http.js";
196 import moment from "moment"; 196 import moment from "moment";
197 197
198 export default { 198 export default {
199 props: ["editPayment"], 199 props: ["editPayment"],
200 data: () => ({ 200 data: () => ({
201 snackbar: false, 201 snackbar: false,
202 // showPayMethods: false, 202 // showPayMethods: false,
203 y: "top", 203 y: "top",
204 x: "right", 204 x: "right",
205 mode: "", 205 mode: "",
206 timeout: 3000, 206 timeout: 3000,
207 text: "", 207 text: "",
208 showLoader: false, 208 showLoader: false,
209 loading: false, 209 loading: false,
210 date: null, 210 date: null,
211 search: "", 211 search: "",
212 // dialog: false, 212 // dialog: false,
213 // dialog1: false, 213 // dialog1: false,
214 valid: true, 214 valid: true,
215 validEdit: true, 215 validEdit: true,
216 // isActive: true, 216 // isActive: true,
217 // newActive: false, 217 // newActive: false,
218 showFeeType: false, 218 showFeeType: false,
219 disabled: true, 219 disabled: true,
220 details: [], 220 details: [],
221 feeTypes: [], 221 feeTypes: [],
222 menu1: false, 222 menu1: false,
223 // invoiceData: {}, 223 // invoiceData: {},
224 paymentMethods: ["Cash", "Cheque"], 224 paymentMethods: ["Cash", "Cheque"],
225 feeType: { 225 feeType: {
226 amount: "0.00", 226 amount: "0.00",
227 discount: "0.00", 227 discount: "0.00",
228 paidAmount: "0.00", 228 paidAmount: "0.00",
229 subTotal: "0.00", 229 subTotal: "0.00",
230 feeTypeName: "" 230 feeTypeName: ""
231 }, 231 },
232 feeTypeData: [], 232 feeTypeData: [],
233 pagination: { 233 pagination: {
234 rowsPerPage: 15 234 rowsPerPage: 15
235 }, 235 },
236 token: "", 236 token: "",
237 editedItem: {}, 237 editedItem: {},
238 invoiceParticularData: {}, 238 invoiceParticularData: {},
239 addclass: [], 239 addclass: [],
240 studentList: [], 240 studentList: [],
241 paymentStatus: [ 241 paymentStatus: [
242 { 242 {
243 name: "Not Paid", 243 name: "Not Paid",
244 value: "NOT_PAID" 244 value: "NOT_PAID"
245 }, 245 },
246 { 246 {
247 name: "Partially Paid", 247 name: "Partially Paid",
248 value: "PARTIALLY_PAID" 248 value: "PARTIALLY_PAID"
249 }, 249 },
250 { 250 {
251 name: "Fully Paid", 251 name: "Fully Paid",
252 value: "FULLY_PAID" 252 value: "FULLY_PAID"
253 } 253 }
254 ] 254 ]
255 }), 255 }),
256 // watch: { 256 // watch: {
257 // menu1(val) { 257 // menu1(val) {
258 // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); 258 // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR"));
259 // } 259 // }
260 // }, 260 // },
261 methods: { 261 methods: {
262 save(date) { 262 save(date) {
263 this.$refs.menu1.save(date); 263 this.$refs.menu1.save(date);
264 }, 264 },
265 dates: function(date) { 265 dates: function(date) {
266 return moment(date).format("MMMM DD, YYYY"); 266 return moment(date).format("MMMM DD, YYYY");
267 }, 267 },
268 update(editPayment) { 268 update(editPayment) {
269 // console.log("editPayment-----------", editPayment); 269 // console.log("editPayment-----------", editPayment);
270 let feeTypeId = ""; 270 let feeTypeId = "";
271 for (let i = 0; i < this.feeTypes.length; i++) { 271 for (let i = 0; i < this.feeTypes.length; i++) {
272 if (this.feeTypes[i].feeType === this.feeType.feeTypeName) { 272 if (this.feeTypes[i].feeType === this.feeType.feeTypeName) {
273 feeTypeId = this.feeTypes[i]._id; 273 feeTypeId = this.feeTypes[i]._id;
274 } 274 }
275 } 275 }
276 // console.log(editPayment); 276 // console.log(editPayment);
277 let editInvoiceData = { 277 let editInvoiceData = {
278 invoiceId: editPayment._id, 278 invoiceId: editPayment._id,
279 classId: editPayment.classNum, 279 classId: editPayment.classNum,
280 studentId: editPayment.sectionId, 280 studentId: editPayment.sectionId,
281 date: editPayment.date, 281 date: editPayment.date,
282 paymentStatus: editPayment.paymentStatus, 282 paymentStatus: editPayment.paymentStatus,
283 paymentMethod: editPayment.paymentMethod, 283 paymentMethod: editPayment.paymentMethod,
284 feeType: editPayment.feeType, 284 feeType: editPayment.feeType,
285 totalAmount: this.feeType.amount, 285 totalAmount: this.feeType.amount,
286 totalDiscount: this.feeType.discount, 286 totalDiscount: this.feeType.discount,
287 totalSubTotal: this.feeType.subTotal, 287 totalSubTotal: this.feeType.subTotal,
288 totalPaidAmount: this.feeType.paidAmount 288 totalPaidAmount: this.feeType.paidAmount
289 }; 289 };
290 if (editInvoiceData.paymentStatus == "NOT_PAID") {
291 delete editInvoiceData.totalPaidAmount;
292 }
293 if (feeTypeId == "") { 290 if (feeTypeId == "") {
294 delete editInvoiceData.feeType[0].feeTypeId; 291 delete editInvoiceData.feeType[0].feeTypeId;
295 } 292 }
296 if (editInvoiceData.paymentStatus == "NOT_PAID") { 293 if (editInvoiceData.paymentStatus == "NOT_PAID") {
297 delete editInvoiceData.paymentMethod; 294 delete editInvoiceData.paymentMethod;
298 } 295 }
299 if (editInvoiceData.paymentStatus == "NOT_PAID") { 296 if (editInvoiceData.totalPaidAmount == "0") {
300 delete invoiceData.totalPaidAmount; 297 if (editInvoiceData.paymentStatus == "NOT_PAID") {
301 } 298 delete editInvoiceData.totalPaidAmount;
302 if (this.feeType.subTotal == this.feeType.paidAmount) { 299 }
303 editInvoiceData.paymentStatus = "FULLY_PAID";
304 // console.log("FULLY_PAID");
305 } 300 }
306 if (editInvoiceData.totalPaidAmount) { 301 console.log("editInvoiceData", editInvoiceData);
302 console.log(
303 "editInvoiceData.totalPaidAmount",
304 editInvoiceData.totalPaidAmount
305 );
306 if (editInvoiceData.totalPaidAmount != "0.00") {
307 if (this.feeType.subTotal == this.feeType.paidAmount) {
308 editInvoiceData.paymentStatus = "FULLY_PAID";
309 }
310
307 if (this.feeType.subTotal != this.feeType.paidAmount) { 311 if (this.feeType.subTotal != this.feeType.paidAmount) {
308 editInvoiceData.paymentStatus = "PARTIALLY_PAID"; 312 editInvoiceData.paymentStatus = "PARTIALLY_PAID";
309 // console.log("PARTIALLY_PAID"); 313 // console.log("PARTIALLY_PAID");
310 } 314 }
311 } 315 }
312 http() 316 http()
313 .put("/updateInvoice", editInvoiceData) 317 .put("/updateInvoice", editInvoiceData)
314 .then(response => { 318 .then(response => {
315 // this.getInvoiceList(); 319 // this.getInvoiceList();
316 this.snackbar = true; 320 this.snackbar = true;
317 this.text = "Payment added successfully"; 321 this.text = "Payment added successfully";
318 this.loading = false; 322 this.loading = false;
319 this.$emit("update-Payment"); 323 this.$emit("update-Payment");
320 }) 324 })
321 .catch(error => { 325 .catch(error => {
322 console.log(error); 326 console.log(error);
323 this.snackbar = true; 327 this.snackbar = true;
324 this.text = error.response.data.message; 328 this.text = error.response.data.message;
325 this.loading = false; 329 this.loading = false;
326 }); 330 });
327 }, 331 },
328 clear() { 332 clear() {
329 this.$refs.form.reset(); 333 this.$refs.form.reset();
330 }, 334 },
331 // selectFeeType() { 335 // selectFeeType() {
332 // // console.log("clckkkkkkkkkkkkkkkkkk", this.feeType.feeTypeName); 336 // // console.log("clckkkkkkkkkkkkkkkkkk", this.feeType.feeTypeName);
333 // this.showFeeType = true; 337 // this.showFeeType = true;
334 // this.editPayment.feeType.push({ feeTypeName: this.feeType.feeTypeName }); 338 // this.editPayment.feeType.push({ feeTypeName: this.feeType.feeTypeName });
335 // }, 339 // },
336 deleteSelectFee: function(feeTyp, feeTypeList, index) { 340 deleteSelectFee: function(feeTyp, feeTypeList, index) {
337 this.editPayment.feeType.splice(index, 1); 341 this.editPayment.feeType.splice(index, 1);
338 this.getAmmountDetails(feeTyp, feeTypeList); 342 this.getAmmountDetails(feeTyp, feeTypeList);
339 if (this.feeTypeData.length == 0) { 343 if (this.feeTypeData.length == 0) {
340 this.feeType = { 344 this.feeType = {
341 amount: "0.00", 345 amount: "0.00",
342 discount: "0.00", 346 discount: "0.00",
343 paidAmount: "0.00", 347 paidAmount: "0.00",
344 subTotal: "0.00", 348 subTotal: "0.00",
345 feeTypeList: "" 349 feeTypeList: ""
346 }; 350 };
347 } 351 }
348 }, 352 },
349 getAllClasses() { 353 getAllClasses() {
350 http() 354 http()
351 .get("/getClassesList", { 355 .get("/getClassesList", {
352 headers: { Authorization: "Bearer " + this.token } 356 headers: { Authorization: "Bearer " + this.token }
353 }) 357 })
354 .then(response => { 358 .then(response => {
355 this.addclass = response.data.data; 359 this.addclass = response.data.data;
356 this.getAllStudents(); 360 this.getAllStudents();
357 }) 361 })
358 .catch(error => { 362 .catch(error => {
359 // console.log("err====>", err); 363 // console.log("err====>", err);
360 this.showLoader = false; 364 this.showLoader = false;
361 if (error.response.status === 401) { 365 if (error.response.status === 401) {
362 this.$router.replace({ path: "/" }); 366 this.$router.replace({ path: "/" });
363 this.$store.dispatch("setToken", null); 367 this.$store.dispatch("setToken", null);
364 this.$store.dispatch("Id", null); 368 this.$store.dispatch("Id", null);
365 this.$store.dispatch("Role", null); 369 this.$store.dispatch("Role", null);
366 } 370 }
367 }); 371 });
368 }, 372 },
369 getAllStudents() { 373 getAllStudents() {
370 http() 374 http()
371 .get("/getStudentsList", { 375 .get("/getStudentsList", {
372 params: { classId: this.editPayment.classNum }, 376 params: { classId: this.editPayment.classNum },
373 headers: { Authorization: "Bearer " + this.token } 377 headers: { Authorization: "Bearer " + this.token }
374 }) 378 })
375 .then(response => { 379 .then(response => {
376 this.studentList = response.data.data; 380 this.studentList = response.data.data;
377 }) 381 })
378 .catch(err => { 382 .catch(err => {
379 // console.log("err====>", err); 383 // console.log("err====>", err);
380 }); 384 });
381 }, 385 },
382 getfeeType() { 386 getfeeType() {
383 http() 387 http()
384 .get("/getFeesList", { 388 .get("/getFeesList", {
385 headers: { Authorization: "Bearer " + this.token } 389 headers: { Authorization: "Bearer " + this.token }
386 }) 390 })
387 .then(response => { 391 .then(response => {
388 this.feeTypes = response.data.data; 392 this.feeTypes = response.data.data;
389 }) 393 })
390 .catch(err => { 394 .catch(err => {
391 // console.log("err====>", err); 395 // console.log("err====>", err);
392 }); 396 });
393 }, 397 },
394 getAmmountDetails(feeTyp, feeTypeList) { 398 getAmmountDetails(feeTyp, feeTypeList) {
395 this.feeTypeData = feeTypeList; 399 this.feeTypeData = feeTypeList;
396 let feeType = { 400 let feeType = {
397 amount: "", 401 amount: "",
398 discount: "", 402 discount: "",
399 subTotal: "", 403 subTotal: "",
400 subParticularTotal: "", 404 subParticularTotal: "",
401 paidAmount: "" 405 paidAmount: ""
402 }; 406 };
403 for (let i = 0; i < this.feeTypeData.length; i++) { 407 for (let i = 0; i < this.feeTypeData.length; i++) {
404 // *********** AMOUNT *********** 408 // *********** AMOUNT ***********
405 feeType.amount = 409 if (this.feeTypeData[i].amount) {
406 Number(feeType.amount) + Number(this.feeTypeData[i].amount); 410 feeType.amount =
407 console.log("feeType.amount ", feeType.amount); 411 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
408 this.feeType.amount = feeType.amount; 412 this.feeType.amount = feeType.amount;
409 this.feeType.subTotal = feeType.amount; 413 this.feeType.subTotal = feeType.amount;
410 this.feeTypeData[i].subTotal = this.feeTypeData[i].amount; 414 this.feeTypeData[i].subTotal = this.feeTypeData[i].amount;
415 } else if (this.feeTypeData[0].amount == "") {
416 this.feeType.amount = "0.00";
417 this.feeTypeData[i].subTotal = "0.00";
418 this.feeType.subTotal = "0.00";
419 } else if (this.feeTypeData[i].amount == "") {
420 this.feeType.amount =
421 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
422 this.feeTypeData[i].subTotal =
423 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
424 this.feeType.subTotal =
425 Number(feeType.amount) + Number(this.feeTypeData[i].amount);
426 }
411 // *********** DISCOUNT *********** 427 // *********** DISCOUNT ***********
412 if (this.feeTypeData[i].discount) { 428 if (this.feeTypeData[i].discount) {
413 feeType.discount = 429 feeType.discount =
414 Number(feeType.discount) + Number(this.feeTypeData[i].discount); 430 Number(feeType.discount) + Number(this.feeTypeData[i].discount);
415 console.log("feeType.discount", feeType.discount);
416 this.feeType.discount = feeType.discount; 431 this.feeType.discount = feeType.discount;
417 feeType.subParticularTotal = 432 feeType.subParticularTotal =
418 this.feeTypeData[i].amount - 433 this.feeTypeData[i].amount -
419 (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100; 434 (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100;
420 console.log("feeType.subTotal", feeType.subTotal);
421 this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2); 435 this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2);
436 } else if (this.feeTypeData[0].discount == "") {
437 this.feeType.discount = "0.00";
438 } else if (this.feeTypeData[i].discount == "") {
439 this.feeType.discount =
440 Number(feeType.discount) + Number(this.feeTypeData[i].discount);
422 } 441 }
442
423 // *********** SUBTOTAL *********** 443 // *********** SUBTOTAL ***********
424 feeType.subTotal = 444 if (this.feeTypeData[i].subTotal) {
425 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal); 445 feeType.subTotal =
426 this.feeType.subTotal = feeType.subTotal.toFixed(2); 446 Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal);
447 this.feeType.subTotal = feeType.subTotal.toFixed(2);
448 }
449
427 // *********** PAID-AMOUNT *********** 450 // *********** PAID-AMOUNT ***********
428 feeType.paidAmount = 451 if (this.feeTypeData[i].paidAmount) {
429 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount); 452 feeType.paidAmount =
430 this.feeType.paidAmount = feeType.paidAmount.toFixed(2); 453 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
454 this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
455 } else if (this.feeTypeData[0].paidAmount == "") {
456 this.feeType.paidAmount = "0.00";
457 } else if (this.feeTypeData[i].paidAmount == "") {
458 this.feeType.paidAmount = feeType.paidAmount =
459 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
460 }
431 461
432 // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value. 462 // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value.
433 if (feeType.paidAmount > feeType.subTotal) { 463 if (feeType.paidAmount > feeType.subTotal) {
434 this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal; 464 this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal;
435 this.feeType.paidAmount = feeType.subTotal; 465 this.feeType.paidAmount = feeType.subTotal;
436 } 466 }
437 } 467 }
438 } 468 }
439 // getPayMethodList() { 469 // getPayMethodList() {
440 // if (this.editPayment.paymentStatus == "PARTIALLY_PAID") { 470 // if (this.editPayment.paymentStatus == "PARTIALLY_PAID") {
441 // this.showPayMethods = true; 471 // this.showPayMethods = true;
442 // } else if (this.editPayment.paymentStatus == "FULLY_PAID") { 472 // } else if (this.editPayment.paymentStatus == "FULLY_PAID") {
443 // this.showPayMethods = true; 473 // this.showPayMethods = true;
444 // } else { 474 // } else {
445 // this.showPayMethods = false; 475 // this.showPayMethods = false;
446 // } 476 // }
447 // } 477 // }
448 }, 478 },
449 mounted() { 479 mounted() {
450 this.token = this.$store.state.token; 480 this.token = this.$store.state.token;
451 this.getAllClasses(); 481 this.getAllClasses();
452 this.getfeeType(); 482 this.getfeeType();
453 }, 483 },
454 created() { 484 created() {
455 this.$root.$on("app:search", search => { 485 this.$root.$on("app:search", search => {
456 this.search = search; 486 this.search = search;
457 }); 487 });
458 }, 488 },
459 beforeDestroy() { 489 beforeDestroy() {
460 // dont forget to remove the listener 490 // dont forget to remove the listener
461 this.$root.$off("app:search"); 491 this.$root.$off("app:search");
462 } 492 }
463 }; 493 };
464 </script> 494 </script>
465 495
466 496
467 <style scoped> 497 <style scoped>
468 .active { 498 .active {
469 background-color: gray; 499 background-color: gray;
470 color: white !important; 500 color: white !important;
471 } 501 }
472 .activebtn { 502 .activebtn {
473 color: black !important; 503 color: black !important;
474 } 504 }
475 table { 505 table {
476 border-collapse: collapse; 506 border-collapse: collapse;
477 border: 1px solid #e2e7eb; 507 border: 1px solid #e2e7eb;
478 } 508 }
479 509
480 th, 510 th,
481 td { 511 td {
482 border: 1px solid #e2e7eb; 512 border: 1px solid #e2e7eb;
483 padding: 10px; 513 padding: 10px;
484 text-align: center; 514 text-align: center;
485 } 515 }
486 table.feeTypeTable { 516 table.feeTypeTable {
487 table-layout: auto !important; 517 table-layout: auto !important;
488 width: 100% !important; 518 width: 100% !important;
489 } 519 }
490 @media screen and (max-width: 380px) { 520 @media screen and (max-width: 380px) {
src/pages/Report/progressCardReport.vue
1 <template> 1 <template>
2 <v-container fluid class="body-color"> 2 <v-container fluid class="body-color">
3 <!-- ****** Progress Card Report Table****** --> 3 <!-- ****** Progress Card Report Table****** -->
4 <v-card flat class="elevation-0 transparent"> 4 <v-card flat class="elevation-0 transparent">
5 <v-form ref="form" v-model="valid" lazy-validation> 5 <v-form ref="form" v-model="valid" lazy-validation>
6 <v-flex xs12 sm12 lg12> 6 <v-flex xs12 sm12 lg12>
7 <v-layout wrap> 7 <v-layout wrap>
8 <v-flex xs12 sm12 lg3> 8 <v-flex xs12 sm12 lg3>
9 <v-layout> 9 <v-layout>
10 <v-flex xs3 sm6 lg2 class="subheading mt-4"> 10 <v-flex xs3 sm6 lg2 class="subheading mt-4">
11 <label class="right">Class:</label> 11 <label class="right">Class:</label>
12 </v-flex> 12 </v-flex>
13 <v-flex xs9 sm6 lg8 class="ml-2"> 13 <v-flex xs9 sm6 lg8 class="ml-2">
14 <v-select 14 <v-select
15 v-model="getReport.classId" 15 v-model="getReport.classId"
16 label="Select your class" 16 label="Select your class"
17 type="text" 17 type="text"
18 :items="classList" 18 :items="classList"
19 item-text="classNum" 19 item-text="classNum"
20 item-value="_id" 20 item-value="_id"
21 :rules="classRules" 21 :rules="classRules"
22 @change="getSections(getReport.classId)" 22 @change="getSections(getReport.classId)"
23 required 23 required
24 ></v-select> 24 ></v-select>
25 </v-flex> 25 </v-flex>
26 </v-layout> 26 </v-layout>
27 </v-flex> 27 </v-flex>
28 <v-flex xs12 sm12 lg3> 28 <v-flex xs12 sm12 lg3>
29 <v-layout> 29 <v-layout>
30 <v-flex xs3 sm6 lg2 class="subheading mt-4"> 30 <v-flex xs3 sm6 lg2 class="subheading mt-4">
31 <label class="right">Section:</label> 31 <label class="right">Section:</label>
32 </v-flex> 32 </v-flex>
33 <v-flex xs9 sm6 lg8 class="ml-2"> 33 <v-flex xs9 sm6 lg8 class="ml-2">
34 <v-select 34 <v-select
35 :items="addSection" 35 :items="addSection"
36 label="Select your Section" 36 label="Select your Section"
37 v-model="getReport.sectionId" 37 v-model="getReport.sectionId"
38 item-text="name" 38 item-text="name"
39 item-value="_id" 39 item-value="_id"
40 name="Select Section" 40 name="Select Section"
41 @change="getStudents" 41 @change="getStudents"
42 :rules="sectionRules" 42 :rules="sectionRules"
43 required 43 required
44 ></v-select> 44 ></v-select>
45 </v-flex> 45 </v-flex>
46 </v-layout> 46 </v-layout>
47 </v-flex> 47 </v-flex>
48 <v-flex xs12 sm12 lg3> 48 <v-flex xs12 sm12 lg3>
49 <v-layout> 49 <v-layout>
50 <v-flex xs3 sm6 lg2 class="subheading mt-4"> 50 <v-flex xs3 sm6 lg2 class="subheading mt-4">
51 <label class="right">Student:</label> 51 <label class="right">Student:</label>
52 </v-flex> 52 </v-flex>
53 <v-flex xs9 sm6 lg8 class="ml-2"> 53 <v-flex xs9 sm6 lg8 class="ml-2">
54 <v-select 54 <v-select
55 :items="getStudentsList" 55 :items="getStudentsList"
56 label="Select your student" 56 label="Select your student"
57 v-model="getReport.studentId" 57 v-model="getReport.studentId"
58 item-text="name" 58 item-text="name"
59 item-value="_id" 59 item-value="_id"
60 :rules="studentRules" 60 :rules="studentRules"
61 @change="selectAllStudent()"
62 required 61 required
63 ></v-select> 62 ></v-select>
64 </v-flex> 63 </v-flex>
65 </v-layout> 64 </v-layout>
66 </v-flex> 65 </v-flex>
67 <v-flex xs12 sm12 lg3 class="hidden-xs-only hidden-sm-only"> 66 <v-flex xs12 sm12 lg3 class="hidden-xs-only hidden-sm-only">
68 <v-btn 67 <v-btn
69 @click="getMarkReportList" 68 @click="getMarkReportList"
70 round 69 round
71 dark 70 dark
72 :loading="loading" 71 :loading="loading"
73 class="open-dialog-button mt-3" 72 class="open-dialog-button mt-3"
74 >Get Report</v-btn> 73 >Get Report</v-btn>
75 </v-flex> 74 </v-flex>
76 </v-layout> 75 </v-layout>
77 </v-flex> 76 </v-flex>
78 </v-form> 77 </v-form>
79 </v-card> 78 </v-card>
80 <v-layout v-show="showReport"> 79 <v-layout v-show="showReport">
81 <v-flex xs12> 80 <v-flex xs12>
82 <v-card class="transparent elevation-0"> 81 <v-card class="transparent elevation-0">
83 <!-- <v-layout> 82 <!-- <v-layout>
84 <v-flex xs12> 83 <v-flex xs12>
85 <v-btn class="open-dialog-button right" round dark @click="printProgressReport()"> 84 <v-btn class="open-dialog-button right" round dark @click="printProgressReport()">
86 Print 85 Print
87 <v-icon right dark>print</v-icon> 86 <v-icon right dark>print</v-icon>
88 </v-btn> 87 </v-btn>
89 </v-flex> 88 </v-flex>
90 </v-layout>--> 89 </v-layout>-->
91 <v-container grid-list-md v-show="showReport" class="report"> 90 <v-container grid-list-md v-show="showReport" class="report">
92 <v-flex xs12 sm12 id="printMe"> 91 <v-flex xs12 sm12 id="printMe">
92 <!-- {{filterData}} -->
93 <v-layout wrap> 93 <v-layout wrap>
94 <!-- ****** TABLE DATA MARK ****** --> 94 <!-- ****** TABLE DATA MARK ****** -->
95 <v-flex xs12 sm12 md12> 95 <v-flex xs12 sm12 md12>
96 <!-- <v-card 96 <!-- <v-card
97 v-for="(value, id, index) in filterData" 97 v-for="(value, id, index) in filterData"
98 :key="index" 98 :key="index"
99 :items="newData" 99 :items="newData"
100 flat 100 flat
101 style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px" 101 style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px"
102 >--> 102 >-->
103 <v-layout> 103 <v-layout>
104 <v-flex xs12> 104 <v-flex xs12>
105 <v-btn class="open-dialog-button" round dark @click="printProgressReport()"> 105 <v-btn class="open-dialog-button" round dark @click="printProgressReport()">
106 Print 106 Print
107 <v-icon right dark>print</v-icon> 107 <v-icon right dark>print</v-icon>
108 </v-btn> 108 </v-btn>
109 </v-flex> 109 </v-flex>
110 </v-layout> 110 </v-layout>
111 <v-card flat style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px"> 111 <v-card flat style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px">
112 <v-layout> 112 <v-layout>
113 <v-flex xs12 sm12 md12> 113 <v-flex xs12 sm12 md12>
114 <!-- {{userData}} --> 114 <!-- {{userData}} -->
115 <div> 115 <div>
116 <div class="school-logo"> 116 <div class="school-logo">
117 <!-- <img :src="userData.schoolLogoUrl" width="140" alt="logo" /> --> 117 <!-- <img :src="userData.schoolLogoUrl" width="140" alt="logo" /> -->
118 <v-avatar> 118 <v-avatar>
119 <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" /> 119 <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" />
120 <img 120 <img
121 src="/static/schoolIcons/INTRACK_White.png" 121 src="/static/schoolIcons/INTRACK_White.png"
122 v-else-if="!userData.schoolLogoUrl" 122 v-else-if="!userData.schoolLogoUrl"
123 /> 123 />
124 </v-avatar> 124 </v-avatar>
125 </div> 125 </div>
126 <div class="school-name"> 126 <div class="school-name">
127 <h2>{{ userData.name }}</h2> 127 <h2>{{ userData.name }}</h2>
128 </div> 128 </div>
129 </div> 129 </div>
130 <hr 130 <hr
131 style="border:1px solid #ddd; 131 style="border:1px solid #ddd;
132 overflow: hidden; 132 overflow: hidden;
133 vertical-align: middle; 133 vertical-align: middle;
134 margin-bottom: 4px;" 134 margin-bottom: 4px;"
135 /> 135 />
136 <div class="school-info"> 136 <div class="school-info">
137 <v-layout> 137 <v-layout>
138 <v-flex xs5 class="pl-3"> 138 <v-flex xs5 class="pl-3">
139 <p style="font-size:20px;">{{ userData.name }}</p> 139 <p style="font-size:20px;">{{ userData.name }}</p>
140 <p 140 <p
141 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 141 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
142 >{{ userData.address }}</p> 142 >{{ userData.address }}</p>
143 <p 143 <p
144 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 144 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
145 >{{ userData.mobile }}</p> 145 >{{ userData.mobile }}</p>
146 <p 146 <p
147 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 147 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
148 >{{ userData.email }}</p> 148 >{{ userData.email }}</p>
149 </v-flex> 149 </v-flex>
150 <v-flex xs5> 150 <v-flex xs5>
151 <div v-if="cardData !=''"> 151 <div v-if="cardData !=''">
152 <p style="font-size:20px;">{{ cardData[0].studentId.name }}</p> 152 <p style="font-size:20px;">{{ cardData[0].studentId.name }}</p>
153 <p 153 <p
154 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 154 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
155 > 155 >
156 Class : 156 Class :
157 <b>{{ cardData[0].classId.classNum }}</b> 157 <b>{{ cardData[0].classId.classNum }}</b>
158 </p> 158 </p>
159 <p 159 <p
160 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 160 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
161 > 161 >
162 Section : 162 Section :
163 <b>{{ cardData[0].sectionId.name }}</b> 163 <b>{{ cardData[0].sectionId.name }}</b>
164 </p> 164 </p>
165 <p 165 <p
166 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;" 166 style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
167 > 167 >
168 Roll NO : 168 Roll NO :
169 <b>{{ cardData[0].studentId.rollNo }}</b> 169 <b>{{ cardData[0].studentId.rollNo }}</b>
170 </p> 170 </p>
171 </div> 171 </div>
172 </v-flex> 172 </v-flex>
173 <v-flex xs2 v-if="cardData !=''"> 173 <v-flex xs2 v-if="cardData !=''">
174 <v-avatar size="100" style="padding-top:20px"> 174 <v-avatar size="100" style="padding-top:20px">
175 <img 175 <img
176 src="/static/icon/user.png" 176 src="/static/icon/user.png"
177 v-if="!cardData[0].studentId.profilePicUrl" 177 v-if="!cardData[0].studentId.profilePicUrl"
178 /> 178 />
179 <img 179 <img
180 :src="cardData[0].studentId.profilePicUrl" 180 :src="cardData[0].studentId.profilePicUrl"
181 v-else-if="cardData[0].studentId.profilePicUrl" 181 v-else-if="cardData[0].studentId.profilePicUrl"
182 /> 182 />
183 </v-avatar> 183 </v-avatar>
184 </v-flex> 184 </v-flex>
185 </v-layout> 185 </v-layout>
186 </div> 186 </div>
187 </v-flex> 187 </v-flex>
188 </v-layout> 188 </v-layout>
189 <v-card class="student-table" xs6 sm6 md6> 189 <v-card class="student-table" xs6 sm6 md6>
190 <table 190 <table
191 v-for="(value, id, index) in filterData" 191 v-for="(value, id, index) in filterData"
192 :key="index" 192 :key="index"
193 class="mb-5 tableRsponsive feeTypeTable subheading" 193 class="mb-5 tableRsponsive feeTypeTable subheading"
194 style="border: 1px solid black; 194 style="border: 1px solid black;
195 border-collapse: collapse;!important 195 border-collapse: collapse;!important
196 table-layout: auto !important; 196 table-layout: auto !important;
197 width: 100% !important; 197 width: 100% !important;
198 overflow: hidden;" 198 overflow: hidden;"
199 > 199 >
200 <thead style="border: 1px solid transparent !important"> 200 <thead style="border: 1px solid transparent !important">
201 <tr style="border: 1px solid transparent !important"> 201 <tr style="border: 1px solid transparent !important">
202 <td 202 <td
203 colspan="4" 203 colspan="4"
204 style="text-align: inherit !important; 204 style="text-align: inherit !important;
205 border-right: inherit; 205 border-right: inherit;
206 border-top: inherit; 206 border-top: inherit;
207 padding:14px;" 207 padding:14px;"
208 >{{value[0].examId.examName}}</td> 208 >{{value[0].examId.examName}}</td>
209 </tr> 209 </tr>
210 <!-- <v-card-title class="subheading" colspan="4">{{value[0].examId.examName}}</v-card-title> --> 210 <!-- <v-card-title class="subheading" colspan="4">{{value[0].examId.examName}}</v-card-title> -->
211 <tr style="border: 1px solid lightgrey !important;padding:4px;"> 211 <tr style="border: 1px solid lightgrey !important;padding:4px;">
212 <td 212 <td
213 rowspan="2" 213 rowspan="2"
214 style="border: 1px solid lightgrey !important;padding: 10px;" 214 style="border: 1px solid lightgrey !important;padding: 10px;"
215 >Subject</td> 215 >Subject</td>
216 <!-- <template v-for="studentData in value"> --> 216 <!-- <template v-for="studentData in value"> -->
217 <!-- <td 217 <!-- <td
218 colspan="4" 218 colspan="4"
219 style="border: 1px solid lightgrey !important;padding: 10px;" 219 style="border: 1px solid lightgrey !important;padding: 10px;"
220 >{{value[0].examId.examName}}</td> 220 >{{value[0].examId.examName}}</td>
221 <td 221 <td
222 colspan="2" 222 colspan="2"
223 style="border: 1px solid lightgrey !important;padding: 10px;" 223 style="border: 1px solid lightgrey !important;padding: 10px;"
224 ></td> 224 ></td>
225 <td 225 <td
226 colspan="2" 226 colspan="2"
227 style="border: 1px solid lightgrey !important;padding: 10px;" 227 style="border: 1px solid lightgrey !important;padding: 10px;"
228 >Total</td>--> 228 >Total</td>-->
229 <!-- <td 229 <!-- <td
230 colspan="2" 230 colspan="2"
231 style="border: 1px solid lightgrey !important;padding: 10px;" 231 style="border: 1px solid lightgrey !important;padding: 10px;"
232 >Grade</td>--> 232 >Grade</td>-->
233 <!-- <td 233 <!-- <td
234 colspan="2" 234 colspan="2"
235 style="border: 1px solid lightgrey !important;padding: 10px;" 235 style="border: 1px solid lightgrey !important;padding: 10px;"
236 >Points</td>--> 236 >Points</td>-->
237 <!-- <td 237 <!-- <td
238 colspan="2" 238 colspan="2"
239 v-for="studentMark in studentData.studentsMarks" 239 v-for="studentMark in studentData.studentsMarks"
240 style="border: 1px solid lightgrey !important;padding: 10px;" 240 style="border: 1px solid lightgrey !important;padding: 10px;"
241 >{{studentMark.markDistributionId.distributionType}}</td>--> 241 >{{studentMark.markDistributionId.distributionType}}</td>-->
242 <!-- <td 242 <!-- <td
243 style="border: 1px solid lightgrey !important;padding: 10px;" 243 style="border: 1px solid lightgrey !important;padding: 10px;"
244 >Total Marks</td>--> 244 >Total Marks</td>-->
245 <!-- </template> --> 245 <!-- </template> -->
246 <!-- </tr> --> 246 <!-- </tr> -->
247 <!-- <tr 247 <!-- <tr
248 v-for="(subject, ind) in value" 248 v-for="(subject, ind) in value"
249 v-if="ind == 0" 249 v-if="ind == 0"
250 style="border: 1px solid lightgrey !important;" 250 style="border: 1px solid lightgrey !important;"
251 >--> 251 >-->
252 <!-- <template v-for="(exam, i) in subject.studentsMarks"> --> 252 <!-- <template v-for="(exam, i) in subject.studentsMarks"> -->
253 <template v-for="studentData in value"> 253 <template v-for="studentData in value">
254 <td 254 <td
255 colspan="2" 255 colspan="2"
256 v-for="studentMark in studentData.studentsMarks" 256 v-for="studentMark in studentData.studentsMarks"
257 style="border: 1px solid lightgrey !important;padding: 10px;" 257 style="border: 1px solid lightgrey !important;padding: 10px;"
258 >{{studentMark.markDistributionId.distributionType}}</td> 258 >{{studentMark.markDistributionId.distributionType}}</td>
259 <td 259 <td
260 style="border: 1px solid lightgrey !important;padding: 10px;" 260 style="border: 1px solid lightgrey !important;padding: 10px;"
261 >Total Marks</td> 261 >Total Marks</td>
262 <!-- <td 262 <!-- <td
263 style="border: 1px solid lightgrey !important;padding: 10px;" 263 style="border: 1px solid lightgrey !important;padding: 10px;"
264 >Marks</td> 264 >Marks</td>
265 <td 265 <td
266 style="border: 1px solid lightgrey !important;padding: 10px;" 266 style="border: 1px solid lightgrey !important;padding: 10px;"
267 >Highest Marks</td>--> 267 >Highest Marks</td>-->
268 </template> 268 </template>
269 </tr> 269 </tr>
270 <tr 270 <tr
271 v-for="(subject, ind) in value" 271 v-for="(subject, ind) in value"
272 v-if="ind == 0" 272 v-if="ind == 0"
273 style="border: 1px solid lightgrey !important;" 273 style="border: 1px solid lightgrey !important;"
274 > 274 >
275 <template v-for="(exam, i) in subject.studentsMarks"> 275 <template v-for="(exam, i) in subject.studentsMarks">
276 <td 276 <td
277 style="border: 1px solid lightgrey !important;padding: 10px;" 277 style="border: 1px solid lightgrey !important;padding: 10px;"
278 >Marks</td> 278 >Marks</td>
279 <td 279 <td
280 style="border: 1px solid lightgrey !important;padding: 10px;" 280 style="border: 1px solid lightgrey !important;padding: 10px;"
281 >Highest Marks</td> 281 >Highest Marks</td>
282 </template> 282 </template>
283 </tr> 283 </tr>
284 </thead> 284 </thead>
285 <tbody style="border: 1px solid lightgrey !important;"> 285 <tbody style="border: 1px solid lightgrey !important;">
286 <tr 286 <tr
287 v-for="subject in value" 287 v-for="subject in value"
288 style="border: 1px solid lightgrey !important;" 288 style="border: 1px solid lightgrey !important;"
289 > 289 >
290 <td 290 <td
291 style="border: 1px solid lightgrey !important;padding: 10px;" 291 style="border: 1px solid lightgrey !important;padding: 10px;"
292 >{{subject.subjectName}}</td> 292 >{{subject.subjectName}}</td>
293 <template v-for="(exam, i) in subject.studentsMarks"> 293 <template v-for="(exam, i) in subject.studentsMarks">
294 <td 294 <td
295 style="border: 1px solid lightgrey !important;padding: 10px;" 295 style="border: 1px solid lightgrey !important;padding: 10px;"
296 >{{exam.marksScored}}</td> 296 >{{exam.marksScored}}</td>
297 <td 297 <td
298 style="border: 1px solid lightgrey !important;padding: 10px;" 298 style="border: 1px solid lightgrey !important;padding: 10px;"
299 >{{exam.markDistributionId.markValue}}</td> 299 >{{exam.markDistributionId.markValue}}</td>
300 </template> 300 </template>
301 <td 301 <td
302 style="border: 1px solid lightgrey !important;padding: 10px;" 302 style="border: 1px solid lightgrey !important;padding: 10px;"
303 >{{subject.totalMarks}}</td> 303 >{{subject.totalMarks}}</td>
304 </tr> 304 </tr>
305 </tbody> 305 </tbody>
306 <!-- <tfoot> 306 <!-- <tfoot>
307 <tr v-for="subject in value" 307 <tr v-for="subject in value"
308 style="border: 1px solid lightgrey !important;"> 308 style="border: 1px solid lightgrey !important;">
309 <td colspan="5"> 309 <td colspan="5">
310 <span class="right subheding">Total Marks :</span> 310 <span class="right subheding">Total Marks :</span>
311 </td> 311 </td>
312 <td 312 <td
313 style="border: 1px solid lightgrey !important;padding: 10px;" 313 style="border: 1px solid lightgrey !important;padding: 10px;"
314 >{{subject.totalMarks}}</td> 314 >{{subject.totalMarks}}</td>
315 </tr> 315 </tr>
316 <tr> 316 <tr>
317 <td colspan="5"> 317 <td colspan="5">
318 <span class="right subheding">Average Mark :</span> 318 <span class="right subheding">Average Mark :</span>
319 </td> 319 </td>
320 <td 320 <td
321 style="border: 1px solid lightgrey !important;padding: 10px;" 321 style="border: 1px solid lightgrey !important;padding: 10px;"
322 >{{subject.averageMark}}</td> 322 >{{subject.averageMark}}</td>
323 </tr> 323 </tr>
324 <tr> 324 <tr>
325 <td colspan="5"> 325 <td colspan="5">
326 <span class="right subheding">GPA :</span> 326 <span class="right subheding">GPA :</span>
327 </td> 327 </td>
328 <td 328 <td
329 style="border: 1px solid lightgrey !important;padding: 10px;" 329 style="border: 1px solid lightgrey !important;padding: 10px;"
330 >{{subject.gpa}}</td> 330 >{{subject.gpa}}</td>
331 </tr> 331 </tr>
332 </tfoot>--> 332 </tfoot>-->
333 <!-- <v-card> --> 333 <!-- <v-card> -->
334 <tr style="border: 1px solid lightgrey !important;"> 334 <tr style="border: 1px solid lightgrey !important;">
335 <td colspan="5"> 335 <td colspan="5">
336 <span class="subheding">Total Marks</span> 336 <span class="subheding">Total Marks</span>
337 </td> 337 </td>
338 <td 338 <td
339 colspan="7" 339 colspan="7"
340 style="border: 1px solid lightgrey !important;padding: 10px;" 340 style="border: 1px solid lightgrey !important;padding: 10px;"
341 > 341 >
342 <b>{{ totalMarks }}</b> 342 <b>{{ totalMarks }}</b>
343 </td> 343 </td>
344 </tr> 344 </tr>
345 <tr> 345 <tr>
346 <td colspan="5"> 346 <td colspan="5">
347 <span class="right subheding">Average Mark</span> 347 <span class="subheding">Average Mark</span>
348 </td> 348 </td>
349 <td 349 <td
350 colspan="7" 350 colspan="7"
351 style="border: 1px solid lightgrey !important;padding: 10px;" 351 style="border: 1px solid lightgrey !important;padding: 10px;"
352 ></td> 352 ></td>
353 </tr> 353 </tr>
354 <tr> 354 <tr>
355 <td colspan="5"> 355 <td colspan="5">
356 <span class="right subheding">GPA</span> 356 <span class="subheding">GPA</span>
357 </td> 357 </td>
358 <td 358 <td
359 colspan="7" 359 colspan="7"
360 style="border: 1px solid lightgrey !important;padding: 10px;" 360 style="border: 1px solid lightgrey !important;padding: 10px;"
361 ></td> 361 ></td>
362 </tr> 362 </tr>
363 <!-- </v-card> --> 363 <!-- </v-card> -->
364 <!-- <tbody style="border: 1px solid lightgrey !important;"> 364 <!-- <tbody style="border: 1px solid lightgrey !important;">
365 <tr 365 <tr
366 v-for="subject in value" 366 v-for="subject in value"
367 style="border: 1px solid lightgrey !important;" 367 style="border: 1px solid lightgrey !important;"
368 > 368 >
369 <td style="border: 1px solid lightgrey !important;padding: 10px;"></td>--> 369 <td style="border: 1px solid lightgrey !important;padding: 10px;"></td>-->
370 <!-- <td 370 <!-- <td
371 style="border: 1px solid lightgrey !important;padding: 10px;" 371 style="border: 1px solid lightgrey !important;padding: 10px;"
372 >{{subject.subjectName}}</td>--> 372 >{{subject.subjectName}}</td>-->
373 <!-- <template v-for="(exam, i) in subject.studentsMarks"> 373 <!-- <template v-for="(exam, i) in subject.studentsMarks">
374 <td 374 <td
375 style="border: 1px solid lightgrey !important;padding: 10px;" 375 style="border: 1px solid lightgrey !important;padding: 10px;"
376 >{{exam.marksScored}}</td> 376 >{{exam.marksScored}}</td>
377 <td 377 <td
378 style="border: 1px solid lightgrey !important;padding: 10px;" 378 style="border: 1px solid lightgrey !important;padding: 10px;"
379 >{{exam.markDistributionId.markValue}}</td> 379 >{{exam.markDistributionId.markValue}}</td>
380 </template> 380 </template>
381 <td 381 <td
382 style="border: 1px solid lightgrey !important;padding: 10px;" 382 style="border: 1px solid lightgrey !important;padding: 10px;"
383 >{{subject.totalMarks}}</td> 383 >{{subject.totalMarks}}</td>
384 </tr> 384 </tr>
385 </tbody>--> 385 </tbody>-->
386 </table> 386 </table>
387 </v-card> 387 </v-card>
388 </v-card> 388 </v-card>
389 </v-flex> 389 </v-flex>
390 </v-layout> 390 </v-layout>
391 </v-flex> 391 </v-flex>
392 </v-container> 392 </v-container>
393 </v-card> 393 </v-card>
394 </v-flex> 394 </v-flex>
395 </v-layout> 395 </v-layout>
396 <div class="loader" v-if="showLoader"> 396 <div class="loader" v-if="showLoader">
397 <v-progress-circular indeterminate color="white"></v-progress-circular> 397 <v-progress-circular indeterminate color="white"></v-progress-circular>
398 </div> 398 </div>
399 </v-container> 399 </v-container>
400 </template> 400 </template>
401 401
402 <script> 402 <script>
403 import http from "@/Services/http.js"; 403 import http from "@/Services/http.js";
404 import moment from "moment"; 404 import moment from "moment";
405 import _ from "underscore"; 405 import _ from "underscore";
406 406
407 export default { 407 export default {
408 data: () => ({ 408 data: () => ({
409 showLoader: false, 409 showLoader: false,
410 cardData: [], 410 cardData: [],
411 token: "", 411 token: "",
412 markDistributions: [], 412 markDistributions: [],
413 markParticularDistributionData: [], 413 markParticularDistributionData: [],
414 loading: false, 414 loading: false,
415 valid: true, 415 valid: true,
416 loading: false, 416 loading: false,
417 showReport: false, 417 showReport: false,
418 addSection: [], 418 addSection: [],
419 filterData: [], 419 filterData: [],
420 getStudentsList: [], 420 getStudentsList: [],
421 classRules: [v => !!v || "Class is required"], 421 classRules: [v => !!v || "Class is required"],
422 sectionRules: [v => !!v || "Class is required"], 422 sectionRules: [v => !!v || "Class is required"],
423 studentRules: [v => !!v || "Student is required"], 423 studentRules: [v => !!v || "Student is required"],
424 getReport: {}, 424 getReport: {},
425 classList: [], 425 classList: [],
426 output: null, 426 output: null,
427 userData: {}, 427 userData: {},
428 newData: [], 428 newData: [],
429 gradeAPlus: "A+", 429 gradeAPlus: "A+",
430 gradeA: "A", 430 gradeA: "A",
431 gradeBPlus: "B+", 431 gradeBPlus: "B+",
432 gradeB: "B", 432 gradeB: "B",
433 gradeCPlus: "C+", 433 gradeCPlus: "C+",
434 gradeC: "C", 434 gradeC: "C",
435 totalMarks: "" 435 totalMarks: ""
436 }), 436 }),
437 mounted() { 437 mounted() {
438 this.token = this.$store.state.token; 438 this.token = this.$store.state.token;
439 this.getClass(); 439 this.getClass();
440 this.getUserData(); 440 this.getUserData();
441 }, 441 },
442 methods: { 442 methods: {
443 clear() { 443 clear() {
444 this.$refs.form.reset(); 444 this.$refs.form.reset();
445 }, 445 },
446 getClass() { 446 getClass() {
447 this.showLoader = true; 447 this.showLoader = true;
448 http() 448 http()
449 .get("/getClassesList", { 449 .get("/getClassesList", {
450 headers: { Authorization: "Bearer " + this.token } 450 headers: { Authorization: "Bearer " + this.token }
451 }) 451 })
452 .then(response => { 452 .then(response => {
453 this.classList = response.data.data; 453 this.classList = response.data.data;
454 this.showLoader = false; 454 this.showLoader = false;
455 }) 455 })
456 .catch(error => { 456 .catch(error => {
457 this.showLoader = false; 457 this.showLoader = false;
458 // console.log("err====>", err); 458 // console.log("err====>", err);
459 }); 459 });
460 }, 460 },
461 getSections(_id) { 461 getSections(_id) {
462 this.showLoader = true; 462 this.showLoader = true;
463 http() 463 http()
464 .get( 464 .get(
465 "/getSectionsList", 465 "/getSectionsList",
466 { params: { classId: _id } }, 466 { params: { classId: _id } },
467 { 467 {
468 headers: { Authorization: "Bearer " + this.token } 468 headers: { Authorization: "Bearer " + this.token }
469 } 469 }
470 ) 470 )
471 .then(response => { 471 .then(response => {
472 this.addSection = response.data.data; 472 this.addSection = response.data.data;
473 this.showLoader = false; 473 this.showLoader = false;
474 }) 474 })
475 .catch(err => { 475 .catch(err => {
476 this.showLoader = false; 476 this.showLoader = false;
477 // console.log("err====>", err); 477 // console.log("err====>", err);
478 }); 478 });
479 }, 479 },
480 getStudents() { 480 getStudents() {
481 this.showLoader = true; 481 this.showLoader = true;
482 http() 482 http()
483 .get("/getStudentWithClass", { 483 .get("/getStudentWithClass", {
484 params: { 484 params: {
485 classId: this.getReport.classId, 485 classId: this.getReport.classId,
486 sectionId: this.getReport.sectionId 486 sectionId: this.getReport.sectionId
487 } 487 }
488 }) 488 })
489 .then(response => { 489 .then(response => {
490 response.data.data.unshift({ 490 response.data.data.unshift({
491 name: "Select All", 491 name: "Select All",
492 _id: "Select All" 492 _id: "Select All"
493 }); 493 });
494 this.getStudentsList = response.data.data; 494 this.getStudentsList = response.data.data;
495 this.showLoader = false; 495 this.showLoader = false;
496 // console.log("getSectionsList=====>", response.data.data); 496 // console.log("getSectionsList=====>", response.data.data);
497 }) 497 })
498 .catch(error => { 498 .catch(error => {
499 console.log("err====>", error); 499 console.log("err====>", error);
500 this.showLoader = false; 500 this.showLoader = false;
501 }); 501 });
502 }, 502 },
503 selectAllStudent() {
504 // console.log("this.studentId", this.getReport.studentId);
505 // this.invoiceData.students = [];
506 if (this.getReport.studentId === "Select All") {
507 for (let i = 1; i < this.getStudentsList.length; i++) {
508 // this.invoiceData.students.push(this.getStudentsList[i]._id);
509 console.log("data", this.getStudentsList[i]._id);
510 // data.push(this.studentList[i]._id);
511 // console.log("data", data);
512 }
513 } else {
514 this.invoiceData.students.push(this.invoiceData.studentId);
515 }
516 },
517 getMarkReportList() { 503 getMarkReportList() {
518 // this.showLoader = true; 504 // this.showLoader = true;
519 this.showReport = true; 505 this.showReport = true;
520 // http() 506 // http()
521 // .get("/getParticularMark", { 507 // .get("/getParticularMark", {
522 // params: { studentId: this.getReport.studentId }, 508 // params: { studentId: this.getReport.studentId },
523 // headers: { Authorization: "Bearer " + this.token } 509 // headers: { Authorization: "Bearer " + this.token }
524 // }) 510 // })
525 // .then(response => { 511 // .then(response => {
526 // this.showLoader = false; 512 // this.showLoader = false;
527 // this.cardData = response.data.data; 513 // this.cardData = response.data.data;
528 // let newData = response.data.data; 514 // let newData = response.data.data;
529 // for (var i = 0; i < newData.length; i++) { 515 // for (var i = 0; i < newData.length; i++) {
530 // newData[i].examination = newData[i].examId._id; 516 // newData[i].examination = newData[i].examId._id;
531 // } 517 // }
532 // this.filterData = _.groupBy(newData, ["examination"]); 518 // this.filterData = _.groupBy(newData, ["examination"]);
533 // for (let data in this.filterData) { 519 // for (let data in this.filterData) {
534 520
535 // for (let item in this.filterData[data]) { 521 // for (let item in this.filterData[data]) {
536 // var totalMarks = 0; 522 // var totalMarks = 0;
537 // for ( 523 // for (
538 // let i = 0; 524 // let i = 0;
539 // i < this.filterData[data][item].studentsMarks.length; 525 // i < this.filterData[data][item].studentsMarks.length;
540 // i++ 526 // i++
541 // ) { 527 // ) {
542 // totalMarks += this.filterData[data][item].studentsMarks[i] 528 // totalMarks += this.filterData[data][item].studentsMarks[i]
543 // .marksScored; 529 // .marksScored;
544 // } 530 // }
545 // this.filterData[data][item].totalMarks = totalMarks; 531 // this.filterData[data][item].totalMarks = totalMarks;
546 // var total = 0; 532 // var total = 0;
547 // total += this.filterData[data][item].totalMarks ; 533 // total += this.filterData[data][item].totalMarks ;
548 // console.log("total", total); 534 // console.log("total", total);
549 // } 535 // }
550 // } 536 // }
551 // }) 537 // })
538 // console.log(
539 // "getReport.classId",
540 // this.getReport.classId,
541 // "getReport.sectionId",
542 // this.getReport.sectionId,
543 // "getReport.studentId",
544 // this.getReport.studentId
545 // );
546
547 var getSelectMarks = {};
548 if (this.getReport.studentId == "Select All") {
549 getSelectMarks = {
550 classId: this.getReport.classId,
551 sectionId: this.getReport.sectionId
552 };
553 } else if(this.getReport.studentId != "Select All") {
554 getSelectMarks = {
555 classId: this.getReport.classId,
556 sectionId: this.getReport.sectionId,
557 studentId: this.getReport.studentId
558 };
559 }
552 http() 560 http()
553 .get("/getParticularMark", { 561 .get("/getParticularMark", {
554 params: { studentId: this.getReport.studentId }, 562 params: getSelectMarks,
555 headers: { Authorization: "Bearer " + this.token } 563 headers: { Authorization: "Bearer " + this.token }
556 }) 564 })
557 .then(response => { 565 .then(response => {
558 this.cardData = response.data.data; 566 this.cardData = response.data.data;
559 let newData = response.data.data; 567 let newData = response.data.data;
560 // console.log("newData", newData); 568 // console.log("newData", newData);
561 for (var i = 0; i < newData.length; i++) { 569 for (var i = 0; i < newData.length; i++) {
562 newData[i].examination = newData[i].examId._id; 570 newData[i].examination = newData[i].examId._id;
563 } 571 }
564 this.filterData = _.groupBy(newData, ["examination"]); 572 this.filterData = _.groupBy(newData, ["examination"]);
565 // console.log("this.filterData", this.filterData); 573 // console.log("this.filterData", this.filterData);
566 for (let data in this.filterData) { 574 for (let data in this.filterData) {
567 for (let item in this.filterData[data]) { 575 for (let item in this.filterData[data]) {
568 var totalMarks = 0; 576 var totalMarks = 0;
569 for ( 577 for (
570 let i = 0; 578 let i = 0;
571 i < this.filterData[data][item].studentsMarks.length; 579 i < this.filterData[data][item].studentsMarks.length;
572 i++ 580 i++
573 ) { 581 ) {
574 // console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i]
575 // .marksScored)
576 totalMarks += this.filterData[data][item].studentsMarks[i] 582 totalMarks += this.filterData[data][item].studentsMarks[i]
577 .marksScored; 583 .marksScored;
578 } 584 }
579 this.filterData[data][item].totalMarks = totalMarks; 585 this.filterData[data][item].totalMarks = totalMarks;
580 console.log("totalMarks", totalMarks); 586 console.log("totalMarks", totalMarks);
581 this.totalMarks = totalMarks; 587 this.totalMarks = totalMarks;
582 // console.log("this.filterData[data][item].grade", this.filterData[data][item].grade);
583 if (totalMarks > 90) { 588 if (totalMarks > 90) {
584 this.filterData[data][item].grade = this.gradeAPlus; 589 this.filterData[data][item].grade = this.gradeAPlus;
585 } else if (totalMarks > 80 && totalMarks < 90) { 590 } else if (totalMarks > 80 && totalMarks < 90) {
586 this.filterData[data][item].grade = this.gradeA; 591 this.filterData[data][item].grade = this.gradeA;
587 } else if (totalMarks > 70 && totalMarks < 80) { 592 } else if (totalMarks > 70 && totalMarks < 80) {
588 this.filterData[data][item].grade = this.gradeBPlus; 593 this.filterData[data][item].grade = this.gradeBPlus;
589 } else if (totalMarks > 60 && totalMarks < 70) { 594 } else if (totalMarks > 60 && totalMarks < 70) {
590 this.filterData[data][item].grade = this.gradeB; 595 this.filterData[data][item].grade = this.gradeB;
591 } else if (totalMarks > 50 && totalMarks < 60) { 596 } else if (totalMarks > 50 && totalMarks < 60) {
592 this.filterData[data][item].grade = this.gradeCPlus; 597 this.filterData[data][item].grade = this.gradeCPlus;
593 } else if (totalMarks > 40 && totalMarks < 50) { 598 } else if (totalMarks > 40 && totalMarks < 50) {
594 this.filterData[data][item].grade = this.gradeC; 599 this.filterData[data][item].grade = this.gradeC;
595 } 600 }
596 } 601 }
597 } 602 }
598 this.showLoader = false; 603 this.showLoader = false;
599 }) 604 })
600 .catch(error => { 605 .catch(error => {
601 // console.log("err====>", err); 606 // console.log("err====>", err);
602 this.showLoader = false; 607 this.showLoader = false;
603 this.snackbar = true; 608 this.snackbar = true;
604 // this.text = error.response.data.message; 609 // this.text = error.response.data.message;
605 // if (error.response.status === 401) { 610 // if (error.response.status === 401) {
606 // this.$router.replace({ path: "/" }); 611 // this.$router.replace({ path: "/" });
607 // this.$store.dispatch("setToken", null); 612 // this.$store.dispatch("setToken", null);
608 // this.$store.dispatch("Id", null); 613 // this.$store.dispatch("Id", null);
609 // } 614 // }
610 }); 615 });
611 }, 616 },
612 printProgressReport() { 617 printProgressReport() {
613 // Pass the element id here 618 // Pass the element id here
614 this.$htmlToPaper("printMe"); 619 this.$htmlToPaper("printMe");
615 }, 620 },
616 getUserData() { 621 getUserData() {
617 http() 622 http()
618 .get("/getParticularUserDetail") 623 .get("/getParticularUserDetail")
619 .then(response => { 624 .then(response => {
620 this.userData = response.data.data; 625 this.userData = response.data.data;
621 }) 626 })
622 .catch(error => { 627 .catch(error => {
623 // if (error.response.status === 401) { 628 // if (error.response.status === 401) {
624 // this.$router.replace({ path: "/" }); 629 // this.$router.replace({ path: "/" });
625 // this.$store.dispatch("setToken", null); 630 // this.$store.dispatch("setToken", null);
626 // this.$store.dispatch("Id", null); 631 // this.$store.dispatch("Id", null);
627 // } 632 // }
628 }); 633 });
629 } 634 }
630 } 635 }
631 }; 636 };
632 </script> 637 </script>
633 638
634 <style scoped> 639 <style scoped>
635 table { 640 table {
636 border-collapse: collapse; 641 border-collapse: collapse;
637 border: 1px solid #e2e7eb; 642 border: 1px solid #e2e7eb;
638 } 643 }
639 644
640 th, 645 th,
641 td { 646 td {
642 border: 1px solid #e2e7eb; 647 border: 1px solid #e2e7eb;
643 padding: 10px; 648 padding: 10px;
644 text-align: center; 649 text-align: center;
645 } 650 }
646 table.feeTypeTable { 651 table.feeTypeTable {
647 table-layout: auto !important; 652 table-layout: auto !important;
648 width: 100% !important; 653 width: 100% !important;
649 } 654 }
650 .bg-sky { 655 .bg-sky {
651 background-color: #98b2cc !important; 656 background-color: #98b2cc !important;
652 } 657 }
653 .bg-sky-light { 658 .bg-sky-light {
654 background-color: #89a0b8; 659 background-color: #89a0b8;
655 } 660 }
656 .bg-purple { 661 .bg-purple {
657 background-color: #9583ac; 662 background-color: #9583ac;
658 } 663 }
659 .bg-skyDark { 664 .bg-skyDark {
660 background-color: #956785; 665 background-color: #956785;
661 } 666 }
662 667
663 /* .report { 668 /* .report {
664 overflow: hidden; 669 overflow: hidden;
665 max-width: 794px; 670 max-width: 794px;
666 margin: 0px auto; 671 margin: 0px auto;
667 margin-bottom: 10px; 672 margin-bottom: 10px;
668 padding: 30px; 673 padding: 30px;
669 } */ 674 } */
670 .line { 675 .line {
671 border-bottom: 1px solid #ddd; 676 border-bottom: 1px solid #ddd;
672 overflow: hidden; 677 overflow: hidden;
673 padding-bottom: 10px; 678 padding-bottom: 10px;
674 vertical-align: middle; 679 vertical-align: middle;
675 margin-bottom: 4px; 680 margin-bottom: 4px;
676 } 681 }
677 .school-logo { 682 .school-logo {
678 float: left; 683 float: left;
679 } 684 }
680 .school-name { 685 .school-name {
681 box-sizing: border-box; 686 box-sizing: border-box;
682 } 687 }
683 .school-info { 688 .school-info {
684 width: 100%; 689 width: 100%;
685 overflow: hidden; 690 overflow: hidden;
686 } 691 }
687 .school-address { 692 .school-address {