@freteclick/quasar-financial-ui 1.0.113 → 1.0.115

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.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <q-page padding>
2
+ <q-page class="finance-pay-detail-page">
3
3
  <InvoiceDetails />
4
4
  </q-page>
5
5
  </template>
@@ -21,3 +21,20 @@ export default {
21
21
  }
22
22
  }
23
23
  </script>
24
+
25
+ <style lang="scss" scoped>
26
+ .finance-pay-detail-page {
27
+ width: 100%;
28
+ min-width: 0;
29
+ min-height: 100%;
30
+ box-sizing: border-box;
31
+ padding: clamp(20px, 3vw, 36px);
32
+ background: #f4f7fb;
33
+ }
34
+
35
+ @media (max-width: 600px) {
36
+ .finance-pay-detail-page {
37
+ padding: 16px 20px 24px;
38
+ }
39
+ }
40
+ </style>
@@ -1,40 +1,78 @@
1
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>
2
+ <q-page class="finance-pay-page">
3
+ <div class="finance-pay-page__content">
4
+ <PageHeader
5
+ title="Contas a pagar"
6
+ description="Organize despesas, acompanhe vencimentos e mantenha os pagamentos em dia."
7
+ >
8
+ <template #actions>
9
+ <template v-if="currentTab === 'expenses'">
10
+ <q-btn
11
+ unelevated
12
+ no-caps
13
+ rounded
14
+ color="white"
15
+ text-color="primary"
16
+ icon="add"
17
+ label="Adicionar despesa"
18
+ @click="openExpenseDialog"
19
+ />
20
+ </template>
21
+ <template v-else>
22
+ <q-btn
23
+ unelevated
24
+ no-caps
25
+ rounded
26
+ color="white"
27
+ text-color="primary"
28
+ icon="add"
29
+ label="Adicionar categoria"
30
+ @click="openCreateCategory"
31
+ />
32
+ </template>
33
+ </template>
34
+ </PageHeader>
35
+
36
+ <div class="finance-pay-tabs-shell">
37
+ <q-tabs
38
+ v-model="currentTab"
39
+ align="left"
40
+ no-caps
41
+ inline-label
42
+ class="finance-pay-tabs"
43
+ >
44
+ <q-tab name="expenses" icon="receipt_long" :label="$t('Despesas')" />
45
+ <q-tab name="categories" icon="category" :label="$t('Categorias')" />
46
+ </q-tabs>
26
47
  </div>
27
- </q-card>
48
+
49
+ <q-tab-panels v-model="currentTab" class="finance-pay-panels">
50
+ <q-tab-panel name="expenses" class="q-pa-none">
51
+ <InvoiceSearching ref="invoiceSearch" />
52
+ </q-tab-panel>
53
+
54
+ <q-tab-panel name="categories" class="q-pa-none">
55
+ <TableCategories
56
+ ref="categoryTable"
57
+ :context="'expense'"
58
+ :api="api"
59
+ appearance="finance"
60
+ />
61
+ </q-tab-panel>
62
+ </q-tab-panels>
63
+ </div>
28
64
  </q-page>
29
65
  </template>
30
66
 
31
67
  <script>
32
68
  import Api from '@freteclick/quasar-common-ui/src/utils/api';
69
+ import PageHeader from '@freteclick/quasar-common-ui/src/components/common/PageHeader.vue';
33
70
  import InvoiceSearching from '../../../components/invoice/pay/InvoiceSearching.vue';
34
71
  import TableCategories from '@freteclick/quasar-common-ui/src/components/categories/Table.vue';
35
72
 
36
73
  export default {
37
74
  components: {
75
+ PageHeader,
38
76
  TableCategories,
39
77
  InvoiceSearching,
40
78
  },
@@ -46,8 +84,79 @@ export default {
46
84
  }
47
85
  },
48
86
 
49
- created() {
50
-
87
+ methods: {
88
+ openExpenseDialog() {
89
+ this.$refs.invoiceSearch?.openExpenseDialog();
90
+ },
91
+
92
+ openCreateCategory() {
93
+ this.$refs.categoryTable?.openCreateCategory();
94
+ },
51
95
  },
52
96
  }
53
97
  </script>
