@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,131 @@
|
|
|
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, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import { Animated, StyleSheet, View } from 'react-native';
|
|
20
|
+
import { useThemeColor, CardIconButton, Checkbox } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useTranslator, useDispatch, useSelector, openFileInExternalApp, } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { Expense, ExpenseLine } from '../../../types';
|
|
23
|
+
import { ExpenseLineCard } from '../../atoms';
|
|
24
|
+
import { deleteExpenseLine } from '../../../features/expenseLineSlice';
|
|
25
|
+
const ExpenseLineDetailCard = ({ style, item, expense, onEdit, onLongPress, onItemSelection, isSelectionMode, isSelected, }) => {
|
|
26
|
+
const I18n = useTranslator();
|
|
27
|
+
const Colors = useThemeColor();
|
|
28
|
+
const dispatch = useDispatch();
|
|
29
|
+
const { userId } = useSelector((state) => state.auth);
|
|
30
|
+
const { baseUrl, token, jsessionId } = useSelector((state) => state.auth);
|
|
31
|
+
const [cardHeight, setCardHeight] = useState();
|
|
32
|
+
const translateXAnim = useRef(new Animated.Value(0)).current;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (isSelectionMode) {
|
|
35
|
+
Animated.timing(translateXAnim, {
|
|
36
|
+
toValue: 10,
|
|
37
|
+
duration: 800,
|
|
38
|
+
useNativeDriver: false,
|
|
39
|
+
}).start();
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
Animated.timing(translateXAnim, {
|
|
43
|
+
toValue: 0,
|
|
44
|
+
duration: 800,
|
|
45
|
+
useNativeDriver: false,
|
|
46
|
+
}).start();
|
|
47
|
+
}
|
|
48
|
+
}, [isSelectionMode, translateXAnim]);
|
|
49
|
+
const cardPosition = useMemo(() => isSelectionMode
|
|
50
|
+
? translateXAnim.interpolate({
|
|
51
|
+
inputRange: [0, 10],
|
|
52
|
+
outputRange: ['0%', '10%'],
|
|
53
|
+
})
|
|
54
|
+
: 0, [isSelectionMode, translateXAnim]);
|
|
55
|
+
const handleDelete = useCallback(() => {
|
|
56
|
+
dispatch(deleteExpenseLine({ ExpenseLineId: item.id, userId: userId }));
|
|
57
|
+
}, [dispatch, item, userId]);
|
|
58
|
+
const handleShowFile = async () => {
|
|
59
|
+
await openFileInExternalApp({
|
|
60
|
+
fileName: item.justificationMetaFile?.fileName,
|
|
61
|
+
id: item.justificationMetaFile?.id,
|
|
62
|
+
isMetaFile: true,
|
|
63
|
+
}, { baseUrl: baseUrl, token: token, jsessionId: jsessionId }, I18n);
|
|
64
|
+
};
|
|
65
|
+
return (<View style={[styles.globalContainer, { height: cardHeight }, style]}>
|
|
66
|
+
<Checkbox style={styles.checkbox} isDefaultChecked={isSelected} onChange={onItemSelection}/>
|
|
67
|
+
<Animated.View style={[
|
|
68
|
+
styles.animatedCard,
|
|
69
|
+
{
|
|
70
|
+
left: cardPosition,
|
|
71
|
+
},
|
|
72
|
+
]}>
|
|
73
|
+
<View style={styles.container}>
|
|
74
|
+
<View style={styles.containerCard}>
|
|
75
|
+
<ExpenseLineCard expenseId={item.id} expenseDate={item.expenseDate} projectName={item.project?.fullName} totalAmount={item.totalAmount} currency={item.currency?.symbol || item.currency?.name} displayText={item.fromCity == null && item.toCity == null
|
|
76
|
+
? item.expenseProduct?.name
|
|
77
|
+
: ExpenseLine.getKilomectricTypeSelect(item.kilometricTypeSelect, I18n)} onLongPress={onLongPress} setCardHeight={setCardHeight}/>
|
|
78
|
+
</View>
|
|
79
|
+
{ExpenseLine.getExpenseMode(item) === ExpenseLine.modes.general &&
|
|
80
|
+
item.justificationMetaFile != null && (<CardIconButton iconName={'expand-alt'} iconColor={Colors.secondaryColor_dark.background} onPress={handleShowFile} style={styles.cardIconButton}/>)}
|
|
81
|
+
{expense == null ||
|
|
82
|
+
expense.statusSelect === Expense.statusSelect.Draft ? (<View style={styles.iconContainer}>
|
|
83
|
+
<CardIconButton iconName={'pencil-alt'} iconColor={Colors.secondaryColor_dark.background} onPress={onEdit} style={styles.cardIconButton}/>
|
|
84
|
+
{expense == null && (<CardIconButton iconName={'trash-alt'} iconColor={Colors.errorColor.background} onPress={handleDelete} style={styles.cardIconButton}/>)}
|
|
85
|
+
</View>) : null}
|
|
86
|
+
</View>
|
|
87
|
+
</Animated.View>
|
|
88
|
+
</View>);
|
|
89
|
+
};
|
|
90
|
+
const styles = StyleSheet.create({
|
|
91
|
+
globalContainer: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
alignSelf: 'center',
|
|
95
|
+
width: '96%',
|
|
96
|
+
marginHorizontal: '2%',
|
|
97
|
+
minHeight: 90,
|
|
98
|
+
marginVertical: 4,
|
|
99
|
+
},
|
|
100
|
+
checkbox: {
|
|
101
|
+
marginRight: 10,
|
|
102
|
+
},
|
|
103
|
+
animatedCard: {
|
|
104
|
+
position: 'absolute',
|
|
105
|
+
left: 0,
|
|
106
|
+
top: 0,
|
|
107
|
+
width: '100%',
|
|
108
|
+
},
|
|
109
|
+
container: {
|
|
110
|
+
display: 'flex',
|
|
111
|
+
flexDirection: 'row',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
flex: 1,
|
|
114
|
+
justifyContent: 'space-evenly',
|
|
115
|
+
alignSelf: 'center',
|
|
116
|
+
marginVertical: 4,
|
|
117
|
+
},
|
|
118
|
+
containerCard: {
|
|
119
|
+
flex: 6,
|
|
120
|
+
margin: 2,
|
|
121
|
+
},
|
|
122
|
+
iconContainer: {
|
|
123
|
+
flexDirection: 'column',
|
|
124
|
+
flex: 1,
|
|
125
|
+
},
|
|
126
|
+
cardIconButton: {
|
|
127
|
+
flex: 1,
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
export default ExpenseLineDetailCard;
|
|
131
|
+
//# sourceMappingURL=ExpenseLineDetailCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpenseLineDetailCard.js","sourceRoot":"","sources":["../../../../src/components/molecules/ExpenseLineDetailCard/ExpenseLineDetailCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AACxD,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,eAAe,E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ACpB,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,cAAc;QAC9B,SAAS,EAAE,QAAQ;QACnB,cAAc,EAAE,CAAC;KAClB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,CAAC;QACP,MAAM,EAAE,CAAC;KACV;IACD,aAAa,EAAE;QACb,aAAa,EAAE,QAAQ;QACvB,IAAI,EAAE,CAAC;KACR;IACD,cAAc,EAAE;QACd,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,eAAe,qBAAqB,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 { Button, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { StyleSheet, View } from 'react-native';
|
|
21
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
22
|
+
const ExpenseLineValidationButton = ({ onOpen, selectedItems, onChangeMode }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const Colors = useThemeColor();
|
|
25
|
+
return (<View style={styles.container}>
|
|
26
|
+
<Button title={I18n.t('Base_Cancel')} color={Colors.errorColor} onPress={onChangeMode} width="45%" iconName="times"/>
|
|
27
|
+
<Button title={I18n.t('Base_Add')} disabled={selectedItems.length <= 0} onPress={onOpen} width="45%" iconName="plus"/>
|
|
28
|
+
</View>);
|
|
29
|
+
};
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
justifyContent: 'space-evenly',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
export default ExpenseLineValidationButton;
|
|
37
|
+
//# sourceMappingURL=ExpenseLineValidationButton.js.map
|
package/lib/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpenseLineValidationButton.js","sourceRoot":"","sources":["../../../../src/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEtD,MAAM,2BAA2B,GAAG,CAAC,EAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAC,EAAE,EAAE;IAC5E,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAC7B,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CACzB,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,KAAK,CAAC,KAAK,CACX,QAAQ,CAAC,OAAO,EAElB;MAAA,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAC1B,QAAQ,CAAC,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,CAAC,CACpC,OAAO,CAAC,CAAC,MAAM,CAAC,CAChB,KAAK,CAAC,KAAK,CACX,QAAQ,CAAC,MAAM,EAEnB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,cAAc;KAC/B;CACF,CAAC,CAAC;AAEH,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default ExpenseRefusalPopup;
|
|
2
|
+
declare function ExpenseRefusalPopup({ refusalPopupIsOpen, setRefusalMessage, expense, mode, refusalMessage, onClose, }: {
|
|
3
|
+
refusalPopupIsOpen: any;
|
|
4
|
+
setRefusalMessage: any;
|
|
5
|
+
expense: any;
|
|
6
|
+
mode: any;
|
|
7
|
+
refusalMessage: any;
|
|
8
|
+
onClose: any;
|
|
9
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { Alert, FormInput, checkNullString } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { useTranslator, useDispatch } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { refuseExpense } from '../../../features/expenseSlice';
|
|
22
|
+
const ExpenseRefusalPopup = ({ refusalPopupIsOpen, setRefusalMessage, expense, mode, refusalMessage, onClose, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const refuseExpenseAPI = useCallback(() => {
|
|
26
|
+
dispatch(refuseExpense({
|
|
27
|
+
expenseId: expense.id,
|
|
28
|
+
version: expense.version,
|
|
29
|
+
groundForRefusal: refusalMessage,
|
|
30
|
+
mode: mode,
|
|
31
|
+
}));
|
|
32
|
+
}, [dispatch, expense, refusalMessage, mode]);
|
|
33
|
+
const isDisabled = useMemo(() => checkNullString(refusalMessage), [refusalMessage]);
|
|
34
|
+
return (<Alert visible={refusalPopupIsOpen} cancelButtonConfig={{ onPress: onClose }} confirmButtonConfig={{ onPress: refuseExpenseAPI, disabled: isDisabled }} translator={I18n.t}>
|
|
35
|
+
<FormInput title={I18n.t('Hr_ReasonRefusal')} multiline={true} adjustHeightWithLines={true} required={true} onChange={setRefusalMessage}/>
|
|
36
|
+
</Alert>);
|
|
37
|
+
};
|
|
38
|
+
export default ExpenseRefusalPopup;
|
|
39
|
+
//# sourceMappingURL=ExpenseRefusalPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpenseRefusalPopup.js","sourceRoot":"","sources":["../../../../src/components/molecules/ExpenseRefusalPopup/ExpenseRefusalPopup.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WA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,SAAS,CAAC,CAAC,IAAI,CAAC,CAChB,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAC5B,QAAQ,CAAC,CAAC,IAAI,CAAC,CACf,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAEhC;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as ExpenseAddPopup } from "./ExpenseAddPopup/ExpenseAddPopup";
|
|
2
|
+
export { default as ExpenseDetailsValidationButton } from "./ExpenseDetailsValidationButton/ExpenseDetailsValidationButton";
|
|
3
|
+
export { default as ExpenseLineDetailCard } from "./ExpenseLineDetailCard/ExpenseLineDetailCard";
|
|
4
|
+
export { default as ExpenseLineValidationButton } from "./ExpenseLineValidationButton/ExpenseLineValidationButton";
|
|
5
|
+
export { default as ExpenseRefusalPopup } from "./ExpenseRefusalPopup/ExpenseRefusalPopup";
|
|
@@ -0,0 +1,23 @@
|
|
|
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 ExpenseAddPopup } from './ExpenseAddPopup/ExpenseAddPopup';
|
|
19
|
+
export { default as ExpenseDetailsValidationButton } from './ExpenseDetailsValidationButton/ExpenseDetailsValidationButton';
|
|
20
|
+
export { default as ExpenseLineDetailCard } from './ExpenseLineDetailCard/ExpenseLineDetailCard';
|
|
21
|
+
export { default as ExpenseLineValidationButton } from './ExpenseLineValidationButton/ExpenseLineValidationButton';
|
|
22
|
+
export { default as ExpenseRefusalPopup } from './ExpenseRefusalPopup/ExpenseRefusalPopup';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/molecules/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,8BAA8B,EAAC,MAAM,iEAAiE,CAAC;AAC1H,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAC,OAAO,IAAI,2BAA2B,EAAC,MAAM,2DAA2D,CAAC;AACjH,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,2CAA2C,CAAC"}
|
|
@@ -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
|
+
import React from 'react';
|
|
19
|
+
import { SwitchCard } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
const BillableSwitchCard = ({ style = null, title = 'Hr_ToInvoice', defaultValue = null, onChange = () => { }, }) => {
|
|
22
|
+
const I18n = useTranslator();
|
|
23
|
+
return (<SwitchCard style={style} defaultValue={defaultValue} title={I18n.t(title)} onToggle={onChange}/>);
|
|
24
|
+
};
|
|
25
|
+
export default BillableSwitchCard;
|
|
26
|
+
//# sourceMappingURL=BillableSwitchCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BillableSwitchCard.js","sourceRoot":"","sources":["../../../../src/components/templates/BillableSwitchCard/BillableSwitchCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAEtD,MAAM,kBAAkB,GAAG,CAAC,EAC1B,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,cAAc,EACtB,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,GACpB,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,UAAU,CACT,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CACrB,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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, useEffect, useRef, useState } from 'react';
|
|
19
|
+
import { Dimensions, StyleSheet } from 'react-native';
|
|
20
|
+
import { FormInput, InfoBubble, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { getDistance } from '../../../features/distanceSlice';
|
|
23
|
+
const CityFormInputAux = ({ title = '', defaultValue = null, readonly = false, required = false, onChange = () => { }, delay = 1000, isFromCity = false, }) => {
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const I18n = useTranslator();
|
|
27
|
+
const timerRef = useRef(null);
|
|
28
|
+
const [value, setValue] = useState(defaultValue);
|
|
29
|
+
const { toCity, fromCity, needUpdateDistance, showCityError } = useSelector(state => state.distance);
|
|
30
|
+
const { expenseConfig } = useSelector(state => state.expenseConfig);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (expenseConfig?.computeDistanceWithWebService && needUpdateDistance) {
|
|
33
|
+
clearTimeout(timerRef.current);
|
|
34
|
+
timerRef.current = setTimeout(() => getDistanceApi(value), delay);
|
|
35
|
+
}
|
|
36
|
+
}, [
|
|
37
|
+
delay,
|
|
38
|
+
expenseConfig?.computeDistanceWithWebService,
|
|
39
|
+
getDistanceApi,
|
|
40
|
+
needUpdateDistance,
|
|
41
|
+
value,
|
|
42
|
+
]);
|
|
43
|
+
const handleChange = e => {
|
|
44
|
+
onChange(e);
|
|
45
|
+
setValue(e);
|
|
46
|
+
};
|
|
47
|
+
const getDistanceApi = useCallback(_value => {
|
|
48
|
+
dispatch(getDistance({
|
|
49
|
+
fromCity: isFromCity ? _value : fromCity,
|
|
50
|
+
toCity: isFromCity ? toCity : _value,
|
|
51
|
+
}));
|
|
52
|
+
}, [dispatch, fromCity, isFromCity, toCity]);
|
|
53
|
+
return (<>
|
|
54
|
+
<FormInput title={title} defaultValue={defaultValue} readOnly={readonly} style={styles.input} required={required} onChange={handleChange}/>
|
|
55
|
+
{showCityError && (<InfoBubble style={styles.infoBubble} textIndicationStyle={styles.infoIndicator} iconName="exclamation" coloredBubble={false} badgeColor={Colors.errorColor} indication={I18n.t('Hr_CityNotFound')} position="left"/>)}
|
|
56
|
+
</>);
|
|
57
|
+
};
|
|
58
|
+
const CityFormInput = ({ title, defaultValue, onChange, readonly, required, isFromCity, }) => {
|
|
59
|
+
return (<CityFormInputAux title={title} defaultValue={defaultValue} onChange={onChange} readonly={readonly} required={required} isFromCity={isFromCity}/>);
|
|
60
|
+
};
|
|
61
|
+
const styles = StyleSheet.create({
|
|
62
|
+
input: {
|
|
63
|
+
width: '90%',
|
|
64
|
+
alignSelf: 'center',
|
|
65
|
+
},
|
|
66
|
+
infoBubble: {
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
bottom: 6,
|
|
69
|
+
right: 30,
|
|
70
|
+
},
|
|
71
|
+
infoIndicator: {
|
|
72
|
+
width: Dimensions.get('window').width * 0.8,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
export default CityFormInput;
|
|
76
|
+
//# sourceMappingURL=CityFormInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CityFormInput.js","sourceRoot":"","sources":["../../../../src/components/templates/CityFormInput/CityFormInput.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACtE,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAE5D,MAAM,gBAAgB,GAAG,CAAC,EACxB,KAAK,GAAG,EAAE,EACV,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,KAAK,GAAG,IAAI,EACZ,UAAU,GAAG,KAAK,GACnB,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAE9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEjD,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAC,GAAG,WAAW,CACvE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CACxB,CAAC;IACF,MAAM,EAAC,aAAa,EAAC,GAAG,WAAW,CAAC,KAAK,CAA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|
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 { searchCurrencies } from '../../../features/currencySlice';
|
|
22
|
+
const CurrencySearchBarAux = ({ style = null, title = 'Hr_Currency', defaultValue = null, onChange = () => { }, required = false, readonly = false, }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const dispatch = useDispatch();
|
|
25
|
+
const { loadingCurrencies, moreLoadingCurrencies, isListEndCurrencies, currencyList, } = useSelector(state => state.currency);
|
|
26
|
+
const searchCurrenciesAPI = useCallback(({ page = 0, searchValue }) => {
|
|
27
|
+
dispatch(searchCurrencies({
|
|
28
|
+
page,
|
|
29
|
+
searchValue,
|
|
30
|
+
}));
|
|
31
|
+
}, [dispatch]);
|
|
32
|
+
return (<AutoCompleteSearch style={style} title={I18n.t(title)} objectList={currencyList} value={defaultValue} required={required} readonly={readonly} onChangeValue={onChange} fetchData={searchCurrenciesAPI} displayValue={displayItemName} placeholder={I18n.t(title)} showDetailsPopup={true} loadingList={loadingCurrencies} moreLoading={moreLoadingCurrencies} isListEnd={isListEndCurrencies} navigate={false} oneFilter={false} isFocus={false}/>);
|
|
33
|
+
};
|
|
34
|
+
const CurrencySearchBar = ({ style, title, defaultValue, onChange, readonly, required, }) => {
|
|
35
|
+
return (<CurrencySearchBarAux style={style} title={title} defaultValue={defaultValue} onChange={onChange} readonly={readonly} required={required}/>);
|
|
36
|
+
};
|
|
37
|
+
export default CurrencySearchBar;
|
|
38
|
+
//# sourceMappingURL=CurrencySearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrencySearchBar.js","sourceRoot":"","sources":["../../../../src/components/templates/CurrencySearchBar/CurrencySearchBar.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,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,MAAM,oBAAoB,GAAG,CAAC,EAC5B,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,aAAa,EACrB,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,GACjB,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,EACJ,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,GACb,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEzC,MAAM,mBAAmB,GAAG,WAAW,CACrC,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,WAAW,EAAC,EAAE,EAAE;QAC1B,QAAQ,CACN,gBAAgB,CAAC;YACf,IAAI;YACJ,WAAW;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C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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, useEffect, useState } from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { useSelector } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { FormIncrementInput } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const DistanceIncrementAux = ({ title = 'Hr_Distance', defaultValue = null, onChange = () => { }, readonly = false, required = false, }) => {
|
|
23
|
+
const [value, setValue] = useState(defaultValue);
|
|
24
|
+
const { distance } = useSelector(state => state.distance);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (distance != null) {
|
|
27
|
+
setValue(Number(distance));
|
|
28
|
+
}
|
|
29
|
+
}, [distance]);
|
|
30
|
+
const handleChange = useCallback(e => {
|
|
31
|
+
setValue(e);
|
|
32
|
+
onChange(e);
|
|
33
|
+
}, [onChange]);
|
|
34
|
+
return (<FormIncrementInput title={title} style={styles.input} onChange={handleChange} defaultValue={value} readOnly={readonly} required={required}/>);
|
|
35
|
+
};
|
|
36
|
+
const DistanceIncrement = ({ style, title, defaultValue, onChange, readOnly, required, }) => {
|
|
37
|
+
return (<DistanceIncrementAux defaultValue={defaultValue} onChange={onChange} style={style} title={title} readonly={readOnly} required={required}/>);
|
|
38
|
+
};
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
input: {
|
|
41
|
+
width: '90%',
|
|
42
|
+
alignSelf: 'center',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
export default DistanceIncrement;
|
|
46
|
+
//# sourceMappingURL=DistanceIncrement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DistanceIncrement.js","sourceRoot":"","sources":["../../../../src/components/templates/DistanceIncrement/DistanceIncrement.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEzD,MAAM,oBAAoB,GAAG,CAAC,EAC5B,KAAK,GAAG,aAAa,EACrB,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,GACjB,EAAE,EAAE;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEjD,MAAM,EAAC,QAAQ,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC5B;IACH,CAAC,EAAE,CAA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* 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 { View, StyleSheet } from 'react-native';
|
|
20
|
+
import { useThemeColor, Text, Badge } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { Expense } from '../../../types';
|
|
23
|
+
const ExpenseHeader = ({}) => {
|
|
24
|
+
const I18n = useTranslator();
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const { user } = useSelector((state) => state.user);
|
|
27
|
+
const { expense } = useSelector((state) => state.expense);
|
|
28
|
+
return (<View style={styles.headerContainer}>
|
|
29
|
+
<View style={styles.headerChildrenContainer}>
|
|
30
|
+
<View>
|
|
31
|
+
<Text writingType="title">
|
|
32
|
+
{`${I18n.t('Hr_ExpenseNumber')} ${expense.expenseSeq} `}
|
|
33
|
+
</Text>
|
|
34
|
+
</View>
|
|
35
|
+
<Badge color={Expense.getStatusColor(expense.statusSelect, Colors)} title={Expense.getStatus(expense.statusSelect, I18n)}/>
|
|
36
|
+
</View>
|
|
37
|
+
<Text>{`${I18n.t('Hr_TotalATI')}: ${expense.inTaxTotal} ${user?.activeCompany?.currency?.symbol != null
|
|
38
|
+
? user?.activeCompany?.currency?.symbol
|
|
39
|
+
: user?.activeCompany?.currency?.code}`}</Text>
|
|
40
|
+
</View>);
|
|
41
|
+
};
|
|
42
|
+
const styles = StyleSheet.create({
|
|
43
|
+
headerContainer: {
|
|
44
|
+
marginHorizontal: 24,
|
|
45
|
+
},
|
|
46
|
+
headerChildrenContainer: {
|
|
47
|
+
flexDirection: 'row',
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export default ExpenseHeader;
|
|
52
|
+
//# sourceMappingURL=ExpenseHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpenseHeader.js","sourceRoot":"","sources":["../../../../src/components/templates/ExpenseHeader/ExpenseHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAEvC,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE;IAC3B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,EAAC,IAAI,EAAC,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,EAAC,OAAO,EAAC,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE7D,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAClC;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAC1C;QAAA,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