@feedmepos/mf-inventory-portal 0.0.19-dev.9 → 0.0.20-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/App.vue.d.ts +1 -1
  2. package/dist/{ApprovalView-Bcxk6B7K.js → ApprovalView-CF-RhtHH.js} +5 -5
  3. package/dist/{BindingsDialog-XDkcjW_c.js → BindingsDialog-0_fCmf7t.js} +26 -26
  4. package/dist/{BindingsPicker-CgbiqX72.js → BindingsPicker-CT-56t-W.js} +17 -17
  5. package/dist/BindingsTable-DEftAnTN.js +120 -0
  6. package/dist/Entry.vue.d.ts +1 -1
  7. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-6yg6_JPe.js +308 -0
  8. package/dist/IngredientsView-Au6oRwF2.js +1663 -0
  9. package/dist/{IntegrationView-CErHEVAO.js → IntegrationView-D7hqf0P5.js} +278 -278
  10. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-XXoPyhlc.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-HcOKpAlW.js} +1 -1
  11. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BpyUheXn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BTOE1vFl.js} +1 -1
  12. package/dist/PurchaseOrderPrintPreview-C92PdleC.js +152 -0
  13. package/dist/{ReceiveRequestView-BKbeFDxm.js → ReceiveRequestView-BaxEQWOD.js} +8 -8
  14. package/dist/{RecipeView-Drp4l4gL.js → RecipeView-CDgZpLPk.js} +181 -181
  15. package/dist/Standalone.vue.d.ts +1 -1
  16. package/dist/{StockView-Cj6fErwD.js → StockView-B77CrARl.js} +498 -502
  17. package/dist/SupplierView-DQ3hB7q2.js +819 -0
  18. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-lsyakQIl.js +738 -0
  19. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-DN7NCT72.js +1435 -0
  20. package/dist/TransferTemplateView-Dt04xMCK.js +1290 -0
  21. package/dist/{UnitView-C_tAxIpq.js → UnitView-DlmlVNOx.js} +242 -242
  22. package/dist/{WarehouseView-BAqVtbD6.js → WarehouseView-DXWls5vv.js} +360 -362
  23. package/dist/api/bill.d.ts +238 -84
  24. package/dist/api/inventory.d.ts +3 -3
  25. package/dist/api/purchase-order-template.d.ts +4 -0
  26. package/dist/api/stock.d.ts +0 -8
  27. package/dist/api/supplier.d.ts +2 -0
  28. package/dist/app-P7rGzGsF.js +68600 -0
  29. package/dist/app.d.ts +200 -7
  30. package/dist/app.js +3 -3
  31. package/dist/{array-AvWd53LI.js → array-ClJzD_Lt.js} +3 -3
  32. package/dist/components/ChangeLocationComponent.vue.d.ts +14 -1
  33. package/dist/components/DeferableLoading.vue.d.ts +1 -1
  34. package/dist/components/DeleteDialog.vue.d.ts +1 -1
  35. package/dist/components/FmCoordinateInput.vue.d.ts +3 -3
  36. package/dist/components/FmDroppableField.vue.d.ts +6 -6
  37. package/dist/components/FmFilterableSelect.vue.d.ts +3 -3
  38. package/dist/components/FmInventoryTableToolbar.vue.d.ts +19 -10
  39. package/dist/components/FmMinMaxInput.vue.d.ts +20 -0
  40. package/dist/components/FmMinMaxInputProps.d.ts +16 -0
  41. package/dist/components/FmMinMaxInputRules.d.ts +4 -0
  42. package/dist/components/FmMultiselectDialog.vue.d.ts +5 -5
  43. package/dist/components/FmMultiselectDialogProps.d.ts +14 -1
  44. package/dist/components/FmUnitInputRules.d.ts +1 -0
  45. package/dist/components/MultiSelectDialog.vue.d.ts +1 -1
  46. package/dist/components/NavigationTab.vue.d.ts +1 -1
  47. package/dist/components/NumberPrecisionInput.vue.d.ts +3 -3
  48. package/dist/components/PremiumBadge.vue.d.ts +3 -3
  49. package/dist/components/PreviewBadge.vue.d.ts +3 -3
  50. package/dist/components/StockForecast.vue.d.ts +1 -1
  51. package/dist/components/TableActionableRow.vue.d.ts +4 -4
  52. package/dist/components/UnitDisplayControl.vue.d.ts +1 -1
  53. package/dist/components/icons/IconCommunity.vue.d.ts +1 -1
  54. package/dist/components/icons/IconDocumentation.vue.d.ts +1 -1
  55. package/dist/components/icons/IconEcosystem.vue.d.ts +1 -1
  56. package/dist/components/icons/IconSupport.vue.d.ts +1 -1
  57. package/dist/components/icons/IconTooling.vue.d.ts +1 -1
  58. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +6 -6
  59. package/dist/components/map/CoordinateDialog.vue.d.ts +4 -4
  60. package/dist/components/map/GoogleMap.vue.d.ts +6 -6
  61. package/dist/components/nested-multiselect/FmNestedMultiselectDialog.vue.d.ts +3 -3
  62. package/dist/components/row-action.enum.d.ts +3 -1
  63. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +3 -3
  64. package/dist/components/shell/inventory/binding-ui.vue.d.ts +6 -6
  65. package/dist/components/ui-library/FmDateRangePickerChip.vue.d.ts +5 -5
  66. package/dist/composable/useIframe.d.ts +1 -1
  67. package/dist/composable/useSearch.d.ts +1 -1
  68. package/dist/{decimal-D3KXLC4T.js → decimal-4ONRlhOO.js} +1 -1
  69. package/dist/format-unit-display-DJpElzu_.js +707 -0
  70. package/dist/helper/number.d.ts +2 -0
  71. package/dist/{id-to-date-Cj02m808.js → id-to-date-D8Ey2CVj.js} +1 -1
  72. package/dist/is-linked-ingredient-error-fJ2TJb3z.js +37 -0
  73. package/dist/layout/InventoryLayout.vue.d.ts +1 -1
  74. package/dist/layout/SingleColumnLayout.vue.d.ts +6 -5
  75. package/dist/layout/components/NavigationButton.vue.d.ts +4 -4
  76. package/dist/layout-D-zXtsSp.js +151 -0
  77. package/dist/row-action.enum-PMKMRrZR.js +50 -0
  78. package/dist/stores/feature.d.ts +5 -1
  79. package/dist/stores/inventory.d.ts +4 -4
  80. package/dist/stores/location.d.ts +185 -152
  81. package/dist/stores/supplier.d.ts +666 -12
  82. package/dist/stores/warehouse.d.ts +17 -5
  83. package/dist/supplier-DsUIjl-L.js +69 -0
  84. package/dist/tsconfig.app.tsbuildinfo +1 -1
  85. package/dist/views/InventoryView.vue.d.ts +1 -1
  86. package/dist/views/SelectBussinessDialog.vue.d.ts +1 -1
  87. package/dist/views/approval/ApprovalView.vue.d.ts +1 -1
  88. package/dist/views/dev/ComponentPreview.vue.d.ts +1 -1
  89. package/dist/views/dev/components/CoordinateTest.vue.d.ts +1 -1
  90. package/dist/views/dev/components/DateRange.vue.d.ts +1 -1
  91. package/dist/views/dev/components/FmDecimalInputTest.vue.d.ts +1 -1
  92. package/dist/views/dev/components/FmMultiselectDialogGrouped.vue.d.ts +2 -0
  93. package/dist/views/dev/components/FmSelectTest.vue.d.ts +1 -1
  94. package/dist/views/dev/components/InventoryIframe.vue.d.ts +1 -1
  95. package/dist/views/dev/components/LayoutDev.vue.d.ts +1 -1
  96. package/dist/views/dev/components/MfCommontTest.vue.d.ts +1 -1
  97. package/dist/views/dev/components/NestedSelection.vue.d.ts +1 -1
  98. package/dist/views/dev/components/NumberStepper.vue.d.ts +1 -1
  99. package/dist/views/dev/components/TabStorageTest.vue.d.ts +1 -1
  100. package/dist/views/dev/components/UnitInput.vue.d.ts +1 -1
  101. package/dist/views/dev/helpers/pinia-test.d.ts +1 -1
  102. package/dist/views/home/HomeView.vue.d.ts +1 -1
  103. package/dist/views/iframe/inventory-bindings/bindings-dialog/BindingsDialog.vue.d.ts +1 -1
  104. package/dist/views/iframe/inventory-bindings/bindings-picker/BindingsPicker.vue.d.ts +1 -1
  105. package/dist/views/iframe/inventory-bindings/bindings-table/BindingsTable.vue.d.ts +1 -1
  106. package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -1
  107. package/dist/views/ingredients/components/cannot-delete/CannotDelete.vue.d.ts +4 -4
  108. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +3 -3
  109. package/dist/views/ingredients/components/import-ingredients/ImportIngredientItem.vue.d.ts +1 -1
  110. package/dist/views/ingredients/components/import-ingredients/ImportIngredients.vue.d.ts +1 -1
  111. package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItem.vue.d.ts +1 -1
  112. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialog.vue.d.ts +5 -5
  113. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +6 -6
  114. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +5 -5
  115. package/dist/views/ingredients/components/inventory-binding/InventoryBindingSummary.vue.d.ts +3 -3
  116. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +8 -8
  117. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
  118. package/dist/views/integration/IntegrationView.vue.d.ts +1 -1
  119. package/dist/views/integration/components/ApplyAddon.vue.d.ts +5 -5
  120. package/dist/views/integration/components/ApplyProduct.vue.d.ts +5 -5
  121. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +5 -5
  122. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +5 -5
  123. package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +1 -1
  124. package/dist/views/receive-request/components/select-template-dialog/SelectTemplateDialog.vue.d.ts +8 -0
  125. package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistory.vue.d.ts +1 -1
  126. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +3 -3
  127. package/dist/views/receive-request/components/transfer-dialog/TransferDialog.vue.d.ts +4 -4
  128. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +1 -1
  129. package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +4 -4
  130. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +34 -32
  131. package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +8 -2
  132. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
  133. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +6 -6
  134. package/dist/views/receive-request/components/transfer-form/components/TransferItem.vue.d.ts +3 -3
  135. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +3 -3
  136. package/dist/views/receive-request/components/transfer-form/composables/use-backdate-po.d.ts +4 -4
  137. package/dist/views/receive-request/components/transfer-form/composables/use-compare-price.d.ts +3 -3
  138. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -9
  139. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1016 -70
  140. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +36 -36
  141. package/dist/views/receive-request/print-preview/PurchaseOrderPrintPreview.vue.d.ts +1 -1
  142. package/dist/views/recipe/RecipeView.vue.d.ts +1 -1
  143. package/dist/views/recipe/components/recipe-dialog/RecipeDialog.vue.d.ts +5 -5
  144. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +4 -4
  145. package/dist/views/recipe/composables/use-recipe-form.d.ts +8 -8
  146. package/dist/views/stock/StockView.vue.d.ts +1 -1
  147. package/dist/views/stock/components/StockHeaderPreview.vue.d.ts +1 -1
  148. package/dist/views/stock/components/StockHistory.vue.d.ts +3 -3
  149. package/dist/views/stock/components/StockRecordCard.vue.d.ts +123 -46
  150. package/dist/views/stock/components/dialog/AdjustSkuDialog.vue.d.ts +4 -4
  151. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +5 -5
  152. package/dist/views/stock/components/dialog/ConvertSkuDialog.vue.d.ts +4 -4
  153. package/dist/views/stock/composables/use-stock-action.d.ts +11 -11
  154. package/dist/views/stock/helper/stock-row-action.d.ts +4 -2
  155. package/dist/views/supplier/SupplierView.vue.d.ts +1 -1
  156. package/dist/views/supplier/components/SupplierDialog.vue.d.ts +4 -4
  157. package/dist/views/supplier/components/SupplierForm.vue.d.ts +10 -10
  158. package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -3
  159. package/dist/views/supplier/composables/use-supplier-table.d.ts +3 -3
  160. package/dist/views/transfer-template/TransferTemplateView.vue.d.ts +1 -1
  161. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +20 -0
  162. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetailsProps.d.ts +9 -0
  163. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +4 -4
  164. package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateForm.vue.d.ts +2 -2
  165. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +3 -3
  166. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +7 -7
  167. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +15 -9
  168. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1428 -43
  169. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +893 -13
  170. package/dist/views/unit/UnitView.vue.d.ts +1 -1
  171. package/dist/views/unit/components/unit-dialog/UnitDialog.vue.d.ts +5 -5
  172. package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +4 -4
  173. package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +3 -3
  174. package/dist/views/unit/components/unit-used-by/UnitUsedBy.vue.d.ts +1 -1
  175. package/dist/views/unit/composables/use-unit-form.d.ts +8 -8
  176. package/dist/views/warehouse/WarehouseView.vue.d.ts +1 -1
  177. package/dist/views/warehouse/components/WarehouseDialog.vue.d.ts +4 -4
  178. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +38 -14
  179. package/dist/{xlsx-B-2KyDJq.js → xlsx-zfERRe6K.js} +3383 -3383
  180. package/dist/{xlsx.util-D6EzRE71.js → xlsx.util-DnbiJzsk.js} +4 -4
  181. package/package.json +6 -5
  182. package/dist/BindingsTable-xNXNsBAd.js +0 -145
  183. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DFPkUHl-.js +0 -272
  184. package/dist/IngredientsView-DD7ns3mP.js +0 -1751
  185. package/dist/PurchaseOrderPrintPreview-L_iaaURb.js +0 -152
  186. package/dist/SupplierView-EFsHWet-.js +0 -801
  187. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-kM5fyqq6.js +0 -745
  188. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-CyFMCmXw.js +0 -1605
  189. package/dist/TransferTemplateView-Cymhrayh.js +0 -933
  190. package/dist/app-CeUU5Gd8.js +0 -66938
  191. package/dist/is-linked-ingredient-error-C6AghEwR.js +0 -37
  192. package/dist/layout-2zzAZIVO.js +0 -147
  193. package/dist/purchase-order-transaction-type-Dz0YF5qh.js +0 -294
  194. package/dist/row-action.enum-7jVyol1k.js +0 -36
  195. package/dist/supplier-mDVKd7Ge.js +0 -54
  196. package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +0 -9
