@feedmepos/mf-inventory-portal 1.8.0-dev.1 → 1.8.0-dev.3
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-DRXADP0k.js +1498 -0
- package/dist/{ApprovalView-C8_ax05b.js → ApprovalView-hV1msz5Y.js} +9 -9
- package/dist/{BindingsDialog-t0ZY9eh5.js → BindingsDialog-BX1Lopf0.js} +2 -2
- package/dist/{BindingsPicker-C0Qblmml.js → BindingsPicker-BNKW8-XY.js} +2 -2
- package/dist/{BindingsTable-CsqUBbRA.js → BindingsTable-DiLDsL83.js} +4 -4
- package/dist/{BulkReceiveRequestView-DAG-TMox.js → BulkReceiveRequestView-oQh6kFLc.js} +20 -20
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BaMcGU-x.js +151 -0
- package/dist/{ClosingDraftView-CdKp4Ny6.js → ClosingDraftView-sgLoaSf4.js} +20 -20
- package/dist/{ClosingHistoryView-Blyq9-BS.js → ClosingHistoryView-BnE9HrzA.js} +5 -5
- package/dist/{ClosingTemplateView-C326DL4q.js → ClosingTemplateView-BD3Pa11r.js} +302 -291
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DlbyxkMQ.js} +1 -1
- package/dist/{DefaultView-CsIMmQAY.js → DefaultView-CuzvVkfE.js} +5 -5
- package/dist/{DeliveryOrderPrintPreview-eTrMvJzA.js → DeliveryOrderPrintPreview-w-1aAOY1.js} +2 -2
- package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-Bp8bjDU1.js +58 -0
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js → EmailDialog.vue_vue_type_script_setup_true_lang-CxD12Qct.js} +1668 -1671
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CMoQKl_a.js +308 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BqCh_vTP.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CAXnmdUy.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NhOdW33O.js +120 -0
- package/dist/{FmMultiselectDialog-BAw-gp5K.js → FmMultiselectDialog-BqZgHP8s.js} +1 -1
- package/dist/{FmMultiselectDialog-CYUxtxnS.js → FmMultiselectDialog-CULwA_hi.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CI3Y9kDl.js} +6 -6
- package/dist/{ImportView-BmotFC-3.js → ImportView-DqQG673_.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DfvNUu80.js} +1 -1
- package/dist/IngredientGroupView-CyngKxPo.js +1000 -0
- package/dist/{IngredientsView-CZ6E7cXf.js → IngredientsView-pzpP6oXT.js} +309 -296
- package/dist/{IntegrationExplorerView-B15ND4Fg.js → IntegrationExplorerView-C5aAhB6e.js} +4 -4
- package/dist/{IntegrationView-hkNhsqx2.js → IntegrationView-Bqun7nX0.js} +2403 -2408
- package/dist/{InventoryBindingForm-SfuUF0_O.js → InventoryBindingForm-r_Ua1C4a.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYDuu4kU.js} +5 -5
- package/dist/{InventoryBindingSummary-DUcukkyJ.js → InventoryBindingSummary-BQuZLohR.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-7r-QcJdU.js} +1 -1
- package/dist/{ProductionRunDetailView-BwgRX-14.js → ProductionRunDetailView-95fu_CfH.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CdOca1tV.js} +7 -7
- package/dist/{ProductionRunView-CZU7LY9-.js → ProductionRunView-DIjor_Ix.js} +3 -3
- package/dist/{PublishView-DS2FZ66p.js → PublishView-DYObyHQq.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CZa0MVAs.js → PurchaseOrderPrintPreview-C0jCmI9L.js} +2 -2
- package/dist/{ReceiveRequestView-Bk5b3nVB.js → ReceiveRequestView-i7ibPfIE.js} +14 -14
- package/dist/{RecipeView-DvI6X-uN.js → RecipeView-C5VO7yr3.js} +18 -18
- package/dist/SettingsView-CdBloj9k.js +983 -0
- package/dist/{StockView-Z9wGihT7.js → StockView-g_6eJ62R.js} +327 -322
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C1rKc7MA.js} +1 -1
- package/dist/{SupplierView-D8q6siZW.js → SupplierView-DkYp_Frj.js} +451 -447
- package/dist/{SurchargeView-Db_5YFoR.js → SurchargeView-CfkV4Y3y.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-2MtN1p5t.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BtoP4XgE.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CYMjKXq4.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js → TransferDetails.vue_vue_type_script_setup_true_lang-D0zNr_vQ.js} +21 -21
- package/dist/{TransferTemplateView-DtsJzmUr.js → TransferTemplateView-Ne2gYUSn.js} +21 -21
- package/dist/{UnitCostHistoryView-BqDiQ4IE.js → UnitCostHistoryView-Db0_otOb.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BzO1lq7j.js} +4 -4
- package/dist/{UnitView-CM695-VI.js → UnitView-CiCeQ63i.js} +8 -8
- package/dist/{WarehouseView-BdidU4p6.js → WarehouseView-BcuJSOMF.js} +193 -189
- package/dist/{WastageTemplateView-DdhwdXT6.js → WastageTemplateView-CPQmtOKQ.js} +15 -15
- package/dist/api/feature-flags.d.ts +10 -0
- package/dist/api/inventory.d.ts +9 -9
- package/dist/api/license.d.ts +9 -0
- package/dist/{app-Cb5s4jMu.js → app-DqJp3dcI.js} +146 -108
- package/dist/app.d.ts +36 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-DnqnpXxn.js → closing-template-BNlgZviN.js} +1 -1
- package/dist/components/ChangeLocationComponent.vue.d.ts +21 -14
- package/dist/components/DeprecateSoonWarningDialog.vue.d.ts +22 -0
- package/dist/components/FeatureCapabilityBadge.vue.d.ts +29 -0
- package/dist/components/{PreviewBadge.vue.d.ts → FeatureCapabilityGate.vue.d.ts} +10 -7
- package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
- package/dist/components/{PremiumBadge.vue.d.ts → PlanTierBadge.vue.d.ts} +5 -13
- package/dist/components/PlanUpgradeDialog.vue.d.ts +30 -0
- package/dist/composable/useNavigationMenu.d.ts +2 -1
- package/dist/{inventory-core-dart.default-DDRxXXnt.js → core-Js7d-3Pv.js} +121 -118
- package/dist/{date2-BPhD_1Of.js → date2-Ci7521dn.js} +1 -1
- package/dist/{dayjs.min-Zbd6-uVD.js → dayjs.min-Cyp32v4J.js} +1 -1
- package/dist/{decimal-Df6a50Ld.js → decimal-BGdm5R3A.js} +2 -2
- package/dist/{defineDeepModel-Brbsikbi.js → defineDeepModel-B2cJ-rtd.js} +1 -1
- package/dist/{duplicate-template-B9kuShaF.js → duplicate-template-By5WeKZ0.js} +1 -1
- package/dist/feature-fG7d73oi.js +371 -0
- package/dist/feature-flags/core.d.ts +27 -0
- package/dist/feature-flags/core.spec.d.ts +1 -0
- package/dist/feature-flags/navigation-capabilities.d.ts +23 -0
- package/dist/feature-flags/navigation-capabilities.spec.d.ts +1 -0
- package/dist/feature-flags/plan-tier.d.ts +6 -0
- package/dist/feature-flags/plan-tier.spec.d.ts +1 -0
- package/dist/feature-flags/portal-feature-catalog.d.ts +24 -0
- package/dist/feature-flags/vue.d.ts +14 -0
- package/dist/{format-time-from-id-DmUjUcVj.js → format-time-from-id-Q8C2P96H.js} +1 -1
- package/dist/{format-unit-display-CsQA0SQd.js → format-unit-display-CICrmm8r.js} +13 -13
- package/dist/id-to-date-DeN5x0LR.js +67 -0
- package/dist/{import-export.helper-DCQ6oX9s.js → import-export.helper-BOTQWxr6.js} +28 -28
- package/dist/{index-C-mazZwS.js → index-BbbqCCfp.js} +3 -3
- package/dist/{index-BXaIMGnI.js → index-Cxm3Sgfv.js} +1 -1
- package/dist/index-Dqf27vLH.js +841 -0
- package/dist/{index-UmM6gHJ1.js → index-tCYhLCKP.js} +1 -1
- package/dist/{lz-string-Bibw5D_6.js → lz-string-Dy4Pg8mh.js} +1 -1
- package/dist/{netsuite-Bev0OtQT.js → netsuite-BaJjkDM8.js} +2 -2
- package/dist/{number-y_W4pn_d.js → number-CB36d2PQ.js} +3 -3
- package/dist/{predefined-templates-BHvUnTk_.js → predefined-templates-DLm93Bpx.js} +1 -1
- package/dist/{purchase-order-template-DgOKEzhS.js → purchase-order-template-CDhn9ZIF.js} +1 -1
- package/dist/{recalculationUtils-Dv__DzZh.js → recalculationUtils-Cqvefakh.js} +1 -1
- package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-NTfVmGY8.js} +2 -2
- package/dist/{rules-CZTBvenw.js → rules-C8dfM84-.js} +2 -2
- package/dist/{stock-XINW8JOM.js → stock-BGB0Siue.js} +3 -3
- package/dist/{stock-CxCRZo_D.js → stock-Qu5IiN2_.js} +1 -1
- package/dist/stores/feature.d.ts +12 -0
- package/dist/stores/integration/netsuite.d.ts +2 -2
- package/dist/stores/location.d.ts +42 -42
- package/dist/stores/supplier.d.ts +48 -48
- package/dist/stores/warehouse.d.ts +1 -1
- package/dist/{supplier-CkZdeMcl.js → supplier-CZdNOSMN.js} +17 -17
- package/dist/{surcharge-FRSFqjGl.js → surcharge-Cm40oJvU.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-Cm1styDr.js → uom-rules-L-IW4Nwk.js} +1 -1
- package/dist/{use-ingredient-select-dialog-ntAqHX04.js → use-ingredient-select-dialog-B2TDVJM6.js} +2 -2
- package/dist/{use-inventory-binding-dialog-DVIJO8Cl.js → use-inventory-binding-dialog-BJ00hl5f.js} +2 -2
- package/dist/{use-template-enabled-locations-CIZqw-Z8.js → use-template-enabled-locations-DYAPMvo9.js} +2 -2
- package/dist/{use-transfer-locations-CM5vNttA.js → use-transfer-locations-w-9tymYS.js} +2 -2
- package/dist/{useHrmPermission-CslLuBoP.js → useHrmPermission-BFCIo5sA.js} +1 -1
- package/dist/useNavigationMenu-BPHAH5sJ.js +352 -0
- package/dist/{useSseClient-CCV4mPzD.js → useSseClient-CWjRacRs.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
- package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
- package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
- package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
- package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +5 -5
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +34 -34
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
- package/dist/views/settings/FeatureFlagView.vue.d.ts +2 -0
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
- package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
- package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
- package/dist/{vue-i18n-C5j4EQhi.js → vue-i18n-S4YQ9w6a.js} +295 -295
- package/dist/{xlsx.util-B50OvX4z.js → xlsx.util-CP8_VajN.js} +2 -2
- package/package.json +5 -5
- package/dist/App-BXgpGzGR.js +0 -1476
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js +0 -243
- package/dist/IngredientGroupView-qrR9ksEn.js +0 -985
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-3e3kDsbN.js +0 -93
- package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
- package/dist/SettingsView-sThYErMz.js +0 -698
- package/dist/feature-Ckn5ra3z.js +0 -1136
- package/dist/useNavigationMenu-CSinmNCY.js +0 -172
- /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { useCoreStore as c } from "@feedmepos/mf-common";
|
|
2
|
+
import { a as R, u as m, k as P } from "./app-DqJp3dcI.js";
|
|
3
|
+
import { u as p, h as I, p as x } from "./index-Dqf27vLH.js";
|
|
4
|
+
import { ref as C } from "vue";
|
|
5
|
+
import { I as n } from "./core-Js7d-3Pv.js";
|
|
6
|
+
var q = { development: { appEndpoint: { licenseV2: "https://license-v2-dev.feedmeapi.com" } } };
|
|
7
|
+
function W() {
|
|
8
|
+
return q.development.appEndpoint.licenseV2.replace(/\/$/, "");
|
|
9
|
+
}
|
|
10
|
+
async function T(a) {
|
|
11
|
+
var s;
|
|
12
|
+
const t = c(), o = await fetch(`${W()}${a}`, {
|
|
13
|
+
headers: { authorization: `Bearer ${((s = t.sessionUser.value) == null ? void 0 : s.token) ?? ""}` },
|
|
14
|
+
mode: "cors"
|
|
15
|
+
});
|
|
16
|
+
if (!o.ok)
|
|
17
|
+
throw new Error(`License API request failed (${o.status}): ${await o.text()}`);
|
|
18
|
+
return await o.text();
|
|
19
|
+
}
|
|
20
|
+
function F() {
|
|
21
|
+
return {
|
|
22
|
+
async getWarehouseQuota(a) {
|
|
23
|
+
const t = await T(`/api/business/${a}/feature/warehouse`);
|
|
24
|
+
return JSON.parse(t);
|
|
25
|
+
},
|
|
26
|
+
async getInventoryPlan(a) {
|
|
27
|
+
const t = (await T(`/api/restaurant-features/${a}/inventory`)).trim();
|
|
28
|
+
if (!t || t === "null") return null;
|
|
29
|
+
if (t === "Standard" || t === "Premium") return t;
|
|
30
|
+
throw new Error(`Unexpected inventory plan response: ${t}`);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const B = /* @__PURE__ */ new Set([
|
|
35
|
+
// vivo pizza prod
|
|
36
|
+
"business_6687e91fa7240b001ba3f4c2",
|
|
37
|
+
// vivo dev
|
|
38
|
+
"business_669a1d2efc050a001cfbb5a2"
|
|
39
|
+
]), L = /* @__PURE__ */ new Set([
|
|
40
|
+
// zus dev
|
|
41
|
+
"business_671005de24a7f4001c87e25e",
|
|
42
|
+
// zus prod
|
|
43
|
+
"business_6776a1fe205a52001c516efa"
|
|
44
|
+
]);
|
|
45
|
+
function w() {
|
|
46
|
+
return {
|
|
47
|
+
isLoaded: !1,
|
|
48
|
+
planTier: "standard",
|
|
49
|
+
inventoryPlan: null,
|
|
50
|
+
warehouseQuota: [],
|
|
51
|
+
autoReceiveWarehouse: !1,
|
|
52
|
+
businessSupplierOnly: !1,
|
|
53
|
+
enableBackdatePo: !1,
|
|
54
|
+
enableClosingTemplate: !1,
|
|
55
|
+
enableIngredientGroup: !1,
|
|
56
|
+
enablePoTemplate: !1,
|
|
57
|
+
enableTotalCost: !1,
|
|
58
|
+
enableWastageTemplate: !1,
|
|
59
|
+
manualReceive: !1,
|
|
60
|
+
mustUseDefaultCost: !1,
|
|
61
|
+
mustUsePoTemplate: !1,
|
|
62
|
+
enableXilnexTransferNote: !1,
|
|
63
|
+
enableCustomAttribute: !1,
|
|
64
|
+
usePurchaseOrderV2: !1,
|
|
65
|
+
acceptRequireFulfillment: !1,
|
|
66
|
+
useOperatePurchaseOrderV2: !1,
|
|
67
|
+
inventory_xilnex_opening_migration: !1,
|
|
68
|
+
inventory_synergy_opening_migration: !1,
|
|
69
|
+
inventory_netsuite_inventory_transfer_out: !1,
|
|
70
|
+
inventory_portal_supplier_preparation_time: !1,
|
|
71
|
+
inventory_portal_delivery_order_write: !1,
|
|
72
|
+
inventory_pos_transfer_require_fulfillment: !1,
|
|
73
|
+
inventory_backdate_receive: !1,
|
|
74
|
+
inventory_purchase_order_custom_cost: !1,
|
|
75
|
+
inventory_bulk_import: !1,
|
|
76
|
+
inventory_portal_surcharge: !1,
|
|
77
|
+
inventory_purchase_order_cost_edit: !1,
|
|
78
|
+
inventory_purchase_order_price_adjustment: !1,
|
|
79
|
+
inventory_purchase_order_workflow_allow_to_mark_completed: !1,
|
|
80
|
+
inventory_recipe_v2: !1,
|
|
81
|
+
inventory_print_template: !1,
|
|
82
|
+
inventory_purchase_order_email: !1,
|
|
83
|
+
inventory_bulk_edit_recipes: !1,
|
|
84
|
+
inventory_receive_request_beta: !1,
|
|
85
|
+
inventory_portal_production_item: !1,
|
|
86
|
+
report_portal_po_forecast_days_constraint: null,
|
|
87
|
+
report_portal_po_forecast_days_default: 7
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const e = C(w()), G = () => ({
|
|
91
|
+
get businessDbName() {
|
|
92
|
+
var o;
|
|
93
|
+
return `business_${((o = c().currentBusiness.value) == null ? void 0 : o._id) ?? ""}`;
|
|
94
|
+
},
|
|
95
|
+
get isWarehouse() {
|
|
96
|
+
var t;
|
|
97
|
+
return ((t = m()._currentLocation) == null ? void 0 : t.type) === P.enum.warehouse;
|
|
98
|
+
},
|
|
99
|
+
get restaurantPosVersion() {
|
|
100
|
+
var o;
|
|
101
|
+
const a = m();
|
|
102
|
+
return (o = c().restaurants.value.find(
|
|
103
|
+
(s) => {
|
|
104
|
+
var i;
|
|
105
|
+
return s._id === ((i = a._currentLocation) == null ? void 0 : i.doc._id);
|
|
106
|
+
}
|
|
107
|
+
)) == null ? void 0 : o.posVersion;
|
|
108
|
+
},
|
|
109
|
+
get enableTotalCost() {
|
|
110
|
+
return e.value.enableTotalCost;
|
|
111
|
+
},
|
|
112
|
+
get enableBackdatePo() {
|
|
113
|
+
return e.value.enableBackdatePo;
|
|
114
|
+
},
|
|
115
|
+
/** @deprecated TODO: remove */
|
|
116
|
+
get autoReceiveWarehouse() {
|
|
117
|
+
return e.value.autoReceiveWarehouse;
|
|
118
|
+
},
|
|
119
|
+
/** @deprecated TODO: remove */
|
|
120
|
+
get manualReceive() {
|
|
121
|
+
return e.value.manualReceive;
|
|
122
|
+
},
|
|
123
|
+
get isLoaded() {
|
|
124
|
+
return e.value.isLoaded;
|
|
125
|
+
},
|
|
126
|
+
get planTier() {
|
|
127
|
+
return e.value.planTier;
|
|
128
|
+
},
|
|
129
|
+
get inventoryPlan() {
|
|
130
|
+
return e.value.inventoryPlan;
|
|
131
|
+
},
|
|
132
|
+
get warehouseQuota() {
|
|
133
|
+
return e.value.warehouseQuota;
|
|
134
|
+
},
|
|
135
|
+
hasPlanTier(a) {
|
|
136
|
+
return I(e.value.planTier, a);
|
|
137
|
+
},
|
|
138
|
+
get enablePoTemplate() {
|
|
139
|
+
return e.value.enablePoTemplate;
|
|
140
|
+
},
|
|
141
|
+
get enableClosingTemplate() {
|
|
142
|
+
return e.value.enableClosingTemplate;
|
|
143
|
+
},
|
|
144
|
+
get enableWastageTemplate() {
|
|
145
|
+
return e.value.enableWastageTemplate;
|
|
146
|
+
},
|
|
147
|
+
get enableIngredientGroup() {
|
|
148
|
+
return e.value.enableIngredientGroup;
|
|
149
|
+
},
|
|
150
|
+
get mustUsePoTemplate() {
|
|
151
|
+
return e.value.mustUsePoTemplate;
|
|
152
|
+
},
|
|
153
|
+
get businessSupplierOnly() {
|
|
154
|
+
return e.value.businessSupplierOnly;
|
|
155
|
+
},
|
|
156
|
+
get enableXilnexTransferNote() {
|
|
157
|
+
return e.value.enableXilnexTransferNote;
|
|
158
|
+
},
|
|
159
|
+
get enabledXilnexOpeningMigration() {
|
|
160
|
+
return e.value.inventory_xilnex_opening_migration;
|
|
161
|
+
},
|
|
162
|
+
get enabledSynergyOpeningMigration() {
|
|
163
|
+
return e.value.inventory_synergy_opening_migration;
|
|
164
|
+
},
|
|
165
|
+
get enableCustomAttribute() {
|
|
166
|
+
return e.value.enableCustomAttribute;
|
|
167
|
+
},
|
|
168
|
+
get usePurchaseOrderV2() {
|
|
169
|
+
return e.value.usePurchaseOrderV2;
|
|
170
|
+
},
|
|
171
|
+
get acceptRequireFulfillment() {
|
|
172
|
+
return e.value.acceptRequireFulfillment;
|
|
173
|
+
},
|
|
174
|
+
get useOperatePurchaseOrderV2() {
|
|
175
|
+
return e.value.useOperatePurchaseOrderV2;
|
|
176
|
+
},
|
|
177
|
+
get isNetSuiteInventoryTransferOutEnabled() {
|
|
178
|
+
return e.value.inventory_netsuite_inventory_transfer_out;
|
|
179
|
+
},
|
|
180
|
+
get enableSupplierPreparationTime() {
|
|
181
|
+
return e.value.inventory_portal_supplier_preparation_time;
|
|
182
|
+
},
|
|
183
|
+
get enablePortalDeliveryOrderWrite() {
|
|
184
|
+
return e.value.inventory_portal_delivery_order_write ?? !0;
|
|
185
|
+
},
|
|
186
|
+
get enablePOSTransferRequireFulfillment() {
|
|
187
|
+
return e.value.inventory_pos_transfer_require_fulfillment;
|
|
188
|
+
},
|
|
189
|
+
get enableBackdateReceive() {
|
|
190
|
+
return e.value.inventory_backdate_receive;
|
|
191
|
+
},
|
|
192
|
+
get enablePurchaseOrderReceiveWithCustomCost() {
|
|
193
|
+
return e.value.inventory_purchase_order_custom_cost;
|
|
194
|
+
},
|
|
195
|
+
get enableBulkImport() {
|
|
196
|
+
return e.value.inventory_bulk_import;
|
|
197
|
+
},
|
|
198
|
+
get enableSurcharge() {
|
|
199
|
+
return e.value.inventory_portal_surcharge;
|
|
200
|
+
},
|
|
201
|
+
get enablePurchaseOrderCostEdit() {
|
|
202
|
+
return e.value.inventory_purchase_order_cost_edit;
|
|
203
|
+
},
|
|
204
|
+
get enablePurchaseOrderPriceAdjustment() {
|
|
205
|
+
return e.value.inventory_purchase_order_price_adjustment;
|
|
206
|
+
},
|
|
207
|
+
get poWorkflowAllowToMarkCompleted() {
|
|
208
|
+
return e.value.inventory_purchase_order_workflow_allow_to_mark_completed;
|
|
209
|
+
},
|
|
210
|
+
get enableRecipeV2() {
|
|
211
|
+
return e.value.inventory_recipe_v2;
|
|
212
|
+
},
|
|
213
|
+
get enablePrintTemplate() {
|
|
214
|
+
return e.value.inventory_print_template;
|
|
215
|
+
},
|
|
216
|
+
get enablePurchaseOrderEmail() {
|
|
217
|
+
return e.value.inventory_purchase_order_email;
|
|
218
|
+
},
|
|
219
|
+
get enableBulkEditRecipes() {
|
|
220
|
+
return e.value.inventory_bulk_edit_recipes;
|
|
221
|
+
},
|
|
222
|
+
get enableReceiveRequestBeta() {
|
|
223
|
+
return e.value.inventory_receive_request_beta;
|
|
224
|
+
},
|
|
225
|
+
get enableProductionRun() {
|
|
226
|
+
return e.value.inventory_portal_production_item;
|
|
227
|
+
},
|
|
228
|
+
get poForecastDaysConstraint() {
|
|
229
|
+
return e.value.report_portal_po_forecast_days_constraint;
|
|
230
|
+
},
|
|
231
|
+
get poForecastDaysDefault() {
|
|
232
|
+
return e.value.report_portal_po_forecast_days_default;
|
|
233
|
+
},
|
|
234
|
+
async init() {
|
|
235
|
+
const a = c(), { init: t, setBusiness: o } = p(), s = F(), i = R(), u = a.namespace.value === "prod";
|
|
236
|
+
await t({
|
|
237
|
+
apiKey: u ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
|
|
238
|
+
// url: 'https://flag.feedme.farm/api/v1/', // optional -> this is a default URL value
|
|
239
|
+
// enableAnalytics: true, // optional, defaults to true
|
|
240
|
+
// cacheFlags: true // optional, defaults to true
|
|
241
|
+
}), m().watchLocation(async (v) => {
|
|
242
|
+
var g, b, h;
|
|
243
|
+
if (!v) {
|
|
244
|
+
e.value = w();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const d = ((g = a.currentBusiness.value) == null ? void 0 : g._id) ?? "";
|
|
248
|
+
await o(d);
|
|
249
|
+
const [l, _] = await Promise.allSettled([
|
|
250
|
+
s.getInventoryPlan(v.doc._id),
|
|
251
|
+
s.getWarehouseQuota(d)
|
|
252
|
+
]);
|
|
253
|
+
l.status === "rejected" && console.error(
|
|
254
|
+
"Unable to load the inventory plan from the license API",
|
|
255
|
+
l.reason
|
|
256
|
+
), _.status === "rejected" && console.error(
|
|
257
|
+
"Unable to load the warehouse quota from the license API",
|
|
258
|
+
_.reason
|
|
259
|
+
);
|
|
260
|
+
const k = `business_${d}`, S = v.type === P.enum.warehouse, f = (
|
|
261
|
+
// if menu v4, must manual receive && must use outlet app
|
|
262
|
+
((b = a.currentBusiness.value) == null ? void 0 : b.menuVersion) === "v4" && // more guard for businesses using menu v4, only those listed for manual receive will be included
|
|
263
|
+
// TODO: may be removed to use menu version only
|
|
264
|
+
B.has(this.businessDbName)
|
|
265
|
+
), y = L.has(k) || r(n.inventory_portal_must_use_transfer_template), O = r(n.inventory_purchase_order_backdate) && (this.isWarehouse || i.state.closing !== null);
|
|
266
|
+
e.value = {
|
|
267
|
+
isLoaded: !0,
|
|
268
|
+
planTier: x(
|
|
269
|
+
l.status === "fulfilled" ? l.value : null
|
|
270
|
+
),
|
|
271
|
+
inventoryPlan: l.status === "fulfilled" ? l.value : null,
|
|
272
|
+
warehouseQuota: _.status === "fulfilled" ? _.value : [],
|
|
273
|
+
enableTotalCost: ((h = a.currentBusiness.value) == null ? void 0 : h.menuVersion) === "v4",
|
|
274
|
+
enableBackdatePo: O,
|
|
275
|
+
autoReceiveWarehouse: S && !f,
|
|
276
|
+
manualReceive: f,
|
|
277
|
+
enablePoTemplate: y,
|
|
278
|
+
enableClosingTemplate: r(n.inventory_pos_closing_v2),
|
|
279
|
+
enableWastageTemplate: r(n.inventory_pos_adjust_v2_wastage),
|
|
280
|
+
enableIngredientGroup: r(n.inventory_ingredient_group),
|
|
281
|
+
mustUsePoTemplate: y,
|
|
282
|
+
businessSupplierOnly: y,
|
|
283
|
+
enableXilnexTransferNote: r(n.inventory_portal_xilnex_transfer_note),
|
|
284
|
+
enableCustomAttribute: r(n.inventory_portal_custom_attribute),
|
|
285
|
+
usePurchaseOrderV2: r(n.inventory_portal_purchase_order_v2),
|
|
286
|
+
acceptRequireFulfillment: r(
|
|
287
|
+
n.inventory_portal_accept_require_fulfillment
|
|
288
|
+
),
|
|
289
|
+
useOperatePurchaseOrderV2: r(n.inventory_portal_po_operate_v2),
|
|
290
|
+
inventory_xilnex_opening_migration: r(
|
|
291
|
+
n.inventory_xilnex_opening_migration
|
|
292
|
+
),
|
|
293
|
+
inventory_synergy_opening_migration: r(
|
|
294
|
+
n.inventory_synergy_opening_migration
|
|
295
|
+
),
|
|
296
|
+
inventory_netsuite_inventory_transfer_out: r(
|
|
297
|
+
n.inventory_netsuite_inventory_transfer_out
|
|
298
|
+
),
|
|
299
|
+
inventory_portal_supplier_preparation_time: r(
|
|
300
|
+
n.inventory_portal_supplier_preparation_time
|
|
301
|
+
),
|
|
302
|
+
inventory_portal_delivery_order_write: r(
|
|
303
|
+
n.inventory_portal_delivery_order_write
|
|
304
|
+
),
|
|
305
|
+
inventory_pos_transfer_require_fulfillment: r(
|
|
306
|
+
n.inventory_pos_transfer_require_fulfillment
|
|
307
|
+
),
|
|
308
|
+
inventory_backdate_receive: r(n.inventory_backdate_receive),
|
|
309
|
+
inventory_purchase_order_custom_cost: r(
|
|
310
|
+
n.inventory_purchase_order_custom_cost
|
|
311
|
+
),
|
|
312
|
+
inventory_bulk_import: r(n.inventory_bulk_import),
|
|
313
|
+
inventory_portal_surcharge: r(n.inventory_portal_surcharge),
|
|
314
|
+
inventory_purchase_order_cost_edit: r(
|
|
315
|
+
n.inventory_purchase_order_cost_edit
|
|
316
|
+
),
|
|
317
|
+
inventory_purchase_order_price_adjustment: r(
|
|
318
|
+
n.inventory_purchase_order_price_adjustment
|
|
319
|
+
),
|
|
320
|
+
inventory_purchase_order_workflow_allow_to_mark_completed: r(
|
|
321
|
+
n.inventory_purchase_order_workflow_allow_to_mark_completed
|
|
322
|
+
),
|
|
323
|
+
inventory_recipe_v2: r(n.inventory_recipe_v2),
|
|
324
|
+
inventory_print_template: r(n.inventory_print_template),
|
|
325
|
+
inventory_purchase_order_email: r(n.inventory_purchase_order_email),
|
|
326
|
+
inventory_bulk_edit_recipes: r(n.inventory_bulk_edit_recipes),
|
|
327
|
+
inventory_receive_request_beta: r(
|
|
328
|
+
"inventory_receive_request_beta"
|
|
329
|
+
),
|
|
330
|
+
inventory_portal_production_item: r(
|
|
331
|
+
n.inventory_portal_production_item
|
|
332
|
+
),
|
|
333
|
+
report_portal_po_forecast_days_constraint: N(
|
|
334
|
+
"report_portal_po_forecast_days_constraint"
|
|
335
|
+
),
|
|
336
|
+
report_portal_po_forecast_days_default: V(
|
|
337
|
+
"report_portal_po_forecast_days_default",
|
|
338
|
+
7
|
|
339
|
+
)
|
|
340
|
+
};
|
|
341
|
+
}, "feature");
|
|
342
|
+
},
|
|
343
|
+
async awaitFeatureLoaded(a) {
|
|
344
|
+
return new Promise((t) => {
|
|
345
|
+
const o = () => {
|
|
346
|
+
e.value.isLoaded ? t(a()) : setTimeout(o, 100);
|
|
347
|
+
};
|
|
348
|
+
o();
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
function r(a, t) {
|
|
353
|
+
t = t === void 0 ? null : t;
|
|
354
|
+
const { getFlagValue: o } = p();
|
|
355
|
+
return o(a, (s) => s === "true") ?? t;
|
|
356
|
+
}
|
|
357
|
+
function N(a) {
|
|
358
|
+
const { getFlagValue: t } = p();
|
|
359
|
+
return t(a, (s) => s.trim() ? s.trim() : null) ?? null;
|
|
360
|
+
}
|
|
361
|
+
function V(a, t) {
|
|
362
|
+
const { getFlagValue: o } = p();
|
|
363
|
+
return o(a, (i) => {
|
|
364
|
+
const u = parseInt(i, 10);
|
|
365
|
+
return isNaN(u) ? null : u;
|
|
366
|
+
}) ?? t;
|
|
367
|
+
}
|
|
368
|
+
export {
|
|
369
|
+
n as InventoryFeatureFlags,
|
|
370
|
+
G as useFeatureStore
|
|
371
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type InventoryPlanTier } from './plan-tier';
|
|
2
|
+
export interface FeatureDefinition<Key extends string = string> {
|
|
3
|
+
key: Key;
|
|
4
|
+
minimumTier: InventoryPlanTier;
|
|
5
|
+
release?: FeatureRelease;
|
|
6
|
+
}
|
|
7
|
+
export type ReleaseStage = 'off' | 'beta' | 'ga';
|
|
8
|
+
export interface FeatureRelease {
|
|
9
|
+
stage: ReleaseStage;
|
|
10
|
+
}
|
|
11
|
+
export interface FeatureEvaluationContext {
|
|
12
|
+
planTier: InventoryPlanTier;
|
|
13
|
+
businessId?: string;
|
|
14
|
+
locationId?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface FeatureResult {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
stage: ReleaseStage;
|
|
20
|
+
eligible: boolean;
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function defineFeature<Key extends string>(definition: FeatureDefinition<Key>): FeatureDefinition<Key>;
|
|
24
|
+
/**
|
|
25
|
+
* Headless release and plan evaluator; it has no Vue or feature-vendor dependency.
|
|
26
|
+
*/
|
|
27
|
+
export declare function evaluateFeature(feature: FeatureDefinition, context: FeatureEvaluationContext): FeatureResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RouteName } from '@/router/name';
|
|
2
|
+
import { type FeatureDefinition, type FeatureEvaluationContext, type FeatureRelease } from './core';
|
|
3
|
+
import type { InventoryPlanTier } from './plan-tier';
|
|
4
|
+
export interface NavigationCapability {
|
|
5
|
+
route: RouteName;
|
|
6
|
+
module: string;
|
|
7
|
+
tier: InventoryPlanTier;
|
|
8
|
+
description: string;
|
|
9
|
+
featureKey?: string;
|
|
10
|
+
/** Optional staged rollout configuration for this capability. */
|
|
11
|
+
release?: FeatureRelease;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Commercial catalogue for every user-facing portal navigation capability.
|
|
15
|
+
*
|
|
16
|
+
* The Vue navigation consumes this catalogue for tier badges and upgrade
|
|
17
|
+
* dialogs. Existing permission and rollout-feature-flag checks still apply.
|
|
18
|
+
*/
|
|
19
|
+
export declare const navigationCapabilities: readonly NavigationCapability[];
|
|
20
|
+
export declare const navigationFeatures: Record<RouteName, FeatureDefinition<RouteName>>;
|
|
21
|
+
export declare function getNavigationCapability(route: RouteName | undefined): NavigationCapability | null;
|
|
22
|
+
export declare function getNavigationFeature(route: RouteName | undefined): FeatureDefinition<RouteName> | null;
|
|
23
|
+
export declare function evaluateNavigationFeature(route: RouteName | undefined, context: FeatureEvaluationContext): import("./core").FeatureResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const inventoryPlanTiers: readonly ["lite", "standard", "premium"];
|
|
2
|
+
export type InventoryPlanTier = (typeof inventoryPlanTiers)[number];
|
|
3
|
+
/** Converts the license API value to the internal tier name. Null means the Standard baseline. */
|
|
4
|
+
export declare function parseInventoryPlanTier(value: string | null | undefined): InventoryPlanTier;
|
|
5
|
+
/** Whether a business on `current` can use a feature requiring `minimum`. */
|
|
6
|
+
export declare function hasInventoryPlanTier(current: InventoryPlanTier, minimum: InventoryPlanTier): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type FeatureDefinition } from './core';
|
|
2
|
+
import type { InventoryPlanTier } from './plan-tier';
|
|
3
|
+
export type PortalFeatureCategory = InventoryPlanTier | 'beta';
|
|
4
|
+
/** Raw rollout flags that are consumed by inventory-portal UI code. */
|
|
5
|
+
export declare const PORTAL_FEATURE_FLAG_KEYS: Set<string>;
|
|
6
|
+
export declare function isPortalFeatureFlag(flagKey: string): boolean;
|
|
7
|
+
export interface PortalFeatureCatalogueEntry {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
category: PortalFeatureCategory;
|
|
11
|
+
/** Lifecycle notice for features that remain supported for now. */
|
|
12
|
+
deprecateSoon?: boolean;
|
|
13
|
+
controls: string;
|
|
14
|
+
flagKeys?: readonly string[];
|
|
15
|
+
definition?: FeatureDefinition;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Product classification for every portal feature currently controlled by a
|
|
19
|
+
* feature flag. Keep this independent of the vendor flag names so that rollout
|
|
20
|
+
* mechanisms can change without touching component code.
|
|
21
|
+
*/
|
|
22
|
+
export declare const portalFeatureCatalogue: readonly PortalFeatureCatalogueEntry[];
|
|
23
|
+
export declare function getPortalFeature(key: string): PortalFeatureCatalogueEntry | undefined;
|
|
24
|
+
export declare function getPortalFeatureForFlag(flagKey: string): PortalFeatureCatalogueEntry | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ComputedRef, type MaybeRef } from 'vue';
|
|
2
|
+
import { type FeatureDefinition, type FeatureEvaluationContext, type FeatureResult, type ReleaseStage } from './core';
|
|
3
|
+
export interface UseFeatureResult {
|
|
4
|
+
enabled: ComputedRef<boolean>;
|
|
5
|
+
disabled: ComputedRef<boolean>;
|
|
6
|
+
stage: ComputedRef<ReleaseStage>;
|
|
7
|
+
eligible: ComputedRef<boolean>;
|
|
8
|
+
reason: ComputedRef<string | undefined>;
|
|
9
|
+
result: ComputedRef<FeatureResult>;
|
|
10
|
+
}
|
|
11
|
+
/** Vue adapter for the headless feature evaluator. */
|
|
12
|
+
export declare function useFeature(feature: MaybeRef<FeatureDefinition | null>): UseFeatureResult;
|
|
13
|
+
/** Provides the current actor context to the headless evaluator. */
|
|
14
|
+
export declare function useFeatureEvaluationContext(): ComputedRef<FeatureEvaluationContext>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { components as ce, useDialogChild as Pe, useSnackbar as de, useDialog as Me, FmButtonVariant as te } from "@feedmepos/ui-library";
|
|
2
2
|
import { defineStore as pe } from "pinia";
|
|
3
3
|
import { F as xe } from "./form-mode.enum-BKiNVH6A.js";
|
|
4
|
-
import { u as fe } from "./purchase-order-template-
|
|
4
|
+
import { u as fe } from "./purchase-order-template-CDhn9ZIF.js";
|
|
5
5
|
import { ref as I, h as oe, defineComponent as ye, resolveComponent as W, createElementBlock as F, openBlock as O, createElementVNode as N, createCommentVNode as J, normalizeClass as Z, createTextVNode as Be, toDisplayString as q, unref as B, createVNode as z, withCtx as me, Fragment as Y, renderList as ae, onMounted as Le, computed as H, watch as Qe, createSlots as Ue, createBlock as re } from "vue";
|
|
6
|
-
import { a as X, c as ve, r as L, u as ie, m as qe, k as _e, s as Ve, R as we } from "./app-
|
|
6
|
+
import { a as X, c as ve, r as L, u as ie, m as qe, k as _e, s as Ve, R as we } from "./app-DqJp3dcI.js";
|
|
7
7
|
import { useRouter as He } from "vue-router";
|
|
8
|
-
import { a as ze } from "./FmMultiselectDialog-
|
|
9
|
-
import { D as ne, R as U } from "./row-action.enum-
|
|
8
|
+
import { a as ze } from "./FmMultiselectDialog-CULwA_hi.js";
|
|
9
|
+
import { D as ne, R as U } from "./row-action.enum-NTfVmGY8.js";
|
|
10
10
|
import { c as je } from "./component-BmLAdDiY.js";
|
|
11
|
-
import { f as Ye } from "./format-time-from-id-
|
|
11
|
+
import { f as Ye } from "./format-time-from-id-Q8C2P96H.js";
|
|
12
12
|
import { useI18n as he, useCoreStore as Ie } from "@feedmepos/mf-common";
|
|
13
|
-
import { t as K, a as Ce, d as Oe, s as Ae, r as Ke } from "./xlsx.util-
|
|
13
|
+
import { t as K, a as Ce, d as Oe, s as Ae, r as Ke } from "./xlsx.util-CP8_VajN.js";
|
|
14
14
|
import { F as Ge } from "./FmDroppableField-J0tG_U3w.js";
|
|
15
|
-
import { a as G, c as We, t as se, g as ue } from "./number-
|
|
16
|
-
import { f as Je } from "./date2-
|
|
17
|
-
import { u as ge } from "./supplier-
|
|
18
|
-
import { a as Ze, B as Xe } from "./rules-
|
|
19
|
-
import { u as Te } from "./netsuite-
|
|
20
|
-
import { u as et } from "./duplicate-template-
|
|
21
|
-
import { u as tt } from "./vue-i18n-
|
|
15
|
+
import { a as G, c as We, t as se, g as ue } from "./number-CB36d2PQ.js";
|
|
16
|
+
import { f as Je } from "./date2-Ci7521dn.js";
|
|
17
|
+
import { u as ge } from "./supplier-CZdNOSMN.js";
|
|
18
|
+
import { a as Ze, B as Xe } from "./rules-C8dfM84-.js";
|
|
19
|
+
import { u as Te } from "./netsuite-BaJjkDM8.js";
|
|
20
|
+
import { u as et } from "./duplicate-template-By5WeKZ0.js";
|
|
21
|
+
import { u as tt } from "./vue-i18n-S4YQ9w6a.js";
|
|
22
22
|
function De(n) {
|
|
23
23
|
const e = X(), o = n.sku, d = e.skuById[o._id];
|
|
24
24
|
if (d.unit._id !== o.unit._id) return !0;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { d as p, u as F } from "./app-DqJp3dcI.js";
|
|
2
|
+
import { useCoreStore as y } from "@feedmepos/mf-common";
|
|
3
|
+
import { ref as v } from "vue";
|
|
4
|
+
const l = p((e, r) => {
|
|
5
|
+
const t = F(), u = y();
|
|
6
|
+
return {
|
|
7
|
+
async getInventoryForecast() {
|
|
8
|
+
var a;
|
|
9
|
+
const n = ((a = u.currentBusiness.value) == null ? void 0 : a._id) ?? "", s = t.currentLocationId ?? "", c = `${e.dataBackendUrl}/${n}/${s}/inventory-forecast`;
|
|
10
|
+
try {
|
|
11
|
+
return await r.get(c);
|
|
12
|
+
} catch {
|
|
13
|
+
return { skus: [] };
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
async getPurchaseOrderForecast(n, s) {
|
|
17
|
+
var d;
|
|
18
|
+
const c = ((d = u.currentBusiness.value) == null ? void 0 : d._id) ?? "", a = t.currentLocationId ?? "", i = `${e.dataBackendUrl}/${c}/${a}/purchase-order-forecast?days=${n}${s ? `&template_id=${s}` : ""}`;
|
|
19
|
+
try {
|
|
20
|
+
return await r.get(i);
|
|
21
|
+
} catch {
|
|
22
|
+
return { skus: [] };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
function f() {
|
|
28
|
+
return {
|
|
29
|
+
inventoryForecast: { skus: [] },
|
|
30
|
+
purchaseOrderForecast: { skus: [] }
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const o = v(f());
|
|
34
|
+
function g() {
|
|
35
|
+
return {
|
|
36
|
+
// state
|
|
37
|
+
get inventoryForecast() {
|
|
38
|
+
return o.value.inventoryForecast;
|
|
39
|
+
},
|
|
40
|
+
set inventoryForecast(e) {
|
|
41
|
+
o.value.inventoryForecast = e;
|
|
42
|
+
},
|
|
43
|
+
get purchaseOrderForecast() {
|
|
44
|
+
return o.value.purchaseOrderForecast;
|
|
45
|
+
},
|
|
46
|
+
set purchaseOrderForecast(e) {
|
|
47
|
+
o.value.purchaseOrderForecast = e;
|
|
48
|
+
},
|
|
49
|
+
// actions
|
|
50
|
+
async readStockEstimateBalance() {
|
|
51
|
+
const e = l();
|
|
52
|
+
this.inventoryForecast = await e.getInventoryForecast();
|
|
53
|
+
},
|
|
54
|
+
async readPurchaseOrder(e, r) {
|
|
55
|
+
const t = l();
|
|
56
|
+
this.purchaseOrderForecast = await t.getPurchaseOrderForecast(e, r);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function m(e) {
|
|
61
|
+
let r = e.substring(e.indexOf("_") + 1);
|
|
62
|
+
return r.includes("_") && (r = r.substring(0, r.lastIndexOf("_"))), Number.isNaN(Date.parse(r)) ? null : new Date(r).toISOString();
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
m as i,
|
|
66
|
+
g as u
|
|
67
|
+
};
|