@axelor/aos-mobile-stock 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 (373) hide show
  1. package/README.md +44 -0
  2. package/lib/api/customer-delivery-api.d.ts +16 -0
  3. package/lib/api/customer-delivery-api.js +122 -0
  4. package/lib/api/customer-delivery-api.js.map +1 -0
  5. package/lib/api/customer-delivery-line-api.d.ts +9 -0
  6. package/lib/api/customer-delivery-line-api.js +65 -0
  7. package/lib/api/customer-delivery-line-api.js.map +1 -0
  8. package/lib/api/index.d.ts +18 -0
  9. package/lib/api/index.js +36 -0
  10. package/lib/api/index.js.map +1 -0
  11. package/lib/api/internal-move-api.d.ts +20 -0
  12. package/lib/api/internal-move-api.js +112 -0
  13. package/lib/api/internal-move-api.js.map +1 -0
  14. package/lib/api/internal-move-line-api.d.ts +4 -0
  15. package/lib/api/internal-move-line-api.js +53 -0
  16. package/lib/api/internal-move-line-api.js.map +1 -0
  17. package/lib/api/inventory-api.d.ts +18 -0
  18. package/lib/api/inventory-api.js +121 -0
  19. package/lib/api/inventory-api.js.map +1 -0
  20. package/lib/api/inventory-line-api.d.ts +18 -0
  21. package/lib/api/inventory-line-api.js +76 -0
  22. package/lib/api/inventory-line-api.js.map +1 -0
  23. package/lib/api/partner-api.d.ts +8 -0
  24. package/lib/api/partner-api.js +155 -0
  25. package/lib/api/partner-api.js.map +1 -0
  26. package/lib/api/product-api.d.ts +26 -0
  27. package/lib/api/product-api.js +189 -0
  28. package/lib/api/product-api.js.map +1 -0
  29. package/lib/api/stock-correction-api.d.ts +17 -0
  30. package/lib/api/stock-correction-api.js +73 -0
  31. package/lib/api/stock-correction-api.js.map +1 -0
  32. package/lib/api/stock-correction-reason-api.d.ts +1 -0
  33. package/lib/api/stock-correction-reason-api.js +24 -0
  34. package/lib/api/stock-correction-reason-api.js.map +1 -0
  35. package/lib/api/stock-location-api.d.ts +7 -0
  36. package/lib/api/stock-location-api.js +121 -0
  37. package/lib/api/stock-location-api.js.map +1 -0
  38. package/lib/api/stock-location-line-api.d.ts +6 -0
  39. package/lib/api/stock-location-line-api.js +114 -0
  40. package/lib/api/stock-location-line-api.js.map +1 -0
  41. package/lib/api/supplier-arrival-api.d.ts +17 -0
  42. package/lib/api/supplier-arrival-api.js +121 -0
  43. package/lib/api/supplier-arrival-api.js.map +1 -0
  44. package/lib/api/supplier-arrival-line-api.d.ts +10 -0
  45. package/lib/api/supplier-arrival-line-api.js +67 -0
  46. package/lib/api/supplier-arrival-line-api.js.map +1 -0
  47. package/lib/api/supplier-catalog-api.d.ts +4 -0
  48. package/lib/api/supplier-catalog-api.js +49 -0
  49. package/lib/api/supplier-catalog-api.js.map +1 -0
  50. package/lib/api/supplychain-config-api.d.ts +1 -0
  51. package/lib/api/supplychain-config-api.js +24 -0
  52. package/lib/api/supplychain-config-api.js.map +1 -0
  53. package/lib/api/tracking-number-api.d.ts +16 -0
  54. package/lib/api/tracking-number-api.js +107 -0
  55. package/lib/api/tracking-number-api.js.map +1 -0
  56. package/lib/api/unit-api.d.ts +1 -0
  57. package/lib/api/unit-api.js +22 -0
  58. package/lib/api/unit-api.js.map +1 -0
  59. package/lib/components/index.d.ts +2 -0
  60. package/lib/components/index.js +20 -0
  61. package/lib/components/index.js.map +1 -0
  62. package/lib/components/molecules/CarrierCard/CarrierCard.d.ts +6 -0
  63. package/lib/components/molecules/CarrierCard/CarrierCard.js +46 -0
  64. package/lib/components/molecules/CarrierCard/CarrierCard.js.map +1 -0
  65. package/lib/components/molecules/LocationsMoveCard/LocationsMoveCard.d.ts +14 -0
  66. package/lib/components/molecules/LocationsMoveCard/LocationsMoveCard.js +82 -0
  67. package/lib/components/molecules/LocationsMoveCard/LocationsMoveCard.js.map +1 -0
  68. package/lib/components/molecules/ProductCardDetails/ProductCardDetails.d.ts +7 -0
  69. package/lib/components/molecules/ProductCardDetails/ProductCardDetails.js +42 -0
  70. package/lib/components/molecules/ProductCardDetails/ProductCardDetails.js.map +1 -0
  71. package/lib/components/molecules/StockCorrectionCard/StockCorrectionCard.d.ts +10 -0
  72. package/lib/components/molecules/StockCorrectionCard/StockCorrectionCard.js +75 -0
  73. package/lib/components/molecules/StockCorrectionCard/StockCorrectionCard.js.map +1 -0
  74. package/lib/components/molecules/index.d.ts +4 -0
  75. package/lib/components/molecules/index.js +22 -0
  76. package/lib/components/molecules/index.js.map +1 -0
  77. package/lib/components/organisms/CardStockIndicator/CardStockIndicator.d.ts +6 -0
  78. package/lib/components/organisms/CardStockIndicator/CardStockIndicator.js +72 -0
  79. package/lib/components/organisms/CardStockIndicator/CardStockIndicator.js.map +1 -0
  80. package/lib/components/organisms/CustomerDeliveryCard/CustomerDeliveryCard.d.ts +12 -0
  81. package/lib/components/organisms/CustomerDeliveryCard/CustomerDeliveryCard.js +94 -0
  82. package/lib/components/organisms/CustomerDeliveryCard/CustomerDeliveryCard.js.map +1 -0
  83. package/lib/components/organisms/CustomerDeliveryLineCard/CustomerDeliveryLineCard.d.ts +14 -0
  84. package/lib/components/organisms/CustomerDeliveryLineCard/CustomerDeliveryLineCard.js +81 -0
  85. package/lib/components/organisms/CustomerDeliveryLineCard/CustomerDeliveryLineCard.js.map +1 -0
  86. package/lib/components/organisms/DescriptionCard/DescriptionCard.d.ts +7 -0
  87. package/lib/components/organisms/DescriptionCard/DescriptionCard.js +42 -0
  88. package/lib/components/organisms/DescriptionCard/DescriptionCard.js.map +1 -0
  89. package/lib/components/organisms/InternalMoveCard/InternalMoveCard.d.ts +13 -0
  90. package/lib/components/organisms/InternalMoveCard/InternalMoveCard.js +94 -0
  91. package/lib/components/organisms/InternalMoveCard/InternalMoveCard.js.map +1 -0
  92. package/lib/components/organisms/InternalMoveLineCard/InternalMoveLineCard.d.ts +13 -0
  93. package/lib/components/organisms/InternalMoveLineCard/InternalMoveLineCard.js +101 -0
  94. package/lib/components/organisms/InternalMoveLineCard/InternalMoveLineCard.js.map +1 -0
  95. package/lib/components/organisms/InventoryCard/InventoryCard.d.ts +10 -0
  96. package/lib/components/organisms/InventoryCard/InventoryCard.js +88 -0
  97. package/lib/components/organisms/InventoryCard/InventoryCard.js.map +1 -0
  98. package/lib/components/organisms/InventoryHeader/InventoryHeader.d.ts +8 -0
  99. package/lib/components/organisms/InventoryHeader/InventoryHeader.js +77 -0
  100. package/lib/components/organisms/InventoryHeader/InventoryHeader.js.map +1 -0
  101. package/lib/components/organisms/InventoryLineCard/InventoryLineCard.d.ts +14 -0
  102. package/lib/components/organisms/InventoryLineCard/InventoryLineCard.js +72 -0
  103. package/lib/components/organisms/InventoryLineCard/InventoryLineCard.js.map +1 -0
  104. package/lib/components/organisms/ProductCard/ProductCard.d.ts +10 -0
  105. package/lib/components/organisms/ProductCard/ProductCard.js +77 -0
  106. package/lib/components/organisms/ProductCard/ProductCard.js.map +1 -0
  107. package/lib/components/organisms/ProductCardInfo/ProductCardInfo.d.ts +10 -0
  108. package/lib/components/organisms/ProductCardInfo/ProductCardInfo.js +74 -0
  109. package/lib/components/organisms/ProductCardInfo/ProductCardInfo.js.map +1 -0
  110. package/lib/components/organisms/ProductCharacteristics/ProductCharacteristics.d.ts +13 -0
  111. package/lib/components/organisms/ProductCharacteristics/ProductCharacteristics.js +79 -0
  112. package/lib/components/organisms/ProductCharacteristics/ProductCharacteristics.js.map +1 -0
  113. package/lib/components/organisms/ProductStockLocationCard/ProductStockLocationCard.d.ts +10 -0
  114. package/lib/components/organisms/ProductStockLocationCard/ProductStockLocationCard.js +89 -0
  115. package/lib/components/organisms/ProductStockLocationCard/ProductStockLocationCard.js.map +1 -0
  116. package/lib/components/organisms/ProductVariantCard/ProductVariantCard.d.ts +19 -0
  117. package/lib/components/organisms/ProductVariantCard/ProductVariantCard.js +128 -0
  118. package/lib/components/organisms/ProductVariantCard/ProductVariantCard.js.map +1 -0
  119. package/lib/components/organisms/QuantityCard/QuantityCard.d.ts +12 -0
  120. package/lib/components/organisms/QuantityCard/QuantityCard.js +98 -0
  121. package/lib/components/organisms/QuantityCard/QuantityCard.js.map +1 -0
  122. package/lib/components/organisms/SmallPropertyCard/SmallPropertyCard.d.ts +9 -0
  123. package/lib/components/organisms/SmallPropertyCard/SmallPropertyCard.js +63 -0
  124. package/lib/components/organisms/SmallPropertyCard/SmallPropertyCard.js.map +1 -0
  125. package/lib/components/organisms/StockMoveHeader/StockMoveHeader.d.ts +9 -0
  126. package/lib/components/organisms/StockMoveHeader/StockMoveHeader.js +71 -0
  127. package/lib/components/organisms/StockMoveHeader/StockMoveHeader.js.map +1 -0
  128. package/lib/components/organisms/SupplierArrivalCard/SupplierArrivalCard.d.ts +11 -0
  129. package/lib/components/organisms/SupplierArrivalCard/SupplierArrivalCard.js +93 -0
  130. package/lib/components/organisms/SupplierArrivalCard/SupplierArrivalCard.js.map +1 -0
  131. package/lib/components/organisms/SupplierArrivalLineCard/SupplierArrivalLineCard.d.ts +13 -0
  132. package/lib/components/organisms/SupplierArrivalLineCard/SupplierArrivalLineCard.js +78 -0
  133. package/lib/components/organisms/SupplierArrivalLineCard/SupplierArrivalLineCard.js.map +1 -0
  134. package/lib/components/organisms/index.d.ts +19 -0
  135. package/lib/components/organisms/index.js +37 -0
  136. package/lib/components/organisms/index.js.map +1 -0
  137. package/lib/features/asyncFunctions-index.d.ts +21 -0
  138. package/lib/features/asyncFunctions-index.js +39 -0
  139. package/lib/features/asyncFunctions-index.js.map +1 -0
  140. package/lib/features/customerDeliveryLineSlice.d.ts +27 -0
  141. package/lib/features/customerDeliveryLineSlice.js +88 -0
  142. package/lib/features/customerDeliveryLineSlice.js.map +1 -0
  143. package/lib/features/customerDeliverySlice.d.ts +38 -0
  144. package/lib/features/customerDeliverySlice.js +102 -0
  145. package/lib/features/customerDeliverySlice.js.map +1 -0
  146. package/lib/features/index.d.ts +21 -0
  147. package/lib/features/index.js +39 -0
  148. package/lib/features/index.js.map +1 -0
  149. package/lib/features/internalMoveLineSlice.d.ts +16 -0
  150. package/lib/features/internalMoveLineSlice.js +71 -0
  151. package/lib/features/internalMoveLineSlice.js.map +1 -0
  152. package/lib/features/internalMoveSlice.d.ts +38 -0
  153. package/lib/features/internalMoveSlice.js +105 -0
  154. package/lib/features/internalMoveSlice.js.map +1 -0
  155. package/lib/features/inventoryLineSlice.d.ts +38 -0
  156. package/lib/features/inventoryLineSlice.js +105 -0
  157. package/lib/features/inventoryLineSlice.js.map +1 -0
  158. package/lib/features/inventorySlice.d.ts +47 -0
  159. package/lib/features/inventorySlice.js +129 -0
  160. package/lib/features/inventorySlice.js.map +1 -0
  161. package/lib/features/partnerSlice.d.ts +25 -0
  162. package/lib/features/partnerSlice.js +65 -0
  163. package/lib/features/partnerSlice.js.map +1 -0
  164. package/lib/features/productIndicatorsSlice.d.ts +37 -0
  165. package/lib/features/productIndicatorsSlice.js +101 -0
  166. package/lib/features/productIndicatorsSlice.js.map +1 -0
  167. package/lib/features/productSlice.d.ts +39 -0
  168. package/lib/features/productSlice.js +105 -0
  169. package/lib/features/productSlice.js.map +1 -0
  170. package/lib/features/productVariantSlice.d.ts +27 -0
  171. package/lib/features/productVariantSlice.js +98 -0
  172. package/lib/features/productVariantSlice.js.map +1 -0
  173. package/lib/features/racksListSlice.d.ts +14 -0
  174. package/lib/features/racksListSlice.js +63 -0
  175. package/lib/features/racksListSlice.js.map +1 -0
  176. package/lib/features/stockAppConfigSlice.d.ts +14 -0
  177. package/lib/features/stockAppConfigSlice.js +49 -0
  178. package/lib/features/stockAppConfigSlice.js.map +1 -0
  179. package/lib/features/stockCorrectionReasonSlice.d.ts +14 -0
  180. package/lib/features/stockCorrectionReasonSlice.js +48 -0
  181. package/lib/features/stockCorrectionReasonSlice.js.map +1 -0
  182. package/lib/features/stockCorrectionSlice.d.ts +38 -0
  183. package/lib/features/stockCorrectionSlice.js +105 -0
  184. package/lib/features/stockCorrectionSlice.js.map +1 -0
  185. package/lib/features/stockLocationLineSlice.d.ts +16 -0
  186. package/lib/features/stockLocationLineSlice.js +71 -0
  187. package/lib/features/stockLocationLineSlice.js.map +1 -0
  188. package/lib/features/stockLocationSlice.d.ts +25 -0
  189. package/lib/features/stockLocationSlice.js +65 -0
  190. package/lib/features/stockLocationSlice.js.map +1 -0
  191. package/lib/features/supplierArrivalLineSlice.d.ts +27 -0
  192. package/lib/features/supplierArrivalLineSlice.js +88 -0
  193. package/lib/features/supplierArrivalLineSlice.js.map +1 -0
  194. package/lib/features/supplierArrivalSlice.d.ts +38 -0
  195. package/lib/features/supplierArrivalSlice.js +105 -0
  196. package/lib/features/supplierArrivalSlice.js.map +1 -0
  197. package/lib/features/supplierCatalogSlice.d.ts +14 -0
  198. package/lib/features/supplierCatalogSlice.js +48 -0
  199. package/lib/features/supplierCatalogSlice.js.map +1 -0
  200. package/lib/features/trackingNumberSlice.d.ts +35 -0
  201. package/lib/features/trackingNumberSlice.js +96 -0
  202. package/lib/features/trackingNumberSlice.js.map +1 -0
  203. package/lib/features/unitSlice.d.ts +14 -0
  204. package/lib/features/unitSlice.js +48 -0
  205. package/lib/features/unitSlice.js.map +1 -0
  206. package/lib/i18n/en.json +103 -0
  207. package/lib/i18n/fr.json +103 -0
  208. package/lib/index.d.ts +14 -0
  209. package/lib/index.js +97 -0
  210. package/lib/index.js.map +1 -0
  211. package/lib/screens/auth/UserScreen.d.ts +4 -0
  212. package/lib/screens/auth/UserScreen.js +54 -0
  213. package/lib/screens/auth/UserScreen.js.map +1 -0
  214. package/lib/screens/customerDeliveries/CustomerDeliveryDetailScreen.d.ts +5 -0
  215. package/lib/screens/customerDeliveries/CustomerDeliveryDetailScreen.js +149 -0
  216. package/lib/screens/customerDeliveries/CustomerDeliveryDetailScreen.js.map +1 -0
  217. package/lib/screens/customerDeliveries/CustomerDeliveryLineDetailScreen.d.ts +5 -0
  218. package/lib/screens/customerDeliveries/CustomerDeliveryLineDetailScreen.js +140 -0
  219. package/lib/screens/customerDeliveries/CustomerDeliveryLineDetailScreen.js.map +1 -0
  220. package/lib/screens/customerDeliveries/CustomerDeliveryLineListScreen.d.ts +5 -0
  221. package/lib/screens/customerDeliveries/CustomerDeliveryLineListScreen.js +116 -0
  222. package/lib/screens/customerDeliveries/CustomerDeliveryLineListScreen.js.map +1 -0
  223. package/lib/screens/customerDeliveries/CustomerDeliveryListScreen.d.ts +4 -0
  224. package/lib/screens/customerDeliveries/CustomerDeliveryListScreen.js +130 -0
  225. package/lib/screens/customerDeliveries/CustomerDeliveryListScreen.js.map +1 -0
  226. package/lib/screens/customerDeliveries/CustomerDeliverySelectProductScreen.d.ts +5 -0
  227. package/lib/screens/customerDeliveries/CustomerDeliverySelectProductScreen.js +76 -0
  228. package/lib/screens/customerDeliveries/CustomerDeliverySelectProductScreen.js.map +1 -0
  229. package/lib/screens/customerDeliveries/CustomerDeliverySelectTrackingScreen.d.ts +5 -0
  230. package/lib/screens/customerDeliveries/CustomerDeliverySelectTrackingScreen.js +79 -0
  231. package/lib/screens/customerDeliveries/CustomerDeliverySelectTrackingScreen.js.map +1 -0
  232. package/lib/screens/customerDeliveries/index.d.ts +66 -0
  233. package/lib/screens/customerDeliveries/index.js +68 -0
  234. package/lib/screens/customerDeliveries/index.js.map +1 -0
  235. package/lib/screens/internalMoves/InternalMoveDetailsGeneralScreen.d.ts +5 -0
  236. package/lib/screens/internalMoves/InternalMoveDetailsGeneralScreen.js +102 -0
  237. package/lib/screens/internalMoves/InternalMoveDetailsGeneralScreen.js.map +1 -0
  238. package/lib/screens/internalMoves/InternalMoveLineDetailsScreen.d.ts +5 -0
  239. package/lib/screens/internalMoves/InternalMoveLineDetailsScreen.js +296 -0
  240. package/lib/screens/internalMoves/InternalMoveLineDetailsScreen.js.map +1 -0
  241. package/lib/screens/internalMoves/InternalMoveLineListScreen.d.ts +5 -0
  242. package/lib/screens/internalMoves/InternalMoveLineListScreen.js +107 -0
  243. package/lib/screens/internalMoves/InternalMoveLineListScreen.js.map +1 -0
  244. package/lib/screens/internalMoves/InternalMoveListScreen.d.ts +4 -0
  245. package/lib/screens/internalMoves/InternalMoveListScreen.js +162 -0
  246. package/lib/screens/internalMoves/InternalMoveListScreen.js.map +1 -0
  247. package/lib/screens/internalMoves/InternalMoveSelectFromLocationScreen.d.ts +5 -0
  248. package/lib/screens/internalMoves/InternalMoveSelectFromLocationScreen.js +48 -0
  249. package/lib/screens/internalMoves/InternalMoveSelectFromLocationScreen.js.map +1 -0
  250. package/lib/screens/internalMoves/InternalMoveSelectProductScreen.d.ts +5 -0
  251. package/lib/screens/internalMoves/InternalMoveSelectProductScreen.js +98 -0
  252. package/lib/screens/internalMoves/InternalMoveSelectProductScreen.js.map +1 -0
  253. package/lib/screens/internalMoves/InternalMoveSelectToLocationScreen.d.ts +5 -0
  254. package/lib/screens/internalMoves/InternalMoveSelectToLocationScreen.js +53 -0
  255. package/lib/screens/internalMoves/InternalMoveSelectToLocationScreen.js.map +1 -0
  256. package/lib/screens/internalMoves/InternalMoveSelectTrackingScreen.d.ts +5 -0
  257. package/lib/screens/internalMoves/InternalMoveSelectTrackingScreen.js +101 -0
  258. package/lib/screens/internalMoves/InternalMoveSelectTrackingScreen.js.map +1 -0
  259. package/lib/screens/internalMoves/index.d.ts +78 -0
  260. package/lib/screens/internalMoves/index.js +78 -0
  261. package/lib/screens/internalMoves/index.js.map +1 -0
  262. package/lib/screens/inventories/InventoryLineDetailsScreen.d.ts +5 -0
  263. package/lib/screens/inventories/InventoryLineDetailsScreen.js +98 -0
  264. package/lib/screens/inventories/InventoryLineDetailsScreen.js.map +1 -0
  265. package/lib/screens/inventories/InventoryLineListScreen.d.ts +5 -0
  266. package/lib/screens/inventories/InventoryLineListScreen.js +122 -0
  267. package/lib/screens/inventories/InventoryLineListScreen.js.map +1 -0
  268. package/lib/screens/inventories/InventoryListScreen.d.ts +4 -0
  269. package/lib/screens/inventories/InventoryListScreen.js +148 -0
  270. package/lib/screens/inventories/InventoryListScreen.js.map +1 -0
  271. package/lib/screens/inventories/InventoryPlannedDetailsScreen.d.ts +5 -0
  272. package/lib/screens/inventories/InventoryPlannedDetailsScreen.js +81 -0
  273. package/lib/screens/inventories/InventoryPlannedDetailsScreen.js.map +1 -0
  274. package/lib/screens/inventories/InventorySelectProductScreen.d.ts +5 -0
  275. package/lib/screens/inventories/InventorySelectProductScreen.js +83 -0
  276. package/lib/screens/inventories/InventorySelectProductScreen.js.map +1 -0
  277. package/lib/screens/inventories/InventorySelectTrackingScreen.d.ts +5 -0
  278. package/lib/screens/inventories/InventorySelectTrackingScreen.js +81 -0
  279. package/lib/screens/inventories/InventorySelectTrackingScreen.js.map +1 -0
  280. package/lib/screens/inventories/InventoryStartedDetailsScreen.d.ts +5 -0
  281. package/lib/screens/inventories/InventoryStartedDetailsScreen.js +110 -0
  282. package/lib/screens/inventories/InventoryStartedDetailsScreen.js.map +1 -0
  283. package/lib/screens/inventories/index.d.ts +77 -0
  284. package/lib/screens/inventories/index.js +76 -0
  285. package/lib/screens/inventories/index.js.map +1 -0
  286. package/lib/screens/products/ProductDetailsScreen.d.ts +5 -0
  287. package/lib/screens/products/ProductDetailsScreen.js +135 -0
  288. package/lib/screens/products/ProductDetailsScreen.js.map +1 -0
  289. package/lib/screens/products/ProductImageScreen.d.ts +4 -0
  290. package/lib/screens/products/ProductImageScreen.js +62 -0
  291. package/lib/screens/products/ProductImageScreen.js.map +1 -0
  292. package/lib/screens/products/ProductListScreen.d.ts +4 -0
  293. package/lib/screens/products/ProductListScreen.js +72 -0
  294. package/lib/screens/products/ProductListScreen.js.map +1 -0
  295. package/lib/screens/products/ProductListVariantScreen.d.ts +5 -0
  296. package/lib/screens/products/ProductListVariantScreen.js +66 -0
  297. package/lib/screens/products/ProductListVariantScreen.js.map +1 -0
  298. package/lib/screens/products/ProductStockDetailsScreen.d.ts +5 -0
  299. package/lib/screens/products/ProductStockDetailsScreen.js +201 -0
  300. package/lib/screens/products/ProductStockDetailsScreen.js.map +1 -0
  301. package/lib/screens/products/ProductStockLocationDetailsScreen.d.ts +4 -0
  302. package/lib/screens/products/ProductStockLocationDetailsScreen.js +110 -0
  303. package/lib/screens/products/ProductStockLocationDetailsScreen.js.map +1 -0
  304. package/lib/screens/products/index.d.ts +46 -0
  305. package/lib/screens/products/index.js +56 -0
  306. package/lib/screens/products/index.js.map +1 -0
  307. package/lib/screens/stockCorrections/StockCorrectionDetailsScreen.d.ts +5 -0
  308. package/lib/screens/stockCorrections/StockCorrectionDetailsScreen.js +271 -0
  309. package/lib/screens/stockCorrections/StockCorrectionDetailsScreen.js.map +1 -0
  310. package/lib/screens/stockCorrections/StockCorrectionListScreen.d.ts +4 -0
  311. package/lib/screens/stockCorrections/StockCorrectionListScreen.js +140 -0
  312. package/lib/screens/stockCorrections/StockCorrectionListScreen.js.map +1 -0
  313. package/lib/screens/stockCorrections/StockCorrectionNewLocationScreen.d.ts +5 -0
  314. package/lib/screens/stockCorrections/StockCorrectionNewLocationScreen.js +48 -0
  315. package/lib/screens/stockCorrections/StockCorrectionNewLocationScreen.js.map +1 -0
  316. package/lib/screens/stockCorrections/StockCorrectionNewProductScreen.d.ts +5 -0
  317. package/lib/screens/stockCorrections/StockCorrectionNewProductScreen.js +55 -0
  318. package/lib/screens/stockCorrections/StockCorrectionNewProductScreen.js.map +1 -0
  319. package/lib/screens/stockCorrections/StockCorrectionNewTrackingScreen.d.ts +5 -0
  320. package/lib/screens/stockCorrections/StockCorrectionNewTrackingScreen.js +54 -0
  321. package/lib/screens/stockCorrections/StockCorrectionNewTrackingScreen.js.map +1 -0
  322. package/lib/screens/stockCorrections/index.d.ts +40 -0
  323. package/lib/screens/stockCorrections/index.js +51 -0
  324. package/lib/screens/stockCorrections/index.js.map +1 -0
  325. package/lib/screens/supplierArrivals/SupplierArrivalAddTrackingScreen.d.ts +5 -0
  326. package/lib/screens/supplierArrivals/SupplierArrivalAddTrackingScreen.js +87 -0
  327. package/lib/screens/supplierArrivals/SupplierArrivalAddTrackingScreen.js.map +1 -0
  328. package/lib/screens/supplierArrivals/SupplierArrivalDetailsScreen.d.ts +5 -0
  329. package/lib/screens/supplierArrivals/SupplierArrivalDetailsScreen.js +120 -0
  330. package/lib/screens/supplierArrivals/SupplierArrivalDetailsScreen.js.map +1 -0
  331. package/lib/screens/supplierArrivals/SupplierArrivalLineDetailScreen.d.ts +5 -0
  332. package/lib/screens/supplierArrivals/SupplierArrivalLineDetailScreen.js +167 -0
  333. package/lib/screens/supplierArrivals/SupplierArrivalLineDetailScreen.js.map +1 -0
  334. package/lib/screens/supplierArrivals/SupplierArrivalLineListScreen.d.ts +5 -0
  335. package/lib/screens/supplierArrivals/SupplierArrivalLineListScreen.js +107 -0
  336. package/lib/screens/supplierArrivals/SupplierArrivalLineListScreen.js.map +1 -0
  337. package/lib/screens/supplierArrivals/SupplierArrivalListScreen.d.ts +4 -0
  338. package/lib/screens/supplierArrivals/SupplierArrivalListScreen.js +126 -0
  339. package/lib/screens/supplierArrivals/SupplierArrivalListScreen.js.map +1 -0
  340. package/lib/screens/supplierArrivals/SupplierArrivalSelectProductScreen.d.ts +5 -0
  341. package/lib/screens/supplierArrivals/SupplierArrivalSelectProductScreen.js +79 -0
  342. package/lib/screens/supplierArrivals/SupplierArrivalSelectProductScreen.js.map +1 -0
  343. package/lib/screens/supplierArrivals/SupplierArrivalSelectTrackingScreen.d.ts +5 -0
  344. package/lib/screens/supplierArrivals/SupplierArrivalSelectTrackingScreen.js +106 -0
  345. package/lib/screens/supplierArrivals/SupplierArrivalSelectTrackingScreen.js.map +1 -0
  346. package/lib/screens/supplierArrivals/index.d.ts +77 -0
  347. package/lib/screens/supplierArrivals/index.js +76 -0
  348. package/lib/screens/supplierArrivals/index.js.map +1 -0
  349. package/lib/types/index.d.ts +5 -0
  350. package/lib/types/index.js +23 -0
  351. package/lib/types/index.js.map +1 -0
  352. package/lib/types/inventory.d.ts +16 -0
  353. package/lib/types/inventory.js +88 -0
  354. package/lib/types/inventory.js.map +1 -0
  355. package/lib/types/product.d.ts +16 -0
  356. package/lib/types/product.js +62 -0
  357. package/lib/types/product.js.map +1 -0
  358. package/lib/types/stock-corrrection.d.ts +11 -0
  359. package/lib/types/stock-corrrection.js +47 -0
  360. package/lib/types/stock-corrrection.js.map +1 -0
  361. package/lib/types/stock-location.d.ts +8 -0
  362. package/lib/types/stock-location.js +26 -0
  363. package/lib/types/stock-location.js.map +1 -0
  364. package/lib/types/stock-move.d.ts +36 -0
  365. package/lib/types/stock-move.js +124 -0
  366. package/lib/types/stock-move.js.map +1 -0
  367. package/lib/utils/displayers.d.ts +4 -0
  368. package/lib/utils/displayers.js +22 -0
  369. package/lib/utils/displayers.js.map +1 -0
  370. package/lib/utils/filters.d.ts +6 -0
  371. package/lib/utils/filters.js +77 -0
  372. package/lib/utils/filters.js.map +1 -0
  373. package/package.json +48 -0
