Blame view

src/pages/Account/viewPaymentInvoice.vue 14.8 KB
81d876b5d   Shikha Mishra   salary invoice de...
1
2
3
4
  <template>
    <v-app id="pages-dasboard">
      <!-- ****** Edit INVOICE ****** -->
      <v-container fluid grid-list-md>
abce86599   Neeraj Sharma   testing sucess of...
5
6
7
8
9
10
11
12
13
        <v-flex xs12 sm12>
          <v-layout>
            <v-flex xs12 sm12 md10 class="mx-auto">
              <v-btn class="open-dialog-button mt-3" round dark @click="printInvoice()">
                Print
                <v-icon size="18" right dark>print</v-icon>
              </v-btn>
            </v-flex>
          </v-layout>
81d876b5d   Shikha Mishra   salary invoice de...
14
15
          <v-layout wrap>
            <!-- ****** TABLE DATA MARK  ****** -->
abce86599   Neeraj Sharma   testing sucess of...
16
            <v-flex xs12 sm12 md10 lg10 class="mx-auto" id="printMe">
c5110e900   Neeraj Sharma   fixed responsive ...
17
18
19
20
21
22
23
24
25
26
              <v-card
                style="
                 background-color: #fff;
                 border-color: #fff;
                 color: rgba(0,0,0,0.87);
                 border: 1px solid rgb(226, 231, 235);
                 -webkit-box-shadow: 0 1px 1px 0 rgba(60,64,67,0.08), 0 1px 3px 1px rgba(60,64,67,0.16);
                 box-shadow: 0 1px 1px 0 rgba(60,64,67,0.08), 0 1px 3px 1px rgba(60,64,67,0.16);"
              >
                <!-- <v-layout wrap> -->
abce86599   Neeraj Sharma   testing sucess of...
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
                <v-layout wrap>
                  <v-flex xs12 sm12 md12>
                    <div
                      style="    
                         border-bottom: 1px solid #ddd;
                         overflow: hidden;
                         vertical-align: middle;
                         margin: 10px;
                         padding-bottom: 10px;"
                    >
                      <v-flex xs12 sm12 md12>
                        <v-layout>
                          <div class="school-logo">
                            <v-avatar>
                              <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" />
                              <img
                                src="/static/schoolIcons/INTRACK_White.png"
                                v-else-if="!userData.schoolLogoUrl"
                              />
                            </v-avatar>
                          </div>
                          <div class="school-name">
                            <h2>{{ userData.name }}</h2>
                          </div>
                        </v-layout>
                      </v-flex>
                    </div>
                  </v-flex>
                  <!-- Profile School -->
                  <v-layout>
                    <!-- school info -->
                    <v-flex xs12 sm12 md12 lg12 style="margin:0px 10px; ">
                      <v-layout wrap>
                        <v-flex xs4 sm4 md4 lg4 style="padding:4px;padding-left:16px;">
                          <span style="font-size: 16px;  color: #707478;">From</span>
                          <br />
                          <p style="font-size:20px;margin-bottom: 16px;">{{ userData.name }}</p>
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >{{ userData.address }}</p>
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >Phone : {{ userData.mobile }}</p>
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >Email : {{ userData.email }}</p>
c5110e900   Neeraj Sharma   fixed responsive ...
73
                        </v-flex>
abce86599   Neeraj Sharma   testing sucess of...
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
                        <!-- student info -->
                        <v-flex xs4 sm4 md4 lg4 style="padding:4px;padding-left:16px;">
                          <span style="font-size: 16px;  color: #707478;">To</span>
                          <br />
                          <p
                            style="font-size:20px;margin-bottom: 16px;"
                          >{{ invoiceParticularData.studentId.name }}</p>
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >Class : {{ invoiceParticularData.classId.classNum }}</p>
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >Roll : {{ invoiceParticularData.studentId.rollNo }}</p>
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >Email : {{ invoiceParticularData.studentId.email ? invoiceParticularData.studentId.email: '-' }}</p>
c5110e900   Neeraj Sharma   fixed responsive ...
90
                        </v-flex>
abce86599   Neeraj Sharma   testing sucess of...
91
92
93
94
95
96
97
98
99
100
101
102
                        <v-flex xs4 sm4 md4 lg4 style="padding:4px;padding-left:16px;">
                          <br />
                          <p
                            style="font-size: 15px;margin:0px;margin-bottom:8px;"
                          >Invoice #{{ invoiceParticularData.invoiceNumber }}</p>
                          <br />
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >Status : {{ invoiceParticularData.paymentStatus }}</p>
                          <p
                            style="font-size: 15px;color: #707478;margin:0px;margin-bottom:8px;"
                          >Payment Method : {{ invoiceParticularData.paymentMethod }}</p>
