@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.
- package/package.json +17 -17
- package/src/components/common/Filters.vue +140 -140
- package/src/components/expense/FormExpense.vue +309 -309
- package/src/components/expense/TableExpenses.vue +305 -305
- package/src/components/invoice/client/ClientInvoiceDetails.vue +212 -212
- package/src/components/invoice/client/InvoiceSearching.vue +382 -382
- package/src/components/invoice/client/details/InvoiceInvoice.vue +248 -248
- package/src/components/invoice/client/details/InvoiceOrders.vue +327 -327
- package/src/components/invoice/expense/CreateExpense.vue +539 -539
- package/src/components/invoice/expense/DetailExpense.vue +393 -393
- package/src/components/invoice/pay/InvoiceDetails.vue +210 -210
- package/src/components/invoice/pay/InvoiceSearching.vue +388 -388
- package/src/components/invoice/pay/details/InvoiceInvoice.vue +47 -47
- package/src/components/invoice/pay/details/InvoiceOrders.vue +342 -342
- package/src/components/invoice/receive/InvoiceDetails.vue +280 -280
- package/src/components/invoice/receive/InvoiceSearching.vue +359 -359
- package/src/components/invoice/receive/details/InvoiceInvoice.vue +453 -371
- package/src/components/invoice/receive/details/InvoiceInvoiceBkp.vue +259 -259
- package/src/components/invoice/receive/details/InvoiceOrders.vue +369 -369
- package/src/i18n/en-us/index.js +8 -8
- package/src/i18n/index.js +5 -5
- package/src/i18n/pt-br/index.js +30 -30
- package/src/pages/Invoice/Client/Details.vue +23 -23
- package/src/pages/Invoice/Client/Index.vue +26 -26
- package/src/pages/Invoice/Pay/Details.vue +23 -23
- package/src/pages/Invoice/Pay/Index.vue +53 -53
- package/src/pages/Invoice/Receive/Details.vue +23 -23
- package/src/pages/Invoice/Receive/Index.vue +26 -26
- package/src/router/routes.js +32 -32
- package/src/store/modules/invoice/comission/actions.js +66 -66
- package/src/store/modules/invoice/comission/getters.js +6 -6
- package/src/store/modules/invoice/comission/index.js +19 -19
- package/src/store/modules/invoice/comission/mutation_types.js +7 -7
- package/src/store/modules/invoice/comission/mutations.js +42 -42
- package/src/store/modules/invoice/expense/actions.js +98 -98
- package/src/store/modules/invoice/expense/getters.js +1 -1
- package/src/store/modules/invoice/expense/index.js +12 -12
- package/src/store/modules/invoice/expense/mutations.js +3 -3
- package/src/store/modules/invoice/expense/state.js +5 -5
- package/src/store/modules/invoice/pay/actions.js +114 -114
- package/src/store/modules/invoice/pay/getters.js +6 -6
- package/src/store/modules/invoice/pay/index.js +19 -19
- package/src/store/modules/invoice/pay/mutation_types.js +7 -7
- package/src/store/modules/invoice/pay/mutations.js +42 -42
- package/src/store/modules/invoice/receive/actions.js +163 -152
- package/src/store/modules/invoice/receive/actionsBkp.js +77 -77
- package/src/store/modules/invoice/receive/getters.js +6 -6
- package/src/store/modules/invoice/receive/index.js +19 -19
- package/src/store/modules/invoice/receive/mutation_types.js +7 -7
- package/src/store/modules/invoice/receive/mutations.js +42 -42
- package/src/store/store-flag.d.ts +9 -9
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as actions from './actions';
|
|
2
|
-
import * as getters from './getters';
|
|
3
|
-
import mutations from './mutations';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
namespaced: true,
|
|
7
|
-
state : {
|
|
8
|
-
isLoading : false,
|
|
9
|
-
error : '',
|
|
10
|
-
violations: null,
|
|
11
|
-
retrieved : null,
|
|
12
|
-
totalItems: 10,
|
|
13
|
-
items : [],
|
|
14
|
-
view : [],
|
|
15
|
-
},
|
|
16
|
-
actions,
|
|
17
|
-
getters,
|
|
18
|
-
mutations,
|
|
19
|
-
};
|
|
1
|
+
import * as actions from './actions';
|
|
2
|
+
import * as getters from './getters';
|
|
3
|
+
import mutations from './mutations';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
namespaced: true,
|
|
7
|
+
state : {
|
|
8
|
+
isLoading : false,
|
|
9
|
+
error : '',
|
|
10
|
+
violations: null,
|
|
11
|
+
retrieved : null,
|
|
12
|
+
totalItems: 10,
|
|
13
|
+
items : [],
|
|
14
|
+
view : [],
|
|
15
|
+
},
|
|
16
|
+
actions,
|
|
17
|
+
getters,
|
|
18
|
+
mutations,
|
|
19
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export const SET_ERROR = 'SET_ERROR';
|
|
2
|
-
export const SET_ISLOADING = 'SET_ISLOADING';
|
|
3
|
-
export const SET_VIOLATIONS = 'SET_VIOLATIONS';
|
|
4
|
-
export const SET_ITEMS = 'SET_ITEMS';
|
|
5
|
-
export const SET_VIEW = 'SET_VIEW';
|
|
6
|
-
export const SET_TOTALITEMS = 'SET_TOTALITEMS';
|
|
7
|
-
export const SET_RETRIEVED = 'SET_RETRIEVED';
|
|
1
|
+
export const SET_ERROR = 'SET_ERROR';
|
|
2
|
+
export const SET_ISLOADING = 'SET_ISLOADING';
|
|
3
|
+
export const SET_VIOLATIONS = 'SET_VIOLATIONS';
|
|
4
|
+
export const SET_ITEMS = 'SET_ITEMS';
|
|
5
|
+
export const SET_VIEW = 'SET_VIEW';
|
|
6
|
+
export const SET_TOTALITEMS = 'SET_TOTALITEMS';
|
|
7
|
+
export const SET_RETRIEVED = 'SET_RETRIEVED';
|
|
8
8
|
export const RESET = 'RESET';
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import * as types from './mutation_types';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
[types.SET_ERROR] (state, error) {
|
|
5
|
-
Object.assign(state, { error });
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
[types.SET_ISLOADING] (state, isLoading = true) {
|
|
9
|
-
Object.assign(state, { isLoading: isLoading });
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
[types.SET_VIOLATIONS](state, violations) {
|
|
13
|
-
Object.assign(state, { violations });
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
[types.SET_RETRIEVED](state, retrieved) {
|
|
17
|
-
Object.assign(state, { retrieved });
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
[types.SET_ITEMS](state, items) {
|
|
21
|
-
Object.assign(state, { items });
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
[types.SET_VIEW](state, view) {
|
|
25
|
-
Object.assign(state, { view });
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
[types.SET_TOTALITEMS](state, totalItems) {
|
|
29
|
-
Object.assign(state, { totalItems });
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
[types.RESET](state) {
|
|
33
|
-
Object.assign(state, {
|
|
34
|
-
isLoading : false,
|
|
35
|
-
error : '',
|
|
36
|
-
violations: null,
|
|
37
|
-
retrieved : null,
|
|
38
|
-
totalItems: null,
|
|
39
|
-
items : [],
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
};
|
|
1
|
+
import * as types from './mutation_types';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
[types.SET_ERROR] (state, error) {
|
|
5
|
+
Object.assign(state, { error });
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
[types.SET_ISLOADING] (state, isLoading = true) {
|
|
9
|
+
Object.assign(state, { isLoading: isLoading });
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
[types.SET_VIOLATIONS](state, violations) {
|
|
13
|
+
Object.assign(state, { violations });
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
[types.SET_RETRIEVED](state, retrieved) {
|
|
17
|
+
Object.assign(state, { retrieved });
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
[types.SET_ITEMS](state, items) {
|
|
21
|
+
Object.assign(state, { items });
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
[types.SET_VIEW](state, view) {
|
|
25
|
+
Object.assign(state, { view });
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
[types.SET_TOTALITEMS](state, totalItems) {
|
|
29
|
+
Object.assign(state, { totalItems });
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
[types.RESET](state) {
|
|
33
|
+
Object.assign(state, {
|
|
34
|
+
isLoading : false,
|
|
35
|
+
error : '',
|
|
36
|
+
violations: null,
|
|
37
|
+
retrieved : null,
|
|
38
|
+
totalItems: null,
|
|
39
|
+
items : [],
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import SubmissionError from '@freteclick/quasar-common-ui/src/error/SubmissionError';
|
|
2
|
-
import { fetch } from '../../../../../../../../src/boot/myapi';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function getProviders({ commit }, data) {
|
|
8
|
-
const options = {
|
|
9
|
-
method: 'GET',
|
|
10
|
-
params: data.params ? data.params : {}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
return fetch('/providers', options)
|
|
14
|
-
.then(response => response.json())
|
|
15
|
-
.then(response => {
|
|
16
|
-
return response['hydra:member'];
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const createExpense = ({ commit }, data) => {
|
|
21
|
-
let options = {
|
|
22
|
-
method: 'POST',
|
|
23
|
-
body: JSON.stringify(data.values),
|
|
24
|
-
params: data.params ? data.params : {}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return fetch('/invoices', options)
|
|
28
|
-
.then(response => response.json())
|
|
29
|
-
.then(response => {
|
|
30
|
-
return response.data ? response.data : null;
|
|
31
|
-
})
|
|
32
|
-
.catch(e => {
|
|
33
|
-
if (e instanceof SubmissionError) {
|
|
34
|
-
throw new Error(e.errors._error);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
throw new Error(e.message);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const createProvider = ({ commit }, data) => {
|
|
42
|
-
let options = {
|
|
43
|
-
method: 'POST',
|
|
44
|
-
body: JSON.stringify(data.values),
|
|
45
|
-
params: data.params ? data.params : {}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
return fetch('/providers', options)
|
|
49
|
-
.then(response => response.json())
|
|
50
|
-
.then(response => {
|
|
51
|
-
return response;
|
|
52
|
-
})
|
|
53
|
-
.catch(e => {
|
|
54
|
-
if (e instanceof SubmissionError) {
|
|
55
|
-
throw new Error(e.errors._error);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
throw new Error(e.message);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const updateExpense = ({ commit }, data) => {
|
|
63
|
-
let options = {
|
|
64
|
-
method: 'PUT',
|
|
65
|
-
body: JSON.stringify(data.values),
|
|
66
|
-
params: data.params ? data.params : {}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return fetch(`/invoices/${data.id}`, options)
|
|
70
|
-
.then(response => response.json())
|
|
71
|
-
.then(response => {
|
|
72
|
-
return response.data ? response.data : null;
|
|
73
|
-
})
|
|
74
|
-
.catch(e => {
|
|
75
|
-
if (e instanceof SubmissionError) {
|
|
76
|
-
throw new Error(e.errors._error);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
throw new Error(e.message);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const deleteExpense = ({ commit }, data) => {
|
|
84
|
-
let options = {
|
|
85
|
-
method: 'DELETE',
|
|
86
|
-
body: JSON.stringify(data.values),
|
|
87
|
-
params: data.params ? data.params : {}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
return fetch(`/invoices/${data.id}`, options)
|
|
91
|
-
.catch(e => {
|
|
92
|
-
if (e instanceof SubmissionError) {
|
|
93
|
-
throw new Error(e.errors._error);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
throw new Error(e.message);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
1
|
+
import SubmissionError from '@freteclick/quasar-common-ui/src/error/SubmissionError';
|
|
2
|
+
import { fetch } from '../../../../../../../../src/boot/myapi';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export function getProviders({ commit }, data) {
|
|
8
|
+
const options = {
|
|
9
|
+
method: 'GET',
|
|
10
|
+
params: data.params ? data.params : {}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return fetch('/providers', options)
|
|
14
|
+
.then(response => response.json())
|
|
15
|
+
.then(response => {
|
|
16
|
+
return response['hydra:member'];
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const createExpense = ({ commit }, data) => {
|
|
21
|
+
let options = {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
body: JSON.stringify(data.values),
|
|
24
|
+
params: data.params ? data.params : {}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return fetch('/invoices', options)
|
|
28
|
+
.then(response => response.json())
|
|
29
|
+
.then(response => {
|
|
30
|
+
return response.data ? response.data : null;
|
|
31
|
+
})
|
|
32
|
+
.catch(e => {
|
|
33
|
+
if (e instanceof SubmissionError) {
|
|
34
|
+
throw new Error(e.errors._error);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
throw new Error(e.message);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const createProvider = ({ commit }, data) => {
|
|
42
|
+
let options = {
|
|
43
|
+
method: 'POST',
|
|
44
|
+
body: JSON.stringify(data.values),
|
|
45
|
+
params: data.params ? data.params : {}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return fetch('/providers', options)
|
|
49
|
+
.then(response => response.json())
|
|
50
|
+
.then(response => {
|
|
51
|
+
return response;
|
|
52
|
+
})
|
|
53
|
+
.catch(e => {
|
|
54
|
+
if (e instanceof SubmissionError) {
|
|
55
|
+
throw new Error(e.errors._error);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
throw new Error(e.message);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const updateExpense = ({ commit }, data) => {
|
|
63
|
+
let options = {
|
|
64
|
+
method: 'PUT',
|
|
65
|
+
body: JSON.stringify(data.values),
|
|
66
|
+
params: data.params ? data.params : {}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return fetch(`/invoices/${data.id}`, options)
|
|
70
|
+
.then(response => response.json())
|
|
71
|
+
.then(response => {
|
|
72
|
+
return response.data ? response.data : null;
|
|
73
|
+
})
|
|
74
|
+
.catch(e => {
|
|
75
|
+
if (e instanceof SubmissionError) {
|
|
76
|
+
throw new Error(e.errors._error);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
throw new Error(e.message);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const deleteExpense = ({ commit }, data) => {
|
|
84
|
+
let options = {
|
|
85
|
+
method: 'DELETE',
|
|
86
|
+
body: JSON.stringify(data.values),
|
|
87
|
+
params: data.params ? data.params : {}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return fetch(`/invoices/${data.id}`, options)
|
|
91
|
+
.catch(e => {
|
|
92
|
+
if (e instanceof SubmissionError) {
|
|
93
|
+
throw new Error(e.errors._error);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
throw new Error(e.message);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const items = state => state.item
|
|
1
|
+
export const items = state => state.item
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import state from './state'
|
|
2
|
-
import * as getters from './getters'
|
|
3
|
-
import * as mutations from './mutations'
|
|
4
|
-
import * as actions from './actions'
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
namespaced: true,
|
|
8
|
-
state,
|
|
9
|
-
getters,
|
|
10
|
-
mutations,
|
|
11
|
-
actions
|
|
12
|
-
}
|
|
1
|
+
import state from './state'
|
|
2
|
+
import * as getters from './getters'
|
|
3
|
+
import * as mutations from './mutations'
|
|
4
|
+
import * as actions from './actions'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
namespaced: true,
|
|
8
|
+
state,
|
|
9
|
+
getters,
|
|
10
|
+
mutations,
|
|
11
|
+
actions
|
|
12
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export function SET_ITEMS (state, payload) {
|
|
2
|
-
state.items = payload
|
|
3
|
-
}
|
|
1
|
+
export function SET_ITEMS (state, payload) {
|
|
2
|
+
state.items = payload
|
|
3
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default function () {
|
|
2
|
-
return {
|
|
3
|
-
items: [],
|
|
4
|
-
}
|
|
5
|
-
}
|
|
1
|
+
export default function () {
|
|
2
|
+
return {
|
|
3
|
+
items: [],
|
|
4
|
+
}
|
|
5
|
+
}
|
|
@@ -1,114 +1,114 @@
|
|
|
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/pay';
|
|
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/pay/${invoiceId}`, { params })
|
|
60
|
-
.then(response => response.json())
|
|
61
|
-
.then(data => {
|
|
62
|
-
|
|
63
|
-
return data;
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export const updateInvoiceDuedate = ({ commit }, { id, dueDate, params }) => {
|
|
70
|
-
let options = {
|
|
71
|
-
method: 'PUT',
|
|
72
|
-
body: JSON.stringify({ dueDate }),
|
|
73
|
-
params: params
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
return fetch(`${id}`, options)
|
|
77
|
-
.then(response => response.json())
|
|
78
|
-
.then(invoice => {
|
|
79
|
-
if (invoice['@id'])
|
|
80
|
-
return invoice;
|
|
81
|
-
|
|
82
|
-
return null;
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const deleteInvoiceOrder = ({ commit }, { invoiceId, orderId, params }) => {
|
|
87
|
-
let options = {
|
|
88
|
-
method: 'PUT',
|
|
89
|
-
body: JSON.stringify({ orderId }),
|
|
90
|
-
params: params
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
return fetch(`${invoiceId}/remove-order`, options)
|
|
94
|
-
.then(response => response.json())
|
|
95
|
-
.then(data => {
|
|
96
|
-
if (data.response) {
|
|
97
|
-
if (data.response.success === false)
|
|
98
|
-
throw Error(data.response.error);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return null;
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const bankItau = ({ commit }, { invoiceId, operation, params = {} }) => {
|
|
106
|
-
return fetch(`/finance/pay/${invoiceId}/bank/itau/${operation}`, { params })
|
|
107
|
-
.then(response => response.json())
|
|
108
|
-
.then(data => {
|
|
109
|
-
if (data.response)
|
|
110
|
-
return data.response.data !== null ? data.response.data : null;
|
|
111
|
-
|
|
112
|
-
return null;
|
|
113
|
-
});
|
|
114
|
-
};
|
|
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/pay';
|
|
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/pay/${invoiceId}`, { params })
|
|
60
|
+
.then(response => response.json())
|
|
61
|
+
.then(data => {
|
|
62
|
+
|
|
63
|
+
return data;
|
|
64
|
+
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export const updateInvoiceDuedate = ({ commit }, { id, dueDate, params }) => {
|
|
70
|
+
let options = {
|
|
71
|
+
method: 'PUT',
|
|
72
|
+
body: JSON.stringify({ dueDate }),
|
|
73
|
+
params: params
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return fetch(`${id}`, options)
|
|
77
|
+
.then(response => response.json())
|
|
78
|
+
.then(invoice => {
|
|
79
|
+
if (invoice['@id'])
|
|
80
|
+
return invoice;
|
|
81
|
+
|
|
82
|
+
return null;
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const deleteInvoiceOrder = ({ commit }, { invoiceId, orderId, params }) => {
|
|
87
|
+
let options = {
|
|
88
|
+
method: 'PUT',
|
|
89
|
+
body: JSON.stringify({ orderId }),
|
|
90
|
+
params: params
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return fetch(`${invoiceId}/remove-order`, options)
|
|
94
|
+
.then(response => response.json())
|
|
95
|
+
.then(data => {
|
|
96
|
+
if (data.response) {
|
|
97
|
+
if (data.response.success === false)
|
|
98
|
+
throw Error(data.response.error);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return null;
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const bankItau = ({ commit }, { invoiceId, operation, params = {} }) => {
|
|
106
|
+
return fetch(`/finance/pay/${invoiceId}/bank/itau/${operation}`, { params })
|
|
107
|
+
.then(response => response.json())
|
|
108
|
+
.then(data => {
|
|
109
|
+
if (data.response)
|
|
110
|
+
return data.response.data !== null ? data.response.data : null;
|
|
111
|
+
|
|
112
|
+
return null;
|
|
113
|
+
});
|
|
114
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const retrieved = state => state.retrieved;
|
|
2
|
-
export const error = state => state.error;
|
|
3
|
-
export const isLoading = state => state.isLoading;
|
|
4
|
-
export const violations = state => state.violations;
|
|
5
|
-
export const items = state => state.items;
|
|
6
|
-
export const view = state => state.view;
|
|
1
|
+
export const retrieved = state => state.retrieved;
|
|
2
|
+
export const error = state => state.error;
|
|
3
|
+
export const isLoading = state => state.isLoading;
|
|
4
|
+
export const violations = state => state.violations;
|
|
5
|
+
export const items = state => state.items;
|
|
6
|
+
export const view = state => state.view;
|
|
7
7
|
export const totalItems = state => state.totalItems;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as actions from './actions';
|
|
2
|
-
import * as getters from './getters';
|
|
3
|
-
import mutations from './mutations';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
namespaced: true,
|
|
7
|
-
state : {
|
|
8
|
-
isLoading : false,
|
|
9
|
-
error : '',
|
|
10
|
-
violations: null,
|
|
11
|
-
retrieved : null,
|
|
12
|
-
totalItems: 10,
|
|
13
|
-
items : [],
|
|
14
|
-
view : [],
|
|
15
|
-
},
|
|
16
|
-
actions,
|
|
17
|
-
getters,
|
|
18
|
-
mutations,
|
|
19
|
-
};
|
|
1
|
+
import * as actions from './actions';
|
|
2
|
+
import * as getters from './getters';
|
|
3
|
+
import mutations from './mutations';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
namespaced: true,
|
|
7
|
+
state : {
|
|
8
|
+
isLoading : false,
|
|
9
|
+
error : '',
|
|
10
|
+
violations: null,
|
|
11
|
+
retrieved : null,
|
|
12
|
+
totalItems: 10,
|
|
13
|
+
items : [],
|
|
14
|
+
view : [],
|
|
15
|
+
},
|
|
16
|
+
actions,
|
|
17
|
+
getters,
|
|
18
|
+
mutations,
|
|
19
|
+
};
|