@feedmepos/mf-inventory-portal 1.7.13-dev.3 → 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 (274) hide show
  1. package/dist/{App-OcI38sEw.js → App-JqoqVVdP.js} +471 -460
  2. package/dist/{ApprovalView-qTRrEvTp.js → ApprovalView-JiWbXkVU.js} +9 -9
  3. package/dist/{BindingsDialog-G8tFbm7v.js → BindingsDialog-BK4xofWu.js} +2 -2
  4. package/dist/{BindingsPicker-DB3mjjVh.js → BindingsPicker-CLMsAseG.js} +2 -2
  5. package/dist/{BindingsTable-DLf8XLyn.js → BindingsTable-DKrBQTxN.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-2AWitWXo.js → BulkReceiveRequestView-bttHw2ub.js} +19 -19
  7. package/dist/{ClosingDraftView-c25_GCaw.js → ClosingDraftView-Bhdwo-n8.js} +19 -19
  8. package/dist/ClosingHistoryView-DrQPWnr6.js +761 -0
  9. package/dist/{ClosingTemplateView-BzaVZ1Mf.js → ClosingTemplateView-UkwXCrz_.js} +16 -16
  10. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Dlh4ThV0.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DNtMdFVF.js} +1 -1
  11. package/dist/{DefaultView-e9RSHejw.js → DefaultView-sGrYeUGh.js} +2 -2
  12. package/dist/{DeliveryOrderPrintPreview-BSbiO2Vd.js → DeliveryOrderPrintPreview-CVnqC9Jy.js} +10 -10
  13. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-D_8msVau.js → EmailDialog.vue_vue_type_script_setup_true_lang-CYtHQ2Ru.js} +2250 -2250
  14. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DUjcebMR.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DXTdvT0C.js} +1 -1
  15. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BA6stZHF.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-DEg8KNwS.js → FmMultiselectDialog-A9VIMLGn.js} +1 -1
  18. package/dist/{FmMultiselectDialog-DsA4X91e.js → FmMultiselectDialog-DL00XnUc.js} +2 -2
  19. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CPlywwpg.js → FmUnitInput.vue_vue_type_script_setup_true_lang-RJKOB-cm.js} +66 -63
  20. package/dist/{ImportView-D9QCHpOd.js → ImportView-DPrLnJO8.js} +6 -6
  21. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-C7iOvnZV.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-IAQyFPmi.js} +1 -1
  22. package/dist/{IngredientGroupView-BRH304Pf.js → IngredientGroupView-DyhC6lJ8.js} +5 -5
  23. package/dist/{IngredientsView-BUGYJ6cN.js → IngredientsView-P4AqPikD.js} +15 -15
  24. package/dist/{IntegrationExplorerView-Z3_x4C5I.js → IntegrationExplorerView-CujhjHHV.js} +4 -4
  25. package/dist/{IntegrationView-ClWTgLai.js → IntegrationView-CFqsZyzI.js} +3077 -2998
  26. package/dist/{InventoryBindingForm-B7tGISLQ.js → InventoryBindingForm-B0NJ8H51.js} +1 -1
  27. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DOWePtXq.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-bbIpFo_4.js} +5 -5
  28. package/dist/{InventoryBindingSummary-j3YGRPOt.js → InventoryBindingSummary-CBgO_tCz.js} +1 -1
  29. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CPpO-iyC.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DuuXzyKH.js} +1 -1
  30. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BP8f4hlw.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-CL747KZU.js → PublishView-Cf0Tn7xt.js} +3 -3
  36. package/dist/{PurchaseOrderPrintPreview-C5AB03ht.js → PurchaseOrderPrintPreview-BTlSyQqZ.js} +6 -6
  37. package/dist/{ReceiveRequestView-BDy40tBg.js → ReceiveRequestView-9LFOl2hJ.js} +14 -14
  38. package/dist/{RecipeView-BbBZGBPb.js → RecipeView-C4KxMCpQ.js} +17 -17
  39. package/dist/{SettingsView-rcalnrlB.js → SettingsView-ShrefnTM.js} +4 -4
  40. package/dist/{StockView-BSLGMo1e.js → StockView-BVd6f7Fr.js} +21 -21
  41. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DeEq2HQe.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B-rB7p9o.js} +1 -1
  42. package/dist/{SupplierView-DOq8oosU.js → SupplierView-DZSY6_eU.js} +12 -12
  43. package/dist/{SurchargeView-BK9Yakao.js → SurchargeView-UUYoT8MK.js} +6 -6
  44. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DQRfvdyo.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BLMxzi1C.js} +2 -2
  45. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CjfzWy2p.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-z3qIVKP7.js} +1 -1
  46. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-6qKRU6v7.js → TransferDetails.vue_vue_type_script_setup_true_lang-DEO8CP-X.js} +20 -20
  47. package/dist/{TransferTemplateView-BmWxWDe8.js → TransferTemplateView-C21o2V_1.js} +20 -20
  48. package/dist/{UnitCostHistoryView-BCvCf-2e.js → UnitCostHistoryView-DPEGVLBP.js} +4 -4
  49. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DJu3u-cT.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BuGmmHBk.js} +4 -4
  50. package/dist/{UnitView-CW8GRw2n.js → UnitView-Bx03E4uc.js} +7 -7
  51. package/dist/{WarehouseView-ZWuCwzuM.js → WarehouseView-BehHQ9Ao.js} +6 -6
  52. package/dist/{WastageTemplateView-DkwVp2Bc.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-BJsy0dhl.js → app-BT7hD4az.js} +16523 -12629
  59. package/dist/app.d.ts +3047 -71
  60. package/dist/app.js +1 -1
  61. package/dist/{closing-template-DdxIx-dq.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/cypress/component/ChangelogPanel.cy.d.ts +1 -0
  68. package/dist/cypress/support/component.d.ts +1 -2
  69. package/dist/{date2-BySoG7zL.js → date2-CAh7rsAp.js} +1 -1
  70. package/dist/{dayjs.min-CEK_HLa5.js → dayjs.min-BJk-edO7.js} +7 -7
  71. package/dist/{decimal-CxH3h_oz.js → decimal-DYlKNkVX.js} +2 -2
  72. package/dist/{defineDeepModel-BiNh3hbS.js → defineDeepModel-BPHl7mTD.js} +1 -1
  73. package/dist/{duplicate-template-BqTirEVQ.js → duplicate-template-BWUUIdzG.js} +1 -1
  74. package/dist/{feature-CtiarMKO.js → feature-CSvVyBN2.js} +2 -2
  75. package/dist/{format-time-from-id-BZlQSqcg.js → format-time-from-id-Dh3lxXpc.js} +1 -1
  76. package/dist/{format-unit-display-Ckyw7NDq.js → format-unit-display-B1ft2wxm.js} +12 -12
  77. package/dist/{import-export.helper-93ZgMgfA.js → import-export.helper-txDvkMf0.js} +6 -6
  78. package/dist/{index-6U0mJTRK.js → index-AmTodx3_.js} +1 -1
  79. package/dist/{index-OMz6kBpd.js → index-B4wQijn6.js} +1 -1
  80. package/dist/{index-BDmWjw_1.js → index-TIX5DyQk.js} +3 -3
  81. package/dist/inventory-core-dart.default-BpMxAF-0.js +31060 -0
  82. package/dist/{lz-string-BgsMxnd4.js → lz-string-CFDYH-K6.js} +1 -1
  83. package/dist/{netsuite-DFRzj2t1.js → netsuite-CdW9v92G.js} +477 -462
  84. package/dist/{number-D-_PL2pH.js → number-DRRlTYv7.js} +6 -6
  85. package/dist/{predefined-templates-Ccsy5pq1.js → predefined-templates-C68U85pc.js} +1 -1
  86. package/dist/production-run-display-DmyfdjHR.js +239 -0
  87. package/dist/production-run-prepare-sheet-BvxMd19E.js +189 -0
  88. package/dist/{purchase-order-template-DhWqGEYn.js → purchase-order-template-BvED3CpO.js} +1 -1
  89. package/dist/{recalculationUtils-DBZx8AEF.js → recalculationUtils-9rFepwwr.js} +1 -1
  90. package/dist/router/name.d.ts +2 -0
  91. package/dist/{rules-14YnQFVP.js → rules-C8RmopTe.js} +2 -2
  92. package/dist/{stock-CqPXExNE.js → stock-BKkluaaM.js} +26 -36
  93. package/dist/{stock-NwBpU2GU.js → stock-CiCsT5JK.js} +3 -3
  94. package/dist/stores/integration/codemax.d.ts +1 -1
  95. package/dist/stores/integration/netsuite.d.ts +54 -0
  96. package/dist/style.css +1 -1
  97. package/dist/{supplier-BGh3ELiI.js → supplier--zZMQHPc.js} +2 -2
  98. package/dist/{surcharge-B2A5F8CG.js → surcharge-BLF3XV0G.js} +1 -1
  99. package/dist/tsconfig.app.tsbuildinfo +1 -1
  100. package/dist/{uom-rules-B9vLSzRQ.js → uom-rules-CjCCXiGL.js} +1 -1
  101. package/dist/{use-ingredient-select-dialog-vwF7iReq.js → use-ingredient-select-dialog-DnUiY-Ic.js} +2 -2
  102. package/dist/{use-inventory-binding-dialog-DBp_gbnj.js → use-inventory-binding-dialog-BAU-P8kV.js} +2 -2
  103. package/dist/{use-template-enabled-locations-DSvlNPYu.js → use-template-enabled-locations-DZMzYCi-.js} +2 -2
  104. package/dist/{use-transfer-locations-OMxT9ofA.js → use-transfer-locations-DomGLsT2.js} +2 -2
  105. package/dist/{useHrmPermission-BbjcDYMn.js → useHrmPermission-CrhsV_5z.js} +1 -1
  106. package/dist/{useNavigationMenu-CJw7QuVt.js → useNavigationMenu-1h-G_-el.js} +2 -2
  107. package/dist/{useSseClient-CT69SXDP.js → useSseClient-o_3wiqhX.js} +1 -1
  108. package/dist/views/changelog/components/ChangelogFloatingButton.spec.d.ts +1 -0
  109. package/dist/views/changelog/composables/fab-position.d.ts +21 -0
  110. package/dist/views/changelog/composables/use-inventory-record-commits.d.ts +1 -1
  111. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  112. package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +2 -2
  113. package/dist/views/integration/components/CodemaxDialog.vue.d.ts +2 -2
  114. package/dist/views/integration/components/netsuite/business/vendor-publish.d.ts +7 -0
  115. package/dist/views/integration/components/netsuite/business/vendor-publish.spec.d.ts +1 -0
  116. package/dist/views/production-run/ProductionRunDetailView.spec.d.ts +1 -0
  117. package/dist/views/production-run/ProductionRunDetailView.vue.d.ts +15 -0
  118. package/dist/views/production-run/ProductionRunPreparePrintView.spec.d.ts +1 -0
  119. package/dist/views/production-run/ProductionRunPreparePrintView.vue.d.ts +2 -0
  120. package/dist/views/production-run/ProductionRunView.spec.d.ts +1 -0
  121. package/dist/views/production-run/ProductionRunView.vue.d.ts +2 -0
  122. package/dist/views/production-run/components/CancelRunDialog.spec.d.ts +1 -0
  123. package/dist/views/production-run/components/CancelRunDialog.vue.d.ts +918 -0
  124. package/dist/views/production-run/components/CancelRunDialogProps.d.ts +9 -0
  125. package/dist/views/production-run/components/CloseRunDialog.spec.d.ts +1 -0
  126. package/dist/views/production-run/components/CloseRunDialog.vue.d.ts +918 -0
  127. package/dist/views/production-run/components/CloseRunDialogProps.d.ts +29 -0
  128. package/dist/views/production-run/components/PrepareRunConfirmationDialog.spec.d.ts +1 -0
  129. package/dist/views/production-run/components/PrepareRunConfirmationDialog.vue.d.ts +29 -0
  130. package/dist/views/production-run/components/PrepareRunDialog.spec.d.ts +1 -0
  131. package/dist/views/production-run/components/PrepareRunDialog.vue.d.ts +18 -0
  132. package/dist/views/production-run/components/PrepareRunDialogProps.d.ts +29 -0
  133. package/dist/views/production-run/components/PrepareSheetDialog.spec.d.ts +1 -0
  134. package/dist/views/production-run/components/PrepareSheetDialog.vue.d.ts +26 -0
  135. package/dist/views/{stock/components/dialog/SnapshotRecalculationDialog.vue.d.ts → production-run/components/ProductionRunActionMenuItem.vue.d.ts} +7 -10
  136. package/dist/views/production-run/components/ProductionRunActionsCell.spec.d.ts +1 -0
  137. package/dist/views/production-run/components/ProductionRunActionsCell.vue.d.ts +20 -0
  138. package/dist/views/production-run/components/ProductionRunActivityTab.spec.d.ts +1 -0
  139. package/dist/views/production-run/components/ProductionRunActivityTab.vue.d.ts +15 -0
  140. package/dist/views/production-run/components/ProductionRunBanner.spec.d.ts +1 -0
  141. package/dist/views/production-run/components/ProductionRunBanner.vue.d.ts +42 -0
  142. package/dist/views/production-run/components/ProductionRunBatchCard.spec.d.ts +1 -0
  143. package/dist/views/production-run/components/ProductionRunBatchCard.vue.d.ts +69 -0
  144. package/dist/views/production-run/components/ProductionRunBatchWastageDetails.spec.d.ts +1 -0
  145. package/dist/views/production-run/components/ProductionRunBatchWastageDetails.vue.d.ts +33 -0
  146. package/dist/views/production-run/components/ProductionRunBindingsDisclosure.spec.d.ts +1 -0
  147. package/dist/views/production-run/components/ProductionRunBindingsDisclosure.vue.d.ts +25 -0
  148. package/dist/views/production-run/components/ProductionRunBindingsList.vue.d.ts +51 -0
  149. package/dist/views/production-run/components/ProductionRunCompactDisclosure.vue.d.ts +25 -0
  150. package/dist/views/production-run/components/ProductionRunContributorBranch.spec.d.ts +1 -0
  151. package/dist/views/production-run/components/ProductionRunContributorBranch.vue.d.ts +25 -0
  152. package/dist/views/production-run/components/ProductionRunCostRail.spec.d.ts +1 -0
  153. package/dist/views/production-run/components/ProductionRunCostRail.vue.d.ts +77 -0
  154. package/dist/views/production-run/components/ProductionRunDialog.spec.d.ts +1 -0
  155. package/dist/views/production-run/components/ProductionRunDialog.vue.d.ts +24 -0
  156. package/dist/views/production-run/components/ProductionRunDialogProps.d.ts +15 -0
  157. package/dist/views/production-run/components/ProductionRunDialogSurface.vue.d.ts +33 -0
  158. package/dist/views/production-run/components/ProductionRunDiscardDialog.spec.d.ts +1 -0
  159. package/dist/views/production-run/components/ProductionRunDiscardDialog.vue.d.ts +21 -0
  160. package/dist/views/production-run/components/ProductionRunDuplicateDialog.spec.d.ts +1 -0
  161. package/dist/views/production-run/components/ProductionRunDuplicateDialog.vue.d.ts +51 -0
  162. package/dist/views/production-run/components/ProductionRunFormDialog.spec.d.ts +1 -0
  163. package/dist/views/production-run/components/ProductionRunFormDialog.vue.d.ts +918 -0
  164. package/dist/views/production-run/components/ProductionRunFormDialogProps.d.ts +22 -0
  165. package/dist/views/production-run/components/ProductionRunHeader.spec.d.ts +1 -0
  166. package/dist/views/production-run/components/ProductionRunHeader.vue.d.ts +65 -0
  167. package/dist/views/production-run/components/ProductionRunHelpPopover.spec.d.ts +1 -0
  168. package/dist/views/production-run/components/ProductionRunHelpPopover.vue.d.ts +52 -0
  169. package/dist/views/production-run/components/ProductionRunIngredientTree.spec.d.ts +1 -0
  170. package/dist/views/production-run/components/ProductionRunIngredientTree.vue.d.ts +42 -0
  171. package/dist/views/production-run/components/ProductionRunIngredientsTab.spec.d.ts +1 -0
  172. package/dist/views/production-run/components/ProductionRunIngredientsTab.vue.d.ts +63 -0
  173. package/dist/views/production-run/components/ProductionRunInstructionsCard.spec.d.ts +1 -0
  174. package/dist/views/production-run/components/ProductionRunInstructionsCard.vue.d.ts +15 -0
  175. package/dist/views/production-run/components/ProductionRunItemPickerDialog.spec.d.ts +1 -0
  176. package/dist/views/production-run/components/ProductionRunItemPickerDialog.vue.d.ts +30 -0
  177. package/dist/views/production-run/components/ProductionRunItemsCell.spec.d.ts +1 -0
  178. package/dist/views/production-run/components/ProductionRunItemsCell.vue.d.ts +33 -0
  179. package/dist/views/production-run/components/ProductionRunItemsTable.spec.d.ts +1 -0
  180. package/dist/views/production-run/components/ProductionRunItemsTable.vue.d.ts +73 -0
  181. package/dist/views/production-run/components/ProductionRunLoadBannerContract.spec.d.ts +1 -0
  182. package/dist/views/production-run/components/ProductionRunNoBindingsHelp.spec.d.ts +1 -0
  183. package/dist/views/production-run/components/ProductionRunNoBindingsHelp.vue.d.ts +15 -0
  184. package/dist/views/production-run/components/ProductionRunOutputTab.spec.d.ts +1 -0
  185. package/dist/views/production-run/components/ProductionRunOutputTab.vue.d.ts +26 -0
  186. package/dist/views/production-run/components/ProductionRunOverviewTab.spec.d.ts +1 -0
  187. package/dist/views/production-run/components/ProductionRunOverviewTab.vue.d.ts +999 -0
  188. package/dist/views/production-run/components/ProductionRunPlanCard.spec.d.ts +1 -0
  189. package/dist/views/production-run/components/ProductionRunPlanCard.vue.d.ts +50 -0
  190. package/dist/views/production-run/components/ProductionRunPlanner.spec.d.ts +1 -0
  191. package/dist/views/production-run/components/ProductionRunPlanner.vue.d.ts +61 -0
  192. package/dist/views/production-run/components/ProductionRunPrepareSheet.vue.d.ts +16 -0
  193. package/dist/views/production-run/components/ProductionRunProjectionFeedback.spec.d.ts +1 -0
  194. package/dist/views/production-run/components/ProductionRunProjectionFeedback.vue.d.ts +41 -0
  195. package/dist/views/production-run/components/ProductionRunRecordOutputDetails.spec.d.ts +1 -0
  196. package/dist/views/production-run/components/ProductionRunRecordOutputDetails.vue.d.ts +43 -0
  197. package/dist/views/production-run/components/ProductionRunRecordOutputWastageStatus.spec.d.ts +1 -0
  198. package/dist/views/production-run/components/ProductionRunRecordOutputWastageStatus.vue.d.ts +31 -0
  199. package/dist/views/production-run/components/ProductionRunRequestedOverview.spec.d.ts +1 -0
  200. package/dist/views/production-run/components/ProductionRunRequestedOverview.vue.d.ts +48 -0
  201. package/dist/views/production-run/components/ProductionRunResultTable.spec.d.ts +1 -0
  202. package/dist/views/production-run/components/ProductionRunResultTable.vue.d.ts +31 -0
  203. package/dist/views/production-run/components/ProductionRunScrollHint.spec.d.ts +1 -0
  204. package/dist/views/production-run/components/ProductionRunScrollHint.vue.d.ts +31 -0
  205. package/dist/views/production-run/components/ProductionRunSelectionCheckbox.vue.d.ts +31 -0
  206. package/dist/views/production-run/components/ProductionRunSelectionControls.spec.d.ts +1 -0
  207. package/dist/views/production-run/components/ProductionRunSelectionRadio.spec.d.ts +1 -0
  208. package/dist/views/production-run/components/ProductionRunSelectionRadio.vue.d.ts +37 -0
  209. package/dist/views/production-run/components/ProductionRunSideSheet.spec.d.ts +1 -0
  210. package/dist/views/production-run/components/ProductionRunSideSheet.vue.d.ts +77 -0
  211. package/dist/views/production-run/components/ProductionRunSideSheetSurface.vue.d.ts +52 -0
  212. package/dist/views/production-run/components/ProductionRunSortHeader.spec.d.ts +1 -0
  213. package/dist/views/production-run/components/ProductionRunSortHeader.vue.d.ts +25 -0
  214. package/dist/views/production-run/components/ProductionRunStatusBadge.vue.d.ts +15 -0
  215. package/dist/views/production-run/components/ProductionRunTabs.spec.d.ts +1 -0
  216. package/dist/views/production-run/components/ProductionRunTabs.vue.d.ts +47 -0
  217. package/dist/views/production-run/components/ProductionRunTerminalNotice.spec.d.ts +1 -0
  218. package/dist/views/production-run/components/ProductionRunTerminalNotice.vue.d.ts +15 -0
  219. package/dist/views/production-run/components/ProductionRunTextarea.spec.d.ts +1 -0
  220. package/dist/views/production-run/components/ProductionRunTextarea.vue.d.ts +53 -0
  221. package/dist/views/production-run/components/ProductionRunUnitInput.spec.d.ts +1 -0
  222. package/dist/views/production-run/components/ProductionRunUnitInput.vue.d.ts +34 -0
  223. package/dist/views/production-run/components/ProductionRunWastageDisclosure.spec.d.ts +1 -0
  224. package/dist/views/production-run/components/ProductionRunWastageDisclosure.vue.d.ts +23 -0
  225. package/dist/views/production-run/components/RecordOutputDialog.spec.d.ts +1 -0
  226. package/dist/views/production-run/components/RecordOutputDialog.vue.d.ts +20 -0
  227. package/dist/views/production-run/components/RecordOutputDialogProps.d.ts +28 -0
  228. package/dist/views/production-run/components/TargetReachedDialog.spec.d.ts +1 -0
  229. package/dist/views/production-run/components/TargetReachedDialog.vue.d.ts +927 -0
  230. package/dist/views/production-run/components/production-run-deduction-parity.spec.d.ts +1 -0
  231. package/dist/views/production-run/components/production-run-prepare-sheet.d.ts +17 -0
  232. package/dist/views/production-run/components/production-run-typography-contract.spec.d.ts +1 -0
  233. package/dist/views/production-run/components/production-run-unit-snapshot.d.ts +39 -0
  234. package/dist/views/production-run/composables/production-run-display.d.ts +272 -0
  235. package/dist/views/production-run/composables/production-run-display.spec.d.ts +1 -0
  236. package/dist/views/production-run/composables/production-run-list.d.ts +46 -0
  237. package/dist/views/production-run/composables/production-run-list.spec.d.ts +1 -0
  238. package/dist/views/production-run/composables/production-run-request-confirmation.d.ts +20 -0
  239. package/dist/views/production-run/composables/use-production-run-actions.d.ts +37 -0
  240. package/dist/views/production-run/composables/use-production-run-actions.spec.d.ts +1 -0
  241. package/dist/views/production-run/composables/use-production-run-cost.d.ts +672 -0
  242. package/dist/views/production-run/composables/use-production-run-cost.spec.d.ts +1 -0
  243. package/dist/views/production-run/composables/use-production-run-detail.d.ts +1894 -0
  244. package/dist/views/production-run/composables/use-production-run-detail.spec.d.ts +1 -0
  245. package/dist/views/production-run/composables/use-production-run-disclosure.d.ts +15 -0
  246. package/dist/views/production-run/composables/use-production-run-disclosure.spec.d.ts +1 -0
  247. package/dist/views/production-run/composables/use-production-run-duplicate-sources.d.ts +19 -0
  248. package/dist/views/production-run/composables/use-production-run-duplicate-sources.spec.d.ts +1 -0
  249. package/dist/views/production-run/composables/use-production-run-economics.d.ts +92 -0
  250. package/dist/views/production-run/composables/use-production-run-economics.spec.d.ts +1 -0
  251. package/dist/views/production-run/composables/use-production-run-form.d.ts +277 -0
  252. package/dist/views/production-run/composables/use-production-run-form.spec.d.ts +1 -0
  253. package/dist/views/production-run/composables/use-production-run-record-output.d.ts +261 -0
  254. package/dist/views/production-run/composables/use-production-run-record-output.spec.d.ts +1 -0
  255. package/dist/views/production-run/composables/use-production-run-scroll-hint.d.ts +9 -0
  256. package/dist/views/production-run/composables/use-production-run-table.d.ts +19 -0
  257. package/dist/views/production-run/composables/use-production-run-table.spec.d.ts +1 -0
  258. package/dist/views/production-run/helpers/production-run-precision.helper.d.ts +31 -0
  259. package/dist/views/production-run/helpers/production-run-quantity.helper.d.ts +55 -0
  260. package/dist/views/production-run/helpers/production-run-quantity.helper.spec.d.ts +1 -0
  261. package/dist/views/production-run/production-run.fixture.d.ts +70 -0
  262. package/dist/views/production-run/production-run.fixture.spec.d.ts +1 -0
  263. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -3
  264. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +3 -3
  265. package/dist/views/stock/components/dialog/RecalculationDialog.vue.d.ts +2 -17
  266. package/dist/{vue-i18n--DyBLMYh.js → vue-i18n-hE8n67Ig.js} +358 -358
  267. package/dist/{xlsx.util-BthUZo9U.js → xlsx.util-Jv7EpwFc.js} +2 -2
  268. package/package.json +5 -5
  269. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DpqPCG-m.js +0 -126
  270. package/dist/ClosingHistoryView-Cy2yMiEc.js +0 -1112
  271. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C28nZw_t.js +0 -120
  272. package/dist/ProductionView-DGB2sdwD.js +0 -1441
  273. package/dist/inventory-core-dart.default-BmR8gM8k.js +0 -25155
  274. package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +0 -9
@@ -0,0 +1,761 @@
1
+ import { defineComponent as se, ref as p, computed as D, watch as ue, resolveComponent as x, createElementBlock as y, openBlock as u, createVNode as _, withCtx as $, createElementVNode as a, createCommentVNode as w, toDisplayString as r, unref as d, Fragment as j, createBlock as G, createTextVNode as ae, renderList as re, normalizeClass as fe, h as W, Teleport as ge } from "vue";
2
+ import { _ as ve } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
+ import { useI18n as le, useCoreStore as he } from "@feedmepos/mf-common";
4
+ import { G as me, B as N, a as _e, u as be } from "./app-BT7hD4az.js";
5
+ import { F as ce } from "./FmAdminBadge-DlplQOHb.js";
6
+ import { _ as ke } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-yBIbCJYy.js";
7
+ import { _ as de } from "./CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js";
8
+ import { useSnackbar as pe, useDialog as De } from "@feedmepos/ui-library";
9
+ import { u as xe } from "./stock-BKkluaaM.js";
10
+ import { g as Se, f as we } from "./recalculationUtils-9rFepwwr.js";
11
+ import { _ as Ve } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-BuGmmHBk.js";
12
+ const Ce = { class: "fm-typo-en-heading-lg-600" }, Fe = { class: "flex flex-col gap-16" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = { class: "flex flex-col gap-8" }, $e = { class: "fm-typo-en-body-md-600" }, Be = { class: "flex flex-col gap-8" }, Te = { class: "fm-typo-en-body-md-600" }, Le = {
13
+ key: 0,
14
+ class: "text-red-500 text-sm mt-2"
15
+ }, Re = { class: "fm-typo-en-body-sm-400" }, Ne = {
16
+ key: 1,
17
+ class: "p-12 border border-fm-color-border-primary rounded-8 bg-fm-color-background-secondary"
18
+ }, Oe = {
19
+ key: 0,
20
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
21
+ }, Pe = {
22
+ key: 1,
23
+ class: "flex flex-col gap-8"
24
+ }, Me = { class: "fm-typo-en-body-sm-600" }, Ke = { class: "flex flex-col gap-4" }, Ue = { key: 0 }, Ee = { key: 1 }, He = { key: 2 }, We = {
25
+ key: 1,
26
+ class: "flex flex-col gap-8"
27
+ }, ze = { class: "fm-typo-en-body-md-600" }, je = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Ge = { class: "flex items-center justify-between" }, Ye = { class: "fm-typo-en-body-sm-600" }, Je = { class: "flex items-center gap-8" }, Qe = {
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
+ }, Xe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ze = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qe = {
31
+ key: 0,
32
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
33
+ }, et = {
34
+ key: 1,
35
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
36
+ }, tt = {
37
+ key: 2,
38
+ class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
39
+ }, ot = {
40
+ key: 0,
41
+ class: "flex gap-8 ml-auto"
42
+ }, nt = {
43
+ key: 1,
44
+ class: "flex gap-8 ml-auto"
45
+ }, at = 15 * 60 * 1e3, st = /* @__PURE__ */ se({
46
+ __name: "RecalculationDialog",
47
+ emits: ["submitted"],
48
+ setup(Z, { expose: f, emit: h }) {
49
+ const A = h, { t: i } = le(), T = xe(), V = me(), k = pe(), I = p(!1), g = p(""), v = p(""), L = p([]), O = p([]), s = p(!1), n = p([]), S = p(!1), m = p([]), C = p(!1), B = D(
50
+ () => Se(L.value, O.value)
51
+ ), F = D(() => we(
52
+ m.value.filter((t) => !!t.closingId).map((t) => ({ closingId: t.closingId, draftCreatedAt: new Date(N(t._id)) }))
53
+ )), P = D(() => {
54
+ if (g.value)
55
+ try {
56
+ const t = N(g.value);
57
+ if (t)
58
+ return t;
59
+ } catch (t) {
60
+ console.error("Error parsing date from opening ID:", t);
61
+ }
62
+ }), M = D(() => {
63
+ if (!g.value || !v.value) return "";
64
+ const t = N(g.value);
65
+ if (t && v.value) {
66
+ const c = new Date(t).getTime();
67
+ if (new Date(v.value).getTime() <= c)
68
+ return i("inventory.stock.recalculation.error.endDateBeforeOpening");
69
+ }
70
+ return "";
71
+ }), z = D(() => {
72
+ if (!v.value) return !1;
73
+ const t = new Date(v.value), c = /* @__PURE__ */ new Date();
74
+ return c.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), t >= c;
75
+ }), K = D(() => !!g.value && !!v.value && !M.value), Y = D(() => n.value.some(
76
+ (t) => !t.completedAt && !t.failedReason && Date.now() - new Date(t.createdAt).getTime() < at
77
+ ));
78
+ async function J() {
79
+ I.value = !0, await Promise.all([q(), U(), E()]), g.value = "", v.value = "";
80
+ }
81
+ f({
82
+ open: J
83
+ });
84
+ async function q() {
85
+ s.value = !0;
86
+ try {
87
+ const t = await V.getLastNClosings(30);
88
+ L.value = t;
89
+ } catch (t) {
90
+ console.error("Error fetching recent closings:", t), k.open({
91
+ title: i("common.error"),
92
+ message: "Failed to fetch recent closings",
93
+ type: "error"
94
+ });
95
+ } finally {
96
+ s.value = !1;
97
+ }
98
+ }
99
+ async function U() {
100
+ try {
101
+ const t = await V.getLastNStockSnapshots(30);
102
+ O.value = t;
103
+ } catch (t) {
104
+ console.error("Error fetching recent snapshots:", t);
105
+ }
106
+ }
107
+ async function E() {
108
+ S.value = !0;
109
+ try {
110
+ const t = await T.recalculation.recalculationRequests();
111
+ n.value = t;
112
+ } catch (t) {
113
+ console.error("Error fetching recalculation requests:", t);
114
+ } finally {
115
+ S.value = !1;
116
+ }
117
+ }
118
+ async function ee() {
119
+ if (!g.value || !v.value) {
120
+ m.value = [];
121
+ return;
122
+ }
123
+ C.value = !0;
124
+ try {
125
+ const t = new Date(v.value);
126
+ t.setHours(23, 59, 59, 999);
127
+ const c = await T.recalculation.getAffectedClosingDrafts(
128
+ g.value,
129
+ t.toISOString()
130
+ );
131
+ m.value = c;
132
+ } catch {
133
+ k.open({
134
+ title: i("common.error"),
135
+ message: "Failed to fetch affected closing drafts",
136
+ type: "error"
137
+ }), m.value = [];
138
+ } finally {
139
+ C.value = !1;
140
+ }
141
+ }
142
+ ue(
143
+ [g, v],
144
+ () => {
145
+ g.value && v.value && !M.value ? ee() : m.value = [];
146
+ },
147
+ { immediate: !1 }
148
+ );
149
+ async function te() {
150
+ if (!(!K.value || !v.value)) {
151
+ s.value = !0;
152
+ try {
153
+ const t = new Date(v.value);
154
+ if (t.setHours(23, 59, 59, 999), await T.recalculation.scheduleRecalculation({
155
+ openingId: g.value,
156
+ untilDate: t.toISOString(),
157
+ recalculateBySnapshot: !0
158
+ }), m.value.length > 0) {
159
+ const c = m.value.map((H) => H._id);
160
+ await T.recalculation.scheduleInvalidateClosingDraftCache(c);
161
+ }
162
+ k.open({
163
+ title: i("common.success"),
164
+ message: "Stock recalculation has been scheduled successfully",
165
+ type: "success"
166
+ }), await E(), I.value = !1, A("submitted");
167
+ } catch (t) {
168
+ console.error("Error scheduling recalculation:", t), k.open({
169
+ title: i("common.error"),
170
+ message: "Failed to schedule stock recalculation",
171
+ type: "error"
172
+ });
173
+ } finally {
174
+ s.value = !1;
175
+ }
176
+ }
177
+ }
178
+ return (t, c) => {
179
+ const H = x("FmSelect"), oe = x("FmDatePicker"), Q = x("FmSnackbar"), X = x("FmAlert"), o = x("FmButton"), l = x("FmDialog");
180
+ return u(), y("div", null, [
181
+ _(l, {
182
+ modelValue: I.value,
183
+ "onUpdate:modelValue": c[4] || (c[4] = (e) => I.value = e),
184
+ "close-button": "",
185
+ dismissAway: "",
186
+ "max-width": "600px"
187
+ }, {
188
+ "dialog-header": $(() => [
189
+ a("div", Ce, r(d(i)("inventory.stock.recalculation.title")), 1)
190
+ ]),
191
+ "dialog-footer": $(() => [
192
+ Y.value ? (u(), y("div", nt, [
193
+ _(o, {
194
+ variant: "tertiary",
195
+ onClick: c[3] || (c[3] = (e) => I.value = !1),
196
+ label: d(i)("common.close")
197
+ }, null, 8, ["label"])
198
+ ])) : (u(), y("div", ot, [
199
+ _(o, {
200
+ variant: "tertiary",
201
+ onClick: c[2] || (c[2] = (e) => I.value = !1),
202
+ disabled: s.value,
203
+ label: d(i)("common.cancel")
204
+ }, null, 8, ["disabled", "label"]),
205
+ _(o, {
206
+ variant: "primary",
207
+ onClick: te,
208
+ disabled: !K.value || s.value,
209
+ loading: s.value,
210
+ label: d(i)("inventory.stock.recalculation.schedule")
211
+ }, null, 8, ["disabled", "loading", "label"])
212
+ ]))
213
+ ]),
214
+ default: $(() => [
215
+ a("div", Fe, [
216
+ a("div", Ae, r(d(i)("inventory.stock.recalculation.description")), 1),
217
+ Y.value ? w("", !0) : (u(), y(j, { key: 0 }, [
218
+ a("div", Ie, [
219
+ a("p", $e, [
220
+ ae(r(d(i)("inventory.stock.recalculation.openingDate")) + " ", 1),
221
+ c[5] || (c[5] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
222
+ ]),
223
+ c[6] || (c[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)),
224
+ _(H, {
225
+ modelValue: g.value,
226
+ "onUpdate:modelValue": c[0] || (c[0] = (e) => g.value = e),
227
+ items: B.value,
228
+ placeholder: d(i)("inventory.stock.recalculation.selectOpening"),
229
+ loading: s.value,
230
+ disabled: s.value
231
+ }, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
232
+ ]),
233
+ a("div", Be, [
234
+ a("p", Te, [
235
+ ae(r(d(i)("inventory.stock.recalculation.untilDate")) + " ", 1),
236
+ c[7] || (c[7] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
237
+ ]),
238
+ c[8] || (c[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)),
239
+ _(oe, {
240
+ modelValue: v.value,
241
+ "onUpdate:modelValue": c[1] || (c[1] = (e) => v.value = e),
242
+ placeholder: d(i)("inventory.stock.recalculation.selectDate"),
243
+ min: P.value,
244
+ disabled: !g.value || s.value
245
+ }, null, 8, ["modelValue", "placeholder", "min", "disabled"]),
246
+ M.value ? (u(), y("div", Le, r(M.value), 1)) : w("", !0),
247
+ z.value ? (u(), G(Q, {
248
+ key: 1,
249
+ title: "Warning",
250
+ variant: "warning",
251
+ description: "You have selected today or a future date. The stock balance will be refreshed accordingly."
252
+ })) : w("", !0)
253
+ ]),
254
+ g.value && v.value && !M.value ? (u(), G(X, {
255
+ key: 0,
256
+ type: "info"
257
+ }, {
258
+ default: $(() => [
259
+ a("div", Re, r(d(i)("inventory.stock.recalculation.info")), 1)
260
+ ]),
261
+ _: 1
262
+ })) : w("", !0),
263
+ m.value.length > 0 ? (u(), y("div", Ne, [
264
+ C.value ? (u(), y("div", Oe, " Loading affected closing drafts... ")) : (u(), y("div", Pe, [
265
+ a("div", Me, " Affected closing draft(s): " + r(m.value.length), 1),
266
+ a("div", Ke, [
267
+ (u(!0), y(j, null, re(m.value, (e) => (u(), y("div", {
268
+ key: e._id,
269
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
270
+ }, [
271
+ c[9] || (c[9] = ae(" • ")),
272
+ e.closingId && F.value.get(e.closingId) ? (u(), y("span", Ue, r(F.value.get(e.closingId)), 1)) : (u(), y("span", Ee, r(e._id), 1)),
273
+ e.effectiveAt ? (u(), y("span", He, " (" + r(new Date(e.effectiveAt).toLocaleString()) + ") ", 1)) : w("", !0)
274
+ ]))), 128))
275
+ ])
276
+ ]))
277
+ ])) : w("", !0)
278
+ ], 64)),
279
+ n.value.length > 0 ? (u(), y("div", We, [
280
+ a("p", ze, r(d(i)("inventory.stock.recalculation.recentRequests")), 1),
281
+ a("div", je, [
282
+ (u(!0), y(j, null, re(n.value, (e) => {
283
+ var R;
284
+ return u(), y("div", {
285
+ key: e._id,
286
+ class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
287
+ }, [
288
+ a("div", Ge, [
289
+ a("div", Ye, r(d(i)("inventory.stock.recalculation.requestedAt")) + ": " + r(new Date(e.createdAt).toLocaleString()), 1),
290
+ a("div", Je, [
291
+ (R = e.meta) != null && R.openingType ? (u(), y("div", Qe, r(e.meta.openingType === "stockSnapshot" ? "Snapshot" : "Closing"), 1)) : w("", !0),
292
+ a("div", {
293
+ class: fe(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
294
+ "bg-fm-color-system-error-100 text-fm-color-system-error-500": e.failedReason,
295
+ "bg-fm-color-system-success-100 text-fm-color-system-success-500": e.completedAt,
296
+ "bg-fm-color-system-info-100 text-fm-color-system-info-500": !e.failedReason && !e.completedAt
297
+ }])
298
+ }, r(e.failedReason ? d(i)("inventory.stock.recalculation.status.failed") : e.completedAt ? d(i)("inventory.stock.recalculation.status.completed") : d(i)("inventory.stock.recalculation.status.inProgress")), 3)
299
+ ])
300
+ ]),
301
+ a("div", Xe, r(d(i)("inventory.stock.recalculation.from")) + ": " + r(new Date(e.recalculateStartDate).toLocaleDateString()), 1),
302
+ a("div", Ze, r(d(i)("inventory.stock.recalculation.to")) + ": " + r(new Date(e.recalculateEndDate).toLocaleDateString()), 1),
303
+ e.createdBy ? (u(), y("div", qe, r(d(i)("inventory.stock.recalculation.requestedBy")) + ": " + r(e.createdBy.name || e.createdBy.id), 1)) : w("", !0),
304
+ e.completedAt ? (u(), y("div", et, r(d(i)("inventory.stock.recalculation.completedAt")) + ": " + r(new Date(e.completedAt).toLocaleString()), 1)) : w("", !0),
305
+ e.failedReason ? (u(), y("div", tt, r(e.failedReason), 1)) : w("", !0)
306
+ ]);
307
+ }), 128))
308
+ ])
309
+ ])) : w("", !0)
310
+ ])
311
+ ]),
312
+ _: 1
313
+ }, 8, ["modelValue"])
314
+ ]);
315
+ };
316
+ }
317
+ }), lt = { class: "fm-typo-en-heading-lg-600" }, it = { class: "flex flex-col gap-16" }, rt = { class: "flex flex-col gap-4" }, ct = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, dt = { class: "fm-typo-en-body-md-400" }, ut = { class: "flex flex-col gap-4" }, mt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, pt = { class: "fm-typo-en-body-md-400" }, yt = { class: "flex flex-col gap-4" }, ft = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex gap-8 ml-auto" }, vt = /* @__PURE__ */ se({
318
+ __name: "ClosingDetailDialog",
319
+ props: {
320
+ modelValue: { type: Boolean },
321
+ type: {},
322
+ data: {}
323
+ },
324
+ emits: ["update:modelValue"],
325
+ setup(Z, { emit: f }) {
326
+ const { t: h } = le(), A = _e(), i = Z, T = f, V = D({
327
+ get: () => i.modelValue,
328
+ set: (s) => T("update:modelValue", s)
329
+ }), k = p("");
330
+ ue(V, (s) => {
331
+ s || (k.value = "");
332
+ });
333
+ const I = D(() => {
334
+ var s;
335
+ return ((s = i.data) == null ? void 0 : s.skus) ?? [];
336
+ }), g = D(() => {
337
+ var m;
338
+ const s = (m = i.data) == null ? void 0 : m._id;
339
+ if (!s) return "-";
340
+ const n = N(s);
341
+ return new Date(n).toLocaleString();
342
+ }), v = D(() => i.type === "closing" ? h("inventory.closing.history.closingDetail", "Closing Detail") : h("inventory.closing.history.snapshotDetail", "Snapshot Detail")), L = D(() => I.value.map((s) => {
343
+ const n = A.skuById[s.id] ?? null, S = !n;
344
+ return {
345
+ id: s.id,
346
+ sku: n,
347
+ skuName: (n == null ? void 0 : n.name) ?? s.id,
348
+ skuCode: (n == null ? void 0 : n.code) ?? "-",
349
+ balance: s.balance ?? { amount: 0, precision: 0 },
350
+ isMissing: S,
351
+ costs: s.costs,
352
+ weightedAverage: s.weightedAverage
353
+ };
354
+ })), O = [
355
+ {
356
+ accessorKey: "skuName",
357
+ header: () => h("inventory.ingredient.name", "Ingredient Name"),
358
+ cell: (s) => {
359
+ const n = s.row.original;
360
+ return n.isMissing ? W("div", { class: "flex items-center gap-8" }, [
361
+ W("span", {}, n.id),
362
+ W(
363
+ "span",
364
+ {
365
+ class: "px-8 py-2 rounded-4 bg-fm-color-danger-weak text-fm-color-danger-default fm-typo-en-label-sm-400"
366
+ },
367
+ "Missing"
368
+ )
369
+ ]) : s.getValue();
370
+ }
371
+ },
372
+ {
373
+ accessorKey: "skuCode",
374
+ header: () => h("inventory.ingredient.code", "Code")
375
+ },
376
+ {
377
+ id: "balance",
378
+ header: () => h("inventory.closing.history.balance", "Balance"),
379
+ cell: (s) => {
380
+ var m;
381
+ const n = s.row.original;
382
+ if (n.isMissing || !((m = n.sku) != null && m.unit))
383
+ return `${n.balance.amount / Math.pow(10, n.balance.precision)}`;
384
+ const S = {
385
+ unit: n.sku.unit,
386
+ sku: n.sku,
387
+ amount: n.balance,
388
+ defaultTrackingMeasurement: n.sku.trackingMeasurement ?? void 0
389
+ };
390
+ return W(Ve, S);
391
+ },
392
+ size: 180
393
+ },
394
+ {
395
+ accessorKey: "weightedAverage",
396
+ header: () => h("inventory.closing.history.weightedAvgCost", "Weighted Avg Cost"),
397
+ cell: (s) => {
398
+ const n = s.getValue();
399
+ if (!n) return "-";
400
+ const S = n.amount ?? 0, m = n.precision ?? 0, C = n.currency ?? "", B = S / Math.pow(10, m);
401
+ return `${C} ${B.toFixed(2)}`;
402
+ }
403
+ }
404
+ ];
405
+ return (s, n) => {
406
+ const S = x("FmTextField"), m = x("FmTable"), C = x("FmButton"), B = x("FmDialog");
407
+ return u(), G(B, {
408
+ modelValue: V.value,
409
+ "onUpdate:modelValue": n[2] || (n[2] = (F) => V.value = F),
410
+ "close-button": "",
411
+ dismissAway: "",
412
+ "max-width": "900px"
413
+ }, {
414
+ "dialog-header": $(() => [
415
+ a("div", lt, r(v.value), 1)
416
+ ]),
417
+ default: $(() => {
418
+ var F;
419
+ return [
420
+ a("div", it, [
421
+ a("div", rt, [
422
+ a("div", ct, r(i.type === "closing" ? d(h)("inventory.closing.history.closingId") : d(h)("inventory.closing.history.snapshotId", "Snapshot ID")), 1),
423
+ a("div", dt, r(((F = i.data) == null ? void 0 : F._id) ?? "-"), 1)
424
+ ]),
425
+ a("div", ut, [
426
+ a("div", mt, r(d(h)("inventory.closing.history.date")), 1),
427
+ a("div", pt, r(g.value), 1)
428
+ ]),
429
+ a("div", yt, [
430
+ a("div", ft, r(d(h)("inventory.closing.history.ingredientBalances", "Ingredient Balances")) + " (" + r(I.value.length) + ") ", 1),
431
+ _(S, {
432
+ modelValue: k.value,
433
+ "onUpdate:modelValue": n[0] || (n[0] = (P) => k.value = P),
434
+ placeholder: "Filter by code or name"
435
+ }, null, 8, ["modelValue"]),
436
+ _(m, {
437
+ "row-data": L.value,
438
+ "column-defs": O,
439
+ pagination: { pageSize: 10 },
440
+ "search-value": k.value
441
+ }, null, 8, ["row-data", "search-value"])
442
+ ])
443
+ ])
444
+ ];
445
+ }),
446
+ "dialog-footer": $(() => [
447
+ a("div", gt, [
448
+ _(C, {
449
+ variant: "tertiary",
450
+ onClick: n[1] || (n[1] = (F) => V.value = !1),
451
+ label: "Close"
452
+ })
453
+ ])
454
+ ]),
455
+ _: 1
456
+ }, 8, ["modelValue"]);
457
+ };
458
+ }
459
+ }), ht = { class: "flex flex-col gap-16 p-16" }, _t = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, bt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, kt = { class: "flex flex-col gap-16" }, Dt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xt = { class: "flex gap-8 ml-auto" }, Rt = /* @__PURE__ */ se({
460
+ __name: "ClosingHistoryView",
461
+ setup(Z) {
462
+ var Q, X;
463
+ const { t: f } = le(), h = me(), A = be(), i = he(), T = De(), V = pe(), k = p("closings"), I = D(() => [
464
+ { label: f("inventory.closing.history.closingsTab"), value: "closings" },
465
+ { label: f("inventory.closing.history.snapshotsTab"), value: "snapshots" }
466
+ ]), g = p([]), v = p(0), L = p([]), O = p(0);
467
+ let s = A.currentLocationDBName;
468
+ async function n(o) {
469
+ return A.currentLocationDBName ? (s = A.currentLocationDBName, h.listClosingsPage(o)) : { docs: [], nextStartkey: null, hasMore: !1 };
470
+ }
471
+ async function S(o) {
472
+ return A.currentLocationDBName ? (s = A.currentLocationDBName, h.listStockSnapshotsPage(o)) : { docs: [], nextStartkey: null, hasMore: !1 };
473
+ }
474
+ function m() {
475
+ g.value = [], v.value++;
476
+ }
477
+ function C() {
478
+ L.value = [], O.value++;
479
+ }
480
+ const B = p(!1), F = p("closing"), P = p(null);
481
+ function M(o) {
482
+ return [
483
+ o.getFullYear(),
484
+ String(o.getMonth() + 1).padStart(2, "0"),
485
+ String(o.getDate()).padStart(2, "0")
486
+ ].join("-");
487
+ }
488
+ const z = () => M(new Date(Date.now() - 864e5)), K = p(z()), Y = D(() => {
489
+ const o = [
490
+ {
491
+ label: f("inventory.stock.recalculation.title"),
492
+ value: "recalculation",
493
+ prependIcon: "history",
494
+ isAdminOnly: !0
495
+ }
496
+ ];
497
+ return k.value === "closings" ? o.push(
498
+ {
499
+ label: f("inventory.closing.history.initiate_opening"),
500
+ value: "initiateOpening",
501
+ prependIcon: "add_box",
502
+ isAdminOnly: !0
503
+ },
504
+ {
505
+ label: "Refresh",
506
+ value: "refreshOpening",
507
+ prependIcon: "refresh"
508
+ }
509
+ ) : o.push(
510
+ {
511
+ label: f("inventory.closing.history.initiate_snapshot"),
512
+ value: "initiateStockSnapshot",
513
+ prependIcon: "camera",
514
+ isAdminOnly: !0
515
+ },
516
+ {
517
+ label: "Refresh",
518
+ value: "refreshStockSnapshot",
519
+ prependIcon: "refresh"
520
+ }
521
+ ), o;
522
+ }), J = p();
523
+ function q(o) {
524
+ var l;
525
+ switch (o) {
526
+ case "recalculation":
527
+ return (l = J.value) == null ? void 0 : l.open();
528
+ case "initiateOpening": {
529
+ T.open({
530
+ title: "Initiate Opening Balance",
531
+ message: "Initiate opening balance if no opening balance exists for the current location.",
532
+ primaryActions: { text: "Confirm", close: !0 }
533
+ }).onPrimary(async () => {
534
+ try {
535
+ await h.initiateClosing(), V.open({
536
+ message: "Opening balance initiated successfully.",
537
+ type: "success"
538
+ }), await m();
539
+ } catch (e) {
540
+ V.open({
541
+ message: e.message || "Failed to initiate opening balance. Please try again.",
542
+ type: "error"
543
+ });
544
+ }
545
+ });
546
+ break;
547
+ }
548
+ case "initiateStockSnapshot": {
549
+ K.value = z(), U.value = !0;
550
+ break;
551
+ }
552
+ case "refreshOpening": {
553
+ m();
554
+ break;
555
+ }
556
+ case "refreshStockSnapshot": {
557
+ C();
558
+ break;
559
+ }
560
+ }
561
+ }
562
+ const U = p(!1), E = p(!1), ee = z();
563
+ async function te() {
564
+ E.value = !0;
565
+ try {
566
+ await h.initiateStockSnapshot(K.value), V.open({
567
+ message: "Stock snapshot created successfully.",
568
+ type: "success"
569
+ }), U.value = !1, await C();
570
+ } catch (o) {
571
+ V.open({
572
+ message: o.message || "Failed to create stock snapshot. Please try again.",
573
+ type: "error"
574
+ });
575
+ } finally {
576
+ E.value = !1;
577
+ }
578
+ }
579
+ const t = [
580
+ ...(Q = i.sessionUser.value) != null && Q.role.isAdmin ? [
581
+ {
582
+ accessorKey: "_id",
583
+ header: () => W(ce, {}, () => `${f("inventory.closing.history.closingId")}`),
584
+ cell: (o) => o.getValue()
585
+ }
586
+ ] : [],
587
+ {
588
+ accessorKey: "_id",
589
+ id: "date",
590
+ header: () => f("inventory.closing.history.date"),
591
+ cell: (o) => {
592
+ const l = o.getValue(), e = N(l);
593
+ return new Date(e).toLocaleDateString();
594
+ }
595
+ },
596
+ {
597
+ accessorKey: "_id",
598
+ id: "time",
599
+ header: () => f("inventory.closing.history.time"),
600
+ cell: (o) => {
601
+ const l = o.getValue(), e = N(l);
602
+ return new Date(e).toLocaleTimeString();
603
+ }
604
+ },
605
+ {
606
+ accessorKey: "ref",
607
+ header: () => f("inventory.closing.history.createdFrom"),
608
+ cell: (o) => o.getValue() || "-"
609
+ }
610
+ ], c = [
611
+ ...(X = i.sessionUser.value) != null && X.role.isAdmin ? [
612
+ {
613
+ accessorKey: "_id",
614
+ header: () => W(
615
+ ce,
616
+ {},
617
+ () => `${f("inventory.closing.history.snapshotId", "Snapshot ID")}`
618
+ ),
619
+ cell: (o) => o.getValue()
620
+ }
621
+ ] : [],
622
+ {
623
+ accessorKey: "_id",
624
+ id: "date",
625
+ header: () => f("inventory.closing.history.date"),
626
+ cell: (o) => {
627
+ const l = o.getValue(), e = N(l);
628
+ return new Date(e).toLocaleDateString();
629
+ }
630
+ },
631
+ {
632
+ accessorKey: "_id",
633
+ id: "time",
634
+ header: () => f("inventory.closing.history.time"),
635
+ cell: (o) => {
636
+ const l = o.getValue(), e = N(l);
637
+ return new Date(e).toLocaleTimeString();
638
+ }
639
+ },
640
+ {
641
+ accessorKey: "remark",
642
+ header: () => f("inventory.closing.history.createdFrom"),
643
+ cell: (o) => o.getValue() || "-"
644
+ }
645
+ ];
646
+ async function H(o, l) {
647
+ const e = await h.getClosingById(o, l);
648
+ if (!e) throw new Error(`Closing ${o} not found`);
649
+ return F.value = "closing", P.value = e, B.value = !0, e;
650
+ }
651
+ async function oe(o, l) {
652
+ const e = await h.getStockSnapshotById(o, l);
653
+ if (!e) throw new Error(`Stock snapshot ${o} not found`);
654
+ return F.value = "snapshot", P.value = e, B.value = !0, e;
655
+ }
656
+ return A.watchLocation(async () => {
657
+ (A.currentLocationDBName || void 0) !== s && (m(), C());
658
+ }), (o, l) => {
659
+ const e = x("FmTabs"), R = x("FmDatePicker"), ie = x("FmButton"), ye = x("FmDialog");
660
+ return u(), G(ve, {
661
+ actions: Y.value,
662
+ title: d(f)("inventory.closing.history.title"),
663
+ "onClick:action": q
664
+ }, {
665
+ default: $(() => [
666
+ a("div", ht, [
667
+ _(ke, {
668
+ "change-location": "",
669
+ "hide-filter-options": !0
670
+ }),
671
+ _(e, {
672
+ "model-value": k.value,
673
+ "onUpdate:modelValue": l[0] || (l[0] = (b) => k.value = b),
674
+ items: I.value
675
+ }, null, 8, ["model-value", "items"]),
676
+ k.value === "closings" ? (u(), y(j, { key: 0 }, [
677
+ a("div", _t, r(d(f)("inventory.closing.history.closingsDescription")), 1),
678
+ _(de, {
679
+ rows: g.value,
680
+ "onUpdate:rows": l[1] || (l[1] = (b) => g.value = b),
681
+ "fetch-page": n,
682
+ "refresh-key": v.value,
683
+ "column-defs": t,
684
+ "fetch-detail": (b, ne) => H(b._id, ne)
685
+ }, null, 8, ["rows", "refresh-key", "fetch-detail"])
686
+ ], 64)) : w("", !0),
687
+ k.value === "snapshots" ? (u(), y(j, { key: 1 }, [
688
+ a("div", bt, r(d(f)("inventory.closing.history.snapshotsDescription")), 1),
689
+ _(de, {
690
+ rows: L.value,
691
+ "onUpdate:rows": l[2] || (l[2] = (b) => L.value = b),
692
+ "fetch-page": S,
693
+ "refresh-key": O.value,
694
+ "column-defs": c,
695
+ "fetch-detail": (b, ne) => oe(b._id, ne)
696
+ }, null, 8, ["rows", "refresh-key", "fetch-detail"])
697
+ ], 64)) : w("", !0)
698
+ ]),
699
+ (u(), G(ge, { to: "body" }, [
700
+ _(st, {
701
+ ref_key: "recalculationDialogRef",
702
+ ref: J,
703
+ onSubmitted: l[3] || (l[3] = (b) => {
704
+ m(), C();
705
+ })
706
+ }, null, 512),
707
+ _(vt, {
708
+ modelValue: B.value,
709
+ "onUpdate:modelValue": l[4] || (l[4] = (b) => B.value = b),
710
+ type: F.value,
711
+ data: P.value
712
+ }, null, 8, ["modelValue", "type", "data"]),
713
+ _(ye, {
714
+ modelValue: U.value,
715
+ "onUpdate:modelValue": l[7] || (l[7] = (b) => U.value = b),
716
+ "close-button": "",
717
+ dismissAway: "",
718
+ "max-width": "400px"
719
+ }, {
720
+ "dialog-header": $(() => l[8] || (l[8] = [
721
+ a("div", { class: "fm-typo-en-heading-lg-600" }, "Initiate Stock Snapshot", -1)
722
+ ])),
723
+ default: $(() => [
724
+ a("div", kt, [
725
+ a("div", Dt, r(d(f)("inventory.closing.history.snapshotsDescription")), 1),
726
+ _(R, {
727
+ modelValue: K.value,
728
+ "onUpdate:modelValue": l[5] || (l[5] = (b) => K.value = b),
729
+ label: "Snapshot Date",
730
+ max: d(ee)
731
+ }, null, 8, ["modelValue", "max"])
732
+ ])
733
+ ]),
734
+ "dialog-footer": $(() => [
735
+ a("div", xt, [
736
+ _(ie, {
737
+ variant: "tertiary",
738
+ onClick: l[6] || (l[6] = (b) => U.value = !1),
739
+ label: "Cancel",
740
+ disabled: E.value
741
+ }, null, 8, ["disabled"]),
742
+ _(ie, {
743
+ variant: "primary",
744
+ onClick: te,
745
+ label: "Confirm",
746
+ loading: E.value
747
+ }, null, 8, ["loading"])
748
+ ])
749
+ ]),
750
+ _: 1
751
+ }, 8, ["modelValue"])
752
+ ]))
753
+ ]),
754
+ _: 1
755
+ }, 8, ["actions", "title"]);
756
+ };
757
+ }
758
+ });
759
+ export {
760
+ Rt as default
761
+ };