@freteclick/quasar-financial-ui 1.0.90 → 1.0.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freteclick/quasar-financial-ui",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "author": "FreteClick",
5
5
  "description": "FreteClick financial Quasar UI Component",
6
6
  "license": "MIT",
@@ -1,39 +1,49 @@
1
1
  <template>
2
2
  <div class="row items-center justify-center">
3
3
  <div class="flex flex-center" v-if="isLoading">
4
- <q-circular-progress :indeterminate="isLoading"
5
- size="sm"
6
- color="primary"
7
- class="q-ma-md"
4
+ <q-circular-progress
5
+ :indeterminate="isLoading"
6
+ size="sm"
7
+ color="primary"
8
+ class="q-ma-md"
8
9
  />
9
10
  Carregando...
10
11
  </div>
11
12
 
12
- <!-- BILLET VIEWER SICRED -->
13
-
14
- <div :class="showBilletSicred ? 'full-width q-pa-lg' : 'hidden'">
15
-
16
- <div class="col-12 q-pt-lg" v-if=" paymentInstitution === 'sicred'">
17
- <div class="row justify-center items-center">
18
- <q-btn
19
- icon="money"
20
- size="lg"
21
- color="primary"
22
- label="Abrir Boleto Pix"
23
- :loading="isLoadingDownload"
24
- @click="clickDownloadBilletSicred()"
25
- :disable="isPaid"
26
- />
27
-
28
-
29
-
13
+ <div :class="showInfoBox ? 'full-width q-pa-lg' : 'hidden'">
14
+ <div class="q-pa-md q-gutter-sm">
15
+ <q-banner inline-actions rounded class="bg-primary text-white text-center">
16
+ <h6>Este boleto não pode ser gerado agora, pois a fatura está em aberto.</h6>
17
+ </q-banner>
30
18
  </div>
31
19
  </div>
32
20
 
21
+ <!-- BILLET VIEWER SICRED -->
22
+ <div :class="showBilletSicred ? 'full-width q-pa-lg' : 'hidden'">
23
+ <div class="col-12 q-pt-lg" v-if="paymentInstitution === 'sicred'">
24
+ <!-- <div class="row justify-center items-center">
25
+ <q-btn
26
+ icon="money"
27
+ size="lg"
28
+ color="primary"
29
+ label="Abrir Boleto Pix"
30
+ :loading="isLoadingDownload"
31
+ @click="clickDownloadBilletSicred()"
32
+ :disable="isPaid"
33
+ />
34
+ </div> -->
35
+
36
+ <div style="height: 1200px">
37
+ <iframe
38
+ :src="invoiceUrlSicred"
39
+ name="BILLETINTER" id="billet_sicred" width="100%" height="100%" frameBorder="0">
40
+ <p>This browser does not support IFrame.</p>
41
+ </iframe>
42
+ </div>
43
+ </div>
33
44
  </div>
34
45
 
35
46
  <!-- BILLET VIEWER INTER -->
36
-
37
47
  <div :class="showBilletInter ? 'full-width q-pa-lg' : 'hidden'">
38
48
  <div style="height: 1200px">
39
49
  <iframe
@@ -45,7 +55,6 @@
45
55
  </div>
46
56
 
47
57
  <!-- BILLET VIEWER ITAU -->
48
-
49
58
  <div :class="showBillet ? 'full-width q-pa-lg' : 'hidden'">
50
59
  <q-form
51
60
  ref="myForm"
@@ -56,7 +65,6 @@
56
65
  >
57
66
  <input type="hidden" name="DC" :value="itauHash"/>
58
67
  </q-form>
59
-
60
68
  <div style="height: 1200px">
61
69
  <iframe name="BILLET" width="100%" height="100%" frameBorder="0">
62
70
  <p>This browser does not support IFrame.</p>
@@ -65,7 +73,6 @@
65
73
  </div>
66
74
 
67
75
  <!-- BILLET GENERATOR TRIGGER -->
68
-
69
76
  <div class="col-12 q-pt-lg" v-if="paymentIsPending && billetMustBeCreated && paymentInstitution === 'itau'">
70
77
  <div style="min-height: 80vh;" class="row justify-center items-center">
71
78
  <q-btn
@@ -99,7 +106,6 @@
99
106
  </div>
100
107
 