@@ -0,0 +1,738 @@
1
+ import { b as le, f as ae, P as Z, e as xe, g as De } from "./format-unit-display-DJpElzu_.js";
2
+ import { computed as re, h as be, defineComponent as Se, ref as ee, resolveComponent as K, openBlock as d, createBlock as P, unref as s, isRef as Ce, withCtx as te, createElementVNode as e, createVNode as I, createElementBlock as h, Fragment as X, toDisplayString as l, normalizeClass as se, createCommentVNode as f, renderList as oe } from "vue";
3
+ import { c as ge } from "./layout-D-zXtsSp.js";
4
+ import { D as g, R as p } from "./row-action.enum-PMKMRrZR.js";
5
+ import { B as Re, l as ie, a as ce, a7 as ue, ag as b, c as Ae, j as Ee, ad as q, H as Pe, G as Te, E as Ne, b as Fe, w as je } from "./app-P7rGzGsF.js";
6
+ import { F as Ie } from "./decimal-4ONRlhOO.js";
7
+ import { components as _e, useDialog as Ue, useSnackbar as Me, useProxiedModel as $e } from "@feedmepos/ui-library";
8
+ import { useI18n as Oe } from "@feedmepos/mf-common";
9
+ import { E as Ke } from "./empty-placeholder-wf6-BWE8.js";
10
+ function Le(m, k) {
11
+ return k.reduce(
12
+ (r, T) => {
13
+ const D = T.received.find((A) => A.sku._id === m._id);
14
+ return D && (r = Re(r, D.amount)), r;
15
+ },
16
+ Ie.toPrecision(ie(0), m.unit.precision)
17
+ );
18
+ }
19
+ function Ve(m, k) {
20
+ const { name: _, address: r, regNo: T } = k.doc.profile, D = {
21
+ name: _,
22
+ registrationNumber: T,
23
+ line1: r == null ? void 0 : r.line1,
24
+ line2: r == null ? void 0 : r.line2,
25
+ postcode: r == null ? void 0 : r.postcode,
26
+ city: r == null ? void 0 : r.city,
27
+ state: r == null ? void 0 : r.state,
28
+ country: r == null ? void 0 : r.country
29
+ }, A = {
30
+ name: m.supplier.name,
31
+ registrationNumber: m.supplier.registrationNumber,
32
+ line1: m.supplier.address.line1,
33
+ line2: m.supplier.address.line2,
34
+ postcode: m.supplier.address.postcode,
35
+ city: m.supplier.address.city,
36
+ state: m.supplier.address.state,
37
+ country: m.supplier.address.country
38
+ }, i = m.items.map((o) => {
39
+ const { sku: a, measurement: v } = o, V = ce(
40
+ Le(o.sku, m.deliveryOrder || []),
41
+ !1
42
+ );
43
+ return {
44
+ code: a.code,
45
+ description: a.name,
46
+ quantity: le(o.quantity, a.unit, o.measurement),
47
+ unit: (v == null ? void 0 : v.abbrev) || a.unit.abbrev,
48
+ received: V
49
+ };
50
+ }), U = m.deliveryOrder.map((o) => ({
51
+ createdAt: ue(new Date(o.createdAt)),
52
+ ref: o.deliveryOrderNumber,
53
+ remark: o.remark || "",
54
+ items: o.received.map((a) => {
55
+ var v;
56
+ return {
57
+ code: a.sku.code,
58
+ description: a.sku.name,
59
+ quantity: ce(a.amount),
60
+ unit: ((v = a.measurement) == null ? void 0 : v.abbrev) || a.sku.unit.abbrev
61
+ };
62
+ })
63
+ })), L = {
64
+ orderNumber: m.seqNumber.toString(),
65
+ createdAt: ae(m._id),
66
+ ref: m.ref || "",
67
+ remark: m.remark || "",
68
+ buyer: D,
69
+ supplier: A,
70
+ items: i,
71
+ status: m.status,
72
+ deliveryOrders: U
73
+ }, c = new URL(window.location.href);
74
+ c.pathname = "/receive-request/print-preview", c.searchParams.append("data", JSON.stringify(L)), window.open(c.href, "_blank", "noreferrer");
75
+ }
76
+ const z = {
77
+ submitRequest: {
78
+ translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
79
+ color: "text-fm-color-typo-primary",
80
+ value: b.enum.submitRequest
81
+ },
82
+ confirmDraft: {
83
+ translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
84
+ color: "text-fm-color-typo-primary",
85
+ value: b.enum.confirmDraft
86
+ },
87
+ cancelDraft: {
88
+ translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
89
+ color: "text-fm-color-typo-error",
90
+ value: b.enum.cancelDraft
91
+ },
92
+ approveRequest: {
93
+ translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
94
+ color: "text-fm-color-typo-primary",
95
+ value: b.enum.approveRequest
96
+ },
97
+ rejectRequest: {
98
+ translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
99
+ color: "text-fm-color-typo-error",
100
+ value: b.enum.rejectRequest
101
+ },
102
+ processRequest: {
103
+ translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
104
+ color: "text-fm-color-typo-primary",
105
+ value: b.enum.processRequest
106
+ },
107
+ receiveStock: {
108
+ translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
109
+ color: "text-fm-color-typo-primary",
110
+ value: b.enum.receiveStock
111
+ },
112
+ completeReceive: {
113
+ translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
114
+ color: "text-fm-color-typo-primary",
115
+ value: b.enum.completeReceive
116
+ }
117
+ };
118
+ function us(m, k) {
119
+ const _ = Ee(), { t: r } = Oe();
120
+ function T(c) {
121
+ switch (c.status) {
122
+ case "DRAFT":
123
+ return [
124
+ c.supplier.internal === "restaurant" || c.supplier.internal === "warehouse" ? z[b.enum.submitRequest] : z[b.enum.confirmDraft],
125
+ z[b.enum.cancelDraft],
126
+ g[p.Update],
127
+ g[p.Details],
128
+ g[p.Print]
129
+ ];
130
+ case "RECEIVING":
131
+ return [
132
+ z[b.enum.completeReceive],
133
+ g[p.Update],
134
+ g[p.Details],
135
+ g[p.Print]
136
+ ];
137
+ case "REQUESTING":
138
+ return m === "receive/request" ? [
139
+ g[p.Update],
140
+ g[p.Details],
141
+ g[p.Print]
142
+ ] : [
143
+ z[b.enum.approveRequest],
144
+ z[b.enum.rejectRequest],
145
+ g[p.Details],
146
+ g[p.Print]
147
+ ];
148
+ case "PROCESSING":
149
+ return [g[p.Details], g[p.Print]];
150
+ case "COMPLETE":
151
+ case "CANCEL":
152
+ default:
153
+ return [
154
+ g[p.Update],
155
+ g[p.Details],
156
+ g[p.Print]
157
+ ];
158
+ }
159
+ }
160
+ function D(c) {
161
+ return Object.values(b.enum).includes(c);
162
+ }
163
+ async function A(c, o, a) {
164
+ var V, B;
165
+ const v = Ae(o);
166
+ if (c === p.Print) {
167
+ Ve(v, _.currentLocation);
168
+ return;
169
+ }
170
+ if (c === p.Details) {
171
+ k.promptShowTransferDetails(v, a);
172
+ return;
173
+ }
174
+ if (c === p.Update) {
175
+ (V = k.promptUpdateTransferDialog) == null || V.call(k, v);
176
+ return;
177
+ }
178
+ if (D(c)) {
179
+ k.submitAction(o, c, (B = a == null ? void 0 : a.to) == null ? void 0 : B.dbName);
180
+ return;
181
+ }
182
+ }
183
+ function i() {
184
+ return [
185
+ {
186
+ accessorKey: "seqNumber",
187
+ header: () => r("inventory.transfer.table.seqNo"),
188
+ enableSorting: !0,
189
+ size: 80,
190
+ sortUndefined: "last"
191
+ },
192
+ {
193
+ accessorKey: "_id",
194
+ header: () => r("inventory.transfer.table.createdAt"),
195
+ cell(c) {
196
+ return ae(`${c.getValue()}`);
197
+ },
198
+ enableSorting: !0
199
+ },
200
+ {
201
+ accessorKey: "supplier.name",
202
+ header: () => r("inventory.transfer.table.transferFrom"),
203
+ enableSorting: !0,
204
+ size: 200
205
+ },
206
+ {
207
+ accessorKey: "items.length",
208
+ header: () => r("inventory.transfer.table.noOfItems"),
209
+ enableSorting: !1,
210
+ meta: {
211
+ width: "10rem"
212
+ }
213
+ },
214
+ {
215
+ accessorKey: "ref",
216
+ header: () => r("inventory.transfer.table.reference"),
217
+ enableSorting: !1,
218
+ size: "auto"
219
+ },
220
+ {
221
+ accessorKey: "status",
222
+ header: () => r("inventory.transfer.table.status"),
223
+ cell(c) {
224
+ const o = r(`inventory.transfer.status.${c.getValue() ?? ""}`), a = `${c.getValue() ?? ""}`.toLocaleLowerCase("en-us");
225
+ return be(_e.FmChip, {
226
+ label: o,
227
+ class: `fm-status-badge fm-status-badge-${a}`,
228
+ compact: !0
229
+ });
230
+ },
231
+ enableSorting: !0,
232
+ size: 200
233
+ },
234
+ {
235
+ id: "action",
236
+ cell(c) {
237
+ const o = c.row.original, a = T(o);
238
+ return ge(a, (v) => A(v, o));
239
+ },
240
+ enableSorting: !1,
241
+ size: 40,
242
+ meta: {
243
+ cellClass: "",
244
+ headerClass: ""
245
+ }
246
+ }
247
+ ];
248
+ }
249
+ function U() {
250
+ return [
251
+ {
252
+ accessorKey: "purchaseOrder.seqNumber",
253
+ header: () => r("inventory.transfer.table.seqNo"),
254
+ enableSorting: !0,
255
+ size: 80,
256
+ sortUndefined: "last"
257
+ },
258
+ {
259
+ accessorKey: "purchaseOrder._id",
260
+ header: () => r("inventory.transfer.table.createdAt"),
261
+ cell(c) {
262
+ return ae(`${c.getValue()}`);
263
+ },
264
+ enableSorting: !0
265
+ },
266
+ {
267
+ accessorKey: "to.name",
268
+ header: () => r("inventory.transfer.table.transferTo"),
269
+ enableSorting: !1,
270
+ size: 200
271
+ },
272
+ {
273
+ accessorKey: "purchaseOrder.items.length",
274
+ header: () => r("inventory.transfer.table.noOfItems"),
275
+ enableSorting: !1
276
+ },
277
+ {
278
+ accessorKey: "purchaseOrder.ref",
279
+ header: () => r("inventory.transfer.table.reference"),
280
+ enableSorting: !1,
281
+ size: "auto"
282
+ },
283
+ {
284
+ accessorKey: "purchaseOrder.status",
285
+ header: () => r("inventory.transfer.table.status"),
286
+ cell(c) {
287
+ const o = r(`inventory.transfer.status.${c.getValue() ?? ""}`), a = `${c.getValue() ?? ""}`.toLocaleLowerCase("en-us");
288
+ return be(_e.FmChip, {
289
+ label: o,
290
+ class: `fm-status-badge fm-status-badge-${a}`,
291
+ compact: !0
292
+ });
293
+ },
294
+ enableSorting: !0
295
+ },
296
+ {
297
+ id: "action",
298
+ cell(c) {
299
+ const o = c.row.original, a = o.purchaseOrder ? T(o.purchaseOrder) : [];
300
+ return ge(
301
+ a,
302
+ (v) => o.purchaseOrder ? A(v, o.purchaseOrder, o) : void 0
303
+ );
304
+ },
305
+ enableSorting: !1,
306
+ size: 40,
307
+ meta: {
308
+ cellClass: "",
309
+ headerClass: ""
310
+ }
311
+ }
312
+ ];
313
+ }
314
+ const L = re(() => m === "receive/request" ? i() : U());
315
+ return {
316
+ get columnDefs() {
317
+ return L.value;
318
+ }
319
+ };
320
+ }
321
+ const Be = { class: "flex flex-col gap-16 w-full h-full" }, Ge = { class: "flex justify-between" }, He = { class: "fm-typo-en-body-lg-600" }, ze = { class: "flex flex-col gap-8" }, Qe = { class: "flex flex-col gap-4" }, Ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Je = { class: "flex gap-1" }, We = { class: "fm-typo-en-body-lg-600" }, Xe = {
322
+ key: 0,
323
+ class: "flex flex-col gap-4"
324
+ }, Ze = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, et = { class: "fm-typo-en-body-lg-600" }, tt = { class: "flex flex-col gap-4" }, st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt = { class: "fm-typo-en-body-lg-600" }, at = {
325
+ key: 1,
326
+ class: "flex flex-col gap-4"
327
+ }, nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ot = { class: "fm-typo-en-body-lg-600" }, lt = {
328
+ key: 2,
329
+ class: "flex flex-col gap-4"
330
+ }, it = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ct = { class: "fm-typo-en-body-lg-600" }, ut = {
331
+ key: 3,
332
+ class: "flex flex-col gap-4"
333
+ }, dt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, mt = { class: "fm-typo-en-body-lg-600" }, ft = {
334
+ key: 4,
335
+ class: "flex flex-col gap-4"
336
+ }, pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vt = { class: "fm-typo-en-body-lg-600" }, yt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, ht = { class: "flex flex-col gap-8" }, bt = { class: "fm-typo-en-body-lg-600" }, gt = { class: "flex w-full gap-4" }, _t = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Rt = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Ot = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, qt = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, kt = {
337
+ key: 0,
338
+ class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
339
+ }, wt = {
340
+ key: 1,
341
+ class: "flex-1 xs:w-screen xs:max-w-full"
342
+ }, xt = {
343
+ key: 0,
344
+ class: "flex flex-col items-center gap-8 h-full"
345
+ }, Dt = ["src"], St = { class: "fm-typo-en-body-lg-600" }, Ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, At = {
346
+ key: 1,
347
+ class: "px-4 flex flex-col"
348
+ }, Et = { class: "flex gap-12 content-stretch" }, Pt = {
349
+ class: "flex flex-col w-24",
350
+ name: "circles"
351
+ }, Tt = { class: "flex-1 flex flex-col items-center" }, Nt = { class: "flex-1 flex flex-col items-center" }, Ft = {
352
+ class: "py-12 flex flex-col gap-4",
353
+ name: "received-at header"
354
+ }, jt = { class: "fm-typo-en-body-lg-400" }, It = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ut = { class: "flex gap-12 content-stretch" }, Mt = {
355
+ class: "flex flex-col w-24",
356
+ name: "circles"
357
+ }, $t = { class: "flex-1 flex flex-col items-center" }, Kt = {
358
+ class: "py-12 flex flex-col gap-4 flex-1",
359
+ name: "delivery details"
360
+ }, Lt = { class: "flex flex-col gap-8" }, Vt = { class: "flex flex-col gap-4" }, Bt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-lg-600" }, Ht = { class: "flex flex-col gap-4" }, zt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qt = { class: "flex flex-col gap-4" }, Yt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Jt = { class: "fm-typo-en-body-lg-600" }, Wt = { class: "flex flex-col gap-4" }, Xt = {
361
+ key: 0,
362
+ class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
363
+ }, Zt = { class: "fm-typo-en-body-lg-600" }, es = { class: "flex gap-8 xs:flex-col" }, ds = /* @__PURE__ */ Se({
364
+ __name: "TransferDetails",
365
+ props: {
366
+ purchaseOrder: {},
367
+ transferTo: {},
368
+ transferToDbName: {},
369
+ show: { type: Boolean },
370
+ canResubmit: { type: Boolean },
371
+ canApprove: { type: Boolean }
372
+ },
373
+ emits: ["update:show", "submitted"],
374
+ setup(m, { emit: k }) {
375
+ const _ = m, r = k, T = Ue(), D = Me(), A = Fe(), { t: i } = Oe(), U = re(
376
+ () => {
377
+ var t, n, S, y;
378
+ return ((n = (t = _.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : n.internal) === "restaurant" || ((y = (S = _.purchaseOrder) == null ? void 0 : S.supplier) == null ? void 0 : y.internal) === "warehouse" ? Z.TRANSFER : Z.PURCHASE;
379
+ }
380
+ ), L = [
381
+ {
382
+ label: i("inventory.transfer.receiveRequest.details.overview"),
383
+ value: "overview"
384
+ },
385
+ {
386
+ label: i("inventory.transfer.receiveRequest.details.deliveryHistory"),
387
+ value: "deliveryHistory"
388
+ }
389
+ ], c = ee(L[0]), o = ee(!1), a = ee(""), v = ee(!0), V = xe(), B = $e(_, "show");
390
+ async function qe(t, n, S) {
391
+ a.value = n, o.value = !0, v.value = !1;
392
+ try {
393
+ await V.processPurchaseOrder(
394
+ {
395
+ operation: n,
396
+ doc: t,
397
+ options: (
398
+ // auto receive for supplier to warehouse
399
+ (n === b.enum.confirmDraft || // auto receive for warehouse to warehouse
400
+ n === b.enum.completeReceive) && A.autoReceiveWarehouse ? {
401
+ autoReceive: !0
402
+ } : void 0
403
+ )
404
+ },
405
+ _.transferToDbName
406
+ ), await new Promise((y) => setTimeout(y, 1e3)), D.open({
407
+ title: "Success",
408
+ message: S,
409
+ type: "success"
410
+ }), r("update:show", !1), r("submitted");
411
+ } catch (y) {
412
+ D.open({
413
+ title: "Something went wrong",
414
+ message: "Please try again.",
415
+ type: "error"
416
+ }), console.error("Error when submitting PO operation", n, t, y);
417
+ } finally {
418
+ a.value = "", o.value = !1, v.value = !0;
419
+ }
420
+ }
421
+ async function M(t) {
422
+ const n = De[t];
423
+ if (!n) {
424
+ D.open({
425
+ title: "Something went wrong",
426
+ message: `Cannot process order: ${je(t)}`,
427
+ type: "error"
428
+ });
429
+ return;
430
+ }
431
+ const { successMessage: S, ...y } = n;
432
+ T.open({
433
+ title: y.title,
434
+ message: y.message,
435
+ primaryActions: y.primaryActions
436
+ }).onPrimary(() => {
437
+ _.purchaseOrder && qe(_.purchaseOrder, t, S);
438
+ });
439
+ }
440
+ const ke = re(() => {
441
+ var t, n;
442
+ return ((t = _.purchaseOrder) == null ? void 0 : t.status) === q.enum.RECEIVING || ((n = _.purchaseOrder) == null ? void 0 : n.status) === q.enum.COMPLETE;
443
+ }), we = re(() => {
444
+ var Q, G, w;
445
+ const S = (((Q = _.purchaseOrder) == null ? void 0 : Q.deliveryOrder) ?? []).flatMap((O) => O.received ?? []).reduce(
446
+ (O, N) => {
447
+ const H = O[N.sku._id] ?? [];
448
+ return O[N.sku._id] = [...H, N], O;
449
+ },
450
+ {}
451
+ ), y = Object.entries(S).reduce(
452
+ (O, [N, H]) => {
453
+ const E = H.reduce((F, j) => {
454
+ const $ = Pe(
455
+ F,
456
+ Math.max(F.precision, j.amount.precision)
457
+ );
458
+ return Re($, j.amount);
459
+ }, ie(0));
460
+ return O[N] = E, O;
461
+ },
462
+ {}
463
+ ), ne = ((G = _.purchaseOrder) == null ? void 0 : G.items) ?? [];
464
+ for (const O of ne)
465
+ y[w = O.sku._id] ?? (y[w] = ie(0));
466
+ return y;
467
+ });
468
+ return (t, n) => {
469
+ var N, H;
470
+ const S = K("FmButtonGroup"), y = K("FmChip"), ne = K("FmMenuDivider"), Q = K("FmCard"), G = K("FmSpacer"), w = K("FmButton"), O = K("FmSideSheet");
471
+ return d(), P(O, {
472
+ header: s(i)("inventory.transfer.receiveRequest.details.title") + ((N = t.purchaseOrder) != null && N.seqNumber ? ` #${(H = t.purchaseOrder) == null ? void 0 : H.seqNumber}` : ""),
473
+ modelValue: s(B),
474
+ "onUpdate:modelValue": n[9] || (n[9] = (E) => Ce(B) ? B.value = E : null),
475
+ "dismiss-away": v.value,
476
+ "close-button": "",
477
+ "max-width": 500
478
+ }, {
479
+ default: te(() => {
480
+ var E, F, j, $, Y, J;
481
+ return [
482
+ e("div", Be, [
483
+ e("div", null, [
484
+ I(S, {
485
+ items: L,
486
+ modelValue: c.value,
487
+ "onUpdate:modelValue": n[0] || (n[0] = (u) => c.value = u)
488
+ }, null, 8, ["modelValue"])
489
+ ]),
490
+ c.value.value === "overview" ? (d(), h(X, { key: 0 }, [
491
+ I(Q, {
492
+ variant: "outlined",
493
+ class: "flex flex-col gap-8 px-12 py-16"
494
+ }, {
495
+ default: te(() => {
496
+ var u, R, x, W, C, de, me, fe, pe, ve, ye, he;
497
+ return [
498
+ e("div", Ge, [
499
+ e("div", He, l(s(i)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
500
+ e("div", null, [
501
+ I(y, {
502
+ label: s(i)(`inventory.transfer.status.${(u = t.purchaseOrder) == null ? void 0 : u.status}`),
503
+ class: se(`fm-status-badge fm-status-badge-${(x = (R = t.purchaseOrder) == null ? void 0 : R.status) == null ? void 0 : x.toLocaleLowerCase("en-us")}`),
504
+ compact: ""
505
+ }, null, 8, ["label", "class"])
506
+ ])
507
+ ]),
508
+ I(ne),
509
+ e("div", ze, [
510
+ e("div", Qe, [
511
+ e("div", Ye, [
512
+ e("div", Je, l(s(i)("inventory.transfer.receiveRequest.details.createdAt")), 1)
513
+ ]),
514
+ e("div", We, l(s(ae)(((W = t.purchaseOrder) == null ? void 0 : W._id) ?? "")), 1)
515
+ ]),
516
+ (C = t.purchaseOrder) != null && C.effectiveAt ? (d(), h("div", Xe, [
517
+ e("div", Ze, l(s(i)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
518
+ e("div", et, l(s(ue)(new Date((de = t.purchaseOrder) == null ? void 0 : de.effectiveAt))), 1)
519
+ ])) : f("", !0),
520
+ e("div", tt, [
521
+ e("div", st, l(s(i)("inventory.transfer.receiveRequest.details.type.title")), 1),
522
+ e("div", rt, l(s(i)(
523
+ `inventory.transfer.receiveRequest.details.type.${U.value.toLocaleLowerCase("en-US")}`
524
+ )), 1)
525
+ ]),
526
+ (fe = (me = t.purchaseOrder) == null ? void 0 : me.supplier) != null && fe.name ? (d(), h("div", at, [
527
+ e("div", nt, l(s(i)("inventory.transfer.receiveRequest.details.from")), 1),
528
+ e("div", ot, l((ve = (pe = t.purchaseOrder) == null ? void 0 : pe.supplier) == null ? void 0 : ve.name), 1)
529
+ ])) : f("", !0),
530
+ t.transferTo ? (d(), h("div", lt, [
531
+ e("div", it, l(s(i)("inventory.transfer.receiveRequest.details.to")), 1),
532
+ e("div", ct, l(t.transferTo), 1)
533
+ ])) : f("", !0),
534
+ (ye = t.purchaseOrder) != null && ye.ref ? (d(), h("div", ut, [
535
+ e("div", dt, l(s(i)("inventory.transfer.receiveRequest.details.reference")), 1),
536
+ e("div", mt, l(t.purchaseOrder.ref), 1)
537
+ ])) : f("", !0),
538
+ (he = t.purchaseOrder) != null && he.remark ? (d(), h("div", ft, [
539
+ e("div", pt, l(s(i)("inventory.transfer.receiveRequest.details.remark")), 1),
540
+ e("div", vt, l(t.purchaseOrder.remark), 1)
541
+ ])) : f("", !0)
542
+ ])
543
+ ];
544
+ }),
545
+ _: 1
546
+ }),
547
+ e("div", yt, [
548
+ e("div", ht, [
549
+ e("div", bt, l(ke.value ? s(i)("inventory.transfer.receiveRequest.details.receivedItems") : s(i)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
550
+ (d(!0), h(X, null, oe(((E = t.purchaseOrder) == null ? void 0 : E.items) ?? [], (u) => (d(), h("div", {
551
+ key: u.code,
552
+ class: "flex flex-col"
553
+ }, [
554
+ e("div", gt, [
555
+ e("div", _t, l(u.name), 1),
556
+ e("div", Rt, l(s(ce)(we.value[u.sku._id], !1)) + "/" + l(s(le)(u.quantity, u.sku.unit, u.measurement)), 1)
557
+ ]),
558
+ e("div", Ot, [
559
+ e("div", qt, l(u.code), 1),
560
+ u.totalCost && s(A).enableTotalCost ? (d(), h("div", kt, " (" + l(s(Te)(u.totalCost)) + ") ", 1)) : f("", !0)
561
+ ])
562
+ ]))), 128))
563
+ ])
564
+ ])
565
+ ], 64)) : f("", !0),
566
+ c.value.value === "deliveryHistory" ? (d(), h("div", wt, [
567
+ ((j = (F = t.purchaseOrder) == null ? void 0 : F.deliveryOrder) == null ? void 0 : j.length) === 0 ? (d(), h("div", xt, [
568
+ I(G),
569
+ e("div", null, [
570
+ e("img", {
571
+ src: s(Ke),
572
+ alt: "List is empty"
573
+ }, null, 8, Dt)
574
+ ]),
575
+ e("div", St, l(s(i)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
576
+ e("div", Ct, l(s(i)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
577
+ I(G),
578
+ I(G)
579
+ ])) : f("", !0),
580
+ ($ = t.purchaseOrder) != null && $.deliveryOrder && ((Y = t.purchaseOrder) == null ? void 0 : Y.deliveryOrder.length) > 0 ? (d(), h("div", At, [
581
+ (d(!0), h(X, null, oe((J = t.purchaseOrder) == null ? void 0 : J.deliveryOrder, (u, R) => (d(), h(X, { key: R }, [
582
+ e("div", Et, [
583
+ e("div", Pt, [
584
+ e("div", Tt, [
585
+ e("div", {
586
+ class: se([
587
+ {
588
+ "bg-fm-color-primary": R !== 0,
589
+ "bg-white": R === 0
590
+ },
591
+ "w-[2px] h-full"
592
+ ])
593
+ }, null, 2)
594
+ ]),
595
+ n[10] || (n[10] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
596
+ e("div", Nt, [
597
+ e("div", {
598
+ class: se([
599
+ {
600
+ "bg-fm-color-primary": R < t.purchaseOrder.deliveryOrder.length - 1,
601
+ "bg-white": R >= t.purchaseOrder.deliveryOrder.length - 1
602
+ },
603
+ "w-[2px] h-full"
604
+ ])
605
+ }, null, 2)
606
+ ])
607
+ ]),
608
+ e("div", Ft, [
609
+ e("div", jt, l(s(i)("inventory.transfer.receiveRequest.details.received")), 1),
610
+ e("div", It, l(s(ue)(new Date(u.createdAt))) + ", " + l(s(Ne)(new Date(u.createdAt))), 1)
611
+ ])
612
+ ]),
613
+ e("div", Ut, [
614
+ e("div", Mt, [
615
+ e("div", $t, [
616
+ e("div", {
617
+ class: se([
618
+ {
619
+ "bg-fm-color-primary": R < t.purchaseOrder.deliveryOrder.length - 1,
620
+ "bg-white": R >= t.purchaseOrder.deliveryOrder.length - 1
621
+ },
622
+ "w-[2px] h-full"
623
+ ])
624
+ }, null, 2)
625
+ ])
626
+ ]),
627
+ e("div", Kt, [
628
+ I(Q, {
629
+ variant: "outlined",
630
+ class: "py-12 px-16"
631
+ }, {
632
+ default: te(() => [
633
+ e("div", Lt, [
634
+ e("div", Vt, [
635
+ e("div", Bt, l(s(i)("inventory.transfer.receiveRequest.details.receivedBy")), 1),
636
+ e("div", Gt, l(u.createdBy.name), 1)
637
+ ]),
638
+ e("div", Ht, [
639
+ e("div", zt, l(s(i)("inventory.transfer.receiveRequest.details.receivedItems")), 1),
640
+ (d(!0), h(X, null, oe(u.received, (x) => (d(), h("div", {
641
+ class: "fm-typo-en-body-lg-600",
642
+ key: x.sku._id
643
+ }, l(x.sku.name) + " " + l(s(le)(x.amount, x.sku.unit, x.measurement)), 1))), 128))
644
+ ]),
645
+ e("div", Qt, [
646
+ e("div", Yt, l(s(i)("inventory.transfer.receiveRequest.details.deliveryOrderNo")), 1),
647
+ e("div", Jt, l(u.deliveryOrderNumber.trim().length ? u.deliveryOrderNumber : "-"), 1)
648
+ ]),
649
+ e("div", Wt, [
650
+ u.remark ? (d(), h("div", Xt, l(s(i)("inventory.transfer.receiveRequest.details.deliveryRemark")), 1)) : f("", !0),
651
+ e("div", Zt, l(u.remark), 1)
652
+ ])
653
+ ])
654
+ ]),
655
+ _: 2
656
+ }, 1024)
657
+ ])
658
+ ])
659
+ ], 64))), 128))
660
+ ])) : f("", !0)
661
+ ])) : f("", !0)
662
+ ])
663
+ ];
664
+ }),
665
+ "side-sheet-footer": te(() => {
666
+ var E, F, j, $, Y, J, u, R, x, W;
667
+ return [
668
+ e("div", es, [
669
+ ((E = t.purchaseOrder) == null ? void 0 : E.status) === s(q).enum.DRAFT && U.value === s(Z).PURCHASE ? (d(), P(w, {
670
+ key: 0,
671
+ label: s(i)("inventory.transfer.receiveRequest.actions.confirmDraft"),
672
+ onClick: n[1] || (n[1] = (C) => M("confirmDraft")),
673
+ loading: a.value === "confirmDraft",
674
+ disabled: a.value !== "confirmDraft" && o.value
675
+ }, null, 8, ["label", "loading", "disabled"])) : f("", !0),
676
+ ((F = t.purchaseOrder) == null ? void 0 : F.status) === s(q).enum.DRAFT && U.value === s(Z).TRANSFER ? (d(), P(w, {
677
+ key: 1,
678
+ label: s(i)("inventory.transfer.receiveRequest.actions.submitRequest"),
679
+ onClick: n[2] || (n[2] = (C) => M("submitRequest")),
680
+ loading: a.value === "submitRequest",
681
+ disabled: a.value !== "submitRequest" && o.value
682
+ }, null, 8, ["label", "loading", "disabled"])) : f("", !0),
683
+ ((j = t.purchaseOrder) == null ? void 0 : j.status) === s(q).enum.DRAFT ? (d(), P(w, {
684
+ key: 2,
685
+ label: s(i)("inventory.transfer.receiveRequest.actions.cancelDraft"),
686
+ onClick: n[3] || (n[3] = (C) => M("cancelDraft")),
687
+ loading: a.value === "cancelDraft",
688
+ disabled: a.value !== "cancelDraft" && o.value,
689
+ variant: "destructive"
690
+ }, null, 8, ["label", "loading", "disabled"])) : f("", !0),
691
+ (($ = t.purchaseOrder) == null ? void 0 : $.status) === s(q).enum.RECEIVING ? (d(), P(w, {
692
+ key: 3,
693
+ label: s(i)("inventory.transfer.receiveRequest.actions.completeReceive"),
694
+ onClick: n[4] || (n[4] = (C) => M("completeReceive")),
695
+ loading: a.value === "completeReceive",
696
+ disabled: a.value !== "completeReceive" && o.value
697
+ }, null, 8, ["label", "loading", "disabled"])) : f("", !0),
698
+ t.canResubmit ? (d(), P(w, {
699
+ key: 4,
700
+ label: s(i)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
701
+ onClick: n[5] || (n[5] = (C) => M("submitRequest")),
702
+ loading: a.value === "submitRequest",
703
+ disabled: a.value !== "submitRequest" && o.value
704
+ }, null, 8, ["label", "loading", "disabled"])) : f("", !0),
705
+ (((Y = t.purchaseOrder) == null ? void 0 : Y.status) === s(q).enum.REQUESTING || ((J = t.purchaseOrder) == null ? void 0 : J.status) === s(q).enum.PROCESSING) && t.canApprove ? (d(), P(w, {
706
+ key: 5,
707
+ label: s(i)("inventory.transfer.approval.actions.approveRequest"),
708
+ onClick: n[6] || (n[6] = (C) => M("approveRequest")),
709
+ loading: a.value === "approveRequest",
710
+ disabled: a.value !== "approveRequest" && o.value
711
+ }, null, 8, ["label", "loading", "disabled"])) : f("", !0),
712
+ ((u = t.purchaseOrder) == null ? void 0 : u.status) === s(q).enum.REQUESTING && t.canApprove ? (d(), P(w, {
713
+ key: 6,
714
+ label: s(i)("inventory.transfer.approval.actions.rejectRequest"),
715
+ onClick: n[7] || (n[7] = (C) => M("rejectRequest")),
716
+ loading: a.value === "rejectRequest",
717
+ disabled: a.value !== "rejectRequest" && o.value,
718
+ variant: "destructive"
719
+ }, null, 8, ["label", "loading", "disabled"])) : f("", !0),
720
+ ((R = t.purchaseOrder) == null ? void 0 : R.status) !== s(q).enum.COMPLETE && ((x = t.purchaseOrder) == null ? void 0 : x.status) !== s(q).enum.CANCEL && (((W = t.purchaseOrder) == null ? void 0 : W.status) !== s(q).enum.REQUESTING || t.canApprove) ? (d(), P(w, {
721
+ key: 7,
722
+ label: s(i)("common.close"),
723
+ variant: "tertiary",
724
+ onClick: n[8] || (n[8] = (C) => r("update:show", !1))
725
+ }, null, 8, ["label"])) : f("", !0)
726
+ ])
727
+ ];
728
+ }),
729
+ _: 1
730
+ }, 8, ["header", "modelValue", "dismiss-away"]);
731
+ };
732
+ }
733
+ });
734
+ export {
735
+ ds as _,
736
+ Le as g,
737
+ us as u
738
+ };