@feedmepos/mf-inventory-portal 1.0.36 → 1.0.37-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-BM-ivBnF.js → App-_SMozUEj.js} +1 -1
- package/dist/{ApprovalView-C4hE43Zp.js → ApprovalView-D55iBGg5.js} +19 -19
- package/dist/{BindingsDialog-BqjiXxGY.js → BindingsDialog-Di_xTPkA.js} +4 -4
- package/dist/{BindingsPicker-DqCR7P5k.js → BindingsPicker-BwIKt9Il.js} +1 -1
- package/dist/{BindingsTable-DD_mVBtS.js → BindingsTable-CMFvNSAH.js} +4 -4
- package/dist/{ClosingDraftView-CL09Xu9q.js → ClosingDraftView-DXoi5cw9.js} +26 -26
- package/dist/ClosingTemplateView-DaPOj50P.js +1849 -0
- package/dist/{DeliveryOrderPrintPreview-CNPUHnpX.js → DeliveryOrderPrintPreview-CkIPZo14.js} +4 -4
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DB6m8oSF.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSzt53-l.js} +11 -11
- package/dist/{FmMultiselectDialog-DJ5cyN7G.js → FmMultiselectDialog-EpV0X6CI.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CPAnSCWa.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Cn3qOqJr.js} +21 -21
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CauBVtK9.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BUQQL5kL.js} +1 -1
- package/dist/{IngredientGroupView-D0U1ivRz.js → IngredientGroupView-DvxOGAuo.js} +2 -2
- package/dist/IngredientsView-BhFDYfnd.js +1851 -0
- package/dist/{IntegrationView-hERgFYsT.js → IntegrationView-B_EmS2-x.js} +69 -69
- package/dist/{InventoryBindingForm-vO00BnZP.js → InventoryBindingForm-B79lRAe6.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bku7tdc-.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DBsD7abQ.js} +24 -24
- package/dist/{InventoryBindingSummary-DWOniuG6.js → InventoryBindingSummary-CmnSXYAW.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C4_atZsW.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CDRN_Nrk.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DUdI1WOL.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BknocD4_.js} +10 -10
- package/dist/{PublishView-enVS6QHQ.js → PublishView-DNkUYpMh.js} +17 -17
- package/dist/{PurchaseOrderPrintPreview-Z769Yvkh.js → PurchaseOrderPrintPreview-D0UhIY8z.js} +12 -12
- package/dist/{ReceiveRequestView-BYYWrgNX.js → ReceiveRequestView-DsBpjA9P.js} +797 -782
- package/dist/{RecipeView-CU9pkFiv.js → RecipeView-lpMLqWM8.js} +3 -3
- package/dist/{StockView-iqR-h1Mg.js → StockView-CIgg_FTJ.js} +6 -6
- package/dist/{SupplierView-DFzgQ53O.js → SupplierView-fwzviqqM.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BEVlutvf.js → TransferDetails.vue_vue_type_script_setup_true_lang-TYNgMCEs.js} +604 -602
- package/dist/{TransferTemplateView-EZ_z14kY.js → TransferTemplateView-CSy8pydr.js} +83 -83
- package/dist/{UnitView-gYD75UdW.js → UnitView-CMOz7RLY.js} +3 -3
- package/dist/{WarehouseView-COLgYw-j.js → WarehouseView-B-1c6rRg.js} +1 -1
- package/dist/api/duplicate-template.d.ts +5 -0
- package/dist/api/inventory.d.ts +4 -0
- package/dist/api/netsuite.d.ts +7 -0
- package/dist/{app-DMbkakEB.js → app-CFm28RQ_.js} +53154 -52645
- package/dist/app.d.ts +9 -0
- package/dist/app.js +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -0
- package/dist/components/row-action.enum.d.ts +2 -1
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -0
- package/dist/{decimal-BLjZMddB.js → decimal-UyI93Y1E.js} +1 -1
- package/dist/format-unit-display-CNki_g8Q.js +1275 -0
- package/dist/{index-C5rv3Yu2.js → index-BWYshfa3.js} +1 -1
- package/dist/{index-Bj0hlHvy.js → index-DliBh-3z.js} +1 -1
- package/dist/{stock-DjOpPBxG.js → stock-A60nU_aj.js} +1 -1
- package/dist/stores/integration/netsuite.d.ts +7 -1
- package/dist/stores/inventory.d.ts +9 -0
- package/dist/{supplier-BRKfl2V3.js → supplier-lcKFLaW5.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DRIWNN3P.js → use-ingredient-select-dialog-B17VDJ0o.js} +1 -1
- package/dist/{use-inventory-binding-dialog-DLnKkFpe.js → use-inventory-binding-dialog-sj5lERBj.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +4 -1
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -0
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +24 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -0
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +16 -1
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +12 -0
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -0
- package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +2 -0
- package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +4 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +17 -0
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +4 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -0
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +4 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +24 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +24 -0
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +1 -0
- package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +3 -0
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +16 -1
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +12 -0
- package/dist/{vue-i18n-x8-PdKzv.js → vue-i18n-CZSieSF0.js} +487 -487
- package/package.json +4 -4
- package/dist/ClosingTemplateView-CDWMdZOk.js +0 -1804
- package/dist/IngredientsView-pgJWthql.js +0 -1838
- package/dist/format-unit-display-BkXJg2Ux.js +0 -1230
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { reactive as bt, onMounted as Qe, watch as _e, computed as
|
|
2
|
-
import { b as Me, Q as _t, c as We, m as Oe, j as Ce, a7 as je, T as Pt,
|
|
3
|
-
import { u as tt, a as
|
|
4
|
-
import { _ as Ct, u as
|
|
5
|
-
import { u as
|
|
6
|
-
import { useBreakpoints as st, components as ge, FmButtonVariant as
|
|
7
|
-
import { P as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { c as $e, u as
|
|
1
|
+
import { reactive as bt, onMounted as Qe, watch as _e, computed as N, h as L, defineComponent as ce, openBlock as S, createElementBlock as T, Fragment as de, renderList as Se, createElementVNode as n, toDisplayString as q, unref as s, resolveComponent as I, createVNode as b, withCtx as R, createCommentVNode as j, ref as M, createBlock as G, normalizeClass as Z, normalizeStyle as gt, createTextVNode as Ie, nextTick as $t, mergeProps as Ze, isRef as xe, createSlots as It, Teleport as Tt, normalizeProps as Dt, guardReactiveProps as Vt } from "vue";
|
|
2
|
+
import { b as Me, Q as _t, c as We, m as Oe, j as Ce, a7 as je, T as Pt, av as Rt, A as qe, M as At, n as ht, ae as Ge, G as fe, an as Et, aw as Ot, ax as qt, ay as Mt, K as kt, u as Je, a as et, az as Ut, aA as Nt, a6 as Bt, a0 as zt, aB as Lt, E as xt, a2 as Ht, e as Ee, aC as jt, x as Qt, y as Yt, z as Kt, aD as He, a8 as pt, B as Xt, N as Zt, H as Wt, _ as Gt, C as Jt, W as ft } from "./app-CFm28RQ_.js";
|
|
3
|
+
import { u as tt, a as es, P as Xe, b as ts, _ as ss, g as os } from "./TransferDetails.vue_vue_type_script_setup_true_lang-TYNgMCEs.js";
|
|
4
|
+
import { _ as Ct, u as as, i as ns, e as ls } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BknocD4_.js";
|
|
5
|
+
import { u as rs } from "./useTabStorage-BkIVScW_.js";
|
|
6
|
+
import { useBreakpoints as st, components as ge, FmButtonVariant as is, useSnackbar as Te, useDialog as us, useProxiedModel as St } from "@feedmepos/ui-library";
|
|
7
|
+
import { P as ne, u as wt } from "./format-unit-display-CNki_g8Q.js";
|
|
8
|
+
import { _ as ds, F as cs, a as ms, b as ps } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-Cn3qOqJr.js";
|
|
9
|
+
import { c as $e, u as fs, _ as vs } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSzt53-l.js";
|
|
10
10
|
import { useI18n as he } from "@feedmepos/mf-common";
|
|
11
|
-
import "./FmMultiselectDialog-
|
|
12
|
-
import { u as ot } from "./supplier-
|
|
13
|
-
import { _ as
|
|
14
|
-
import { u as
|
|
11
|
+
import "./FmMultiselectDialog-EpV0X6CI.js";
|
|
12
|
+
import { u as ot } from "./supplier-lcKFLaW5.js";
|
|
13
|
+
import { _ as ys } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
14
|
+
import { u as bs } from "./vue-i18n-CZSieSF0.js";
|
|
15
15
|
import "./array-Ca8T3f_G.js";
|
|
16
16
|
var J = /* @__PURE__ */ ((g) => (g.Code = "Code", g.Name = "Name", g.TemplateName = "TemplateName", g.Amount = "Amount", g.Cost = "Cost", g.TotalCost = "TotalCost", g.Delete = "Delete", g))(J || {});
|
|
17
|
-
const
|
|
17
|
+
const gs = () => (he(), L(
|
|
18
18
|
Ct,
|
|
19
19
|
{
|
|
20
20
|
zIndex: 50,
|
|
@@ -22,40 +22,40 @@ const bs = () => (he(), L(
|
|
|
22
22
|
},
|
|
23
23
|
`Total (${ht()})`
|
|
24
24
|
));
|
|
25
|
-
function
|
|
26
|
-
const { t: w } = he(),
|
|
25
|
+
function _s(g) {
|
|
26
|
+
const { t: w } = he(), r = bt({}), { breakpoints: p } = st(), x = We(), t = Me();
|
|
27
27
|
Qe(() => {
|
|
28
|
-
for (const
|
|
29
|
-
if (!
|
|
28
|
+
for (const y of g.items) {
|
|
29
|
+
if (!y.totalCost)
|
|
30
30
|
continue;
|
|
31
31
|
const { cost: e } = $e(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
y.sku,
|
|
33
|
+
y.quantity,
|
|
34
|
+
y.measurement,
|
|
35
35
|
{
|
|
36
36
|
supplier: g.supplier
|
|
37
37
|
}
|
|
38
|
-
), u =
|
|
39
|
-
e ?
|
|
38
|
+
), u = y.totalCost ?? _t.reset();
|
|
39
|
+
e ? r[y.sku._id] = e.amount !== u.amount || e.precision !== u.precision : r[y.sku._id] = !0;
|
|
40
40
|
}
|
|
41
|
-
}), _e([() => g.supplier], ([
|
|
41
|
+
}), _e([() => g.supplier], ([y]) => {
|
|
42
42
|
for (const e of g.items) {
|
|
43
|
-
if (!e.totalCost ||
|
|
43
|
+
if (!e.totalCost || r[e.sku._id] || !v(e.sku))
|
|
44
44
|
continue;
|
|
45
45
|
const { cost: u } = $e(
|
|
46
46
|
e.sku,
|
|
47
47
|
e.quantity,
|
|
48
48
|
e.measurement,
|
|
49
49
|
{
|
|
50
|
-
supplier:
|
|
50
|
+
supplier: y
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
g.updateItem({ ...e, totalCost: u });
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
function v(
|
|
56
|
+
function v(y) {
|
|
57
57
|
var u, k, a, i, h, _, C;
|
|
58
|
-
return !!(((k = (u =
|
|
58
|
+
return !!(((k = (u = y.defaultCost) == null ? void 0 : u.costPerUnit) == null ? void 0 : k.amount) ?? ((C = (_ = (h = (i = (a = g.supplier) == null ? void 0 : a.supplyItems) == null ? void 0 : i.find((l) => l.skuId === y._id)) == null ? void 0 : h.defaultCost) == null ? void 0 : _.costPerUnit) == null ? void 0 : C.amount));
|
|
59
59
|
}
|
|
60
60
|
const F = [
|
|
61
61
|
{
|
|
@@ -63,8 +63,8 @@ function gs(g) {
|
|
|
63
63
|
header: () => w("inventory.transfer.form.items.table.Code"),
|
|
64
64
|
accessorKey: "code",
|
|
65
65
|
size: 200,
|
|
66
|
-
cell(
|
|
67
|
-
const e =
|
|
66
|
+
cell(y) {
|
|
67
|
+
const e = y.row.original;
|
|
68
68
|
return t.isEnabled ? L(
|
|
69
69
|
ge.FmTooltip,
|
|
70
70
|
{
|
|
@@ -99,8 +99,8 @@ function gs(g) {
|
|
|
99
99
|
id: "Name",
|
|
100
100
|
header: () => w("inventory.transfer.form.items.table.Name"),
|
|
101
101
|
minSize: 300,
|
|
102
|
-
cell(
|
|
103
|
-
const e =
|
|
102
|
+
cell(y) {
|
|
103
|
+
const e = y.row.original;
|
|
104
104
|
return t.isEnabled ? L(
|
|
105
105
|
ge.FmTooltip,
|
|
106
106
|
{
|
|
@@ -136,8 +136,8 @@ function gs(g) {
|
|
|
136
136
|
header: () => w("inventory.transfer.form.items.table.Name"),
|
|
137
137
|
minSize: 300,
|
|
138
138
|
enableSorting: !1,
|
|
139
|
-
cell(
|
|
140
|
-
const e =
|
|
139
|
+
cell(y) {
|
|
140
|
+
const e = y.row.original, u = e.code, k = e.name;
|
|
141
141
|
return L(
|
|
142
142
|
ge.FmTooltip,
|
|
143
143
|
{ zIndex: 50 },
|
|
@@ -169,12 +169,12 @@ function gs(g) {
|
|
|
169
169
|
id: "Amount",
|
|
170
170
|
header: () => w("inventory.transfer.form.items.table.Amount"),
|
|
171
171
|
minSize: 200,
|
|
172
|
-
cell(
|
|
173
|
-
var i, h, _, C,
|
|
174
|
-
const e =
|
|
172
|
+
cell(y) {
|
|
173
|
+
var i, h, _, C, l;
|
|
174
|
+
const e = y.row.original, u = (i = g.forecastAmounts) == null ? void 0 : i.find((m) => m.skuId === e.sku._id), k = u ? u.helperState === "error" ? `Predicted: ${u.amount} (out of range)` : `Predicted: ${u.amount}` : void 0, a = (C = (_ = (h = g.template) == null ? void 0 : h.purchaseOrder) == null ? void 0 : _.items) == null ? void 0 : C.find(
|
|
175
175
|
(m) => m.sku._id === e.sku._id
|
|
176
176
|
);
|
|
177
|
-
return L(
|
|
177
|
+
return L(ds, {
|
|
178
178
|
style: {
|
|
179
179
|
flex: "1 1 0%"
|
|
180
180
|
},
|
|
@@ -188,40 +188,40 @@ function gs(g) {
|
|
|
188
188
|
helperState: u == null ? void 0 : u.helperState,
|
|
189
189
|
"onUpdate:modelValue": (m) => {
|
|
190
190
|
if (!m) return;
|
|
191
|
-
const
|
|
191
|
+
const D = {
|
|
192
192
|
...e,
|
|
193
193
|
quantity: m.amount,
|
|
194
194
|
measurement: m.measurement
|
|
195
195
|
};
|
|
196
196
|
if (x.enableTotalCost) {
|
|
197
|
-
const { cost:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
const { cost: B } = $e(
|
|
198
|
+
D.sku,
|
|
199
|
+
D.quantity,
|
|
200
|
+
D.measurement,
|
|
201
201
|
{
|
|
202
202
|
supplier: g.supplier,
|
|
203
203
|
// NOTE: set undefined here if `manualTotalCost[updatedRow.sku._id] = false`, so that the function
|
|
204
204
|
// will return the auto calculated default cost instead of the manual total cost
|
|
205
|
-
manualTotalCost:
|
|
205
|
+
manualTotalCost: r[D.sku._id] ? D.totalCost : void 0
|
|
206
206
|
}
|
|
207
207
|
);
|
|
208
|
-
|
|
208
|
+
D.totalCost = B;
|
|
209
209
|
}
|
|
210
|
-
g.updateItem(
|
|
210
|
+
g.updateItem(D);
|
|
211
211
|
},
|
|
212
212
|
stepper: a == null ? void 0 : a.quantityStep,
|
|
213
213
|
disableUnit: !!a,
|
|
214
214
|
disabled: g.disabled,
|
|
215
215
|
rules: [
|
|
216
|
-
|
|
216
|
+
cs(
|
|
217
217
|
+Ce(
|
|
218
|
-
((
|
|
218
|
+
((l = e.quantity) == null ? void 0 : l.amount) === 0 ? { amount: 0, precision: 0 } : (a == null ? void 0 : a.minimumQuantity) ?? { amount: 0, precision: 0 }
|
|
219
219
|
)
|
|
220
220
|
),
|
|
221
|
-
|
|
221
|
+
ms(
|
|
222
222
|
a != null && a.maximumQuantity ? +Ce(a == null ? void 0 : a.maximumQuantity) : 1 / 0
|
|
223
223
|
),
|
|
224
|
-
...a != null && a.quantityStep ? [
|
|
224
|
+
...a != null && a.quantityStep ? [ps(a.quantityStep)] : []
|
|
225
225
|
],
|
|
226
226
|
applyDefaultRules: !0
|
|
227
227
|
});
|
|
@@ -230,11 +230,11 @@ function gs(g) {
|
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
id: "Cost",
|
|
233
|
-
header:
|
|
233
|
+
header: gs,
|
|
234
234
|
size: 180,
|
|
235
|
-
cell(
|
|
236
|
-
const e =
|
|
237
|
-
if (!
|
|
235
|
+
cell(y) {
|
|
236
|
+
const e = y.row.original, u = v(e.sku), k = p.value.xs || p.value.sm;
|
|
237
|
+
if (!r[e.sku._id] && u) {
|
|
238
238
|
const { cost: a, supplierOverrideCost: i } = $e(
|
|
239
239
|
e.sku,
|
|
240
240
|
e.quantity,
|
|
@@ -255,13 +255,13 @@ function gs(g) {
|
|
|
255
255
|
[
|
|
256
256
|
L(ge.FmButton, {
|
|
257
257
|
prependIcon: "edit",
|
|
258
|
-
variant:
|
|
258
|
+
variant: is.Tertiary,
|
|
259
259
|
disabled: g.disabled,
|
|
260
260
|
onClick() {
|
|
261
261
|
g.updateItem({
|
|
262
262
|
...e,
|
|
263
263
|
totalCost: a
|
|
264
|
-
}),
|
|
264
|
+
}), r[e.sku._id] = !0;
|
|
265
265
|
}
|
|
266
266
|
}),
|
|
267
267
|
L(
|
|
@@ -356,7 +356,7 @@ function gs(g) {
|
|
|
356
356
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
357
357
|
// the total cost will automatically assigned
|
|
358
358
|
totalCost: a
|
|
359
|
-
}),
|
|
359
|
+
}), r[e.sku._id] = !1;
|
|
360
360
|
}
|
|
361
361
|
}) : null;
|
|
362
362
|
}
|
|
@@ -368,8 +368,8 @@ function gs(g) {
|
|
|
368
368
|
{
|
|
369
369
|
id: "Delete",
|
|
370
370
|
header: "",
|
|
371
|
-
cell(
|
|
372
|
-
const e =
|
|
371
|
+
cell(y) {
|
|
372
|
+
const e = y.row.original;
|
|
373
373
|
return L("div", { class: "flex justify-end" }, [
|
|
374
374
|
L(ge.FmButton, {
|
|
375
375
|
key: e.sku._id,
|
|
@@ -394,47 +394,47 @@ function gs(g) {
|
|
|
394
394
|
}
|
|
395
395
|
];
|
|
396
396
|
return {
|
|
397
|
-
columnDefs:
|
|
398
|
-
(
|
|
397
|
+
columnDefs: N(() => x.enableTotalCost && g.transferType === ne.PURCHASE ? F : F.filter(
|
|
398
|
+
(y) => y.id !== "Cost"
|
|
399
399
|
/* Cost */
|
|
400
400
|
))
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
|
-
const
|
|
403
|
+
const hs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, ks = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, xs = { class: "w-[450px] xs:w-full flex" }, Cs = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Ss = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ft = /* @__PURE__ */ ce({
|
|
404
404
|
__name: "SupplierPriceHistory",
|
|
405
405
|
props: {
|
|
406
406
|
prices: {}
|
|
407
407
|
},
|
|
408
408
|
setup(g) {
|
|
409
409
|
const w = ot();
|
|
410
|
-
function
|
|
411
|
-
return w.suppliers.find((x) => x._id ===
|
|
410
|
+
function r(p) {
|
|
411
|
+
return w.suppliers.find((x) => x._id === p);
|
|
412
412
|
}
|
|
413
|
-
return (
|
|
414
|
-
(S(!0),
|
|
413
|
+
return (p, x) => (S(), T("div", hs, [
|
|
414
|
+
(S(!0), T(de, null, Se(Object.keys(p.prices), (t) => {
|
|
415
415
|
var v;
|
|
416
|
-
return S(),
|
|
416
|
+
return S(), T("div", {
|
|
417
417
|
key: t,
|
|
418
418
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
419
419
|
}, [
|
|
420
|
-
n("div",
|
|
421
|
-
n("div",
|
|
422
|
-
(S(!0),
|
|
420
|
+
n("div", ks, q((v = r(t)) == null ? void 0 : v.name), 1),
|
|
421
|
+
n("div", xs, [
|
|
422
|
+
(S(!0), T(de, null, Se(p.prices[t].slice(0, 3), (F) => {
|
|
423
423
|
var $;
|
|
424
|
-
return S(),
|
|
424
|
+
return S(), T("div", {
|
|
425
425
|
key: F.date,
|
|
426
426
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
427
427
|
}, [
|
|
428
|
-
n("div",
|
|
429
|
-
n("span", null,
|
|
428
|
+
n("div", Cs, [
|
|
429
|
+
n("span", null, q(F.totalCost ? s(je)(F.totalCost) : "No data"), 1),
|
|
430
430
|
x[0] || (x[0] = n("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
431
|
-
n("span", null,
|
|
432
|
-
n("span", null,
|
|
431
|
+
n("span", null, q(s(Ce)(F.totalUnit, !1)), 1),
|
|
432
|
+
n("span", null, q((($ = F.measurement) == null ? void 0 : $.abbrev) ?? F.unit.abbrev), 1)
|
|
433
433
|
]),
|
|
434
|
-
n("div",
|
|
435
|
-
n("span", null, "(#" +
|
|
436
|
-
x[1] || (x[1] = n("span", null,
|
|
437
|
-
n("span", null,
|
|
434
|
+
n("div", Ss, [
|
|
435
|
+
n("span", null, "(#" + q(F.seqNumber) + ")", 1),
|
|
436
|
+
x[1] || (x[1] = n("span", null, q(" "), -1)),
|
|
437
|
+
n("span", null, q(s(Ge)(new Date(F.date))), 1)
|
|
438
438
|
])
|
|
439
439
|
]);
|
|
440
440
|
}), 128))
|
|
@@ -443,10 +443,10 @@ const _s = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
443
443
|
}), 128))
|
|
444
444
|
]));
|
|
445
445
|
}
|
|
446
|
-
}),
|
|
446
|
+
}), ws = { class: "flex flex-col gap-8 py-16" }, Fs = { class: "flex items-center" }, $s = { class: "flex-1 flex gap-1 items-center" }, Is = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ts = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ds = { class: "flex gap-8 w-full" }, Vs = { class: "flex-1 flex flex-col gap-4" }, Ps = { class: "flex-1 flex flex-col gap-4" }, Rs = { class: "flex gap-8 w-full" }, As = { class: "flex-1 flex flex-col gap-4" }, Es = {
|
|
447
447
|
key: 0,
|
|
448
448
|
class: "flex-1 flex flex-col gap-4"
|
|
449
|
-
},
|
|
449
|
+
}, Os = /* @__PURE__ */ ce({
|
|
450
450
|
__name: "TransferItem",
|
|
451
451
|
props: {
|
|
452
452
|
cellByColId: {},
|
|
@@ -456,83 +456,83 @@ const _s = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
456
456
|
},
|
|
457
457
|
setup(g) {
|
|
458
458
|
const { t: w } = he();
|
|
459
|
-
return (
|
|
460
|
-
var v, F, $,
|
|
461
|
-
const x =
|
|
462
|
-
return S(),
|
|
463
|
-
n("div",
|
|
464
|
-
n("div",
|
|
465
|
-
n("span",
|
|
466
|
-
n("span", Ts,
|
|
459
|
+
return (r, p) => {
|
|
460
|
+
var v, F, $, y, e, u, k, a, i, h, _, C, l, m, D, B, Q, Y, K, E, U, P, d, c, O, ee, X;
|
|
461
|
+
const x = I("FmLabel"), t = I("FmSpacer");
|
|
462
|
+
return S(), T("div", ws, [
|
|
463
|
+
n("div", Fs, [
|
|
464
|
+
n("div", $s, [
|
|
465
|
+
n("span", Is, " (" + q(r.row.original.sku.code) + ") ", 1),
|
|
466
|
+
n("span", Ts, q(r.row.original.sku.name), 1)
|
|
467
467
|
]),
|
|
468
468
|
n("div", null, [
|
|
469
|
-
|
|
470
|
-
render: ($ = (F = (v =
|
|
471
|
-
props: (e = (
|
|
469
|
+
b(s(fe), {
|
|
470
|
+
render: ($ = (F = (v = r.cellByColId.Delete) == null ? void 0 : v.column) == null ? void 0 : F.columnDef) == null ? void 0 : $.cell,
|
|
471
|
+
props: (e = (y = r.cellByColId.Delete) == null ? void 0 : y.getContext) == null ? void 0 : e.call(y)
|
|
472
472
|
}, null, 8, ["render", "props"])
|
|
473
473
|
])
|
|
474
474
|
]),
|
|
475
475
|
n("div", Ds, [
|
|
476
|
-
n("div",
|
|
477
|
-
|
|
476
|
+
n("div", Vs, [
|
|
477
|
+
b(x, {
|
|
478
478
|
label: s(w)(`inventory.transfer.form.items.table.${s(J).Code}`)
|
|
479
479
|
}, null, 8, ["label"]),
|
|
480
|
-
|
|
481
|
-
render: (a = (k = (u =
|
|
482
|
-
props: (h = (i =
|
|
480
|
+
b(s(fe), {
|
|
481
|
+
render: (a = (k = (u = r.cellByColId[s(J).Code]) == null ? void 0 : u.column) == null ? void 0 : k.columnDef) == null ? void 0 : a.cell,
|
|
482
|
+
props: (h = (i = r.cellByColId[s(J).Code]) == null ? void 0 : i.getContext) == null ? void 0 : h.call(i)
|
|
483
483
|
}, null, 8, ["render", "props"]),
|
|
484
|
-
|
|
484
|
+
p[0] || (p[0] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
485
485
|
]),
|
|
486
|
-
n("div",
|
|
487
|
-
|
|
486
|
+
n("div", Ps, [
|
|
487
|
+
b(x, {
|
|
488
488
|
label: s(w)(`inventory.transfer.form.items.table.${s(J).Name}`)
|
|
489
489
|
}, null, 8, ["label"]),
|
|
490
|
-
|
|
491
|
-
render: (
|
|
492
|
-
props: (
|
|
490
|
+
b(s(fe), {
|
|
491
|
+
render: (l = (C = (_ = r.cellByColId[s(J).Name]) == null ? void 0 : _.column) == null ? void 0 : C.columnDef) == null ? void 0 : l.cell,
|
|
492
|
+
props: (D = (m = r.cellByColId[s(J).Name]) == null ? void 0 : m.getContext) == null ? void 0 : D.call(m)
|
|
493
493
|
}, null, 8, ["render", "props"]),
|
|
494
|
-
|
|
494
|
+
p[1] || (p[1] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
495
495
|
])
|
|
496
496
|
]),
|
|
497
|
-
n("div",
|
|
498
|
-
n("div",
|
|
499
|
-
|
|
497
|
+
n("div", Rs, [
|
|
498
|
+
n("div", As, [
|
|
499
|
+
b(x, {
|
|
500
500
|
label: s(w)(`inventory.transfer.form.items.table.${s(J).Amount}`)
|
|
501
501
|
}, null, 8, ["label"]),
|
|
502
|
-
|
|
503
|
-
render: (
|
|
504
|
-
props: (
|
|
502
|
+
b(s(fe), {
|
|
503
|
+
render: (Y = (Q = (B = r.cellByColId[s(J).Amount]) == null ? void 0 : B.column) == null ? void 0 : Q.columnDef) == null ? void 0 : Y.cell,
|
|
504
|
+
props: (E = (K = r.cellByColId[s(J).Amount]) == null ? void 0 : K.getContext) == null ? void 0 : E.call(K)
|
|
505
505
|
}, null, 8, ["render", "props"]),
|
|
506
|
-
|
|
506
|
+
p[2] || (p[2] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
507
507
|
]),
|
|
508
|
-
|
|
509
|
-
|
|
508
|
+
r.cellByColId[s(J).Cost] ? (S(), T("div", Es, [
|
|
509
|
+
b(Ct, { "z-index": 50 }, {
|
|
510
510
|
default: R(() => [
|
|
511
|
-
|
|
511
|
+
b(x, {
|
|
512
512
|
label: s(w)(`inventory.transfer.form.items.table.${s(J).Cost}2`)
|
|
513
513
|
}, null, 8, ["label"])
|
|
514
514
|
]),
|
|
515
515
|
_: 1
|
|
516
516
|
}),
|
|
517
|
-
|
|
518
|
-
render: (d = (P = (
|
|
519
|
-
props: (
|
|
517
|
+
b(s(fe), {
|
|
518
|
+
render: (d = (P = (U = r.cellByColId[s(J).Cost]) == null ? void 0 : U.column) == null ? void 0 : P.columnDef) == null ? void 0 : d.cell,
|
|
519
|
+
props: (O = (c = r.cellByColId[s(J).Cost]) == null ? void 0 : c.getContext) == null ? void 0 : O.call(c)
|
|
520
520
|
}, null, 8, ["render", "props"]),
|
|
521
|
-
|
|
522
|
-
])) :
|
|
521
|
+
p[3] || (p[3] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
522
|
+
])) : j("", !0)
|
|
523
523
|
]),
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
prices:
|
|
524
|
+
r.showComparePrice && Object.keys(r.comparePriceBySku[(ee = r.row.original.sku) == null ? void 0 : ee._id] ?? {}).length > 0 ? (S(), T(de, { key: 0 }, [
|
|
525
|
+
b(t, { class: "h-8" }),
|
|
526
|
+
b(Ft, {
|
|
527
|
+
prices: r.comparePriceBySku[(X = r.row.original.sku) == null ? void 0 : X._id]
|
|
528
528
|
}, null, 8, ["prices"])
|
|
529
|
-
], 64)) :
|
|
529
|
+
], 64)) : j("", !0)
|
|
530
530
|
]);
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
});
|
|
534
|
-
function
|
|
535
|
-
const w =
|
|
534
|
+
function qs(g) {
|
|
535
|
+
const w = N({
|
|
536
536
|
get() {
|
|
537
537
|
const t = g.getEffectiveAt();
|
|
538
538
|
return t ? new Date(t) : null;
|
|
@@ -540,42 +540,42 @@ function Os(g) {
|
|
|
540
540
|
set(t) {
|
|
541
541
|
g.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
|
|
542
542
|
}
|
|
543
|
-
}),
|
|
543
|
+
}), r = N({
|
|
544
544
|
get() {
|
|
545
545
|
return !!w.value;
|
|
546
546
|
},
|
|
547
547
|
set(t) {
|
|
548
548
|
t ? w.value = /* @__PURE__ */ new Date() : w.value = null;
|
|
549
549
|
}
|
|
550
|
-
}),
|
|
550
|
+
}), p = N({
|
|
551
551
|
get() {
|
|
552
552
|
return w.value === null ? "" : Ge(w.value);
|
|
553
553
|
},
|
|
554
554
|
set(t) {
|
|
555
555
|
t ? w.value = /* @__PURE__ */ new Date(`${t} ${x.value}`) : w.value = null;
|
|
556
556
|
}
|
|
557
|
-
}), x =
|
|
557
|
+
}), x = N({
|
|
558
558
|
get() {
|
|
559
559
|
return w.value === null ? "" : Et(w.value);
|
|
560
560
|
},
|
|
561
561
|
set(t) {
|
|
562
|
-
t ? w.value = /* @__PURE__ */ new Date(`${
|
|
562
|
+
t ? w.value = /* @__PURE__ */ new Date(`${p.value} ${t}`) : w.value = null;
|
|
563
563
|
}
|
|
564
564
|
});
|
|
565
565
|
return {
|
|
566
566
|
backdatePo: w,
|
|
567
|
-
backdateSwitch:
|
|
568
|
-
backdateModel:
|
|
567
|
+
backdateSwitch: r,
|
|
568
|
+
backdateModel: p,
|
|
569
569
|
backdateTimeModel: x
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
|
-
const
|
|
572
|
+
const Ms = {
|
|
573
573
|
width: "24",
|
|
574
574
|
height: "24",
|
|
575
575
|
viewBox: "0 0 24 24",
|
|
576
576
|
fill: "none",
|
|
577
577
|
xmlns: "http://www.w3.org/2000/svg"
|
|
578
|
-
},
|
|
578
|
+
}, Us = ["fill"], Ns = ["fill"], Bs = ["stroke"], zs = ["stroke"], Ls = /* @__PURE__ */ ce({
|
|
579
579
|
__name: "SparkIcon",
|
|
580
580
|
props: {
|
|
581
581
|
size: {
|
|
@@ -588,22 +588,22 @@ const qs = {
|
|
|
588
588
|
}
|
|
589
589
|
},
|
|
590
590
|
setup(g) {
|
|
591
|
-
return (w,
|
|
591
|
+
return (w, r) => (S(), T("svg", Ms, [
|
|
592
592
|
n("path", {
|
|
593
593
|
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",
|
|
594
594
|
fill: g.color
|
|
595
|
-
}, null, 8,
|
|
595
|
+
}, null, 8, Us),
|
|
596
596
|
n("path", {
|
|
597
597
|
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",
|
|
598
598
|
fill: g.color
|
|
599
|
-
}, null, 8,
|
|
599
|
+
}, null, 8, Ns),
|
|
600
600
|
n("path", {
|
|
601
601
|
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",
|
|
602
602
|
stroke: g.color,
|
|
603
603
|
"stroke-width": "1.5",
|
|
604
604
|
"stroke-linecap": "round",
|
|
605
605
|
"stroke-linejoin": "round"
|
|
606
|
-
}, null, 8,
|
|
606
|
+
}, null, 8, Bs),
|
|
607
607
|
n("path", {
|
|
608
608
|
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",
|
|
609
609
|
stroke: g.color,
|
|
@@ -613,7 +613,7 @@ const qs = {
|
|
|
613
613
|
}, null, 8, zs)
|
|
614
614
|
]));
|
|
615
615
|
}
|
|
616
|
-
}),
|
|
616
|
+
}), Hs = { class: "flex gap-8 items-center" }, js = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Qs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Ys = { class: "flex items-center w-full" }, Ks = { class: "flex-1" }, Xs = { class: "fm-typo-en-title-sm-800" }, Zs = { class: "flex items-start gap-8" }, Ws = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Gs = { class: "flex gap-1" }, Js = /* @__PURE__ */ ce({
|
|
617
617
|
__name: "ForecastStock",
|
|
618
618
|
props: {
|
|
619
619
|
templateId: {},
|
|
@@ -623,8 +623,8 @@ const qs = {
|
|
|
623
623
|
},
|
|
624
624
|
emits: ["update:poItems", "update:forecastAmounts"],
|
|
625
625
|
setup(g, { emit: w }) {
|
|
626
|
-
const
|
|
627
|
-
function
|
|
626
|
+
const r = g, p = w, x = M(!1), t = M(7), v = as(), F = Te(), { t: $ } = he();
|
|
627
|
+
function y(a, i, h) {
|
|
628
628
|
return i != null && a < i && (a = i), h != null && a > h && (a = h), a;
|
|
629
629
|
}
|
|
630
630
|
function e(a) {
|
|
@@ -637,33 +637,33 @@ const qs = {
|
|
|
637
637
|
name: h,
|
|
638
638
|
baseAmount: _,
|
|
639
639
|
measurement: C,
|
|
640
|
-
min:
|
|
640
|
+
min: l,
|
|
641
641
|
max: m
|
|
642
642
|
}) {
|
|
643
643
|
if (C) {
|
|
644
|
-
const
|
|
645
|
-
let
|
|
646
|
-
return
|
|
644
|
+
const D = C.conversion.amount;
|
|
645
|
+
let B = Math.ceil(_ / D);
|
|
646
|
+
return B = y(B, l, m), {
|
|
647
647
|
sku: a,
|
|
648
648
|
code: i,
|
|
649
649
|
name: h,
|
|
650
|
-
quantity: { amount:
|
|
650
|
+
quantity: { amount: B, precision: 0 },
|
|
651
651
|
measurement: C
|
|
652
652
|
};
|
|
653
653
|
} else {
|
|
654
|
-
const
|
|
654
|
+
const D = Math.ceil(y(_, l, m));
|
|
655
655
|
return {
|
|
656
656
|
sku: a,
|
|
657
657
|
code: i,
|
|
658
658
|
name: h,
|
|
659
|
-
quantity: { amount:
|
|
659
|
+
quantity: { amount: D, precision: 0 },
|
|
660
660
|
measurement: null
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
async function k() {
|
|
665
665
|
if (t.value < 1) return;
|
|
666
|
-
x.value = !1, await v.readPurchaseOrder(t.value,
|
|
666
|
+
x.value = !1, await v.readPurchaseOrder(t.value, r.templateId);
|
|
667
667
|
const a = v.purchaseOrderForecast.skus;
|
|
668
668
|
if (a.length === 0) {
|
|
669
669
|
F.open({
|
|
@@ -672,47 +672,47 @@ const qs = {
|
|
|
672
672
|
});
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
|
-
const i =
|
|
676
|
-
var
|
|
677
|
-
const
|
|
675
|
+
const i = r.templateItems.reduce((_, C) => {
|
|
676
|
+
var B;
|
|
677
|
+
const l = (B = r.poItems) == null ? void 0 : B.find((Q) => Q.sku._id === C.sku._id), m = a.find((Q) => Q.id === C.sku._id);
|
|
678
678
|
if (!m)
|
|
679
|
-
return
|
|
680
|
-
if (!
|
|
681
|
-
const
|
|
679
|
+
return l && _.push(l), _;
|
|
680
|
+
if (!r.templateId && m.amount <= 0) return _;
|
|
681
|
+
const D = m.amount ?? e(l == null ? void 0 : l.quantity) ?? 0;
|
|
682
682
|
return _.push(
|
|
683
683
|
u({
|
|
684
684
|
sku: C.sku,
|
|
685
685
|
code: C.code,
|
|
686
686
|
name: C.name,
|
|
687
|
-
baseAmount:
|
|
687
|
+
baseAmount: D,
|
|
688
688
|
measurement: C.measurement || null,
|
|
689
689
|
min: e(C.minimumQuantity),
|
|
690
690
|
max: e(C.maximumQuantity)
|
|
691
691
|
})
|
|
692
692
|
), _;
|
|
693
693
|
}, []), h = a.map((_) => {
|
|
694
|
-
const C =
|
|
695
|
-
let
|
|
694
|
+
const C = r.templateItems.find((Y) => Y.sku._id === _.id);
|
|
695
|
+
let l = _.amount, m = 0;
|
|
696
696
|
if (C != null && C.measurement) {
|
|
697
|
-
const
|
|
698
|
-
|
|
697
|
+
const Y = e(C.measurement.conversion) ?? 1;
|
|
698
|
+
l = Math.ceil(_.amount / Y);
|
|
699
699
|
} else
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
return { skuId: _.id, amount:
|
|
700
|
+
l = Math.ceil(_.amount);
|
|
701
|
+
const D = e(C == null ? void 0 : C.minimumQuantity) ?? 0, B = e(C == null ? void 0 : C.maximumQuantity) ?? 1 / 0, Q = l < D || l > B ? "error" : "success";
|
|
702
|
+
return { skuId: _.id, amount: l, precision: m, helperState: Q };
|
|
703
703
|
});
|
|
704
|
-
|
|
704
|
+
p("update:poItems", i), p("update:forecastAmounts", h);
|
|
705
705
|
}
|
|
706
706
|
return (a, i) => {
|
|
707
|
-
const h =
|
|
708
|
-
return S(),
|
|
707
|
+
const h = I("FmButton"), _ = I("FmIcon"), C = I("FmStepperField"), l = I("FmPopover");
|
|
708
|
+
return S(), G(l, {
|
|
709
709
|
disabled: a.disabled,
|
|
710
710
|
class: "flex",
|
|
711
711
|
"show-popover": x.value,
|
|
712
712
|
onPopoverChanged: i[3] || (i[3] = (m) => x.value = m)
|
|
713
713
|
}, {
|
|
714
714
|
"popover-button": R(() => [
|
|
715
|
-
|
|
715
|
+
b(h, {
|
|
716
716
|
label: "unused",
|
|
717
717
|
variant: "secondary",
|
|
718
718
|
"text-color": a.disabled ? "disabled" : "primary",
|
|
@@ -721,61 +721,61 @@ const qs = {
|
|
|
721
721
|
disabled: a.disabled
|
|
722
722
|
}, {
|
|
723
723
|
default: R(() => [
|
|
724
|
-
n("div",
|
|
725
|
-
|
|
724
|
+
n("div", Hs, [
|
|
725
|
+
b(Ls, {
|
|
726
726
|
size: 24,
|
|
727
727
|
color: a.disabled ? "#c7c7cc" : "#ff7823"
|
|
728
728
|
}, null, 8, ["color"]),
|
|
729
|
-
n("div",
|
|
729
|
+
n("div", js, q(s($)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
730
730
|
])
|
|
731
731
|
]),
|
|
732
732
|
_: 1
|
|
733
733
|
}, 8, ["text-color", "border-color", "disabled"])
|
|
734
734
|
]),
|
|
735
735
|
default: R(() => [
|
|
736
|
-
n("div",
|
|
737
|
-
n("div",
|
|
738
|
-
n("div",
|
|
739
|
-
|
|
736
|
+
n("div", Qs, [
|
|
737
|
+
n("div", Ys, [
|
|
738
|
+
n("div", Ks, [
|
|
739
|
+
b(ys, { "z-index": 99 }, {
|
|
740
740
|
default: R(() => [
|
|
741
|
-
n("p",
|
|
741
|
+
n("p", Xs, q(s($)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
742
742
|
]),
|
|
743
743
|
_: 1
|
|
744
744
|
})
|
|
745
745
|
]),
|
|
746
|
-
|
|
746
|
+
b(h, {
|
|
747
747
|
icon: "close",
|
|
748
748
|
size: "md",
|
|
749
749
|
variant: "tertiary",
|
|
750
750
|
onClick: i[0] || (i[0] = (m) => x.value = !1)
|
|
751
751
|
})
|
|
752
752
|
]),
|
|
753
|
-
|
|
753
|
+
b(C, {
|
|
754
754
|
modelValue: t.value,
|
|
755
755
|
"onUpdate:modelValue": i[1] || (i[1] = (m) => t.value = m),
|
|
756
756
|
label: s($)("inventory.transfer.form.items.forecastStock.days"),
|
|
757
757
|
rules: [s(qe)(1)]
|
|
758
758
|
}, {
|
|
759
759
|
"helper-text": R(() => [
|
|
760
|
-
n("div",
|
|
761
|
-
|
|
760
|
+
n("div", Zs, [
|
|
761
|
+
b(_, {
|
|
762
762
|
name: "warning",
|
|
763
763
|
size: "sm",
|
|
764
764
|
class: "text-fm-color-system-warning-300"
|
|
765
765
|
}),
|
|
766
|
-
n("div",
|
|
766
|
+
n("div", Ws, q(s($)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
767
767
|
])
|
|
768
768
|
]),
|
|
769
769
|
_: 1
|
|
770
770
|
}, 8, ["modelValue", "label", "rules"]),
|
|
771
|
-
n("div",
|
|
771
|
+
n("div", Gs, [
|
|
772
772
|
i[4] || (i[4] = n("div", { class: "grow" }, null, -1)),
|
|
773
|
-
|
|
773
|
+
b(h, {
|
|
774
774
|
label: s($)("common.cancel"),
|
|
775
775
|
variant: "tertiary",
|
|
776
776
|
onClick: i[2] || (i[2] = (m) => x.value = !1)
|
|
777
777
|
}, null, 8, ["label"]),
|
|
778
|
-
|
|
778
|
+
b(h, {
|
|
779
779
|
label: s($)("inventory.transfer.form.items.forecastStock.generate"),
|
|
780
780
|
onClick: k
|
|
781
781
|
}, null, 8, ["label"])
|
|
@@ -787,14 +787,14 @@ const qs = {
|
|
|
787
787
|
};
|
|
788
788
|
}
|
|
789
789
|
});
|
|
790
|
-
function
|
|
791
|
-
const g =
|
|
792
|
-
_e(
|
|
793
|
-
v && (x.value = !0,
|
|
790
|
+
function eo() {
|
|
791
|
+
const g = Te(), w = tt(), r = M(!1);
|
|
792
|
+
_e(r, (v) => {
|
|
793
|
+
v && (x.value = !0, p().finally(() => {
|
|
794
794
|
x.value = !1;
|
|
795
795
|
}));
|
|
796
796
|
});
|
|
797
|
-
async function
|
|
797
|
+
async function p() {
|
|
798
798
|
try {
|
|
799
799
|
const { startDate: v, endDate: F } = Ot(6), e = (await w.getPurchaseOrders({ start: v, end: F })).filter(
|
|
800
800
|
(u) => {
|
|
@@ -822,17 +822,17 @@ function Js() {
|
|
|
822
822
|
g.open({
|
|
823
823
|
title: "Something went wrong",
|
|
824
824
|
message: "Cannot retrieve supplier purchase history. Please try again."
|
|
825
|
-
}),
|
|
825
|
+
}), r.value = !1;
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
|
-
const x =
|
|
828
|
+
const x = M(!1), t = M({});
|
|
829
829
|
return {
|
|
830
|
-
comparePricesToggle:
|
|
830
|
+
comparePricesToggle: r,
|
|
831
831
|
comparePriceFetching: x,
|
|
832
832
|
comparePriceBySku: t
|
|
833
833
|
};
|
|
834
834
|
}
|
|
835
|
-
const
|
|
835
|
+
const to = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, so = { key: 0 }, oo = ["colspan"], ao = /* @__PURE__ */ ce({
|
|
836
836
|
__name: "TransferItemTable",
|
|
837
837
|
props: {
|
|
838
838
|
templateItem: {},
|
|
@@ -843,30 +843,30 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
843
843
|
},
|
|
844
844
|
emits: ["update:item"],
|
|
845
845
|
setup(g) {
|
|
846
|
-
function w(
|
|
847
|
-
return
|
|
846
|
+
function w(r) {
|
|
847
|
+
return r.column.columnDef.meta;
|
|
848
848
|
}
|
|
849
|
-
return (
|
|
849
|
+
return (r, p) => {
|
|
850
850
|
var x, t;
|
|
851
|
-
return S(),
|
|
851
|
+
return S(), T(de, null, [
|
|
852
852
|
n("tr", {
|
|
853
|
-
class:
|
|
854
|
-
"bg-fm-color-neutral-gray-100":
|
|
853
|
+
class: Z(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
854
|
+
"bg-fm-color-neutral-gray-100": r.row.getIsSelected()
|
|
855
855
|
}])
|
|
856
856
|
}, [
|
|
857
|
-
(S(!0),
|
|
858
|
-
var F, $,
|
|
859
|
-
return S(),
|
|
857
|
+
(S(!0), T(de, null, Se(r.row.getVisibleCells(), (v) => {
|
|
858
|
+
var F, $, y, e;
|
|
859
|
+
return S(), T("td", {
|
|
860
860
|
key: v.id,
|
|
861
|
-
class:
|
|
861
|
+
class: Z(["h-[56px] text-fm-color-typo-primary", ((F = w(v)) == null ? void 0 : F.cellClass) ?? "px-16"]),
|
|
862
862
|
style: gt({
|
|
863
863
|
width: ($ = w(v)) == null ? void 0 : $.width,
|
|
864
|
-
maxWidth: (
|
|
864
|
+
maxWidth: (y = w(v)) == null ? void 0 : y.maxWidth,
|
|
865
865
|
textAlign: ((e = w(v)) == null ? void 0 : e.textAlign) ?? "left"
|
|
866
866
|
})
|
|
867
867
|
}, [
|
|
868
|
-
n("span",
|
|
869
|
-
|
|
868
|
+
n("span", to, [
|
|
869
|
+
b(s(fe), {
|
|
870
870
|
render: v.column.columnDef.cell,
|
|
871
871
|
props: v.getContext()
|
|
872
872
|
}, null, 8, ["render", "props"])
|
|
@@ -874,25 +874,25 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
874
874
|
], 6);
|
|
875
875
|
}), 128))
|
|
876
876
|
], 2),
|
|
877
|
-
|
|
877
|
+
r.showComparePrice && Object.keys(r.comparePriceBySku[(x = r.row.original.sku) == null ? void 0 : x._id] ?? {}).length > 0 ? (S(), T("tr", so, [
|
|
878
878
|
n("td", {
|
|
879
|
-
colspan:
|
|
879
|
+
colspan: r.row.getVisibleCells().length
|
|
880
880
|
}, [
|
|
881
|
-
|
|
882
|
-
prices:
|
|
881
|
+
b(Ft, {
|
|
882
|
+
prices: r.comparePriceBySku[(t = r.row.original.sku) == null ? void 0 : t._id]
|
|
883
883
|
}, null, 8, ["prices"])
|
|
884
|
-
], 8,
|
|
885
|
-
])) :
|
|
884
|
+
], 8, oo)
|
|
885
|
+
])) : j("", !0)
|
|
886
886
|
], 64);
|
|
887
887
|
};
|
|
888
888
|
}
|
|
889
|
-
}),
|
|
889
|
+
}), no = {
|
|
890
890
|
key: 0,
|
|
891
891
|
class: "flex flex-col gap-8"
|
|
892
|
-
},
|
|
892
|
+
}, lo = { class: "flex flex-col gap-4" }, ro = { class: "flex items-center gap-4" }, io = {
|
|
893
893
|
key: 0,
|
|
894
894
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
|
|
895
|
-
},
|
|
895
|
+
}, uo = /* @__PURE__ */ ce({
|
|
896
896
|
__name: "NetSuiteField",
|
|
897
897
|
props: {
|
|
898
898
|
required: { type: Boolean },
|
|
@@ -904,7 +904,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
904
904
|
},
|
|
905
905
|
emits: ["netsuite:ready"],
|
|
906
906
|
setup(g, { emit: w }) {
|
|
907
|
-
const
|
|
907
|
+
const r = Me(), p = g, x = w, { t } = bs(), v = M(!1), F = M();
|
|
908
908
|
Qe(() => {
|
|
909
909
|
var u, k, a, i;
|
|
910
910
|
let e = {
|
|
@@ -912,14 +912,14 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
912
912
|
subsidiary: { id: "", name: "" },
|
|
913
913
|
errors: []
|
|
914
914
|
};
|
|
915
|
-
if (!
|
|
915
|
+
if (!r.isEnabled || !p.required) {
|
|
916
916
|
x("netsuite:ready", e);
|
|
917
917
|
return;
|
|
918
918
|
}
|
|
919
919
|
try {
|
|
920
|
-
const h =
|
|
921
|
-
|
|
922
|
-
...
|
|
920
|
+
const h = r.currentLocationSubsidiary();
|
|
921
|
+
p.setting ? e = {
|
|
922
|
+
...p.setting,
|
|
923
923
|
subsidiary: {
|
|
924
924
|
id: h.id || "",
|
|
925
925
|
name: h.name
|
|
@@ -931,64 +931,64 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
931
931
|
name: h.name
|
|
932
932
|
}
|
|
933
933
|
};
|
|
934
|
-
const _ =
|
|
935
|
-
if (
|
|
936
|
-
const m =
|
|
937
|
-
|
|
934
|
+
const _ = r.getAvailableItems(h.id), C = p.items.filter((l) => {
|
|
935
|
+
if (l.measurement != null) {
|
|
936
|
+
const m = r.getAvailableMeasurements(
|
|
937
|
+
l.sku._id,
|
|
938
938
|
h.id
|
|
939
939
|
);
|
|
940
|
-
return _.includes(
|
|
940
|
+
return _.includes(l.sku._id) && m.includes(l.measurement.id);
|
|
941
941
|
}
|
|
942
|
-
return _.includes(
|
|
943
|
-
}).map((
|
|
944
|
-
|
|
945
|
-
|
|
942
|
+
return _.includes(l.sku._id);
|
|
943
|
+
}).map((l) => l.sku._id);
|
|
944
|
+
p.onChange(
|
|
945
|
+
p.items.filter((l) => C.includes(l.sku._id)),
|
|
946
946
|
e
|
|
947
947
|
);
|
|
948
948
|
} finally {
|
|
949
|
-
|
|
950
|
-
`${
|
|
951
|
-
) : F.value =
|
|
952
|
-
const h =
|
|
953
|
-
!
|
|
949
|
+
p.supplier.internal ? F.value = r.getNetSuiteLocation(
|
|
950
|
+
`${p.supplier.internal}_${p.supplier._id}`
|
|
951
|
+
) : F.value = r.getNetSuiteVendor(p.supplier._id);
|
|
952
|
+
const h = p.supplier.internal ? r.getLocationSubsidiary((u = F.value) == null ? void 0 : u.netSuiteId).id : (k = F.value) == null ? void 0 : k.subsidiaryId, _ = p.supplier.internal ? (a = r.currentLocationSubsidiary()) == null ? void 0 : a.id : (i = r.currentVendorSubsidiary(p.supplier._id)) == null ? void 0 : i.id;
|
|
953
|
+
!r.isEnabled || h && r.isEnabled && h == _ ? x("netsuite:ready", e) : v.value = !0;
|
|
954
954
|
}
|
|
955
955
|
});
|
|
956
|
-
const $ =
|
|
957
|
-
() =>
|
|
958
|
-
),
|
|
956
|
+
const $ = N(
|
|
957
|
+
() => p.supplier.internal ? r.currentLocationSubsidiary() : r.currentVendorSubsidiary(p.supplier._id)
|
|
958
|
+
), y = N(() => {
|
|
959
959
|
var e, u;
|
|
960
|
-
return F.value == null ? `Cannot find the NetSuite location for "${
|
|
961
|
-
location is ${(u =
|
|
960
|
+
return F.value == null ? `Cannot find the NetSuite location for "${p.supplier.name}"` : `The subsidiary of the request
|
|
961
|
+
location is ${(u = r.getLocationSubsidiary((e = F.value) == null ? void 0 : e.netSuiteId)) == null ? void 0 : u.fullName}`;
|
|
962
962
|
});
|
|
963
963
|
return (e, u) => {
|
|
964
|
-
const k =
|
|
965
|
-
return s(
|
|
966
|
-
|
|
964
|
+
const k = I("FmLabel"), a = I("FmIcon"), i = I("FmField"), h = I("FmTooltip");
|
|
965
|
+
return s(r).isEnabled && p.required ? (S(), T("div", no, [
|
|
966
|
+
b(k, {
|
|
967
967
|
label: `NetSuite ${s(t)("inventory.transfer.form.netsuite.subsidiary")}`
|
|
968
968
|
}, null, 8, ["label"]),
|
|
969
|
-
n("div",
|
|
970
|
-
|
|
969
|
+
n("div", lo, [
|
|
970
|
+
b(h, {
|
|
971
971
|
"z-index": 51,
|
|
972
972
|
placement: "left",
|
|
973
973
|
disabled: e.disabled
|
|
974
974
|
}, {
|
|
975
975
|
content: R(() => u[0] || (u[0] = [
|
|
976
|
-
|
|
976
|
+
Ie("This field is locked and based on the location of the request.")
|
|
977
977
|
])),
|
|
978
978
|
default: R(() => [
|
|
979
|
-
|
|
979
|
+
b(i, null, {
|
|
980
980
|
default: R(() => {
|
|
981
981
|
var _;
|
|
982
982
|
return [
|
|
983
|
-
n("div",
|
|
984
|
-
|
|
983
|
+
n("div", ro, [
|
|
984
|
+
b(a, {
|
|
985
985
|
name: "lock_outline",
|
|
986
986
|
size: "sm",
|
|
987
987
|
color: e.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
988
988
|
}, null, 8, ["color"]),
|
|
989
989
|
n("div", {
|
|
990
|
-
class:
|
|
991
|
-
},
|
|
990
|
+
class: Z([e.disabled ? "text-fm-color-typo-disabled" : ""])
|
|
991
|
+
}, q((_ = $.value) == null ? void 0 : _.fullName), 3)
|
|
992
992
|
])
|
|
993
993
|
];
|
|
994
994
|
}),
|
|
@@ -997,21 +997,21 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
997
997
|
]),
|
|
998
998
|
_: 1
|
|
999
999
|
}, 8, ["disabled"]),
|
|
1000
|
-
v.value ? (S(),
|
|
1000
|
+
v.value ? (S(), T("div", io, q(y.value), 1)) : j("", !0)
|
|
1001
1001
|
])
|
|
1002
|
-
])) :
|
|
1002
|
+
])) : j("", !0);
|
|
1003
1003
|
};
|
|
1004
1004
|
}
|
|
1005
|
-
}),
|
|
1005
|
+
}), co = { class: "flex flex-col gap-4" }, mo = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, po = { class: "flex flex-col gap-16" }, fo = { class: "flex flex-col gap-24" }, vo = { class: "flex flex-col gap-8" }, yo = { class: "flex flex-col gap-4" }, bo = { class: "flex items-center gap-4" }, go = { class: "flex flex-col gap-8" }, _o = { class: "flex flex-col gap-4" }, ho = { class: "flex items-center gap-4" }, ko = {
|
|
1006
1006
|
key: 3,
|
|
1007
1007
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
|
|
1008
|
-
},
|
|
1008
|
+
}, xo = {
|
|
1009
1009
|
key: 0,
|
|
1010
1010
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
1011
|
-
},
|
|
1011
|
+
}, Co = { class: "flex-1" }, So = { class: "flex-1" }, wo = {
|
|
1012
1012
|
key: 1,
|
|
1013
1013
|
class: "flex items-center gap-4"
|
|
1014
|
-
},
|
|
1014
|
+
}, Fo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, $o = { class: "flex flex-col gap-16" }, Io = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, To = { class: "flex gap-8" }, Do = { key: 0 }, Vo = /* @__PURE__ */ ce({
|
|
1015
1015
|
__name: "TransferForm2",
|
|
1016
1016
|
props: {
|
|
1017
1017
|
modelValue: {},
|
|
@@ -1022,43 +1022,43 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1022
1022
|
lastClosingDate: {}
|
|
1023
1023
|
},
|
|
1024
1024
|
emits: ["validation-success", "form:ready"],
|
|
1025
|
-
setup(g, { expose: w, emit:
|
|
1026
|
-
const
|
|
1025
|
+
setup(g, { expose: w, emit: r }) {
|
|
1026
|
+
const p = g, x = r, t = kt(), { t: v } = he(), F = Je(), $ = et(), y = Me(), e = ot(), u = We(), k = wt(), { breakpoints: a } = st(), i = N(() => a.value.xs || a.value.sm), h = bt({
|
|
1027
1027
|
value: !1
|
|
1028
|
-
}), _ =
|
|
1028
|
+
}), _ = M(!1), C = M(0), l = M([]), m = N(
|
|
1029
1029
|
() => {
|
|
1030
1030
|
var o;
|
|
1031
|
-
return ((o =
|
|
1031
|
+
return ((o = p.modelValue) == null ? void 0 : o.templateDoc) ?? k.templates.find((f) => f._id === t.template);
|
|
1032
1032
|
}
|
|
1033
|
-
),
|
|
1033
|
+
), D = N(() => t.status === "DRAFT" || !t._rev);
|
|
1034
1034
|
_e(m, (o) => {
|
|
1035
|
-
var
|
|
1035
|
+
var f, A;
|
|
1036
1036
|
if (o) {
|
|
1037
1037
|
if (o && !o.purchaseOrder.supplier)
|
|
1038
1038
|
throw new Error("Template order must have a source location");
|
|
1039
|
-
if (
|
|
1040
|
-
const
|
|
1041
|
-
if (
|
|
1042
|
-
const le = (
|
|
1043
|
-
(ie) => ie.type ===
|
|
1039
|
+
if (D.value) {
|
|
1040
|
+
const H = (f = o.purchaseOrder) == null ? void 0 : f.supplier.internal;
|
|
1041
|
+
if (H && (H == "restaurant" || H == "warehouse")) {
|
|
1042
|
+
const le = (A = o.purchaseOrder) == null ? void 0 : A.supplier._id, re = `${H}_${le}`, W = F.allLocations.find(
|
|
1043
|
+
(ie) => ie.type === H && ie.dbName === re
|
|
1044
1044
|
);
|
|
1045
|
-
if (
|
|
1045
|
+
if (W) {
|
|
1046
1046
|
const ie = {
|
|
1047
1047
|
...o.purchaseOrder.supplier,
|
|
1048
|
-
name:
|
|
1049
|
-
contactName:
|
|
1050
|
-
email:
|
|
1051
|
-
phoneNumber:
|
|
1052
|
-
registrationNumber:
|
|
1053
|
-
address:
|
|
1048
|
+
name: W.doc.profile.name,
|
|
1049
|
+
contactName: W.doc.profile.name,
|
|
1050
|
+
email: W.doc.profile.email,
|
|
1051
|
+
phoneNumber: W.doc.profile.phoneNo,
|
|
1052
|
+
registrationNumber: W.doc.profile.regNo,
|
|
1053
|
+
address: W.doc.profile.address
|
|
1054
1054
|
};
|
|
1055
1055
|
t.supplier = ie;
|
|
1056
1056
|
}
|
|
1057
1057
|
} else {
|
|
1058
1058
|
const le = e.suppliers.find(
|
|
1059
1059
|
(re) => {
|
|
1060
|
-
var
|
|
1061
|
-
return re._id === ((
|
|
1060
|
+
var W;
|
|
1061
|
+
return re._id === ((W = o.purchaseOrder.supplier) == null ? void 0 : W._id);
|
|
1062
1062
|
}
|
|
1063
1063
|
);
|
|
1064
1064
|
t.supplier = le ?? t.supplier;
|
|
@@ -1070,107 +1070,108 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1070
1070
|
}), Qe(() => {
|
|
1071
1071
|
var o;
|
|
1072
1072
|
try {
|
|
1073
|
-
|
|
1074
|
-
|
|
1073
|
+
const f = $.skuById;
|
|
1074
|
+
let A = t.items.map((H) => ({ ...H, id: H.id ?? H.sku._id }));
|
|
1075
|
+
t.template && (t.items.length || (A = ((o = m.value) == null ? void 0 : o.purchaseOrder.items) ?? [])), t.items = A.filter((H) => !f[H.sku._id].isInactive);
|
|
1075
1076
|
} finally {
|
|
1076
1077
|
_.value = !0;
|
|
1077
1078
|
}
|
|
1078
|
-
}), _e([_, h], ([o,
|
|
1079
|
-
|
|
1079
|
+
}), _e([_, h], ([o, f], [A, H]) => {
|
|
1080
|
+
f.value && H.value && x("form:ready");
|
|
1080
1081
|
});
|
|
1081
|
-
const
|
|
1082
|
+
const B = N(
|
|
1082
1083
|
() => F.currentLocation.type === Ut.restaurant
|
|
1083
1084
|
);
|
|
1084
1085
|
F.watchLocation(async () => {
|
|
1085
1086
|
location && (t.supplier || (t.supplier = e.suppliers.find((o) => o) ?? t.supplier));
|
|
1086
1087
|
});
|
|
1087
|
-
const
|
|
1088
|
+
const Q = us(), Y = fs(
|
|
1088
1089
|
() => t,
|
|
1089
1090
|
(o) => {
|
|
1090
1091
|
Object.assign(t, o);
|
|
1091
1092
|
},
|
|
1092
1093
|
!0,
|
|
1093
1094
|
!0
|
|
1094
|
-
),
|
|
1095
|
+
), K = N({
|
|
1095
1096
|
get() {
|
|
1096
1097
|
var o;
|
|
1097
|
-
return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ?
|
|
1098
|
+
return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? ne.TRANSFER : ne.PURCHASE;
|
|
1098
1099
|
},
|
|
1099
1100
|
set(o) {
|
|
1100
|
-
var
|
|
1101
|
-
const
|
|
1102
|
-
o !==
|
|
1101
|
+
var A;
|
|
1102
|
+
const f = typeof ((A = t == null ? void 0 : t.supplier) == null ? void 0 : A.internal) == "string" ? ne.TRANSFER : ne.PURCHASE;
|
|
1103
|
+
o !== f && (t.supplier = o === ne.PURCHASE ? Y.locationOptionsTypePurchase.value[0] : Y.locationOptionsTypeTransfer.value[0]);
|
|
1103
1104
|
}
|
|
1104
1105
|
});
|
|
1105
1106
|
_e(
|
|
1106
1107
|
() => {
|
|
1107
1108
|
var o;
|
|
1108
|
-
return (o =
|
|
1109
|
+
return (o = p.modelValue) == null ? void 0 : o.template;
|
|
1109
1110
|
},
|
|
1110
1111
|
(o) => {
|
|
1111
1112
|
u.mustUsePoTemplate && !o && $t(() => {
|
|
1112
|
-
var
|
|
1113
|
-
t.supplier = ((
|
|
1114
|
-
(
|
|
1115
|
-
)) == null ? void 0 :
|
|
1113
|
+
var f, A;
|
|
1114
|
+
t.supplier = ((A = (f = Y.locationOptionsTypeTransfer.value) == null ? void 0 : f.filter(
|
|
1115
|
+
(H) => H.internal === "restaurant"
|
|
1116
|
+
)) == null ? void 0 : A[0]) ?? t.supplier;
|
|
1116
1117
|
});
|
|
1117
1118
|
},
|
|
1118
1119
|
{ immediate: !0 }
|
|
1119
1120
|
);
|
|
1120
|
-
const
|
|
1121
|
-
let o =
|
|
1122
|
-
return u.mustUsePoTemplate && !t.template && (o = o.filter((
|
|
1123
|
-
var
|
|
1124
|
-
return (
|
|
1121
|
+
const E = N(() => {
|
|
1122
|
+
let o = Y.transferLocationOptions.value;
|
|
1123
|
+
return u.mustUsePoTemplate && !t.template && (o = o.filter((f) => {
|
|
1124
|
+
var A;
|
|
1125
|
+
return (A = f.sublabel) == null ? void 0 : A.startsWith("restaurant");
|
|
1125
1126
|
})), o;
|
|
1126
|
-
}),
|
|
1127
|
+
}), U = N({
|
|
1127
1128
|
get() {
|
|
1128
1129
|
var o;
|
|
1129
1130
|
return (o = t.supplier) == null ? void 0 : o._id;
|
|
1130
1131
|
},
|
|
1131
1132
|
set(o) {
|
|
1132
|
-
|
|
1133
|
+
Y.transferLocationModel.value = o;
|
|
1133
1134
|
}
|
|
1134
|
-
}), P =
|
|
1135
|
+
}), P = N({
|
|
1135
1136
|
get() {
|
|
1136
1137
|
return t.remark ?? void 0;
|
|
1137
1138
|
},
|
|
1138
1139
|
set(o) {
|
|
1139
1140
|
t.remark = o;
|
|
1140
1141
|
}
|
|
1141
|
-
}), { backdatePo: d, backdateSwitch: c, backdateModel:
|
|
1142
|
+
}), { backdatePo: d, backdateSwitch: c, backdateModel: O, backdateTimeModel: ee } = qs({
|
|
1142
1143
|
getEffectiveAt() {
|
|
1143
1144
|
return t.effectiveAt;
|
|
1144
1145
|
},
|
|
1145
1146
|
setEffectiveAt(o) {
|
|
1146
1147
|
t.effectiveAt = o;
|
|
1147
1148
|
}
|
|
1148
|
-
}), { comparePricesToggle:
|
|
1149
|
+
}), { comparePricesToggle: X, comparePriceFetching: ke, comparePriceBySku: ve } = eo(), me = M();
|
|
1149
1150
|
w({
|
|
1150
1151
|
validateInputs: () => {
|
|
1151
|
-
var o,
|
|
1152
|
-
(
|
|
1152
|
+
var o, f;
|
|
1153
|
+
(f = (o = me.value) == null ? void 0 : o.validateInputs) == null || f.call(o);
|
|
1153
1154
|
},
|
|
1154
1155
|
resetInputsValidation: () => {
|
|
1155
|
-
var o,
|
|
1156
|
-
(
|
|
1156
|
+
var o, f;
|
|
1157
|
+
(f = (o = me.value) == null ? void 0 : o.resetInputsValidation) == null || f.call(o);
|
|
1157
1158
|
},
|
|
1158
1159
|
resetInputs: () => {
|
|
1159
|
-
var o,
|
|
1160
|
-
(
|
|
1160
|
+
var o, f;
|
|
1161
|
+
(f = (o = me.value) == null ? void 0 : o.resetInputs) == null || f.call(o);
|
|
1161
1162
|
}
|
|
1162
1163
|
});
|
|
1163
|
-
const we =
|
|
1164
|
+
const we = N(() => ({
|
|
1164
1165
|
updateItem: (o) => {
|
|
1165
|
-
const
|
|
1166
|
-
t.items = t.items.map((
|
|
1166
|
+
const f = Nt.parse(o);
|
|
1167
|
+
t.items = t.items.map((A) => A.id && A.id !== o.id || !A.id && A.sku._id !== o.sku._id ? A : f);
|
|
1167
1168
|
},
|
|
1168
1169
|
deleteItem: (o) => {
|
|
1169
1170
|
t.items = t.items.filter(
|
|
1170
|
-
(
|
|
1171
|
+
(f) => f.id ? f.id !== o.id : f.sku._id !== o.sku._id
|
|
1171
1172
|
);
|
|
1172
1173
|
}
|
|
1173
|
-
})), Ue =
|
|
1174
|
+
})), Ue = _s({
|
|
1174
1175
|
updateItem: (o) => we.value.updateItem(o),
|
|
1175
1176
|
deleteItem: (o) => we.value.deleteItem(o),
|
|
1176
1177
|
get supplier() {
|
|
@@ -1180,48 +1181,49 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1180
1181
|
return t.items;
|
|
1181
1182
|
},
|
|
1182
1183
|
get transferType() {
|
|
1183
|
-
return
|
|
1184
|
+
return K.value;
|
|
1184
1185
|
},
|
|
1185
1186
|
get template() {
|
|
1186
1187
|
return m.value;
|
|
1187
1188
|
},
|
|
1188
1189
|
get disabled() {
|
|
1189
|
-
return
|
|
1190
|
+
return p.disabled;
|
|
1190
1191
|
},
|
|
1191
1192
|
get forecastAmounts() {
|
|
1192
|
-
return
|
|
1193
|
+
return l.value;
|
|
1193
1194
|
}
|
|
1194
|
-
}), Ne =
|
|
1195
|
+
}), Ne = N(() => Ue.columnDefs.value);
|
|
1195
1196
|
function Fe() {
|
|
1196
|
-
var
|
|
1197
|
-
const o = (
|
|
1198
|
-
var
|
|
1199
|
-
const
|
|
1200
|
-
(ye) => ye.sku._id ===
|
|
1197
|
+
var W, ie, ze, Le, Pe;
|
|
1198
|
+
const o = (ze = (ie = (W = m.value) == null ? void 0 : W.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : ze.groupBy((z) => z.sku._id), f = y.isEnabled ? y.getAvailableItems((Pe = (Le = t.netSuite) == null ? void 0 : Le.subsidiary) == null ? void 0 : Pe.id) : [], A = o != null && o.size ? $.skus.filter((z) => o.has(z._id)) : $.skus, H = y.isEnabled ? A.filter((z) => {
|
|
1199
|
+
var ae, se, ue, pe;
|
|
1200
|
+
const te = (se = (ae = m.value) == null ? void 0 : ae.purchaseOrder) == null ? void 0 : se.items.find(
|
|
1201
|
+
(ye) => ye.sku._id === z._id
|
|
1201
1202
|
);
|
|
1202
|
-
if (
|
|
1203
|
-
const ye =
|
|
1204
|
-
|
|
1203
|
+
if (te != null && te.measurement != null) {
|
|
1204
|
+
const ye = y.getAvailableMeasurements(
|
|
1205
|
+
te.sku._id,
|
|
1205
1206
|
(pe = (ue = t.netSuite) == null ? void 0 : ue.subsidiary) == null ? void 0 : pe.id
|
|
1206
1207
|
);
|
|
1207
|
-
return
|
|
1208
|
+
return f.includes(te.sku._id) && ye.includes(te.measurement.id);
|
|
1208
1209
|
}
|
|
1209
|
-
return
|
|
1210
|
-
}).map((
|
|
1211
|
-
(
|
|
1212
|
-
var
|
|
1210
|
+
return f.includes(z._id);
|
|
1211
|
+
}).map((z) => z._id) : A.map((z) => z._id), le = A.map(
|
|
1212
|
+
(z) => {
|
|
1213
|
+
var te, ae, se, ue;
|
|
1213
1214
|
return {
|
|
1214
|
-
label: ((
|
|
1215
|
-
sublabel: ((ue = (
|
|
1216
|
-
value:
|
|
1217
|
-
disabled: !
|
|
1215
|
+
label: ((ae = (te = o == null ? void 0 : o.get(z._id)) == null ? void 0 : te[0]) == null ? void 0 : ae.name) ?? z.name,
|
|
1216
|
+
sublabel: ((ue = (se = o == null ? void 0 : o.get(z._id)) == null ? void 0 : se[0]) == null ? void 0 : ue.code) ?? z.code,
|
|
1217
|
+
value: z,
|
|
1218
|
+
disabled: !!(!H.includes(z._id) || z.isInactive),
|
|
1219
|
+
tags: z.isInactive ? ["Inactive"] : []
|
|
1218
1220
|
};
|
|
1219
1221
|
}
|
|
1220
|
-
), re = le.filter((
|
|
1221
|
-
var
|
|
1222
|
-
return (
|
|
1223
|
-
}).map((
|
|
1224
|
-
|
|
1222
|
+
), re = le.filter((z) => {
|
|
1223
|
+
var te;
|
|
1224
|
+
return (te = t.items) == null ? void 0 : te.find((ae) => ae.sku._id === z.value._id);
|
|
1225
|
+
}).map((z) => z.value);
|
|
1226
|
+
Q.open({
|
|
1225
1227
|
title: v("inventory.transfer.form.items.selectItem"),
|
|
1226
1228
|
closeButton: !0,
|
|
1227
1229
|
contentComponent: Ht,
|
|
@@ -1239,24 +1241,24 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1239
1241
|
close: !0,
|
|
1240
1242
|
variant: "tertiary"
|
|
1241
1243
|
}
|
|
1242
|
-
}).onPrimary((
|
|
1243
|
-
const
|
|
1244
|
+
}).onPrimary((z) => {
|
|
1245
|
+
const te = t.items ?? [], ae = z.map((se) => {
|
|
1244
1246
|
var ye, Re;
|
|
1245
|
-
const ue =
|
|
1247
|
+
const ue = te.find((be) => be.sku._id === se._id);
|
|
1246
1248
|
if (ue)
|
|
1247
1249
|
return ue;
|
|
1248
1250
|
const pe = ((Re = (ye = m.value) == null ? void 0 : ye.purchaseOrder.items) == null ? void 0 : Re.find(
|
|
1249
|
-
(be) => be.sku._id ===
|
|
1251
|
+
(be) => be.sku._id === se._id
|
|
1250
1252
|
)) ?? {
|
|
1251
|
-
sku:
|
|
1252
|
-
code:
|
|
1253
|
-
name:
|
|
1253
|
+
sku: se,
|
|
1254
|
+
code: se.code,
|
|
1255
|
+
name: se.name,
|
|
1254
1256
|
quantity: {
|
|
1255
1257
|
amount: 1,
|
|
1256
1258
|
precision: 0
|
|
1257
1259
|
}
|
|
1258
1260
|
};
|
|
1259
|
-
if (
|
|
1261
|
+
if (K.value == ne.PURCHASE) {
|
|
1260
1262
|
const { cost: be } = $e(
|
|
1261
1263
|
pe.sku,
|
|
1262
1264
|
pe.quantity,
|
|
@@ -1269,104 +1271,104 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1269
1271
|
}
|
|
1270
1272
|
return pe;
|
|
1271
1273
|
});
|
|
1272
|
-
|
|
1274
|
+
ae.sort((se, ue) => se.sku.code.localeCompare(ue.sku.code)), t.items = ae;
|
|
1273
1275
|
});
|
|
1274
1276
|
}
|
|
1275
1277
|
function Ye(o) {
|
|
1276
1278
|
return o;
|
|
1277
1279
|
}
|
|
1278
|
-
const
|
|
1280
|
+
const Be = N(() => {
|
|
1279
1281
|
var o;
|
|
1280
|
-
return m.value ? ((o = m.value) == null ? void 0 : o.purchaseOrder.items) || [] : $.skus.map((
|
|
1282
|
+
return m.value ? ((o = m.value) == null ? void 0 : o.purchaseOrder.items) || [] : $.skus.map((f) => ({
|
|
1281
1283
|
quantity: {
|
|
1282
1284
|
amount: 0,
|
|
1283
1285
|
precision: 0
|
|
1284
1286
|
},
|
|
1285
|
-
name:
|
|
1286
|
-
code:
|
|
1287
|
-
sku:
|
|
1287
|
+
name: f.name,
|
|
1288
|
+
code: f.code,
|
|
1289
|
+
sku: f,
|
|
1288
1290
|
quantityStep: {
|
|
1289
1291
|
amount: 0,
|
|
1290
1292
|
precision: 0
|
|
1291
1293
|
},
|
|
1292
|
-
measurement:
|
|
1294
|
+
measurement: f.trackingMeasurement ? f.unit.measurements.find((A) => A.id === f.trackingMeasurement) : null
|
|
1293
1295
|
}));
|
|
1294
|
-
}),
|
|
1296
|
+
}), De = N(() => {
|
|
1295
1297
|
const o = [];
|
|
1296
1298
|
return (!u.mustUsePoTemplate || u.mustUsePoTemplate && t.template) && o.push({
|
|
1297
1299
|
label: v("inventory.transfer.form.type.purchase"),
|
|
1298
|
-
value:
|
|
1300
|
+
value: ne.PURCHASE
|
|
1299
1301
|
}), o.push({
|
|
1300
1302
|
label: v("inventory.transfer.form.type.transfer"),
|
|
1301
|
-
value:
|
|
1303
|
+
value: ne.TRANSFER
|
|
1302
1304
|
}), o;
|
|
1303
|
-
}), Ve =
|
|
1305
|
+
}), Ve = N(() => {
|
|
1304
1306
|
var o;
|
|
1305
|
-
return (o =
|
|
1307
|
+
return (o = p.modelValue) == null ? void 0 : o.items.every((f) => f.quantity.amount <= 0);
|
|
1306
1308
|
});
|
|
1307
|
-
return (o,
|
|
1309
|
+
return (o, f) => {
|
|
1308
1310
|
var ye, Re;
|
|
1309
|
-
const
|
|
1310
|
-
return S(),
|
|
1311
|
-
n("div",
|
|
1312
|
-
(ye =
|
|
1311
|
+
const A = I("FmChip"), H = I("FmLabel"), le = I("FmIcon"), re = I("FmField"), W = I("FmTooltip"), ie = I("FmSelect"), ze = I("FmTextField"), Le = I("FmTextarea"), Pe = I("FmSwitch"), z = I("FmDatePicker"), te = I("FmTimePicker"), ae = I("FmFormGroup"), se = I("FmButton"), ue = I("FmTable"), pe = I("FmForm");
|
|
1312
|
+
return S(), T("div", co, [
|
|
1313
|
+
n("div", mo, [
|
|
1314
|
+
(ye = p.modelValue) != null && ye.template ? (S(), G(A, {
|
|
1313
1315
|
key: 0,
|
|
1314
1316
|
variant: o.disabled ? "warning" : void 0,
|
|
1315
1317
|
label: `${s(v)("inventory.transfer.template.title")}: ${((Re = m.value) == null ? void 0 : Re.name) ?? s(v)("inventory.transfer.form.loading")}`,
|
|
1316
1318
|
icon: "summarize",
|
|
1317
1319
|
compact: ""
|
|
1318
|
-
}, null, 8, ["variant", "label"])) :
|
|
1319
|
-
|
|
1320
|
+
}, null, 8, ["variant", "label"])) : j("", !0),
|
|
1321
|
+
b(A, {
|
|
1320
1322
|
label: s(F).currentLocation.name,
|
|
1321
1323
|
icon: "storefront",
|
|
1322
1324
|
compact: ""
|
|
1323
1325
|
}, null, 8, ["label"]),
|
|
1324
|
-
o.lastClosingDate ? (S(),
|
|
1326
|
+
o.lastClosingDate ? (S(), G(A, {
|
|
1325
1327
|
key: 1,
|
|
1326
|
-
label: `${s(v)("inventory.transfer.form.lastClosing")}: ${s(Ge)(o.lastClosingDate)} ${s(
|
|
1328
|
+
label: `${s(v)("inventory.transfer.form.lastClosing")}: ${s(Ge)(o.lastClosingDate)} ${s(Bt)(o.lastClosingDate)}`,
|
|
1327
1329
|
icon: "calendar_month",
|
|
1328
1330
|
compact: ""
|
|
1329
|
-
}, null, 8, ["label"])) :
|
|
1331
|
+
}, null, 8, ["label"])) : j("", !0)
|
|
1330
1332
|
]),
|
|
1331
|
-
|
|
1333
|
+
b(pe, {
|
|
1332
1334
|
ref_key: "formRef",
|
|
1333
1335
|
ref: me,
|
|
1334
1336
|
class: "flex flex-col gap-32",
|
|
1335
1337
|
disabled: o.disabled,
|
|
1336
1338
|
onValidationFailed: console.log,
|
|
1337
|
-
onValidationSuccess:
|
|
1339
|
+
onValidationSuccess: f[14] || (f[14] = (be) => x("validation-success"))
|
|
1338
1340
|
}, {
|
|
1339
1341
|
default: R(() => {
|
|
1340
1342
|
var be, at, nt, lt, rt, it, ut, dt;
|
|
1341
1343
|
return [
|
|
1342
|
-
n("div",
|
|
1343
|
-
n("div",
|
|
1344
|
-
(be =
|
|
1345
|
-
n("div",
|
|
1346
|
-
|
|
1344
|
+
n("div", po, [
|
|
1345
|
+
n("div", fo, [
|
|
1346
|
+
(be = p.modelValue) != null && be.template ? (S(), T(de, { key: 0 }, [
|
|
1347
|
+
n("div", vo, [
|
|
1348
|
+
b(H, {
|
|
1347
1349
|
label: s(v)("inventory.transfer.form.type.title")
|
|
1348
1350
|
}, null, 8, ["label"]),
|
|
1349
|
-
n("div",
|
|
1350
|
-
|
|
1351
|
+
n("div", yo, [
|
|
1352
|
+
b(W, {
|
|
1351
1353
|
"z-index": 51,
|
|
1352
1354
|
placement: "left",
|
|
1353
1355
|
disabled: o.disabled
|
|
1354
1356
|
}, {
|
|
1355
|
-
content: R(() =>
|
|
1356
|
-
|
|
1357
|
+
content: R(() => f[15] || (f[15] = [
|
|
1358
|
+
Ie("This field is locked from template.")
|
|
1357
1359
|
])),
|
|
1358
1360
|
default: R(() => [
|
|
1359
|
-
|
|
1361
|
+
b(re, null, {
|
|
1360
1362
|
default: R(() => [
|
|
1361
|
-
n("div",
|
|
1362
|
-
|
|
1363
|
+
n("div", bo, [
|
|
1364
|
+
b(le, {
|
|
1363
1365
|
name: "lock_outline",
|
|
1364
1366
|
size: "sm",
|
|
1365
1367
|
color: o.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1366
1368
|
}, null, 8, ["color"]),
|
|
1367
1369
|
n("div", {
|
|
1368
|
-
class:
|
|
1369
|
-
},
|
|
1370
|
+
class: Z({ "text-fm-color-typo-disabled": o.disabled })
|
|
1371
|
+
}, q(s(v)(`inventory.transfer.form.type.${K.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1370
1372
|
])
|
|
1371
1373
|
]),
|
|
1372
1374
|
_: 1
|
|
@@ -1375,40 +1377,40 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1375
1377
|
_: 1
|
|
1376
1378
|
}, 8, ["disabled"]),
|
|
1377
1379
|
n("div", {
|
|
1378
|
-
class:
|
|
1380
|
+
class: Z([
|
|
1379
1381
|
"fm-typo-en-body-sm-400",
|
|
1380
1382
|
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1381
1383
|
])
|
|
1382
1384
|
}, null, 2)
|
|
1383
1385
|
])
|
|
1384
1386
|
]),
|
|
1385
|
-
n("div",
|
|
1386
|
-
|
|
1387
|
-
label:
|
|
1387
|
+
n("div", go, [
|
|
1388
|
+
b(H, {
|
|
1389
|
+
label: K.value === s(ne).PURCHASE ? s(v)("inventory.transfer.form.purchaseFrom") : s(v)("inventory.transfer.form.transferFrom")
|
|
1388
1390
|
}, null, 8, ["label"]),
|
|
1389
|
-
n("div",
|
|
1390
|
-
|
|
1391
|
+
n("div", _o, [
|
|
1392
|
+
b(W, {
|
|
1391
1393
|
"z-index": 51,
|
|
1392
1394
|
placement: "left",
|
|
1393
1395
|
disabled: o.disabled
|
|
1394
1396
|
}, {
|
|
1395
|
-
content: R(() =>
|
|
1396
|
-
|
|
1397
|
+
content: R(() => f[16] || (f[16] = [
|
|
1398
|
+
Ie("This field is locked from template.")
|
|
1397
1399
|
])),
|
|
1398
1400
|
default: R(() => [
|
|
1399
|
-
|
|
1401
|
+
b(re, null, {
|
|
1400
1402
|
default: R(() => {
|
|
1401
1403
|
var V;
|
|
1402
1404
|
return [
|
|
1403
|
-
n("div",
|
|
1404
|
-
|
|
1405
|
+
n("div", ho, [
|
|
1406
|
+
b(le, {
|
|
1405
1407
|
name: "lock_outline",
|
|
1406
1408
|
size: "sm",
|
|
1407
1409
|
color: o.disabled ? "neutral-gray-200" : "neutral-gray-400"
|
|
1408
1410
|
}, null, 8, ["color"]),
|
|
1409
1411
|
n("div", {
|
|
1410
|
-
class:
|
|
1411
|
-
},
|
|
1412
|
+
class: Z({ "text-fm-color-typo-disabled": o.disabled })
|
|
1413
|
+
}, q((V = E.value.find((oe) => oe.value === U.value)) == null ? void 0 : V.label), 3)
|
|
1412
1414
|
])
|
|
1413
1415
|
];
|
|
1414
1416
|
}),
|
|
@@ -1419,39 +1421,39 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1419
1421
|
}, 8, ["disabled"])
|
|
1420
1422
|
])
|
|
1421
1423
|
])
|
|
1422
|
-
], 64)) : (S(),
|
|
1423
|
-
|
|
1424
|
+
], 64)) : (S(), T(de, { key: 1 }, [
|
|
1425
|
+
b(ie, {
|
|
1424
1426
|
label: s(v)("inventory.transfer.form.type.title"),
|
|
1425
1427
|
"label-mark": "required",
|
|
1426
|
-
modelValue:
|
|
1427
|
-
"onUpdate:modelValue":
|
|
1428
|
-
items:
|
|
1429
|
-
rules: [s(qe)(1)(
|
|
1428
|
+
modelValue: K.value,
|
|
1429
|
+
"onUpdate:modelValue": f[0] || (f[0] = (V) => K.value = V),
|
|
1430
|
+
items: De.value,
|
|
1431
|
+
rules: [s(qe)(1)(De.value)]
|
|
1430
1432
|
}, {
|
|
1431
1433
|
default: R(() => [
|
|
1432
1434
|
n("span", {
|
|
1433
|
-
class:
|
|
1435
|
+
class: Z([
|
|
1434
1436
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1435
1437
|
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1436
1438
|
])
|
|
1437
|
-
},
|
|
1439
|
+
}, q(s(zt)(K.value)), 3)
|
|
1438
1440
|
]),
|
|
1439
1441
|
_: 1
|
|
1440
1442
|
}, 8, ["label", "modelValue", "items", "rules"]),
|
|
1441
|
-
|
|
1442
|
-
label:
|
|
1443
|
+
b(ie, {
|
|
1444
|
+
label: K.value === s(ne).PURCHASE ? s(v)("inventory.transfer.form.purchaseFrom") : s(v)("inventory.transfer.form.transferFrom"),
|
|
1443
1445
|
"label-mark": "required",
|
|
1444
|
-
modelValue:
|
|
1445
|
-
"onUpdate:modelValue":
|
|
1446
|
-
items:
|
|
1447
|
-
rules: [s(qe)(1)(
|
|
1446
|
+
modelValue: U.value,
|
|
1447
|
+
"onUpdate:modelValue": f[1] || (f[1] = (V) => U.value = V),
|
|
1448
|
+
items: E.value,
|
|
1449
|
+
rules: [s(qe)(1)(E.value)]
|
|
1448
1450
|
}, {
|
|
1449
1451
|
"menu-wrapper": R((V) => {
|
|
1450
|
-
var
|
|
1452
|
+
var oe, Ae;
|
|
1451
1453
|
return [
|
|
1452
|
-
|
|
1453
|
-
items:
|
|
1454
|
-
"model-value": (Ae = (
|
|
1454
|
+
b(vs, Ze(V, {
|
|
1455
|
+
items: E.value,
|
|
1456
|
+
"model-value": (Ae = (oe = o.modelValue) == null ? void 0 : oe.supplier) == null ? void 0 : Ae._id
|
|
1455
1457
|
}), null, 16, ["items", "model-value"])
|
|
1456
1458
|
];
|
|
1457
1459
|
}),
|
|
@@ -1459,103 +1461,103 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1459
1461
|
var V;
|
|
1460
1462
|
return [
|
|
1461
1463
|
n("span", {
|
|
1462
|
-
class:
|
|
1464
|
+
class: Z([
|
|
1463
1465
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
1464
1466
|
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
1465
1467
|
])
|
|
1466
|
-
},
|
|
1468
|
+
}, q((V = E.value.find((oe) => oe.value === U.value)) == null ? void 0 : V.label), 3)
|
|
1467
1469
|
];
|
|
1468
1470
|
}),
|
|
1469
1471
|
_: 1
|
|
1470
1472
|
}, 8, ["label", "modelValue", "items", "rules"])
|
|
1471
1473
|
], 64)),
|
|
1472
|
-
|
|
1474
|
+
b(ze, {
|
|
1473
1475
|
label: s(v)("inventory.transfer.form.reference"),
|
|
1474
1476
|
"label-mark": "optional",
|
|
1475
1477
|
modelValue: s(t).ref,
|
|
1476
|
-
"onUpdate:modelValue":
|
|
1478
|
+
"onUpdate:modelValue": f[2] || (f[2] = (V) => s(t).ref = V)
|
|
1477
1479
|
}, null, 8, ["label", "modelValue"]),
|
|
1478
|
-
|
|
1480
|
+
b(Le, {
|
|
1479
1481
|
label: s(v)("inventory.transfer.form.remark"),
|
|
1480
1482
|
"label-mark": "optional",
|
|
1481
1483
|
"max-length": 240,
|
|
1482
1484
|
modelValue: P.value,
|
|
1483
|
-
"onUpdate:modelValue":
|
|
1484
|
-
class:
|
|
1485
|
+
"onUpdate:modelValue": f[3] || (f[3] = (V) => P.value = V),
|
|
1486
|
+
class: Z([o.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1485
1487
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1486
|
-
_.value ? (S(),
|
|
1488
|
+
_.value ? (S(), G(uo, {
|
|
1487
1489
|
key: 2,
|
|
1488
1490
|
required: s(t).template != null,
|
|
1489
1491
|
disabled: o.disabled,
|
|
1490
1492
|
supplier: s(t).supplier,
|
|
1491
1493
|
setting: s(t).netSuite,
|
|
1492
1494
|
items: s(t).items,
|
|
1493
|
-
onChange: (V,
|
|
1494
|
-
s(t).items = V, s(t).netSuite =
|
|
1495
|
+
onChange: (V, oe) => {
|
|
1496
|
+
s(t).items = V, s(t).netSuite = oe;
|
|
1495
1497
|
},
|
|
1496
|
-
"onNetsuite:ready":
|
|
1498
|
+
"onNetsuite:ready": f[4] || (f[4] = (V) => {
|
|
1497
1499
|
h.value = !0;
|
|
1498
1500
|
})
|
|
1499
|
-
}, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) :
|
|
1500
|
-
s(u).enableBackdatePo ? (S(),
|
|
1501
|
+
}, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : j("", !0),
|
|
1502
|
+
s(u).enableBackdatePo ? (S(), T("div", ko, [
|
|
1501
1503
|
n("div", {
|
|
1502
|
-
class:
|
|
1504
|
+
class: Z([
|
|
1503
1505
|
"flex",
|
|
1504
1506
|
{
|
|
1505
1507
|
"flex-col": i.value
|
|
1506
1508
|
}
|
|
1507
1509
|
])
|
|
1508
1510
|
}, [
|
|
1509
|
-
|
|
1511
|
+
b(Pe, {
|
|
1510
1512
|
modelValue: s(c),
|
|
1511
|
-
"onUpdate:modelValue":
|
|
1513
|
+
"onUpdate:modelValue": f[5] || (f[5] = (V) => xe(c) ? c.value = V : null),
|
|
1512
1514
|
label: s(v)("inventory.transfer.form.backdate.title"),
|
|
1513
1515
|
sublabel: s(v)("inventory.transfer.form.backdate.subtitle"),
|
|
1514
1516
|
"label-placement": "right",
|
|
1515
|
-
disabled:
|
|
1517
|
+
disabled: B.value && !o.lastClosingDate || o.disabled
|
|
1516
1518
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1517
1519
|
n("div", {
|
|
1518
|
-
class:
|
|
1520
|
+
class: Z({ hidden: i.value, "w-16": !i.value })
|
|
1519
1521
|
}, null, 2),
|
|
1520
|
-
s(c) ? (S(),
|
|
1521
|
-
n("div",
|
|
1522
|
-
|
|
1523
|
-
modelValue: s(
|
|
1524
|
-
"onUpdate:modelValue":
|
|
1522
|
+
s(c) ? (S(), T("div", xo, [
|
|
1523
|
+
n("div", Co, [
|
|
1524
|
+
b(z, {
|
|
1525
|
+
modelValue: s(O),
|
|
1526
|
+
"onUpdate:modelValue": f[6] || (f[6] = (V) => xe(O) ? O.value = V : null)
|
|
1525
1527
|
}, null, 8, ["modelValue"])
|
|
1526
1528
|
]),
|
|
1527
|
-
n("div",
|
|
1528
|
-
|
|
1529
|
-
modelValue: s(
|
|
1530
|
-
"onUpdate:modelValue":
|
|
1529
|
+
n("div", So, [
|
|
1530
|
+
b(te, {
|
|
1531
|
+
modelValue: s(ee),
|
|
1532
|
+
"onUpdate:modelValue": f[7] || (f[7] = (V) => xe(ee) ? ee.value = V : null)
|
|
1531
1533
|
}, null, 8, ["modelValue"])
|
|
1532
1534
|
])
|
|
1533
|
-
])) :
|
|
1535
|
+
])) : j("", !0)
|
|
1534
1536
|
], 2),
|
|
1535
|
-
s(d) ? (S(),
|
|
1537
|
+
s(d) ? (S(), G(ae, {
|
|
1536
1538
|
key: 0,
|
|
1537
1539
|
modelValue: s(d),
|
|
1538
|
-
"onUpdate:modelValue":
|
|
1540
|
+
"onUpdate:modelValue": f[8] || (f[8] = (V) => xe(d) ? d.value = V : null),
|
|
1539
1541
|
rules: [s(Lt)(new Date(o.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1540
|
-
}, null, 8, ["modelValue", "rules"])) :
|
|
1541
|
-
|
|
1542
|
-
|
|
1542
|
+
}, null, 8, ["modelValue", "rules"])) : j("", !0),
|
|
1543
|
+
B.value && !o.lastClosingDate ? (S(), T("div", wo, [
|
|
1544
|
+
b(le, {
|
|
1543
1545
|
name: "error",
|
|
1544
1546
|
size: "sm",
|
|
1545
1547
|
class: "text-fm-color-typo-warning"
|
|
1546
1548
|
}),
|
|
1547
|
-
n("span",
|
|
1548
|
-
])) :
|
|
1549
|
-
])) :
|
|
1549
|
+
n("span", Fo, q(s(v)("inventory.transfer.form.backdate.error")), 1)
|
|
1550
|
+
])) : j("", !0)
|
|
1551
|
+
])) : j("", !0)
|
|
1550
1552
|
])
|
|
1551
1553
|
]),
|
|
1552
|
-
n("div",
|
|
1553
|
-
|
|
1554
|
+
n("div", $o, [
|
|
1555
|
+
b(ae, {
|
|
1554
1556
|
"model-value": s(t).items,
|
|
1555
1557
|
rules: [s(qe)(1)]
|
|
1556
1558
|
}, null, 8, ["model-value", "rules"]),
|
|
1557
1559
|
n("div", {
|
|
1558
|
-
class:
|
|
1560
|
+
class: Z([
|
|
1559
1561
|
"flex gap-16",
|
|
1560
1562
|
{
|
|
1561
1563
|
"flex-col items-start": i.value,
|
|
@@ -1563,9 +1565,9 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1563
1565
|
}
|
|
1564
1566
|
])
|
|
1565
1567
|
}, [
|
|
1566
|
-
n("div",
|
|
1568
|
+
n("div", Io, q(s(v)("inventory.transfer.form.items.title")), 1),
|
|
1567
1569
|
n("div", To, [
|
|
1568
|
-
|
|
1570
|
+
b(se, {
|
|
1569
1571
|
disabled: o.disabled,
|
|
1570
1572
|
label: s(v)("inventory.transfer.form.items.addItem"),
|
|
1571
1573
|
"prepend-icon": "add",
|
|
@@ -1573,37 +1575,37 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1573
1575
|
"text-color": "primary",
|
|
1574
1576
|
"bg-color": "transparent",
|
|
1575
1577
|
"border-color": "primary",
|
|
1576
|
-
onClick:
|
|
1578
|
+
onClick: f[9] || (f[9] = (V) => Fe()),
|
|
1577
1579
|
size: "md"
|
|
1578
1580
|
}, null, 8, ["disabled", "label"]),
|
|
1579
|
-
|
|
1581
|
+
b(Js, {
|
|
1580
1582
|
"template-id": s(t).template || void 0,
|
|
1581
|
-
"template-items":
|
|
1583
|
+
"template-items": Be.value,
|
|
1582
1584
|
"po-items": s(t).items,
|
|
1583
|
-
"onUpdate:forecastAmounts":
|
|
1584
|
-
|
|
1585
|
+
"onUpdate:forecastAmounts": f[10] || (f[10] = (V) => {
|
|
1586
|
+
l.value = V;
|
|
1585
1587
|
}),
|
|
1586
|
-
"onUpdate:poItems":
|
|
1588
|
+
"onUpdate:poItems": f[11] || (f[11] = (V) => {
|
|
1587
1589
|
s(t).items = V, C.value++;
|
|
1588
1590
|
})
|
|
1589
1591
|
}, null, 8, ["template-id", "template-items", "po-items"])
|
|
1590
1592
|
])
|
|
1591
1593
|
], 2),
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
+
K.value === s(ne).PURCHASE && D.value && s(u).enableTotalCost && ((at = o.modelValue) != null && at.items.length) ? (S(), T("div", Do, [
|
|
1595
|
+
b(Pe, {
|
|
1594
1596
|
label: s(ke) ? s(v)("inventory.transfer.form.items.fetchingData") : s(v)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1595
1597
|
"prepend-icon": "compare_arrows",
|
|
1596
1598
|
"label-placement": "right",
|
|
1597
|
-
"model-value": s(
|
|
1598
|
-
"onUpdate:modelValue":
|
|
1599
|
+
"model-value": s(X),
|
|
1600
|
+
"onUpdate:modelValue": f[12] || (f[12] = (V) => xe(X) ? X.value = V : null),
|
|
1599
1601
|
disabled: s(ke) || o.disabled
|
|
1600
1602
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1601
|
-
])) :
|
|
1602
|
-
|
|
1603
|
+
])) : j("", !0),
|
|
1604
|
+
b(ae, {
|
|
1603
1605
|
"model-value": Ve.value,
|
|
1604
1606
|
rules: [() => Ve.value ? "Must have at least one non-zero item" : !0]
|
|
1605
1607
|
}, null, 8, ["model-value", "rules"]),
|
|
1606
|
-
(S(),
|
|
1608
|
+
(S(), G(ue, {
|
|
1607
1609
|
"column-defs": Ne.value,
|
|
1608
1610
|
"column-visibility": {
|
|
1609
1611
|
[s(J).Code]: !(((nt = o.modelValue) == null ? void 0 : nt.template) ?? ((lt = o.modelValue) == null ? void 0 : lt.templateDoc)),
|
|
@@ -1616,31 +1618,31 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1616
1618
|
"page-size": s(t).items.length
|
|
1617
1619
|
}, {
|
|
1618
1620
|
"table-row": R((V) => {
|
|
1619
|
-
var
|
|
1621
|
+
var oe, Ae, ct, mt;
|
|
1620
1622
|
return [
|
|
1621
|
-
|
|
1623
|
+
b(ao, {
|
|
1622
1624
|
"compare-price-by-sku": s(ve),
|
|
1623
|
-
"show-compare-price":
|
|
1625
|
+
"show-compare-price": K.value === s(ne).PURCHASE && s(X),
|
|
1624
1626
|
row: V,
|
|
1625
|
-
"template-item": (mt = (ct = (Ae = (
|
|
1627
|
+
"template-item": (mt = (ct = (Ae = (oe = o.modelValue) == null ? void 0 : oe.templateDoc) == null ? void 0 : Ae.purchaseOrder) == null ? void 0 : ct.items) == null ? void 0 : mt.find(
|
|
1626
1628
|
(Ke) => Ke.sku._id === V.original.sku._id
|
|
1627
1629
|
),
|
|
1628
|
-
"onUpdate:item":
|
|
1630
|
+
"onUpdate:item": f[13] || (f[13] = (Ke) => we.value.updateItem(Ke)),
|
|
1629
1631
|
disabled: o.disabled
|
|
1630
1632
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "template-item", "disabled"])
|
|
1631
1633
|
];
|
|
1632
1634
|
}),
|
|
1633
1635
|
"list-row": R((V) => [
|
|
1634
|
-
(S(),
|
|
1636
|
+
(S(), G(xt, {
|
|
1635
1637
|
row: V,
|
|
1636
|
-
key: s(t).items.map((
|
|
1638
|
+
key: s(t).items.map((oe) => oe.sku._id).join(".")
|
|
1637
1639
|
}, {
|
|
1638
|
-
default: R((
|
|
1639
|
-
|
|
1640
|
+
default: R((oe) => [
|
|
1641
|
+
b(Os, {
|
|
1640
1642
|
"compare-price-by-sku": s(ve),
|
|
1641
|
-
"show-compare-price":
|
|
1643
|
+
"show-compare-price": K.value === s(ne).PURCHASE && s(X),
|
|
1642
1644
|
row: V,
|
|
1643
|
-
"cell-by-col-id":
|
|
1645
|
+
"cell-by-col-id": oe
|
|
1644
1646
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
|
|
1645
1647
|
]),
|
|
1646
1648
|
_: 2
|
|
@@ -1656,7 +1658,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1656
1658
|
]);
|
|
1657
1659
|
};
|
|
1658
1660
|
}
|
|
1659
|
-
}),
|
|
1661
|
+
}), Po = { class: "flex items-center" }, Ro = { class: "fm-typo-en-title-md-800" }, Ao = { class: "flex gap-4" }, Eo = /* @__PURE__ */ ce({
|
|
1660
1662
|
__name: "TransferDialog",
|
|
1661
1663
|
props: {
|
|
1662
1664
|
mode: {},
|
|
@@ -1666,9 +1668,9 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1666
1668
|
lastClosingDate: {}
|
|
1667
1669
|
},
|
|
1668
1670
|
emits: ["update:show", "submitted"],
|
|
1669
|
-
setup(g, { expose: w, emit:
|
|
1671
|
+
setup(g, { expose: w, emit: r }) {
|
|
1670
1672
|
var P;
|
|
1671
|
-
const
|
|
1673
|
+
const p = g, x = r, t = tt(), v = wt(), F = Te(), $ = ot(), y = et(), e = Je(), { t: u } = he(), k = M(!1), a = M(!1), i = M(!1);
|
|
1672
1674
|
async function h(d) {
|
|
1673
1675
|
if (d) {
|
|
1674
1676
|
a.value = !1;
|
|
@@ -1714,20 +1716,20 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1714
1716
|
_id: "",
|
|
1715
1717
|
seqNumber: 0,
|
|
1716
1718
|
deliveryOrder: [],
|
|
1717
|
-
template:
|
|
1718
|
-
templateDoc: v.templates.find((c) => c._id ===
|
|
1719
|
+
template: p.templateId,
|
|
1720
|
+
templateDoc: v.templates.find((c) => c._id === p.templateId)
|
|
1719
1721
|
};
|
|
1720
1722
|
}
|
|
1721
|
-
const C = St(
|
|
1723
|
+
const C = St(p, "show"), l = M(p.modelValue ?? _()), m = M(((P = p.modelValue) == null ? void 0 : P._id) ?? `${Math.random()}`);
|
|
1722
1724
|
_e(
|
|
1723
|
-
() =>
|
|
1725
|
+
() => p.show,
|
|
1724
1726
|
(d) => {
|
|
1725
1727
|
var c;
|
|
1726
|
-
d && (i.value = !1,
|
|
1728
|
+
d && (i.value = !1, l.value = p.modelValue ?? _(), m.value = ((c = p.modelValue) == null ? void 0 : c._id) ?? `${Math.random()}`);
|
|
1727
1729
|
}
|
|
1728
1730
|
);
|
|
1729
|
-
const
|
|
1730
|
-
switch (
|
|
1731
|
+
const D = N(() => !a.value || !i.value), B = N(() => {
|
|
1732
|
+
switch (p.mode) {
|
|
1731
1733
|
case Ee.READ:
|
|
1732
1734
|
return "View transfer";
|
|
1733
1735
|
case Ee.CREATE:
|
|
@@ -1736,23 +1738,23 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1736
1738
|
return u("inventory.transfer.receiveRequest.update.title");
|
|
1737
1739
|
}
|
|
1738
1740
|
return "";
|
|
1739
|
-
}),
|
|
1741
|
+
}), Q = M();
|
|
1740
1742
|
w({
|
|
1741
1743
|
validateInputs: () => {
|
|
1742
1744
|
var d, c;
|
|
1743
|
-
(c = (d =
|
|
1745
|
+
(c = (d = Q.value) == null ? void 0 : d.validateInputs) == null || c.call(d);
|
|
1744
1746
|
},
|
|
1745
1747
|
resetInputsValidation: () => {
|
|
1746
1748
|
var d, c;
|
|
1747
|
-
(c = (d =
|
|
1749
|
+
(c = (d = Q.value) == null ? void 0 : d.resetInputsValidation) == null || c.call(d);
|
|
1748
1750
|
},
|
|
1749
1751
|
resetInputs: () => {
|
|
1750
1752
|
var d, c;
|
|
1751
|
-
(c = (d =
|
|
1753
|
+
(c = (d = Q.value) == null ? void 0 : d.resetInputs) == null || c.call(d);
|
|
1752
1754
|
}
|
|
1753
1755
|
});
|
|
1754
|
-
async function
|
|
1755
|
-
const d =
|
|
1756
|
+
async function Y() {
|
|
1757
|
+
const d = l.value;
|
|
1756
1758
|
if (k.value = !0, d.items = d.items.filter((c) => c.quantity.amount > 0), !d.items.length) {
|
|
1757
1759
|
F.open({
|
|
1758
1760
|
title: "Cannot create order",
|
|
@@ -1761,7 +1763,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1761
1763
|
});
|
|
1762
1764
|
return;
|
|
1763
1765
|
}
|
|
1764
|
-
(d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...
|
|
1766
|
+
(d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...O }) => O));
|
|
1765
1767
|
try {
|
|
1766
1768
|
await t.createPurchaseOrder(d), await new Promise((c) => setTimeout(c, 1e3)), F.open({
|
|
1767
1769
|
title: u("inventory.transfer.receiveRequest.create.success"),
|
|
@@ -1778,8 +1780,8 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1778
1780
|
k.value = !1;
|
|
1779
1781
|
}
|
|
1780
1782
|
}
|
|
1781
|
-
async function
|
|
1782
|
-
const d =
|
|
1783
|
+
async function K() {
|
|
1784
|
+
const d = l.value;
|
|
1783
1785
|
if (k.value = !0, d.items = d.items.filter((c) => c.quantity.amount > 0), !d.items.length) {
|
|
1784
1786
|
F.open({
|
|
1785
1787
|
title: "Cannot create order",
|
|
@@ -1788,7 +1790,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1788
1790
|
});
|
|
1789
1791
|
return;
|
|
1790
1792
|
}
|
|
1791
|
-
(d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...
|
|
1793
|
+
(d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...O }) => O));
|
|
1792
1794
|
try {
|
|
1793
1795
|
await t.updatePurchaseOrder(d), await new Promise((c) => setTimeout(c, 1e3)), F.open({
|
|
1794
1796
|
title: u("inventory.transfer.receiveRequest.update.success"),
|
|
@@ -1805,61 +1807,74 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1805
1807
|
k.value = !1;
|
|
1806
1808
|
}
|
|
1807
1809
|
}
|
|
1808
|
-
function
|
|
1809
|
-
switch (
|
|
1810
|
+
function E() {
|
|
1811
|
+
switch (p.mode) {
|
|
1810
1812
|
case Ee.CREATE:
|
|
1811
|
-
return Q();
|
|
1812
|
-
case Ee.UPDATE:
|
|
1813
1813
|
return Y();
|
|
1814
|
+
case Ee.UPDATE:
|
|
1815
|
+
return K();
|
|
1814
1816
|
}
|
|
1815
1817
|
}
|
|
1816
|
-
function
|
|
1817
|
-
var
|
|
1818
|
-
|
|
1818
|
+
function U() {
|
|
1819
|
+
var O, ee;
|
|
1820
|
+
const d = jt.validatePurchaseOrderItems({
|
|
1821
|
+
skusById: y.skuById ?? {},
|
|
1822
|
+
items: l.value.items ?? []
|
|
1823
|
+
}), c = Object.values(d).flat();
|
|
1824
|
+
if (c.length > 0) {
|
|
1825
|
+
const X = c[0];
|
|
1826
|
+
F.open({
|
|
1827
|
+
title: `[Row ${X.index + 1}] "${X.poItem.sku.name}"`,
|
|
1828
|
+
message: `${X.message}`,
|
|
1829
|
+
type: "error"
|
|
1830
|
+
});
|
|
1831
|
+
return;
|
|
1832
|
+
}
|
|
1833
|
+
(ee = (O = Q.value) == null ? void 0 : O.validateInputs) == null || ee.call(O);
|
|
1819
1834
|
}
|
|
1820
1835
|
return (d, c) => {
|
|
1821
|
-
const
|
|
1822
|
-
return S(),
|
|
1836
|
+
const O = I("FmButton"), ee = I("FmSideSheet");
|
|
1837
|
+
return S(), G(ee, {
|
|
1823
1838
|
modelValue: s(C),
|
|
1824
|
-
"onUpdate:modelValue": c[3] || (c[3] = (
|
|
1839
|
+
"onUpdate:modelValue": c[3] || (c[3] = (X) => xe(C) ? C.value = X : null),
|
|
1825
1840
|
"dismiss-away": "",
|
|
1826
1841
|
"close-button": "",
|
|
1827
1842
|
"max-width": 900
|
|
1828
1843
|
}, {
|
|
1829
1844
|
"side-sheet-header": R(() => [
|
|
1830
|
-
n("div",
|
|
1831
|
-
n("div",
|
|
1845
|
+
n("div", Po, [
|
|
1846
|
+
n("div", Ro, q(B.value), 1)
|
|
1832
1847
|
])
|
|
1833
1848
|
]),
|
|
1834
1849
|
default: R(() => [
|
|
1835
|
-
(S(),
|
|
1850
|
+
(S(), G(Vo, {
|
|
1836
1851
|
class: "w-full",
|
|
1837
1852
|
ref_key: "formRef",
|
|
1838
|
-
ref:
|
|
1853
|
+
ref: Q,
|
|
1839
1854
|
"onForm:ready": c[0] || (c[0] = () => i.value = !0),
|
|
1840
|
-
onValidationSuccess:
|
|
1841
|
-
modelValue:
|
|
1842
|
-
"onUpdate:modelValue": c[1] || (c[1] = (
|
|
1843
|
-
disabled: k.value ||
|
|
1855
|
+
onValidationSuccess: E,
|
|
1856
|
+
modelValue: l.value,
|
|
1857
|
+
"onUpdate:modelValue": c[1] || (c[1] = (X) => l.value = X),
|
|
1858
|
+
disabled: k.value || D.value,
|
|
1844
1859
|
suppliers: s($).suppliers,
|
|
1845
|
-
skus: s(
|
|
1860
|
+
skus: s(y).skus,
|
|
1846
1861
|
key: m.value,
|
|
1847
1862
|
"last-closing-date": d.lastClosingDate
|
|
1848
1863
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1849
1864
|
]),
|
|
1850
1865
|
"side-sheet-footer": R(() => [
|
|
1851
|
-
n("div",
|
|
1852
|
-
|
|
1866
|
+
n("div", Ao, [
|
|
1867
|
+
b(O, {
|
|
1853
1868
|
loading: k.value,
|
|
1854
|
-
disabled:
|
|
1869
|
+
disabled: D.value,
|
|
1855
1870
|
label: s(u)("common.save"),
|
|
1856
|
-
onClick:
|
|
1871
|
+
onClick: U
|
|
1857
1872
|
}, null, 8, ["loading", "disabled", "label"]),
|
|
1858
|
-
|
|
1859
|
-
disabled:
|
|
1873
|
+
b(O, {
|
|
1874
|
+
disabled: D.value,
|
|
1860
1875
|
variant: "tertiary",
|
|
1861
1876
|
label: s(u)("common.close"),
|
|
1862
|
-
onClick: c[2] || (c[2] = (
|
|
1877
|
+
onClick: c[2] || (c[2] = (X) => x("update:show", !1))
|
|
1863
1878
|
}, null, 8, ["disabled", "label"])
|
|
1864
1879
|
])
|
|
1865
1880
|
]),
|
|
@@ -1868,17 +1883,17 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
|
|
|
1868
1883
|
};
|
|
1869
1884
|
}
|
|
1870
1885
|
});
|
|
1871
|
-
function
|
|
1872
|
-
const [w,
|
|
1886
|
+
function Oo(g) {
|
|
1887
|
+
const [w, r, p, ...x] = Qt(g), t = p.map((y) => y.toLowerCase().trim().replace(/ /g, "_")), F = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((y) => !t.includes(y));
|
|
1873
1888
|
if (F.length)
|
|
1874
1889
|
throw new Error(
|
|
1875
1890
|
`Missing headers (${F.join()}). Excel file does not come from the template.`
|
|
1876
1891
|
);
|
|
1877
|
-
return x.map((
|
|
1892
|
+
return x.map((y, e) => {
|
|
1878
1893
|
const u = {};
|
|
1879
1894
|
for (const k in t) {
|
|
1880
1895
|
const a = t[k];
|
|
1881
|
-
Object.assign(u, { [a]:
|
|
1896
|
+
Object.assign(u, { [a]: y[k] });
|
|
1882
1897
|
}
|
|
1883
1898
|
return {
|
|
1884
1899
|
index: e,
|
|
@@ -1886,12 +1901,12 @@ function Eo(g) {
|
|
|
1886
1901
|
};
|
|
1887
1902
|
});
|
|
1888
1903
|
}
|
|
1889
|
-
function
|
|
1904
|
+
function qo(g) {
|
|
1890
1905
|
const w = g.SheetNames;
|
|
1891
1906
|
try {
|
|
1892
1907
|
return w.reduce(
|
|
1893
|
-
(
|
|
1894
|
-
const t = new Array(), v = g.Sheets[x], F = et(), $ =
|
|
1908
|
+
(p, x) => {
|
|
1909
|
+
const t = new Array(), v = g.Sheets[x], F = et(), $ = Oo(v), y = [];
|
|
1895
1910
|
for (const { index: u, data: k } of $) {
|
|
1896
1911
|
k.scanned_code === "" && t.push(`Row ${u + 1}: Scanned code is empty`), k.item_name === "" && t.push(`Row ${u + 1}: Item name is empty`), k.uom === "" && t.push(`Row ${u + 1}: UOM is empty`), k["transfer_quantity(uom)"] === "" && t.push(`Row ${u + 1}: Transfer quantity is empty`);
|
|
1897
1912
|
const a = F.skus.find((_) => _.code === k.scanned_code);
|
|
@@ -1909,7 +1924,7 @@ function Oo(g) {
|
|
|
1909
1924
|
}
|
|
1910
1925
|
h = _;
|
|
1911
1926
|
}
|
|
1912
|
-
|
|
1927
|
+
y.push({
|
|
1913
1928
|
sku: a,
|
|
1914
1929
|
code: k.scanned_code,
|
|
1915
1930
|
name: k.item_name,
|
|
@@ -1919,31 +1934,31 @@ function Oo(g) {
|
|
|
1919
1934
|
}
|
|
1920
1935
|
const e = {
|
|
1921
1936
|
type: "create",
|
|
1922
|
-
poItems:
|
|
1937
|
+
poItems: y,
|
|
1923
1938
|
excelSheetName: x,
|
|
1924
1939
|
errors: t
|
|
1925
1940
|
};
|
|
1926
|
-
return
|
|
1941
|
+
return p.importCreateResult.push(e), p;
|
|
1927
1942
|
},
|
|
1928
1943
|
{
|
|
1929
1944
|
invalidExcel: !1,
|
|
1930
1945
|
importCreateResult: new Array()
|
|
1931
1946
|
}
|
|
1932
1947
|
);
|
|
1933
|
-
} catch (
|
|
1948
|
+
} catch (r) {
|
|
1934
1949
|
return {
|
|
1935
1950
|
invalidExcel: !0,
|
|
1936
|
-
invalidExcelMessage: (
|
|
1951
|
+
invalidExcelMessage: (r == null ? void 0 : r.message) ?? "Invalid excel",
|
|
1937
1952
|
importCreateResult: []
|
|
1938
1953
|
};
|
|
1939
1954
|
}
|
|
1940
1955
|
}
|
|
1941
|
-
const
|
|
1956
|
+
const Mo = exports.FfCalculator, Uo = { class: "flex flex-col flex-1" }, No = { class: "flex flex-col" }, Bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, zo = {
|
|
1942
1957
|
key: 0,
|
|
1943
1958
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1944
|
-
},
|
|
1945
|
-
class: /* @__PURE__ */
|
|
1946
|
-
},
|
|
1959
|
+
}, Lo = { key: 0 }, Ho = {
|
|
1960
|
+
class: /* @__PURE__ */ Z(["fm-typo-en-body-lg-600"])
|
|
1961
|
+
}, jo = { class: "flex-1" }, Qo = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, Yo = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, Ko = { class: "text-fm-color-typo-primary" }, Xo = { class: "ml-auto" }, Zo = { key: 0 }, Wo = /* @__PURE__ */ ce({
|
|
1947
1962
|
__name: "XilnexResult",
|
|
1948
1963
|
props: {
|
|
1949
1964
|
type: {},
|
|
@@ -1952,123 +1967,123 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
1952
1967
|
errors: {}
|
|
1953
1968
|
},
|
|
1954
1969
|
setup(g) {
|
|
1955
|
-
const w = g, { t:
|
|
1956
|
-
w.errors.length && (
|
|
1970
|
+
const w = g, { t: r } = he(), p = M(!1), x = () => {
|
|
1971
|
+
w.errors.length && (p.value = !p.value);
|
|
1957
1972
|
};
|
|
1958
1973
|
return (t, v) => {
|
|
1959
|
-
var
|
|
1960
|
-
const F =
|
|
1961
|
-
return S(),
|
|
1974
|
+
var y;
|
|
1975
|
+
const F = I("FmIcon"), $ = I("FmTooltip");
|
|
1976
|
+
return S(), T("div", Uo, [
|
|
1962
1977
|
n("div", {
|
|
1963
1978
|
onClick: x,
|
|
1964
|
-
class:
|
|
1979
|
+
class: Z({
|
|
1965
1980
|
"cursor-pointer": t.errors.length
|
|
1966
1981
|
})
|
|
1967
1982
|
}, [
|
|
1968
|
-
n("div",
|
|
1969
|
-
n("div",
|
|
1983
|
+
n("div", No, [
|
|
1984
|
+
n("div", Bo, [
|
|
1970
1985
|
n("div", {
|
|
1971
|
-
class:
|
|
1986
|
+
class: Z({
|
|
1972
1987
|
"text-fm-color-system-error-300": t.errors.length
|
|
1973
1988
|
})
|
|
1974
1989
|
}, [
|
|
1975
|
-
|
|
1976
|
-
t.type === "create" ? (S(),
|
|
1990
|
+
Ie(q(t.name) + " ", 1),
|
|
1991
|
+
t.type === "create" ? (S(), T("span", zo, "(" + q(s(r)("inventory.closing.template.import.new")) + ")", 1)) : j("", !0)
|
|
1977
1992
|
], 2),
|
|
1978
|
-
t.errors.length ? (S(),
|
|
1979
|
-
|
|
1993
|
+
t.errors.length ? (S(), T("div", Lo, [
|
|
1994
|
+
b(F, {
|
|
1980
1995
|
name: "error",
|
|
1981
1996
|
size: "sm",
|
|
1982
1997
|
color: "system-error-300"
|
|
1983
1998
|
})
|
|
1984
|
-
])) :
|
|
1999
|
+
])) : j("", !0)
|
|
1985
2000
|
]),
|
|
1986
2001
|
v[0] || (v[0] = n("hr", { class: "my-2" }, null, -1)),
|
|
1987
|
-
n("div",
|
|
1988
|
-
(
|
|
2002
|
+
n("div", Ho, [
|
|
2003
|
+
(y = t.items) != null && y.length ? (S(!0), T(de, { key: 0 }, Se(t.items, (e, u) => (S(), T("div", {
|
|
1989
2004
|
key: u,
|
|
1990
2005
|
class: "flex gap-4 mt-2 items-center"
|
|
1991
2006
|
}, [
|
|
1992
|
-
n("div",
|
|
1993
|
-
|
|
2007
|
+
n("div", jo, [
|
|
2008
|
+
b($, {
|
|
1994
2009
|
content: e.code,
|
|
1995
2010
|
placement: "top",
|
|
1996
2011
|
"z-index": 51
|
|
1997
2012
|
}, {
|
|
1998
2013
|
default: R(() => [
|
|
1999
|
-
n("span",
|
|
2014
|
+
n("span", Qo, q(e.code), 1)
|
|
2000
2015
|
]),
|
|
2001
2016
|
_: 2
|
|
2002
2017
|
}, 1032, ["content"]),
|
|
2003
|
-
|
|
2018
|
+
b($, {
|
|
2004
2019
|
content: e.name,
|
|
2005
2020
|
placement: "top",
|
|
2006
2021
|
"z-index": 51
|
|
2007
2022
|
}, {
|
|
2008
2023
|
default: R(() => [
|
|
2009
|
-
n("span",
|
|
2024
|
+
n("span", Yo, q(e.name), 1)
|
|
2010
2025
|
]),
|
|
2011
2026
|
_: 2
|
|
2012
2027
|
}, 1032, ["content"])
|
|
2013
2028
|
]),
|
|
2014
2029
|
n("div", null, [
|
|
2015
|
-
n("span",
|
|
2030
|
+
n("span", Ko, q(s(Mo).toFormatString({
|
|
2016
2031
|
value: e.quantity
|
|
2017
2032
|
})), 1),
|
|
2018
|
-
|
|
2033
|
+
Ie(" " + q(e.measurement ? e.measurement.abbrev : e.sku.unit.abbrev), 1)
|
|
2019
2034
|
])
|
|
2020
|
-
]))), 128)) :
|
|
2035
|
+
]))), 128)) : j("", !0)
|
|
2021
2036
|
])
|
|
2022
2037
|
]),
|
|
2023
|
-
n("div",
|
|
2024
|
-
t.errors.length ? (S(),
|
|
2038
|
+
n("div", Xo, [
|
|
2039
|
+
t.errors.length ? (S(), G(F, {
|
|
2025
2040
|
key: 0,
|
|
2026
|
-
name:
|
|
2041
|
+
name: p.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
2027
2042
|
size: "md"
|
|
2028
|
-
}, null, 8, ["name"])) :
|
|
2043
|
+
}, null, 8, ["name"])) : j("", !0)
|
|
2029
2044
|
])
|
|
2030
2045
|
], 2),
|
|
2031
|
-
|
|
2046
|
+
p.value ? (S(), T("div", {
|
|
2032
2047
|
key: 0,
|
|
2033
|
-
class:
|
|
2048
|
+
class: Z(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
|
|
2034
2049
|
"text-fm-color-typo-secondary": !t.errors.length,
|
|
2035
2050
|
"text-fm-color-system-error-300": t.errors.length
|
|
2036
2051
|
}])
|
|
2037
2052
|
}, [
|
|
2038
|
-
t.errors.length ? (S(),
|
|
2053
|
+
t.errors.length ? (S(), T("div", Zo, [
|
|
2039
2054
|
n("ol", null, [
|
|
2040
|
-
(S(!0),
|
|
2055
|
+
(S(!0), T(de, null, Se(t.errors, (e, u) => (S(), T("li", { key: u }, q(e), 1))), 128))
|
|
2041
2056
|
])
|
|
2042
|
-
])) :
|
|
2043
|
-
], 2)) :
|
|
2057
|
+
])) : j("", !0)
|
|
2058
|
+
], 2)) : j("", !0)
|
|
2044
2059
|
]);
|
|
2045
2060
|
};
|
|
2046
2061
|
}
|
|
2047
|
-
}),
|
|
2062
|
+
}), Go = { class: "flex flex-col gap-24" }, Jo = {
|
|
2048
2063
|
key: 0,
|
|
2049
2064
|
class: "flex items-center gap-8"
|
|
2050
|
-
},
|
|
2065
|
+
}, ea = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ta = { class: "flex flex-col gap-8" }, sa = { class: "line-clamp-2 text-ellipsis break-all" }, oa = {
|
|
2051
2066
|
key: 2,
|
|
2052
2067
|
class: "shrink-0"
|
|
2053
|
-
},
|
|
2068
|
+
}, aa = {
|
|
2054
2069
|
key: 0,
|
|
2055
2070
|
class: "flex flex-col"
|
|
2056
|
-
},
|
|
2071
|
+
}, na = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, la = {
|
|
2057
2072
|
key: 0,
|
|
2058
2073
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
2059
|
-
},
|
|
2074
|
+
}, ra = { class: "fm-typo-en-body-lg-600" }, vt = "Transfer note", ia = /* @__PURE__ */ ce({
|
|
2060
2075
|
__name: "XilnexImportForm",
|
|
2061
2076
|
setup(g, { expose: w }) {
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2064
|
-
const
|
|
2077
|
+
const r = M(null), p = Te(), x = M(!1), t = M(!1), v = kt(), F = M(!1), $ = Me();
|
|
2078
|
+
M([]);
|
|
2079
|
+
const y = N({
|
|
2065
2080
|
get() {
|
|
2066
|
-
var
|
|
2067
|
-
return ((
|
|
2081
|
+
var l;
|
|
2082
|
+
return ((l = v.supplier) == null ? void 0 : l.name) ?? "";
|
|
2068
2083
|
},
|
|
2069
|
-
set(
|
|
2070
|
-
|
|
2071
|
-
name:
|
|
2084
|
+
set(l) {
|
|
2085
|
+
l && (v.supplier = {
|
|
2086
|
+
name: l,
|
|
2072
2087
|
registrationNumber: "",
|
|
2073
2088
|
_id: "xilnex",
|
|
2074
2089
|
internal: "restaurant",
|
|
@@ -2084,93 +2099,93 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2084
2099
|
}
|
|
2085
2100
|
});
|
|
2086
2101
|
Qe(async () => {
|
|
2087
|
-
const
|
|
2088
|
-
console.log(
|
|
2102
|
+
const l = await $.getNetSuiteLocations();
|
|
2103
|
+
console.log(l), F.value = !0;
|
|
2089
2104
|
});
|
|
2090
|
-
const e =
|
|
2105
|
+
const e = N({
|
|
2091
2106
|
get() {
|
|
2092
2107
|
return "";
|
|
2093
2108
|
},
|
|
2094
|
-
set(
|
|
2095
|
-
if (
|
|
2096
|
-
const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [
|
|
2097
|
-
m.setFullYear(parseInt(
|
|
2109
|
+
set(l) {
|
|
2110
|
+
if (l) {
|
|
2111
|
+
const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [D, B, Q] = l.split("-");
|
|
2112
|
+
m.setFullYear(parseInt(D)), m.setMonth(parseInt(B) - 1), m.setDate(parseInt(Q)), v.effectiveAt = m.toISOString();
|
|
2098
2113
|
}
|
|
2099
2114
|
}
|
|
2100
|
-
}), u =
|
|
2115
|
+
}), u = N({
|
|
2101
2116
|
get() {
|
|
2102
2117
|
return null;
|
|
2103
2118
|
},
|
|
2104
|
-
set(
|
|
2105
|
-
if (
|
|
2106
|
-
const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [
|
|
2107
|
-
m.setMinutes(parseInt(
|
|
2119
|
+
set(l) {
|
|
2120
|
+
if (l) {
|
|
2121
|
+
const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [D, B] = l.split(":");
|
|
2122
|
+
m.setMinutes(parseInt(D)), m.setSeconds(parseInt(B)), v.effectiveAt = m.toISOString();
|
|
2108
2123
|
}
|
|
2109
2124
|
}
|
|
2110
|
-
}), k =
|
|
2111
|
-
() => !!k.value.length || a.value.some((
|
|
2112
|
-
), h =
|
|
2125
|
+
}), k = M(new Array()), a = M([]), i = N(
|
|
2126
|
+
() => !!k.value.length || a.value.some((l) => l.errors.length)
|
|
2127
|
+
), h = M();
|
|
2113
2128
|
w({
|
|
2114
2129
|
validateInputs: () => {
|
|
2115
|
-
var
|
|
2116
|
-
(m = (
|
|
2130
|
+
var l, m;
|
|
2131
|
+
(m = (l = h.value) == null ? void 0 : l.validateInputs) == null || m.call(l);
|
|
2117
2132
|
},
|
|
2118
2133
|
resetInputsValidation: () => {
|
|
2119
|
-
var
|
|
2120
|
-
(m = (
|
|
2134
|
+
var l, m;
|
|
2135
|
+
(m = (l = h.value) == null ? void 0 : l.resetInputsValidation) == null || m.call(l);
|
|
2121
2136
|
},
|
|
2122
2137
|
resetInputs: () => {
|
|
2123
|
-
var
|
|
2124
|
-
(m = (
|
|
2138
|
+
var l, m;
|
|
2139
|
+
(m = (l = h.value) == null ? void 0 : l.resetInputs) == null || m.call(l);
|
|
2125
2140
|
}
|
|
2126
2141
|
});
|
|
2127
2142
|
const { t: _ } = he();
|
|
2128
|
-
async function C(
|
|
2143
|
+
async function C(l) {
|
|
2129
2144
|
k.value = [], a.value = [];
|
|
2130
2145
|
try {
|
|
2131
2146
|
x.value = !0;
|
|
2132
2147
|
const [m] = await Promise.all([
|
|
2133
|
-
|
|
2148
|
+
Kt(l),
|
|
2134
2149
|
// fake buffer
|
|
2135
|
-
new Promise((
|
|
2136
|
-
]),
|
|
2137
|
-
if (
|
|
2150
|
+
new Promise((B) => setTimeout(B, 1e3))
|
|
2151
|
+
]), D = qo(m);
|
|
2152
|
+
if (D.invalidExcel) {
|
|
2138
2153
|
k.value.push(
|
|
2139
|
-
|
|
2154
|
+
D.invalidExcelMessage ?? _("inventory.ingredient.import.fileError.invalidExcel")
|
|
2140
2155
|
);
|
|
2141
2156
|
return;
|
|
2142
2157
|
}
|
|
2143
|
-
if (a.value =
|
|
2158
|
+
if (a.value = D.importCreateResult, !a.value.length) {
|
|
2144
2159
|
k.value.push(_("inventory.ingredient.import.fileError.noData"));
|
|
2145
2160
|
return;
|
|
2146
2161
|
}
|
|
2147
|
-
v.items = a.value.map((
|
|
2162
|
+
v.items = a.value.map((B) => B.poItems).flat();
|
|
2148
2163
|
} catch (m) {
|
|
2149
|
-
|
|
2164
|
+
p.open({
|
|
2150
2165
|
title: _("inventory.ingredient.import.fileError.unableToRead"),
|
|
2151
2166
|
message: m == null ? void 0 : m.message,
|
|
2152
2167
|
type: "error"
|
|
2153
2168
|
}), console.error("Error in reading file", m);
|
|
2154
2169
|
} finally {
|
|
2155
|
-
k.value.length &&
|
|
2170
|
+
k.value.length && p.open({
|
|
2156
2171
|
title: _("inventory.ingredient.import.fileError.invalidExcel"),
|
|
2157
2172
|
type: "error"
|
|
2158
2173
|
}), x.value = !1;
|
|
2159
2174
|
}
|
|
2160
2175
|
}
|
|
2161
|
-
return _e(
|
|
2162
|
-
|
|
2163
|
-
}), (
|
|
2164
|
-
const
|
|
2165
|
-
return S(),
|
|
2176
|
+
return _e(r, (l) => {
|
|
2177
|
+
l && C(l);
|
|
2178
|
+
}), (l, m) => {
|
|
2179
|
+
const D = I("FmSelect"), B = I("FmDatePicker"), Q = I("FmTimePicker"), Y = I("FmCircularProgress"), K = I("FmLabel"), E = I("FmIcon"), U = I("FmButton"), P = I("FmForm");
|
|
2180
|
+
return S(), G(P, {
|
|
2166
2181
|
ref_key: "formRef",
|
|
2167
2182
|
ref: h
|
|
2168
2183
|
}, {
|
|
2169
2184
|
default: R(() => [
|
|
2170
|
-
n("div",
|
|
2171
|
-
|
|
2172
|
-
modelValue:
|
|
2173
|
-
"onUpdate:modelValue": m[0] || (m[0] = (d) =>
|
|
2185
|
+
n("div", Go, [
|
|
2186
|
+
b(D, {
|
|
2187
|
+
modelValue: y.value,
|
|
2188
|
+
"onUpdate:modelValue": m[0] || (m[0] = (d) => y.value = d),
|
|
2174
2189
|
label: "Transfer from",
|
|
2175
2190
|
searchable: "",
|
|
2176
2191
|
searchTarget: "label",
|
|
@@ -2185,50 +2200,50 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2185
2200
|
"helper-text": "Helper",
|
|
2186
2201
|
rules: [s(Oe)()]
|
|
2187
2202
|
}, null, 8, ["modelValue", "rules"]),
|
|
2188
|
-
|
|
2203
|
+
b(B, {
|
|
2189
2204
|
modelValue: e.value,
|
|
2190
2205
|
"onUpdate:modelValue": m[1] || (m[1] = (d) => e.value = d),
|
|
2191
2206
|
label: "Transfer date",
|
|
2192
2207
|
rules: [s(Oe)()]
|
|
2193
2208
|
}, null, 8, ["modelValue", "rules"]),
|
|
2194
|
-
|
|
2209
|
+
b(Q, {
|
|
2195
2210
|
modelValue: u.value,
|
|
2196
2211
|
"onUpdate:modelValue": m[2] || (m[2] = (d) => u.value = d),
|
|
2197
2212
|
label: "Transfer time",
|
|
2198
2213
|
rules: [s(Oe)()]
|
|
2199
2214
|
}, null, 8, ["modelValue", "rules"]),
|
|
2200
|
-
t.value ? (S(),
|
|
2215
|
+
t.value ? (S(), T("div", Jo, [
|
|
2201
2216
|
n("div", null, [
|
|
2202
|
-
|
|
2217
|
+
b(Y, {
|
|
2203
2218
|
size: "md",
|
|
2204
2219
|
color: "neutral-gray-200"
|
|
2205
2220
|
})
|
|
2206
2221
|
]),
|
|
2207
|
-
n("div",
|
|
2208
|
-
])) : (S(),
|
|
2209
|
-
|
|
2222
|
+
n("div", ea, q(s(_)("inventory.formField.loading")), 1)
|
|
2223
|
+
])) : (S(), T(de, { key: 1 }, [
|
|
2224
|
+
b(Yt, {
|
|
2210
2225
|
"max-file-size": 5,
|
|
2211
|
-
class:
|
|
2226
|
+
class: Z({
|
|
2212
2227
|
"w-full": !0,
|
|
2213
|
-
"h-[200px]": !
|
|
2228
|
+
"h-[200px]": !r.value
|
|
2214
2229
|
}),
|
|
2215
2230
|
accept: ".xlsx,.xls",
|
|
2216
2231
|
label: vt,
|
|
2217
|
-
onFileUpload: m[3] || (m[3] = (d) =>
|
|
2232
|
+
onFileUpload: m[3] || (m[3] = (d) => r.value = d),
|
|
2218
2233
|
"button-label": s(_)("inventory.ingredient.import.selectFile")
|
|
2219
|
-
},
|
|
2220
|
-
|
|
2234
|
+
}, It({ _: 2 }, [
|
|
2235
|
+
r.value ? {
|
|
2221
2236
|
name: "default",
|
|
2222
2237
|
fn: R(({ openFileDialog: d }) => [
|
|
2223
|
-
|
|
2238
|
+
b(K, null, {
|
|
2224
2239
|
default: R(() => [
|
|
2225
|
-
|
|
2240
|
+
Ie(q(vt))
|
|
2226
2241
|
]),
|
|
2227
2242
|
_: 1
|
|
2228
2243
|
}),
|
|
2229
|
-
n("div",
|
|
2244
|
+
n("div", ta, [
|
|
2230
2245
|
n("div", {
|
|
2231
|
-
class:
|
|
2246
|
+
class: Z([
|
|
2232
2247
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
2233
2248
|
{
|
|
2234
2249
|
"border border-fm-color-neutral-gray-100": x.value,
|
|
@@ -2237,18 +2252,18 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2237
2252
|
}
|
|
2238
2253
|
])
|
|
2239
2254
|
}, [
|
|
2240
|
-
x.value ? (S(),
|
|
2255
|
+
x.value ? (S(), G(Y, {
|
|
2241
2256
|
key: 0,
|
|
2242
2257
|
size: "md",
|
|
2243
2258
|
color: "neutral-gray-200"
|
|
2244
|
-
})) : (S(),
|
|
2259
|
+
})) : (S(), G(E, {
|
|
2245
2260
|
key: 1,
|
|
2246
2261
|
name: i.value ? "error" : "attach_file",
|
|
2247
2262
|
outline: "",
|
|
2248
2263
|
color: i.value ? "system-error-300" : void 0
|
|
2249
2264
|
}, null, 8, ["name", "color"])),
|
|
2250
2265
|
n("div", {
|
|
2251
|
-
class:
|
|
2266
|
+
class: Z([
|
|
2252
2267
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
2253
2268
|
{
|
|
2254
2269
|
"text-fm-color-typo-disabled": x.value,
|
|
@@ -2256,10 +2271,10 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2256
2271
|
}
|
|
2257
2272
|
])
|
|
2258
2273
|
}, [
|
|
2259
|
-
n("div",
|
|
2274
|
+
n("div", sa, q(r.value.name), 1)
|
|
2260
2275
|
], 2),
|
|
2261
|
-
x.value ?
|
|
2262
|
-
|
|
2276
|
+
x.value ? j("", !0) : (S(), T("div", oa, [
|
|
2277
|
+
b(U, {
|
|
2263
2278
|
label: s(_)("inventory.ingredient.import.replaceFile"),
|
|
2264
2279
|
variant: i.value ? "destructive" : "secondary",
|
|
2265
2280
|
"prepend-icon": i.value ? void 0 : "autorenew",
|
|
@@ -2267,34 +2282,34 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2267
2282
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
2268
2283
|
]))
|
|
2269
2284
|
], 2),
|
|
2270
|
-
k.value.length ? (S(),
|
|
2271
|
-
(S(!0),
|
|
2272
|
-
key:
|
|
2285
|
+
k.value.length ? (S(), T("div", aa, [
|
|
2286
|
+
(S(!0), T(de, null, Se(k.value, (c, O) => (S(), T("div", {
|
|
2287
|
+
key: O,
|
|
2273
2288
|
class: "flex gap-8 items-center"
|
|
2274
2289
|
}, [
|
|
2275
|
-
|
|
2290
|
+
b(E, {
|
|
2276
2291
|
name: "error",
|
|
2277
2292
|
size: "sm",
|
|
2278
2293
|
color: "system-error-300"
|
|
2279
2294
|
}),
|
|
2280
|
-
n("div",
|
|
2295
|
+
n("div", na, q(c), 1)
|
|
2281
2296
|
]))), 128))
|
|
2282
|
-
])) :
|
|
2297
|
+
])) : j("", !0)
|
|
2283
2298
|
])
|
|
2284
2299
|
]),
|
|
2285
2300
|
key: "0"
|
|
2286
2301
|
} : void 0
|
|
2287
2302
|
]), 1032, ["class", "button-label"]),
|
|
2288
|
-
|
|
2289
|
-
n("div",
|
|
2290
|
-
(S(!0),
|
|
2303
|
+
r.value ? (S(), T("div", la, [
|
|
2304
|
+
n("div", ra, q(s(_)("inventory.ingredient.import.summary")), 1),
|
|
2305
|
+
(S(!0), T(de, null, Se(a.value, (d, c) => (S(), G(Wo, {
|
|
2291
2306
|
key: c,
|
|
2292
2307
|
name: `Transfer Note ${c + 1}`,
|
|
2293
2308
|
items: d.poItems,
|
|
2294
2309
|
errors: d.errors,
|
|
2295
2310
|
type: "create"
|
|
2296
2311
|
}, null, 8, ["name", "items", "errors"]))), 128))
|
|
2297
|
-
])) :
|
|
2312
|
+
])) : j("", !0)
|
|
2298
2313
|
], 64))
|
|
2299
2314
|
])
|
|
2300
2315
|
]),
|
|
@@ -2302,34 +2317,34 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2302
2317
|
}, 512);
|
|
2303
2318
|
};
|
|
2304
2319
|
}
|
|
2305
|
-
}),
|
|
2320
|
+
}), ua = { class: "w-[480px]" }, da = /* @__PURE__ */ ce({
|
|
2306
2321
|
__name: "XilnexImportDialog",
|
|
2307
2322
|
props: {
|
|
2308
2323
|
show: { type: Boolean }
|
|
2309
2324
|
},
|
|
2310
2325
|
emits: ["update:show", "submitted"],
|
|
2311
|
-
setup(g, { expose: w, emit:
|
|
2312
|
-
const
|
|
2326
|
+
setup(g, { expose: w, emit: r }) {
|
|
2327
|
+
const p = r, t = St(g, "show"), v = Te(), F = tt(), $ = M(!1), y = M(), e = M();
|
|
2313
2328
|
w({
|
|
2314
2329
|
validateInputs: () => {
|
|
2315
2330
|
var a, i;
|
|
2316
|
-
(i = (a =
|
|
2331
|
+
(i = (a = y.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
|
|
2317
2332
|
},
|
|
2318
2333
|
resetInputsValidation: () => {
|
|
2319
2334
|
var a, i;
|
|
2320
|
-
(i = (a =
|
|
2335
|
+
(i = (a = y.value) == null ? void 0 : a.resetInputsValidation) == null || i.call(a);
|
|
2321
2336
|
},
|
|
2322
2337
|
resetInputs: () => {
|
|
2323
2338
|
var a, i;
|
|
2324
|
-
(i = (a =
|
|
2339
|
+
(i = (a = y.value) == null ? void 0 : a.resetInputs) == null || i.call(a);
|
|
2325
2340
|
}
|
|
2326
2341
|
});
|
|
2327
2342
|
function u() {
|
|
2328
2343
|
var a, i;
|
|
2329
|
-
(i = (a =
|
|
2344
|
+
(i = (a = y.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
|
|
2330
2345
|
}
|
|
2331
2346
|
async function k() {
|
|
2332
|
-
var i, h, _, C,
|
|
2347
|
+
var i, h, _, C, l;
|
|
2333
2348
|
if (!((h = (i = e.value) == null ? void 0 : i.supplier) != null && h.name)) {
|
|
2334
2349
|
v.open({
|
|
2335
2350
|
title: "Upload failed",
|
|
@@ -2338,7 +2353,7 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2338
2353
|
});
|
|
2339
2354
|
return;
|
|
2340
2355
|
}
|
|
2341
|
-
if (!((_ = e.value) != null && _.items) || ((
|
|
2356
|
+
if (!((_ = e.value) != null && _.items) || ((l = (C = e.value) == null ? void 0 : C.items) == null ? void 0 : l.length) === 0) {
|
|
2342
2357
|
v.open({
|
|
2343
2358
|
title: "Upload failed",
|
|
2344
2359
|
message: "No data to upload",
|
|
@@ -2365,9 +2380,9 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2365
2380
|
}
|
|
2366
2381
|
$.value = !0;
|
|
2367
2382
|
try {
|
|
2368
|
-
await F.importFromXilnex(e.value),
|
|
2383
|
+
await F.importFromXilnex(e.value), p("update:show", !1);
|
|
2369
2384
|
} catch (m) {
|
|
2370
|
-
await new Promise((
|
|
2385
|
+
await new Promise((D) => setTimeout(D, 1e3)), v.open({
|
|
2371
2386
|
title: "Upload failed",
|
|
2372
2387
|
message: m == null ? void 0 : m.message,
|
|
2373
2388
|
type: "error"
|
|
@@ -2377,10 +2392,10 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2377
2392
|
}
|
|
2378
2393
|
}
|
|
2379
2394
|
return (a, i) => {
|
|
2380
|
-
const h =
|
|
2381
|
-
return S(),
|
|
2395
|
+
const h = I("FmSpacer"), _ = I("FmButton"), C = I("FmDialog");
|
|
2396
|
+
return S(), G(C, {
|
|
2382
2397
|
modelValue: s(t),
|
|
2383
|
-
"onUpdate:modelValue": i[2] || (i[2] = (
|
|
2398
|
+
"onUpdate:modelValue": i[2] || (i[2] = (l) => xe(t) ? t.value = l : null),
|
|
2384
2399
|
overlay: !0,
|
|
2385
2400
|
"close-button": !1
|
|
2386
2401
|
}, {
|
|
@@ -2388,16 +2403,16 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2388
2403
|
n("div", null, "Xilnex transfer order", -1)
|
|
2389
2404
|
])),
|
|
2390
2405
|
"dialog-footer": R(() => [
|
|
2391
|
-
|
|
2392
|
-
|
|
2406
|
+
b(h, { class: "sm:hidden xs:hidden" }),
|
|
2407
|
+
b(_, {
|
|
2393
2408
|
disabled: $.value,
|
|
2394
2409
|
class: "sm:w-full xs:w-full",
|
|
2395
2410
|
label: "Cancel",
|
|
2396
2411
|
size: "md",
|
|
2397
2412
|
variant: "tertiary",
|
|
2398
|
-
onClick: i[1] || (i[1] = (
|
|
2413
|
+
onClick: i[1] || (i[1] = (l) => p("update:show", !1))
|
|
2399
2414
|
}, null, 8, ["disabled"]),
|
|
2400
|
-
|
|
2415
|
+
b(_, {
|
|
2401
2416
|
disabled: $.value,
|
|
2402
2417
|
loading: $.value,
|
|
2403
2418
|
class: "sm:w-full xs:w-full",
|
|
@@ -2408,13 +2423,13 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2408
2423
|
}, null, 8, ["disabled", "loading"])
|
|
2409
2424
|
]),
|
|
2410
2425
|
default: R(() => [
|
|
2411
|
-
n("div",
|
|
2412
|
-
|
|
2426
|
+
n("div", ua, [
|
|
2427
|
+
b(ia, {
|
|
2413
2428
|
ref_key: "formRef",
|
|
2414
|
-
ref:
|
|
2429
|
+
ref: y,
|
|
2415
2430
|
onValidationSuccess: k,
|
|
2416
2431
|
modelValue: e.value,
|
|
2417
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
2432
|
+
"onUpdate:modelValue": i[0] || (i[0] = (l) => e.value = l)
|
|
2418
2433
|
}, null, 8, ["modelValue"])
|
|
2419
2434
|
])
|
|
2420
2435
|
]),
|
|
@@ -2422,60 +2437,60 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2422
2437
|
}, 8, ["modelValue"]);
|
|
2423
2438
|
};
|
|
2424
2439
|
}
|
|
2425
|
-
}),
|
|
2440
|
+
}), ca = { class: "flex flex-col py-8" }, ma = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, fa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, va = {
|
|
2426
2441
|
key: 0,
|
|
2427
2442
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
2428
|
-
},
|
|
2443
|
+
}, ya = { class: "pt-8" }, yt = "ReceiveRequestViewSearchCriteria", Pa = /* @__PURE__ */ ce({
|
|
2429
2444
|
__name: "ReceiveRequestView",
|
|
2430
2445
|
setup(g) {
|
|
2431
|
-
const { t: w } = he(),
|
|
2446
|
+
const { t: w } = he(), r = Te();
|
|
2432
2447
|
He.object({
|
|
2433
2448
|
name: He.string().optional().nullable(),
|
|
2434
2449
|
startDate: He.string().optional().nullable(),
|
|
2435
2450
|
endDate: He.string().optional().nullable()
|
|
2436
2451
|
});
|
|
2437
|
-
const
|
|
2452
|
+
const p = N(
|
|
2438
2453
|
() => !k._currentLocation || e.loading.value
|
|
2439
|
-
), x =
|
|
2454
|
+
), x = rs(), t = We(), v = Me();
|
|
2440
2455
|
function F() {
|
|
2441
|
-
const
|
|
2456
|
+
const E = {
|
|
2442
2457
|
name: "",
|
|
2443
2458
|
...pt()
|
|
2444
|
-
},
|
|
2445
|
-
if (!
|
|
2446
|
-
return
|
|
2459
|
+
}, U = x.getItem(yt);
|
|
2460
|
+
if (!U)
|
|
2461
|
+
return E;
|
|
2447
2462
|
try {
|
|
2448
|
-
return JSON.parse(
|
|
2463
|
+
return JSON.parse(U);
|
|
2449
2464
|
} catch {
|
|
2450
|
-
return
|
|
2465
|
+
return E;
|
|
2451
2466
|
}
|
|
2452
2467
|
}
|
|
2453
2468
|
function $() {
|
|
2454
|
-
x.setItem(yt, JSON.stringify(
|
|
2469
|
+
x.setItem(yt, JSON.stringify(y.value));
|
|
2455
2470
|
}
|
|
2456
|
-
const
|
|
2471
|
+
const y = M(F()), e = es(
|
|
2457
2472
|
Xe.RECEIVE_REQUEST,
|
|
2458
|
-
|
|
2459
|
-
), { columnDefs: u } =
|
|
2473
|
+
y.value
|
|
2474
|
+
), { columnDefs: u } = ts(
|
|
2460
2475
|
Xe.RECEIVE_REQUEST,
|
|
2461
2476
|
e
|
|
2462
2477
|
), k = Je();
|
|
2463
2478
|
async function a() {
|
|
2464
|
-
const
|
|
2479
|
+
const E = `inventory-record_${ft(y.value.startDate).format("DD-MM-YYYY_HH-mm")}-${ft(y.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, U = e.purchaseOrders.value.flatMap(
|
|
2465
2480
|
(d) => d.items.map((c) => {
|
|
2466
2481
|
var me;
|
|
2467
|
-
const
|
|
2468
|
-
|
|
2482
|
+
const O = new Date(ns(d._id) ?? ""), ee = d.effectiveAt ? new Date(d.effectiveAt) : void 0, X = Ce(
|
|
2483
|
+
os(c.sku, d.deliveryOrder || [])
|
|
2469
2484
|
), ke = Ce(c.quantity), ve = ((me = c == null ? void 0 : c.measurement) == null ? void 0 : me.abbrev) || c.sku.unit.abbrev;
|
|
2470
2485
|
return {
|
|
2471
2486
|
"SKU code": c.code,
|
|
2472
2487
|
"SKU name": c.name,
|
|
2473
2488
|
"PO #": d.seqNumber,
|
|
2474
|
-
"Effective at":
|
|
2475
|
-
Date:
|
|
2489
|
+
"Effective at": ee,
|
|
2490
|
+
Date: O,
|
|
2476
2491
|
Status: d.status,
|
|
2477
2492
|
Reference: d.ref ?? "",
|
|
2478
|
-
"Received quantity":
|
|
2493
|
+
"Received quantity": X,
|
|
2479
2494
|
"Ordered quantity": ke,
|
|
2480
2495
|
Unit: ve,
|
|
2481
2496
|
"Total cost": c.totalCost ? je(c.totalCost) : null
|
|
@@ -2492,34 +2507,34 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2492
2507
|
"Ordered quantity",
|
|
2493
2508
|
"Unit"
|
|
2494
2509
|
];
|
|
2495
|
-
t.enableBackdatePo && P.insert("Effective at", 4), t.enableTotalCost && P.push("Total cost"), await
|
|
2510
|
+
t.enableBackdatePo && P.insert("Effective at", 4), t.enableTotalCost && P.push("Total cost"), await ls(
|
|
2496
2511
|
[
|
|
2497
2512
|
{
|
|
2498
2513
|
name: "purchases",
|
|
2499
|
-
data:
|
|
2514
|
+
data: U,
|
|
2500
2515
|
columns: P
|
|
2501
2516
|
}
|
|
2502
2517
|
],
|
|
2503
|
-
|
|
2504
|
-
),
|
|
2518
|
+
E
|
|
2519
|
+
), r.open({
|
|
2505
2520
|
title: w("inventory.transfer.receiveRequest.export.success"),
|
|
2506
|
-
message: w("inventory.transfer.receiveRequest.export.message", [
|
|
2521
|
+
message: w("inventory.transfer.receiveRequest.export.message", [E]),
|
|
2507
2522
|
type: "success"
|
|
2508
2523
|
});
|
|
2509
2524
|
}
|
|
2510
|
-
const i =
|
|
2511
|
-
_e([() => i.value], ([
|
|
2512
|
-
!
|
|
2513
|
-
|
|
2514
|
-
|
|
2525
|
+
const i = M(pt()), h = M("");
|
|
2526
|
+
_e([() => i.value], ([E]) => {
|
|
2527
|
+
!E.startDate || !E.endDate || (y.value.startDate = E.startDate, y.value.endDate = E.endDate, e.updateDateRange(
|
|
2528
|
+
y.value.startDate,
|
|
2529
|
+
y.value.endDate
|
|
2515
2530
|
), $());
|
|
2516
2531
|
}), _e([() => h.value], () => {
|
|
2517
2532
|
$();
|
|
2518
2533
|
});
|
|
2519
|
-
function _(
|
|
2520
|
-
if (
|
|
2521
|
-
if (
|
|
2522
|
-
|
|
2534
|
+
function _(E) {
|
|
2535
|
+
if (E === "create") {
|
|
2536
|
+
if (p.value) {
|
|
2537
|
+
r.open({
|
|
2523
2538
|
title: "Loading data...",
|
|
2524
2539
|
message: "Please wait.",
|
|
2525
2540
|
type: "info"
|
|
@@ -2528,14 +2543,14 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2528
2543
|
}
|
|
2529
2544
|
return e.promptCreateTransferDialog();
|
|
2530
2545
|
}
|
|
2531
|
-
if (
|
|
2546
|
+
if (E === "upload" && t.enableXilnexTransferNote)
|
|
2532
2547
|
return e.promptUploadTransferDialog();
|
|
2533
|
-
if (
|
|
2548
|
+
if (E === "refresh")
|
|
2534
2549
|
return e.fetchData();
|
|
2535
|
-
if (
|
|
2550
|
+
if (E === "export")
|
|
2536
2551
|
return a();
|
|
2537
2552
|
}
|
|
2538
|
-
const { breakpoints: C } = st(),
|
|
2553
|
+
const { breakpoints: C } = st(), l = N(() => C.value.xs || C.value.sm), m = N(() => l.value ? 10 : 20), D = Xt(), B = N(() => [
|
|
2539
2554
|
{
|
|
2540
2555
|
label: w("inventory.transfer.receiveRequest.actions.create"),
|
|
2541
2556
|
value: "create",
|
|
@@ -2556,8 +2571,8 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2556
2571
|
label: w("inventory.common.export"),
|
|
2557
2572
|
value: "export"
|
|
2558
2573
|
}
|
|
2559
|
-
]),
|
|
2560
|
-
const
|
|
2574
|
+
]), Q = N(() => {
|
|
2575
|
+
const E = [
|
|
2561
2576
|
{
|
|
2562
2577
|
type: "string",
|
|
2563
2578
|
key: "status",
|
|
@@ -2566,7 +2581,7 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2566
2581
|
new Set(e.purchaseOrders.value.map((P) => P.status))
|
|
2567
2582
|
)
|
|
2568
2583
|
}
|
|
2569
|
-
],
|
|
2584
|
+
], U = [
|
|
2570
2585
|
{
|
|
2571
2586
|
type: "string",
|
|
2572
2587
|
key: "netsuiteTransactionNumber",
|
|
@@ -2595,98 +2610,98 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2595
2610
|
}).filter((P) => P != null)
|
|
2596
2611
|
}
|
|
2597
2612
|
];
|
|
2598
|
-
return [...
|
|
2599
|
-
}),
|
|
2600
|
-
if (!
|
|
2613
|
+
return [...E, ...v.isEnabled ? U : []];
|
|
2614
|
+
}), Y = M(null), K = N(() => {
|
|
2615
|
+
if (!Y.value)
|
|
2601
2616
|
return e.purchaseOrders.value;
|
|
2602
|
-
const
|
|
2603
|
-
return e.purchaseOrders.value.filter((
|
|
2604
|
-
var P, d, c,
|
|
2605
|
-
return
|
|
2617
|
+
const E = Zt.build(Y.value);
|
|
2618
|
+
return e.purchaseOrders.value.filter((U) => {
|
|
2619
|
+
var P, d, c, O;
|
|
2620
|
+
return Wt(
|
|
2606
2621
|
{
|
|
2607
|
-
netsuiteTransactionNumber: (d = (P =
|
|
2608
|
-
netsuiteOrderNo: (c =
|
|
2609
|
-
netsuiteOrderId: (
|
|
2610
|
-
status:
|
|
2622
|
+
netsuiteTransactionNumber: (d = (P = U.netSuite) == null ? void 0 : P.additionalInfo) == null ? void 0 : d.transactionnumber,
|
|
2623
|
+
netsuiteOrderNo: (c = U.netSuite) == null ? void 0 : c.refNo,
|
|
2624
|
+
netsuiteOrderId: (O = U.netSuite) == null ? void 0 : O.id,
|
|
2625
|
+
status: U.status
|
|
2611
2626
|
},
|
|
2612
|
-
|
|
2627
|
+
E
|
|
2613
2628
|
);
|
|
2614
2629
|
});
|
|
2615
2630
|
});
|
|
2616
|
-
return (
|
|
2617
|
-
const P =
|
|
2618
|
-
return S(),
|
|
2631
|
+
return (E, U) => {
|
|
2632
|
+
const P = I("FmTable");
|
|
2633
|
+
return S(), G(Gt, {
|
|
2619
2634
|
title: s(w)("inventory.transfer.receiveRequest.title2"),
|
|
2620
|
-
actions:
|
|
2635
|
+
actions: B.value,
|
|
2621
2636
|
"onClick:action": _
|
|
2622
2637
|
}, {
|
|
2623
2638
|
default: R(() => {
|
|
2624
2639
|
var d;
|
|
2625
2640
|
return [
|
|
2626
2641
|
n("div", {
|
|
2627
|
-
class:
|
|
2642
|
+
class: Z([
|
|
2628
2643
|
"flex flex-col gap-8 max-h-full",
|
|
2629
2644
|
{
|
|
2630
|
-
"p-0":
|
|
2631
|
-
"px-24 ": !
|
|
2645
|
+
"p-0": l.value,
|
|
2646
|
+
"px-24 ": !l.value
|
|
2632
2647
|
}
|
|
2633
2648
|
])
|
|
2634
2649
|
}, [
|
|
2635
|
-
|
|
2650
|
+
b(Jt, {
|
|
2636
2651
|
"date-range-query": "",
|
|
2637
2652
|
"date-range": i.value,
|
|
2638
|
-
"onUpdate:dateRange":
|
|
2653
|
+
"onUpdate:dateRange": U[0] || (U[0] = (c) => i.value = c),
|
|
2639
2654
|
searchable: "",
|
|
2640
2655
|
"change-location": "",
|
|
2641
2656
|
search: h.value,
|
|
2642
|
-
"onUpdate:search":
|
|
2657
|
+
"onUpdate:search": U[1] || (U[1] = (c) => h.value = c),
|
|
2643
2658
|
filterable: "",
|
|
2644
|
-
"filter-attributes":
|
|
2645
|
-
filter:
|
|
2646
|
-
"onUpdate:filter":
|
|
2659
|
+
"filter-attributes": Q.value,
|
|
2660
|
+
filter: Y.value,
|
|
2661
|
+
"onUpdate:filter": U[2] || (U[2] = (c) => Y.value = c)
|
|
2647
2662
|
}, null, 8, ["date-range", "search", "filter-attributes", "filter"]),
|
|
2648
|
-
(S(),
|
|
2649
|
-
style: gt(s(
|
|
2663
|
+
(S(), G(P, {
|
|
2664
|
+
style: gt(s(D).tableHeight),
|
|
2650
2665
|
"column-defs": s(u),
|
|
2651
|
-
"row-data":
|
|
2666
|
+
"row-data": K.value,
|
|
2652
2667
|
"search-value": h.value,
|
|
2653
|
-
loading:
|
|
2654
|
-
onRowClick:
|
|
2668
|
+
loading: p.value,
|
|
2669
|
+
onRowClick: U[3] || (U[3] = (c) => s(e).promptShowTransferDetails(c.original)),
|
|
2655
2670
|
key: (d = s(k)._currentLocation) == null ? void 0 : d.dbName,
|
|
2656
2671
|
"page-size": m.value
|
|
2657
2672
|
}, {
|
|
2658
2673
|
"list-row": R((c) => [
|
|
2659
|
-
|
|
2674
|
+
b(xt, {
|
|
2660
2675
|
row: c,
|
|
2661
2676
|
onRowClick: s(e).promptShowTransferDetails
|
|
2662
2677
|
}, {
|
|
2663
|
-
default: R((
|
|
2664
|
-
var
|
|
2678
|
+
default: R((O) => {
|
|
2679
|
+
var ee, X, ke, ve, me, we, Ue, Ne, Fe, Ye, Be, De, Ve, o, f, A, H, le, re, W;
|
|
2665
2680
|
return [
|
|
2666
|
-
n("div",
|
|
2667
|
-
n("div",
|
|
2668
|
-
|
|
2669
|
-
render: (ke = (
|
|
2670
|
-
props: (me = (ve =
|
|
2681
|
+
n("div", ca, [
|
|
2682
|
+
n("div", ma, [
|
|
2683
|
+
b(s(fe), {
|
|
2684
|
+
render: (ke = (X = (ee = O._id) == null ? void 0 : ee.column) == null ? void 0 : X.columnDef) == null ? void 0 : ke.cell,
|
|
2685
|
+
props: (me = (ve = O._id) == null ? void 0 : ve.getContext) == null ? void 0 : me.call(ve)
|
|
2671
2686
|
}, null, 8, ["render", "props"])
|
|
2672
2687
|
]),
|
|
2673
|
-
n("div",
|
|
2674
|
-
|
|
2675
|
-
render: (Ne = (Ue = (we =
|
|
2676
|
-
props: (Ye = (Fe =
|
|
2688
|
+
n("div", pa, [
|
|
2689
|
+
b(s(fe), {
|
|
2690
|
+
render: (Ne = (Ue = (we = O.supplier_name) == null ? void 0 : we.column) == null ? void 0 : Ue.columnDef) == null ? void 0 : Ne.cell,
|
|
2691
|
+
props: (Ye = (Fe = O.supplier_name) == null ? void 0 : Fe.getContext) == null ? void 0 : Ye.call(Fe)
|
|
2677
2692
|
}, null, 8, ["render", "props"])
|
|
2678
2693
|
]),
|
|
2679
|
-
n("div",
|
|
2680
|
-
c.original.ref ? (S(),
|
|
2681
|
-
|
|
2682
|
-
render: (Ve = (
|
|
2683
|
-
props: (
|
|
2694
|
+
n("div", fa, q(c.original.items.map((ie) => `${ie.name}`).join(", ")), 1),
|
|
2695
|
+
c.original.ref ? (S(), T("div", va, [
|
|
2696
|
+
b(s(fe), {
|
|
2697
|
+
render: (Ve = (De = (Be = O.ref) == null ? void 0 : Be.column) == null ? void 0 : De.columnDef) == null ? void 0 : Ve.cell,
|
|
2698
|
+
props: (f = (o = O.ref) == null ? void 0 : o.getContext) == null ? void 0 : f.call(o)
|
|
2684
2699
|
}, null, 8, ["render", "props"])
|
|
2685
|
-
])) :
|
|
2686
|
-
n("div",
|
|
2687
|
-
|
|
2688
|
-
render: (le = (
|
|
2689
|
-
props: (
|
|
2700
|
+
])) : j("", !0),
|
|
2701
|
+
n("div", ya, [
|
|
2702
|
+
b(s(fe), {
|
|
2703
|
+
render: (le = (H = (A = O.status) == null ? void 0 : A.column) == null ? void 0 : H.columnDef) == null ? void 0 : le.cell,
|
|
2704
|
+
props: (W = (re = O.status) == null ? void 0 : re.getContext) == null ? void 0 : W.call(re)
|
|
2690
2705
|
}, null, 8, ["render", "props"])
|
|
2691
2706
|
])
|
|
2692
2707
|
])
|
|
@@ -2698,16 +2713,16 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2698
2713
|
_: 1
|
|
2699
2714
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2700
2715
|
], 2),
|
|
2701
|
-
(S(),
|
|
2702
|
-
|
|
2716
|
+
(S(), G(Tt, { to: "body" }, [
|
|
2717
|
+
b(Eo, Ze(s(e).transferDialogProps.value, {
|
|
2703
2718
|
onSubmitted: s(e).fetchData
|
|
2704
2719
|
}), null, 16, ["onSubmitted"]),
|
|
2705
|
-
|
|
2720
|
+
b(ss, Ze({
|
|
2706
2721
|
scope: s(Xe).RECEIVE_REQUEST
|
|
2707
2722
|
}, s(e).transferDetailsProps.value, {
|
|
2708
2723
|
onSubmitted: s(e).fetchData
|
|
2709
2724
|
}), null, 16, ["scope", "onSubmitted"]),
|
|
2710
|
-
|
|
2725
|
+
b(da, Dt(Vt(s(e).xilnexImportDialogProps.value)), null, 16)
|
|
2711
2726
|
]))
|
|
2712
2727
|
];
|
|
2713
2728
|
}),
|
|
@@ -2717,5 +2732,5 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
|
|
|
2717
2732
|
}
|
|
2718
2733
|
});
|
|
2719
2734
|
export {
|
|
2720
|
-
|
|
2735
|
+
Pa as default
|
|
2721
2736
|
};
|