@feedmepos/mf-inventory-portal 1.2.46 → 1.2.47
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-DBd4DVaZ.js → App-JsgP9iMu.js} +3 -3
- package/dist/{ApprovalView-C-XcEiMZ.js → ApprovalView-Co6sACH5.js} +5 -5
- package/dist/{BindingsDialog-CXKDYmmR.js → BindingsDialog-B73QXq1j.js} +2 -2
- package/dist/{BindingsPicker-Cq1yHJhJ.js → BindingsPicker-DuMTRelf.js} +3 -3
- package/dist/{BindingsTable-BL8DhipQ.js → BindingsTable-CcYQN1_L.js} +3 -3
- package/dist/ClosingDraftView-D3INnwT_.js +2410 -0
- package/dist/{ClosingHistoryView-BC8ZP51z.js → ClosingHistoryView-CSjxazA8.js} +3 -3
- package/dist/{ClosingTemplateView-B4jnOrpc.js → ClosingTemplateView-Ct0GFJ7D.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-Bxy5xIrP.js → DeliveryOrderPrintPreview-BS50CpKI.js} +4 -4
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D5DApGXT.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bi9iqGTu.js} +12 -12
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHS5LMuy.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CRUsPKK3.js} +2 -2
- package/dist/{FmMultiselectDialog-C6OzbsWu.js → FmMultiselectDialog-B_aNaPp3.js} +2 -2
- package/dist/{FmMultiselectDialog-C7DVf8cL.js → FmMultiselectDialog-CaUUBqDA.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BtN3UL40.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CQqGUFIx.js} +3 -3
- package/dist/{ImportView-BhmfI7Am.js → ImportView-KjHa3RPH.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BXSO5UKK.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BBaVY_DM.js} +1 -1
- package/dist/{IngredientGroupView-DfAt-7Fz.js → IngredientGroupView-DPM9zcrM.js} +5 -5
- package/dist/{IngredientsView-4MNLuMhd.js → IngredientsView-DJGeVNXg.js} +916 -910
- package/dist/{IntegrationView-CvgAJIaG.js → IntegrationView-C1-xqYQI.js} +12 -12
- package/dist/{InventoryBindingForm-CQB1X3d5.js → InventoryBindingForm-B57y7_jC.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Sebvr-gm.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CHTnMNKl.js} +4 -4
- package/dist/{InventoryBindingSummary-_-dkvb4N.js → InventoryBindingSummary-Df70IKSg.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BGsjKOls.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DWe54YRe.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D9goSrss.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BgCCrM-_.js} +2 -2
- package/dist/{PublishView-BFdsGmRf.js → PublishView-C5YHhPwg.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-DpaV5GjO.js → PurchaseOrderPrintPreview-BjopVTxs.js} +10 -10
- package/dist/{ReceiveRequestView-DNimgIgR.js → ReceiveRequestView-huk0yTuo.js} +896 -889
- package/dist/{RecipeView-D8CH2rJC.js → RecipeView-B2jYchFP.js} +8 -8
- package/dist/StockView-BhttACCV.js +2497 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bb-yJBxo.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DvviBt_n.js} +1 -1
- package/dist/{SupplierView-Bl0JNI44.js → SupplierView-6Vxxq9GN.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-C-VmXiM3.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C_nItuSz.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DqmlOtC4.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Den4pUf9.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D-4LyU74.js → TransferDetails.vue_vue_type_script_setup_true_lang-CmI0k0v2.js} +99 -99
- package/dist/{TransferTemplateView-COJEXmF0.js → TransferTemplateView-_WTnebCR.js} +412 -412
- package/dist/{UnitView-ecUANF8x.js → UnitView-BeP9MpmK.js} +6 -6
- package/dist/{WarehouseView-DZ9OCali.js → WarehouseView-pdM7HFYr.js} +5 -5
- package/dist/{WastageTemplateView-DXu5bayJ.js → WastageTemplateView-a4twoJLB.js} +14 -14
- package/dist/api/inventory.d.ts +10 -10
- package/dist/api/stock.d.ts +1 -0
- package/dist/{app-aLZoWUfQ.js → app-D-WXtKYn.js} +4623 -5097
- package/dist/app.d.ts +176 -834
- package/dist/app.js +1 -1
- package/dist/{closing-template-D-cf9Vnu.js → closing-template-O7lUhol7.js} +1 -1
- package/dist/{date2-DluMG3-3.js → date2-DkEAKP8N.js} +1 -1
- package/dist/{dayjs.min-UuQWuDkU.js → dayjs.min-DF1VUh0Q.js} +13 -13
- package/dist/{decimal-B2f58cUQ.js → decimal-CL_qgPqL.js} +2 -2
- package/dist/{defineDeepModel-DUvW0g9M.js → defineDeepModel-xcAkDmDA.js} +1 -1
- package/dist/{duplicate-template-BiGYHuPK.js → duplicate-template-TY54cIdK.js} +1 -1
- package/dist/{feature-B-rekKRC.js → feature-Dw3PJCX9.js} +2 -2
- package/dist/{format-time-from-id-CMm14GBq.js → format-time-from-id-Ceptcl3U.js} +1 -1
- package/dist/{format-unit-display-DeHfXVX_.js → format-unit-display-GRZQIgFD.js} +10 -10
- package/dist/{import-export.helper-rXmKqRlR.js → import-export.helper-Bl-r_RxV.js} +5 -5
- package/dist/{index-DGs4MBmv.js → index-CEbidibW.js} +3 -3
- package/dist/{index-CYdIQDVa.js → index-D-_4dS91.js} +1 -1
- package/dist/{index-CEK6OlSE.js → index-Dgk8_4hY.js} +1 -1
- package/dist/{lodash-DO8ShgBV.js → lodash-efdnV3n2.js} +1 -1
- package/dist/{netsuite-NShFW2SJ.js → netsuite-D4yOOSrW.js} +3 -3
- package/dist/{purchase-order-template-COeJz9vK.js → purchase-order-template-Dvs3YVVH.js} +1 -1
- package/dist/{rules-C_U2Ahtv.js → rules-BsrasJ6a.js} +3 -3
- package/dist/{stock-B9KGLNAt.js → stock-BITU59fq.js} +3 -3
- package/dist/{stock-DdZuie8e.js → stock-D0WV9zWp.js} +7 -1
- package/dist/stores/inventory.d.ts +13 -13
- package/dist/stores/stock.d.ts +5 -5
- package/dist/stores/supplier.d.ts +24 -24
- package/dist/{supplier-BCfa74hz.js → supplier-DSUvpEyd.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-CoAP08vZ.js → use-ingredient-select-dialog-CNpU0tfI.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BPXhlhVD.js → use-inventory-binding-dialog-D7s2C-xQ.js} +2 -2
- package/dist/{use-template-enabled-locations-2-CYfkmGP5.js → use-template-enabled-locations-2-bflR8fp7.js} +2 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +29 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +20 -20
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +3 -3
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +60 -60
- package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +2 -2
- package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +1 -1
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +6 -6
- package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +12 -12
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +2 -2
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +2 -2
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +12 -12
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +14 -14
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +29 -6
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +2 -2
- package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +2 -2
- package/dist/views/supplier/composables/use-supplier-table.d.ts +1 -1
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +12 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +12 -12
- package/dist/{vue-i18n-Cn8L1Fah.js → vue-i18n-j0rHGXSn.js} +301 -301
- package/dist/{xlsx-jqtV3ziP.js → xlsx-CgB84NXq.js} +398 -398
- package/dist/{xlsx.util-BBey-FqO.js → xlsx.util-DeZhqfVV.js} +1 -1
- package/package.json +1 -1
- package/dist/ClosingDraftView-nwQQl4U1.js +0 -2164
- package/dist/StockView-cXMeYZEU.js +0 -2407
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { s as
|
|
3
|
-
import { i as
|
|
4
|
-
import { u as
|
|
5
|
-
import { R as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { d as
|
|
1
|
+
import { reactive as $t, onMounted as We, watch as _e, computed as M, h as Q, defineComponent as de, openBlock as k, createElementBlock as T, Fragment as re, renderList as xe, createElementVNode as l, toDisplayString as E, unref as t, resolveComponent as V, createVNode as v, withCtx as A, createCommentVNode as K, ref as U, createBlock as se, normalizeClass as J, normalizeStyle as Dt, createTextVNode as Pe, toRaw as Et, shallowRef as ht, onUnmounted as Mt, triggerRef as qt, mergeProps as nt, isRef as Se, createSlots as Ut, Teleport as Nt, normalizeProps as Bt, guardReactiveProps as zt } from "vue";
|
|
2
|
+
import { s as rt, t as pe, J as Lt, f as Tt, M as Ht, A as jt, u as Je, a as Ge, O as kt, P as Qt, Q as Yt, T as Kt, U as Xt, v as Zt, m as Ke } from "./app-D-WXtKYn.js";
|
|
3
|
+
import { i as xt, _ as Wt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CRUsPKK3.js";
|
|
4
|
+
import { u as Jt, P as at, a as Gt, _ as es, g as ts } from "./TransferDetails.vue_vue_type_script_setup_true_lang-CmI0k0v2.js";
|
|
5
|
+
import { R as Ue, a as we, e as Ze, d as ss, A as Xe, M as as, B as lt } from "./rules-BsrasJ6a.js";
|
|
6
|
+
import { _ as Vt, u as os, i as ns, e as ls } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BgCCrM-_.js";
|
|
7
|
+
import { d as Ct } from "./dayjs.min-DF1VUh0Q.js";
|
|
8
8
|
import { u as rs } from "./useTabStorage-BkIVScW_.js";
|
|
9
9
|
import { u as is, _ as us } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
10
|
-
import { useBreakpoints as
|
|
10
|
+
import { useBreakpoints as it, components as ge, FmButtonVariant as ds, useSnackbar as Re, useDialog as cs, useProxiedModel as Pt } from "@feedmepos/ui-library";
|
|
11
11
|
import { F as qe } from "./form-mode.enum-BKiNVH6A.js";
|
|
12
|
-
import { _ as ms, a as ps, b as fs, F as vs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
13
|
-
import { u as et, c as ys, P as bs } from "./feature-
|
|
14
|
-
import { u as
|
|
15
|
-
import { c as Te, u as gs, _ as _s } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { _ as ms, a as ps, b as fs, F as vs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CQqGUFIx.js";
|
|
13
|
+
import { u as et, c as ys, P as bs } from "./feature-Dw3PJCX9.js";
|
|
14
|
+
import { u as Ne } from "./netsuite-D4yOOSrW.js";
|
|
15
|
+
import { c as Te, u as gs, _ as _s } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bi9iqGTu.js";
|
|
16
16
|
import { useI18n as he } from "@feedmepos/mf-common";
|
|
17
|
-
import { a as hs } from "./FmMultiselectDialog-
|
|
18
|
-
import { F as ve, _ as
|
|
19
|
-
import { u as
|
|
20
|
-
import { d as
|
|
17
|
+
import { a as hs } from "./FmMultiselectDialog-B_aNaPp3.js";
|
|
18
|
+
import { F as ve, _ as Rt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
|
|
19
|
+
import { u as ut } from "./supplier-DSUvpEyd.js";
|
|
20
|
+
import { d as dt, e as ks, g as xs, b as Cs } from "./date2-DkEAKP8N.js";
|
|
21
21
|
import { _ as Ss } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
22
|
-
import { a as
|
|
23
|
-
import { u as
|
|
24
|
-
import { u as ws } from "./vue-i18n-
|
|
25
|
-
import { s as Fs, r as Is } from "./xlsx.util-
|
|
22
|
+
import { a as Ot } from "./format-unit-display-GRZQIgFD.js";
|
|
23
|
+
import { u as ct } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-C_nItuSz.js";
|
|
24
|
+
import { u as ws } from "./vue-i18n-j0rHGXSn.js";
|
|
25
|
+
import { s as Fs, r as Is } from "./xlsx.util-DeZhqfVV.js";
|
|
26
26
|
import { F as $s } from "./FmDroppableField-J0xUsOTV.js";
|
|
27
|
-
import { d as Ds } from "./defineDeepModel-
|
|
27
|
+
import { d as Ds } from "./defineDeepModel-xcAkDmDA.js";
|
|
28
28
|
import { N as Ts, H as Vs } from "./app-uBuHtW8m.js";
|
|
29
|
-
var te = /* @__PURE__ */ ((
|
|
29
|
+
var te = /* @__PURE__ */ ((p) => (p.Code = "Code", p.Name = "Name", p.TemplateName = "TemplateName", p.Amount = "Amount", p.Cost = "Cost", p.TotalCost = "TotalCost", p.Delete = "Delete", p))(te || {});
|
|
30
30
|
const Ps = () => (he(), Q(
|
|
31
|
-
|
|
31
|
+
Vt,
|
|
32
32
|
{
|
|
33
33
|
zIndex: 50,
|
|
34
34
|
class: "whitespace-nowrap"
|
|
35
35
|
},
|
|
36
|
-
`Total (${
|
|
36
|
+
`Total (${Tt()})`
|
|
37
37
|
));
|
|
38
|
-
function Rs(
|
|
39
|
-
const { t:
|
|
38
|
+
function Rs(p) {
|
|
39
|
+
const { t: g } = he(), i = $t({}), { breakpoints: d } = it(), b = et(), o = Ne();
|
|
40
40
|
We(() => {
|
|
41
|
-
for (const
|
|
42
|
-
if (!
|
|
41
|
+
for (const m of p.items) {
|
|
42
|
+
if (!m.totalCost)
|
|
43
43
|
continue;
|
|
44
44
|
const { cost: e } = Te(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
m.sku,
|
|
46
|
+
m.quantity,
|
|
47
|
+
m.measurement,
|
|
48
48
|
{
|
|
49
|
-
supplier:
|
|
49
|
+
supplier: p.supplier
|
|
50
50
|
}
|
|
51
|
-
), n =
|
|
52
|
-
e ?
|
|
51
|
+
), n = m.totalCost ?? rt.reset();
|
|
52
|
+
e ? i[m.sku._id] = e.amount !== n.amount || e.precision !== n.precision : i[m.sku._id] = !0;
|
|
53
53
|
}
|
|
54
54
|
}), _e(
|
|
55
55
|
() => {
|
|
56
|
-
var
|
|
57
|
-
return (
|
|
56
|
+
var m;
|
|
57
|
+
return (m = p.supplier) == null ? void 0 : m._id;
|
|
58
58
|
},
|
|
59
59
|
() => {
|
|
60
|
-
const
|
|
61
|
-
for (const e of
|
|
62
|
-
if (!e.totalCost ||
|
|
60
|
+
const m = p.supplier;
|
|
61
|
+
for (const e of p.items) {
|
|
62
|
+
if (!e.totalCost || i[e.sku._id] || !h(e.sku))
|
|
63
63
|
continue;
|
|
64
64
|
const { cost: n } = Te(
|
|
65
65
|
e.sku,
|
|
66
66
|
e.quantity,
|
|
67
67
|
e.measurement,
|
|
68
68
|
{
|
|
69
|
-
supplier:
|
|
69
|
+
supplier: m
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
|
-
|
|
72
|
+
p.updateItem({ ...e, totalCost: n });
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
|
-
function
|
|
77
|
-
var n,
|
|
78
|
-
return !!(((
|
|
76
|
+
function h(m) {
|
|
77
|
+
var n, f, s, r, u, w, $;
|
|
78
|
+
return !!(((f = (n = m.defaultCost) == null ? void 0 : n.costPerUnit) == null ? void 0 : f.amount) ?? (($ = (w = (u = (r = (s = p.supplier) == null ? void 0 : s.supplyItems) == null ? void 0 : r.find((c) => c.skuId === m._id)) == null ? void 0 : u.defaultCost) == null ? void 0 : w.costPerUnit) == null ? void 0 : $.amount));
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const x = [
|
|
81
81
|
{
|
|
82
82
|
id: "Code",
|
|
83
|
-
header: () =>
|
|
83
|
+
header: () => g("inventory.transfer.form.items.table.Code"),
|
|
84
84
|
accessorKey: "code",
|
|
85
85
|
size: 200,
|
|
86
|
-
cell(
|
|
87
|
-
const e =
|
|
86
|
+
cell(m) {
|
|
87
|
+
const e = m.row.original;
|
|
88
88
|
return o.isEnabled ? Q(
|
|
89
89
|
ge.FmTooltip,
|
|
90
90
|
{
|
|
@@ -103,13 +103,13 @@ function Rs(m) {
|
|
|
103
103
|
) : Q(ge.FmTextField, {
|
|
104
104
|
modelValue: e.code,
|
|
105
105
|
"onUpdate:modelValue": (n) => {
|
|
106
|
-
|
|
106
|
+
p.updateItem({
|
|
107
107
|
...e,
|
|
108
108
|
code: n
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
key: e.sku._id,
|
|
112
|
-
rules: [
|
|
112
|
+
rules: [Ue()],
|
|
113
113
|
labelMark: "required"
|
|
114
114
|
});
|
|
115
115
|
},
|
|
@@ -117,10 +117,10 @@ function Rs(m) {
|
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
id: "Name",
|
|
120
|
-
header: () =>
|
|
120
|
+
header: () => g("inventory.transfer.form.items.table.Name"),
|
|
121
121
|
minSize: 300,
|
|
122
|
-
cell(
|
|
123
|
-
const e =
|
|
122
|
+
cell(m) {
|
|
123
|
+
const e = m.row.original;
|
|
124
124
|
return o.isEnabled ? Q(
|
|
125
125
|
ge.FmTooltip,
|
|
126
126
|
{
|
|
@@ -139,13 +139,13 @@ function Rs(m) {
|
|
|
139
139
|
) : Q(ge.FmTextField, {
|
|
140
140
|
modelValue: e.name,
|
|
141
141
|
"onUpdate:modelValue": (n) => {
|
|
142
|
-
|
|
142
|
+
p.updateItem({
|
|
143
143
|
...e,
|
|
144
144
|
name: n
|
|
145
145
|
});
|
|
146
146
|
},
|
|
147
147
|
key: e.sku._id,
|
|
148
|
-
rules: [
|
|
148
|
+
rules: [Ue()],
|
|
149
149
|
labelMark: "required"
|
|
150
150
|
});
|
|
151
151
|
},
|
|
@@ -153,11 +153,11 @@ function Rs(m) {
|
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
id: "TemplateName",
|
|
156
|
-
header: () =>
|
|
156
|
+
header: () => g("inventory.transfer.form.items.table.Name"),
|
|
157
157
|
minSize: 300,
|
|
158
158
|
enableSorting: !1,
|
|
159
|
-
cell(
|
|
160
|
-
const e =
|
|
159
|
+
cell(m) {
|
|
160
|
+
const e = m.row.original, n = e.code, f = e.name;
|
|
161
161
|
return Q(
|
|
162
162
|
ge.FmTooltip,
|
|
163
163
|
{ zIndex: 50 },
|
|
@@ -167,7 +167,7 @@ function Rs(m) {
|
|
|
167
167
|
Q(
|
|
168
168
|
"div",
|
|
169
169
|
{ class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
|
|
170
|
-
|
|
170
|
+
f
|
|
171
171
|
),
|
|
172
172
|
Q(
|
|
173
173
|
"div",
|
|
@@ -179,7 +179,7 @@ function Rs(m) {
|
|
|
179
179
|
]);
|
|
180
180
|
},
|
|
181
181
|
content() {
|
|
182
|
-
return
|
|
182
|
+
return f;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
);
|
|
@@ -187,12 +187,12 @@ function Rs(m) {
|
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
id: "Amount",
|
|
190
|
-
header: () =>
|
|
190
|
+
header: () => g("inventory.transfer.form.items.table.Amount"),
|
|
191
191
|
minSize: 200,
|
|
192
|
-
cell(
|
|
193
|
-
var
|
|
194
|
-
const e =
|
|
195
|
-
(
|
|
192
|
+
cell(m) {
|
|
193
|
+
var r, u, w, $, c;
|
|
194
|
+
const e = m.row.original, n = (r = p.forecastAmounts) == null ? void 0 : r.find((y) => y.skuId === e.sku._id), f = n ? n.helperState === "error" ? `Predicted: ${n.amount} (out of range)` : `Predicted: ${n.amount}` : void 0, s = ($ = (w = (u = p.template) == null ? void 0 : u.purchaseOrder) == null ? void 0 : w.items) == null ? void 0 : $.find(
|
|
195
|
+
(y) => y.sku._id === e.sku._id
|
|
196
196
|
);
|
|
197
197
|
return Q(ms, {
|
|
198
198
|
style: {
|
|
@@ -204,38 +204,38 @@ function Rs(m) {
|
|
|
204
204
|
},
|
|
205
205
|
key: e.sku._id,
|
|
206
206
|
unit: e.sku.unit,
|
|
207
|
-
helperText:
|
|
207
|
+
helperText: f,
|
|
208
208
|
helperState: n == null ? void 0 : n.helperState,
|
|
209
|
-
"onUpdate:modelValue": (
|
|
210
|
-
if (!
|
|
211
|
-
const
|
|
209
|
+
"onUpdate:modelValue": (y) => {
|
|
210
|
+
if (!y) return;
|
|
211
|
+
const F = {
|
|
212
212
|
...e,
|
|
213
|
-
quantity:
|
|
214
|
-
measurement:
|
|
213
|
+
quantity: y.amount,
|
|
214
|
+
measurement: y.measurement
|
|
215
215
|
};
|
|
216
|
-
if (
|
|
216
|
+
if (b.enableTotalCost) {
|
|
217
217
|
const { cost: B } = Te(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
F.sku,
|
|
219
|
+
F.quantity,
|
|
220
|
+
F.measurement,
|
|
221
221
|
{
|
|
222
|
-
supplier:
|
|
222
|
+
supplier: p.supplier,
|
|
223
223
|
// NOTE: set undefined here if `manualTotalCost[updatedRow.sku._id] = false`, so that the function
|
|
224
224
|
// will return the auto calculated default cost instead of the manual total cost
|
|
225
|
-
manualTotalCost:
|
|
225
|
+
manualTotalCost: i[F.sku._id] ? F.totalCost : void 0
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
|
-
|
|
228
|
+
F.totalCost = B;
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
p.updateItem(F);
|
|
231
231
|
},
|
|
232
232
|
stepper: s == null ? void 0 : s.quantityStep,
|
|
233
233
|
disableUnit: !!s,
|
|
234
|
-
disabled:
|
|
234
|
+
disabled: p.disabled,
|
|
235
235
|
rules: [
|
|
236
236
|
ps(
|
|
237
237
|
+we(
|
|
238
|
-
((
|
|
238
|
+
((c = e.quantity) == null ? void 0 : c.amount) === 0 ? { amount: 0, precision: 0 } : (s == null ? void 0 : s.minimumQuantity) ?? { amount: 0, precision: 0 }
|
|
239
239
|
)
|
|
240
240
|
),
|
|
241
241
|
fs(
|
|
@@ -252,15 +252,15 @@ function Rs(m) {
|
|
|
252
252
|
id: "Cost",
|
|
253
253
|
header: Ps,
|
|
254
254
|
size: 180,
|
|
255
|
-
cell(
|
|
256
|
-
const e =
|
|
257
|
-
if (!
|
|
258
|
-
const { cost: s, supplierOverrideCost:
|
|
255
|
+
cell(m) {
|
|
256
|
+
const e = m.row.original, n = h(e.sku), f = d.value.xs || d.value.sm;
|
|
257
|
+
if (!i[e.sku._id] && n) {
|
|
258
|
+
const { cost: s, supplierOverrideCost: r } = Te(
|
|
259
259
|
e.sku,
|
|
260
260
|
e.quantity,
|
|
261
261
|
e.measurement,
|
|
262
262
|
{
|
|
263
|
-
supplier:
|
|
263
|
+
supplier: p.supplier
|
|
264
264
|
}
|
|
265
265
|
);
|
|
266
266
|
return Q(
|
|
@@ -268,7 +268,7 @@ function Rs(m) {
|
|
|
268
268
|
{
|
|
269
269
|
class: [
|
|
270
270
|
"flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
271
|
-
|
|
271
|
+
p.disabled ? "text-fm-color-typo-disabled" : ""
|
|
272
272
|
],
|
|
273
273
|
key: e.sku._id
|
|
274
274
|
},
|
|
@@ -276,12 +276,12 @@ function Rs(m) {
|
|
|
276
276
|
Q(ge.FmButton, {
|
|
277
277
|
prependIcon: "edit",
|
|
278
278
|
variant: ds.Tertiary,
|
|
279
|
-
disabled:
|
|
279
|
+
disabled: p.disabled,
|
|
280
280
|
onClick() {
|
|
281
|
-
|
|
281
|
+
p.updateItem({
|
|
282
282
|
...e,
|
|
283
283
|
totalCost: s
|
|
284
|
-
}),
|
|
284
|
+
}), i[e.sku._id] = !0;
|
|
285
285
|
}
|
|
286
286
|
}),
|
|
287
287
|
Q(
|
|
@@ -292,33 +292,33 @@ function Rs(m) {
|
|
|
292
292
|
[
|
|
293
293
|
Q(
|
|
294
294
|
"span",
|
|
295
|
-
|
|
295
|
+
f ? Ze(s) : we(s)
|
|
296
296
|
),
|
|
297
297
|
Q(
|
|
298
298
|
"span",
|
|
299
299
|
{
|
|
300
300
|
class: [
|
|
301
301
|
"fm-typo-en-body-sm-400",
|
|
302
|
-
|
|
302
|
+
p.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
303
303
|
]
|
|
304
304
|
},
|
|
305
|
-
|
|
305
|
+
g("inventory.transfer.form.items.autoCalculated")
|
|
306
306
|
),
|
|
307
|
-
|
|
307
|
+
r ? Q(
|
|
308
308
|
"span",
|
|
309
309
|
{
|
|
310
310
|
class: [
|
|
311
311
|
"fm-typo-en-body-sm-400",
|
|
312
|
-
|
|
312
|
+
p.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
313
313
|
]
|
|
314
314
|
},
|
|
315
315
|
[
|
|
316
|
-
Ze(
|
|
316
|
+
Ze(r.costPerUnit),
|
|
317
317
|
"/",
|
|
318
|
-
|
|
318
|
+
r.measurement ? Q(
|
|
319
319
|
"span",
|
|
320
320
|
{ class: "text-blue-500 font-semibold" },
|
|
321
|
-
|
|
321
|
+
r.measurement.abbrev
|
|
322
322
|
) : Q("span", { class: "text-green-500 font-bold" }, e.sku.unit.abbrev)
|
|
323
323
|
// base unit style
|
|
324
324
|
]
|
|
@@ -334,49 +334,49 @@ function Rs(m) {
|
|
|
334
334
|
modelValue: we(e.totalCost ?? { amount: 0, precision: 0 }),
|
|
335
335
|
key: e.sku._id,
|
|
336
336
|
"onUpdate:modelValue": (s) => {
|
|
337
|
-
|
|
337
|
+
p.updateItem({
|
|
338
338
|
...e,
|
|
339
339
|
totalCost: {
|
|
340
|
-
...
|
|
341
|
-
currency:
|
|
340
|
+
...ss(+s),
|
|
341
|
+
currency: Lt()
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
344
|
},
|
|
345
|
-
rules: [
|
|
345
|
+
rules: [Xe(0), as(2)]
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
348
|
prepend() {
|
|
349
|
-
return
|
|
349
|
+
return f ? Q(
|
|
350
350
|
"div",
|
|
351
351
|
{
|
|
352
352
|
class: [
|
|
353
353
|
"text-fm-typo-en-body-lg-400",
|
|
354
|
-
|
|
354
|
+
p.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
355
355
|
]
|
|
356
356
|
},
|
|
357
|
-
|
|
357
|
+
Tt()
|
|
358
358
|
) : null;
|
|
359
359
|
},
|
|
360
360
|
append() {
|
|
361
361
|
return n ? Q(ge.FmButton, {
|
|
362
362
|
prependIcon: "close",
|
|
363
363
|
variant: "tertiary",
|
|
364
|
-
disabled:
|
|
364
|
+
disabled: p.disabled,
|
|
365
365
|
onClick() {
|
|
366
366
|
const { cost: s } = Te(
|
|
367
367
|
e.sku,
|
|
368
368
|
e.quantity,
|
|
369
369
|
e.measurement,
|
|
370
370
|
{
|
|
371
|
-
supplier:
|
|
371
|
+
supplier: p.supplier
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
|
-
|
|
374
|
+
p.updateItem({
|
|
375
375
|
...e,
|
|
376
376
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
377
377
|
// the total cost will automatically assigned
|
|
378
378
|
totalCost: s
|
|
379
|
-
}),
|
|
379
|
+
}), i[e.sku._id] = !1;
|
|
380
380
|
}
|
|
381
381
|
}) : null;
|
|
382
382
|
}
|
|
@@ -388,8 +388,8 @@ function Rs(m) {
|
|
|
388
388
|
{
|
|
389
389
|
id: "Delete",
|
|
390
390
|
header: "",
|
|
391
|
-
cell(
|
|
392
|
-
const e =
|
|
391
|
+
cell(m) {
|
|
392
|
+
const e = m.row.original;
|
|
393
393
|
return Q("div", { class: "flex justify-end" }, [
|
|
394
394
|
Q(ge.FmButton, {
|
|
395
395
|
key: e.sku._id,
|
|
@@ -398,9 +398,9 @@ function Rs(m) {
|
|
|
398
398
|
icon: "delete",
|
|
399
399
|
variant: "tertiary",
|
|
400
400
|
size: "md",
|
|
401
|
-
disabled:
|
|
401
|
+
disabled: p.disabled,
|
|
402
402
|
onClick: () => {
|
|
403
|
-
|
|
403
|
+
p.deleteItem(e);
|
|
404
404
|
}
|
|
405
405
|
})
|
|
406
406
|
]);
|
|
@@ -414,47 +414,47 @@ function Rs(m) {
|
|
|
414
414
|
}
|
|
415
415
|
];
|
|
416
416
|
return {
|
|
417
|
-
columnDefs: M(() =>
|
|
418
|
-
(
|
|
417
|
+
columnDefs: M(() => b.enableTotalCost && p.transferType === pe.enum.purchase ? x : x.filter(
|
|
418
|
+
(m) => m.id !== "Cost"
|
|
419
419
|
/* Cost */
|
|
420
420
|
))
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
|
-
const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, As = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Es = { class: "w-[450px] xs:w-full flex" }, Ms = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, qs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
423
|
+
const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, As = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Es = { class: "w-[450px] xs:w-full flex" }, Ms = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, qs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, At = /* @__PURE__ */ de({
|
|
424
424
|
__name: "SupplierPriceHistory",
|
|
425
425
|
props: {
|
|
426
426
|
prices: {}
|
|
427
427
|
},
|
|
428
|
-
setup(
|
|
429
|
-
const
|
|
430
|
-
function
|
|
431
|
-
return
|
|
428
|
+
setup(p) {
|
|
429
|
+
const g = ut();
|
|
430
|
+
function i(d) {
|
|
431
|
+
return g.suppliers.find((b) => b._id === d);
|
|
432
432
|
}
|
|
433
|
-
return (d,
|
|
434
|
-
(
|
|
435
|
-
var
|
|
436
|
-
return
|
|
433
|
+
return (d, b) => (k(), T("div", Os, [
|
|
434
|
+
(k(!0), T(re, null, xe(Object.keys(d.prices), (o) => {
|
|
435
|
+
var h;
|
|
436
|
+
return k(), T("div", {
|
|
437
437
|
key: o,
|
|
438
438
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
439
439
|
}, [
|
|
440
|
-
l("div", As, E((
|
|
440
|
+
l("div", As, E((h = i(o)) == null ? void 0 : h.name), 1),
|
|
441
441
|
l("div", Es, [
|
|
442
|
-
(
|
|
442
|
+
(k(!0), T(re, null, xe(d.prices[o].slice(0, 3), (x) => {
|
|
443
443
|
var I;
|
|
444
|
-
return
|
|
445
|
-
key:
|
|
444
|
+
return k(), T("div", {
|
|
445
|
+
key: x.date,
|
|
446
446
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
447
447
|
}, [
|
|
448
448
|
l("div", Ms, [
|
|
449
|
-
l("span", null, E(
|
|
450
|
-
|
|
451
|
-
l("span", null, E(t(we)(
|
|
452
|
-
l("span", null, E(((I =
|
|
449
|
+
l("span", null, E(x.totalCost ? t(Ze)(x.totalCost) : "No data"), 1),
|
|
450
|
+
b[0] || (b[0] = l("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
451
|
+
l("span", null, E(t(we)(x.totalUnit, !1)), 1),
|
|
452
|
+
l("span", null, E(((I = x.measurement) == null ? void 0 : I.abbrev) ?? x.unit.abbrev), 1)
|
|
453
453
|
]),
|
|
454
454
|
l("div", qs, [
|
|
455
|
-
l("span", null, "(#" + E(
|
|
456
|
-
|
|
457
|
-
l("span", null, E(t(
|
|
455
|
+
l("span", null, "(#" + E(x.seqNumber) + ")", 1),
|
|
456
|
+
b[1] || (b[1] = l("span", null, E(" "), -1)),
|
|
457
|
+
l("span", null, E(t(dt)(new Date(x.date))), 1)
|
|
458
458
|
])
|
|
459
459
|
]);
|
|
460
460
|
}), 128))
|
|
@@ -463,7 +463,7 @@ const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
463
463
|
}), 128))
|
|
464
464
|
]));
|
|
465
465
|
}
|
|
466
|
-
}),
|
|
466
|
+
}), Us = { class: "flex flex-col gap-8 py-16" }, Ns = { class: "flex items-center" }, Bs = { class: "flex-1 flex gap-1 items-center" }, zs = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ls = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Hs = { class: "flex gap-8 w-full" }, js = { class: "flex-1 flex flex-col gap-4" }, Qs = { class: "flex-1 flex flex-col gap-4" }, Ys = { class: "flex gap-8 w-full" }, Ks = { class: "flex-1 flex flex-col gap-4" }, Xs = {
|
|
467
467
|
key: 0,
|
|
468
468
|
class: "flex-1 flex flex-col gap-4"
|
|
469
469
|
}, Zs = /* @__PURE__ */ de({
|
|
@@ -474,128 +474,128 @@ const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
474
474
|
showComparePrice: { type: Boolean },
|
|
475
475
|
row: {}
|
|
476
476
|
},
|
|
477
|
-
setup(
|
|
478
|
-
const { t:
|
|
479
|
-
return (
|
|
480
|
-
var
|
|
481
|
-
const
|
|
482
|
-
return
|
|
483
|
-
l("div",
|
|
477
|
+
setup(p) {
|
|
478
|
+
const { t: g } = he();
|
|
479
|
+
return (i, d) => {
|
|
480
|
+
var h, x, I, m, e, n, f, s, r, u, w, $, c, y, F, B, z, Z, X, N, P, R, D, q, L, W, ae;
|
|
481
|
+
const b = V("FmLabel"), o = V("FmSpacer");
|
|
482
|
+
return k(), T("div", Us, [
|
|
483
|
+
l("div", Ns, [
|
|
484
484
|
l("div", Bs, [
|
|
485
|
-
l("span", zs, " (" + E(
|
|
486
|
-
l("span", Ls, E(
|
|
485
|
+
l("span", zs, " (" + E(i.row.original.sku.code) + ") ", 1),
|
|
486
|
+
l("span", Ls, E(i.row.original.sku.name), 1)
|
|
487
487
|
]),
|
|
488
488
|
l("div", null, [
|
|
489
|
-
|
|
490
|
-
render: (I = (
|
|
491
|
-
props: (e = (
|
|
489
|
+
v(t(ve), {
|
|
490
|
+
render: (I = (x = (h = i.cellByColId.Delete) == null ? void 0 : h.column) == null ? void 0 : x.columnDef) == null ? void 0 : I.cell,
|
|
491
|
+
props: (e = (m = i.cellByColId.Delete) == null ? void 0 : m.getContext) == null ? void 0 : e.call(m)
|
|
492
492
|
}, null, 8, ["render", "props"])
|
|
493
493
|
])
|
|
494
494
|
]),
|
|
495
495
|
l("div", Hs, [
|
|
496
496
|
l("div", js, [
|
|
497
|
-
|
|
498
|
-
label: t(
|
|
497
|
+
v(b, {
|
|
498
|
+
label: t(g)(`inventory.transfer.form.items.table.${t(te).Code}`)
|
|
499
499
|
}, null, 8, ["label"]),
|
|
500
|
-
|
|
501
|
-
render: (s = (
|
|
502
|
-
props: (u = (
|
|
500
|
+
v(t(ve), {
|
|
501
|
+
render: (s = (f = (n = i.cellByColId[t(te).Code]) == null ? void 0 : n.column) == null ? void 0 : f.columnDef) == null ? void 0 : s.cell,
|
|
502
|
+
props: (u = (r = i.cellByColId[t(te).Code]) == null ? void 0 : r.getContext) == null ? void 0 : u.call(r)
|
|
503
503
|
}, null, 8, ["render", "props"]),
|
|
504
504
|
d[0] || (d[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
505
505
|
]),
|
|
506
506
|
l("div", Qs, [
|
|
507
|
-
|
|
508
|
-
label: t(
|
|
507
|
+
v(b, {
|
|
508
|
+
label: t(g)(`inventory.transfer.form.items.table.${t(te).Name}`)
|
|
509
509
|
}, null, 8, ["label"]),
|
|
510
|
-
|
|
511
|
-
render: (
|
|
512
|
-
props: (
|
|
510
|
+
v(t(ve), {
|
|
511
|
+
render: (c = ($ = (w = i.cellByColId[t(te).Name]) == null ? void 0 : w.column) == null ? void 0 : $.columnDef) == null ? void 0 : c.cell,
|
|
512
|
+
props: (F = (y = i.cellByColId[t(te).Name]) == null ? void 0 : y.getContext) == null ? void 0 : F.call(y)
|
|
513
513
|
}, null, 8, ["render", "props"]),
|
|
514
514
|
d[1] || (d[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
515
515
|
])
|
|
516
516
|
]),
|
|
517
517
|
l("div", Ys, [
|
|
518
518
|
l("div", Ks, [
|
|
519
|
-
|
|
520
|
-
label: t(
|
|
519
|
+
v(b, {
|
|
520
|
+
label: t(g)(`inventory.transfer.form.items.table.${t(te).Amount}`)
|
|
521
521
|
}, null, 8, ["label"]),
|
|
522
|
-
|
|
523
|
-
render: (
|
|
524
|
-
props: (
|
|
522
|
+
v(t(ve), {
|
|
523
|
+
render: (Z = (z = (B = i.cellByColId[t(te).Amount]) == null ? void 0 : B.column) == null ? void 0 : z.columnDef) == null ? void 0 : Z.cell,
|
|
524
|
+
props: (N = (X = i.cellByColId[t(te).Amount]) == null ? void 0 : X.getContext) == null ? void 0 : N.call(X)
|
|
525
525
|
}, null, 8, ["render", "props"]),
|
|
526
526
|
d[2] || (d[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
527
527
|
]),
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
i.cellByColId[t(te).Cost] ? (k(), T("div", Xs, [
|
|
529
|
+
v(Vt, { "z-index": 50 }, {
|
|
530
530
|
default: A(() => [
|
|
531
|
-
|
|
532
|
-
label: t(
|
|
531
|
+
v(b, {
|
|
532
|
+
label: t(g)(`inventory.transfer.form.items.table.${t(te).Cost}2`)
|
|
533
533
|
}, null, 8, ["label"])
|
|
534
534
|
]),
|
|
535
535
|
_: 1
|
|
536
536
|
}),
|
|
537
|
-
|
|
538
|
-
render: (D = (R = (P =
|
|
539
|
-
props: (L = (q =
|
|
537
|
+
v(t(ve), {
|
|
538
|
+
render: (D = (R = (P = i.cellByColId[t(te).Cost]) == null ? void 0 : P.column) == null ? void 0 : R.columnDef) == null ? void 0 : D.cell,
|
|
539
|
+
props: (L = (q = i.cellByColId[t(te).Cost]) == null ? void 0 : q.getContext) == null ? void 0 : L.call(q)
|
|
540
540
|
}, null, 8, ["render", "props"]),
|
|
541
541
|
d[3] || (d[3] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
542
542
|
])) : K("", !0)
|
|
543
543
|
]),
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
prices:
|
|
544
|
+
i.showComparePrice && Object.keys(i.comparePriceBySku[(W = i.row.original.sku) == null ? void 0 : W._id] ?? {}).length > 0 ? (k(), T(re, { key: 0 }, [
|
|
545
|
+
v(o, { class: "h-8" }),
|
|
546
|
+
v(At, {
|
|
547
|
+
prices: i.comparePriceBySku[(ae = i.row.original.sku) == null ? void 0 : ae._id]
|
|
548
548
|
}, null, 8, ["prices"])
|
|
549
549
|
], 64)) : K("", !0)
|
|
550
550
|
]);
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
|
-
function Ws(
|
|
555
|
-
const
|
|
554
|
+
function Ws(p) {
|
|
555
|
+
const g = M({
|
|
556
556
|
get() {
|
|
557
|
-
const o =
|
|
557
|
+
const o = p.getEffectiveAt();
|
|
558
558
|
return o ? new Date(o) : null;
|
|
559
559
|
},
|
|
560
560
|
set(o) {
|
|
561
|
-
|
|
561
|
+
p.setEffectiveAt((o == null ? void 0 : o.toISOString()) ?? null);
|
|
562
562
|
}
|
|
563
|
-
}),
|
|
563
|
+
}), i = M({
|
|
564
564
|
get() {
|
|
565
|
-
return !!
|
|
565
|
+
return !!g.value;
|
|
566
566
|
},
|
|
567
567
|
set(o) {
|
|
568
|
-
o ?
|
|
568
|
+
o ? g.value = /* @__PURE__ */ new Date() : g.value = null;
|
|
569
569
|
}
|
|
570
570
|
}), d = M({
|
|
571
571
|
get() {
|
|
572
|
-
return
|
|
572
|
+
return g.value === null ? "" : dt(g.value);
|
|
573
573
|
},
|
|
574
574
|
set(o) {
|
|
575
|
-
o ?
|
|
575
|
+
o ? g.value = /* @__PURE__ */ new Date(`${o} ${b.value}`) : g.value = null;
|
|
576
576
|
}
|
|
577
|
-
}),
|
|
577
|
+
}), b = M({
|
|
578
578
|
get() {
|
|
579
|
-
return
|
|
579
|
+
return g.value === null ? "" : ks(g.value);
|
|
580
580
|
},
|
|
581
581
|
set(o) {
|
|
582
|
-
o ?
|
|
582
|
+
o ? g.value = /* @__PURE__ */ new Date(`${d.value} ${o}`) : g.value = null;
|
|
583
583
|
}
|
|
584
584
|
});
|
|
585
585
|
return {
|
|
586
|
-
backdatePo:
|
|
587
|
-
backdateSwitch:
|
|
586
|
+
backdatePo: g,
|
|
587
|
+
backdateSwitch: i,
|
|
588
588
|
backdateModel: d,
|
|
589
|
-
backdateTimeModel:
|
|
589
|
+
backdateTimeModel: b
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
|
-
const
|
|
592
|
+
const Js = {
|
|
593
593
|
width: "24",
|
|
594
594
|
height: "24",
|
|
595
595
|
viewBox: "0 0 24 24",
|
|
596
596
|
fill: "none",
|
|
597
597
|
xmlns: "http://www.w3.org/2000/svg"
|
|
598
|
-
},
|
|
598
|
+
}, Gs = ["fill"], ea = ["fill"], ta = ["stroke"], sa = ["stroke"], aa = /* @__PURE__ */ de({
|
|
599
599
|
__name: "SparkIcon",
|
|
600
600
|
props: {
|
|
601
601
|
size: {
|
|
@@ -607,26 +607,26 @@ const Gs = {
|
|
|
607
607
|
default: "#c7c7cc"
|
|
608
608
|
}
|
|
609
609
|
},
|
|
610
|
-
setup(
|
|
611
|
-
return (
|
|
610
|
+
setup(p) {
|
|
611
|
+
return (g, i) => (k(), T("svg", Js, [
|
|
612
612
|
l("path", {
|
|
613
613
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
614
|
-
fill:
|
|
615
|
-
}, null, 8,
|
|
614
|
+
fill: p.color
|
|
615
|
+
}, null, 8, Gs),
|
|
616
616
|
l("path", {
|
|
617
617
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
618
|
-
fill:
|
|
618
|
+
fill: p.color
|
|
619
619
|
}, null, 8, ea),
|
|
620
620
|
l("path", {
|
|
621
621
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
622
|
-
stroke:
|
|
622
|
+
stroke: p.color,
|
|
623
623
|
"stroke-width": "1.5",
|
|
624
624
|
"stroke-linecap": "round",
|
|
625
625
|
"stroke-linejoin": "round"
|
|
626
626
|
}, null, 8, ta),
|
|
627
627
|
l("path", {
|
|
628
628
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
629
|
-
stroke:
|
|
629
|
+
stroke: p.color,
|
|
630
630
|
"stroke-width": "1.5",
|
|
631
631
|
"stroke-linecap": "round",
|
|
632
632
|
"stroke-linejoin": "round"
|
|
@@ -642,10 +642,10 @@ const Gs = {
|
|
|
642
642
|
templateItems: {}
|
|
643
643
|
},
|
|
644
644
|
emits: ["update:poItems", "update:forecastAmounts"],
|
|
645
|
-
setup(
|
|
646
|
-
const
|
|
647
|
-
function
|
|
648
|
-
return
|
|
645
|
+
setup(p, { emit: g }) {
|
|
646
|
+
const i = p, d = g, b = U(!1), o = U(7), h = os(), x = Re(), { t: I } = he();
|
|
647
|
+
function m(s, r, u) {
|
|
648
|
+
return r != null && s < r && (s = r), u != null && s > u && (s = u), s;
|
|
649
649
|
}
|
|
650
650
|
function e(s) {
|
|
651
651
|
if (!((s == null ? void 0 : s.amount) == null || (s == null ? void 0 : s.precision) == null))
|
|
@@ -653,86 +653,93 @@ const Gs = {
|
|
|
653
653
|
}
|
|
654
654
|
function n({
|
|
655
655
|
sku: s,
|
|
656
|
-
code:
|
|
656
|
+
code: r,
|
|
657
657
|
name: u,
|
|
658
|
-
baseAmount:
|
|
659
|
-
measurement:
|
|
660
|
-
min:
|
|
661
|
-
max:
|
|
658
|
+
baseAmount: w,
|
|
659
|
+
measurement: $,
|
|
660
|
+
min: c,
|
|
661
|
+
max: y
|
|
662
662
|
}) {
|
|
663
|
-
if (
|
|
664
|
-
const
|
|
665
|
-
let B = Math.ceil(
|
|
666
|
-
return B =
|
|
663
|
+
if ($) {
|
|
664
|
+
const F = $.conversion.amount;
|
|
665
|
+
let B = Math.ceil(w / F);
|
|
666
|
+
return B = m(B, c, y), {
|
|
667
667
|
sku: s,
|
|
668
|
-
code:
|
|
668
|
+
code: r,
|
|
669
669
|
name: u,
|
|
670
670
|
quantity: { amount: B, precision: 0 },
|
|
671
|
-
measurement:
|
|
671
|
+
measurement: $
|
|
672
672
|
};
|
|
673
673
|
} else {
|
|
674
|
-
const
|
|
674
|
+
const F = Math.ceil(m(w, c, y));
|
|
675
675
|
return {
|
|
676
676
|
sku: s,
|
|
677
|
-
code:
|
|
677
|
+
code: r,
|
|
678
678
|
name: u,
|
|
679
|
-
quantity: { amount:
|
|
679
|
+
quantity: { amount: F, precision: 0 },
|
|
680
680
|
measurement: null
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
async function
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
684
|
+
async function f() {
|
|
685
|
+
const s = lt(1, 8)(String(o.value));
|
|
686
|
+
if (typeof s == "string") {
|
|
687
|
+
x.open({
|
|
688
|
+
message: s,
|
|
689
|
+
type: "error"
|
|
690
|
+
});
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
b.value = !1, await h.readPurchaseOrder(o.value, i.templateId);
|
|
694
|
+
const r = h.purchaseOrderForecast.skus;
|
|
695
|
+
if (r.length === 0) {
|
|
696
|
+
x.open({
|
|
690
697
|
message: I("inventory.transfer.form.items.forecastStock.notAvailable"),
|
|
691
698
|
type: "info"
|
|
692
699
|
});
|
|
693
700
|
return;
|
|
694
701
|
}
|
|
695
|
-
const
|
|
696
|
-
var
|
|
697
|
-
const y = (
|
|
698
|
-
if (!
|
|
699
|
-
return y &&
|
|
700
|
-
if (!
|
|
701
|
-
const
|
|
702
|
-
return
|
|
702
|
+
const u = i.templateItems.reduce(($, c) => {
|
|
703
|
+
var z;
|
|
704
|
+
const y = (z = i.poItems) == null ? void 0 : z.find((Z) => Z.sku._id === c.sku._id), F = r.find((Z) => Z.id === c.sku._id);
|
|
705
|
+
if (!F)
|
|
706
|
+
return y && $.push(y), $;
|
|
707
|
+
if (!i.templateId && F.amount <= 0) return $;
|
|
708
|
+
const B = F.amount ?? e(y == null ? void 0 : y.quantity) ?? 0;
|
|
709
|
+
return $.push(
|
|
703
710
|
n({
|
|
704
|
-
sku:
|
|
705
|
-
code:
|
|
706
|
-
name:
|
|
707
|
-
baseAmount:
|
|
708
|
-
measurement:
|
|
709
|
-
min: e(
|
|
710
|
-
max: e(
|
|
711
|
+
sku: c.sku,
|
|
712
|
+
code: c.code,
|
|
713
|
+
name: c.name,
|
|
714
|
+
baseAmount: B,
|
|
715
|
+
measurement: c.measurement || null,
|
|
716
|
+
min: e(c.minimumQuantity),
|
|
717
|
+
max: e(c.maximumQuantity)
|
|
711
718
|
})
|
|
712
|
-
),
|
|
713
|
-
}, []),
|
|
714
|
-
const
|
|
715
|
-
let y =
|
|
716
|
-
if (
|
|
717
|
-
const
|
|
718
|
-
y = Math.ceil(
|
|
719
|
+
), $;
|
|
720
|
+
}, []), w = r.map(($) => {
|
|
721
|
+
const c = i.templateItems.find((X) => X.sku._id === $.id);
|
|
722
|
+
let y = $.amount, F = 0;
|
|
723
|
+
if (c != null && c.measurement) {
|
|
724
|
+
const X = e(c.measurement.conversion) ?? 1;
|
|
725
|
+
y = Math.ceil($.amount / X);
|
|
719
726
|
} else
|
|
720
|
-
y = Math.ceil(
|
|
721
|
-
const
|
|
722
|
-
return { skuId:
|
|
727
|
+
y = Math.ceil($.amount);
|
|
728
|
+
const B = e(c == null ? void 0 : c.minimumQuantity) ?? 0, z = e(c == null ? void 0 : c.maximumQuantity) ?? 1 / 0, Z = y < B || y > z ? "error" : "success";
|
|
729
|
+
return { skuId: $.id, amount: y, precision: F, helperState: Z };
|
|
723
730
|
});
|
|
724
|
-
d("update:poItems",
|
|
731
|
+
d("update:poItems", u), d("update:forecastAmounts", w);
|
|
725
732
|
}
|
|
726
|
-
return (s,
|
|
727
|
-
const u = V("FmButton"),
|
|
728
|
-
return
|
|
733
|
+
return (s, r) => {
|
|
734
|
+
const u = V("FmButton"), w = V("FmIcon"), $ = V("FmStepperField"), c = V("FmPopover");
|
|
735
|
+
return k(), se(c, {
|
|
729
736
|
disabled: s.disabled,
|
|
730
737
|
class: "flex",
|
|
731
|
-
"show-popover":
|
|
732
|
-
onPopoverChanged:
|
|
738
|
+
"show-popover": b.value,
|
|
739
|
+
onPopoverChanged: r[3] || (r[3] = (y) => b.value = y)
|
|
733
740
|
}, {
|
|
734
741
|
"popover-button": A(() => [
|
|
735
|
-
|
|
742
|
+
v(u, {
|
|
736
743
|
label: "unused",
|
|
737
744
|
variant: "secondary",
|
|
738
745
|
"text-color": s.disabled ? "disabled" : "primary",
|
|
@@ -742,7 +749,7 @@ const Gs = {
|
|
|
742
749
|
}, {
|
|
743
750
|
default: A(() => [
|
|
744
751
|
l("div", oa, [
|
|
745
|
-
|
|
752
|
+
v(aa, {
|
|
746
753
|
size: 24,
|
|
747
754
|
color: s.disabled ? "#c7c7cc" : "#ff7823"
|
|
748
755
|
}, null, 8, ["color"]),
|
|
@@ -756,29 +763,29 @@ const Gs = {
|
|
|
756
763
|
l("div", la, [
|
|
757
764
|
l("div", ra, [
|
|
758
765
|
l("div", ia, [
|
|
759
|
-
|
|
766
|
+
v(Ss, { "z-index": 99 }, {
|
|
760
767
|
default: A(() => [
|
|
761
768
|
l("p", ua, E(t(I)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
762
769
|
]),
|
|
763
770
|
_: 1
|
|
764
771
|
})
|
|
765
772
|
]),
|
|
766
|
-
|
|
773
|
+
v(u, {
|
|
767
774
|
icon: "close",
|
|
768
775
|
size: "md",
|
|
769
776
|
variant: "tertiary",
|
|
770
|
-
onClick:
|
|
777
|
+
onClick: r[0] || (r[0] = (y) => b.value = !1)
|
|
771
778
|
})
|
|
772
779
|
]),
|
|
773
|
-
|
|
780
|
+
v($, {
|
|
774
781
|
modelValue: o.value,
|
|
775
|
-
"onUpdate:modelValue":
|
|
782
|
+
"onUpdate:modelValue": r[1] || (r[1] = (y) => o.value = y),
|
|
776
783
|
label: t(I)("inventory.transfer.form.items.forecastStock.days"),
|
|
777
|
-
rules: [t(
|
|
784
|
+
rules: [t(lt)(1, 8)]
|
|
778
785
|
}, {
|
|
779
786
|
"helper-text": A(() => [
|
|
780
787
|
l("div", da, [
|
|
781
|
-
|
|
788
|
+
v(w, {
|
|
782
789
|
name: "warning",
|
|
783
790
|
size: "sm",
|
|
784
791
|
class: "text-fm-color-system-warning-300"
|
|
@@ -789,15 +796,15 @@ const Gs = {
|
|
|
789
796
|
_: 1
|
|
790
797
|
}, 8, ["modelValue", "label", "rules"]),
|
|
791
798
|
l("div", ma, [
|
|
792
|
-
|
|
793
|
-
|
|
799
|
+
r[4] || (r[4] = l("div", { class: "grow" }, null, -1)),
|
|
800
|
+
v(u, {
|
|
794
801
|
label: t(I)("common.cancel"),
|
|
795
802
|
variant: "tertiary",
|
|
796
|
-
onClick:
|
|
803
|
+
onClick: r[2] || (r[2] = (y) => b.value = !1)
|
|
797
804
|
}, null, 8, ["label"]),
|
|
798
|
-
|
|
805
|
+
v(u, {
|
|
799
806
|
label: t(I)("inventory.transfer.form.items.forecastStock.generate"),
|
|
800
|
-
onClick:
|
|
807
|
+
onClick: f
|
|
801
808
|
}, null, 8, ["label"])
|
|
802
809
|
])
|
|
803
810
|
])
|
|
@@ -808,47 +815,47 @@ const Gs = {
|
|
|
808
815
|
}
|
|
809
816
|
});
|
|
810
817
|
function fa() {
|
|
811
|
-
const
|
|
812
|
-
_e(
|
|
813
|
-
|
|
814
|
-
|
|
818
|
+
const p = Re(), g = ct(), i = U(!1);
|
|
819
|
+
_e(i, (h) => {
|
|
820
|
+
h && (b.value = !0, d().finally(() => {
|
|
821
|
+
b.value = !1;
|
|
815
822
|
}));
|
|
816
823
|
});
|
|
817
824
|
async function d() {
|
|
818
825
|
try {
|
|
819
|
-
const { startDate:
|
|
826
|
+
const { startDate: h, endDate: x } = xs(6), e = (await g.getPurchaseOrders({ start: h, end: x })).filter(
|
|
820
827
|
(n) => {
|
|
821
|
-
var
|
|
822
|
-
return n.status ===
|
|
828
|
+
var f, s;
|
|
829
|
+
return n.status === Ht.enum.COMPLETE && ((f = n.supplier) == null ? void 0 : f.internal) !== "warehouse" && ((s = n.supplier) == null ? void 0 : s.internal) !== "restaurant";
|
|
823
830
|
}
|
|
824
|
-
).reduce((n,
|
|
825
|
-
const s = new Date(
|
|
826
|
-
for (const u of
|
|
831
|
+
).reduce((n, f) => {
|
|
832
|
+
const s = new Date(jt(f._id)), r = f.supplier._id;
|
|
833
|
+
for (const u of f.items) {
|
|
827
834
|
if (!u.totalCost) continue;
|
|
828
|
-
const
|
|
829
|
-
|
|
835
|
+
const w = n[u.sku._id] ?? {}, $ = w[r] ?? [];
|
|
836
|
+
$.push({
|
|
830
837
|
date: s.toISOString(),
|
|
831
838
|
totalUnit: u.quantity,
|
|
832
839
|
totalCost: u.totalCost,
|
|
833
840
|
unit: u.sku.unit,
|
|
834
841
|
measurement: u.measurement,
|
|
835
|
-
seqNumber:
|
|
836
|
-
}),
|
|
842
|
+
seqNumber: f.seqNumber
|
|
843
|
+
}), w[r] = $, n[u.sku._id] = w;
|
|
837
844
|
}
|
|
838
845
|
return n;
|
|
839
846
|
}, {});
|
|
840
847
|
o.value = e;
|
|
841
848
|
} catch {
|
|
842
|
-
|
|
849
|
+
p.open({
|
|
843
850
|
title: "Something went wrong",
|
|
844
851
|
message: "Cannot retrieve supplier purchase history. Please try again."
|
|
845
|
-
}),
|
|
852
|
+
}), i.value = !1;
|
|
846
853
|
}
|
|
847
854
|
}
|
|
848
|
-
const
|
|
855
|
+
const b = U(!1), o = U({});
|
|
849
856
|
return {
|
|
850
|
-
comparePricesToggle:
|
|
851
|
-
comparePriceFetching:
|
|
857
|
+
comparePricesToggle: i,
|
|
858
|
+
comparePriceFetching: b,
|
|
852
859
|
comparePriceBySku: o
|
|
853
860
|
};
|
|
854
861
|
}
|
|
@@ -862,44 +869,44 @@ const va = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ya = { key: 0 }
|
|
|
862
869
|
disabled: { type: Boolean }
|
|
863
870
|
},
|
|
864
871
|
emits: ["update:item"],
|
|
865
|
-
setup(
|
|
866
|
-
function
|
|
867
|
-
return
|
|
872
|
+
setup(p) {
|
|
873
|
+
function g(i) {
|
|
874
|
+
return i.column.columnDef.meta;
|
|
868
875
|
}
|
|
869
|
-
return (
|
|
870
|
-
var
|
|
871
|
-
return
|
|
876
|
+
return (i, d) => {
|
|
877
|
+
var b, o;
|
|
878
|
+
return k(), T(re, null, [
|
|
872
879
|
l("tr", {
|
|
873
|
-
class:
|
|
874
|
-
"bg-fm-color-neutral-gray-100":
|
|
880
|
+
class: J(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
881
|
+
"bg-fm-color-neutral-gray-100": i.row.getIsSelected()
|
|
875
882
|
}])
|
|
876
883
|
}, [
|
|
877
|
-
(
|
|
878
|
-
var
|
|
879
|
-
return
|
|
880
|
-
key:
|
|
881
|
-
class:
|
|
882
|
-
style:
|
|
883
|
-
width: (I =
|
|
884
|
-
maxWidth: (
|
|
885
|
-
textAlign: ((e =
|
|
884
|
+
(k(!0), T(re, null, xe(i.row.getVisibleCells(), (h) => {
|
|
885
|
+
var x, I, m, e;
|
|
886
|
+
return k(), T("td", {
|
|
887
|
+
key: h.id,
|
|
888
|
+
class: J(["h-[56px] text-fm-color-typo-primary", ((x = g(h)) == null ? void 0 : x.cellClass) ?? "px-16"]),
|
|
889
|
+
style: Dt({
|
|
890
|
+
width: (I = g(h)) == null ? void 0 : I.width,
|
|
891
|
+
maxWidth: (m = g(h)) == null ? void 0 : m.maxWidth,
|
|
892
|
+
textAlign: ((e = g(h)) == null ? void 0 : e.textAlign) ?? "left"
|
|
886
893
|
})
|
|
887
894
|
}, [
|
|
888
895
|
l("span", va, [
|
|
889
|
-
|
|
890
|
-
render:
|
|
891
|
-
props:
|
|
896
|
+
v(t(ve), {
|
|
897
|
+
render: h.column.columnDef.cell,
|
|
898
|
+
props: h.getContext()
|
|
892
899
|
}, null, 8, ["render", "props"])
|
|
893
900
|
])
|
|
894
901
|
], 6);
|
|
895
902
|
}), 128))
|
|
896
903
|
], 2),
|
|
897
|
-
|
|
904
|
+
i.showComparePrice && Object.keys(i.comparePriceBySku[(b = i.row.original.sku) == null ? void 0 : b._id] ?? {}).length > 0 ? (k(), T("tr", ya, [
|
|
898
905
|
l("td", {
|
|
899
|
-
colspan:
|
|
906
|
+
colspan: i.row.getVisibleCells().length
|
|
900
907
|
}, [
|
|
901
|
-
|
|
902
|
-
prices:
|
|
908
|
+
v(At, {
|
|
909
|
+
prices: i.comparePriceBySku[(o = i.row.original.sku) == null ? void 0 : o._id]
|
|
903
910
|
}, null, 8, ["prices"])
|
|
904
911
|
], 8, ba)
|
|
905
912
|
])) : K("", !0)
|
|
@@ -924,16 +931,16 @@ const va = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ya = { key: 0 }
|
|
|
924
931
|
onChange: { type: Function }
|
|
925
932
|
},
|
|
926
933
|
emits: ["netsuite:ready"],
|
|
927
|
-
setup(
|
|
928
|
-
const
|
|
934
|
+
setup(p, { emit: g }) {
|
|
935
|
+
const i = Ne(), d = p, b = g, { t: o } = ws(), h = U(!1), x = U();
|
|
929
936
|
function I() {
|
|
930
|
-
var s,
|
|
937
|
+
var s, r, u, w;
|
|
931
938
|
if (!d.supplier) return;
|
|
932
|
-
d.supplier.internal ?
|
|
939
|
+
d.supplier.internal ? x.value = i.getNetSuiteLocation(
|
|
933
940
|
`${d.supplier.internal}_${d.supplier._id}`
|
|
934
|
-
) :
|
|
935
|
-
const n = d.supplier.internal ?
|
|
936
|
-
|
|
941
|
+
) : x.value = i.getNetSuiteVendor(d.supplier._id);
|
|
942
|
+
const n = d.supplier.internal ? i.getLocationSubsidiary((s = x.value) == null ? void 0 : s.netSuiteId).id : (r = x.value) == null ? void 0 : r.subsidiaryId, f = d.supplier.internal ? (u = i.currentLocationSubsidiary()) == null ? void 0 : u.id : (w = i.currentVendorSubsidiary(d.supplier._id)) == null ? void 0 : w.id;
|
|
943
|
+
h.value = !(!i.isEnabled || n && i.isEnabled && n == f);
|
|
937
944
|
}
|
|
938
945
|
_e(
|
|
939
946
|
() => d.supplier,
|
|
@@ -947,81 +954,81 @@ const va = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ya = { key: 0 }
|
|
|
947
954
|
subsidiary: { id: "", name: "" },
|
|
948
955
|
errors: []
|
|
949
956
|
};
|
|
950
|
-
if (
|
|
951
|
-
if (!
|
|
952
|
-
|
|
957
|
+
if (i.isReady) {
|
|
958
|
+
if (!i.isEnabled || !d.required) {
|
|
959
|
+
b("netsuite:ready", n);
|
|
953
960
|
return;
|
|
954
961
|
}
|
|
955
962
|
try {
|
|
956
|
-
const
|
|
963
|
+
const f = i.currentLocationSubsidiary();
|
|
957
964
|
d.setting ? n = {
|
|
958
965
|
...d.setting,
|
|
959
966
|
subsidiary: {
|
|
960
|
-
id:
|
|
961
|
-
name:
|
|
967
|
+
id: f.id || "",
|
|
968
|
+
name: f.name
|
|
962
969
|
}
|
|
963
970
|
} : n = {
|
|
964
971
|
...n,
|
|
965
972
|
subsidiary: {
|
|
966
|
-
id:
|
|
967
|
-
name:
|
|
973
|
+
id: f.id || "",
|
|
974
|
+
name: f.name
|
|
968
975
|
}
|
|
969
976
|
};
|
|
970
|
-
const s =
|
|
977
|
+
const s = i.getAvailableItems(f.id), r = d.items.filter((u) => {
|
|
971
978
|
if (u.measurement != null) {
|
|
972
|
-
const
|
|
979
|
+
const w = i.getAvailableMeasurements(
|
|
973
980
|
u.sku._id,
|
|
974
|
-
|
|
981
|
+
f.id
|
|
975
982
|
);
|
|
976
|
-
return s.includes(u.sku._id) &&
|
|
983
|
+
return s.includes(u.sku._id) && w.includes(u.measurement.id);
|
|
977
984
|
}
|
|
978
985
|
return s.includes(u.sku._id);
|
|
979
986
|
}).map((u) => u.sku._id);
|
|
980
987
|
d.onChange(
|
|
981
|
-
d.items.filter((u) =>
|
|
988
|
+
d.items.filter((u) => r.includes(u.sku._id)),
|
|
982
989
|
n
|
|
983
990
|
);
|
|
984
991
|
} finally {
|
|
985
|
-
I(),
|
|
992
|
+
I(), h.value ? d.subsidiaryOptional && b("netsuite:ready", n) : b("netsuite:ready", n);
|
|
986
993
|
}
|
|
987
994
|
}
|
|
988
995
|
});
|
|
989
|
-
const
|
|
990
|
-
() => d.supplier.internal ?
|
|
996
|
+
const m = M(
|
|
997
|
+
() => d.supplier.internal ? i.currentLocationSubsidiary() : i.currentVendorSubsidiary(d.supplier._id)
|
|
991
998
|
), e = M(() => {
|
|
992
|
-
var n,
|
|
993
|
-
return
|
|
994
|
-
location is ${(
|
|
999
|
+
var n, f;
|
|
1000
|
+
return x.value == null ? `Cannot find the NetSuite location for "${d.supplier.name}"` : `The subsidiary of the request
|
|
1001
|
+
location is ${(f = i.getLocationSubsidiary((n = x.value) == null ? void 0 : n.netSuiteId)) == null ? void 0 : f.fullName}`;
|
|
995
1002
|
});
|
|
996
|
-
return (n,
|
|
997
|
-
const s = V("FmLabel"),
|
|
998
|
-
return t(
|
|
999
|
-
|
|
1003
|
+
return (n, f) => {
|
|
1004
|
+
const s = V("FmLabel"), r = V("FmIcon"), u = V("FmField"), w = V("FmTooltip");
|
|
1005
|
+
return t(i).isEnabled && d.required ? (k(), T("div", _a, [
|
|
1006
|
+
v(s, {
|
|
1000
1007
|
label: `NetSuite ${t(o)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
1001
1008
|
}, null, 8, ["label"]),
|
|
1002
1009
|
l("div", ha, [
|
|
1003
|
-
|
|
1010
|
+
v(w, {
|
|
1004
1011
|
"z-index": 51,
|
|
1005
1012
|
placement: "left",
|
|
1006
1013
|
disabled: n.disabled
|
|
1007
1014
|
}, {
|
|
1008
|
-
content: A(() =>
|
|
1015
|
+
content: A(() => f[0] || (f[0] = [
|
|
1009
1016
|
Pe("This field is locked and based on the location of the request.")
|
|
1010
1017
|
])),
|
|
1011
1018
|
default: A(() => [
|
|
1012
|
-
|
|
1019
|
+
v(u, null, {
|
|
1013
1020
|
default: A(() => {
|
|
1014
|
-
var
|
|
1021
|
+
var $;
|
|
1015
1022
|
return [
|
|
1016
1023
|
l("div", ka, [
|
|
1017
|
-
|
|
1024
|
+
v(r, {
|
|
1018
1025
|
name: "lock_outline",
|
|
1019
1026
|
size: "sm",
|
|
1020
1027
|
color: n.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1021
1028
|
}, null, 8, ["color"]),
|
|
1022
1029
|
l("div", {
|
|
1023
|
-
class:
|
|
1024
|
-
}, E((
|
|
1030
|
+
class: J([n.disabled ? "text-fm-color-typo-disabled" : ""])
|
|
1031
|
+
}, E(($ = m.value) == null ? void 0 : $.fullName), 3)
|
|
1025
1032
|
])
|
|
1026
1033
|
];
|
|
1027
1034
|
}),
|
|
@@ -1030,105 +1037,105 @@ const va = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ya = { key: 0 }
|
|
|
1030
1037
|
]),
|
|
1031
1038
|
_: 1
|
|
1032
1039
|
}, 8, ["disabled"]),
|
|
1033
|
-
|
|
1040
|
+
h.value ? (k(), T("div", xa, E(e.value), 1)) : K("", !0)
|
|
1034
1041
|
])
|
|
1035
1042
|
])) : K("", !0);
|
|
1036
1043
|
};
|
|
1037
1044
|
}
|
|
1038
1045
|
});
|
|
1039
|
-
function Ve(
|
|
1040
|
-
const
|
|
1041
|
-
if (Array.isArray(
|
|
1042
|
-
return
|
|
1043
|
-
if (
|
|
1044
|
-
const
|
|
1045
|
-
for (const d in
|
|
1046
|
-
Object.prototype.hasOwnProperty.call(
|
|
1047
|
-
return
|
|
1046
|
+
function Ve(p) {
|
|
1047
|
+
const g = Et(p);
|
|
1048
|
+
if (Array.isArray(g))
|
|
1049
|
+
return g.map(Ve);
|
|
1050
|
+
if (g !== null && typeof g == "object") {
|
|
1051
|
+
const i = {};
|
|
1052
|
+
for (const d in g)
|
|
1053
|
+
Object.prototype.hasOwnProperty.call(g, d) && (i[d] = Ve(g[d]));
|
|
1054
|
+
return i;
|
|
1048
1055
|
}
|
|
1049
|
-
return
|
|
1056
|
+
return g;
|
|
1050
1057
|
}
|
|
1051
1058
|
const ot = {
|
|
1052
1059
|
set: "set",
|
|
1053
1060
|
add: "add",
|
|
1054
1061
|
delete: "delete"
|
|
1055
1062
|
};
|
|
1056
|
-
function
|
|
1063
|
+
function St(p) {
|
|
1057
1064
|
return {
|
|
1058
|
-
dbName:
|
|
1059
|
-
type:
|
|
1060
|
-
name:
|
|
1061
|
-
acceptRequest:
|
|
1062
|
-
doc:
|
|
1065
|
+
dbName: p.dbName,
|
|
1066
|
+
type: p.type,
|
|
1067
|
+
name: p.name,
|
|
1068
|
+
acceptRequest: p.acceptRequest ?? !1,
|
|
1069
|
+
doc: p.doc
|
|
1063
1070
|
};
|
|
1064
1071
|
}
|
|
1065
|
-
function
|
|
1066
|
-
const d = Ve(
|
|
1072
|
+
function wt(p, g, i) {
|
|
1073
|
+
const d = Ve(p.suppliers ?? []), b = Ve(g.allLocations ?? []).map(St), o = g._currentLocation ? St(Ve(g._currentLocation)) : null, h = i.inventory ? [Ve(i.inventory)] : [];
|
|
1067
1074
|
return {
|
|
1068
1075
|
suppliers: d,
|
|
1069
|
-
locations:
|
|
1076
|
+
locations: b,
|
|
1070
1077
|
currentLocation: o,
|
|
1071
|
-
inventoryDoc:
|
|
1078
|
+
inventoryDoc: h
|
|
1072
1079
|
};
|
|
1073
1080
|
}
|
|
1074
1081
|
function Sa() {
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
const o =
|
|
1082
|
+
const p = ut(), g = Je(), i = Ge(), d = wt(p, g, i), b = ht(ys({ env: d }));
|
|
1083
|
+
b.value.setUsePartialUpdates(!0);
|
|
1084
|
+
const o = ht(b.value.state()), h = (e) => {
|
|
1078
1085
|
o.value = e;
|
|
1079
1086
|
};
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1087
|
+
b.value.addListener(h);
|
|
1088
|
+
const x = (e, n, f) => {
|
|
1082
1089
|
switch (e) {
|
|
1083
1090
|
case ot.set:
|
|
1084
|
-
|
|
1091
|
+
kt(o.value, n, f);
|
|
1085
1092
|
break;
|
|
1086
1093
|
case ot.add:
|
|
1087
|
-
|
|
1094
|
+
Yt(o.value, n, f);
|
|
1088
1095
|
break;
|
|
1089
1096
|
case ot.delete:
|
|
1090
|
-
|
|
1097
|
+
Qt(o.value, n);
|
|
1091
1098
|
break;
|
|
1092
1099
|
default:
|
|
1093
|
-
console.warn(`Unknown partial update operation: ${e}, falling back to 'set'`),
|
|
1100
|
+
console.warn(`Unknown partial update operation: ${e}, falling back to 'set'`), kt(o.value, n, f);
|
|
1094
1101
|
}
|
|
1095
|
-
n !== "remark" && n !== "ref" &&
|
|
1102
|
+
n !== "remark" && n !== "ref" && qt(o);
|
|
1096
1103
|
};
|
|
1097
|
-
|
|
1104
|
+
b.value.addPartialListener(x);
|
|
1098
1105
|
function I() {
|
|
1099
|
-
const e =
|
|
1100
|
-
|
|
1106
|
+
const e = wt(p, g, i);
|
|
1107
|
+
b.value.updateFullEnv(e), o.value = b.value.state();
|
|
1101
1108
|
}
|
|
1102
1109
|
_e(
|
|
1103
1110
|
[
|
|
1104
|
-
() =>
|
|
1105
|
-
() =>
|
|
1106
|
-
() =>
|
|
1107
|
-
() =>
|
|
1111
|
+
() => p.suppliers,
|
|
1112
|
+
() => g.allLocations,
|
|
1113
|
+
() => g._currentLocation,
|
|
1114
|
+
() => i.inventory
|
|
1108
1115
|
],
|
|
1109
1116
|
() => {
|
|
1110
1117
|
I();
|
|
1111
1118
|
},
|
|
1112
1119
|
{ deep: !0 }
|
|
1113
|
-
),
|
|
1114
|
-
|
|
1120
|
+
), Mt(() => {
|
|
1121
|
+
b.value.removeListener(h), b.value.removePartialListener(x);
|
|
1115
1122
|
});
|
|
1116
|
-
function
|
|
1123
|
+
function m(e) {
|
|
1117
1124
|
var n;
|
|
1118
1125
|
if (e != null && e._id) {
|
|
1119
|
-
|
|
1126
|
+
b.value.loadPurchaseOrder(e);
|
|
1120
1127
|
return;
|
|
1121
1128
|
}
|
|
1122
1129
|
if (!et().mustUsePoTemplate) {
|
|
1123
|
-
|
|
1130
|
+
b.value.init();
|
|
1124
1131
|
return;
|
|
1125
1132
|
}
|
|
1126
|
-
e != null && e.template && ((n = e.templateDoc) != null && n.purchaseOrder) ? (e.items = e.templateDoc.purchaseOrder.items,
|
|
1133
|
+
e != null && e.template && ((n = e.templateDoc) != null && n.purchaseOrder) ? (e.items = e.templateDoc.purchaseOrder.items, b.value.initFromTemplate(e)) : b.value.initOutletToOutlet();
|
|
1127
1134
|
}
|
|
1128
1135
|
return {
|
|
1129
|
-
controller:
|
|
1136
|
+
controller: b,
|
|
1130
1137
|
state: o,
|
|
1131
|
-
init:
|
|
1138
|
+
init: m
|
|
1132
1139
|
};
|
|
1133
1140
|
}
|
|
1134
1141
|
const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, Ia = { class: "flex flex-col gap-16" }, $a = { class: "flex flex-col gap-24" }, Da = { class: "flex flex-col gap-8" }, Ta = { class: "flex flex-col gap-4" }, Va = { class: "flex items-center gap-4" }, Pa = { class: "flex flex-col gap-8" }, Ra = { class: "flex flex-col gap-4" }, Oa = { class: "flex items-center gap-4" }, Aa = {
|
|
@@ -1137,10 +1144,10 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1137
1144
|
}, Ea = {
|
|
1138
1145
|
key: 0,
|
|
1139
1146
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
1140
|
-
}, Ma = { class: "flex-1" }, qa = { class: "flex-1" },
|
|
1147
|
+
}, Ma = { class: "flex-1" }, qa = { class: "flex-1" }, Ua = {
|
|
1141
1148
|
key: 1,
|
|
1142
1149
|
class: "flex items-center gap-4"
|
|
1143
|
-
},
|
|
1150
|
+
}, Na = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ba = { class: "flex flex-col gap-16" }, za = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, La = { class: "flex gap-8" }, Ha = { key: 0 }, ja = /* @__PURE__ */ de({
|
|
1144
1151
|
__name: "TransferFormWithController",
|
|
1145
1152
|
props: {
|
|
1146
1153
|
modelValue: {},
|
|
@@ -1151,12 +1158,12 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1151
1158
|
lastClosingDate: {}
|
|
1152
1159
|
},
|
|
1153
1160
|
emits: ["validation-success", "form:ready"],
|
|
1154
|
-
setup(
|
|
1155
|
-
const d =
|
|
1161
|
+
setup(p, { expose: g, emit: i }) {
|
|
1162
|
+
const d = p, b = i, { t: o } = he(), h = Je(), x = Ge(), I = Ne(), m = et(), e = Ot(), { breakpoints: n } = it(), f = M(() => n.value.xs || n.value.sm), s = Sa();
|
|
1156
1163
|
s.init(d.modelValue);
|
|
1157
|
-
const { controller:
|
|
1164
|
+
const { controller: r, state: u } = s, w = $t({
|
|
1158
1165
|
value: !1
|
|
1159
|
-
}),
|
|
1166
|
+
}), $ = U(!1), c = U(0), y = U([]), F = M(
|
|
1160
1167
|
() => {
|
|
1161
1168
|
var a;
|
|
1162
1169
|
return ((a = d.modelValue) == null ? void 0 : a.templateDoc) ?? e.templates.find((_) => {
|
|
@@ -1173,7 +1180,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1173
1180
|
We(() => {
|
|
1174
1181
|
var a, _, Y, le;
|
|
1175
1182
|
try {
|
|
1176
|
-
I.isEnabled && I.businessSubsidiaryId && !((_ = (a = u.value.netSuite) == null ? void 0 : a.subsidiary) != null && _.id) &&
|
|
1183
|
+
I.isEnabled && I.businessSubsidiaryId && !((_ = (a = u.value.netSuite) == null ? void 0 : a.subsidiary) != null && _.id) && r.value.setNetSuiteSetting({
|
|
1177
1184
|
...u.value.netSuite,
|
|
1178
1185
|
id: ((Y = u.value.netSuite) == null ? void 0 : Y.id) ?? "",
|
|
1179
1186
|
subsidiary: {
|
|
@@ -1183,31 +1190,31 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1183
1190
|
errors: ((le = u.value.netSuite) == null ? void 0 : le.errors) ?? []
|
|
1184
1191
|
});
|
|
1185
1192
|
} finally {
|
|
1186
|
-
|
|
1193
|
+
$.value = !0;
|
|
1187
1194
|
}
|
|
1188
|
-
}), _e([
|
|
1189
|
-
_.value && le.value &&
|
|
1195
|
+
}), _e([$, w], ([a, _], [Y, le]) => {
|
|
1196
|
+
_.value && le.value && b("form:ready");
|
|
1190
1197
|
});
|
|
1191
|
-
const
|
|
1192
|
-
() =>
|
|
1193
|
-
),
|
|
1198
|
+
const Z = M(
|
|
1199
|
+
() => h.currentLocation.type === Kt.restaurant
|
|
1200
|
+
), X = cs(), N = gs(
|
|
1194
1201
|
() => u.value,
|
|
1195
1202
|
(a) => {
|
|
1196
|
-
|
|
1203
|
+
r.value.setSupplier(a.supplier);
|
|
1197
1204
|
},
|
|
1198
1205
|
!0,
|
|
1199
|
-
!
|
|
1206
|
+
!m.businessSupplierOnly
|
|
1200
1207
|
), P = M({
|
|
1201
1208
|
get() {
|
|
1202
1209
|
var a;
|
|
1203
1210
|
return typeof ((a = u.value.supplier) == null ? void 0 : a.internal) == "string" ? pe.enum.transfer : pe.enum.purchase;
|
|
1204
1211
|
},
|
|
1205
1212
|
set(a) {
|
|
1206
|
-
|
|
1213
|
+
r.value.selectType(a);
|
|
1207
1214
|
}
|
|
1208
1215
|
}), R = M(() => {
|
|
1209
|
-
let a =
|
|
1210
|
-
return
|
|
1216
|
+
let a = N.transferLocationOptions.value;
|
|
1217
|
+
return m.mustUsePoTemplate && !u.value.template && (a = a.filter((_) => {
|
|
1211
1218
|
var Y;
|
|
1212
1219
|
return (Y = _.sublabel) == null ? void 0 : Y.startsWith("restaurant");
|
|
1213
1220
|
})), a;
|
|
@@ -1217,31 +1224,31 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1217
1224
|
return (a = u.value.supplier) == null ? void 0 : a._id;
|
|
1218
1225
|
},
|
|
1219
1226
|
set(a) {
|
|
1220
|
-
|
|
1227
|
+
N.transferLocationModel.value = a;
|
|
1221
1228
|
}
|
|
1222
1229
|
}), q = M({
|
|
1223
1230
|
get() {
|
|
1224
1231
|
return u.value.remark ?? "";
|
|
1225
1232
|
},
|
|
1226
1233
|
set(a) {
|
|
1227
|
-
|
|
1234
|
+
r.value.addRemark(a ?? "");
|
|
1228
1235
|
}
|
|
1229
1236
|
}), L = M({
|
|
1230
1237
|
get() {
|
|
1231
1238
|
return u.value.ref ?? "";
|
|
1232
1239
|
},
|
|
1233
1240
|
set(a) {
|
|
1234
|
-
|
|
1241
|
+
r.value.addReference(a ?? "");
|
|
1235
1242
|
}
|
|
1236
|
-
}), { backdatePo:
|
|
1243
|
+
}), { backdatePo: W, backdateSwitch: ae, backdateModel: S, backdateTimeModel: C } = Ws({
|
|
1237
1244
|
getEffectiveAt() {
|
|
1238
1245
|
return u.value.effectiveAt;
|
|
1239
1246
|
},
|
|
1240
1247
|
setEffectiveAt(a) {
|
|
1241
|
-
|
|
1248
|
+
r.value.setEffectiveAt(a);
|
|
1242
1249
|
}
|
|
1243
|
-
}), { comparePricesToggle: H, comparePriceFetching: fe, comparePriceBySku: ce } = fa(), G =
|
|
1244
|
-
|
|
1250
|
+
}), { comparePricesToggle: H, comparePriceFetching: fe, comparePriceBySku: ce } = fa(), G = U();
|
|
1251
|
+
g({
|
|
1245
1252
|
validateInputs: () => {
|
|
1246
1253
|
var a, _;
|
|
1247
1254
|
(_ = (a = G.value) == null ? void 0 : a.validateInputs) == null || _.call(a);
|
|
@@ -1254,15 +1261,15 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1254
1261
|
var a, _;
|
|
1255
1262
|
(_ = (a = G.value) == null ? void 0 : a.resetInputs) == null || _.call(a);
|
|
1256
1263
|
},
|
|
1257
|
-
getFormData: () => u.value.id && u.value.rev ?
|
|
1264
|
+
getFormData: () => u.value.id && u.value.rev ? r.value.toUpdateData() : r.value.toCreateData()
|
|
1258
1265
|
});
|
|
1259
1266
|
const Fe = M(() => ({
|
|
1260
1267
|
updateItem: (a) => {
|
|
1261
|
-
const _ =
|
|
1262
|
-
|
|
1268
|
+
const _ = Xt.parse(a), Y = r.value.toFdtoPOItem(_);
|
|
1269
|
+
r.value.updateSkuInfo(Y);
|
|
1263
1270
|
},
|
|
1264
1271
|
deleteItem: (a) => {
|
|
1265
|
-
|
|
1272
|
+
r.value.removeSku(a.sku);
|
|
1266
1273
|
}
|
|
1267
1274
|
})), Ie = Rs({
|
|
1268
1275
|
updateItem: (a) => Fe.value.updateItem(a),
|
|
@@ -1277,20 +1284,20 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1277
1284
|
return P.value;
|
|
1278
1285
|
},
|
|
1279
1286
|
get template() {
|
|
1280
|
-
return
|
|
1287
|
+
return F.value;
|
|
1281
1288
|
},
|
|
1282
1289
|
get disabled() {
|
|
1283
1290
|
return d.disabled;
|
|
1284
1291
|
},
|
|
1285
1292
|
get forecastAmounts() {
|
|
1286
|
-
return
|
|
1293
|
+
return y.value;
|
|
1287
1294
|
}
|
|
1288
|
-
}),
|
|
1289
|
-
function
|
|
1290
|
-
var Ae,
|
|
1291
|
-
const a = (
|
|
1295
|
+
}), Be = M(() => Ie.columnDefs.value);
|
|
1296
|
+
function ze() {
|
|
1297
|
+
var Ae, je, Qe, Ee, Ye;
|
|
1298
|
+
const a = (Qe = (je = (Ae = F.value) == null ? void 0 : Ae.purchaseOrder) == null ? void 0 : je.items) == null ? void 0 : Qe.groupBy((j) => j.sku._id), _ = I.isEnabled ? I.getAvailableItems((Ye = (Ee = u.value.netSuite) == null ? void 0 : Ee.subsidiary) == null ? void 0 : Ye.id) : [], Y = a != null && a.size ? x.skus.filter((j) => a.has(j._id)) : x.skus, le = I.isEnabled ? Y.filter((j) => {
|
|
1292
1299
|
var ie, oe, ue, me;
|
|
1293
|
-
const ee = (oe = (ie =
|
|
1300
|
+
const ee = (oe = (ie = F.value) == null ? void 0 : ie.purchaseOrder) == null ? void 0 : oe.items.find(
|
|
1294
1301
|
(be) => be.sku._id === j._id
|
|
1295
1302
|
);
|
|
1296
1303
|
if (ee != null && ee.measurement != null) {
|
|
@@ -1315,7 +1322,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1315
1322
|
), $e = ye.filter((j) => {
|
|
1316
1323
|
var ee;
|
|
1317
1324
|
return (ee = z.value) == null ? void 0 : ee.find((ie) => ie.sku._id === j.value._id);
|
|
1318
|
-
}).map((j) => j.value),
|
|
1325
|
+
}).map((j) => j.value), He = [
|
|
1319
1326
|
{
|
|
1320
1327
|
type: "string",
|
|
1321
1328
|
key: "tags",
|
|
@@ -1323,7 +1330,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1323
1330
|
values: ["Inactive", "Active"]
|
|
1324
1331
|
}
|
|
1325
1332
|
];
|
|
1326
|
-
|
|
1333
|
+
X.open({
|
|
1327
1334
|
title: o("inventory.transfer.form.items.selectItem"),
|
|
1328
1335
|
closeButton: !0,
|
|
1329
1336
|
contentComponent: hs,
|
|
@@ -1331,7 +1338,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1331
1338
|
modelValue: $e,
|
|
1332
1339
|
items: ye,
|
|
1333
1340
|
virtualScroll: !0,
|
|
1334
|
-
filterAttributes:
|
|
1341
|
+
filterAttributes: He
|
|
1335
1342
|
},
|
|
1336
1343
|
primaryActions: {
|
|
1337
1344
|
text: o("common.confirm"),
|
|
@@ -1348,7 +1355,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1348
1355
|
const ue = ee.find((ke) => ke.sku._id === oe._id);
|
|
1349
1356
|
if (ue)
|
|
1350
1357
|
return ue;
|
|
1351
|
-
const me = ((De = (be =
|
|
1358
|
+
const me = ((De = (be = F.value) == null ? void 0 : be.purchaseOrder.items) == null ? void 0 : De.find(
|
|
1352
1359
|
(ke) => ke.sku._id === oe._id
|
|
1353
1360
|
)) ?? {
|
|
1354
1361
|
sku: oe,
|
|
@@ -1372,15 +1379,15 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1372
1379
|
}
|
|
1373
1380
|
return me;
|
|
1374
1381
|
});
|
|
1375
|
-
ie.sort((oe, ue) => oe.sku.code.localeCompare(ue.sku.code)),
|
|
1382
|
+
ie.sort((oe, ue) => oe.sku.code.localeCompare(ue.sku.code)), r.value.updateItems(ie);
|
|
1376
1383
|
});
|
|
1377
1384
|
}
|
|
1378
1385
|
function tt(a) {
|
|
1379
1386
|
return a;
|
|
1380
1387
|
}
|
|
1381
|
-
const
|
|
1388
|
+
const Le = M(() => {
|
|
1382
1389
|
var a;
|
|
1383
|
-
return
|
|
1390
|
+
return F.value ? ((a = F.value) == null ? void 0 : a.purchaseOrder.items) || [] : x.skus.map((_) => ({
|
|
1384
1391
|
quantity: {
|
|
1385
1392
|
amount: 0,
|
|
1386
1393
|
precision: 0
|
|
@@ -1396,7 +1403,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1396
1403
|
}));
|
|
1397
1404
|
}), Ce = M(() => {
|
|
1398
1405
|
const a = [];
|
|
1399
|
-
return (!
|
|
1406
|
+
return (!m.mustUsePoTemplate || m.mustUsePoTemplate && u.value.template) && a.push({
|
|
1400
1407
|
label: o("inventory.transfer.form.type.purchase"),
|
|
1401
1408
|
value: pe.enum.purchase
|
|
1402
1409
|
}), a.push({
|
|
@@ -1411,48 +1418,48 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1411
1418
|
);
|
|
1412
1419
|
return (a, _) => {
|
|
1413
1420
|
var me, be;
|
|
1414
|
-
const Y = V("FmChip"), le = V("FmLabel"), ye = V("FmIcon"), $e = V("FmField"),
|
|
1415
|
-
return
|
|
1421
|
+
const Y = V("FmChip"), le = V("FmLabel"), ye = V("FmIcon"), $e = V("FmField"), He = V("FmTooltip"), Ae = V("FmSelect"), je = V("FmTextField"), Qe = V("FmTextarea"), Ee = V("FmSwitch"), Ye = V("FmDatePicker"), j = V("FmTimePicker"), ee = V("FmFormGroup"), ie = V("FmButton"), oe = V("FmTable"), ue = V("FmForm");
|
|
1422
|
+
return k(), T("div", wa, [
|
|
1416
1423
|
l("div", Fa, [
|
|
1417
|
-
(me = d.modelValue) != null && me.template ? (
|
|
1424
|
+
(me = d.modelValue) != null && me.template ? (k(), se(Y, {
|
|
1418
1425
|
key: 0,
|
|
1419
1426
|
variant: a.disabled ? "warning" : void 0,
|
|
1420
|
-
label: `${t(o)("inventory.transfer.template.title")}: ${((be =
|
|
1427
|
+
label: `${t(o)("inventory.transfer.template.title")}: ${((be = F.value) == null ? void 0 : be.name) ?? t(o)("inventory.transfer.form.loading")}`,
|
|
1421
1428
|
icon: "summarize",
|
|
1422
1429
|
compact: ""
|
|
1423
1430
|
}, null, 8, ["variant", "label"])) : K("", !0),
|
|
1424
|
-
|
|
1425
|
-
label: t(
|
|
1431
|
+
v(Y, {
|
|
1432
|
+
label: t(h).currentLocation.name,
|
|
1426
1433
|
icon: "storefront",
|
|
1427
1434
|
compact: ""
|
|
1428
1435
|
}, null, 8, ["label"]),
|
|
1429
|
-
a.lastClosingDate ? (
|
|
1436
|
+
a.lastClosingDate ? (k(), se(Y, {
|
|
1430
1437
|
key: 1,
|
|
1431
|
-
label: `${t(o)("inventory.transfer.form.lastClosing")}: ${t(
|
|
1438
|
+
label: `${t(o)("inventory.transfer.form.lastClosing")}: ${t(dt)(a.lastClosingDate)} ${t(Cs)(a.lastClosingDate)}`,
|
|
1432
1439
|
icon: "calendar_month",
|
|
1433
1440
|
compact: ""
|
|
1434
1441
|
}, null, 8, ["label"])) : K("", !0)
|
|
1435
1442
|
]),
|
|
1436
|
-
|
|
1443
|
+
v(ue, {
|
|
1437
1444
|
ref_key: "formRef",
|
|
1438
1445
|
ref: G,
|
|
1439
1446
|
class: "flex flex-col gap-32",
|
|
1440
1447
|
disabled: a.disabled,
|
|
1441
1448
|
onValidationFailed: console.log,
|
|
1442
|
-
onValidationSuccess: _[14] || (_[14] = (De) =>
|
|
1449
|
+
onValidationSuccess: _[14] || (_[14] = (De) => b("validation-success"))
|
|
1443
1450
|
}, {
|
|
1444
1451
|
default: A(() => {
|
|
1445
|
-
var De, ke,
|
|
1452
|
+
var De, ke, mt, pt, ft, vt, yt, bt;
|
|
1446
1453
|
return [
|
|
1447
1454
|
l("div", Ia, [
|
|
1448
1455
|
l("div", $a, [
|
|
1449
|
-
(De = d.modelValue) != null && De.template ? (
|
|
1456
|
+
(De = d.modelValue) != null && De.template ? (k(), T(re, { key: 0 }, [
|
|
1450
1457
|
l("div", Da, [
|
|
1451
|
-
|
|
1458
|
+
v(le, {
|
|
1452
1459
|
label: t(o)("inventory.transfer.form.type.title")
|
|
1453
1460
|
}, null, 8, ["label"]),
|
|
1454
1461
|
l("div", Ta, [
|
|
1455
|
-
|
|
1462
|
+
v(He, {
|
|
1456
1463
|
"z-index": 51,
|
|
1457
1464
|
placement: "left",
|
|
1458
1465
|
disabled: a.disabled
|
|
@@ -1461,16 +1468,16 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1461
1468
|
Pe("This field is locked from template.")
|
|
1462
1469
|
])),
|
|
1463
1470
|
default: A(() => [
|
|
1464
|
-
|
|
1471
|
+
v($e, null, {
|
|
1465
1472
|
default: A(() => [
|
|
1466
1473
|
l("div", Va, [
|
|
1467
|
-
|
|
1474
|
+
v(ye, {
|
|
1468
1475
|
name: "lock_outline",
|
|
1469
1476
|
size: "sm",
|
|
1470
1477
|
color: a.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1471
1478
|
}, null, 8, ["color"]),
|
|
1472
1479
|
l("div", {
|
|
1473
|
-
class:
|
|
1480
|
+
class: J({ "text-fm-color-typo-disabled": a.disabled })
|
|
1474
1481
|
}, E(t(o)(`inventory.transfer.form.type.${P.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1475
1482
|
])
|
|
1476
1483
|
]),
|
|
@@ -1480,7 +1487,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1480
1487
|
_: 1
|
|
1481
1488
|
}, 8, ["disabled"]),
|
|
1482
1489
|
l("div", {
|
|
1483
|
-
class:
|
|
1490
|
+
class: J([
|
|
1484
1491
|
"fm-typo-en-body-sm-400",
|
|
1485
1492
|
a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1486
1493
|
])
|
|
@@ -1488,11 +1495,11 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1488
1495
|
])
|
|
1489
1496
|
]),
|
|
1490
1497
|
l("div", Pa, [
|
|
1491
|
-
|
|
1498
|
+
v(le, {
|
|
1492
1499
|
label: P.value === t(pe).enum.purchase ? t(o)("inventory.transfer.form.purchaseFrom") : t(o)("inventory.transfer.form.transferFrom")
|
|
1493
1500
|
}, null, 8, ["label"]),
|
|
1494
1501
|
l("div", Ra, [
|
|
1495
|
-
|
|
1502
|
+
v(He, {
|
|
1496
1503
|
"z-index": 51,
|
|
1497
1504
|
placement: "left",
|
|
1498
1505
|
disabled: a.disabled
|
|
@@ -1501,18 +1508,18 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1501
1508
|
Pe("This field is locked from template.")
|
|
1502
1509
|
])),
|
|
1503
1510
|
default: A(() => [
|
|
1504
|
-
|
|
1511
|
+
v($e, null, {
|
|
1505
1512
|
default: A(() => {
|
|
1506
1513
|
var O;
|
|
1507
1514
|
return [
|
|
1508
1515
|
l("div", Oa, [
|
|
1509
|
-
|
|
1516
|
+
v(ye, {
|
|
1510
1517
|
name: "lock_outline",
|
|
1511
1518
|
size: "sm",
|
|
1512
1519
|
color: a.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1513
1520
|
}, null, 8, ["color"]),
|
|
1514
1521
|
l("div", {
|
|
1515
|
-
class:
|
|
1522
|
+
class: J({ "text-fm-color-typo-disabled": a.disabled })
|
|
1516
1523
|
}, E((O = R.value.find((ne) => ne.value === D.value)) == null ? void 0 : O.label), 3)
|
|
1517
1524
|
])
|
|
1518
1525
|
];
|
|
@@ -1524,37 +1531,37 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1524
1531
|
}, 8, ["disabled"])
|
|
1525
1532
|
])
|
|
1526
1533
|
])
|
|
1527
|
-
], 64)) : (
|
|
1528
|
-
|
|
1534
|
+
], 64)) : (k(), T(re, { key: 1 }, [
|
|
1535
|
+
v(Ae, {
|
|
1529
1536
|
label: t(o)("inventory.transfer.form.type.title"),
|
|
1530
1537
|
"label-mark": "required",
|
|
1531
1538
|
modelValue: P.value,
|
|
1532
1539
|
"onUpdate:modelValue": _[0] || (_[0] = (O) => P.value = O),
|
|
1533
1540
|
items: Ce.value,
|
|
1534
|
-
rules: [t(
|
|
1541
|
+
rules: [t(Xe)(1)(Ce.value)]
|
|
1535
1542
|
}, {
|
|
1536
1543
|
default: A(() => [
|
|
1537
1544
|
l("span", {
|
|
1538
|
-
class:
|
|
1545
|
+
class: J([
|
|
1539
1546
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1540
1547
|
a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1541
1548
|
])
|
|
1542
|
-
}, E(t(
|
|
1549
|
+
}, E(t(Zt)(P.value)), 3)
|
|
1543
1550
|
]),
|
|
1544
1551
|
_: 1
|
|
1545
1552
|
}, 8, ["label", "modelValue", "items", "rules"]),
|
|
1546
|
-
|
|
1553
|
+
v(Ae, {
|
|
1547
1554
|
label: P.value === t(pe).enum.purchase ? t(o)("inventory.transfer.form.purchaseFrom") : t(o)("inventory.transfer.form.transferFrom"),
|
|
1548
1555
|
"label-mark": "required",
|
|
1549
1556
|
modelValue: D.value,
|
|
1550
1557
|
"onUpdate:modelValue": _[1] || (_[1] = (O) => D.value = O),
|
|
1551
1558
|
items: R.value,
|
|
1552
|
-
rules: [t(
|
|
1559
|
+
rules: [t(Xe)(1)(R.value)]
|
|
1553
1560
|
}, {
|
|
1554
1561
|
"menu-wrapper": A((O) => {
|
|
1555
1562
|
var ne, Me;
|
|
1556
1563
|
return [
|
|
1557
|
-
|
|
1564
|
+
v(_s, nt(O, {
|
|
1558
1565
|
items: R.value,
|
|
1559
1566
|
"model-value": (Me = (ne = a.modelValue) == null ? void 0 : ne.supplier) == null ? void 0 : Me._id
|
|
1560
1567
|
}), null, 16, ["items", "model-value"])
|
|
@@ -1564,7 +1571,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1564
1571
|
var O;
|
|
1565
1572
|
return [
|
|
1566
1573
|
l("span", {
|
|
1567
|
-
class:
|
|
1574
|
+
class: J([
|
|
1568
1575
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1569
1576
|
a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1570
1577
|
])
|
|
@@ -1574,21 +1581,21 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1574
1581
|
_: 1
|
|
1575
1582
|
}, 8, ["label", "modelValue", "items", "rules"])
|
|
1576
1583
|
], 64)),
|
|
1577
|
-
|
|
1584
|
+
v(je, {
|
|
1578
1585
|
label: t(o)("inventory.transfer.form.reference"),
|
|
1579
1586
|
"label-mark": "optional",
|
|
1580
1587
|
modelValue: L.value,
|
|
1581
1588
|
"onUpdate:modelValue": _[2] || (_[2] = (O) => L.value = O)
|
|
1582
1589
|
}, null, 8, ["label", "modelValue"]),
|
|
1583
|
-
|
|
1590
|
+
v(Qe, {
|
|
1584
1591
|
label: t(o)("inventory.transfer.form.remark"),
|
|
1585
1592
|
"label-mark": "optional",
|
|
1586
1593
|
"max-length": 240,
|
|
1587
1594
|
modelValue: q.value,
|
|
1588
1595
|
"onUpdate:modelValue": _[3] || (_[3] = (O) => q.value = O),
|
|
1589
|
-
class:
|
|
1596
|
+
class: J([a.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1590
1597
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1591
|
-
|
|
1598
|
+
$.value ? (k(), se(Ca, {
|
|
1592
1599
|
key: 2,
|
|
1593
1600
|
required: t(u).template != null || t(u).netSuite != null,
|
|
1594
1601
|
subsidiaryOptional: t(u).template == null,
|
|
@@ -1597,81 +1604,81 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1597
1604
|
setting: t(u).netSuite,
|
|
1598
1605
|
items: z.value,
|
|
1599
1606
|
onChange: (O, ne) => {
|
|
1600
|
-
t(
|
|
1607
|
+
t(r).updateItems(O), t(r).setNetSuiteSetting(ne);
|
|
1601
1608
|
},
|
|
1602
1609
|
"onNetsuite:ready": _[4] || (_[4] = (O) => {
|
|
1603
|
-
|
|
1610
|
+
w.value = !0;
|
|
1604
1611
|
})
|
|
1605
1612
|
}, null, 8, ["required", "subsidiaryOptional", "disabled", "supplier", "setting", "items", "onChange"])) : K("", !0),
|
|
1606
|
-
t(
|
|
1613
|
+
t(m).enableBackdatePo ? (k(), T("div", Aa, [
|
|
1607
1614
|
l("div", {
|
|
1608
|
-
class:
|
|
1615
|
+
class: J([
|
|
1609
1616
|
"flex",
|
|
1610
1617
|
{
|
|
1611
|
-
"flex-col":
|
|
1618
|
+
"flex-col": f.value
|
|
1612
1619
|
}
|
|
1613
1620
|
])
|
|
1614
1621
|
}, [
|
|
1615
|
-
|
|
1622
|
+
v(Ee, {
|
|
1616
1623
|
modelValue: t(ae),
|
|
1617
1624
|
"onUpdate:modelValue": _[5] || (_[5] = (O) => Se(ae) ? ae.value = O : null),
|
|
1618
1625
|
label: t(o)("inventory.transfer.form.backdate.title"),
|
|
1619
1626
|
sublabel: t(o)("inventory.transfer.form.backdate.subtitle"),
|
|
1620
1627
|
"label-placement": "right",
|
|
1621
|
-
disabled:
|
|
1628
|
+
disabled: Z.value && !a.lastClosingDate || a.disabled
|
|
1622
1629
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1623
1630
|
l("div", {
|
|
1624
|
-
class:
|
|
1631
|
+
class: J({ hidden: f.value, "w-16": !f.value })
|
|
1625
1632
|
}, null, 2),
|
|
1626
|
-
t(ae) ? (
|
|
1633
|
+
t(ae) ? (k(), T("div", Ea, [
|
|
1627
1634
|
l("div", Ma, [
|
|
1628
|
-
|
|
1629
|
-
modelValue: t(
|
|
1630
|
-
"onUpdate:modelValue": _[6] || (_[6] = (O) => Se(
|
|
1635
|
+
v(Ye, {
|
|
1636
|
+
modelValue: t(S),
|
|
1637
|
+
"onUpdate:modelValue": _[6] || (_[6] = (O) => Se(S) ? S.value = O : null)
|
|
1631
1638
|
}, null, 8, ["modelValue"])
|
|
1632
1639
|
]),
|
|
1633
1640
|
l("div", qa, [
|
|
1634
|
-
|
|
1635
|
-
modelValue: t(
|
|
1636
|
-
"onUpdate:modelValue": _[7] || (_[7] = (O) => Se(
|
|
1641
|
+
v(j, {
|
|
1642
|
+
modelValue: t(C),
|
|
1643
|
+
"onUpdate:modelValue": _[7] || (_[7] = (O) => Se(C) ? C.value = O : null)
|
|
1637
1644
|
}, null, 8, ["modelValue"])
|
|
1638
1645
|
])
|
|
1639
1646
|
])) : K("", !0)
|
|
1640
1647
|
], 2),
|
|
1641
|
-
t(
|
|
1648
|
+
t(W) ? (k(), se(ee, {
|
|
1642
1649
|
key: 0,
|
|
1643
|
-
modelValue: t(
|
|
1644
|
-
"onUpdate:modelValue": _[8] || (_[8] = (O) => Se(
|
|
1645
|
-
rules: [t(
|
|
1650
|
+
modelValue: t(W),
|
|
1651
|
+
"onUpdate:modelValue": _[8] || (_[8] = (O) => Se(W) ? W.value = O : null),
|
|
1652
|
+
rules: [t(lt)(new Date(a.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1646
1653
|
}, null, 8, ["modelValue", "rules"])) : K("", !0),
|
|
1647
|
-
|
|
1648
|
-
|
|
1654
|
+
Z.value && !a.lastClosingDate ? (k(), T("div", Ua, [
|
|
1655
|
+
v(ye, {
|
|
1649
1656
|
name: "error",
|
|
1650
1657
|
size: "sm",
|
|
1651
1658
|
class: "text-fm-color-typo-warning"
|
|
1652
1659
|
}),
|
|
1653
|
-
l("span",
|
|
1660
|
+
l("span", Na, E(t(o)("inventory.transfer.form.backdate.error")), 1)
|
|
1654
1661
|
])) : K("", !0)
|
|
1655
1662
|
])) : K("", !0)
|
|
1656
1663
|
])
|
|
1657
1664
|
]),
|
|
1658
1665
|
l("div", Ba, [
|
|
1659
|
-
|
|
1666
|
+
v(ee, {
|
|
1660
1667
|
"model-value": z.value,
|
|
1661
|
-
rules: [t(
|
|
1668
|
+
rules: [t(Xe)(1)]
|
|
1662
1669
|
}, null, 8, ["model-value", "rules"]),
|
|
1663
1670
|
l("div", {
|
|
1664
|
-
class:
|
|
1671
|
+
class: J([
|
|
1665
1672
|
"flex gap-16",
|
|
1666
1673
|
{
|
|
1667
|
-
"flex-col items-start":
|
|
1668
|
-
"items-center": !
|
|
1674
|
+
"flex-col items-start": f.value,
|
|
1675
|
+
"items-center": !f.value
|
|
1669
1676
|
}
|
|
1670
1677
|
])
|
|
1671
1678
|
}, [
|
|
1672
1679
|
l("div", za, E(t(o)("inventory.transfer.form.items.title")), 1),
|
|
1673
1680
|
l("div", La, [
|
|
1674
|
-
|
|
1681
|
+
v(ie, {
|
|
1675
1682
|
disabled: a.disabled,
|
|
1676
1683
|
label: t(o)("inventory.transfer.form.items.addItem"),
|
|
1677
1684
|
"prepend-icon": "add",
|
|
@@ -1679,24 +1686,24 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1679
1686
|
"text-color": "primary",
|
|
1680
1687
|
"bg-color": "transparent",
|
|
1681
1688
|
"border-color": "primary",
|
|
1682
|
-
onClick: _[9] || (_[9] = (O) =>
|
|
1689
|
+
onClick: _[9] || (_[9] = (O) => ze()),
|
|
1683
1690
|
size: "md"
|
|
1684
1691
|
}, null, 8, ["disabled", "label"]),
|
|
1685
|
-
|
|
1692
|
+
v(pa, {
|
|
1686
1693
|
"template-id": t(u).template || void 0,
|
|
1687
|
-
"template-items":
|
|
1694
|
+
"template-items": Le.value,
|
|
1688
1695
|
"po-items": z.value,
|
|
1689
1696
|
"onUpdate:forecastAmounts": _[10] || (_[10] = (O) => {
|
|
1690
|
-
|
|
1697
|
+
y.value = O;
|
|
1691
1698
|
}),
|
|
1692
1699
|
"onUpdate:poItems": _[11] || (_[11] = (O) => {
|
|
1693
|
-
t(
|
|
1700
|
+
t(r).updateItems(O), c.value++;
|
|
1694
1701
|
})
|
|
1695
1702
|
}, null, 8, ["template-id", "template-items", "po-items"])
|
|
1696
1703
|
])
|
|
1697
1704
|
], 2),
|
|
1698
|
-
P.value === t(pe).enum.purchase && B.value && t(
|
|
1699
|
-
|
|
1705
|
+
P.value === t(pe).enum.purchase && B.value && t(m).enableTotalCost && ((ke = a.modelValue) != null && ke.items.length) ? (k(), T("div", Ha, [
|
|
1706
|
+
v(Ee, {
|
|
1700
1707
|
label: t(fe) ? t(o)("inventory.transfer.form.items.fetchingData") : t(o)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1701
1708
|
"prepend-icon": "compare_arrows",
|
|
1702
1709
|
"label-placement": "right",
|
|
@@ -1705,30 +1712,30 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1705
1712
|
disabled: t(fe) || a.disabled
|
|
1706
1713
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1707
1714
|
])) : K("", !0),
|
|
1708
|
-
|
|
1715
|
+
v(ee, {
|
|
1709
1716
|
"model-value": Oe.value,
|
|
1710
1717
|
rules: [() => Oe.value ? "Must have at least one non-zero item" : !0]
|
|
1711
1718
|
}, null, 8, ["model-value", "rules"]),
|
|
1712
|
-
(
|
|
1713
|
-
"column-defs":
|
|
1719
|
+
(k(), se(oe, {
|
|
1720
|
+
"column-defs": Be.value,
|
|
1714
1721
|
"column-visibility": {
|
|
1715
|
-
[t(te).Code]: !(((
|
|
1716
|
-
[t(te).Name]: !(((
|
|
1717
|
-
[t(te).TemplateName]: !!(((
|
|
1722
|
+
[t(te).Code]: !(((mt = a.modelValue) == null ? void 0 : mt.template) ?? ((pt = a.modelValue) == null ? void 0 : pt.templateDoc)),
|
|
1723
|
+
[t(te).Name]: !(((ft = a.modelValue) == null ? void 0 : ft.template) ?? ((vt = a.modelValue) == null ? void 0 : vt.templateDoc)),
|
|
1724
|
+
[t(te).TemplateName]: !!(((yt = a.modelValue) == null ? void 0 : yt.template) ?? ((bt = a.modelValue) == null ? void 0 : bt.templateDoc))
|
|
1718
1725
|
},
|
|
1719
1726
|
"row-data": z.value,
|
|
1720
|
-
key:
|
|
1727
|
+
key: c.value,
|
|
1721
1728
|
"hide-footer": "",
|
|
1722
1729
|
"page-size": z.value.length
|
|
1723
1730
|
}, {
|
|
1724
1731
|
"table-row": A((O) => {
|
|
1725
|
-
var ne, Me,
|
|
1732
|
+
var ne, Me, gt, _t;
|
|
1726
1733
|
return [
|
|
1727
|
-
|
|
1734
|
+
v(ga, {
|
|
1728
1735
|
"compare-price-by-sku": t(ce),
|
|
1729
1736
|
"show-compare-price": P.value === t(pe).enum.purchase && t(H),
|
|
1730
1737
|
row: O,
|
|
1731
|
-
"template-item": (
|
|
1738
|
+
"template-item": (_t = (gt = (Me = (ne = a.modelValue) == null ? void 0 : ne.templateDoc) == null ? void 0 : Me.purchaseOrder) == null ? void 0 : gt.items) == null ? void 0 : _t.find(
|
|
1732
1739
|
(st) => st.sku._id === O.original.sku._id
|
|
1733
1740
|
),
|
|
1734
1741
|
"onUpdate:item": _[13] || (_[13] = (st) => Fe.value.updateItem(st)),
|
|
@@ -1737,12 +1744,12 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1737
1744
|
];
|
|
1738
1745
|
}),
|
|
1739
1746
|
"list-row": A((O) => [
|
|
1740
|
-
(
|
|
1747
|
+
(k(), se(Rt, {
|
|
1741
1748
|
row: O,
|
|
1742
1749
|
key: z.value.map((ne) => ne.sku._id).join(".")
|
|
1743
1750
|
}, {
|
|
1744
1751
|
default: A((ne) => [
|
|
1745
|
-
|
|
1752
|
+
v(Zs, {
|
|
1746
1753
|
"compare-price-by-sku": t(ce),
|
|
1747
1754
|
"show-compare-price": P.value === t(pe).enum.purchase && t(H),
|
|
1748
1755
|
row: O,
|
|
@@ -1762,7 +1769,7 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1762
1769
|
]);
|
|
1763
1770
|
};
|
|
1764
1771
|
}
|
|
1765
|
-
}), Qa = { class: "flex items-center" }, Ya = { class: "fm-typo-en-title-md-800" }, Ka = { class: "flex gap-4" }, Xa = { class: "fm-typo-en-title-md-600" }, Za = { class: "flex flex-col gap-16" }, Wa = { class: "fm-typo-en-body-md-400" },
|
|
1772
|
+
}), Qa = { class: "flex items-center" }, Ya = { class: "fm-typo-en-title-md-800" }, Ka = { class: "flex gap-4" }, Xa = { class: "fm-typo-en-title-md-600" }, Za = { class: "flex flex-col gap-16" }, Wa = { class: "fm-typo-en-body-md-400" }, Ja = { class: "max-h-[300px] overflow-y-auto" }, Ga = { class: "list-disc pl-16" }, eo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, to = { class: "flex w-full gap-8 justify-end" }, so = /* @__PURE__ */ de({
|
|
1766
1773
|
__name: "TransferDialog",
|
|
1767
1774
|
props: {
|
|
1768
1775
|
mode: {},
|
|
@@ -1772,19 +1779,19 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1772
1779
|
lastClosingDate: {}
|
|
1773
1780
|
},
|
|
1774
1781
|
emits: ["update:show", "submitted"],
|
|
1775
|
-
setup(
|
|
1782
|
+
setup(p, { expose: g, emit: i }) {
|
|
1776
1783
|
var ae;
|
|
1777
|
-
const d =
|
|
1778
|
-
var
|
|
1779
|
-
return ((
|
|
1784
|
+
const d = p, b = i, o = ct(), h = Ot(), x = Re(), I = ut(), m = Ge(), e = Je(), { t: n } = he(), f = U(!1), s = U(!1), r = U(!1), u = U(!1), w = M(() => {
|
|
1785
|
+
var S;
|
|
1786
|
+
return ((S = F.value.items) == null ? void 0 : S.filter((C) => C.quantity.amount === 0)) ?? [];
|
|
1780
1787
|
});
|
|
1781
|
-
async function S
|
|
1782
|
-
if (
|
|
1788
|
+
async function $(S) {
|
|
1789
|
+
if (S) {
|
|
1783
1790
|
s.value = !1;
|
|
1784
1791
|
try {
|
|
1785
1792
|
await I.readSuppliers(), s.value = !0;
|
|
1786
1793
|
} catch {
|
|
1787
|
-
|
|
1794
|
+
x.open({
|
|
1788
1795
|
title: n("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1789
1796
|
message: n("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1790
1797
|
type: "error"
|
|
@@ -1792,8 +1799,8 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1792
1799
|
}
|
|
1793
1800
|
}
|
|
1794
1801
|
}
|
|
1795
|
-
e.watchLocation(
|
|
1796
|
-
function
|
|
1802
|
+
e.watchLocation($);
|
|
1803
|
+
function c() {
|
|
1797
1804
|
return {
|
|
1798
1805
|
remark: void 0,
|
|
1799
1806
|
ref: void 0,
|
|
@@ -1824,18 +1831,18 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1824
1831
|
seqNumber: 0,
|
|
1825
1832
|
deliveryOrder: [],
|
|
1826
1833
|
template: d.templateId,
|
|
1827
|
-
templateDoc:
|
|
1834
|
+
templateDoc: h.templates.find((C) => C._id === d.templateId)
|
|
1828
1835
|
};
|
|
1829
1836
|
}
|
|
1830
|
-
const
|
|
1837
|
+
const y = Pt(d, "show"), F = U(d.modelValue ?? c()), B = U(((ae = d.modelValue) == null ? void 0 : ae._id) ?? `${Math.random()}`);
|
|
1831
1838
|
_e(
|
|
1832
1839
|
() => d.show,
|
|
1833
|
-
(
|
|
1834
|
-
var
|
|
1835
|
-
|
|
1840
|
+
(S) => {
|
|
1841
|
+
var C;
|
|
1842
|
+
S && (r.value = !1, F.value = d.modelValue ?? c(), B.value = ((C = d.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
|
|
1836
1843
|
}
|
|
1837
1844
|
);
|
|
1838
|
-
const z = M(() => !s.value || !
|
|
1845
|
+
const z = M(() => !s.value || !r.value), Z = M(() => {
|
|
1839
1846
|
switch (d.mode) {
|
|
1840
1847
|
case qe.READ:
|
|
1841
1848
|
return "View transfer";
|
|
@@ -1845,169 +1852,169 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
1845
1852
|
return n("inventory.transfer.receiveRequest.update.title");
|
|
1846
1853
|
}
|
|
1847
1854
|
return "";
|
|
1848
|
-
}),
|
|
1849
|
-
|
|
1855
|
+
}), X = U();
|
|
1856
|
+
g({
|
|
1850
1857
|
validateInputs: () => {
|
|
1851
|
-
var
|
|
1852
|
-
(
|
|
1858
|
+
var S, C;
|
|
1859
|
+
(C = (S = X.value) == null ? void 0 : S.validateInputs) == null || C.call(S);
|
|
1853
1860
|
},
|
|
1854
1861
|
resetInputsValidation: () => {
|
|
1855
|
-
var
|
|
1856
|
-
(
|
|
1862
|
+
var S, C;
|
|
1863
|
+
(C = (S = X.value) == null ? void 0 : S.resetInputsValidation) == null || C.call(S);
|
|
1857
1864
|
},
|
|
1858
1865
|
resetInputs: () => {
|
|
1859
|
-
var
|
|
1860
|
-
(
|
|
1866
|
+
var S, C;
|
|
1867
|
+
(C = (S = X.value) == null ? void 0 : S.resetInputs) == null || C.call(S);
|
|
1861
1868
|
}
|
|
1862
1869
|
});
|
|
1863
|
-
async function
|
|
1864
|
-
const
|
|
1865
|
-
if (
|
|
1866
|
-
|
|
1870
|
+
async function N() {
|
|
1871
|
+
const S = F.value;
|
|
1872
|
+
if (f.value = !0, S.items = S.items.filter((C) => C.quantity.amount > 0), !S.items.length) {
|
|
1873
|
+
x.open({
|
|
1867
1874
|
title: "Cannot create order",
|
|
1868
1875
|
message: "There are no items with non-zero amount in your request.",
|
|
1869
1876
|
type: "error"
|
|
1870
1877
|
});
|
|
1871
1878
|
return;
|
|
1872
1879
|
}
|
|
1873
|
-
(
|
|
1880
|
+
(S.supplier.internal === "warehouse" || S.supplier.internal === "restaurant") && (S.items = S.items.map(({ totalCost: C, ...H }) => H));
|
|
1874
1881
|
try {
|
|
1875
|
-
await o.createPurchaseOrder(
|
|
1882
|
+
await o.createPurchaseOrder(S), await new Promise((C) => setTimeout(C, 1e3)), x.open({
|
|
1876
1883
|
title: n("inventory.transfer.receiveRequest.create.success"),
|
|
1877
1884
|
message: n("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1878
1885
|
type: "success"
|
|
1879
|
-
}),
|
|
1880
|
-
} catch (
|
|
1881
|
-
|
|
1886
|
+
}), b("update:show", !1), b("submitted");
|
|
1887
|
+
} catch (C) {
|
|
1888
|
+
x.open({
|
|
1882
1889
|
title: n("inventory.transfer.receiveRequest.create.error.title"),
|
|
1883
1890
|
message: n("inventory.transfer.receiveRequest.create.error.message"),
|
|
1884
1891
|
type: "error"
|
|
1885
|
-
}), console.error("Error in creating purchase order",
|
|
1892
|
+
}), console.error("Error in creating purchase order", C);
|
|
1886
1893
|
} finally {
|
|
1887
|
-
|
|
1894
|
+
f.value = !1;
|
|
1888
1895
|
}
|
|
1889
1896
|
}
|
|
1890
1897
|
async function P() {
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1893
|
-
|
|
1898
|
+
const S = F.value;
|
|
1899
|
+
if (f.value = !0, S.items = S.items.filter((C) => C.quantity.amount > 0), !S.items.length) {
|
|
1900
|
+
x.open({
|
|
1894
1901
|
title: "Cannot create order",
|
|
1895
1902
|
message: "There are no items with non-zero amount in your request.",
|
|
1896
1903
|
type: "error"
|
|
1897
1904
|
});
|
|
1898
1905
|
return;
|
|
1899
1906
|
}
|
|
1900
|
-
(
|
|
1907
|
+
(S.supplier.internal === "warehouse" || S.supplier.internal === "restaurant") && (S.items = S.items.map(({ totalCost: C, ...H }) => H));
|
|
1901
1908
|
try {
|
|
1902
|
-
await o.updatePurchaseOrder(
|
|
1909
|
+
await o.updatePurchaseOrder(S), await new Promise((C) => setTimeout(C, 1e3)), x.open({
|
|
1903
1910
|
title: n("inventory.transfer.receiveRequest.update.success"),
|
|
1904
1911
|
message: n("inventory.transfer.receiveRequest.update.successMessage"),
|
|
1905
1912
|
type: "success"
|
|
1906
|
-
}),
|
|
1907
|
-
} catch (
|
|
1908
|
-
|
|
1913
|
+
}), b("update:show", !1), b("submitted");
|
|
1914
|
+
} catch (C) {
|
|
1915
|
+
x.open({
|
|
1909
1916
|
title: n("inventory.transfer.receiveRequest.update.error.title"),
|
|
1910
1917
|
message: n("inventory.transfer.receiveRequest.update.error.message"),
|
|
1911
1918
|
type: "error"
|
|
1912
|
-
}), console.error("Error in updating purchase order",
|
|
1919
|
+
}), console.error("Error in updating purchase order", C);
|
|
1913
1920
|
} finally {
|
|
1914
|
-
|
|
1921
|
+
f.value = !1;
|
|
1915
1922
|
}
|
|
1916
1923
|
}
|
|
1917
1924
|
function R() {
|
|
1918
1925
|
switch (d.mode) {
|
|
1919
1926
|
case qe.CREATE:
|
|
1920
|
-
return
|
|
1927
|
+
return N();
|
|
1921
1928
|
case qe.UPDATE:
|
|
1922
1929
|
return P();
|
|
1923
1930
|
}
|
|
1924
1931
|
}
|
|
1925
1932
|
function D() {
|
|
1926
|
-
var
|
|
1927
|
-
|
|
1933
|
+
var S;
|
|
1934
|
+
F.value.items = ((S = F.value.items) == null ? void 0 : S.filter((C) => C.quantity.amount > 0)) ?? [], u.value = !1, L();
|
|
1928
1935
|
}
|
|
1929
1936
|
function q() {
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
...
|
|
1937
|
+
X.value.getFormData && (F.value = {
|
|
1938
|
+
...F.value,
|
|
1939
|
+
...X.value.getFormData()
|
|
1933
1940
|
});
|
|
1934
1941
|
}
|
|
1935
1942
|
function L() {
|
|
1936
1943
|
var H, fe;
|
|
1937
|
-
const
|
|
1938
|
-
skusById:
|
|
1939
|
-
items:
|
|
1940
|
-
}),
|
|
1941
|
-
if (
|
|
1942
|
-
const ce =
|
|
1943
|
-
|
|
1944
|
+
const S = bs.validatePurchaseOrderItems({
|
|
1945
|
+
skusById: m.skuById ?? {},
|
|
1946
|
+
items: F.value.items ?? []
|
|
1947
|
+
}), C = Object.values(S).flat();
|
|
1948
|
+
if (C.length > 0) {
|
|
1949
|
+
const ce = C[0];
|
|
1950
|
+
x.open({
|
|
1944
1951
|
title: `[Row ${ce.index + 1}] "${ce.poItem.sku.name}"`,
|
|
1945
1952
|
message: `${ce.message}`,
|
|
1946
1953
|
type: "error"
|
|
1947
1954
|
});
|
|
1948
1955
|
return;
|
|
1949
1956
|
}
|
|
1950
|
-
(fe = (H =
|
|
1957
|
+
(fe = (H = X.value) == null ? void 0 : H.validateInputs) == null || fe.call(H);
|
|
1951
1958
|
}
|
|
1952
|
-
function
|
|
1953
|
-
if (q(),
|
|
1959
|
+
function W() {
|
|
1960
|
+
if (q(), w.value.length > 0) {
|
|
1954
1961
|
u.value = !0;
|
|
1955
1962
|
return;
|
|
1956
1963
|
}
|
|
1957
1964
|
L();
|
|
1958
1965
|
}
|
|
1959
|
-
return (
|
|
1966
|
+
return (S, C) => {
|
|
1960
1967
|
const H = V("FmButton"), fe = V("FmSideSheet"), ce = V("FmDialog");
|
|
1961
|
-
return
|
|
1962
|
-
|
|
1963
|
-
modelValue: t(
|
|
1964
|
-
"onUpdate:modelValue":
|
|
1968
|
+
return k(), T(re, null, [
|
|
1969
|
+
v(fe, {
|
|
1970
|
+
modelValue: t(y),
|
|
1971
|
+
"onUpdate:modelValue": C[3] || (C[3] = (G) => Se(y) ? y.value = G : null),
|
|
1965
1972
|
"dismiss-away": "",
|
|
1966
1973
|
"close-button": "",
|
|
1967
1974
|
"max-width": 900
|
|
1968
1975
|
}, {
|
|
1969
1976
|
"side-sheet-header": A(() => [
|
|
1970
1977
|
l("div", Qa, [
|
|
1971
|
-
l("div", Ya, E(
|
|
1978
|
+
l("div", Ya, E(Z.value), 1)
|
|
1972
1979
|
])
|
|
1973
1980
|
]),
|
|
1974
1981
|
default: A(() => [
|
|
1975
|
-
(
|
|
1982
|
+
(k(), se(ja, {
|
|
1976
1983
|
class: "w-full",
|
|
1977
1984
|
ref_key: "formRef",
|
|
1978
|
-
ref:
|
|
1979
|
-
"onForm:ready":
|
|
1985
|
+
ref: X,
|
|
1986
|
+
"onForm:ready": C[0] || (C[0] = () => r.value = !0),
|
|
1980
1987
|
onValidationSuccess: R,
|
|
1981
|
-
modelValue:
|
|
1982
|
-
"onUpdate:modelValue":
|
|
1983
|
-
disabled:
|
|
1988
|
+
modelValue: F.value,
|
|
1989
|
+
"onUpdate:modelValue": C[1] || (C[1] = (G) => F.value = G),
|
|
1990
|
+
disabled: f.value || z.value,
|
|
1984
1991
|
suppliers: t(I).suppliers,
|
|
1985
|
-
skus: t(
|
|
1992
|
+
skus: t(m).skus,
|
|
1986
1993
|
key: B.value,
|
|
1987
|
-
"last-closing-date":
|
|
1994
|
+
"last-closing-date": S.lastClosingDate
|
|
1988
1995
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1989
1996
|
]),
|
|
1990
1997
|
"side-sheet-footer": A(() => [
|
|
1991
1998
|
l("div", Ka, [
|
|
1992
|
-
|
|
1993
|
-
loading:
|
|
1999
|
+
v(H, {
|
|
2000
|
+
loading: f.value,
|
|
1994
2001
|
disabled: z.value,
|
|
1995
2002
|
label: t(n)("common.save"),
|
|
1996
|
-
onClick:
|
|
2003
|
+
onClick: W
|
|
1997
2004
|
}, null, 8, ["loading", "disabled", "label"]),
|
|
1998
|
-
|
|
2005
|
+
v(H, {
|
|
1999
2006
|
disabled: z.value,
|
|
2000
2007
|
variant: "tertiary",
|
|
2001
2008
|
label: t(n)("common.close"),
|
|
2002
|
-
onClick:
|
|
2009
|
+
onClick: C[2] || (C[2] = (G) => b("update:show", !1))
|
|
2003
2010
|
}, null, 8, ["disabled", "label"])
|
|
2004
2011
|
])
|
|
2005
2012
|
]),
|
|
2006
2013
|
_: 1
|
|
2007
2014
|
}, 8, ["modelValue"]),
|
|
2008
|
-
|
|
2015
|
+
v(ce, {
|
|
2009
2016
|
modelValue: u.value,
|
|
2010
|
-
"onUpdate:modelValue":
|
|
2017
|
+
"onUpdate:modelValue": C[5] || (C[5] = (G) => u.value = G),
|
|
2011
2018
|
overlay: !0
|
|
2012
2019
|
}, {
|
|
2013
2020
|
"dialog-header": A(() => [
|
|
@@ -2015,12 +2022,12 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
2015
2022
|
]),
|
|
2016
2023
|
"dialog-footer": A(() => [
|
|
2017
2024
|
l("div", to, [
|
|
2018
|
-
|
|
2025
|
+
v(H, {
|
|
2019
2026
|
label: t(n)("common.cancel"),
|
|
2020
2027
|
variant: "tertiary",
|
|
2021
|
-
onClick:
|
|
2028
|
+
onClick: C[4] || (C[4] = (G) => u.value = !1)
|
|
2022
2029
|
}, null, 8, ["label"]),
|
|
2023
|
-
|
|
2030
|
+
v(H, {
|
|
2024
2031
|
label: t(n)("inventory.transfer.template.zeroQuantity.removeAll"),
|
|
2025
2032
|
variant: "primary",
|
|
2026
2033
|
"prepend-icon": "delete",
|
|
@@ -2030,10 +2037,10 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
2030
2037
|
]),
|
|
2031
2038
|
default: A(() => [
|
|
2032
2039
|
l("div", Za, [
|
|
2033
|
-
l("div", Wa, E(t(n)("inventory.transfer.template.zeroQuantity.message", { count:
|
|
2034
|
-
l("div",
|
|
2035
|
-
l("ul",
|
|
2036
|
-
(
|
|
2040
|
+
l("div", Wa, E(t(n)("inventory.transfer.template.zeroQuantity.message", { count: w.value.length })), 1),
|
|
2041
|
+
l("div", Ja, [
|
|
2042
|
+
l("ul", Ga, [
|
|
2043
|
+
(k(!0), T(re, null, xe(w.value, (G) => (k(), T("li", {
|
|
2037
2044
|
key: G.sku._id,
|
|
2038
2045
|
class: "fm-typo-en-body-md-400"
|
|
2039
2046
|
}, E(G.sku.name) + " (" + E(G.sku.code) + ") ", 1))), 128))
|
|
@@ -2048,17 +2055,17 @@ const wa = { class: "flex flex-col gap-4" }, Fa = { class: "flex items-center ga
|
|
|
2048
2055
|
};
|
|
2049
2056
|
}
|
|
2050
2057
|
});
|
|
2051
|
-
function ao(
|
|
2052
|
-
const [
|
|
2053
|
-
if (
|
|
2058
|
+
function ao(p) {
|
|
2059
|
+
const [g, i, d, ...b] = Fs(p), o = d.map((m) => m.toLowerCase().trim().replace(/ /g, "_")), x = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((m) => !o.includes(m));
|
|
2060
|
+
if (x.length)
|
|
2054
2061
|
throw new Error(
|
|
2055
|
-
`Missing headers (${
|
|
2062
|
+
`Missing headers (${x.join()}). Excel file does not come from the template.`
|
|
2056
2063
|
);
|
|
2057
|
-
return
|
|
2064
|
+
return b.map((m, e) => {
|
|
2058
2065
|
const n = {};
|
|
2059
|
-
for (const
|
|
2060
|
-
const s = o[
|
|
2061
|
-
Object.assign(n, { [s]:
|
|
2066
|
+
for (const f in o) {
|
|
2067
|
+
const s = o[f];
|
|
2068
|
+
Object.assign(n, { [s]: m[f] });
|
|
2062
2069
|
}
|
|
2063
2070
|
return {
|
|
2064
2071
|
index: e,
|
|
@@ -2066,41 +2073,41 @@ function ao(m) {
|
|
|
2066
2073
|
};
|
|
2067
2074
|
});
|
|
2068
2075
|
}
|
|
2069
|
-
function oo(
|
|
2070
|
-
const
|
|
2076
|
+
function oo(p) {
|
|
2077
|
+
const g = p.SheetNames;
|
|
2071
2078
|
try {
|
|
2072
|
-
return
|
|
2073
|
-
(d,
|
|
2074
|
-
const o = new Array(),
|
|
2075
|
-
for (const { index: n, data:
|
|
2076
|
-
|
|
2077
|
-
const s =
|
|
2079
|
+
return g.reduce(
|
|
2080
|
+
(d, b) => {
|
|
2081
|
+
const o = new Array(), h = p.Sheets[b], x = Ge(), I = ao(h), m = [];
|
|
2082
|
+
for (const { index: n, data: f } of I) {
|
|
2083
|
+
f.scanned_code === "" && o.push(`Row ${n + 1}: Scanned code is empty`), f.item_name === "" && o.push(`Row ${n + 1}: Item name is empty`), f.uom === "" && o.push(`Row ${n + 1}: UOM is empty`), f["transfer_quantity(uom)"] === "" && o.push(`Row ${n + 1}: Transfer quantity is empty`);
|
|
2084
|
+
const s = x.skus.find((w) => w.code === f.scanned_code);
|
|
2078
2085
|
if (!s) {
|
|
2079
2086
|
o.push(`Row ${n + 1}: SKU not found`);
|
|
2080
2087
|
continue;
|
|
2081
2088
|
}
|
|
2082
|
-
const
|
|
2089
|
+
const r = s.unit.abbrev === f.uom;
|
|
2083
2090
|
let u = null;
|
|
2084
|
-
if (!
|
|
2085
|
-
const
|
|
2086
|
-
if (!
|
|
2091
|
+
if (!r) {
|
|
2092
|
+
const w = s.unit.measurements.find(($) => $.abbrev === f.uom);
|
|
2093
|
+
if (!w) {
|
|
2087
2094
|
o.push(`Row ${n + 1}: Measurement not found`);
|
|
2088
2095
|
continue;
|
|
2089
2096
|
}
|
|
2090
|
-
u =
|
|
2097
|
+
u = w;
|
|
2091
2098
|
}
|
|
2092
|
-
|
|
2099
|
+
m.push({
|
|
2093
2100
|
sku: s,
|
|
2094
|
-
code:
|
|
2095
|
-
name:
|
|
2096
|
-
quantity:
|
|
2101
|
+
code: f.scanned_code,
|
|
2102
|
+
name: f.item_name,
|
|
2103
|
+
quantity: rt.fromNumber(Number(f["transfer_quantity(uom)"])),
|
|
2097
2104
|
measurement: u
|
|
2098
2105
|
});
|
|
2099
2106
|
}
|
|
2100
2107
|
const e = {
|
|
2101
2108
|
type: "create",
|
|
2102
|
-
poItems:
|
|
2103
|
-
excelSheetName:
|
|
2109
|
+
poItems: m,
|
|
2110
|
+
excelSheetName: b,
|
|
2104
2111
|
errors: o
|
|
2105
2112
|
};
|
|
2106
2113
|
return d.importCreateResult.push(e), d;
|
|
@@ -2110,10 +2117,10 @@ function oo(m) {
|
|
|
2110
2117
|
importCreateResult: new Array()
|
|
2111
2118
|
}
|
|
2112
2119
|
);
|
|
2113
|
-
} catch (
|
|
2120
|
+
} catch (i) {
|
|
2114
2121
|
return {
|
|
2115
2122
|
invalidExcel: !0,
|
|
2116
|
-
invalidExcelMessage: (
|
|
2123
|
+
invalidExcelMessage: (i == null ? void 0 : i.message) ?? "Invalid excel",
|
|
2117
2124
|
importCreateResult: []
|
|
2118
2125
|
};
|
|
2119
2126
|
}
|
|
@@ -2122,7 +2129,7 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2122
2129
|
key: 0,
|
|
2123
2130
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
2124
2131
|
}, uo = { key: 0 }, co = {
|
|
2125
|
-
class: /* @__PURE__ */
|
|
2132
|
+
class: /* @__PURE__ */ J(["fm-typo-en-body-lg-600"])
|
|
2126
2133
|
}, mo = { class: "flex-1" }, po = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, fo = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, vo = { class: "text-fm-color-typo-primary" }, yo = { class: "ml-auto" }, bo = { key: 0 }, go = /* @__PURE__ */ de({
|
|
2127
2134
|
__name: "XilnexResult",
|
|
2128
2135
|
props: {
|
|
@@ -2131,46 +2138,46 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2131
2138
|
items: {},
|
|
2132
2139
|
errors: {}
|
|
2133
2140
|
},
|
|
2134
|
-
setup(
|
|
2135
|
-
const
|
|
2136
|
-
|
|
2141
|
+
setup(p) {
|
|
2142
|
+
const g = p, { t: i } = he(), d = U(!1), b = () => {
|
|
2143
|
+
g.errors.length && (d.value = !d.value);
|
|
2137
2144
|
};
|
|
2138
|
-
return (o,
|
|
2139
|
-
var
|
|
2140
|
-
const
|
|
2141
|
-
return
|
|
2145
|
+
return (o, h) => {
|
|
2146
|
+
var m;
|
|
2147
|
+
const x = V("FmIcon"), I = V("FmTooltip");
|
|
2148
|
+
return k(), T("div", no, [
|
|
2142
2149
|
l("div", {
|
|
2143
|
-
onClick:
|
|
2144
|
-
class:
|
|
2150
|
+
onClick: b,
|
|
2151
|
+
class: J({
|
|
2145
2152
|
"cursor-pointer": o.errors.length
|
|
2146
2153
|
})
|
|
2147
2154
|
}, [
|
|
2148
2155
|
l("div", lo, [
|
|
2149
2156
|
l("div", ro, [
|
|
2150
2157
|
l("div", {
|
|
2151
|
-
class:
|
|
2158
|
+
class: J({
|
|
2152
2159
|
"text-fm-color-system-error-300": o.errors.length
|
|
2153
2160
|
})
|
|
2154
2161
|
}, [
|
|
2155
2162
|
Pe(E(o.name) + " ", 1),
|
|
2156
|
-
o.type === "create" ? (
|
|
2163
|
+
o.type === "create" ? (k(), T("span", io, "(" + E(t(i)("inventory.closing.template.import.new")) + ")", 1)) : K("", !0)
|
|
2157
2164
|
], 2),
|
|
2158
|
-
o.errors.length ? (
|
|
2159
|
-
|
|
2165
|
+
o.errors.length ? (k(), T("div", uo, [
|
|
2166
|
+
v(x, {
|
|
2160
2167
|
name: "error",
|
|
2161
2168
|
size: "sm",
|
|
2162
2169
|
color: "system-error-300"
|
|
2163
2170
|
})
|
|
2164
2171
|
])) : K("", !0)
|
|
2165
2172
|
]),
|
|
2166
|
-
|
|
2173
|
+
h[0] || (h[0] = l("hr", { class: "my-2" }, null, -1)),
|
|
2167
2174
|
l("div", co, [
|
|
2168
|
-
(
|
|
2175
|
+
(m = o.items) != null && m.length ? (k(!0), T(re, { key: 0 }, xe(o.items, (e, n) => (k(), T("div", {
|
|
2169
2176
|
key: n,
|
|
2170
2177
|
class: "flex gap-4 mt-2 items-center"
|
|
2171
2178
|
}, [
|
|
2172
2179
|
l("div", mo, [
|
|
2173
|
-
|
|
2180
|
+
v(I, {
|
|
2174
2181
|
content: e.code,
|
|
2175
2182
|
placement: "top",
|
|
2176
2183
|
"z-index": 51
|
|
@@ -2180,7 +2187,7 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2180
2187
|
]),
|
|
2181
2188
|
_: 2
|
|
2182
2189
|
}, 1032, ["content"]),
|
|
2183
|
-
|
|
2190
|
+
v(I, {
|
|
2184
2191
|
content: e.name,
|
|
2185
2192
|
placement: "top",
|
|
2186
2193
|
"z-index": 51
|
|
@@ -2192,7 +2199,7 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2192
2199
|
}, 1032, ["content"])
|
|
2193
2200
|
]),
|
|
2194
2201
|
l("div", null, [
|
|
2195
|
-
l("span", vo, E(t(
|
|
2202
|
+
l("span", vo, E(t(rt).toFormatString({
|
|
2196
2203
|
value: e.quantity
|
|
2197
2204
|
})), 1),
|
|
2198
2205
|
Pe(" " + E(e.measurement ? e.measurement.abbrev : e.sku.unit.abbrev), 1)
|
|
@@ -2201,23 +2208,23 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2201
2208
|
])
|
|
2202
2209
|
]),
|
|
2203
2210
|
l("div", yo, [
|
|
2204
|
-
o.errors.length ? (
|
|
2211
|
+
o.errors.length ? (k(), se(x, {
|
|
2205
2212
|
key: 0,
|
|
2206
2213
|
name: d.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
2207
2214
|
size: "md"
|
|
2208
2215
|
}, null, 8, ["name"])) : K("", !0)
|
|
2209
2216
|
])
|
|
2210
2217
|
], 2),
|
|
2211
|
-
d.value ? (
|
|
2218
|
+
d.value ? (k(), T("div", {
|
|
2212
2219
|
key: 0,
|
|
2213
|
-
class:
|
|
2220
|
+
class: J(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
|
|
2214
2221
|
"text-fm-color-typo-secondary": !o.errors.length,
|
|
2215
2222
|
"text-fm-color-system-error-300": o.errors.length
|
|
2216
2223
|
}])
|
|
2217
2224
|
}, [
|
|
2218
|
-
o.errors.length ? (
|
|
2225
|
+
o.errors.length ? (k(), T("div", bo, [
|
|
2219
2226
|
l("ol", null, [
|
|
2220
|
-
(
|
|
2227
|
+
(k(!0), T(re, null, xe(o.errors, (e, n) => (k(), T("li", { key: n }, E(e), 1))), 128))
|
|
2221
2228
|
])
|
|
2222
2229
|
])) : K("", !0)
|
|
2223
2230
|
], 2)) : K("", !0)
|
|
@@ -2236,19 +2243,19 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2236
2243
|
}, Fo = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Io = {
|
|
2237
2244
|
key: 0,
|
|
2238
2245
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
2239
|
-
}, $o = { class: "fm-typo-en-body-lg-600" },
|
|
2246
|
+
}, $o = { class: "fm-typo-en-body-lg-600" }, Ft = "Transfer note", Do = /* @__PURE__ */ de({
|
|
2240
2247
|
__name: "XilnexImportForm",
|
|
2241
|
-
setup(
|
|
2242
|
-
const
|
|
2243
|
-
|
|
2244
|
-
const
|
|
2248
|
+
setup(p, { expose: g }) {
|
|
2249
|
+
const i = U(null), d = Re(), b = U(!1), o = U(!1), h = Ds(), x = U(!1), I = Ne();
|
|
2250
|
+
U([]);
|
|
2251
|
+
const m = M({
|
|
2245
2252
|
get() {
|
|
2246
|
-
var
|
|
2247
|
-
return ((
|
|
2253
|
+
var c;
|
|
2254
|
+
return ((c = h.supplier) == null ? void 0 : c.name) ?? "";
|
|
2248
2255
|
},
|
|
2249
|
-
set(
|
|
2250
|
-
|
|
2251
|
-
name:
|
|
2256
|
+
set(c) {
|
|
2257
|
+
c && (h.supplier = {
|
|
2258
|
+
name: c,
|
|
2252
2259
|
registrationNumber: "",
|
|
2253
2260
|
_id: "xilnex",
|
|
2254
2261
|
internal: "restaurant",
|
|
@@ -2264,93 +2271,93 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2264
2271
|
}
|
|
2265
2272
|
});
|
|
2266
2273
|
We(async () => {
|
|
2267
|
-
const
|
|
2268
|
-
console.log(
|
|
2274
|
+
const c = await I.getNetSuiteLocations();
|
|
2275
|
+
console.log(c), x.value = !0;
|
|
2269
2276
|
});
|
|
2270
2277
|
const e = M({
|
|
2271
2278
|
get() {
|
|
2272
2279
|
return "";
|
|
2273
2280
|
},
|
|
2274
|
-
set(
|
|
2275
|
-
if (
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2281
|
+
set(c) {
|
|
2282
|
+
if (c) {
|
|
2283
|
+
const y = h.effectiveAt ? new Date(h.effectiveAt) : /* @__PURE__ */ new Date(), [F, B, z] = c.split("-");
|
|
2284
|
+
y.setFullYear(parseInt(F)), y.setMonth(parseInt(B) - 1), y.setDate(parseInt(z)), h.effectiveAt = y.toISOString();
|
|
2278
2285
|
}
|
|
2279
2286
|
}
|
|
2280
2287
|
}), n = M({
|
|
2281
2288
|
get() {
|
|
2282
2289
|
return null;
|
|
2283
2290
|
},
|
|
2284
|
-
set(
|
|
2285
|
-
if (
|
|
2286
|
-
const
|
|
2287
|
-
|
|
2291
|
+
set(c) {
|
|
2292
|
+
if (c) {
|
|
2293
|
+
const y = h.effectiveAt ? new Date(h.effectiveAt) : /* @__PURE__ */ new Date(), [F, B] = c.split(":");
|
|
2294
|
+
y.setMinutes(parseInt(F)), y.setSeconds(parseInt(B)), h.effectiveAt = y.toISOString();
|
|
2288
2295
|
}
|
|
2289
2296
|
}
|
|
2290
|
-
}),
|
|
2291
|
-
() => !!
|
|
2292
|
-
), u =
|
|
2293
|
-
|
|
2297
|
+
}), f = U(new Array()), s = U([]), r = M(
|
|
2298
|
+
() => !!f.value.length || s.value.some((c) => c.errors.length)
|
|
2299
|
+
), u = U();
|
|
2300
|
+
g({
|
|
2294
2301
|
validateInputs: () => {
|
|
2295
|
-
var
|
|
2296
|
-
(
|
|
2302
|
+
var c, y;
|
|
2303
|
+
(y = (c = u.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
|
|
2297
2304
|
},
|
|
2298
2305
|
resetInputsValidation: () => {
|
|
2299
|
-
var
|
|
2300
|
-
(
|
|
2306
|
+
var c, y;
|
|
2307
|
+
(y = (c = u.value) == null ? void 0 : c.resetInputsValidation) == null || y.call(c);
|
|
2301
2308
|
},
|
|
2302
2309
|
resetInputs: () => {
|
|
2303
|
-
var
|
|
2304
|
-
(
|
|
2310
|
+
var c, y;
|
|
2311
|
+
(y = (c = u.value) == null ? void 0 : c.resetInputs) == null || y.call(c);
|
|
2305
2312
|
}
|
|
2306
2313
|
});
|
|
2307
|
-
const { t:
|
|
2308
|
-
async function
|
|
2309
|
-
|
|
2314
|
+
const { t: w } = he();
|
|
2315
|
+
async function $(c) {
|
|
2316
|
+
f.value = [], s.value = [];
|
|
2310
2317
|
try {
|
|
2311
|
-
|
|
2312
|
-
const [
|
|
2313
|
-
Is(
|
|
2318
|
+
b.value = !0;
|
|
2319
|
+
const [y] = await Promise.all([
|
|
2320
|
+
Is(c),
|
|
2314
2321
|
// fake buffer
|
|
2315
2322
|
new Promise((B) => setTimeout(B, 1e3))
|
|
2316
|
-
]),
|
|
2317
|
-
if (
|
|
2318
|
-
|
|
2319
|
-
|
|
2323
|
+
]), F = oo(y);
|
|
2324
|
+
if (F.invalidExcel) {
|
|
2325
|
+
f.value.push(
|
|
2326
|
+
F.invalidExcelMessage ?? w("inventory.ingredient.import.fileError.invalidExcel")
|
|
2320
2327
|
);
|
|
2321
2328
|
return;
|
|
2322
2329
|
}
|
|
2323
|
-
if (s.value =
|
|
2324
|
-
|
|
2330
|
+
if (s.value = F.importCreateResult, !s.value.length) {
|
|
2331
|
+
f.value.push(w("inventory.ingredient.import.fileError.noData"));
|
|
2325
2332
|
return;
|
|
2326
2333
|
}
|
|
2327
|
-
|
|
2328
|
-
} catch (
|
|
2334
|
+
h.items = s.value.map((B) => B.poItems).flat();
|
|
2335
|
+
} catch (y) {
|
|
2329
2336
|
d.open({
|
|
2330
|
-
title:
|
|
2331
|
-
message:
|
|
2337
|
+
title: w("inventory.ingredient.import.fileError.unableToRead"),
|
|
2338
|
+
message: y == null ? void 0 : y.message,
|
|
2332
2339
|
type: "error"
|
|
2333
|
-
}), console.error("Error in reading file",
|
|
2340
|
+
}), console.error("Error in reading file", y);
|
|
2334
2341
|
} finally {
|
|
2335
|
-
|
|
2336
|
-
title:
|
|
2342
|
+
f.value.length && d.open({
|
|
2343
|
+
title: w("inventory.ingredient.import.fileError.invalidExcel"),
|
|
2337
2344
|
type: "error"
|
|
2338
|
-
}),
|
|
2345
|
+
}), b.value = !1;
|
|
2339
2346
|
}
|
|
2340
2347
|
}
|
|
2341
|
-
return _e(
|
|
2342
|
-
|
|
2343
|
-
}), (
|
|
2344
|
-
const
|
|
2345
|
-
return
|
|
2348
|
+
return _e(i, (c) => {
|
|
2349
|
+
c && $(c);
|
|
2350
|
+
}), (c, y) => {
|
|
2351
|
+
const F = V("FmSelect"), B = V("FmDatePicker"), z = V("FmTimePicker"), Z = V("FmCircularProgress"), X = V("FmLabel"), N = V("FmIcon"), P = V("FmButton"), R = V("FmForm");
|
|
2352
|
+
return k(), se(R, {
|
|
2346
2353
|
ref_key: "formRef",
|
|
2347
2354
|
ref: u
|
|
2348
2355
|
}, {
|
|
2349
2356
|
default: A(() => [
|
|
2350
2357
|
l("div", _o, [
|
|
2351
|
-
|
|
2352
|
-
modelValue:
|
|
2353
|
-
"onUpdate:modelValue":
|
|
2358
|
+
v(F, {
|
|
2359
|
+
modelValue: m.value,
|
|
2360
|
+
"onUpdate:modelValue": y[0] || (y[0] = (D) => m.value = D),
|
|
2354
2361
|
label: "Transfer from",
|
|
2355
2362
|
searchable: "",
|
|
2356
2363
|
searchTarget: "label",
|
|
@@ -2363,96 +2370,96 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2363
2370
|
{ label: "2", value: "6" }
|
|
2364
2371
|
],
|
|
2365
2372
|
"helper-text": "Helper",
|
|
2366
|
-
rules: [t(
|
|
2373
|
+
rules: [t(Ue)()]
|
|
2367
2374
|
}, null, 8, ["modelValue", "rules"]),
|
|
2368
|
-
|
|
2375
|
+
v(B, {
|
|
2369
2376
|
modelValue: e.value,
|
|
2370
|
-
"onUpdate:modelValue":
|
|
2377
|
+
"onUpdate:modelValue": y[1] || (y[1] = (D) => e.value = D),
|
|
2371
2378
|
label: "Transfer date",
|
|
2372
|
-
rules: [t(
|
|
2379
|
+
rules: [t(Ue)()]
|
|
2373
2380
|
}, null, 8, ["modelValue", "rules"]),
|
|
2374
|
-
|
|
2381
|
+
v(z, {
|
|
2375
2382
|
modelValue: n.value,
|
|
2376
|
-
"onUpdate:modelValue":
|
|
2383
|
+
"onUpdate:modelValue": y[2] || (y[2] = (D) => n.value = D),
|
|
2377
2384
|
label: "Transfer time",
|
|
2378
|
-
rules: [t(
|
|
2385
|
+
rules: [t(Ue)()]
|
|
2379
2386
|
}, null, 8, ["modelValue", "rules"]),
|
|
2380
|
-
o.value ? (
|
|
2387
|
+
o.value ? (k(), T("div", ho, [
|
|
2381
2388
|
l("div", null, [
|
|
2382
|
-
|
|
2389
|
+
v(Z, {
|
|
2383
2390
|
size: "md",
|
|
2384
2391
|
color: "neutral-gray-200"
|
|
2385
2392
|
})
|
|
2386
2393
|
]),
|
|
2387
|
-
l("div", ko, E(t(
|
|
2388
|
-
])) : (
|
|
2389
|
-
|
|
2394
|
+
l("div", ko, E(t(w)("inventory.formField.loading")), 1)
|
|
2395
|
+
])) : (k(), T(re, { key: 1 }, [
|
|
2396
|
+
v($s, {
|
|
2390
2397
|
"max-file-size": 5,
|
|
2391
|
-
class:
|
|
2398
|
+
class: J({
|
|
2392
2399
|
"w-full": !0,
|
|
2393
|
-
"h-[200px]": !
|
|
2400
|
+
"h-[200px]": !i.value
|
|
2394
2401
|
}),
|
|
2395
2402
|
accept: ".xlsx,.xls",
|
|
2396
|
-
label:
|
|
2397
|
-
onFileUpload:
|
|
2398
|
-
"button-label": t(
|
|
2399
|
-
},
|
|
2400
|
-
|
|
2403
|
+
label: Ft,
|
|
2404
|
+
onFileUpload: y[3] || (y[3] = (D) => i.value = D),
|
|
2405
|
+
"button-label": t(w)("inventory.ingredient.import.selectFile")
|
|
2406
|
+
}, Ut({ _: 2 }, [
|
|
2407
|
+
i.value ? {
|
|
2401
2408
|
name: "default",
|
|
2402
2409
|
fn: A(({ openFileDialog: D }) => [
|
|
2403
|
-
|
|
2410
|
+
v(X, null, {
|
|
2404
2411
|
default: A(() => [
|
|
2405
|
-
Pe(E(
|
|
2412
|
+
Pe(E(Ft))
|
|
2406
2413
|
]),
|
|
2407
2414
|
_: 1
|
|
2408
2415
|
}),
|
|
2409
2416
|
l("div", xo, [
|
|
2410
2417
|
l("div", {
|
|
2411
|
-
class:
|
|
2418
|
+
class: J([
|
|
2412
2419
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
2413
2420
|
{
|
|
2414
|
-
"border border-fm-color-neutral-gray-100":
|
|
2415
|
-
"border border-fm-color-neutral-gray-200": !
|
|
2416
|
-
"border border-fm-color-system-error-200":
|
|
2421
|
+
"border border-fm-color-neutral-gray-100": b.value,
|
|
2422
|
+
"border border-fm-color-neutral-gray-200": !b.value && !r.value,
|
|
2423
|
+
"border border-fm-color-system-error-200": r.value
|
|
2417
2424
|
}
|
|
2418
2425
|
])
|
|
2419
2426
|
}, [
|
|
2420
|
-
|
|
2427
|
+
b.value ? (k(), se(Z, {
|
|
2421
2428
|
key: 0,
|
|
2422
2429
|
size: "md",
|
|
2423
2430
|
color: "neutral-gray-200"
|
|
2424
|
-
})) : (
|
|
2431
|
+
})) : (k(), se(N, {
|
|
2425
2432
|
key: 1,
|
|
2426
|
-
name:
|
|
2433
|
+
name: r.value ? "error" : "attach_file",
|
|
2427
2434
|
outline: "",
|
|
2428
|
-
color:
|
|
2435
|
+
color: r.value ? "system-error-300" : void 0
|
|
2429
2436
|
}, null, 8, ["name", "color"])),
|
|
2430
2437
|
l("div", {
|
|
2431
|
-
class:
|
|
2438
|
+
class: J([
|
|
2432
2439
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
2433
2440
|
{
|
|
2434
|
-
"text-fm-color-typo-disabled":
|
|
2435
|
-
"text-fm-color-typo-primary": !
|
|
2441
|
+
"text-fm-color-typo-disabled": b.value,
|
|
2442
|
+
"text-fm-color-typo-primary": !b.value
|
|
2436
2443
|
}
|
|
2437
2444
|
])
|
|
2438
2445
|
}, [
|
|
2439
|
-
l("div", Co, E(
|
|
2446
|
+
l("div", Co, E(i.value.name), 1)
|
|
2440
2447
|
], 2),
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
label: t(
|
|
2444
|
-
variant:
|
|
2445
|
-
"prepend-icon":
|
|
2448
|
+
b.value ? K("", !0) : (k(), T("div", So, [
|
|
2449
|
+
v(P, {
|
|
2450
|
+
label: t(w)("inventory.ingredient.import.replaceFile"),
|
|
2451
|
+
variant: r.value ? "destructive" : "secondary",
|
|
2452
|
+
"prepend-icon": r.value ? void 0 : "autorenew",
|
|
2446
2453
|
onClick: D
|
|
2447
2454
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
2448
2455
|
]))
|
|
2449
2456
|
], 2),
|
|
2450
|
-
|
|
2451
|
-
(
|
|
2457
|
+
f.value.length ? (k(), T("div", wo, [
|
|
2458
|
+
(k(!0), T(re, null, xe(f.value, (q, L) => (k(), T("div", {
|
|
2452
2459
|
key: L,
|
|
2453
2460
|
class: "flex gap-8 items-center"
|
|
2454
2461
|
}, [
|
|
2455
|
-
|
|
2462
|
+
v(N, {
|
|
2456
2463
|
name: "error",
|
|
2457
2464
|
size: "sm",
|
|
2458
2465
|
color: "system-error-300"
|
|
@@ -2465,9 +2472,9 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2465
2472
|
key: "0"
|
|
2466
2473
|
} : void 0
|
|
2467
2474
|
]), 1032, ["class", "button-label"]),
|
|
2468
|
-
|
|
2469
|
-
l("div", $o, E(t(
|
|
2470
|
-
(
|
|
2475
|
+
i.value ? (k(), T("div", Io, [
|
|
2476
|
+
l("div", $o, E(t(w)("inventory.ingredient.import.summary")), 1),
|
|
2477
|
+
(k(!0), T(re, null, xe(s.value, (D, q) => (k(), se(go, {
|
|
2471
2478
|
key: q,
|
|
2472
2479
|
name: `Transfer Note ${q + 1}`,
|
|
2473
2480
|
items: D.poItems,
|
|
@@ -2488,38 +2495,38 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2488
2495
|
show: { type: Boolean }
|
|
2489
2496
|
},
|
|
2490
2497
|
emits: ["update:show", "submitted"],
|
|
2491
|
-
setup(
|
|
2492
|
-
const d =
|
|
2493
|
-
|
|
2498
|
+
setup(p, { expose: g, emit: i }) {
|
|
2499
|
+
const d = i, o = Pt(p, "show"), h = Re(), x = ct(), I = U(!1), m = U(), e = U();
|
|
2500
|
+
g({
|
|
2494
2501
|
validateInputs: () => {
|
|
2495
|
-
var s,
|
|
2496
|
-
(
|
|
2502
|
+
var s, r;
|
|
2503
|
+
(r = (s = m.value) == null ? void 0 : s.validateInputs) == null || r.call(s);
|
|
2497
2504
|
},
|
|
2498
2505
|
resetInputsValidation: () => {
|
|
2499
|
-
var s,
|
|
2500
|
-
(
|
|
2506
|
+
var s, r;
|
|
2507
|
+
(r = (s = m.value) == null ? void 0 : s.resetInputsValidation) == null || r.call(s);
|
|
2501
2508
|
},
|
|
2502
2509
|
resetInputs: () => {
|
|
2503
|
-
var s,
|
|
2504
|
-
(
|
|
2510
|
+
var s, r;
|
|
2511
|
+
(r = (s = m.value) == null ? void 0 : s.resetInputs) == null || r.call(s);
|
|
2505
2512
|
}
|
|
2506
2513
|
});
|
|
2507
2514
|
function n() {
|
|
2508
|
-
var s,
|
|
2509
|
-
(
|
|
2515
|
+
var s, r;
|
|
2516
|
+
(r = (s = m.value) == null ? void 0 : s.validateInputs) == null || r.call(s);
|
|
2510
2517
|
}
|
|
2511
|
-
async function
|
|
2512
|
-
var
|
|
2513
|
-
if (!((u = (
|
|
2514
|
-
|
|
2518
|
+
async function f() {
|
|
2519
|
+
var r, u, w, $, c;
|
|
2520
|
+
if (!((u = (r = e.value) == null ? void 0 : r.supplier) != null && u.name)) {
|
|
2521
|
+
h.open({
|
|
2515
2522
|
title: "Upload failed",
|
|
2516
2523
|
message: "Location is required",
|
|
2517
2524
|
type: "error"
|
|
2518
2525
|
});
|
|
2519
2526
|
return;
|
|
2520
2527
|
}
|
|
2521
|
-
if (!((
|
|
2522
|
-
|
|
2528
|
+
if (!((w = e.value) != null && w.items) || ((c = ($ = e.value) == null ? void 0 : $.items) == null ? void 0 : c.length) === 0) {
|
|
2529
|
+
h.open({
|
|
2523
2530
|
title: "Upload failed",
|
|
2524
2531
|
message: "No data to upload",
|
|
2525
2532
|
type: "error"
|
|
@@ -2528,7 +2535,7 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2528
2535
|
}
|
|
2529
2536
|
const s = e.value.effectiveAt ? new Date(e.value.effectiveAt) : null;
|
|
2530
2537
|
if (!s) {
|
|
2531
|
-
|
|
2538
|
+
h.open({
|
|
2532
2539
|
title: "Invalid date",
|
|
2533
2540
|
message: "Transfer date is required",
|
|
2534
2541
|
type: "error"
|
|
@@ -2536,7 +2543,7 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2536
2543
|
return;
|
|
2537
2544
|
}
|
|
2538
2545
|
if (s.getTime() > (/* @__PURE__ */ new Date()).getTime()) {
|
|
2539
|
-
|
|
2546
|
+
h.open({
|
|
2540
2547
|
title: "Invalid date",
|
|
2541
2548
|
message: "Transfer date cannot be in the future",
|
|
2542
2549
|
type: "error"
|
|
@@ -2545,39 +2552,39 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2545
2552
|
}
|
|
2546
2553
|
I.value = !0;
|
|
2547
2554
|
try {
|
|
2548
|
-
await
|
|
2549
|
-
} catch (
|
|
2550
|
-
await new Promise((
|
|
2555
|
+
await x.importFromXilnex(e.value), d("update:show", !1);
|
|
2556
|
+
} catch (y) {
|
|
2557
|
+
await new Promise((F) => setTimeout(F, 1e3)), h.open({
|
|
2551
2558
|
title: "Upload failed",
|
|
2552
|
-
message:
|
|
2559
|
+
message: y == null ? void 0 : y.message,
|
|
2553
2560
|
type: "error"
|
|
2554
2561
|
});
|
|
2555
2562
|
} finally {
|
|
2556
2563
|
I.value = !1;
|
|
2557
2564
|
}
|
|
2558
2565
|
}
|
|
2559
|
-
return (s,
|
|
2560
|
-
const u = V("FmSpacer"),
|
|
2561
|
-
return
|
|
2566
|
+
return (s, r) => {
|
|
2567
|
+
const u = V("FmSpacer"), w = V("FmButton"), $ = V("FmDialog");
|
|
2568
|
+
return k(), se($, {
|
|
2562
2569
|
modelValue: t(o),
|
|
2563
|
-
"onUpdate:modelValue":
|
|
2570
|
+
"onUpdate:modelValue": r[2] || (r[2] = (c) => Se(o) ? o.value = c : null),
|
|
2564
2571
|
overlay: !0,
|
|
2565
2572
|
"close-button": !1
|
|
2566
2573
|
}, {
|
|
2567
|
-
"dialog-header": A(() =>
|
|
2574
|
+
"dialog-header": A(() => r[3] || (r[3] = [
|
|
2568
2575
|
l("div", null, "Xilnex transfer order", -1)
|
|
2569
2576
|
])),
|
|
2570
2577
|
"dialog-footer": A(() => [
|
|
2571
|
-
|
|
2572
|
-
|
|
2578
|
+
v(u, { class: "sm:hidden xs:hidden" }),
|
|
2579
|
+
v(w, {
|
|
2573
2580
|
disabled: I.value,
|
|
2574
2581
|
class: "sm:w-full xs:w-full",
|
|
2575
2582
|
label: "Cancel",
|
|
2576
2583
|
size: "md",
|
|
2577
2584
|
variant: "tertiary",
|
|
2578
|
-
onClick:
|
|
2585
|
+
onClick: r[1] || (r[1] = (c) => d("update:show", !1))
|
|
2579
2586
|
}, null, 8, ["disabled"]),
|
|
2580
|
-
|
|
2587
|
+
v(w, {
|
|
2581
2588
|
disabled: I.value,
|
|
2582
2589
|
loading: I.value,
|
|
2583
2590
|
class: "sm:w-full xs:w-full",
|
|
@@ -2589,12 +2596,12 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2589
2596
|
]),
|
|
2590
2597
|
default: A(() => [
|
|
2591
2598
|
l("div", To, [
|
|
2592
|
-
|
|
2599
|
+
v(Do, {
|
|
2593
2600
|
ref_key: "formRef",
|
|
2594
|
-
ref:
|
|
2595
|
-
onValidationSuccess:
|
|
2601
|
+
ref: m,
|
|
2602
|
+
onValidationSuccess: f,
|
|
2596
2603
|
modelValue: e.value,
|
|
2597
|
-
"onUpdate:modelValue":
|
|
2604
|
+
"onUpdate:modelValue": r[0] || (r[0] = (c) => e.value = c)
|
|
2598
2605
|
}, null, 8, ["modelValue"])
|
|
2599
2606
|
])
|
|
2600
2607
|
]),
|
|
@@ -2605,60 +2612,60 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2605
2612
|
}), Po = { class: "flex flex-col py-8" }, Ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Ao = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Eo = {
|
|
2606
2613
|
key: 0,
|
|
2607
2614
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
2608
|
-
}, Mo = { class: "pt-8" },
|
|
2615
|
+
}, Mo = { class: "pt-8" }, It = "ReceiveRequestViewSearchCriteria", pn = /* @__PURE__ */ de({
|
|
2609
2616
|
__name: "ReceiveRequestView",
|
|
2610
|
-
setup(
|
|
2611
|
-
const { t:
|
|
2612
|
-
|
|
2613
|
-
name:
|
|
2614
|
-
startDate:
|
|
2615
|
-
endDate:
|
|
2617
|
+
setup(p) {
|
|
2618
|
+
const { t: g } = he(), i = Re();
|
|
2619
|
+
Ke.object({
|
|
2620
|
+
name: Ke.string().optional().nullable(),
|
|
2621
|
+
startDate: Ke.string().optional().nullable(),
|
|
2622
|
+
endDate: Ke.string().optional().nullable()
|
|
2616
2623
|
});
|
|
2617
2624
|
const d = M(
|
|
2618
|
-
() => !
|
|
2619
|
-
),
|
|
2620
|
-
function
|
|
2621
|
-
const
|
|
2625
|
+
() => !f._currentLocation || e.loading.value
|
|
2626
|
+
), b = rs(), o = et(), h = Ne();
|
|
2627
|
+
function x() {
|
|
2628
|
+
const N = {
|
|
2622
2629
|
name: "",
|
|
2623
|
-
...
|
|
2624
|
-
}, P =
|
|
2630
|
+
...xt()
|
|
2631
|
+
}, P = b.getItem(It);
|
|
2625
2632
|
if (!P)
|
|
2626
|
-
return
|
|
2633
|
+
return N;
|
|
2627
2634
|
try {
|
|
2628
2635
|
return JSON.parse(P);
|
|
2629
2636
|
} catch {
|
|
2630
|
-
return
|
|
2637
|
+
return N;
|
|
2631
2638
|
}
|
|
2632
2639
|
}
|
|
2633
2640
|
function I() {
|
|
2634
|
-
|
|
2641
|
+
b.setItem(It, JSON.stringify(m.value));
|
|
2635
2642
|
}
|
|
2636
|
-
const
|
|
2643
|
+
const m = U(x()), e = Jt(
|
|
2637
2644
|
at.RECEIVE_REQUEST,
|
|
2638
|
-
|
|
2645
|
+
m.value
|
|
2639
2646
|
), { columnDefs: n } = Gt(
|
|
2640
2647
|
at.RECEIVE_REQUEST,
|
|
2641
2648
|
e,
|
|
2642
2649
|
e.shipments
|
|
2643
|
-
),
|
|
2650
|
+
), f = Je();
|
|
2644
2651
|
async function s() {
|
|
2645
|
-
const
|
|
2652
|
+
const N = `inventory-record_${Ct(m.value.startDate).format("DD-MM-YYYY_HH-mm")}-${Ct(m.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, P = e.purchaseOrders.value.flatMap(
|
|
2646
2653
|
(D) => D.items.map((q) => {
|
|
2647
2654
|
var H;
|
|
2648
|
-
const L = new Date(ns(D._id) ?? ""),
|
|
2649
|
-
|
|
2650
|
-
),
|
|
2655
|
+
const L = new Date(ns(D._id) ?? ""), W = D.effectiveAt ? new Date(D.effectiveAt) : void 0, ae = we(
|
|
2656
|
+
ts(q.sku, D.deliveryOrder || [])
|
|
2657
|
+
), S = we(q.quantity), C = ((H = q == null ? void 0 : q.measurement) == null ? void 0 : H.abbrev) || q.sku.unit.abbrev;
|
|
2651
2658
|
return {
|
|
2652
2659
|
"SKU code": q.code,
|
|
2653
2660
|
"SKU name": q.name,
|
|
2654
2661
|
"PO #": D.seqNumber,
|
|
2655
|
-
"Effective at":
|
|
2662
|
+
"Effective at": W,
|
|
2656
2663
|
Date: L,
|
|
2657
2664
|
Status: D.status,
|
|
2658
2665
|
Reference: D.ref ?? "",
|
|
2659
2666
|
"Received quantity": ae,
|
|
2660
|
-
"Ordered quantity":
|
|
2661
|
-
Unit:
|
|
2667
|
+
"Ordered quantity": S,
|
|
2668
|
+
Unit: C,
|
|
2662
2669
|
"Total cost": q.totalCost ? Ze(q.totalCost) : null
|
|
2663
2670
|
};
|
|
2664
2671
|
})
|
|
@@ -2681,26 +2688,26 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2681
2688
|
columns: R
|
|
2682
2689
|
}
|
|
2683
2690
|
],
|
|
2684
|
-
|
|
2685
|
-
),
|
|
2686
|
-
title:
|
|
2687
|
-
message:
|
|
2691
|
+
N
|
|
2692
|
+
), i.open({
|
|
2693
|
+
title: g("inventory.transfer.receiveRequest.export.success"),
|
|
2694
|
+
message: g("inventory.transfer.receiveRequest.export.message", [N]),
|
|
2688
2695
|
type: "success"
|
|
2689
2696
|
});
|
|
2690
2697
|
}
|
|
2691
|
-
const
|
|
2692
|
-
_e([() =>
|
|
2693
|
-
!
|
|
2694
|
-
|
|
2695
|
-
|
|
2698
|
+
const r = U(xt()), u = U("");
|
|
2699
|
+
_e([() => r.value], ([N]) => {
|
|
2700
|
+
!N.startDate || !N.endDate || (m.value.startDate = N.startDate, m.value.endDate = N.endDate, e.updateDateRange(
|
|
2701
|
+
m.value.startDate,
|
|
2702
|
+
m.value.endDate
|
|
2696
2703
|
), I());
|
|
2697
2704
|
}), _e([() => u.value], () => {
|
|
2698
2705
|
I();
|
|
2699
2706
|
});
|
|
2700
|
-
function
|
|
2701
|
-
if (
|
|
2707
|
+
function w(N) {
|
|
2708
|
+
if (N === "create") {
|
|
2702
2709
|
if (d.value) {
|
|
2703
|
-
|
|
2710
|
+
i.open({
|
|
2704
2711
|
title: "Loading data...",
|
|
2705
2712
|
message: "Please wait.",
|
|
2706
2713
|
type: "info"
|
|
@@ -2709,36 +2716,36 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2709
2716
|
}
|
|
2710
2717
|
return e.promptCreateTransferDialog();
|
|
2711
2718
|
}
|
|
2712
|
-
if (
|
|
2719
|
+
if (N === "upload" && o.enableXilnexTransferNote)
|
|
2713
2720
|
return e.promptUploadTransferDialog();
|
|
2714
|
-
if (
|
|
2721
|
+
if (N === "refresh")
|
|
2715
2722
|
return e.fetchData();
|
|
2716
|
-
if (
|
|
2723
|
+
if (N === "export")
|
|
2717
2724
|
return s();
|
|
2718
2725
|
}
|
|
2719
|
-
const { breakpoints:
|
|
2726
|
+
const { breakpoints: $ } = it(), c = M(() => $.value.xs || $.value.sm), y = M(() => c.value ? 10 : 20), F = is(), B = M(() => [
|
|
2720
2727
|
{
|
|
2721
|
-
label:
|
|
2728
|
+
label: g("inventory.transfer.receiveRequest.actions.create"),
|
|
2722
2729
|
value: "create",
|
|
2723
2730
|
isPrimary: !0,
|
|
2724
2731
|
prependIcon: "add"
|
|
2725
2732
|
},
|
|
2726
2733
|
...o.enableXilnexTransferNote ? [
|
|
2727
2734
|
{
|
|
2728
|
-
label:
|
|
2735
|
+
label: g("inventory.common.upload"),
|
|
2729
2736
|
value: "upload"
|
|
2730
2737
|
}
|
|
2731
2738
|
] : [],
|
|
2732
2739
|
{
|
|
2733
|
-
label:
|
|
2740
|
+
label: g("inventory.common.refresh"),
|
|
2734
2741
|
value: "refresh"
|
|
2735
2742
|
},
|
|
2736
2743
|
{
|
|
2737
|
-
label:
|
|
2744
|
+
label: g("inventory.common.export"),
|
|
2738
2745
|
value: "export"
|
|
2739
2746
|
}
|
|
2740
2747
|
]), z = M(() => {
|
|
2741
|
-
const
|
|
2748
|
+
const N = [
|
|
2742
2749
|
{
|
|
2743
2750
|
type: "string",
|
|
2744
2751
|
key: "status",
|
|
@@ -2776,11 +2783,11 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2776
2783
|
}).filter((R) => R != null)
|
|
2777
2784
|
}
|
|
2778
2785
|
];
|
|
2779
|
-
return [...
|
|
2780
|
-
}),
|
|
2781
|
-
if (!
|
|
2786
|
+
return [...N, ...h.isEnabled ? P : []];
|
|
2787
|
+
}), Z = U(null), X = M(() => {
|
|
2788
|
+
if (!Z.value)
|
|
2782
2789
|
return e.purchaseOrders.value;
|
|
2783
|
-
const
|
|
2790
|
+
const N = Ts.build(Z.value);
|
|
2784
2791
|
return e.purchaseOrders.value.filter((P) => {
|
|
2785
2792
|
var R, D, q, L;
|
|
2786
2793
|
return Vs(
|
|
@@ -2790,84 +2797,84 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2790
2797
|
netsuiteOrderId: (L = P.netSuite) == null ? void 0 : L.id,
|
|
2791
2798
|
status: P.status
|
|
2792
2799
|
},
|
|
2793
|
-
|
|
2800
|
+
N
|
|
2794
2801
|
);
|
|
2795
2802
|
});
|
|
2796
2803
|
});
|
|
2797
|
-
return (
|
|
2804
|
+
return (N, P) => {
|
|
2798
2805
|
const R = V("FmTable");
|
|
2799
|
-
return
|
|
2800
|
-
title: t(
|
|
2806
|
+
return k(), se(us, {
|
|
2807
|
+
title: t(g)("inventory.transfer.receiveRequest.title2"),
|
|
2801
2808
|
actions: B.value,
|
|
2802
|
-
"onClick:action":
|
|
2809
|
+
"onClick:action": w
|
|
2803
2810
|
}, {
|
|
2804
2811
|
default: A(() => {
|
|
2805
2812
|
var D, q;
|
|
2806
2813
|
return [
|
|
2807
2814
|
l("div", {
|
|
2808
|
-
class:
|
|
2815
|
+
class: J([
|
|
2809
2816
|
"flex flex-col gap-8 max-h-full",
|
|
2810
2817
|
{
|
|
2811
|
-
"p-0":
|
|
2812
|
-
"px-24 ": !
|
|
2818
|
+
"p-0": c.value,
|
|
2819
|
+
"px-24 ": !c.value
|
|
2813
2820
|
}
|
|
2814
2821
|
])
|
|
2815
2822
|
}, [
|
|
2816
|
-
|
|
2823
|
+
v(Wt, {
|
|
2817
2824
|
"date-range-query": "",
|
|
2818
|
-
"date-range":
|
|
2819
|
-
"onUpdate:dateRange": P[0] || (P[0] = (L) =>
|
|
2825
|
+
"date-range": r.value,
|
|
2826
|
+
"onUpdate:dateRange": P[0] || (P[0] = (L) => r.value = L),
|
|
2820
2827
|
searchable: "",
|
|
2821
2828
|
"change-location": "",
|
|
2822
2829
|
search: u.value,
|
|
2823
2830
|
"onUpdate:search": P[1] || (P[1] = (L) => u.value = L),
|
|
2824
2831
|
filterable: "",
|
|
2825
2832
|
"filter-attributes": z.value,
|
|
2826
|
-
filter:
|
|
2827
|
-
"onUpdate:filter": P[2] || (P[2] = (L) =>
|
|
2833
|
+
filter: Z.value,
|
|
2834
|
+
"onUpdate:filter": P[2] || (P[2] = (L) => Z.value = L)
|
|
2828
2835
|
}, null, 8, ["date-range", "search", "filter-attributes", "filter"]),
|
|
2829
|
-
(
|
|
2830
|
-
style:
|
|
2836
|
+
(k(), se(R, {
|
|
2837
|
+
style: Dt(t(F).tableHeight),
|
|
2831
2838
|
"column-defs": t(n),
|
|
2832
|
-
"row-data":
|
|
2839
|
+
"row-data": X.value,
|
|
2833
2840
|
"search-value": u.value,
|
|
2834
2841
|
loading: d.value,
|
|
2835
2842
|
onRowClick: P[3] || (P[3] = (L) => t(e).promptShowTransferDetails(L.original)),
|
|
2836
|
-
key: (D = t(
|
|
2837
|
-
"page-size":
|
|
2843
|
+
key: (D = t(f)._currentLocation) == null ? void 0 : D.dbName,
|
|
2844
|
+
"page-size": y.value
|
|
2838
2845
|
}, {
|
|
2839
2846
|
"list-row": A((L) => [
|
|
2840
|
-
|
|
2847
|
+
v(Rt, {
|
|
2841
2848
|
row: L,
|
|
2842
2849
|
onRowClick: t(e).promptShowTransferDetails
|
|
2843
2850
|
}, {
|
|
2844
|
-
default: A((
|
|
2845
|
-
var ae,
|
|
2851
|
+
default: A((W) => {
|
|
2852
|
+
var ae, S, C, H, fe, ce, G, Fe, Ie, Be, ze, tt, Le, Ce, Oe, a, _, Y, le, ye;
|
|
2846
2853
|
return [
|
|
2847
2854
|
l("div", Po, [
|
|
2848
2855
|
l("div", Ro, [
|
|
2849
|
-
|
|
2850
|
-
render: (
|
|
2851
|
-
props: (fe = (H =
|
|
2856
|
+
v(t(ve), {
|
|
2857
|
+
render: (C = (S = (ae = W._id) == null ? void 0 : ae.column) == null ? void 0 : S.columnDef) == null ? void 0 : C.cell,
|
|
2858
|
+
props: (fe = (H = W._id) == null ? void 0 : H.getContext) == null ? void 0 : fe.call(H)
|
|
2852
2859
|
}, null, 8, ["render", "props"])
|
|
2853
2860
|
]),
|
|
2854
2861
|
l("div", Oo, [
|
|
2855
|
-
|
|
2856
|
-
render: (Fe = (G = (ce =
|
|
2857
|
-
props: (
|
|
2862
|
+
v(t(ve), {
|
|
2863
|
+
render: (Fe = (G = (ce = W.supplier_name) == null ? void 0 : ce.column) == null ? void 0 : G.columnDef) == null ? void 0 : Fe.cell,
|
|
2864
|
+
props: (Be = (Ie = W.supplier_name) == null ? void 0 : Ie.getContext) == null ? void 0 : Be.call(Ie)
|
|
2858
2865
|
}, null, 8, ["render", "props"])
|
|
2859
2866
|
]),
|
|
2860
2867
|
l("div", Ao, E(L.original.items.map(($e) => `${$e.name}`).join(", ")), 1),
|
|
2861
|
-
L.original.ref ? (
|
|
2862
|
-
|
|
2863
|
-
render: (
|
|
2864
|
-
props: (Oe = (Ce =
|
|
2868
|
+
L.original.ref ? (k(), T("div", Eo, [
|
|
2869
|
+
v(t(ve), {
|
|
2870
|
+
render: (Le = (tt = (ze = W.ref) == null ? void 0 : ze.column) == null ? void 0 : tt.columnDef) == null ? void 0 : Le.cell,
|
|
2871
|
+
props: (Oe = (Ce = W.ref) == null ? void 0 : Ce.getContext) == null ? void 0 : Oe.call(Ce)
|
|
2865
2872
|
}, null, 8, ["render", "props"])
|
|
2866
2873
|
])) : K("", !0),
|
|
2867
2874
|
l("div", Mo, [
|
|
2868
|
-
|
|
2869
|
-
render: (Y = (_ = (a =
|
|
2870
|
-
props: (ye = (le =
|
|
2875
|
+
v(t(ve), {
|
|
2876
|
+
render: (Y = (_ = (a = W.status) == null ? void 0 : a.column) == null ? void 0 : _.columnDef) == null ? void 0 : Y.cell,
|
|
2877
|
+
props: (ye = (le = W.status) == null ? void 0 : le.getContext) == null ? void 0 : ye.call(le)
|
|
2871
2878
|
}, null, 8, ["render", "props"])
|
|
2872
2879
|
])
|
|
2873
2880
|
])
|
|
@@ -2879,11 +2886,11 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2879
2886
|
_: 1
|
|
2880
2887
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2881
2888
|
], 2),
|
|
2882
|
-
(
|
|
2883
|
-
|
|
2889
|
+
(k(), se(Nt, { to: "body" }, [
|
|
2890
|
+
v(so, nt(t(e).transferDialogProps.value, {
|
|
2884
2891
|
onSubmitted: t(e).fetchData
|
|
2885
2892
|
}), null, 16, ["onSubmitted"]),
|
|
2886
|
-
|
|
2893
|
+
v(es, nt({
|
|
2887
2894
|
scope: t(at).RECEIVE_REQUEST
|
|
2888
2895
|
}, {
|
|
2889
2896
|
...t(e).transferDetailsProps.value,
|
|
@@ -2892,7 +2899,7 @@ const no = { class: "flex flex-col flex-1" }, lo = { class: "flex flex-col" }, r
|
|
|
2892
2899
|
}, {
|
|
2893
2900
|
onSubmitted: t(e).fetchData
|
|
2894
2901
|
}), null, 16, ["scope", "onSubmitted"]),
|
|
2895
|
-
|
|
2902
|
+
v(Vo, Bt(zt(t(e).xilnexImportDialogProps.value)), null, 16)
|
|
2896
2903
|
]))
|
|
2897
2904
|
];
|
|
2898
2905
|
}),
|