@feedmepos/mf-inventory-portal 1.2.49 → 1.2.50-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-w_Dbl-jn.js → App-DAO7XF9h.js} +72 -68
- package/dist/{ApprovalView-CuOM9Ych.js → ApprovalView-BUHefc15.js} +34 -34
- package/dist/{BindingsDialog-DkMSnr51.js → BindingsDialog-Cx9ngX7X.js} +2 -2
- package/dist/{BindingsPicker-DrXdWUTh.js → BindingsPicker-CIZ9FVgv.js} +2 -2
- package/dist/{BindingsTable-Bj0eBYdU.js → BindingsTable-CMyZkvyn.js} +4 -4
- package/dist/{ClosingDraftView-D1oohB8Y.js → ClosingDraftView-D4CMfSvf.js} +19 -18
- package/dist/{ClosingHistoryView-BCYNhLDg.js → ClosingHistoryView-J_2EA-F4.js} +3 -3
- package/dist/{ClosingTemplateView-DIvZkCgT.js → ClosingTemplateView-Bz21bJLn.js} +18 -17
- package/dist/{DeliveryOrderPrintPreview-C83_a-LI.js → DeliveryOrderPrintPreview-D9xRJSBT.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bmas1qkC.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ifkxhq6-.js} +4 -4
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ_Er40u.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BcJ1ydJ1.js} +12 -12
- package/dist/FmMultiselectDialog-B5F93-xV.js +621 -0
- package/dist/{FmMultiselectDialog-BtvZkE6p.js → FmMultiselectDialog-Cxj6_Bbq.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BN9OeQF3.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CJsg-6qm.js} +3 -3
- package/dist/{ImportView-CRdvYxW3.js → ImportView-mq9p_YKN.js} +7 -7
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D6J1wcU6.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CvdNblLJ.js} +1 -1
- package/dist/{IngredientGroupView-DCdnjh-f.js → IngredientGroupView-1YQdweWW.js} +108 -107
- package/dist/{IngredientsView-DhZadYV8.js → IngredientsView-rZZDO37M.js} +126 -125
- package/dist/{IntegrationView-B_D6Sgj-.js → IntegrationView-0KCNTL9w.js} +80 -80
- package/dist/{InventoryBindingForm-CM47I9t9.js → InventoryBindingForm-Cz6tMVlQ.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BYKUWI9e.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-9jHxMOEn.js} +4 -4
- package/dist/{InventoryBindingSummary-BSuJMrFU.js → InventoryBindingSummary-DarjH7Dn.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9TTwcC8s.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BR6U0SpT.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D2vWMBZF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C9ffyR0d.js} +2 -2
- package/dist/{PublishView-DxhE5g9_.js → PublishView-Bam4W7ko.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BzIwRI7z.js → PurchaseOrderPrintPreview-DEKkUMB6.js} +1 -1
- package/dist/ReceiveRequestView-DDfHVcG2.js +3028 -0
- package/dist/{RecipeView-Azx2MoPR.js → RecipeView-CwwKtDRg.js} +83 -82
- package/dist/{StockView-D51RBHWQ.js → StockView-CVN5MKbj.js} +113 -112
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-R0yauCbz.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bm1MxmBR.js} +1 -1
- package/dist/{SupplierView-BeHjJ0xJ.js → SupplierView-BhnmPv7N.js} +28 -27
- package/dist/SurchargeView-nlkL3YIK.js +460 -0
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DG1p3Rim.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DdPVsOZY.js} +2 -2
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js +84 -0
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-cPIomfPb.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bp49G_dV.js} +13 -13
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BZR_EozX.js → TransferDetails.vue_vue_type_script_setup_true_lang-BQFBZ0CH.js} +15 -15
- package/dist/{TransferTemplateView-BwdhVKO4.js → TransferTemplateView-7AJGTAAy.js} +16 -16
- package/dist/{UnitView-BT23dBtV.js → UnitView-Dz4bgzmW.js} +20 -19
- package/dist/{WarehouseView-PWigQlHk.js → WarehouseView-DEYOa_Ol.js} +21 -20
- package/dist/{WastageTemplateView-BGO19Pux.js → WastageTemplateView-DdPkFfyQ.js} +165 -164
- package/dist/api/netsuite.d.ts +8 -0
- package/dist/api/surcharge.d.ts +31 -0
- package/dist/app-DiX-EfV6.js +8167 -0
- package/dist/{app-C0a15lwm.js → app-kim0oKgm.js} +4511 -4408
- package/dist/app.d.ts +52 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-C9jSN68K.js → closing-template-MLHUWgwA.js} +1 -1
- package/dist/component-DpCUABT3.js +82 -0
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +8 -0
- package/dist/components/FmMultiselectDialogProps.d.ts +5 -0
- package/dist/{date2-DND2dkpu.js → date2-Ck1fxOS1.js} +1 -1
- package/dist/{dayjs.min-CvewwBuM.js → dayjs.min-CgHxLw1P.js} +1 -1
- package/dist/{decimal-C11049RC.js → decimal-DVjzMCmx.js} +2 -2
- package/dist/{defineDeepModel-BYmk9G2K.js → defineDeepModel-CLo1ie3w.js} +1 -1
- package/dist/{duplicate-template-CJLrmGdo.js → duplicate-template-B_f_fYhs.js} +1 -1
- package/dist/{feature-D2GGGVQh.js → feature-D4HcMaGK.js} +3442 -2812
- package/dist/{format-time-from-id-DuUqVP8F.js → format-time-from-id-CwtHJpC0.js} +1 -1
- package/dist/{format-unit-display-BwBGMuCk.js → format-unit-display-DRIOlVir.js} +11 -11
- package/dist/{import-export.helper-ejk_vT2V.js → import-export.helper-BrcydEPI.js} +5 -5
- package/dist/{index-D65a-5cn.js → index-ChruXaud.js} +1 -1
- package/dist/{index-Cy-YW3O0.js → index-D9dtwK1d.js} +1 -1
- package/dist/{index-C9F5LU0v.js → index-Wd74fJNj.js} +3 -3
- package/dist/{lodash-DNLSknxF.js → lodash-MkfFbMhZ.js} +1 -1
- package/dist/netsuite-D4cXyIr7.js +5402 -0
- package/dist/{purchase-order-template-C7J9I7o4.js → purchase-order-template-BdKUiSPI.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/{rules-DQNuaKK6.js → rules-KSzt3qOJ.js} +3 -3
- package/dist/{stock-bYU0NTHD.js → stock-BHWNLsBc.js} +1 -1
- package/dist/{stock-1aynIWpi.js → stock-DZliLQNR.js} +3 -3
- package/dist/stores/integration/netsuite.d.ts +5 -0
- package/dist/stores/surcharge.d.ts +18 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-B72SAF3j.js → supplier-CiMOpHKx.js} +2 -2
- package/dist/surcharge-CjdNdcm1.js +71 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DO20RWUv.js → use-ingredient-select-dialog-CK_Ldhwm.js} +2 -2
- package/dist/{use-inventory-binding-dialog-R2VQakMR.js → use-inventory-binding-dialog-jfME3m3c.js} +2 -2
- package/dist/{use-template-enabled-locations-2-C7L_vyIF.js → use-template-enabled-locations-2-Dbk_RoRj.js} +2 -2
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +714 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +5 -0
- package/dist/views/surcharge/SurchargeView.vue.d.ts +2 -0
- package/dist/vue-i18n-DUlOMRWF.js +2365 -0
- package/dist/{xlsx-DZcSBj-s.js → xlsx-CiNXr9Ie.js} +1 -1
- package/dist/{xlsx.util-DMCjqrHn.js → xlsx.util-D81JjCsx.js} +1 -1
- package/package.json +2 -2
- package/dist/FmMultiselectDialog-IU5C9o_F.js +0 -598
- package/dist/ReceiveRequestView-C5wqi0jE.js +0 -2913
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js +0 -162
- package/dist/app-uBuHtW8m.js +0 -8127
- package/dist/netsuite-TqUeqkqw.js +0 -5131
- package/dist/vue-i18n-BLzLoy1U.js +0 -2365
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as I, computed as x, openBlock as l, createElementBlock as d, createElementVNode as e, normalizeClass as b, toDisplayString as u, unref as p, ref as D, resolveComponent as B, Fragment as $, createVNode as k, createCommentVNode as N, withCtx as C, renderList as E } from "vue";
|
|
2
2
|
import { useI18n as F, useCoreStore as A } from "@feedmepos/mf-common";
|
|
3
|
-
import { u as U } from "./netsuite-
|
|
3
|
+
import { u as U } from "./netsuite-D4cXyIr7.js";
|
|
4
4
|
function ee(o, n = !1) {
|
|
5
5
|
var c;
|
|
6
6
|
return o ? [
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { defineComponent as ie, mergeModels as Hd, computed as E, useModel as ed, resolveComponent as D, openBlock as S, createElementBlock as w, createElementVNode as h, createVNode as C, withCtx as U, toDisplayString as A, unref as p, Fragment as oe, renderList as le, ref as k, createBlock as z, createCommentVNode as W, createTextVNode as wd, isRef as dd, normalizeClass as ae, watch as Td, createSlots as jd, normalizeStyle as Kd, Teleport as Wd } from "vue";
|
|
2
|
-
import { u as ce } from "./supplier-
|
|
2
|
+
import { u as ce } from "./supplier-CiMOpHKx.js";
|
|
3
3
|
import { D as td, R as ye } from "./row-action.enum-BcW_L_nE.js";
|
|
4
|
-
import { c as Yd
|
|
5
|
-
import { c as we, a as ke, h as rd, i as nd, d as
|
|
4
|
+
import { c as Yd } from "./component-DpCUABT3.js";
|
|
5
|
+
import { c as we, a as ke, h as rd, i as nd, d as Xd, n as Ad, u as Pe } from "./app-kim0oKgm.js";
|
|
6
6
|
import { useI18n as ee, useCoreStore as Ce } from "@feedmepos/mf-common";
|
|
7
|
-
import { u as Ve } from "./netsuite-
|
|
8
|
-
import { useDialog as Ne, useSnackbar as Se, useProxiedModel as od, useDialogChild as
|
|
9
|
-
import { u as
|
|
7
|
+
import { u as Ve } from "./netsuite-D4cXyIr7.js";
|
|
8
|
+
import { useDialog as Ne, useSnackbar as Se, useProxiedModel as od, useDialogChild as Zd, useBreakpoints as qd } from "@feedmepos/ui-library";
|
|
9
|
+
import { u as zd, _ as Jd } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
10
10
|
import { F as B } from "./form-mode.enum-BKiNVH6A.js";
|
|
11
|
-
import { R as Z, g as
|
|
12
|
-
import { a as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { _ as
|
|
15
|
-
import { u as xe } from "./feature-
|
|
16
|
-
import { u as
|
|
17
|
-
import { _ as
|
|
11
|
+
import { R as Z, g as Qd } from "./rules-KSzt3qOJ.js";
|
|
12
|
+
import { a as et } from "./FmMultiselectDialog-B5F93-xV.js";
|
|
13
|
+
import { _ as dt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
14
|
+
import { _ as tt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CJsg-6qm.js";
|
|
15
|
+
import { u as xe } from "./feature-D4HcMaGK.js";
|
|
16
|
+
import { u as rt } from "./purchase-order-template-BdKUiSPI.js";
|
|
17
|
+
import { _ as nt, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
18
|
+
import { _ as ot } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BcJ1ydJ1.js";
|
|
18
19
|
import { defineStore as at } from "pinia";
|
|
19
|
-
import { b as Rd, d as Md, s as it, r as $t } from "./xlsx.util-
|
|
20
|
-
import { f as lt } from "./date2-
|
|
20
|
+
import { b as Rd, d as Md, s as it, r as $t } from "./xlsx.util-D81JjCsx.js";
|
|
21
|
+
import { f as lt } from "./date2-Ck1fxOS1.js";
|
|
21
22
|
import { F as st } from "./FmDroppableField-J0xUsOTV.js";
|
|
22
23
|
function ut(e, d) {
|
|
23
24
|
const { t } = ee(), r = Ve();
|
|
@@ -106,13 +107,13 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
106
107
|
})), y = ((N = o.value) == null ? void 0 : N.map((f) => f.skuId)) ?? [], g = E(
|
|
107
108
|
() => {
|
|
108
109
|
var f;
|
|
109
|
-
return ((f =
|
|
110
|
+
return ((f = Xd(d.currentCountry.value)) == null ? void 0 : f.currency) ?? "MYR";
|
|
110
111
|
}
|
|
111
112
|
);
|
|
112
113
|
n.open({
|
|
113
114
|
title: i("inventory.supplier.supplyItems.selectItem"),
|
|
114
115
|
closeButton: !0,
|
|
115
|
-
contentComponent:
|
|
116
|
+
contentComponent: et,
|
|
116
117
|
contentComponentProps: {
|
|
117
118
|
modelValue: y,
|
|
118
119
|
items: c
|
|
@@ -183,7 +184,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
183
184
|
h("div", pt, [
|
|
184
185
|
h("div", ft, [
|
|
185
186
|
h("div", mt, [
|
|
186
|
-
C(
|
|
187
|
+
C(dt, { "z-index": 50 }, {
|
|
187
188
|
default: U(() => [
|
|
188
189
|
h("div", yt, A(p(i)("inventory.supplier.supplyItems.title")), 1)
|
|
189
190
|
]),
|
|
@@ -216,7 +217,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
216
217
|
]),
|
|
217
218
|
h("div", Ct, [
|
|
218
219
|
h("div", Nt, [
|
|
219
|
-
C(
|
|
220
|
+
C(tt, {
|
|
220
221
|
"model-value": v(N),
|
|
221
222
|
unit: u(N),
|
|
222
223
|
"onUpdate:modelValue": (T) => m(N, T),
|
|
@@ -554,7 +555,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
554
555
|
},
|
|
555
556
|
emits: ["update:show", "submitted"],
|
|
556
557
|
setup(e, { expose: d, emit: t }) {
|
|
557
|
-
const r = Ve(), n = e, i = t, o = k(!1), l = Se(), s = Ne(), { t: u } = ee(), v = ce(), m =
|
|
558
|
+
const r = Ve(), n = e, i = t, o = k(!1), l = Se(), s = Ne(), { t: u } = ee(), v = ce(), m = rt(), c = ke(), y = k(!1), g = E(() => {
|
|
558
559
|
switch (n.mode) {
|
|
559
560
|
case B.READ:
|
|
560
561
|
return "";
|
|
@@ -710,7 +711,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
710
711
|
var $e;
|
|
711
712
|
const re = {
|
|
712
713
|
amount: 1,
|
|
713
|
-
precision:
|
|
714
|
+
precision: Qd(K.unit)
|
|
714
715
|
};
|
|
715
716
|
return {
|
|
716
717
|
sku: K,
|
|
@@ -2697,7 +2698,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2697
2698
|
}, v1 = { class: "fm-typo-en-body-lg-600" }, g1 = /* @__PURE__ */ ie({
|
|
2698
2699
|
__name: "SupplierImport",
|
|
2699
2700
|
setup(e) {
|
|
2700
|
-
const d = k(null), t =
|
|
2701
|
+
const d = k(null), t = Zd(), r = Se(), n = k(!1), i = k(!1), o = k(new Array()), l = k([]), s = k([]), u = E(
|
|
2701
2702
|
() => !!o.value.length || l.value.some((y) => y.errors.length) || s.value.some((y) => y.errors.length)
|
|
2702
2703
|
), v = E(
|
|
2703
2704
|
() => !!l.value.length || !!s.value.length
|
|
@@ -2942,7 +2943,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2942
2943
|
}), b1 = { class: "flex flex-col py-8" }, _1 = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, P1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, C1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, N1 = {
|
|
2943
2944
|
key: 0,
|
|
2944
2945
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
2945
|
-
}, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.",
|
|
2946
|
+
}, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", X1 = /* @__PURE__ */ ie({
|
|
2946
2947
|
__name: "SupplierView",
|
|
2947
2948
|
setup(e) {
|
|
2948
2949
|
const { importSuppliers: d, exportSuppliers: t } = h1(), r = ce(), n = Pe(), i = xe(), o = Ve(), l = k(!1), s = Ne(), u = Se(), { t: v } = ee();
|
|
@@ -3032,7 +3033,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3032
3033
|
if ($ === "refresh")
|
|
3033
3034
|
return c();
|
|
3034
3035
|
}
|
|
3035
|
-
const V = k(""), { breakpoints: Y } =
|
|
3036
|
+
const V = k(""), { breakpoints: Y } = qd(), X = E(() => Y.value.xs || Y.value.sm), te = E(() => X.value ? 10 : 20), _ = zd(), x = E(() => [
|
|
3036
3037
|
{
|
|
3037
3038
|
label: v("inventory.supplier.create.title"),
|
|
3038
3039
|
value: "create",
|
|
@@ -3057,7 +3058,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3057
3058
|
]);
|
|
3058
3059
|
return ($, a) => {
|
|
3059
3060
|
const H = D("FmTable");
|
|
3060
|
-
return S(), z(
|
|
3061
|
+
return S(), z(Jd, {
|
|
3061
3062
|
title: p(v)("inventory.supplier.title"),
|
|
3062
3063
|
actions: x.value,
|
|
3063
3064
|
"onClick:action": T,
|
|
@@ -3092,7 +3093,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3092
3093
|
"page-size": te.value
|
|
3093
3094
|
}, {
|
|
3094
3095
|
"list-row": U((I) => [
|
|
3095
|
-
C(
|
|
3096
|
+
C(nt, {
|
|
3096
3097
|
row: I,
|
|
3097
3098
|
onRowClick: f
|
|
3098
3099
|
}, {
|
|
@@ -3149,5 +3150,5 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3149
3150
|
}
|
|
3150
3151
|
});
|
|
3151
3152
|
export {
|
|
3152
|
-
|
|
3153
|
+
X1 as default
|
|
3153
3154
|
};
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { defineComponent as pe, ref as v, computed as c, watch as R, onMounted as fe, resolveComponent as p, openBlock as j, createElementBlock as ye, Fragment as ge, createVNode as n, unref as s, withCtx as f, createElementVNode as u, normalizeClass as G, normalizeStyle as he, toDisplayString as E, withDirectives as be, vModelText as _e, createBlock as Se, withModifiers as xe, createCommentVNode as Fe } from "vue";
|
|
2
|
+
import { u as ke, _ as we } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
3
|
+
import { a as Ie, u as Ce, J as V, j as Le, s as Ve } from "./app-kim0oKgm.js";
|
|
4
|
+
import { u as Ae } from "./surcharge-CjdNdcm1.js";
|
|
5
|
+
import { useSnackbar as De, useDialog as Me, useBreakpoints as Oe } from "@feedmepos/ui-library";
|
|
6
|
+
import { _ as Pe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BcJ1ydJ1.js";
|
|
7
|
+
import { a as Te } from "./FmMultiselectDialog-B5F93-xV.js";
|
|
8
|
+
import { useI18n as Be } from "@feedmepos/mf-common";
|
|
9
|
+
import { u as ze } from "./supplier-CiMOpHKx.js";
|
|
10
|
+
import { u as Ee } from "./feature-D4HcMaGK.js";
|
|
11
|
+
import { D as Ne, P as $e, L as Ue } from "./app-DiX-EfV6.js";
|
|
12
|
+
import { D as H, R as A } from "./row-action.enum-BcW_L_nE.js";
|
|
13
|
+
import { c as qe } from "./component-DpCUABT3.js";
|
|
14
|
+
const Je = { class: "flex flex-col py-8" }, Re = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, je = { class: "flex flex-col h-full justify-between" }, Ge = { class: "space-y-16" }, He = ["placeholder"], Ke = { class: "flex flex-col gap-16" }, Qe = { class: "flex flex-col gap-8" }, We = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = { class: "flex flex-col gap-12" }, Ye = { class: "flex flex-col gap-4" }, Ze = { class: "flex items-center gap-8" }, pt = /* @__PURE__ */ pe({
|
|
15
|
+
__name: "SurchargeView",
|
|
16
|
+
setup(et) {
|
|
17
|
+
const y = De(), N = Me(), D = Ie(), x = Ae(), F = Ce(), M = ze(), K = Ee(), g = v(!1), Q = c(() => x.surcharges), k = v(""), { breakpoints: $ } = Oe(), O = c(() => $.value.xs || $.value.sm), W = c(() => O.value ? 10 : 20), X = ke(), { t: a } = Be(), Y = c(() => F.businessLevel);
|
|
18
|
+
R(Y, T);
|
|
19
|
+
const Z = c(() => (F.businessLevel || K.businessSupplierOnly ? M.businessSuppliers : M.locationSuppliers).map((t) => ({ label: t.name, value: t._id }))), ee = c(() => [
|
|
20
|
+
{
|
|
21
|
+
key: "supplierId",
|
|
22
|
+
type: "string",
|
|
23
|
+
entity: "supplier",
|
|
24
|
+
options: Z.value
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: "totalCost",
|
|
28
|
+
type: "number"
|
|
29
|
+
}
|
|
30
|
+
]), te = c(() => D.skus.map((e) => ({
|
|
31
|
+
label: `${e.code} - ${e.name}`,
|
|
32
|
+
sublabel: e.code,
|
|
33
|
+
value: e,
|
|
34
|
+
disabled: e.isInactive,
|
|
35
|
+
tags: e.isInactive ? ["Inactive"] : ["Active"]
|
|
36
|
+
}))), w = c(() => {
|
|
37
|
+
var t;
|
|
38
|
+
const e = (t = o.value.value) == null ? void 0 : t.skuId;
|
|
39
|
+
return e ? D.skus.find((r) => r._id === e) : null;
|
|
40
|
+
});
|
|
41
|
+
function ae() {
|
|
42
|
+
var i;
|
|
43
|
+
const e = (i = o.value.value) == null ? void 0 : i.skuId, t = e ? D.skus.find((d) => d._id === e) : null, r = [
|
|
44
|
+
{
|
|
45
|
+
type: "string",
|
|
46
|
+
key: "tags",
|
|
47
|
+
entity: "item",
|
|
48
|
+
values: ["Inactive", "Active"]
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
N.open({
|
|
52
|
+
title: a("inventory.surcharge.form.value.itemPlaceholder"),
|
|
53
|
+
closeButton: !0,
|
|
54
|
+
contentComponent: Te,
|
|
55
|
+
contentComponentProps: {
|
|
56
|
+
modelValue: t ? [t] : [],
|
|
57
|
+
items: te.value,
|
|
58
|
+
virtualScroll: !0,
|
|
59
|
+
filterAttributes: r,
|
|
60
|
+
maxSelections: 1
|
|
61
|
+
},
|
|
62
|
+
primaryActions: {
|
|
63
|
+
text: a("common.confirm"),
|
|
64
|
+
close: !0
|
|
65
|
+
},
|
|
66
|
+
secondaryActions: {
|
|
67
|
+
text: a("common.close"),
|
|
68
|
+
close: !0,
|
|
69
|
+
variant: "tertiary"
|
|
70
|
+
}
|
|
71
|
+
}).onPrimary((d) => {
|
|
72
|
+
d && d.length > 0 ? z(d[0]._id) : z(null);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const _ = v(!1), P = v(""), o = v({
|
|
76
|
+
_id: "",
|
|
77
|
+
name: "",
|
|
78
|
+
value: {
|
|
79
|
+
amount: {
|
|
80
|
+
currency: V(),
|
|
81
|
+
amount: 0,
|
|
82
|
+
precision: 0
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
rule: null,
|
|
86
|
+
businessId: "",
|
|
87
|
+
applyTo: "purchaseOrder"
|
|
88
|
+
}), S = v(), h = v(""), b = v(null), oe = c(() => [
|
|
89
|
+
{
|
|
90
|
+
label: a("inventory.surcharge.actions.create"),
|
|
91
|
+
value: "create",
|
|
92
|
+
isPrimary: !0,
|
|
93
|
+
prependIcon: "add"
|
|
94
|
+
}
|
|
95
|
+
]);
|
|
96
|
+
async function T() {
|
|
97
|
+
try {
|
|
98
|
+
await M.readSuppliers();
|
|
99
|
+
} catch {
|
|
100
|
+
y.open({ message: a("Failed to fetch suppliers"), type: "error" });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function le() {
|
|
104
|
+
o.value.rule = b.value ? $e.build(b.value) : null, g.value = !0;
|
|
105
|
+
try {
|
|
106
|
+
S.value ? (await x.update(o.value._id, o.value), y.open({
|
|
107
|
+
title: a("Success"),
|
|
108
|
+
message: a("Order surcharge updated successfully"),
|
|
109
|
+
type: "success"
|
|
110
|
+
})) : (await x.create(o.value), y.open({
|
|
111
|
+
title: a("Success"),
|
|
112
|
+
message: a("Order surcharge created successfully"),
|
|
113
|
+
type: "success"
|
|
114
|
+
})), _.value = !1, o.value = {
|
|
115
|
+
_id: "",
|
|
116
|
+
name: "",
|
|
117
|
+
value: { amount: { currency: V(), amount: 0, precision: 0 } },
|
|
118
|
+
rule: null,
|
|
119
|
+
businessId: "",
|
|
120
|
+
applyTo: "purchaseOrder"
|
|
121
|
+
}, S.value = void 0;
|
|
122
|
+
} catch (e) {
|
|
123
|
+
e instanceof Le || y.open({
|
|
124
|
+
title: a("Error"),
|
|
125
|
+
message: a("Failed to save order surcharge"),
|
|
126
|
+
type: "error"
|
|
127
|
+
});
|
|
128
|
+
} finally {
|
|
129
|
+
g.value = !1;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function re(e) {
|
|
133
|
+
g.value = !0;
|
|
134
|
+
try {
|
|
135
|
+
await x.delete(e._id), y.open({
|
|
136
|
+
title: a("Success"),
|
|
137
|
+
message: a("inventory.surcharge.delete.success", { name: e.name }),
|
|
138
|
+
type: "success"
|
|
139
|
+
}), _.value = !1;
|
|
140
|
+
} catch (t) {
|
|
141
|
+
y.open({
|
|
142
|
+
title: a("inventory.surcharge.delete.error"),
|
|
143
|
+
message: a("inventory.surcharge.delete.errorMessage", { name: e.name }),
|
|
144
|
+
type: "error"
|
|
145
|
+
}), console.error("failed to delete surcharge", t);
|
|
146
|
+
} finally {
|
|
147
|
+
g.value = !1;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function ne() {
|
|
151
|
+
S.value && N.open({
|
|
152
|
+
title: a("inventory.surcharge.delete.title", { name: o.value.name }),
|
|
153
|
+
closeButton: !1,
|
|
154
|
+
message: a("inventory.surcharge.delete.message"),
|
|
155
|
+
primaryActions: {
|
|
156
|
+
text: a("common.delete"),
|
|
157
|
+
close: !0,
|
|
158
|
+
variant: "destructive"
|
|
159
|
+
},
|
|
160
|
+
secondaryActions: {
|
|
161
|
+
text: a("common.cancel"),
|
|
162
|
+
close: !0
|
|
163
|
+
}
|
|
164
|
+
}).onPrimary(() => re(o.value));
|
|
165
|
+
}
|
|
166
|
+
function se(e, t) {
|
|
167
|
+
if (e === A.Edit) {
|
|
168
|
+
U(t);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (e === A.Delete) {
|
|
172
|
+
o.value = JSON.parse(JSON.stringify(t)), S.value = t, ne();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function ue(e) {
|
|
177
|
+
switch (e) {
|
|
178
|
+
case "create": {
|
|
179
|
+
if (g.value) {
|
|
180
|
+
y.open({
|
|
181
|
+
title: "Loading data...",
|
|
182
|
+
message: "Please wait.",
|
|
183
|
+
type: "info"
|
|
184
|
+
});
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
P.value = "inventory.surcharge.actions.create";
|
|
188
|
+
const t = V();
|
|
189
|
+
o.value = {
|
|
190
|
+
_id: "",
|
|
191
|
+
name: "",
|
|
192
|
+
value: {
|
|
193
|
+
amount: {
|
|
194
|
+
currency: t,
|
|
195
|
+
amount: 0,
|
|
196
|
+
precision: 0
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
rule: null,
|
|
200
|
+
businessId: "",
|
|
201
|
+
applyTo: "purchaseOrder"
|
|
202
|
+
}, S.value = void 0, b.value = null, h.value = "", _.value = !0;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function U(e) {
|
|
208
|
+
P.value = "inventory.surcharge.actions.edit", o.value = JSON.parse(JSON.stringify(e)), S.value = e, b.value = e.rule ? Ue.build(e.rule) : null, h.value = "", _.value = !0;
|
|
209
|
+
}
|
|
210
|
+
function q() {
|
|
211
|
+
var t;
|
|
212
|
+
if (h.value !== "")
|
|
213
|
+
return h.value;
|
|
214
|
+
const e = (t = o.value.value) == null ? void 0 : t.amount;
|
|
215
|
+
return e ? Ve.toFormatString({
|
|
216
|
+
value: {
|
|
217
|
+
amount: e.amount,
|
|
218
|
+
precision: e.precision
|
|
219
|
+
}
|
|
220
|
+
}) : "0";
|
|
221
|
+
}
|
|
222
|
+
let B = null;
|
|
223
|
+
function ie(e) {
|
|
224
|
+
h.value = e, B && clearTimeout(B), B = setTimeout(() => {
|
|
225
|
+
var I, L;
|
|
226
|
+
const t = parseFloat(e) || 0, r = (I = o.value.value) == null ? void 0 : I.amount, i = (r == null ? void 0 : r.precision) ?? 0, d = (r == null ? void 0 : r.currency) ?? V(), C = (L = o.value.value) == null ? void 0 : L.skuId;
|
|
227
|
+
o.value.value = {
|
|
228
|
+
amount: {
|
|
229
|
+
amount: Math.round(t * Math.pow(10, i)),
|
|
230
|
+
precision: i,
|
|
231
|
+
currency: d
|
|
232
|
+
},
|
|
233
|
+
...C && { skuId: C }
|
|
234
|
+
}, h.value = "";
|
|
235
|
+
}, 500);
|
|
236
|
+
}
|
|
237
|
+
function z(e) {
|
|
238
|
+
const t = o.value.value;
|
|
239
|
+
if (e)
|
|
240
|
+
o.value.value = {
|
|
241
|
+
...t,
|
|
242
|
+
skuId: e
|
|
243
|
+
};
|
|
244
|
+
else {
|
|
245
|
+
const { skuId: r, ...i } = t || {};
|
|
246
|
+
o.value.value = i;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
const ce = c(() => [
|
|
250
|
+
{
|
|
251
|
+
accessorKey: "name",
|
|
252
|
+
header: () => a("inventory.surcharge.table.name"),
|
|
253
|
+
enableSorting: !0,
|
|
254
|
+
size: "auto"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: "action",
|
|
258
|
+
header: "",
|
|
259
|
+
cell(e) {
|
|
260
|
+
return qe(
|
|
261
|
+
[H[A.Edit], H[A.Delete]],
|
|
262
|
+
(t) => {
|
|
263
|
+
se(t, e.row.original);
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
},
|
|
267
|
+
enableSorting: !1,
|
|
268
|
+
size: 40
|
|
269
|
+
}
|
|
270
|
+
]), me = c(() => {
|
|
271
|
+
let e = Q.value;
|
|
272
|
+
if (k.value) {
|
|
273
|
+
const t = k.value.toLowerCase();
|
|
274
|
+
e = e.filter((r) => r.name.toLowerCase().includes(t));
|
|
275
|
+
}
|
|
276
|
+
return e;
|
|
277
|
+
});
|
|
278
|
+
return fe(() => {
|
|
279
|
+
T(), x.browse();
|
|
280
|
+
}), R(
|
|
281
|
+
() => F._currentLocation,
|
|
282
|
+
() => {
|
|
283
|
+
F._currentLocation && T();
|
|
284
|
+
}
|
|
285
|
+
), (e, t) => {
|
|
286
|
+
const r = p("FmTable"), i = p("FmFormGroup"), d = p("FmLabel"), C = p("FmTextField"), I = p("FmButton"), L = p("FmIcon"), de = p("FmCard"), ve = p("FmSideSheet");
|
|
287
|
+
return j(), ye(ge, null, [
|
|
288
|
+
n(we, {
|
|
289
|
+
title: s(a)("inventory.surcharge.title"),
|
|
290
|
+
actions: oe.value,
|
|
291
|
+
"onClick:action": ue
|
|
292
|
+
}, {
|
|
293
|
+
default: f(() => [
|
|
294
|
+
u("div", {
|
|
295
|
+
class: G([
|
|
296
|
+
"flex flex-col gap-8 max-h-full",
|
|
297
|
+
{
|
|
298
|
+
"p-0": O.value,
|
|
299
|
+
"px-24 ": !O.value
|
|
300
|
+
}
|
|
301
|
+
])
|
|
302
|
+
}, [
|
|
303
|
+
n(Pe, {
|
|
304
|
+
searchable: "",
|
|
305
|
+
search: k.value,
|
|
306
|
+
"onUpdate:search": t[0] || (t[0] = (l) => k.value = l)
|
|
307
|
+
}, null, 8, ["search"]),
|
|
308
|
+
n(r, {
|
|
309
|
+
style: he(s(X).tableHeight),
|
|
310
|
+
"column-defs": ce.value,
|
|
311
|
+
"row-data": me.value,
|
|
312
|
+
"search-value": k.value,
|
|
313
|
+
loading: g.value || !s(F)._currentLocation,
|
|
314
|
+
"page-size": W.value,
|
|
315
|
+
onRowClick: t[1] || (t[1] = (l) => U(l.original))
|
|
316
|
+
}, {
|
|
317
|
+
"list-row": f((l) => [
|
|
318
|
+
u("div", Je, [
|
|
319
|
+
u("div", Re, E(l.original.name), 1)
|
|
320
|
+
])
|
|
321
|
+
]),
|
|
322
|
+
_: 1
|
|
323
|
+
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
324
|
+
], 2)
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
}, 8, ["title", "actions"]),
|
|
328
|
+
n(ve, {
|
|
329
|
+
modelValue: _.value,
|
|
330
|
+
"onUpdate:modelValue": t[8] || (t[8] = (l) => _.value = l),
|
|
331
|
+
header: s(a)(P.value),
|
|
332
|
+
"max-width": 800
|
|
333
|
+
}, {
|
|
334
|
+
"side-sheet-footer": f(() => [
|
|
335
|
+
n(I, {
|
|
336
|
+
variant: "primary",
|
|
337
|
+
class: "w-full",
|
|
338
|
+
onClick: le,
|
|
339
|
+
loading: g.value,
|
|
340
|
+
label: s(a)("inventory.surcharge.actions.save")
|
|
341
|
+
}, null, 8, ["loading", "label"])
|
|
342
|
+
]),
|
|
343
|
+
default: f(() => [
|
|
344
|
+
u("div", je, [
|
|
345
|
+
u("div", Ge, [
|
|
346
|
+
n(i, {
|
|
347
|
+
modelValue: o.value.name,
|
|
348
|
+
"onUpdate:modelValue": t[3] || (t[3] = (l) => o.value.name = l),
|
|
349
|
+
label: s(a)("inventory.surcharge.form.name"),
|
|
350
|
+
required: !0,
|
|
351
|
+
rules: [(l) => !!l.trim().length || s(a)("inventory.surcharge.form.nameRequired")]
|
|
352
|
+
}, {
|
|
353
|
+
default: f(() => [
|
|
354
|
+
be(u("input", {
|
|
355
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => o.value.name = l),
|
|
356
|
+
class: "w-full p-8 border rounded-md outline-none focus:border-blue-500",
|
|
357
|
+
placeholder: s(a)("inventory.surcharge.form.namePlaceholder")
|
|
358
|
+
}, null, 8, He), [
|
|
359
|
+
[_e, o.value.name]
|
|
360
|
+
])
|
|
361
|
+
]),
|
|
362
|
+
_: 1
|
|
363
|
+
}, 8, ["modelValue", "label", "rules"]),
|
|
364
|
+
u("div", Ke, [
|
|
365
|
+
u("div", Qe, [
|
|
366
|
+
n(d, {
|
|
367
|
+
label: s(a)("inventory.surcharge.form.rules.title"),
|
|
368
|
+
required: ""
|
|
369
|
+
}, null, 8, ["label"]),
|
|
370
|
+
u("div", We, E(s(a)("inventory.surcharge.form.rules.description")), 1)
|
|
371
|
+
]),
|
|
372
|
+
n(de, {
|
|
373
|
+
variant: "outlined",
|
|
374
|
+
class: "p-16"
|
|
375
|
+
}, {
|
|
376
|
+
default: f(() => {
|
|
377
|
+
var l;
|
|
378
|
+
return [
|
|
379
|
+
u("div", Xe, [
|
|
380
|
+
u("div", Ye, [
|
|
381
|
+
n(i, {
|
|
382
|
+
"model-value": parseFloat(q()),
|
|
383
|
+
label: s(a)("inventory.surcharge.form.value.amount"),
|
|
384
|
+
required: !0,
|
|
385
|
+
rules: [(m) => m > 0 || "Amount must be greater than 0"]
|
|
386
|
+
}, {
|
|
387
|
+
default: f(() => [
|
|
388
|
+
n(C, {
|
|
389
|
+
"model-value": q(),
|
|
390
|
+
"onUpdate:modelValue": t[4] || (t[4] = (m) => ie(m)),
|
|
391
|
+
onBlur: t[5] || (t[5] = () => h.value = ""),
|
|
392
|
+
type: "number",
|
|
393
|
+
step: 0.01
|
|
394
|
+
}, null, 8, ["model-value"])
|
|
395
|
+
]),
|
|
396
|
+
_: 1
|
|
397
|
+
}, 8, ["model-value", "label", "rules"]),
|
|
398
|
+
n(i, {
|
|
399
|
+
"model-value": (l = o.value.value) == null ? void 0 : l.skuId,
|
|
400
|
+
label: s(a)("inventory.surcharge.form.value.item"),
|
|
401
|
+
"label-mark": "optional"
|
|
402
|
+
}, {
|
|
403
|
+
default: f(() => [
|
|
404
|
+
u("div", {
|
|
405
|
+
class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-300 rounded-md cursor-pointer hover:border-fm-color-neutral-gray-400 transition-colors",
|
|
406
|
+
onClick: ae
|
|
407
|
+
}, [
|
|
408
|
+
u("span", {
|
|
409
|
+
class: G([
|
|
410
|
+
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
411
|
+
w.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"
|
|
412
|
+
])
|
|
413
|
+
}, E(w.value ? `${w.value.code} - ${w.value.name}` : s(a)("inventory.surcharge.form.value.itemPlaceholder")), 3),
|
|
414
|
+
u("div", Ze, [
|
|
415
|
+
w.value ? (j(), Se(I, {
|
|
416
|
+
key: 0,
|
|
417
|
+
variant: "tertiary",
|
|
418
|
+
icon: "close",
|
|
419
|
+
onClick: t[6] || (t[6] = xe((m) => z(null), ["stop"]))
|
|
420
|
+
})) : Fe("", !0),
|
|
421
|
+
n(L, {
|
|
422
|
+
name: "arrow_drop_down",
|
|
423
|
+
size: "md"
|
|
424
|
+
})
|
|
425
|
+
])
|
|
426
|
+
])
|
|
427
|
+
]),
|
|
428
|
+
_: 1
|
|
429
|
+
}, 8, ["model-value", "label"]),
|
|
430
|
+
n(s(Ne), {
|
|
431
|
+
modelValue: b.value,
|
|
432
|
+
"onUpdate:modelValue": t[7] || (t[7] = (m) => b.value = m),
|
|
433
|
+
attributes: ee.value
|
|
434
|
+
}, null, 8, ["modelValue", "attributes"]),
|
|
435
|
+
n(i, {
|
|
436
|
+
"model-value": b.value,
|
|
437
|
+
rules: [(m) => {
|
|
438
|
+
var J;
|
|
439
|
+
return !!((J = m == null ? void 0 : m.rules) != null && J.length) || "At least one rule is required";
|
|
440
|
+
}]
|
|
441
|
+
}, null, 8, ["model-value", "rules"])
|
|
442
|
+
])
|
|
443
|
+
])
|
|
444
|
+
];
|
|
445
|
+
}),
|
|
446
|
+
_: 1
|
|
447
|
+
})
|
|
448
|
+
])
|
|
449
|
+
])
|
|
450
|
+
])
|
|
451
|
+
]),
|
|
452
|
+
_: 1
|
|
453
|
+
}, 8, ["modelValue", "header"])
|
|
454
|
+
], 64);
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
export {
|
|
459
|
+
pt as default
|
|
460
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as I, ref as m, resolveComponent as p, openBlock as i, createBlock as O, withCtx as u, createVNode as y, createElementBlock as v, toDisplayString as g, createElementVNode as T, h as B } from "vue";
|
|
2
2
|
import { F as L } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
3
|
-
import { o as U, u as _ } from "./app-
|
|
3
|
+
import { o as U, u as _ } from "./app-kim0oKgm.js";
|
|
4
4
|
import { useCoreStore as A } from "@feedmepos/mf-common";
|
|
5
5
|
import { useDialog as C, components as V } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as F, a as j } from "./closing-template-
|
|
6
|
+
import { u as F, a as j } from "./closing-template-MLHUWgwA.js";
|
|
7
7
|
const q = U((o, t) => {
|
|
8
8
|
const c = _(), l = A();
|
|
9
9
|
return {
|