@freteclick/quasar-financial-ui 1.0.85 → 1.0.86

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.
Files changed (51) hide show
  1. package/package.json +17 -17
  2. package/src/components/common/Filters.vue +140 -140
  3. package/src/components/expense/FormExpense.vue +309 -309
  4. package/src/components/expense/TableExpenses.vue +305 -305
  5. package/src/components/invoice/client/ClientInvoiceDetails.vue +212 -212
  6. package/src/components/invoice/client/InvoiceSearching.vue +382 -382
  7. package/src/components/invoice/client/details/InvoiceInvoice.vue +248 -248
  8. package/src/components/invoice/client/details/InvoiceOrders.vue +327 -327
  9. package/src/components/invoice/expense/CreateExpense.vue +539 -539
  10. package/src/components/invoice/expense/DetailExpense.vue +393 -393
  11. package/src/components/invoice/pay/InvoiceDetails.vue +210 -210
  12. package/src/components/invoice/pay/InvoiceSearching.vue +388 -388
  13. package/src/components/invoice/pay/details/InvoiceInvoice.vue +47 -47
  14. package/src/components/invoice/pay/details/InvoiceOrders.vue +342 -342
  15. package/src/components/invoice/receive/InvoiceDetails.vue +280 -280
  16. package/src/components/invoice/receive/InvoiceSearching.vue +359 -359
  17. package/src/components/invoice/receive/details/InvoiceInvoice.vue +445 -371
  18. package/src/components/invoice/receive/details/InvoiceInvoiceBkp.vue +259 -259
  19. package/src/components/invoice/receive/details/InvoiceOrders.vue +369 -369
  20. package/src/i18n/en-us/index.js +8 -8
  21. package/src/i18n/index.js +5 -5
  22. package/src/i18n/pt-br/index.js +30 -30
  23. package/src/pages/Invoice/Client/Details.vue +23 -23
  24. package/src/pages/Invoice/Client/Index.vue +26 -26
  25. package/src/pages/Invoice/Pay/Details.vue +23 -23
  26. package/src/pages/Invoice/Pay/Index.vue +53 -53
  27. package/src/pages/Invoice/Receive/Details.vue +23 -23
  28. package/src/pages/Invoice/Receive/Index.vue +26 -26
  29. package/src/router/routes.js +32 -32
  30. package/src/store/modules/invoice/comission/actions.js +66 -66
  31. package/src/store/modules/invoice/comission/getters.js +6 -6
  32. package/src/store/modules/invoice/comission/index.js +19 -19
  33. package/src/store/modules/invoice/comission/mutation_types.js +7 -7
  34. package/src/store/modules/invoice/comission/mutations.js +42 -42
  35. package/src/store/modules/invoice/expense/actions.js +98 -98
  36. package/src/store/modules/invoice/expense/getters.js +1 -1
  37. package/src/store/modules/invoice/expense/index.js +12 -12
  38. package/src/store/modules/invoice/expense/mutations.js +3 -3
  39. package/src/store/modules/invoice/expense/state.js +5 -5
  40. package/src/store/modules/invoice/pay/actions.js +114 -114
  41. package/src/store/modules/invoice/pay/getters.js +6 -6
  42. package/src/store/modules/invoice/pay/index.js +19 -19
  43. package/src/store/modules/invoice/pay/mutation_types.js +7 -7
  44. package/src/store/modules/invoice/pay/mutations.js +42 -42
  45. package/src/store/modules/invoice/receive/actions.js +163 -152
  46. package/src/store/modules/invoice/receive/actionsBkp.js +77 -77
  47. package/src/store/modules/invoice/receive/getters.js +6 -6
  48. package/src/store/modules/invoice/receive/index.js +19 -19
  49. package/src/store/modules/invoice/receive/mutation_types.js +7 -7
  50. package/src/store/modules/invoice/receive/mutations.js +42 -42
  51. package/src/store/store-flag.d.ts +9 -9