c5110e900   Neeraj Sharma   fixed responsive ...
103
104
105
106
                        </v-flex>
                      </v-layout>
                    </v-flex>
                  </v-layout>
abce86599   Neeraj Sharma   testing sucess of...
107
                </v-layout>
c5110e900   Neeraj Sharma   fixed responsive ...
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
                <table
                  class="tableRsponsive"
                  style=" 
                     table-layout: auto !important;
                     width: 100% !important;
                     border-collapse: collapse;
                     border: 1px solid #e2e7eb;"
                >
                  <tr
                    class="white--text"
                    style="
                    background: #827bfa !important;
                    border-color: #827bfa !important;"
                  >
                    <th
                      style="  
                      border: 1px solid #e2e7eb;
                      padding: 10px;
                      text-align: center;"
                    >#</th>
                    <th
                      style=" 
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >Fee Type</th>
                    <th
                      style="
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >Amount</th>
                    <th
                      style="  
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >Discount</th>
                    <th
                      style=" 
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >Subtotal</th>
81d876b5d   Shikha Mishra   salary invoice de...
152
153
154
155
156
157
                  </tr>
                  <tr
                    v-for="(feeType, index) in feeTypeData"
                    :key="index"
                    v-on:keyup="getAmmountDetails(feeType)"
                  >
c5110e900   Neeraj Sharma   fixed responsive ...
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
                    <td
                      style="width:40px;   
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >{{ index + 1 }}</td>
                    <td
                      style="
                       width:120px;  
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >{{ feeType.feeTypeName }}</td>
                    <td
                      style="width:120px; 
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >{{ feeType.amount }}</td>
                    <td
                      style="width:120px; 
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >{{ feeType.amount-feeType.subTotal }}</td>
                    <td
                      style="width:120px;
                        border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                    >{{ feeType.subTotal }}</td>
81d876b5d   Shikha Mishra   salary invoice de...
189
190
191
                  </tr>
                  <tfoot>
                    <tr>
c5110e900   Neeraj Sharma   fixed responsive ...
192
193
194
195
196
197
198
199
                      <td
                        colspan="2"
                        style="
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                      >
                        <span style="float:right">Total Amount (RS) :</span>
81d876b5d   Shikha Mishra   salary invoice de...
200
                      </td>
c5110e900   Neeraj Sharma   fixed responsive ...
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
                      <td
                        style="
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                      >{{ feeType.amount }}</td>
                      <td
                        style="
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                      >{{ feeType.amount-feeType.subTotal }}</td>
                      <td
                        style="
                       border: 1px solid #e2e7eb;
                       padding: 10px;
                       text-align: center;"
                      >{{ feeType.subTotal }}</td>
81d876b5d   Shikha Mishra   salary invoice de...
219
                    </tr>
81d876b5d   Shikha Mishra   salary invoice de...
220
221
                  </tfoot>
                </table>
c5110e900   Neeraj Sharma   fixed responsive ...
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
                <v-layout>
                  <v-flex xs12>
                    <v-card
                      style="width:22%;
                    position:relative;
                    float:right !important;
                    margin:10px 0px;
                    -webkit-box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.2), 0px 0px 0px 0px rgba(0,0,0,0.14), 0px 0px 0px 0px rgba(0,0,0,0.12) !important;
                     box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.2), 0px 0px 0px 0px rgba(0,0,0,0.14), 0px 0px 0px 0px rgba(0,0,0,0.12) !important;"
                    >
                      <div
                        style="
                   min-height: 20px;
                   padding: 9px;
                   margin-bottom: 20px;
                   background-color: #f0f3f5;
                   border: 1px solid #E2E7EB;
                   border-radius: 3px;"
                      >
                        <p
                          style="
                    margin: 0 0 10px;    
                    font-size: 12px;"
                        >
                          Create By : Admin
                          <br />
                          Date : {{ dates(invoiceParticularData.created) }}
                        </p>
                      </div>
                    </v-card>
                  </v-flex>
                </v-layout>