98
+
99
+ <style lang="scss" scoped>
100
+ .finance-pay-page {
101
+ width: 100%;
102
+ min-width: 0;
103
+ min-height: 100%;
104
+ box-sizing: border-box;
105
+ padding: clamp(20px, 3vw, 36px);
106
+ background: #f4f7fb;
107
+ }
108
+
109
+ .finance-pay-page__content {
110
+ display: grid;
111
+ grid-template-columns: minmax(0, 1fr);
112
+ width: 100%;
113
+ min-width: 0;
114
+ max-width: none;
115
+ gap: 20px;
116
+ margin: 0;
117
+ }
118
+
119
+ .finance-pay-tabs-shell {
120
+ min-width: 0;
121
+ overflow: hidden;
122
+ border: 1px solid #e5ebf3;
123
+ border-radius: 15px;
124
+ background: #fff;
125
+ box-shadow: 0 8px 24px rgba(26, 46, 70, 0.035);
126
+ }
127
+
128
+ .finance-pay-tabs {
129
+ min-height: 56px;
130
+ padding: 0 12px;
131
+ color: #687d93;
132
+ }
133
+
134
+ .finance-pay-tabs :deep(.q-tab--active) {
135
+ color: #245d9c;
136
+ font-weight: 700;
137
+ }
138
+
139
+ .finance-pay-tabs :deep(.q-tab__indicator) {
140
+ height: 3px;
141
+ border-radius: 3px 3px 0 0;
142
+ }
143
+
144
+ .finance-pay-panels {
145
+ min-width: 0;
146
+ background: transparent;
147
+ }
148
+
149
+ @media (max-width: 600px) {
150
+ .finance-pay-page {
151
+ padding: 16px 20px 24px;
152
+ }
153
+
154
+ .finance-pay-page__content {
155
+ gap: 14px;
156
+ }
157
+
158
+ .finance-pay-tabs {
159
+ padding: 0 4px;
160
+ }
161
+ }
162
+ </style>
@@ -1,10 +1,6 @@
1
1
  <template>
2
- <q-page padding>
3
- <div class="row">
4
- <div class="col-12">
5
- <InvoiceSearching />
6
- </div>
7
- </div>
2
+ <q-page class="finance-receive-page">
3
+ <InvoiceSearching />
8
4
  </q-page>
9
5
  </template>
10
6
 
@@ -12,16 +8,24 @@
12
8
  import InvoiceSearching from '../../../components/invoice/receive/InvoiceSearching.vue';
13
9
 
14
10
  export default {
15
- name : 'InvoiceIndexPage',
11
+ name: 'InvoiceReceiveIndexPage',
16
12
 
17
13
  components: {
18
14
  InvoiceSearching,
19
15
  },
16
+ };
17
+ </script>
20
18
 
21
- data () {
22
- return {
19
+ <style lang="scss" scoped>
20
+ .finance-receive-page {
21
+ min-height: 100%;
22
+ padding: clamp(18px, 3vw, 36px);
23
+ background: #f4f7fb;
24
+ }
23
25
 
24
- }
26
+ @media (max-width: 600px) {
27
+ .finance-receive-page {
28
+ padding: 16px 12px 24px;
25
29
  }
26
30
  }
27
- </script>
31
+ </style>
@@ -15,6 +15,7 @@ export const getItems = ({ commit }, params = {}) => {
15
15
  commit(types.SET_ITEMS, data['hydra:member']);
16
16
  commit(types.SET_VIEW, data['hydra:view']);
17
17
  commit(types.SET_TOTALITEMS, data['hydra:totalItems']);
18
+ commit(types.SET_TOTALAMOUNT, data.totalAmount);
18
19
 
19
20
  return data['hydra:member'];
20
21
 
@@ -83,14 +84,14 @@ export const updateInvoiceDuedate = ({ commit }, { id, dueDate, params }) => {
83
84
  });
84
85
  };
85
86
 
