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