81d876b5d   Shikha Mishra   salary invoice de...
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
              </v-card>
            </v-flex>
          </v-layout>
        </v-flex>
      </v-container>
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
    </v-app>
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import moment from "moment";
  
  export default {
    data: () => ({
      showLoader: false,
      feeTypes: [],
      filterData: [],
      invoiceData: {},
      feeType: {
        amount: "",
        discount: "",
        totalPaidAmount: "",
        subTotal: "",
        feeTypeName: ""
      },
      feeTypeData: [],
      token: "",
      invoiceParticularData: {
        studentId: {
          name: ""
        },
        classId: {
          classNum: ""
        }
      },
      userData: {
        name: ""
      }
    }),
  
    methods: {
c5110e900   Neeraj Sharma   fixed responsive ...
298
299
300
      dates: function(date) {
        return moment(date).format("MMMM DD, YYYY");
      },
81d876b5d   Shikha Mishra   salary invoice de...
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
      getInvoiceList() {
        http()
          .get("/getParticularInvoice", {
            params: {
              invoiceId: this.$route.params.viewPaymentInvoiceId,
              schoolId: this.$store.state.schoolId
            },
            headers: { Authorization: "Bearer " + this.token }
          })
          .then(response => {
            this.invoiceParticularData = response.data.data;
            this.invoiceData = this.invoiceParticularData;
            this.invoiceData.date = this.invoiceParticularData.date.slice(0, 10);
            this.feeTypeData = this.invoiceParticularData.feeType;
            (this.feeType.amount = response.data.data.totalAmount),
              (this.feeType.discount = response.data.data.totalDiscount),
              (this.feeType.subTotal = response.data.data.totalSubTotal),
              (this.feeType.totalPaidAmount = response.data.data.totalPaidAmount);
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
              this.$store.dispatch("Role", null);
            }
          });
      },
      getfeeType() {
        http()
          .get("/getFeesList", {
            params: { schoolId: this.$store.state.schoolId },
            headers: { Authorization: "Bearer " + this.token }
          })
          .then(response => {
            this.feeTypes = response.data.data;
          })
          .catch(err => {
            // console.log("err====>", err);
          });
      },
      getAmmountDetails(feeTyp) {
        let feeType = {
          subTotal: "",
          subParticularTotal: "",
          paidAmount: ""
        };
        // *********** SUBTOTAL ***********
        feeType.subTotal =
          Number(feeType.subTotal) + Number(this.feeTypeData[i].subTotal);
        this.feeType.subTotal = feeType.subTotal.toFixed(2);
        // *********** PAID-AMOUNT ***********
        feeType.paidAmount =
          Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
        this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
      },
      printInvoice() {
        // Pass the element id here
        this.$htmlToPaper("printMe");
      },
      getUserData() {
        http()
          .get("/getParticularUserDetail")
          .then(response => {
            this.userData = response.data.data;
          })
          .catch(error => {
c5110e900   Neeraj Sharma   fixed responsive ...
370
371
372
373
374
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
81d876b5d   Shikha Mishra   salary invoice de...
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
          });
      }
    },
    mounted() {
      this.token = this.$store.state.token;
      this.getInvoiceList();
      this.getfeeType();
      this.getUserData();
    },
    created() {
      this.$root.$on("app:search", search => {
        this.search = search;
      });
    },
    beforeDestroy() {
      // dont forget to remove the listener
      this.$root.$off("app:search");
    }
  };
  </script>
c5110e900   Neeraj Sharma   fixed responsive ...
395
396
  <style>
  /* table {
81d876b5d   Shikha Mishra   salary invoice de...
397
398
    border-collapse: collapse;
    border: 1px solid #e2e7eb;
c5110e900   Neeraj Sharma   fixed responsive ...
399
  } */
81d876b5d   Shikha Mishra   salary invoice de...
400
401
402
403
404
  .open-dialog-button {
    background: #827bfa !important;
    border-color: #827bfa !important;
    text-transform: none !important;
  }
c5110e900   Neeraj Sharma   fixed responsive ...
405
406
407
408
  .center {
    text-align: center !important;
  }
  /* th,
81d876b5d   Shikha Mishra   salary invoice de...
409
410
411
412
  td {
    border: 1px solid #e2e7eb;
    padding: 10px;
    text-align: center;
c5110e900   Neeraj Sharma   fixed responsive ...
413
  } */
81d876b5d   Shikha Mishra   salary invoice de...
414
415
416
417
418
419
420
421
422
423
424
425
  table.feeTypeTable {
    table-layout: auto !important;
    width: 100% !important;
  }
  @media screen and (max-width: 380px) {
    .tableRsponsive {
      display: block;
      position: relative;
      overflow: scroll;
    }
  }
  </style>