@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.
Files changed (175) hide show
  1. package/README.md +44 -0
  2. package/lib/api/currency-api.d.ts +4 -0
  3. package/lib/api/currency-api.js +32 -0
  4. package/lib/api/currency-api.js.map +1 -0
  5. package/lib/api/distance-api.d.ts +4 -0
  6. package/lib/api/distance-api.js +40 -0
  7. package/lib/api/distance-api.js.map +1 -0
  8. package/lib/api/expense-api.d.ts +37 -0
  9. package/lib/api/expense-api.js +136 -0
  10. package/lib/api/expense-api.js.map +1 -0
  11. package/lib/api/expense-config-api.d.ts +1 -0
  12. package/lib/api/expense-config-api.js +23 -0
  13. package/lib/api/expense-config-api.js.map +1 -0
  14. package/lib/api/expense-line-api.d.ts +24 -0
  15. package/lib/api/expense-line-api.js +111 -0
  16. package/lib/api/expense-line-api.js.map +1 -0
  17. package/lib/api/expense-type-api.d.ts +5 -0
  18. package/lib/api/expense-type-api.js +56 -0
  19. package/lib/api/expense-type-api.js.map +1 -0
  20. package/lib/api/index.d.ts +6 -0
  21. package/lib/api/index.js +24 -0
  22. package/lib/api/index.js.map +1 -0
  23. package/lib/api/kilometric-allow-param-api.d.ts +5 -0
  24. package/lib/api/kilometric-allow-param-api.js +44 -0
  25. package/lib/api/kilometric-allow-param-api.js.map +1 -0
  26. package/lib/api/project-api.d.ts +5 -0
  27. package/lib/api/project-api.js +39 -0
  28. package/lib/api/project-api.js.map +1 -0
  29. package/lib/components/atoms/ExpenseCard/ExpenseCard.d.ts +15 -0
  30. package/lib/components/atoms/ExpenseCard/ExpenseCard.js +130 -0
  31. package/lib/components/atoms/ExpenseCard/ExpenseCard.js.map +1 -0
  32. package/lib/components/atoms/ExpenseLineCard/ExpenseLineCard.d.ts +12 -0
  33. package/lib/components/atoms/ExpenseLineCard/ExpenseLineCard.js +106 -0
  34. package/lib/components/atoms/ExpenseLineCard/ExpenseLineCard.js.map +1 -0
  35. package/lib/components/atoms/index.d.ts +2 -0
  36. package/lib/components/atoms/index.js +20 -0
  37. package/lib/components/atoms/index.js.map +1 -0
  38. package/lib/components/index.d.ts +3 -0
  39. package/lib/components/index.js +21 -0
  40. package/lib/components/index.js.map +1 -0
  41. package/lib/components/molecules/ExpenseAddPopup/ExpenseAddPopup.d.ts +7 -0
  42. package/lib/components/molecules/ExpenseAddPopup/ExpenseAddPopup.js +78 -0
  43. package/lib/components/molecules/ExpenseAddPopup/ExpenseAddPopup.js.map +1 -0
  44. package/lib/components/molecules/ExpenseDetailsValidationButton/ExpenseDetailsValidationButton.d.ts +5 -0
  45. package/lib/components/molecules/ExpenseDetailsValidationButton/ExpenseDetailsValidationButton.js +76 -0
  46. package/lib/components/molecules/ExpenseDetailsValidationButton/ExpenseDetailsValidationButton.js.map +1 -0
  47. package/lib/components/molecules/ExpenseLineDetailCard/ExpenseLineDetailCard.d.ts +11 -0
  48. package/lib/components/molecules/ExpenseLineDetailCard/ExpenseLineDetailCard.js +131 -0
  49. package/lib/components/molecules/ExpenseLineDetailCard/ExpenseLineDetailCard.js.map +1 -0
  50. package/lib/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.d.ts +6 -0
  51. package/lib/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.js +37 -0
  52. package/lib/components/molecules/ExpenseLineValidationButton/ExpenseLineValidationButton.js.map +1 -0
  53. package/lib/components/molecules/ExpenseRefusalPopup/ExpenseRefusalPopup.d.ts +9 -0
  54. package/lib/components/molecules/ExpenseRefusalPopup/ExpenseRefusalPopup.js +39 -0
  55. package/lib/components/molecules/ExpenseRefusalPopup/ExpenseRefusalPopup.js.map +1 -0
  56. package/lib/components/molecules/index.d.ts +5 -0
  57. package/lib/components/molecules/index.js +23 -0
  58. package/lib/components/molecules/index.js.map +1 -0
  59. package/lib/components/templates/BillableSwitchCard/BillableSwitchCard.d.ts +7 -0
  60. package/lib/components/templates/BillableSwitchCard/BillableSwitchCard.js +26 -0
  61. package/lib/components/templates/BillableSwitchCard/BillableSwitchCard.js.map +1 -0
  62. package/lib/components/templates/CityFormInput/CityFormInput.d.ts +9 -0
  63. package/lib/components/templates/CityFormInput/CityFormInput.js +76 -0
  64. package/lib/components/templates/CityFormInput/CityFormInput.js.map +1 -0
  65. package/lib/components/templates/CurrencySearchBar/CurrencySearchBar.d.ts +9 -0
  66. package/lib/components/templates/CurrencySearchBar/CurrencySearchBar.js +38 -0
  67. package/lib/components/templates/CurrencySearchBar/CurrencySearchBar.js.map +1 -0
  68. package/lib/components/templates/DistanceIncrement/DistanceIncrement.d.ts +9 -0
  69. package/lib/components/templates/DistanceIncrement/DistanceIncrement.js +46 -0
  70. package/lib/components/templates/DistanceIncrement/DistanceIncrement.js.map +1 -0
  71. package/lib/components/templates/ExpenseHeader/ExpenseHeader.d.ts +2 -0
  72. package/lib/components/templates/ExpenseHeader/ExpenseHeader.js +52 -0
  73. package/lib/components/templates/ExpenseHeader/ExpenseHeader.js.map +1 -0
  74. package/lib/components/templates/ExpenseLineTypeSwitch/ExpenseLineTypeSwitch.d.ts +4 -0
  75. package/lib/components/templates/ExpenseLineTypeSwitch/ExpenseLineTypeSwitch.js +63 -0
  76. package/lib/components/templates/ExpenseLineTypeSwitch/ExpenseLineTypeSwitch.js.map +1 -0
  77. package/lib/components/templates/ExpenseTypeSearchBar/ExpenseTypeSearchBar.d.ts +5 -0
  78. package/lib/components/templates/ExpenseTypeSearchBar/ExpenseTypeSearchBar.js +40 -0
  79. package/lib/components/templates/ExpenseTypeSearchBar/ExpenseTypeSearchBar.js.map +1 -0
  80. package/lib/components/templates/ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar.d.ts +12 -0
  81. package/lib/components/templates/ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar.js +33 -0
  82. package/lib/components/templates/ExpenseWaitingValidationSearchBar/ExpenseWaitingValidationSearchBar.js.map +1 -0
  83. package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.d.ts +9 -0
  84. package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.js +81 -0
  85. package/lib/components/templates/KilometricAllowParamSearchBar/KilometricAllowParamSearchBar.js.map +1 -0
  86. package/lib/components/templates/KilometricTypeSelectPicker/KilometricTypeSelectPicker.d.ts +8 -0
  87. package/lib/components/templates/KilometricTypeSelectPicker/KilometricTypeSelectPicker.js +37 -0
  88. package/lib/components/templates/KilometricTypeSelectPicker/KilometricTypeSelectPicker.js.map +1 -0
  89. package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.d.ts +9 -0
  90. package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.js +38 -0
  91. package/lib/components/templates/ProjectSearchBar/ProjectSearchBar.js.map +1 -0
  92. package/lib/components/templates/ToggleSwitchMode/ToggleSwitchMode.d.ts +6 -0
  93. package/lib/components/templates/ToggleSwitchMode/ToggleSwitchMode.js +34 -0
  94. package/lib/components/templates/ToggleSwitchMode/ToggleSwitchMode.js.map +1 -0
  95. package/lib/components/templates/index.d.ts +12 -0
  96. package/lib/components/templates/index.js +30 -0
  97. package/lib/components/templates/index.js.map +1 -0
  98. package/lib/features/asyncFunctions-index.d.ts +6 -0
  99. package/lib/features/asyncFunctions-index.js +24 -0
  100. package/lib/features/asyncFunctions-index.js.map +1 -0
  101. package/lib/features/currencySlice.d.ts +16 -0
  102. package/lib/features/currencySlice.js +49 -0
  103. package/lib/features/currencySlice.js.map +1 -0
  104. package/lib/features/distanceSlice.d.ts +22 -0
  105. package/lib/features/distanceSlice.js +76 -0
  106. package/lib/features/distanceSlice.js.map +1 -0
  107. package/lib/features/expenseConfigSlice.d.ts +14 -0
  108. package/lib/features/expenseConfigSlice.js +48 -0
  109. package/lib/features/expenseConfigSlice.js.map +1 -0
  110. package/lib/features/expenseLineSlice.d.ts +76 -0
  111. package/lib/features/expenseLineSlice.js +180 -0
  112. package/lib/features/expenseLineSlice.js.map +1 -0
  113. package/lib/features/expenseSlice.d.ts +105 -0
  114. package/lib/features/expenseSlice.js +314 -0
  115. package/lib/features/expenseSlice.js.map +1 -0
  116. package/lib/features/expenseTypeSlice.d.ts +16 -0
  117. package/lib/features/expenseTypeSlice.js +49 -0
  118. package/lib/features/expenseTypeSlice.js.map +1 -0
  119. package/lib/features/index.d.ts +8 -0
  120. package/lib/features/index.js +26 -0
  121. package/lib/features/index.js.map +1 -0
  122. package/lib/features/kilometricAllowParamSlice.d.ts +18 -0
  123. package/lib/features/kilometricAllowParamSlice.js +56 -0
  124. package/lib/features/kilometricAllowParamSlice.js.map +1 -0
  125. package/lib/features/projectSlice.d.ts +16 -0
  126. package/lib/features/projectSlice.js +49 -0
  127. package/lib/features/projectSlice.js.map +1 -0
  128. package/lib/hooks/use-hr-header-actions.d.ts +1 -0
  129. package/lib/hooks/use-hr-header-actions.js +53 -0
  130. package/lib/hooks/use-hr-header-actions.js.map +1 -0
  131. package/lib/i18n/en.json +68 -0
  132. package/lib/i18n/fr.json +68 -0
  133. package/lib/index.d.ts +7 -0
  134. package/lib/index.js +66 -0
  135. package/lib/index.js.map +1 -0
  136. package/lib/models/forms.d.ts +2 -0
  137. package/lib/models/forms.js +183 -0
  138. package/lib/models/forms.js.map +1 -0
  139. package/lib/models/index.d.ts +4 -0
  140. package/lib/models/index.js +22 -0
  141. package/lib/models/index.js.map +1 -0
  142. package/lib/models/objectFields.d.ts +2 -0
  143. package/lib/models/objectFields.js +87 -0
  144. package/lib/models/objectFields.js.map +1 -0
  145. package/lib/models/searchFields.d.ts +2 -0
  146. package/lib/models/searchFields.js +26 -0
  147. package/lib/models/searchFields.js.map +1 -0
  148. package/lib/models/sortFields.d.ts +2 -0
  149. package/lib/models/sortFields.js +26 -0
  150. package/lib/models/sortFields.js.map +1 -0
  151. package/lib/screens/ExpenseDetailsScreen.d.ts +5 -0
  152. package/lib/screens/ExpenseDetailsScreen.js +85 -0
  153. package/lib/screens/ExpenseDetailsScreen.js.map +1 -0
  154. package/lib/screens/ExpenseLineFormScreen.d.ts +5 -0
  155. package/lib/screens/ExpenseLineFormScreen.js +202 -0
  156. package/lib/screens/ExpenseLineFormScreen.js.map +1 -0
  157. package/lib/screens/ExpenseLinesListScreen.d.ts +4 -0
  158. package/lib/screens/ExpenseLinesListScreen.js +91 -0
  159. package/lib/screens/ExpenseLinesListScreen.js.map +1 -0
  160. package/lib/screens/ExpenseListScreen.d.ts +4 -0
  161. package/lib/screens/ExpenseListScreen.js +138 -0
  162. package/lib/screens/ExpenseListScreen.js.map +1 -0
  163. package/lib/screens/index.d.ts +38 -0
  164. package/lib/screens/index.js +52 -0
  165. package/lib/screens/index.js.map +1 -0
  166. package/lib/types/expense.d.ts +27 -0
  167. package/lib/types/expense.js +80 -0
  168. package/lib/types/expense.js.map +1 -0
  169. package/lib/types/expenseLine.d.ts +21 -0
  170. package/lib/types/expenseLine.js +57 -0
  171. package/lib/types/expenseLine.js.map +1 -0
  172. package/lib/types/index.d.ts +2 -0
  173. package/lib/types/index.js +20 -0
  174. package/lib/types/index.js.map +1 -0
  175. package/package.json +50 -0
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: HR
3
+ tags: Readme
4
+ ---
5
+
6
+ <h1 align="center">@axelor/aos-mobile-hr</h1>
7
+
8
+ <div align="center">
9
+ <img src="https://i.imgur.com/KJAAFlT.png" width="30%"/>
10
+ </div>
11
+
12
+ ## Presentation
13
+
14
+ This package was developed for the [Axelor Open Mobile](https://github.com/axelor/axelor-mobile) application.
15
+
16
+ The purpose of this package is to link with the HR module of the [Axelor Open Suite (AOS)](https://github.com/axelor/axelor-open-suite) ERP to realize expenses. This package is compatible with AOS from version 7.2.0.
17
+
18
+ ## Usage
19
+
20
+ Install the library :
21
+
22
+ ```bash
23
+ yarn add @axelor/aos-mobile-hr
24
+ ```
25
+
26
+ Compatibility with React v18.2.x and React Native v0.68.x.
27
+
28
+ To add this package in your application, you need to add it the _modules_ props of the component `Application` from @axelor/aos-mobile-core package.
29
+
30
+ ```javascript
31
+ import React from 'react';
32
+ import {Application} from '@axelor/aos-mobile-core';
33
+ import {HrModule} from '@axelor/aos-mobile-hr';
34
+
35
+ const App = () => {
36
+ return <Application modules={[HrModule]} mainMenu="auth_menu_user" />;
37
+ };
38
+
39
+ export default App;
40
+ ```
41
+
42
+ ## Developpment
43
+
44
+ This package is developed as part of the Axelor Open Mobile application. To contribute, please go to the [Github project](https://github.com/axelor/axelor-mobile) and follow the guidelines. You will also find an installation guide to help you configure your environment.
@@ -0,0 +1,4 @@
1
+ export function searchCurrencies({ searchValue, page }: {
2
+ searchValue?: any;
3
+ page?: number;
4
+ }): Promise<any>;
@@ -0,0 +1,32 @@
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 { createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createCurrencyCriteria = searchValue => {
20
+ const criteria = [getSearchCriterias('hr_currency', searchValue)];
21
+ return criteria;
22
+ };
23
+ export async function searchCurrencies({ searchValue = null, page = 0 }) {
24
+ return createStandardSearch({
25
+ model: 'com.axelor.apps.base.db.Currency',
26
+ criteria: createCurrencyCriteria(searchValue),
27
+ fieldKey: 'hr_currency',
28
+ sortKey: 'hr_currency',
29
+ page,
30
+ });
31
+ }
32
+ //# sourceMappingURL=currency-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency-api.js","sourceRoot":"","sources":["../../src/api/currency-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,sBAAsB,GAAG,WAAW,CAAC,EAAE;IAC3C,MAAM,QAAQ,GAAG,CAAC,kBAAkB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;IAElE,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAC,WAAW,GAAG,IAAI,EAAE,IAAI,GAAG,CAAC,EAAC;IACnE,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,kCAAkC;QACzC,QAAQ,EAAE,sBAAsB,CAAC,WAAW,CAAC;QAC7C,QAAQ,EAAE,aAAa;QACvB,OAAO,EAAE,aAAa;QACtB,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ export function getDistance({ fromCity, toCity }: {
2
+ fromCity: any;
3
+ toCity: any;
4
+ }): Promise<any>;
@@ -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 { axiosApiProvider } from '@axelor/aos-mobile-core';
19
+ export async function getDistance({ fromCity, toCity }) {
20
+ if (fromCity != null && toCity != null) {
21
+ return axiosApiProvider
22
+ .post({
23
+ url: 'ws/aos/kilometric/distance',
24
+ data: { fromCity, toCity },
25
+ })
26
+ .catch(e => {
27
+ if (e?.response?.data?.codeStatus === 500) {
28
+ return {
29
+ data: {
30
+ object: { error: true, message: e.response.data.messageStatus },
31
+ },
32
+ };
33
+ }
34
+ else {
35
+ throw e;
36
+ }
37
+ });
38
+ }
39
+ }
40
+ //# sourceMappingURL=distance-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distance-api.js","sourceRoot":"","sources":["../../src/api/distance-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAEzD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAC,QAAQ,EAAE,MAAM,EAAC;IAClD,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,EAAE;QACtC,OAAO,gBAAgB;aACpB,IAAI,CAAC;YACJ,GAAG,EAAE,4BAA4B;YACjC,IAAI,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC;SACzB,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE;YACT,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,KAAK,GAAG,EAAE;gBACzC,OAAO;oBACL,IAAI,EAAE;wBACJ,MAAM,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAC;qBAC9D;iBACF,CAAC;aACH;iBAAM;gBACL,MAAM,CAAC,CAAC;aACT;QACH,CAAC,CAAC,CAAC;KACN;AACH,CAAC"}
@@ -0,0 +1,37 @@
1
+ export function searchExpenseDraft({ userId }: {
2
+ userId: any;
3
+ }): Promise<any>;
4
+ export function searchMyExpense({ searchValue, page, userId }: {
5
+ searchValue?: any;
6
+ page?: number;
7
+ userId: any;
8
+ }): Promise<any>;
9
+ export function searchExpenseToValidate({ searchValue, page, user, }: {
10
+ searchValue?: any;
11
+ page?: number;
12
+ user: any;
13
+ }): Promise<any>;
14
+ export function getExpense({ ExpenseId }: {
15
+ ExpenseId: any;
16
+ }): Promise<any>;
17
+ export function createExpense({ expense }: {
18
+ expense: any;
19
+ }): Promise<any>;
20
+ export function updateExpense({ expenseId, version, expenseLineIdList }: {
21
+ expenseId: any;
22
+ version: any;
23
+ expenseLineIdList: any;
24
+ }): Promise<any>;
25
+ export function sendExpense({ expenseId, version }: {
26
+ expenseId: any;
27
+ version: any;
28
+ }): Promise<any>;
29
+ export function validateExpense({ expenseId, version }: {
30
+ expenseId: any;
31
+ version: any;
32
+ }): Promise<any>;
33
+ export function refuseExpense({ expenseId, version, groundForRefusal }: {
34
+ expenseId: any;
35
+ version: any;
36
+ groundForRefusal: any;
37
+ }): Promise<any>;
@@ -0,0 +1,136 @@
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 { createStandardSearch, getSearchCriterias, createStandardFetch, axiosApiProvider, } from '@axelor/aos-mobile-core';
19
+ import { Expense } from '../types';
20
+ const createExpenseDraftCriteria = userId => {
21
+ const criteria = [
22
+ {
23
+ fieldName: 'statusSelect',
24
+ operator: '=',
25
+ value: Expense.statusSelect.Draft,
26
+ },
27
+ ];
28
+ if (userId != null) {
29
+ criteria.push({
30
+ fieldName: 'employee.user.id',
31
+ operator: '=',
32
+ value: userId,
33
+ });
34
+ }
35
+ return criteria;
36
+ };
37
+ const createMyExpenseCriteria = (searchValue, userId) => {
38
+ const criteria = [getSearchCriterias('hr_expense', searchValue)];
39
+ if (userId != null) {
40
+ criteria.push({
41
+ fieldName: 'employee.user.id',
42
+ operator: '=',
43
+ value: userId,
44
+ });
45
+ }
46
+ return criteria;
47
+ };
48
+ const createExpenseToValidateCriteria = (searchValue, user) => {
49
+ const criteria = [
50
+ getSearchCriterias('hr_expense', searchValue),
51
+ {
52
+ fieldName: 'statusSelect',
53
+ operator: '=',
54
+ value: Expense.statusSelect.WaitingValidation,
55
+ },
56
+ ];
57
+ if (!user?.employee?.hrManager) {
58
+ criteria.push({
59
+ fieldName: 'employee.managerUser.id',
60
+ operator: '=',
61
+ value: user?.id,
62
+ });
63
+ }
64
+ return criteria;
65
+ };
66
+ export async function searchExpenseDraft({ userId }) {
67
+ return createStandardSearch({
68
+ model: 'com.axelor.apps.hr.db.Expense',
69
+ criteria: createExpenseDraftCriteria(userId),
70
+ fieldKey: 'hr_expenseDraft',
71
+ numberElementsByPage: null,
72
+ page: 0,
73
+ });
74
+ }
75
+ export async function searchMyExpense({ searchValue = null, page = 0, userId }) {
76
+ return createStandardSearch({
77
+ model: 'com.axelor.apps.hr.db.Expense',
78
+ criteria: createMyExpenseCriteria(searchValue, userId),
79
+ fieldKey: 'hr_expense',
80
+ sortKey: 'hr_expense',
81
+ page,
82
+ });
83
+ }
84
+ export async function searchExpenseToValidate({ searchValue = null, page = 0, user, }) {
85
+ return createStandardSearch({
86
+ model: 'com.axelor.apps.hr.db.Expense',
87
+ criteria: createExpenseToValidateCriteria(searchValue, user),
88
+ fieldKey: 'hr_expense',
89
+ sortKey: 'hr_expense',
90
+ page,
91
+ });
92
+ }
93
+ export async function getExpense({ ExpenseId }) {
94
+ return createStandardFetch({
95
+ model: 'com.axelor.apps.hr.db.Expense',
96
+ id: ExpenseId,
97
+ fieldKey: 'hr_expense',
98
+ });
99
+ }
100
+ export async function createExpense({ expense }) {
101
+ return axiosApiProvider.post({
102
+ url: 'ws/aos/expense/',
103
+ data: expense,
104
+ });
105
+ }
106
+ export async function updateExpense({ expenseId, version, expenseLineIdList }) {
107
+ return axiosApiProvider.put({
108
+ url: `ws/aos/expense/add-line/${expenseId}`,
109
+ data: {
110
+ version: version,
111
+ expenseLineIdList: expenseLineIdList,
112
+ },
113
+ });
114
+ }
115
+ export async function sendExpense({ expenseId, version }) {
116
+ return axiosApiProvider.put({
117
+ url: `ws/aos/expense/send/${expenseId}`,
118
+ data: { version: version },
119
+ });
120
+ }
121
+ export async function validateExpense({ expenseId, version }) {
122
+ return axiosApiProvider.put({
123
+ url: `ws/aos/expense/validate/${expenseId}`,
124
+ data: { version: version },
125
+ });
126
+ }
127
+ export async function refuseExpense({ expenseId, version, groundForRefusal }) {
128
+ return axiosApiProvider.put({
129
+ url: `ws/aos/expense/refuse/${expenseId}`,
130
+ data: {
131
+ version: version,
132
+ groundForRefusal: groundForRefusal,
133
+ },
134
+ });
135
+ }
136
+ //# sourceMappingURL=expense-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expense-api.js","sourceRoot":"","sources":["../../src/api/expense-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEjC,MAAM,0BAA0B,GAAG,MAAM,CAAC,EAAE;IAC1C,MAAM,QAAQ,GAAG;QACf;YACE,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK;SAClC;KACF,CAAC;IAEF,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,kBAAkB;YAC7B,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;KACJ;IACD,OAAO,QAA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,OAAO,EAAC;IACpD,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,uBAAuB,SAAS,EAAE;QACvC,IAAI,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC;KACzB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAC,SAAS,EAAE,OAAO,EAAC;IACxD,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,2BAA2B,SAAS,EAAE;QAC3C,IAAI,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC;KACzB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAC;IACxE,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,yBAAyB,SAAS,EAAE;QACzC,IAAI,EAAE;YACJ,OAAO,EAAE,OAAO;YAChB,gBAAgB,EAAE,gBAAgB;SACnC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1 @@
1
+ export function fetchExpenseConfig(): Promise<any>;
@@ -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
+ import { axiosApiProvider, RouterProvider } from '@axelor/aos-mobile-core';
19
+ export async function fetchExpenseConfig() {
20
+ const route = await RouterProvider.get('AppExpense');
21
+ return axiosApiProvider.get({ url: route });
22
+ }
23
+ //# sourceMappingURL=expense-config-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expense-config-api.js","sourceRoot":"","sources":["../../src/api/expense-config-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEzE,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAErD,OAAO,gBAAgB,CAAC,GAAG,CAAC,EAAC,GAAG,EAAE,KAAK,EAAC,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,24 @@
1
+ export function searchExpenseLines({ searchValue, userId, page, }: {
2
+ searchValue?: any;
3
+ userId: any;
4
+ page?: number;
5
+ }): Promise<any>;
6
+ export function searchGeneralExpenseLines({ searchValue, expenseId, page, }: {
7
+ searchValue?: any;
8
+ expenseId: any;
9
+ page: any;
10
+ }): Promise<any>;
11
+ export function searchKilometricExpenseLines({ searchValue, expenseId, page, }: {
12
+ searchValue?: any;
13
+ expenseId: any;
14
+ page: any;
15
+ }): Promise<any>;
16
+ export function createExpenseLine({ expenseLine }: {
17
+ expenseLine: any;
18
+ }): Promise<any>;
19
+ export function updateExpenseLine({ expenseLine }: {
20
+ expenseLine: any;
21
+ }): Promise<any>;
22
+ export function deleteExpenseLine({ ExpenseLineId }: {
23
+ ExpenseLineId: any;
24
+ }): Promise<any>;
@@ -0,0 +1,111 @@
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 { axiosApiProvider, createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createExpenseLineSearchCriteria = searchValue => {
20
+ return [getSearchCriterias('hr_expenseLines', searchValue)];
21
+ };
22
+ const createExpenseLinesCriteria = (searchValue, userId) => {
23
+ const criteria = createExpenseLineSearchCriteria(searchValue);
24
+ if (userId != null) {
25
+ criteria.push({
26
+ operator: 'and',
27
+ criteria: [
28
+ {
29
+ fieldName: 'employee.user.id',
30
+ operator: '=',
31
+ value: userId,
32
+ },
33
+ {
34
+ fieldName: 'expense',
35
+ operator: 'isNull',
36
+ },
37
+ ],
38
+ });
39
+ }
40
+ return criteria;
41
+ };
42
+ const createExpenseLineCriteria = (searchValue, expenseId) => {
43
+ const criteria = createExpenseLineSearchCriteria(searchValue);
44
+ if (expenseId != null) {
45
+ criteria.push({
46
+ fieldName: 'expense.id',
47
+ operator: '=',
48
+ value: expenseId,
49
+ });
50
+ }
51
+ return criteria;
52
+ };
53
+ const createGeneralExpenseLineCriteria = (searchValue, expenseId) => {
54
+ const criteria = createExpenseLineCriteria(searchValue, expenseId);
55
+ criteria.push({
56
+ fieldName: 'generalExpense',
57
+ operator: 'notNull',
58
+ });
59
+ return criteria;
60
+ };
61
+ const createKilomectricExpenseLineCriteria = (searchValue, expenseId) => {
62
+ const criteria = createExpenseLineCriteria(searchValue, expenseId);
63
+ criteria.push({
64
+ fieldName: 'kilometricExpense',
65
+ operator: 'notNull',
66
+ });
67
+ return criteria;
68
+ };
69
+ export async function searchExpenseLines({ searchValue = null, userId, page = 0, }) {
70
+ return createStandardSearch({
71
+ model: 'com.axelor.apps.hr.db.ExpenseLine',
72
+ criteria: createExpenseLinesCriteria(searchValue, userId),
73
+ fieldKey: 'hr_expenseLines',
74
+ sortKey: 'hr_expenseLines',
75
+ page,
76
+ });
77
+ }
78
+ export async function searchGeneralExpenseLines({ searchValue = null, expenseId, page, }) {
79
+ return createStandardSearch({
80
+ model: 'com.axelor.apps.hr.db.ExpenseLine',
81
+ criteria: createGeneralExpenseLineCriteria(searchValue, expenseId),
82
+ fieldKey: 'hr_expenseLines',
83
+ page: page,
84
+ });
85
+ }
86
+ export async function searchKilometricExpenseLines({ searchValue = null, expenseId, page, }) {
87
+ return createStandardSearch({
88
+ model: 'com.axelor.apps.hr.db.ExpenseLine',
89
+ criteria: createKilomectricExpenseLineCriteria(searchValue, expenseId),
90
+ fieldKey: 'hr_expenseLines',
91
+ page: page,
92
+ });
93
+ }
94
+ export async function createExpenseLine({ expenseLine }) {
95
+ return axiosApiProvider.post({
96
+ url: 'ws/aos/expense-line/',
97
+ data: expenseLine,
98
+ });
99
+ }
100
+ export async function updateExpenseLine({ expenseLine }) {
101
+ return axiosApiProvider.post({
102
+ url: `ws/rest/com.axelor.apps.hr.db.ExpenseLine/${expenseLine.id}`,
103
+ data: { data: expenseLine },
104
+ });
105
+ }
106
+ export async function deleteExpenseLine({ ExpenseLineId }) {
107
+ return axiosApiProvider.delete({
108
+ url: `ws/rest/com.axelor.apps.hr.db.ExpenseLine/${ExpenseLineId}`,
109
+ });
110
+ }
111
+ //# sourceMappingURL=expense-line-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expense-line-api.js","sourceRoot":"","sources":["../../src/api/expense-line-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,+BAA+B,GAAG,WAAW,CAAC,EAAE;IACpD,OAAO,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,WA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,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,6CAA6C,WAAW,CAAC,EAAE,EAAE;QAClE,IAAI,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC;KAC1B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EAAC,aAAa,EAAC;IACrD,OAAO,gBAAgB,CAAC,MAAM,CAAC;QAC7B,GAAG,EAAE,6CAA6C,aAAa,EAAE;KAClE,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ export function searchExpenseType({ searchValue, page, user }: {
2
+ searchValue?: any;
3
+ page?: number;
4
+ user: any;
5
+ }): Promise<any>;
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createExpenseType = (searchValue, user) => {
20
+ const criteria = [
21
+ {
22
+ fieldName: 'isModel',
23
+ operator: '=',
24
+ value: false,
25
+ },
26
+ {
27
+ fieldName: 'expense',
28
+ operator: '=',
29
+ value: true,
30
+ },
31
+ {
32
+ fieldName: 'dtype',
33
+ operator: '=',
34
+ value: 'Product',
35
+ },
36
+ getSearchCriterias('hr_expenseType', searchValue),
37
+ ];
38
+ if (!user?.employee?.hrManager) {
39
+ criteria.push({
40
+ fieldName: 'unavailableToUsers',
41
+ operator: '=',
42
+ value: false,
43
+ });
44
+ }
45
+ return criteria;
46
+ };
47
+ export async function searchExpenseType({ searchValue = null, page = 0, user }) {
48
+ return createStandardSearch({
49
+ model: 'com.axelor.apps.base.db.Product',
50
+ criteria: createExpenseType(searchValue, user),
51
+ fieldKey: 'hr_expenseType',
52
+ sortKey: 'hr_expenseType',
53
+ page,
54
+ });
55
+ }
56
+ //# sourceMappingURL=expense-type-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expense-type-api.js","sourceRoot":"","sources":["../../src/api/expense-type-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,iBAAiB,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE;IAC9C,MAAM,QAAQ,GAAG;QACf;YACE,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,KAAK;SACb;QACD;YACE,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,IAAI;SACZ;QACD;YACE,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,SAAS;SACjB;QACD,kBAAkB,CAAC,gBAAgB,EAAE,WAAW,CAAC;KAClD,CAAC;IACF,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE;QAC9B,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,oBAAoB;YAC/B,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;KACJ;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EAAC,WAAW,GAAG,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,EAAC;IAC1E,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,iCAAiC;QACxC,QAAQ,EAAE,iBAAiB,CAAC,WAAW,EAAE,IAAI,CAAC;QAC9C,QAAQ,EAAE,gBAAgB;QAC1B,OAAO,EAAE,gBAAgB;QACzB,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { searchCurrencies as searchCurrenciesApi } from './currency-api';
2
+ export { createExpense as createExpenseApi, getExpense, refuseExpense as refuseExpenseApi, searchExpenseDraft as searchExpenseDraftApi, searchExpenseToValidate as searchExpenseToValidateApi, searchMyExpense as searchMyExpenseApi, sendExpense as sendExpenseApi, updateExpense as updateExpenseApi, validateExpense as validateExpenseApi, } from './expense-api';
3
+ export { createExpenseLine as createExpenseLineApi, deleteExpenseLine as deleteExpenseLineApi, searchExpenseLines as searchExpenseLinespi, searchGeneralExpenseLines as searchGeneralExpenseLinesApi, searchKilometricExpenseLines as searchKilometricExpenseLinesApi, updateExpenseLine as updateExpenseLineApi, } from './expense-line-api';
4
+ export { searchExpenseType as searchExpenseTypeApi } from './expense-type-api';
5
+ export { searchKilometricAllowParam as searchKilometricAllowParamApi } from './kilometric-allow-param-api';
6
+ export { searchProject as searchProjectApi } from './project-api';
@@ -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 as searchCurrenciesApi } from './currency-api';
19
+ export { createExpense as createExpenseApi, getExpense, refuseExpense as refuseExpenseApi, searchExpenseDraft as searchExpenseDraftApi, searchExpenseToValidate as searchExpenseToValidateApi, searchMyExpense as searchMyExpenseApi, sendExpense as sendExpenseApi, updateExpense as updateExpenseApi, validateExpense as validateExpenseApi, } from './expense-api';
20
+ export { createExpenseLine as createExpenseLineApi, deleteExpenseLine as deleteExpenseLineApi, searchExpenseLines as searchExpenseLinespi, searchGeneralExpenseLines as searchGeneralExpenseLinesApi, searchKilometricExpenseLines as searchKilometricExpenseLinesApi, updateExpenseLine as updateExpenseLineApi, } from './expense-line-api';
21
+ export { searchExpenseType as searchExpenseTypeApi } from './expense-type-api';
22
+ export { searchKilometricAllowParam as searchKilometricAllowParamApi } from './kilometric-allow-param-api';
23
+ export { searchProject as searchProjectApi } from './project-api';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,IAAI,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EACL,aAAa,IAAI,gBAAgB,EACjC,UAAU,EACV,aAAa,IAAI,gBAAgB,EACjC,kBAAkB,IAAI,qBAAqB,EAC3C,uBAAuB,IAAI,0BAA0B,EACrD,eAAe,IAAI,kBAAkB,EACrC,WAAW,IAAI,cAAc,EAC7B,aAAa,IAAI,gBAAgB,EACjC,eAAe,IAAI,kBAAkB,GACtC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,IAAI,oBAAoB,EACzC,iBAAiB,IAAI,oBAAoB,EACzC,kBAAkB,IAAI,oBAAoB,EAC1C,yBAAyB,IAAI,4BAA4B,EACzD,4BAA4B,IAAI,+BAA+B,EAC/D,iBAAiB,IAAI,oBAAoB,GAC1C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,iBAAiB,IAAI,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAC,0BAA0B,IAAI,6BAA6B,EAAC,MAAM,8BAA8B,CAAC;AACzG,OAAO,EAAC,aAAa,IAAI,gBAAgB,EAAC,MAAM,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ export function searchKilometricAllowParam({ searchValue, page, idList, }: {
2
+ searchValue?: any;
3
+ page?: number;
4
+ idList?: any[];
5
+ }): Promise<any>;
@@ -0,0 +1,44 @@
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 { createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createKilometricAllowParamCriteria = (searchValue, idList) => {
20
+ const criteria = [
21
+ getSearchCriterias('hr_kilomectricAllowParam', searchValue),
22
+ ];
23
+ if (Array.isArray(idList)) {
24
+ criteria.push({
25
+ fieldName: 'id',
26
+ operator: 'in',
27
+ value: idList,
28
+ });
29
+ }
30
+ return criteria;
31
+ };
32
+ export async function searchKilometricAllowParam({ searchValue = null, page = 0, idList = [], }) {
33
+ if (!Array.isArray(idList) || idList.length === 0) {
34
+ return [];
35
+ }
36
+ return createStandardSearch({
37
+ model: 'com.axelor.apps.hr.db.KilometricAllowParam',
38
+ criteria: createKilometricAllowParamCriteria(searchValue, idList),
39
+ fieldKey: 'hr_kilomectricAllowParam',
40
+ sortKey: 'hr_kilomectricAllowParam',
41
+ page,
42
+ });
43
+ }
44
+ //# sourceMappingURL=kilometric-allow-param-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kilometric-allow-param-api.js","sourceRoot":"","sources":["../../src/api/kilometric-allow-param-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,kCAAkC,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE;IACjE,MAAM,QAAQ,GAAG;QACf,kBAAkB,CAAC,0BAA0B,EAAE,WAAW,CAAC;KAC5D,CAAC;IAEF,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;KACJ;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAC/C,WAAW,GAAG,IAAI,EAClB,IAAI,GAAG,CAAC,EACR,MAAM,GAAG,EAAE,GACZ;IACC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACjD,OAAO,EAAE,CAAC;KACX;IAED,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,4CAA4C;QACnD,QAAQ,EAAE,kCAAkC,CAAC,WAAW,EAAE,MAAM,CAAC;QACjE,QAAQ,EAAE,0BAA0B;QACpC,OAAO,EAAE,0BAA0B;QACnC,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}