101
108
  <!-- PAID MESSAGE -->
102
-
103
109
  <div class="col-12" v-if="payment !== null && isPaid">
104
110
  <div class="row items-center justify-center" style="min-height: 90vh;">
105
111
  <q-banner class="text-white bg-positive text-center text-h3" rounded>
@@ -118,9 +124,6 @@ import {mapActions, mapGetters} from 'vuex';
118
124
  import axios from 'axios';
119
125
  import {ENTRYPOINT} from '../../../../../../../../src/config/entrypoint';
120
126
 
121
-
122
-
123
-
124
127
  export default {
125
128
  props: {
126
129
  invoiceId: {
@@ -133,9 +136,7 @@ export default {
133
136
  },
134
137
  },
135
138
 
136
- components: {
137
-
138
- },
139
+ components: {},
139
140
 
140
141
  mounted() {
141
142
  window.addEventListener('focus', this.loadItauDataOnFocus);
@@ -155,6 +156,7 @@ export default {
155
156
  invoiceUrlSicred: null,
156
157
  showBilletInter: null,
157
158
  showBilletSicred: null,
159
+ showInfoBox: null,
158
160
  isLoadingDownload: false,
159
161
  isLoading: false,
160
162
  payment: null,
@@ -163,7 +165,7 @@ export default {
163
165
  showBillet: false,
164
166
  loadOnFocus: false,
165
167
  retrievingHash: false,
166
- paymentInstitution: null // 'itau','inter'
168
+ paymentInstitution: null
167
169
  };
168
170
  },
169
171
 
@@ -198,9 +200,16 @@ export default {
198
200
 
199
201
  this.isPaid = data.paymentStatus === 'paid';
200
202
 
203
+ if(this.payment.paymentStatus === 'open')
204
+ {
205
+ this.showInfoBox = true;
206
+ }
207
+
201
208
  if (data.paymentType == 'billet') {
202
209
 
203
- // if (data.paymentStatus == 'created' && this.isPaid === false) {
210
+ if (data.paymentStatus !== 'open') {
211
+
212
+ this.showInfoBox = false;
204
213
 
205
214
  if (this.paymentInstitution === 'itau') {
206
215
  this.getItauHash().then(hash => {
@@ -221,18 +230,14 @@ export default {
221
230
  else {
222
231
 
223
232
  this.showBillet = false;
224
- let urlTmp = ENTRYPOINT + `/download?invoiceUrl=${this.payment.invoiceUrl}`;
233
+ let urlTmp = ENTRYPOINT + `/vendor/pdf.js/web/viewer.html?file=/finance/${this.invoiceId}/bank/sicred/download?timestamp${new Date().getTime()}`;
234
+ // let urlTmp = ENTRYPOINT + `/download?invoiceUrl=${this.payment.invoiceUrl}`;
225
235
  this.invoiceUrlSicred = urlTmp;
226
236
  this.isLoading = false;
227
237
  this.showBilletSicred = true;
228
238
 
229
239
  }
230
- // } else {
231
- // this.showBillet = false;
232
- // if (this.paymentInstitution === 'sicred') {
233
- // this.isPaid = data.status === 'paid';
234
- // }
235
- // }
240
+ }
236
241
 
237
242
  }
238
243
 
@@ -360,7 +365,7 @@ export default {
360
365
 
361
366
  return this.getBank().then(data2 => {
362
367
 
363
- if (this.paymentInstitution === 'itau') { // ------------------------------ Banco 'itau'
368
+ if (this.paymentInstitution === 'itau') {
364
369
 
365
370
  this.getItauData({
366
371
  invoiceId: this.invoiceId,
@@ -378,7 +383,7 @@ export default {
378
383
  // this.isLoading = false;
379
384
  });
380
385
 
381
- } else if(this.paymentInstitution === 'inter'){ // ------------------------------ Banco 'inter'
386
+ } else if(this.paymentInstitution === 'inter'){
382
387
 
383
388
  this.getInterData({
384
389
  invoiceId: this.invoiceId,
@@ -411,7 +416,7 @@ export default {
411
416
  });
412
417
 
413
418
  }
414
- else { // ------------------------------ Banco 'Sicred'
419
+ else {
415
420
 
416
421
  this.getSicredData({
417
422
  invoiceId: this.invoiceId,
@@ -206,8 +206,8 @@ export default {
206
206
  data: [],
207
207
  filters: {
208
208
  orderType: {
209
- label: "Todos",
210
- value: null,
209
+ label: "Venda",
210
+ value: "sale",
211
211
  },
212
212
  date: {
213
213
  from: "",
@@ -1,39 +1,49 @@
1
1
  <template>
2
2
  <div class="row items-center justify-center">
3
3
  <div class="flex flex-center" v-if="isLoading">
4
- <q-circular-progress :indeterminate="isLoading"
5
- size="sm"
6
- color="primary"
7
- class="q-ma-md"
4
+ <q-circular-progress
5
+ :indeterminate="isLoading"
6
+ size="sm"
7
+ color="primary"
8
+ class="q-ma-md"
8
9
  />
9
10
  Carregando...
10
11
  </div>
11
12
 
12
- <!-- BILLET VIEWER SICRED -->
13
-
14
- <div :class="showBilletSicred ? 'full-width q-pa-lg' : 'hidden'">
15
-
16
- <div class="col-12 q-pt-lg" v-if=" paymentInstitution === 'sicred'">
17
- <div class="row justify-center items-center">
18
- <q-btn
19
- icon="money"
20
- size="lg"
21
- color="primary"
22
- label="Abrir Boleto Pix"
23
- :loading="isLoadingDownload"
24
- @click="clickDownloadBilletSicred()"
25
- :disable="isPaid"
26
- />
27
-
28
-
29
-
13
+ <div :class="showInfoBox ? 'full-width q-pa-lg' : 'hidden'">
14
+ <div class="q-pa-md q-gutter-sm">
15
+ <q-banner inline-actions rounded class="bg-primary text-white text-center">
16
+ <h6>Este boleto não pode ser gerado agora, pois a fatura está em aberto.</h6>
17
+ </q-banner>
30
18
  </div>
31
19
  </div>
32
20
 
21
+ <!-- BILLET VIEWER SICRED -->
22
+ <div :class="showBilletSicred ? 'full-width q-pa-lg' : 'hidden'">
23
+ <div class="col-12 q-pt-lg" v-if="paymentInstitution === 'sicred'">
24
+ <!-- <div class="row justify-center items-center">
25
+ <q-btn
26
+ icon="money"
27
+ size="lg"
28
+ color="primary"
29
+ label="Abrir Boleto Pix"
30
+ :loading="isLoadingDownload"
31
+ @click="clickDownloadBilletSicred()"
32
+ :disable="isPaid"
33
+ />
34
+ </div> -->
35
+
36
+ <div style="height: 1200px">
37
+ <iframe
38
+ :src="invoiceUrlSicred"
39
+ name="BILLETINTER" id="billet_sicred" width="100%" height="100%" frameBorder="0">
40
+ <p>This browser does not support IFrame.</p>
41
+ </iframe>
42
+ </div>
43
+ </div>
33
44
  </div>
34
45
 
35
46
  <!-- BILLET VIEWER INTER -->
36
-
37
47
  <div :class="showBilletInter ? 'full-width q-pa-lg' : 'hidden'">
38
48
  <div style="height: 1200px">
39
49
  <iframe
@@ -45,7 +55,6 @@
45
55
  </div>
46
56
 
47
57
  <!-- BILLET VIEWER ITAU -->
48
-
49
58
  <div :class="showBillet ? 'full-width q-pa-lg' : 'hidden'">
50
59
  <q-form
51
60
  ref="myForm"
@@ -56,7 +65,6 @@
56
65
  >
57
66
  <input type="hidden" name="DC" :value="itauHash"/>
58
67
  </q-form>
59
-
60
68
  <div style="height: 1200px">
61
69
  <iframe name="BILLET" width="100%" height="100%" frameBorder="0">
62
70
  <p>This browser does not support IFrame.</p>
@@ -65,7 +73,6 @@
65
73
  </div>
66
74
 
67
75
  <!-- BILLET GENERATOR TRIGGER -->
68
-
69
76
  <div class="col-12 q-pt-lg" v-if="paymentIsPending && billetMustBeCreated && paymentInstitution === 'itau'">
70
77
  <div style="min-height: 80vh;" class="row justify-center items-center">
71
78
  <q-btn
@@ -99,7 +106,6 @@
99
106
  </div>
100
107
 
101
108
  <!-- PAID MESSAGE -->
102
-
103
109
  <div class="col-12" v-if="payment !== null && isPaid">
104
110
  <div class="row items-center justify-center" style="min-height: 90vh;">
105
111
  <q-banner class="text-white bg-positive text-center text-h3" rounded>
@@ -118,9 +124,6 @@ import {mapActions, mapGetters} from 'vuex';
118
124
  import axios from 'axios';
119
125
  import {ENTRYPOINT} from '../../../../../../../../src/config/entrypoint';
120
126
 
121
-
122
-
123
-
124
127
  export default {
125
128
  props: {
126
129
  invoiceId: {
@@ -133,9 +136,7 @@ export default {
133
136
  },
134
137
  },
135
138
 
136
- components: {
137
-
138
- },
139
+ components: {},
139
140
 
140
141
  mounted() {
141
142
  window.addEventListener('focus', this.loadItauDataOnFocus);
@@ -155,6 +156,7 @@ export default {
155
156
  invoiceUrlSicred: null,
156
157
  showBilletInter: null,
157
158
  showBilletSicred: null,
159
+ showInfoBox: null,
158
160
  isLoadingDownload: false,
159
161
  isLoading: false,
160
162
  payment: null,
@@ -163,7 +165,7 @@ export default {
163
165
  showBillet: false,
164
166
  loadOnFocus: false,
165
167
  retrievingHash: false,
166
- paymentInstitution: null // 'itau','inter'
168
+ paymentInstitution: null
167
169
  };
168
170
  },
169
171
 
@@ -198,9 +200,16 @@ export default {
198
200
 
199
201
  this.isPaid = data.paymentStatus === 'paid';
200
202
 
203
+ if(this.payment.paymentStatus === 'open')
204
+ {
205
+ this.showInfoBox = true;
206
+ }
207
+
201
208
  if (data.paymentType == 'billet') {
202
209
 
203
- // if (data.paymentStatus == 'created' && this.isPaid === false) {
210
+ if (data.paymentStatus !== 'open') {
211
+
212
+ this.showInfoBox = false;
204
213
 
205
214
  if (this.paymentInstitution === 'itau') {
206
215
  this.getItauHash().then(hash => {
@@ -221,18 +230,14 @@ export default {
221
230
  else {
222
231
 
223
232
  this.showBillet = false;
224
- let urlTmp = ENTRYPOINT + `/download?invoiceUrl=${this.payment.invoiceUrl}`;
233
+ let urlTmp = ENTRYPOINT + `/vendor/pdf.js/web/viewer.html?file=/finance/${this.invoiceId}/bank/sicred/download?timestamp${new Date().getTime()}`;
234
+ // let urlTmp = ENTRYPOINT + `/download?invoiceUrl=${this.payment.invoiceUrl}`;
225
235
  this.invoiceUrlSicred = urlTmp;
226
236
  this.isLoading = false;
227
237
  this.showBilletSicred = true;
228
238
 
229
239
  }
230
- // } else {
231
- // this.showBillet = false;
232
- // if (this.paymentInstitution === 'sicred') {
233
- // this.isPaid = data.status === 'paid';
234
- // }
235
- // }
240
+ }
236
241
 
237
242
  }
238
243
 
@@ -360,7 +365,7 @@ export default {
360
365
 
361
366
  return this.getBank().then(data2 => {
362
367
 
363
- if (this.paymentInstitution === 'itau') { // ------------------------------ Banco 'itau'
368
+ if (this.paymentInstitution === 'itau') {
364
369
 
365
370
  this.getItauData({
366
371
  invoiceId: this.invoiceId,
@@ -378,7 +383,7 @@ export default {
378
383
  // this.isLoading = false;
379
384
  });
380
385
 
381
- } else if(this.paymentInstitution === 'inter'){ // ------------------------------ Banco 'inter'
386
+ } else if(this.paymentInstitution === 'inter'){
382
387
 
383
388
  this.getInterData({
384
389
  invoiceId: this.invoiceId,
@@ -411,7 +416,7 @@ export default {
411
416
  });
412
417
 
413
418
  }
414
- else { // ------------------------------ Banco 'Sicred'
419
+ else {
415
420
 
416
421
  this.getSicredData({
417
422
  invoiceId: this.invoiceId,