86
- export const deleteInvoiceOrder = ({ commit }, { invoiceId, orderId, params }) => {
87
+ export const deleteInvoiceOrder = ({ commit }, { invoiceId, orderId, params, priceSource = 'dacte' }) => {
87
88
  let options = {
88
89
  method: 'PUT',
89
- body: JSON.stringify({ orderId }),
90
+ body: JSON.stringify({ orderId, priceSource }),
90
91
  params: params
91
92
  };
92
93
 
93
- return fetch(`${invoiceId}/remove-order`, options)
94
+ return fetch(`${RESOURCE_ENDPOINT}/${invoiceId}/remove-order`, options)
94
95
  .then(response => response.json())
95
96
  .then(data => {
96
97
  if (data.response) {
@@ -98,7 +99,7 @@ export const deleteInvoiceOrder = ({ commit }, { invoiceId, orderId, params }) =
98
99
  throw Error(data.response.error);
99
100
  }
100
101
 
101
- return null;
102
+ return data.response ? data.response.data : null;
102
103
  });
103
104
  };
104
105
 
@@ -4,4 +4,5 @@ export const isLoading = state => state.isLoading;
4
4
  export const violations = state => state.violations;
5
5
  export const items = state => state.items;
6
6
  export const view = state => state.view;
7
- export const totalItems = state => state.totalItems;
7
+ export const totalItems = state => state.totalItems;
8
+ export const totalAmount = state => state.totalAmount;
@@ -10,6 +10,7 @@ export default {
10
10
  violations: null,
11
11
  retrieved : null,
12
12
  totalItems: 10,
13
+ totalAmount: null,
13
14
  items : [],
14
15
  view : [],
15
16
  },
@@ -4,5 +4,6 @@ export const SET_VIOLATIONS = 'SET_VIOLATIONS';
4
4
  export const SET_ITEMS = 'SET_ITEMS';
5
5
  export const SET_VIEW = 'SET_VIEW';
6
6
  export const SET_TOTALITEMS = 'SET_TOTALITEMS';
7
+ export const SET_TOTALAMOUNT = 'SET_TOTALAMOUNT';
7
8
  export const SET_RETRIEVED = 'SET_RETRIEVED';
8
- export const RESET = 'RESET';
9
+ export const RESET = 'RESET';
@@ -29,6 +29,10 @@ export default {
29
29
  Object.assign(state, { totalItems });
30
30
  },
31
31
 
32
+ [types.SET_TOTALAMOUNT](state, totalAmount) {
33
+ Object.assign(state, { totalAmount });
34
+ },
35
+
32
36
  [types.RESET](state) {
33
37
  Object.assign(state, {
34
38
  isLoading : false,
@@ -36,6 +40,7 @@ export default {
36
40
  violations: null,
37
41
  retrieved : null,
38
42
  totalItems: null,
43
+ totalAmount: null,
39
44
  items : [],
40
45
  });
41
46
  },
@@ -15,6 +15,7 @@ export const getItems = ({ commit }, params = {}) => {
15
15
  commit(types.SET_ITEMS, data['hydra:member']);
16
16
  commit(types.SET_VIEW, data['hydra:view']);
17
17
  commit(types.SET_TOTALITEMS, data['hydra:totalItems']);
18
+ commit(types.SET_TOTALAMOUNT, data.totalAmount);
18
19
 
19
20
  return data['hydra:member'];
20
21
 
@@ -4,4 +4,5 @@ export const isLoading = state => state.isLoading;
4
4
  export const violations = state => state.violations;
5
5
  export const items = state => state.items;
6
6
  export const view = state => state.view;
7
- export const totalItems = state => state.totalItems;
7
+ export const totalItems = state => state.totalItems;
8
+ export const totalAmount = state => state.totalAmount;
@@ -10,6 +10,7 @@ export default {
10
10
  violations: null,
11
11
  retrieved : null,
12
12
  totalItems: 10,
13
+ totalAmount: null,
13
14
  items : [],
14
15
  view : [],
15
16
  },
@@ -4,5 +4,6 @@ export const SET_VIOLATIONS = 'SET_VIOLATIONS';
4
4
  export const SET_ITEMS = 'SET_ITEMS';
5
5
  export const SET_VIEW = 'SET_VIEW';
6
6
  export const SET_TOTALITEMS = 'SET_TOTALITEMS';
7
+ export const SET_TOTALAMOUNT = 'SET_TOTALAMOUNT';
7
8
  export const SET_RETRIEVED = 'SET_RETRIEVED';
8
- export const RESET = 'RESET';
9
+ export const RESET = 'RESET';
@@ -29,6 +29,10 @@ export default {
29
29
  Object.assign(state, { totalItems });
30
30
  },
31
31
 
32
+ [types.SET_TOTALAMOUNT](state, totalAmount) {
33
+ Object.assign(state, { totalAmount });
34
+ },
35
+
32
36
  [types.RESET](state) {
33
37
  Object.assign(state, {
34
38
  isLoading : false,
@@ -36,6 +40,7 @@ export default {
36
40
  violations: null,
37
41
  retrieved : null,
38
42
  totalItems: null,
43
+ totalAmount: null,
39
44
  items : [],
40
45
  });
41
46
  },