@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,52 @@
|
|
|
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 ExpenseLinesListScreen from './ExpenseLinesListScreen';
|
|
19
|
+
import ExpenseListScreen from './ExpenseListScreen';
|
|
20
|
+
import ExpenseDetailsScreen from './ExpenseDetailsScreen';
|
|
21
|
+
import ExpenseLineFormScreen from './ExpenseLineFormScreen';
|
|
22
|
+
export default {
|
|
23
|
+
ExpenseLinesListScreen: {
|
|
24
|
+
title: 'Hr_ExpenseLines',
|
|
25
|
+
component: ExpenseLinesListScreen,
|
|
26
|
+
actionID: 'hr_expenseLine_list',
|
|
27
|
+
},
|
|
28
|
+
ExpenseListScreen: {
|
|
29
|
+
title: 'Hr_Expenses',
|
|
30
|
+
component: ExpenseListScreen,
|
|
31
|
+
options: {
|
|
32
|
+
shadedHeader: false,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
ExpenseDetailsScreen: {
|
|
36
|
+
title: 'Hr_Expenses',
|
|
37
|
+
component: ExpenseDetailsScreen,
|
|
38
|
+
options: {
|
|
39
|
+
shadedHeader: false,
|
|
40
|
+
},
|
|
41
|
+
actionID: 'hr_expense_details',
|
|
42
|
+
},
|
|
43
|
+
ExpenseLineFormScreen: {
|
|
44
|
+
title: 'Hr_CreateExpenseLine',
|
|
45
|
+
component: ExpenseLineFormScreen,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export { ExpenseLinesListScreen };
|
|
49
|
+
export { ExpenseListScreen };
|
|
50
|
+
export { ExpenseDetailsScreen };
|
|
51
|
+
export { ExpenseLineFormScreen };
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/screens/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAE5D,eAAe;IACb,sBAAsB,EAAE;QACtB,KAAK,EAAE,iBAAiB;QACxB,SAAS,EAAE,sBAAsB;QACjC,QAAQ,EAAE,qBAAqB;KAChC;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,iBAAiB;QAC5B,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;KACF;IACD,oBAAoB,EAAE;QACpB,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,oBAAoB;QAC/B,OAAO,EAAE;YACP,YAAY,EAAE,KAAK;SACpB;QACD,QAAQ,EAAE,oBAAoB;KAC/B;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,sBAAsB;QAC7B,SAAS,EAAE,qBAAqB;KACjC;CACF,CAAC;AAEF,OAAO,EAAC,sBAAsB,EAAC,CAAC;AAChC,OAAO,EAAC,iBAAiB,EAAC,CAAC;AAC3B,OAAO,EAAC,oBAAoB,EAAC,CAAC;AAC9B,OAAO,EAAC,qBAAqB,EAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Color, ThemeColors } from '@axelor/aos-mobile-ui';
|
|
2
|
+
declare class ExpenseType {
|
|
3
|
+
static statusSelect: {
|
|
4
|
+
Draft: number;
|
|
5
|
+
WaitingValidation: number;
|
|
6
|
+
Validate: number;
|
|
7
|
+
Reimbursed: number;
|
|
8
|
+
Refused: number;
|
|
9
|
+
Canceled: number;
|
|
10
|
+
};
|
|
11
|
+
static mode: {
|
|
12
|
+
personnal: string;
|
|
13
|
+
validation: string;
|
|
14
|
+
};
|
|
15
|
+
static getStatus: (select: number, I18n: {
|
|
16
|
+
t: (key: string) => string;
|
|
17
|
+
}) => string;
|
|
18
|
+
static getStatusColor: (status: number, Colors: ThemeColors) => Color;
|
|
19
|
+
static getStatusList: (Colors: ThemeColors, I18n: {
|
|
20
|
+
t: (key: string) => string;
|
|
21
|
+
}) => {
|
|
22
|
+
title: string;
|
|
23
|
+
color: Color;
|
|
24
|
+
key: number;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
export default ExpenseType;
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
class ExpenseType {
|
|
19
|
+
static statusSelect = {
|
|
20
|
+
Draft: 1,
|
|
21
|
+
WaitingValidation: 2,
|
|
22
|
+
Validate: 3,
|
|
23
|
+
Reimbursed: 4,
|
|
24
|
+
Refused: 5,
|
|
25
|
+
Canceled: 6,
|
|
26
|
+
};
|
|
27
|
+
static mode = {
|
|
28
|
+
personnal: 'myExpenseMode',
|
|
29
|
+
validation: 'toValidateMode',
|
|
30
|
+
};
|
|
31
|
+
static getStatus = (select, I18n) => {
|
|
32
|
+
if (I18n) {
|
|
33
|
+
switch (select) {
|
|
34
|
+
case this.statusSelect.Draft:
|
|
35
|
+
return I18n.t('Hr_ExpenseStatus_Draft');
|
|
36
|
+
case this.statusSelect.WaitingValidation:
|
|
37
|
+
return I18n.t('Hr_ExpenseStatus_WaitingValidation');
|
|
38
|
+
case this.statusSelect.Validate:
|
|
39
|
+
return I18n.t('Hr_ExpenseStatus_Validate');
|
|
40
|
+
case this.statusSelect.Reimbursed:
|
|
41
|
+
return I18n.t('Hr_ExpenseStatus_Reimbursed');
|
|
42
|
+
case this.statusSelect.Refused:
|
|
43
|
+
return I18n.t('Hr_ExpenseStatus_Refused');
|
|
44
|
+
case this.statusSelect.Canceled:
|
|
45
|
+
return I18n.t('Hr_ExpenseStatus_Canceled');
|
|
46
|
+
default:
|
|
47
|
+
console.warn(`Status provided with value ${select} is not supported by Expense`);
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
static getStatusColor = (status, Colors) => {
|
|
53
|
+
switch (status) {
|
|
54
|
+
case this.statusSelect.Draft:
|
|
55
|
+
return Colors.secondaryColor;
|
|
56
|
+
case this.statusSelect.WaitingValidation:
|
|
57
|
+
return Colors.cautionColor;
|
|
58
|
+
case this.statusSelect.Validate:
|
|
59
|
+
return Colors.primaryColor;
|
|
60
|
+
case this.statusSelect.Reimbursed:
|
|
61
|
+
return Colors.priorityColor;
|
|
62
|
+
case this.statusSelect.Refused:
|
|
63
|
+
return Colors.importantColor;
|
|
64
|
+
case this.statusSelect.Canceled:
|
|
65
|
+
return Colors.plannedColor;
|
|
66
|
+
default:
|
|
67
|
+
console.warn(`Status provided with value ${status} is not supported by Expense`);
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
static getStatusList = (Colors, I18n) => {
|
|
72
|
+
return Object.entries(this.statusSelect).map(([key, value]) => ({
|
|
73
|
+
title: I18n.t(`Hr_ExpenseStatus_${key}`),
|
|
74
|
+
color: this.getStatusColor(value, Colors),
|
|
75
|
+
key: value,
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export default ExpenseType;
|
|
80
|
+
//# sourceMappingURL=expense.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expense.js","sourceRoot":"","sources":["../../src/types/expense.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,WAAW;IACf,MAAM,CAAC,YAAY,GAAG;QACpB,KAAK,EAAE,CAAC;QACR,iBAAiB,EAAE,CAAC;QACpB,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,CAAC;KACZ,CAAC;IAEF,MAAM,CAAC,IAAI,GAAG;QACZ,SAAS,EAAE,eAAe;QAC1B,UAAU,EAAE,gBAAgB;KAC7B,CAAC;IAEF,MAAM,CAAC,SAAS,GAAG,CACjB,MAAc,EACd,IAAkC,EAC1B,EAAE;QACV,IAAI,IAAI,EAAE;YACR,QAAQ,MAAM,EAAE;gBACd,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK;oBAC1B,OAAO,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC;gBAC1C,KAAK,IAAI,CAAC,YAAY,CAAC,iBAAiB;oBACtC,OAAO,IAAI,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC;gBACtD,KAAK,IAAI,CAAC,YAAY,CAAC,QAAQ;oBAC7B,OAAO,IAAI,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC;gBAC7C,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU;oBAC/B,OAAO,IAAI,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC;gBAC/C,KAAK,IAAI,CAAC,YAAY,CAAC,OAAO;oBAC5B,OAAO,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;gBAC5C,KAAK,IAAI,CAAC,YAAY,CAAC,QAAQ;oBAC7B,OAAO,IAAI,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC;gBAC7C;oBACE,OAAO,CAAC,IAAI,CACV,8BAA8B,MAAM,8BAA8B,CACnE,CAAC;oBACF,OAAO,IAAI,CAAC;aACf;SACF;IACH,CAAC,CAAC;IACF,MAAM,CAAC,cAAc,GAAG,CAAC,MAAc,EAAE,MAAmB,EAAS,EAAE;QACrE,QAAQ,MAAM,EAAE;YACd,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK;gBAC1B,OAAO,MAAM,CAAC,cAAc,CAAC;YAC/B,KAAK,IAAI,CAAC,YAAY,CAAC,iBAAiB;gBACtC,OAAO,MAAM,CAAC,YAAY,CAAC;YAC7B,KAAK,IAAI,CAAC,YAAY,CAAC,QAAQ;gBAC7B,OAAO,MAAM,CAAC,YAAY,CAAC;YAC7B,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU;gBAC/B,OAAO,MAAM,CAAC,aAAa,CAAC;YAC9B,KAAK,IAAI,CAAC,YAAY,CAAC,OAAO;gBAC5B,OAAO,MAAM,CAAC,cAAc,CAAC;YAC/B,KAAK,IAAI,CAAC,YAAY,CAAC,QAAQ;gBAC7B,OAAO,MAAM,CAAC,YAAY,CAAC;YAC7B;gBACE,OAAO,CAAC,IAAI,CACV,8BAA8B,MAAM,8BAA8B,CACnE,CAAC;gBACF,OAAO,IAAI,CAAC;SACf;IACH,CAAC,CAAC;IAEF,MAAM,CAAC,aAAa,GAAG,CACrB,MAAmB,EACnB,IAAkC,EAClC,EAAE;QACF,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9D,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,oBAAoB,GAAG,EAAE,CAAC;YACxC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC;YACzC,GAAG,EAAE,KAAK;SACX,CAAC,CAAC,CAAC;IACN,CAAC,CAAC;;AAGJ,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare class ExpenseLineType {
|
|
2
|
+
static kilomectricTypeSelect: {
|
|
3
|
+
OneWay: number;
|
|
4
|
+
RoundTrip: number;
|
|
5
|
+
};
|
|
6
|
+
static modes: {
|
|
7
|
+
general: string;
|
|
8
|
+
kilometric: string;
|
|
9
|
+
};
|
|
10
|
+
static getExpenseMode: (item: any) => string;
|
|
11
|
+
static getKilomectricTypeSelect: (select: number, I18n: {
|
|
12
|
+
t: (key: string) => string;
|
|
13
|
+
}) => string;
|
|
14
|
+
static getKilomectricTypeSelectList: (I18n: {
|
|
15
|
+
t: (key: string) => string;
|
|
16
|
+
}) => {
|
|
17
|
+
title: string;
|
|
18
|
+
key: number;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export default ExpenseLineType;
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
class ExpenseLineType {
|
|
19
|
+
static kilomectricTypeSelect = {
|
|
20
|
+
OneWay: 1,
|
|
21
|
+
RoundTrip: 2,
|
|
22
|
+
};
|
|
23
|
+
static modes = {
|
|
24
|
+
general: 'general',
|
|
25
|
+
kilometric: 'kilometric',
|
|
26
|
+
};
|
|
27
|
+
static getExpenseMode = (item) => {
|
|
28
|
+
if (item == null) {
|
|
29
|
+
return this.modes.general;
|
|
30
|
+
}
|
|
31
|
+
if (item.fromCity != null && item.toCity != null) {
|
|
32
|
+
return this.modes.kilometric;
|
|
33
|
+
}
|
|
34
|
+
return this.modes.general;
|
|
35
|
+
};
|
|
36
|
+
static getKilomectricTypeSelect = (select, I18n) => {
|
|
37
|
+
if (I18n) {
|
|
38
|
+
switch (select) {
|
|
39
|
+
case this.kilomectricTypeSelect.OneWay:
|
|
40
|
+
return I18n.t('Hr_KilomectricTypeSelect_OneWay');
|
|
41
|
+
case this.kilomectricTypeSelect.RoundTrip:
|
|
42
|
+
return I18n.t('Hr_KilomectricTypeSelect_RoundTrip');
|
|
43
|
+
default:
|
|
44
|
+
console.warn(`KilomectricTypeSelect provided with value ${select} is not supported by ExpenseLine`);
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
static getKilomectricTypeSelectList = (I18n) => {
|
|
50
|
+
return Object.entries(this.kilomectricTypeSelect).map(([key, value]) => ({
|
|
51
|
+
title: I18n.t(`Hr_KilomectricTypeSelect_${key}`),
|
|
52
|
+
key: value,
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export default ExpenseLineType;
|
|
57
|
+
//# sourceMappingURL=expenseLine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expenseLine.js","sourceRoot":"","sources":["../../src/types/expenseLine.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,eAAe;IACnB,MAAM,CAAC,qBAAqB,GAAG;QAC7B,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,CAAC;KACb,CAAC;IAEF,MAAM,CAAC,KAAK,GAAG;QACb,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,YAAY;KACzB,CAAC;IAEF,MAAM,CAAC,cAAc,GAAG,CAAC,IAAS,EAAU,EAAE;QAC5C,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;SAC3B;QAED,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YAChD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;SAC9B;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,CAAC,wBAAwB,GAAG,CAChC,MAAc,EACd,IAAkC,EAClC,EAAE;QACF,IAAI,IAAI,EAAE;YACR,QAAQ,MAAM,EAAE;gBACd,KAAK,IAAI,CAAC,qBAAqB,CAAC,MAAM;oBACpC,OAAO,IAAI,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC;gBACnD,KAAK,IAAI,CAAC,qBAAqB,CAAC,SAAS;oBACvC,OAAO,IAAI,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC;gBACtD;oBACE,OAAO,CAAC,IAAI,CACV,6CAA6C,MAAM,kCAAkC,CACtF,CAAC;oBACF,OAAO,IAAI,CAAC;aACf;SACF;IACH,CAAC,CAAC;IAEF,MAAM,CAAC,4BAA4B,GAAG,CAAC,IAEtC,EAAE,EAAE;QACH,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YACvE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,4BAA4B,GAAG,EAAE,CAAC;YAChD,GAAG,EAAE,KAAK;SACX,CAAC,CAAC,CAAC;IACN,CAAC,CAAC;;AAGJ,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 Expense } from './expense';
|
|
19
|
+
export { default as ExpenseLine } from './expenseLine';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,eAAe,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@axelor/aos-mobile-hr",
|
|
3
|
+
"version": "7.2.0",
|
|
4
|
+
"author": "Axelor",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"main": "lib/index.js",
|
|
10
|
+
"types": "lib/index.d.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"lib"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"clean": "rm -rf lib/",
|
|
16
|
+
"compile": "tsc -p tsconfig.build.json",
|
|
17
|
+
"dev": "npm run compile -- --watch",
|
|
18
|
+
"build": "npm run clean && npm run compile",
|
|
19
|
+
"i18n": "i18n-parser --config=./i18n.json",
|
|
20
|
+
"npm-publish": "npm publish",
|
|
21
|
+
"lint": "eslint .",
|
|
22
|
+
"format": "prettier --write src/",
|
|
23
|
+
"format:check": "prettier --check src/",
|
|
24
|
+
"license:add": "npx add-copyright-header --generate --dir 'src'"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": "18.2.0",
|
|
28
|
+
"react-i18next": "^11.18.6"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@axelor/aos-mobile-core": "7.2.0",
|
|
32
|
+
"@axelor/aos-mobile-ui": "7.2.0",
|
|
33
|
+
"@reduxjs/toolkit": "^1.8.5"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@babel/runtime": "^7.19.0",
|
|
37
|
+
"@react-native-community/eslint-config": "^2.0.0",
|
|
38
|
+
"@types/react": "18.2.0",
|
|
39
|
+
"@types/react-native": "0.68.1",
|
|
40
|
+
"cpx2": "^4.2.0",
|
|
41
|
+
"eslint": "^7.32.0",
|
|
42
|
+
"i18n-parser": "^1.0.0",
|
|
43
|
+
"prettier": "^2.7.1",
|
|
44
|
+
"react": "18.2.0",
|
|
45
|
+
"react-native": "0.68.1"
|
|
46
|
+
},
|
|
47
|
+
"resolutions": {
|
|
48
|
+
"@types/react": "18.2.0"
|
|
49
|
+
}
|
|
50
|
+
}
|