@freteclick/quasar-financial-ui 1.0.85
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 +18 -0
- package/src/components/common/Filters.vue +141 -0
- package/src/components/expense/FormExpense.vue +309 -0
- package/src/components/expense/TableExpenses.vue +305 -0
- package/src/components/invoice/client/ClientInvoiceDetails.vue +213 -0
- package/src/components/invoice/client/InvoiceSearching.vue +383 -0
- package/src/components/invoice/client/details/InvoiceInvoice.vue +249 -0
- package/src/components/invoice/client/details/InvoiceOrders.vue +328 -0
- package/src/components/invoice/expense/CreateExpense.vue +539 -0
- package/src/components/invoice/expense/DetailExpense.vue +393 -0
- package/src/components/invoice/pay/InvoiceDetails.vue +210 -0
- package/src/components/invoice/pay/InvoiceSearching.vue +388 -0
- package/src/components/invoice/pay/details/InvoiceInvoice.vue +47 -0
- package/src/components/invoice/pay/details/InvoiceOrders.vue +342 -0
- package/src/components/invoice/receive/InvoiceDetails.vue +281 -0
- package/src/components/invoice/receive/InvoiceSearching.vue +359 -0
- package/src/components/invoice/receive/details/InvoiceInvoice.vue +371 -0
- package/src/components/invoice/receive/details/InvoiceInvoiceBkp.vue +260 -0
- package/src/components/invoice/receive/details/InvoiceOrders.vue +370 -0
- package/src/i18n/en-us/index.js +8 -0
- package/src/i18n/index.js +5 -0
- package/src/i18n/pt-br/index.js +30 -0
- package/src/pages/Invoice/Client/Details.vue +23 -0
- package/src/pages/Invoice/Client/Index.vue +27 -0
- package/src/pages/Invoice/Pay/Details.vue +23 -0
- package/src/pages/Invoice/Pay/Index.vue +53 -0
- package/src/pages/Invoice/Receive/Details.vue +23 -0
- package/src/pages/Invoice/Receive/Index.vue +27 -0
- package/src/router/routes.js +32 -0
- package/src/store/modules/invoice/comission/actions.js +66 -0
- package/src/store/modules/invoice/comission/getters.js +7 -0
- package/src/store/modules/invoice/comission/index.js +19 -0
- package/src/store/modules/invoice/comission/mutation_types.js +8 -0
- package/src/store/modules/invoice/comission/mutations.js +42 -0
- package/src/store/modules/invoice/expense/actions.js +98 -0
- package/src/store/modules/invoice/expense/getters.js +1 -0
- package/src/store/modules/invoice/expense/index.js +12 -0
- package/src/store/modules/invoice/expense/mutations.js +3 -0
- package/src/store/modules/invoice/expense/state.js +5 -0
- package/src/store/modules/invoice/pay/actions.js +114 -0
- package/src/store/modules/invoice/pay/getters.js +7 -0
- package/src/store/modules/invoice/pay/index.js +19 -0
- package/src/store/modules/invoice/pay/mutation_types.js +8 -0
- package/src/store/modules/invoice/pay/mutations.js +42 -0
- package/src/store/modules/invoice/receive/actions.js +152 -0
- package/src/store/modules/invoice/receive/actionsBkp.js +77 -0
- package/src/store/modules/invoice/receive/getters.js +7 -0
- package/src/store/modules/invoice/receive/index.js +19 -0
- package/src/store/modules/invoice/receive/mutation_types.js +8 -0
- package/src/store/modules/invoice/receive/mutations.js +42 -0
- package/src/store/store-flag.d.ts +9 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-table
|
|
3
|
+
:loading="isLoading"
|
|
4
|
+
:data="data"
|
|
5
|
+
:columns="settings.columns"
|
|
6
|
+
:pagination.sync="pagination"
|
|
7
|
+
@request="onRequest"
|
|
8
|
+
row-key="@id"
|
|
9
|
+
:visible-columns="settings.visibleColumns"
|
|
10
|
+
style="min-height: 90vh"
|
|
11
|
+
>
|
|
12
|
+
<template v-slot:body="props">
|
|
13
|
+
<q-tr :props="props">
|
|
14
|
+
<q-td key="id" :props="props">
|
|
15
|
+
<q-btn
|
|
16
|
+
outline
|
|
17
|
+
dense
|
|
18
|
+
:to="{ name: 'OrderDetails', params: { id: props.row.id } }"
|
|
19
|
+
:label="`#${props.row.id}`"
|
|
20
|
+
:style="{ color: props.row.color_status }"
|
|
21
|
+
class="full-width"
|
|
22
|
+
/>
|
|
23
|
+
</q-td>
|
|
24
|
+
<q-td key="notaFiscal" :props="props">{{ props.row.notaFiscal }}</q-td>
|
|
25
|
+
<q-td key="dataPedido" :props="props">{{ props.cols[2].value }}</q-td>
|
|
26
|
+
<q-td key="ultimaModificacao" :props="props">{{
|
|
27
|
+
props.cols[3].value
|
|
28
|
+
}}</q-td>
|
|
29
|
+
<q-td
|
|
30
|
+
key="status"
|
|
31
|
+
:props="props"
|
|
32
|
+
:style="{ color: props.row.color_status }"
|
|
33
|
+
>
|
|
34
|
+
{{ $t(`order.statuses.${props.row.status}`) }}
|
|
35
|
+
</q-td>
|
|
36
|
+
<q-td key="coleta" :props="props">
|
|
37
|
+
{{ props.row.localColeta }}<br />{{ props.row.coleta }}
|
|
38
|
+
</q-td>
|
|
39
|
+
<q-td key="entrega" :props="props">
|
|
40
|
+
{{ props.row.localEntrega }}<br />{{ props.row.entrega }}
|
|
41
|
+
</q-td>
|
|
42
|
+
<q-td key="transportadora" :props="props">
|
|
43
|
+
{{ props.row.transportadora }}
|
|
44
|
+
</q-td>
|
|
45
|
+
<q-td key="preco" :props="props">{{ props.cols[8].value }}</q-td>
|
|
46
|
+
<q-td key="precoReal" :props="props">{{ props.cols[9].value }}</q-td>
|
|
47
|
+
<q-td
|
|
48
|
+
auto-width
|
|
49
|
+
v-if="invoice.status === 'pending' || invoice.billet === false"
|
|
50
|
+
key="removeAction"
|
|
51
|
+
>
|
|
52
|
+
<q-btn
|
|
53
|
+
flat
|
|
54
|
+
round
|
|
55
|
+
dense
|
|
56
|
+
color="red"
|
|
57
|
+
icon="delete"
|
|
58
|
+
@click="removeItem(props.row)"
|
|
59
|
+
:loading="props.row._bussy"
|
|
60
|
+
/>
|
|
61
|
+
</q-td>
|
|
62
|
+
</q-tr>
|
|
63
|
+
</template>
|
|
64
|
+
</q-table>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
import { mapActions, mapGetters } from "vuex";
|
|
69
|
+
import { date } from "quasar";
|
|
70
|
+
import { formatMoney } from "@freteclick/quasar-common-ui/src/utils/formatter";
|
|
71
|
+
|
|
72
|
+
const SETTINGS = {
|
|
73
|
+
visibleColumns: [
|
|
74
|
+
"id",
|
|
75
|
+
"notaFiscal",
|
|
76
|
+
"dataPedido",
|
|
77
|
+
"ultimaModificacao",
|
|
78
|
+
"status",
|
|
79
|
+
"coleta",
|
|
80
|
+
"entrega",
|
|
81
|
+
"transportadora",
|
|
82
|
+
"preco",
|
|
83
|
+
"precoReal",
|
|
84
|
+
"removeAction",
|
|
85
|
+
],
|
|
86
|
+
columns: [
|
|
87
|
+
{
|
|
88
|
+
name: "id",
|
|
89
|
+
field: "id",
|
|
90
|
+
align: "left",
|
|
91
|
+
label: "ID",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "notaFiscal",
|
|
95
|
+
field: "notaFiscal",
|
|
96
|
+
align: "left",
|
|
97
|
+
label: "Nota Fiscal",
|
|
98
|
+
format: (val, row) => {
|
|
99
|
+
return val ? "#" + val : "";
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "dataPedido",
|
|
104
|
+
field: "dataPedido",
|
|
105
|
+
align: "left",
|
|
106
|
+
format: (val, row) => {
|
|
107
|
+
return val.replace(
|
|
108
|
+
/^(\d{4})\-(\d{2})\-(\d{2})T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}$/g,
|
|
109
|
+
"$3/$2/$1"
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
label: "Data do pedido",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "ultimaModificacao",
|
|
116
|
+
field: "ultimaModificacao",
|
|
117
|
+
align: "left",
|
|
118
|
+
format: (val, row) => {
|
|
119
|
+
return date.formatDate(val, "DD/MM/YYYY HH:mm:ss");
|
|
120
|
+
},
|
|
121
|
+
label: "Ultima alteração",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "status",
|
|
125
|
+
field: "status",
|
|
126
|
+
align: "left",
|
|
127
|
+
label: "Status",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "coleta",
|
|
131
|
+
field: "coleta",
|
|
132
|
+
align: "left",
|
|
133
|
+
label: "Coleta",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "localColeta",
|
|
137
|
+
field: "localColeta",
|
|
138
|
+
align: "left",
|
|
139
|
+
label: "Local de coleta",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "entrega",
|
|
143
|
+
field: "entrega",
|
|
144
|
+
align: "left",
|
|
145
|
+
label: "Entrega",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: "localEntrega",
|
|
149
|
+
field: "localEntrega",
|
|
150
|
+
align: "left",
|
|
151
|
+
label: "Local de entrega",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "transportadora",
|
|
155
|
+
field: "transportadora",
|
|
156
|
+
align: "left",
|
|
157
|
+
label: "Transportadora",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "preco",
|
|
161
|
+
field: "preco",
|
|
162
|
+
align: "left",
|
|
163
|
+
format: (val, row) => {
|
|
164
|
+
return formatMoney(val, "BRL", "pt-br");
|
|
165
|
+
},
|
|
166
|
+
label: "Preço",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "precoReal",
|
|
170
|
+
field: "precoReal",
|
|
171
|
+
align: "left",
|
|
172
|
+
format: (val, row) => {
|
|
173
|
+
if (isNaN(val)) {
|
|
174
|
+
return val;
|
|
175
|
+
} else {
|
|
176
|
+
return formatMoney(val, "BRL", "pt-br");
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
label: "Preço Real",
|
|
180
|
+
},
|
|
181
|
+
{ name: "removeAction" },
|
|
182
|
+
],
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
Object.freeze(SETTINGS);
|
|
186
|
+
|
|
187
|
+
export default {
|
|
188
|
+
props: {
|
|
189
|
+
invoiceId: {
|
|
190
|
+
type: String,
|
|
191
|
+
required: false,
|
|
192
|
+
default: null,
|
|
193
|
+
},
|
|
194
|
+
invoice: {
|
|
195
|
+
type: Object,
|
|
196
|
+
required: true,
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
created() {
|
|
201
|
+
if (this.myCompany !== null) {
|
|
202
|
+
this.filters.company = this.myCompany;
|
|
203
|
+
this.onRequest({
|
|
204
|
+
pagination: this.pagination,
|
|
205
|
+
filter: this.filters,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
beforeDestroy() {
|
|
211
|
+
this.reset();
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
data() {
|
|
215
|
+
return {
|
|
216
|
+
settings: SETTINGS,
|
|
217
|
+
data: [],
|
|
218
|
+
filters: {
|
|
219
|
+
company: null,
|
|
220
|
+
},
|
|
221
|
+
pagination: {
|
|
222
|
+
sortBy: "ultimaModificacao",
|
|
223
|
+
descending: false,
|
|
224
|
+
page: 1,
|
|
225
|
+
rowsPerPage: 10,
|
|
226
|
+
rowsNumber: 10,
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
computed: {
|
|
232
|
+
...mapGetters({
|
|
233
|
+
isLoading: "salesOrder/isLoading",
|
|
234
|
+
error: "salesOrder/error",
|
|
235
|
+
violations: "salesOrder/violations",
|
|
236
|
+
items: "salesOrder/items",
|
|
237
|
+
totalItems: "salesOrder/totalItems",
|
|
238
|
+
myCompany: "people/currentCompany",
|
|
239
|
+
}),
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
watch: {
|
|
243
|
+
myCompany(company) {
|
|
244
|
+
if (company !== null) {
|
|
245
|
+
this.filters.company = company;
|
|
246
|
+
this.onRequest({
|
|
247
|
+
pagination: this.pagination,
|
|
248
|
+
filter: this.filters,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
totalItems(val) {
|
|
254
|
+
this.pagination.rowsNumber = val;
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
items(items) {
|
|
258
|
+
if (!items) return;
|
|
259
|
+
|
|
260
|
+
let data = [];
|
|
261
|
+
|
|
262
|
+
for (let index in items) {
|
|
263
|
+
let item = items[index];
|
|
264
|
+
|
|
265
|
+
data.push({
|
|
266
|
+
"@id": item["@id"],
|
|
267
|
+
id: item["@id"].match(/^\/sales\/orders\/([a-z0-9-]*)$/)[1],
|
|
268
|
+
notaFiscal:
|
|
269
|
+
item.invoiceTax.length > 0
|
|
270
|
+
? "#" + item.invoiceTax[0].invoiceTax.invoiceNumber
|
|
271
|
+
: "",
|
|
272
|
+
dataPedido: item.orderDate,
|
|
273
|
+
ultimaModificacao: item.alterDate,
|
|
274
|
+
status: item.status.status,
|
|
275
|
+
color_status: item.status.color,
|
|
276
|
+
fornecedor: item.client.alias,
|
|
277
|
+
coleta: item.retrievePeople !== null ? item.retrievePeople.name : "",
|
|
278
|
+
localColeta:
|
|
279
|
+
item.quote !== null
|
|
280
|
+
? `${item.quote.cityOrigin.city} / ${item.quote.cityOrigin.state.uf}`
|
|
281
|
+
: "",
|
|
282
|
+
entrega: item.deliveryPeople !== null ? item.deliveryPeople.name : "",
|
|
283
|
+
localEntrega:
|
|
284
|
+
item.quote !== null
|
|
285
|
+
? `${item.quote.cityDestination.city} / ${item.quote.cityDestination.state.uf}`
|
|
286
|
+
: "",
|
|
287
|
+
transportadora: item.quote !== null ? item.quote.carrier.name : "",
|
|
288
|
+
preco: item.price,
|
|
289
|
+
precoReal: this.getRealPrice(item),
|
|
290
|
+
_bussy: false,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
this.data = data;
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
methods: {
|
|
299
|
+
...mapActions({
|
|
300
|
+
getItems: "salesOrder/getItems",
|
|
301
|
+
reset: "salesOrder/reset",
|
|
302
|
+
removeOrder: "receiveInvoice/deleteInvoiceOrder",
|
|
303
|
+
}),
|
|
304
|
+
getRealPrice(invoice) {
|
|
305
|
+
let price = 0;
|
|
306
|
+
invoice.invoice.forEach((element) => {
|
|
307
|
+
if (element.invoice.id == this.invoiceId) {
|
|
308
|
+
price = element.realPrice;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
return price == invoice.price || price == 0 ? "-----" : price;
|
|
312
|
+
},
|
|
313
|
+
removeItem(item) {
|
|
314
|
+
if (window.confirm("Tem certeza que deseja eliminar este registro?")) {
|
|
315
|
+
item._bussy = true;
|
|
316
|
+
|
|
317
|
+
this.removeOrder({
|
|
318
|
+
invoiceId: this.invoice["@id"],
|
|
319
|
+
orderId: item.id,
|
|
320
|
+
params: {
|
|
321
|
+
myCompany: this.myCompany.id,
|
|
322
|
+
},
|
|
323
|
+
})
|
|
324
|
+
.then((result) => {
|
|
325
|
+
this.onRequest({
|
|
326
|
+
pagination: this.pagination,
|
|
327
|
+
filter: this.filters,
|
|
328
|
+
});
|
|
329
|
+
})
|
|
330
|
+
.catch((error) => {
|
|
331
|
+
this.$q.notify({
|
|
332
|
+
message: error.message,
|
|
333
|
+
position: "bottom",
|
|
334
|
+
type: "negative",
|
|
335
|
+
});
|
|
336
|
+
})
|
|
337
|
+
.finally(() => {
|
|
338
|
+
item._bussy = false;
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
|
|
343
|
+
onRequest(props) {
|
|
344
|
+
if (this.isLoading) return;
|
|
345
|
+
|
|
346
|
+
let { page, rowsPerPage, rowsNumber, sortBy, descending } =
|
|
347
|
+
props.pagination;
|
|
348
|
+
let filter = props.filter;
|
|
349
|
+
let params = { itemsPerPage: rowsPerPage, page };
|
|
350
|
+
|
|
351
|
+
if (this.filters.company != null) {
|
|
352
|
+
params["myCompany"] = this.filters.company.id;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (this.invoiceId !== null) {
|
|
356
|
+
params["invoice.invoice"] = this.invoiceId;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
params["order[alterDate]"] = "desc";
|
|
360
|
+
|
|
361
|
+
this.getItems(params).then(() => {
|
|
362
|
+
this.pagination.page = page;
|
|
363
|
+
this.pagination.rowsPerPage = rowsPerPage;
|
|
364
|
+
this.pagination.sortBy = sortBy;
|
|
365
|
+
this.pagination.descending = descending;
|
|
366
|
+
});
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// This is just an example,
|
|
2
|
+
// so you can safely delete all default props below
|
|
3
|
+
|
|
4
|
+
export const translate = {
|
|
5
|
+
purchase: 'Compra',
|
|
6
|
+
sale: 'Venda',
|
|
7
|
+
comission: 'Comissão',
|
|
8
|
+
royalties: 'Royalties',
|
|
9
|
+
finance: {
|
|
10
|
+
orders: 'Pedidos',
|
|
11
|
+
order: 'Pedido',
|
|
12
|
+
description: 'Descrição'
|
|
13
|
+
},
|
|
14
|
+
invoice: {
|
|
15
|
+
statuses: {
|
|
16
|
+
'waiting payment': 'Aguardando pagamento',
|
|
17
|
+
'paid': 'Pago',
|
|
18
|
+
'divergence of values': 'Divergência de valores',
|
|
19
|
+
'canceled': 'Cancelado',
|
|
20
|
+
'outdated billing': 'Fatura em atraso',
|
|
21
|
+
'open': 'Aberto',
|
|
22
|
+
'exceeded billing': 'Limite de faturamento excedido',
|
|
23
|
+
'waiting billing': 'Aguardando fatura',
|
|
24
|
+
'waiting generate invoice': 'Gerando NF',
|
|
25
|
+
'waiting for discount': 'Aguardando desconto',
|
|
26
|
+
'resolved': 'Resolvido'
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page padding>
|
|
3
|
+
<ClientInvoiceDetails />
|
|
4
|
+
</q-page>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import ClientInvoiceDetails from '../../../components/invoice/client/ClientInvoiceDetails';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name : 'ClientInvoiceDetailsPage',
|
|
12
|
+
|
|
13
|
+
components: {
|
|
14
|
+
ClientInvoiceDetails,
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
data () {
|
|
18
|
+
return {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page padding>
|
|
3
|
+
<div class="row">
|
|
4
|
+
<div class="col-12">
|
|
5
|
+
<InvoiceSearching />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</q-page>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import InvoiceSearching from '../../../components/invoice/client/InvoiceSearching';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name : 'ClientInvoiceIndexPage',
|
|
16
|
+
|
|
17
|
+
components: {
|
|
18
|
+
InvoiceSearching,
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
data () {
|
|
22
|
+
return {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page padding>
|
|
3
|
+
<InvoiceDetails />
|
|
4
|
+
</q-page>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import InvoiceDetails from '../../../components/invoice/pay/InvoiceDetails.vue';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name : 'InvoiceDetailsPage',
|
|
12
|
+
|
|
13
|
+
components: {
|
|
14
|
+
InvoiceDetails,
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
data () {
|
|
18
|
+
return {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page padding>
|
|
3
|
+
<q-card style="min-height: 90vh;" :bordered="false" :flat="true">
|
|
4
|
+
<q-card-section class="text-h6">
|
|
5
|
+
{{ $t('Contas a pagar') }}
|
|
6
|
+
</q-card-section>
|
|
7
|
+
<div class="row">
|
|
8
|
+
<div class="col-12">
|
|
9
|
+
<q-tabs :horizontal="$q.screen.gt.xs" align="justify" v-model="currentTab" class="bg-white text-primary">
|
|
10
|
+
<q-tab name="expenses" :label="$t('Despesas')" />
|
|
11
|
+
<q-tab name="categories" :label="$t('Categorias')" />
|
|
12
|
+
</q-tabs>
|
|
13
|
+
|
|
14
|
+
<q-separator />
|
|
15
|
+
|
|
16
|
+
<q-tab-panels v-model="currentTab">
|
|
17
|
+
<q-tab-panel name="expenses" class="q-px-none">
|
|
18
|
+
<InvoiceSearching />
|
|
19
|
+
</q-tab-panel>
|
|
20
|
+
|
|
21
|
+
<q-tab-panel name="categories" class="q-px-none">
|
|
22
|
+
<TableCategories :context="'expense'" :api="api" />
|
|
23
|
+
</q-tab-panel>
|
|
24
|
+
</q-tab-panels>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</q-card>
|
|
28
|
+
</q-page>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
import Api from '@freteclick/quasar-common-ui/src/utils/api';
|
|
33
|
+
import InvoiceSearching from '../../../components/invoice/pay/InvoiceSearching.vue';
|
|
34
|
+
import TableCategories from '@freteclick/quasar-common-ui/src/components/categories/Table.vue';
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
components: {
|
|
38
|
+
TableCategories,
|
|
39
|
+
InvoiceSearching,
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
currentTab: 'expenses',
|
|
45
|
+
api: new Api(this.$store.getters['auth/user'].token)
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
created() {
|
|
50
|
+
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page padding>
|
|
3
|
+
<InvoiceDetails />
|
|
4
|
+
</q-page>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import InvoiceDetails from '../../../components/invoice/receive/InvoiceDetails.vue';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name : 'InvoiceDetailsPage',
|
|
12
|
+
|
|
13
|
+
components: {
|
|
14
|
+
InvoiceDetails,
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
data () {
|
|
18
|
+
return {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-page padding>
|
|
3
|
+
<div class="row">
|
|
4
|
+
<div class="col-12">
|
|
5
|
+
<InvoiceSearching />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</q-page>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import InvoiceSearching from '../../../components/invoice/receive/InvoiceSearching.vue';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name : 'InvoiceIndexPage',
|
|
16
|
+
|
|
17
|
+
components: {
|
|
18
|
+
InvoiceSearching,
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
data () {
|
|
22
|
+
return {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
export const routes = [
|
|
3
|
+
{
|
|
4
|
+
path : '/finance/',
|
|
5
|
+
component: () => import('../../../../../src/layouts/AdminLayout.vue'),
|
|
6
|
+
children : [
|
|
7
|
+
{ name: 'ClientInvoiceIndex', path: 'client', component: () => import('../pages/Invoice/Client/Index.vue') },
|
|
8
|
+
{ name: 'ClientInvoiceDetails', path: 'client/id/:id', component: () => import('../pages/Invoice/Client/Details.vue') },
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
name: 'FinancePayIndex',
|
|
12
|
+
path: 'pay',
|
|
13
|
+
component: () => import('../pages/Invoice/Pay/Index.vue')
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'PayDetails',
|
|
17
|
+
path: 'pay/id/:id',
|
|
18
|
+
component: () => import('../pages/Invoice/Pay/Details.vue')
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'FinanceReceiveIndex',
|
|
22
|
+
path: 'receive',
|
|
23
|
+
component: () => import('../pages/Invoice/Receive/Index.vue')
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'ReceiveDetails',
|
|
27
|
+
path: 'receive/id/:id',
|
|
28
|
+
component: () => import('../pages/Invoice/Receive/Details.vue')
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import SubmissionError from '@freteclick/quasar-common-ui/src/error/SubmissionError';
|
|
2
|
+
import { fetch } from '../../../../../../../../src/boot/myapi';
|
|
3
|
+
import * as types from './mutation_types';
|
|
4
|
+
|
|
5
|
+
const RESOURCE_ENDPOINT = '/finance/comission';
|
|
6
|
+
|
|
7
|
+
export const getItems = ({ commit }, params = {}) => {
|
|
8
|
+
commit(types.SET_ISLOADING);
|
|
9
|
+
|
|
10
|
+
return fetch(RESOURCE_ENDPOINT, { params })
|
|
11
|
+
.then(response => response.json())
|
|
12
|
+
.then(data => {
|
|
13
|
+
commit(types.SET_ISLOADING , false);
|
|
14
|
+
|
|
15
|
+
commit(types.SET_ITEMS , data['hydra:member']);
|
|
16
|
+
commit(types.SET_VIEW , data['hydra:view']);
|
|
17
|
+
commit(types.SET_TOTALITEMS, data['hydra:totalItems']);
|
|
18
|
+
|
|
19
|
+
return data['hydra:member'];
|
|
20
|
+
|
|
21
|
+
}).catch(e => {
|
|
22
|
+
commit(types.SET_ISLOADING, false);
|
|
23
|
+
|
|
24
|
+
if (e instanceof SubmissionError) {
|
|
25
|
+
commit(types.SET_VIOLATIONS, e.errors);
|
|
26
|
+
// eslint-disable-next-line
|
|
27
|
+
commit(types.SET_ERROR, e.errors._error);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
commit(types.SET_ERROR, e.message);
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const reset = ({ commit }) => {
|
|
36
|
+
commit(types.RESET);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const getStatuses = ({ commit }, params = {}) => {
|
|
40
|
+
return fetch('/statuses', { params })
|
|
41
|
+
.then(response => response.json())
|
|
42
|
+
.then(data => {
|
|
43
|
+
|
|
44
|
+
return data['hydra:member'];
|
|
45
|
+
|
|
46
|
+
}).catch(e => {
|
|
47
|
+
if (e instanceof SubmissionError) {
|
|
48
|
+
commit(types.SET_VIOLATIONS, e.errors);
|
|
49
|
+
// eslint-disable-next-line
|
|
50
|
+
commit(types.SET_ERROR, e.errors._error);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
commit(types.SET_ERROR, e.message);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const getInvoice = ({ commit }, { invoiceId, params }) => {
|
|
59
|
+
return fetch(`/finance/comission/${invoiceId}`, { params })
|
|
60
|
+
.then(response => response.json())
|
|
61
|
+
.then(data => {
|
|
62
|
+
|
|
63
|
+
return data;
|
|
64
|
+
|
|
65
|
+
});
|
|
66
|
+
};
|