@feedmepos/mf-inventory-portal 1.2.61 → 1.2.63-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-BqScGtJx.js → App-BHssUobV.js} +82 -78
- package/dist/{ApprovalView-BFdlYIot.js → ApprovalView-DRGCQeGY.js} +5 -5
- package/dist/{BindingsDialog-Dvmrms77.js → BindingsDialog-CWl3LpdO.js} +5 -5
- package/dist/{BindingsPicker-fPVSXv-h.js → BindingsPicker-BcASw3JJ.js} +3 -3
- package/dist/{BindingsTable-CnUa8VOi.js → BindingsTable-BiKiLiVY.js} +5 -5
- package/dist/{ClosingDraftView-10BcpWkm.js → ClosingDraftView-mh5Kw46x.js} +217 -216
- package/dist/{ClosingHistoryView-zLh0HCIb.js → ClosingHistoryView-C-ZrFei9.js} +36 -36
- package/dist/{ClosingTemplateView-BFupX87V.js → ClosingTemplateView-DBNRH0Tt.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-BLBqmOjw.js → DeliveryOrderPrintPreview-Dv3JZ3yr.js} +7 -7
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DN8ziFA_.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CfL1adhx.js} +16 -16
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DJT_7Uus.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Db0JeXbc.js} +2 -2
- package/dist/{FmMultiselectDialog-DmnYEmN1.js → FmMultiselectDialog-D9g07F_c.js} +1 -1
- package/dist/{FmMultiselectDialog-B5paZk6T.js → FmMultiselectDialog-DuYKQng9.js} +16 -16
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-MW749j29.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CeXRT7Lf.js} +23 -22
- package/dist/{ImportView-BsI1_unJ.js → ImportView-DoMyJ1NE.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D8hvH-4n.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CqJQcOBK.js} +1 -1
- package/dist/{IngredientGroupView-BALVTSwF.js → IngredientGroupView-D_Cl4kJy.js} +5 -5
- package/dist/{IngredientsView-C-sauieO.js → IngredientsView-CG6wUGzt.js} +25 -24
- package/dist/{IntegrationView-GG2E4Yrl.js → IntegrationView-BIWPp1JH.js} +18 -17
- package/dist/{InventoryBindingForm-DCSBFj6b.js → InventoryBindingForm-BrL6-2He.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-4_i25unG.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-M3uVquEq.js} +17 -16
- package/dist/{InventoryBindingSummary-6dFJPewB.js → InventoryBindingSummary-mnlQU1Mp.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CU9mgYbv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ByPOKZRm.js} +5 -5
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DC1HpuMm.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DHwXNoTs.js} +2 -2
- package/dist/{PublishView-DO7k1AeP.js → PublishView-B4iVMq25.js} +8 -8
- package/dist/{PurchaseOrderPrintPreview-C3VqOLCi.js → PurchaseOrderPrintPreview-ws-SKrEC.js} +11 -11
- package/dist/{ReceiveRequestView-CpgLQtbw.js → ReceiveRequestView-deSiORNX.js} +143 -142
- package/dist/RecipeView-EEK7PiKl.js +1558 -0
- package/dist/{StockView-CtC3ldc6.js → StockView-6j_t2Kf1.js} +106 -105
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cj6cVmd0.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CgAMsW8n.js} +1 -1
- package/dist/{SupplierView-DKFtc22j.js → SupplierView-D5tSOECx.js} +20 -19
- package/dist/{SurchargeView-B-EYMp6w.js → SurchargeView-CP81Q4dW.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CDeeFvnm.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bmuw4PTO.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CH3hjFS8.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D1FuB-kv.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-rAyYuhku.js → TransferDetails.vue_vue_type_script_setup_true_lang-Canrz2ri.js} +501 -501
- package/dist/{TransferTemplateView-FeC34QoJ.js → TransferTemplateView-CRI_Lexa.js} +22 -21
- package/dist/UnitCostHistoryView-CT-4QDK8.js +651 -0
- package/dist/{UnitView-BoJisnXd.js → UnitView-BZmfd-aw.js} +11 -10
- package/dist/{WarehouseView-s-xF6xJ0.js → WarehouseView-BcmSyjA0.js} +5 -5
- package/dist/{WastageTemplateView-BQBlHZLh.js → WastageTemplateView-CNsdu0ga.js} +14 -14
- package/dist/api/inventory.d.ts +126 -36
- package/dist/api/netsuite.d.ts +8 -1
- package/dist/api/unit-cost-history.d.ts +28 -0
- package/dist/{app-_4kRbuQl.js → app-ayv5Jw7D.js} +8041 -7036
- package/dist/app.d.ts +228 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-BBWYKm_X.js → closing-template-D9UR8sMo.js} +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +37 -1
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +14 -0
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +16 -1
- package/dist/{date2-Cd93SZu4.js → date2-GNP-79dA.js} +1 -1
- package/dist/{dayjs.min-DeHn_Fz-.js → dayjs.min-Bg_wgP2J.js} +16 -16
- package/dist/{defineDeepModel-DUOLQh1E.js → defineDeepModel-Co03tZfS.js} +1 -1
- package/dist/{duplicate-template-BgpMF-fd.js → duplicate-template-BiPU4Z2Y.js} +1 -1
- package/dist/{feature-DqGkM6Yx.js → feature-BGeFfaiX.js} +95 -90
- package/dist/{format-time-from-id-BkH4swoc.js → format-time-from-id-ByV0VX1x.js} +1 -1
- package/dist/{format-unit-display-rkrD3WLD.js → format-unit-display-r1Hb4DfH.js} +16 -15
- package/dist/{import-export.helper-C8Q4AMQx.js → import-export.helper-PB9pPO3m.js} +16 -15
- package/dist/{index-B3m_9m2a.js → index-ClbYCYSU.js} +3 -3
- package/dist/{index-O5M93j6z.js → index-DMqOVOHw.js} +1 -1
- package/dist/{index-B0WTs-3a.js → index-DWWlEK_r.js} +1471 -1412
- package/dist/{lodash-Dj6GdEkm.js → lodash-BbWPSHMM.js} +1 -1
- package/dist/{netsuite-DpQxb3vH.js → netsuite-VGghPz8h.js} +92 -92
- package/dist/number-DPuTdA-J.js +232 -0
- package/dist/{purchase-order-template-DKuo07gT.js → purchase-order-template-BMNxJR59.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/rules-CyF-4tvp.js +98 -0
- package/dist/stock-D1SElOsp.js +75 -0
- package/dist/{stock-D7HQf4-H.js → stock-b7nNc6ko.js} +1 -1
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/integration/netsuite.d.ts +8 -1
- package/dist/stores/inventory.d.ts +119 -30
- package/dist/{supplier-B3kE2tbF.js → supplier-Dm-bxVXL.js} +2 -2
- package/dist/{surcharge-Cc9vownX.js → surcharge-ZM-_XIvY.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-MnUTm-3P.js → use-ingredient-select-dialog-BYxTRqif.js} +2 -2
- package/dist/{use-inventory-binding-dialog-_J9LNiGo.js → use-inventory-binding-dialog-Dg9Mp0Vk.js} +2 -2
- package/dist/{use-template-enabled-locations-2-B9gbuIPM.js → use-template-enabled-locations-2-BmgcViqJ.js} +2 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +64 -8
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +192 -24
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +8 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +96 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +96 -12
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +18 -18
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +14 -0
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +32 -4
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +28 -0
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +169 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingAlternative.vue.d.ts +43 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingRule.vue.d.ts +25 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +125 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventorySkuBindingV2Field.vue.d.ts +129 -0
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-alternative-table.d.ts +30 -0
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +4 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +8 -1
- package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +16 -2
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +33 -5
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +16 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +32 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +8 -1
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +41 -6
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +246 -36
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +287 -42
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +16 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -0
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -1
- package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +24 -3
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -12
- package/dist/views/unit-cost-history/UnitCostHistoryView.vue.d.ts +2 -0
- package/dist/views/unit-cost-history/components/UnitCostDetailsSideSheet.vue.d.ts +19 -0
- package/dist/views/unit-cost-history/components/UnitCostRecalculationDialog.vue.d.ts +11 -0
- package/dist/views/unit-cost-history/composables/use-unit-cost-history.d.ts +65 -0
- package/dist/{vue-i18n-BvsTy4Fg.js → vue-i18n-BwxQzDKn.js} +535 -535
- package/dist/{xlsx-BvjocXXw.js → xlsx-dJMIfias.js} +1 -1
- package/dist/{xlsx.util-D65Nsat4.js → xlsx.util-dclbjq8C.js} +1 -1
- package/package.json +3 -3
- package/dist/RecipeView-C2D7FdzN.js +0 -646
- package/dist/rules-D6o4zK8x.js +0 -327
- package/dist/stock-DLFjfcAv.js +0 -75
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { p as qt, f as Ze } from "./format-time-from-id-
|
|
2
|
-
import { defineComponent as Re, ref as
|
|
1
|
+
import { p as qt, f as Ze } from "./format-time-from-id-ByV0VX1x.js";
|
|
2
|
+
import { defineComponent as Re, ref as J, watch as et, openBlock as l, createElementBlock as h, toDisplayString as y, createCommentVNode as L, createElementVNode as e, unref as f, withDirectives as Vt, vModelText as Et, computed as W, h as U, toRaw as Lt, shallowRef as gt, onUnmounted as Ut, triggerRef as Mt, reactive as jt, onMounted as Ct, resolveComponent as K, createBlock as ae, withCtx as re, createVNode as T, Fragment as ce, renderList as we, createTextVNode as Ie, normalizeClass as Ke, isRef as Bt, resolveDynamicComponent as zt } from "vue";
|
|
3
3
|
import { c as bt } from "./component-DpCUABT3.js";
|
|
4
4
|
import { R as me, D as be } from "./row-action.enum-BcW_L_nE.js";
|
|
5
|
-
import { o as Kt, u as Ae,
|
|
6
|
-
import {
|
|
7
|
-
import { t as Jt, c as Xt, h as At, a as Qe } from "./date2-
|
|
8
|
-
import { u as
|
|
5
|
+
import { o as Kt, u as Ae, U as F, V as nt, O as se, H as Gt, c as Rt, v as yt, a as Ht, W as _t, X as Wt, Y as Yt, Z as $t, t as Ye, s as Ce, D as tt, y as Le, E as Ee } from "./app-ayv5Jw7D.js";
|
|
6
|
+
import { k as Dt, F as Qt, c as kt, a as _e, t as rt, d as ze } from "./number-DPuTdA-J.js";
|
|
7
|
+
import { t as Jt, c as Xt, h as At, a as Qe } from "./date2-GNP-79dA.js";
|
|
8
|
+
import { u as Me, F as Zt, c as er, a as it } from "./feature-BGeFfaiX.js";
|
|
9
9
|
import { useI18n as at, useCoreStore as vt } from "@feedmepos/mf-common";
|
|
10
|
-
import { u as Je, a as ht, S as De } from "./netsuite-
|
|
10
|
+
import { u as Je, a as ht, S as De } from "./netsuite-VGghPz8h.js";
|
|
11
11
|
import { useDialog as lt, useSnackbar as Ge, components as st, FmButtonVariant as Se, useProxiedModel as tr } from "@feedmepos/ui-library";
|
|
12
|
-
import { F as
|
|
12
|
+
import { F as Ue } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
13
13
|
import { E as rr } from "./empty-placeholder-wf6-BWE8.js";
|
|
14
|
-
import { u as sr, a as or, f as nr } from "./format-unit-display-
|
|
15
|
-
import { u as He, _ as ar } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { _ as lr, a as ir, b as cr } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
+
import { u as sr, a as or, f as nr } from "./format-unit-display-r1Hb4DfH.js";
|
|
15
|
+
import { u as He, _ as ar } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bmuw4PTO.js";
|
|
16
|
+
import { _ as lr, a as ir, b as cr } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CeXRT7Lf.js";
|
|
17
17
|
import { u as ur, R as St } from "./usePromise-CbVUCxhj.js";
|
|
18
|
-
import { c as dr } from "./index-
|
|
19
|
-
import { i as mr } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
18
|
+
import { c as dr } from "./index-ClbYCYSU.js";
|
|
19
|
+
import { i as mr } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Db0JeXbc.js";
|
|
20
20
|
import { F as Ot } from "./form-mode.enum-BKiNVH6A.js";
|
|
21
|
-
import { d as Nt } from "./defineDeepModel-
|
|
22
|
-
import { u as pr } from "./vue-i18n-
|
|
23
|
-
import { u as fr } from "./supplier-
|
|
24
|
-
import { u as yr } from "./surcharge-
|
|
21
|
+
import { d as Nt } from "./defineDeepModel-Co03tZfS.js";
|
|
22
|
+
import { u as pr } from "./vue-i18n-BwxQzDKn.js";
|
|
23
|
+
import { u as fr } from "./supplier-Dm-bxVXL.js";
|
|
24
|
+
import { u as yr } from "./surcharge-ZM-_XIvY.js";
|
|
25
25
|
const vr = Kt((b, r) => {
|
|
26
26
|
const s = Ae();
|
|
27
27
|
return {
|
|
@@ -135,7 +135,7 @@ const vr = Kt((b, r) => {
|
|
|
135
135
|
onChange: { type: Function }
|
|
136
136
|
},
|
|
137
137
|
setup(b) {
|
|
138
|
-
const r = b, { t: s } = at(), u =
|
|
138
|
+
const r = b, { t: s } = at(), u = J("");
|
|
139
139
|
et(u, (a) => {
|
|
140
140
|
var g;
|
|
141
141
|
(g = r.onChange) == null || g.call(r, a ?? "");
|
|
@@ -189,7 +189,7 @@ function pt(b, r, s) {
|
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
function Pt() {
|
|
192
|
-
const b = Ae(), r = He(), s =
|
|
192
|
+
const b = Ae(), r = He(), s = Me();
|
|
193
193
|
async function u(a, g) {
|
|
194
194
|
const t = b.currentLocationDBName;
|
|
195
195
|
return a.doc.supplier.internal && a.operation === F.enum.confirmDraft && (a.operation = F.enum.submitRequest), await r.processPurchaseOrder(a, g || t);
|
|
@@ -201,24 +201,24 @@ function Pt() {
|
|
|
201
201
|
return (a) => s.useOperatePurchaseOrderV2 ? v(a.operateV2, a.transferTo) : u(a.operate, a.transferTo);
|
|
202
202
|
}
|
|
203
203
|
var ft = /* @__PURE__ */ ((b) => (b.RECEIVE_REQUEST = "receive/request", b.APPROVAL = "approval", b))(ft || {});
|
|
204
|
-
const We =
|
|
204
|
+
const We = J(), ct = J();
|
|
205
205
|
function wa(b, r) {
|
|
206
|
-
const s = lt(), u = Ae(), v =
|
|
206
|
+
const s = lt(), u = Ae(), v = Me();
|
|
207
207
|
Je();
|
|
208
|
-
const a = sr(), g = or(), t =
|
|
208
|
+
const a = sr(), g = or(), t = J(!1), i = Ge(), _ = He(), w = vr(), C = J(new Array()), c = J(new Array()), R = J(
|
|
209
209
|
r != null && r.startDate && (r != null && r.endDate) ? r : mr()
|
|
210
|
-
), $ =
|
|
211
|
-
const
|
|
210
|
+
), $ = W(() => {
|
|
211
|
+
const M = new Date(R.value.startDate), j = new Date(R.value.endDate);
|
|
212
212
|
return {
|
|
213
|
-
start: Jt(
|
|
213
|
+
start: Jt(M).toISOString(),
|
|
214
214
|
end: Xt(j).toISOString()
|
|
215
215
|
};
|
|
216
|
-
}), D =
|
|
217
|
-
async function d(
|
|
216
|
+
}), D = J(new Array()), n = Gt(), m = J(null);
|
|
217
|
+
async function d(M) {
|
|
218
218
|
function j(A) {
|
|
219
219
|
const O = {
|
|
220
220
|
mode: Ot.CREATE,
|
|
221
|
-
modelValue:
|
|
221
|
+
modelValue: M || void 0,
|
|
222
222
|
show: !0,
|
|
223
223
|
"onUpdate:show"(I) {
|
|
224
224
|
We.value.show = I;
|
|
@@ -229,7 +229,7 @@ function wa(b, r) {
|
|
|
229
229
|
We.value = O;
|
|
230
230
|
}
|
|
231
231
|
let oe;
|
|
232
|
-
v.mustUsePoTemplate && !(
|
|
232
|
+
v.mustUsePoTemplate && !(M != null && M.template) ? s.open({
|
|
233
233
|
title: "Create transfer",
|
|
234
234
|
message: "",
|
|
235
235
|
primaryActions: {
|
|
@@ -247,10 +247,10 @@ function wa(b, r) {
|
|
|
247
247
|
j(void 0);
|
|
248
248
|
}) : j(oe);
|
|
249
249
|
}
|
|
250
|
-
function S(
|
|
250
|
+
function S(M) {
|
|
251
251
|
const j = {
|
|
252
252
|
mode: Ot.UPDATE,
|
|
253
|
-
modelValue: Rt(
|
|
253
|
+
modelValue: Rt(M),
|
|
254
254
|
show: !0,
|
|
255
255
|
"onUpdate:show"(oe) {
|
|
256
256
|
We.value.show = oe;
|
|
@@ -262,15 +262,15 @@ function wa(b, r) {
|
|
|
262
262
|
async function k() {
|
|
263
263
|
C.value = [], c.value = [], t.value = !0;
|
|
264
264
|
try {
|
|
265
|
-
const
|
|
266
|
-
C.value =
|
|
267
|
-
const j =
|
|
265
|
+
const M = await _.getPurchaseOrders($.value);
|
|
266
|
+
C.value = M.sort((B, le) => le._id.localeCompare(B._id));
|
|
267
|
+
const j = M.flatMap((B) => B.shipmentIds || []).filter(Boolean), oe = j.length > 0 ? await w.getShipmentsByIds(j) : [];
|
|
268
268
|
c.value = oe;
|
|
269
269
|
const A = await n.readCurrentLocationLastClosing(!0), O = A == null ? void 0 : A._id;
|
|
270
270
|
O && (m.value = qt(O)), await v.awaitFeatureLoaded(() => v.mustUsePoTemplate) && await g.fetchTemplates();
|
|
271
271
|
const I = C.value.map((B) => {
|
|
272
|
-
var
|
|
273
|
-
return ((
|
|
272
|
+
var le;
|
|
273
|
+
return ((le = B.request) == null ? void 0 : le.id) ?? "";
|
|
274
274
|
}).filter((B) => B);
|
|
275
275
|
D.value = await _.readRequestByIds(I);
|
|
276
276
|
} catch {
|
|
@@ -283,14 +283,14 @@ function wa(b, r) {
|
|
|
283
283
|
t.value = !1;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
async function
|
|
286
|
+
async function G() {
|
|
287
287
|
D.value = [], t.value = !0;
|
|
288
288
|
try {
|
|
289
289
|
D.value = await _.readRequests(
|
|
290
290
|
void 0,
|
|
291
291
|
$.value.start,
|
|
292
292
|
$.value.end
|
|
293
|
-
).then((
|
|
293
|
+
).then((M) => M.reverse());
|
|
294
294
|
} catch {
|
|
295
295
|
i.open({
|
|
296
296
|
title: "Something went wrong",
|
|
@@ -306,33 +306,33 @@ function wa(b, r) {
|
|
|
306
306
|
case "receive/request":
|
|
307
307
|
return k();
|
|
308
308
|
case "approval":
|
|
309
|
-
return
|
|
309
|
+
return G();
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
function ee(
|
|
312
|
+
function ee(M, j) {
|
|
313
313
|
R.value = {
|
|
314
|
-
startDate:
|
|
314
|
+
startDate: M,
|
|
315
315
|
endDate: j
|
|
316
316
|
}, N();
|
|
317
317
|
}
|
|
318
|
-
u.watchLocation(async (
|
|
319
|
-
if (!
|
|
318
|
+
u.watchLocation(async (M) => {
|
|
319
|
+
if (!M) {
|
|
320
320
|
C.value = [];
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
323
|
await N();
|
|
324
324
|
});
|
|
325
|
-
const
|
|
326
|
-
async function
|
|
325
|
+
const z = J(), H = J(Math.random().toString());
|
|
326
|
+
async function he(M, j) {
|
|
327
327
|
const oe = Math.random().toString();
|
|
328
|
-
|
|
329
|
-
(B) => B.purchaseOrderId ===
|
|
328
|
+
H.value = oe, j ?? (j = D.value.computeFirst(
|
|
329
|
+
(B) => B.purchaseOrderId === M._id ? B : null
|
|
330
330
|
) ?? void 0);
|
|
331
331
|
const A = b === "receive/request" ? u.currentLocation : j == null ? void 0 : j.to, O = b === "approval", I = {
|
|
332
332
|
poRequest: j,
|
|
333
333
|
purchaseOrder: {
|
|
334
|
-
...
|
|
335
|
-
status: O && (j != null && j.rejectedAt) ? se.Enum.REJECT :
|
|
334
|
+
...M,
|
|
335
|
+
status: O && (j != null && j.rejectedAt) ? se.Enum.REJECT : M.status
|
|
336
336
|
},
|
|
337
337
|
transferTo: A == null ? void 0 : A.name,
|
|
338
338
|
transferToDbName: A == null ? void 0 : A.dbName,
|
|
@@ -340,22 +340,22 @@ function wa(b, r) {
|
|
|
340
340
|
canResubmit: !1,
|
|
341
341
|
canApprove: O,
|
|
342
342
|
"onUpdate:show"(B) {
|
|
343
|
-
|
|
343
|
+
z.value.show = B;
|
|
344
344
|
},
|
|
345
345
|
scope: b,
|
|
346
|
-
receivedMap: ot(
|
|
346
|
+
receivedMap: ot(M) ?? {},
|
|
347
347
|
shipments: c.value
|
|
348
348
|
};
|
|
349
|
-
|
|
349
|
+
z.value = I;
|
|
350
350
|
}
|
|
351
|
-
async function
|
|
351
|
+
async function fe(M, j, oe, A, O) {
|
|
352
352
|
const I = Pt();
|
|
353
353
|
t.value = !0;
|
|
354
354
|
try {
|
|
355
355
|
await I({
|
|
356
356
|
operate: {
|
|
357
357
|
operation: j,
|
|
358
|
-
doc:
|
|
358
|
+
doc: M,
|
|
359
359
|
options: (
|
|
360
360
|
// auto receive for supplier to warehouse
|
|
361
361
|
(j === F.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
@@ -365,15 +365,15 @@ function wa(b, r) {
|
|
|
365
365
|
)
|
|
366
366
|
},
|
|
367
367
|
operateV2: {
|
|
368
|
-
_id:
|
|
369
|
-
_rev:
|
|
368
|
+
_id: M._id,
|
|
369
|
+
_rev: M._rev ?? "",
|
|
370
370
|
action: j,
|
|
371
371
|
payloads: O ?? []
|
|
372
372
|
},
|
|
373
373
|
transferTo: A
|
|
374
374
|
}), await new Promise((Ne) => setTimeout(Ne, 1e3));
|
|
375
|
-
const
|
|
376
|
-
j === F.enum.confirmDraft &&
|
|
375
|
+
const le = Ae().currentLocationDBName.startsWith("restaurant_");
|
|
376
|
+
j === F.enum.confirmDraft && M.effectiveAt && le ? i.open({
|
|
377
377
|
title: "Success",
|
|
378
378
|
message: `${oe}. The backdate will be reflected once your POS has received this change.`,
|
|
379
379
|
type: "success"
|
|
@@ -387,12 +387,12 @@ function wa(b, r) {
|
|
|
387
387
|
title: "Something went wrong",
|
|
388
388
|
message: "Please try again.",
|
|
389
389
|
type: "error"
|
|
390
|
-
}), console.error("Error when submitting PO operation", j,
|
|
390
|
+
}), console.error("Error when submitting PO operation", j, M, B);
|
|
391
391
|
} finally {
|
|
392
392
|
t.value = !1, N();
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
async function $e(
|
|
395
|
+
async function $e(M, j, oe) {
|
|
396
396
|
const A = Ft[j];
|
|
397
397
|
if (!A) {
|
|
398
398
|
i.open({
|
|
@@ -412,16 +412,16 @@ function wa(b, r) {
|
|
|
412
412
|
contentComponent: Tt,
|
|
413
413
|
contentComponentProps: {
|
|
414
414
|
message: I.message,
|
|
415
|
-
onChange: (
|
|
415
|
+
onChange: (le) => B = le
|
|
416
416
|
}
|
|
417
417
|
}).onPrimary(() => {
|
|
418
|
-
const
|
|
419
|
-
|
|
418
|
+
const le = [];
|
|
419
|
+
le.push({
|
|
420
420
|
action: "rejectDraft",
|
|
421
421
|
payload: {
|
|
422
422
|
rejectReason: B
|
|
423
423
|
}
|
|
424
|
-
}),
|
|
424
|
+
}), fe(M, j, O, oe, le);
|
|
425
425
|
});
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
@@ -430,7 +430,7 @@ function wa(b, r) {
|
|
|
430
430
|
message: I.message,
|
|
431
431
|
primaryActions: I.primaryActions
|
|
432
432
|
}).onPrimary(() => {
|
|
433
|
-
|
|
433
|
+
fe(M, j, O, oe);
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
436
|
async function je() {
|
|
@@ -445,13 +445,13 @@ function wa(b, r) {
|
|
|
445
445
|
close: !0
|
|
446
446
|
}
|
|
447
447
|
}).onPrimary(() => {
|
|
448
|
-
const
|
|
448
|
+
const M = {
|
|
449
449
|
show: !0,
|
|
450
450
|
"onUpdate:show"(j) {
|
|
451
451
|
ct.value.show = j;
|
|
452
452
|
}
|
|
453
453
|
};
|
|
454
|
-
ct.value =
|
|
454
|
+
ct.value = M;
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
return {
|
|
@@ -464,8 +464,8 @@ function wa(b, r) {
|
|
|
464
464
|
transferDialogProps: We,
|
|
465
465
|
promptCreateTransferDialog: d,
|
|
466
466
|
promptUpdateTransferDialog: S,
|
|
467
|
-
transferDetailsProps:
|
|
468
|
-
promptShowTransferDetails:
|
|
467
|
+
transferDetailsProps: z,
|
|
468
|
+
promptShowTransferDetails: he,
|
|
469
469
|
submitAction: $e,
|
|
470
470
|
xilnexImportDialogProps: ct,
|
|
471
471
|
promptUploadTransferDialog: je
|
|
@@ -481,7 +481,7 @@ function Sr(b, r) {
|
|
|
481
481
|
);
|
|
482
482
|
}
|
|
483
483
|
function Or(b) {
|
|
484
|
-
const { po: r, currentLocation: s, business: u, fulfilling: v, por: a } = b, { name: g, address: t, regNo: i, legalName: _ } = s.doc.profile,
|
|
484
|
+
const { po: r, currentLocation: s, business: u, fulfilling: v, por: a } = b, { name: g, address: t, regNo: i, legalName: _ } = s.doc.profile, w = {
|
|
485
485
|
name: g,
|
|
486
486
|
legalName: _,
|
|
487
487
|
registrationNumber: i,
|
|
@@ -502,15 +502,15 @@ function Or(b) {
|
|
|
502
502
|
state: r.supplier.address.state,
|
|
503
503
|
country: r.supplier.address.country
|
|
504
504
|
}, c = r.items.map((k) => {
|
|
505
|
-
const { sku:
|
|
505
|
+
const { sku: G, measurement: N } = k, ee = _e(
|
|
506
506
|
Sr(k.sku, r.deliveryOrder || []),
|
|
507
507
|
!1
|
|
508
508
|
);
|
|
509
509
|
return {
|
|
510
|
-
code:
|
|
511
|
-
description:
|
|
510
|
+
code: G.code,
|
|
511
|
+
description: G.name,
|
|
512
512
|
quantity: _e(k.quantity, !1),
|
|
513
|
-
unit: (N == null ? void 0 : N.abbrev) ||
|
|
513
|
+
unit: (N == null ? void 0 : N.abbrev) || G.unit.abbrev,
|
|
514
514
|
received: ee,
|
|
515
515
|
cost: k.totalCost ? `${k.totalCost.currency} ${Zt.toFormatString({
|
|
516
516
|
value: k.totalCost
|
|
@@ -520,13 +520,13 @@ function Or(b) {
|
|
|
520
520
|
createdAt: At(new Date(k.createdAt)),
|
|
521
521
|
ref: k.deliveryOrderNumber,
|
|
522
522
|
remark: k.remark || "",
|
|
523
|
-
items: k.received.map((
|
|
523
|
+
items: k.received.map((G) => {
|
|
524
524
|
var N;
|
|
525
525
|
return {
|
|
526
|
-
code:
|
|
527
|
-
description:
|
|
528
|
-
quantity: _e(
|
|
529
|
-
unit: ((N =
|
|
526
|
+
code: G.sku.code,
|
|
527
|
+
description: G.sku.name,
|
|
528
|
+
quantity: _e(G.amount),
|
|
529
|
+
unit: ((N = G.measurement) == null ? void 0 : N.abbrev) || G.sku.unit.abbrev
|
|
530
530
|
};
|
|
531
531
|
})
|
|
532
532
|
})), $ = [
|
|
@@ -548,7 +548,7 @@ function Or(b) {
|
|
|
548
548
|
createdAt: Ze(r._id),
|
|
549
549
|
ref: r.ref || "",
|
|
550
550
|
remark: r.remark || "",
|
|
551
|
-
buyer:
|
|
551
|
+
buyer: w,
|
|
552
552
|
supplier: C,
|
|
553
553
|
items: c,
|
|
554
554
|
status: r.status,
|
|
@@ -619,7 +619,7 @@ const Te = {
|
|
|
619
619
|
}
|
|
620
620
|
};
|
|
621
621
|
function It() {
|
|
622
|
-
const b =
|
|
622
|
+
const b = Me();
|
|
623
623
|
return {
|
|
624
624
|
ableToMarkReceived(r) {
|
|
625
625
|
if (!r || r.status !== se.enum.RECEIVING || b.useOperatePurchaseOrderV2) return !1;
|
|
@@ -680,18 +680,18 @@ function Ca(b, r, s) {
|
|
|
680
680
|
function _($) {
|
|
681
681
|
return Object.values(F.enum).includes($);
|
|
682
682
|
}
|
|
683
|
-
async function
|
|
684
|
-
var d, S, k,
|
|
683
|
+
async function w($, D, n) {
|
|
684
|
+
var d, S, k, G, N, ee;
|
|
685
685
|
const m = Rt(D);
|
|
686
686
|
if ($ === me.Print) {
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
const
|
|
690
|
-
|
|
687
|
+
const z = (n == null ? void 0 : n.toInventoryLocation) ?? u.currentLocation;
|
|
688
|
+
if (z.type === "restaurant") {
|
|
689
|
+
const H = u.locationRestaurantFromCore(z.doc._id);
|
|
690
|
+
H !== null && (z.doc = H);
|
|
691
691
|
}
|
|
692
|
-
((d = n == null ? void 0 : n.netSuite) != null && d.refNo || (S = m.netSuite) != null && S.refNo) && (m.ref = [((k = n == null ? void 0 : n.netSuite) == null ? void 0 : k.refNo) || ((
|
|
692
|
+
((d = n == null ? void 0 : n.netSuite) != null && d.refNo || (S = m.netSuite) != null && S.refNo) && (m.ref = [((k = n == null ? void 0 : n.netSuite) == null ? void 0 : k.refNo) || ((G = m.netSuite) == null ? void 0 : G.refNo)].filter((H) => H).join(" ")), Or({
|
|
693
693
|
po: m,
|
|
694
|
-
currentLocation:
|
|
694
|
+
currentLocation: z,
|
|
695
695
|
business: a.currentBusiness.value,
|
|
696
696
|
fulfilling: b === "approval",
|
|
697
697
|
por: n
|
|
@@ -740,14 +740,14 @@ function Ca(b, r, s) {
|
|
|
740
740
|
header: () => t("inventory.transfer.table.noOfItems"),
|
|
741
741
|
cell: (n) => {
|
|
742
742
|
const m = n.row.original.version || "1", d = n.getValue();
|
|
743
|
-
return
|
|
743
|
+
return U("div", { class: "flex items-center gap-2" }, [
|
|
744
744
|
d,
|
|
745
|
-
m !== "1" ?
|
|
745
|
+
m !== "1" ? U(
|
|
746
746
|
"div",
|
|
747
747
|
{ class: "py-3" },
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
748
|
+
U(
|
|
749
|
+
Ue,
|
|
750
|
+
U(
|
|
751
751
|
"div",
|
|
752
752
|
{
|
|
753
753
|
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
@@ -772,7 +772,7 @@ function Ca(b, r, s) {
|
|
|
772
772
|
...(D = a.sessionUser.value) != null && D.role.isAdmin ? [
|
|
773
773
|
{
|
|
774
774
|
id: "statusForAdmin",
|
|
775
|
-
header: () =>
|
|
775
|
+
header: () => U(Ue, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
776
776
|
cell(n) {
|
|
777
777
|
return n.row.original.status;
|
|
778
778
|
},
|
|
@@ -784,28 +784,28 @@ function Ca(b, r, s) {
|
|
|
784
784
|
accessorKey: "status",
|
|
785
785
|
header: () => t("inventory.transfer.table.status"),
|
|
786
786
|
cell(n) {
|
|
787
|
-
const m = n.getValue(), d = ot(n.row.original), { partial: S, over: k } = mt(d),
|
|
788
|
-
let N = t(`inventory.transfer.status.${
|
|
789
|
-
|
|
790
|
-
let
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
793
|
-
const
|
|
794
|
-
if (
|
|
795
|
-
const
|
|
796
|
-
|
|
787
|
+
const m = n.getValue(), d = ot(n.row.original), { partial: S, over: k } = mt(d), G = pt(m ?? "", S, k);
|
|
788
|
+
let N = t(`inventory.transfer.status.${G}`), ee = `${m ?? ""}`.toLocaleLowerCase("en-us");
|
|
789
|
+
G === se.enum.CLOSE && (N = `${t(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), G === "PARTIAL_RECEIVED" && ee === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (ee = se.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
790
|
+
let z = null;
|
|
791
|
+
const H = s.value.find((he) => he.ref === n.row.original._id);
|
|
792
|
+
if (H != null && H.milestones && H.milestones.length > 0) {
|
|
793
|
+
const he = H.milestones[H.milestones.length - 1];
|
|
794
|
+
if (he.estimatedTime) {
|
|
795
|
+
const fe = new Date(he.estimatedTime), $e = fe.getDate().toString().padStart(2, "0");
|
|
796
|
+
z = `${fe.toLocaleString("en-US", { month: "short" })} ${$e}`;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
|
-
return
|
|
799
|
+
return U(
|
|
800
800
|
"div",
|
|
801
801
|
{
|
|
802
802
|
class: "flex"
|
|
803
803
|
},
|
|
804
804
|
[
|
|
805
|
-
|
|
805
|
+
U(
|
|
806
806
|
"div",
|
|
807
807
|
{ class: "flex items-center" },
|
|
808
|
-
|
|
808
|
+
U(
|
|
809
809
|
"div",
|
|
810
810
|
{
|
|
811
811
|
class: [
|
|
@@ -817,22 +817,22 @@ function Ca(b, r, s) {
|
|
|
817
817
|
`${N}`
|
|
818
818
|
)
|
|
819
819
|
),
|
|
820
|
-
...
|
|
821
|
-
|
|
820
|
+
...z ? [
|
|
821
|
+
U(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
824
|
class: "flex items-center gap-1 ml-2"
|
|
825
825
|
},
|
|
826
826
|
[
|
|
827
|
-
|
|
827
|
+
U(st.FmIcon, {
|
|
828
828
|
name: "local_shipping",
|
|
829
829
|
size: "md",
|
|
830
830
|
color: "neutral-gray-400"
|
|
831
831
|
}),
|
|
832
|
-
|
|
832
|
+
U(
|
|
833
833
|
"span",
|
|
834
834
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
835
|
-
|
|
835
|
+
z
|
|
836
836
|
)
|
|
837
837
|
]
|
|
838
838
|
)
|
|
@@ -847,7 +847,7 @@ function Ca(b, r, s) {
|
|
|
847
847
|
id: "action",
|
|
848
848
|
cell(n) {
|
|
849
849
|
const m = n.row.original, d = i(m);
|
|
850
|
-
return bt(d, (S) =>
|
|
850
|
+
return bt(d, (S) => w(S, m));
|
|
851
851
|
},
|
|
852
852
|
enableSorting: !1,
|
|
853
853
|
size: 40,
|
|
@@ -939,7 +939,7 @@ function Ca(b, r, s) {
|
|
|
939
939
|
...(D = a.sessionUser.value) != null && D.role.isAdmin ? [
|
|
940
940
|
{
|
|
941
941
|
id: "statusForAdmin",
|
|
942
|
-
header: () =>
|
|
942
|
+
header: () => U(Ue, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
943
943
|
cell(n) {
|
|
944
944
|
return n.row.original.status;
|
|
945
945
|
},
|
|
@@ -953,24 +953,24 @@ function Ca(b, r, s) {
|
|
|
953
953
|
cell(n) {
|
|
954
954
|
const m = n.row.original, d = n.getValue();
|
|
955
955
|
if (!m.purchaseOrder)
|
|
956
|
-
return
|
|
956
|
+
return U(st.FmChip, {
|
|
957
957
|
label: "N/A",
|
|
958
958
|
compact: !0
|
|
959
959
|
});
|
|
960
|
-
const S = ot(m.purchaseOrder), { partial: k, over:
|
|
961
|
-
let ee = t(`inventory.transfer.status.${N}`),
|
|
962
|
-
return N === se.enum.CLOSE && (ee = `${t(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), N === "PARTIAL_RECEIVED" &&
|
|
960
|
+
const S = ot(m.purchaseOrder), { partial: k, over: G } = mt(S), N = pt(d ?? "", k, G);
|
|
961
|
+
let ee = t(`inventory.transfer.status.${N}`), z = `${d ?? ""}`.toLocaleLowerCase("en-us");
|
|
962
|
+
return N === se.enum.CLOSE && (ee = `${t(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), N === "PARTIAL_RECEIVED" && z === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (z = se.enum.RECEIVING.toLocaleLowerCase("en-us")), m.rejectedAt && (ee = t("inventory.transfer.status.REJECT"), z = se.enum.REJECT.toLocaleLowerCase("en-us")), U(
|
|
963
963
|
"div",
|
|
964
964
|
{
|
|
965
965
|
class: "flex"
|
|
966
966
|
},
|
|
967
|
-
|
|
967
|
+
U(
|
|
968
968
|
"div",
|
|
969
969
|
{
|
|
970
970
|
class: [
|
|
971
971
|
"fm-status-badge",
|
|
972
|
-
`fm-status-badge-${
|
|
973
|
-
|
|
972
|
+
`fm-status-badge-${z}`,
|
|
973
|
+
G && "fm-status-badge-error"
|
|
974
974
|
].filter(Boolean).join(" ")
|
|
975
975
|
},
|
|
976
976
|
`${ee}`
|
|
@@ -988,7 +988,7 @@ function Ca(b, r, s) {
|
|
|
988
988
|
} : k);
|
|
989
989
|
return bt(
|
|
990
990
|
S,
|
|
991
|
-
(k) => m.purchaseOrder ?
|
|
991
|
+
(k) => m.purchaseOrder ? w(k, m.purchaseOrder, m) : void 0
|
|
992
992
|
);
|
|
993
993
|
},
|
|
994
994
|
enableSorting: !1,
|
|
@@ -1044,7 +1044,7 @@ function Ca(b, r, s) {
|
|
|
1044
1044
|
return $;
|
|
1045
1045
|
}
|
|
1046
1046
|
return {
|
|
1047
|
-
columnDefs:
|
|
1047
|
+
columnDefs: W(() => b === "receive/request" ? C() : c())
|
|
1048
1048
|
};
|
|
1049
1049
|
}
|
|
1050
1050
|
function Pe(b) {
|
|
@@ -1074,14 +1074,14 @@ function xt(b) {
|
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
1076
1076
|
function wt(b, r, s, u, v) {
|
|
1077
|
-
const a = Pe(b.suppliers ?? []), g = Pe(r.allLocations ?? []).map(xt), t = r._currentLocation ? xt(Pe(r._currentLocation)) : null, i = s.inventory ? [Pe(s.inventory)] : [], _ = u.state.setting ? Pe(u.state.setting) : null,
|
|
1077
|
+
const a = Pe(b.suppliers ?? []), g = Pe(r.allLocations ?? []).map(xt), t = r._currentLocation ? xt(Pe(r._currentLocation)) : null, i = s.inventory ? [Pe(s.inventory)] : [], _ = u.state.setting ? Pe(u.state.setting) : null, w = Pe(v.surcharges ?? []);
|
|
1078
1078
|
return {
|
|
1079
1079
|
suppliers: a,
|
|
1080
1080
|
locations: g,
|
|
1081
1081
|
currentLocation: t,
|
|
1082
1082
|
inventoryDoc: i,
|
|
1083
1083
|
netSuiteSetting: _,
|
|
1084
|
-
surcharges:
|
|
1084
|
+
surcharges: w
|
|
1085
1085
|
};
|
|
1086
1086
|
}
|
|
1087
1087
|
function xr() {
|
|
@@ -1111,10 +1111,10 @@ function xr() {
|
|
|
1111
1111
|
default:
|
|
1112
1112
|
console.warn(`Unknown partial update operation: ${c}, falling back to 'set'`), _t(t.value, R, $);
|
|
1113
1113
|
}
|
|
1114
|
-
R !== "remark" && R !== "ref" &&
|
|
1114
|
+
R !== "remark" && R !== "ref" && Mt(t);
|
|
1115
1115
|
};
|
|
1116
1116
|
g.value.addPartialListener(_);
|
|
1117
|
-
function
|
|
1117
|
+
function w() {
|
|
1118
1118
|
const c = wt(
|
|
1119
1119
|
b,
|
|
1120
1120
|
r,
|
|
@@ -1134,10 +1134,10 @@ function xr() {
|
|
|
1134
1134
|
() => v.surcharges
|
|
1135
1135
|
],
|
|
1136
1136
|
() => {
|
|
1137
|
-
|
|
1137
|
+
w();
|
|
1138
1138
|
},
|
|
1139
1139
|
{ deep: !0 }
|
|
1140
|
-
),
|
|
1140
|
+
), Ut(() => {
|
|
1141
1141
|
g.value.removeListener(i), g.value.removePartialListener(_);
|
|
1142
1142
|
});
|
|
1143
1143
|
function C(c) {
|
|
@@ -1146,7 +1146,7 @@ function xr() {
|
|
|
1146
1146
|
g.value.loadPurchaseOrder(c);
|
|
1147
1147
|
return;
|
|
1148
1148
|
}
|
|
1149
|
-
if (!
|
|
1149
|
+
if (!Me().mustUsePoTemplate) {
|
|
1150
1150
|
g.value.init();
|
|
1151
1151
|
return;
|
|
1152
1152
|
}
|
|
@@ -1170,7 +1170,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1170
1170
|
id: "",
|
|
1171
1171
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1172
1172
|
items: []
|
|
1173
|
-
}), v =
|
|
1173
|
+
}), v = J(), a = r;
|
|
1174
1174
|
Ct(() => {
|
|
1175
1175
|
s.purchaseOrder && (u.items = s.purchaseOrder.items.map((t) => ({
|
|
1176
1176
|
id: t.id,
|
|
@@ -1179,10 +1179,10 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1179
1179
|
amount: t.quantity ?? { amount: 1, precision: 0 }
|
|
1180
1180
|
})));
|
|
1181
1181
|
});
|
|
1182
|
-
const g =
|
|
1182
|
+
const g = W(() => u.items.length <= 10);
|
|
1183
1183
|
return (t, i) => {
|
|
1184
|
-
const _ =
|
|
1185
|
-
return l(),
|
|
1184
|
+
const _ = K("FmTable"), w = K("FmButton"), C = K("FmForm");
|
|
1185
|
+
return l(), ae(C, {
|
|
1186
1186
|
ref_key: "formRef",
|
|
1187
1187
|
ref: v,
|
|
1188
1188
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
@@ -1199,7 +1199,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1199
1199
|
header: "Code",
|
|
1200
1200
|
cell: (c) => {
|
|
1201
1201
|
const R = s.purchaseOrder.items.find(($) => $.id === c.row.original.id || $.sku._id === c.row.original.sku._id);
|
|
1202
|
-
return
|
|
1202
|
+
return U(
|
|
1203
1203
|
f(st).FmTooltip,
|
|
1204
1204
|
{
|
|
1205
1205
|
content: R.code,
|
|
@@ -1207,7 +1207,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1207
1207
|
variant: "plain",
|
|
1208
1208
|
zIndex: 50
|
|
1209
1209
|
},
|
|
1210
|
-
|
|
1210
|
+
U(
|
|
1211
1211
|
"span",
|
|
1212
1212
|
{
|
|
1213
1213
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -1221,7 +1221,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1221
1221
|
header: "Name",
|
|
1222
1222
|
cell: (c) => {
|
|
1223
1223
|
const R = s.purchaseOrder.items.find(($) => $.id === c.row.original.id || $.sku._id === c.row.original.sku._id);
|
|
1224
|
-
return
|
|
1224
|
+
return U(
|
|
1225
1225
|
f(st).FmTooltip,
|
|
1226
1226
|
{
|
|
1227
1227
|
content: R.name,
|
|
@@ -1229,7 +1229,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1229
1229
|
variant: "plain",
|
|
1230
1230
|
zIndex: 50
|
|
1231
1231
|
},
|
|
1232
|
-
|
|
1232
|
+
U(
|
|
1233
1233
|
"span",
|
|
1234
1234
|
{
|
|
1235
1235
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -1246,7 +1246,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1246
1246
|
amount: 1,
|
|
1247
1247
|
precision: 0
|
|
1248
1248
|
};
|
|
1249
|
-
return
|
|
1249
|
+
return U(lr, {
|
|
1250
1250
|
style: {
|
|
1251
1251
|
flex: "1 1 0%"
|
|
1252
1252
|
},
|
|
@@ -1279,14 +1279,14 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1279
1279
|
])
|
|
1280
1280
|
]),
|
|
1281
1281
|
e("div", Rr, [
|
|
1282
|
-
T(
|
|
1282
|
+
T(w, {
|
|
1283
1283
|
class: "px-16",
|
|
1284
1284
|
label: "Confirm",
|
|
1285
1285
|
size: "md",
|
|
1286
1286
|
variant: "primary",
|
|
1287
1287
|
type: "submit"
|
|
1288
1288
|
}),
|
|
1289
|
-
T(
|
|
1289
|
+
T(w, {
|
|
1290
1290
|
class: "px-16",
|
|
1291
1291
|
label: "Cancel",
|
|
1292
1292
|
size: "md",
|
|
@@ -1372,21 +1372,21 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1372
1372
|
scope: {}
|
|
1373
1373
|
},
|
|
1374
1374
|
setup(b) {
|
|
1375
|
-
const r = b, s = Je(), u = Ge(), v = lt(), a =
|
|
1376
|
-
|
|
1377
|
-
var
|
|
1375
|
+
const r = b, s = Je(), u = Ge(), v = lt(), a = J(!1);
|
|
1376
|
+
W(() => {
|
|
1377
|
+
var w, C, c, R;
|
|
1378
1378
|
let t = !0;
|
|
1379
1379
|
s.isEnabled || (t = !1);
|
|
1380
1380
|
const i = r.purchaseOrder, _ = r.poRequest;
|
|
1381
|
-
return i && ((
|
|
1381
|
+
return i && ((w = i == null ? void 0 : i.supplier) != null && w.internal ? (!_ && i.status == se.enum.DRAFT && (t = !1), _ && !((C = _ == null ? void 0 : _.netSuite) != null && C.id) && (t = !1), r.isTransferBetweenOutlets && (t = !1)) : ((i == null ? void 0 : i.status) !== se.enum.REQUESTING && i.supplier.internal && (t = !1), !_ && !((c = i == null ? void 0 : i.netSuite) != null && c.id) && (t = !1), !_ && ((R = i == null ? void 0 : i.netSuite) != null && R.id) && (i == null ? void 0 : i.status) == se.enum.REQUESTING && (t = !1))), t;
|
|
1382
1382
|
});
|
|
1383
1383
|
async function g() {
|
|
1384
1384
|
a.value || v.open({
|
|
1385
1385
|
title: "Sync with NetSuite",
|
|
1386
|
-
contentComponent:
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1386
|
+
contentComponent: U("div", [
|
|
1387
|
+
U("p", "Are you sure you want to sync now?"),
|
|
1388
|
+
U("br"),
|
|
1389
|
+
U(
|
|
1390
1390
|
"p",
|
|
1391
1391
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1392
1392
|
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
@@ -1402,9 +1402,9 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1402
1402
|
var t, i, _;
|
|
1403
1403
|
try {
|
|
1404
1404
|
a.value = !0;
|
|
1405
|
-
const
|
|
1405
|
+
const w = ((t = r.purchaseOrder) == null ? void 0 : t._id) || ((i = r.poRequest) == null ? void 0 : i.purchaseOrderId) || "", C = (_ = r.poRequest) == null ? void 0 : _.to.dbName;
|
|
1406
1406
|
await s.syncPurchaseOrder(
|
|
1407
|
-
|
|
1407
|
+
w,
|
|
1408
1408
|
r.scope === "approval" ? C : void 0
|
|
1409
1409
|
), u.open({
|
|
1410
1410
|
title: "Sync with NetSuite",
|
|
@@ -1421,7 +1421,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1421
1421
|
});
|
|
1422
1422
|
}
|
|
1423
1423
|
return (t, i) => {
|
|
1424
|
-
const _ =
|
|
1424
|
+
const _ = K("FmButton");
|
|
1425
1425
|
return l(), h("div", Dr, [
|
|
1426
1426
|
T(_, {
|
|
1427
1427
|
"prepend-icon": "sync",
|
|
@@ -1445,7 +1445,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1445
1445
|
}, Pr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ir = { class: "fm-typo-en-body-lg-600" }, qr = { key: 0 }, Vr = { key: 1 }, Er = {
|
|
1446
1446
|
key: 1,
|
|
1447
1447
|
class: "flex flex-col gap-4"
|
|
1448
|
-
}, Lr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1448
|
+
}, Lr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ur = { class: "fm-typo-en-body-lg-600" }, Mr = { key: 0 }, jr = { key: 1 }, Br = {
|
|
1449
1449
|
key: 2,
|
|
1450
1450
|
class: "flex flex-col gap-4"
|
|
1451
1451
|
}, zr = { class: "fm-typo-en-body-lg-600" }, Kr = {
|
|
@@ -1462,7 +1462,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1462
1462
|
scope: {}
|
|
1463
1463
|
},
|
|
1464
1464
|
setup(b) {
|
|
1465
|
-
const r = b, s = Je(), u = He(), v =
|
|
1465
|
+
const r = b, s = Je(), u = He(), v = J(r.poRequest);
|
|
1466
1466
|
Ct(async () => {
|
|
1467
1467
|
var i;
|
|
1468
1468
|
if (!r.poRequest && ((i = r.purchaseOrder) != null && i._id)) {
|
|
@@ -1470,40 +1470,40 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1470
1470
|
v.value = _;
|
|
1471
1471
|
}
|
|
1472
1472
|
});
|
|
1473
|
-
const a =
|
|
1473
|
+
const a = W(
|
|
1474
1474
|
() => {
|
|
1475
|
-
var i, _,
|
|
1475
|
+
var i, _, w, C, c, R;
|
|
1476
1476
|
return s.getSubsidiaryFullName(
|
|
1477
|
-
((
|
|
1477
|
+
((w = (_ = (i = r.purchaseOrder) == null ? void 0 : i.netSuite) == null ? void 0 : _.subsidiary) == null ? void 0 : w.id) || ((R = (c = (C = r.poRequest) == null ? void 0 : C.netSuite) == null ? void 0 : c.subsidiary) == null ? void 0 : R.id)
|
|
1478
1478
|
).fullName;
|
|
1479
1479
|
}
|
|
1480
|
-
), g =
|
|
1481
|
-
var i, _,
|
|
1482
|
-
return (
|
|
1483
|
-
}), t =
|
|
1484
|
-
var i, _,
|
|
1485
|
-
return (_ = (i = r.purchaseOrder) == null ? void 0 : i.deliveryFullfillment) != null && _.length && ((C = (
|
|
1480
|
+
), g = W(() => {
|
|
1481
|
+
var i, _, w, C, c, R, $, D, n, m, d, S;
|
|
1482
|
+
return (w = (_ = (i = r.purchaseOrder) == null ? void 0 : i.netSuite) == null ? void 0 : _.additionalInfo) != null && w.transactionnumber ? (R = (c = (C = r.purchaseOrder) == null ? void 0 : C.netSuite) == null ? void 0 : c.additionalInfo) == null ? void 0 : R.transactionnumber : (n = (D = ($ = v.value) == null ? void 0 : $.netSuite) == null ? void 0 : D.additionalInfo) != null && n.transactionnumber ? (S = (d = (m = v.value) == null ? void 0 : m.netSuite) == null ? void 0 : d.additionalInfo) == null ? void 0 : S.transactionnumber : null;
|
|
1483
|
+
}), t = W(() => {
|
|
1484
|
+
var i, _, w, C, c, R;
|
|
1485
|
+
return (_ = (i = r.purchaseOrder) == null ? void 0 : i.deliveryFullfillment) != null && _.length && ((C = (w = r.purchaseOrder) == null ? void 0 : w.deliveryFullfillment) == null ? void 0 : C.length) > 0 ? (R = (c = r.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) == null ? void 0 : R.map(($) => {
|
|
1486
1486
|
var D;
|
|
1487
1487
|
return (D = $.netSuite) == null ? void 0 : D.refNo;
|
|
1488
1488
|
}).join(", ") : "N/A";
|
|
1489
1489
|
});
|
|
1490
1490
|
return (i, _) => {
|
|
1491
|
-
var
|
|
1491
|
+
var w, C, c, R, $, D, n, m, d, S, k, G, N, ee, z, H;
|
|
1492
1492
|
return f(s).isEnabled ? (l(), h("div", Ar, [
|
|
1493
1493
|
e("div", Nr, [
|
|
1494
1494
|
_[0] || (_[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1495
1495
|
e("div", Fr, y(a.value || "N/A"), 1)
|
|
1496
1496
|
]),
|
|
1497
1497
|
!i.isTransferBetweenOutlets && i.scope === f(ft).RECEIVE_REQUEST ? (l(), h("div", Tr, [
|
|
1498
|
-
e("div", Pr, " NetSuite " + y((C = (
|
|
1498
|
+
e("div", Pr, " NetSuite " + y((C = (w = i.purchaseOrder) == null ? void 0 : w.netSuite) != null && C.recordType ? f($t)((R = (c = i.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : R.recordType) : i.transferType === f(Ye).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1499
1499
|
e("div", Ir, [
|
|
1500
1500
|
(D = ($ = i.purchaseOrder) == null ? void 0 : $.netSuite) != null && D.id ? (l(), h("span", qr, y((m = (n = i.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : m.refNo) + " (" + y((S = (d = i.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : S.id) + ") ", 1)) : (l(), h("span", Vr, "N/A"))
|
|
1501
1501
|
])
|
|
1502
1502
|
])) : L("", !0),
|
|
1503
1503
|
!i.isTransferBetweenOutlets && v.value || i.scope === f(ft).APPROVAL ? (l(), h("div", Er, [
|
|
1504
1504
|
e("div", Lr, " (Request) NetSuite " + y(i.transferType === f(Ye).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1505
|
-
e("div",
|
|
1506
|
-
(
|
|
1505
|
+
e("div", Ur, [
|
|
1506
|
+
(G = (k = v.value) == null ? void 0 : k.netSuite) != null && G.id ? (l(), h("span", Mr, y((ee = (N = v.value) == null ? void 0 : N.netSuite) == null ? void 0 : ee.refNo) + " (" + y((H = (z = v.value) == null ? void 0 : z.netSuite) == null ? void 0 : H.id) + ") ", 1)) : (l(), h("span", jr, "N/A"))
|
|
1507
1507
|
])
|
|
1508
1508
|
])) : L("", !0),
|
|
1509
1509
|
g.value ? (l(), h("div", Br, [
|
|
@@ -1528,8 +1528,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1528
1528
|
async function u(v, a) {
|
|
1529
1529
|
const g = [];
|
|
1530
1530
|
if (v && g.push(`body.message:*${v}*`), a) {
|
|
1531
|
-
const
|
|
1532
|
-
g.push(`${
|
|
1531
|
+
const w = a.replace(/:/g, "\\:");
|
|
1532
|
+
g.push(`${w}`);
|
|
1533
1533
|
}
|
|
1534
1534
|
if (g.length === 0) {
|
|
1535
1535
|
r.open({
|
|
@@ -1545,10 +1545,10 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1545
1545
|
type: "info"
|
|
1546
1546
|
},
|
|
1547
1547
|
800
|
|
1548
|
-
), await new Promise((
|
|
1548
|
+
), await new Promise((w) => setTimeout(w, 800)), window.open(_, "_blank");
|
|
1549
1549
|
}
|
|
1550
1550
|
return (v, a) => {
|
|
1551
|
-
const g =
|
|
1551
|
+
const g = K("FmButton");
|
|
1552
1552
|
return l(), h("div", Wr, [
|
|
1553
1553
|
T(g, {
|
|
1554
1554
|
"prepend-icon": "history",
|
|
@@ -1578,7 +1578,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1578
1578
|
purchaseOrderId: {}
|
|
1579
1579
|
},
|
|
1580
1580
|
setup(b) {
|
|
1581
|
-
const r = b, s = ht(), u =
|
|
1581
|
+
const r = b, s = ht(), u = J(!1), v = Ae(), a = J(!0), g = J(!1), t = J(!1), i = J(!1), _ = J(null), w = J([]);
|
|
1582
1582
|
async function C() {
|
|
1583
1583
|
if (!_.value) {
|
|
1584
1584
|
u.value = !0;
|
|
@@ -1598,11 +1598,11 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
1600
|
async function c() {
|
|
1601
|
-
if (!(
|
|
1601
|
+
if (!(w.value.length > 0))
|
|
1602
1602
|
try {
|
|
1603
1603
|
t.value = !0;
|
|
1604
1604
|
const D = await s.getChangeLogs(r.netsuiteId);
|
|
1605
|
-
|
|
1605
|
+
w.value = D, i.value = !1;
|
|
1606
1606
|
} catch {
|
|
1607
1607
|
i.value = !0;
|
|
1608
1608
|
} finally {
|
|
@@ -1633,9 +1633,9 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1633
1633
|
});
|
|
1634
1634
|
}
|
|
1635
1635
|
return (D, n) => {
|
|
1636
|
-
const m =
|
|
1636
|
+
const m = K("FmButton"), d = K("FmLabel"), S = K("FmCircularProgress"), k = K("FmIcon"), G = K("FmDialog");
|
|
1637
1637
|
return l(), h("div", Qr, [
|
|
1638
|
-
T(
|
|
1638
|
+
T(G, {
|
|
1639
1639
|
modelValue: u.value,
|
|
1640
1640
|
"onUpdate:modelValue": n[2] || (n[2] = (N) => u.value = N),
|
|
1641
1641
|
overlay: !0,
|
|
@@ -1657,10 +1657,10 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1657
1657
|
])),
|
|
1658
1658
|
default: re(() => [
|
|
1659
1659
|
a.value ? (l(), h("div", Jr, "Loading...")) : (l(), h("div", Xr, [
|
|
1660
|
-
g.value ? (l(), h("p", hs, "Something went wrong.")) : (l(), h(
|
|
1660
|
+
g.value ? (l(), h("p", hs, "Something went wrong.")) : (l(), h(ce, { key: 0 }, [
|
|
1661
1661
|
e("div", Zr, [
|
|
1662
1662
|
n[4] || (n[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
1663
|
-
(l(!0), h(
|
|
1663
|
+
(l(!0), h(ce, null, we(_.value, (N, ee) => (l(), h("div", {
|
|
1664
1664
|
key: ee,
|
|
1665
1665
|
class: "mb-2"
|
|
1666
1666
|
}, [
|
|
@@ -1678,7 +1678,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1678
1678
|
n[5] || (n[5] = e("span", null, "Change Log Loading...", -1)),
|
|
1679
1679
|
T(S, { size: "md" })
|
|
1680
1680
|
])) : L("", !0),
|
|
1681
|
-
!t.value &&
|
|
1681
|
+
!t.value && w.value.length > 0 ? (l(), h("div", os, [
|
|
1682
1682
|
e("h3", ns, [
|
|
1683
1683
|
T(k, {
|
|
1684
1684
|
name: "error",
|
|
@@ -1706,7 +1706,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1706
1706
|
])
|
|
1707
1707
|
], -1)),
|
|
1708
1708
|
e("tbody", null, [
|
|
1709
|
-
(l(!0), h(
|
|
1709
|
+
(l(!0), h(ce, null, we(w.value, (N, ee) => (l(), h("tr", {
|
|
1710
1710
|
key: ee,
|
|
1711
1711
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
1712
1712
|
}, [
|
|
@@ -1758,33 +1758,33 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1758
1758
|
scope: {}
|
|
1759
1759
|
},
|
|
1760
1760
|
setup(b) {
|
|
1761
|
-
const r = b, s = dr(), u =
|
|
1761
|
+
const r = b, s = dr(), u = W(() => s.isNetSuiteEnabled);
|
|
1762
1762
|
return (v, a) => {
|
|
1763
1763
|
var t, i;
|
|
1764
|
-
const g =
|
|
1764
|
+
const g = K("FmMenuDivider");
|
|
1765
1765
|
return u.value ? (l(), h("div", bs, [
|
|
1766
1766
|
e("div", _s, [
|
|
1767
1767
|
a[0] || (a[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
1768
1768
|
e("div", Ss, [
|
|
1769
1769
|
e("div", Os, [
|
|
1770
|
-
(i = (t = r.purchaseOrder) == null ? void 0 : t.netSuite) != null && i.id ? (l(),
|
|
1770
|
+
(i = (t = r.purchaseOrder) == null ? void 0 : t.netSuite) != null && i.id ? (l(), ae(Ue, { key: 0 }, {
|
|
1771
1771
|
default: re(() => {
|
|
1772
|
-
var _,
|
|
1772
|
+
var _, w, C;
|
|
1773
1773
|
return [
|
|
1774
1774
|
T(gs, {
|
|
1775
|
-
"netsuite-id": (
|
|
1775
|
+
"netsuite-id": (w = (_ = v.purchaseOrder) == null ? void 0 : _.netSuite) == null ? void 0 : w.id,
|
|
1776
1776
|
"purchase-order-id": (C = v.purchaseOrder) == null ? void 0 : C._id
|
|
1777
1777
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1778
1778
|
];
|
|
1779
1779
|
}),
|
|
1780
1780
|
_: 1
|
|
1781
1781
|
})) : L("", !0),
|
|
1782
|
-
T(
|
|
1782
|
+
T(Ue, null, {
|
|
1783
1783
|
default: re(() => {
|
|
1784
|
-
var _,
|
|
1784
|
+
var _, w, C;
|
|
1785
1785
|
return [
|
|
1786
1786
|
T(Yr, {
|
|
1787
|
-
"netsuite-id": (
|
|
1787
|
+
"netsuite-id": (w = (_ = v.purchaseOrder) == null ? void 0 : _.netSuite) == null ? void 0 : w.id,
|
|
1788
1788
|
"purchase-order-id": (C = v.purchaseOrder) == null ? void 0 : C._id
|
|
1789
1789
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
1790
1790
|
];
|
|
@@ -1818,10 +1818,10 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1818
1818
|
}, Is = {
|
|
1819
1819
|
key: 0,
|
|
1820
1820
|
class: "border-b border-fm-color-stroke-secondary"
|
|
1821
|
-
}, qs = { class: "flex flex-col gap-4" }, Vs = { class: "flex flex-col gap-4" }, Es = { class: "flex flex-col gap-4" }, Ls = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" },
|
|
1821
|
+
}, qs = { class: "flex flex-col gap-4" }, Vs = { class: "flex flex-col gap-4" }, Es = { class: "flex flex-col gap-4" }, Ls = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Us = {
|
|
1822
1822
|
key: 0,
|
|
1823
1823
|
class: "flex flex-col gap-4"
|
|
1824
|
-
},
|
|
1824
|
+
}, Ms = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, js = /* @__PURE__ */ Re({
|
|
1825
1825
|
__name: "EditForm",
|
|
1826
1826
|
props: {
|
|
1827
1827
|
purchaseOrder: {},
|
|
@@ -1830,14 +1830,14 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1830
1830
|
emits: ["submitted"],
|
|
1831
1831
|
setup(b, { emit: r }) {
|
|
1832
1832
|
pr();
|
|
1833
|
-
const s =
|
|
1833
|
+
const s = Me(), u = Ge(), v = J(!1), a = b, g = r, t = Nt("deliveryOrder"), i = He(), _ = W(
|
|
1834
1834
|
() => {
|
|
1835
1835
|
var m;
|
|
1836
1836
|
return ((m = a.purchaseOrder.deliveryFullfillment) == null ? void 0 : m.findIndex(
|
|
1837
1837
|
(d) => a.deliveryOrder.fullfillmentId && d.id === a.deliveryOrder.fullfillmentId
|
|
1838
1838
|
)) ?? -1;
|
|
1839
1839
|
}
|
|
1840
|
-
),
|
|
1840
|
+
), w = s.enablePurchaseOrderReceiveWithCustomCost, C = s.enablePortalDeliveryOrderWrite, c = J({}), R = W(() => a.purchaseOrder.items.map((m, d) => W({
|
|
1841
1841
|
get: () => {
|
|
1842
1842
|
var k;
|
|
1843
1843
|
const S = (k = t.received[d]) == null ? void 0 : k.cost;
|
|
@@ -1849,7 +1849,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1849
1849
|
...rt(S, 4)
|
|
1850
1850
|
};
|
|
1851
1851
|
}
|
|
1852
|
-
}))), $ =
|
|
1852
|
+
}))), $ = W(() => a.deliveryOrder.received.map((m, d) => W({
|
|
1853
1853
|
get: () => {
|
|
1854
1854
|
var k;
|
|
1855
1855
|
const S = (k = t.received[d]) == null ? void 0 : k.amount;
|
|
@@ -1895,14 +1895,14 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1895
1895
|
});
|
|
1896
1896
|
}
|
|
1897
1897
|
return (m, d) => {
|
|
1898
|
-
const S =
|
|
1899
|
-
return l(),
|
|
1898
|
+
const S = K("FmButton"), k = K("FmStepperField"), G = K("FmSwitch"), N = K("FmTextField"), ee = K("FmDialog");
|
|
1899
|
+
return l(), ae(ee, {
|
|
1900
1900
|
modelValue: v.value,
|
|
1901
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
1901
|
+
"onUpdate:modelValue": d[1] || (d[1] = (z) => v.value = z),
|
|
1902
1902
|
overlay: !0
|
|
1903
1903
|
}, {
|
|
1904
1904
|
"dialog-button": re(() => [
|
|
1905
|
-
f(C) ? (l(),
|
|
1905
|
+
f(C) ? (l(), ae(S, {
|
|
1906
1906
|
key: 0,
|
|
1907
1907
|
variant: "plain",
|
|
1908
1908
|
label: "Edit",
|
|
@@ -1931,35 +1931,35 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1931
1931
|
]),
|
|
1932
1932
|
e("div", $s, [
|
|
1933
1933
|
d[4] || (d[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received items", -1)),
|
|
1934
|
-
(l(!0), h(
|
|
1935
|
-
var
|
|
1936
|
-
return l(), h("div", { key:
|
|
1934
|
+
(l(!0), h(ce, null, we(a.deliveryOrder.received, (z, H) => {
|
|
1935
|
+
var he;
|
|
1936
|
+
return l(), h("div", { key: H }, [
|
|
1937
1937
|
e("div", Ds, [
|
|
1938
1938
|
e("div", ks, [
|
|
1939
|
-
e("span", As, y(
|
|
1940
|
-
e("span", Ns, y(
|
|
1939
|
+
e("span", As, y(z.sku.name), 1),
|
|
1940
|
+
e("span", Ns, y(z.sku.code), 1)
|
|
1941
1941
|
]),
|
|
1942
1942
|
e("div", Fs, [
|
|
1943
1943
|
T(k, {
|
|
1944
1944
|
label: "Receive Quantity",
|
|
1945
|
-
modelValue: $.value[
|
|
1946
|
-
"onUpdate:modelValue": (
|
|
1945
|
+
modelValue: $.value[H].value,
|
|
1946
|
+
"onUpdate:modelValue": (fe) => $.value[H].value = fe,
|
|
1947
1947
|
min: 0,
|
|
1948
|
-
"append-text": ((
|
|
1948
|
+
"append-text": ((he = z.measurement) == null ? void 0 : he.abbrev) ?? z.sku.unit.abbrev
|
|
1949
1949
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"]),
|
|
1950
|
-
e("div", Ts, y(`${
|
|
1951
|
-
f(
|
|
1952
|
-
T(
|
|
1953
|
-
"model-value": c.value[
|
|
1954
|
-
"onUpdate:modelValue": (
|
|
1950
|
+
e("div", Ts, y(`${z.cost ? `${f(ze)(z.cost)}` : ""}`), 1),
|
|
1951
|
+
f(w) ? (l(), h("div", Ps, [
|
|
1952
|
+
T(G, {
|
|
1953
|
+
"model-value": c.value[H],
|
|
1954
|
+
"onUpdate:modelValue": (fe) => D(H),
|
|
1955
1955
|
size: "sm"
|
|
1956
1956
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1957
1957
|
d[3] || (d[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
1958
1958
|
])) : L("", !0),
|
|
1959
|
-
f(
|
|
1959
|
+
f(w) && c.value[H] ? (l(), ae(k, {
|
|
1960
1960
|
key: 1,
|
|
1961
|
-
modelValue: R.value[
|
|
1962
|
-
"onUpdate:modelValue": (
|
|
1961
|
+
modelValue: R.value[H].value,
|
|
1962
|
+
"onUpdate:modelValue": (fe) => R.value[H].value = fe,
|
|
1963
1963
|
label: "Total Cost",
|
|
1964
1964
|
step: 1e-4,
|
|
1965
1965
|
min: 0,
|
|
@@ -1969,7 +1969,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1969
1969
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : L("", !0)
|
|
1970
1970
|
])
|
|
1971
1971
|
]),
|
|
1972
|
-
|
|
1972
|
+
H < a.purchaseOrder.items.length - 1 ? (l(), h("div", Is)) : L("", !0)
|
|
1973
1973
|
]);
|
|
1974
1974
|
}), 128))
|
|
1975
1975
|
]),
|
|
@@ -1978,7 +1978,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1978
1978
|
e("div", Vs, [
|
|
1979
1979
|
T(N, {
|
|
1980
1980
|
modelValue: f(t).deliveryOrderNumber,
|
|
1981
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
1981
|
+
"onUpdate:modelValue": d[0] || (d[0] = (z) => f(t).deliveryOrderNumber = z),
|
|
1982
1982
|
size: "md",
|
|
1983
1983
|
placeholder: a.deliveryOrder.deliveryOrderNumber
|
|
1984
1984
|
}, null, 8, ["modelValue", "placeholder"])
|
|
@@ -1988,9 +1988,9 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1988
1988
|
d[6] || (d[6] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
1989
1989
|
e("div", Ls, y(a.deliveryOrder.remark || "N/A"), 1)
|
|
1990
1990
|
]),
|
|
1991
|
-
_.value >= 0 ? (l(), h("div",
|
|
1991
|
+
_.value >= 0 ? (l(), h("div", Us, [
|
|
1992
1992
|
d[7] || (d[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fulfilment's sequence ", -1)),
|
|
1993
|
-
e("div",
|
|
1993
|
+
e("div", Ms, y(_.value + 1), 1)
|
|
1994
1994
|
])) : L("", !0)
|
|
1995
1995
|
])
|
|
1996
1996
|
])
|
|
@@ -2022,8 +2022,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2022
2022
|
},
|
|
2023
2023
|
emits: ["submitted"],
|
|
2024
2024
|
setup(b, { emit: r }) {
|
|
2025
|
-
var
|
|
2026
|
-
const { t: s } = at(), u =
|
|
2025
|
+
var M, j, oe;
|
|
2026
|
+
const { t: s } = at(), u = J(!1), v = vt(), a = b, g = r, t = Nt("", {
|
|
2027
2027
|
default: {
|
|
2028
2028
|
deliveryOrderNumber: "",
|
|
2029
2029
|
remark: "",
|
|
@@ -2033,12 +2033,12 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2033
2033
|
measurement: A.measurement
|
|
2034
2034
|
})),
|
|
2035
2035
|
createdBy: {
|
|
2036
|
-
id: ((
|
|
2036
|
+
id: ((M = v.sessionUser.value) == null ? void 0 : M.id) || "",
|
|
2037
2037
|
name: ((j = v.sessionUser.value) == null ? void 0 : j.displayName) || ""
|
|
2038
2038
|
},
|
|
2039
2039
|
createdAt: ""
|
|
2040
2040
|
}
|
|
2041
|
-
}), i = He(), _ = lt(),
|
|
2041
|
+
}), i = He(), _ = lt(), w = Me(), C = ((oe = a.purchaseOrder) == null ? void 0 : oe.supplier.internal) != null, c = C && w.enablePOSTransferRequireFulfillment, R = w.enablePortalDeliveryOrderWrite && (a.purchaseOrder.status === se.Enum.RECEIVING || a.purchaseOrder.status === se.Enum.COMPLETE) && (C ? !c : !0), $ = w.enablePurchaseOrderReceiveWithCustomCost, D = w.enableBackdateReceive, n = J({}), m = Ge(), d = W({
|
|
2042
2042
|
get() {
|
|
2043
2043
|
if (!t.createdAt) return "";
|
|
2044
2044
|
const A = new Date(t.createdAt), O = A.getFullYear(), I = String(A.getMonth() + 1).padStart(2, "0"), B = String(A.getDate()).padStart(2, "0");
|
|
@@ -2046,11 +2046,11 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2046
2046
|
},
|
|
2047
2047
|
set(A) {
|
|
2048
2048
|
if (A) {
|
|
2049
|
-
const O = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [I, B,
|
|
2050
|
-
O.setFullYear(parseInt(I)), O.setMonth(parseInt(B) - 1), O.setDate(parseInt(
|
|
2049
|
+
const O = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [I, B, le] = A.split("-");
|
|
2050
|
+
O.setFullYear(parseInt(I)), O.setMonth(parseInt(B) - 1), O.setDate(parseInt(le)), t.createdAt = O.toISOString();
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
|
-
}), S =
|
|
2053
|
+
}), S = W({
|
|
2054
2054
|
get() {
|
|
2055
2055
|
if (!t.createdAt) return "";
|
|
2056
2056
|
const A = new Date(t.createdAt), O = String(A.getHours()).padStart(2, "0"), I = String(A.getMinutes()).padStart(2, "0");
|
|
@@ -2062,29 +2062,29 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2062
2062
|
O.setHours(parseInt(I)), O.setMinutes(parseInt(B)), t.createdAt = O.toISOString();
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
}), k =
|
|
2065
|
+
}), k = W(() => {
|
|
2066
2066
|
const A = tt(a.purchaseOrder._id);
|
|
2067
2067
|
if (!A) return "";
|
|
2068
|
-
const O = new Date(A), I = O.getFullYear(), B = String(O.getMonth() + 1).padStart(2, "0"),
|
|
2069
|
-
return `${I}-${B}-${
|
|
2070
|
-
}),
|
|
2068
|
+
const O = new Date(A), I = O.getFullYear(), B = String(O.getMonth() + 1).padStart(2, "0"), le = String(O.getDate()).padStart(2, "0");
|
|
2069
|
+
return `${I}-${B}-${le}`;
|
|
2070
|
+
}), G = W(() => {
|
|
2071
2071
|
const A = tt(a.purchaseOrder._id);
|
|
2072
2072
|
return A ? new Date(A) : null;
|
|
2073
|
-
}), N =
|
|
2074
|
-
if (!d.value || !S.value || !
|
|
2075
|
-
if (/* @__PURE__ */ new Date(`${d.value}T${S.value}:00`) <
|
|
2076
|
-
const O = k.value, I =
|
|
2073
|
+
}), N = W(() => {
|
|
2074
|
+
if (!d.value || !S.value || !G.value) return null;
|
|
2075
|
+
if (/* @__PURE__ */ new Date(`${d.value}T${S.value}:00`) < G.value) {
|
|
2076
|
+
const O = k.value, I = G.value.getHours(), B = G.value.getMinutes(), le = I >= 12 ? "PM" : "AM", Ne = I % 12 || 12, Fe = `${String(Ne).padStart(2, "0")}:${String(B).padStart(2, "0")} ${le}`;
|
|
2077
2077
|
return `Delivery date & time cannot be earlier than order creation (${O} ${Fe})`;
|
|
2078
2078
|
}
|
|
2079
2079
|
return null;
|
|
2080
|
-
}), ee =
|
|
2080
|
+
}), ee = W(() => N.value ? !1 : t.received.some((O) => {
|
|
2081
2081
|
const I = O.amount;
|
|
2082
2082
|
return I ? +_e(I) > 0 : !1;
|
|
2083
2083
|
}));
|
|
2084
|
-
function
|
|
2084
|
+
function z() {
|
|
2085
2085
|
t.createdAt = "";
|
|
2086
2086
|
}
|
|
2087
|
-
const
|
|
2087
|
+
const H = W(() => a.purchaseOrder.items.map((A, O) => W({
|
|
2088
2088
|
get: () => {
|
|
2089
2089
|
var B;
|
|
2090
2090
|
const I = (B = t.received[O]) == null ? void 0 : B.amount;
|
|
@@ -2094,7 +2094,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2094
2094
|
t.received[O].amount = rt(I, 2);
|
|
2095
2095
|
}
|
|
2096
2096
|
})));
|
|
2097
|
-
function
|
|
2097
|
+
function he(A) {
|
|
2098
2098
|
const O = !n.value[A];
|
|
2099
2099
|
if (n.value[A] = O, O) {
|
|
2100
2100
|
const I = a.purchaseOrder.items[A];
|
|
@@ -2111,7 +2111,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2111
2111
|
} else
|
|
2112
2112
|
delete t.received[A].cost;
|
|
2113
2113
|
}
|
|
2114
|
-
const
|
|
2114
|
+
const fe = W(() => a.purchaseOrder.items.map((A, O) => W({
|
|
2115
2115
|
get: () => {
|
|
2116
2116
|
var B;
|
|
2117
2117
|
const I = (B = t.received[O]) == null ? void 0 : B.cost;
|
|
@@ -2157,15 +2157,15 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2157
2157
|
});
|
|
2158
2158
|
}
|
|
2159
2159
|
return (A, O) => {
|
|
2160
|
-
const I =
|
|
2161
|
-
return l(),
|
|
2160
|
+
const I = K("FmButton"), B = K("FmDatePicker"), le = K("FmTimePicker"), Ne = K("FmIcon"), Fe = K("FmStepperField"), o = K("FmSwitch"), p = K("FmTextField"), P = K("FmDialog");
|
|
2161
|
+
return l(), ae(P, {
|
|
2162
2162
|
modelValue: u.value,
|
|
2163
2163
|
"onUpdate:modelValue": O[4] || (O[4] = (q) => u.value = q),
|
|
2164
2164
|
overlay: !0,
|
|
2165
2165
|
"min-width": 800
|
|
2166
2166
|
}, {
|
|
2167
2167
|
"dialog-button": re(() => [
|
|
2168
|
-
f(R) ? (l(),
|
|
2168
|
+
f(R) ? (l(), ae(I, {
|
|
2169
2169
|
key: 0,
|
|
2170
2170
|
variant: "primary",
|
|
2171
2171
|
label: "Create",
|
|
@@ -2201,12 +2201,12 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2201
2201
|
O[6] || (O[6] = Ie(" Delivery Date & Time ")),
|
|
2202
2202
|
!d.value && !S.value ? (l(), h("div", Ys, " Leave blank to use current date & time ")) : L("", !0)
|
|
2203
2203
|
]),
|
|
2204
|
-
d.value || S.value ? (l(),
|
|
2204
|
+
d.value || S.value ? (l(), ae(I, {
|
|
2205
2205
|
key: 0,
|
|
2206
2206
|
variant: "tertiary",
|
|
2207
2207
|
label: "Clear",
|
|
2208
2208
|
"prepend-icon": "close",
|
|
2209
|
-
onClick:
|
|
2209
|
+
onClick: z
|
|
2210
2210
|
})) : L("", !0)
|
|
2211
2211
|
]),
|
|
2212
2212
|
e("div", Qs, [
|
|
@@ -2217,7 +2217,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2217
2217
|
}, null, 8, ["modelValue"])
|
|
2218
2218
|
]),
|
|
2219
2219
|
e("div", Xs, [
|
|
2220
|
-
T(
|
|
2220
|
+
T(le, {
|
|
2221
2221
|
modelValue: S.value,
|
|
2222
2222
|
"onUpdate:modelValue": O[1] || (O[1] = (V) => S.value = V)
|
|
2223
2223
|
}, null, 8, ["modelValue"])
|
|
@@ -2234,8 +2234,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2234
2234
|
])) : L("", !0),
|
|
2235
2235
|
e("div", to, [
|
|
2236
2236
|
O[8] || (O[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2237
|
-
(l(!0), h(
|
|
2238
|
-
var
|
|
2237
|
+
(l(!0), h(ce, null, we(a.purchaseOrder.items, (V, E) => {
|
|
2238
|
+
var Y, x, X;
|
|
2239
2239
|
return l(), h("div", { key: E }, [
|
|
2240
2240
|
e("div", ro, [
|
|
2241
2241
|
e("div", so, [
|
|
@@ -2245,28 +2245,28 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2245
2245
|
e("div", ao, [
|
|
2246
2246
|
T(Fe, {
|
|
2247
2247
|
label: "Receive Quantity",
|
|
2248
|
-
modelValue:
|
|
2249
|
-
"onUpdate:modelValue": (
|
|
2248
|
+
modelValue: H.value[E].value,
|
|
2249
|
+
"onUpdate:modelValue": (Q) => H.value[E].value = Q,
|
|
2250
2250
|
"helper-text": `${f(s)("inventory.transfer.receiveRequest.details.received")} ${f(Le).toFormatString(
|
|
2251
2251
|
{
|
|
2252
|
-
value: (
|
|
2252
|
+
value: (Y = A.receivedInfoMap[V.sku._id]) == null ? void 0 : Y.received
|
|
2253
2253
|
}
|
|
2254
|
-
)} ${((
|
|
2254
|
+
)} ${((x = V.measurement) == null ? void 0 : x.abbrev) ?? V.sku.unit.abbrev}`,
|
|
2255
2255
|
min: 0,
|
|
2256
|
-
"append-text": ((
|
|
2256
|
+
"append-text": ((X = V.measurement) == null ? void 0 : X.abbrev) ?? V.sku.unit.abbrev
|
|
2257
2257
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
2258
2258
|
f($) ? (l(), h("div", lo, [
|
|
2259
2259
|
T(o, {
|
|
2260
2260
|
"model-value": n.value[E],
|
|
2261
|
-
"onUpdate:modelValue": (
|
|
2261
|
+
"onUpdate:modelValue": (Q) => he(E),
|
|
2262
2262
|
size: "sm"
|
|
2263
2263
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2264
2264
|
O[7] || (O[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2265
2265
|
])) : L("", !0),
|
|
2266
|
-
f($) && n.value[E] ? (l(),
|
|
2266
|
+
f($) && n.value[E] ? (l(), ae(Fe, {
|
|
2267
2267
|
key: 1,
|
|
2268
|
-
modelValue:
|
|
2269
|
-
"onUpdate:modelValue": (
|
|
2268
|
+
modelValue: fe.value[E].value,
|
|
2269
|
+
"onUpdate:modelValue": (Q) => fe.value[E].value = Q,
|
|
2270
2270
|
label: "Total Cost",
|
|
2271
2271
|
step: 1e-4,
|
|
2272
2272
|
min: 0,
|
|
@@ -2322,21 +2322,21 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2322
2322
|
netsuiteId: {}
|
|
2323
2323
|
},
|
|
2324
2324
|
setup(b) {
|
|
2325
|
-
const r = b, s = ht(), u =
|
|
2325
|
+
const r = b, s = ht(), u = J(!1), v = J(!1), a = J(!1), g = J([]);
|
|
2326
2326
|
async function t() {
|
|
2327
2327
|
if (!(g.value.length > 0))
|
|
2328
2328
|
try {
|
|
2329
2329
|
v.value = !0;
|
|
2330
|
-
const
|
|
2331
|
-
g.value =
|
|
2330
|
+
const w = await s.getChangeLogs(r.netsuiteId);
|
|
2331
|
+
g.value = w, a.value = !1;
|
|
2332
2332
|
} catch {
|
|
2333
2333
|
a.value = !0;
|
|
2334
2334
|
} finally {
|
|
2335
2335
|
v.value = !1;
|
|
2336
2336
|
}
|
|
2337
2337
|
}
|
|
2338
|
-
function i(
|
|
2339
|
-
switch (
|
|
2338
|
+
function i(w) {
|
|
2339
|
+
switch (w) {
|
|
2340
2340
|
case De.Create:
|
|
2341
2341
|
return "text-green-600 bg-green-100";
|
|
2342
2342
|
case De.Set:
|
|
@@ -2349,8 +2349,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2349
2349
|
return "text-gray-600 bg-gray-100";
|
|
2350
2350
|
}
|
|
2351
2351
|
}
|
|
2352
|
-
function _(
|
|
2353
|
-
return new Date(
|
|
2352
|
+
function _(w) {
|
|
2353
|
+
return new Date(w).toLocaleDateString("en-US", {
|
|
2354
2354
|
year: "numeric",
|
|
2355
2355
|
month: "short",
|
|
2356
2356
|
day: "numeric",
|
|
@@ -2358,8 +2358,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2358
2358
|
minute: "2-digit"
|
|
2359
2359
|
});
|
|
2360
2360
|
}
|
|
2361
|
-
return (
|
|
2362
|
-
const c =
|
|
2361
|
+
return (w, C) => {
|
|
2362
|
+
const c = K("FmButton"), R = K("FmCircularProgress"), $ = K("FmIcon"), D = K("FmDialog");
|
|
2363
2363
|
return l(), h("div", yo, [
|
|
2364
2364
|
T(D, {
|
|
2365
2365
|
modelValue: u.value,
|
|
@@ -2414,7 +2414,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2414
2414
|
])
|
|
2415
2415
|
], -1)),
|
|
2416
2416
|
e("tbody", null, [
|
|
2417
|
-
(l(!0), h(
|
|
2417
|
+
(l(!0), h(ce, null, we(g.value, (n, m) => (l(), h("tr", {
|
|
2418
2418
|
key: m,
|
|
2419
2419
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2420
2420
|
}, [
|
|
@@ -2454,7 +2454,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2454
2454
|
}), No = { class: "flex flex-col w-full gap-3" }, Fo = { class: "flex" }, To = { class: "fm-typo-en-title-md-600 text-fm-color-typo-primary" }, Po = { class: "flex flex-col gap-16 w-full h-full" }, Io = { class: "flex justify-between" }, qo = { class: "fm-typo-en-body-lg-600" }, Vo = { class: "flex gap-2" }, Eo = {
|
|
2455
2455
|
key: 0,
|
|
2456
2456
|
class: "flex items-center gap-1"
|
|
2457
|
-
}, Lo = { class: "fm-typo-en-body-md-400" },
|
|
2457
|
+
}, Lo = { class: "fm-typo-en-body-md-400" }, Uo = { class: "flex flex-col gap-8" }, Mo = { class: "flex flex-col gap-4" }, jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bo = { class: "flex gap-1" }, zo = { class: "fm-typo-en-body-lg-600" }, Ko = {
|
|
2458
2458
|
key: 0,
|
|
2459
2459
|
class: "flex flex-col gap-4"
|
|
2460
2460
|
}, Go = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ho = { class: "fm-typo-en-body-lg-600" }, Wo = { class: "flex flex-col gap-4" }, Yo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qo = { class: "fm-typo-en-body-lg-600" }, Jo = {
|
|
@@ -2490,7 +2490,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2490
2490
|
}, qn = { class: "flex gap-12 content-stretch" }, Vn = {
|
|
2491
2491
|
class: "flex flex-col w-40",
|
|
2492
2492
|
name: "circles"
|
|
2493
|
-
}, En = { class: "flex-1 flex flex-col items-center" }, Ln = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" },
|
|
2493
|
+
}, En = { class: "flex-1 flex flex-col items-center" }, Ln = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" }, Un = { class: "flex-1 flex flex-col items-center" }, Mn = { class: "flex w-full items-center gap-4" }, jn = {
|
|
2494
2494
|
class: "py-12 flex flex-col gap-4",
|
|
2495
2495
|
name: "received-at header"
|
|
2496
2496
|
}, Bn = { class: "fm-typo-en-body-lg-400" }, zn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Kn = { class: "ml-auto flex gap-1" }, Gn = { class: "flex gap-12 content-stretch" }, Hn = {
|
|
@@ -2515,7 +2515,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2515
2515
|
},
|
|
2516
2516
|
emits: ["update:show", "submitted"],
|
|
2517
2517
|
setup(b, { emit: r }) {
|
|
2518
|
-
const s = b, u = r, v = lt(), a = Ge(), g =
|
|
2518
|
+
const s = b, u = r, v = lt(), a = Ge(), g = Me(), t = Ae(), i = vt(), _ = xr();
|
|
2519
2519
|
et(
|
|
2520
2520
|
() => s.purchaseOrder,
|
|
2521
2521
|
(o) => {
|
|
@@ -2523,7 +2523,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2523
2523
|
},
|
|
2524
2524
|
{ immediate: !0 }
|
|
2525
2525
|
);
|
|
2526
|
-
const
|
|
2526
|
+
const w = W(
|
|
2527
2527
|
() => {
|
|
2528
2528
|
var o, p;
|
|
2529
2529
|
return {
|
|
@@ -2531,12 +2531,12 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2531
2531
|
name: ((p = i.sessionUser.value) == null ? void 0 : p.displayName) ?? ""
|
|
2532
2532
|
};
|
|
2533
2533
|
}
|
|
2534
|
-
), C = It(), { t: c } = at(), R =
|
|
2534
|
+
), C = It(), { t: c } = at(), R = W(
|
|
2535
2535
|
() => {
|
|
2536
2536
|
var o, p, P, q;
|
|
2537
2537
|
return ((p = (o = s.purchaseOrder) == null ? void 0 : o.supplier) == null ? void 0 : p.internal) === "restaurant" || ((q = (P = s.purchaseOrder) == null ? void 0 : P.supplier) == null ? void 0 : q.internal) === "warehouse" ? Ye.enum.transfer : Ye.enum.purchase;
|
|
2538
2538
|
}
|
|
2539
|
-
), $ =
|
|
2539
|
+
), $ = W(() => {
|
|
2540
2540
|
var P;
|
|
2541
2541
|
const o = (P = s.shipments) == null ? void 0 : P.find((q) => {
|
|
2542
2542
|
var V;
|
|
@@ -2551,42 +2551,42 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2551
2551
|
}
|
|
2552
2552
|
}
|
|
2553
2553
|
return p;
|
|
2554
|
-
}), D =
|
|
2554
|
+
}), D = J(!1), n = J(""), m = J(!0), d = He(), S = ur(d.getWorkflowConfig), k = Pt(), G = [
|
|
2555
2555
|
F.enum.receiveStock,
|
|
2556
2556
|
F.enum.processRequest,
|
|
2557
2557
|
F.enum.closeRequest
|
|
2558
|
-
], N =
|
|
2558
|
+
], N = W(() => {
|
|
2559
2559
|
if (!s.purchaseOrder)
|
|
2560
2560
|
return [];
|
|
2561
2561
|
const o = S.result.value;
|
|
2562
2562
|
if (o.state === St.loading)
|
|
2563
2563
|
return [];
|
|
2564
2564
|
const p = {
|
|
2565
|
-
user:
|
|
2565
|
+
user: w.value,
|
|
2566
2566
|
executedAt: t.locations.computeFirst(
|
|
2567
|
-
(
|
|
2568
|
-
var
|
|
2569
|
-
return
|
|
2567
|
+
(Y) => {
|
|
2568
|
+
var x;
|
|
2569
|
+
return Y.dbName === ((x = t._currentLocation) == null ? void 0 : x.dbName) ? Y : null;
|
|
2570
2570
|
}
|
|
2571
2571
|
),
|
|
2572
2572
|
purchaseOrderRequest: s.poRequest,
|
|
2573
2573
|
purchaseOrder: s.purchaseOrder
|
|
2574
|
-
}, P = g.useOperatePurchaseOrderV2, q = g.poWorkflowAllowToMarkCompleted, V = [...
|
|
2574
|
+
}, P = g.useOperatePurchaseOrderV2, q = g.poWorkflowAllowToMarkCompleted, V = [...G];
|
|
2575
2575
|
P && !q && V.push(F.enum.completeReceive);
|
|
2576
2576
|
let E = [];
|
|
2577
2577
|
try {
|
|
2578
2578
|
o.state === St.error ? (console.error("Error fetching workflow config:", o.error), E = it.getAvailableActions({
|
|
2579
2579
|
...p,
|
|
2580
2580
|
orderConfig: it.getDefaultConfig()
|
|
2581
|
-
}).actions.filter((
|
|
2581
|
+
}).actions.filter((Y) => !V.includes(Y))) : E = it.getAvailableActions({
|
|
2582
2582
|
...p,
|
|
2583
2583
|
orderConfig: o.data
|
|
2584
|
-
}).actions.filter((
|
|
2585
|
-
} catch (
|
|
2586
|
-
console.error("Error getting available actions:",
|
|
2584
|
+
}).actions.filter((Y) => !V.includes(Y));
|
|
2585
|
+
} catch (Y) {
|
|
2586
|
+
console.error("Error getting available actions:", Y);
|
|
2587
2587
|
}
|
|
2588
|
-
return s.scope === "approval" && (E = E.filter((
|
|
2589
|
-
}), ee = tr(s, "show"),
|
|
2588
|
+
return s.scope === "approval" && (E = E.filter((Y) => Y !== F.enum.completeReceive)), E;
|
|
2589
|
+
}), ee = tr(s, "show"), z = W(() => [
|
|
2590
2590
|
{
|
|
2591
2591
|
label: c("inventory.transfer.receiveRequest.details.overview"),
|
|
2592
2592
|
value: "overview"
|
|
@@ -2595,14 +2595,14 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2595
2595
|
label: c("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
2596
2596
|
value: "deliveryHistory"
|
|
2597
2597
|
}
|
|
2598
|
-
]),
|
|
2598
|
+
]), H = J(z.value[0]);
|
|
2599
2599
|
et(
|
|
2600
2600
|
() => s.show,
|
|
2601
2601
|
(o) => {
|
|
2602
|
-
o && (
|
|
2602
|
+
o && (H.value = z.value[0]);
|
|
2603
2603
|
}
|
|
2604
2604
|
);
|
|
2605
|
-
function
|
|
2605
|
+
function he(o) {
|
|
2606
2606
|
return o.map((p) => ({
|
|
2607
2607
|
...p,
|
|
2608
2608
|
amount: {
|
|
@@ -2611,60 +2611,60 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2611
2611
|
}
|
|
2612
2612
|
}));
|
|
2613
2613
|
}
|
|
2614
|
-
async function
|
|
2615
|
-
return new Promise((E,
|
|
2616
|
-
const
|
|
2614
|
+
async function fe(o, p, P, q, V) {
|
|
2615
|
+
return new Promise((E, Y) => {
|
|
2616
|
+
const x = {
|
|
2617
2617
|
closeButton: !1,
|
|
2618
2618
|
title: q.title,
|
|
2619
2619
|
message: q.message,
|
|
2620
2620
|
primaryActions: q.primaryActions,
|
|
2621
2621
|
secondaryActions: { text: "No", close: !1 }
|
|
2622
2622
|
};
|
|
2623
|
-
let
|
|
2624
|
-
P === F.enum.rejectDraft && (
|
|
2623
|
+
let X = p.rejectReason ?? "";
|
|
2624
|
+
P === F.enum.rejectDraft && (x.contentComponent = Tt, x.contentComponentProps = {
|
|
2625
2625
|
message: q.message,
|
|
2626
|
-
onChange: (
|
|
2627
|
-
|
|
2626
|
+
onChange: (Q) => {
|
|
2627
|
+
X = Q ?? "";
|
|
2628
2628
|
}
|
|
2629
|
-
}), v.open(
|
|
2630
|
-
var
|
|
2631
|
-
const
|
|
2632
|
-
P === F.enum.confirmDraft ?
|
|
2629
|
+
}), v.open(x).onPrimary(async () => {
|
|
2630
|
+
var ie, Z, ne, pe;
|
|
2631
|
+
const Q = [];
|
|
2632
|
+
P === F.enum.confirmDraft ? Q.push({
|
|
2633
2633
|
action: "confirmDraft",
|
|
2634
2634
|
payload: {
|
|
2635
2635
|
items: p.items
|
|
2636
2636
|
}
|
|
2637
|
-
}) : P === F.enum.approveRequest ? (
|
|
2637
|
+
}) : P === F.enum.approveRequest ? (Q.push({
|
|
2638
2638
|
action: "approveRequest",
|
|
2639
2639
|
payload: null
|
|
2640
|
-
}), p.fulfillment &&
|
|
2640
|
+
}), p.fulfillment && Q.push({
|
|
2641
2641
|
action: "processRequest",
|
|
2642
2642
|
payload: {
|
|
2643
2643
|
fulfillmentId: "",
|
|
2644
2644
|
deliveryOrderNumber: "",
|
|
2645
2645
|
deliveryRemark: null,
|
|
2646
|
-
items:
|
|
2647
|
-
createdBy:
|
|
2646
|
+
items: he(p.fulfillment.items),
|
|
2647
|
+
createdBy: w.value
|
|
2648
2648
|
}
|
|
2649
|
-
})) : P === F.enum.processRequest ? p.fulfillment &&
|
|
2649
|
+
})) : P === F.enum.processRequest ? p.fulfillment && Q.push({
|
|
2650
2650
|
action: "processRequest",
|
|
2651
2651
|
payload: {
|
|
2652
2652
|
fulfillmentId: "",
|
|
2653
2653
|
deliveryOrderNumber: "",
|
|
2654
2654
|
deliveryRemark: null,
|
|
2655
|
-
items:
|
|
2656
|
-
createdBy:
|
|
2655
|
+
items: he(p.fulfillment.items),
|
|
2656
|
+
createdBy: w.value
|
|
2657
2657
|
}
|
|
2658
|
-
}) : P === F.enum.rejectRequest ?
|
|
2658
|
+
}) : P === F.enum.rejectRequest ? Q.push({
|
|
2659
2659
|
action: "rejectRequest",
|
|
2660
2660
|
payload: null
|
|
2661
|
-
}) : P === F.enum.closeRequest ?
|
|
2661
|
+
}) : P === F.enum.closeRequest ? Q.push({
|
|
2662
2662
|
action: "closeRequest",
|
|
2663
2663
|
payload: null
|
|
2664
|
-
}) : P === F.enum.rejectDraft &&
|
|
2664
|
+
}) : P === F.enum.rejectDraft && Q.push({
|
|
2665
2665
|
action: "rejectDraft",
|
|
2666
2666
|
payload: {
|
|
2667
|
-
rejectReason:
|
|
2667
|
+
rejectReason: X ?? ""
|
|
2668
2668
|
}
|
|
2669
2669
|
});
|
|
2670
2670
|
try {
|
|
@@ -2675,27 +2675,27 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2675
2675
|
options: p
|
|
2676
2676
|
},
|
|
2677
2677
|
operateV2: {
|
|
2678
|
-
_id: ((
|
|
2679
|
-
_rev: ((
|
|
2678
|
+
_id: ((ie = s.purchaseOrder) == null ? void 0 : ie._id) ?? "",
|
|
2679
|
+
_rev: ((Z = s.purchaseOrder) == null ? void 0 : Z._rev) ?? "",
|
|
2680
2680
|
action: P,
|
|
2681
|
-
payloads:
|
|
2681
|
+
payloads: Q
|
|
2682
2682
|
// add payload if action is receiveStock or processRequest
|
|
2683
2683
|
},
|
|
2684
|
-
transferTo: (
|
|
2684
|
+
transferTo: (pe = (ne = s.poRequest) == null ? void 0 : ne.to) == null ? void 0 : pe.dbName
|
|
2685
2685
|
}).delayed(1e3), E("submitted");
|
|
2686
2686
|
} catch (ke) {
|
|
2687
|
-
|
|
2687
|
+
Y(ke);
|
|
2688
2688
|
}
|
|
2689
2689
|
}).onSecondary(() => {
|
|
2690
2690
|
E("cancelled");
|
|
2691
|
-
for (let
|
|
2691
|
+
for (let Q = 0; Q < V + 2; Q++)
|
|
2692
2692
|
v.close();
|
|
2693
2693
|
}).onClose(() => {
|
|
2694
2694
|
});
|
|
2695
2695
|
});
|
|
2696
2696
|
}
|
|
2697
2697
|
async function $e(o) {
|
|
2698
|
-
var V, E,
|
|
2698
|
+
var V, E, Y, x;
|
|
2699
2699
|
if (o === F.enum.receiveStock)
|
|
2700
2700
|
return;
|
|
2701
2701
|
const p = Ft[o];
|
|
@@ -2710,142 +2710,142 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2710
2710
|
const { successMessage: P, ...q } = p;
|
|
2711
2711
|
if (s.purchaseOrder) {
|
|
2712
2712
|
n.value = `${o}`, D.value = !0, m.value = !1;
|
|
2713
|
-
const
|
|
2714
|
-
let
|
|
2715
|
-
if (o === F.enum.confirmDraft && (
|
|
2716
|
-
...
|
|
2717
|
-
totalCost: _.controller.value.getItemCost(
|
|
2713
|
+
const X = {};
|
|
2714
|
+
let Q = 0;
|
|
2715
|
+
if (o === F.enum.confirmDraft && (X.items = s.purchaseOrder.items.map((ie) => ({
|
|
2716
|
+
...ie,
|
|
2717
|
+
totalCost: _.controller.value.getItemCost(ie, Ce()).cost
|
|
2718
2718
|
}))), (o === F.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
2719
2719
|
o === F.enum.completeReceive) && g.autoReceiveWarehouse)
|
|
2720
|
-
|
|
2720
|
+
X.autoReceive = !0;
|
|
2721
2721
|
else if ((o === F.enum.approveRequest || o === F.enum.processRequest) && g.acceptRequireFulfillment) {
|
|
2722
|
-
const
|
|
2723
|
-
if (
|
|
2724
|
-
const
|
|
2722
|
+
const ie = (E = (V = s.poRequest) == null ? void 0 : V.from) == null ? void 0 : E.dbName, Z = (x = (Y = s.poRequest) == null ? void 0 : Y.to) == null ? void 0 : x.dbName;
|
|
2723
|
+
if (ie && Z && (ie.startsWith("warehouse_") || Z.startsWith("warehouse_"))) {
|
|
2724
|
+
const ne = await new Promise((pe, ke) => {
|
|
2725
2725
|
v.open({
|
|
2726
2726
|
closeButton: !1,
|
|
2727
2727
|
title: "Confirm transfer amount",
|
|
2728
2728
|
dialogComponent: $r,
|
|
2729
2729
|
dialogComponentProps: {
|
|
2730
2730
|
purchaseOrder: s.purchaseOrder,
|
|
2731
|
-
confirm:
|
|
2731
|
+
confirm: pe,
|
|
2732
2732
|
"onUpdate:show": (qe) => {
|
|
2733
|
-
qe || (n.value = "", D.value = !1, m.value = !0,
|
|
2733
|
+
qe || (n.value = "", D.value = !1, m.value = !0, Q++, v.close()), ke("cancelled");
|
|
2734
2734
|
}
|
|
2735
2735
|
}
|
|
2736
2736
|
});
|
|
2737
2737
|
});
|
|
2738
|
-
|
|
2738
|
+
X.fulfillment = ne;
|
|
2739
2739
|
}
|
|
2740
2740
|
}
|
|
2741
2741
|
try {
|
|
2742
|
-
await
|
|
2742
|
+
await fe(
|
|
2743
2743
|
s.purchaseOrder,
|
|
2744
|
-
|
|
2744
|
+
X,
|
|
2745
2745
|
o,
|
|
2746
2746
|
p,
|
|
2747
|
-
|
|
2747
|
+
Q
|
|
2748
2748
|
) === "submitted" && (a.open({
|
|
2749
2749
|
title: "Success",
|
|
2750
2750
|
message: P,
|
|
2751
2751
|
type: "success"
|
|
2752
2752
|
}), u("update:show", !1), u("submitted"));
|
|
2753
|
-
} catch (
|
|
2753
|
+
} catch (ie) {
|
|
2754
2754
|
a.open({
|
|
2755
2755
|
title: "Something went wrong",
|
|
2756
2756
|
message: "Please try again.",
|
|
2757
2757
|
type: "error"
|
|
2758
|
-
}), console.error("Error when submitting PO operation", o, s.purchaseOrder,
|
|
2758
|
+
}), console.error("Error when submitting PO operation", o, s.purchaseOrder, ie);
|
|
2759
2759
|
} finally {
|
|
2760
2760
|
n.value = "", D.value = !1, m.value = !0;
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
2763
|
}
|
|
2764
|
-
const je =
|
|
2764
|
+
const je = W(() => {
|
|
2765
2765
|
var o, p;
|
|
2766
2766
|
return ((o = s.purchaseOrder) == null ? void 0 : o.status) === se.enum.RECEIVING || ((p = s.purchaseOrder) == null ? void 0 : p.status) === se.enum.COMPLETE;
|
|
2767
|
-
}),
|
|
2767
|
+
}), M = W(() => s.purchaseOrder ? ot(s.purchaseOrder) : {}), j = W(() => {
|
|
2768
2768
|
const o = s.purchaseOrder;
|
|
2769
2769
|
if (!o) return { status: "", statusClass: "" };
|
|
2770
|
-
const { partial: p, over: P } = mt(
|
|
2770
|
+
const { partial: p, over: P } = mt(M.value), q = pt(o.status, p, P);
|
|
2771
2771
|
let V = c(`inventory.transfer.status.${q}`), E = `${o.status}`.toLocaleLowerCase("en-us");
|
|
2772
2772
|
return q === se.enum.CLOSE && (V = `${c(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), q === "PARTIAL_RECEIVED" && E === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (E = se.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
2773
2773
|
status: V,
|
|
2774
2774
|
statusClass: `fm-status-badge fm-status-badge-${E}`
|
|
2775
2775
|
};
|
|
2776
|
-
}), oe =
|
|
2777
|
-
var E,
|
|
2778
|
-
const o = ((E = s.purchaseOrder) == null ? void 0 : E.deliveryOrder) ?? [], p = ((
|
|
2779
|
-
...o.map((
|
|
2780
|
-
createdAt:
|
|
2776
|
+
}), oe = W(() => {
|
|
2777
|
+
var E, Y;
|
|
2778
|
+
const o = ((E = s.purchaseOrder) == null ? void 0 : E.deliveryOrder) ?? [], p = ((Y = s.purchaseOrder) == null ? void 0 : Y.deliveryFullfillment) ?? [], P = [
|
|
2779
|
+
...o.map((x) => ({
|
|
2780
|
+
createdAt: x.createdAt,
|
|
2781
2781
|
type: "grn",
|
|
2782
|
-
doc:
|
|
2782
|
+
doc: x
|
|
2783
2783
|
})),
|
|
2784
|
-
...p.map((
|
|
2785
|
-
createdAt:
|
|
2784
|
+
...p.map((x) => ({
|
|
2785
|
+
createdAt: x.createdAt,
|
|
2786
2786
|
type: "fulfillment",
|
|
2787
|
-
doc:
|
|
2787
|
+
doc: x
|
|
2788
2788
|
}))
|
|
2789
2789
|
];
|
|
2790
|
-
P.reverse().sort((
|
|
2791
|
-
function q(
|
|
2792
|
-
var
|
|
2793
|
-
const
|
|
2794
|
-
(
|
|
2790
|
+
P.reverse().sort((x, X) => x.createdAt.localeCompare(X.createdAt));
|
|
2791
|
+
function q(x) {
|
|
2792
|
+
var ie, Z, ne, pe, ke, qe, te, ue, ye, ge, Oe, xe;
|
|
2793
|
+
const X = p.findIndex((de) => de.id === x.fullfillmentId), Q = [
|
|
2794
|
+
(Z = (ie = p[X]) == null ? void 0 : ie.netSuite) != null && Z.id ? {
|
|
2795
2795
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
2796
2796
|
values: [
|
|
2797
|
-
`${((
|
|
2797
|
+
`${((pe = (ne = p[X]) == null ? void 0 : ne.netSuite) == null ? void 0 : pe.refNo) ?? "N/A"} (${((qe = (ke = p[X]) == null ? void 0 : ke.netSuite) == null ? void 0 : qe.id) ?? "-"})`
|
|
2798
2798
|
]
|
|
2799
2799
|
} : null,
|
|
2800
|
-
(te =
|
|
2800
|
+
(te = x == null ? void 0 : x.netSuite) != null && te.id ? {
|
|
2801
2801
|
label: "Netsuite ref no.",
|
|
2802
|
-
values: [`${((
|
|
2802
|
+
values: [`${((ue = x == null ? void 0 : x.netSuite) == null ? void 0 : ue.refNo) ?? "N/A"} (${((ye = x == null ? void 0 : x.netSuite) == null ? void 0 : ye.id) ?? "-"})`]
|
|
2803
2803
|
} : null,
|
|
2804
|
-
(ge =
|
|
2804
|
+
(ge = x == null ? void 0 : x.netSuite) != null && ge.recordType ? {
|
|
2805
2805
|
label: "Netsuite Type",
|
|
2806
|
-
values: [$t((Oe =
|
|
2806
|
+
values: [$t((Oe = x == null ? void 0 : x.netSuite) == null ? void 0 : Oe.recordType)]
|
|
2807
2807
|
} : null
|
|
2808
2808
|
];
|
|
2809
2809
|
return {
|
|
2810
2810
|
header: "Received",
|
|
2811
|
-
deliveryOrder:
|
|
2812
|
-
date: Qe(new Date(
|
|
2811
|
+
deliveryOrder: x,
|
|
2812
|
+
date: Qe(new Date(x.createdAt)),
|
|
2813
2813
|
info: [
|
|
2814
2814
|
{
|
|
2815
2815
|
label: "Adjustment date",
|
|
2816
2816
|
values: [
|
|
2817
|
-
|
|
2817
|
+
x.adjustment ? Qe(new Date(tt(x.adjustment))) : "-"
|
|
2818
2818
|
]
|
|
2819
2819
|
},
|
|
2820
2820
|
{
|
|
2821
2821
|
label: "Received by",
|
|
2822
|
-
values: [(xe =
|
|
2822
|
+
values: [(xe = x.createdBy) == null ? void 0 : xe.name]
|
|
2823
2823
|
},
|
|
2824
2824
|
{
|
|
2825
2825
|
label: "Received items",
|
|
2826
|
-
values:
|
|
2827
|
-
var
|
|
2828
|
-
return
|
|
2829
|
-
|
|
2826
|
+
values: x.received.map((de) => {
|
|
2827
|
+
var ve;
|
|
2828
|
+
return U("div", [
|
|
2829
|
+
U(
|
|
2830
2830
|
"div",
|
|
2831
2831
|
{
|
|
2832
2832
|
class: "flex gap-4"
|
|
2833
2833
|
},
|
|
2834
2834
|
[
|
|
2835
|
-
|
|
2835
|
+
U(
|
|
2836
2836
|
"div",
|
|
2837
2837
|
{
|
|
2838
2838
|
class: "flex flex-col"
|
|
2839
2839
|
},
|
|
2840
2840
|
[
|
|
2841
|
-
|
|
2841
|
+
U(
|
|
2842
2842
|
"span",
|
|
2843
2843
|
{
|
|
2844
2844
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
2845
2845
|
},
|
|
2846
2846
|
`${de.sku.name}`
|
|
2847
2847
|
),
|
|
2848
|
-
|
|
2848
|
+
U(
|
|
2849
2849
|
"span",
|
|
2850
2850
|
{
|
|
2851
2851
|
class: "fm-typo-en-body-md-400"
|
|
@@ -2854,35 +2854,35 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2854
2854
|
)
|
|
2855
2855
|
]
|
|
2856
2856
|
),
|
|
2857
|
-
|
|
2857
|
+
U(
|
|
2858
2858
|
"div",
|
|
2859
2859
|
{
|
|
2860
2860
|
class: "ml-auto flex flex-col"
|
|
2861
2861
|
},
|
|
2862
2862
|
[
|
|
2863
|
-
|
|
2863
|
+
U(
|
|
2864
2864
|
"div",
|
|
2865
2865
|
{
|
|
2866
2866
|
class: "ml-auto flex gap-1"
|
|
2867
2867
|
},
|
|
2868
2868
|
[
|
|
2869
|
-
|
|
2869
|
+
U(
|
|
2870
2870
|
"span",
|
|
2871
2871
|
{
|
|
2872
2872
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
2873
2873
|
},
|
|
2874
2874
|
_e(de.amount, !1)
|
|
2875
2875
|
),
|
|
2876
|
-
|
|
2876
|
+
U(
|
|
2877
2877
|
"span",
|
|
2878
2878
|
{
|
|
2879
2879
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
2880
2880
|
},
|
|
2881
|
-
((
|
|
2881
|
+
((ve = de.measurement) == null ? void 0 : ve.abbrev) ?? de.sku.unit.abbrev
|
|
2882
2882
|
)
|
|
2883
2883
|
]
|
|
2884
2884
|
),
|
|
2885
|
-
|
|
2885
|
+
U(
|
|
2886
2886
|
"div",
|
|
2887
2887
|
{
|
|
2888
2888
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -2898,98 +2898,98 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2898
2898
|
},
|
|
2899
2899
|
{
|
|
2900
2900
|
label: "Delivery order no.",
|
|
2901
|
-
values: [
|
|
2901
|
+
values: [x.deliveryOrderNumber || "N/A"]
|
|
2902
2902
|
},
|
|
2903
2903
|
{
|
|
2904
2904
|
label: "Remark",
|
|
2905
|
-
values: [
|
|
2905
|
+
values: [x.remark || "N/A"]
|
|
2906
2906
|
},
|
|
2907
|
-
|
|
2907
|
+
X > -1 ? {
|
|
2908
2908
|
label: "Fulfilment's sequence",
|
|
2909
|
-
values: [`${
|
|
2909
|
+
values: [`${X + 1}`]
|
|
2910
2910
|
} : null,
|
|
2911
|
-
...
|
|
2911
|
+
...Q
|
|
2912
2912
|
].filter((de) => !!de)
|
|
2913
2913
|
};
|
|
2914
2914
|
}
|
|
2915
|
-
function V(
|
|
2916
|
-
var
|
|
2917
|
-
const
|
|
2915
|
+
function V(x) {
|
|
2916
|
+
var Q, ie, Z;
|
|
2917
|
+
const X = p.findIndex((ne) => ne.id === x.id);
|
|
2918
2918
|
return {
|
|
2919
2919
|
header: "Fulfillment",
|
|
2920
|
-
date: Qe(new Date(
|
|
2920
|
+
date: Qe(new Date(x.createdAt)),
|
|
2921
2921
|
info: [
|
|
2922
2922
|
{
|
|
2923
2923
|
label: "Sequence",
|
|
2924
|
-
values: [String(
|
|
2924
|
+
values: [String(X + 1)]
|
|
2925
2925
|
},
|
|
2926
2926
|
{
|
|
2927
2927
|
label: "Receiveable items",
|
|
2928
|
-
values:
|
|
2929
|
-
var
|
|
2930
|
-
return
|
|
2931
|
-
|
|
2928
|
+
values: x.items.map((ne) => {
|
|
2929
|
+
var pe;
|
|
2930
|
+
return U("div", [
|
|
2931
|
+
U(
|
|
2932
2932
|
"div",
|
|
2933
2933
|
{
|
|
2934
2934
|
class: "flex gap-4"
|
|
2935
2935
|
},
|
|
2936
2936
|
[
|
|
2937
|
-
|
|
2937
|
+
U(
|
|
2938
2938
|
"div",
|
|
2939
2939
|
{
|
|
2940
2940
|
class: "flex flex-col"
|
|
2941
2941
|
},
|
|
2942
2942
|
[
|
|
2943
|
-
|
|
2943
|
+
U(
|
|
2944
2944
|
"span",
|
|
2945
2945
|
{
|
|
2946
2946
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
2947
2947
|
},
|
|
2948
|
-
`${
|
|
2948
|
+
`${ne.sku.name}`
|
|
2949
2949
|
),
|
|
2950
|
-
|
|
2950
|
+
U(
|
|
2951
2951
|
"span",
|
|
2952
2952
|
{
|
|
2953
2953
|
class: "fm-typo-en-body-md-400"
|
|
2954
2954
|
},
|
|
2955
|
-
`${
|
|
2955
|
+
`${ne.sku.code} `
|
|
2956
2956
|
)
|
|
2957
2957
|
]
|
|
2958
2958
|
),
|
|
2959
|
-
|
|
2959
|
+
U(
|
|
2960
2960
|
"div",
|
|
2961
2961
|
{
|
|
2962
2962
|
class: "ml-auto flex flex-col"
|
|
2963
2963
|
},
|
|
2964
2964
|
[
|
|
2965
|
-
|
|
2965
|
+
U(
|
|
2966
2966
|
"div",
|
|
2967
2967
|
{
|
|
2968
2968
|
class: "ml-auto flex gap-1"
|
|
2969
2969
|
},
|
|
2970
2970
|
[
|
|
2971
|
-
|
|
2971
|
+
U(
|
|
2972
2972
|
"span",
|
|
2973
2973
|
{
|
|
2974
2974
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
2975
2975
|
},
|
|
2976
|
-
_e(
|
|
2976
|
+
_e(ne.amount, !1)
|
|
2977
2977
|
),
|
|
2978
|
-
|
|
2978
|
+
U(
|
|
2979
2979
|
"span",
|
|
2980
2980
|
{
|
|
2981
2981
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
2982
2982
|
},
|
|
2983
|
-
((
|
|
2983
|
+
((pe = ne.measurement) == null ? void 0 : pe.abbrev) ?? ne.sku.unit.abbrev
|
|
2984
2984
|
)
|
|
2985
2985
|
]
|
|
2986
2986
|
),
|
|
2987
|
-
|
|
2987
|
+
U(
|
|
2988
2988
|
"div",
|
|
2989
2989
|
{
|
|
2990
2990
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
2991
2991
|
},
|
|
2992
|
-
`${
|
|
2992
|
+
`${ne.cost ? `(${ze(ne.cost)})` : ""}`
|
|
2993
2993
|
)
|
|
2994
2994
|
]
|
|
2995
2995
|
)
|
|
@@ -2998,22 +2998,22 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2998
2998
|
]);
|
|
2999
2999
|
})
|
|
3000
3000
|
},
|
|
3001
|
-
(
|
|
3002
|
-
label: "Ref no. (
|
|
3003
|
-
values: [(
|
|
3001
|
+
(Q = x.netSuite) != null && Q.refNo ? {
|
|
3002
|
+
label: "Netsuite Ref no. (ID)",
|
|
3003
|
+
values: [`${(ie = x.netSuite) == null ? void 0 : ie.refNo} (${((Z = x.netSuite) == null ? void 0 : Z.id) ?? "-"})`]
|
|
3004
3004
|
} : null
|
|
3005
|
-
].filter((
|
|
3005
|
+
].filter((ne) => !!ne)
|
|
3006
3006
|
};
|
|
3007
3007
|
}
|
|
3008
|
-
return P.map((
|
|
3009
|
-
switch (
|
|
3008
|
+
return P.map((x) => {
|
|
3009
|
+
switch (x.type) {
|
|
3010
3010
|
case "grn":
|
|
3011
|
-
return q(
|
|
3011
|
+
return q(x.doc);
|
|
3012
3012
|
case "fulfillment":
|
|
3013
|
-
return V(
|
|
3013
|
+
return V(x.doc);
|
|
3014
3014
|
}
|
|
3015
3015
|
});
|
|
3016
|
-
}), A =
|
|
3016
|
+
}), A = W(() => {
|
|
3017
3017
|
var p;
|
|
3018
3018
|
const o = {
|
|
3019
3019
|
...kt(0),
|
|
@@ -3030,32 +3030,32 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3030
3030
|
return `<span class="${I(o)} fm-typo-en-body-lg-600">${Le.toFormatString({ value: q.received })}</span>/${nr(o.quantity, o.sku.unit, o.measurement)}`;
|
|
3031
3031
|
}
|
|
3032
3032
|
function I(o) {
|
|
3033
|
-
var
|
|
3034
|
-
const P = (((
|
|
3035
|
-
return E ? "text-fm-color-typo-tertiary" : V ? "text-fm-color-system-warning-300" :
|
|
3033
|
+
var X;
|
|
3034
|
+
const P = (((X = s.purchaseOrder) == null ? void 0 : X.version) ?? Ee.enum[1]) === Ee.enum[2] ? o.id : o.sku._id, q = s.receivedMap[P], { isPartialReceive: V, isNoReceive: E, isOverReceive: Y, isFullReceive: x } = _r(q);
|
|
3035
|
+
return E ? "text-fm-color-typo-tertiary" : V ? "text-fm-color-system-warning-300" : Y ? "text-fm-color-system-error-300" : x ? "text-fm-color-system-success-300" : "";
|
|
3036
3036
|
}
|
|
3037
|
-
const B =
|
|
3037
|
+
const B = W(() => {
|
|
3038
3038
|
var o, p, P;
|
|
3039
3039
|
return (o = s.purchaseOrder) != null && o.itemsAtSubmission ? ((p = s.purchaseOrder) == null ? void 0 : p.version) === Ee.enum[2] ? s.purchaseOrder.items.reduce((q, V) => {
|
|
3040
|
-
var
|
|
3041
|
-
const E = (
|
|
3042
|
-
(
|
|
3040
|
+
var Y, x;
|
|
3041
|
+
const E = (x = (Y = s.purchaseOrder) == null ? void 0 : Y.itemsAtSubmission) == null ? void 0 : x.find(
|
|
3042
|
+
(X) => X.id === V.id
|
|
3043
3043
|
);
|
|
3044
3044
|
return E && E.quantity !== V.quantity && q.set(V.sku.code, {
|
|
3045
3045
|
originalAmount: Number(Le.toFormatString({ value: E.quantity })),
|
|
3046
3046
|
newAmount: Number(Le.toFormatString({ value: V.quantity }))
|
|
3047
3047
|
}), q;
|
|
3048
3048
|
}, /* @__PURE__ */ new Map()) : (P = s.purchaseOrder) == null ? void 0 : P.items.reduce((q, V) => {
|
|
3049
|
-
var
|
|
3050
|
-
const E = (
|
|
3051
|
-
(
|
|
3052
|
-
),
|
|
3053
|
-
return E &&
|
|
3054
|
-
originalAmount:
|
|
3055
|
-
newAmount:
|
|
3049
|
+
var X, Q;
|
|
3050
|
+
const E = (Q = (X = s.purchaseOrder) == null ? void 0 : X.itemsAtSubmission) == null ? void 0 : Q.find(
|
|
3051
|
+
(ie) => ie.sku._id === V.sku._id
|
|
3052
|
+
), Y = E ? Number(Le.toFormatString({ value: E.quantity })) : 0, x = Number(Le.toFormatString({ value: V.quantity }));
|
|
3053
|
+
return E && Y !== x && q.set(V.sku.code, {
|
|
3054
|
+
originalAmount: Y,
|
|
3055
|
+
newAmount: x
|
|
3056
3056
|
}), q;
|
|
3057
3057
|
}, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
3058
|
-
}),
|
|
3058
|
+
}), le = (o) => {
|
|
3059
3059
|
var P, q;
|
|
3060
3060
|
const p = B.value;
|
|
3061
3061
|
return ((P = s.purchaseOrder) == null ? void 0 : P.version) === Ee.enum[2] ? p.has(o.id) : p.has((q = o.sku) == null ? void 0 : q.code);
|
|
@@ -3063,7 +3063,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3063
3063
|
var P, q;
|
|
3064
3064
|
const p = B.value;
|
|
3065
3065
|
return ((P = s.purchaseOrder) == null ? void 0 : P.version) === Ee.enum[2] ? p.get(o.id) : p.get((q = o.sku) == null ? void 0 : q.code);
|
|
3066
|
-
}, Fe =
|
|
3066
|
+
}, Fe = W(() => {
|
|
3067
3067
|
const o = s.purchaseOrder;
|
|
3068
3068
|
if (!o) return "";
|
|
3069
3069
|
const p = o.actionChangelogs ?? [], P = p.length ? p[p.length - 1] : null;
|
|
@@ -3074,36 +3074,36 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3074
3074
|
return "";
|
|
3075
3075
|
});
|
|
3076
3076
|
return (o, p) => {
|
|
3077
|
-
const P =
|
|
3078
|
-
return l(),
|
|
3077
|
+
const P = K("FmButton"), q = K("FmButtonGroup"), V = K("FmChip"), E = K("FmIcon"), Y = K("FmMenuDivider"), x = K("FmCard"), X = K("FmTooltip"), Q = K("FmSpacer"), ie = K("FmSideSheet");
|
|
3078
|
+
return l(), ae(ie, {
|
|
3079
3079
|
modelValue: f(ee),
|
|
3080
|
-
"onUpdate:modelValue": p[8] || (p[8] = (
|
|
3080
|
+
"onUpdate:modelValue": p[8] || (p[8] = (Z) => Bt(ee) ? ee.value = Z : null),
|
|
3081
3081
|
"dismiss-away": m.value,
|
|
3082
3082
|
"max-width": 600,
|
|
3083
3083
|
"close-button": !1
|
|
3084
3084
|
}, {
|
|
3085
3085
|
"side-sheet-header": re(() => {
|
|
3086
|
-
var
|
|
3086
|
+
var Z, ne;
|
|
3087
3087
|
return [
|
|
3088
3088
|
e("div", No, [
|
|
3089
3089
|
e("div", Fo, [
|
|
3090
|
-
e("div", To, y(f(c)("inventory.transfer.receiveRequest.details.title") + ((
|
|
3090
|
+
e("div", To, y(f(c)("inventory.transfer.receiveRequest.details.title") + ((Z = o.purchaseOrder) != null && Z.seqNumber ? ` #${(ne = o.purchaseOrder) == null ? void 0 : ne.seqNumber}` : "")), 1),
|
|
3091
3091
|
T(P, {
|
|
3092
3092
|
class: "ml-auto -m-2",
|
|
3093
3093
|
variant: "tertiary",
|
|
3094
3094
|
"prepend-icon": "close",
|
|
3095
|
-
onClick: p[0] || (p[0] = (
|
|
3095
|
+
onClick: p[0] || (p[0] = (pe) => u("update:show", !1))
|
|
3096
3096
|
})
|
|
3097
3097
|
]),
|
|
3098
3098
|
T(q, {
|
|
3099
|
-
items:
|
|
3100
|
-
modelValue:
|
|
3101
|
-
"onUpdate:modelValue": p[1] || (p[1] = (
|
|
3099
|
+
items: z.value,
|
|
3100
|
+
modelValue: H.value,
|
|
3101
|
+
"onUpdate:modelValue": p[1] || (p[1] = (pe) => H.value = pe)
|
|
3102
3102
|
}, null, 8, ["items", "modelValue"]),
|
|
3103
|
-
o.purchaseOrder &&
|
|
3103
|
+
o.purchaseOrder && H.value.value === "deliveryHistory" ? (l(), ae(fo, {
|
|
3104
3104
|
key: 0,
|
|
3105
3105
|
"purchase-order": o.purchaseOrder,
|
|
3106
|
-
"received-info-map":
|
|
3106
|
+
"received-info-map": M.value,
|
|
3107
3107
|
onSubmitted: p[2] || (p[2] = () => {
|
|
3108
3108
|
u("update:show", !1), u("submitted");
|
|
3109
3109
|
})
|
|
@@ -3112,22 +3112,22 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3112
3112
|
];
|
|
3113
3113
|
}),
|
|
3114
3114
|
default: re(() => {
|
|
3115
|
-
var
|
|
3115
|
+
var Z, ne, pe, ke, qe;
|
|
3116
3116
|
return [
|
|
3117
3117
|
e("div", Po, [
|
|
3118
|
-
|
|
3118
|
+
H.value.value === "overview" ? (l(), h(ce, { key: 0 }, [
|
|
3119
3119
|
e("div", null, [
|
|
3120
|
-
T(
|
|
3120
|
+
T(x, {
|
|
3121
3121
|
variant: "outlined",
|
|
3122
3122
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
3123
3123
|
}, {
|
|
3124
3124
|
default: re(() => {
|
|
3125
|
-
var te,
|
|
3125
|
+
var te, ue, ye, ge, Oe, xe, de, ve, Ve, Be;
|
|
3126
3126
|
return [
|
|
3127
3127
|
e("div", Io, [
|
|
3128
3128
|
e("div", qo, y(f(c)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
3129
3129
|
e("div", Vo, [
|
|
3130
|
-
T(
|
|
3130
|
+
T(Ue, null, {
|
|
3131
3131
|
default: re(() => {
|
|
3132
3132
|
var Xe;
|
|
3133
3133
|
return [
|
|
@@ -3150,17 +3150,17 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3150
3150
|
])) : L("", !0)
|
|
3151
3151
|
])
|
|
3152
3152
|
]),
|
|
3153
|
-
T(
|
|
3154
|
-
e("div",
|
|
3155
|
-
e("div",
|
|
3153
|
+
T(Y),
|
|
3154
|
+
e("div", Uo, [
|
|
3155
|
+
e("div", Mo, [
|
|
3156
3156
|
e("div", jo, [
|
|
3157
3157
|
e("div", Bo, y(f(c)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
3158
3158
|
]),
|
|
3159
3159
|
e("div", zo, y(f(Ze)(((te = o.purchaseOrder) == null ? void 0 : te._id) ?? "")), 1)
|
|
3160
3160
|
]),
|
|
3161
|
-
(
|
|
3161
|
+
(ue = o.purchaseOrder) != null && ue.effectiveAt ? (l(), h("div", Ko, [
|
|
3162
3162
|
e("div", Go, y(f(c)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
3163
|
-
e("div", Ho, y(f(At)(new Date((
|
|
3163
|
+
e("div", Ho, y(f(At)(new Date((ye = o.purchaseOrder) == null ? void 0 : ye.effectiveAt))), 1)
|
|
3164
3164
|
])) : L("", !0),
|
|
3165
3165
|
e("div", Wo, [
|
|
3166
3166
|
e("div", Yo, y(f(c)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
@@ -3176,7 +3176,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3176
3176
|
e("div", tn, y(f(c)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
3177
3177
|
e("div", rn, y(o.transferTo), 1)
|
|
3178
3178
|
])) : L("", !0),
|
|
3179
|
-
(
|
|
3179
|
+
(ve = o.purchaseOrder) != null && ve.ref ? (l(), h("div", sn, [
|
|
3180
3180
|
e("div", on, y(f(c)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
3181
3181
|
e("div", nn, y(o.purchaseOrder.ref), 1)
|
|
3182
3182
|
])) : L("", !0),
|
|
@@ -3206,17 +3206,17 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3206
3206
|
e("div", yn, [
|
|
3207
3207
|
e("span", vn, [
|
|
3208
3208
|
Ie(y(je.value ? f(c)("inventory.transfer.receiveRequest.details.receivedItems") : f(c)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
3209
|
-
(
|
|
3209
|
+
(ne = (Z = o.purchaseOrder) == null ? void 0 : Z.netSuite) != null && ne.missingItems && ((ke = (pe = o.purchaseOrder) == null ? void 0 : pe.netSuite) == null ? void 0 : ke.missingItems.length) > 0 ? (l(), ae(X, {
|
|
3210
3210
|
key: 0,
|
|
3211
3211
|
variant: "rich",
|
|
3212
3212
|
placement: "top",
|
|
3213
3213
|
"z-index": 51
|
|
3214
3214
|
}, {
|
|
3215
3215
|
content: re(() => {
|
|
3216
|
-
var te,
|
|
3216
|
+
var te, ue;
|
|
3217
3217
|
return [
|
|
3218
3218
|
e("div", hn, [
|
|
3219
|
-
(l(!0), h(
|
|
3219
|
+
(l(!0), h(ce, null, we((ue = (te = o.purchaseOrder) == null ? void 0 : te.netSuite) == null ? void 0 : ue.missingItems, (ye, ge) => (l(), h("div", {
|
|
3220
3220
|
class: "flex justify-center align-middle",
|
|
3221
3221
|
key: ge
|
|
3222
3222
|
}, [
|
|
@@ -3224,7 +3224,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3224
3224
|
name: "arrow_right",
|
|
3225
3225
|
size: "sm"
|
|
3226
3226
|
}),
|
|
3227
|
-
Ie(" " + y(`(${
|
|
3227
|
+
Ie(" " + y(`(${ye.netSuiteId}) ${ye.name}: ${ye.reason}`), 1)
|
|
3228
3228
|
]))), 128))
|
|
3229
3229
|
])
|
|
3230
3230
|
];
|
|
@@ -3240,17 +3240,17 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3240
3240
|
})) : L("", !0)
|
|
3241
3241
|
])
|
|
3242
3242
|
]),
|
|
3243
|
-
T(
|
|
3244
|
-
(l(!0), h(
|
|
3245
|
-
var
|
|
3243
|
+
T(Y),
|
|
3244
|
+
(l(!0), h(ce, null, we(((qe = o.purchaseOrder) == null ? void 0 : qe.items) ?? [], (te, ue) => {
|
|
3245
|
+
var ye, ge;
|
|
3246
3246
|
return l(), h("div", {
|
|
3247
|
-
key:
|
|
3247
|
+
key: ue,
|
|
3248
3248
|
class: "flex flex-col"
|
|
3249
3249
|
}, [
|
|
3250
3250
|
e("div", gn, [
|
|
3251
3251
|
e("div", bn, [
|
|
3252
3252
|
Ie(y(te.name) + " ", 1),
|
|
3253
|
-
|
|
3253
|
+
le(te) ? (l(), ae(X, {
|
|
3254
3254
|
key: 0,
|
|
3255
3255
|
variant: "rich",
|
|
3256
3256
|
placement: "top",
|
|
@@ -3284,8 +3284,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3284
3284
|
]),
|
|
3285
3285
|
e("div", xn, [
|
|
3286
3286
|
e("div", wn, y(te.code), 1),
|
|
3287
|
-
f(g).enableTotalCost ? (l(), h(
|
|
3288
|
-
(
|
|
3287
|
+
f(g).enableTotalCost ? (l(), h(ce, { key: 0 }, [
|
|
3288
|
+
(ye = te.totalCost) != null && ye.amount ? (l(), h("span", Cn, " (" + y(f(ze)(te.totalCost)) + ") ", 1)) : (l(), h(ce, { key: 1 }, [
|
|
3289
3289
|
((ge = o.purchaseOrder) == null ? void 0 : ge.status) === f(se).enum.DRAFT ? (l(), h("span", Rn, y(f(c)("inventory.transfer.form.items.autoCalculated")) + ": " + y(f(ze)(
|
|
3290
3290
|
f(_).controller.value.getItemCost(te, f(Ce)()).cost
|
|
3291
3291
|
)), 1)) : L("", !0)
|
|
@@ -3294,9 +3294,9 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3294
3294
|
])
|
|
3295
3295
|
]);
|
|
3296
3296
|
}), 128)),
|
|
3297
|
-
+f(_e)(A.value) ? (l(), h(
|
|
3297
|
+
+f(_e)(A.value) ? (l(), h(ce, { key: 0 }, [
|
|
3298
3298
|
e("div", $n, [
|
|
3299
|
-
T(
|
|
3299
|
+
T(Y)
|
|
3300
3300
|
]),
|
|
3301
3301
|
e("div", Dn, [
|
|
3302
3302
|
p[10] || (p[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
@@ -3305,51 +3305,51 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3305
3305
|
], 64)) : L("", !0)
|
|
3306
3306
|
])
|
|
3307
3307
|
])
|
|
3308
|
-
], 64)) :
|
|
3308
|
+
], 64)) : H.value.value === "deliveryHistory" ? (l(), h("div", An, [
|
|
3309
3309
|
oe.value.length ? (l(), h("div", In, [
|
|
3310
|
-
(l(!0), h(
|
|
3311
|
-
var
|
|
3312
|
-
return l(), h(
|
|
3310
|
+
(l(!0), h(ce, null, we(oe.value, (te, ue) => {
|
|
3311
|
+
var ye, ge, Oe, xe, de;
|
|
3312
|
+
return l(), h(ce, { key: ue }, [
|
|
3313
3313
|
e("div", qn, [
|
|
3314
3314
|
e("div", Vn, [
|
|
3315
3315
|
e("div", En, [
|
|
3316
3316
|
e("div", {
|
|
3317
3317
|
class: Ke([
|
|
3318
3318
|
{
|
|
3319
|
-
"bg-fm-color-primary":
|
|
3320
|
-
"bg-white":
|
|
3319
|
+
"bg-fm-color-primary": ue !== 0,
|
|
3320
|
+
"bg-white": ue === 0
|
|
3321
3321
|
},
|
|
3322
3322
|
"w-[2px] h-full"
|
|
3323
3323
|
])
|
|
3324
3324
|
}, null, 2)
|
|
3325
3325
|
]),
|
|
3326
3326
|
e("div", Ln, [
|
|
3327
|
-
te.header === "Received" ? (l(),
|
|
3327
|
+
te.header === "Received" ? (l(), ae(E, {
|
|
3328
3328
|
key: 0,
|
|
3329
3329
|
name: "local_shipping",
|
|
3330
3330
|
outline: "",
|
|
3331
3331
|
color: "#ffffff"
|
|
3332
3332
|
})) : L("", !0)
|
|
3333
3333
|
]),
|
|
3334
|
-
e("div",
|
|
3334
|
+
e("div", Un, [
|
|
3335
3335
|
e("div", {
|
|
3336
3336
|
class: Ke([
|
|
3337
3337
|
{
|
|
3338
|
-
"bg-fm-color-primary":
|
|
3339
|
-
"bg-white":
|
|
3338
|
+
"bg-fm-color-primary": ue < oe.value.length - 1,
|
|
3339
|
+
"bg-white": ue >= oe.value.length - 1
|
|
3340
3340
|
},
|
|
3341
3341
|
"w-[2px] h-full"
|
|
3342
3342
|
])
|
|
3343
3343
|
}, null, 2)
|
|
3344
3344
|
])
|
|
3345
3345
|
]),
|
|
3346
|
-
e("div",
|
|
3346
|
+
e("div", Mn, [
|
|
3347
3347
|
e("div", jn, [
|
|
3348
3348
|
e("div", Bn, y(te.header), 1),
|
|
3349
3349
|
e("div", zn, y(te.date), 1)
|
|
3350
3350
|
]),
|
|
3351
3351
|
e("div", Kn, [
|
|
3352
|
-
te.header === "Received" && te.deliveryOrder && o.purchaseOrder ? (l(),
|
|
3352
|
+
te.header === "Received" && te.deliveryOrder && o.purchaseOrder ? (l(), ae(js, {
|
|
3353
3353
|
key: 0,
|
|
3354
3354
|
deliveryOrder: te.deliveryOrder,
|
|
3355
3355
|
purchaseOrder: o.purchaseOrder,
|
|
@@ -3357,18 +3357,18 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3357
3357
|
u("update:show", !1), u("submitted");
|
|
3358
3358
|
})
|
|
3359
3359
|
}, null, 8, ["deliveryOrder", "purchaseOrder"])) : L("", !0),
|
|
3360
|
-
(ge = (
|
|
3360
|
+
(ge = (ye = te.deliveryOrder) == null ? void 0 : ye.netSuite) != null && ge.id ? (l(), ae(Ue, { key: 1 }, {
|
|
3361
3361
|
default: re(() => {
|
|
3362
|
-
var
|
|
3362
|
+
var ve, Ve;
|
|
3363
3363
|
return [
|
|
3364
3364
|
T(Ao, {
|
|
3365
|
-
"netsuite-id": (Ve = (
|
|
3365
|
+
"netsuite-id": (Ve = (ve = te.deliveryOrder) == null ? void 0 : ve.netSuite) == null ? void 0 : Ve.id
|
|
3366
3366
|
}, null, 8, ["netsuite-id"])
|
|
3367
3367
|
];
|
|
3368
3368
|
}),
|
|
3369
3369
|
_: 2
|
|
3370
3370
|
}, 1024)) : L("", !0),
|
|
3371
|
-
o.purchaseOrder && ((Oe = te.deliveryOrder) != null && Oe.id) ? (l(),
|
|
3371
|
+
o.purchaseOrder && ((Oe = te.deliveryOrder) != null && Oe.id) ? (l(), ae(ar, {
|
|
3372
3372
|
key: 2,
|
|
3373
3373
|
"purchase-order-id": (xe = o.purchaseOrder) == null ? void 0 : xe._id,
|
|
3374
3374
|
"delivery-order-id": (de = te.deliveryOrder) == null ? void 0 : de.id
|
|
@@ -3382,8 +3382,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3382
3382
|
e("div", {
|
|
3383
3383
|
class: Ke([
|
|
3384
3384
|
{
|
|
3385
|
-
"bg-fm-color-primary":
|
|
3386
|
-
"bg-white":
|
|
3385
|
+
"bg-fm-color-primary": ue < oe.value.length - 1,
|
|
3386
|
+
"bg-white": ue >= oe.value.length - 1
|
|
3387
3387
|
},
|
|
3388
3388
|
"w-[2px] h-full"
|
|
3389
3389
|
])
|
|
@@ -3391,25 +3391,25 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3391
3391
|
])
|
|
3392
3392
|
]),
|
|
3393
3393
|
e("div", Yn, [
|
|
3394
|
-
T(
|
|
3394
|
+
T(x, {
|
|
3395
3395
|
variant: "outlined",
|
|
3396
3396
|
class: "py-12 px-16"
|
|
3397
3397
|
}, {
|
|
3398
3398
|
default: re(() => [
|
|
3399
3399
|
e("div", Qn, [
|
|
3400
|
-
(l(!0), h(
|
|
3400
|
+
(l(!0), h(ce, null, we(te.info, (ve, Ve) => (l(), h("div", {
|
|
3401
3401
|
key: Ve,
|
|
3402
3402
|
class: "flex flex-col gap-4"
|
|
3403
3403
|
}, [
|
|
3404
|
-
e("div", Jn, y(
|
|
3404
|
+
e("div", Jn, y(ve == null ? void 0 : ve.label), 1),
|
|
3405
3405
|
e("div", Xn, [
|
|
3406
|
-
(l(!0), h(
|
|
3406
|
+
(l(!0), h(ce, null, we(ve == null ? void 0 : ve.values, (Be, Xe) => (l(), h("div", {
|
|
3407
3407
|
key: Xe,
|
|
3408
3408
|
class: "fm-typo-en-body-lg-600"
|
|
3409
3409
|
}, [
|
|
3410
|
-
typeof Be == "string" ? (l(), h(
|
|
3410
|
+
typeof Be == "string" ? (l(), h(ce, { key: 0 }, [
|
|
3411
3411
|
Ie(y(Be), 1)
|
|
3412
|
-
], 64)) : (l(),
|
|
3412
|
+
], 64)) : (l(), ae(zt(Be), { key: 1 }))
|
|
3413
3413
|
]))), 128))
|
|
3414
3414
|
])
|
|
3415
3415
|
]))), 128))
|
|
@@ -3422,7 +3422,7 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3422
3422
|
], 64);
|
|
3423
3423
|
}), 128))
|
|
3424
3424
|
])) : (l(), h("div", Nn, [
|
|
3425
|
-
T(
|
|
3425
|
+
T(Q),
|
|
3426
3426
|
e("div", null, [
|
|
3427
3427
|
e("img", {
|
|
3428
3428
|
src: f(rr),
|
|
@@ -3431,8 +3431,8 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3431
3431
|
]),
|
|
3432
3432
|
e("div", Tn, y(f(c)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
3433
3433
|
e("div", Pn, y(f(c)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
3434
|
-
T(
|
|
3435
|
-
T(
|
|
3434
|
+
T(Q),
|
|
3435
|
+
T(Q)
|
|
3436
3436
|
]))
|
|
3437
3437
|
])) : L("", !0)
|
|
3438
3438
|
])
|
|
@@ -3440,41 +3440,41 @@ const wr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
3440
3440
|
}),
|
|
3441
3441
|
"side-sheet-footer": re(() => [
|
|
3442
3442
|
e("div", Zn, [
|
|
3443
|
-
(l(!0), h(
|
|
3444
|
-
f(dt)[
|
|
3445
|
-
key:
|
|
3446
|
-
label: f(c)(f(dt)[
|
|
3447
|
-
onClick: (
|
|
3448
|
-
loading: n.value ===
|
|
3449
|
-
disabled: n.value !==
|
|
3450
|
-
variant: f(dt)[
|
|
3443
|
+
(l(!0), h(ce, null, we(N.value, (Z) => (l(), h(ce, null, [
|
|
3444
|
+
f(dt)[Z].available != !1 ? (l(), ae(P, {
|
|
3445
|
+
key: Z,
|
|
3446
|
+
label: f(c)(f(dt)[Z].translationKey),
|
|
3447
|
+
onClick: (ne) => $e(Z),
|
|
3448
|
+
loading: n.value === Z,
|
|
3449
|
+
disabled: n.value !== Z && D.value,
|
|
3450
|
+
variant: f(dt)[Z].buttonVariant
|
|
3451
3451
|
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : L("", !0)
|
|
3452
3452
|
], 64))), 256)),
|
|
3453
|
-
f(C).ableToMarkReceived(o.purchaseOrder) && !N.value.includes("completeReceive") ? (l(),
|
|
3453
|
+
f(C).ableToMarkReceived(o.purchaseOrder) && !N.value.includes("completeReceive") ? (l(), ae(P, {
|
|
3454
3454
|
key: 0,
|
|
3455
3455
|
label: f(c)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
3456
|
-
onClick: p[4] || (p[4] = (
|
|
3456
|
+
onClick: p[4] || (p[4] = (Z) => $e("completeReceive")),
|
|
3457
3457
|
loading: n.value === "completeReceive",
|
|
3458
3458
|
disabled: n.value !== "completeReceive" && D.value
|
|
3459
3459
|
}, null, 8, ["label", "loading", "disabled"])) : L("", !0),
|
|
3460
|
-
f(C).ableToMarkApproved(o.purchaseOrder) && o.canApprove && !N.value.includes("approveRequest") ? (l(),
|
|
3460
|
+
f(C).ableToMarkApproved(o.purchaseOrder) && o.canApprove && !N.value.includes("approveRequest") ? (l(), ae(P, {
|
|
3461
3461
|
key: 1,
|
|
3462
3462
|
label: f(c)("inventory.transfer.approval.actions.approveRequest"),
|
|
3463
|
-
onClick: p[5] || (p[5] = (
|
|
3463
|
+
onClick: p[5] || (p[5] = (Z) => $e("approveRequest")),
|
|
3464
3464
|
loading: n.value === "approveRequest",
|
|
3465
3465
|
disabled: n.value !== "approveRequest" && D.value
|
|
3466
3466
|
}, null, 8, ["label", "loading", "disabled"])) : L("", !0),
|
|
3467
|
-
f(C).ableToCreateFulfillment(o.purchaseOrder, o.poRequest) && s.scope === "approval" ? (l(),
|
|
3467
|
+
f(C).ableToCreateFulfillment(o.purchaseOrder, o.poRequest) && s.scope === "approval" ? (l(), ae(P, {
|
|
3468
3468
|
key: 2,
|
|
3469
3469
|
label: f(c)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
3470
|
-
onClick: p[6] || (p[6] = (
|
|
3470
|
+
onClick: p[6] || (p[6] = (Z) => $e("processRequest")),
|
|
3471
3471
|
loading: n.value === "processRequest",
|
|
3472
3472
|
disabled: n.value !== "processRequest" && D.value
|
|
3473
3473
|
}, null, 8, ["label", "loading", "disabled"])) : L("", !0),
|
|
3474
3474
|
T(P, {
|
|
3475
3475
|
label: f(c)("common.close"),
|
|
3476
3476
|
variant: "tertiary",
|
|
3477
|
-
onClick: p[7] || (p[7] = (
|
|
3477
|
+
onClick: p[7] || (p[7] = (Z) => u("update:show", !1))
|
|
3478
3478
|
}, null, 8, ["label"])
|
|
3479
3479
|
])
|
|
3480
3480
|
]),
|