@axelor/aos-mobile-manufacturing 0.0.1

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 (196) hide show
  1. package/README.md +45 -0
  2. package/lib/api/index.d.ts +7 -0
  3. package/lib/api/index.js +25 -0
  4. package/lib/api/index.js.map +1 -0
  5. package/lib/api/machine-api.d.ts +3 -0
  6. package/lib/api/machine-api.js +47 -0
  7. package/lib/api/machine-api.js.map +1 -0
  8. package/lib/api/manufacturing-order-api.d.ts +22 -0
  9. package/lib/api/manufacturing-order-api.js +225 -0
  10. package/lib/api/manufacturing-order-api.js.map +1 -0
  11. package/lib/api/operation-order-api.d.ts +14 -0
  12. package/lib/api/operation-order-api.js +153 -0
  13. package/lib/api/operation-order-api.js.map +1 -0
  14. package/lib/api/prod-product-api.d.ts +21 -0
  15. package/lib/api/prod-product-api.js +59 -0
  16. package/lib/api/prod-product-api.js.map +1 -0
  17. package/lib/api/production-file-api.d.ts +4 -0
  18. package/lib/api/production-file-api.js +51 -0
  19. package/lib/api/production-file-api.js.map +1 -0
  20. package/lib/api/waste-product-api.d.ts +27 -0
  21. package/lib/api/waste-product-api.js +123 -0
  22. package/lib/api/waste-product-api.js.map +1 -0
  23. package/lib/api/work-center-api.d.ts +3 -0
  24. package/lib/api/work-center-api.js +47 -0
  25. package/lib/api/work-center-api.js.map +1 -0
  26. package/lib/components/index.d.ts +2 -0
  27. package/lib/components/index.js +20 -0
  28. package/lib/components/index.js.map +1 -0
  29. package/lib/components/molecules/OperationOrderDatesCard/OperationOrderDatesCard.d.ts +7 -0
  30. package/lib/components/molecules/OperationOrderDatesCard/OperationOrderDatesCard.js +32 -0
  31. package/lib/components/molecules/OperationOrderDatesCard/OperationOrderDatesCard.js.map +1 -0
  32. package/lib/components/molecules/index.d.ts +1 -0
  33. package/lib/components/molecules/index.js +19 -0
  34. package/lib/components/molecules/index.js.map +1 -0
  35. package/lib/components/organisms/ConsumedProductCard/ConsumedProductCard.d.ts +17 -0
  36. package/lib/components/organisms/ConsumedProductCard/ConsumedProductCard.js +92 -0
  37. package/lib/components/organisms/ConsumedProductCard/ConsumedProductCard.js.map +1 -0
  38. package/lib/components/organisms/ConsumedProductGlobalCard/ConsumedProductGlobalCard.d.ts +17 -0
  39. package/lib/components/organisms/ConsumedProductGlobalCard/ConsumedProductGlobalCard.js +81 -0
  40. package/lib/components/organisms/ConsumedProductGlobalCard/ConsumedProductGlobalCard.js.map +1 -0
  41. package/lib/components/organisms/ManufacturingOrderCard/ManufacturingOrderCard.d.ts +16 -0
  42. package/lib/components/organisms/ManufacturingOrderCard/ManufacturingOrderCard.js +83 -0
  43. package/lib/components/organisms/ManufacturingOrderCard/ManufacturingOrderCard.js.map +1 -0
  44. package/lib/components/organisms/ManufacturingOrderHeader/ManufacturingOrderHeader.d.ts +8 -0
  45. package/lib/components/organisms/ManufacturingOrderHeader/ManufacturingOrderHeader.js +68 -0
  46. package/lib/components/organisms/ManufacturingOrderHeader/ManufacturingOrderHeader.js.map +1 -0
  47. package/lib/components/organisms/OperationOrderCard/OperationOrderCard.d.ts +11 -0
  48. package/lib/components/organisms/OperationOrderCard/OperationOrderCard.js +76 -0
  49. package/lib/components/organisms/OperationOrderCard/OperationOrderCard.js.map +1 -0
  50. package/lib/components/organisms/OperationOrderDetailsCard/OperationOrderDetailsCard.d.ts +17 -0
  51. package/lib/components/organisms/OperationOrderDetailsCard/OperationOrderDetailsCard.js +86 -0
  52. package/lib/components/organisms/OperationOrderDetailsCard/OperationOrderDetailsCard.js.map +1 -0
  53. package/lib/components/organisms/OperationOrderHeader/OperationOrderHeader.d.ts +8 -0
  54. package/lib/components/organisms/OperationOrderHeader/OperationOrderHeader.js +72 -0
  55. package/lib/components/organisms/OperationOrderHeader/OperationOrderHeader.js.map +1 -0
  56. package/lib/components/organisms/ProducedProductCard/ProducedProductCard.d.ts +11 -0
  57. package/lib/components/organisms/ProducedProductCard/ProducedProductCard.js +61 -0
  58. package/lib/components/organisms/ProducedProductCard/ProducedProductCard.js.map +1 -0
  59. package/lib/components/organisms/ProductionFileLargeCard/ProductionFileLargeCard.d.ts +10 -0
  60. package/lib/components/organisms/ProductionFileLargeCard/ProductionFileLargeCard.js +62 -0
  61. package/lib/components/organisms/ProductionFileLargeCard/ProductionFileLargeCard.js.map +1 -0
  62. package/lib/components/organisms/ProductionFileSmallCard/ProductionFileSmallCard.d.ts +10 -0
  63. package/lib/components/organisms/ProductionFileSmallCard/ProductionFileSmallCard.js +52 -0
  64. package/lib/components/organisms/ProductionFileSmallCard/ProductionFileSmallCard.js.map +1 -0
  65. package/lib/components/organisms/WasteProductCard/WasteProductCard.d.ts +9 -0
  66. package/lib/components/organisms/WasteProductCard/WasteProductCard.js +47 -0
  67. package/lib/components/organisms/WasteProductCard/WasteProductCard.js.map +1 -0
  68. package/lib/components/organisms/index.d.ts +11 -0
  69. package/lib/components/organisms/index.js +29 -0
  70. package/lib/components/organisms/index.js.map +1 -0
  71. package/lib/features/asyncFunctions-index.d.ts +7 -0
  72. package/lib/features/asyncFunctions-index.js +25 -0
  73. package/lib/features/asyncFunctions-index.js.map +1 -0
  74. package/lib/features/index.d.ts +7 -0
  75. package/lib/features/index.js +25 -0
  76. package/lib/features/index.js.map +1 -0
  77. package/lib/features/machinesSlice.d.ts +14 -0
  78. package/lib/features/machinesSlice.js +48 -0
  79. package/lib/features/machinesSlice.js.map +1 -0
  80. package/lib/features/manufacturingOrderSlice.d.ts +66 -0
  81. package/lib/features/manufacturingOrderSlice.js +186 -0
  82. package/lib/features/manufacturingOrderSlice.js.map +1 -0
  83. package/lib/features/operationOrderSlice.d.ts +49 -0
  84. package/lib/features/operationOrderSlice.js +124 -0
  85. package/lib/features/operationOrderSlice.js.map +1 -0
  86. package/lib/features/prodProductSlice.d.ts +46 -0
  87. package/lib/features/prodProductSlice.js +114 -0
  88. package/lib/features/prodProductSlice.js.map +1 -0
  89. package/lib/features/productionFileSlice.d.ts +16 -0
  90. package/lib/features/productionFileSlice.js +71 -0
  91. package/lib/features/productionFileSlice.js.map +1 -0
  92. package/lib/features/wasteProductsSlice.d.ts +48 -0
  93. package/lib/features/wasteProductsSlice.js +117 -0
  94. package/lib/features/wasteProductsSlice.js.map +1 -0
  95. package/lib/features/workCentersSlice.d.ts +14 -0
  96. package/lib/features/workCentersSlice.js +48 -0
  97. package/lib/features/workCentersSlice.js.map +1 -0
  98. package/lib/i18n/en.json +45 -0
  99. package/lib/i18n/fr.json +45 -0
  100. package/lib/index.d.ts +13 -0
  101. package/lib/index.js +68 -0
  102. package/lib/index.js.map +1 -0
  103. package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.d.ts +5 -0
  104. package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.js +158 -0
  105. package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.js.map +1 -0
  106. package/lib/screens/manufactoringOrder/ManufacturingOrderListProductionOrderScreen.d.ts +5 -0
  107. package/lib/screens/manufactoringOrder/ManufacturingOrderListProductionOrderScreen.js +72 -0
  108. package/lib/screens/manufactoringOrder/ManufacturingOrderListProductionOrderScreen.js.map +1 -0
  109. package/lib/screens/manufactoringOrder/ManufacturingOrderListSaleOrderScreen.d.ts +4 -0
  110. package/lib/screens/manufactoringOrder/ManufacturingOrderListSaleOrderScreen.js +60 -0
  111. package/lib/screens/manufactoringOrder/ManufacturingOrderListSaleOrderScreen.js.map +1 -0
  112. package/lib/screens/manufactoringOrder/ManufacturingOrderListScreen.d.ts +4 -0
  113. package/lib/screens/manufactoringOrder/ManufacturingOrderListScreen.js +182 -0
  114. package/lib/screens/manufactoringOrder/ManufacturingOrderListScreen.js.map +1 -0
  115. package/lib/screens/manufactoringOrder/ManufacturingOrderOperationListScreen.d.ts +5 -0
  116. package/lib/screens/manufactoringOrder/ManufacturingOrderOperationListScreen.js +150 -0
  117. package/lib/screens/manufactoringOrder/ManufacturingOrderOperationListScreen.js.map +1 -0
  118. package/lib/screens/manufactoringOrder/consumedProduct/ChildrenManufOrderListScreen.d.ts +5 -0
  119. package/lib/screens/manufactoringOrder/consumedProduct/ChildrenManufOrderListScreen.js +184 -0
  120. package/lib/screens/manufactoringOrder/consumedProduct/ChildrenManufOrderListScreen.js.map +1 -0
  121. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductDetailsScreen.d.ts +5 -0
  122. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductDetailsScreen.js +103 -0
  123. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductDetailsScreen.js.map +1 -0
  124. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductListScreen.d.ts +5 -0
  125. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductListScreen.js +160 -0
  126. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductListScreen.js.map +1 -0
  127. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectProductScreen.d.ts +5 -0
  128. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectProductScreen.js +56 -0
  129. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectProductScreen.js.map +1 -0
  130. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectTrackingScreen.d.ts +5 -0
  131. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectTrackingScreen.js +51 -0
  132. package/lib/screens/manufactoringOrder/consumedProduct/ConsumedProductSelectTrackingScreen.js.map +1 -0
  133. package/lib/screens/manufactoringOrder/consumedProduct/index.d.ts +55 -0
  134. package/lib/screens/manufactoringOrder/consumedProduct/index.js +60 -0
  135. package/lib/screens/manufactoringOrder/consumedProduct/index.js.map +1 -0
  136. package/lib/screens/manufactoringOrder/index.d.ts +171 -0
  137. package/lib/screens/manufactoringOrder/index.js +66 -0
  138. package/lib/screens/manufactoringOrder/index.js.map +1 -0
  139. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductDetailsScreen.d.ts +5 -0
  140. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductDetailsScreen.js +103 -0
  141. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductDetailsScreen.js.map +1 -0
  142. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.d.ts +5 -0
  143. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.js +141 -0
  144. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.js.map +1 -0
  145. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectProductScreen.d.ts +5 -0
  146. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectProductScreen.js +56 -0
  147. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectProductScreen.js.map +1 -0
  148. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectTrackingScreen.d.ts +5 -0
  149. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectTrackingScreen.js +74 -0
  150. package/lib/screens/manufactoringOrder/producedProduct/ProducedProductSelectTrackingScreen.js.map +1 -0
  151. package/lib/screens/manufactoringOrder/producedProduct/index.d.ts +44 -0
  152. package/lib/screens/manufactoringOrder/producedProduct/index.js +52 -0
  153. package/lib/screens/manufactoringOrder/producedProduct/index.js.map +1 -0
  154. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductDetailsScreen.d.ts +5 -0
  155. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductDetailsScreen.js +100 -0
  156. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductDetailsScreen.js.map +1 -0
  157. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductListScreen.d.ts +5 -0
  158. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductListScreen.js +103 -0
  159. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductListScreen.js.map +1 -0
  160. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductSelectProductScreen.d.ts +5 -0
  161. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductSelectProductScreen.js +48 -0
  162. package/lib/screens/manufactoringOrder/wasteProduct/WasteProductSelectProductScreen.js.map +1 -0
  163. package/lib/screens/manufactoringOrder/wasteProduct/index.d.ts +33 -0
  164. package/lib/screens/manufactoringOrder/wasteProduct/index.js +44 -0
  165. package/lib/screens/manufactoringOrder/wasteProduct/index.js.map +1 -0
  166. package/lib/screens/operationOrder/OperationOrderDetailsScreen.d.ts +5 -0
  167. package/lib/screens/operationOrder/OperationOrderDetailsScreen.js +87 -0
  168. package/lib/screens/operationOrder/OperationOrderDetailsScreen.js.map +1 -0
  169. package/lib/screens/operationOrder/OperationOrderListScreen.d.ts +4 -0
  170. package/lib/screens/operationOrder/OperationOrderListScreen.js +178 -0
  171. package/lib/screens/operationOrder/OperationOrderListScreen.js.map +1 -0
  172. package/lib/screens/operationOrder/OperationOrderPlanningScreen.d.ts +2 -0
  173. package/lib/screens/operationOrder/OperationOrderPlanningScreen.js +126 -0
  174. package/lib/screens/operationOrder/OperationOrderPlanningScreen.js.map +1 -0
  175. package/lib/screens/operationOrder/ProductionFileScreen.d.ts +5 -0
  176. package/lib/screens/operationOrder/ProductionFileScreen.js +45 -0
  177. package/lib/screens/operationOrder/ProductionFileScreen.js.map +1 -0
  178. package/lib/screens/operationOrder/index.d.ts +44 -0
  179. package/lib/screens/operationOrder/index.js +52 -0
  180. package/lib/screens/operationOrder/index.js.map +1 -0
  181. package/lib/types/index.d.ts +2 -0
  182. package/lib/types/index.js +20 -0
  183. package/lib/types/index.js.map +1 -0
  184. package/lib/types/manufacturing-order.d.ts +29 -0
  185. package/lib/types/manufacturing-order.js +117 -0
  186. package/lib/types/manufacturing-order.js.map +1 -0
  187. package/lib/types/operation-order.d.ts +25 -0
  188. package/lib/types/operation-order.js +169 -0
  189. package/lib/types/operation-order.js.map +1 -0
  190. package/lib/utils/displayers.d.ts +1 -0
  191. package/lib/utils/displayers.js +19 -0
  192. package/lib/utils/displayers.js.map +1 -0
  193. package/lib/utils/formaters.d.ts +4 -0
  194. package/lib/utils/formaters.js +23 -0
  195. package/lib/utils/formaters.js.map +1 -0
  196. package/package.json +51 -0
