@feedmepos/mf-inventory-portal 1.7.13-dev.4 → 1.7.13-dev.6

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 (270) hide show
  1. package/dist/{App-Cfp4CqzQ.js → App-JqoqVVdP.js} +354 -348
  2. package/dist/{ApprovalView-DO91AQ5f.js → ApprovalView-JiWbXkVU.js} +9 -9
  3. package/dist/{BindingsDialog-DUj0z6N7.js → BindingsDialog-BK4xofWu.js} +2 -2
  4. package/dist/{BindingsPicker-CD2J6-_Z.js → BindingsPicker-CLMsAseG.js} +2 -2
  5. package/dist/{BindingsTable-B2FEKZXU.js → BindingsTable-DKrBQTxN.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-ejHyukEp.js → BulkReceiveRequestView-bttHw2ub.js} +19 -19
  7. package/dist/{ClosingDraftView-tIvrsfYH.js → ClosingDraftView-Bhdwo-n8.js} +19 -19
  8. package/dist/ClosingHistoryView-DrQPWnr6.js +761 -0
  9. package/dist/{ClosingTemplateView-C-hL9uPv.js → ClosingTemplateView-UkwXCrz_.js} +16 -16
  10. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BffF8S_q.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DNtMdFVF.js} +1 -1
  11. package/dist/{DefaultView-BLbtx0Ho.js → DefaultView-sGrYeUGh.js} +2 -2
  12. package/dist/{DeliveryOrderPrintPreview-BLQHL7aB.js → DeliveryOrderPrintPreview-CVnqC9Jy.js} +10 -10
  13. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BnTAuutB.js → EmailDialog.vue_vue_type_script_setup_true_lang-CYtHQ2Ru.js} +2250 -2250
  14. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Mxhn0b6c.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DXTdvT0C.js} +1 -1
  15. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-hrk0cTBX.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DtfiRgsD.js} +2 -2
  16. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yBIbCJYy.js +243 -0
  17. package/dist/{FmMultiselectDialog-Bpi5rI0h.js → FmMultiselectDialog-A9VIMLGn.js} +1 -1
  18. package/dist/{FmMultiselectDialog-Bi6XlAAU.js → FmMultiselectDialog-DL00XnUc.js} +2 -2
  19. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-e55tnl4u.js → FmUnitInput.vue_vue_type_script_setup_true_lang-RJKOB-cm.js} +66 -63
  20. package/dist/{ImportView-xPTzBekx.js → ImportView-DPrLnJO8.js} +6 -6
  21. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-tvmS42s_.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-IAQyFPmi.js} +1 -1
  22. package/dist/{IngredientGroupView-RFcqjF8T.js → IngredientGroupView-DyhC6lJ8.js} +5 -5
  23. package/dist/{IngredientsView-CvWOgquN.js → IngredientsView-P4AqPikD.js} +15 -15
  24. package/dist/{IntegrationExplorerView-CYNhsJSS.js → IntegrationExplorerView-CujhjHHV.js} +4 -4
  25. package/dist/{IntegrationView-ZtLokbu3.js → IntegrationView-CFqsZyzI.js} +3074 -2999
  26. package/dist/{InventoryBindingForm-DwiAIf5v.js → InventoryBindingForm-B0NJ8H51.js} +1 -1
  27. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-njDaQe10.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-bbIpFo_4.js} +5 -5
  28. package/dist/{InventoryBindingSummary-zim_Bp5_.js → InventoryBindingSummary-CBgO_tCz.js} +1 -1
  29. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CfTgt5xW.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DuuXzyKH.js} +1 -1
  30. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-LLtd1VvM.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C418f34P.js} +1 -1
  31. package/dist/ProductionRunDetailView-tSByC3nQ.js +5165 -0
  32. package/dist/ProductionRunPreparePrintView-zPAATL-n.js +31 -0
  33. package/dist/ProductionRunTabs.vue_vue_type_script_setup_true_lang-DgtZJgrs.js +3506 -0
  34. package/dist/ProductionRunView-BsP02jgC.js +815 -0
  35. package/dist/{PublishView-DFXOi7Hx.js → PublishView-Cf0Tn7xt.js} +3 -3
  36. package/dist/{PurchaseOrderPrintPreview-CG6kBQ26.js → PurchaseOrderPrintPreview-BTlSyQqZ.js} +6 -6
  37. package/dist/{ReceiveRequestView-DKMVMo7M.js → ReceiveRequestView-9LFOl2hJ.js} +14 -14
  38. package/dist/{RecipeView-cLLKlLmE.js → RecipeView-C4KxMCpQ.js} +17 -17
  39. package/dist/{SettingsView-Cmf2ZOUL.js → SettingsView-ShrefnTM.js} +4 -4
  40. package/dist/{StockView-DTai8l8U.js → StockView-BVd6f7Fr.js} +21 -21
  41. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BlKm7GLw.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B-rB7p9o.js} +1 -1
  42. package/dist/{SupplierView-CRAHOOLm.js → SupplierView-DZSY6_eU.js} +12 -12
  43. package/dist/{SurchargeView-3XymEvcr.js → SurchargeView-UUYoT8MK.js} +6 -6
  44. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DcXfQr_8.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BLMxzi1C.js} +2 -2
  45. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-qhJVHahS.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-z3qIVKP7.js} +1 -1
  46. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CibsrZXw.js → TransferDetails.vue_vue_type_script_setup_true_lang-DEO8CP-X.js} +20 -20
  47. package/dist/{TransferTemplateView-ByhvK4Ua.js → TransferTemplateView-C21o2V_1.js} +20 -20
  48. package/dist/{UnitCostHistoryView-DHHWNJYA.js → UnitCostHistoryView-DPEGVLBP.js} +4 -4
  49. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-bQu2KOI7.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BuGmmHBk.js} +4 -4
  50. package/dist/{UnitView-BZTS-Ahu.js → UnitView-Bx03E4uc.js} +7 -7
  51. package/dist/{WarehouseView-DVak1RPs.js → WarehouseView-BehHQ9Ao.js} +6 -6
  52. package/dist/{WastageTemplateView-CUDL3HUD.js → WastageTemplateView-gmr7doXL.js} +14 -14
  53. package/dist/api/netsuite.d.ts +13 -0
  54. package/dist/api/production-run-error.d.ts +36 -0
  55. package/dist/api/production-run-error.spec.d.ts +1 -0
  56. package/dist/api/production-run.d.ts +58 -0
  57. package/dist/api/stock.d.ts +0 -6
  58. package/dist/{app-BUQUpe4c.js → app-BT7hD4az.js} +16491 -12629
  59. package/dist/app.d.ts +2958 -14
  60. package/dist/app.js +1 -1
  61. package/dist/{closing-template-DzxDiEQB.js → closing-template-BNfr1RIX.js} +1 -1
  62. package/dist/components/FmInventoryBanner.vue.d.ts +39 -0
  63. package/dist/components/FmUnitInput.spec.d.ts +1 -0
  64. package/dist/components/FmUnitInputProps.d.ts +2 -0
  65. package/dist/composable/useModalA11y.d.ts +9 -0
  66. package/dist/composable/useModalA11y.spec.d.ts +1 -0
  67. package/dist/{date2-6jkfRNS_.js → date2-CAh7rsAp.js} +1 -1
  68. package/dist/{dayjs.min-ByRnXzrl.js → dayjs.min-BJk-edO7.js} +7 -7
  69. package/dist/{decimal-CqWBdj8E.js → decimal-DYlKNkVX.js} +2 -2
  70. package/dist/{defineDeepModel-CaT-4fiq.js → defineDeepModel-BPHl7mTD.js} +1 -1
  71. package/dist/{duplicate-template-Cyvx-WK7.js → duplicate-template-BWUUIdzG.js} +1 -1
  72. package/dist/{feature-FjXz4WXw.js → feature-CSvVyBN2.js} +2 -2
  73. package/dist/{format-time-from-id-cSri3OoO.js → format-time-from-id-Dh3lxXpc.js} +1 -1
  74. package/dist/{format-unit-display-DPbcT7Ff.js → format-unit-display-B1ft2wxm.js} +12 -12
  75. package/dist/{import-export.helper-_yqcePYs.js → import-export.helper-txDvkMf0.js} +6 -6
  76. package/dist/{index-CyJVMHQW.js → index-AmTodx3_.js} +1 -1
  77. package/dist/{index-CGvNoBid.js → index-B4wQijn6.js} +1 -1
  78. package/dist/{index-nSL5yxNn.js → index-TIX5DyQk.js} +3 -3
  79. package/dist/inventory-core-dart.default-BpMxAF-0.js +31060 -0
  80. package/dist/{lz-string-iyER1Klb.js → lz-string-CFDYH-K6.js} +1 -1
  81. package/dist/{netsuite-BD8LVxaA.js → netsuite-CdW9v92G.js} +477 -462
  82. package/dist/{number-C7CJ9ZfE.js → number-DRRlTYv7.js} +6 -6
  83. package/dist/{predefined-templates-o-_pKVSM.js → predefined-templates-C68U85pc.js} +1 -1
  84. package/dist/production-run-display-DmyfdjHR.js +239 -0
  85. package/dist/production-run-prepare-sheet-BvxMd19E.js +189 -0
  86. package/dist/{purchase-order-template-BHS8T1VA.js → purchase-order-template-BvED3CpO.js} +1 -1
  87. package/dist/{recalculationUtils-BCByr_CU.js → recalculationUtils-9rFepwwr.js} +1 -1
  88. package/dist/router/name.d.ts +2 -0
  89. package/dist/{rules-wZo-8FZ0.js → rules-C8RmopTe.js} +2 -2
  90. package/dist/{stock-DwqEvWM5.js → stock-BKkluaaM.js} +26 -36
  91. package/dist/{stock-CnAjxV7P.js → stock-CiCsT5JK.js} +3 -3
  92. package/dist/stores/integration/codemax.d.ts +1 -1
  93. package/dist/stores/integration/netsuite.d.ts +54 -0
  94. package/dist/style.css +1 -1
  95. package/dist/{supplier-DkqNwQmi.js → supplier--zZMQHPc.js} +2 -2
  96. package/dist/{surcharge-Csj1WYbH.js → surcharge-BLF3XV0G.js} +1 -1
  97. package/dist/tsconfig.app.tsbuildinfo +1 -1
  98. package/dist/{uom-rules-BI1CdWeS.js → uom-rules-CjCCXiGL.js} +1 -1
  99. package/dist/{use-ingredient-select-dialog-5AqoZJDA.js → use-ingredient-select-dialog-DnUiY-Ic.js} +2 -2
  100. package/dist/{use-inventory-binding-dialog-ChiyhiuP.js → use-inventory-binding-dialog-BAU-P8kV.js} +2 -2
  101. package/dist/{use-template-enabled-locations-BqXxegct.js → use-template-enabled-locations-DZMzYCi-.js} +2 -2
  102. package/dist/{use-transfer-locations-Ckj_diGt.js → use-transfer-locations-DomGLsT2.js} +2 -2
  103. package/dist/{useHrmPermission-USG_KRoq.js → useHrmPermission-CrhsV_5z.js} +1 -1
  104. package/dist/{useNavigationMenu-BhYf87KI.js → useNavigationMenu-1h-G_-el.js} +2 -2
  105. package/dist/{useSseClient-BqoE-ir6.js → useSseClient-o_3wiqhX.js} +1 -1
  106. package/dist/views/changelog/composables/use-inventory-record-commits.d.ts +1 -1
  107. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  108. package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +2 -2
  109. package/dist/views/integration/components/CodemaxDialog.vue.d.ts +2 -2
  110. package/dist/views/integration/components/netsuite/business/vendor-publish.d.ts +7 -0
  111. package/dist/views/integration/components/netsuite/business/vendor-publish.spec.d.ts +1 -0
  112. package/dist/views/production-run/ProductionRunDetailView.spec.d.ts +1 -0
  113. package/dist/views/production-run/ProductionRunDetailView.vue.d.ts +15 -0
  114. package/dist/views/production-run/ProductionRunPreparePrintView.spec.d.ts +1 -0
  115. package/dist/views/production-run/ProductionRunPreparePrintView.vue.d.ts +2 -0
  116. package/dist/views/production-run/ProductionRunView.spec.d.ts +1 -0
  117. package/dist/views/production-run/ProductionRunView.vue.d.ts +2 -0
  118. package/dist/views/production-run/components/CancelRunDialog.spec.d.ts +1 -0
  119. package/dist/views/production-run/components/CancelRunDialog.vue.d.ts +918 -0
  120. package/dist/views/production-run/components/CancelRunDialogProps.d.ts +9 -0
  121. package/dist/views/production-run/components/CloseRunDialog.spec.d.ts +1 -0
  122. package/dist/views/production-run/components/CloseRunDialog.vue.d.ts +918 -0
  123. package/dist/views/production-run/components/CloseRunDialogProps.d.ts +29 -0
  124. package/dist/views/production-run/components/PrepareRunConfirmationDialog.spec.d.ts +1 -0
  125. package/dist/views/production-run/components/PrepareRunConfirmationDialog.vue.d.ts +29 -0
  126. package/dist/views/production-run/components/PrepareRunDialog.spec.d.ts +1 -0
  127. package/dist/views/production-run/components/PrepareRunDialog.vue.d.ts +18 -0
  128. package/dist/views/production-run/components/PrepareRunDialogProps.d.ts +29 -0
  129. package/dist/views/production-run/components/PrepareSheetDialog.spec.d.ts +1 -0
  130. package/dist/views/production-run/components/PrepareSheetDialog.vue.d.ts +26 -0
  131. package/dist/views/{stock/components/dialog/SnapshotRecalculationDialog.vue.d.ts → production-run/components/ProductionRunActionMenuItem.vue.d.ts} +7 -10
  132. package/dist/views/production-run/components/ProductionRunActionsCell.spec.d.ts +1 -0
  133. package/dist/views/production-run/components/ProductionRunActionsCell.vue.d.ts +20 -0
  134. package/dist/views/production-run/components/ProductionRunActivityTab.spec.d.ts +1 -0
  135. package/dist/views/production-run/components/ProductionRunActivityTab.vue.d.ts +15 -0
  136. package/dist/views/production-run/components/ProductionRunBanner.spec.d.ts +1 -0
  137. package/dist/views/production-run/components/ProductionRunBanner.vue.d.ts +42 -0
  138. package/dist/views/production-run/components/ProductionRunBatchCard.spec.d.ts +1 -0
  139. package/dist/views/production-run/components/ProductionRunBatchCard.vue.d.ts +69 -0
  140. package/dist/views/production-run/components/ProductionRunBatchWastageDetails.spec.d.ts +1 -0
  141. package/dist/views/production-run/components/ProductionRunBatchWastageDetails.vue.d.ts +33 -0
  142. package/dist/views/production-run/components/ProductionRunBindingsDisclosure.spec.d.ts +1 -0
  143. package/dist/views/production-run/components/ProductionRunBindingsDisclosure.vue.d.ts +25 -0
  144. package/dist/views/production-run/components/ProductionRunBindingsList.vue.d.ts +51 -0
  145. package/dist/views/production-run/components/ProductionRunCompactDisclosure.vue.d.ts +25 -0
  146. package/dist/views/production-run/components/ProductionRunContributorBranch.spec.d.ts +1 -0
  147. package/dist/views/production-run/components/ProductionRunContributorBranch.vue.d.ts +25 -0
  148. package/dist/views/production-run/components/ProductionRunCostRail.spec.d.ts +1 -0
  149. package/dist/views/production-run/components/ProductionRunCostRail.vue.d.ts +77 -0
  150. package/dist/views/production-run/components/ProductionRunDialog.spec.d.ts +1 -0
  151. package/dist/views/production-run/components/ProductionRunDialog.vue.d.ts +24 -0
  152. package/dist/views/production-run/components/ProductionRunDialogProps.d.ts +15 -0
  153. package/dist/views/production-run/components/ProductionRunDialogSurface.vue.d.ts +33 -0
  154. package/dist/views/production-run/components/ProductionRunDiscardDialog.spec.d.ts +1 -0
  155. package/dist/views/production-run/components/ProductionRunDiscardDialog.vue.d.ts +21 -0
  156. package/dist/views/production-run/components/ProductionRunDuplicateDialog.spec.d.ts +1 -0
  157. package/dist/views/production-run/components/ProductionRunDuplicateDialog.vue.d.ts +51 -0
  158. package/dist/views/production-run/components/ProductionRunFormDialog.spec.d.ts +1 -0
  159. package/dist/views/production-run/components/ProductionRunFormDialog.vue.d.ts +918 -0
  160. package/dist/views/production-run/components/ProductionRunFormDialogProps.d.ts +22 -0
  161. package/dist/views/production-run/components/ProductionRunHeader.spec.d.ts +1 -0
  162. package/dist/views/production-run/components/ProductionRunHeader.vue.d.ts +65 -0
  163. package/dist/views/production-run/components/ProductionRunHelpPopover.spec.d.ts +1 -0
  164. package/dist/views/production-run/components/ProductionRunHelpPopover.vue.d.ts +52 -0
  165. package/dist/views/production-run/components/ProductionRunIngredientTree.spec.d.ts +1 -0
  166. package/dist/views/production-run/components/ProductionRunIngredientTree.vue.d.ts +42 -0
  167. package/dist/views/production-run/components/ProductionRunIngredientsTab.spec.d.ts +1 -0
  168. package/dist/views/production-run/components/ProductionRunIngredientsTab.vue.d.ts +63 -0
  169. package/dist/views/production-run/components/ProductionRunInstructionsCard.spec.d.ts +1 -0
  170. package/dist/views/production-run/components/ProductionRunInstructionsCard.vue.d.ts +15 -0
  171. package/dist/views/production-run/components/ProductionRunItemPickerDialog.spec.d.ts +1 -0
  172. package/dist/views/production-run/components/ProductionRunItemPickerDialog.vue.d.ts +30 -0
  173. package/dist/views/production-run/components/ProductionRunItemsCell.spec.d.ts +1 -0
  174. package/dist/views/production-run/components/ProductionRunItemsCell.vue.d.ts +33 -0
  175. package/dist/views/production-run/components/ProductionRunItemsTable.spec.d.ts +1 -0
  176. package/dist/views/production-run/components/ProductionRunItemsTable.vue.d.ts +73 -0
  177. package/dist/views/production-run/components/ProductionRunLoadBannerContract.spec.d.ts +1 -0
  178. package/dist/views/production-run/components/ProductionRunNoBindingsHelp.spec.d.ts +1 -0
  179. package/dist/views/production-run/components/ProductionRunNoBindingsHelp.vue.d.ts +15 -0
  180. package/dist/views/production-run/components/ProductionRunOutputTab.spec.d.ts +1 -0
  181. package/dist/views/production-run/components/ProductionRunOutputTab.vue.d.ts +26 -0
  182. package/dist/views/production-run/components/ProductionRunOverviewTab.spec.d.ts +1 -0
  183. package/dist/views/production-run/components/ProductionRunOverviewTab.vue.d.ts +999 -0
  184. package/dist/views/production-run/components/ProductionRunPlanCard.spec.d.ts +1 -0
  185. package/dist/views/production-run/components/ProductionRunPlanCard.vue.d.ts +50 -0
  186. package/dist/views/production-run/components/ProductionRunPlanner.spec.d.ts +1 -0
  187. package/dist/views/production-run/components/ProductionRunPlanner.vue.d.ts +61 -0
  188. package/dist/views/production-run/components/ProductionRunPrepareSheet.vue.d.ts +16 -0
  189. package/dist/views/production-run/components/ProductionRunProjectionFeedback.spec.d.ts +1 -0
  190. package/dist/views/production-run/components/ProductionRunProjectionFeedback.vue.d.ts +41 -0
  191. package/dist/views/production-run/components/ProductionRunRecordOutputDetails.spec.d.ts +1 -0
  192. package/dist/views/production-run/components/ProductionRunRecordOutputDetails.vue.d.ts +43 -0
  193. package/dist/views/production-run/components/ProductionRunRecordOutputWastageStatus.spec.d.ts +1 -0
  194. package/dist/views/production-run/components/ProductionRunRecordOutputWastageStatus.vue.d.ts +31 -0
  195. package/dist/views/production-run/components/ProductionRunRequestedOverview.spec.d.ts +1 -0
  196. package/dist/views/production-run/components/ProductionRunRequestedOverview.vue.d.ts +48 -0
  197. package/dist/views/production-run/components/ProductionRunResultTable.spec.d.ts +1 -0
  198. package/dist/views/production-run/components/ProductionRunResultTable.vue.d.ts +31 -0
  199. package/dist/views/production-run/components/ProductionRunScrollHint.spec.d.ts +1 -0
  200. package/dist/views/production-run/components/ProductionRunScrollHint.vue.d.ts +31 -0
  201. package/dist/views/production-run/components/ProductionRunSelectionCheckbox.vue.d.ts +31 -0
  202. package/dist/views/production-run/components/ProductionRunSelectionControls.spec.d.ts +1 -0
  203. package/dist/views/production-run/components/ProductionRunSelectionRadio.spec.d.ts +1 -0
  204. package/dist/views/production-run/components/ProductionRunSelectionRadio.vue.d.ts +37 -0
  205. package/dist/views/production-run/components/ProductionRunSideSheet.spec.d.ts +1 -0
  206. package/dist/views/production-run/components/ProductionRunSideSheet.vue.d.ts +77 -0
  207. package/dist/views/production-run/components/ProductionRunSideSheetSurface.vue.d.ts +52 -0
  208. package/dist/views/production-run/components/ProductionRunSortHeader.spec.d.ts +1 -0
  209. package/dist/views/production-run/components/ProductionRunSortHeader.vue.d.ts +25 -0
  210. package/dist/views/production-run/components/ProductionRunStatusBadge.vue.d.ts +15 -0
  211. package/dist/views/production-run/components/ProductionRunTabs.spec.d.ts +1 -0
  212. package/dist/views/production-run/components/ProductionRunTabs.vue.d.ts +47 -0
  213. package/dist/views/production-run/components/ProductionRunTerminalNotice.spec.d.ts +1 -0
  214. package/dist/views/production-run/components/ProductionRunTerminalNotice.vue.d.ts +15 -0
  215. package/dist/views/production-run/components/ProductionRunTextarea.spec.d.ts +1 -0
  216. package/dist/views/production-run/components/ProductionRunTextarea.vue.d.ts +53 -0
  217. package/dist/views/production-run/components/ProductionRunUnitInput.spec.d.ts +1 -0
  218. package/dist/views/production-run/components/ProductionRunUnitInput.vue.d.ts +34 -0
  219. package/dist/views/production-run/components/ProductionRunWastageDisclosure.spec.d.ts +1 -0
  220. package/dist/views/production-run/components/ProductionRunWastageDisclosure.vue.d.ts +23 -0
  221. package/dist/views/production-run/components/RecordOutputDialog.spec.d.ts +1 -0
  222. package/dist/views/production-run/components/RecordOutputDialog.vue.d.ts +20 -0
  223. package/dist/views/production-run/components/RecordOutputDialogProps.d.ts +28 -0
  224. package/dist/views/production-run/components/TargetReachedDialog.spec.d.ts +1 -0
  225. package/dist/views/production-run/components/TargetReachedDialog.vue.d.ts +927 -0
  226. package/dist/views/production-run/components/production-run-deduction-parity.spec.d.ts +1 -0
  227. package/dist/views/production-run/components/production-run-prepare-sheet.d.ts +17 -0
  228. package/dist/views/production-run/components/production-run-typography-contract.spec.d.ts +1 -0
  229. package/dist/views/production-run/components/production-run-unit-snapshot.d.ts +39 -0
  230. package/dist/views/production-run/composables/production-run-display.d.ts +272 -0
  231. package/dist/views/production-run/composables/production-run-display.spec.d.ts +1 -0
  232. package/dist/views/production-run/composables/production-run-list.d.ts +46 -0
  233. package/dist/views/production-run/composables/production-run-list.spec.d.ts +1 -0
  234. package/dist/views/production-run/composables/production-run-request-confirmation.d.ts +20 -0
  235. package/dist/views/production-run/composables/use-production-run-actions.d.ts +37 -0
  236. package/dist/views/production-run/composables/use-production-run-actions.spec.d.ts +1 -0
  237. package/dist/views/production-run/composables/use-production-run-cost.d.ts +672 -0
  238. package/dist/views/production-run/composables/use-production-run-cost.spec.d.ts +1 -0
  239. package/dist/views/production-run/composables/use-production-run-detail.d.ts +1894 -0
  240. package/dist/views/production-run/composables/use-production-run-detail.spec.d.ts +1 -0
  241. package/dist/views/production-run/composables/use-production-run-disclosure.d.ts +15 -0
  242. package/dist/views/production-run/composables/use-production-run-disclosure.spec.d.ts +1 -0
  243. package/dist/views/production-run/composables/use-production-run-duplicate-sources.d.ts +19 -0
  244. package/dist/views/production-run/composables/use-production-run-duplicate-sources.spec.d.ts +1 -0
  245. package/dist/views/production-run/composables/use-production-run-economics.d.ts +92 -0
  246. package/dist/views/production-run/composables/use-production-run-economics.spec.d.ts +1 -0
  247. package/dist/views/production-run/composables/use-production-run-form.d.ts +277 -0
  248. package/dist/views/production-run/composables/use-production-run-form.spec.d.ts +1 -0
  249. package/dist/views/production-run/composables/use-production-run-record-output.d.ts +261 -0
  250. package/dist/views/production-run/composables/use-production-run-record-output.spec.d.ts +1 -0
  251. package/dist/views/production-run/composables/use-production-run-scroll-hint.d.ts +9 -0
  252. package/dist/views/production-run/composables/use-production-run-table.d.ts +19 -0
  253. package/dist/views/production-run/composables/use-production-run-table.spec.d.ts +1 -0
  254. package/dist/views/production-run/helpers/production-run-precision.helper.d.ts +31 -0
  255. package/dist/views/production-run/helpers/production-run-quantity.helper.d.ts +55 -0
  256. package/dist/views/production-run/helpers/production-run-quantity.helper.spec.d.ts +1 -0
  257. package/dist/views/production-run/production-run.fixture.d.ts +70 -0
  258. package/dist/views/production-run/production-run.fixture.spec.d.ts +1 -0
  259. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -3
  260. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +3 -3
  261. package/dist/views/stock/components/dialog/RecalculationDialog.vue.d.ts +2 -17
  262. package/dist/{vue-i18n-DoKioQ81.js → vue-i18n-hE8n67Ig.js} +202 -202
  263. package/dist/{xlsx.util-BXjE2o-3.js → xlsx.util-Jv7EpwFc.js} +2 -2
  264. package/package.json +4 -4
  265. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-ashHOuZt.js +0 -130
  266. package/dist/ClosingHistoryView-BYVZ01Ma.js +0 -1112
  267. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-hTQmIyaf.js +0 -120
  268. package/dist/ProductionView-BWn7RBEg.js +0 -1441
  269. package/dist/inventory-core-dart.default-DSYRPQNZ.js +0 -25155
  270. package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +0 -9
