@axelor/aos-mobile-hr 7.2.0
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/README.md +44 -0
- package/lib/api/currency-api.d.ts +4 -0
- package/lib/api/currency-api.js +32 -0
- package/lib/api/currency-api.js.map +1 -0
- package/lib/api/distance-api.d.ts +4 -0
- package/lib/api/distance-api.js +40 -0
- package/lib/api/distance-api.js.map +1 -0
- package/lib/api/expense-api.d.ts +37 -0
- package/lib/api/expense-api.js +136 -0
- package/lib/api/expense-api.js.map +1 -0
- package/lib/api/expense-config-api.d.ts +1 -0
- package/lib/api/expense-config-api.js +23 -0
- package/lib/api/expense-config-api.js.map +1 -0
- package/lib/api/expense-line-api.d.ts +24 -0
- package/lib/api/expense-line-api.js +111 -0
- package/lib/api/expense-line-api.js.map +1 -0
- package/lib/api/expense-type-api.d.ts +5 -0
- package/lib/api/expense-type-api.js +56 -0
- package/lib/api/expense-type-api.js.map +1 -0
- package/lib/api/index.d.ts +6 -0
- package/lib/api/index.js +24 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/kilometric-allow-param-api.d.ts +5 -0
- package/lib/api/kilometric-allow-param-api.js +44 -0
- package/lib/api/kilometric-allow-param-api.js.map +1 -0
- package/lib/api/project-api.d.ts +5 -0
- package/lib/api/project-api.js +39 -0
- package/lib/api/project-api.js.map +1 -0
- package/lib/components/atoms/ExpenseCard/ExpenseCard.d.ts +15 -0
- package/lib/components/atoms/ExpenseCard/ExpenseCard.js +130 -0
- package/lib/components/atoms/ExpenseCard/ExpenseCard.js.map +1 -0
- package/lib/components/atoms/ExpenseLineCard/ExpenseLineCard.d.ts +12 -0
- package/lib/components/atoms/ExpenseLineCard/ExpenseLineCard.js +106 -0
- package/lib/components/atoms/ExpenseLineCard/ExpenseLineCard.js.map +1 -0
- package/lib/components/atoms/index.d.ts +2 -0
- package/lib/components/atoms/index.js +20 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +21 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/ExpenseAddPopup/ExpenseAddPopup.d.ts +7 -0
- package/lib/components/molecules/ExpenseAddPopup/ExpenseAddPopup.js +78 -0
- package/lib/components/molecules/ExpenseAddPopup/ExpenseAddPopup.js.map +1 -0
- package/lib/components/molecules/ExpenseDetailsValidationButton/ExpenseDetailsValidationButton.d.ts +5 -0
- package/lib/components/molecules/ExpenseDetailsValidationButton/ExpenseDetailsValidationButton.js +76 -0
- package/lib/components/molecules/ExpenseDetailsValidationButton/ExpenseDetailsValidationButton.js.map +1 -0
- package/lib/components/molecules/ExpenseLineDetailCard/ExpenseLineDetailCard.d.ts +11 -0
- package/lib/components/molecules/ExpenseLineDetailCard/ExpenseLineDetailCard.js +131 -0
- package/lib/components/molecules/ExpenseLineDetailCard/ExpenseLineDetailCard.js.map +1 -0
- package/lib/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.d.ts +6 -0
- package/lib/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.js +37 -0
- package/lib/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.js.map +1 -0
- package/lib/components/molecules/ExpenseRefusalPopup/ExpenseRefusalPopup.d.ts +9 -0
- package/lib/components/molecules/ExpenseRefusalPopup/ExpenseRefusalPopup.js +39 -0
- package/lib/components/molecules/ExpenseRefusalPopup/ExpenseRefusalPopup.js.map +1 -0
- package/lib/components/molecules/index.d.ts +5 -0
- package/lib/components/molecules/index.js +23 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/templates/BillableSwitchCard/BillableSwitchCard.d.ts +7 -0
- package/lib/components/templates/BillableSwitchCard/BillableSwitchCard.js +26 -0
- package/lib/components/templates/BillableSwitchCard/BillableSwitchCard.js.map +1 -0
- package/lib/components/templates/CityFormInput/CityFormInput.d.ts +9 -0
- package/lib/components/templates/CityFormInput/CityFormInput.js +76 -0
- package/lib/components/templates/CityFormInput/CityFormInput.js.map +1 -0
- package/lib/components/templates/CurrencySearchBar/CurrencySearchBar.d.ts +9 -0
- package/lib/components/templates/CurrencySearchBar/CurrencySearchBar.js +38 -0
- package/lib/components/templates/CurrencySearchBar/CurrencySearchBar.js.map +1 -0
- package/lib/components/templates/DistanceIncrement/DistanceIncrement.d.ts +9 -0
- package/lib/components/templates/DistanceIncrement/DistanceIncrement.js +46 -0
- package/lib/components/templates/DistanceIncrement/DistanceIncrement.js.map +1 -0
- package/lib/components/templates/ExpenseHeader/ExpenseHeader.d.ts +2 -0
- package/lib/components/templates/ExpenseHeader/ExpenseHeader.js +52 -0
- package/lib/components/templates/ExpenseHeader/ExpenseHeader.js.map +1 -0
- package/lib/components/templates/ExpenseLineTypeSwitch/ExpenseLineTypeSwitch.d.ts +4 -0
- package/lib/components/templates/ExpenseLineTypeSwitch/ExpenseLineTypeSwitch.js +63 -0
- package/lib/components/templates/ExpenseLineTypeSwitch/ExpenseLineTypeSwitch.js.map +1 -0
- package/lib/components/templates/ExpenseTypeSearchBar/ExpenseTypeSearchBar.d.ts +5 -0
- package/lib/components/templates/ExpenseTypeSearchBar/ExpenseTypeSearchBar.js +40 -0
- package/lib/components/templates/ExpenseTypeSearchBar/ExpenseTypeSearchBar.js.map +1 -0
- package/lib/components/templates/ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar.d.ts +12 -0
- package/lib/components/templates/ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar.js +33 -0
- package/lib/components/templates/ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar.js.map +1 -0
- package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.d.ts +9 -0
- package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.js +81 -0
- package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.js.map +1 -0
- package/lib/components/templates/KilometricTypeSelectPicker/KilometricTypeSelectPicker.d.ts +8 -0
- package/lib/components/templates/KilometricTypeSelectPicker/KilometricTypeSelectPicker.js +37 -0
- package/lib/components/templates/KilometricTypeSelectPicker/KilometricTypeSelectPicker.js.map +1 -0
- package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.d.ts +9 -0
- package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.js +38 -0
- package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.js.map +1 -0
- package/lib/components/templates/ToggleSwitchMode/ToggleSwitchMode.d.ts +6 -0
- package/lib/components/templates/ToggleSwitchMode/ToggleSwitchMode.js +34 -0
- package/lib/components/templates/ToggleSwitchMode/ToggleSwitchMode.js.map +1 -0
- package/lib/components/templates/index.d.ts +12 -0
- package/lib/components/templates/index.js +30 -0
- package/lib/components/templates/index.js.map +1 -0
- package/lib/features/asyncFunctions-index.d.ts +6 -0
- package/lib/features/asyncFunctions-index.js +24 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/currencySlice.d.ts +16 -0
- package/lib/features/currencySlice.js +49 -0
- package/lib/features/currencySlice.js.map +1 -0
- package/lib/features/distanceSlice.d.ts +22 -0
- package/lib/features/distanceSlice.js +76 -0
- package/lib/features/distanceSlice.js.map +1 -0
- package/lib/features/expenseConfigSlice.d.ts +14 -0
- package/lib/features/expenseConfigSlice.js +48 -0
- package/lib/features/expenseConfigSlice.js.map +1 -0
- package/lib/features/expenseLineSlice.d.ts +76 -0
- package/lib/features/expenseLineSlice.js +180 -0
- package/lib/features/expenseLineSlice.js.map +1 -0
- package/lib/features/expenseSlice.d.ts +105 -0
- package/lib/features/expenseSlice.js +314 -0
- package/lib/features/expenseSlice.js.map +1 -0
- package/lib/features/expenseTypeSlice.d.ts +16 -0
- package/lib/features/expenseTypeSlice.js +49 -0
- package/lib/features/expenseTypeSlice.js.map +1 -0
- package/lib/features/index.d.ts +8 -0
- package/lib/features/index.js +26 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/kilometricAllowParamSlice.d.ts +18 -0
- package/lib/features/kilometricAllowParamSlice.js +56 -0
- package/lib/features/kilometricAllowParamSlice.js.map +1 -0
- package/lib/features/projectSlice.d.ts +16 -0
- package/lib/features/projectSlice.js +49 -0
- package/lib/features/projectSlice.js.map +1 -0
- package/lib/hooks/use-hr-header-actions.d.ts +1 -0
- package/lib/hooks/use-hr-header-actions.js +53 -0
- package/lib/hooks/use-hr-header-actions.js.map +1 -0
- package/lib/i18n/en.json +68 -0
- package/lib/i18n/fr.json +68 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +66 -0
- package/lib/index.js.map +1 -0
- package/lib/models/forms.d.ts +2 -0
- package/lib/models/forms.js +183 -0
- package/lib/models/forms.js.map +1 -0
- package/lib/models/index.d.ts +4 -0
- package/lib/models/index.js +22 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/objectFields.d.ts +2 -0
- package/lib/models/objectFields.js +87 -0
- package/lib/models/objectFields.js.map +1 -0
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/models/searchFields.js +26 -0
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/models/sortFields.js +26 -0
- package/lib/models/sortFields.js.map +1 -0
- package/lib/screens/ExpenseDetailsScreen.d.ts +5 -0
- package/lib/screens/ExpenseDetailsScreen.js +85 -0
- package/lib/screens/ExpenseDetailsScreen.js.map +1 -0
- package/lib/screens/ExpenseLineFormScreen.d.ts +5 -0
- package/lib/screens/ExpenseLineFormScreen.js +202 -0
- package/lib/screens/ExpenseLineFormScreen.js.map +1 -0
- package/lib/screens/ExpenseLinesListScreen.d.ts +4 -0
- package/lib/screens/ExpenseLinesListScreen.js +91 -0
- package/lib/screens/ExpenseLinesListScreen.js.map +1 -0
- package/lib/screens/ExpenseListScreen.d.ts +4 -0
- package/lib/screens/ExpenseListScreen.js +138 -0
- package/lib/screens/ExpenseListScreen.js.map +1 -0
- package/lib/screens/index.d.ts +38 -0
- package/lib/screens/index.js +52 -0
- package/lib/screens/index.js.map +1 -0
- package/lib/types/expense.d.ts +27 -0
- package/lib/types/expense.js +80 -0
- package/lib/types/expense.js.map +1 -0
- package/lib/types/expenseLine.d.ts +21 -0
- package/lib/types/expenseLine.js +57 -0
- package/lib/types/expenseLine.js.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +20 -0
- package/lib/types/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, updateAgendaItems, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { searchExpenseDraft as _searchExpenseDraft, searchMyExpense as _searchMyExpense, searchExpenseToValidate as _searchExpenseToValidate, getExpense, createExpense as _createExpense, updateExpense as _updateExpense, sendExpense as _sendExpense, validateExpense as _validateExpense, refuseExpense as _refuseExpense, } from '../api/expense-api';
|
|
21
|
+
import { Expense } from '../types';
|
|
22
|
+
import { fetchExpenseLine } from './expenseLineSlice';
|
|
23
|
+
export const createExpense = createAsyncThunk('expense/createExpense', async function (data = {}, { getState, dispatch }) {
|
|
24
|
+
return handlerApiCall({
|
|
25
|
+
fetchFunction: _createExpense,
|
|
26
|
+
data,
|
|
27
|
+
action: 'Hr_SliceAction_CreateExpense',
|
|
28
|
+
getState,
|
|
29
|
+
responseOptions: { isArrayResponse: false },
|
|
30
|
+
})
|
|
31
|
+
.then(() => {
|
|
32
|
+
return handlerApiCall({
|
|
33
|
+
fetchFunction: _searchMyExpense,
|
|
34
|
+
data: { userId: data.userId },
|
|
35
|
+
action: 'Hr_SliceAction_FetchMyExpense',
|
|
36
|
+
getState,
|
|
37
|
+
responseOptions: { isArrayResponse: true },
|
|
38
|
+
});
|
|
39
|
+
})
|
|
40
|
+
.then(res => {
|
|
41
|
+
dispatch(fetchExpenseLine({ userId: data.userId }));
|
|
42
|
+
return res;
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
export const sendExpense = createAsyncThunk('expense/sendExpense', async function (data = {}, { getState }) {
|
|
46
|
+
return handlerApiCall({
|
|
47
|
+
fetchFunction: _sendExpense,
|
|
48
|
+
data,
|
|
49
|
+
action: 'Hr_SliceAction_SendExpense',
|
|
50
|
+
getState,
|
|
51
|
+
responseOptions: { isArrayResponse: false },
|
|
52
|
+
}).then(() => {
|
|
53
|
+
if (data.onExpense) {
|
|
54
|
+
return handlerApiCall({
|
|
55
|
+
fetchFunction: getExpense,
|
|
56
|
+
data: { ExpenseId: data.expenseId },
|
|
57
|
+
action: 'Hr_SliceAction_FetchExpenseById',
|
|
58
|
+
getState,
|
|
59
|
+
responseOptions: { isArrayResponse: false },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return handlerApiCall({
|
|
64
|
+
fetchFunction: _searchMyExpense,
|
|
65
|
+
data: { userId: data.userId },
|
|
66
|
+
action: 'Hr_SliceAction_FetchMyExpense',
|
|
67
|
+
getState,
|
|
68
|
+
responseOptions: { isArrayResponse: true },
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
export const validateExpense = createAsyncThunk('expense/validateExpense', async function (data = {}, { getState }) {
|
|
74
|
+
return handlerApiCall({
|
|
75
|
+
fetchFunction: _validateExpense,
|
|
76
|
+
data,
|
|
77
|
+
action: 'Hr_SliceAction_ValidateExpense',
|
|
78
|
+
getState,
|
|
79
|
+
responseOptions: { isArrayResponse: false },
|
|
80
|
+
}).then(() => {
|
|
81
|
+
if (data.onExpense) {
|
|
82
|
+
return handlerApiCall({
|
|
83
|
+
fetchFunction: getExpense,
|
|
84
|
+
data: { ExpenseId: data.expenseId },
|
|
85
|
+
action: 'Hr_SliceAction_FetchExpenseById',
|
|
86
|
+
getState,
|
|
87
|
+
responseOptions: { isArrayResponse: false },
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else if (data.mode === Expense.mode.validation) {
|
|
91
|
+
return handlerApiCall({
|
|
92
|
+
fetchFunction: _searchExpenseToValidate,
|
|
93
|
+
data: { user: data.user },
|
|
94
|
+
action: 'Hr_SliceAction_FetchExpenseToValidate',
|
|
95
|
+
getState,
|
|
96
|
+
responseOptions: { isArrayResponse: true },
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
return handlerApiCall({
|
|
101
|
+
fetchFunction: _searchMyExpense,
|
|
102
|
+
data: { userId: data.userId },
|
|
103
|
+
action: 'Hr_SliceAction_FetchMyExpense',
|
|
104
|
+
getState,
|
|
105
|
+
responseOptions: { isArrayResponse: true },
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
export const refuseExpense = createAsyncThunk('expense/refuseExpense', async function (data = {}, { getState }) {
|
|
111
|
+
return handlerApiCall({
|
|
112
|
+
fetchFunction: _refuseExpense,
|
|
113
|
+
data,
|
|
114
|
+
action: 'Hr_SliceAction_RefuseExpense',
|
|
115
|
+
getState,
|
|
116
|
+
responseOptions: { isArrayResponse: false },
|
|
117
|
+
}).then(() => {
|
|
118
|
+
return handlerApiCall({
|
|
119
|
+
fetchFunction: getExpense,
|
|
120
|
+
data: { ExpenseId: data.expenseId },
|
|
121
|
+
action: 'Hr_SliceAction_FetchExpenseById',
|
|
122
|
+
getState,
|
|
123
|
+
responseOptions: { isArrayResponse: false },
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
export const updateExpense = createAsyncThunk('expense/updateExpense', async function (data = {}, { getState, dispatch }) {
|
|
128
|
+
return handlerApiCall({
|
|
129
|
+
fetchFunction: _updateExpense,
|
|
130
|
+
data,
|
|
131
|
+
action: 'Hr_SliceAction_UpdateExpense',
|
|
132
|
+
getState,
|
|
133
|
+
responseOptions: { isArrayResponse: false },
|
|
134
|
+
}).then(() => {
|
|
135
|
+
return handlerApiCall({
|
|
136
|
+
fetchFunction: _searchMyExpense,
|
|
137
|
+
data: { userId: data.userId },
|
|
138
|
+
action: 'Hr_SliceAction_FetchMyExpense',
|
|
139
|
+
getState,
|
|
140
|
+
responseOptions: { isArrayResponse: true },
|
|
141
|
+
}).then(res => {
|
|
142
|
+
dispatch(fetchExpenseLine({ userId: data.userId }));
|
|
143
|
+
return res;
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
export const searchExpenseDraft = createAsyncThunk('expense/searchExpenseDraft', async function (data = {}, { getState }) {
|
|
148
|
+
return handlerApiCall({
|
|
149
|
+
fetchFunction: _searchExpenseDraft,
|
|
150
|
+
data,
|
|
151
|
+
action: 'Hr_SliceAction_SearchDraftExpense',
|
|
152
|
+
getState,
|
|
153
|
+
responseOptions: { isArrayResponse: true },
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
export const searchMyExpense = createAsyncThunk('expense/searchMyExpense', async function (data, { getState }) {
|
|
157
|
+
return handlerApiCall({
|
|
158
|
+
fetchFunction: _searchMyExpense,
|
|
159
|
+
data,
|
|
160
|
+
action: 'Hr_SliceAction_FetchMyExpense',
|
|
161
|
+
getState,
|
|
162
|
+
responseOptions: { isArrayResponse: true },
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
export const searchExpenseToValidate = createAsyncThunk('expense/searchExpenseToValidate', async function (data, { getState }) {
|
|
166
|
+
return handlerApiCall({
|
|
167
|
+
fetchFunction: _searchExpenseToValidate,
|
|
168
|
+
data,
|
|
169
|
+
action: 'Hr_SliceAction_FetchExpenseToValidate',
|
|
170
|
+
getState,
|
|
171
|
+
responseOptions: { isArrayResponse: true, resturnTotalWithData: true },
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
export const fetchExpenseById = createAsyncThunk('expense/fetchExpenseById', async function (data = {}, { getState }) {
|
|
175
|
+
return handlerApiCall({
|
|
176
|
+
fetchFunction: getExpense,
|
|
177
|
+
data,
|
|
178
|
+
action: 'Hr_SliceAction_FetchExpenseById',
|
|
179
|
+
getState,
|
|
180
|
+
responseOptions: { isArrayResponse: false },
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
const initialState = {
|
|
184
|
+
loading: true,
|
|
185
|
+
expenseDraftList: [],
|
|
186
|
+
loadingMyExpense: true,
|
|
187
|
+
moreLoadingMyExpense: false,
|
|
188
|
+
isListEndMyExpense: false,
|
|
189
|
+
myExpenseList: [],
|
|
190
|
+
loadingExpenseToValidate: true,
|
|
191
|
+
moreLoadingExpenseToValidate: false,
|
|
192
|
+
isListEndExpenseToValidate: false,
|
|
193
|
+
expenseToValidateList: [],
|
|
194
|
+
totalNumberExpenseToValidate: 0,
|
|
195
|
+
loadingExpense: true,
|
|
196
|
+
expense: {},
|
|
197
|
+
};
|
|
198
|
+
const expenseSlice = createSlice({
|
|
199
|
+
name: 'expense',
|
|
200
|
+
initialState,
|
|
201
|
+
extraReducers: builder => {
|
|
202
|
+
generateInifiniteScrollCases(builder, searchMyExpense, {
|
|
203
|
+
loading: 'loadingMyExpense',
|
|
204
|
+
moreLoading: 'moreLoadingMyExpense',
|
|
205
|
+
isListEnd: 'isListEndMyExpense',
|
|
206
|
+
list: 'myExpenseList',
|
|
207
|
+
});
|
|
208
|
+
generateInifiniteScrollCases(builder, searchExpenseToValidate, {
|
|
209
|
+
loading: 'loadingExpenseToValidate',
|
|
210
|
+
moreLoading: 'moreLoadingExpenseToValidate',
|
|
211
|
+
isListEnd: 'isListEndExpenseToValidate',
|
|
212
|
+
list: 'expenseToValidateList',
|
|
213
|
+
total: 'totalNumberExpenseToValidate',
|
|
214
|
+
}, {
|
|
215
|
+
manageTotal: true,
|
|
216
|
+
});
|
|
217
|
+
builder.addCase(searchExpenseDraft.pending, state => {
|
|
218
|
+
state.loading = true;
|
|
219
|
+
});
|
|
220
|
+
builder.addCase(searchExpenseDraft.fulfilled, (state, action) => {
|
|
221
|
+
state.loading = false;
|
|
222
|
+
state.expenseDraftList = action.payload;
|
|
223
|
+
});
|
|
224
|
+
builder.addCase(fetchExpenseById.pending, (state, action) => {
|
|
225
|
+
state.loadingExpense = true;
|
|
226
|
+
});
|
|
227
|
+
builder.addCase(fetchExpenseById.fulfilled, (state, action) => {
|
|
228
|
+
state.loadingExpense = false;
|
|
229
|
+
state.expense = action.payload;
|
|
230
|
+
});
|
|
231
|
+
builder.addCase(createExpense.pending, (state, action) => {
|
|
232
|
+
state.loadingMyExpense = true;
|
|
233
|
+
});
|
|
234
|
+
builder.addCase(createExpense.fulfilled, (state, action) => {
|
|
235
|
+
state.loadingMyExpense = false;
|
|
236
|
+
state.myExpenseList = action.payload;
|
|
237
|
+
});
|
|
238
|
+
builder.addCase(updateExpense.pending, (state, action) => {
|
|
239
|
+
state.loadingMyExpense = true;
|
|
240
|
+
});
|
|
241
|
+
builder.addCase(updateExpense.fulfilled, (state, action) => {
|
|
242
|
+
state.loadingMyExpense = false;
|
|
243
|
+
state.myExpenseList = action.payload;
|
|
244
|
+
});
|
|
245
|
+
builder.addCase(sendExpense.pending, (state, action) => {
|
|
246
|
+
if (action?.meta?.arg?.onExpense) {
|
|
247
|
+
state.loadingExpense = true;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
state.loadingMyExpense = true;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
builder.addCase(sendExpense.fulfilled, (state, action) => {
|
|
254
|
+
if (action?.meta?.arg?.onExpense) {
|
|
255
|
+
state.loadingExpense = false;
|
|
256
|
+
state.expense = action.payload;
|
|
257
|
+
state.myExpenseList = updateAgendaItems(state.myExpenseList, [
|
|
258
|
+
action.payload,
|
|
259
|
+
]);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
state.loadingMyExpense = false;
|
|
263
|
+
state.myExpenseList = action.payload;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
builder.addCase(validateExpense.pending, (state, action) => {
|
|
267
|
+
if (action?.meta?.arg?.onExpense) {
|
|
268
|
+
state.loadingExpense = true;
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
state.loadingMyExpense = true;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
builder.addCase(validateExpense.fulfilled, (state, action) => {
|
|
275
|
+
if (action?.meta?.arg?.onExpense) {
|
|
276
|
+
state.loadingExpense = false;
|
|
277
|
+
state.expense = action.payload;
|
|
278
|
+
if (action?.meta?.arg?.mode === Expense.mode.validation) {
|
|
279
|
+
state.expenseToValidateList = updateAgendaItems(state.expenseToValidateList, [action.payload]);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
state.myExpenseList = updateAgendaItems(state.myExpenseList, [
|
|
283
|
+
action.payload,
|
|
284
|
+
]);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else if (action?.meta?.arg?.mode === Expense.mode.validation) {
|
|
288
|
+
state.loadingExpenseToValidate = false;
|
|
289
|
+
state.expenseToValidateList = action.payload;
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
state.loadingMyExpense = false;
|
|
293
|
+
state.myExpenseList = action.payload;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
builder.addCase(refuseExpense.pending, (state, action) => {
|
|
297
|
+
state.loadloadingExpenseingMyExpense = true;
|
|
298
|
+
});
|
|
299
|
+
builder.addCase(refuseExpense.fulfilled, (state, action) => {
|
|
300
|
+
state.loadingExpense = false;
|
|
301
|
+
state.expense = action.payload;
|
|
302
|
+
if (action?.meta?.arg?.mode === Expense.mode.validation) {
|
|
303
|
+
state.expenseToValidateList = updateAgendaItems(state.expenseToValidateList, [action.payload]);
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
state.myExpenseList = updateAgendaItems(state.myExpenseList, [
|
|
307
|
+
action.payload,
|
|
308
|
+
]);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
export const expenseReducer = expenseSlice.reducer;
|
|
314
|
+
//# sourceMappingURL=expenseSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expenseSlice.js","sourceRoot":"","sources":["../../src/features/expenseSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,IAAI,mBAAmB,EACzC,eAAe,IAAI,gBAAgB,EACnC,uBAAuB,IAAI,wBAAwB,EACnD,UAAU,EACV,aAAa,IAAI,cAAc,EAC/B,aAAa,IAAI,cAAc,EAC/B,WAAW,IAAI,YAAY,EAC3B,eAAe,IAAI,gBAAgB,EACnC,aAAa,IAAI,cAAc,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AACjC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAC3C,uBAAuB,EACvB,KAAK,WAAW,IAAI,GAAG,EAAE,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAC;I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cAAc,GAAG,KAAK,CAAC;YAC7B,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YAC/B,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE;gBACvD,KAAK,CAAC,qBAAqB,GAAG,iBAAiB,CAC7C,KAAK,CAAC,qBAAqB,EAC3B,CAAC,MAAM,CAAC,OAAO,CAAC,CACjB,CAAC;aACH;iBAAM;gBACL,KAAK,CAAC,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,aAAa,EAAE;oBAC3D,MAAM,CAAC,OAAO;iBACf,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const searchExpenseType: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const expenseTypeReducer: import("redux").Reducer<{
|
|
12
|
+
loadingExpenseType: boolean;
|
|
13
|
+
moreLoadingExpenseType: boolean;
|
|
14
|
+
isListEndExpenseType: boolean;
|
|
15
|
+
expenseTypeList: any[];
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { searchExpenseType as _searchExpenseType } from '../api/expense-type-api';
|
|
21
|
+
export const searchExpenseType = createAsyncThunk('expenseType/searchExpenseType', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchExpenseType,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Hr_SliceAction_FetchExpenseType',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingExpenseType: true,
|
|
32
|
+
moreLoadingExpenseType: false,
|
|
33
|
+
isListEndExpenseType: false,
|
|
34
|
+
expenseTypeList: [],
|
|
35
|
+
};
|
|
36
|
+
const expenseTypeSlice = createSlice({
|
|
37
|
+
name: 'expenseType',
|
|
38
|
+
initialState,
|
|
39
|
+
extraReducers: builder => {
|
|
40
|
+
generateInifiniteScrollCases(builder, searchExpenseType, {
|
|
41
|
+
loading: 'loadingExpenseType',
|
|
42
|
+
moreLoading: 'moreLoadingExpenseType',
|
|
43
|
+
isListEnd: 'isListEndExpenseType',
|
|
44
|
+
list: 'expenseTypeList',
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const expenseTypeReducer = expenseTypeSlice.reducer;
|
|
49
|
+
//# sourceMappingURL=expenseTypeSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expenseTypeSlice.js","sourceRoot":"","sources":["../../src/features/expenseTypeSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAC/C,+BAA+B,EAC/B,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,kBAAkB;QACjC,IAAI;QACJ,MAAM,EAAE,iCAAiC;QACzC,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,kBAAkB,EAAE,IAAI;IACxB,sBAAsB,EAAE,KAAK;IAC7B,oBAAoB,EAAE,KAAK;IAC3B,eAAe,EAAE,EAAE;CACpB,CAAC;AAEF,MAAM,gBAAgB,GAAG,WAAW,CAAC;IACnC,IAAI,EAAE,aAAa;IACnB,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,iBAAiB,EAAE;YACvD,OAAO,EAAE,oBAAoB;YAC7B,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,sBAAsB;YACjC,IAAI,EAAE,iBAAiB;SACxB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { currencyReducer as currency } from "./currencySlice";
|
|
2
|
+
export { distanceReducer as distance } from "./distanceSlice";
|
|
3
|
+
export { expenseConfigReducer as expenseConfig } from "./expenseConfigSlice";
|
|
4
|
+
export { expenseLineReducer as expenseLine } from "./expenseLineSlice";
|
|
5
|
+
export { expenseReducer as expense } from "./expenseSlice";
|
|
6
|
+
export { expenseTypeReducer as expenseType } from "./expenseTypeSlice";
|
|
7
|
+
export { kilometricAllowParamReducer as kilometricAllowParam } from "./kilometricAllowParamSlice";
|
|
8
|
+
export { projectReducer as project } from "./projectSlice";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export { currencyReducer as currency } from './currencySlice';
|
|
19
|
+
export { distanceReducer as distance } from './distanceSlice';
|
|
20
|
+
export { expenseConfigReducer as expenseConfig } from './expenseConfigSlice';
|
|
21
|
+
export { expenseLineReducer as expenseLine } from './expenseLineSlice';
|
|
22
|
+
export { expenseReducer as expense } from './expenseSlice';
|
|
23
|
+
export { expenseTypeReducer as expenseType } from './expenseTypeSlice';
|
|
24
|
+
export { kilometricAllowParamReducer as kilometricAllowParam } from './kilometricAllowParamSlice';
|
|
25
|
+
export { projectReducer as project } from './projectSlice';
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,eAAe,IAAI,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAC,eAAe,IAAI,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAC,oBAAoB,IAAI,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAC,kBAAkB,IAAI,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAC,cAAc,IAAI,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAC,kBAAkB,IAAI,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAC,2BAA2B,IAAI,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAC,cAAc,IAAI,OAAO,EAAC,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const searchKilometricAllowParam: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const updateExpenseDate: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "kilometricAllowParam/updateExpenseDate">;
|
|
12
|
+
export const kilometricAllowParamReducer: import("redux").Reducer<import("immer/dist/internal").WritableDraft<{
|
|
13
|
+
loadingKilometricAllowParam: boolean;
|
|
14
|
+
moreLoadingKilometricAllowParam: boolean;
|
|
15
|
+
isListEndKilometricAllowParam: boolean;
|
|
16
|
+
kilometricAllowParamList: any[];
|
|
17
|
+
expenseDate: any;
|
|
18
|
+
}>>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { searchKilometricAllowParam as _searchKilometricAllowParam } from '../api/kilometric-allow-param-api';
|
|
21
|
+
export const searchKilometricAllowParam = createAsyncThunk('kilometricAllowParam/kilometricAllowParam', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchKilometricAllowParam,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Hr_SliceAction_SearchKilometricAllowParam',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingKilometricAllowParam: true,
|
|
32
|
+
moreLoadingKilometricAllowParam: false,
|
|
33
|
+
isListEndKilometricAllowParam: false,
|
|
34
|
+
kilometricAllowParamList: [],
|
|
35
|
+
expenseDate: null,
|
|
36
|
+
};
|
|
37
|
+
const kilometricAllowParamSlice = createSlice({
|
|
38
|
+
name: 'kilometricAllowParam',
|
|
39
|
+
initialState,
|
|
40
|
+
reducers: {
|
|
41
|
+
updateExpenseDate: (state, action) => {
|
|
42
|
+
state.expenseDate = action.payload;
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
extraReducers: builder => {
|
|
46
|
+
generateInifiniteScrollCases(builder, searchKilometricAllowParam, {
|
|
47
|
+
loading: 'loadingKilometricAllowParam',
|
|
48
|
+
moreLoading: 'moreLoadingKilometricAllowParam',
|
|
49
|
+
isListEnd: 'isListEndKilometricAllowParam',
|
|
50
|
+
list: 'kilometricAllowParamList',
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
export const { updateExpenseDate } = kilometricAllowParamSlice.actions;
|
|
55
|
+
export const kilometricAllowParamReducer = kilometricAllowParamSlice.reducer;
|
|
56
|
+
//# sourceMappingURL=kilometricAllowParamSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kilometricAllowParamSlice.js","sourceRoot":"","sources":["../../src/features/kilometricAllowParamSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,0BAA0B,IAAI,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAE5G,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CACxD,2CAA2C,EAC3C,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,2BAA2B;QAC1C,IAAI;QACJ,MAAM,EAAE,2CAA2C;QACnD,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,2BAA2B,EAAE,IAAI;IACjC,+BAA+B,EAAE,KAAK;IACtC,6BAA6B,EAAE,KAAK;IACpC,wBAAwB,EAAE,EAAE;IAC5B,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,MAAM,yBAAyB,GAAG,WAAW,CAAC;IAC5C,IAAI,EAAE,sBAAsB;IAC5B,YAAY;IACZ,QAAQ,EAAE;QACR,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACnC,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;QACrC,CAAC;KACF;IACD,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,0BAA0B,EAAE;YAChE,OAAO,EAAE,6BAA6B;YACtC,WAAW,EAAE,iCAAiC;YAC9C,SAAS,EAAE,+BAA+B;YAC1C,IAAI,EAAE,0BAA0B;SACjC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAC,iBAAiB,EAAC,GAAG,yBAAyB,CAAC,OAAO,CAAC;AAErE,MAAM,CAAC,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const searchProject: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const projectReducer: import("redux").Reducer<{
|
|
12
|
+
loadingProject: boolean;
|
|
13
|
+
moreLoading: boolean;
|
|
14
|
+
isListEnd: boolean;
|
|
15
|
+
projectList: any[];
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { handlerApiCall, generateInifiniteScrollCases, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { searchProject as _searchProject } from '../api/project-api';
|
|
21
|
+
export const searchProject = createAsyncThunk('Project/searchProject', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchProject,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Hr_SliceAction_FetchProjects',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingProject: true,
|
|
32
|
+
moreLoading: false,
|
|
33
|
+
isListEnd: false,
|
|
34
|
+
projectList: [],
|
|
35
|
+
};
|
|
36
|
+
const projectSlice = createSlice({
|
|
37
|
+
name: 'project',
|
|
38
|
+
initialState,
|
|
39
|
+
extraReducers: builder => {
|
|
40
|
+
generateInifiniteScrollCases(builder, searchProject, {
|
|
41
|
+
loading: 'loadingProject',
|
|
42
|
+
moreLoading: 'moreLoading',
|
|
43
|
+
isListEnd: 'isListEnd',
|
|
44
|
+
list: 'projectList',
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const projectReducer = projectSlice.reducer;
|
|
49
|
+
//# sourceMappingURL=projectSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectSlice.js","sourceRoot":"","sources":["../../src/features/projectSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,cAAc,EACd,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,aAAa,IAAI,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEnE,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAC3C,uBAAuB,EACvB,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,cAAc;QAC7B,IAAI;QACJ,MAAM,EAAE,8BAA8B;QACtC,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,YAAY,GAAG,WAAW,CAAC;IAC/B,IAAI,EAAE,SAAS;IACf,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,aAAa,EAAE;YACnD,OAAO,EAAE,gBAAgB;YACzB,WAAW,EAAE,aAAa;YAC1B,SAAS,EAAE,WAAW;YACtB,IAAI,EAAE,aAAa;SACpB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function useHrHeaders(): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { useEffect } from 'react';
|
|
19
|
+
import { headerActionsProvider, useSelector, useTranslator, useDispatch, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { fetchExpenseById } from '../features/expenseSlice';
|
|
22
|
+
const useExpenseDetailsAction = () => {
|
|
23
|
+
const Colors = useThemeColor();
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const dispatch = useDispatch();
|
|
26
|
+
const { expense } = useSelector(state => state.expense);
|
|
27
|
+
const { mobileSettings } = useSelector(state => state.config);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
headerActionsProvider.registerModel('hr_expense_details', {
|
|
30
|
+
model: 'com.axelor.apps.hr.db.Expense',
|
|
31
|
+
modelId: expense?.id,
|
|
32
|
+
disableMailMessages: !mobileSettings?.isTrackerMessageEnabled,
|
|
33
|
+
actions: [
|
|
34
|
+
{
|
|
35
|
+
key: 'refreshExpenseDetails',
|
|
36
|
+
order: 10,
|
|
37
|
+
iconName: 'refresh',
|
|
38
|
+
title: I18n.t('Hr_RefreshExpenseDetails'),
|
|
39
|
+
FontAwesome5: false,
|
|
40
|
+
iconColor: Colors.primaryColor.background,
|
|
41
|
+
onPress: () => {
|
|
42
|
+
dispatch(fetchExpenseById({ ExpenseId: expense?.id }));
|
|
43
|
+
},
|
|
44
|
+
showInHeader: true,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
}, [Colors, I18n, dispatch, expense, mobileSettings]);
|
|
49
|
+
};
|
|
50
|
+
export const useHrHeaders = () => {
|
|
51
|
+
useExpenseDetailsAction();
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=use-hr-header-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-hr-header-actions.js","sourceRoot":"","sources":["../../src/hooks/use-hr-header-actions.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAE1D,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACnC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,I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