@feedmepos/mf-inventory-portal 0.0.19-dev.13 → 0.0.19-dev.15
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.vue.d.ts +1 -1
- package/dist/{ApprovalView-9MdmwrUz.js → ApprovalView-CRHU3Bv0.js} +5 -5
- package/dist/{BindingsDialog-C-q6Y04n.js → BindingsDialog-ChIRg0d3.js} +22 -22
- package/dist/{BindingsPicker-syyx9h8v.js → BindingsPicker-BJAbeiDf.js} +17 -17
- package/dist/{BindingsTable-CQ0WyX2i.js → BindingsTable-5MxWD_qa.js} +29 -29
- package/dist/Entry.vue.d.ts +1 -1
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D0j4VOis.js +306 -0
- package/dist/{IngredientsView-Ofs2UG-9.js → IngredientsView-qXrDtzSK.js} +294 -294
- package/dist/{IntegrationView-BCruLSTA.js → IntegrationView-D6yFqod1.js} +278 -278
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bvw_BkWY.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DGurlvYg.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BLVAIHDv.js → PremiumBadge.vue_vue_type_script_setup_true_lang-2Ady4pB4.js} +1 -1
- package/dist/PurchaseOrderPrintPreview-BWwjMRqb.js +152 -0
- package/dist/{ReceiveRequestView-Dw-AC1Mw.js → ReceiveRequestView-C94SWDaj.js} +7 -7
- package/dist/{RecipeView-B5WkUzLO.js → RecipeView-CG9H_ZOo.js} +181 -181
- package/dist/Standalone.vue.d.ts +1 -1
- package/dist/{StockView-CMTxj8Ly.js → StockView-BdXGfDNl.js} +23 -23
- package/dist/SupplierView-ClL2oc8K.js +813 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B8IGZmDZ.js → TransferDetails.vue_vue_type_script_setup_true_lang-DktBkwCx.js} +106 -106
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-BE95F9r1.js +1437 -0
- package/dist/TransferTemplateView-BXrNS8pg.js +1279 -0
- package/dist/{UnitView-CExCsCFg.js → UnitView-Dx2vWJXi.js} +242 -242
- package/dist/{WarehouseView-DuPizg7w.js → WarehouseView-UkmUZnqH.js} +360 -362
- package/dist/api/bill.d.ts +238 -84
- package/dist/api/supplier.d.ts +4 -4
- package/dist/app-BLzTa0Ut.js +68571 -0
- package/dist/app.d.ts +14 -0
- package/dist/app.js +3 -3
- package/dist/components/ChangeLocationComponent.vue.d.ts +11 -1
- package/dist/components/DeferableLoading.vue.d.ts +1 -1
- package/dist/components/DeleteDialog.vue.d.ts +1 -1
- package/dist/components/FmCoordinateInput.vue.d.ts +3 -3
- package/dist/components/FmDroppableField.vue.d.ts +6 -6
- package/dist/components/FmFilterableSelect.vue.d.ts +3 -3
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +21 -10
- package/dist/components/FmMinMaxInput.vue.d.ts +20 -0
- package/dist/components/FmMinMaxInputProps.d.ts +16 -0
- package/dist/components/FmMinMaxInputRules.d.ts +4 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +5 -5
- package/dist/components/FmMultiselectDialogProps.d.ts +6 -1
- package/dist/components/FmUnitInputRules.d.ts +1 -0
- package/dist/components/MultiSelectDialog.vue.d.ts +1 -1
- package/dist/components/NavigationTab.vue.d.ts +1 -1
- package/dist/components/NumberPrecisionInput.vue.d.ts +3 -3
- package/dist/components/PremiumBadge.vue.d.ts +3 -3
- package/dist/components/PreviewBadge.vue.d.ts +3 -3
- package/dist/components/StockForecast.vue.d.ts +1 -1
- package/dist/components/TableActionableRow.vue.d.ts +4 -4
- package/dist/components/UnitDisplayControl.vue.d.ts +1 -1
- package/dist/components/icons/IconCommunity.vue.d.ts +1 -1
- package/dist/components/icons/IconDocumentation.vue.d.ts +1 -1
- package/dist/components/icons/IconEcosystem.vue.d.ts +1 -1
- package/dist/components/icons/IconSupport.vue.d.ts +1 -1
- package/dist/components/icons/IconTooling.vue.d.ts +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +5 -5
- package/dist/components/map/CoordinateDialog.vue.d.ts +4 -4
- package/dist/components/map/GoogleMap.vue.d.ts +6 -6
- package/dist/components/nested-multiselect/FmNestedMultiselectDialog.vue.d.ts +3 -3
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +3 -3
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +5 -5
- package/dist/components/ui-library/FmDateRangePickerChip.vue.d.ts +5 -5
- package/dist/composable/useIframe.d.ts +1 -1
- package/dist/composable/useSearch.d.ts +1 -1
- package/dist/{decimal-GwZ2MmM_.js → decimal-DLYVb_I_.js} +1 -1
- package/dist/format-unit-display-D_Z4TNZd.js +668 -0
- package/dist/helper/number.d.ts +2 -0
- package/dist/{id-to-date-CMUZ2glF.js → id-to-date-CKplrnj_.js} +1 -1
- package/dist/is-linked-ingredient-error-fJ2TJb3z.js +37 -0
- package/dist/layout/InventoryLayout.vue.d.ts +1 -1
- package/dist/layout/SingleColumnLayout.vue.d.ts +5 -5
- package/dist/layout/components/NavigationButton.vue.d.ts +4 -4
- package/dist/{layout-C3IEOm7C.js → layout-B9sdKjL9.js} +1 -1
- package/dist/stores/feature.d.ts +3 -1
- package/dist/stores/location.d.ts +112 -148
- package/dist/stores/supplier.d.ts +672 -18
- package/dist/stores/warehouse.d.ts +9 -5
- package/dist/supplier-BZ6HZcYB.js +60 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/InventoryView.vue.d.ts +1 -1
- package/dist/views/SelectBussinessDialog.vue.d.ts +1 -1
- package/dist/views/approval/ApprovalView.vue.d.ts +1 -1
- package/dist/views/dev/ComponentPreview.vue.d.ts +1 -1
- package/dist/views/dev/components/CoordinateTest.vue.d.ts +1 -1
- package/dist/views/dev/components/DateRange.vue.d.ts +1 -1
- package/dist/views/dev/components/FmDecimalInputTest.vue.d.ts +1 -1
- package/dist/views/dev/components/FmMultiselectDialogGrouped.vue.d.ts +1 -1
- package/dist/views/dev/components/FmSelectTest.vue.d.ts +1 -1
- package/dist/views/dev/components/InventoryIframe.vue.d.ts +1 -1
- package/dist/views/dev/components/LayoutDev.vue.d.ts +1 -1
- package/dist/views/dev/components/MfCommontTest.vue.d.ts +1 -1
- package/dist/views/dev/components/NestedSelection.vue.d.ts +1 -1
- package/dist/views/dev/components/NumberStepper.vue.d.ts +1 -1
- package/dist/views/dev/components/TabStorageTest.vue.d.ts +1 -1
- package/dist/views/dev/components/UnitInput.vue.d.ts +1 -1
- package/dist/views/dev/helpers/pinia-test.d.ts +1 -1
- package/dist/views/home/HomeView.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-dialog/BindingsDialog.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-picker/BindingsPicker.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-table/BindingsTable.vue.d.ts +1 -1
- package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -1
- package/dist/views/ingredients/components/cannot-delete/CannotDelete.vue.d.ts +4 -4
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +3 -3
- package/dist/views/ingredients/components/import-ingredients/ImportIngredientItem.vue.d.ts +1 -1
- package/dist/views/ingredients/components/import-ingredients/ImportIngredients.vue.d.ts +1 -1
- package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItem.vue.d.ts +1 -1
- package/dist/views/ingredients/components/ingredient-dialog/IngredientDialog.vue.d.ts +5 -5
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +4 -4
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +5 -5
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingSummary.vue.d.ts +3 -3
- package/dist/views/ingredients/composables/use-ingredient-form.d.ts +8 -8
- package/dist/views/integration/IntegrationView.vue.d.ts +1 -1
- package/dist/views/integration/components/ApplyAddon.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProduct.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +5 -5
- package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +1 -1
- package/dist/views/receive-request/components/select-template-dialog/SelectTemplateDialog.vue.d.ts +8 -0
- package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistory.vue.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-dialog/TransferDialog.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +27 -27
- package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/components/TransferItem.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/composables/use-backdate-po.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-compare-price.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +0 -8
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1013 -67
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +24 -24
- package/dist/views/receive-request/print-preview/PurchaseOrderPrintPreview.vue.d.ts +1 -1
- package/dist/views/recipe/RecipeView.vue.d.ts +1 -1
- package/dist/views/recipe/components/recipe-dialog/RecipeDialog.vue.d.ts +5 -5
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +4 -4
- package/dist/views/recipe/composables/use-recipe-form.d.ts +8 -8
- package/dist/views/stock/StockView.vue.d.ts +1 -1
- package/dist/views/stock/components/StockHeaderPreview.vue.d.ts +1 -1
- package/dist/views/stock/components/StockHistory.vue.d.ts +3 -3
- package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +123 -46
- package/dist/views/stock/components/dialog/AdjustSkuDialog.vue.d.ts +4 -4
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +3 -3
- package/dist/views/stock/components/dialog/ConvertSkuDialog.vue.d.ts +4 -4
- package/dist/views/stock/composables/use-stock-action.d.ts +11 -11
- package/dist/views/supplier/SupplierView.vue.d.ts +1 -1
- package/dist/views/supplier/components/SupplierDialog.vue.d.ts +4 -4
- package/dist/views/supplier/components/SupplierDialogProps.d.ts +1 -0
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +10 -10
- package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -3
- package/dist/views/supplier/composables/use-supplier-table.d.ts +3 -3
- package/dist/views/transfer-template/TransferTemplateView.vue.d.ts +1 -1
- package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +3 -3
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +4 -4
- package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateForm.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +3 -3
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +7 -7
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +13 -8
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1020 -79
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +309 -11
- package/dist/views/unit/UnitView.vue.d.ts +1 -1
- package/dist/views/unit/components/unit-dialog/UnitDialog.vue.d.ts +5 -5
- package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +4 -4
- package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +3 -3
- package/dist/views/unit/components/unit-used-by/UnitUsedBy.vue.d.ts +1 -1
- package/dist/views/unit/composables/use-unit-form.d.ts +8 -8
- package/dist/views/warehouse/WarehouseView.vue.d.ts +1 -1
- package/dist/views/warehouse/components/WarehouseDialog.vue.d.ts +4 -4
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +22 -14
- package/dist/{xlsx-CjErNF-B.js → xlsx-C3AV6UrJ.js} +2759 -2759
- package/dist/{xlsx.util-CMXCCmUA.js → xlsx.util-slrhXhsk.js} +2 -2
- package/package.json +2 -1
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DlIq3AyC.js +0 -272
- package/dist/PurchaseOrderPrintPreview-Do2KxBzF.js +0 -152
- package/dist/SupplierView-OmZ0X1E1.js +0 -801
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-BJMBsA9j.js +0 -1672
- package/dist/TransferTemplateView-Da6ehaJF.js +0 -1101
- package/dist/app-Chj8x632.js +0 -67206
- package/dist/is-linked-ingredient-error-C6AghEwR.js +0 -37
- package/dist/purchase-order-transaction-type-DpZQe_jA.js +0 -299
- package/dist/supplier-dG_APcwB.js +0 -54
|
@@ -0,0 +1,1437 @@
|
|
|
1
|
+
import { reactive as qe, onMounted as Le, computed as F, h as B, getCurrentInstance as Be, watch as Ae, defineComponent as se, openBlock as T, createElementBlock as A, Fragment as ve, renderList as Fe, createElementVNode as d, toDisplayString as D, unref as e, resolveComponent as P, createVNode as C, withCtx as V, createCommentVNode as Z, ref as M, createBlock as N, normalizeClass as Pe, normalizeStyle as Ze, isRef as ie } from "vue";
|
|
2
|
+
import { useBreakpoints as Ke, components as re, FmButtonVariant as Qe, useSnackbar as De, useDialog as Ge, useProxiedModel as Je } from "@feedmepos/ui-library";
|
|
3
|
+
import { F as fe } from "./row-action.enum-PMKMRrZR.js";
|
|
4
|
+
import { P as I, e as Ne, d as Xe } from "./format-unit-display-D_Z4TNZd.js";
|
|
5
|
+
import { a as H, t as et, a5 as Ie, D as tt, b as He, R as Ue, a2 as st, a3 as ot, r as Me, a4 as nt, G as ze, l as at, A as ke, M as lt, a6 as je, c as rt, a9 as it, O as Ve, P as $e, aa as ut, j as Re, ab as dt, u as Oe, ac as ct, ad as pt, ae as mt, E as ft, af as yt, y as vt } from "./app-BLzTa0Ut.js";
|
|
6
|
+
import { _ as We, u as bt } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-2Ady4pB4.js";
|
|
7
|
+
import { useI18n as de } from "@feedmepos/mf-common";
|
|
8
|
+
import "vue-router";
|
|
9
|
+
import { u as he } from "./supplier-BZ6HZcYB.js";
|
|
10
|
+
import { F as ue, _ as gt } from "./layout-B9sdKjL9.js";
|
|
11
|
+
import { _ as _t } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
12
|
+
function te(s, m, l, r) {
|
|
13
|
+
var a, _, b;
|
|
14
|
+
if (r != null && r.manualTotalCost)
|
|
15
|
+
return r == null ? void 0 : r.manualTotalCost;
|
|
16
|
+
const f = (b = (_ = (a = r == null ? void 0 : r.supplier) == null ? void 0 : a.supplyItems) == null ? void 0 : _.find(
|
|
17
|
+
(k) => k.skuId === s._id
|
|
18
|
+
)) == null ? void 0 : b.defaultCost, t = s.defaultCost, n = f ?? t, w = n == null ? void 0 : n.costPerUnit, p = w ? n != null && n.measurement ? +H(w) / +H(n == null ? void 0 : n.measurement.conversion) : +H(w) : void 0, o = p ? l ? p * +H(l.conversion) : p : void 0, i = o ? +H(m) * o : void 0;
|
|
19
|
+
return i ? {
|
|
20
|
+
...et(i ?? 0, 2),
|
|
21
|
+
currency: Ie()
|
|
22
|
+
} : {
|
|
23
|
+
amount: 0,
|
|
24
|
+
precision: 0,
|
|
25
|
+
currency: Ie()
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
var U = /* @__PURE__ */ ((s) => (s.Code = "Code", s.Name = "Name", s.Amount = "Amount", s.Cost = "Cost", s.Delete = "Delete", s))(U || {});
|
|
29
|
+
const Ct = () => {
|
|
30
|
+
const { t: s } = de();
|
|
31
|
+
return B(
|
|
32
|
+
We,
|
|
33
|
+
{
|
|
34
|
+
zIndex: 50,
|
|
35
|
+
class: "whitespace-nowrap"
|
|
36
|
+
},
|
|
37
|
+
s("inventory.transfer.form.items.table.Cost", [je()])
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
function kt(s) {
|
|
41
|
+
const { t: m } = de(), l = qe({}), { breakpoints: r } = Ke(), f = He();
|
|
42
|
+
Le(() => {
|
|
43
|
+
for (const p of s.items) {
|
|
44
|
+
if (!p.totalCost)
|
|
45
|
+
continue;
|
|
46
|
+
const o = te(p.sku, p.quantity, p.measurement, {
|
|
47
|
+
supplier: s.supplier
|
|
48
|
+
}), i = p.totalCost ?? tt.reset();
|
|
49
|
+
o ? l[p.sku._id] = o.amount !== i.amount || o.precision !== i.precision : l[p.sku._id] = !0;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
function t(p) {
|
|
53
|
+
var i, u, a, _, b, k, h;
|
|
54
|
+
return !!(((u = (i = p.defaultCost) == null ? void 0 : i.costPerUnit) == null ? void 0 : u.amount) ?? ((h = (k = (b = (_ = (a = s.supplier) == null ? void 0 : a.supplyItems) == null ? void 0 : _.find((S) => S.skuId === p._id)) == null ? void 0 : b.defaultCost) == null ? void 0 : k.costPerUnit) == null ? void 0 : h.amount));
|
|
55
|
+
}
|
|
56
|
+
const n = [
|
|
57
|
+
{
|
|
58
|
+
id: "Code",
|
|
59
|
+
header: () => m("inventory.transfer.form.items.table.Code"),
|
|
60
|
+
accessorKey: "code",
|
|
61
|
+
size: 96,
|
|
62
|
+
cell(p) {
|
|
63
|
+
const o = p.row.original;
|
|
64
|
+
return B(re.FmTextField, {
|
|
65
|
+
modelValue: o.code,
|
|
66
|
+
"onUpdate:modelValue": (i) => {
|
|
67
|
+
s.updateItem({
|
|
68
|
+
...o,
|
|
69
|
+
code: i
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
key: o.sku._id,
|
|
73
|
+
rules: [Ue()],
|
|
74
|
+
labelMark: "required"
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
enableSorting: !1
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "Name",
|
|
81
|
+
header: () => m("inventory.transfer.form.items.table.Name"),
|
|
82
|
+
minSize: 300,
|
|
83
|
+
cell(p) {
|
|
84
|
+
const o = p.row.original;
|
|
85
|
+
return B(re.FmTextField, {
|
|
86
|
+
modelValue: o.name,
|
|
87
|
+
"onUpdate:modelValue": (i) => {
|
|
88
|
+
s.updateItem({
|
|
89
|
+
...o,
|
|
90
|
+
name: i
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
key: o.sku._id,
|
|
94
|
+
rules: [Ue()],
|
|
95
|
+
labelMark: "required"
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
enableSorting: !1
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "Amount",
|
|
102
|
+
header: () => m("inventory.transfer.form.items.table.Amount"),
|
|
103
|
+
minSize: 200,
|
|
104
|
+
cell(p) {
|
|
105
|
+
var u, a, _;
|
|
106
|
+
const o = p.row.original, i = (_ = (a = (u = s.template) == null ? void 0 : u.purchaseOrder) == null ? void 0 : a.items) == null ? void 0 : _.find(
|
|
107
|
+
(b) => b.sku._id === o.sku._id
|
|
108
|
+
);
|
|
109
|
+
return B(st, {
|
|
110
|
+
style: {
|
|
111
|
+
flex: "1 1 0%"
|
|
112
|
+
},
|
|
113
|
+
modelValue: {
|
|
114
|
+
amount: o.quantity ?? { amount: 1, precision: 0 },
|
|
115
|
+
measurement: o.measurement ?? null
|
|
116
|
+
},
|
|
117
|
+
key: o.sku._id,
|
|
118
|
+
unit: o.sku.unit,
|
|
119
|
+
"onUpdate:modelValue": (b) => {
|
|
120
|
+
const k = {
|
|
121
|
+
...o,
|
|
122
|
+
quantity: b.amount,
|
|
123
|
+
measurement: b.measurement
|
|
124
|
+
};
|
|
125
|
+
f.enableTotalCost && (k.totalCost = te(o.sku, o.quantity, o.measurement, {
|
|
126
|
+
supplier: s.supplier,
|
|
127
|
+
// NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
|
|
128
|
+
// will return the auto calculated default cost instead of the manual total cost
|
|
129
|
+
manualTotalCost: l[o.sku._id] ? k.totalCost : void 0
|
|
130
|
+
})), s.updateItem(k);
|
|
131
|
+
},
|
|
132
|
+
stepper: i == null ? void 0 : i.quantityStep,
|
|
133
|
+
disableUnit: !!i,
|
|
134
|
+
disabled: s.disabled,
|
|
135
|
+
rules: [
|
|
136
|
+
ot(
|
|
137
|
+
+H(
|
|
138
|
+
(i == null ? void 0 : i.minimumQuantity) ?? {
|
|
139
|
+
amount: 1,
|
|
140
|
+
precision: Me(o.sku.unit, o.measurement)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
),
|
|
144
|
+
nt(
|
|
145
|
+
+H(
|
|
146
|
+
(i == null ? void 0 : i.maximumQuantity) ?? {
|
|
147
|
+
amount: 1,
|
|
148
|
+
precision: Me(o.sku.unit, o.measurement)
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
)
|
|
152
|
+
],
|
|
153
|
+
applyDefaultRules: !0
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
enableSorting: !1
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: "Cost",
|
|
160
|
+
header: Ct,
|
|
161
|
+
size: 180,
|
|
162
|
+
cell(p) {
|
|
163
|
+
const o = p.row.original, i = t(o.sku), u = r.value.xs || r.value.sm;
|
|
164
|
+
return !l[o.sku._id] && i ? B(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
class: [
|
|
168
|
+
"flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
169
|
+
s.disabled ? "text-fm-color-typo-disabled" : ""
|
|
170
|
+
],
|
|
171
|
+
key: o.sku._id
|
|
172
|
+
},
|
|
173
|
+
[
|
|
174
|
+
B(re.FmButton, {
|
|
175
|
+
prependIcon: "edit",
|
|
176
|
+
variant: Qe.Tertiary,
|
|
177
|
+
disabled: s.disabled,
|
|
178
|
+
onClick() {
|
|
179
|
+
s.updateItem({
|
|
180
|
+
...o,
|
|
181
|
+
totalCost: te(o.sku, o.quantity, o.measurement, {
|
|
182
|
+
supplier: s.supplier
|
|
183
|
+
})
|
|
184
|
+
}), l[o.sku._id] = !0;
|
|
185
|
+
}
|
|
186
|
+
}),
|
|
187
|
+
B(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
class: "flex flex-col"
|
|
191
|
+
},
|
|
192
|
+
[
|
|
193
|
+
B(
|
|
194
|
+
"span",
|
|
195
|
+
u ? ze(
|
|
196
|
+
te(o.sku, o.quantity, o.measurement, {
|
|
197
|
+
supplier: s.supplier
|
|
198
|
+
})
|
|
199
|
+
) : H(
|
|
200
|
+
te(o.sku, o.quantity, o.measurement, {
|
|
201
|
+
supplier: s.supplier
|
|
202
|
+
})
|
|
203
|
+
)
|
|
204
|
+
),
|
|
205
|
+
B(
|
|
206
|
+
"span",
|
|
207
|
+
{
|
|
208
|
+
class: [
|
|
209
|
+
"fm-typo-en-body-sm-400",
|
|
210
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
m("inventory.transfer.form.items.autoCalculated")
|
|
214
|
+
)
|
|
215
|
+
]
|
|
216
|
+
)
|
|
217
|
+
]
|
|
218
|
+
) : B(
|
|
219
|
+
re.FmTextField,
|
|
220
|
+
{
|
|
221
|
+
modelValue: H(o.totalCost ?? { amount: 0, precision: 0 }),
|
|
222
|
+
key: o.sku._id,
|
|
223
|
+
"onUpdate:modelValue": (a) => {
|
|
224
|
+
s.updateItem({
|
|
225
|
+
...o,
|
|
226
|
+
totalCost: {
|
|
227
|
+
...at(+a),
|
|
228
|
+
currency: Ie()
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
rules: [ke(0), lt(2)]
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
prepend() {
|
|
236
|
+
return u ? B(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
class: [
|
|
240
|
+
"text-fm-typo-en-body-lg-400",
|
|
241
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
je()
|
|
245
|
+
) : null;
|
|
246
|
+
},
|
|
247
|
+
append() {
|
|
248
|
+
return i ? B(re.FmButton, {
|
|
249
|
+
prependIcon: "close",
|
|
250
|
+
variant: "tertiary",
|
|
251
|
+
disabled: s.disabled,
|
|
252
|
+
onClick() {
|
|
253
|
+
s.updateItem({
|
|
254
|
+
...o,
|
|
255
|
+
// NOTE: different from PO template, if a default cost is reenabled,
|
|
256
|
+
// the total cost will automatically assigned
|
|
257
|
+
totalCost: te(o.sku, o.quantity, o.measurement, {
|
|
258
|
+
supplier: s.supplier
|
|
259
|
+
})
|
|
260
|
+
}), l[o.sku._id] = !1;
|
|
261
|
+
}
|
|
262
|
+
}) : null;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
},
|
|
267
|
+
enableSorting: !1
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
id: "Delete",
|
|
271
|
+
header: "",
|
|
272
|
+
cell(p) {
|
|
273
|
+
const o = p.row.original;
|
|
274
|
+
return B(re.FmButton, {
|
|
275
|
+
key: o.sku._id,
|
|
276
|
+
class: "delete-button",
|
|
277
|
+
type: "button",
|
|
278
|
+
icon: "delete",
|
|
279
|
+
variant: "tertiary",
|
|
280
|
+
size: "md",
|
|
281
|
+
disabled: s.disabled,
|
|
282
|
+
onClick: () => {
|
|
283
|
+
s.deleteItem(o);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
},
|
|
287
|
+
enableSorting: !1,
|
|
288
|
+
size: 40,
|
|
289
|
+
meta: {
|
|
290
|
+
cellClass: "",
|
|
291
|
+
headerClass: ""
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
];
|
|
295
|
+
return {
|
|
296
|
+
columnDefs: F(() => f.enableTotalCost && s.transferType === I.PURCHASE ? n : n.filter(
|
|
297
|
+
(p) => p.id !== "Cost"
|
|
298
|
+
/* Cost */
|
|
299
|
+
))
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function ht(s = "modelValue") {
|
|
303
|
+
var t, n;
|
|
304
|
+
const m = ((t = Be()) == null ? void 0 : t.props) ?? {}, l = ((n = Be()) == null ? void 0 : n.emit) ?? (() => {
|
|
305
|
+
}), r = qe(rt(m[s] ?? {})), f = `update:${it(s)}`;
|
|
306
|
+
return Ae(r, (w) => {
|
|
307
|
+
l(f, w);
|
|
308
|
+
}), r;
|
|
309
|
+
}
|
|
310
|
+
const wt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, xt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, St = { class: "w-[450px] xs:w-full flex" }, Tt = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Ft = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ se({
|
|
311
|
+
__name: "SupplierPriceHistory",
|
|
312
|
+
props: {
|
|
313
|
+
prices: {}
|
|
314
|
+
},
|
|
315
|
+
setup(s) {
|
|
316
|
+
const m = he();
|
|
317
|
+
function l(r) {
|
|
318
|
+
return m.suppliers.find((f) => f._id === r);
|
|
319
|
+
}
|
|
320
|
+
return (r, f) => (T(), A("div", wt, [
|
|
321
|
+
(T(!0), A(ve, null, Fe(Object.keys(r.prices), (t) => {
|
|
322
|
+
var n;
|
|
323
|
+
return T(), A("div", {
|
|
324
|
+
key: t,
|
|
325
|
+
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
326
|
+
}, [
|
|
327
|
+
d("div", xt, D((n = l(t)) == null ? void 0 : n.name), 1),
|
|
328
|
+
d("div", St, [
|
|
329
|
+
(T(!0), A(ve, null, Fe(r.prices[t].slice(0, 3), (w) => {
|
|
330
|
+
var p;
|
|
331
|
+
return T(), A("div", {
|
|
332
|
+
key: w.date,
|
|
333
|
+
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
334
|
+
}, [
|
|
335
|
+
d("div", Tt, [
|
|
336
|
+
d("span", null, D(w.totalCost ? e(ze)(w.totalCost) : "No data"), 1),
|
|
337
|
+
f[0] || (f[0] = d("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
338
|
+
d("span", null, D(e(H)(w.totalUnit, !1)), 1),
|
|
339
|
+
d("span", null, D(((p = w.measurement) == null ? void 0 : p.abbrev) ?? w.unit.abbrev), 1)
|
|
340
|
+
]),
|
|
341
|
+
d("div", Ft, [
|
|
342
|
+
d("span", null, "(#" + D(w.seqNumber) + ")", 1),
|
|
343
|
+
f[1] || (f[1] = d("span", null, D(" "), -1)),
|
|
344
|
+
d("span", null, D(e(Ve)(new Date(w.date))), 1)
|
|
345
|
+
])
|
|
346
|
+
]);
|
|
347
|
+
}), 128))
|
|
348
|
+
])
|
|
349
|
+
]);
|
|
350
|
+
}), 128))
|
|
351
|
+
]));
|
|
352
|
+
}
|
|
353
|
+
}), Pt = { class: "flex flex-col gap-8 py-16" }, It = { class: "flex items-center" }, $t = { class: "flex-1 flex gap-1 items-center" }, At = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Dt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Vt = { class: "flex gap-8 w-full" }, Rt = { class: "flex-1 flex flex-col gap-4" }, Ot = { class: "flex-1 flex flex-col gap-4" }, Bt = { class: "flex gap-8 w-full" }, Ut = { class: "flex-1 flex flex-col gap-4" }, Mt = { class: "flex-1 flex flex-col gap-4" }, Et = /* @__PURE__ */ se({
|
|
354
|
+
__name: "TransferItem",
|
|
355
|
+
props: {
|
|
356
|
+
cellByColId: {},
|
|
357
|
+
comparePriceBySku: {},
|
|
358
|
+
showComparePrice: { type: Boolean },
|
|
359
|
+
row: {}
|
|
360
|
+
},
|
|
361
|
+
setup(s) {
|
|
362
|
+
const { t: m } = de();
|
|
363
|
+
return (l, r) => {
|
|
364
|
+
var n, w, p, o, i, u, a, _, b, k, h, S, K, E, J, R, z, Q, q, L, G, v, g, O, oe, j, we;
|
|
365
|
+
const f = P("FmLabel"), t = P("FmSpacer");
|
|
366
|
+
return T(), A("div", Pt, [
|
|
367
|
+
d("div", It, [
|
|
368
|
+
d("div", $t, [
|
|
369
|
+
d("span", At, " (" + D(l.row.original.sku.code) + ") ", 1),
|
|
370
|
+
d("span", Dt, D(l.row.original.sku.name), 1)
|
|
371
|
+
]),
|
|
372
|
+
d("div", null, [
|
|
373
|
+
C(e(ue), {
|
|
374
|
+
render: (p = (w = (n = l.cellByColId.Delete) == null ? void 0 : n.column) == null ? void 0 : w.columnDef) == null ? void 0 : p.cell,
|
|
375
|
+
props: (i = (o = l.cellByColId.Delete) == null ? void 0 : o.getContext) == null ? void 0 : i.call(o)
|
|
376
|
+
}, null, 8, ["render", "props"])
|
|
377
|
+
])
|
|
378
|
+
]),
|
|
379
|
+
d("div", Vt, [
|
|
380
|
+
d("div", Rt, [
|
|
381
|
+
C(f, {
|
|
382
|
+
label: e(m)(`inventory.transfer.form.items.table.${e(U).Code}`)
|
|
383
|
+
}, null, 8, ["label"]),
|
|
384
|
+
C(e(ue), {
|
|
385
|
+
render: (_ = (a = (u = l.cellByColId[e(U).Code]) == null ? void 0 : u.column) == null ? void 0 : a.columnDef) == null ? void 0 : _.cell,
|
|
386
|
+
props: (k = (b = l.cellByColId[e(U).Code]) == null ? void 0 : b.getContext) == null ? void 0 : k.call(b)
|
|
387
|
+
}, null, 8, ["render", "props"]),
|
|
388
|
+
r[0] || (r[0] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
389
|
+
]),
|
|
390
|
+
d("div", Ot, [
|
|
391
|
+
C(f, {
|
|
392
|
+
label: e(m)(`inventory.transfer.form.items.table.${e(U).Name}`)
|
|
393
|
+
}, null, 8, ["label"]),
|
|
394
|
+
C(e(ue), {
|
|
395
|
+
render: (K = (S = (h = l.cellByColId[e(U).Name]) == null ? void 0 : h.column) == null ? void 0 : S.columnDef) == null ? void 0 : K.cell,
|
|
396
|
+
props: (J = (E = l.cellByColId[e(U).Name]) == null ? void 0 : E.getContext) == null ? void 0 : J.call(E)
|
|
397
|
+
}, null, 8, ["render", "props"]),
|
|
398
|
+
r[1] || (r[1] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
399
|
+
])
|
|
400
|
+
]),
|
|
401
|
+
d("div", Bt, [
|
|
402
|
+
d("div", Ut, [
|
|
403
|
+
C(f, {
|
|
404
|
+
label: e(m)(`inventory.transfer.form.items.table.${e(U).Amount}`)
|
|
405
|
+
}, null, 8, ["label"]),
|
|
406
|
+
C(e(ue), {
|
|
407
|
+
render: (Q = (z = (R = l.cellByColId[e(U).Amount]) == null ? void 0 : R.column) == null ? void 0 : z.columnDef) == null ? void 0 : Q.cell,
|
|
408
|
+
props: (L = (q = l.cellByColId[e(U).Amount]) == null ? void 0 : q.getContext) == null ? void 0 : L.call(q)
|
|
409
|
+
}, null, 8, ["render", "props"]),
|
|
410
|
+
r[2] || (r[2] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
411
|
+
]),
|
|
412
|
+
d("div", Mt, [
|
|
413
|
+
C(We, { "z-index": 50 }, {
|
|
414
|
+
default: V(() => [
|
|
415
|
+
C(f, {
|
|
416
|
+
label: e(m)(`inventory.transfer.form.items.table.${e(U).Cost}2`)
|
|
417
|
+
}, null, 8, ["label"])
|
|
418
|
+
]),
|
|
419
|
+
_: 1
|
|
420
|
+
}),
|
|
421
|
+
C(e(ue), {
|
|
422
|
+
render: (g = (v = (G = l.cellByColId[e(U).Cost]) == null ? void 0 : G.column) == null ? void 0 : v.columnDef) == null ? void 0 : g.cell,
|
|
423
|
+
props: (oe = (O = l.cellByColId[e(U).Cost]) == null ? void 0 : O.getContext) == null ? void 0 : oe.call(O)
|
|
424
|
+
}, null, 8, ["render", "props"]),
|
|
425
|
+
r[3] || (r[3] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
426
|
+
])
|
|
427
|
+
]),
|
|
428
|
+
l.showComparePrice && Object.keys(l.comparePriceBySku[(j = l.row.original.sku) == null ? void 0 : j._id] ?? {}).length > 0 ? (T(), A(ve, { key: 0 }, [
|
|
429
|
+
C(t, { class: "h-8" }),
|
|
430
|
+
C(Ye, {
|
|
431
|
+
prices: l.comparePriceBySku[(we = l.row.original.sku) == null ? void 0 : we._id]
|
|
432
|
+
}, null, 8, ["prices"])
|
|
433
|
+
], 64)) : Z("", !0)
|
|
434
|
+
]);
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
function ye(s) {
|
|
439
|
+
return ut.parse(s);
|
|
440
|
+
}
|
|
441
|
+
function Ce(s) {
|
|
442
|
+
return {
|
|
443
|
+
_id: s.doc._id,
|
|
444
|
+
internal: s.type,
|
|
445
|
+
contactName: s.doc.profile.name,
|
|
446
|
+
name: s.doc.profile.name,
|
|
447
|
+
email: s.doc.profile.email,
|
|
448
|
+
phoneNumber: s.doc.profile.phoneNo,
|
|
449
|
+
registrationNumber: s.doc.profile.regNo,
|
|
450
|
+
address: s.doc.profile.address
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function qt(s, m) {
|
|
454
|
+
const l = he(), r = Re();
|
|
455
|
+
r.watchLocation(async () => {
|
|
456
|
+
await l.readSuppliers();
|
|
457
|
+
const u = s();
|
|
458
|
+
if (u.supplier._id) return;
|
|
459
|
+
const a = l.suppliers[0], _ = r.locations[0];
|
|
460
|
+
m({
|
|
461
|
+
...u,
|
|
462
|
+
supplier: a ? ye(a) : _ ? Ce(_) : u.supplier
|
|
463
|
+
});
|
|
464
|
+
});
|
|
465
|
+
const f = F(
|
|
466
|
+
() => {
|
|
467
|
+
var u, a;
|
|
468
|
+
return typeof ((a = (u = s()) == null ? void 0 : u.supplier) == null ? void 0 : a.internal) == "string" ? I.TRANSFER : I.PURCHASE;
|
|
469
|
+
}
|
|
470
|
+
), t = F({
|
|
471
|
+
get() {
|
|
472
|
+
var u, a;
|
|
473
|
+
return (a = (u = s()) == null ? void 0 : u.supplier) == null ? void 0 : a._id;
|
|
474
|
+
},
|
|
475
|
+
set(u) {
|
|
476
|
+
const a = s() ?? {};
|
|
477
|
+
if (f.value === I.PURCHASE) {
|
|
478
|
+
const k = l.suppliers.find((h) => h._id === u);
|
|
479
|
+
m({
|
|
480
|
+
...a,
|
|
481
|
+
supplier: k ? ye(k) : a.supplier
|
|
482
|
+
});
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
const b = r.locations.find((k) => k.doc._id === u);
|
|
486
|
+
m({
|
|
487
|
+
...a,
|
|
488
|
+
supplier: b ? Ce(b) : a.supplier
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
}), n = F(() => l.locationSuppliers.map(ye)), w = F(() => l.businessSuppliers.map(ye)), p = F(() => {
|
|
492
|
+
var a;
|
|
493
|
+
const u = ((a = r._currentLocation) == null ? void 0 : a.type) === $e.warehouse;
|
|
494
|
+
return r.locations.filter((_) => {
|
|
495
|
+
var k;
|
|
496
|
+
return !(_.dbName === ((k = r._currentLocation) == null ? void 0 : k.dbName)) && (!u || _.type === $e.warehouse) && _.acceptRequest;
|
|
497
|
+
}).map(Ce);
|
|
498
|
+
}), o = F(() => {
|
|
499
|
+
if (f.value === I.PURCHASE) {
|
|
500
|
+
const a = n.value.map((b) => ({
|
|
501
|
+
label: b.name,
|
|
502
|
+
value: b._id
|
|
503
|
+
})), _ = w.value.map((b) => ({
|
|
504
|
+
label: b.name,
|
|
505
|
+
sublabel: "Business supplier",
|
|
506
|
+
value: b._id
|
|
507
|
+
}));
|
|
508
|
+
return [...a, ..._];
|
|
509
|
+
}
|
|
510
|
+
return p.value.map((a) => ({
|
|
511
|
+
label: a.name,
|
|
512
|
+
sublabel: a.internal ? `${a.internal}` : void 0,
|
|
513
|
+
value: a._id
|
|
514
|
+
}));
|
|
515
|
+
}), i = F(() => {
|
|
516
|
+
var b, k;
|
|
517
|
+
const u = (k = (b = s()) == null ? void 0 : b.supplier) == null ? void 0 : k._id;
|
|
518
|
+
if (f.value === I.PURCHASE) {
|
|
519
|
+
const h = l.suppliers.find((S) => S._id === u);
|
|
520
|
+
return h ? ye(h) : null;
|
|
521
|
+
}
|
|
522
|
+
const _ = r.locations.find((h) => h.doc._id);
|
|
523
|
+
return _ ? Ce(_) : null;
|
|
524
|
+
});
|
|
525
|
+
return {
|
|
526
|
+
transferLocationModel: t,
|
|
527
|
+
transferLocationOptions: o,
|
|
528
|
+
locationOptionsTypePurchase: n,
|
|
529
|
+
locationOptionsTypeTransfer: p,
|
|
530
|
+
selectedLocation: i
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function Lt(s) {
|
|
534
|
+
const m = F({
|
|
535
|
+
get() {
|
|
536
|
+
const t = s.getEffectiveAt();
|
|
537
|
+
return t ? new Date(t) : null;
|
|
538
|
+
},
|
|
539
|
+
set(t) {
|
|
540
|
+
s.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
|
|
541
|
+
}
|
|
542
|
+
}), l = F({
|
|
543
|
+
get() {
|
|
544
|
+
return !!m.value;
|
|
545
|
+
},
|
|
546
|
+
set(t) {
|
|
547
|
+
t ? m.value = /* @__PURE__ */ new Date() : m.value = null;
|
|
548
|
+
}
|
|
549
|
+
}), r = F({
|
|
550
|
+
get() {
|
|
551
|
+
return m.value === null ? "" : Ve(m.value);
|
|
552
|
+
},
|
|
553
|
+
set(t) {
|
|
554
|
+
t ? m.value = /* @__PURE__ */ new Date(`${t} ${f.value}`) : m.value = null;
|
|
555
|
+
}
|
|
556
|
+
}), f = F({
|
|
557
|
+
get() {
|
|
558
|
+
return m.value === null ? "" : dt(m.value);
|
|
559
|
+
},
|
|
560
|
+
set(t) {
|
|
561
|
+
t ? m.value = /* @__PURE__ */ new Date(`${r.value} ${t}`) : m.value = null;
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
return {
|
|
565
|
+
backdatePo: m,
|
|
566
|
+
backdateSwitch: l,
|
|
567
|
+
backdateModel: r,
|
|
568
|
+
backdateTimeModel: f
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
const Nt = {
|
|
572
|
+
width: "24",
|
|
573
|
+
height: "24",
|
|
574
|
+
viewBox: "0 0 24 24",
|
|
575
|
+
fill: "none",
|
|
576
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
577
|
+
}, Ht = ["fill"], zt = ["fill"], jt = ["stroke"], Wt = ["stroke"], Yt = /* @__PURE__ */ se({
|
|
578
|
+
__name: "SparkIcon",
|
|
579
|
+
props: {
|
|
580
|
+
size: {
|
|
581
|
+
type: Number,
|
|
582
|
+
default: 24
|
|
583
|
+
},
|
|
584
|
+
color: {
|
|
585
|
+
type: String,
|
|
586
|
+
default: "#c7c7cc"
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
setup(s) {
|
|
590
|
+
return (m, l) => (T(), A("svg", Nt, [
|
|
591
|
+
d("path", {
|
|
592
|
+
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
593
|
+
fill: s.color
|
|
594
|
+
}, null, 8, Ht),
|
|
595
|
+
d("path", {
|
|
596
|
+
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
597
|
+
fill: s.color
|
|
598
|
+
}, null, 8, zt),
|
|
599
|
+
d("path", {
|
|
600
|
+
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
601
|
+
stroke: s.color,
|
|
602
|
+
"stroke-width": "1.5",
|
|
603
|
+
"stroke-linecap": "round",
|
|
604
|
+
"stroke-linejoin": "round"
|
|
605
|
+
}, null, 8, jt),
|
|
606
|
+
d("path", {
|
|
607
|
+
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
608
|
+
stroke: s.color,
|
|
609
|
+
"stroke-width": "1.5",
|
|
610
|
+
"stroke-linecap": "round",
|
|
611
|
+
"stroke-linejoin": "round"
|
|
612
|
+
}, null, 8, Wt)
|
|
613
|
+
]));
|
|
614
|
+
}
|
|
615
|
+
}), Zt = { class: "flex gap-8 items-center" }, Kt = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Qt = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Gt = { class: "flex items-center w-full" }, Jt = { class: "flex-1" }, Xt = { class: "fm-typo-en-title-sm-800" }, es = { class: "flex items-start gap-8" }, ts = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ss = { class: "flex gap-1" }, Ee = /* @__PURE__ */ se({
|
|
616
|
+
__name: "ForecastStock",
|
|
617
|
+
props: {
|
|
618
|
+
disabled: { type: Boolean }
|
|
619
|
+
},
|
|
620
|
+
emits: ["update:poItems"],
|
|
621
|
+
setup(s, { emit: m }) {
|
|
622
|
+
const l = m, r = M(!1), f = M(7), t = bt(), n = De(), w = Oe(), { t: p } = de();
|
|
623
|
+
async function o() {
|
|
624
|
+
if (f.value < 1)
|
|
625
|
+
return;
|
|
626
|
+
r.value = !1, await t.readPurchaseOrder(f.value);
|
|
627
|
+
const i = [];
|
|
628
|
+
if (t.purchaseOrderForecast.skus.length <= 0) {
|
|
629
|
+
n.open({
|
|
630
|
+
message: p("inventory.transfer.form.items.forecastStock.notAvailable"),
|
|
631
|
+
type: "info"
|
|
632
|
+
});
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
const u = t.purchaseOrderForecast.skus.reduce((a, _) => {
|
|
636
|
+
const b = w.skus.find((S) => S._id === _.id);
|
|
637
|
+
if (a.find((S) => S.sku._id === _.id) || !b)
|
|
638
|
+
return a;
|
|
639
|
+
const h = {
|
|
640
|
+
sku: b,
|
|
641
|
+
code: b.code,
|
|
642
|
+
name: b.name,
|
|
643
|
+
quantity: {
|
|
644
|
+
amount: _.amount,
|
|
645
|
+
precision: 0
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
return a.push(h), a;
|
|
649
|
+
}, i);
|
|
650
|
+
l("update:poItems", u);
|
|
651
|
+
}
|
|
652
|
+
return (i, u) => {
|
|
653
|
+
const a = P("FmButton"), _ = P("FmIcon"), b = P("FmStepperField"), k = P("FmPopover");
|
|
654
|
+
return T(), N(k, {
|
|
655
|
+
disabled: i.disabled,
|
|
656
|
+
class: "flex",
|
|
657
|
+
"show-popover": r.value,
|
|
658
|
+
onPopoverChanged: u[3] || (u[3] = (h) => r.value = h)
|
|
659
|
+
}, {
|
|
660
|
+
"popover-button": V(() => [
|
|
661
|
+
C(a, {
|
|
662
|
+
label: "unused",
|
|
663
|
+
variant: "secondary",
|
|
664
|
+
"text-color": i.disabled ? "disabled" : "primary",
|
|
665
|
+
"bg-color": "transparent",
|
|
666
|
+
"border-color": i.disabled ? "disabled" : "primary",
|
|
667
|
+
disabled: i.disabled
|
|
668
|
+
}, {
|
|
669
|
+
default: V(() => [
|
|
670
|
+
d("div", Zt, [
|
|
671
|
+
C(Yt, {
|
|
672
|
+
size: 24,
|
|
673
|
+
color: i.disabled ? "#c7c7cc" : "#ff7823"
|
|
674
|
+
}, null, 8, ["color"]),
|
|
675
|
+
d("div", Kt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
676
|
+
])
|
|
677
|
+
]),
|
|
678
|
+
_: 1
|
|
679
|
+
}, 8, ["text-color", "border-color", "disabled"])
|
|
680
|
+
]),
|
|
681
|
+
default: V(() => [
|
|
682
|
+
d("div", Qt, [
|
|
683
|
+
d("div", Gt, [
|
|
684
|
+
d("div", Jt, [
|
|
685
|
+
C(_t, { "z-index": 99 }, {
|
|
686
|
+
default: V(() => [
|
|
687
|
+
d("p", Xt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
688
|
+
]),
|
|
689
|
+
_: 1
|
|
690
|
+
})
|
|
691
|
+
]),
|
|
692
|
+
C(a, {
|
|
693
|
+
icon: "close",
|
|
694
|
+
size: "md",
|
|
695
|
+
variant: "tertiary",
|
|
696
|
+
onClick: u[0] || (u[0] = (h) => r.value = !1)
|
|
697
|
+
})
|
|
698
|
+
]),
|
|
699
|
+
C(b, {
|
|
700
|
+
modelValue: f.value,
|
|
701
|
+
"onUpdate:modelValue": u[1] || (u[1] = (h) => f.value = h),
|
|
702
|
+
label: e(p)("inventory.transfer.form.items.forecastStock.days"),
|
|
703
|
+
rules: [e(ke)(1)]
|
|
704
|
+
}, {
|
|
705
|
+
"helper-text": V(() => [
|
|
706
|
+
d("div", es, [
|
|
707
|
+
C(_, {
|
|
708
|
+
name: "warning",
|
|
709
|
+
size: "sm",
|
|
710
|
+
class: "text-fm-color-system-warning-300"
|
|
711
|
+
}),
|
|
712
|
+
d("div", ts, D(e(p)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
713
|
+
])
|
|
714
|
+
]),
|
|
715
|
+
_: 1
|
|
716
|
+
}, 8, ["modelValue", "label", "rules"]),
|
|
717
|
+
d("div", ss, [
|
|
718
|
+
u[4] || (u[4] = d("div", { class: "grow" }, null, -1)),
|
|
719
|
+
C(a, {
|
|
720
|
+
label: e(p)("common.cancel"),
|
|
721
|
+
variant: "tertiary",
|
|
722
|
+
onClick: u[2] || (u[2] = (h) => r.value = !1)
|
|
723
|
+
}, null, 8, ["label"]),
|
|
724
|
+
C(a, {
|
|
725
|
+
label: e(p)("inventory.transfer.form.items.forecastStock.generate"),
|
|
726
|
+
onClick: o
|
|
727
|
+
}, null, 8, ["label"])
|
|
728
|
+
])
|
|
729
|
+
])
|
|
730
|
+
]),
|
|
731
|
+
_: 1
|
|
732
|
+
}, 8, ["disabled", "show-popover"]);
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
function os() {
|
|
737
|
+
const s = De(), m = Ne(), l = M(!1);
|
|
738
|
+
Ae(l, (n) => {
|
|
739
|
+
n && (f.value = !0, r().finally(() => {
|
|
740
|
+
f.value = !1;
|
|
741
|
+
}));
|
|
742
|
+
});
|
|
743
|
+
async function r() {
|
|
744
|
+
try {
|
|
745
|
+
const { startDate: n, endDate: w } = ct(6), i = (await m.getPurchaseOrders({ start: n, end: w })).filter(
|
|
746
|
+
(u) => {
|
|
747
|
+
var a, _;
|
|
748
|
+
return u.status === pt.enum.COMPLETE && ((a = u.supplier) == null ? void 0 : a.internal) !== "warehouse" && ((_ = u.supplier) == null ? void 0 : _.internal) !== "restaurant";
|
|
749
|
+
}
|
|
750
|
+
).reduce((u, a) => {
|
|
751
|
+
const _ = new Date(mt(a._id)), b = a.supplier._id;
|
|
752
|
+
for (const k of a.items) {
|
|
753
|
+
if (!k.totalCost) continue;
|
|
754
|
+
const h = u[k.sku._id] ?? {}, S = h[b] ?? [];
|
|
755
|
+
S.push({
|
|
756
|
+
date: _.toISOString(),
|
|
757
|
+
totalUnit: k.quantity,
|
|
758
|
+
totalCost: k.totalCost,
|
|
759
|
+
unit: k.sku.unit,
|
|
760
|
+
measurement: k.measurement,
|
|
761
|
+
seqNumber: a.seqNumber
|
|
762
|
+
}), h[b] = S, u[k.sku._id] = h;
|
|
763
|
+
}
|
|
764
|
+
return u;
|
|
765
|
+
}, {});
|
|
766
|
+
t.value = i;
|
|
767
|
+
} catch {
|
|
768
|
+
s.open({
|
|
769
|
+
title: "Something went wrong",
|
|
770
|
+
message: "Cannot retrieve supplier purchase history. Please try again."
|
|
771
|
+
}), l.value = !1;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
const f = M(!1), t = M({});
|
|
775
|
+
return {
|
|
776
|
+
comparePricesToggle: l,
|
|
777
|
+
comparePriceFetching: f,
|
|
778
|
+
comparePriceBySku: t
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }, ls = ["colspan"], rs = /* @__PURE__ */ se({
|
|
782
|
+
__name: "TransferItemTable",
|
|
783
|
+
props: {
|
|
784
|
+
row: {},
|
|
785
|
+
comparePriceBySku: {},
|
|
786
|
+
showComparePrice: { type: Boolean }
|
|
787
|
+
},
|
|
788
|
+
setup(s) {
|
|
789
|
+
function m(l) {
|
|
790
|
+
return l.column.columnDef.meta;
|
|
791
|
+
}
|
|
792
|
+
return (l, r) => {
|
|
793
|
+
var f, t;
|
|
794
|
+
return T(), A(ve, null, [
|
|
795
|
+
d("tr", {
|
|
796
|
+
class: Pe(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
797
|
+
"bg-fm-color-neutral-gray-100": l.row.getIsSelected()
|
|
798
|
+
}])
|
|
799
|
+
}, [
|
|
800
|
+
(T(!0), A(ve, null, Fe(l.row.getVisibleCells(), (n) => {
|
|
801
|
+
var w, p, o, i;
|
|
802
|
+
return T(), A("td", {
|
|
803
|
+
key: n.id,
|
|
804
|
+
class: Pe([
|
|
805
|
+
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
806
|
+
((w = m(n)) == null ? void 0 : w.cellClass) ?? "px-16"
|
|
807
|
+
]),
|
|
808
|
+
style: Ze({
|
|
809
|
+
width: (p = m(n)) == null ? void 0 : p.width,
|
|
810
|
+
maxWidth: (o = m(n)) == null ? void 0 : o.maxWidth,
|
|
811
|
+
textAlign: ((i = m(n)) == null ? void 0 : i.textAlign) ?? "left"
|
|
812
|
+
})
|
|
813
|
+
}, [
|
|
814
|
+
d("span", ns, [
|
|
815
|
+
C(e(ue), {
|
|
816
|
+
render: n.column.columnDef.cell,
|
|
817
|
+
props: n.getContext()
|
|
818
|
+
}, null, 8, ["render", "props"])
|
|
819
|
+
])
|
|
820
|
+
], 6);
|
|
821
|
+
}), 128))
|
|
822
|
+
], 2),
|
|
823
|
+
l.showComparePrice && Object.keys(l.comparePriceBySku[(f = l.row.original.sku) == null ? void 0 : f._id] ?? {}).length > 0 ? (T(), A("tr", as, [
|
|
824
|
+
d("td", {
|
|
825
|
+
colspan: l.row.getVisibleCells().length
|
|
826
|
+
}, [
|
|
827
|
+
C(Ye, {
|
|
828
|
+
prices: l.comparePriceBySku[(t = l.row.original.sku) == null ? void 0 : t._id]
|
|
829
|
+
}, null, 8, ["prices"])
|
|
830
|
+
], 8, ls)
|
|
831
|
+
])) : Z("", !0)
|
|
832
|
+
], 64);
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
}), is = { class: "flex flex-col gap-4" }, us = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, ds = { class: "flex flex-col gap-16" }, cs = { class: "flex flex-col gap-24" }, ps = {
|
|
836
|
+
key: 0,
|
|
837
|
+
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
|
|
838
|
+
}, ms = { class: "flex xs:flex-col sm:flex-col" }, fs = {
|
|
839
|
+
key: 0,
|
|
840
|
+
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
841
|
+
}, ys = { class: "flex-1" }, vs = { class: "flex-1" }, bs = {
|
|
842
|
+
key: 1,
|
|
843
|
+
class: "flex items-center gap-4"
|
|
844
|
+
}, gs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, _s = { class: "flex flex-col gap-16" }, Cs = { class: "flex sm:flex-col xs:flex-col gap-16 items-center xs:items-start sm:items-start" }, ks = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, hs = { class: "flex gap-8" }, ws = {
|
|
845
|
+
key: 0,
|
|
846
|
+
class: "xs:w-full"
|
|
847
|
+
}, xs = /* @__PURE__ */ se({
|
|
848
|
+
__name: "TransferForm2",
|
|
849
|
+
props: {
|
|
850
|
+
modelValue: {},
|
|
851
|
+
disabled: { type: Boolean },
|
|
852
|
+
suppliers: {},
|
|
853
|
+
skus: {},
|
|
854
|
+
lastClosingDate: {}
|
|
855
|
+
},
|
|
856
|
+
emits: ["validation-success", "form:ready"],
|
|
857
|
+
setup(s, { expose: m, emit: l }) {
|
|
858
|
+
const r = s, f = l, t = ht(), { t: n } = de(), w = Re(), p = Oe(), o = he(), i = He(), u = Xe(), a = F(
|
|
859
|
+
() => u.templates.value.find((c) => c._id === t.template)
|
|
860
|
+
), _ = F(() => t.status === "DRAFT" || !t._rev);
|
|
861
|
+
Le(async () => {
|
|
862
|
+
try {
|
|
863
|
+
if (!t.template) return;
|
|
864
|
+
await u.loadTemplate(t.template);
|
|
865
|
+
} finally {
|
|
866
|
+
f("form:ready");
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
const b = F(
|
|
870
|
+
() => w.currentLocation.type === $e.restaurant
|
|
871
|
+
);
|
|
872
|
+
w.watchLocation(async () => {
|
|
873
|
+
location && (t.supplier || (t.supplier = o.suppliers.find((c) => c) ?? t.supplier));
|
|
874
|
+
});
|
|
875
|
+
const k = Ge(), h = qt(
|
|
876
|
+
() => t,
|
|
877
|
+
(c) => {
|
|
878
|
+
Object.assign(t, c);
|
|
879
|
+
}
|
|
880
|
+
), S = F({
|
|
881
|
+
get() {
|
|
882
|
+
var c;
|
|
883
|
+
return typeof ((c = t == null ? void 0 : t.supplier) == null ? void 0 : c.internal) == "string" ? I.TRANSFER : I.PURCHASE;
|
|
884
|
+
},
|
|
885
|
+
set(c) {
|
|
886
|
+
var W;
|
|
887
|
+
const y = typeof ((W = t == null ? void 0 : t.supplier) == null ? void 0 : W.internal) == "string" ? I.TRANSFER : I.PURCHASE;
|
|
888
|
+
c !== y && (t.supplier = c === I.PURCHASE ? h.locationOptionsTypePurchase.value[0] : h.locationOptionsTypeTransfer.value[0]);
|
|
889
|
+
}
|
|
890
|
+
}), K = F(() => h.transferLocationOptions.value), E = F({
|
|
891
|
+
get() {
|
|
892
|
+
return t.supplier._id;
|
|
893
|
+
},
|
|
894
|
+
set(c) {
|
|
895
|
+
h.transferLocationModel.value = c;
|
|
896
|
+
}
|
|
897
|
+
}), J = F({
|
|
898
|
+
get() {
|
|
899
|
+
return t.remark ?? void 0;
|
|
900
|
+
},
|
|
901
|
+
set(c) {
|
|
902
|
+
t.remark = c;
|
|
903
|
+
}
|
|
904
|
+
}), { backdatePo: R, backdateSwitch: z, backdateModel: Q, backdateTimeModel: q } = Lt({
|
|
905
|
+
getEffectiveAt() {
|
|
906
|
+
return t.effectiveAt;
|
|
907
|
+
},
|
|
908
|
+
setEffectiveAt(c) {
|
|
909
|
+
t.effectiveAt = c;
|
|
910
|
+
}
|
|
911
|
+
}), { comparePricesToggle: L, comparePriceFetching: G, comparePriceBySku: v } = os(), g = M();
|
|
912
|
+
m({
|
|
913
|
+
validateInputs: () => {
|
|
914
|
+
var c, y;
|
|
915
|
+
(y = (c = g.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
|
|
916
|
+
},
|
|
917
|
+
resetInputsValidation: () => {
|
|
918
|
+
var c, y;
|
|
919
|
+
(y = (c = g.value) == null ? void 0 : c.resetInputsValidation) == null || y.call(c);
|
|
920
|
+
},
|
|
921
|
+
resetInputs: () => {
|
|
922
|
+
var c, y;
|
|
923
|
+
(y = (c = g.value) == null ? void 0 : c.resetInputs) == null || y.call(c);
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
const O = kt({
|
|
927
|
+
updateItem: (c) => {
|
|
928
|
+
t.items = t.items.map((y) => y.sku._id !== c.sku._id ? y : c);
|
|
929
|
+
},
|
|
930
|
+
deleteItem: (c) => {
|
|
931
|
+
t.items = t.items.filter((y) => y.sku._id !== c.sku._id);
|
|
932
|
+
},
|
|
933
|
+
get supplier() {
|
|
934
|
+
return t.supplier;
|
|
935
|
+
},
|
|
936
|
+
get items() {
|
|
937
|
+
return t.items;
|
|
938
|
+
},
|
|
939
|
+
get transferType() {
|
|
940
|
+
return S.value;
|
|
941
|
+
},
|
|
942
|
+
get template() {
|
|
943
|
+
return a.value;
|
|
944
|
+
},
|
|
945
|
+
get disabled() {
|
|
946
|
+
return r.disabled;
|
|
947
|
+
}
|
|
948
|
+
}), oe = F(() => O.columnDefs.value);
|
|
949
|
+
function j() {
|
|
950
|
+
var be, pe, ge;
|
|
951
|
+
let c;
|
|
952
|
+
(($) => {
|
|
953
|
+
$.IsInTemplate = "IsInTemplate", $.IsOutsideTemplate = "IsOutsideTemplate";
|
|
954
|
+
})(c || (c = {}));
|
|
955
|
+
const y = [
|
|
956
|
+
{
|
|
957
|
+
id: "IsInTemplate",
|
|
958
|
+
label: n("inventory.transfer.form.items.fromTemplate.title"),
|
|
959
|
+
sublabel: n("inventory.transfer.form.items.fromTemplate.sublabel")
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
id: "IsOutsideTemplate",
|
|
963
|
+
label: n("inventory.transfer.form.items.other.title"),
|
|
964
|
+
collapse: !0
|
|
965
|
+
}
|
|
966
|
+
], W = new Set((ge = (pe = (be = a.value) == null ? void 0 : be.purchaseOrder) == null ? void 0 : pe.items) == null ? void 0 : ge.map(($) => $.sku._id)), ce = p.skus.map(
|
|
967
|
+
($) => ({
|
|
968
|
+
label: $.name,
|
|
969
|
+
sublabel: $.code,
|
|
970
|
+
value: $,
|
|
971
|
+
groupId: W.has($._id) ? "IsInTemplate" : "IsOutsideTemplate"
|
|
972
|
+
/* IsOutsideTemplate */
|
|
973
|
+
})
|
|
974
|
+
), xe = ce.filter(($) => {
|
|
975
|
+
var X;
|
|
976
|
+
return (X = t.items) == null ? void 0 : X.find((ne) => ne.sku._id === $.value._id);
|
|
977
|
+
}).map(($) => $.value);
|
|
978
|
+
k.open({
|
|
979
|
+
title: n("inventory.transfer.form.items.selectItem"),
|
|
980
|
+
closeButton: !0,
|
|
981
|
+
contentComponent: vt,
|
|
982
|
+
contentComponentProps: {
|
|
983
|
+
modelValue: xe,
|
|
984
|
+
items: ce,
|
|
985
|
+
groups: W.size ? y : void 0
|
|
986
|
+
},
|
|
987
|
+
primaryActions: {
|
|
988
|
+
text: n("common.confirm"),
|
|
989
|
+
close: !0
|
|
990
|
+
},
|
|
991
|
+
secondaryActions: {
|
|
992
|
+
text: n("common.close"),
|
|
993
|
+
close: !0,
|
|
994
|
+
variant: "tertiary"
|
|
995
|
+
}
|
|
996
|
+
}).onPrimary(($) => {
|
|
997
|
+
const X = t.items ?? [], ne = $.map((Y) => {
|
|
998
|
+
var _e, me;
|
|
999
|
+
const ae = X.find((le) => le.sku._id === Y._id);
|
|
1000
|
+
if (ae)
|
|
1001
|
+
return ae;
|
|
1002
|
+
const ee = ((me = (_e = a.value) == null ? void 0 : _e.purchaseOrder.items) == null ? void 0 : me.find(
|
|
1003
|
+
(le) => le.sku._id === Y._id
|
|
1004
|
+
)) ?? {
|
|
1005
|
+
sku: Y,
|
|
1006
|
+
code: Y.code,
|
|
1007
|
+
name: Y.name,
|
|
1008
|
+
quantity: {
|
|
1009
|
+
amount: 1,
|
|
1010
|
+
precision: 0
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
return S.value == I.PURCHASE && (ee.totalCost = te(
|
|
1014
|
+
ee.sku,
|
|
1015
|
+
ee.quantity,
|
|
1016
|
+
ee.measurement,
|
|
1017
|
+
{
|
|
1018
|
+
supplier: t.supplier
|
|
1019
|
+
}
|
|
1020
|
+
)), ee;
|
|
1021
|
+
});
|
|
1022
|
+
ne.sort((Y, ae) => Y.sku.code.localeCompare(ae.sku.code)), t.items = ne;
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
function we(c) {
|
|
1026
|
+
return c;
|
|
1027
|
+
}
|
|
1028
|
+
return (c, y) => {
|
|
1029
|
+
var me, le;
|
|
1030
|
+
const W = P("FmChip"), ce = P("FmSelect"), xe = P("FmTextField"), be = P("FmTextarea"), pe = P("FmSwitch"), ge = P("FmDatePicker"), $ = P("FmTimePicker"), X = P("FmFormGroup"), ne = P("FmIcon"), Y = P("FmButton"), ae = P("FmTooltip"), ee = P("FmTable"), _e = P("FmForm");
|
|
1031
|
+
return T(), A("div", is, [
|
|
1032
|
+
d("div", us, [
|
|
1033
|
+
(me = r.modelValue) != null && me.template ? (T(), N(W, {
|
|
1034
|
+
key: 0,
|
|
1035
|
+
variant: c.disabled ? "warning" : void 0,
|
|
1036
|
+
label: `${e(n)("inventory.transfer.template.title")}: ${((le = a.value) == null ? void 0 : le.name) ?? e(n)("inventory.transfer.form.loading")}`,
|
|
1037
|
+
icon: "summarize",
|
|
1038
|
+
compact: ""
|
|
1039
|
+
}, null, 8, ["variant", "label"])) : Z("", !0),
|
|
1040
|
+
C(W, {
|
|
1041
|
+
label: e(w).currentLocation.name,
|
|
1042
|
+
icon: "storefront",
|
|
1043
|
+
compact: ""
|
|
1044
|
+
}, null, 8, ["label"]),
|
|
1045
|
+
c.lastClosingDate ? (T(), N(W, {
|
|
1046
|
+
key: 1,
|
|
1047
|
+
label: `${e(n)("inventory.transfer.form.lastClosing")}: ${e(Ve)(c.lastClosingDate)} ${e(ft)(c.lastClosingDate)}`,
|
|
1048
|
+
icon: "calendar_month",
|
|
1049
|
+
compact: ""
|
|
1050
|
+
}, null, 8, ["label"])) : Z("", !0)
|
|
1051
|
+
]),
|
|
1052
|
+
C(_e, {
|
|
1053
|
+
ref_key: "formRef",
|
|
1054
|
+
ref: g,
|
|
1055
|
+
class: "flex flex-col gap-32",
|
|
1056
|
+
disabled: c.disabled,
|
|
1057
|
+
onValidationFailed: console.log,
|
|
1058
|
+
onValidationSuccess: y[12] || (y[12] = (Se) => f("validation-success"))
|
|
1059
|
+
}, {
|
|
1060
|
+
default: V(() => {
|
|
1061
|
+
var Se;
|
|
1062
|
+
return [
|
|
1063
|
+
d("div", ds, [
|
|
1064
|
+
d("div", cs, [
|
|
1065
|
+
C(ce, {
|
|
1066
|
+
label: e(n)("inventory.transfer.form.type.title"),
|
|
1067
|
+
"model-value": S.value,
|
|
1068
|
+
"onUpdate:modelValue": y[0] || (y[0] = (x) => S.value = x),
|
|
1069
|
+
items: [
|
|
1070
|
+
{
|
|
1071
|
+
label: e(n)("inventory.transfer.form.type.purchase"),
|
|
1072
|
+
value: e(I).PURCHASE,
|
|
1073
|
+
disabled: !e(h).locationOptionsTypePurchase.value.length,
|
|
1074
|
+
sublabel: e(h).locationOptionsTypePurchase.value.length ? void 0 : e(n)("inventory.transfer.form.noSupplierAvailable")
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
label: e(n)("inventory.transfer.form.type.transfer"),
|
|
1078
|
+
value: e(I).TRANSFER,
|
|
1079
|
+
disabled: !e(h).locationOptionsTypeTransfer.value.length,
|
|
1080
|
+
sublabel: e(h).locationOptionsTypeTransfer.value.length ? void 0 : e(n)("inventory.transfer.form.noLocationAvailable")
|
|
1081
|
+
}
|
|
1082
|
+
],
|
|
1083
|
+
rules: [e(ke)(1)(K.value)]
|
|
1084
|
+
}, null, 8, ["label", "model-value", "items", "rules"]),
|
|
1085
|
+
C(ce, {
|
|
1086
|
+
label: S.value === e(I).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom"),
|
|
1087
|
+
modelValue: E.value,
|
|
1088
|
+
"onUpdate:modelValue": y[1] || (y[1] = (x) => E.value = x),
|
|
1089
|
+
items: K.value
|
|
1090
|
+
}, null, 8, ["label", "modelValue", "items"]),
|
|
1091
|
+
C(xe, {
|
|
1092
|
+
label: e(n)("inventory.transfer.form.reference"),
|
|
1093
|
+
"label-mark": "optional",
|
|
1094
|
+
modelValue: e(t).ref,
|
|
1095
|
+
"onUpdate:modelValue": y[2] || (y[2] = (x) => e(t).ref = x)
|
|
1096
|
+
}, null, 8, ["label", "modelValue"]),
|
|
1097
|
+
C(be, {
|
|
1098
|
+
label: e(n)("inventory.transfer.form.remark"),
|
|
1099
|
+
"label-mark": "optional",
|
|
1100
|
+
"max-length": 240,
|
|
1101
|
+
modelValue: J.value,
|
|
1102
|
+
"onUpdate:modelValue": y[3] || (y[3] = (x) => J.value = x),
|
|
1103
|
+
class: Pe([c.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1104
|
+
}, null, 8, ["label", "modelValue", "class"]),
|
|
1105
|
+
e(i).enableBackdatePo ? (T(), A("div", ps, [
|
|
1106
|
+
d("div", ms, [
|
|
1107
|
+
C(pe, {
|
|
1108
|
+
modelValue: e(z),
|
|
1109
|
+
"onUpdate:modelValue": y[4] || (y[4] = (x) => ie(z) ? z.value = x : null),
|
|
1110
|
+
label: e(n)("inventory.transfer.form.backdate.title"),
|
|
1111
|
+
sublabel: e(n)("inventory.transfer.form.backdate.subtitle"),
|
|
1112
|
+
"label-placement": "right",
|
|
1113
|
+
disabled: b.value && !c.lastClosingDate || c.disabled
|
|
1114
|
+
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1115
|
+
y[13] || (y[13] = d("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1)),
|
|
1116
|
+
e(z) ? (T(), A("div", fs, [
|
|
1117
|
+
d("div", ys, [
|
|
1118
|
+
C(ge, {
|
|
1119
|
+
modelValue: e(Q),
|
|
1120
|
+
"onUpdate:modelValue": y[5] || (y[5] = (x) => ie(Q) ? Q.value = x : null)
|
|
1121
|
+
}, null, 8, ["modelValue"])
|
|
1122
|
+
]),
|
|
1123
|
+
d("div", vs, [
|
|
1124
|
+
C($, {
|
|
1125
|
+
modelValue: e(q),
|
|
1126
|
+
"onUpdate:modelValue": y[6] || (y[6] = (x) => ie(q) ? q.value = x : null)
|
|
1127
|
+
}, null, 8, ["modelValue"])
|
|
1128
|
+
])
|
|
1129
|
+
])) : Z("", !0)
|
|
1130
|
+
]),
|
|
1131
|
+
e(R) ? (T(), N(X, {
|
|
1132
|
+
key: 0,
|
|
1133
|
+
modelValue: e(R),
|
|
1134
|
+
"onUpdate:modelValue": y[7] || (y[7] = (x) => ie(R) ? R.value = x : null),
|
|
1135
|
+
rules: [e(yt)(new Date(c.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1136
|
+
}, null, 8, ["modelValue", "rules"])) : Z("", !0),
|
|
1137
|
+
b.value && !c.lastClosingDate ? (T(), A("div", bs, [
|
|
1138
|
+
C(ne, {
|
|
1139
|
+
name: "error",
|
|
1140
|
+
size: "sm",
|
|
1141
|
+
class: "text-fm-color-typo-warning"
|
|
1142
|
+
}),
|
|
1143
|
+
d("span", gs, D(e(n)("inventory.transfer.form.backdate.error")), 1)
|
|
1144
|
+
])) : Z("", !0)
|
|
1145
|
+
])) : Z("", !0)
|
|
1146
|
+
])
|
|
1147
|
+
]),
|
|
1148
|
+
d("div", _s, [
|
|
1149
|
+
C(X, {
|
|
1150
|
+
"model-value": e(t).items,
|
|
1151
|
+
rules: [e(ke)(1)]
|
|
1152
|
+
}, null, 8, ["model-value", "rules"]),
|
|
1153
|
+
d("div", Cs, [
|
|
1154
|
+
d("div", ks, D(e(n)("inventory.transfer.form.items.title")), 1),
|
|
1155
|
+
d("div", hs, [
|
|
1156
|
+
C(Y, {
|
|
1157
|
+
disabled: c.disabled,
|
|
1158
|
+
label: e(n)("inventory.transfer.form.items.addItem"),
|
|
1159
|
+
"prepend-icon": "add",
|
|
1160
|
+
variant: "secondary",
|
|
1161
|
+
"text-color": "primary",
|
|
1162
|
+
"bg-color": "transparent",
|
|
1163
|
+
"border-color": "primary",
|
|
1164
|
+
onClick: y[8] || (y[8] = (x) => j()),
|
|
1165
|
+
size: "md"
|
|
1166
|
+
}, null, 8, ["disabled", "label"]),
|
|
1167
|
+
e(t).template ? (T(), N(ae, {
|
|
1168
|
+
key: 0,
|
|
1169
|
+
"z-index": 50
|
|
1170
|
+
}, {
|
|
1171
|
+
content: V(() => [
|
|
1172
|
+
d("div", null, D(e(n)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
|
|
1173
|
+
]),
|
|
1174
|
+
default: V(() => [
|
|
1175
|
+
C(Ee, {
|
|
1176
|
+
"onUpdate:poItems": y[9] || (y[9] = (x) => e(t).items = x),
|
|
1177
|
+
disabled: ""
|
|
1178
|
+
})
|
|
1179
|
+
]),
|
|
1180
|
+
_: 1
|
|
1181
|
+
})) : (T(), N(Ee, {
|
|
1182
|
+
key: 1,
|
|
1183
|
+
"onUpdate:poItems": y[10] || (y[10] = (x) => e(t).items = x),
|
|
1184
|
+
disabled: c.disabled || !!e(t).template
|
|
1185
|
+
}, null, 8, ["disabled"]))
|
|
1186
|
+
])
|
|
1187
|
+
]),
|
|
1188
|
+
S.value === e(I).PURCHASE && _.value && e(i).enableTotalCost && ((Se = c.modelValue) != null && Se.items.length) ? (T(), A("div", ws, [
|
|
1189
|
+
C(pe, {
|
|
1190
|
+
label: e(G) ? e(n)("inventory.transfer.form.items.fetchingData") : e(n)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1191
|
+
"prepend-icon": "compare_arrows",
|
|
1192
|
+
"label-placement": "right",
|
|
1193
|
+
"model-value": e(L),
|
|
1194
|
+
"onUpdate:modelValue": y[11] || (y[11] = (x) => ie(L) ? L.value = x : null),
|
|
1195
|
+
disabled: e(G) || c.disabled
|
|
1196
|
+
}, null, 8, ["label", "model-value", "disabled"])
|
|
1197
|
+
])) : Z("", !0),
|
|
1198
|
+
(T(), N(ee, {
|
|
1199
|
+
"column-defs": oe.value,
|
|
1200
|
+
"row-data": e(t).items,
|
|
1201
|
+
key: e(t).items.map((x) => x.sku._id).join("."),
|
|
1202
|
+
"hide-footer": ""
|
|
1203
|
+
}, {
|
|
1204
|
+
"table-row": V((x) => [
|
|
1205
|
+
C(rs, {
|
|
1206
|
+
"compare-price-by-sku": e(v),
|
|
1207
|
+
"show-compare-price": S.value === e(I).PURCHASE && e(L),
|
|
1208
|
+
row: x
|
|
1209
|
+
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
|
|
1210
|
+
]),
|
|
1211
|
+
"list-row": V((x) => [
|
|
1212
|
+
(T(), N(gt, {
|
|
1213
|
+
row: x,
|
|
1214
|
+
key: e(t).items.map((Te) => Te.sku._id).join(".")
|
|
1215
|
+
}, {
|
|
1216
|
+
default: V((Te) => [
|
|
1217
|
+
C(Et, {
|
|
1218
|
+
"compare-price-by-sku": e(v),
|
|
1219
|
+
"show-compare-price": S.value === e(I).PURCHASE && e(L),
|
|
1220
|
+
row: x,
|
|
1221
|
+
"cell-by-col-id": Te
|
|
1222
|
+
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
|
|
1223
|
+
]),
|
|
1224
|
+
_: 2
|
|
1225
|
+
}, 1032, ["row"]))
|
|
1226
|
+
]),
|
|
1227
|
+
_: 1
|
|
1228
|
+
}, 8, ["column-defs", "row-data"]))
|
|
1229
|
+
])
|
|
1230
|
+
];
|
|
1231
|
+
}),
|
|
1232
|
+
_: 1
|
|
1233
|
+
}, 8, ["disabled", "onValidationFailed"])
|
|
1234
|
+
]);
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
}), Ss = { class: "flex items-center" }, Ts = { class: "fm-typo-en-title-md-800" }, Fs = { class: "flex gap-4" }, Es = /* @__PURE__ */ se({
|
|
1238
|
+
__name: "TransferDialog",
|
|
1239
|
+
props: {
|
|
1240
|
+
mode: {},
|
|
1241
|
+
modelValue: {},
|
|
1242
|
+
templateId: {},
|
|
1243
|
+
show: { type: Boolean },
|
|
1244
|
+
lastClosingDate: {}
|
|
1245
|
+
},
|
|
1246
|
+
emits: ["update:show", "submitted"],
|
|
1247
|
+
setup(s, { expose: m, emit: l }) {
|
|
1248
|
+
var G;
|
|
1249
|
+
const r = s, f = l, t = Ne(), n = De(), w = he(), p = Oe(), o = Re(), { t: i } = de(), u = M(!1), a = M(!1), _ = M(!1);
|
|
1250
|
+
async function b(v) {
|
|
1251
|
+
if (v) {
|
|
1252
|
+
a.value = !1;
|
|
1253
|
+
try {
|
|
1254
|
+
await w.readSuppliers(), a.value = !0;
|
|
1255
|
+
} catch {
|
|
1256
|
+
n.open({
|
|
1257
|
+
title: i("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1258
|
+
message: i("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1259
|
+
type: "error"
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
o.watchLocation(b);
|
|
1265
|
+
function k() {
|
|
1266
|
+
return {
|
|
1267
|
+
remark: void 0,
|
|
1268
|
+
ref: void 0,
|
|
1269
|
+
stockSnapshotId: void 0,
|
|
1270
|
+
effectiveAt: void 0,
|
|
1271
|
+
items: [],
|
|
1272
|
+
supplier: {
|
|
1273
|
+
_rev: void 0,
|
|
1274
|
+
email: void 0,
|
|
1275
|
+
internal: void 0,
|
|
1276
|
+
contactName: void 0,
|
|
1277
|
+
phoneNumber: void 0,
|
|
1278
|
+
registrationNumber: void 0,
|
|
1279
|
+
supplyItems: void 0,
|
|
1280
|
+
_id: "",
|
|
1281
|
+
name: "",
|
|
1282
|
+
address: {
|
|
1283
|
+
line2: void 0,
|
|
1284
|
+
line1: "",
|
|
1285
|
+
state: "",
|
|
1286
|
+
city: "",
|
|
1287
|
+
postcode: "",
|
|
1288
|
+
country: ""
|
|
1289
|
+
}
|
|
1290
|
+
},
|
|
1291
|
+
status: "DRAFT",
|
|
1292
|
+
_id: "",
|
|
1293
|
+
seqNumber: 0,
|
|
1294
|
+
deliveryOrder: [],
|
|
1295
|
+
template: r.templateId
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
const h = Je(r, "show"), S = M(r.modelValue ?? k()), K = M(((G = r.modelValue) == null ? void 0 : G._id) ?? `${Math.random()}`);
|
|
1299
|
+
Ae(
|
|
1300
|
+
() => r.show,
|
|
1301
|
+
(v) => {
|
|
1302
|
+
var g;
|
|
1303
|
+
v && (_.value = !1, S.value = r.modelValue ?? k(), K.value = ((g = r.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
1306
|
+
const E = F(() => !a.value || !_.value), J = F(() => {
|
|
1307
|
+
switch (r.mode) {
|
|
1308
|
+
case fe.READ:
|
|
1309
|
+
return "View transfer";
|
|
1310
|
+
case fe.CREATE:
|
|
1311
|
+
return i("inventory.transfer.receiveRequest.create.title");
|
|
1312
|
+
case fe.UPDATE:
|
|
1313
|
+
return i("inventory.transfer.receiveRequest.update.title");
|
|
1314
|
+
}
|
|
1315
|
+
return "";
|
|
1316
|
+
}), R = M();
|
|
1317
|
+
m({
|
|
1318
|
+
validateInputs: () => {
|
|
1319
|
+
var v, g;
|
|
1320
|
+
(g = (v = R.value) == null ? void 0 : v.validateInputs) == null || g.call(v);
|
|
1321
|
+
},
|
|
1322
|
+
resetInputsValidation: () => {
|
|
1323
|
+
var v, g;
|
|
1324
|
+
(g = (v = R.value) == null ? void 0 : v.resetInputsValidation) == null || g.call(v);
|
|
1325
|
+
},
|
|
1326
|
+
resetInputs: () => {
|
|
1327
|
+
var v, g;
|
|
1328
|
+
(g = (v = R.value) == null ? void 0 : v.resetInputs) == null || g.call(v);
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
async function z() {
|
|
1332
|
+
const v = S.value;
|
|
1333
|
+
u.value = !0, (v.supplier.internal === "warehouse" || v.supplier.internal === "restaurant") && (v.items = v.items.map(({ totalCost: g, ...O }) => O));
|
|
1334
|
+
try {
|
|
1335
|
+
await t.createPurchaseOrder(v), await new Promise((g) => setTimeout(g, 1e3)), n.open({
|
|
1336
|
+
title: i("inventory.transfer.receiveRequest.create.success"),
|
|
1337
|
+
message: i("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1338
|
+
type: "success"
|
|
1339
|
+
}), f("update:show", !1), f("submitted");
|
|
1340
|
+
} catch (g) {
|
|
1341
|
+
n.open({
|
|
1342
|
+
title: i("inventory.transfer.receiveRequest.create.error.title"),
|
|
1343
|
+
message: i("inventory.transfer.receiveRequest.create.error.message"),
|
|
1344
|
+
type: "error"
|
|
1345
|
+
}), console.error("Error in creating purchase order", g);
|
|
1346
|
+
} finally {
|
|
1347
|
+
u.value = !1;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
async function Q() {
|
|
1351
|
+
const v = S.value;
|
|
1352
|
+
u.value = !0, (v.supplier.internal === "warehouse" || v.supplier.internal === "restaurant") && (v.items = v.items.map(({ totalCost: g, ...O }) => O));
|
|
1353
|
+
try {
|
|
1354
|
+
await t.updatePurchaseOrder(v), await new Promise((g) => setTimeout(g, 1e3)), n.open({
|
|
1355
|
+
title: i("inventory.transfer.receiveRequest.update.success"),
|
|
1356
|
+
message: i("inventory.transfer.receiveRequest.update.successMessage"),
|
|
1357
|
+
type: "success"
|
|
1358
|
+
}), f("update:show", !1), f("submitted");
|
|
1359
|
+
} catch (g) {
|
|
1360
|
+
n.open({
|
|
1361
|
+
title: i("inventory.transfer.receiveRequest.update.error.title"),
|
|
1362
|
+
message: i("inventory.transfer.receiveRequest.update.error.message"),
|
|
1363
|
+
type: "error"
|
|
1364
|
+
}), console.error("Error in updating purchase order", g);
|
|
1365
|
+
} finally {
|
|
1366
|
+
u.value = !1;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
function q() {
|
|
1370
|
+
switch (r.mode) {
|
|
1371
|
+
case fe.CREATE:
|
|
1372
|
+
return z();
|
|
1373
|
+
case fe.UPDATE:
|
|
1374
|
+
return Q();
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
function L() {
|
|
1378
|
+
var v, g;
|
|
1379
|
+
(g = (v = R.value) == null ? void 0 : v.validateInputs) == null || g.call(v);
|
|
1380
|
+
}
|
|
1381
|
+
return (v, g) => {
|
|
1382
|
+
const O = P("FmButton"), oe = P("FmSideSheet");
|
|
1383
|
+
return T(), N(oe, {
|
|
1384
|
+
modelValue: e(h),
|
|
1385
|
+
"onUpdate:modelValue": g[3] || (g[3] = (j) => ie(h) ? h.value = j : null),
|
|
1386
|
+
"dismiss-away": "",
|
|
1387
|
+
"close-button": "",
|
|
1388
|
+
"max-width": 900
|
|
1389
|
+
}, {
|
|
1390
|
+
"side-sheet-header": V(() => [
|
|
1391
|
+
d("div", Ss, [
|
|
1392
|
+
d("div", Ts, D(J.value), 1)
|
|
1393
|
+
])
|
|
1394
|
+
]),
|
|
1395
|
+
default: V(() => [
|
|
1396
|
+
(T(), N(xs, {
|
|
1397
|
+
class: "w-full",
|
|
1398
|
+
ref_key: "formRef",
|
|
1399
|
+
ref: R,
|
|
1400
|
+
"onForm:ready": g[0] || (g[0] = () => _.value = !0),
|
|
1401
|
+
onValidationSuccess: q,
|
|
1402
|
+
modelValue: S.value,
|
|
1403
|
+
"onUpdate:modelValue": g[1] || (g[1] = (j) => S.value = j),
|
|
1404
|
+
disabled: u.value || E.value,
|
|
1405
|
+
suppliers: e(w).suppliers,
|
|
1406
|
+
skus: e(p).skus,
|
|
1407
|
+
key: K.value,
|
|
1408
|
+
"last-closing-date": v.lastClosingDate
|
|
1409
|
+
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1410
|
+
]),
|
|
1411
|
+
"side-sheet-footer": V(() => [
|
|
1412
|
+
d("div", Fs, [
|
|
1413
|
+
C(O, {
|
|
1414
|
+
loading: u.value,
|
|
1415
|
+
disabled: E.value,
|
|
1416
|
+
label: e(i)("common.save"),
|
|
1417
|
+
onClick: L
|
|
1418
|
+
}, null, 8, ["loading", "disabled", "label"]),
|
|
1419
|
+
C(O, {
|
|
1420
|
+
disabled: E.value,
|
|
1421
|
+
variant: "tertiary",
|
|
1422
|
+
label: e(i)("common.close"),
|
|
1423
|
+
onClick: g[2] || (g[2] = (j) => f("update:show", !1))
|
|
1424
|
+
}, null, 8, ["disabled", "label"])
|
|
1425
|
+
])
|
|
1426
|
+
]),
|
|
1427
|
+
_: 1
|
|
1428
|
+
}, 8, ["modelValue"]);
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
export {
|
|
1433
|
+
Es as _,
|
|
1434
|
+
te as c,
|
|
1435
|
+
ht as d,
|
|
1436
|
+
qt as u
|
|
1437
|
+
};
|