@@ -1,1112 +0,0 @@
1
- import { defineComponent as se, ref as g, computed as D, watch as re, resolveComponent as w, createElementBlock as p, openBlock as i, createBlock as j, createCommentVNode as _, createVNode as h, withModifiers as pe, withCtx as F, createElementVNode as a, toDisplayString as l, unref as c, Fragment as G, createTextVNode as te, renderList as le, normalizeClass as ve, h as ee, Teleport as be } from "vue";
2
- import { _ as ke } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
- import { useI18n as ie, useCoreStore as xe } from "@feedmepos/mf-common";
4
- import { G as de, B as P, a as De, u as Se } from "./app-BUQUpe4c.js";
5
- import { F as fe } from "./FmAdminBadge-DlplQOHb.js";
6
- import { _ as we } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-hTQmIyaf.js";
7
- import { _ as ye } from "./CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js";
8
- import { useSnackbar as ue, useDialog as Ve } from "@feedmepos/ui-library";
9
- import { u as ge } from "./stock-DwqEvWM5.js";
10
- import { g as he, f as $e } from "./recalculationUtils-BCByr_CU.js";
11
- import { _ as Ce } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-bQu2KOI7.js";
12
- const Ae = { class: "fm-typo-en-heading-lg-600" }, Fe = { class: "flex flex-col gap-16" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = { class: "flex flex-col gap-8" }, Ie = { class: "fm-typo-en-body-md-600" }, Te = { class: "flex flex-col gap-8" }, Le = { class: "fm-typo-en-body-md-600" }, Oe = { class: "flex items-center gap-8 mb-8" }, Pe = {
13
- key: 2,
14
- class: "text-red-500 text-sm mt-2"
15
- }, Ue = { class: "fm-typo-en-body-sm-400" }, Ee = {
16
- key: 1,
17
- class: "p-12 border border-fm-color-border-primary rounded-8 bg-fm-color-background-secondary"
18
- }, Ne = {
19
- key: 0,
20
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
21
- }, Me = {
22
- key: 1,
23
- class: "flex flex-col gap-8"
24
- }, Ke = { class: "fm-typo-en-body-sm-600" }, He = { class: "flex flex-col gap-4" }, je = { key: 0 }, ze = {
25
- key: 1,
26
- class: "flex flex-col gap-8"
27
- }, We = { class: "fm-typo-en-body-md-600" }, Ye = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Ge = { class: "flex items-center justify-between" }, Je = { class: "fm-typo-en-body-sm-600" }, Qe = { class: "flex items-center gap-8" }, Xe = {
28
- key: 0,
29
- class: "fm-typo-en-body-xs-600 px-8 py-4 rounded-4 bg-fm-color-neutral-100 text-fm-color-typo-secondary"
30
- }, Ze = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, et = {
31
- key: 0,
32
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
33
- }, tt = {
34
- key: 1,
35
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
36
- }, ot = {
37
- key: 2,
38
- class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
39
- }, at = {
40
- key: 0,
41
- class: "flex gap-8 ml-auto"
42
- }, nt = {
43
- key: 1,
44
- class: "flex gap-8 ml-auto"
45
- }, lt = /* @__PURE__ */ se({
46
- __name: "RecalculationDialog",
47
- props: {
48
- showButton: { type: Boolean }
49
- },
50
- emits: ["submitted"],
51
- setup(ne, { expose: b, emit: k }) {
52
- const T = k, { t: o } = ie(), L = ge(), R = de(), x = ue(), S = g(!1), f = g(""), y = g(""), $ = g(!1), U = g([]), s = g(!1), r = g([]), C = g(!1), v = g([]), A = g(!1), B = D(() => he(U.value)), I = D(() => {
53
- if (!f.value) return [];
54
- const u = B.value.find((e) => e.value === f.value);
55
- return u ? B.value.filter((e) => e.date.getTime() > u.date.getTime()).sort((e, m) => m.date.getTime() - e.date.getTime()) : [];
56
- }), N = D({
57
- get: () => {
58
- if ($.value && y.value) {
59
- const u = U.value.find((e) => P(e._id) === y.value);
60
- return (u == null ? void 0 : u._id) || y.value;
61
- }
62
- return y.value;
63
- },
64
- set: (u) => {
65
- $.value && u ? y.value = P(u) : y.value = u;
66
- }
67
- }), z = D(() => {
68
- if (f.value)
69
- try {
70
- const u = P(f.value);
71
- if (u)
72
- return u;
73
- } catch (u) {
74
- console.error("Error parsing date from closing ID:", u);
75
- }
76
- }), E = D(() => {
77
- if (!f.value || !y.value) return "";
78
- const u = P(f.value), e = y.value;
79
- if (u && e) {
80
- const m = new Date(u).getTime();
81
- if (new Date(e).getTime() <= m)
82
- return o("inventory.stock.recalculation.error.endDateBeforeOpening");
83
- }
84
- return "";
85
- }), M = D(() => !!f.value && !!y.value && !E.value), J = D(() => r.value.some(
86
- (u) => !u.completedAt && !u.failedReason
87
- ));
88
- async function Y() {
89
- S.value = !0, await Promise.all([oe(), K()]), f.value = "", y.value = "", $.value = !1;
90
- }
91
- function Q() {
92
- S.value = !1;
93
- }
94
- b({
95
- open: Y,
96
- close: Q
97
- });
98
- async function oe() {
99
- s.value = !0;
100
- try {
101
- const u = await R.getLastNClosings(30);
102
- U.value = u;
103
- } catch (u) {
104
- console.error("Error fetching recent closings:", u), x.open({
105
- title: o("common.error"),
106
- message: "Failed to fetch recent closings",
107
- type: "error"
108
- });
109
- } finally {
110
- s.value = !1;
111
- }
112
- }
113
- async function K() {
114
- C.value = !0;
115
- try {
116
- const u = await L.recalculation.recalculationRequests();
117
- r.value = u;
118
- } catch (u) {
119
- console.error("Error fetching recalculation requests:", u);
120
- } finally {
121
- C.value = !1;
122
- }
123
- }
124
- async function W() {
125
- if (!f.value || !y.value) {
126
- v.value = [];
127
- return;
128
- }
129
- A.value = !0;
130
- try {
131
- const u = await L.recalculation.getAffectedClosingDrafts(
132
- f.value,
133
- y.value
134
- );
135
- v.value = u;
136
- } catch {
137
- x.open({
138
- title: o("common.error"),
139
- message: "Failed to fetch affected closing drafts",
140
- type: "error"
141
- }), v.value = [];
142
- } finally {
143
- A.value = !1;
144
- }
145
- }
146
- re(
147
- [f, y],
148
- () => {
149
- f.value && y.value && !E.value ? W() : v.value = [];
150
- },
151
- { immediate: !1 }
152
- );
153
- async function ae() {
154
- if (M.value) {
155
- s.value = !0;
156
- try {
157
- if (await L.recalculation.scheduleRecalculation({
158
- openingId: f.value,
159
- untilDate: y.value
160
- }), v.value.length > 0) {
161
- const u = v.value.map((e) => e._id);
162
- await L.recalculation.scheduleInvalidateClosingDraftCache(u);
163
- }
164
- x.open({
165
- title: o("common.success"),
166
- message: "Stock recalculation has been scheduled successfully",
167
- type: "success"
168
- }), await K(), S.value = !1, T("submitted");
169
- } catch (u) {
170
- console.error("Error scheduling recalculation:", u), x.open({
171
- title: o("common.error"),
172
- message: "Failed to schedule stock recalculation",
173
- type: "error"
174
- });
175
- } finally {
176
- s.value = !1;
177
- }
178
- }
179
- }
180
- return (u, e) => {
181
- const m = w("FmButton"), O = w("FmSelect"), X = w("FmRadio"), Z = w("FmDatePicker"), q = w("FmAlert"), d = w("FmDialog");
182
- return i(), p("div", null, [
183
- u.showButton ? (i(), j(m, {
184
- key: 0,
185
- "prepend-icon": "info",
186
- variant: "tertiary",
187
- onClick: pe(Y, ["stop"])
188
- })) : _("", !0),
189
- h(d, {
190
- modelValue: S.value,
191
- "onUpdate:modelValue": e[7] || (e[7] = (t) => S.value = t),
192
- "close-button": "",
193
- dismissAway: "",
194
- "max-width": "600px"
195
- }, {
196
- "dialog-header": F(() => [
197
- a("div", Ae, l(c(o)("inventory.stock.recalculation.title")), 1)
198
- ]),
199
- "dialog-footer": F(() => [
200
- J.value ? (i(), p("div", nt, [
201
- h(m, {
202
- variant: "tertiary",
203
- onClick: e[6] || (e[6] = (t) => S.value = !1),
204
- label: c(o)("common.close")
205
- }, null, 8, ["label"])
206
- ])) : (i(), p("div", at, [
207
- h(m, {
208
- variant: "tertiary",
209
- onClick: e[5] || (e[5] = (t) => S.value = !1),
210
- disabled: s.value,
211
- label: c(o)("common.cancel")
212
- }, null, 8, ["disabled", "label"]),
213
- h(m, {
214
- variant: "primary",
215
- onClick: ae,
216
- disabled: !M.value || s.value,
217
- loading: s.value,
218
- label: c(o)("inventory.stock.recalculation.schedule")
219
- }, null, 8, ["disabled", "loading", "label"])
220
- ]))
221
- ]),
222
- default: F(() => [
223
- a("div", Fe, [
224
- a("div", Re, l(c(o)("inventory.stock.recalculation.description")), 1),
225
- J.value ? _("", !0) : (i(), p(G, { key: 0 }, [
226
- a("div", Be, [
227
- a("p", Ie, [
228
- te(l(c(o)("inventory.stock.recalculation.openingDate")) + " ", 1),
229
- e[8] || (e[8] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
230
- ]),
231
- e[9] || (e[9] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Showing the last 30 closing records. Select the opening date to start recalculation. ", -1)),
232
- h(O, {
233
- modelValue: f.value,
234
- "onUpdate:modelValue": e[0] || (e[0] = (t) => f.value = t),
235
- items: B.value,
236
- placeholder: c(o)("inventory.stock.recalculation.selectOpening"),
237
- loading: s.value,
238
- disabled: s.value
239
- }, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
240
- ]),
241
- a("div", Te, [
242
- a("p", Le, [
243
- te(l(c(o)("inventory.stock.recalculation.untilDate")) + " ", 1),
244
- e[10] || (e[10] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
245
- ]),
246
- a("div", Oe, [
247
- h(X, {
248
- modelValue: $.value,
249
- "onUpdate:modelValue": e[1] || (e[1] = (t) => $.value = t),
250
- value: !1,
251
- label: c(o)("inventory.stock.recalculation.selectByDate")
252
- }, null, 8, ["modelValue", "label"]),
253
- h(X, {
254
- modelValue: $.value,
255
- "onUpdate:modelValue": e[2] || (e[2] = (t) => $.value = t),
256
- value: !0,
257
- label: c(o)("inventory.stock.recalculation.selectByClosing")
258
- }, null, 8, ["modelValue", "label"])
259
- ]),
260
- $.value ? (i(), j(O, {
261
- key: 1,
262
- modelValue: N.value,
263
- "onUpdate:modelValue": e[4] || (e[4] = (t) => N.value = t),
264
- items: I.value,
265
- placeholder: c(o)("inventory.stock.recalculation.selectClosing"),
266
- loading: s.value,
267
- disabled: !f.value || s.value
268
- }, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])) : (i(), j(Z, {
269
- key: 0,
270
- modelValue: y.value,
271
- "onUpdate:modelValue": e[3] || (e[3] = (t) => y.value = t),
272
- placeholder: c(o)("inventory.stock.recalculation.selectDate"),
273
- min: z.value,
274
- disabled: !f.value || s.value
275
- }, null, 8, ["modelValue", "placeholder", "min", "disabled"])),
276
- E.value ? (i(), p("div", Pe, l(E.value), 1)) : _("", !0)
277
- ]),
278
- f.value && y.value && !E.value ? (i(), j(q, {
279
- key: 0,
280
- type: "info"
281
- }, {
282
- default: F(() => [
283
- a("div", Ue, l(c(o)("inventory.stock.recalculation.info")), 1)
284
- ]),
285
- _: 1
286
- })) : _("", !0),
287
- v.value.length > 0 ? (i(), p("div", Ee, [
288
- A.value ? (i(), p("div", Ne, " Loading affected closing drafts... ")) : (i(), p("div", Me, [
289
- a("div", Ke, " Affected closing draft(s): " + l(v.value.length), 1),
290
- a("div", He, [
291
- (i(!0), p(G, null, le(v.value, (t) => (i(), p("div", {
292
- key: t._id,
293
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
294
- }, [
295
- te(" • " + l(t._id) + " ", 1),
296
- t.effectiveAt ? (i(), p("span", je, " (" + l(new Date(t.effectiveAt).toLocaleString()) + ") ", 1)) : _("", !0)
297
- ]))), 128))
298
- ])
299
- ]))
300
- ])) : _("", !0)
301
- ], 64)),
302
- r.value.length > 0 ? (i(), p("div", ze, [
303
- a("p", We, l(c(o)("inventory.stock.recalculation.recentRequests")), 1),
304
- a("div", Ye, [
305
- (i(!0), p(G, null, le(r.value, (t) => {
306
- var n;
307
- return i(), p("div", {
308
- key: t._id,
309
- class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
310
- }, [
311
- a("div", Ge, [
312
- a("div", Je, l(c(o)("inventory.stock.recalculation.requestedAt")) + ": " + l(new Date(t.createdAt).toLocaleString()), 1),
313
- a("div", Qe, [
314
- (n = t.meta) != null && n.openingType ? (i(), p("div", Xe, l(t.meta.openingType === "stockSnapshot" ? "Snapshot" : "Closing"), 1)) : _("", !0),
315
- a("div", {
316
- class: ve(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
317
- "bg-fm-color-system-error-100 text-fm-color-system-error-500": t.failedReason,
318
- "bg-fm-color-system-success-100 text-fm-color-system-success-500": t.completedAt,
319
- "bg-fm-color-system-info-100 text-fm-color-system-info-500": !t.failedReason && !t.completedAt
320
- }])
321
- }, l(t.failedReason ? c(o)("inventory.stock.recalculation.status.failed") : t.completedAt ? c(o)("inventory.stock.recalculation.status.completed") : c(o)("inventory.stock.recalculation.status.inProgress")), 3)
322
- ])
323
- ]),
324
- a("div", Ze, l(c(o)("inventory.stock.recalculation.from")) + ": " + l(new Date(t.recalculateStartDate).toLocaleDateString()), 1),
325
- a("div", qe, l(c(o)("inventory.stock.recalculation.to")) + ": " + l(new Date(t.recalculateEndDate).toLocaleDateString()), 1),
326
- t.createdBy ? (i(), p("div", et, l(c(o)("inventory.stock.recalculation.requestedBy")) + ": " + l(t.createdBy.name || t.createdBy.id), 1)) : _("", !0),
327
- t.completedAt ? (i(), p("div", tt, l(c(o)("inventory.stock.recalculation.completedAt")) + ": " + l(new Date(t.completedAt).toLocaleString()), 1)) : _("", !0),
328
- t.failedReason ? (i(), p("div", ot, l(t.failedReason), 1)) : _("", !0)
329
- ]);
330
- }), 128))
331
- ])
332
- ])) : _("", !0)
333
- ])
334
- ]),
335
- _: 1
336
- }, 8, ["modelValue"])
337
- ]);
338
- };
339
- }
340
- }), st = { class: "fm-typo-en-heading-lg-600" }, it = { class: "flex flex-col gap-16" }, ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt = { class: "flex flex-col gap-8" }, dt = { class: "fm-typo-en-body-md-600" }, ut = { class: "flex flex-col gap-8" }, mt = { class: "fm-typo-en-body-md-600" }, ft = {
341
- key: 0,
342
- class: "text-red-500 text-sm mt-2"
343
- }, yt = { class: "fm-typo-en-body-sm-400" }, pt = {
344
- key: 1,
345
- class: "p-12 border border-fm-color-border-primary rounded-8 bg-fm-color-background-secondary"
346
- }, vt = {
347
- key: 0,
348
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
349
- }, gt = {
350
- key: 1,
351
- class: "flex flex-col gap-8"
352
- }, ht = { class: "fm-typo-en-body-sm-600" }, _t = { class: "flex flex-col gap-4" }, bt = { key: 0 }, kt = { key: 1 }, xt = { key: 2 }, Dt = {
353
- key: 1,
354
- class: "flex flex-col gap-8"
355
- }, St = { class: "fm-typo-en-body-md-600" }, wt = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Vt = { class: "flex items-center justify-between" }, $t = { class: "fm-typo-en-body-sm-600" }, Ct = { class: "flex items-center gap-8" }, At = {
356
- key: 0,
357
- class: "fm-typo-en-body-xs-600 px-8 py-4 rounded-4 bg-fm-color-neutral-100 text-fm-color-typo-secondary"
358
- }, Ft = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bt = {
359
- key: 0,
360
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
361
- }, It = {
362
- key: 1,
363
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
364
- }, Tt = {
365
- key: 2,
366
- class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
367
- }, Lt = {
368
- key: 0,
369
- class: "flex gap-8 ml-auto"
370
- }, Ot = {
371
- key: 1,
372
- class: "flex gap-8 ml-auto"
373
- }, Pt = /* @__PURE__ */ se({
374
- __name: "SnapshotRecalculationDialog",
375
- props: {
376
- showButton: { type: Boolean }
377
- },
378
- emits: ["submitted"],
379
- setup(ne, { expose: b, emit: k }) {
380
- const T = k, { t: o } = ie(), L = ge(), R = de(), x = ue(), S = g(!1), f = g(""), y = g(""), $ = g([]), U = g([]), s = g(!1), r = g([]), C = g(!1), v = g([]), A = g(!1), B = D(
381
- () => he($.value, U.value)
382
- ), I = D(() => $e(
383
- v.value.filter((e) => !!e.closingId).map((e) => ({ closingId: e.closingId, draftCreatedAt: new Date(P(e._id)) }))
384
- )), N = D(() => {
385
- if (f.value)
386
- try {
387
- const e = P(f.value);
388
- if (e)
389
- return e;
390
- } catch (e) {
391
- console.error("Error parsing date from opening ID:", e);
392
- }
393
- }), z = D(() => {
394
- if (!f.value || !y.value) return "";
395
- const e = P(f.value);
396
- if (e && y.value) {
397
- const m = new Date(e).getTime();
398
- if (new Date(y.value).getTime() <= m)
399
- return o("inventory.stock.recalculation.error.endDateBeforeOpening");
400
- }
401
- return "";
402
- }), E = D(() => {
403
- if (!y.value) return !1;
404
- const e = new Date(y.value), m = /* @__PURE__ */ new Date();
405
- return m.setHours(0, 0, 0, 0), e.setHours(0, 0, 0, 0), e >= m;
406
- }), M = D(() => !!f.value && !!y.value && !z.value), J = D(() => r.value.some(
407
- (e) => !e.completedAt && !e.failedReason
408
- ));
409
- async function Y() {
410
- S.value = !0, await Promise.all([oe(), K(), W()]), f.value = "", y.value = "";
411
- }
412
- function Q() {
413
- S.value = !1;
414
- }
415
- b({
416
- open: Y,
417
- close: Q
418
- });
419
- async function oe() {
420
- s.value = !0;
421
- try {
422
- const e = await R.getLastNClosings(30);
423
- $.value = e;
424
- } catch (e) {
425
- console.error("Error fetching recent closings:", e), x.open({
426
- title: o("common.error"),
427
- message: "Failed to fetch recent closings",
428
- type: "error"
429
- });
430
- } finally {
431
- s.value = !1;
432
- }
433
- }
434
- async function K() {
435
- try {
436
- const e = await R.getLastNStockSnapshots(30);
437
- U.value = e;
438
- } catch (e) {
439
- console.error("Error fetching recent snapshots:", e);
440
- }
441
- }
442
- async function W() {
443
- C.value = !0;
444
- try {
445
- const e = await L.recalculation.recalculationRequests();
446
- r.value = e;
447
- } catch (e) {
448
- console.error("Error fetching recalculation requests:", e);
449
- } finally {
450
- C.value = !1;
451
- }
452
- }
453
- async function ae() {
454
- if (!f.value || !y.value) {
455
- v.value = [];
456
- return;
457
- }
458
- A.value = !0;
459
- try {
460
- const e = new Date(y.value);
461
- e.setHours(23, 59, 59, 999);
462
- const m = await L.recalculation.getAffectedClosingDrafts(
463
- f.value,
464
- e.toISOString()
465
- );
466
- v.value = m;
467
- } catch {
468
- x.open({
469
- title: o("common.error"),
470
- message: "Failed to fetch affected closing drafts",
471
- type: "error"
472
- }), v.value = [];
473
- } finally {
474
- A.value = !1;
475
- }
476
- }
477
- re(
478
- [f, y],
479
- () => {
480
- f.value && y.value && !z.value ? ae() : v.value = [];
481
- },
482
- { immediate: !1 }
483
- );
484
- async function u() {
485
- if (!(!M.value || !y.value)) {
486
- s.value = !0;
487
- try {
488
- const e = new Date(y.value);
489
- if (e.setHours(23, 59, 59, 999), await L.recalculation.scheduleRecalculation({
490
- openingId: f.value,
491
- untilDate: e.toISOString(),
492
- recalculateBySnapshot: !0
493
- }), v.value.length > 0) {
494
- const m = v.value.map((O) => O._id);
495
- await L.recalculation.scheduleInvalidateClosingDraftCache(m);
496
- }
497
- x.open({
498
- title: o("common.success"),
499
- message: "Stock recalculation has been scheduled successfully",
500
- type: "success"
501
- }), await W(), S.value = !1, T("submitted");
502
- } catch (e) {
503
- console.error("Error scheduling recalculation:", e), x.open({
504
- title: o("common.error"),
505
- message: "Failed to schedule stock recalculation",
506
- type: "error"
507
- });
508
- } finally {
509
- s.value = !1;
510
- }
511
- }
512
- }
513
- return (e, m) => {
514
- const O = w("FmButton"), X = w("FmSelect"), Z = w("FmDatePicker"), q = w("FmSnackbar"), d = w("FmAlert"), t = w("FmDialog");
515
- return i(), p("div", null, [
516
- e.showButton ? (i(), j(O, {
517
- key: 0,
518
- "prepend-icon": "info",
519
- variant: "tertiary",
520
- onClick: pe(Y, ["stop"])
521
- })) : _("", !0),
522
- h(t, {
523
- modelValue: S.value,
524
- "onUpdate:modelValue": m[4] || (m[4] = (n) => S.value = n),
525
- "close-button": "",
526
- dismissAway: "",
527
- "max-width": "600px"
528
- }, {
529
- "dialog-header": F(() => [
530
- a("div", st, l(c(o)("inventory.stock.recalculation.title")), 1)
531
- ]),
532
- "dialog-footer": F(() => [
533
- J.value ? (i(), p("div", Ot, [
534
- h(O, {
535
- variant: "tertiary",
536
- onClick: m[3] || (m[3] = (n) => S.value = !1),
537
- label: c(o)("common.close")
538
- }, null, 8, ["label"])
539
- ])) : (i(), p("div", Lt, [
540
- h(O, {
541
- variant: "tertiary",
542
- onClick: m[2] || (m[2] = (n) => S.value = !1),
543
- disabled: s.value,
544
- label: c(o)("common.cancel")
545
- }, null, 8, ["disabled", "label"]),
546
- h(O, {
547
- variant: "primary",
548
- onClick: u,
549
- disabled: !M.value || s.value,
550
- loading: s.value,
551
- label: c(o)("inventory.stock.recalculation.schedule")
552
- }, null, 8, ["disabled", "loading", "label"])
553
- ]))
554
- ]),
555
- default: F(() => [
556
- a("div", it, [
557
- a("div", ct, l(c(o)("inventory.stock.recalculation.description")), 1),
558
- J.value ? _("", !0) : (i(), p(G, { key: 0 }, [
559
- a("div", rt, [
560
- a("p", dt, [
561
- te(l(c(o)("inventory.stock.recalculation.openingDate")) + " ", 1),
562
- m[5] || (m[5] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
563
- ]),
564
- m[6] || (m[6] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Select from the last 30 closing or snapshot records as the opening date for recalculation. ", -1)),
565
- h(X, {
566
- modelValue: f.value,
567
- "onUpdate:modelValue": m[0] || (m[0] = (n) => f.value = n),
568
- items: B.value,
569
- placeholder: c(o)("inventory.stock.recalculation.selectOpening"),
570
- loading: s.value,
571
- disabled: s.value
572
- }, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
573
- ]),
574
- a("div", ut, [
575
- a("p", mt, [
576
- te(l(c(o)("inventory.stock.recalculation.untilDate")) + " ", 1),
577
- m[7] || (m[7] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
578
- ]),
579
- m[8] || (m[8] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Select the end date for recalculation. Must be after the selected opening date. ", -1)),
580
- h(Z, {
581
- modelValue: y.value,
582
- "onUpdate:modelValue": m[1] || (m[1] = (n) => y.value = n),
583
- placeholder: c(o)("inventory.stock.recalculation.selectDate"),
584
- min: N.value,
585
- disabled: !f.value || s.value
586
- }, null, 8, ["modelValue", "placeholder", "min", "disabled"]),
587
- z.value ? (i(), p("div", ft, l(z.value), 1)) : _("", !0),
588
- E.value ? (i(), j(q, {
589
- key: 1,
590
- title: "Warning",
591
- variant: "warning",
592
- description: "You have selected today or a future date. The stock balance will be refreshed accordingly."
593
- })) : _("", !0)
594
- ]),
595
- f.value && y.value && !z.value ? (i(), j(d, {
596
- key: 0,
597
- type: "info"
598
- }, {
599
- default: F(() => [
600
- a("div", yt, l(c(o)("inventory.stock.recalculation.info")), 1)
601
- ]),
602
- _: 1
603
- })) : _("", !0),
604
- v.value.length > 0 ? (i(), p("div", pt, [
605
- A.value ? (i(), p("div", vt, " Loading affected closing drafts... ")) : (i(), p("div", gt, [
606
- a("div", ht, " Affected closing draft(s): " + l(v.value.length), 1),
607
- a("div", _t, [
608
- (i(!0), p(G, null, le(v.value, (n) => (i(), p("div", {
609
- key: n._id,
610
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
611
- }, [
612
- m[9] || (m[9] = te(" • ")),
613
- n.closingId && I.value.get(n.closingId) ? (i(), p("span", bt, l(I.value.get(n.closingId)), 1)) : (i(), p("span", kt, l(n._id), 1)),
614
- n.effectiveAt ? (i(), p("span", xt, " (" + l(new Date(n.effectiveAt).toLocaleString()) + ") ", 1)) : _("", !0)
615
- ]))), 128))
616
- ])
617
- ]))
618
- ])) : _("", !0)
619
- ], 64)),
620
- r.value.length > 0 ? (i(), p("div", Dt, [
621
- a("p", St, l(c(o)("inventory.stock.recalculation.recentRequests")), 1),
622
- a("div", wt, [
623
- (i(!0), p(G, null, le(r.value, (n) => {
624
- var H;
625
- return i(), p("div", {
626
- key: n._id,
627
- class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
628
- }, [
629
- a("div", Vt, [
630
- a("div", $t, l(c(o)("inventory.stock.recalculation.requestedAt")) + ": " + l(new Date(n.createdAt).toLocaleString()), 1),
631
- a("div", Ct, [
632
- (H = n.meta) != null && H.openingType ? (i(), p("div", At, l(n.meta.openingType === "stockSnapshot" ? "Snapshot" : "Closing"), 1)) : _("", !0),
633
- a("div", {
634
- class: ve(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
635
- "bg-fm-color-system-error-100 text-fm-color-system-error-500": n.failedReason,
636
- "bg-fm-color-system-success-100 text-fm-color-system-success-500": n.completedAt,
637
- "bg-fm-color-system-info-100 text-fm-color-system-info-500": !n.failedReason && !n.completedAt
638
- }])
639
- }, l(n.failedReason ? c(o)("inventory.stock.recalculation.status.failed") : n.completedAt ? c(o)("inventory.stock.recalculation.status.completed") : c(o)("inventory.stock.recalculation.status.inProgress")), 3)
640
- ])
641
- ]),
642
- a("div", Ft, l(c(o)("inventory.stock.recalculation.from")) + ": " + l(new Date(n.recalculateStartDate).toLocaleDateString()), 1),
643
- a("div", Rt, l(c(o)("inventory.stock.recalculation.to")) + ": " + l(new Date(n.recalculateEndDate).toLocaleDateString()), 1),
644
- n.createdBy ? (i(), p("div", Bt, l(c(o)("inventory.stock.recalculation.requestedBy")) + ": " + l(n.createdBy.name || n.createdBy.id), 1)) : _("", !0),
645
- n.completedAt ? (i(), p("div", It, l(c(o)("inventory.stock.recalculation.completedAt")) + ": " + l(new Date(n.completedAt).toLocaleString()), 1)) : _("", !0),
646
- n.failedReason ? (i(), p("div", Tt, l(n.failedReason), 1)) : _("", !0)
647
- ]);
648
- }), 128))
649
- ])
650
- ])) : _("", !0)
651
- ])
652
- ]),
653
- _: 1
654
- }, 8, ["modelValue"])
655
- ]);
656
- };
657
- }
658
- }), Ut = { class: "fm-typo-en-heading-lg-600" }, Et = { class: "flex flex-col gap-16" }, Nt = { class: "flex flex-col gap-4" }, Mt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, Kt = { class: "fm-typo-en-body-md-400" }, Ht = { class: "flex flex-col gap-4" }, jt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, zt = { class: "fm-typo-en-body-md-400" }, Wt = { class: "flex flex-col gap-4" }, Yt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, Gt = { class: "flex gap-8 ml-auto" }, Jt = /* @__PURE__ */ se({
659
- __name: "ClosingDetailDialog",
660
- props: {
661
- modelValue: { type: Boolean },
662
- type: {},
663
- data: {}
664
- },
665
- emits: ["update:modelValue"],
666
- setup(ne, { emit: b }) {
667
- const { t: k } = ie(), T = De(), o = ne, L = b, R = D({
668
- get: () => o.modelValue,
669
- set: (s) => L("update:modelValue", s)
670
- }), x = g("");
671
- re(R, (s) => {
672
- s || (x.value = "");
673
- });
674
- const S = D(() => {
675
- var s;
676
- return ((s = o.data) == null ? void 0 : s.skus) ?? [];
677
- }), f = D(() => {
678
- var v;
679
- const s = (v = o.data) == null ? void 0 : v._id;
680
- if (!s) return "-";
681
- const r = P(s);
682
- return new Date(r).toLocaleString();
683
- }), y = D(() => o.type === "closing" ? k("inventory.closing.history.closingDetail", "Closing Detail") : k("inventory.closing.history.snapshotDetail", "Snapshot Detail")), $ = D(() => S.value.map((s) => {
684
- const r = T.skuById[s.id] ?? null, C = !r;
685
- return {
686
- id: s.id,
687
- sku: r,
688
- skuName: (r == null ? void 0 : r.name) ?? s.id,
689
- skuCode: (r == null ? void 0 : r.code) ?? "-",
690
- balance: s.balance ?? { amount: 0, precision: 0 },
691
- isMissing: C,
692
- costs: s.costs,
693
- weightedAverage: s.weightedAverage
694
- };
695
- })), U = [
696
- {
697
- accessorKey: "skuName",
698
- header: () => k("inventory.ingredient.name", "Ingredient Name"),
699
- cell: (s) => {
700
- const r = s.row.original;
701
- return r.isMissing ? ee("div", { class: "flex items-center gap-8" }, [
702
- ee("span", {}, r.id),
703
- ee(
704
- "span",
705
- {
706
- class: "px-8 py-2 rounded-4 bg-fm-color-danger-weak text-fm-color-danger-default fm-typo-en-label-sm-400"
707
- },
708
- "Missing"
709
- )
710
- ]) : s.getValue();
711
- }
712
- },
713
- {
714
- accessorKey: "skuCode",
715
- header: () => k("inventory.ingredient.code", "Code")
716
- },
717
- {
718
- id: "balance",
719
- header: () => k("inventory.closing.history.balance", "Balance"),
720
- cell: (s) => {
721
- var v;
722
- const r = s.row.original;
723
- if (r.isMissing || !((v = r.sku) != null && v.unit))
724
- return `${r.balance.amount / Math.pow(10, r.balance.precision)}`;
725
- const C = {
726
- unit: r.sku.unit,
727
- sku: r.sku,
728
- amount: r.balance,
729
- defaultTrackingMeasurement: r.sku.trackingMeasurement ?? void 0
730
- };
731
- return ee(Ce, C);
732
- },
733
- size: 180
734
- },
735
- {
736
- accessorKey: "weightedAverage",
737
- header: () => k("inventory.closing.history.weightedAvgCost", "Weighted Avg Cost"),
738
- cell: (s) => {
739
- const r = s.getValue();
740
- if (!r) return "-";
741
- const C = r.amount ?? 0, v = r.precision ?? 0, A = r.currency ?? "", B = C / Math.pow(10, v);
742
- return `${A} ${B.toFixed(2)}`;
743
- }
744
- }
745
- ];
746
- return (s, r) => {
747
- const C = w("FmTextField"), v = w("FmTable"), A = w("FmButton"), B = w("FmDialog");
748
- return i(), j(B, {
749
- modelValue: R.value,
750
- "onUpdate:modelValue": r[2] || (r[2] = (I) => R.value = I),
751
- "close-button": "",
752
- dismissAway: "",
753
- "max-width": "900px"
754
- }, {
755
- "dialog-header": F(() => [
756
- a("div", Ut, l(y.value), 1)
757
- ]),
758
- default: F(() => {
759
- var I;
760
- return [
761
- a("div", Et, [
762
- a("div", Nt, [
763
- a("div", Mt, l(o.type === "closing" ? c(k)("inventory.closing.history.closingId") : c(k)("inventory.closing.history.snapshotId", "Snapshot ID")), 1),
764
- a("div", Kt, l(((I = o.data) == null ? void 0 : I._id) ?? "-"), 1)
765
- ]),
766
- a("div", Ht, [
767
- a("div", jt, l(c(k)("inventory.closing.history.date")), 1),
768
- a("div", zt, l(f.value), 1)
769
- ]),
770
- a("div", Wt, [
771
- a("div", Yt, l(c(k)("inventory.closing.history.ingredientBalances", "Ingredient Balances")) + " (" + l(S.value.length) + ") ", 1),
772
- h(C, {
773
- modelValue: x.value,
774
- "onUpdate:modelValue": r[0] || (r[0] = (N) => x.value = N),
775
- placeholder: "Filter by code or name"
776
- }, null, 8, ["modelValue"]),
777
- h(v, {
778
- "row-data": $.value,
779
- "column-defs": U,
780
- pagination: { pageSize: 10 },
781
- "search-value": x.value
782
- }, null, 8, ["row-data", "search-value"])
783
- ])
784
- ])
785
- ];
786
- }),
787
- "dialog-footer": F(() => [
788
- a("div", Gt, [
789
- h(A, {
790
- variant: "tertiary",
791
- onClick: r[1] || (r[1] = (I) => R.value = !1),
792
- label: "Close"
793
- })
794
- ])
795
- ]),
796
- _: 1
797
- }, 8, ["modelValue"]);
798
- };
799
- }
800
- }), Qt = { class: "flex flex-col gap-16 p-16" }, Xt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qt = { class: "flex flex-col gap-16" }, eo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, to = { class: "flex gap-8 ml-auto" }, yo = /* @__PURE__ */ se({
801
- __name: "ClosingHistoryView",
802
- setup(ne) {
803
- var Z, q;
804
- const { t: b } = ie(), k = de(), T = Se(), o = xe(), L = Ve(), R = ue(), x = g("closings"), S = D(() => [
805
- { label: b("inventory.closing.history.closingsTab"), value: "closings" },
806
- { label: b("inventory.closing.history.snapshotsTab"), value: "snapshots" }
807
- ]), f = g([]), y = g(0), $ = g([]), U = g(0);
808
- let s = T.currentLocationDBName;
809
- async function r(d) {
810
- return T.currentLocationDBName ? (s = T.currentLocationDBName, k.listClosingsPage(d)) : { docs: [], nextStartkey: null, hasMore: !1 };
811
- }
812
- async function C(d) {
813
- return T.currentLocationDBName ? (s = T.currentLocationDBName, k.listStockSnapshotsPage(d)) : { docs: [], nextStartkey: null, hasMore: !1 };
814
- }
815
- function v() {
816
- f.value = [], y.value++;
817
- }
818
- function A() {
819
- $.value = [], U.value++;
820
- }
821
- const B = g(!1), I = g("closing"), N = g(null);
822
- function z(d) {
823
- return [
824
- d.getFullYear(),
825
- String(d.getMonth() + 1).padStart(2, "0"),
826
- String(d.getDate()).padStart(2, "0")
827
- ].join("-");
828
- }
829
- const E = () => z(new Date(Date.now() - 864e5)), M = g(E()), J = D(() => {
830
- const d = [];
831
- return x.value === "closings" ? d.push(
832
- {
833
- label: b("inventory.stock.recalculation.title"),
834
- value: "recalculation",
835
- prependIcon: "history",
836
- isAdminOnly: !0
837
- },
838
- {
839
- label: b("inventory.closing.history.initiate_opening"),
840
- value: "initiateOpening",
841
- prependIcon: "add_box",
842
- isAdminOnly: !0
843
- },
844
- {
845
- label: "Refresh",
846
- value: "refreshOpening",
847
- prependIcon: "refresh"
848
- }
849
- ) : d.push(
850
- {
851
- label: `${b("inventory.stock.recalculation.title")} (BETA)`,
852
- value: "recalculation",
853
- prependIcon: "history",
854
- isAdminOnly: !0
855
- },
856
- {
857
- label: `${b("inventory.closing.history.initiate_snapshot")} (BETA)`,
858
- value: "initiateStockSnapshot",
859
- prependIcon: "camera",
860
- isAdminOnly: !0
861
- },
862
- {
863
- label: "Refresh",
864
- value: "refreshStockSnapshot",
865
- prependIcon: "refresh"
866
- }
867
- ), d;
868
- }), Y = g(), Q = g();
869
- function oe(d) {
870
- var t, n;
871
- switch (d) {
872
- case "recalculation":
873
- return x.value === "closings" ? (t = Y.value) == null ? void 0 : t.open() : (n = Q.value) == null ? void 0 : n.open();
874
- case "initiateOpening": {
875
- L.open({
876
- title: "Initiate Opening Balance",
877
- message: "Initiate opening balance if no opening balance exists for the current location.",
878
- primaryActions: { text: "Confirm", close: !0 }
879
- }).onPrimary(async () => {
880
- try {
881
- await k.initiateClosing(), R.open({
882
- message: "Opening balance initiated successfully.",
883
- type: "success"
884
- }), await v();
885
- } catch (H) {
886
- R.open({
887
- message: H.message || "Failed to initiate opening balance. Please try again.",
888
- type: "error"
889
- });
890
- }
891
- });
892
- break;
893
- }
894
- case "initiateStockSnapshot": {
895
- M.value = E(), K.value = !0;
896
- break;
897
- }
898
- case "refreshOpening": {
899
- v();
900
- break;
901
- }
902
- case "refreshStockSnapshot": {
903
- A();
904
- break;
905
- }
906
- }
907
- }
908
- const K = g(!1), W = g(!1), ae = E();
909
- async function u() {
910
- W.value = !0;
911
- try {
912
- await k.initiateStockSnapshot(M.value), R.open({
913
- message: "Stock snapshot created successfully.",
914
- type: "success"
915
- }), K.value = !1, await A();
916
- } catch (d) {
917
- R.open({
918
- message: d.message || "Failed to create stock snapshot. Please try again.",
919
- type: "error"
920
- });
921
- } finally {
922
- W.value = !1;
923
- }
924
- }
925
- const e = [
926
- ...(Z = o.sessionUser.value) != null && Z.role.isAdmin ? [
927
- {
928
- accessorKey: "_id",
929
- header: () => ee(fe, {}, () => `${b("inventory.closing.history.closingId")}`),
930
- cell: (d) => d.getValue()
931
- }
932
- ] : [],
933
- {
934
- accessorKey: "_id",
935
- id: "date",
936
- header: () => b("inventory.closing.history.date"),
937
- cell: (d) => {
938
- const t = d.getValue(), n = P(t);
939
- return new Date(n).toLocaleDateString();
940
- }
941
- },
942
- {
943
- accessorKey: "_id",
944
- id: "time",
945
- header: () => b("inventory.closing.history.time"),
946
- cell: (d) => {
947
- const t = d.getValue(), n = P(t);
948
- return new Date(n).toLocaleTimeString();
949
- }
950
- },
951
- {
952
- accessorKey: "ref",
953
- header: () => b("inventory.closing.history.createdFrom"),
954
- cell: (d) => d.getValue() || "-"
955
- }
956
- ], m = [
957
- ...(q = o.sessionUser.value) != null && q.role.isAdmin ? [
958
- {
959
- accessorKey: "_id",
960
- header: () => ee(
961
- fe,
962
- {},
963
- () => `${b("inventory.closing.history.snapshotId", "Snapshot ID")}`
964
- ),
965
- cell: (d) => d.getValue()
966
- }
967
- ] : [],
968
- {
969
- accessorKey: "_id",
970
- id: "date",
971
- header: () => b("inventory.closing.history.date"),
972
- cell: (d) => {
973
- const t = d.getValue(), n = P(t);
974
- return new Date(n).toLocaleDateString();
975
- }
976
- },
977
- {
978
- accessorKey: "_id",
979
- id: "time",
980
- header: () => b("inventory.closing.history.time"),
981
- cell: (d) => {
982
- const t = d.getValue(), n = P(t);
983
- return new Date(n).toLocaleTimeString();
984
- }
985
- },
986
- {
987
- accessorKey: "remark",
988
- header: () => b("inventory.closing.history.createdFrom"),
989
- cell: (d) => d.getValue() || "-"
990
- }
991
- ];
992
- async function O(d, t) {
993
- const n = await k.getClosingById(d, t);
994
- if (!n) throw new Error(`Closing ${d} not found`);
995
- return I.value = "closing", N.value = n, B.value = !0, n;
996
- }
997
- async function X(d, t) {
998
- const n = await k.getStockSnapshotById(d, t);
999
- if (!n) throw new Error(`Stock snapshot ${d} not found`);
1000
- return I.value = "snapshot", N.value = n, B.value = !0, n;
1001
- }
1002
- return T.watchLocation(async () => {
1003
- (T.currentLocationDBName || void 0) !== s && (v(), A());
1004
- }), (d, t) => {
1005
- const n = w("FmTabs"), H = w("FmDatePicker"), me = w("FmButton"), _e = w("FmDialog");
1006
- return i(), j(ke, {
1007
- actions: J.value,
1008
- title: c(b)("inventory.closing.history.title"),
1009
- "onClick:action": oe
1010
- }, {
1011
- default: F(() => [
1012
- a("div", Qt, [
1013
- h(we, {
1014
- "change-location": "",
1015
- "hide-filter-options": !0
1016
- }),
1017
- h(n, {
1018
- "model-value": x.value,
1019
- "onUpdate:modelValue": t[0] || (t[0] = (V) => x.value = V),
1020
- items: S.value
1021
- }, null, 8, ["model-value", "items"]),
1022
- x.value === "closings" ? (i(), p(G, { key: 0 }, [
1023
- a("div", Xt, l(c(b)("inventory.closing.history.closingsDescription")), 1),
1024
- h(ye, {
1025
- rows: f.value,
1026
- "onUpdate:rows": t[1] || (t[1] = (V) => f.value = V),
1027
- "fetch-page": r,
1028
- "refresh-key": y.value,
1029
- "column-defs": e,
1030
- "fetch-detail": (V, ce) => O(V._id, ce)
1031
- }, null, 8, ["rows", "refresh-key", "fetch-detail"])
1032
- ], 64)) : _("", !0),
1033
- x.value === "snapshots" ? (i(), p(G, { key: 1 }, [
1034
- a("div", Zt, l(c(b)("inventory.closing.history.snapshotsDescription")), 1),
1035
- h(ye, {
1036
- rows: $.value,
1037
- "onUpdate:rows": t[2] || (t[2] = (V) => $.value = V),
1038
- "fetch-page": C,
1039
- "refresh-key": U.value,
1040
- "column-defs": m,
1041
- "fetch-detail": (V, ce) => X(V._id, ce)
1042
- }, null, 8, ["rows", "refresh-key", "fetch-detail"])
1043
- ], 64)) : _("", !0)
1044
- ]),
1045
- (i(), j(be, { to: "body" }, [
1046
- h(lt, {
1047
- "show-button": !1,
1048
- ref_key: "recalculationDialogRef",
1049
- ref: Y,
1050
- onSubmitted: t[3] || (t[3] = (V) => v())
1051
- }, null, 512),
1052
- h(Pt, {
1053
- "show-button": !1,
1054
- ref_key: "snapshotRecalculationDialogRef",
1055
- ref: Q,
1056
- onSubmitted: t[4] || (t[4] = (V) => A())
1057
- }, null, 512),
1058
- h(Jt, {
1059
- modelValue: B.value,
1060
- "onUpdate:modelValue": t[5] || (t[5] = (V) => B.value = V),
1061
- type: I.value,
1062
- data: N.value
1063
- }, null, 8, ["modelValue", "type", "data"]),
1064
- h(_e, {
1065
- modelValue: K.value,
1066
- "onUpdate:modelValue": t[8] || (t[8] = (V) => K.value = V),
1067
- "close-button": "",
1068
- dismissAway: "",
1069
- "max-width": "400px"
1070
- }, {
1071
- "dialog-header": F(() => t[9] || (t[9] = [
1072
- a("div", { class: "fm-typo-en-heading-lg-600" }, "Initiate Stock Snapshot", -1)
1073
- ])),
1074
- default: F(() => [
1075
- a("div", qt, [
1076
- a("div", eo, l(c(b)("inventory.closing.history.snapshotsDescription")), 1),
1077
- h(H, {
1078
- modelValue: M.value,
1079
- "onUpdate:modelValue": t[6] || (t[6] = (V) => M.value = V),
1080
- label: "Snapshot Date",
1081
- max: c(ae)
1082
- }, null, 8, ["modelValue", "max"])
1083
- ])
1084
- ]),
1085
- "dialog-footer": F(() => [
1086
- a("div", to, [
1087
- h(me, {
1088
- variant: "tertiary",
1089
- onClick: t[7] || (t[7] = (V) => K.value = !1),
1090
- label: "Cancel",
1091
- disabled: W.value
1092
- }, null, 8, ["disabled"]),
1093
- h(me, {
1094
- variant: "primary",
1095
- onClick: u,
1096
- label: "Confirm",
1097
- loading: W.value
1098
- }, null, 8, ["loading"])
1099
- ])
1100
- ]),
1101
- _: 1
1102
- }, 8, ["modelValue"])
1103
- ]))
1104
- ]),
1105
- _: 1
1106
- }, 8, ["actions", "title"]);
1107
- };
1108
- }
1109
- });
1110
- export {
1111
- yo as default
1112
- };