@feedmepos/mf-inventory-portal 1.2.63-dev.1 → 1.2.63
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.
- package/dist/{App-BHssUobV.js → App-W35c1JM6.js} +78 -82
- package/dist/{ApprovalView-DRGCQeGY.js → ApprovalView-qZaYBUOw.js} +5 -5
- package/dist/{BindingsDialog-CWl3LpdO.js → BindingsDialog-Bgvqj142.js} +5 -5
- package/dist/{BindingsPicker-BcASw3JJ.js → BindingsPicker-BlUUKBUF.js} +3 -3
- package/dist/{BindingsTable-BiKiLiVY.js → BindingsTable-Bb2CUGOE.js} +5 -5
- package/dist/{ClosingDraftView-mh5Kw46x.js → ClosingDraftView-BgIB7VGF.js} +216 -217
- package/dist/{ClosingHistoryView-C-ZrFei9.js → ClosingHistoryView-BNrhBSY1.js} +36 -36
- package/dist/{ClosingTemplateView-DBNRH0Tt.js → ClosingTemplateView-BHexv7IS.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-Dv3JZ3yr.js → DeliveryOrderPrintPreview-b6HAqBJ3.js} +7 -7
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CfL1adhx.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BMZ6uK2r.js} +16 -16
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Db0JeXbc.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DTN2FDK5.js} +2 -2
- package/dist/{FmMultiselectDialog-DuYKQng9.js → FmMultiselectDialog-BRhLiA42.js} +16 -16
- package/dist/{FmMultiselectDialog-D9g07F_c.js → FmMultiselectDialog-ClPRjx_J.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CeXRT7Lf.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6jUtx5F.js} +22 -23
- package/dist/{ImportView-DoMyJ1NE.js → ImportView-D0oguV-P.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CqJQcOBK.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-05HRp0Rw.js} +1 -1
- package/dist/{IngredientGroupView-D_Cl4kJy.js → IngredientGroupView-C8qcgsqS.js} +5 -5
- package/dist/{IngredientsView-CG6wUGzt.js → IngredientsView-DZLBIxnp.js} +24 -25
- package/dist/{IntegrationView-BIWPp1JH.js → IntegrationView-DoLRBfXS.js} +17 -18
- package/dist/{InventoryBindingForm-BrL6-2He.js → InventoryBindingForm-Ddc2xNun.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-M3uVquEq.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Drnfo6QF.js} +16 -17
- package/dist/{InventoryBindingSummary-mnlQU1Mp.js → InventoryBindingSummary-C9G9UNHE.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ByPOKZRm.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C-2ZqPDQ.js} +5 -5
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DHwXNoTs.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CCFfnd1y.js} +2 -2
- package/dist/{PublishView-B4iVMq25.js → PublishView-CA0ndWK1.js} +8 -8
- package/dist/{PurchaseOrderPrintPreview-ws-SKrEC.js → PurchaseOrderPrintPreview-C0fSwRzh.js} +11 -11
- package/dist/{ReceiveRequestView-deSiORNX.js → ReceiveRequestView-7LQVLMw_.js} +142 -143
- package/dist/RecipeView-C970Tbje.js +646 -0
- package/dist/{StockView-6j_t2Kf1.js → StockView-DMFw_TH_.js} +105 -106
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CgAMsW8n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BnBRHve2.js} +1 -1
- package/dist/{SupplierView-D5tSOECx.js → SupplierView-BgwlWXfk.js} +19 -20
- package/dist/{SurchargeView-CP81Q4dW.js → SurchargeView-Cg6fbAF-.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bmuw4PTO.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-B65wyG1T.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D1FuB-kv.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-jjtyBmso.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Canrz2ri.js → TransferDetails.vue_vue_type_script_setup_true_lang-Gi-bL9hh.js} +124 -124
- package/dist/{TransferTemplateView-CRI_Lexa.js → TransferTemplateView-B54hUzme.js} +21 -22
- package/dist/{UnitView-BZmfd-aw.js → UnitView-DOfJbxkC.js} +10 -11
- package/dist/{WarehouseView-BcmSyjA0.js → WarehouseView-x7UBmz1U.js} +5 -5
- package/dist/{WastageTemplateView-CNsdu0ga.js → WastageTemplateView-DyAlJgfd.js} +14 -14
- package/dist/api/inventory.d.ts +36 -126
- package/dist/api/netsuite.d.ts +1 -8
- package/dist/{app-ayv5Jw7D.js → app-CA2Cny0i.js} +7036 -8041
- package/dist/app.d.ts +0 -228
- package/dist/app.js +1 -1
- package/dist/{closing-template-D9UR8sMo.js → closing-template-DTv1fwBu.js} +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -37
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +0 -14
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -16
- package/dist/{date2-GNP-79dA.js → date2-Cp4YfWcb.js} +1 -1
- package/dist/{dayjs.min-Bg_wgP2J.js → dayjs.min-CgirzsHV.js} +16 -16
- package/dist/{defineDeepModel-Co03tZfS.js → defineDeepModel-D9OlXcS_.js} +1 -1
- package/dist/{duplicate-template-BiPU4Z2Y.js → duplicate-template-DyCBVMov.js} +1 -1
- package/dist/{feature-BGeFfaiX.js → feature-BxsRwVch.js} +89 -94
- package/dist/{format-time-from-id-ByV0VX1x.js → format-time-from-id-BusUCMUA.js} +1 -1
- package/dist/{format-unit-display-r1Hb4DfH.js → format-unit-display-BvtbVzxs.js} +15 -16
- package/dist/{import-export.helper-PB9pPO3m.js → import-export.helper-B3Le8F5L.js} +15 -16
- package/dist/{index-DWWlEK_r.js → index-CLSRasCh.js} +1412 -1471
- package/dist/{index-ClbYCYSU.js → index-DzJrZhr1.js} +3 -3
- package/dist/{index-DMqOVOHw.js → index-f9YwK5uk.js} +1 -1
- package/dist/{lodash-BbWPSHMM.js → lodash--YJHqtef.js} +1 -1
- package/dist/{netsuite-VGghPz8h.js → netsuite-CBG_dy7k.js} +92 -92
- package/dist/{purchase-order-template-BMNxJR59.js → purchase-order-template-sK4yLnG5.js} +1 -1
- package/dist/router/name.d.ts +0 -1
- package/dist/rules-DPShesHe.js +327 -0
- package/dist/{stock-b7nNc6ko.js → stock-iBLjW3Y5.js} +1 -1
- package/dist/stock-q7nfubr2.js +75 -0
- package/dist/stores/feature.d.ts +0 -2
- package/dist/stores/integration/netsuite.d.ts +1 -8
- package/dist/stores/inventory.d.ts +30 -119
- package/dist/{supplier-Dm-bxVXL.js → supplier-pjh8CQtC.js} +2 -2
- package/dist/{surcharge-ZM-_XIvY.js → surcharge-CN4HYoU0.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BYxTRqif.js → use-ingredient-select-dialog-Do34jWZ9.js} +2 -2
- package/dist/{use-inventory-binding-dialog-Dg9Mp0Vk.js → use-inventory-binding-dialog-CH_yEZAR.js} +2 -2
- package/dist/{use-template-enabled-locations-2-BmgcViqJ.js → use-template-enabled-locations-2-DDUlfrLq.js} +2 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -64
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +24 -192
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -8
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +12 -96
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +12 -96
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +18 -18
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +0 -14
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +4 -32
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -28
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -8
- package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +2 -16
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -33
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +2 -16
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +4 -32
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -8
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +6 -41
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +36 -246
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -287
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +0 -16
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +0 -1
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -16
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +2 -16
- package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +2 -16
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +2 -16
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +1 -8
- package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +3 -24
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +12 -96
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +12 -96
- package/dist/{vue-i18n-BwxQzDKn.js → vue-i18n-CVbjsMxl.js} +538 -538
- package/dist/{xlsx-dJMIfias.js → xlsx-CSeMIpYz.js} +1 -1
- package/dist/{xlsx.util-dclbjq8C.js → xlsx.util-CsYD8XWC.js} +1 -1
- package/package.json +3 -3
- package/dist/RecipeView-EEK7PiKl.js +0 -1558
- package/dist/UnitCostHistoryView-CT-4QDK8.js +0 -651
- package/dist/api/unit-cost-history.d.ts +0 -28
- package/dist/number-DPuTdA-J.js +0 -232
- package/dist/rules-CyF-4tvp.js +0 -98
- package/dist/stock-D1SElOsp.js +0 -75
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -169
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingAlternative.vue.d.ts +0 -43
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingRule.vue.d.ts +0 -25
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +0 -125
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventorySkuBindingV2Field.vue.d.ts +0 -129
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-alternative-table.d.ts +0 -30
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -4
- package/dist/views/unit-cost-history/UnitCostHistoryView.vue.d.ts +0 -2
- package/dist/views/unit-cost-history/components/UnitCostDetailsSideSheet.vue.d.ts +0 -19
- package/dist/views/unit-cost-history/components/UnitCostRecalculationDialog.vue.d.ts +0 -11
- package/dist/views/unit-cost-history/composables/use-unit-cost-history.d.ts +0 -65
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { defineComponent as Ve, ref as Y, computed as U, onMounted as et, resolveComponent as O, openBlock as
|
|
1
|
+
import { defineComponent as Ve, ref as Y, computed as U, onMounted as et, resolveComponent as O, openBlock as D, createElementBlock as R, Fragment as ce, createTextVNode as ue, createBlock as pe, withCtx as q, createElementVNode as n, toDisplayString as W, unref as v, createVNode as k, createCommentVNode as se, h as S, watch as He, renderList as je, reactive as Lt, isRef as kt, normalizeClass as Ie, normalizeStyle as xt, Teleport as Et, mergeProps as zt } from "vue";
|
|
2
2
|
import { F as bt, u as Ht, _ as Ot } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as at, useDialog as Kt, components as
|
|
5
|
-
import { o as Gt, u as Ge,
|
|
3
|
+
import { useCoreStore as At, useI18n as tt } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as at, useDialog as Kt, components as _e, useProxiedModel as Yt, useBreakpoints as qt } from "@feedmepos/ui-library";
|
|
5
|
+
import { o as Gt, u as Ge, J as Z, w as H, s as Dt, v as Ue, K as ke, B as Oe, c as Qt, a as wt } from "./app-CA2Cny0i.js";
|
|
6
6
|
import { defineStore as St, storeToRefs as Wt } from "pinia";
|
|
7
|
-
import { d as Ye, e as Ct, f as Zt, a as
|
|
8
|
-
import { R as Jt } from "./rules-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as ot } from "./stock-b7nNc6ko.js";
|
|
7
|
+
import { d as Ye, e as Ct, f as Zt, a as Ae } from "./date2-Cp4YfWcb.js";
|
|
8
|
+
import { R as Jt, f as nt, a as Xe, t as Xt, d as Re, p as $t, q as Ft, m as Bt, o as Tt, r as te, F as ea } from "./rules-DPShesHe.js";
|
|
9
|
+
import { b as ta, d as aa } from "./xlsx.util-CsYD8XWC.js";
|
|
10
|
+
import { u as jt } from "./stock-q7nfubr2.js";
|
|
11
|
+
import { u as ot } from "./stock-iBLjW3Y5.js";
|
|
13
12
|
import { D as ht, R as Te } from "./row-action.enum-BcW_L_nE.js";
|
|
14
13
|
import { c as na } from "./component-DpCUABT3.js";
|
|
15
|
-
import { f as oa } from "./format-time-from-id-
|
|
16
|
-
import { _ as sa } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
14
|
+
import { f as oa } from "./format-time-from-id-BusUCMUA.js";
|
|
15
|
+
import { _ as sa } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DTN2FDK5.js";
|
|
17
16
|
import { E as ra } from "./empty-placeholder-wf6-BWE8.js";
|
|
18
|
-
import { u as la } from "./vue-i18n-
|
|
17
|
+
import { u as la } from "./vue-i18n-CVbjsMxl.js";
|
|
19
18
|
import { _ as ia, F as ze } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
20
19
|
const Qe = Gt((c, s) => {
|
|
21
20
|
function e() {
|
|
@@ -23,27 +22,27 @@ const Qe = Gt((c, s) => {
|
|
|
23
22
|
}
|
|
24
23
|
return {
|
|
25
24
|
async getDraft(u) {
|
|
26
|
-
const
|
|
25
|
+
const _ = e(), h = `${c.inventoryBackendUrl}/${_}/closing-draft/${u}`;
|
|
27
26
|
return s.get(h);
|
|
28
27
|
},
|
|
29
28
|
async readDrafts() {
|
|
30
|
-
const u = e(),
|
|
31
|
-
return s.get(
|
|
29
|
+
const u = e(), _ = `${c.inventoryBackendUrl}/${u}/closing-draft`;
|
|
30
|
+
return s.get(_);
|
|
32
31
|
},
|
|
33
32
|
async runOperation(u) {
|
|
34
|
-
const
|
|
33
|
+
const _ = e(), h = `${c.inventoryBackendUrl}/${_}/closing-draft/run-operation`;
|
|
35
34
|
return s.post(h, u);
|
|
36
35
|
},
|
|
37
36
|
async runOperationV1(u) {
|
|
38
|
-
const
|
|
37
|
+
const _ = e(), h = `${c.inventoryBackendUrl}/${_}/closing-draft/v1/run-operation`;
|
|
39
38
|
return s.post(h, u);
|
|
40
39
|
},
|
|
41
40
|
async sync(u) {
|
|
42
|
-
const
|
|
41
|
+
const _ = e(), h = `${c.inventoryBackendUrl}/${_}/closing-draft/sync`;
|
|
43
42
|
return s.post(h, u);
|
|
44
43
|
},
|
|
45
44
|
async cloneDraft(u) {
|
|
46
|
-
const
|
|
45
|
+
const _ = e(), h = `${c.inventoryBackendUrl}/${_}/closing-draft/${u}/clone`;
|
|
47
46
|
return s.post(h, {});
|
|
48
47
|
}
|
|
49
48
|
};
|
|
@@ -62,7 +61,7 @@ const Qe = Gt((c, s) => {
|
|
|
62
61
|
onFinished: { type: Function }
|
|
63
62
|
},
|
|
64
63
|
setup(c) {
|
|
65
|
-
const s = c, e = Y(), u = Qe(),
|
|
64
|
+
const s = c, e = Y(), u = Qe(), _ = at(), h = Y(!1), r = Y(null), L = Y(!1), V = U(() => {
|
|
66
65
|
switch (s.action) {
|
|
67
66
|
case Z.enum.approveDraft:
|
|
68
67
|
return "Approve";
|
|
@@ -134,13 +133,13 @@ const Qe = Gt((c, s) => {
|
|
|
134
133
|
effectiveAt: r.value ? r.value.toISOString() : null,
|
|
135
134
|
remark: e.value
|
|
136
135
|
}
|
|
137
|
-
}).delayed(500),
|
|
136
|
+
}).delayed(500), _.open({
|
|
138
137
|
title: "Success",
|
|
139
138
|
message: "Action submitted",
|
|
140
139
|
type: "success"
|
|
141
140
|
}), s.onFinished();
|
|
142
141
|
} catch (t) {
|
|
143
|
-
|
|
142
|
+
_.open({
|
|
144
143
|
title: "Something went wrong",
|
|
145
144
|
message: (t == null ? void 0 : t.message) ?? "Unable to submit action. Please try again",
|
|
146
145
|
type: "error"
|
|
@@ -150,8 +149,8 @@ const Qe = Gt((c, s) => {
|
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
151
|
return (d, t) => {
|
|
153
|
-
const j = O("FmLabel"),
|
|
154
|
-
return L.value ? (
|
|
152
|
+
const j = O("FmLabel"), A = O("FmDatePicker"), Q = O("FmTimePicker"), y = O("FmTextField"), m = O("FmButton"), F = O("FmForm");
|
|
153
|
+
return L.value ? (D(), pe(F, {
|
|
155
154
|
key: 1,
|
|
156
155
|
onValidationSuccess: K,
|
|
157
156
|
class: "flex flex-col gap-32",
|
|
@@ -163,31 +162,31 @@ const Qe = Gt((c, s) => {
|
|
|
163
162
|
n("span", ua, W(V.value), 1),
|
|
164
163
|
t[5] || (t[5] = ue(" this draft. Please provide a remark to justify this action. "))
|
|
165
164
|
]),
|
|
166
|
-
d.action === v(Z).enum.approveDraft ? (
|
|
167
|
-
|
|
165
|
+
d.action === v(Z).enum.approveDraft ? (D(), R("div", da, [
|
|
166
|
+
k(j, { class: "fm-typo-en-body-lg-600" }, {
|
|
168
167
|
default: q(() => t[6] || (t[6] = [
|
|
169
168
|
ue("Closing Date")
|
|
170
169
|
])),
|
|
171
170
|
_: 1
|
|
172
171
|
}),
|
|
173
|
-
|
|
172
|
+
k(A, {
|
|
174
173
|
modelValue: x.value,
|
|
175
174
|
"onUpdate:modelValue": t[0] || (t[0] = (z) => x.value = z),
|
|
176
175
|
max: v(Ye)(/* @__PURE__ */ new Date())
|
|
177
176
|
}, null, 8, ["modelValue", "max"]),
|
|
178
|
-
|
|
177
|
+
k(j, { class: "fm-typo-en-body-lg-600" }, {
|
|
179
178
|
default: q(() => t[7] || (t[7] = [
|
|
180
179
|
ue("Closing Time")
|
|
181
180
|
])),
|
|
182
181
|
_: 1
|
|
183
182
|
}),
|
|
184
|
-
|
|
183
|
+
k(Q, {
|
|
185
184
|
modelValue: M.value,
|
|
186
185
|
"onUpdate:modelValue": t[1] || (t[1] = (z) => M.value = z)
|
|
187
186
|
}, null, 8, ["modelValue"]),
|
|
188
|
-
G.value ? (
|
|
187
|
+
G.value ? (D(), R("div", ma, " Cannot select future date ")) : se("", !0)
|
|
189
188
|
])) : se("", !0),
|
|
190
|
-
|
|
189
|
+
k(y, {
|
|
191
190
|
modelValue: e.value,
|
|
192
191
|
"onUpdate:modelValue": t[2] || (t[2] = (z) => e.value = z),
|
|
193
192
|
label: "Remark",
|
|
@@ -195,12 +194,12 @@ const Qe = Gt((c, s) => {
|
|
|
195
194
|
rules: [v(Jt)()]
|
|
196
195
|
}, null, 8, ["modelValue", "rules"]),
|
|
197
196
|
n("div", fa, [
|
|
198
|
-
|
|
197
|
+
k(m, {
|
|
199
198
|
label: "Cancel",
|
|
200
199
|
variant: "tertiary",
|
|
201
200
|
onClick: t[3] || (t[3] = (z) => d.onCancel())
|
|
202
201
|
}),
|
|
203
|
-
|
|
202
|
+
k(m, {
|
|
204
203
|
label: V.value,
|
|
205
204
|
type: "submit",
|
|
206
205
|
variant: I.value,
|
|
@@ -209,22 +208,22 @@ const Qe = Gt((c, s) => {
|
|
|
209
208
|
])
|
|
210
209
|
]),
|
|
211
210
|
_: 1
|
|
212
|
-
}, 8, ["disabled"])) : (
|
|
211
|
+
}, 8, ["disabled"])) : (D(), R(ce, { key: 0 }, [
|
|
213
212
|
ue("Loading")
|
|
214
213
|
], 64));
|
|
215
214
|
};
|
|
216
215
|
}
|
|
217
216
|
}), pa = Re(0);
|
|
218
217
|
function It(c) {
|
|
219
|
-
const s = c.measurementsAmounts.groupBy((u) => u.measurement.id), e = c.sku.unit.measurements.reduce((u,
|
|
218
|
+
const s = c.measurementsAmounts.groupBy((u) => u.measurement.id), e = c.sku.unit.measurements.reduce((u, _) => {
|
|
220
219
|
var L, V;
|
|
221
|
-
const h = ((V = (L = s.get(
|
|
220
|
+
const h = ((V = (L = s.get(_.id)) == null ? void 0 : L[0]) == null ? void 0 : V.amount) ?? pa, r = nt(_.conversion, h);
|
|
222
221
|
return u + +Xe(r);
|
|
223
222
|
}, +Xe(c.baseAmount));
|
|
224
223
|
return Xt(e, c.baseAmount.precision);
|
|
225
224
|
}
|
|
226
225
|
const va = Re(0), ya = Re(100);
|
|
227
|
-
function ga(c, s, e, u,
|
|
226
|
+
function ga(c, s, e, u, _, h, r) {
|
|
228
227
|
var ne, le, me, $, w;
|
|
229
228
|
const L = It(c), V = u ?? L, I = $t(V, s), x = s.amount === 0 ? null : Ft(I, {
|
|
230
229
|
...s,
|
|
@@ -234,7 +233,7 @@ function ga(c, s, e, u, k, h, r) {
|
|
|
234
233
|
precision: 0
|
|
235
234
|
}, t = Number(
|
|
236
235
|
H.toFormatString({ value: d })
|
|
237
|
-
), j =
|
|
236
|
+
), j = _ ? Number(H.toFormatString({ value: _ })) : 0, A = Number(H.toFormatString({ value: s })), Q = Number(H.toFormatString({ value: V })), y = Q - A, m = y * K / t, F = Q * K / t, z = A * K / t, ae = {};
|
|
238
237
|
return r && h && r.forEach((g) => {
|
|
239
238
|
const P = { amount: 0, precision: 0 }, J = h[g];
|
|
240
239
|
if (J) {
|
|
@@ -254,7 +253,7 @@ function ga(c, s, e, u, k, h, r) {
|
|
|
254
253
|
(g, P, J) => (g[`measurementAbbrev${J}`] = `(${P.measurement.abbrev}) × ${H.toFormatString({ value: P.measurement.conversion })}`, g[`measurementAmount${J}`] = Number(H.toFormatString({ value: P.amount })), g),
|
|
255
254
|
{}
|
|
256
255
|
),
|
|
257
|
-
systemBalance:
|
|
256
|
+
systemBalance: A,
|
|
258
257
|
physicalBalance: Q,
|
|
259
258
|
adjustedAmount: Number(H.toFormatString({ value: I })),
|
|
260
259
|
adjustedDiffPercentage: M ? Number(
|
|
@@ -278,8 +277,8 @@ function ha(c) {
|
|
|
278
277
|
const s = Pt(c);
|
|
279
278
|
return c.reduce(
|
|
280
279
|
(e, u) => {
|
|
281
|
-
var
|
|
282
|
-
return Math.max(e, ((
|
|
280
|
+
var _;
|
|
281
|
+
return Math.max(e, ((_ = s == null ? void 0 : s.get(u.sku._id)) == null ? void 0 : _[0].length) ?? 0);
|
|
283
282
|
},
|
|
284
283
|
0
|
|
285
284
|
);
|
|
@@ -290,8 +289,8 @@ function Pt(c) {
|
|
|
290
289
|
(s) => s.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
291
290
|
);
|
|
292
291
|
}
|
|
293
|
-
function
|
|
294
|
-
const e =
|
|
292
|
+
function _a(c, s = []) {
|
|
293
|
+
const e = Dt(), u = e === "MYR" ? "RM" : e;
|
|
295
294
|
return [
|
|
296
295
|
{
|
|
297
296
|
id: "code",
|
|
@@ -366,12 +365,12 @@ function ka(c, s = []) {
|
|
|
366
365
|
])
|
|
367
366
|
];
|
|
368
367
|
}
|
|
369
|
-
function
|
|
368
|
+
function ka(c, s, e) {
|
|
370
369
|
var ae, de, ne, le, me, $, w;
|
|
371
370
|
const u = s.groupBy(
|
|
372
371
|
(g) => g.id,
|
|
373
372
|
(g) => g.balance
|
|
374
|
-
),
|
|
373
|
+
), _ = e.groupBy(
|
|
375
374
|
(g) => g.id,
|
|
376
375
|
(g) => g.balance
|
|
377
376
|
), h = /* @__PURE__ */ new Map();
|
|
@@ -387,21 +386,21 @@ function _a(c, s, e) {
|
|
|
387
386
|
r.has(g) && (I.push(g), r.delete(g));
|
|
388
387
|
});
|
|
389
388
|
const x = Array.from(r).sort(), M = [...I, ...x], G = [...c.items, ...c.negativeStockItems ?? []], K = Pt(G), d = G.map((g) => {
|
|
390
|
-
var xe,
|
|
391
|
-
const P = ((xe = u.get(g.sku._id)) == null ? void 0 : xe[0]) ?? va, J = ((
|
|
389
|
+
var xe, De, be;
|
|
390
|
+
const P = ((xe = u.get(g.sku._id)) == null ? void 0 : xe[0]) ?? va, J = ((De = K == null ? void 0 : K.get(g.sku._id)) == null ? void 0 : De[0]) ?? [], ee = h.get(g.sku._id), X = L.get(g.sku._id);
|
|
392
391
|
return ga(
|
|
393
392
|
g,
|
|
394
393
|
P,
|
|
395
394
|
J,
|
|
396
|
-
(be =
|
|
395
|
+
(be = _.get(g.sku._id)) == null ? void 0 : be[0],
|
|
397
396
|
ee,
|
|
398
397
|
X,
|
|
399
398
|
M
|
|
400
399
|
);
|
|
401
|
-
}), t = ha(G),
|
|
402
|
-
["Business name:",
|
|
403
|
-
["Business ID:",
|
|
404
|
-
["Menu version",
|
|
400
|
+
}), t = ha(G), A = At().currentBusiness.value, Q = _a(t, M), y = [
|
|
401
|
+
["Business name:", A == null ? void 0 : A.name],
|
|
402
|
+
["Business ID:", A == null ? void 0 : A._id],
|
|
403
|
+
["Menu version", A == null ? void 0 : A.menuVersion],
|
|
405
404
|
["Created at", new Date(c.createdAt)],
|
|
406
405
|
["Created by", (ae = c.createdBy) == null ? void 0 : ae.name],
|
|
407
406
|
["Updated at", new Date(c.updatedAt)],
|
|
@@ -422,13 +421,13 @@ function _a(c, s, e) {
|
|
|
422
421
|
[],
|
|
423
422
|
Q.map((g) => g.name),
|
|
424
423
|
...d.map((g) => Q.map((P) => g[P.id]))
|
|
425
|
-
], m = Q.map((g) => `system:${g.id}`), F = ta(y, m), z = `[${
|
|
424
|
+
], m = Q.map((g) => `system:${g.id}`), F = ta(y, m), z = `[${A == null ? void 0 : A.name}] closing draft (${Zt(new Date(c.updatedAt))}).xlsx`;
|
|
426
425
|
return aa(F, z), z;
|
|
427
426
|
}
|
|
428
|
-
const xa = { class: "flex flex-col" },
|
|
427
|
+
const xa = { class: "flex flex-col" }, Aa = {
|
|
429
428
|
key: 0,
|
|
430
429
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
|
|
431
|
-
},
|
|
430
|
+
}, Da = { class: "flex gap-12 py-8 justify-end w-full" }, wa = /* @__PURE__ */ Ve({
|
|
432
431
|
__name: "RefreshBalanceAction",
|
|
433
432
|
props: {
|
|
434
433
|
draft: {},
|
|
@@ -438,7 +437,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
438
437
|
setup(c) {
|
|
439
438
|
const s = c;
|
|
440
439
|
ot();
|
|
441
|
-
const e = Y(!1), u = Y(null),
|
|
440
|
+
const e = Y(!1), u = Y(null), _ = Y(!1);
|
|
442
441
|
et(() => {
|
|
443
442
|
if (s.draft.effectiveAt)
|
|
444
443
|
u.value = new Date(s.draft.effectiveAt);
|
|
@@ -446,7 +445,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
446
445
|
const I = new Date(s.draft.createdAt);
|
|
447
446
|
I.setHours(23, 59, 59, 999), u.value = I;
|
|
448
447
|
}
|
|
449
|
-
|
|
448
|
+
_.value = !0;
|
|
450
449
|
});
|
|
451
450
|
const h = U({
|
|
452
451
|
get() {
|
|
@@ -476,7 +475,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
476
475
|
}
|
|
477
476
|
return (I, x) => {
|
|
478
477
|
const M = O("FmLabel"), G = O("FmDatePicker"), K = O("FmTimePicker"), d = O("FmButton"), t = O("FmForm");
|
|
479
|
-
return
|
|
478
|
+
return _.value ? (D(), pe(t, {
|
|
480
479
|
key: 1,
|
|
481
480
|
onValidationSuccess: V,
|
|
482
481
|
class: "flex flex-col gap-32",
|
|
@@ -496,36 +495,36 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
496
495
|
])
|
|
497
496
|
], -1)),
|
|
498
497
|
n("div", xa, [
|
|
499
|
-
|
|
498
|
+
k(M, { class: "fm-typo-en-body-lg-600" }, {
|
|
500
499
|
default: q(() => x[3] || (x[3] = [
|
|
501
500
|
ue("Closing Date")
|
|
502
501
|
])),
|
|
503
502
|
_: 1
|
|
504
503
|
}),
|
|
505
|
-
|
|
504
|
+
k(G, {
|
|
506
505
|
modelValue: h.value,
|
|
507
506
|
"onUpdate:modelValue": x[0] || (x[0] = (j) => h.value = j),
|
|
508
507
|
max: v(Ye)(/* @__PURE__ */ new Date())
|
|
509
508
|
}, null, 8, ["modelValue", "max"]),
|
|
510
|
-
|
|
509
|
+
k(M, { class: "fm-typo-en-body-lg-600" }, {
|
|
511
510
|
default: q(() => x[4] || (x[4] = [
|
|
512
511
|
ue("Closing Time")
|
|
513
512
|
])),
|
|
514
513
|
_: 1
|
|
515
514
|
}),
|
|
516
|
-
|
|
515
|
+
k(K, {
|
|
517
516
|
modelValue: r.value,
|
|
518
517
|
"onUpdate:modelValue": x[1] || (x[1] = (j) => r.value = j)
|
|
519
518
|
}, null, 8, ["modelValue"]),
|
|
520
|
-
L.value ? (
|
|
519
|
+
L.value ? (D(), R("div", Aa, " Cannot select future date ")) : se("", !0)
|
|
521
520
|
]),
|
|
522
|
-
n("div",
|
|
523
|
-
|
|
521
|
+
n("div", Da, [
|
|
522
|
+
k(d, {
|
|
524
523
|
label: "Cancel",
|
|
525
524
|
variant: "tertiary",
|
|
526
525
|
onClick: x[2] || (x[2] = (j) => I.onCancel())
|
|
527
526
|
}),
|
|
528
|
-
|
|
527
|
+
k(d, {
|
|
529
528
|
label: "Refresh balance",
|
|
530
529
|
type: "submit",
|
|
531
530
|
variant: "primary",
|
|
@@ -535,7 +534,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
535
534
|
])
|
|
536
535
|
]),
|
|
537
536
|
_: 1
|
|
538
|
-
}, 8, ["disabled"])) : (
|
|
537
|
+
}, 8, ["disabled"])) : (D(), R(ce, { key: 0 }, [
|
|
539
538
|
ue("Loading")
|
|
540
539
|
], 64));
|
|
541
540
|
};
|
|
@@ -543,7 +542,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
543
542
|
}), qe = St(
|
|
544
543
|
"closingDraftActions",
|
|
545
544
|
function() {
|
|
546
|
-
const s = Kt(), e = at(), u = ot(),
|
|
545
|
+
const s = Kt(), e = at(), u = ot(), _ = Qe(), h = jt(), r = Y(!1), L = Y();
|
|
547
546
|
function V(y) {
|
|
548
547
|
const m = {
|
|
549
548
|
draft: y
|
|
@@ -552,7 +551,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
552
551
|
}
|
|
553
552
|
async function I(y) {
|
|
554
553
|
var F;
|
|
555
|
-
if (y.status ===
|
|
554
|
+
if (y.status === ke.enum.COMPLETED) {
|
|
556
555
|
const z = y.closingAdjustmentId;
|
|
557
556
|
if (!z)
|
|
558
557
|
return e.open({
|
|
@@ -575,7 +574,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
575
574
|
m || (e.open({
|
|
576
575
|
title: "Exporting",
|
|
577
576
|
message: "Fetching data..."
|
|
578
|
-
}), m = await I(y)),
|
|
577
|
+
}), m = await I(y)), ka(y, m, F ?? []);
|
|
579
578
|
}
|
|
580
579
|
function M(y, m, F) {
|
|
581
580
|
s.open({
|
|
@@ -624,7 +623,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
624
623
|
});
|
|
625
624
|
}
|
|
626
625
|
async function d(y, m) {
|
|
627
|
-
await
|
|
626
|
+
await _.sync({
|
|
628
627
|
_id: y._id,
|
|
629
628
|
_rev: y._rev ?? "",
|
|
630
629
|
action: Z.enum.approveDraft,
|
|
@@ -655,7 +654,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
655
654
|
}
|
|
656
655
|
});
|
|
657
656
|
}
|
|
658
|
-
async function
|
|
657
|
+
async function A(y) {
|
|
659
658
|
await s.open({
|
|
660
659
|
title: "Invalidate closing draft cache",
|
|
661
660
|
message: "It will invalidate opening and stock movement cache for this draft.",
|
|
@@ -674,7 +673,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
674
673
|
e.open({
|
|
675
674
|
title: "Cloning",
|
|
676
675
|
message: "Creating a copy of the draft..."
|
|
677
|
-
}), await
|
|
676
|
+
}), await _.cloneDraft(y._id), e.open({
|
|
678
677
|
title: "Success",
|
|
679
678
|
message: "Draft cloned successfully",
|
|
680
679
|
type: "success"
|
|
@@ -699,7 +698,7 @@ const xa = { class: "flex flex-col" }, Da = {
|
|
|
699
698
|
cloneDraft: Q,
|
|
700
699
|
viewClosingDraftShow: r,
|
|
701
700
|
viewClosingDraftProps: L,
|
|
702
|
-
invalidateDraftCache:
|
|
701
|
+
invalidateDraftCache: A
|
|
703
702
|
};
|
|
704
703
|
}
|
|
705
704
|
);
|
|
@@ -718,13 +717,13 @@ function Ke(c) {
|
|
|
718
717
|
const Sa = St(
|
|
719
718
|
"closingDraftTable",
|
|
720
719
|
function() {
|
|
721
|
-
const { t: s } = tt(), e =
|
|
720
|
+
const { t: s } = tt(), e = At(), u = qe(), _ = Y(new Array()), h = Y(!1), r = Ge(), L = Qe();
|
|
722
721
|
async function V() {
|
|
723
|
-
if (
|
|
722
|
+
if (_.value = [], !!r._currentLocation) {
|
|
724
723
|
h.value = !0;
|
|
725
724
|
try {
|
|
726
725
|
const [d] = await Promise.all([L.readDrafts()]).delayed(1e3);
|
|
727
|
-
|
|
726
|
+
_.value = d.reverse();
|
|
728
727
|
} catch (d) {
|
|
729
728
|
console.log("Something went wrong when fetching drafts:", d);
|
|
730
729
|
} finally {
|
|
@@ -733,14 +732,14 @@ const Sa = St(
|
|
|
733
732
|
}
|
|
734
733
|
}
|
|
735
734
|
async function I(d) {
|
|
736
|
-
if (!
|
|
735
|
+
if (!_.value.find((t) => t._id) && r._currentLocation) {
|
|
737
736
|
h.value = !0;
|
|
738
737
|
try {
|
|
739
738
|
const [t] = await Promise.all([
|
|
740
739
|
L.getDraft(d),
|
|
741
740
|
new Promise((j) => setTimeout(j, 1e3))
|
|
742
741
|
]);
|
|
743
|
-
|
|
742
|
+
_.value = [t];
|
|
744
743
|
} catch (t) {
|
|
745
744
|
console.log("Something went wrong when fetching drafts:", t);
|
|
746
745
|
} finally {
|
|
@@ -749,7 +748,7 @@ const Sa = St(
|
|
|
749
748
|
}
|
|
750
749
|
}
|
|
751
750
|
function x(d) {
|
|
752
|
-
|
|
751
|
+
_.value = _.value.map((t) => t._id === d._id ? {
|
|
753
752
|
...d,
|
|
754
753
|
_rev: t._rev
|
|
755
754
|
} : t);
|
|
@@ -790,14 +789,14 @@ const Sa = St(
|
|
|
790
789
|
cell(d) {
|
|
791
790
|
const t = d.row.original;
|
|
792
791
|
let j = d.getValue();
|
|
793
|
-
return j || (j = Oe(t._id)),
|
|
792
|
+
return j || (j = Oe(t._id)), Ae(j);
|
|
794
793
|
},
|
|
795
794
|
enableSorting: !0,
|
|
796
795
|
size: 200
|
|
797
796
|
},
|
|
798
797
|
{
|
|
799
798
|
id: "updatedAt",
|
|
800
|
-
accessorFn: (d) =>
|
|
799
|
+
accessorFn: (d) => Ae(d.updatedAt),
|
|
801
800
|
header: () => "Updated at",
|
|
802
801
|
enableSorting: !0,
|
|
803
802
|
size: 200
|
|
@@ -837,8 +836,8 @@ const Sa = St(
|
|
|
837
836
|
enableSorting: !1,
|
|
838
837
|
cell(d) {
|
|
839
838
|
var m;
|
|
840
|
-
const t = d.row.original, j = t.status,
|
|
841
|
-
return j === "DRAFT" && y ? y.getTime() >
|
|
839
|
+
const t = d.row.original, j = t.status, A = new Date(t.updatedAt), Q = (m = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : m.computeFirst((F) => F.rejectedAt), y = Q ? new Date(Q) : null;
|
|
840
|
+
return j === "DRAFT" && y ? y.getTime() > A.getTime() ? S(
|
|
842
841
|
"div",
|
|
843
842
|
{
|
|
844
843
|
class: "flex"
|
|
@@ -881,7 +880,7 @@ const Sa = St(
|
|
|
881
880
|
id: "action",
|
|
882
881
|
cell(d) {
|
|
883
882
|
var m;
|
|
884
|
-
const t = d.row.original, j = ((m = e.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1,
|
|
883
|
+
const t = d.row.original, j = ((m = e.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1, A = [
|
|
885
884
|
ht[Te.Details],
|
|
886
885
|
ht[Te.Export]
|
|
887
886
|
], Q = [
|
|
@@ -900,7 +899,7 @@ const Sa = St(
|
|
|
900
899
|
color: "text-fm-color-typo-error",
|
|
901
900
|
value: Z.enum.markAsFailed
|
|
902
901
|
}
|
|
903
|
-
], y = j && t.status !==
|
|
902
|
+
], y = j && t.status !== ke.enum.DRAFT ? [
|
|
904
903
|
{
|
|
905
904
|
translationKey: "inventory.closing.draft.cloneDraft",
|
|
906
905
|
color: "text-fm-color-typo-primary",
|
|
@@ -909,8 +908,8 @@ const Sa = St(
|
|
|
909
908
|
] : [];
|
|
910
909
|
return na(
|
|
911
910
|
[
|
|
912
|
-
...
|
|
913
|
-
...t.status ===
|
|
911
|
+
...A,
|
|
912
|
+
...t.status === ke.enum.DRAFT ? Q : []
|
|
914
913
|
],
|
|
915
914
|
(F) => G(F, t),
|
|
916
915
|
y
|
|
@@ -924,7 +923,7 @@ const Sa = St(
|
|
|
924
923
|
}
|
|
925
924
|
}
|
|
926
925
|
],
|
|
927
|
-
drafts:
|
|
926
|
+
drafts: _,
|
|
928
927
|
loading: h,
|
|
929
928
|
fetchDrafts: V,
|
|
930
929
|
loadDraft: I,
|
|
@@ -953,7 +952,7 @@ const Sa = St(
|
|
|
953
952
|
},
|
|
954
953
|
emits: ["update:show", "refresh", "approve"],
|
|
955
954
|
setup(c, { emit: s }) {
|
|
956
|
-
const { FmStepper: e, FmStep: u, FmDialog:
|
|
955
|
+
const { FmStepper: e, FmStep: u, FmDialog: _, FmButton: h } = _e, { t: r } = la(), L = wt(), V = c, I = s, x = U(
|
|
957
956
|
() => {
|
|
958
957
|
var $, w;
|
|
959
958
|
return (($ = V.draft) == null ? void 0 : $.stockSnapshot) && ((w = V.draft) == null ? void 0 : w.stockSnapshot) !== void 0;
|
|
@@ -991,7 +990,7 @@ const Sa = St(
|
|
|
991
990
|
}), d = U({
|
|
992
991
|
get: () => V.show,
|
|
993
992
|
set: ($) => I("update:show", $)
|
|
994
|
-
}), t = Y(1), j = () => t.value > 1,
|
|
993
|
+
}), t = Y(1), j = () => t.value > 1, A = () => t.value > 2, Q = () => !1;
|
|
995
994
|
function y($) {
|
|
996
995
|
return $ === 1 ? x.value : $ === 2 ? K.value.length == 0 : !1;
|
|
997
996
|
}
|
|
@@ -1039,7 +1038,7 @@ const Sa = St(
|
|
|
1039
1038
|
}
|
|
1040
1039
|
return ($, w) => {
|
|
1041
1040
|
const g = O("FmIcon");
|
|
1042
|
-
return
|
|
1041
|
+
return D(), pe(v(_), {
|
|
1043
1042
|
modelValue: d.value,
|
|
1044
1043
|
"onUpdate:modelValue": w[1] || (w[1] = (P) => d.value = P),
|
|
1045
1044
|
"max-width": 600
|
|
@@ -1049,21 +1048,21 @@ const Sa = St(
|
|
|
1049
1048
|
]),
|
|
1050
1049
|
default: q(() => [
|
|
1051
1050
|
n("div", $a, [
|
|
1052
|
-
|
|
1051
|
+
k(v(e), {
|
|
1053
1052
|
modelValue: t.value,
|
|
1054
1053
|
"onUpdate:modelValue": w[0] || (w[0] = (P) => t.value = P),
|
|
1055
1054
|
orientation: "vertical"
|
|
1056
1055
|
}, {
|
|
1057
1056
|
default: q(() => [
|
|
1058
|
-
|
|
1057
|
+
k(v(u), {
|
|
1059
1058
|
value: 1,
|
|
1060
1059
|
title: v(r)("inventory.closing.approval.step.generateReport.title"),
|
|
1061
1060
|
complete: j
|
|
1062
1061
|
}, {
|
|
1063
1062
|
default: q(() => [
|
|
1064
1063
|
n("div", Fa, W(v(r)("inventory.closing.approval.step.generateReport.description")), 1),
|
|
1065
|
-
t.value === 1 ? (
|
|
1066
|
-
|
|
1064
|
+
t.value === 1 ? (D(), R("div", Ba, [
|
|
1065
|
+
k(v(h), {
|
|
1067
1066
|
label: v(r)("inventory.stock.stock_balance.refreshBalance"),
|
|
1068
1067
|
"prepend-icon": "refresh",
|
|
1069
1068
|
variant: "secondary",
|
|
@@ -1071,7 +1070,7 @@ const Sa = St(
|
|
|
1071
1070
|
onClick: de
|
|
1072
1071
|
}, null, 8, ["label", "loading"]),
|
|
1073
1072
|
n("div", Ta, [
|
|
1074
|
-
|
|
1073
|
+
k(v(h), {
|
|
1075
1074
|
label: v(r)("inventory.common.continue"),
|
|
1076
1075
|
disabled: !x.value,
|
|
1077
1076
|
onClick: ne
|
|
@@ -1081,30 +1080,30 @@ const Sa = St(
|
|
|
1081
1080
|
]),
|
|
1082
1081
|
_: 1
|
|
1083
1082
|
}, 8, ["title"]),
|
|
1084
|
-
|
|
1083
|
+
k(v(u), {
|
|
1085
1084
|
value: 2,
|
|
1086
1085
|
title: v(r)("inventory.closing.approval.step.negativeItems.title"),
|
|
1087
1086
|
disabled: () => !x.value,
|
|
1088
|
-
complete:
|
|
1087
|
+
complete: A
|
|
1089
1088
|
}, {
|
|
1090
1089
|
default: q(() => [
|
|
1091
1090
|
n("div", ja, W(G.value.length > 0 ? `${v(r)("inventory.closing.approval.step.negativeItems.resolveMessage")} [${v(r)("inventory.closing.approval.step.negativeItems.itemsHeader")} (${K.value.length})]` : v(r)("inventory.closing.approval.step.negativeItems.noItemsMessage")), 1),
|
|
1092
|
-
t.value === 2 ? (
|
|
1093
|
-
G.value.length > 0 ? (
|
|
1091
|
+
t.value === 2 ? (D(), R("div", Ia, [
|
|
1092
|
+
G.value.length > 0 ? (D(), R("div", Pa, [
|
|
1094
1093
|
w[2] || (w[2] = n("div", { class: "fm-typo-en-body-md-600 mb-2" }, null, -1)),
|
|
1095
1094
|
n("div", Ua, [
|
|
1096
|
-
(
|
|
1095
|
+
(D(!0), R(ce, null, je(G.value, (P) => (D(), R("div", {
|
|
1097
1096
|
key: P.id,
|
|
1098
1097
|
class: "flex gap-8"
|
|
1099
1098
|
}, [
|
|
1100
1099
|
n("div", Ra, [
|
|
1101
|
-
M.value[P.id] ? (
|
|
1102
|
-
|
|
1100
|
+
M.value[P.id] ? (D(), R("span", Va, [
|
|
1101
|
+
k(g, {
|
|
1103
1102
|
name: "check_circle",
|
|
1104
1103
|
size: "sm"
|
|
1105
1104
|
})
|
|
1106
|
-
])) : (
|
|
1107
|
-
|
|
1105
|
+
])) : (D(), R("span", Ma, [
|
|
1106
|
+
k(g, {
|
|
1108
1107
|
name: "error",
|
|
1109
1108
|
size: "sm"
|
|
1110
1109
|
})
|
|
@@ -1116,12 +1115,12 @@ const Sa = St(
|
|
|
1116
1115
|
])
|
|
1117
1116
|
])) : se("", !0),
|
|
1118
1117
|
n("div", La, [
|
|
1119
|
-
|
|
1118
|
+
k(v(h), {
|
|
1120
1119
|
label: v(r)("inventory.common.back"),
|
|
1121
1120
|
variant: "secondary",
|
|
1122
1121
|
onClick: le
|
|
1123
1122
|
}, null, 8, ["label"]),
|
|
1124
|
-
|
|
1123
|
+
k(v(h), {
|
|
1125
1124
|
label: v(r)("inventory.common.continue"),
|
|
1126
1125
|
disabled: m.value,
|
|
1127
1126
|
onClick: ne
|
|
@@ -1131,7 +1130,7 @@ const Sa = St(
|
|
|
1131
1130
|
]),
|
|
1132
1131
|
_: 1
|
|
1133
1132
|
}, 8, ["title", "disabled"]),
|
|
1134
|
-
|
|
1133
|
+
k(v(u), {
|
|
1135
1134
|
value: 3,
|
|
1136
1135
|
title: v(r)("inventory.closing.approval.step.approval.title"),
|
|
1137
1136
|
disabled: () => m.value,
|
|
@@ -1139,13 +1138,13 @@ const Sa = St(
|
|
|
1139
1138
|
}, {
|
|
1140
1139
|
default: q(() => [
|
|
1141
1140
|
n("div", Ea, W(v(r)("inventory.closing.approval.step.approval.warning")), 1),
|
|
1142
|
-
t.value === 3 ? (
|
|
1143
|
-
|
|
1141
|
+
t.value === 3 ? (D(), R("div", za, [
|
|
1142
|
+
k(v(h), {
|
|
1144
1143
|
label: v(r)("inventory.common.back"),
|
|
1145
1144
|
variant: "secondary",
|
|
1146
1145
|
onClick: le
|
|
1147
1146
|
}, null, 8, ["label"]),
|
|
1148
|
-
|
|
1147
|
+
k(v(h), {
|
|
1149
1148
|
label: v(r)("inventory.common.approve"),
|
|
1150
1149
|
variant: "destructive",
|
|
1151
1150
|
disabled: m.value,
|
|
@@ -1192,10 +1191,10 @@ const Sa = St(
|
|
|
1192
1191
|
}, yn = { class: "fm-typo-en-body-lg-400" }, gn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, bn = { class: "flex gap-12 content-stretch" }, hn = {
|
|
1193
1192
|
class: "flex flex-col w-24",
|
|
1194
1193
|
name: "circles"
|
|
1195
|
-
},
|
|
1194
|
+
}, _n = { class: "flex-1 flex flex-col items-center" }, kn = {
|
|
1196
1195
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
1197
1196
|
name: "delivery details"
|
|
1198
|
-
}, xn = { class: "flex flex-col gap-8" },
|
|
1197
|
+
}, xn = { class: "flex flex-col gap-8" }, An = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Dn = { class: "flex flex-col gap-4" }, wn = { class: "flex items-center justify-between gap-8 w-full" }, Sn = { class: "flex items-center gap-8" }, Cn = { class: "flex flex-col items-end" }, $n = { class: "text-2xl font-semibold" }, _t = "N/A", Fn = /* @__PURE__ */ Ve({
|
|
1199
1198
|
__name: "ClosingDraftDialog",
|
|
1200
1199
|
props: {
|
|
1201
1200
|
show: { type: Boolean },
|
|
@@ -1205,14 +1204,14 @@ const Sa = St(
|
|
|
1205
1204
|
setup(c, { emit: s }) {
|
|
1206
1205
|
tt();
|
|
1207
1206
|
const e = c, u = U(() => {
|
|
1208
|
-
const l =
|
|
1207
|
+
const l = Dt();
|
|
1209
1208
|
return l === "MYR" ? "RM" : l;
|
|
1210
1209
|
});
|
|
1211
1210
|
jt();
|
|
1212
|
-
const
|
|
1211
|
+
const _ = qe(), h = Yt(e, "show"), r = Y(!1), L = Y(!1), V = Y(!1), I = Y(new Array()), x = Y(new Array()), M = Y([]), G = ot(), K = Qe(), d = at(), t = wt(), j = Ge(), A = Lt({}), Q = U(() => new Set(
|
|
1213
1212
|
t.skus.filter((l) => {
|
|
1214
1213
|
var a;
|
|
1215
|
-
return
|
|
1214
|
+
return A[(a = l.customAttributes) == null ? void 0 : a.tag];
|
|
1216
1215
|
}).map((l) => l._id)
|
|
1217
1216
|
)), y = s, m = Y({
|
|
1218
1217
|
templateItem: !0,
|
|
@@ -1242,7 +1241,7 @@ const Sa = St(
|
|
|
1242
1241
|
var a, p, o, i;
|
|
1243
1242
|
if (!j._currentLocation) return;
|
|
1244
1243
|
r.value = !0;
|
|
1245
|
-
const l = ((a = e.draft) == null ? void 0 : a.status) ===
|
|
1244
|
+
const l = ((a = e.draft) == null ? void 0 : a.status) === ke.enum.COMPLETED;
|
|
1246
1245
|
x.value = [];
|
|
1247
1246
|
try {
|
|
1248
1247
|
if (await t.init(), l) {
|
|
@@ -1302,7 +1301,7 @@ const Sa = St(
|
|
|
1302
1301
|
});
|
|
1303
1302
|
return;
|
|
1304
1303
|
}
|
|
1305
|
-
await
|
|
1304
|
+
await _.refreshBalance(
|
|
1306
1305
|
e.draft,
|
|
1307
1306
|
() => {
|
|
1308
1307
|
},
|
|
@@ -1350,7 +1349,7 @@ const Sa = St(
|
|
|
1350
1349
|
});
|
|
1351
1350
|
return;
|
|
1352
1351
|
}
|
|
1353
|
-
await
|
|
1352
|
+
await _.invalidateDraftCache(e.draft);
|
|
1354
1353
|
}
|
|
1355
1354
|
const g = U(
|
|
1356
1355
|
() => I.value.groupBy(
|
|
@@ -1366,7 +1365,7 @@ const Sa = St(
|
|
|
1366
1365
|
});
|
|
1367
1366
|
function X(l, a) {
|
|
1368
1367
|
return S(
|
|
1369
|
-
|
|
1368
|
+
_e.FmTooltip,
|
|
1370
1369
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
1371
1370
|
{
|
|
1372
1371
|
default() {
|
|
@@ -1413,7 +1412,7 @@ const Sa = St(
|
|
|
1413
1412
|
)
|
|
1414
1413
|
]);
|
|
1415
1414
|
return S(
|
|
1416
|
-
|
|
1415
|
+
_e.FmTooltip,
|
|
1417
1416
|
{
|
|
1418
1417
|
zIndex: 51
|
|
1419
1418
|
},
|
|
@@ -1586,7 +1585,7 @@ const Sa = St(
|
|
|
1586
1585
|
return S(
|
|
1587
1586
|
"div",
|
|
1588
1587
|
{ class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" },
|
|
1589
|
-
|
|
1588
|
+
_t
|
|
1590
1589
|
);
|
|
1591
1590
|
const i = te(o);
|
|
1592
1591
|
if (o === 0)
|
|
@@ -1595,7 +1594,7 @@ const Sa = St(
|
|
|
1595
1594
|
]);
|
|
1596
1595
|
const f = o > 0;
|
|
1597
1596
|
return S("div", { class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" }, [
|
|
1598
|
-
S(
|
|
1597
|
+
S(_e.FmIcon, {
|
|
1599
1598
|
name: f ? "arrow_drop_up" : "arrow_drop_down",
|
|
1600
1599
|
color: f ? "system-success-300" : "system-error-300",
|
|
1601
1600
|
size: "md"
|
|
@@ -1618,7 +1617,7 @@ const Sa = St(
|
|
|
1618
1617
|
if (b) {
|
|
1619
1618
|
const E = H.toFormatString({ value: b.conversion }), fe = `${te(B, { minPrecision: 2, maxPrecision: 4 })} ${o.baseUnit} ÷ ${E} × ${C} ${u.value}`;
|
|
1620
1619
|
return S(
|
|
1621
|
-
|
|
1620
|
+
_e.FmTooltip,
|
|
1622
1621
|
{ zIndex: 51 },
|
|
1623
1622
|
{
|
|
1624
1623
|
content() {
|
|
@@ -1636,7 +1635,7 @@ const Sa = St(
|
|
|
1636
1635
|
} else {
|
|
1637
1636
|
const E = `${te(B, { minPrecision: 2, maxPrecision: 4 })} ${o.baseUnit} × ${C} ${u.value}`;
|
|
1638
1637
|
return S(
|
|
1639
|
-
|
|
1638
|
+
_e.FmTooltip,
|
|
1640
1639
|
{ zIndex: 51 },
|
|
1641
1640
|
{
|
|
1642
1641
|
content() {
|
|
@@ -1668,7 +1667,7 @@ const Sa = St(
|
|
|
1668
1667
|
if (b) {
|
|
1669
1668
|
const E = H.toFormatString({ value: b.conversion }), fe = `${te(B, { minPrecision: 2, maxPrecision: 4 })} ${o.baseUnit} ÷ ${E} × ${C} ${u.value}`;
|
|
1670
1669
|
return S(
|
|
1671
|
-
|
|
1670
|
+
_e.FmTooltip,
|
|
1672
1671
|
{ zIndex: 51 },
|
|
1673
1672
|
{
|
|
1674
1673
|
content() {
|
|
@@ -1686,7 +1685,7 @@ const Sa = St(
|
|
|
1686
1685
|
} else {
|
|
1687
1686
|
const E = `${te(B, { minPrecision: 2, maxPrecision: 4 })} ${o.baseUnit} × ${C} ${u.value}`;
|
|
1688
1687
|
return S(
|
|
1689
|
-
|
|
1688
|
+
_e.FmTooltip,
|
|
1690
1689
|
{ zIndex: 51 },
|
|
1691
1690
|
{
|
|
1692
1691
|
content() {
|
|
@@ -1713,7 +1712,7 @@ const Sa = St(
|
|
|
1713
1712
|
enableSorting: !1,
|
|
1714
1713
|
cell(p) {
|
|
1715
1714
|
const o = p.row.original, i = (b, B) => S(
|
|
1716
|
-
|
|
1715
|
+
_e.FmTooltip,
|
|
1717
1716
|
{ zIndex: 50 },
|
|
1718
1717
|
{
|
|
1719
1718
|
default() {
|
|
@@ -1759,7 +1758,7 @@ const Sa = St(
|
|
|
1759
1758
|
}
|
|
1760
1759
|
}
|
|
1761
1760
|
];
|
|
1762
|
-
}),
|
|
1761
|
+
}), De = U(() => xe.value.map((l) => l.size ?? 0).reduce((l, a) => l + a)), be = Y(""), Pe = U(() => {
|
|
1763
1762
|
var p, o;
|
|
1764
1763
|
const l = ((o = (p = e.draft) == null ? void 0 : p.negativeStockItems) == null ? void 0 : o.reduce(
|
|
1765
1764
|
(i, f) => (i[f.sku._id] = f, i),
|
|
@@ -1841,12 +1840,12 @@ const Sa = St(
|
|
|
1841
1840
|
var a, p, o, i, f;
|
|
1842
1841
|
if (!e.draft) return [];
|
|
1843
1842
|
const l = e.draft.approvedAt ? {
|
|
1844
|
-
action: `Approve at ${
|
|
1843
|
+
action: `Approve at ${Ae(e.draft.approvedAt)}`,
|
|
1845
1844
|
// actionAt: props.draft.approvedAt,
|
|
1846
1845
|
actionBy: e.draft.approvedBy,
|
|
1847
1846
|
remark: e.draft.approveRemark
|
|
1848
1847
|
} : (a = e.draft.rejectionHistory) == null ? void 0 : a.computeFirst((b) => ({
|
|
1849
|
-
action: `Reject at ${
|
|
1848
|
+
action: `Reject at ${Ae(b.rejectedAt)}`,
|
|
1850
1849
|
// actionAt: e.rejectedAt,
|
|
1851
1850
|
actionBy: b.rejectedBy,
|
|
1852
1851
|
remark: b.rejectRemark
|
|
@@ -1854,11 +1853,11 @@ const Sa = St(
|
|
|
1854
1853
|
return [
|
|
1855
1854
|
{
|
|
1856
1855
|
label: "Location",
|
|
1857
|
-
value: ((p = j._currentLocation) == null ? void 0 : p.name) ??
|
|
1856
|
+
value: ((p = j._currentLocation) == null ? void 0 : p.name) ?? _t
|
|
1858
1857
|
},
|
|
1859
1858
|
{
|
|
1860
1859
|
label: "Created at",
|
|
1861
|
-
value:
|
|
1860
|
+
value: Ae(e.draft.createdAt)
|
|
1862
1861
|
},
|
|
1863
1862
|
{
|
|
1864
1863
|
label: "Created by",
|
|
@@ -1866,7 +1865,7 @@ const Sa = St(
|
|
|
1866
1865
|
},
|
|
1867
1866
|
{
|
|
1868
1867
|
label: "Updated at",
|
|
1869
|
-
value:
|
|
1868
|
+
value: Ae(e.draft.updatedAt)
|
|
1870
1869
|
},
|
|
1871
1870
|
{
|
|
1872
1871
|
label: "Updated by",
|
|
@@ -1874,7 +1873,7 @@ const Sa = St(
|
|
|
1874
1873
|
},
|
|
1875
1874
|
{
|
|
1876
1875
|
label: "Effective at",
|
|
1877
|
-
value:
|
|
1876
|
+
value: Ae(e.draft.effectiveAt ?? Oe((o = e.draft) == null ? void 0 : o._id))
|
|
1878
1877
|
},
|
|
1879
1878
|
{
|
|
1880
1879
|
label: "Using template",
|
|
@@ -1931,7 +1930,7 @@ const Sa = St(
|
|
|
1931
1930
|
})), l.sort((b, B) => new Date(B.performedAt).getTime() - new Date(b.performedAt).getTime()).map(
|
|
1932
1931
|
(b) => ({
|
|
1933
1932
|
header: Ue(b.action),
|
|
1934
|
-
date:
|
|
1933
|
+
date: Ae(b.performedAt),
|
|
1935
1934
|
info: [
|
|
1936
1935
|
{
|
|
1937
1936
|
label: "Performed by",
|
|
@@ -1946,10 +1945,10 @@ const Sa = St(
|
|
|
1946
1945
|
);
|
|
1947
1946
|
}), Me = Y(!1), Ne = Y(!1), st = U(() => {
|
|
1948
1947
|
var l;
|
|
1949
|
-
return ((l = e.draft) == null ? void 0 : l.status) !==
|
|
1948
|
+
return ((l = e.draft) == null ? void 0 : l.status) !== ke.enum.DRAFT ? "Status is not draft." : null;
|
|
1950
1949
|
});
|
|
1951
1950
|
function Ut() {
|
|
1952
|
-
e.draft && (Ne.value = !0,
|
|
1951
|
+
e.draft && (Ne.value = !0, _.approveDraft(
|
|
1953
1952
|
e.draft,
|
|
1954
1953
|
() => {
|
|
1955
1954
|
Ne.value = !1, Me.value = !1, y("submitted");
|
|
@@ -1961,12 +1960,12 @@ const Sa = St(
|
|
|
1961
1960
|
}
|
|
1962
1961
|
return (l, a) => {
|
|
1963
1962
|
const p = O("FmButtonGroup"), o = O("FmMenuDivider"), i = O("FmCard"), f = O("FmButton"), b = O("FmCircularProgress"), B = O("FmChip"), C = O("FmTextField"), N = O("FmIcon"), E = O("FmTable"), fe = O("FmSpacer"), ve = O("FmTooltip"), Se = O("FmSideSheet");
|
|
1964
|
-
return
|
|
1965
|
-
|
|
1963
|
+
return D(), R(ce, null, [
|
|
1964
|
+
k(Se, {
|
|
1966
1965
|
"dismiss-away": "",
|
|
1967
1966
|
"max-width": 9999,
|
|
1968
1967
|
"model-value": v(h),
|
|
1969
|
-
"onUpdate:modelValue": a[9] || (a[9] = (T) =>
|
|
1968
|
+
"onUpdate:modelValue": a[9] || (a[9] = (T) => kt(h) ? h.value = T : null),
|
|
1970
1969
|
header: "Closing details"
|
|
1971
1970
|
}, {
|
|
1972
1971
|
"side-sheet-footer": q(() => {
|
|
@@ -1974,8 +1973,8 @@ const Sa = St(
|
|
|
1974
1973
|
return [
|
|
1975
1974
|
n("div", wn, [
|
|
1976
1975
|
n("div", Sn, [
|
|
1977
|
-
((T = e.draft) == null ? void 0 : T.status) === v(
|
|
1978
|
-
st.value ? (
|
|
1976
|
+
((T = e.draft) == null ? void 0 : T.status) === v(ke).enum.DRAFT ? (D(), R(ce, { key: 0 }, [
|
|
1977
|
+
st.value ? (D(), pe(ve, {
|
|
1979
1978
|
key: 0,
|
|
1980
1979
|
"z-index": 51,
|
|
1981
1980
|
placement: "right"
|
|
@@ -1984,37 +1983,37 @@ const Sa = St(
|
|
|
1984
1983
|
ue(W(st.value), 1)
|
|
1985
1984
|
]),
|
|
1986
1985
|
default: q(() => [
|
|
1987
|
-
|
|
1986
|
+
k(f, {
|
|
1988
1987
|
disabled: "",
|
|
1989
1988
|
key: "approve key",
|
|
1990
1989
|
label: "Approve"
|
|
1991
1990
|
})
|
|
1992
1991
|
]),
|
|
1993
1992
|
_: 1
|
|
1994
|
-
})) : (
|
|
1993
|
+
})) : (D(), pe(f, {
|
|
1995
1994
|
key: "approve key",
|
|
1996
1995
|
label: "Approve",
|
|
1997
1996
|
onClick: a[5] || (a[5] = (Be) => Me.value = !0)
|
|
1998
1997
|
}))
|
|
1999
1998
|
], 64)) : se("", !0),
|
|
2000
|
-
((oe = e.draft) == null ? void 0 : oe.status) === v(
|
|
1999
|
+
((oe = e.draft) == null ? void 0 : oe.status) === v(ke).enum.DRAFT ? (D(), pe(f, {
|
|
2001
2000
|
key: 1,
|
|
2002
2001
|
label: "Reject",
|
|
2003
2002
|
variant: "destructive",
|
|
2004
|
-
onClick: a[6] || (a[6] = () => e.draft && v(
|
|
2003
|
+
onClick: a[6] || (a[6] = () => e.draft && v(_).rejectDraft(e.draft, () => y("submitted")))
|
|
2005
2004
|
})) : se("", !0),
|
|
2006
|
-
|
|
2005
|
+
k(f, {
|
|
2007
2006
|
label: "Close",
|
|
2008
2007
|
variant: "tertiary",
|
|
2009
2008
|
onClick: a[7] || (a[7] = (Be) => h.value = !1)
|
|
2010
2009
|
}),
|
|
2011
|
-
(ie = e.draft) != null && ie.approvedAt && ((he = e.draft) == null ? void 0 : he.status) !== v(
|
|
2010
|
+
(ie = e.draft) != null && ie.approvedAt && ((he = e.draft) == null ? void 0 : he.status) !== v(ke).enum.COMPLETED ? (D(), pe(bt, { key: 2 }, {
|
|
2012
2011
|
default: q(() => [
|
|
2013
|
-
|
|
2012
|
+
k(f, {
|
|
2014
2013
|
label: "Sync",
|
|
2015
2014
|
loading: V.value,
|
|
2016
2015
|
onClick: a[8] || (a[8] = () => {
|
|
2017
|
-
e.draft && (V.value = !0, v(
|
|
2016
|
+
e.draft && (V.value = !0, v(_).syncDraft(e.draft, () => {
|
|
2018
2017
|
V.value = !1, y("submitted");
|
|
2019
2018
|
}));
|
|
2020
2019
|
})
|
|
@@ -2033,14 +2032,14 @@ const Sa = St(
|
|
|
2033
2032
|
default: q(() => [
|
|
2034
2033
|
n("div", Oa, [
|
|
2035
2034
|
n("div", null, [
|
|
2036
|
-
|
|
2035
|
+
k(p, {
|
|
2037
2036
|
items: $e,
|
|
2038
2037
|
modelValue: we.value,
|
|
2039
2038
|
"onUpdate:modelValue": a[0] || (a[0] = (T) => we.value = T)
|
|
2040
2039
|
}, null, 8, ["modelValue"])
|
|
2041
2040
|
]),
|
|
2042
|
-
we.value.value === "overview" ? (
|
|
2043
|
-
|
|
2041
|
+
we.value.value === "overview" ? (D(), R(ce, { key: 0 }, [
|
|
2042
|
+
k(i, {
|
|
2044
2043
|
variant: "outlined",
|
|
2045
2044
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
2046
2045
|
}, {
|
|
@@ -2055,9 +2054,9 @@ const Sa = St(
|
|
|
2055
2054
|
}, W(v(Ue)(((oe = l.draft) == null ? void 0 : oe.status) ?? "")), 3)
|
|
2056
2055
|
])
|
|
2057
2056
|
]),
|
|
2058
|
-
|
|
2057
|
+
k(o),
|
|
2059
2058
|
n("div", qa, [
|
|
2060
|
-
(
|
|
2059
|
+
(D(!0), R(ce, null, je(Ce.value, (ie, he) => (D(), R("div", {
|
|
2061
2060
|
class: "flex flex-col gap-4",
|
|
2062
2061
|
key: he
|
|
2063
2062
|
}, [
|
|
@@ -2074,8 +2073,8 @@ const Sa = St(
|
|
|
2074
2073
|
n("div", Za, [
|
|
2075
2074
|
n("div", Ja, [
|
|
2076
2075
|
a[12] || (a[12] = n("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
2077
|
-
r.value ? se("", !0) : (
|
|
2078
|
-
l.draft && l.draft.status !== v(
|
|
2076
|
+
r.value ? se("", !0) : (D(), R("div", Xa, [
|
|
2077
|
+
l.draft && l.draft.status !== v(ke).enum.COMPLETED ? (D(), pe(f, {
|
|
2079
2078
|
key: 0,
|
|
2080
2079
|
label: "Refresh balance",
|
|
2081
2080
|
"prepend-icon": "refresh",
|
|
@@ -2086,9 +2085,9 @@ const Sa = St(
|
|
|
2086
2085
|
loading: L.value,
|
|
2087
2086
|
onClick: $
|
|
2088
2087
|
}, null, 8, ["loading"])) : se("", !0),
|
|
2089
|
-
|
|
2088
|
+
k(bt, null, {
|
|
2090
2089
|
default: q(() => [
|
|
2091
|
-
|
|
2090
|
+
k(f, {
|
|
2092
2091
|
label: "Invalidate Draft Cache",
|
|
2093
2092
|
"prepend-icon": "refresh",
|
|
2094
2093
|
variant: "secondary",
|
|
@@ -2101,14 +2100,14 @@ const Sa = St(
|
|
|
2101
2100
|
]),
|
|
2102
2101
|
_: 1
|
|
2103
2102
|
}),
|
|
2104
|
-
|
|
2103
|
+
k(f, {
|
|
2105
2104
|
label: "Export data",
|
|
2106
2105
|
"prepend-icon": "download",
|
|
2107
2106
|
variant: "secondary",
|
|
2108
2107
|
"text-color": "primary",
|
|
2109
2108
|
"bg-color": "transparent",
|
|
2110
2109
|
"border-color": "primary",
|
|
2111
|
-
onClick: a[1] || (a[1] = (T) => l.draft ? v(
|
|
2110
|
+
onClick: a[1] || (a[1] = (T) => l.draft ? v(_).exportDraft(
|
|
2112
2111
|
l.draft,
|
|
2113
2112
|
I.value,
|
|
2114
2113
|
x.value
|
|
@@ -2116,45 +2115,45 @@ const Sa = St(
|
|
|
2116
2115
|
})
|
|
2117
2116
|
]))
|
|
2118
2117
|
]),
|
|
2119
|
-
r.value ? (
|
|
2118
|
+
r.value ? (D(), R("div", en, [
|
|
2120
2119
|
a[14] || (a[14] = n("div", { class: "h-80" }, null, -1)),
|
|
2121
2120
|
n("div", tn, [
|
|
2122
2121
|
n("div", null, [
|
|
2123
|
-
|
|
2122
|
+
k(b, { size: "md" })
|
|
2124
2123
|
]),
|
|
2125
2124
|
a[13] || (a[13] = n("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
2126
2125
|
]),
|
|
2127
2126
|
a[15] || (a[15] = n("div", { class: "h-80" }, null, -1))
|
|
2128
|
-
])) : (
|
|
2127
|
+
])) : (D(), R(ce, { key: 1 }, [
|
|
2129
2128
|
n("div", an, [
|
|
2130
2129
|
n("div", nn, [
|
|
2131
|
-
|
|
2130
|
+
k(B, {
|
|
2132
2131
|
label: "Template Item(s)",
|
|
2133
2132
|
selected: m.value.templateItem,
|
|
2134
2133
|
onClick: a[2] || (a[2] = (T) => m.value.templateItem = !m.value.templateItem)
|
|
2135
2134
|
}, null, 8, ["selected"]),
|
|
2136
|
-
|
|
2135
|
+
k(B, {
|
|
2137
2136
|
label: "Non-template Item(s)",
|
|
2138
2137
|
selected: m.value.nonTemplateItem,
|
|
2139
2138
|
onClick: a[3] || (a[3] = (T) => m.value.nonTemplateItem = !m.value.nonTemplateItem)
|
|
2140
2139
|
}, null, 8, ["selected"])
|
|
2141
2140
|
]),
|
|
2142
|
-
|
|
2141
|
+
k(C, {
|
|
2143
2142
|
modelValue: be.value,
|
|
2144
2143
|
"onUpdate:modelValue": a[4] || (a[4] = (T) => be.value = T),
|
|
2145
2144
|
placeholder: "Filter items"
|
|
2146
2145
|
}, null, 8, ["modelValue"])
|
|
2147
2146
|
]),
|
|
2148
|
-
v(t).skuTags.size ? (
|
|
2149
|
-
(
|
|
2147
|
+
v(t).skuTags.size ? (D(), R("div", on, [
|
|
2148
|
+
(D(!0), R(ce, null, je(v(t).skuTags.keys(), (T) => (D(), pe(B, {
|
|
2150
2149
|
key: `${T}`,
|
|
2151
2150
|
label: `${T}`,
|
|
2152
2151
|
selectable: "",
|
|
2153
|
-
selected:
|
|
2154
|
-
onClick: (oe) =>
|
|
2152
|
+
selected: A[`${T}`],
|
|
2153
|
+
onClick: (oe) => A[`${T}`] = !A[`${T}`]
|
|
2155
2154
|
}, {
|
|
2156
2155
|
default: q(() => [
|
|
2157
|
-
|
|
2156
|
+
A[`${T}`] ? (D(), pe(N, {
|
|
2158
2157
|
key: 0,
|
|
2159
2158
|
name: "check",
|
|
2160
2159
|
class: "text-white",
|
|
@@ -2164,8 +2163,8 @@ const Sa = St(
|
|
|
2164
2163
|
class: Ie([
|
|
2165
2164
|
"",
|
|
2166
2165
|
{
|
|
2167
|
-
"text-white fm-typo-en-body-md-600":
|
|
2168
|
-
"text-fm-color-typo-primary fm-typo-en-body-md-400": !
|
|
2166
|
+
"text-white fm-typo-en-body-md-600": A[`${T}`],
|
|
2167
|
+
"text-fm-color-typo-primary fm-typo-en-body-md-400": !A[`${T}`]
|
|
2169
2168
|
}
|
|
2170
2169
|
])
|
|
2171
2170
|
}, W(T), 3)
|
|
@@ -2175,9 +2174,9 @@ const Sa = St(
|
|
|
2175
2174
|
])) : se("", !0),
|
|
2176
2175
|
n("div", sn, [
|
|
2177
2176
|
n("div", {
|
|
2178
|
-
style: xt({ height: "600px", minWidth: `${
|
|
2177
|
+
style: xt({ height: "600px", minWidth: `${De.value}px` })
|
|
2179
2178
|
}, [
|
|
2180
|
-
|
|
2179
|
+
k(E, {
|
|
2181
2180
|
"column-defs": xe.value,
|
|
2182
2181
|
"row-data": Pe.value,
|
|
2183
2182
|
"search-value": be.value
|
|
@@ -2187,9 +2186,9 @@ const Sa = St(
|
|
|
2187
2186
|
], 64))
|
|
2188
2187
|
])
|
|
2189
2188
|
], 64)) : se("", !0),
|
|
2190
|
-
we.value.value === "history" ? (
|
|
2191
|
-
Fe.value.length ? (
|
|
2192
|
-
(
|
|
2189
|
+
we.value.value === "history" ? (D(), R("div", rn, [
|
|
2190
|
+
Fe.value.length ? (D(), R("div", un, [
|
|
2191
|
+
(D(!0), R(ce, null, je(Fe.value, (T, oe) => (D(), R(ce, { key: oe }, [
|
|
2193
2192
|
n("div", dn, [
|
|
2194
2193
|
n("div", mn, [
|
|
2195
2194
|
n("div", fn, [
|
|
@@ -2223,7 +2222,7 @@ const Sa = St(
|
|
|
2223
2222
|
]),
|
|
2224
2223
|
n("div", bn, [
|
|
2225
2224
|
n("div", hn, [
|
|
2226
|
-
n("div",
|
|
2225
|
+
n("div", _n, [
|
|
2227
2226
|
n("div", {
|
|
2228
2227
|
class: Ie([
|
|
2229
2228
|
{
|
|
@@ -2235,20 +2234,20 @@ const Sa = St(
|
|
|
2235
2234
|
}, null, 2)
|
|
2236
2235
|
])
|
|
2237
2236
|
]),
|
|
2238
|
-
n("div",
|
|
2239
|
-
|
|
2237
|
+
n("div", kn, [
|
|
2238
|
+
k(i, {
|
|
2240
2239
|
variant: "outlined",
|
|
2241
2240
|
class: "py-12 px-16"
|
|
2242
2241
|
}, {
|
|
2243
2242
|
default: q(() => [
|
|
2244
2243
|
n("div", xn, [
|
|
2245
|
-
(
|
|
2244
|
+
(D(!0), R(ce, null, je(T.info, (ie, he) => (D(), R("div", {
|
|
2246
2245
|
key: he,
|
|
2247
2246
|
class: "flex flex-col gap-4"
|
|
2248
2247
|
}, [
|
|
2249
|
-
n("div",
|
|
2250
|
-
n("div",
|
|
2251
|
-
(
|
|
2248
|
+
n("div", An, W(ie == null ? void 0 : ie.label), 1),
|
|
2249
|
+
n("div", Dn, [
|
|
2250
|
+
(D(!0), R(ce, null, je(ie == null ? void 0 : ie.values, (Be, Le) => (D(), R("div", {
|
|
2252
2251
|
key: Le,
|
|
2253
2252
|
class: "fm-typo-en-body-lg-600"
|
|
2254
2253
|
}, W(Be), 1))), 128))
|
|
@@ -2261,8 +2260,8 @@ const Sa = St(
|
|
|
2261
2260
|
])
|
|
2262
2261
|
])
|
|
2263
2262
|
], 64))), 128))
|
|
2264
|
-
])) : (
|
|
2265
|
-
|
|
2263
|
+
])) : (D(), R("div", ln, [
|
|
2264
|
+
k(fe),
|
|
2266
2265
|
n("div", null, [
|
|
2267
2266
|
n("img", {
|
|
2268
2267
|
src: v(ra),
|
|
@@ -2271,15 +2270,15 @@ const Sa = St(
|
|
|
2271
2270
|
]),
|
|
2272
2271
|
a[16] || (a[16] = n("div", { class: "fm-typo-en-body-lg-600" }, W("No records found"), -1)),
|
|
2273
2272
|
a[17] || (a[17] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, W("You can track approval and rejection history here"), -1)),
|
|
2274
|
-
|
|
2275
|
-
|
|
2273
|
+
k(fe),
|
|
2274
|
+
k(fe)
|
|
2276
2275
|
]))
|
|
2277
2276
|
])) : se("", !0)
|
|
2278
2277
|
])
|
|
2279
2278
|
]),
|
|
2280
2279
|
_: 1
|
|
2281
2280
|
}, 8, ["model-value"]),
|
|
2282
|
-
v(h) && e.draft ? (
|
|
2281
|
+
v(h) && e.draft ? (D(), pe(Ha, {
|
|
2283
2282
|
key: 0,
|
|
2284
2283
|
show: Me.value,
|
|
2285
2284
|
"onUpdate:show": a[10] || (a[10] = (T) => Me.value = T),
|
|
@@ -2292,10 +2291,10 @@ const Sa = St(
|
|
|
2292
2291
|
], 64);
|
|
2293
2292
|
};
|
|
2294
2293
|
}
|
|
2295
|
-
}), Bn = { class: "flex-1 flex flex-col gap-8" }, Tn = { class: "flex flex-col" }, jn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, In = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Pn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Un = { class: "fm-typo-en-body-lg-400 line-clamp-2" },
|
|
2294
|
+
}), Bn = { class: "flex-1 flex flex-col gap-8" }, Tn = { class: "flex flex-col" }, jn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, In = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Pn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Un = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ao = /* @__PURE__ */ Ve({
|
|
2296
2295
|
__name: "ClosingDraftView",
|
|
2297
2296
|
setup(c) {
|
|
2298
|
-
const { t: s } = tt(), { viewDraft: e } = qe(), { viewClosingDraftProps: u, viewClosingDraftShow:
|
|
2297
|
+
const { t: s } = tt(), { viewDraft: e } = qe(), { viewClosingDraftProps: u, viewClosingDraftShow: _ } = Wt(qe()), h = Ge(), r = Sa(), L = Ht(), { breakpoints: V } = qt();
|
|
2299
2298
|
h.watchLocation(r.fetchDrafts);
|
|
2300
2299
|
const I = U(() => r.loading), x = Y(""), M = U(() => V.value.xs || V.value.sm), G = U(() => M.value ? 10 : 20);
|
|
2301
2300
|
function K(j) {
|
|
@@ -2320,10 +2319,10 @@ const Sa = St(
|
|
|
2320
2319
|
isPrimary: !1
|
|
2321
2320
|
}
|
|
2322
2321
|
]);
|
|
2323
|
-
return (j,
|
|
2322
|
+
return (j, A) => {
|
|
2324
2323
|
const Q = O("FmTable");
|
|
2325
|
-
return
|
|
2326
|
-
|
|
2324
|
+
return D(), R(ce, null, [
|
|
2325
|
+
k(Ot, {
|
|
2327
2326
|
title: v(s)("inventory.closing.draft.title"),
|
|
2328
2327
|
actions: t.value,
|
|
2329
2328
|
"onClick:action": K
|
|
@@ -2338,39 +2337,39 @@ const Sa = St(
|
|
|
2338
2337
|
}
|
|
2339
2338
|
])
|
|
2340
2339
|
}, [
|
|
2341
|
-
|
|
2340
|
+
k(sa, {
|
|
2342
2341
|
"change-location": "",
|
|
2343
2342
|
searchable: "",
|
|
2344
2343
|
search: x.value,
|
|
2345
|
-
"onUpdate:search":
|
|
2344
|
+
"onUpdate:search": A[0] || (A[0] = (y) => x.value = y)
|
|
2346
2345
|
}, null, 8, ["search"]),
|
|
2347
|
-
|
|
2346
|
+
k(Q, {
|
|
2348
2347
|
style: xt(v(L).tableHeight),
|
|
2349
2348
|
"column-defs": v(r).columnDefs,
|
|
2350
2349
|
"row-data": v(r).drafts,
|
|
2351
2350
|
"search-value": x.value,
|
|
2352
2351
|
loading: I.value,
|
|
2353
|
-
onRowClick:
|
|
2352
|
+
onRowClick: A[1] || (A[1] = (y) => v(e)(y.original)),
|
|
2354
2353
|
"page-size": G.value
|
|
2355
2354
|
}, {
|
|
2356
2355
|
"list-row": q((y) => [
|
|
2357
|
-
|
|
2356
|
+
k(ia, {
|
|
2358
2357
|
row: y,
|
|
2359
2358
|
onRowClick: (m) => v(e)(m)
|
|
2360
2359
|
}, {
|
|
2361
2360
|
default: q((m) => {
|
|
2362
|
-
var F, z, ae, de, ne, le, me, $, w, g, P, J, ee, X, xe,
|
|
2361
|
+
var F, z, ae, de, ne, le, me, $, w, g, P, J, ee, X, xe, De, be, Pe, Ce, $e;
|
|
2363
2362
|
return [
|
|
2364
2363
|
n("div", Bn, [
|
|
2365
2364
|
n("div", Tn, [
|
|
2366
2365
|
n("div", jn, [
|
|
2367
|
-
|
|
2366
|
+
k(v(ze), {
|
|
2368
2367
|
render: (ae = (z = (F = m._id) == null ? void 0 : F.column) == null ? void 0 : z.columnDef) == null ? void 0 : ae.cell,
|
|
2369
2368
|
props: (ne = (de = m._id) == null ? void 0 : de.getContext) == null ? void 0 : ne.call(de)
|
|
2370
2369
|
}, null, 8, ["render", "props"])
|
|
2371
2370
|
]),
|
|
2372
2371
|
n("div", In, [
|
|
2373
|
-
|
|
2372
|
+
k(v(ze), {
|
|
2374
2373
|
render: ($ = (me = (le = m.name) == null ? void 0 : le.column) == null ? void 0 : me.columnDef) == null ? void 0 : $.cell,
|
|
2375
2374
|
props: (g = (w = m.name) == null ? void 0 : w.getContext) == null ? void 0 : g.call(w)
|
|
2376
2375
|
}, null, 8, ["render", "props"])
|
|
@@ -2380,15 +2379,15 @@ const Sa = St(
|
|
|
2380
2379
|
...y.original.items.length >= 3 ? [`and ${y.original.items.length - 3} more items`] : []
|
|
2381
2380
|
].join(", ")), 1),
|
|
2382
2381
|
n("div", Un, [
|
|
2383
|
-
|
|
2382
|
+
k(v(ze), {
|
|
2384
2383
|
render: (ee = (J = (P = m.ref) == null ? void 0 : P.column) == null ? void 0 : J.columnDef) == null ? void 0 : ee.cell,
|
|
2385
2384
|
props: (xe = (X = m.ref) == null ? void 0 : X.getContext) == null ? void 0 : xe.call(X)
|
|
2386
2385
|
}, null, 8, ["render", "props"])
|
|
2387
2386
|
])
|
|
2388
2387
|
]),
|
|
2389
2388
|
n("div", null, [
|
|
2390
|
-
|
|
2391
|
-
render: (Pe = (be = (
|
|
2389
|
+
k(v(ze), {
|
|
2390
|
+
render: (Pe = (be = (De = m.status) == null ? void 0 : De.column) == null ? void 0 : be.columnDef) == null ? void 0 : Pe.cell,
|
|
2392
2391
|
props: ($e = (Ce = m.status) == null ? void 0 : Ce.getContext) == null ? void 0 : $e.call(Ce)
|
|
2393
2392
|
}, null, 8, ["render", "props"])
|
|
2394
2393
|
])
|
|
@@ -2404,12 +2403,12 @@ const Sa = St(
|
|
|
2404
2403
|
]),
|
|
2405
2404
|
_: 1
|
|
2406
2405
|
}, 8, ["title", "actions"]),
|
|
2407
|
-
(
|
|
2408
|
-
|
|
2409
|
-
show: v(
|
|
2410
|
-
"onUpdate:show":
|
|
2411
|
-
onSubmitted:
|
|
2412
|
-
onRefresh:
|
|
2406
|
+
(D(), pe(Et, { to: "body" }, [
|
|
2407
|
+
k(Fn, zt(v(u), {
|
|
2408
|
+
show: v(_),
|
|
2409
|
+
"onUpdate:show": A[2] || (A[2] = (y) => kt(_) ? _.value = y : null),
|
|
2410
|
+
onSubmitted: A[3] || (A[3] = () => (_.value = !1, v(r).fetchDrafts())),
|
|
2411
|
+
onRefresh: A[4] || (A[4] = (y) => v(r).updateDraftRef(y))
|
|
2413
2412
|
}), null, 16, ["show"])
|
|
2414
2413
|
]))
|
|
2415
2414
|
], 64);
|
|
@@ -2417,5 +2416,5 @@ const Sa = St(
|
|
|
2417
2416
|
}
|
|
2418
2417
|
});
|
|
2419
2418
|
export {
|
|
2420
|
-
|
|
2419
|
+
ao as default
|
|
2421
2420
|
};
|