@feedmepos/mf-inventory-portal 1.0.9 → 1.0.10-dev.2
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-RT4bBubX.js → App-COPx00z6.js} +50 -49
- package/dist/{ApprovalView-BgOWHNMD.js → ApprovalView-DEtUW_BD.js} +24 -24
- package/dist/{BindingsDialog-Dip74zuT.js → BindingsDialog-8WUk3Dv3.js} +2 -2
- package/dist/{BindingsPicker-DMQXwEn4.js → BindingsPicker-D8ABQZWj.js} +7 -7
- package/dist/{BindingsTable-Czz32F7d.js → BindingsTable-E4ObCYZW.js} +5 -5
- package/dist/{ClosingDraftView-Ps4DgRNG.js → ClosingDraftView-BuwTXzoD.js} +499 -498
- package/dist/{ClosingTemplateView-EjVLgUCH.js → ClosingTemplateView-Dwlu2WDi.js} +10 -10
- package/dist/{DeliveryOrderPrintPreview-C52aY34D.js → DeliveryOrderPrintPreview-CZQP0ZBf.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-MSqPw_6t.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CIpktJ_p.js} +32 -32
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DbN_e9U8.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BAsfttD3.js} +51 -51
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DHuB4hRb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BtLdE9Qw.js} +1 -1
- package/dist/{IngredientGroupView-CRTjNc-p.js → IngredientGroupView-DKncarkj.js} +11 -11
- package/dist/{IngredientsView-CuLOu_v9.js → IngredientsView-DJhR4pNL.js} +15 -14
- package/dist/IntegrationView-DbehNBiT.js +10361 -0
- package/dist/{InventoryBindingForm-C1NfSdOs.js → InventoryBindingForm-CakKTaAx.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BJ7h3Nr6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-qrYebXqE.js} +94 -89
- package/dist/{InventoryBindingSummary-CFjSwhxA.js → InventoryBindingSummary-ax4kqODn.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B73N8AvB.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BD8iRcNk.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-rve3vJhu.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D13DAIwe.js} +10 -10
- package/dist/{PublishView-Bj0JawUb.js → PublishView-BMQzmmkT.js} +12 -12
- package/dist/{PurchaseOrderPrintPreview-DCAZVrDM.js → PurchaseOrderPrintPreview-CdbxZWLq.js} +4 -4
- package/dist/{ReceiveRequestView-B_bWd1hC.js → ReceiveRequestView-Blxchs0k.js} +53 -52
- package/dist/RecipeView-Bnigp2lS.js +8493 -0
- package/dist/{StockView-CsZ2hfAY.js → StockView-B4p6XQPR.js} +73 -72
- package/dist/{SupplierView-BUaouKYm.js → SupplierView-ojORzTSY.js} +12 -11
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-G478rFCP.js +1894 -0
- package/dist/{TransferTemplateView-Rq7N13OR.js → TransferTemplateView-DTN23wTJ.js} +291 -290
- package/dist/{UnitView-C9j2RjtY.js → UnitView-w-bUgjIw.js} +23 -23
- package/dist/{WarehouseView-Ct6TWKej.js → WarehouseView-cJ7u4vTr.js} +26 -26
- package/dist/api/bill.d.ts +2 -2
- package/dist/api/food-market-hub.d.ts +1 -1
- package/dist/api/inventory.d.ts +110 -44
- package/dist/api/netsuite.d.ts +191 -8
- package/dist/api/purchase-order.d.ts +5 -1
- package/dist/{app-Cryb1Kx8.js → app-DtLEhFCD.js} +19871 -19809
- package/dist/app.d.ts +7 -7
- package/dist/app.js +2 -2
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +30 -8
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +27 -5
- package/dist/composable/usePromise.d.ts +41 -0
- package/dist/{decimal-Ko0ukH7B.js → decimal-D0mDm48J.js} +1 -1
- package/dist/feature-GZEf4CLT.js +17427 -0
- package/dist/{format-unit-display-C1sTywhb.js → format-unit-display-Dl7kbJn1.js} +60 -60
- package/dist/{index-BAyyesj2.js → index-BglOiNaU.js} +7 -6
- package/dist/{index-WgH7CKAS.js → index-DKLr1Nm9.js} +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/{stock-BVCXjojk.js → stock-V0Qm2pTD.js} +3 -3
- package/dist/stores/feature.d.ts +3 -20
- package/dist/stores/integration/foodmarkethub.d.ts +1 -1
- package/dist/stores/integration/netsuite.d.ts +22 -7
- package/dist/stores/inventory.d.ts +132 -44
- package/dist/stores/location.d.ts +137 -137
- package/dist/{supplier-Brxhm840.js → supplier-DK4PWcz4.js} +4 -4
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DCAYNC6e.js → use-ingredient-select-dialog-BfJ-qHni.js} +1 -1
- package/dist/{use-inventory-binding-dialog-TYwx9mzF.js → use-inventory-binding-dialog-C5IYjwW5.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +228 -228
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +2 -2
- package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +1 -1
- package/dist/views/adjustment-template/wastage-template/table.d.ts +234 -234
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +140 -136
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +420 -408
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +4 -4
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +252 -252
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +252 -252
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +12 -12
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +8 -8
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +3 -3
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +4 -4
- package/dist/views/integration/components/ApplyProduct.vue.d.ts +2 -2
- package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +2 -2
- package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +2 -2
- package/dist/views/integration/components/netsuite/InventoryTransfer.vue.d.ts +48 -0
- package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +180 -0
- package/dist/views/integration/components/netsuite/NetSuiteSideSheet.vue.d.ts +24 -0
- package/dist/views/integration/components/netsuite/NetSuiteSideSheetProps.d.ts +8 -0
- package/dist/views/integration/components/netsuite/{AddLocationDialog.vue.d.ts → business/AddLocationDialog.vue.d.ts} +204 -204
- package/dist/views/integration/components/netsuite/{LocationConfigurationDialog.vue.d.ts → business/BusinessNetSuiteSideSheet.vue.d.ts} +3 -3
- package/dist/views/integration/components/netsuite/{LocationConfigurationDialogProps.d.ts → business/BusinessNetSuiteSideSheetProps.d.ts} +1 -5
- package/dist/views/integration/components/netsuite/{NetSuiteLocationField.vue.d.ts → business/NetSuiteLocationField.vue.d.ts} +11 -9
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +665 -637
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +22 -22
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +44 -44
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +11 -11
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +614 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1190 -1142
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1192 -1144
- package/dist/views/receive-request/constants/po-action-to-ui-style.d.ts +6 -0
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +46 -2
- package/dist/views/recipe/components/recipe-override-form-field/RecipeOverrideFormField.vue.d.ts +61 -0
- package/dist/views/recipe/composables/use-recipe-overrides-form-field.d.ts +10 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +14 -14
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +22 -22
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +17 -17
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +11 -11
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +805 -805
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +805 -805
- package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +33 -33
- package/dist/vue-i18n-3LoKMrMa.js +2365 -0
- package/package.json +8 -5
- package/dist/IntegrationView-DXxwE0z8.js +0 -2148
- package/dist/RecipeView-m7aSOTrT.js +0 -616
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DqImAdxA.js +0 -1746
- package/dist/vue-i18n-B-kKlljK.js +0 -2365
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { a as
|
|
7
|
-
import { E as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as Fe, ref as O, resolveComponent as U, openBlock as h, createBlock as W, withCtx as Y, createElementVNode as o, createTextVNode as Be, toDisplayString as N, unref as g, createVNode as w, h as j, reactive as We, computed as E, onMounted as Ze, watch as Je, isRef as Ie, createElementBlock as P, Fragment as q, createCommentVNode as ee, normalizeClass as pe, renderList as be, normalizeStyle as Ue, Teleport as Xe, mergeProps as Qe } from "vue";
|
|
2
|
+
import { X as et, u as je, af as Z, l as tt, J as $e, i as M, t as at, K as he, q as nt, r as ot, s as st, ag as Ee, ah as He, a3 as Le, ai as ne, a9 as rt, ae, V as ze, D as Pe, h as De, f as lt, e as ct, a as it, z as ut, _ as dt, B as mt, C as ft, E as ke } from "./app-DtLEhFCD.js";
|
|
3
|
+
import { useCoreStore as pt, useI18n as Ne } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as Re, useDialog as vt, useProxiedModel as yt, components as fe, useBreakpoints as gt } from "@feedmepos/ui-library";
|
|
5
|
+
import { defineStore as Oe, storeToRefs as bt } from "pinia";
|
|
6
|
+
import { a as Ve, u as Ye } from "./stock-V0Qm2pTD.js";
|
|
7
|
+
import { E as ht } from "./empty-placeholder-wf6-BWE8.js";
|
|
8
|
+
const Se = et((n, r) => {
|
|
9
9
|
function e() {
|
|
10
|
-
return
|
|
10
|
+
return je().currentLocation.dbName;
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
|
-
async getDraft(
|
|
14
|
-
const
|
|
15
|
-
return
|
|
13
|
+
async getDraft(i) {
|
|
14
|
+
const u = e(), b = `${n.inventoryBackendUrl}/${u}/closing-draft/${i}`;
|
|
15
|
+
return r.get(b);
|
|
16
16
|
},
|
|
17
17
|
async readDrafts() {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
18
|
+
const i = e(), u = `${n.inventoryBackendUrl}/${i}/closing-draft`;
|
|
19
|
+
return r.get(u);
|
|
20
20
|
},
|
|
21
|
-
async runOperation(
|
|
22
|
-
const
|
|
23
|
-
return
|
|
21
|
+
async runOperation(i) {
|
|
22
|
+
const u = e(), b = `${n.inventoryBackendUrl}/${u}/closing-draft/run-operation`;
|
|
23
|
+
return r.post(b, i);
|
|
24
24
|
},
|
|
25
|
-
async sync(
|
|
26
|
-
const
|
|
27
|
-
return
|
|
25
|
+
async sync(i) {
|
|
26
|
+
const u = e(), b = `${n.inventoryBackendUrl}/${u}/closing-draft/sync`;
|
|
27
|
+
return r.post(b, i);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), xt = { class: "fm-typo-en-body-lg-400" }, At = { class: "fm-typo-en-body-lg-600" }, _t = { class: "flex gap-12 py-8 justify-end w-full" }, Me = /* @__PURE__ */ Fe({
|
|
31
31
|
__name: "ClosingDraftAction",
|
|
32
32
|
props: {
|
|
33
33
|
draft: {},
|
|
@@ -36,24 +36,24 @@ const Ce = Xe((n, s) => {
|
|
|
36
36
|
onFinished: { type: Function }
|
|
37
37
|
},
|
|
38
38
|
setup(n) {
|
|
39
|
-
const
|
|
39
|
+
const r = n, e = O(), i = Se(), u = Re(), b = O(!1);
|
|
40
40
|
async function x() {
|
|
41
41
|
b.value = !0;
|
|
42
42
|
try {
|
|
43
|
-
await
|
|
44
|
-
_id:
|
|
45
|
-
_rev:
|
|
46
|
-
action:
|
|
43
|
+
await i.runOperation({
|
|
44
|
+
_id: r.draft._id,
|
|
45
|
+
_rev: r.draft._rev ?? "",
|
|
46
|
+
action: r.action,
|
|
47
47
|
data: {
|
|
48
48
|
remark: e.value
|
|
49
49
|
}
|
|
50
|
-
}).delayed(500),
|
|
50
|
+
}).delayed(500), u.open({
|
|
51
51
|
title: "Success",
|
|
52
52
|
message: "Action submitted",
|
|
53
53
|
type: "success"
|
|
54
|
-
}),
|
|
54
|
+
}), r.onFinished();
|
|
55
55
|
} catch (C) {
|
|
56
|
-
|
|
56
|
+
u.open({
|
|
57
57
|
title: "Something went wrong",
|
|
58
58
|
message: "Unable to submit actino. Please try again",
|
|
59
59
|
type: "error"
|
|
@@ -62,36 +62,36 @@ const Ce = Xe((n, s) => {
|
|
|
62
62
|
b.value = !1;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
return (C,
|
|
65
|
+
return (C, d) => {
|
|
66
66
|
const F = U("FmTextField"), R = U("FmButton"), H = U("FmForm");
|
|
67
|
-
return h(),
|
|
67
|
+
return h(), W(H, {
|
|
68
68
|
onValidationSuccess: x,
|
|
69
69
|
class: "flex flex-col gap-32",
|
|
70
70
|
disabled: b.value
|
|
71
71
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
o("div",
|
|
74
|
-
|
|
75
|
-
o("span",
|
|
76
|
-
|
|
72
|
+
default: Y(() => [
|
|
73
|
+
o("div", xt, [
|
|
74
|
+
d[2] || (d[2] = Be(" You are about to ")),
|
|
75
|
+
o("span", At, N(C.action == g(Z).enum.approveDraft ? "approve" : "reject"), 1),
|
|
76
|
+
d[3] || (d[3] = Be(" this draft. Please provider a remark to justify this action. "))
|
|
77
77
|
]),
|
|
78
78
|
w(F, {
|
|
79
79
|
modelValue: e.value,
|
|
80
|
-
"onUpdate:modelValue":
|
|
80
|
+
"onUpdate:modelValue": d[0] || (d[0] = (I) => e.value = I),
|
|
81
81
|
label: "Remark",
|
|
82
82
|
"label-mark": "required",
|
|
83
|
-
rules: [g(
|
|
83
|
+
rules: [g(tt)()]
|
|
84
84
|
}, null, 8, ["modelValue", "rules"]),
|
|
85
|
-
o("div",
|
|
85
|
+
o("div", _t, [
|
|
86
86
|
w(R, {
|
|
87
87
|
label: "Cancel",
|
|
88
88
|
variant: "tertiary",
|
|
89
|
-
onClick:
|
|
89
|
+
onClick: d[1] || (d[1] = (I) => C.onCancel())
|
|
90
90
|
}),
|
|
91
91
|
w(R, {
|
|
92
|
-
label: C.action == g(
|
|
92
|
+
label: C.action == g(Z).enum.approveDraft ? "Approve" : "Reject",
|
|
93
93
|
type: "submit",
|
|
94
|
-
variant: C.action == g(
|
|
94
|
+
variant: C.action == g(Z).enum.approveDraft ? "primary" : "destructive",
|
|
95
95
|
loading: b.value
|
|
96
96
|
}, null, 8, ["label", "variant", "loading"])
|
|
97
97
|
])
|
|
@@ -100,58 +100,58 @@ const Ce = Xe((n, s) => {
|
|
|
100
100
|
}, 8, ["disabled"]);
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
}),
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
var C,
|
|
107
|
-
const b = ((
|
|
108
|
-
return
|
|
103
|
+
}), Dt = he(0);
|
|
104
|
+
function Ke(n) {
|
|
105
|
+
const r = n.measurementsAmounts.groupBy((i) => i.measurement.id), e = n.sku.unit.measurements.reduce((i, u) => {
|
|
106
|
+
var C, d;
|
|
107
|
+
const b = ((d = (C = r.get(u.id)) == null ? void 0 : C[0]) == null ? void 0 : d.amount) ?? Dt, x = $e(u.conversion, b);
|
|
108
|
+
return i + +M(x);
|
|
109
109
|
}, +M(n.baseAmount));
|
|
110
|
-
return
|
|
110
|
+
return at(e, n.baseAmount.precision);
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
...
|
|
116
|
-
amount: Math.abs(
|
|
117
|
-
}), x = b ?
|
|
112
|
+
const kt = he(0), wt = he(100);
|
|
113
|
+
function Ct(n, r, e) {
|
|
114
|
+
const i = Ke(n), u = Ee(i, r), b = r.amount === 0 ? null : He(u, {
|
|
115
|
+
...r,
|
|
116
|
+
amount: Math.abs(r.amount)
|
|
117
|
+
}), x = b ? $e(b, wt) : null;
|
|
118
118
|
return {
|
|
119
119
|
code: n.sku.code,
|
|
120
120
|
name: n.sku.name,
|
|
121
121
|
baseUnit: n.sku.unit.abbrev,
|
|
122
122
|
baseUnitAmount: +M(n.baseAmount),
|
|
123
123
|
...n.measurementsAmounts.filter(
|
|
124
|
-
(
|
|
124
|
+
(d) => jt(d.measurement) && e.includes(d.measurement.id)
|
|
125
125
|
).reduce(
|
|
126
|
-
(
|
|
126
|
+
(d, F, R) => (d[`measurementAbbrev${R}`] = `(${F.measurement.abbrev}) × ${M(F.measurement.conversion)}`, d[`measurementAmount${R}`] = +M(F.amount), d),
|
|
127
127
|
{}
|
|
128
128
|
),
|
|
129
|
-
systemBalance: +M(
|
|
130
|
-
physicalBalance: +M(
|
|
131
|
-
adjustedAmount: +M(
|
|
132
|
-
adjustedDiffPercentage: x ? +M(
|
|
129
|
+
systemBalance: +M(r),
|
|
130
|
+
physicalBalance: +M(i),
|
|
131
|
+
adjustedAmount: +M(u),
|
|
132
|
+
adjustedDiffPercentage: x ? +M(Le(x, 2)) : null
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function jt(n) {
|
|
136
136
|
return !n.abbrev.toLocaleLowerCase().includes("inactive");
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const
|
|
138
|
+
function St(n) {
|
|
139
|
+
const r = Ge(n);
|
|
140
140
|
return n.reduce(
|
|
141
|
-
(e,
|
|
142
|
-
var
|
|
143
|
-
return Math.max(e, ((
|
|
141
|
+
(e, i) => {
|
|
142
|
+
var u;
|
|
143
|
+
return Math.max(e, ((u = r == null ? void 0 : r.get(i.sku._id)) == null ? void 0 : u[0].length) ?? 0);
|
|
144
144
|
},
|
|
145
145
|
0
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Ge(n) {
|
|
149
149
|
return n.groupBy(
|
|
150
|
-
(
|
|
151
|
-
(
|
|
150
|
+
(r) => r.sku._id,
|
|
151
|
+
(r) => r.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Bt(n) {
|
|
155
155
|
return [
|
|
156
156
|
{
|
|
157
157
|
id: "code",
|
|
@@ -185,149 +185,149 @@ function St(n) {
|
|
|
185
185
|
id: "baseUnit",
|
|
186
186
|
name: "Base unit"
|
|
187
187
|
},
|
|
188
|
-
...Array.from({ length: n }).flatMap((e,
|
|
188
|
+
...Array.from({ length: n }).flatMap((e, i) => [
|
|
189
189
|
{
|
|
190
|
-
id: `measurementAmount${
|
|
191
|
-
name: `UOM amount ${
|
|
190
|
+
id: `measurementAmount${i}`,
|
|
191
|
+
name: `UOM amount ${i + 1}`
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
|
-
id: `measurementAbbrev${
|
|
195
|
-
name: `UOM ${
|
|
194
|
+
id: `measurementAbbrev${i}`,
|
|
195
|
+
name: `UOM ${i + 1}`
|
|
196
196
|
}
|
|
197
197
|
])
|
|
198
198
|
];
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
var
|
|
202
|
-
const e =
|
|
200
|
+
function Ft(n, r) {
|
|
201
|
+
var p, v, y, A, L, _, T;
|
|
202
|
+
const e = r.groupBy(
|
|
203
203
|
(S) => S.id,
|
|
204
204
|
(S) => S.balance
|
|
205
|
-
),
|
|
206
|
-
var
|
|
207
|
-
const
|
|
208
|
-
return
|
|
209
|
-
}), x =
|
|
210
|
-
["Business name:",
|
|
211
|
-
["Business ID:",
|
|
212
|
-
["Menu version",
|
|
205
|
+
), i = [...n.items, ...n.negativeStockItems ?? []], u = Ge(i), b = i.map((S) => {
|
|
206
|
+
var X, se;
|
|
207
|
+
const J = ((X = e.get(S.sku._id)) == null ? void 0 : X[0]) ?? kt, oe = ((se = u == null ? void 0 : u.get(S.sku._id)) == null ? void 0 : se[0]) ?? [];
|
|
208
|
+
return Ct(S, J, oe);
|
|
209
|
+
}), x = St(i), d = pt().currentBusiness.value, F = Bt(x), R = [
|
|
210
|
+
["Business name:", d == null ? void 0 : d.name],
|
|
211
|
+
["Business ID:", d == null ? void 0 : d._id],
|
|
212
|
+
["Menu version", d == null ? void 0 : d.menuVersion],
|
|
213
213
|
["Created at", new Date(n.createdAt)],
|
|
214
|
-
["Created by", (
|
|
214
|
+
["Created by", (p = n.createdBy) == null ? void 0 : p.name],
|
|
215
215
|
["Updated at", new Date(n.updatedAt)],
|
|
216
|
-
["Updated by", (
|
|
216
|
+
["Updated by", (v = n.updatedBy) == null ? void 0 : v.name],
|
|
217
217
|
["Recent action", n.approvedAt ? "Approve" : n.rejectionHistory ? "Reject" : ""],
|
|
218
218
|
[
|
|
219
219
|
"Action by",
|
|
220
|
-
n.approvedAt ? (
|
|
220
|
+
n.approvedAt ? (y = n.approvedBy) == null ? void 0 : y.name : n.rejectionHistory ? (L = (A = n.rejectionHistory[0]) == null ? void 0 : A.rejectedBy) == null ? void 0 : L.name : ""
|
|
221
221
|
],
|
|
222
222
|
[
|
|
223
223
|
"Action at",
|
|
224
|
-
n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((
|
|
224
|
+
n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((_ = n.rejectionHistory[0]) == null ? void 0 : _.rejectedAt) : ""
|
|
225
225
|
],
|
|
226
226
|
[
|
|
227
227
|
"Action remark",
|
|
228
|
-
n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((
|
|
228
|
+
n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((T = n.rejectionHistory[0]) == null ? void 0 : T.rejectRemark) : ""
|
|
229
229
|
],
|
|
230
230
|
[],
|
|
231
231
|
F.map((S) => S.name),
|
|
232
|
-
...b.map((S) => F.map((
|
|
233
|
-
], H = F.map((S) => `system:${S.id}`), I =
|
|
234
|
-
return
|
|
232
|
+
...b.map((S) => F.map((J) => S[J.id]))
|
|
233
|
+
], H = F.map((S) => `system:${S.id}`), I = nt(R, H), l = `[${d == null ? void 0 : d.name}] closing draft (${ot(new Date(n.updatedAt))}).xlsx`;
|
|
234
|
+
return st(I, l), l;
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const Ce = Oe(
|
|
237
237
|
"closingDraftActions",
|
|
238
238
|
function() {
|
|
239
|
-
const
|
|
240
|
-
function
|
|
241
|
-
const
|
|
242
|
-
draft:
|
|
239
|
+
const r = vt(), e = Re(), i = Ve(), u = Se(), b = Ye(), x = O(!1), C = O();
|
|
240
|
+
function d(v) {
|
|
241
|
+
const y = {
|
|
242
|
+
draft: v
|
|
243
243
|
};
|
|
244
|
-
C.value =
|
|
244
|
+
C.value = y, x.value = !0;
|
|
245
245
|
}
|
|
246
|
-
async function F(
|
|
247
|
-
var
|
|
248
|
-
if (
|
|
249
|
-
const L =
|
|
246
|
+
async function F(v) {
|
|
247
|
+
var A;
|
|
248
|
+
if (v.status === ne.enum.COMPLETED) {
|
|
249
|
+
const L = v.closingAdjustmentId;
|
|
250
250
|
if (!L)
|
|
251
251
|
return e.open({
|
|
252
252
|
title: "Something went wrong",
|
|
253
253
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
254
254
|
type: "error"
|
|
255
255
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
256
|
-
draftId:
|
|
256
|
+
draftId: v._id
|
|
257
257
|
}), [];
|
|
258
|
-
const
|
|
259
|
-
return ((
|
|
258
|
+
const _ = await i.readAdjustmentById(L);
|
|
259
|
+
return ((_ == null ? void 0 : _.skus) ?? []).map((S) => ({
|
|
260
260
|
id: S.sku._id,
|
|
261
261
|
balance: S.fromBalance,
|
|
262
262
|
costs: S.fromCostBalances
|
|
263
263
|
}));
|
|
264
264
|
} else
|
|
265
|
-
return await b.readStockBalance(), ((
|
|
265
|
+
return await b.readStockBalance(), ((A = b.stockBalance) == null ? void 0 : A.skus) ?? [];
|
|
266
266
|
}
|
|
267
|
-
async function R(
|
|
268
|
-
|
|
267
|
+
async function R(v, y) {
|
|
268
|
+
y || (e.open({
|
|
269
269
|
title: "Exporting",
|
|
270
270
|
message: "Fetching data..."
|
|
271
|
-
}),
|
|
271
|
+
}), y = await F(v)), Ft(v, y);
|
|
272
272
|
}
|
|
273
|
-
function H(
|
|
274
|
-
|
|
273
|
+
function H(v, y) {
|
|
274
|
+
r.open({
|
|
275
275
|
title: "Approve draft",
|
|
276
|
-
contentComponent:
|
|
276
|
+
contentComponent: Me,
|
|
277
277
|
contentComponentProps: {
|
|
278
|
-
draft:
|
|
279
|
-
action:
|
|
278
|
+
draft: v,
|
|
279
|
+
action: Z.enum.approveDraft,
|
|
280
280
|
onFinished: () => {
|
|
281
|
-
|
|
281
|
+
r.close(), y == null || y();
|
|
282
282
|
},
|
|
283
|
-
onCancel: () =>
|
|
283
|
+
onCancel: () => r.close()
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
function I(
|
|
288
|
-
|
|
287
|
+
function I(v, y) {
|
|
288
|
+
r.open({
|
|
289
289
|
title: "Reject draft",
|
|
290
|
-
contentComponent:
|
|
290
|
+
contentComponent: Me,
|
|
291
291
|
contentComponentProps: {
|
|
292
|
-
draft:
|
|
293
|
-
action:
|
|
292
|
+
draft: v,
|
|
293
|
+
action: Z.enum.rejectDraft,
|
|
294
294
|
onFinished: () => {
|
|
295
|
-
|
|
295
|
+
r.close(), y == null || y();
|
|
296
296
|
},
|
|
297
|
-
onCancel: () =>
|
|
297
|
+
onCancel: () => r.close()
|
|
298
298
|
}
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
async function
|
|
302
|
-
await
|
|
303
|
-
_id:
|
|
304
|
-
_rev:
|
|
305
|
-
action:
|
|
301
|
+
async function l(v, y) {
|
|
302
|
+
await u.sync({
|
|
303
|
+
_id: v._id,
|
|
304
|
+
_rev: v._rev ?? "",
|
|
305
|
+
action: Z.enum.approveDraft,
|
|
306
306
|
data: {
|
|
307
|
-
remark:
|
|
307
|
+
remark: v.remark ?? ""
|
|
308
308
|
}
|
|
309
309
|
}).delayed(500), e.open({
|
|
310
310
|
title: "Success",
|
|
311
311
|
message: "Sync requested",
|
|
312
312
|
type: "success"
|
|
313
|
-
}),
|
|
313
|
+
}), y == null || y();
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function p() {
|
|
316
316
|
x.value = !1;
|
|
317
317
|
}
|
|
318
318
|
return {
|
|
319
|
-
viewDraft:
|
|
320
|
-
closeDraftDialog:
|
|
319
|
+
viewDraft: d,
|
|
320
|
+
closeDraftDialog: p,
|
|
321
321
|
approveDraft: H,
|
|
322
322
|
rejectDraft: I,
|
|
323
|
-
syncDraft:
|
|
323
|
+
syncDraft: l,
|
|
324
324
|
exportDraft: R,
|
|
325
325
|
viewClosingDraftShow: x,
|
|
326
326
|
viewClosingDraftProps: C
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
);
|
|
330
|
-
function
|
|
330
|
+
function we(n) {
|
|
331
331
|
switch (n) {
|
|
332
332
|
case "DRAFT":
|
|
333
333
|
return "fm-status-badge-draft";
|
|
@@ -339,58 +339,58 @@ function ke(n) {
|
|
|
339
339
|
return "fm-status-badge-complete";
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
const
|
|
342
|
+
const $t = Oe(
|
|
343
343
|
"closingDraftTable",
|
|
344
344
|
function() {
|
|
345
|
-
const { t:
|
|
345
|
+
const { t: r } = Ne(), e = Ce(), i = O(new Array()), u = O(!1), b = je(), x = Se();
|
|
346
346
|
async function C() {
|
|
347
|
-
if (
|
|
348
|
-
|
|
347
|
+
if (i.value = [], !!b._currentLocation) {
|
|
348
|
+
u.value = !0;
|
|
349
349
|
try {
|
|
350
|
-
const [
|
|
351
|
-
|
|
352
|
-
} catch (
|
|
353
|
-
console.log("Something went wrong when fetching drafts:",
|
|
350
|
+
const [l] = await Promise.all([x.readDrafts()]).delayed(1e3);
|
|
351
|
+
i.value = l.reverse();
|
|
352
|
+
} catch (l) {
|
|
353
|
+
console.log("Something went wrong when fetching drafts:", l);
|
|
354
354
|
} finally {
|
|
355
|
-
|
|
355
|
+
u.value = !1;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
async function
|
|
360
|
-
if (!
|
|
361
|
-
|
|
359
|
+
async function d(l) {
|
|
360
|
+
if (!i.value.find((p) => p._id) && b._currentLocation) {
|
|
361
|
+
u.value = !0;
|
|
362
362
|
try {
|
|
363
|
-
const [
|
|
364
|
-
x.getDraft(
|
|
365
|
-
new Promise((
|
|
363
|
+
const [p] = await Promise.all([
|
|
364
|
+
x.getDraft(l),
|
|
365
|
+
new Promise((v) => setTimeout(v, 1e3))
|
|
366
366
|
]);
|
|
367
|
-
|
|
368
|
-
} catch (
|
|
369
|
-
console.log("Something went wrong when fetching drafts:",
|
|
367
|
+
i.value = [p];
|
|
368
|
+
} catch (p) {
|
|
369
|
+
console.log("Something went wrong when fetching drafts:", p);
|
|
370
370
|
} finally {
|
|
371
|
-
|
|
371
|
+
u.value = !1;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
function F(
|
|
376
|
-
|
|
377
|
-
...
|
|
378
|
-
_rev:
|
|
379
|
-
} :
|
|
375
|
+
function F(l) {
|
|
376
|
+
i.value = i.value.map((p) => p._id === l._id ? {
|
|
377
|
+
...l,
|
|
378
|
+
_rev: p._rev
|
|
379
|
+
} : p);
|
|
380
380
|
}
|
|
381
381
|
function R() {
|
|
382
382
|
e.closeDraftDialog(), C();
|
|
383
383
|
}
|
|
384
|
-
function H(
|
|
385
|
-
switch (
|
|
386
|
-
case
|
|
387
|
-
return e.viewDraft(
|
|
388
|
-
case
|
|
389
|
-
return e.exportDraft(
|
|
390
|
-
case
|
|
391
|
-
return e.approveDraft(
|
|
392
|
-
case
|
|
393
|
-
return e.rejectDraft(
|
|
384
|
+
function H(l, p) {
|
|
385
|
+
switch (p = ct(p), l) {
|
|
386
|
+
case De.Details:
|
|
387
|
+
return e.viewDraft(p);
|
|
388
|
+
case De.Export:
|
|
389
|
+
return e.exportDraft(p);
|
|
390
|
+
case Z.enum.approveDraft:
|
|
391
|
+
return e.approveDraft(p, R);
|
|
392
|
+
case Z.enum.rejectDraft:
|
|
393
|
+
return e.rejectDraft(p, R);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
return {
|
|
@@ -398,15 +398,15 @@ const Ft = Ne(
|
|
|
398
398
|
{
|
|
399
399
|
id: "_id",
|
|
400
400
|
accessorKey: "_id",
|
|
401
|
-
header: () =>
|
|
402
|
-
cell(
|
|
403
|
-
return
|
|
401
|
+
header: () => r("inventory.closing.table.createdAt"),
|
|
402
|
+
cell(l) {
|
|
403
|
+
return rt(`${l.getValue()}`);
|
|
404
404
|
},
|
|
405
405
|
enableSorting: !0
|
|
406
406
|
},
|
|
407
407
|
{
|
|
408
408
|
id: "updatedAt",
|
|
409
|
-
accessorFn: (
|
|
409
|
+
accessorFn: (l) => ae(l.updatedAt),
|
|
410
410
|
header: () => "Updated at",
|
|
411
411
|
enableSorting: !0,
|
|
412
412
|
size: 200
|
|
@@ -420,11 +420,11 @@ const Ft = Ne(
|
|
|
420
420
|
},
|
|
421
421
|
{
|
|
422
422
|
id: "noOfItems",
|
|
423
|
-
accessorFn: (
|
|
424
|
-
var
|
|
425
|
-
return
|
|
423
|
+
accessorFn: (l) => {
|
|
424
|
+
var p;
|
|
425
|
+
return l.items.length + (((p = l.negativeStockItems) == null ? void 0 : p.length) ?? 0);
|
|
426
426
|
},
|
|
427
|
-
header: () =>
|
|
427
|
+
header: () => r("inventory.closing.table.noOfItems"),
|
|
428
428
|
enableSorting: !1,
|
|
429
429
|
meta: {
|
|
430
430
|
width: "10rem",
|
|
@@ -433,21 +433,21 @@ const Ft = Ne(
|
|
|
433
433
|
},
|
|
434
434
|
{
|
|
435
435
|
id: "recentRemark",
|
|
436
|
-
accessorFn: (
|
|
437
|
-
var
|
|
438
|
-
return (
|
|
436
|
+
accessorFn: (l) => {
|
|
437
|
+
var p;
|
|
438
|
+
return (l == null ? void 0 : l.approveRemark) ?? ((p = l == null ? void 0 : l.rejectionHistory) == null ? void 0 : p.computeFirst((v) => v.rejectRemark)) ?? l.remark;
|
|
439
439
|
},
|
|
440
440
|
header: () => "Recent remark"
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
443
|
id: "status",
|
|
444
|
-
accessorFn: (
|
|
445
|
-
header: () =>
|
|
444
|
+
accessorFn: (l) => l.status,
|
|
445
|
+
header: () => r("inventory.closing.table.status"),
|
|
446
446
|
enableSorting: !1,
|
|
447
|
-
cell(
|
|
448
|
-
var
|
|
449
|
-
const
|
|
450
|
-
return
|
|
447
|
+
cell(l) {
|
|
448
|
+
var _;
|
|
449
|
+
const p = l.row.original, v = p.status, y = new Date(p.updatedAt), A = (_ = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : _.computeFirst((T) => T.rejectedAt), L = A ? new Date(A) : null;
|
|
450
|
+
return v === "DRAFT" && L ? L.getTime() > y.getTime() ? j(
|
|
451
451
|
"div",
|
|
452
452
|
{
|
|
453
453
|
class: "flex"
|
|
@@ -455,7 +455,7 @@ const Ft = Ne(
|
|
|
455
455
|
j(
|
|
456
456
|
"div",
|
|
457
457
|
{
|
|
458
|
-
class: ["fm-status-badge",
|
|
458
|
+
class: ["fm-status-badge", we("FAILED")]
|
|
459
459
|
},
|
|
460
460
|
"Rejected"
|
|
461
461
|
)
|
|
@@ -467,7 +467,7 @@ const Ft = Ne(
|
|
|
467
467
|
j(
|
|
468
468
|
"div",
|
|
469
469
|
{
|
|
470
|
-
class: ["fm-status-badge",
|
|
470
|
+
class: ["fm-status-badge", we("PROCESSING")]
|
|
471
471
|
},
|
|
472
472
|
"Updated"
|
|
473
473
|
)
|
|
@@ -479,37 +479,37 @@ const Ft = Ne(
|
|
|
479
479
|
j(
|
|
480
480
|
"div",
|
|
481
481
|
{
|
|
482
|
-
class: ["fm-status-badge",
|
|
482
|
+
class: ["fm-status-badge", we(v)]
|
|
483
483
|
},
|
|
484
|
-
|
|
484
|
+
ze(v)
|
|
485
485
|
)
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
488
|
},
|
|
489
489
|
{
|
|
490
490
|
id: "action",
|
|
491
|
-
cell(
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
],
|
|
491
|
+
cell(l) {
|
|
492
|
+
const p = l.row.original, v = [
|
|
493
|
+
Pe[De.Details],
|
|
494
|
+
Pe[De.Export]
|
|
495
|
+
], y = [
|
|
496
496
|
{
|
|
497
497
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
498
498
|
color: "text-fm-color-typo-primary",
|
|
499
|
-
value:
|
|
499
|
+
value: Z.enum.approveDraft
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
502
|
translationKey: "inventory.closing.draft.rejectDraft",
|
|
503
503
|
color: "text-fm-color-typo-error",
|
|
504
|
-
value:
|
|
504
|
+
value: Z.enum.rejectDraft
|
|
505
505
|
}
|
|
506
506
|
];
|
|
507
|
-
return
|
|
507
|
+
return lt(
|
|
508
508
|
[
|
|
509
|
-
...
|
|
510
|
-
...
|
|
509
|
+
...v,
|
|
510
|
+
...p.status === ne.enum.DRAFT ? y : []
|
|
511
511
|
],
|
|
512
|
-
(
|
|
512
|
+
(A) => H(A, p)
|
|
513
513
|
);
|
|
514
514
|
},
|
|
515
515
|
enableSorting: !1,
|
|
@@ -520,80 +520,81 @@ const Ft = Ne(
|
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
],
|
|
523
|
-
drafts:
|
|
524
|
-
loading:
|
|
523
|
+
drafts: i,
|
|
524
|
+
loading: u,
|
|
525
525
|
fetchDrafts: C,
|
|
526
|
-
loadDraft:
|
|
526
|
+
loadDraft: d,
|
|
527
527
|
updateDraftRef: F
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
),
|
|
530
|
+
), Rt = { class: "w-full flex flex-col gap-32" }, Tt = { class: "flex justify-between" }, Pt = { class: "flex" }, Mt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "flex gap-1" }, Et = { class: "fm-typo-en-body-lg-600" }, Ht = { class: "flex flex-col gap-16" }, Lt = { class: "flex items-center" }, zt = {
|
|
531
531
|
key: 0,
|
|
532
532
|
class: "flex gap-8"
|
|
533
|
-
},
|
|
533
|
+
}, Nt = {
|
|
534
534
|
key: 0,
|
|
535
535
|
class: "w-full flex flex-col items-center"
|
|
536
|
-
},
|
|
536
|
+
}, Ot = { class: "flex items-center gap-8" }, Vt = {
|
|
537
537
|
key: 0,
|
|
538
538
|
class: "flex gap-8"
|
|
539
|
-
},
|
|
539
|
+
}, Yt = { class: "overflow-x-auto" }, Kt = {
|
|
540
540
|
key: 1,
|
|
541
541
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
542
|
-
},
|
|
542
|
+
}, Gt = {
|
|
543
543
|
key: 0,
|
|
544
544
|
class: "flex flex-col items-center gap-8 h-full"
|
|
545
|
-
},
|
|
545
|
+
}, qt = ["src"], Wt = {
|
|
546
546
|
key: 1,
|
|
547
547
|
class: "px-4 flex flex-col"
|
|
548
|
-
},
|
|
548
|
+
}, Zt = { class: "flex gap-12 content-stretch" }, Jt = {
|
|
549
549
|
class: "flex flex-col w-24",
|
|
550
550
|
name: "circles"
|
|
551
|
-
},
|
|
551
|
+
}, Xt = { class: "flex-1 flex flex-col items-center" }, Qt = { class: "flex-1 flex flex-col items-center" }, ea = {
|
|
552
552
|
class: "py-12 flex flex-col gap-4",
|
|
553
553
|
name: "received-at header"
|
|
554
|
-
},
|
|
554
|
+
}, ta = { class: "fm-typo-en-body-lg-400" }, aa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, na = { class: "flex gap-12 content-stretch" }, oa = {
|
|
555
555
|
class: "flex flex-col w-24",
|
|
556
556
|
name: "circles"
|
|
557
|
-
},
|
|
557
|
+
}, sa = { class: "flex-1 flex flex-col items-center" }, ra = {
|
|
558
558
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
559
559
|
name: "delivery details"
|
|
560
|
-
},
|
|
560
|
+
}, la = { class: "flex flex-col gap-8" }, ca = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ia = { class: "flex flex-col gap-4" }, ua = { class: "flex gap-8" }, da = /* @__PURE__ */ Fe({
|
|
561
561
|
__name: "ClosingDraftDialog",
|
|
562
562
|
props: {
|
|
563
563
|
show: { type: Boolean },
|
|
564
564
|
draft: {}
|
|
565
565
|
},
|
|
566
566
|
emits: ["submitted", "refresh"],
|
|
567
|
-
setup(n, { emit:
|
|
568
|
-
const e = n,
|
|
569
|
-
|
|
567
|
+
setup(n, { emit: r }) {
|
|
568
|
+
const e = n, i = Ye(), u = Ce(), b = yt(e, "show"), x = O(!1), C = O(!1), d = O(!1), F = O(new Array()), R = Ve(), H = Se(), I = Re(), l = it(), p = je(), v = We({}), y = E(() => new Set(
|
|
569
|
+
l.skus.filter((a) => {
|
|
570
570
|
var t;
|
|
571
|
-
return
|
|
571
|
+
return v[(t = a.customAttributes) == null ? void 0 : t.tag];
|
|
572
572
|
}).map((a) => a._id)
|
|
573
|
-
)),
|
|
574
|
-
var t,
|
|
575
|
-
const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((
|
|
576
|
-
return y.value.size ? a.filter((
|
|
577
|
-
}),
|
|
578
|
-
const a =
|
|
579
|
-
return a.sort((t,
|
|
580
|
-
}),
|
|
573
|
+
)), A = r, L = E(() => {
|
|
574
|
+
var t, s;
|
|
575
|
+
const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((s = e.draft) == null ? void 0 : s.negativeStockItems) ?? []];
|
|
576
|
+
return y.value.size ? a.filter((m) => y.value.has(m.sku._id)) : a;
|
|
577
|
+
}), _ = E(() => {
|
|
578
|
+
const a = L.value.map((t) => t.sku);
|
|
579
|
+
return a.sort((t, s) => t.code.localeCompare(s.code)), a;
|
|
580
|
+
}), T = E(() => L.value.groupBy(
|
|
581
581
|
(t) => t.sku._id,
|
|
582
|
-
(t) => t.measurementsAmounts.filter((
|
|
582
|
+
(t) => t.measurementsAmounts.filter((s) => !s.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((s) => s.measurement.id)
|
|
583
583
|
));
|
|
584
|
-
|
|
584
|
+
Ze(oe), Je(
|
|
585
585
|
() => e.show,
|
|
586
586
|
(a) => {
|
|
587
|
-
a && (
|
|
587
|
+
a && (K.value = ue[0], oe());
|
|
588
588
|
}
|
|
589
589
|
);
|
|
590
|
-
const
|
|
591
|
-
async function
|
|
592
|
-
var t,
|
|
590
|
+
const S = he(0), J = he(100);
|
|
591
|
+
async function oe() {
|
|
592
|
+
var t, s, m;
|
|
593
|
+
if (!p._currentLocation) return;
|
|
593
594
|
x.value = !0;
|
|
594
|
-
const a = ((t = e.draft) == null ? void 0 : t.status) ===
|
|
595
|
+
const a = ((t = e.draft) == null ? void 0 : t.status) === ne.enum.COMPLETED;
|
|
595
596
|
try {
|
|
596
|
-
if (await
|
|
597
|
+
if (await l.init(), a) {
|
|
597
598
|
const c = e.draft.closingAdjustmentId;
|
|
598
599
|
if (!c) {
|
|
599
600
|
I.open({
|
|
@@ -601,18 +602,18 @@ const Ft = Ne(
|
|
|
601
602
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
602
603
|
type: "error"
|
|
603
604
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
604
|
-
draftId: (
|
|
605
|
+
draftId: (s = e.draft) == null ? void 0 : s._id
|
|
605
606
|
});
|
|
606
607
|
return;
|
|
607
608
|
}
|
|
608
|
-
const
|
|
609
|
+
const f = await R.readAdjustmentById(c), $ = (f == null ? void 0 : f.skus) ?? [];
|
|
609
610
|
F.value = $.map((k) => ({
|
|
610
611
|
id: k.sku._id,
|
|
611
612
|
balance: k.fromBalance,
|
|
612
613
|
costs: k.fromCostBalances
|
|
613
614
|
}));
|
|
614
615
|
} else
|
|
615
|
-
F.value = ((
|
|
616
|
+
F.value = ((m = e.draft) == null ? void 0 : m.stockSnapshot) ?? [];
|
|
616
617
|
} catch (c) {
|
|
617
618
|
I.open({
|
|
618
619
|
title: "Something went wrong",
|
|
@@ -623,9 +624,9 @@ const Ft = Ne(
|
|
|
623
624
|
x.value = !1;
|
|
624
625
|
}
|
|
625
626
|
}
|
|
626
|
-
async function
|
|
627
|
-
var c,
|
|
628
|
-
const a = ((c = e.draft) == null ? void 0 : c.effectiveAt) ?? ((
|
|
627
|
+
async function X() {
|
|
628
|
+
var c, f, $;
|
|
629
|
+
const a = ((c = e.draft) == null ? void 0 : c.effectiveAt) ?? ((f = e.draft) == null ? void 0 : f.updatedAt);
|
|
629
630
|
if (!a) {
|
|
630
631
|
I.open({
|
|
631
632
|
title: "Cannot refresh",
|
|
@@ -635,14 +636,14 @@ const Ft = Ne(
|
|
|
635
636
|
return;
|
|
636
637
|
}
|
|
637
638
|
C.value = !0;
|
|
638
|
-
const t = ($ = e.draft) == null ? void 0 : $._rev,
|
|
639
|
+
const t = ($ = e.draft) == null ? void 0 : $._rev, s = 30, m = 2e3;
|
|
639
640
|
try {
|
|
640
641
|
await R.recalculation.scheduleCalculateStockSnapshotAtDate(
|
|
641
642
|
a,
|
|
642
643
|
e.draft._id
|
|
643
644
|
);
|
|
644
645
|
let k = null;
|
|
645
|
-
for (let B = 0; B <
|
|
646
|
+
for (let B = 0; B < s && (k = await H.getDraft(e.draft._id).delayed(m), k._rev === t); B++)
|
|
646
647
|
;
|
|
647
648
|
if (!k || k._rev === t) {
|
|
648
649
|
I.open({
|
|
@@ -652,7 +653,7 @@ const Ft = Ne(
|
|
|
652
653
|
}), console.error("error refreshing stock balances: there is no change in stockSnapshotAt");
|
|
653
654
|
return;
|
|
654
655
|
}
|
|
655
|
-
|
|
656
|
+
A("refresh", k), F.value = k.stockSnapshot ?? [], I.open({
|
|
656
657
|
title: "Balance refreshed",
|
|
657
658
|
message: "Stock balance has been recalculated.",
|
|
658
659
|
type: "success"
|
|
@@ -667,15 +668,15 @@ const Ft = Ne(
|
|
|
667
668
|
C.value = !1;
|
|
668
669
|
}
|
|
669
670
|
}
|
|
670
|
-
const
|
|
671
|
+
const se = E(
|
|
671
672
|
() => F.value.groupBy(
|
|
672
673
|
(a) => a.id,
|
|
673
674
|
(a) => a.balance
|
|
674
675
|
)
|
|
675
|
-
),
|
|
676
|
-
function
|
|
676
|
+
), xe = E(() => L.value.groupBy((a) => a.sku._id));
|
|
677
|
+
function le(a) {
|
|
677
678
|
return j(
|
|
678
|
-
|
|
679
|
+
fe.FmTooltip,
|
|
679
680
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
680
681
|
{
|
|
681
682
|
default() {
|
|
@@ -687,48 +688,48 @@ const Ft = Ne(
|
|
|
687
688
|
}
|
|
688
689
|
);
|
|
689
690
|
}
|
|
690
|
-
const
|
|
691
|
-
const a =
|
|
692
|
-
var c,
|
|
693
|
-
return Math.max(
|
|
691
|
+
const ve = E(() => {
|
|
692
|
+
const a = _.value.reduce((s, m) => {
|
|
693
|
+
var c, f;
|
|
694
|
+
return Math.max(s, ((f = (c = T.value) == null ? void 0 : c.get(m._id)) == null ? void 0 : f[0].length) ?? 0);
|
|
694
695
|
}, 0);
|
|
695
696
|
return [
|
|
696
697
|
{
|
|
697
698
|
id: "sku",
|
|
698
|
-
accessorFn: (
|
|
699
|
+
accessorFn: (s) => `${s.code} ${s.name}`,
|
|
699
700
|
header: () => "Name",
|
|
700
701
|
size: 350,
|
|
701
|
-
cell(
|
|
702
|
-
const
|
|
702
|
+
cell(s) {
|
|
703
|
+
const m = s.row.original, c = m.adjustedDiffPercentage, f = typeof c == "number" && Math.abs(c) > 10, $ = j("div", { class: "flex flex-col gap-4" }, [
|
|
703
704
|
j(
|
|
704
705
|
"div",
|
|
705
706
|
{
|
|
706
707
|
class: [
|
|
707
708
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
708
|
-
|
|
709
|
+
f ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
|
|
709
710
|
]
|
|
710
711
|
},
|
|
711
|
-
|
|
712
|
+
m.name
|
|
712
713
|
),
|
|
713
714
|
j(
|
|
714
715
|
"div",
|
|
715
716
|
{
|
|
716
717
|
class: [
|
|
717
718
|
"line-clamp-1 fm-typo-en-body-md-400",
|
|
718
|
-
|
|
719
|
+
f ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
|
|
719
720
|
]
|
|
720
721
|
},
|
|
721
|
-
|
|
722
|
+
m.code
|
|
722
723
|
)
|
|
723
724
|
]);
|
|
724
725
|
return j(
|
|
725
|
-
|
|
726
|
+
fe.FmTooltip,
|
|
726
727
|
{
|
|
727
728
|
zIndex: 51
|
|
728
729
|
},
|
|
729
730
|
{
|
|
730
731
|
content() {
|
|
731
|
-
return
|
|
732
|
+
return f ? "Adjustment difference is more than 10%." : `${m.code} - ${m.name}`;
|
|
732
733
|
},
|
|
733
734
|
default() {
|
|
734
735
|
return j("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
@@ -747,7 +748,7 @@ const Ft = Ne(
|
|
|
747
748
|
{
|
|
748
749
|
id: "physicalBalance",
|
|
749
750
|
accessorKey: "physicalBalance",
|
|
750
|
-
header: () =>
|
|
751
|
+
header: () => le("Actual balance"),
|
|
751
752
|
size: 200,
|
|
752
753
|
meta: {
|
|
753
754
|
textAlign: "right"
|
|
@@ -756,7 +757,7 @@ const Ft = Ne(
|
|
|
756
757
|
{
|
|
757
758
|
id: "systemBalance",
|
|
758
759
|
accessorKey: "systemBalance",
|
|
759
|
-
header: () =>
|
|
760
|
+
header: () => le("Balance"),
|
|
760
761
|
size: 200,
|
|
761
762
|
meta: {
|
|
762
763
|
textAlign: "right"
|
|
@@ -765,7 +766,7 @@ const Ft = Ne(
|
|
|
765
766
|
{
|
|
766
767
|
id: "adjustedAmount",
|
|
767
768
|
accessorKey: "adjustedAmount",
|
|
768
|
-
header: () =>
|
|
769
|
+
header: () => le("Adjusted balance"),
|
|
769
770
|
size: 200,
|
|
770
771
|
meta: {
|
|
771
772
|
textAlign: "right"
|
|
@@ -775,13 +776,13 @@ const Ft = Ne(
|
|
|
775
776
|
id: "adjustedDiffPercentage",
|
|
776
777
|
accessorKey: "adjustedDiffPercentage",
|
|
777
778
|
header: () => j(
|
|
778
|
-
|
|
779
|
+
fe.FmTooltip,
|
|
779
780
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
780
781
|
{
|
|
781
782
|
default() {
|
|
782
783
|
return j("div", { class: "flex items-center gap-4" }, [
|
|
783
784
|
"Diff (%)",
|
|
784
|
-
j(
|
|
785
|
+
j(fe.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
|
|
785
786
|
]);
|
|
786
787
|
},
|
|
787
788
|
content() {
|
|
@@ -790,17 +791,17 @@ const Ft = Ne(
|
|
|
790
791
|
}
|
|
791
792
|
),
|
|
792
793
|
size: 200,
|
|
793
|
-
cell(
|
|
794
|
-
const
|
|
795
|
-
if (!
|
|
796
|
-
const c =
|
|
794
|
+
cell(s) {
|
|
795
|
+
const m = s.row.original.adjustedDiffPercentage;
|
|
796
|
+
if (!m) return "N/A";
|
|
797
|
+
const c = m.toFixed(2);
|
|
797
798
|
if (c === "0.00")
|
|
798
799
|
return j("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
|
|
799
|
-
const
|
|
800
|
+
const f = m > 0;
|
|
800
801
|
return j("div", { class: "flex items-center gap-4 justify-end" }, [
|
|
801
|
-
j(
|
|
802
|
-
name:
|
|
803
|
-
color:
|
|
802
|
+
j(fe.FmIcon, {
|
|
803
|
+
name: f ? "arrow_drop_up" : "arrow_drop_down",
|
|
804
|
+
color: f ? "system-success-300" : "system-error-300",
|
|
804
805
|
size: "md"
|
|
805
806
|
}),
|
|
806
807
|
c
|
|
@@ -814,9 +815,9 @@ const Ft = Ne(
|
|
|
814
815
|
id: "physicalBalances",
|
|
815
816
|
header: () => "Amounts",
|
|
816
817
|
enableSorting: !1,
|
|
817
|
-
cell(
|
|
818
|
-
const
|
|
819
|
-
|
|
818
|
+
cell(s) {
|
|
819
|
+
const m = s.row.original, c = ($, k) => j(
|
|
820
|
+
fe.FmTooltip,
|
|
820
821
|
{ zIndex: 50 },
|
|
821
822
|
{
|
|
822
823
|
default() {
|
|
@@ -843,67 +844,67 @@ const Ft = Ne(
|
|
|
843
844
|
}
|
|
844
845
|
}
|
|
845
846
|
);
|
|
846
|
-
let
|
|
847
|
-
if (!
|
|
847
|
+
let f = Array.from({ length: a }).map(($, k) => {
|
|
848
|
+
if (!m[`measurementAmount${k}`])
|
|
848
849
|
return null;
|
|
849
|
-
const B =
|
|
850
|
-
return c(B,
|
|
850
|
+
const B = m[`measurementAmount${k}`], de = m[`measurementAbbrev${k}`];
|
|
851
|
+
return c(B, de);
|
|
851
852
|
}).filter(($) => $);
|
|
852
|
-
return (
|
|
853
|
+
return (m.baseUnitAmount || !f.length) && (f = [c(m.baseUnitAmount, m.baseUnit), ...f]), j(
|
|
853
854
|
"div",
|
|
854
855
|
{
|
|
855
856
|
class: "flex gap-8 flex-nowrap",
|
|
856
857
|
style: {
|
|
857
|
-
minWidth: `${120 *
|
|
858
|
+
minWidth: `${120 * f.length}px`
|
|
858
859
|
}
|
|
859
860
|
},
|
|
860
|
-
|
|
861
|
+
f
|
|
861
862
|
);
|
|
862
863
|
}
|
|
863
864
|
}
|
|
864
865
|
];
|
|
865
|
-
}),
|
|
866
|
-
var B,
|
|
867
|
-
const t = (B =
|
|
866
|
+
}), ce = E(() => ve.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), ie = O(""), ye = E(() => _.value.map((a) => {
|
|
867
|
+
var B, de;
|
|
868
|
+
const t = (B = xe.value.get(a._id)) == null ? void 0 : B[0], s = ((de = se.value.get(a._id)) == null ? void 0 : de[0]) ?? S;
|
|
868
869
|
if (!t)
|
|
869
870
|
return {
|
|
870
871
|
code: a.code,
|
|
871
872
|
name: a.name,
|
|
872
873
|
baseUnit: a.unit.abbrev,
|
|
873
874
|
baseUnitAmount: 0,
|
|
874
|
-
systemBalance: +M(
|
|
875
|
+
systemBalance: +M(s),
|
|
875
876
|
physicalBalance: 0,
|
|
876
|
-
adjustedAmount: -+M(
|
|
877
|
+
adjustedAmount: -+M(s),
|
|
877
878
|
adjustedDiffPercentage: -100
|
|
878
879
|
};
|
|
879
|
-
const
|
|
880
|
-
...
|
|
881
|
-
amount: Math.abs(
|
|
882
|
-
}), $ =
|
|
880
|
+
const m = Ke(t), c = Ee(m, s), f = s.amount === 0 ? null : He(c, {
|
|
881
|
+
...s,
|
|
882
|
+
amount: Math.abs(s.amount)
|
|
883
|
+
}), $ = f ? $e(f, J) : null;
|
|
883
884
|
return {
|
|
884
885
|
code: a.code,
|
|
885
886
|
name: a.name,
|
|
886
887
|
baseUnit: a.unit.abbrev,
|
|
887
888
|
baseUnitAmount: +M(t.baseAmount),
|
|
888
|
-
...t.measurementsAmounts.filter((
|
|
889
|
-
var
|
|
890
|
-
return (
|
|
891
|
-
}).reduce((
|
|
892
|
-
systemBalance: +M(
|
|
893
|
-
physicalBalance: +M(
|
|
889
|
+
...t.measurementsAmounts.filter((te) => {
|
|
890
|
+
var G, re, _e;
|
|
891
|
+
return (_e = (re = (G = T.value) == null ? void 0 : G.get(a._id)) == null ? void 0 : re[0]) == null ? void 0 : _e.includes(te.measurement.id);
|
|
892
|
+
}).reduce((te, G, re) => (te[`measurementAbbrev${re}`] = `(${G.measurement.abbrev}) × ${M(G.measurement.conversion)}`, te[`measurementAmount${re}`] = +M(G.amount), te), {}),
|
|
893
|
+
systemBalance: +M(s),
|
|
894
|
+
physicalBalance: +M(m),
|
|
894
895
|
adjustedAmount: +M(c),
|
|
895
|
-
adjustedDiffPercentage: $ ? +M(
|
|
896
|
+
adjustedDiffPercentage: $ ? +M(Le($, 2)) : null
|
|
896
897
|
};
|
|
897
|
-
})),
|
|
898
|
-
var t,
|
|
898
|
+
})), Ae = E(() => {
|
|
899
|
+
var t, s, m;
|
|
899
900
|
if (!e.draft) return [];
|
|
900
901
|
const a = e.draft.approvedAt ? {
|
|
901
|
-
action: `Approve at ${
|
|
902
|
+
action: `Approve at ${ae(e.draft.approvedAt)}`,
|
|
902
903
|
// actionAt: props.draft.approvedAt,
|
|
903
904
|
actionBy: e.draft.approvedBy,
|
|
904
905
|
remark: e.draft.approveRemark
|
|
905
906
|
} : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((c) => ({
|
|
906
|
-
action: `Reject at ${
|
|
907
|
+
action: `Reject at ${ae(c.rejectedAt)}`,
|
|
907
908
|
// actionAt: e.rejectedAt,
|
|
908
909
|
actionBy: c.rejectedBy,
|
|
909
910
|
remark: c.rejectRemark
|
|
@@ -911,7 +912,7 @@ const Ft = Ne(
|
|
|
911
912
|
return [
|
|
912
913
|
{
|
|
913
914
|
label: "Created at",
|
|
914
|
-
value:
|
|
915
|
+
value: ae(e.draft.createdAt)
|
|
915
916
|
},
|
|
916
917
|
{
|
|
917
918
|
label: "Created by",
|
|
@@ -919,7 +920,7 @@ const Ft = Ne(
|
|
|
919
920
|
},
|
|
920
921
|
{
|
|
921
922
|
label: "Updated at",
|
|
922
|
-
value:
|
|
923
|
+
value: ae(e.draft.updatedAt)
|
|
923
924
|
},
|
|
924
925
|
{
|
|
925
926
|
label: "Updated by",
|
|
@@ -927,11 +928,11 @@ const Ft = Ne(
|
|
|
927
928
|
},
|
|
928
929
|
{
|
|
929
930
|
label: "Effective at",
|
|
930
|
-
value:
|
|
931
|
+
value: ae(e.draft.effectiveAt ?? e.draft.updatedAt)
|
|
931
932
|
},
|
|
932
933
|
{
|
|
933
934
|
label: "Using template",
|
|
934
|
-
value: ((
|
|
935
|
+
value: ((s = e.draft.usingTemplates.find((c) => c)) == null ? void 0 : s.name) ?? "None"
|
|
935
936
|
},
|
|
936
937
|
e.draft.remark ? {
|
|
937
938
|
label: "Remark",
|
|
@@ -943,14 +944,14 @@ const Ft = Ne(
|
|
|
943
944
|
} : null,
|
|
944
945
|
a && a.actionBy ? {
|
|
945
946
|
label: "Last action by",
|
|
946
|
-
value: (
|
|
947
|
+
value: (m = a.actionBy) == null ? void 0 : m.name
|
|
947
948
|
} : null,
|
|
948
949
|
a && a.remark ? {
|
|
949
950
|
label: "Action remark",
|
|
950
951
|
value: a.remark
|
|
951
952
|
} : null
|
|
952
953
|
].filter((c) => c).map((c) => c);
|
|
953
|
-
}),
|
|
954
|
+
}), ue = [
|
|
954
955
|
{
|
|
955
956
|
label: "Overview",
|
|
956
957
|
value: "overview"
|
|
@@ -959,33 +960,33 @@ const Ft = Ne(
|
|
|
959
960
|
label: "Action history",
|
|
960
961
|
value: "history"
|
|
961
962
|
}
|
|
962
|
-
],
|
|
963
|
-
var t,
|
|
963
|
+
], K = O(ue[0]), Q = E(() => {
|
|
964
|
+
var t, s, m, c;
|
|
964
965
|
return [
|
|
965
966
|
...(((t = e.draft) == null ? void 0 : t.rejectionHistory) ?? []).map(
|
|
966
|
-
(
|
|
967
|
+
(f) => ({
|
|
967
968
|
header: "Reject",
|
|
968
|
-
date:
|
|
969
|
+
date: ae(f.rejectedAt),
|
|
969
970
|
info: [
|
|
970
971
|
{
|
|
971
972
|
label: "Rejected by",
|
|
972
|
-
values: [
|
|
973
|
+
values: [f.rejectedBy.name]
|
|
973
974
|
},
|
|
974
975
|
{
|
|
975
976
|
label: "Rejection remark",
|
|
976
|
-
values: [
|
|
977
|
+
values: [f.rejectRemark]
|
|
977
978
|
}
|
|
978
979
|
]
|
|
979
980
|
})
|
|
980
981
|
),
|
|
981
|
-
...(
|
|
982
|
+
...(s = e.draft) != null && s.approvedBy ? [
|
|
982
983
|
{
|
|
983
984
|
header: "Approve",
|
|
984
|
-
date: e.draft.approvedAt ?
|
|
985
|
+
date: e.draft.approvedAt ? ae(e.draft.approvedAt) : "",
|
|
985
986
|
info: [
|
|
986
987
|
{
|
|
987
988
|
label: "Approved by",
|
|
988
|
-
values: [(
|
|
989
|
+
values: [(m = e.draft) == null ? void 0 : m.approvedBy.name]
|
|
989
990
|
},
|
|
990
991
|
{
|
|
991
992
|
label: "Approval remark",
|
|
@@ -995,122 +996,122 @@ const Ft = Ne(
|
|
|
995
996
|
}
|
|
996
997
|
] : []
|
|
997
998
|
];
|
|
998
|
-
}),
|
|
999
|
-
var c,
|
|
999
|
+
}), ge = E(() => {
|
|
1000
|
+
var c, f, $, k;
|
|
1000
1001
|
if ((c = e == null ? void 0 : e.draft) != null && c.approvedAt) return "Draft is already approved.";
|
|
1001
|
-
if (((
|
|
1002
|
-
const a =
|
|
1002
|
+
if (((f = e.draft) == null ? void 0 : f.status) !== ne.enum.DRAFT) return "Status is not draft.";
|
|
1003
|
+
const a = ye.value.some((B) => B.physicalBalance < 0), t = ((k = ($ = i.stockBalance.skus) == null ? void 0 : $.filter((B) => B.balance.amount < 0)) == null ? void 0 : k.map((B) => B.id)) ?? [], s = new Set(_.value.map((B) => B._id)), m = t.filter((B) => !s.has(B)).length;
|
|
1003
1004
|
return [
|
|
1004
1005
|
a ? "Negative total exist." : null,
|
|
1005
|
-
|
|
1006
|
+
m ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
|
|
1006
1007
|
].filter((B) => B).join(" ");
|
|
1007
1008
|
});
|
|
1008
1009
|
return (a, t) => {
|
|
1009
|
-
const
|
|
1010
|
-
return h(),
|
|
1010
|
+
const s = U("FmButtonGroup"), m = U("FmMenuDivider"), c = U("FmCard"), f = U("FmButton"), $ = U("FmCircularProgress"), k = U("FmTextField"), B = U("FmIcon"), de = U("FmChip"), te = U("FmTable"), G = U("FmSpacer"), re = U("FmTooltip"), _e = U("FmSideSheet");
|
|
1011
|
+
return h(), W(_e, {
|
|
1011
1012
|
"dismiss-away": "",
|
|
1012
1013
|
"max-width": 9999,
|
|
1013
1014
|
"model-value": g(b),
|
|
1014
|
-
"onUpdate:modelValue": t[8] || (t[8] = (
|
|
1015
|
+
"onUpdate:modelValue": t[8] || (t[8] = (D) => Ie(b) ? b.value = D : null),
|
|
1015
1016
|
header: "Closing details"
|
|
1016
1017
|
}, {
|
|
1017
|
-
"side-sheet-footer":
|
|
1018
|
-
var
|
|
1018
|
+
"side-sheet-footer": Y(() => {
|
|
1019
|
+
var D, z, V, me;
|
|
1019
1020
|
return [
|
|
1020
|
-
o("div",
|
|
1021
|
-
((
|
|
1022
|
-
|
|
1021
|
+
o("div", ua, [
|
|
1022
|
+
((D = e.draft) == null ? void 0 : D.status) === g(ne).enum.DRAFT ? (h(), P(q, { key: 0 }, [
|
|
1023
|
+
ge.value ? (h(), W(re, {
|
|
1023
1024
|
key: 0,
|
|
1024
1025
|
"z-index": 51
|
|
1025
1026
|
}, {
|
|
1026
|
-
content:
|
|
1027
|
-
|
|
1027
|
+
content: Y(() => [
|
|
1028
|
+
Be(N(ge.value), 1)
|
|
1028
1029
|
]),
|
|
1029
|
-
default:
|
|
1030
|
-
w(
|
|
1030
|
+
default: Y(() => [
|
|
1031
|
+
w(f, {
|
|
1031
1032
|
disabled: "",
|
|
1032
1033
|
key: "approve key",
|
|
1033
1034
|
label: "Approve",
|
|
1034
|
-
onClick: t[3] || (t[3] = () => e.draft && g(
|
|
1035
|
+
onClick: t[3] || (t[3] = () => e.draft && g(u).approveDraft(e.draft, () => A("submitted")))
|
|
1035
1036
|
})
|
|
1036
1037
|
]),
|
|
1037
1038
|
_: 1
|
|
1038
|
-
})) : (h(),
|
|
1039
|
+
})) : (h(), W(f, {
|
|
1039
1040
|
key: "approve key",
|
|
1040
1041
|
label: "Approve",
|
|
1041
|
-
onClick: t[4] || (t[4] = () => e.draft && g(
|
|
1042
|
+
onClick: t[4] || (t[4] = () => e.draft && g(u).approveDraft(e.draft, () => A("submitted")))
|
|
1042
1043
|
}))
|
|
1043
|
-
], 64)) :
|
|
1044
|
-
((z = e.draft) == null ? void 0 : z.status) === g(
|
|
1044
|
+
], 64)) : ee("", !0),
|
|
1045
|
+
((z = e.draft) == null ? void 0 : z.status) === g(ne).enum.DRAFT ? (h(), W(f, {
|
|
1045
1046
|
key: 1,
|
|
1046
1047
|
label: "Reject",
|
|
1047
1048
|
variant: "destructive",
|
|
1048
|
-
onClick: t[5] || (t[5] = () => e.draft && g(
|
|
1049
|
-
})) :
|
|
1050
|
-
(V = e.draft) != null && V.approvedAt && ((
|
|
1049
|
+
onClick: t[5] || (t[5] = () => e.draft && g(u).rejectDraft(e.draft, () => A("submitted")))
|
|
1050
|
+
})) : ee("", !0),
|
|
1051
|
+
(V = e.draft) != null && V.approvedAt && ((me = e.draft) == null ? void 0 : me.status) !== g(ne).enum.COMPLETED ? (h(), W(f, {
|
|
1051
1052
|
key: 2,
|
|
1052
1053
|
label: "Sync",
|
|
1053
|
-
loading:
|
|
1054
|
+
loading: d.value,
|
|
1054
1055
|
onClick: t[6] || (t[6] = () => {
|
|
1055
|
-
e.draft && (
|
|
1056
|
-
|
|
1056
|
+
e.draft && (d.value = !0, g(u).syncDraft(e.draft, () => {
|
|
1057
|
+
d.value = !1, A("submitted");
|
|
1057
1058
|
}));
|
|
1058
1059
|
})
|
|
1059
|
-
}, null, 8, ["loading"])) :
|
|
1060
|
-
w(
|
|
1060
|
+
}, null, 8, ["loading"])) : ee("", !0),
|
|
1061
|
+
w(f, {
|
|
1061
1062
|
label: "Close",
|
|
1062
1063
|
variant: "tertiary",
|
|
1063
|
-
onClick: t[7] || (t[7] = (
|
|
1064
|
+
onClick: t[7] || (t[7] = (Te) => b.value = !1)
|
|
1064
1065
|
})
|
|
1065
1066
|
])
|
|
1066
1067
|
];
|
|
1067
1068
|
}),
|
|
1068
|
-
default:
|
|
1069
|
-
o("div",
|
|
1069
|
+
default: Y(() => [
|
|
1070
|
+
o("div", Rt, [
|
|
1070
1071
|
o("div", null, [
|
|
1071
|
-
w(
|
|
1072
|
-
items:
|
|
1073
|
-
modelValue:
|
|
1074
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1072
|
+
w(s, {
|
|
1073
|
+
items: ue,
|
|
1074
|
+
modelValue: K.value,
|
|
1075
|
+
"onUpdate:modelValue": t[0] || (t[0] = (D) => K.value = D)
|
|
1075
1076
|
}, null, 8, ["modelValue"])
|
|
1076
1077
|
]),
|
|
1077
|
-
|
|
1078
|
+
K.value.value === "overview" ? (h(), P(q, { key: 0 }, [
|
|
1078
1079
|
w(c, {
|
|
1079
1080
|
variant: "outlined",
|
|
1080
1081
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1081
1082
|
}, {
|
|
1082
|
-
default:
|
|
1083
|
-
var
|
|
1083
|
+
default: Y(() => {
|
|
1084
|
+
var D, z;
|
|
1084
1085
|
return [
|
|
1085
|
-
o("div",
|
|
1086
|
+
o("div", Tt, [
|
|
1086
1087
|
t[9] || (t[9] = o("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
1087
|
-
o("div",
|
|
1088
|
+
o("div", Pt, [
|
|
1088
1089
|
o("div", {
|
|
1089
|
-
class:
|
|
1090
|
-
}, N(g(
|
|
1090
|
+
class: pe(["fm-status-badge", g(we)(((D = a.draft) == null ? void 0 : D.status) ?? "DRAFT")])
|
|
1091
|
+
}, N(g(ze)(((z = a.draft) == null ? void 0 : z.status) ?? "")), 3)
|
|
1091
1092
|
])
|
|
1092
1093
|
]),
|
|
1093
|
-
w(
|
|
1094
|
-
o("div",
|
|
1095
|
-
(h(!0),
|
|
1094
|
+
w(m),
|
|
1095
|
+
o("div", Mt, [
|
|
1096
|
+
(h(!0), P(q, null, be(Ae.value, (V, me) => (h(), P("div", {
|
|
1096
1097
|
class: "flex flex-col gap-4",
|
|
1097
|
-
key:
|
|
1098
|
+
key: me
|
|
1098
1099
|
}, [
|
|
1099
|
-
o("div",
|
|
1100
|
-
o("div",
|
|
1100
|
+
o("div", It, [
|
|
1101
|
+
o("div", Ut, N(V.label), 1)
|
|
1101
1102
|
]),
|
|
1102
|
-
o("div",
|
|
1103
|
+
o("div", Et, N(V.value), 1)
|
|
1103
1104
|
]))), 128))
|
|
1104
1105
|
])
|
|
1105
1106
|
];
|
|
1106
1107
|
}),
|
|
1107
1108
|
_: 1
|
|
1108
1109
|
}),
|
|
1109
|
-
o("div",
|
|
1110
|
-
o("div",
|
|
1110
|
+
o("div", Ht, [
|
|
1111
|
+
o("div", Lt, [
|
|
1111
1112
|
t[10] || (t[10] = o("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
1112
|
-
x.value ?
|
|
1113
|
-
a.draft && a.draft.status !== g(
|
|
1113
|
+
x.value ? ee("", !0) : (h(), P("div", zt, [
|
|
1114
|
+
a.draft && a.draft.status !== g(ne).enum.COMPLETED ? (h(), W(f, {
|
|
1114
1115
|
key: 0,
|
|
1115
1116
|
label: "Refresh balance",
|
|
1116
1117
|
"prepend-icon": "refresh",
|
|
@@ -1119,86 +1120,86 @@ const Ft = Ne(
|
|
|
1119
1120
|
"bg-color": "transparent",
|
|
1120
1121
|
"border-color": "primary",
|
|
1121
1122
|
loading: C.value,
|
|
1122
|
-
onClick:
|
|
1123
|
-
}, null, 8, ["loading"])) :
|
|
1124
|
-
w(
|
|
1123
|
+
onClick: X
|
|
1124
|
+
}, null, 8, ["loading"])) : ee("", !0),
|
|
1125
|
+
w(f, {
|
|
1125
1126
|
label: "Export data",
|
|
1126
1127
|
"prepend-icon": "download",
|
|
1127
1128
|
variant: "secondary",
|
|
1128
1129
|
"text-color": "primary",
|
|
1129
1130
|
"bg-color": "transparent",
|
|
1130
1131
|
"border-color": "primary",
|
|
1131
|
-
onClick: t[1] || (t[1] = (
|
|
1132
|
+
onClick: t[1] || (t[1] = (D) => a.draft ? g(u).exportDraft(a.draft, F.value) : null)
|
|
1132
1133
|
})
|
|
1133
1134
|
]))
|
|
1134
1135
|
]),
|
|
1135
|
-
x.value ? (h(),
|
|
1136
|
+
x.value ? (h(), P("div", Nt, [
|
|
1136
1137
|
t[12] || (t[12] = o("div", { class: "h-80" }, null, -1)),
|
|
1137
|
-
o("div",
|
|
1138
|
+
o("div", Ot, [
|
|
1138
1139
|
o("div", null, [
|
|
1139
1140
|
w($, { size: "md" })
|
|
1140
1141
|
]),
|
|
1141
1142
|
t[11] || (t[11] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
1142
1143
|
]),
|
|
1143
1144
|
t[13] || (t[13] = o("div", { class: "h-80" }, null, -1))
|
|
1144
|
-
])) : (h(),
|
|
1145
|
+
])) : (h(), P(q, { key: 1 }, [
|
|
1145
1146
|
o("div", null, [
|
|
1146
1147
|
w(k, {
|
|
1147
|
-
modelValue:
|
|
1148
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
1148
|
+
modelValue: ie.value,
|
|
1149
|
+
"onUpdate:modelValue": t[2] || (t[2] = (D) => ie.value = D),
|
|
1149
1150
|
placeholder: "Filter items"
|
|
1150
1151
|
}, null, 8, ["modelValue"])
|
|
1151
1152
|
]),
|
|
1152
|
-
g(
|
|
1153
|
-
(h(!0),
|
|
1154
|
-
key: `${
|
|
1155
|
-
label: `${
|
|
1153
|
+
g(l).skuTags.size ? (h(), P("div", Vt, [
|
|
1154
|
+
(h(!0), P(q, null, be(g(l).skuTags.keys(), (D) => (h(), W(de, {
|
|
1155
|
+
key: `${D}`,
|
|
1156
|
+
label: `${D}`,
|
|
1156
1157
|
selectable: "",
|
|
1157
|
-
selected:
|
|
1158
|
-
onClick: (z) =>
|
|
1158
|
+
selected: v[`${D}`],
|
|
1159
|
+
onClick: (z) => v[`${D}`] = !v[`${D}`]
|
|
1159
1160
|
}, {
|
|
1160
|
-
default:
|
|
1161
|
-
|
|
1161
|
+
default: Y(() => [
|
|
1162
|
+
v[`${D}`] ? (h(), W(B, {
|
|
1162
1163
|
key: 0,
|
|
1163
1164
|
name: "check",
|
|
1164
1165
|
class: "text-white",
|
|
1165
1166
|
size: "sm"
|
|
1166
|
-
})) :
|
|
1167
|
+
})) : ee("", !0),
|
|
1167
1168
|
o("span", {
|
|
1168
|
-
class:
|
|
1169
|
+
class: pe([
|
|
1169
1170
|
"",
|
|
1170
1171
|
{
|
|
1171
|
-
"text-white fm-typo-en-body-md-600":
|
|
1172
|
-
"text-fm-color-typo-primary fm-typo-en-body-md-400": !
|
|
1172
|
+
"text-white fm-typo-en-body-md-600": v[`${D}`],
|
|
1173
|
+
"text-fm-color-typo-primary fm-typo-en-body-md-400": !v[`${D}`]
|
|
1173
1174
|
}
|
|
1174
1175
|
])
|
|
1175
|
-
}, N(
|
|
1176
|
+
}, N(D), 3)
|
|
1176
1177
|
]),
|
|
1177
1178
|
_: 2
|
|
1178
1179
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
1179
|
-
])) :
|
|
1180
|
-
o("div",
|
|
1180
|
+
])) : ee("", !0),
|
|
1181
|
+
o("div", Yt, [
|
|
1181
1182
|
o("div", {
|
|
1182
|
-
style:
|
|
1183
|
+
style: Ue({ minWidth: `${ce.value}px` })
|
|
1183
1184
|
}, [
|
|
1184
|
-
w(
|
|
1185
|
-
"column-defs":
|
|
1186
|
-
"row-data":
|
|
1187
|
-
"search-value":
|
|
1185
|
+
w(te, {
|
|
1186
|
+
"column-defs": ve.value,
|
|
1187
|
+
"row-data": ye.value,
|
|
1188
|
+
"search-value": ie.value
|
|
1188
1189
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
1189
1190
|
], 4)
|
|
1190
1191
|
])
|
|
1191
1192
|
], 64))
|
|
1192
1193
|
])
|
|
1193
|
-
], 64)) :
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
(h(!0),
|
|
1197
|
-
o("div",
|
|
1198
|
-
o("div",
|
|
1199
|
-
o("div",
|
|
1194
|
+
], 64)) : ee("", !0),
|
|
1195
|
+
K.value.value === "history" ? (h(), P("div", Kt, [
|
|
1196
|
+
Q.value.length ? (h(), P("div", Wt, [
|
|
1197
|
+
(h(!0), P(q, null, be(Q.value, (D, z) => (h(), P(q, { key: z }, [
|
|
1198
|
+
o("div", Zt, [
|
|
1199
|
+
o("div", Jt, [
|
|
1200
|
+
o("div", Xt, [
|
|
1200
1201
|
o("div", {
|
|
1201
|
-
class:
|
|
1202
|
+
class: pe([
|
|
1202
1203
|
{
|
|
1203
1204
|
"bg-fm-color-primary": z !== 0,
|
|
1204
1205
|
"bg-white": z === 0
|
|
@@ -1210,52 +1211,52 @@ const Ft = Ne(
|
|
|
1210
1211
|
t[16] || (t[16] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1211
1212
|
o("div", Qt, [
|
|
1212
1213
|
o("div", {
|
|
1213
|
-
class:
|
|
1214
|
+
class: pe([
|
|
1214
1215
|
{
|
|
1215
|
-
"bg-fm-color-primary": z <
|
|
1216
|
-
"bg-white": z >=
|
|
1216
|
+
"bg-fm-color-primary": z < Q.value.length - 1,
|
|
1217
|
+
"bg-white": z >= Q.value.length - 1
|
|
1217
1218
|
},
|
|
1218
1219
|
"w-[2px] h-full"
|
|
1219
1220
|
])
|
|
1220
1221
|
}, null, 2)
|
|
1221
1222
|
])
|
|
1222
1223
|
]),
|
|
1223
|
-
o("div",
|
|
1224
|
-
o("div",
|
|
1225
|
-
o("div",
|
|
1224
|
+
o("div", ea, [
|
|
1225
|
+
o("div", ta, N(D.header), 1),
|
|
1226
|
+
o("div", aa, N(D.date), 1)
|
|
1226
1227
|
])
|
|
1227
1228
|
]),
|
|
1228
|
-
o("div",
|
|
1229
|
-
o("div",
|
|
1230
|
-
o("div",
|
|
1229
|
+
o("div", na, [
|
|
1230
|
+
o("div", oa, [
|
|
1231
|
+
o("div", sa, [
|
|
1231
1232
|
o("div", {
|
|
1232
|
-
class:
|
|
1233
|
+
class: pe([
|
|
1233
1234
|
{
|
|
1234
|
-
"bg-fm-color-primary": z <
|
|
1235
|
-
"bg-white": z >=
|
|
1235
|
+
"bg-fm-color-primary": z < Q.value.length - 1,
|
|
1236
|
+
"bg-white": z >= Q.value.length - 1
|
|
1236
1237
|
},
|
|
1237
1238
|
"w-[2px] h-full"
|
|
1238
1239
|
])
|
|
1239
1240
|
}, null, 2)
|
|
1240
1241
|
])
|
|
1241
1242
|
]),
|
|
1242
|
-
o("div",
|
|
1243
|
+
o("div", ra, [
|
|
1243
1244
|
w(c, {
|
|
1244
1245
|
variant: "outlined",
|
|
1245
1246
|
class: "py-12 px-16"
|
|
1246
1247
|
}, {
|
|
1247
|
-
default:
|
|
1248
|
-
o("div",
|
|
1249
|
-
(h(!0),
|
|
1250
|
-
key:
|
|
1248
|
+
default: Y(() => [
|
|
1249
|
+
o("div", la, [
|
|
1250
|
+
(h(!0), P(q, null, be(D.info, (V, me) => (h(), P("div", {
|
|
1251
|
+
key: me,
|
|
1251
1252
|
class: "flex flex-col gap-4"
|
|
1252
1253
|
}, [
|
|
1253
|
-
o("div",
|
|
1254
|
-
o("div",
|
|
1255
|
-
(h(!0),
|
|
1256
|
-
key:
|
|
1254
|
+
o("div", ca, N(V == null ? void 0 : V.label), 1),
|
|
1255
|
+
o("div", ia, [
|
|
1256
|
+
(h(!0), P(q, null, be(V == null ? void 0 : V.values, (Te, qe) => (h(), P("div", {
|
|
1257
|
+
key: qe,
|
|
1257
1258
|
class: "fm-typo-en-body-lg-600"
|
|
1258
|
-
}, N(
|
|
1259
|
+
}, N(Te), 1))), 128))
|
|
1259
1260
|
])
|
|
1260
1261
|
]))), 128))
|
|
1261
1262
|
])
|
|
@@ -1265,65 +1266,65 @@ const Ft = Ne(
|
|
|
1265
1266
|
])
|
|
1266
1267
|
])
|
|
1267
1268
|
], 64))), 128))
|
|
1268
|
-
])) : (h(),
|
|
1269
|
-
w(
|
|
1269
|
+
])) : (h(), P("div", Gt, [
|
|
1270
|
+
w(G),
|
|
1270
1271
|
o("div", null, [
|
|
1271
1272
|
o("img", {
|
|
1272
|
-
src: g(
|
|
1273
|
+
src: g(ht),
|
|
1273
1274
|
alt: "List is empty"
|
|
1274
|
-
}, null, 8,
|
|
1275
|
+
}, null, 8, qt)
|
|
1275
1276
|
]),
|
|
1276
1277
|
t[14] || (t[14] = o("div", { class: "fm-typo-en-body-lg-600" }, N("No records found"), -1)),
|
|
1277
1278
|
t[15] || (t[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, N("You can track approval and rejection history here"), -1)),
|
|
1278
|
-
w(
|
|
1279
|
-
w(
|
|
1279
|
+
w(G),
|
|
1280
|
+
w(G)
|
|
1280
1281
|
]))
|
|
1281
|
-
])) :
|
|
1282
|
+
])) : ee("", !0)
|
|
1282
1283
|
])
|
|
1283
1284
|
]),
|
|
1284
1285
|
_: 1
|
|
1285
1286
|
}, 8, ["model-value"]);
|
|
1286
1287
|
};
|
|
1287
1288
|
}
|
|
1288
|
-
}),
|
|
1289
|
+
}), ma = { class: "flex-1 flex flex-col gap-8" }, fa = { class: "flex flex-col" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, va = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ya = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, ga = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, wa = /* @__PURE__ */ Fe({
|
|
1289
1290
|
__name: "ClosingDraftView",
|
|
1290
1291
|
setup(n) {
|
|
1291
|
-
const { t:
|
|
1292
|
+
const { t: r } = Ne(), { viewDraft: e } = Ce(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = bt(Ce()), b = je(), x = $t(), C = ut(), { breakpoints: d } = gt();
|
|
1292
1293
|
b.watchLocation(x.fetchDrafts);
|
|
1293
|
-
const F = E(() => x.loading), R = O(""), H = E(() =>
|
|
1294
|
-
function
|
|
1295
|
-
switch (
|
|
1294
|
+
const F = E(() => x.loading), R = O(""), H = E(() => d.value.xs || d.value.sm), I = E(() => H.value ? 10 : 20);
|
|
1295
|
+
function l(y) {
|
|
1296
|
+
switch (y) {
|
|
1296
1297
|
case "refresh":
|
|
1297
1298
|
return x.fetchDrafts();
|
|
1298
1299
|
}
|
|
1299
1300
|
}
|
|
1300
|
-
function
|
|
1301
|
-
return
|
|
1301
|
+
function p(y) {
|
|
1302
|
+
return y;
|
|
1302
1303
|
}
|
|
1303
|
-
const
|
|
1304
|
+
const v = E(() => H.value ? [
|
|
1304
1305
|
{
|
|
1305
|
-
label:
|
|
1306
|
+
label: r("inventory.common.refresh"),
|
|
1306
1307
|
value: "refresh",
|
|
1307
1308
|
isPrimary: !1
|
|
1308
1309
|
}
|
|
1309
1310
|
] : [
|
|
1310
1311
|
{
|
|
1311
|
-
label:
|
|
1312
|
+
label: r("inventory.common.refresh"),
|
|
1312
1313
|
value: "refresh",
|
|
1313
1314
|
isPrimary: !1
|
|
1314
1315
|
}
|
|
1315
1316
|
]);
|
|
1316
|
-
return (
|
|
1317
|
+
return (y, A) => {
|
|
1317
1318
|
const L = U("FmTable");
|
|
1318
|
-
return h(),
|
|
1319
|
-
w(
|
|
1320
|
-
title: g(
|
|
1321
|
-
actions:
|
|
1322
|
-
"onClick:action":
|
|
1319
|
+
return h(), P(q, null, [
|
|
1320
|
+
w(dt, {
|
|
1321
|
+
title: g(r)("inventory.closing.draft.title"),
|
|
1322
|
+
actions: v.value,
|
|
1323
|
+
"onClick:action": l
|
|
1323
1324
|
}, {
|
|
1324
|
-
default:
|
|
1325
|
+
default: Y(() => [
|
|
1325
1326
|
o("div", {
|
|
1326
|
-
class:
|
|
1327
|
+
class: pe([
|
|
1327
1328
|
"flex flex-col gap-8 max-h-full",
|
|
1328
1329
|
{
|
|
1329
1330
|
"p-0": H.value,
|
|
@@ -1331,58 +1332,58 @@ const Ft = Ne(
|
|
|
1331
1332
|
}
|
|
1332
1333
|
])
|
|
1333
1334
|
}, [
|
|
1334
|
-
w(
|
|
1335
|
+
w(mt, {
|
|
1335
1336
|
"change-location": "",
|
|
1336
1337
|
searchable: "",
|
|
1337
1338
|
search: R.value,
|
|
1338
|
-
"onUpdate:search":
|
|
1339
|
+
"onUpdate:search": A[0] || (A[0] = (_) => R.value = _)
|
|
1339
1340
|
}, null, 8, ["search"]),
|
|
1340
1341
|
w(L, {
|
|
1341
|
-
style:
|
|
1342
|
+
style: Ue(g(C).tableHeight),
|
|
1342
1343
|
"column-defs": g(x).columnDefs,
|
|
1343
1344
|
"row-data": g(x).drafts,
|
|
1344
1345
|
"search-value": R.value,
|
|
1345
1346
|
loading: F.value,
|
|
1346
|
-
onRowClick:
|
|
1347
|
+
onRowClick: A[1] || (A[1] = (_) => g(e)(_.original)),
|
|
1347
1348
|
"page-size": I.value
|
|
1348
1349
|
}, {
|
|
1349
|
-
"list-row":
|
|
1350
|
-
w(
|
|
1351
|
-
row:
|
|
1352
|
-
onRowClick: (
|
|
1350
|
+
"list-row": Y((_) => [
|
|
1351
|
+
w(ft, {
|
|
1352
|
+
row: _,
|
|
1353
|
+
onRowClick: (T) => g(e)(T)
|
|
1353
1354
|
}, {
|
|
1354
|
-
default:
|
|
1355
|
-
var S,
|
|
1355
|
+
default: Y((T) => {
|
|
1356
|
+
var S, J, oe, X, se, xe, le, ve, ce, ie, ye, Ae, ue, K, Q, ge, a, t, s, m;
|
|
1356
1357
|
return [
|
|
1357
|
-
o("div",
|
|
1358
|
-
o("div",
|
|
1359
|
-
o("div",
|
|
1360
|
-
w(g(
|
|
1361
|
-
render: (
|
|
1362
|
-
props: (se = (
|
|
1358
|
+
o("div", ma, [
|
|
1359
|
+
o("div", fa, [
|
|
1360
|
+
o("div", pa, [
|
|
1361
|
+
w(g(ke), {
|
|
1362
|
+
render: (oe = (J = (S = T._id) == null ? void 0 : S.column) == null ? void 0 : J.columnDef) == null ? void 0 : oe.cell,
|
|
1363
|
+
props: (se = (X = T._id) == null ? void 0 : X.getContext) == null ? void 0 : se.call(X)
|
|
1363
1364
|
}, null, 8, ["render", "props"])
|
|
1364
1365
|
]),
|
|
1365
|
-
o("div",
|
|
1366
|
-
w(g(
|
|
1367
|
-
render: (
|
|
1368
|
-
props: (
|
|
1366
|
+
o("div", va, [
|
|
1367
|
+
w(g(ke), {
|
|
1368
|
+
render: (ve = (le = (xe = T.name) == null ? void 0 : xe.column) == null ? void 0 : le.columnDef) == null ? void 0 : ve.cell,
|
|
1369
|
+
props: (ie = (ce = T.name) == null ? void 0 : ce.getContext) == null ? void 0 : ie.call(ce)
|
|
1369
1370
|
}, null, 8, ["render", "props"])
|
|
1370
1371
|
]),
|
|
1371
|
-
o("div",
|
|
1372
|
-
...
|
|
1373
|
-
...
|
|
1372
|
+
o("div", ya, N([
|
|
1373
|
+
..._.original.items.slice(0, 3).map((c) => c.sku.name),
|
|
1374
|
+
..._.original.items.length >= 3 ? [`and ${_.original.items.length - 3} more items`] : []
|
|
1374
1375
|
].join(", ")), 1),
|
|
1375
|
-
o("div",
|
|
1376
|
-
w(g(
|
|
1377
|
-
render: (
|
|
1378
|
-
props: (
|
|
1376
|
+
o("div", ga, [
|
|
1377
|
+
w(g(ke), {
|
|
1378
|
+
render: (ue = (Ae = (ye = T.ref) == null ? void 0 : ye.column) == null ? void 0 : Ae.columnDef) == null ? void 0 : ue.cell,
|
|
1379
|
+
props: (Q = (K = T.ref) == null ? void 0 : K.getContext) == null ? void 0 : Q.call(K)
|
|
1379
1380
|
}, null, 8, ["render", "props"])
|
|
1380
1381
|
])
|
|
1381
1382
|
]),
|
|
1382
1383
|
o("div", null, [
|
|
1383
|
-
w(g(
|
|
1384
|
-
render: (
|
|
1385
|
-
props: (
|
|
1384
|
+
w(g(ke), {
|
|
1385
|
+
render: (t = (a = (ge = T.status) == null ? void 0 : ge.column) == null ? void 0 : a.columnDef) == null ? void 0 : t.cell,
|
|
1386
|
+
props: (m = (s = T.status) == null ? void 0 : s.getContext) == null ? void 0 : m.call(s)
|
|
1386
1387
|
}, null, 8, ["render", "props"])
|
|
1387
1388
|
])
|
|
1388
1389
|
])
|
|
@@ -1397,12 +1398,12 @@ const Ft = Ne(
|
|
|
1397
1398
|
]),
|
|
1398
1399
|
_: 1
|
|
1399
1400
|
}, 8, ["title", "actions"]),
|
|
1400
|
-
(h(),
|
|
1401
|
-
w(
|
|
1402
|
-
show: g(
|
|
1403
|
-
"onUpdate:show":
|
|
1404
|
-
onSubmitted:
|
|
1405
|
-
onRefresh:
|
|
1401
|
+
(h(), W(Xe, { to: "body" }, [
|
|
1402
|
+
w(da, Qe(g(i), {
|
|
1403
|
+
show: g(u),
|
|
1404
|
+
"onUpdate:show": A[2] || (A[2] = (_) => Ie(u) ? u.value = _ : null),
|
|
1405
|
+
onSubmitted: A[3] || (A[3] = () => (u.value = !1, g(x).fetchDrafts())),
|
|
1406
|
+
onRefresh: A[4] || (A[4] = (_) => g(x).updateDraftRef(_))
|
|
1406
1407
|
}), null, 16, ["show"])
|
|
1407
1408
|
]))
|
|
1408
1409
|
], 64);
|
|
@@ -1410,5 +1411,5 @@ const Ft = Ne(
|
|
|
1410
1411
|
}
|
|
1411
1412
|
});
|
|
1412
1413
|
export {
|
|
1413
|
-
|
|
1414
|
+
wa as default
|
|
1414
1415
|
};
|