@@ -0,0 +1,271 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useEffect, useState } from 'react';
19
+ import { View, StyleSheet, ActivityIndicator } from 'react-native';
20
+ import { Badge, Button, HeaderContainer, Picker, PopUpOneButton, Screen, ScrollView, Text, useThemeColor, } from '@axelor/aos-mobile-ui';
21
+ import { getFromList, useDispatch, useSelector, useTranslator, HeaderOptionsMenu, } from '@axelor/aos-mobile-core';
22
+ import { QuantityCard, ProductCardInfo } from '../../components';
23
+ import { fetchStockCorrectionReasons } from '../../features/stockCorrectionReasonSlice';
24
+ import { fetchProductWithId } from '../../features/productSlice';
25
+ import { createCorrection, updateCorrection, } from '../../features/stockCorrectionSlice';
26
+ import { fetchProductIndicators } from '../../features/productIndicatorsSlice';
27
+ import StockCorrection from '../../types/stock-corrrection';
28
+ const StockCorrectionDetailsScreen = ({ navigation, route }) => {
29
+ const Colors = useThemeColor();
30
+ const I18n = useTranslator();
31
+ const { stockCorrectionReasonList } = useSelector(state => state.stockCorrectionReason);
32
+ const { loadingProduct, productFromId } = useSelector(state => state.product);
33
+ const { activeCompany } = useSelector(state => state.user.user);
34
+ const { productIndicators } = useSelector(state => state.productIndicators);
35
+ const { mobileSettings } = useSelector(state => state.config);
36
+ const dispatch = useDispatch();
37
+ useEffect(() => {
38
+ dispatch(fetchStockCorrectionReasons());
39
+ if (route.params.stockCorrection != null) {
40
+ dispatch(fetchProductWithId(route.params.stockCorrection.product.id));
41
+ }
42
+ dispatch(fetchProductIndicators({
43
+ version: route.params.stockCorrection != null
44
+ ? route.params.stockCorrection.product.$version
45
+ : route.params.stockProduct.version,
46
+ productId: route.params.stockCorrection != null
47
+ ? route.params.stockCorrection.product.id
48
+ : route.params.stockProduct.id,
49
+ companyId: activeCompany?.id,
50
+ stockLocationId: route.params.stockCorrection != null
51
+ ? route.params.stockCorrection.stockLocation.id
52
+ : route.params.stockLocation.id,
53
+ }));
54
+ }, [dispatch, activeCompany?.id, route.params]);
55
+ const [loading, setLoading] = useState(true); // Indicator for initialisation of variables
56
+ const [saveStatus, setSaveStatus] = useState(); // Inidicator for changes
57
+ const [status, setStatus] = useState();
58
+ const [stockLocation, setStockLocation] = useState();
59
+ const [stockProduct, setStockProduct] = useState();
60
+ const [trackingNumber, setTrackingNumber] = useState();
61
+ const [databaseQty, setDatabaseQty] = useState();
62
+ const [realQty, setRealQty] = useState();
63
+ const [reason, setReason] = useState();
64
+ const initVariables = useCallback(() => {
65
+ if (route.params.stockCorrection == null) {
66
+ setStatus(StockCorrection.status.Draft);
67
+ setStockLocation(route.params.stockLocation);
68
+ setStockProduct(route.params.stockProduct);
69
+ setTrackingNumber(route.params.trackingNumber == null
70
+ ? null
71
+ : route.params.trackingNumber);
72
+ if (productIndicators.id !== route.params.stockProduct.id) {
73
+ setLoading(true);
74
+ return;
75
+ }
76
+ else {
77
+ setDatabaseQty(productIndicators?.realQty);
78
+ setRealQty(productIndicators?.realQty);
79
+ }
80
+ setReason({ name: '', id: null });
81
+ setSaveStatus(false);
82
+ }
83
+ else {
84
+ const stockCorrection = route.params.stockCorrection;
85
+ setStatus(stockCorrection.statusSelect);
86
+ setStockLocation(stockCorrection.stockLocation);
87
+ setStockProduct(productFromId);
88
+ setTrackingNumber(stockCorrection.trackingNumber);
89
+ if (stockCorrection.statusSelect === StockCorrection.status.Validated) {
90
+ setDatabaseQty(stockCorrection.baseQty);
91
+ }
92
+ else {
93
+ setDatabaseQty(productIndicators?.realQty);
94
+ }
95
+ setRealQty(stockCorrection.realQty);
96
+ setReason(stockCorrection.stockCorrectionReason);
97
+ setSaveStatus(true);
98
+ }
99
+ setLoading(false);
100
+ }, [productFromId, productIndicators, route.params]);
101
+ useEffect(() => {
102
+ initVariables();
103
+ }, [initVariables]);
104
+ const handleShowProduct = () => {
105
+ navigation.navigate('ProductStockDetailsScreen', {
106
+ product: stockProduct,
107
+ });
108
+ };
109
+ const handleQtyChange = value => {
110
+ setRealQty(value);
111
+ setSaveStatus(false);
112
+ };
113
+ const handleReasonChange = reasonId => {
114
+ if (reasonId === null) {
115
+ setReason({ name: '', id: null });
116
+ }
117
+ else {
118
+ setReason(getFromList(stockCorrectionReasonList, 'id', reasonId));
119
+ }
120
+ setSaveStatus(false);
121
+ };
122
+ const handleSave = () => {
123
+ if (reason.id === null) {
124
+ // Required field
125
+ setPopUp(true);
126
+ return;
127
+ }
128
+ // Request AOS API
129
+ if (route.params.stockCorrection == null) {
130
+ // Stock correction doesn't exsist yet : creation
131
+ if (stockProduct?.trackingNumberConfiguration == null ||
132
+ trackingNumber == null) {
133
+ dispatch(createCorrection({
134
+ productId: stockProduct.id,
135
+ stockLocationId: stockLocation.id,
136
+ reasonId: reason.id,
137
+ status: StockCorrection.status.Draft,
138
+ realQty: realQty,
139
+ }));
140
+ }
141
+ else {
142
+ dispatch(createCorrection({
143
+ productId: stockProduct.id,
144
+ stockLocationId: stockLocation.id,
145
+ reasonId: reason.id,
146
+ trackingNumberId: trackingNumber.id,
147
+ status: StockCorrection.status.Draft,
148
+ realQty: realQty,
149
+ }));
150
+ }
151
+ }
152
+ else {
153
+ // Stock correction already exists : update qty or reason
154
+ dispatch(updateCorrection({
155
+ version: route.params.stockCorrection.version,
156
+ stockCorrectionId: route.params.stockCorrection.id,
157
+ realQty: realQty,
158
+ reasonId: reason.id,
159
+ }));
160
+ }
161
+ handleNavigation();
162
+ };
163
+ const handleValidate = () => {
164
+ if (reason.id === null) {
165
+ // Required field
166
+ setPopUp(true);
167
+ return;
168
+ }
169
+ // Request AOS API
170
+ if (route.params.stockCorrection == null) {
171
+ // Stock correction doesn't exsist yet : creation
172
+ if (stockProduct?.trackingNumberConfiguration == null ||
173
+ trackingNumber == null) {
174
+ dispatch(createCorrection({
175
+ productId: stockProduct.id,
176
+ stockLocationId: stockLocation.id,
177
+ reasonId: reason.id,
178
+ status: StockCorrection.status.Validated,
179
+ realQty: realQty,
180
+ }));
181
+ }
182
+ else {
183
+ dispatch(createCorrection({
184
+ productId: stockProduct.id,
185
+ stockLocationId: stockLocation.id,
186
+ reasonId: reason.id,
187
+ trackingNumberId: trackingNumber.id,
188
+ status: StockCorrection.status.Validated,
189
+ realQty: realQty,
190
+ }));
191
+ }
192
+ }
193
+ else {
194
+ // Stock correction already exists : update qty or reason
195
+ dispatch(updateCorrection({
196
+ version: route.params.stockCorrection.version,
197
+ stockCorrectionId: route.params.stockCorrection.id,
198
+ realQty: saveStatus ? null : realQty,
199
+ reasonId: saveStatus ? null : reason.id,
200
+ status: StockCorrection.status.Validated,
201
+ }));
202
+ }
203
+ handleNavigation();
204
+ };
205
+ const handleNavigation = () => {
206
+ if (route.params.externeNavigation === true) {
207
+ navigation.pop();
208
+ }
209
+ else {
210
+ navigation.popToTop();
211
+ }
212
+ };
213
+ const [popUp, setPopUp] = useState(false);
214
+ React.useLayoutEffect(() => {
215
+ navigation.setOptions({
216
+ headerRight: () => (<HeaderOptionsMenu model="com.axelor.apps.stock.db.StockCorrection" modelId={route.params.stockCorrection?.id} navigation={navigation} disableMailMessages={!mobileSettings?.isTrackerMessageOnStockApp}/>),
217
+ });
218
+ }, [I18n, mobileSettings, navigation, route.params.stockCorrection]);
219
+ return (<Screen removeSpaceOnTop={true} fixedItems={<>
220
+ {saveStatus ? null : (<Button title={I18n.t('Base_Save')} color={Colors.secondaryColor} onPress={handleSave}/>)}
221
+ {status === StockCorrection.status.Validated ? null : (<Button title={I18n.t('Base_Validate')} onPress={handleValidate}/>)}
222
+ </>} loading={loadingProduct}>
223
+ <HeaderContainer expandableFilter={false} fixedItems={<View style={styles.content}>
224
+ <View style={styles.textContainer}>
225
+ <Text style={styles.text_important}>{stockLocation?.name}</Text>
226
+ </View>
227
+ {status && (<Badge color={StockCorrection.getStatusColor(status, Colors)} title={StockCorrection.getStatus(status, I18n)}/>)}
228
+ </View>}/>
229
+ {loading ? (<ActivityIndicator size="large"/>) : (<ScrollView>
230
+ <PopUpOneButton visible={popUp} title={I18n.t('Auth_Warning')} data={I18n.t('Stock_ReasonRequired')} btnTitle={I18n.t('Auth_Close')} onPress={() => setPopUp(!popUp)}/>
231
+ <View>
232
+ <ProductCardInfo name={stockProduct?.name} code={stockProduct?.code} picture={stockProduct?.picture} trackingNumber={stockProduct?.trackingNumberConfiguration == null ||
233
+ trackingNumber == null
234
+ ? null
235
+ : trackingNumber.trackingNumberSeq} locker={null} onPress={handleShowProduct}/>
236
+ </View>
237
+ <QuantityCard labelQty={I18n.t('Stock_RealQty')} defaultValue={parseFloat(realQty).toFixed(2)} onValueChange={handleQtyChange} editable={status === StockCorrection.status.Draft}>
238
+ <Text style={styles.text}>
239
+ {`${I18n.t('Stock_DatabaseQty')}: ${parseFloat(databaseQty).toFixed(2)} ${stockProduct?.unit?.name}`}
240
+ </Text>
241
+ </QuantityCard>
242
+ <Picker styleTxt={reason?.id === null ? styles.picker_empty : null} title={I18n.t('Stock_Reason')} onValueChange={handleReasonChange} defaultValue={reason?.id} listItems={stockCorrectionReasonList} labelField="name" valueField="id" disabled={status === StockCorrection.status.Validated} disabledValue={reason?.name}/>
243
+ </ScrollView>)}
244
+ </Screen>);
245
+ };
246
+ const styles = StyleSheet.create({
247
+ content: {
248
+ marginHorizontal: 32,
249
+ marginBottom: '3%',
250
+ flexDirection: 'row',
251
+ justifyContent: 'center',
252
+ alignItems: 'center',
253
+ },
254
+ textContainer: {
255
+ flex: 2,
256
+ flexDirection: 'column',
257
+ justifyContent: 'space-between',
258
+ },
259
+ text_important: {
260
+ fontSize: 16,
261
+ fontWeight: 'bold',
262
+ },
263
+ picker_empty: {
264
+ color: 'red',
265
+ },
266
+ text: {
267
+ fontSize: 16,
268
+ },
269
+ });
270
+ export default StockCorrectionDetailsScreen;
271
+ //# sourceMappingURL=StockCorrectionDetailsScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StockCorrectionDetailsScreen.js","sourceRoot":"","sources":["../../../src/screens/stockCorrections/StockCorrectionDetailsScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAC,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,KAAK,EACL,MAAM,EACN,eAAe,EACf,MAAM,EACN,cAAc,EACd,MAAM,EACN,UAAU,EACV,IAAI,EACJ,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,YAAY,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,2BAA2B,EAAC,MAAM,2CAA2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AC,kBAAkB,CAAC,CAClC,YAAY,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACzB,SAAS,CAAC,CAAC,yBAAyB,CAAC,CACrC,UAAU,CAAC,MAAM,CACjB,UAAU,CAAC,IAAI,CACf,QAAQ,CAAC,CAAC,MAAM,KAAK,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CACtD,aAAa,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,EAEhC;QAAA,EAAE,UAAU,CAAC,CACd,CACH;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,gBAAgB,EAAE,EAAE;QACpB,YAAY,EAAE,IAAI;QAClB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,CAAC;QACP,aAAa,EAAE,QAAQ;QACvB,cAAc,EAAE,eAAe;KAChC;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;KACb;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC;AAEH,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export default StockCorrectionListScreen;
2
+ declare function StockCorrectionListScreen({ navigation }: {
3
+ navigation: any;
4
+ }): JSX.Element;
@@ -0,0 +1,140 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useEffect, useState } from 'react';
19
+ import { StyleSheet } from 'react-native';
20
+ import { Chip, ChipSelect, Icon, HeaderContainer, Screen, ScrollList, useThemeColor, } from '@axelor/aos-mobile-ui';
21
+ import { displayItemName, filterList, ScannerAutocompleteSearch, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
22
+ import { StockCorrectionCard } from '../../components';
23
+ import { fetchStockCorrections } from '../../features/stockCorrectionSlice';
24
+ import { searchProducts } from '../../features/productSlice';
25
+ import { searchStockLocations } from '../../features/stockLocationSlice';
26
+ import StockCorrection from '../../types/stock-corrrection';
27
+ const stockLocationScanKey = 'stock-location_stock-correction-list';
28
+ const productScanKey = 'product_stock-correction-list';
29
+ const StockCorrectionListScreen = ({ navigation }) => {
30
+ const Colors = useThemeColor();
31
+ const I18n = useTranslator();
32
+ const { loadingStockCorrection, moreLoading, isListEnd, stockCorrectionList } = useSelector(state => state.stockCorrection);
33
+ const { stockLocationList } = useSelector(state => state.stockLocation);
34
+ const { productList } = useSelector(state => state.product);
35
+ const { user } = useSelector(state => state.user);
36
+ const [stockLocation, setStockLocation] = useState(null);
37
+ const [product, setProduct] = useState(null);
38
+ const [draftStatus, setDraftStatus] = useState(false);
39
+ const [validatedStatus, setValidatedStatus] = useState(false);
40
+ const [filteredList, setFilteredList] = useState(stockCorrectionList);
41
+ const dispatch = useDispatch();
42
+ const handleDraftFilter = () => {
43
+ if (!draftStatus && validatedStatus) {
44
+ setValidatedStatus(!validatedStatus);
45
+ }
46
+ setDraftStatus(!draftStatus);
47
+ };
48
+ const handleValidatedFilter = () => {
49
+ if (!validatedStatus && draftStatus) {
50
+ setDraftStatus(!draftStatus);
51
+ }
52
+ setValidatedStatus(!validatedStatus);
53
+ };
54
+ const filterOnStatus = useCallback(list => {
55
+ if (list == null || list === []) {
56
+ return list;
57
+ }
58
+ else {
59
+ if (draftStatus) {
60
+ const draftStockCorrectionList = [];
61
+ list.forEach(item => {
62
+ if (item.statusSelect === 1) {
63
+ draftStockCorrectionList.push(item);
64
+ }
65
+ });
66
+ return draftStockCorrectionList;
67
+ }
68
+ else if (validatedStatus) {
69
+ const validatedStockCorrectionList = [];
70
+ list.forEach(item => {
71
+ if (item.statusSelect === 2) {
72
+ validatedStockCorrectionList.push(item);
73
+ }
74
+ });
75
+ return validatedStockCorrectionList;
76
+ }
77
+ else {
78
+ return list;
79
+ }
80
+ }
81
+ }, [draftStatus, validatedStatus]);
82
+ useEffect(() => {
83
+ setFilteredList(filterOnStatus(filterList(filterList(stockCorrectionList, 'stockLocation', 'id', stockLocation?.id ?? ''), 'product', 'id', product?.id ?? '')));
84
+ }, [
85
+ draftStatus,
86
+ validatedStatus,
87
+ stockCorrectionList,
88
+ stockLocation,
89
+ product,
90
+ filterOnStatus,
91
+ ]);
92
+ const showStockCorrectionDetails = stockCorrection => {
93
+ navigation.navigate('StockCorrectionDetailsScreen', {
94
+ stockCorrection: stockCorrection,
95
+ });
96
+ };
97
+ React.useLayoutEffect(() => {
98
+ navigation.setOptions({
99
+ headerRight: () => (<Icon name="plus" color={Colors.primaryColor.background} size={24} style={styles.action} touchable={true} onPress={() => {
100
+ navigation.navigate('StockCorrectionNewLocationScreen', {});
101
+ }}/>),
102
+ });
103
+ }, [navigation, Colors]);
104
+ const fetchStockCorrectionsAPI = useCallback(page => {
105
+ dispatch(fetchStockCorrections({ page: page }));
106
+ }, [dispatch]);
107
+ const fetchProductsAPI = useCallback(filter => {
108
+ dispatch(searchProducts({ searchValue: filter }));
109
+ }, [dispatch]);
110
+ const fetchStockLocationsAPI = useCallback(filterValue => {
111
+ dispatch(searchStockLocations({
112
+ searchValue: filterValue,
113
+ companyId: user.activeCompany?.id,
114
+ defaultStockLocation: user.workshopStockLocation,
115
+ }));
116
+ }, [dispatch, user]);
117
+ return (<Screen removeSpaceOnTop={true}>
118
+ <HeaderContainer chipComponent={<ChipSelect>
119
+ <Chip selected={draftStatus} title={I18n.t('Stock_Status_Draft')} onPress={handleDraftFilter} selectedColor={StockCorrection.getStatusColor(StockCorrection.status.Draft, Colors)}/>
120
+ <Chip selected={validatedStatus} title={I18n.t('Stock_Status_Validated')} onPress={handleValidatedFilter} selectedColor={StockCorrection.getStatusColor(StockCorrection.status.Validated, Colors)}/>
121
+ </ChipSelect>}>
122
+ <ScannerAutocompleteSearch objectList={stockLocationList} value={stockLocation} onChangeValue={item => setStockLocation(item)} fetchData={fetchStockLocationsAPI} displayValue={displayItemName} scanKeySearch={stockLocationScanKey} placeholder={I18n.t('Stock_StockLocation')} searchBarKey={1}/>
123
+ <ScannerAutocompleteSearch objectList={productList} value={product} onChangeValue={item => setProduct(item)} fetchData={fetchProductsAPI} displayValue={displayItemName} scanKeySearch={productScanKey} placeholder={I18n.t('Stock_Product')} searchBarKey={2}/>
124
+ </HeaderContainer>
125
+ <ScrollList loadingList={loadingStockCorrection} data={filteredList} renderItem={({ item }) => (<StockCorrectionCard style={styles.item} status={item.statusSelect} productFullname={item.product.fullName} stockLocation={item.stockLocation.name} date={item.statusSelect === StockCorrection.status.Draft
126
+ ? item.createdOn
127
+ : item.validationDateT} onPress={() => showStockCorrectionDetails(item)}/>)} fetchData={fetchStockCorrectionsAPI} moreLoading={moreLoading} isListEnd={isListEnd}/>
128
+ </Screen>);
129
+ };
130
+ const styles = StyleSheet.create({
131
+ item: {
132
+ marginHorizontal: 12,
133
+ marginVertical: 4,
134
+ },
135
+ action: {
136
+ marginRight: 15,
137
+ },
138
+ });
139
+ export default StockCorrectionListScreen;
140
+ //# sourceMappingURL=StockCorrectionListScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StockCorrectionListScreen.js","sourceRoot":"","sources":["../../../src/screens/stockCorrections/StockCorrectionListScreen.js"],"names":[],"mappings":"AAAA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,CACjB;MAAA,CAAC,UAAU,CACT,WAAW,CAAC,CAAC,sBAAsB,CAAC,CACpC,IAAI,CAAC,CAAC,YAAY,CAAC,CACnB,UAAU,CAAC,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,CAAC,CACtB,CAAC,mBAAmB,CAClB,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CACnB,MAAM,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAC1B,eAAe,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CACvC,aAAa,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CACvC,IAAI,CAAC,CACH,IAAI,CAAC,YAAY,KAAK,eAAe,CAAC,MAAM,CAAC,KAAK;gBAChD,CAAC,CAAC,IAAI,CAAC,SAAS;gBAChB,CAAC,CAAC,IAAI,CAAC,eAAe,CACzB,CACD,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,EAChD,CACH,CAAC,CACF,SAAS,CAAC,CAAC,wBAAwB,CAAC,CACpC,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,SAAS,CAAC,CAAC,SAAS,CAAC,EAEzB;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,CAAC;KAClB;IACD,MAAM,EAAE;QACN,WAAW,EAAE,EAAE;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export default StockCorrectionNewLocationScreen;
2
+ declare function StockCorrectionNewLocationScreen({ navigation, route }: {
3
+ navigation: any;
4
+ route: any;
5
+ }): JSX.Element;
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback } from 'react';
19
+ import { Screen } from '@axelor/aos-mobile-ui';
20
+ import { displayItemName, ScannerAutocompleteSearch, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
21
+ import { searchStockLocations } from '../../features/stockLocationSlice';
22
+ const stockLocationScanKey = 'stock-location_stock-correction-new';
23
+ const StockCorrectionNewLocationScreen = ({ navigation, route }) => {
24
+ const { stockLocationList } = useSelector(state => state.stockLocation);
25
+ const { user } = useSelector(state => state.user);
26
+ const I18n = useTranslator();
27
+ const dispatch = useDispatch();
28
+ const fetchStockLocationsAPI = useCallback(filterValue => {
29
+ dispatch(searchStockLocations({
30
+ searchValue: filterValue,
31
+ companyId: user.activeCompany?.id,
32
+ defaultStockLocation: user.workshopStockLocation,
33
+ }));
34
+ }, [dispatch, user]);
35
+ const handleNavigate = useCallback(location => {
36
+ if (location == null) {
37
+ return;
38
+ }
39
+ navigation.navigate('StockCorrectionNewProductScreen', {
40
+ stockLocation: location,
41
+ });
42
+ }, [navigation]);
43
+ return (<Screen>
44
+ <ScannerAutocompleteSearch objectList={stockLocationList} onChangeValue={item => handleNavigate(item)} fetchData={fetchStockLocationsAPI} displayValue={displayItemName} scanKeySearch={stockLocationScanKey} placeholder={I18n.t('Stock_StockLocation')} isFocus={true} changeScreenAfter={true}/>
45
+ </Screen>);
46
+ };
47
+ export default StockCorrectionNewLocationScreen;
48
+ //# sourceMappingURL=StockCorrectionNewLocationScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StockCorrectionNewLocationScreen.js","sourceRoot":"","sources":["../../../src/screens/stockCorrections/StockCorrectionNewLocationScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AAEvE,MAAM,oBAAoB,GAAG,qCAAqC,CAAC;AAEnE,MAAM,gCAAgC,GAAG,CAAC,EAAC,UAAU,EAAE,KAAK,EAAC,EAAE,EAAE;IAC/D,MAAM,EAAC,iBAAiB,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACtE,MAAM,EAAC,IAAI,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,sBAAsB,GAAG,WAAW,CACxC,WAAW,CAAC,EAAE;QACZ,QAAQ,CACN,oBAAoB,CAAC;YACnB,WAAW,EAAE,WAAW;YACxB,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE;YACjC,oBAAoB,EAAE,IAAI,CAAC,qBAAqB;SACjD,CAAC,CACH,CAAC;IACJ,CAAC,EACD,CAAC,QAAQ,EAAE,IAAI,CAAC,CACjB,CAAC;IAEF,MAAM,cAAc,GAAG,WAAW,CAChC,QAAQ,CAAC,EAAE;QACT,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO;SACR;QACD,UAAU,CAAC,QAAQ,CAAC,iCAAiC,EAAE;YACrD,aAAa,EAAE,QAAQ;SACxB,CAAC,CAAC;IACL,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CACL;MAAA,CAAC,yBAAyB,CACxB,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAC9B,aAAa,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAC5C,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAClC,YAAY,CAAC,CAAC,eAAe,CAAC,CAC9B,aAAa,CAAC,CAAC,oBAAoB,CAAC,CACpC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAC3C,OAAO,CAAC,CAAC,IAAI,CAAC,CACd,iBAAiB,CAAC,CAAC,IAAI,CAAC,EAE5B;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gCAAgC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export default StockCorrectionNewProductScreen;
2
+ declare function StockCorrectionNewProductScreen({ navigation, route }: {
3
+ navigation: any;
4
+ route: any;
5
+ }): JSX.Element;
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback } from 'react';
19
+ import { ClearableCard, Screen } from '@axelor/aos-mobile-ui';
20
+ import { displayItemName, ScannerAutocompleteSearch, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
21
+ import { searchProducts } from '../../features/productSlice';
22
+ const productScanKey = 'product_stock-correction-new';
23
+ const StockCorrectionNewProductScreen = ({ navigation, route }) => {
24
+ const { productList } = useSelector(state => state.product);
25
+ const I18n = useTranslator();
26
+ const dispatch = useDispatch();
27
+ const fetchProductsAPI = useCallback(filter => {
28
+ dispatch(searchProducts({ searchValue: filter }));
29
+ }, [dispatch]);
30
+ const handleNavigate = useCallback(product => {
31
+ if (product != null) {
32
+ if (product.trackingNumberConfiguration == null) {
33
+ navigation.navigate('StockCorrectionDetailsScreen', {
34
+ stockLocation: route.params.stockLocation,
35
+ stockProduct: product,
36
+ });
37
+ }
38
+ else {
39
+ navigation.navigate('StockCorrectionNewTrackingScreen', {
40
+ stockLocation: route.params.stockLocation,
41
+ product: product,
42
+ });
43
+ }
44
+ }
45
+ }, [navigation, route.params.stockLocation]);
46
+ const handleClearLocation = () => {
47
+ navigation.navigate('StockCorrectionNewLocationScreen');
48
+ };
49
+ return (<Screen>
50
+ <ClearableCard valueTxt={route.params.stockLocation.name} onClearPress={handleClearLocation}/>
51
+ <ScannerAutocompleteSearch objectList={productList} onChangeValue={item => handleNavigate(item)} fetchData={fetchProductsAPI} displayValue={displayItemName} scanKeySearch={productScanKey} placeholder={I18n.t('Stock_Product')} isFocus={true} changeScreenAfter={true}/>
52
+ </Screen>);
53
+ };
54
+ export default StockCorrectionNewProductScreen;
55
+ //# sourceMappingURL=StockCorrectionNewProductScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StockCorrectionNewProductScreen.js","sourceRoot":"","sources":["../../../src/screens/stockCorrections/StockCorrectionNewProductScreen.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AACzC,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mBAAmB,GAAG,GAAG,EAAE;QAC/B,UAAU,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,MAAM,CACL;MAAA,CAAC,aAAa,CACZ,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAC1C,YAAY,CAAC,CAAC,mBAAmB,CAAC,EAEpC;MAAA,CAAC,yBAAyB,CACxB,UAAU,CAAC,CAAC,WAAW,CAAC,CACxB,aAAa,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAC5C,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAC5B,YAAY,CAAC,CAAC,eAAe,CAAC,CAC9B,aAAa,CAAC,CAAC,cAAc,CAAC,CAC9B,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CACrC,OAAO,CAAC,CAAC,IAAI,CAAC,CACd,iBAAiB,CAAC,CAAC,IAAI,CAAC,EAE5B;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export default StockCorrectionNewTrackingScreen;
2
+ declare function StockCorrectionNewTrackingScreen({ navigation, route }: {
3
+ navigation: any;
4
+ route: any;
5
+ }): JSX.Element;
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback } from 'react';
19
+ import { ClearableCard, Screen } from '@axelor/aos-mobile-ui';
20
+ import { ScannerAutocompleteSearch, useDispatch, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
21
+ import { filterTrackingNumber } from '../../features/trackingNumberSlice';
22
+ import { displayItemTrackingNumber } from '../../utils/displayers';
23
+ const trackingNumberScanKey = 'tracking-number_stock-correction-new';
24
+ const StockCorrectionNewTrackingScreen = ({ navigation, route }) => {
25
+ const { trackingNumberList } = useSelector(state => state.trackingNumber);
26
+ const product = route.params.product;
27
+ const I18n = useTranslator();
28
+ const dispatch = useDispatch();
29
+ const fetchTrackingAPI = useCallback(filter => {
30
+ dispatch(filterTrackingNumber({ productId: product.id, searchValue: filter }));
31
+ }, [dispatch, product.id]);
32
+ const handleTrackingNumberSelection = useCallback(trackingNumber => {
33
+ navigation.navigate('StockCorrectionDetailsScreen', {
34
+ stockLocation: route.params.stockLocation,
35
+ stockProduct: route.params.product,
36
+ trackingNumber: trackingNumber,
37
+ });
38
+ }, [navigation, route.params.product, route.params.stockLocation]);
39
+ const handleClearLocation = () => {
40
+ navigation.navigate('StockCorrectionNewLocationScreen');
41
+ };
42
+ const handleClearProduct = () => {
43
+ navigation.navigate('StockCorrectionNewProductScreen', {
44
+ stockLocation: route.params.stockLocation,
45
+ });
46
+ };
47
+ return (<Screen>
48
+ <ClearableCard valueTxt={route.params.stockLocation.name} onClearPress={handleClearLocation}/>
49
+ <ClearableCard valueTxt={route.params.product.name} onClearPress={handleClearProduct}/>
50
+ <ScannerAutocompleteSearch objectList={trackingNumberList} onChangeValue={item => handleTrackingNumberSelection(item)} fetchData={fetchTrackingAPI} displayValue={displayItemTrackingNumber} scanKeySearch={trackingNumberScanKey} placeholder={I18n.t('Stock_TrackingNumber')} isFocus={true} changeScreenAfter={true}/>
51
+ </Screen>);
52
+ };
53
+ export default StockCorrectionNewTrackingScreen;
54
+ //# sourceMappingURL=StockCorrectionNewTrackingScreen.js.map