@@ -0,0 +1,51 @@
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
+ const productionFileFields = ['image', 'description'];
20
+ const sortByFields = ['sequence'];
21
+ const createProductionFileCriteria = prodProcessLineId => {
22
+ let criterias = [];
23
+ if (prodProcessLineId != null) {
24
+ criterias.push({
25
+ fieldName: 'prodProcessLine.id',
26
+ operator: '=',
27
+ value: prodProcessLineId,
28
+ });
29
+ }
30
+ return criterias;
31
+ };
32
+ export async function searchProductionFile({ prodProcessLineId = null, page = 0, }) {
33
+ return axiosApiProvider.post({
34
+ url: '/ws/rest/com.axelor.apps.production.db.ObjectDescription/search',
35
+ data: {
36
+ data: {
37
+ criteria: [
38
+ {
39
+ operator: 'and',
40
+ criteria: createProductionFileCriteria(prodProcessLineId),
41
+ },
42
+ ],
43
+ },
44
+ fields: productionFileFields,
45
+ sortBy: sortByFields,
46
+ limit: 10,
47
+ offset: 10 * page,
48
+ },
49
+ });
50
+ }
51
+ //# sourceMappingURL=production-file-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"production-file-api.js","sourceRoot":"","sources":["../../src/api/production-file-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAEzD,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AACtD,MAAM,YAAY,GAAG,CAAC,UAAU,CAAC,CAAC;AAElC,MAAM,4BAA4B,GAAG,iBAAiB,CAAC,EAAE;IACvD,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,IAAI,iBAAiB,IAAI,IAAI,EAAE;QAC7B,SAAS,CAAC,IAAI,CAAC;YACb,SAAS,EAAE,oBAAoB;YAC/B,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,iBAAiB;SACzB,CAAC,CAAC;KACJ;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,iBAAiB,GAAG,IAAI,EACxB,IAAI,GAAG,CAAC,GACT;IACC,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,iEAAiE;QACtE,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,QAAQ,EAAE;oBACR;wBACE,QAAQ,EAAE,KAAK;wBACf,QAAQ,EAAE,4BAA4B,CAAC,iBAAiB,CAAC;qBAC1D;iBACF;aACF;YACD,MAAM,EAAE,oBAAoB;YAC5B,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE,GAAG,IAAI;SAClB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ export function fetchManufacturingOrderWasteProducts({ manufOrderId, page, }: {
2
+ manufOrderId: any;
3
+ page: any;
4
+ }): Promise<any>;
5
+ export function createManufacturingOrderWasteProduct({ manufOrderVersion, manufOrderId, productId, qty, }: {
6
+ manufOrderVersion: any;
7
+ manufOrderId: any;
8
+ productId: any;
9
+ qty: any;
10
+ }): Promise<any>;
11
+ export function updateManufacturingOrderWasteProduct({ prodProductVersion, prodProductId, qty, }: {
12
+ prodProductVersion: any;
13
+ prodProductId: any;
14
+ qty: any;
15
+ }): Promise<any>;
16
+ export function declareManufacturingOrderWasteProduct({ manufOrderVersion, manufOrderId, }: {
17
+ manufOrderVersion: any;
18
+ manufOrderId: any;
19
+ }): Promise<{
20
+ data: {
21
+ messageStatus: string;
22
+ data: {
23
+ stockMoveCreated: boolean;
24
+ wasteStockMove: any;
25
+ }[];
26
+ };
27
+ }>;
@@ -0,0 +1,123 @@
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
+ import { fetchManufacturingOrder } from './manufacturing-order-api';
20
+ const createWasteProductCriteria = wasteProdProductList => {
21
+ let criterias = [];
22
+ if (wasteProdProductList != null && wasteProdProductList.length > 0) {
23
+ wasteProdProductList.forEach(proProduct => {
24
+ criterias.push({ fieldName: 'id', operator: '=', value: proProduct?.id });
25
+ });
26
+ }
27
+ return criterias;
28
+ };
29
+ export async function fetchManufacturingOrderWasteProducts({ manufOrderId, page, }) {
30
+ return axiosApiProvider
31
+ .get({
32
+ url: `/ws/rest/com.axelor.apps.production.db.ManufOrder/${manufOrderId}`,
33
+ })
34
+ .then(res => {
35
+ const manufOrder = res?.data?.data ? res?.data?.data[0] : null;
36
+ if (manufOrder != null &&
37
+ manufOrder.wasteProdProductList != null &&
38
+ manufOrder.wasteProdProductList.length > 0) {
39
+ return axiosApiProvider.post({
40
+ url: '/ws/rest/com.axelor.apps.production.db.ProdProduct/search',
41
+ data: {
42
+ data: {
43
+ criteria: [
44
+ {
45
+ operator: 'or',
46
+ criteria: createWasteProductCriteria(manufOrder.wasteProdProductList),
47
+ },
48
+ ],
49
+ },
50
+ fields: ['id', 'product', 'qty', 'unit'],
51
+ limit: 10,
52
+ offset: 10 * page,
53
+ },
54
+ });
55
+ }
56
+ else {
57
+ return { data: { data: [] } };
58
+ }
59
+ });
60
+ }
61
+ export async function createManufacturingOrderWasteProduct({ manufOrderVersion, manufOrderId, productId, qty, }) {
62
+ return axiosApiProvider.post({
63
+ url: `ws/aos/manuf-order/${manufOrderId}/waste-product`,
64
+ data: {
65
+ version: manufOrderVersion,
66
+ productId: productId,
67
+ qty: qty,
68
+ },
69
+ });
70
+ }
71
+ export async function updateManufacturingOrderWasteProduct({ prodProductVersion, prodProductId, qty, }) {
72
+ return axiosApiProvider.put({
73
+ url: `ws/aos/manuf-order/waste-product/${prodProductId}`,
74
+ data: {
75
+ version: prodProductVersion,
76
+ qty: qty,
77
+ },
78
+ });
79
+ }
80
+ export async function declareManufacturingOrderWasteProduct({ manufOrderVersion, manufOrderId, }) {
81
+ return axiosApiProvider
82
+ .post({
83
+ url: 'ws/action/',
84
+ data: {
85
+ action: 'com.axelor.apps.production.web.ManufOrderController:generateWasteStockMove',
86
+ data: {
87
+ context: {
88
+ _model: 'com.axelor.apps.production.db.ManufOrder',
89
+ id: manufOrderId,
90
+ version: manufOrderVersion,
91
+ },
92
+ },
93
+ model: 'com.axelor.apps.production.db.ManufOrder',
94
+ },
95
+ })
96
+ .then(result => {
97
+ if (result?.data?.status === 0) {
98
+ return fetchManufacturingOrder({ manufOrderId }).then(manufOrderResult => {
99
+ const manufOrder = manufOrderResult?.data?.data && manufOrderResult?.data?.data[0];
100
+ return {
101
+ data: {
102
+ messageStatus: `Waste products declared in stock move ${manufOrder?.wasteStockMove?.stockMoveSeq}`,
103
+ data: [
104
+ {
105
+ stockMoveCreated: true,
106
+ wasteStockMove: manufOrder?.wasteStockMove,
107
+ },
108
+ ],
109
+ },
110
+ };
111
+ });
112
+ }
113
+ else {
114
+ return {
115
+ data: {
116
+ messageStatus: 'Could not declare waste products',
117
+ data: [{ stockMoveCreated: false, wasteStockMove: null }],
118
+ },
119
+ };
120
+ }
121
+ });
122
+ }
123
+ //# sourceMappingURL=waste-product-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waste-product-api.js","sourceRoot":"","sources":["../../src/api/waste-product-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAElE,MAAM,0BAA0B,GAAG,oBAAoB,CAAC,EAAE;IACxD,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,oBAAoB,IAAI,IAAI,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE;QACnE,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACxC,SAAS,CAAC,IAAI,CAAC,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAC,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,oCAAoC,CAAC,EACzD,YAAY,EACZ,IAAI,GACL;IACC,OAAO,gBAAgB;SACpB,GAAG,CAAC;QACH,GAAG,EAAE,qDAAqD,YAAY,EAAE;KACzE,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,EAAE;QACV,MAAM,UAAU,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/D,IACE,UAAU,IAAI,IAAI;YAClB,UAAU,CAAC,oBAAoB,IAAI,IAAI;YACvC,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;SACpB,IAAI,CAAC;QACJ,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE;YACJ,MAAM,EACJ,4EAA4E;YAC9E,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,MAAM,EAAE,0CAA0C;oBAClD,EAAE,EAAE,YAAY;oBAChB,OAAO,EAAE,iBAAiB;iBAC3B;aACF;YACD,KAAK,EAAE,0CAA0C;SAClD;KACF,CAAC;SACD,IAAI,CAAC,MAAM,CAAC,EAAE;QACb,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,EAAE;YAC9B,OAAO,uBAAuB,CAAC,EAAC,YAAY,EAAC,CAAC,CAAC,IAAI,CACjD,gBAAgB,CAAC,EAAE;gBACjB,MAAM,UAAU,GACd,gBAAgB,EAAE,IAAI,EAAE,IAAI,IAAI,gBAAgB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;gBAClE,OAAO;oBACL,IAAI,EAAE;wBACJ,aAAa,EAAE,yCAAyC,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE;wBAClG,IAAI,EAAE;4BACJ;gCACE,gBAAgB,EAAE,IAAI;gCACtB,cAAc,EAAE,UAAU,EAAE,cAAc;6BAC3C;yBACF;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;SACH;aAAM;YACL,OAAO;gBACL,IAAI,EAAE;oBACJ,aAAa,EAAE,kCAAkC;oBACjD,IAAI,EAAE,CAAC,EAAC,gBAAgB,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAC,CAAC;iBACxD;aACF,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ export function searchWorkCenterFilter({ searchValue }: {
2
+ searchValue?: any;
3
+ }): Promise<any>;
@@ -0,0 +1,47 @@
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
+ const workCenterFields = ['code', 'name'];
20
+ const createWorkCenterCriteria = searchValue => {
21
+ let criterias = [];
22
+ if (searchValue != null) {
23
+ criterias.push({
24
+ fieldName: 'name',
25
+ operator: 'like',
26
+ value: searchValue,
27
+ });
28
+ }
29
+ return criterias;
30
+ };
31
+ export async function searchWorkCenterFilter({ searchValue = null }) {
32
+ return axiosApiProvider.post({
33
+ url: '/ws/rest/com.axelor.apps.production.db.WorkCenter/search',
34
+ data: {
35
+ data: {
36
+ criteria: [
37
+ {
38
+ operator: 'and',
39
+ criteria: createWorkCenterCriteria(searchValue),
40
+ },
41
+ ],
42
+ },
43
+ fields: workCenterFields,
44
+ },
45
+ });
46
+ }
47
+ //# sourceMappingURL=work-center-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-center-api.js","sourceRoot":"","sources":["../../src/api/work-center-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAEzD,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,wBAAwB,GAAG,WAAW,CAAC,EAAE;IAC7C,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,WAAW,IAAI,IAAI,EAAE;QACvB,SAAS,CAAC,IAAI,CAAC;YACb,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,WAAW;SACnB,CAAC,CAAC;KACJ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAAC,WAAW,GAAG,IAAI,EAAC;IAC/D,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,0DAA0D;QAC/D,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,QAAQ,EAAE;oBACR;wBACE,QAAQ,EAAE,KAAK;wBACf,QAAQ,EAAE,wBAAwB,CAAC,WAAW,CAAC;qBAChD;iBACF;aACF;YACD,MAAM,EAAE,gBAAgB;SACzB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./molecules";
2
+ export * from "./organisms";
@@ -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 * from './molecules';
19
+ export * from './organisms';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ interface OperationOrderDatesCardProps {
2
+ status: number;
3
+ startDate: string;
4
+ endDate: string;
5
+ }
6
+ declare function OperationOrderDatesCard({ status, startDate, endDate, }: OperationOrderDatesCardProps): JSX.Element;
7
+ export default OperationOrderDatesCard;
@@ -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 React from 'react';
19
+ import { FromTo, TitledValue } from '@axelor/aos-mobile-ui';
20
+ import { useTranslator } from '@axelor/aos-mobile-core';
21
+ import OperationOrder from '../../../types/operation-order';
22
+ function OperationOrderDatesCard({ status, startDate, endDate, }) {
23
+ const I18n = useTranslator();
24
+ return (<FromTo fromComponent={<TitledValue title={status === OperationOrder.status.Draft ||
25
+ status === OperationOrder.status.Planned
26
+ ? I18n.t('Base_Estimated')
27
+ : I18n.t('Base_Real')} value={startDate}/>} toComponent={<TitledValue title={status === OperationOrder.status.Finished
28
+ ? I18n.t('Base_Real')
29
+ : I18n.t('Base_Estimated')} value={endDate}/>}/>);
30
+ }
31
+ export default OperationOrderDatesCard;
32
+ //# sourceMappingURL=OperationOrderDatesCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationOrderDatesCard.js","sourceRoot":"","sources":["../../../../src/components/molecules/OperationOrderDatesCard/OperationOrderDatesCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAQ5D,SAAS,uBAAuB,CAAC,EAC/B,MAAM,EACN,SAAS,EACT,OAAO,GACsB;IAC7B,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,MAAM,CACL,aAAa,CAAC,CACZ,CAAC,WAAW,CACV,KAAK,CAAC,CACJ,MAAM,KAAK,cAAc,CAAC,MAAM,CAAC,KAAK;gBACtC,MAAM,KAAK,cAAc,CAAC,MAAM,CAAC,OAAO;gBACtC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC;gBAC1B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CACxB,CACD,KAAK,CAAC,CAAC,SAAS,CAAC,EACjB,CACH,CACD,WAAW,CAAC,CACV,CAAC,WAAW,CACV,KAAK,CAAC,CACJ,MAAM,KAAK,cAAc,CAAC,MAAM,CAAC,QAAQ;gBACvC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC;gBACrB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAC7B,CACD,KAAK,CAAC,CAAC,OAAO,CAAC,EACf,CACH,EACD,CACH,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as OperationOrderDatesCard } from "./OperationOrderDatesCard/OperationOrderDatesCard";
@@ -0,0 +1,19 @@
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 OperationOrderDatesCard } from './OperationOrderDatesCard/OperationOrderDatesCard';
19
+ //# 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,uBAAuB,EAAC,MAAM,mDAAmD,CAAC"}
@@ -0,0 +1,17 @@
1
+ interface ConsumedProductCardProps {
2
+ style?: any;
3
+ productName: string;
4
+ plannedQty: number;
5
+ consumedQty?: number;
6
+ missingQty?: number;
7
+ availableQty?: number;
8
+ unitName?: string;
9
+ trackingNumber?: string;
10
+ onPress: () => void;
11
+ increment: {
12
+ addedQty: number;
13
+ incrementVisible: boolean;
14
+ };
15
+ }
16
+ declare const ConsumedProductCard: ({ style, productName, plannedQty, consumedQty, missingQty, availableQty, unitName, trackingNumber, onPress, increment, }: ConsumedProductCardProps) => JSX.Element;
17
+ export default ConsumedProductCard;
@@ -0,0 +1,92 @@
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, { useMemo } from 'react';
19
+ import { StyleSheet, View, TouchableOpacity } from 'react-native';
20
+ import { Badge, Card, LabelText, Text, useThemeColor, } from '@axelor/aos-mobile-ui';
21
+ import { useTranslator } from '@axelor/aos-mobile-core';
22
+ const ConsumedProductCard = ({ style, productName, plannedQty, consumedQty, missingQty, availableQty, unitName, trackingNumber = null, onPress = () => { }, increment = { addedQty: 0, incrementVisible: false }, }) => {
23
+ const Colors = useThemeColor();
24
+ const I18n = useTranslator();
25
+ const borderStyle = useMemo(() => {
26
+ if (missingQty > 0) {
27
+ return getBorderStyles(Colors.errorColor.background)?.border;
28
+ }
29
+ else if (consumedQty == null ||
30
+ consumedQty === 0 ||
31
+ plannedQty > consumedQty) {
32
+ return getBorderStyles(Colors.plannedColor.background)?.border;
33
+ }
34
+ else {
35
+ return getBorderStyles(Colors.primaryColor.background)?.border;
36
+ }
37
+ }, [Colors, consumedQty, missingQty, plannedQty]);
38
+ return (<TouchableOpacity style={style} onPress={onPress} activeOpacity={0.9}>
39
+ <Card style={[styles.cardContainer, borderStyle]}>
40
+ <View style={styles.topContainer}>
41
+ <Text style={styles.txtImportant}>{productName}</Text>
42
+ {increment.incrementVisible && (<Badge title={`+ ${increment.addedQty}`} style={styles.badge} color={Colors.priorityColor} txtStyle={styles.badgeInfos}/>)}
43
+ </View>
44
+ <LabelText title={`${I18n.t('Manufacturing_PlannedQty')}:`} value={`${parseFloat(plannedQty.toString()).toFixed(2)} ${unitName != null ? unitName : ''}`}/>
45
+ <LabelText title={`${I18n.t('Manufacturing_ConsumedQty')}:`} value={`${consumedQty == null
46
+ ? parseFloat('0').toFixed(2)
47
+ : parseFloat(consumedQty.toString()).toFixed(2)} ${unitName != null ? unitName : ''}`}/>
48
+ {trackingNumber != null && (<LabelText iconName="qrcode" title={`${I18n.t('Manufacturing_TrackingNumber')}:`} value={trackingNumber}/>)}
49
+ <Badge color={availableQty > 0
50
+ ? missingQty > 0
51
+ ? Colors.cautionColor
52
+ : Colors.primaryColor
53
+ : Colors.errorColor} title={availableQty > 0
54
+ ? missingQty > 0
55
+ ? I18n.t('Stock_Partially')
56
+ : I18n.t('Stock_Available')
57
+ : I18n.t('Stock_Unavailable')}/>
58
+ </Card>
59
+ </TouchableOpacity>);
60
+ };
61
+ const getBorderStyles = color => StyleSheet.create({
62
+ border: { borderLeftWidth: 7, borderLeftColor: color },
63
+ });
64
+ const styles = StyleSheet.create({
65
+ cardContainer: {
66
+ flexDirection: 'column',
67
+ paddingLeft: 10,
68
+ paddingRight: 10,
69
+ margin: 2,
70
+ elevation: 0,
71
+ },
72
+ topContainer: {
73
+ flexDirection: 'row',
74
+ justifyContent: 'space-between',
75
+ alignItems: 'center',
76
+ height: 20,
77
+ },
78
+ txtImportant: {
79
+ fontSize: 18,
80
+ fontWeight: 'bold',
81
+ },
82
+ badge: {
83
+ height: 20,
84
+ width: 40,
85
+ borderRadius: 30,
86
+ },
87
+ badgeInfos: {
88
+ fontWeight: 'bold',
89
+ },
90
+ });
91
+ export default ConsumedProductCard;
92
+ //# sourceMappingURL=ConsumedProductCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsumedProductCard.js","sourceRoot":"","sources":["../../../../src/components/organisms/ConsumedProductCard/ConsumedProductCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,KAAK,EACL,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAetD,MAAM,mBAAmB,GAAG,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,cAAc,GAAG,IAAI,EACrB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,SAAS,GAAG,EAAC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AAC,YAAY;YACvB,CAAC,CAAC,MAAM,CAAC,UAAU,CACtB,CACD,KAAK,CAAC,CACJ,YAAY,GAAG,CAAC;YACd,CAAC,CAAC,UAAU,GAAG,CAAC;gBACd,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC;gBAC3B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC;YAC7B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAChC,EAEL;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,KAAK,CAAC,EAAE,CAC9B,UAAU,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,KAAK,EAAC;CACrD,CAAC,CAAC;AAEL,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,aAAa,EAAE;QACb,aAAa,EAAE,QAAQ;QACvB,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,CAAC;KACb;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,YAAY,EAAE,EAAE;KACjB;IACD,UAAU,EAAE;QACV,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,17 @@
1
+ interface ConsumedProductGlobalCardProps {
2
+ productName: string;
3
+ plannedQty: number;
4
+ consumedQty?: number;
5
+ missingQty?: number;
6
+ availableQty?: number;
7
+ unitName?: string;
8
+ trackingNumber?: string;
9
+ onPress: () => void;
10
+ onMorePress: (qty: number) => void;
11
+ disableMore: boolean;
12
+ onLocationPress: () => void;
13
+ onSubOfPress: () => void;
14
+ isSubOF: boolean;
15
+ }
16
+ declare const ConsumedProductGlobalCard: ({ productName, plannedQty, consumedQty, missingQty, availableQty, unitName, trackingNumber, onPress, onMorePress, disableMore, onLocationPress, onSubOfPress, isSubOF, }: ConsumedProductGlobalCardProps) => JSX.Element;
17
+ export default ConsumedProductGlobalCard;
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
19
+ import { StyleSheet, View } from 'react-native';
20
+ import { CardIconButton, useThemeColor } from '@axelor/aos-mobile-ui';
21
+ import ConsumedProductCard from '../ConsumedProductCard/ConsumedProductCard';
22
+ const TIME_DISPLAY_INCREMENT = 2000;
23
+ const ConsumedProductGlobalCard = ({ productName, plannedQty, consumedQty, missingQty, availableQty, unitName, trackingNumber = null, onPress, onMorePress, disableMore = false, onLocationPress, onSubOfPress, isSubOF = false, }) => {
24
+ const Colors = useThemeColor();
25
+ const [addedQty, setAddedQty] = useState(0);
26
+ const [incrementVisible, setIncrementVisible] = useState(false);
27
+ let timeOutIncrement = useRef();
28
+ const handleIncrement = () => {
29
+ setIncrementVisible(true);
30
+ setAddedQty(addedQty + 1);
31
+ };
32
+ const handleTimeOut = useCallback(() => {
33
+ if (addedQty > 0) {
34
+ onMorePress(addedQty);
35
+ setIncrementVisible(false);
36
+ setAddedQty(0);
37
+ }
38
+ }, [addedQty, onMorePress]);
39
+ useEffect(() => {
40
+ if (incrementVisible && addedQty > 0) {
41
+ const id = setTimeout(handleTimeOut, TIME_DISPLAY_INCREMENT);
42
+ timeOutIncrement.current = id;
43
+ return () => {
44
+ clearTimeout(timeOutIncrement.current);
45
+ };
46
+ }
47
+ }, [handleTimeOut, incrementVisible, addedQty]);
48
+ return (<View style={styles.globalContainer}>
49
+ <ConsumedProductCard style={styles.consumedCard} productName={productName} plannedQty={plannedQty} consumedQty={consumedQty} missingQty={missingQty} availableQty={availableQty} unitName={unitName} trackingNumber={trackingNumber} onPress={onPress} increment={{ addedQty, incrementVisible }}/>
50
+ <View style={styles.middleContainer}>
51
+ <CardIconButton style={styles.cardIconButton} iconName="map-marker-alt" iconColor={Colors.secondaryColor.background} onPress={onLocationPress}/>
52
+ {isSubOF ? (<CardIconButton style={styles.cardIconButton} iconName="sitemap" iconColor={Colors.secondaryColor.background} onPress={onSubOfPress}/>) : null}
53
+ </View>
54
+ {!disableMore && (<View style={styles.middleContainer}>
55
+ <CardIconButton style={styles.cardIconButton} iconName="plus" iconColor={Colors.primaryColor.background} onPress={handleIncrement}/>
56
+ </View>)}
57
+ </View>);
58
+ };
59
+ const styles = StyleSheet.create({
60
+ globalContainer: {
61
+ display: 'flex',
62
+ flex: 1,
63
+ width: '92%',
64
+ flexDirection: 'row',
65
+ justifyContent: 'space-evenly',
66
+ alignItems: 'center',
67
+ marginHorizontal: 14,
68
+ marginVertical: 2,
69
+ },
70
+ middleContainer: {
71
+ flex: 1,
72
+ },
73
+ consumedCard: {
74
+ flex: 5,
75
+ },
76
+ cardIconButton: {
77
+ flex: 1,
78
+ },
79
+ });
80
+ export default ConsumedProductGlobalCard;
81
+ //# sourceMappingURL=ConsumedProductGlobalCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsumedProductGlobalCard.js","sourceRoot":"","sources":["../../../../src/components/organisms/ConsumedProductGlobalCard/ConsumedProductGlobalCard.tsx"],"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,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpE,OAAO,mBAAmB,MAAM,4CAA4C,CAAC;AAkB7E,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAM,yBAAyB,GAAG,CAAC,EACjC,WAAW,EACX,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,cAAc,GAAG,IAAI,EACrB,OAAO,EACP,WAAW,EACX,WAAW,GAAG,KAAK,EACnB,eAAe,EACf,YAAY,EACZ,OAAO,GAAG,KAAK,GACgB,EAAE,EAAE;IACnC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,IAAI,gBAAgB,GAAG,MAAM,EAAU,CAAC;IAExC,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC1B,WAAW,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,IAAI,QAAQ,GAAG,CAAC,EAAE;YAChB,WAAW,CAAC,QAAQ,CAAC,CAAC;YACtB,m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;
3
+ reference: string;
4
+ status: number;
5
+ priority: number;
6
+ productName: string;
7
+ qty: number;
8
+ unit?: any;
9
+ link?: {
10
+ ordersRef: any[];
11
+ client: any;
12
+ };
13
+ onPress: () => void;
14
+ }
15
+ declare const ManufacturingOrderCard: ({ style, reference, status, priority, productName, qty, unit, link, onPress, }: ManufacturingOrderCardProps) => JSX.Element;
16
+ export default ManufacturingOrderCard;