@freteclick/quasar-financial-ui 1.0.85 → 1.0.87

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 +453 -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,210 +1,210 @@
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">
17
- <div class="text-h5 q-pt-sm q-pb-sm">{{ this.provider.name }}</div>
18
- </div>
19
- <div class="col-xs-12 col-sm-4">
20
- <q-markup-table flat dense
21
- separator="none"
22
- class ="bg-grey-4 full-height"
23
- >
24
- <tbody>
25
- <tr>
26
- <td class="text-left text-bold">Número da fatura</td>
27
- <td class="text-left">
28
- {{ `#${this.invoice['@id'].match(/^\/finance\/pay\/([a-z0-9-]*)$/)[1]}` }}
29
- </td>
30
- </tr>
31
- <tr>
32
- <td class="text-left text-bold">Valor da fatura</td>
33
- <td class="text-left">
34
- {{ formatMoney(this.invoice.price) }}
35
- </td>
36
- </tr>
37
- <tr>
38
- <td class="text-left text-bold">Vencimento</td>
39
- <td class="text-left">
40
- {{ this.invoice.dueDate }}
41
- </td>
42
- </tr>
43
- </tbody>
44
- </q-markup-table>
45
- </div>
46
- <div class ="col-xs-12 col-sm-8">
47
- <div
48
- class ="row items-center justify-center full-height rounded-borders"
49
- :style="`background-color: ${this.invoice.status.color}`"
50
- >
51
- <div class="text-white text-h6">
52
- {{ $t(`invoice.statuses.${invoice.status.status}`) }}
53
- </div>
54
- </div>
55
- </div>
56
- </div>
57
-
58
- <div v-if="invoice !== null"
59
- class="row"
60
- key ="order_tabs"
61
- >
62
- <div class="col-12">
63
- <q-tabs
64
- :horizontal="$q.screen.gt.xs"
65
- align ="justify"
66
- v-model ="currentTab"
67
- class ="bg-white text-primary"
68
- >
69
- <q-tab
70
- name ="details"
71
- label="Detalhes"
72
- />
73
- <q-tab
74
- name ="orders"
75
- label="Despesa"
76
- />
77
- </q-tabs>
78
-
79
- <q-separator />
80
-
81
- <q-tab-panels
82
- v-model="currentTab"
83
- >
84
- <q-tab-panel name="details" class="q-pa-none">
85
- <InvoiceInvoice
86
- :invoiceId="invoiceId"
87
- @updated ="requestInvoice(invoiceId)"
88
- />
89
- </q-tab-panel>
90
- <q-tab-panel name="orders" class="q-pa-none">
91
- <InvoiceOrders
92
- :invoiceId="invoiceId"
93
- />
94
- </q-tab-panel>
95
- </q-tab-panels>
96
- </div>
97
- </div>
98
-
99
- </transition-group>
100
-
101
- <div v-if="invoice === null && notFound"
102
- class="row items-center justify-center"
103
- style="min-height: 90vh;"
104
- >
105
- <q-banner class="text-white bg-red text-center text-h3" rounded>
106
- <template v-slot:avatar>
107
- <q-icon name="error" color="white" />
108
- </template>
109
- A fatura não foi encontrada
110
- </q-banner>
111
- </div>
112
- </q-card>
113
- </template>
114
-
115
- <script>
116
- import { mapActions, mapGetters } from 'vuex';
117
- import InvoiceOrders from './details/InvoiceOrders';
118
- import InvoiceInvoice from './details/InvoiceInvoice';
119
- import { formatMoney, formatDateYmdTodmY } from '@freteclick/quasar-common-ui/src/utils/formatter';
120
-
121
- export default {
122
- components: {
123
- InvoiceInvoice,
124
- InvoiceOrders ,
125
- },
126
-
127
- created() {
128
- if (this.$route.params.id)
129
- this.invoiceId = decodeURIComponent(this.$route.params.id);
130
-
131
- if (this.myCompany !== null && this.invoiceId !== null) {
132
- this.requestInvoice(this.invoiceId);
133
- }
134
- },
135
-
136
- data() {
137
- return {
138
- currentTab: 'details',
139
- invoiceId : null,
140
- orderId : null,
141
- invoice : null,
142
- isLoading : false,
143
- notFound : false,
144
- provider : {
145
- name: '',
146
- },
147
- };
148
- },
149
-
150
- computed: {
151
- ...mapGetters({
152
- myCompany: 'people/currentCompany',
153
- }),
154
- },
155
-
156
- watch: {
157
- myCompany(company) {
158
- if (company !== null) {
159
- this.requestInvoice(this.invoiceId);
160
- }
161
- },
162
- },
163
-
164
- methods: {
165
- ...mapActions({
166
- getInvoice: 'payInvoice/getInvoice',
167
- }),
168
-
169
- formatMoney(value) {
170
- return formatMoney(value, 'BRL', 'pt-br');
171
- },
172
-
173
- requestInvoice(invoiceId) {
174
- let params = {};
175
-
176
- params['myCompany'] = this.myCompany.id;
177
-
178
- this.isLoading = true;
179
-
180
- this.getInvoice({ invoiceId, params })
181
- .then(data => {
182
- this.isLoading = false;
183
-
184
- if (data['@id']) {
185
- this.invoice = data;
186
- this.notFound = false;
187
-
188
- // format date
189
-
190
- if (this.invoice.dueDate)
191
- this.invoice.dueDate = formatDateYmdTodmY(this.invoice.dueDate);
192
-
193
- // set order
194
-
195
- if (this.invoice.order.length > 0) {
196
- this.orderId = this.invoice.order[0].order['@id'].replace(/[^0-9]/g,'');
197
- this.provider.name = `${this.invoice.order[0].order.provider.name} ${this.invoice.order[0].order.provider.alias}`;
198
- }
199
- }
200
- })
201
- .catch(error => {
202
- this.provider.name = '';
203
- this.isLoading = false;
204
- this.invoice = null;
205
- this.notFound = true;
206
- });
207
- },
208
- },
209
- };
210
- </script>
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">
17
+ <div class="text-h5 q-pt-sm q-pb-sm">{{ this.provider.name }}</div>
18
+ </div>
19
+ <div class="col-xs-12 col-sm-4">
20
+ <q-markup-table flat dense
21
+ separator="none"
22
+ class ="bg-grey-4 full-height"
23
+ >
24
+ <tbody>
25
+ <tr>
26
+ <td class="text-left text-bold">Número da fatura</td>
27
+ <td class="text-left">
28
+ {{ `#${this.invoice['@id'].match(/^\/finance\/pay\/([a-z0-9-]*)$/)[1]}` }}
29
+ </td>
30
+ </tr>
31
+ <tr>
32
+ <td class="text-left text-bold">Valor da fatura</td>
33
+ <td class="text-left">
34
+ {{ formatMoney(this.invoice.price) }}
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td class="text-left text-bold">Vencimento</td>
39
+ <td class="text-left">
40
+ {{ this.invoice.dueDate }}
41
+ </td>
42
+ </tr>
43
+ </tbody>
44
+ </q-markup-table>
45
+ </div>
46
+ <div class ="col-xs-12 col-sm-8">
47
+ <div
48
+ class ="row items-center justify-center full-height rounded-borders"
49
+ :style="`background-color: ${this.invoice.status.color}`"
50
+ >
51
+ <div class="text-white text-h6">
52
+ {{ $t(`invoice.statuses.${invoice.status.status}`) }}
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+
58
+ <div v-if="invoice !== null"
59
+ class="row"
60
+ key ="order_tabs"
61
+ >
62
+ <div class="col-12">
63
+ <q-tabs
64
+ :horizontal="$q.screen.gt.xs"
65
+ align ="justify"
66
+ v-model ="currentTab"
67
+ class ="bg-white text-primary"
68
+ >
69
+ <q-tab
70
+ name ="details"
71
+ label="Detalhes"
72
+ />
73
+ <q-tab
74
+ name ="orders"
75
+ label="Despesa"
76
+ />
77
+ </q-tabs>
78
+
79
+ <q-separator />
80
+
81
+ <q-tab-panels
82
+ v-model="currentTab"
83
+ >
84
+ <q-tab-panel name="details" class="q-pa-none">
85
+ <InvoiceInvoice
86
+ :invoiceId="invoiceId"
87
+ @updated ="requestInvoice(invoiceId)"
88
+ />
89
+ </q-tab-panel>
90
+ <q-tab-panel name="orders" class="q-pa-none">
91
+ <InvoiceOrders
92
+ :invoiceId="invoiceId"
93
+ />
94
+ </q-tab-panel>
95
+ </q-tab-panels>
96
+ </div>
97
+ </div>
98
+
99
+ </transition-group>
100
+
101
+ <div v-if="invoice === null && notFound"
102
+ class="row items-center justify-center"
103
+ style="min-height: 90vh;"
104
+ >
105
+ <q-banner class="text-white bg-red text-center text-h3" rounded>
106
+ <template v-slot:avatar>
107
+ <q-icon name="error" color="white" />
108
+ </template>
109
+ A fatura não foi encontrada
110
+ </q-banner>
111
+ </div>
112
+ </q-card>
113
+ </template>
114
+
115
+ <script>
116
+ import { mapActions, mapGetters } from 'vuex';
117
+ import InvoiceOrders from './details/InvoiceOrders';
118
+ import InvoiceInvoice from './details/InvoiceInvoice';
119
+ import { formatMoney, formatDateYmdTodmY } from '@freteclick/quasar-common-ui/src/utils/formatter';
120
+
121
+ export default {
122
+ components: {
123
+ InvoiceInvoice,
124
+ InvoiceOrders ,
125
+ },
126
+
127
+ created() {
128
+ if (this.$route.params.id)
129
+ this.invoiceId = decodeURIComponent(this.$route.params.id);
130
+
131
+ if (this.myCompany !== null && this.invoiceId !== null) {
132
+ this.requestInvoice(this.invoiceId);
133
+ }
134
+ },
135
+
136
+ data() {
137
+ return {
138
+ currentTab: 'details',
139
+ invoiceId : null,
140
+ orderId : null,
141
+ invoice : null,
142
+ isLoading : false,
143
+ notFound : false,
144
+ provider : {
145
+ name: '',
146
+ },
147
+ };
148
+ },
149
+
150
+ computed: {
151
+ ...mapGetters({
152
+ myCompany: 'people/currentCompany',
153
+ }),
154
+ },
155
+
156
+ watch: {
157
+ myCompany(company) {
158
+ if (company !== null) {
159
+ this.requestInvoice(this.invoiceId);
160
+ }
161
+ },
162
+ },
163
+
164
+ methods: {
165
+ ...mapActions({
166
+ getInvoice: 'payInvoice/getInvoice',
167
+ }),
168
+
169
+ formatMoney(value) {
170
+ return formatMoney(value, 'BRL', 'pt-br');
171
+ },
172
+
173
+ requestInvoice(invoiceId) {
174
+ let params = {};
175
+
176
+ params['myCompany'] = this.myCompany.id;
177
+
178
+ this.isLoading = true;
179
+
180
+ this.getInvoice({ invoiceId, params })
181
+ .then(data => {
182
+ this.isLoading = false;
183
+
184
+ if (data['@id']) {
185
+ this.invoice = data;
186
+ this.notFound = false;
187
+
188
+ // format date
189
+
190
+ if (this.invoice.dueDate)
191
+ this.invoice.dueDate = formatDateYmdTodmY(this.invoice.dueDate);
192
+
193
+ // set order
194
+
195
+ if (this.invoice.order.length > 0) {
196
+ this.orderId = this.invoice.order[0].order['@id'].replace(/[^0-9]/g,'');
197
+ this.provider.name = `${this.invoice.order[0].order.provider.name} ${this.invoice.order[0].order.provider.alias}`;
198
+ }
199
+ }
200
+ })
201
+ .catch(error => {
202
+ this.provider.name = '';
203
+ this.isLoading = false;
204
+ this.invoice = null;
205
+ this.notFound = true;
206
+ });
207
+ },
208
+ },
209
+ };
210
+ </script>