@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,63 @@
|
|
|
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 React, { useEffect, useMemo } from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { ToggleSwitch, getCommonStyles, useThemeColor, NumberBubble, } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { searchGeneralExpenseLines, searchKilometricExpenseLines, } from '../../../features/expenseLineSlice';
|
|
23
|
+
import { ExpenseLine } from '../../../types';
|
|
24
|
+
const ExpenseLineTypeSwitch = ({ onChange }) => {
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const Colors = useThemeColor();
|
|
27
|
+
const dispatch = useDispatch();
|
|
28
|
+
const { expense } = useSelector((state) => state.expense);
|
|
29
|
+
const { totalNumberExpenseGeneral, totalNumberExpenseKilomectric } = useSelector((state) => state.expenseLine);
|
|
30
|
+
const commonStyles = useMemo(() => getCommonStyles(Colors), [Colors]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
dispatch(searchKilometricExpenseLines({ expenseId: expense?.id, page: 0 }));
|
|
33
|
+
dispatch(searchGeneralExpenseLines({ expenseId: expense?.id, page: 0 }));
|
|
34
|
+
}, [dispatch, expense?.id]);
|
|
35
|
+
return (<ToggleSwitch styleContainer={[
|
|
36
|
+
commonStyles.filter,
|
|
37
|
+
commonStyles.filterSize,
|
|
38
|
+
styles.toogleContainer,
|
|
39
|
+
]} styleToogle={styles.toggle} leftTitle={I18n.t('Hr_General')} rightTitle={I18n.t('Hr_Kilometric')} leftElement={<NumberBubble style={styles.indicator} number={totalNumberExpenseGeneral} color={Colors.inverseColor} isNeutralBackground={true}/>} rigthElement={<NumberBubble style={styles.indicator} number={totalNumberExpenseKilomectric} color={Colors.inverseColor} isNeutralBackground={true}/>} onSwitch={() => {
|
|
40
|
+
onChange(_mode => {
|
|
41
|
+
return _mode === ExpenseLine.modes.general
|
|
42
|
+
? ExpenseLine.modes.kilometric
|
|
43
|
+
: ExpenseLine.modes.general;
|
|
44
|
+
});
|
|
45
|
+
}}/>);
|
|
46
|
+
};
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
toogleContainer: {
|
|
49
|
+
alignSelf: 'center',
|
|
50
|
+
marginTop: 10,
|
|
51
|
+
},
|
|
52
|
+
toggle: {
|
|
53
|
+
width: '54%',
|
|
54
|
+
height: 38,
|
|
55
|
+
borderRadius: 13,
|
|
56
|
+
},
|
|
57
|
+
indicator: {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
right: '5%',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
export default ExpenseLineTypeSwitch;
|
|
63
|
+
//# sourceMappingURL=ExpenseLineTypeSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;KACd;IACD,MAAM,EAAE;QACN,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;KACjB;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,IAAI;KACZ;CACF,CAAC,CAAC;AAEH,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 React, { useCallback } from 'react';
|
|
19
|
+
import { displayItemName, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { searchExpenseType } from '../../../features/expenseTypeSlice';
|
|
22
|
+
const ExpenseTypeSearchBarAux = ({ style = null, title = 'Hr_ExpenseType', defaultValue = null, onChange = () => { }, required = true, readonly = false, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const { expenseTypeList, loadingExpenseType, moreLoadingExpenseType, isListEndExpenseType, } = useSelector(state => state.expenseType);
|
|
26
|
+
const { user } = useSelector(state => state.user);
|
|
27
|
+
const searchExpenseTypeAPI = useCallback(({ page = 0, searchValue }) => {
|
|
28
|
+
dispatch(searchExpenseType({
|
|
29
|
+
page,
|
|
30
|
+
searchValue,
|
|
31
|
+
user,
|
|
32
|
+
}));
|
|
33
|
+
}, [dispatch, user]);
|
|
34
|
+
return (<AutoCompleteSearch style={style} title={I18n.t(title)} objectList={expenseTypeList} value={defaultValue} required={required} readonly={readonly} onChangeValue={onChange} fetchData={searchExpenseTypeAPI} displayValue={displayItemName} placeholder={I18n.t('Hr_ExpenseType')} showDetailsPopup={true} loadingList={loadingExpenseType} moreLoading={moreLoadingExpenseType} isListEnd={isListEndExpenseType} navigate={false} oneFilter={false} isFocus={false}/>);
|
|
35
|
+
};
|
|
36
|
+
const ExpenseTypeSearchBar = ({ defaultValue, onChange }) => {
|
|
37
|
+
return (<ExpenseTypeSearchBarAux defaultValue={defaultValue} onChange={onChange}/>);
|
|
38
|
+
};
|
|
39
|
+
export default ExpenseTypeSearchBar;
|
|
40
|
+
//# sourceMappingURL=ExpenseTypeSearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpenseTypeSearchBar.js","sourceRoot":"","sources":["../../../../src/components/templates/ExpenseTypeSearchBar/ExpenseTypeSearchBar.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,oCAAoC,CAAC;AAErE,MAAM,uBAAuB,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gB,CAAC,CAAC,CACtC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CACvB,WAAW,CAAC,CAAC,kBAAkB,CAAC,CAChC,WAAW,CAAC,CAAC,sBAAsB,CAAC,CACpC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAChC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAChB,SAAS,CAAC,CAAC,KAAK,CAAC,CACjB,OAAO,CAAC,CAAC,KAAK,CAAC,EACf,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,EAAC,YAAY,EAAE,QAAQ,EAAC,EAAE,EAAE;IACxD,OAAO,CACL,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CAC5E,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default ExpenseWaitingValidationSearchBar;
|
|
2
|
+
declare function ExpenseWaitingValidationSearchBar({ placeholderKey, defaultValue, onChange, scanKey, showDetailsPopup, navigate, oneFilter, isFocus, changeScreenAfter, }: {
|
|
3
|
+
placeholderKey?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onChange?: () => void;
|
|
6
|
+
scanKey: any;
|
|
7
|
+
showDetailsPopup?: boolean;
|
|
8
|
+
navigate?: boolean;
|
|
9
|
+
oneFilter?: boolean;
|
|
10
|
+
isFocus?: boolean;
|
|
11
|
+
changeScreenAfter?: boolean;
|
|
12
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 React, { useCallback } from 'react';
|
|
19
|
+
import { displayItemName, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { searchExpenseToValidate } from '../../../features/expenseSlice';
|
|
22
|
+
const ExpenseWaitingValidationSearchBar = ({ placeholderKey = 'Hr_Employee', defaultValue = '', onChange = () => { }, scanKey, showDetailsPopup = true, navigate = false, oneFilter = false, isFocus = false, changeScreenAfter = false, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const { expenseToValidateList, loadingExpenseToValidate, moreLoadingExpenseToValidate, isListEndExpenseToValidate, } = useSelector(state => state.expense);
|
|
26
|
+
const { user } = useSelector(state => state.user);
|
|
27
|
+
const fetchExpenseToValidateAPI = useCallback(({ page = 0, searchValue }) => {
|
|
28
|
+
dispatch(searchExpenseToValidate({ page: page, user: user, searchValue }));
|
|
29
|
+
}, [dispatch, user]);
|
|
30
|
+
return (<AutoCompleteSearch objectList={expenseToValidateList} value={defaultValue} onChangeValue={onChange} fetchData={fetchExpenseToValidateAPI} displayValue={displayItemName} scanKeySearch={scanKey} placeholder={I18n.t(placeholderKey)} showDetailsPopup={showDetailsPopup} loadingList={loadingExpenseToValidate} moreLoading={moreLoadingExpenseToValidate} isListEnd={isListEndExpenseToValidate} navigate={navigate} oneFilter={oneFilter} isFocus={isFocus} changeScreenAfter={changeScreenAfter}/>);
|
|
31
|
+
};
|
|
32
|
+
export default ExpenseWaitingValidationSearchBar;
|
|
33
|
+
//# sourceMappingURL=ExpenseWaitingValidationSearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpenseWaitingValidationSearchBar.js","sourceRoot":"","sources":["../../../../src/components/templates/ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,uBAAuB,EAAC,MAAM,gCAAgC,CAAC;AAEvE,MAAM,iCAAiC,GAAG,CAAC,EACzC,cAAc,GAAG,aAAa,EAC9B,YAAY,GAAG,EAAE,EACjB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,OAAO,EACP,gBAAgB,GAAG,IAAI,EACvB,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,KAAK,EACf,iBAAiB,GAAG,KAAK,GAC1B,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,EACJ,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,0BAA0B,GAC3B,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,EAAC,IAAI,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhD,MAAM,yBAAyB,GAAG,WAAW,CAC3C,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,WAAW,EAAC,EAAE,EAAE;QAC1B,QAAQ,CAAC,uBAAuB,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAC,CAAC,CAAC,CAAC;IAC3E,CAAC,EACD,CAAC,QAAQ,EAAE,IAAI,CAAC,CACjB,CAAC;IAEF,OAAO,CACL,CAAC,kBAAkB,CACjB,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAClC,KAAK,CAAC,CAAC,YAAY,CAAC,CACpB,aAAa,CAAC,CAAC,QAAQ,CAAC,CACxB,SAAS,CAAC,CAAC,yBAAyB,CAAC,CACrC,YAAY,CAAC,CAAC,eAAe,CAAC,CAC9B,aAAa,CAAC,CAAC,OAAO,CAAC,CACvB,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CACpC,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,WAAW,CAAC,CAAC,wBAAwB,CAAC,CACtC,WAAW,CAAC,CAAC,4BAA4B,CAAC,CAC1C,SAAS,CAAC,CAAC,0BAA0B,CAAC,CACtC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EACrC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iCAAiC,CAAC"}
|
package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default KilometricAllowParamSearchBar;
|
|
2
|
+
declare function KilometricAllowParamSearchBar({ style, title, defaultValue, onChange, readonly, required, }: {
|
|
3
|
+
style?: any;
|
|
4
|
+
title?: string;
|
|
5
|
+
defaultValue?: any;
|
|
6
|
+
onChange?: () => void;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}): JSX.Element;
|
package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
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 React, { useCallback, useMemo } from 'react';
|
|
19
|
+
import { displayItemName, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { searchKilometricAllowParam } from '../../../features/kilometricAllowParamSlice';
|
|
22
|
+
const KilometricAllowParamSearchBarAux = ({ style = null, title = 'Hr_KilometricAllowParam', defaultValue = null, onChange = () => { }, readonly = false, required = false, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const { kilometricAllowParamList, loadingKilometricAllowParam, moreLoadingKilometricAllowParam, isListEndKilometricAllowParam, expenseDate, } = useSelector(state => state.kilometricAllowParam);
|
|
26
|
+
const { user } = useSelector(state => state.user);
|
|
27
|
+
const searchKilometricAllowParamAPI = useCallback(({ page = 0, searchValue }) => {
|
|
28
|
+
dispatch(searchKilometricAllowParam({
|
|
29
|
+
page,
|
|
30
|
+
searchValue,
|
|
31
|
+
idList: user.employee?.employeeVehicleList.map(_vehicle => {
|
|
32
|
+
if (expenseDate != null) {
|
|
33
|
+
const _expenseDate = new Date(expenseDate);
|
|
34
|
+
const _endDate = _vehicle.endDate
|
|
35
|
+
? new Date(_vehicle.endDate)
|
|
36
|
+
: null;
|
|
37
|
+
if (_vehicle.startDate == null) {
|
|
38
|
+
if (_vehicle.endDate == null) {
|
|
39
|
+
// Vehicle has no period, always valid
|
|
40
|
+
return _vehicle.kilometricAllowParam.id;
|
|
41
|
+
}
|
|
42
|
+
else if (_expenseDate <= _endDate) {
|
|
43
|
+
// Vehicle has end date, expense date should be before end date
|
|
44
|
+
return _vehicle.kilometricAllowParam.id;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const _startDate = _vehicle.startDate
|
|
49
|
+
? new Date(_vehicle.startDate)
|
|
50
|
+
: null;
|
|
51
|
+
if (_vehicle.endDate == null) {
|
|
52
|
+
if (_expenseDate >= _startDate) {
|
|
53
|
+
// Vehicle has start date, expense date should be after start date
|
|
54
|
+
return _vehicle.kilometricAllowParam.id;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (_expenseDate >= _startDate &&
|
|
58
|
+
_expenseDate <= _endDate) {
|
|
59
|
+
// Vehicle has a period, expense date should be after start date and before end date
|
|
60
|
+
return _vehicle.kilometricAllowParam.id;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
}));
|
|
66
|
+
}, [dispatch, user, expenseDate]);
|
|
67
|
+
const defaultKap = useMemo(() => {
|
|
68
|
+
if (kilometricAllowParamList?.length === 1) {
|
|
69
|
+
return kilometricAllowParamList[0];
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return defaultValue;
|
|
73
|
+
}
|
|
74
|
+
}, [defaultValue, kilometricAllowParamList]);
|
|
75
|
+
return (<AutoCompleteSearch style={style} title={I18n.t(title)} objectList={kilometricAllowParamList} value={defaultKap} required={required} readonly={readonly} onChangeValue={onChange} fetchData={searchKilometricAllowParamAPI} displayValue={displayItemName} placeholder={title} showDetailsPopup={true} loadingList={loadingKilometricAllowParam} moreLoading={moreLoadingKilometricAllowParam} isListEnd={isListEndKilometricAllowParam} navigate={false} oneFilter={false} isFocus={false}/>);
|
|
76
|
+
};
|
|
77
|
+
const KilometricAllowParamSearchBar = ({ style = null, title = 'Hr_KilometricAllowParam', defaultValue = null, onChange = () => { }, readonly = false, required = false, }) => {
|
|
78
|
+
return (<KilometricAllowParamSearchBarAux style={style} title={title} defaultValue={defaultValue} onChange={onChange} readonly={readonly} required={required}/>);
|
|
79
|
+
};
|
|
80
|
+
export default KilometricAllowParamSearchBar;
|
|
81
|
+
//# sourceMappingURL=KilometricAllowParamSearchBar.js.map
|
package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KilometricAllowParamSearchBar.js","sourceRoot":"","sources":["../../../../src/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,0BAA0B,EAAC,MAAM,6CAA6C,CAAC;AAEvF,MAAM,gCAAgC,GAAG,CAAC,EACxC,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,yBAAyB,EACjC,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,G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,WAAW,CAAC,CAAC,2BAA2B,CAAC,CACzC,WAAW,CAAC,CAAC,+BAA+B,CAAC,CAC7C,SAAS,CAAC,CAAC,6BAA6B,CAAC,CACzC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAChB,SAAS,CAAC,CAAC,KAAK,CAAC,CACjB,OAAO,CAAC,CAAC,KAAK,CAAC,EACf,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAAC,EACrC,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,yBAAyB,EACjC,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,GACjB,EAAE,EAAE;IACH,OAAO,CACL,CAAC,gCAAgC,CAC/B,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 React from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { Picker } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { ExpenseLine } from '../../../types';
|
|
23
|
+
const KilometricTypeSelectPickerAux = ({ title = 'Hr_KilometricTypeSelect', defaultValue = null, onChange = () => { }, readonly = false, required = false, }) => {
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const kilomectricTypeselectList = ExpenseLine.getKilomectricTypeSelectList(I18n);
|
|
26
|
+
return (<Picker style={styles.picker} title={title} defaultValue={defaultValue} listItems={kilomectricTypeselectList} labelField="title" valueField="key" emptyValue={false} onValueChange={onChange} required={required} readonly={readonly} isValueItem={true}/>);
|
|
27
|
+
};
|
|
28
|
+
const KilometricTypeSelectPicker = ({ title, defaultValue, onChange, readonly, required, }) => {
|
|
29
|
+
return (<KilometricTypeSelectPickerAux title={title} defaultValue={defaultValue} onChange={onChange} readonly={readonly} required={required}/>);
|
|
30
|
+
};
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
picker: {
|
|
33
|
+
alignSelf: 'center',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
export default KilometricTypeSelectPicker;
|
|
37
|
+
//# sourceMappingURL=KilometricTypeSelectPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KilometricTypeSelectPicker.js","sourceRoot":"","sources":["../../../../src/components/templates/KilometricTypeSelectPicker/KilometricTypeSelectPicker.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,MAA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,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default ProjectSearchBar;
|
|
2
|
+
declare function ProjectSearchBar({ style, title, defaultValue, onChange, readonly, required, }: {
|
|
3
|
+
style?: any;
|
|
4
|
+
title?: string;
|
|
5
|
+
defaultValue?: any;
|
|
6
|
+
onChange?: () => void;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 React, { useCallback } from 'react';
|
|
19
|
+
import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { AutoCompleteSearch } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { searchProject } from '../../../features/projectSlice';
|
|
22
|
+
const ProjectSearchBar = ({ style = null, title = 'Hr_Project', defaultValue = null, onChange = () => { }, readonly = false, required = false, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const { projectList, loadingProject, moreLoading, isListEnd } = useSelector(state => state.project);
|
|
26
|
+
const { user } = useSelector(state => state.user);
|
|
27
|
+
const searchProjectAPI = useCallback(({ page = 0, searchValue }) => {
|
|
28
|
+
dispatch(searchProject({
|
|
29
|
+
page,
|
|
30
|
+
searchValue,
|
|
31
|
+
activeCompanyId: user?.activeCompany?.id,
|
|
32
|
+
}));
|
|
33
|
+
}, [dispatch, user?.activeCompany?.id]);
|
|
34
|
+
const displayItemFullname = item => item.fullName;
|
|
35
|
+
return (<AutoCompleteSearch style={style} title={I18n.t(title)} objectList={projectList} value={defaultValue} required={required} readonly={readonly} onChangeValue={onChange} fetchData={searchProjectAPI} displayValue={displayItemFullname} placeholder={title} showDetailsPopup={true} loadingList={loadingProject} moreLoading={moreLoading} isListEnd={isListEnd} navigate={false} oneFilter={false} isFocus={false}/>);
|
|
36
|
+
};
|
|
37
|
+
export default ProjectSearchBar;
|
|
38
|
+
//# sourceMappingURL=ProjectSearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectSearchBar.js","sourceRoot":"","sources":["../../../../src/components/templates/ProjectSearchBar/ProjectSearchBar.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAE7D,MAAM,gBAAgB,GAAG,CAAC,EACxB,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,YAAY,EACpB,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAA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,gBAAgB,CAAC,CAAC,IAAI,CAAC,CACvB,WAAW,CAAC,CAAC,cAAc,CAAC,CAC5B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,QAAQ,CAAC,CAAC,KAAK,CAAC,CAChB,SAAS,CAAC,CAAC,KAAK,CAAC,CACjB,OAAO,CAAC,CAAC,KAAK,CAAC,EACf,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 React, { useState } from 'react';
|
|
19
|
+
import { RadioSelect } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { ExpenseLine } from '../../../types';
|
|
22
|
+
const ToggleSwitchMode = ({ style = null, defaultValue = ExpenseLine.modes.general, onChange = () => { }, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const [, setMode] = useState(defaultValue);
|
|
25
|
+
return (<RadioSelect style={style} defaultValue={defaultValue} items={[
|
|
26
|
+
{ id: ExpenseLine.modes.general, title: I18n.t('Hr_General') },
|
|
27
|
+
{ id: ExpenseLine.modes.kilometric, title: I18n.t('Hr_Kilometric') },
|
|
28
|
+
]} onChange={_mode => {
|
|
29
|
+
onChange(_mode);
|
|
30
|
+
setMode(_mode);
|
|
31
|
+
}}/>);
|
|
32
|
+
};
|
|
33
|
+
export default ToggleSwitchMode;
|
|
34
|
+
//# sourceMappingURL=ToggleSwitchMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleSwitchMode.js","sourceRoot":"","sources":["../../../../src/components/templates/ToggleSwitchMode/ToggleSwitchMode.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,MAAM,gBAAgB,GAAG,CAAC,EACxB,KAAK,GAAG,IAAI,EACZ,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,EACxC,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,GACpB,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE3C,OAAO,CACL,CAAC,WAAW,CACV,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,KAAK,CAAC,CAAC;YACL,EAAC,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,EAAC;YAC5D,EAAC,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAC;SACnE,CAAC,CACF,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE;YAChB,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as BillableSwitchCard } from "./BillableSwitchCard/BillableSwitchCard";
|
|
2
|
+
export { default as CityFormInput } from "./CityFormInput/CityFormInput";
|
|
3
|
+
export { default as CurrencySearchBar } from "./CurrencySearchBar/CurrencySearchBar";
|
|
4
|
+
export { default as DistanceIncrement } from "./DistanceIncrement/DistanceIncrement";
|
|
5
|
+
export { default as ExpenseHeader } from "./ExpenseHeader/ExpenseHeader";
|
|
6
|
+
export { default as ExpenseLineTypeSwitch } from "./ExpenseLineTypeSwitch/ExpenseLineTypeSwitch";
|
|
7
|
+
export { default as ExpenseTypeSearchBar } from "./ExpenseTypeSearchBar/ExpenseTypeSearchBar";
|
|
8
|
+
export { default as ExpenseWaitingValidationSearchBar } from "./ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar";
|
|
9
|
+
export { default as KilometricAllowParamSearchBar } from "./KilometricAllowParamSearchBar/KilometricAllowParamSearchBar";
|
|
10
|
+
export { default as KilometricTypeSelectPicker } from "./KilometricTypeSelectPicker/KilometricTypeSelectPicker";
|
|
11
|
+
export { default as ProjectSearchBar } from "./ProjectSearchBar/ProjectSearchBar";
|
|
12
|
+
export { default as ToggleSwitchMode } from "./ToggleSwitchMode/ToggleSwitchMode";
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { default as BillableSwitchCard } from './BillableSwitchCard/BillableSwitchCard';
|
|
19
|
+
export { default as CityFormInput } from './CityFormInput/CityFormInput';
|
|
20
|
+
export { default as CurrencySearchBar } from './CurrencySearchBar/CurrencySearchBar';
|
|
21
|
+
export { default as DistanceIncrement } from './DistanceIncrement/DistanceIncrement';
|
|
22
|
+
export { default as ExpenseHeader } from './ExpenseHeader/ExpenseHeader';
|
|
23
|
+
export { default as ExpenseLineTypeSwitch } from './ExpenseLineTypeSwitch/ExpenseLineTypeSwitch';
|
|
24
|
+
export { default as ExpenseTypeSearchBar } from './ExpenseTypeSearchBar/ExpenseTypeSearchBar';
|
|
25
|
+
export { default as ExpenseWaitingValidationSearchBar } from './ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar';
|
|
26
|
+
export { default as KilometricAllowParamSearchBar } from './KilometricAllowParamSearchBar/KilometricAllowParamSearchBar';
|
|
27
|
+
export { default as KilometricTypeSelectPicker } from './KilometricTypeSelectPicker/KilometricTypeSelectPicker';
|
|
28
|
+
export { default as ProjectSearchBar } from './ProjectSearchBar/ProjectSearchBar';
|
|
29
|
+
export { default as ToggleSwitchMode } from './ToggleSwitchMode/ToggleSwitchMode';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/templates/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAC,OAAO,IAAI,oBAAoB,EAAC,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAC,OAAO,IAAI,iCAAiC,EAAC,MAAM,uEAAuE,CAAC;AACnI,OAAO,EAAC,OAAO,IAAI,6BAA6B,EAAC,MAAM,+DAA+D,CAAC;AACvH,OAAO,EAAC,OAAO,IAAI,0BAA0B,EAAC,MAAM,yDAAyD,CAAC;AAC9G,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { searchCurrencies } from './currencySlice';
|
|
2
|
+
export { createExpenseLine, deleteExpenseLine, fetchExpenseLine, searchGeneralExpenseLines, searchKilometricExpenseLines, updateExpenseLine, } from './expenseLineSlice';
|
|
3
|
+
export { createExpense, fetchExpenseById, refuseExpense, searchExpenseDraft, searchExpenseToValidate, searchMyExpense, sendExpense, updateExpense, validateExpense, } from './expenseSlice';
|
|
4
|
+
export { searchExpenseType } from './expenseTypeSlice';
|
|
5
|
+
export { searchKilometricAllowParam } from './kilometricAllowParamSlice';
|
|
6
|
+
export { searchProject } from './projectSlice';
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { searchCurrencies } from './currencySlice';
|
|
19
|
+
export { createExpenseLine, deleteExpenseLine, fetchExpenseLine, searchGeneralExpenseLines, searchKilometricExpenseLines, updateExpenseLine, } from './expenseLineSlice';
|
|
20
|
+
export { createExpense, fetchExpenseById, refuseExpense, searchExpenseDraft, searchExpenseToValidate, searchMyExpense, sendExpense, updateExpense, validateExpense, } from './expenseSlice';
|
|
21
|
+
export { searchExpenseType } from './expenseTypeSlice';
|
|
22
|
+
export { searchKilometricAllowParam } from './kilometricAllowParamSlice';
|
|
23
|
+
export { searchProject } from './projectSlice';
|
|
24
|
+
//# sourceMappingURL=asyncFunctions-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncFunctions-index.js","sourceRoot":"","sources":["../../src/features/asyncFunctions-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAC,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const searchCurrencies: 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 currencyReducer: import("redux").Reducer<{
|
|
12
|
+
loadingCurrencies: boolean;
|
|
13
|
+
moreLoadingCurrencies: boolean;
|
|
14
|
+
isListEndCurrencies: boolean;
|
|
15
|
+
currencyList: 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 { searchCurrencies as _searchCurrencies } from '../api/currency-api';
|
|
21
|
+
export const searchCurrencies = createAsyncThunk('currency/searchCurrencies', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchCurrencies,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Hr_SliceAction_FetchCurrencies',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingCurrencies: true,
|
|
32
|
+
moreLoadingCurrencies: false,
|
|
33
|
+
isListEndCurrencies: false,
|
|
34
|
+
currencyList: [],
|
|
35
|
+
};
|
|
36
|
+
const currencySlice = createSlice({
|
|
37
|
+
name: 'currency',
|
|
38
|
+
initialState,
|
|
39
|
+
extraReducers: builder => {
|
|
40
|
+
generateInifiniteScrollCases(builder, searchCurrencies, {
|
|
41
|
+
loading: 'loadingCurrencies',
|
|
42
|
+
moreLoading: 'moreLoadingCurrencies',
|
|
43
|
+
isListEnd: 'isListEndCurrencies',
|
|
44
|
+
list: 'currencyList',
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const currencyReducer = currencySlice.reducer;
|
|
49
|
+
//# sourceMappingURL=currencySlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currencySlice.js","sourceRoot":"","sources":["../../src/features/currencySlice.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,gBAAgB,IAAI,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAE1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAC9C,2BAA2B,EAC3B,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,iBAAiB;QAChC,IAAI;QACJ,MAAM,EAAE,gCAAgC;QACxC,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,iBAAiB,EAAE,IAAI;IACvB,qBAAqB,EAAE,KAAK;IAC5B,mBAAmB,EAAE,KAAK;IAC1B,YAAY,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,aAAa,GAAG,WAAW,CAAC;IAChC,IAAI,EAAE,UAAU;IAChB,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,gBAAgB,EAAE;YACtD,OAAO,EAAE,mBAAmB;YAC5B,WAAW,EAAE,uBAAuB;YACpC,SAAS,EAAE,qBAAqB;YAChC,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const getDistance: 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 updateFromCity: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "distance/updateFromCity">;
|
|
12
|
+
export const updateToCity: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "distance/updateToCity">;
|
|
13
|
+
export const resetDistance: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"distance/resetDistance">;
|
|
14
|
+
export const needUpdateDistance: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "distance/needUpdateDistance">;
|
|
15
|
+
export const distanceReducer: import("redux").Reducer<import("immer/dist/internal").WritableDraft<{
|
|
16
|
+
loadingDistance: boolean;
|
|
17
|
+
distance: any;
|
|
18
|
+
fromCity: any;
|
|
19
|
+
toCity: any;
|
|
20
|
+
showCityError: boolean;
|
|
21
|
+
needUpdateDistance: boolean;
|
|
22
|
+
}>>;
|