@@ -1,213 +1,213 @@
1
- <template>
2
- <q-card style="min-height: 90vh;">
3
- <q-inner-loading :showing="isLoading">
4
- <q-spinner-gears size="50px" color="primary" />
5
- </q-inner-loading>
6
-
7
- <transition-group appear
8
- enter-active-class="animated fadeIn"
9
- leave-active-class="animated fadeOut"
10
- >
11
-
12
- <div v-if="invoice !== null"
13
- class="row q-pa-sm q-col-gutter-sm"
14
- key ="status"
15
- >
16
- <div class="col-xs-12 col-sm-4">
17
- <q-markup-table flat dense
18
- separator="none"
19
- class ="bg-grey-4 full-height"
20
- >
21
- <tbody>
22
- <tr>
23
- <td class="text-left text-bold">Número da fatura</td>
24
- <td class="text-left">
25
- {{ `#${this.invoice['@id'].match(/^\/finance\/pay\/([a-z0-9-]*)$/)[1]}` }}
26
- </td>
27
- </tr>
28
- <tr>
29
- <td class="text-left text-bold">Valor da fatura</td>
30
- <td class="text-left">
31
- {{ formatMoney(this.invoice.price) }}
32
- </td>
33
- </tr>
34
- <tr>
35
- <td class="text-left text-bold">Vencimento</td>
36
- <td class="text-left">
37
- {{ this.invoice.dueDate }}
38
- </td>
39
- </tr>
40
- </tbody>
41
- </q-markup-table>
42
- </div>
43
- <div class="col-xs-12 col-sm-8">
44
- <q-markup-table flat dense
45
- separator="none"
46
- class ="text-white full-height"
47
- :style ="`background-color: ${this.invoice.status.color}`"
48
- >
49
- <tbody>
50
- <tr>
51
- <td class="text-center">
52
- <div class="text-h6">{{ $t(`invoice.statuses.${invoice.status.status}`) }}</div>
53
- </td>
54
- </tr>
55
- <tr>
56
- <td class="text-center text-bold">
57
- <!--{{ $t(`order.statuses.${invoice.status.status}`+' text') }}-->
58
- </td>
59
- </tr>
60
- </tbody>
61
- </q-markup-table>
62
- </div>
63
- </div>
64
-
65
- <div v-if="invoice !== null"
66
- class="row"
67
- key ="order_tabs"
68
- >
69
- <div class="col-12">
70
- <q-tabs
71
- :horizontal="$q.screen.gt.xs"
72
- align ="justify"
73
- v-model ="currentTab"
74
- class ="bg-white text-primary"
75
- >
76
- <q-tab
77
- name ="invoice"
78
- label="Boleto"
79
- />
80
- <q-tab
81
- name ="orders"
82
- label="Pedidos"
83
- />
84
- </q-tabs>
85
-
86
- <q-separator />
87
-
88
- <q-tab-panels
89
- v-model="currentTab"
90
- >
91
- <q-tab-panel name="orders" class="q-pa-none">
92
- <InvoiceOrders :invoiceId="invoiceId" />
93
- </q-tab-panel>
94
-
95
- <q-tab-panel name="invoice" class="q-pa-none">
96
- <InvoiceInvoice
97
- :invoiceId="invoiceId"
98
- :orderId ="orderId"
99
- />
100
- </q-tab-panel>
101
- </q-tab-panels>
102
- </div>
103
- </div>
104
-
105
- </transition-group>
106
-
107
- <div v-if="invoice === null && notFound"
108
- class="row items-center justify-center"
109
- style="min-height: 90vh;"
110
- >
111
- <q-banner class="text-white bg-red text-center text-h3" rounded>
112
- <template v-slot:avatar>
113
- <q-icon name="error" color="white" />
114
- </template>
115
- A fatura não foi encontrada
116
- </q-banner>
117
- </div>
118
- </q-card>
119
- </template>
120
-
121
- <script>
122
- import { mapActions, mapGetters } from 'vuex';
123
- import InvoiceInvoice from './details/InvoiceInvoice';
124
- import InvoiceOrders from './details/InvoiceOrders';
125
- import { formatMoney } from '@freteclick/quasar-common-ui/src/utils/formatter';
126
-
127
- export default {
128
- components: {
129
- InvoiceInvoice,
130
- InvoiceOrders ,
131
- },
132
-
133
- created() {
134
- if (this.$route.params.id)
135
- this.invoiceId = decodeURIComponent(this.$route.params.id);
136
-
137
- if (this.myCompany !== null && this.invoiceId !== null) {
138
- this.requestInvoice(this.invoiceId);
139
- }
140
- },
141
-
142
- data() {
143
- return {
144
- currentTab: 'invoice',
145
- invoiceId : null,
146
- orderId : null,
147
- invoice : null,
148
- isLoading : false,
149
- notFound : false,
150
- };
151
- },
152
-
153
- computed: {
154
- ...mapGetters({
155
- myCompany: 'people/currentCompany',
156
- }),
157
- },
158
-
159
- watch: {
160
- myCompany(company) {
161
- if (company !== null) {
162
- this.requestInvoice(this.invoiceId);
163
- }
164
- },
165
- },
166
-
167
- methods: {
168
- ...mapActions({
169
- getInvoice: 'payInvoice/getInvoice',
170
- }),
171
-
172
- formatMoney(value) {
173
- return formatMoney(value, 'BRL', 'pt-br');
174
- },
175
-
176
- requestInvoice(invoiceId) {
177
- let params = {};
178
-
179
- params['myCompany'] = this.myCompany.id;
180
-
181
- this.isLoading = true;
182
-
183
- this.getInvoice({ invoiceId, params })
184
- .then(data => {
185
- this.isLoading = false;
186
-
187
- if (data['@id']) {
188
- this.invoice = data;
189
- this.notFound = false;
190
-
191
- // format date
192
-
193
- if (this.invoice.dueDate) {
194
- this.invoice.dueDate = this.invoice.dueDate
195
- .replace(/^(\d{4})\-(\d{2})\-(\d{2})T00:00:00\+00:00$/g,"\$3\/\$2\/\$1");
196
- }
197
-
198
- // set order
199
-
200
- if (this.invoice.order.length > 0) {
201
- this.orderId = this.invoice.order[0].order['@id'].match(/^\/purchasing\/orders\/([a-z0-9-]*)$/)[1];
202
- }
203
- }
204
- })
205
- .catch(error => {
206
- this.isLoading = false;
207
- this.invoice = null;
208
- this.notFound = true;
209
- });
210
- },
211
- },
212
- };
1
+ <template>
2
+ <q-card style="min-height: 90vh;">
3
+ <q-inner-loading :showing="isLoading">
4
+ <q-spinner-gears size="50px" color="primary" />
5
+ </q-inner-loading>
6
+
7
+ <transition-group appear
8
+ enter-active-class="animated fadeIn"
9
+ leave-active-class="animated fadeOut"
10
+ >
11
+
12
+ <div v-if="invoice !== null"
13
+ class="row q-pa-sm q-col-gutter-sm"
14
+ key ="status"
15
+ >
16
+ <div class="col-xs-12 col-sm-4">
17
+ <q-markup-table flat dense
18
+ separator="none"
19
+ class ="bg-grey-4 full-height"
20
+ >
21
+ <tbody>
22
+ <tr>
23
+ <td class="text-left text-bold">Número da fatura</td>
24
+ <td class="text-left">
25
+ {{ `#${this.invoice['@id'].match(/^\/finance\/pay\/([a-z0-9-]*)$/)[1]}` }}
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td class="text-left text-bold">Valor da fatura</td>
30
+ <td class="text-left">
31
+ {{ formatMoney(this.invoice.price) }}
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <td class="text-left text-bold">Vencimento</td>
36
+ <td class="text-left">
37
+ {{ this.invoice.dueDate }}
38
+ </td>
39
+ </tr>
40
+ </tbody>
41
+ </q-markup-table>
42
+ </div>
43
+ <div class="col-xs-12 col-sm-8">
44
+ <q-markup-table flat dense
45
+ separator="none"
46
+ class ="text-white full-height"
47
+ :style ="`background-color: ${this.invoice.status.color}`"
48
+ >
49
+ <tbody>
50
+ <tr>
51
+ <td class="text-center">
52
+ <div class="text-h6">{{ $t(`invoice.statuses.${invoice.status.status}`) }}</div>
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td class="text-center text-bold">
57
+ <!--{{ $t(`order.statuses.${invoice.status.status}`+' text') }}-->
58
+ </td>
59
+ </tr>
60
+ </tbody>
61
+ </q-markup-table>
62
+ </div>
63
+ </div>
64
+
65
+ <div v-if="invoice !== null"
66
+ class="row"
67
+ key ="order_tabs"
68
+ >
69
+ <div class="col-12">
70
+ <q-tabs
71
+ :horizontal="$q.screen.gt.xs"
72
+ align ="justify"
73
+ v-model ="currentTab"
74
+ class ="bg-white text-primary"
75
+ >
76
+ <q-tab
77
+ name ="invoice"
78
+ label="Boleto"
79
+ />
80
+ <q-tab
81
+ name ="orders"
82
+ label="Pedidos"
83
+ />
84
+ </q-tabs>
85
+
86
+ <q-separator />
87
+
88
+ <q-tab-panels
89
+ v-model="currentTab"
90
+ >
91
+ <q-tab-panel name="orders" class="q-pa-none">
92
+ <InvoiceOrders :invoiceId="invoiceId" />
93
+ </q-tab-panel>
94
+
95
+ <q-tab-panel name="invoice" class="q-pa-none">
96
+ <InvoiceInvoice
97
+ :invoiceId="invoiceId"
98
+ :orderId ="orderId"
99
+ />
100
+ </q-tab-panel>
101
+ </q-tab-panels>
102
+ </div>
103
+ </div>
104
+
105
+ </transition-group>
106
+
107
+ <div v-if="invoice === null && notFound"
108
+ class="row items-center justify-center"
109
+ style="min-height: 90vh;"
110
+ >
111
+ <q-banner class="text-white bg-red text-center text-h3" rounded>
112
+ <template v-slot:avatar>
113
+ <q-icon name="error" color="white" />
114
+ </template>
115
+ A fatura não foi encontrada
116
+ </q-banner>
117
+ </div>
118
+ </q-card>
119
+ </template>
120
+
121
+ <script>
122
+ import { mapActions, mapGetters } from 'vuex';
123
+ import InvoiceInvoice from './details/InvoiceInvoice';
124
+ import InvoiceOrders from './details/InvoiceOrders';
125
+ import { formatMoney } from '@freteclick/quasar-common-ui/src/utils/formatter';
126
+
127
+ export default {
128
+ components: {
129
+ InvoiceInvoice,
130
+ InvoiceOrders ,
131
+ },
132
+
133
+ created() {
134
+ if (this.$route.params.id)
135
+ this.invoiceId = decodeURIComponent(this.$route.params.id);
136
+
137
+ if (this.myCompany !== null && this.invoiceId !== null) {
138
+ this.requestInvoice(this.invoiceId);
139
+ }
140
+ },
141
+
142
+ data() {
143
+ return {
144
+ currentTab: 'invoice',
145
+ invoiceId : null,
146
+ orderId : null,
147
+ invoice : null,
148
+ isLoading : false,
149
+ notFound : false,
150
+ };
151
+ },
152
+
153
+ computed: {
154
+ ...mapGetters({
155
+ myCompany: 'people/currentCompany',
156
+ }),
157
+ },
158
+
159
+ watch: {
160
+ myCompany(company) {
161
+ if (company !== null) {
162
+ this.requestInvoice(this.invoiceId);
163
+ }
164
+ },
165
+ },
166
+
167
+ methods: {
168
+ ...mapActions({
169
+ getInvoice: 'payInvoice/getInvoice',
170
+ }),
171
+
172
+ formatMoney(value) {
173
+ return formatMoney(value, 'BRL', 'pt-br');
174
+ },
175
+
176
+ requestInvoice(invoiceId) {
177
+ let params = {};
178
+
179
+ params['myCompany'] = this.myCompany.id;
180
+
181
+ this.isLoading = true;
182
+
183
+ this.getInvoice({ invoiceId, params })
184
+ .then(data => {
185
+ this.isLoading = false;
186
+
187
+ if (data['@id']) {
188
+ this.invoice = data;
189
+ this.notFound = false;
190
+
191
+ // format date
192
+
193
+ if (this.invoice.dueDate) {
194
+ this.invoice.dueDate = this.invoice.dueDate
195
+ .replace(/^(\d{4})\-(\d{2})\-(\d{2})T00:00:00\+00:00$/g,"\$3\/\$2\/\$1");
196
+ }
197
+
198
+ // set order
199
+
200
+ if (this.invoice.order.length > 0) {
201
+ this.orderId = this.invoice.order[0].order['@id'].match(/^\/purchasing\/orders\/([a-z0-9-]*)$/)[1];
202
+ }
203
+ }
204
+ })
205
+ .catch(error => {
206
+ this.isLoading = false;
207
+ this.invoice = null;
208
+ this.notFound = true;
209
+ });
210
+ },
211
+ },
212
+ };
213
213
  </script>