@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
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, openBlock as n, createElementBlock as s, createElementVNode as r, createTextVNode as a, toDisplayString as o, Fragment as d, renderList as m } from "vue";
|
|
2
|
-
const u = { class: "w-[400px] h-[100px]" }, p = { class: "font-bold text-neutral-500 mx-1" }, _ = { class: "mt-3" }, g = /* @__PURE__ */ c({
|
|
3
|
-
__name: "CannotDelete",
|
|
4
|
-
props: {
|
|
5
|
-
subject: {
|
|
6
|
-
type: String
|
|
7
|
-
},
|
|
8
|
-
items: {
|
|
9
|
-
type: Array,
|
|
10
|
-
default: () => []
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
setup(e) {
|
|
14
|
-
return (t, f) => (n(), s("div", u, [
|
|
15
|
-
r("div", null, [
|
|
16
|
-
a(" Cannot delete "),
|
|
17
|
-
r("span", p, o(e.subject), 1),
|
|
18
|
-
a(" because this unit is linked in these inventory items: ")
|
|
19
|
-
]),
|
|
20
|
-
r("ol", _, [
|
|
21
|
-
(n(!0), s(d, null, m(e.items, (i, l) => (n(), s("li", {
|
|
22
|
-
class: "pl-5 font-bold text-neutral-500",
|
|
23
|
-
key: l
|
|
24
|
-
}, " • (" + o(i.module) + ") " + o(i.name), 1))), 128))
|
|
25
|
-
])
|
|
26
|
-
]));
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
function x(e) {
|
|
30
|
-
return e.errorResponse.error === "validation failed" && Array.isArray(e.errorResponse.message) && e.errorResponse.message.every(
|
|
31
|
-
(t) => typeof t.module == "string" && typeof t.name == "string"
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
g as _,
|
|
36
|
-
x as i
|
|
37
|
-
};
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { n as j, j as $, ad as l, a4 as x, J as H, K as q, ae as Y, c as V, aa as W, w as G, b as J, a as K } from "./app-Chj8x632.js";
|
|
2
|
-
import { ref as h, computed as Q } from "vue";
|
|
3
|
-
import { i as Z } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DlIq3AyC.js";
|
|
4
|
-
import { F as C } from "./row-action.enum-PMKMRrZR.js";
|
|
5
|
-
import { useDialog as z, useSnackbar as X } from "@feedmepos/ui-library";
|
|
6
|
-
const ee = j((a, t) => {
|
|
7
|
-
const n = $();
|
|
8
|
-
return {
|
|
9
|
-
async readRequests(o) {
|
|
10
|
-
const c = o ?? n.currentLocationDBName, s = `${a.inventoryBackendUrl}/${c}/purchase-request`;
|
|
11
|
-
return await t.get(s);
|
|
12
|
-
},
|
|
13
|
-
async getPurchaseOrders({
|
|
14
|
-
start: o,
|
|
15
|
-
end: c
|
|
16
|
-
}) {
|
|
17
|
-
const s = n.currentLocationDBName, d = `${a.inventoryBackendUrl}/${s}/purchase-order`;
|
|
18
|
-
return await t.get(`${d}?start=${o}&end=${c}`);
|
|
19
|
-
},
|
|
20
|
-
async getPurchaseOrderById(o) {
|
|
21
|
-
const c = n.currentLocationDBName, s = `${a.inventoryBackendUrl}/${c}/purchase-order`;
|
|
22
|
-
return await t.get(`${s}/${o}`);
|
|
23
|
-
},
|
|
24
|
-
async processPurchaseOrder(o, c) {
|
|
25
|
-
const s = n.currentLocationDBName, d = c || s, p = `${a.inventoryBackendUrl}/${d}/purchase-order/run-operation`;
|
|
26
|
-
return await t.put(p, o);
|
|
27
|
-
},
|
|
28
|
-
async createPurchaseOrder(o) {
|
|
29
|
-
const c = n.currentLocationDBName, s = `${a.inventoryBackendUrl}/${c}/purchase-order`;
|
|
30
|
-
return await t.post(s, o);
|
|
31
|
-
},
|
|
32
|
-
async updatePurchaseOrder(o) {
|
|
33
|
-
const c = n.currentLocationDBName, s = `${a.inventoryBackendUrl}/${c}/purchase-order`;
|
|
34
|
-
return await t.put(s, o);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}), re = {
|
|
38
|
-
[l.enum.confirmDraft]: {
|
|
39
|
-
primaryActions: {
|
|
40
|
-
text: "Confirm draft",
|
|
41
|
-
close: !0
|
|
42
|
-
},
|
|
43
|
-
title: "Confirm draft?",
|
|
44
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
45
|
-
successMessage: "Purchase order draft has been confirmed"
|
|
46
|
-
},
|
|
47
|
-
[l.enum.cancelDraft]: {
|
|
48
|
-
primaryActions: {
|
|
49
|
-
text: "Cancel draft",
|
|
50
|
-
close: !0,
|
|
51
|
-
variant: "destructive"
|
|
52
|
-
},
|
|
53
|
-
title: "Cancel draft?",
|
|
54
|
-
message: "Purchase order cannot be changed after cancelled draft.",
|
|
55
|
-
successMessage: "Purchase order draft has been cancelled"
|
|
56
|
-
},
|
|
57
|
-
[l.enum.submitRequest]: {
|
|
58
|
-
primaryActions: {
|
|
59
|
-
text: "Submit request",
|
|
60
|
-
close: !0
|
|
61
|
-
},
|
|
62
|
-
title: "Confirm draft?",
|
|
63
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
64
|
-
successMessage: "Purchase order draft has been submitted"
|
|
65
|
-
},
|
|
66
|
-
[l.enum.completeReceive]: {
|
|
67
|
-
primaryActions: {
|
|
68
|
-
text: "Mark received",
|
|
69
|
-
close: !0
|
|
70
|
-
},
|
|
71
|
-
title: "Mark as received",
|
|
72
|
-
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
73
|
-
successMessage: "Purchase order has been marked as received"
|
|
74
|
-
},
|
|
75
|
-
[l.enum.approveRequest]: {
|
|
76
|
-
primaryActions: {
|
|
77
|
-
text: "Approve request",
|
|
78
|
-
close: !0
|
|
79
|
-
},
|
|
80
|
-
title: "Approve request?",
|
|
81
|
-
message: "Purchase order will be approved.",
|
|
82
|
-
successMessage: "Purchase order has been approved"
|
|
83
|
-
},
|
|
84
|
-
[l.enum.rejectRequest]: {
|
|
85
|
-
primaryActions: {
|
|
86
|
-
text: "Reject request",
|
|
87
|
-
close: !0,
|
|
88
|
-
variant: "destructive"
|
|
89
|
-
},
|
|
90
|
-
title: "Reject request?",
|
|
91
|
-
message: "Purchase order will be rejected.",
|
|
92
|
-
successMessage: "Purchase order has been rejected"
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
function ue(a) {
|
|
96
|
-
const t = O(a);
|
|
97
|
-
return t === null ? "" : x(t);
|
|
98
|
-
}
|
|
99
|
-
function O(a) {
|
|
100
|
-
const t = a.match(/\w+_(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z).*/);
|
|
101
|
-
if (!t) return null;
|
|
102
|
-
const n = /* @__PURE__ */ new Date(`${t[1]}`);
|
|
103
|
-
return isNaN(n.getTime()) ? null : n;
|
|
104
|
-
}
|
|
105
|
-
function ie(a, t) {
|
|
106
|
-
const n = z(), o = $(), c = J(), s = h(!1), d = X(), p = ee(), y = h(new Array()), P = h(
|
|
107
|
-
t != null && t.startDate && (t != null && t.endDate) ? t : Z()
|
|
108
|
-
), E = Q(() => {
|
|
109
|
-
const r = new Date(P.value.startDate), e = new Date(P.value.endDate);
|
|
110
|
-
return {
|
|
111
|
-
start: H(r).toISOString(),
|
|
112
|
-
end: q(e).toISOString()
|
|
113
|
-
};
|
|
114
|
-
}), D = h(new Array()), T = Y(), S = h(null), g = h();
|
|
115
|
-
function U(r) {
|
|
116
|
-
const e = {
|
|
117
|
-
mode: C.CREATE,
|
|
118
|
-
modelValue: r || void 0,
|
|
119
|
-
show: !0,
|
|
120
|
-
"onUpdate:show"(u) {
|
|
121
|
-
g.value.show = u;
|
|
122
|
-
},
|
|
123
|
-
lastClosingDate: S.value
|
|
124
|
-
};
|
|
125
|
-
g.value = e;
|
|
126
|
-
}
|
|
127
|
-
function M(r) {
|
|
128
|
-
const e = {
|
|
129
|
-
mode: C.UPDATE,
|
|
130
|
-
modelValue: V(r),
|
|
131
|
-
show: !0,
|
|
132
|
-
"onUpdate:show"(u) {
|
|
133
|
-
g.value.show = u;
|
|
134
|
-
},
|
|
135
|
-
lastClosingDate: S.value
|
|
136
|
-
};
|
|
137
|
-
g.value = e;
|
|
138
|
-
}
|
|
139
|
-
async function B() {
|
|
140
|
-
y.value = [], s.value = !0;
|
|
141
|
-
try {
|
|
142
|
-
y.value = await p.getPurchaseOrders(E.value).then((u) => u.sort((i, m) => m._id.localeCompare(i._id)));
|
|
143
|
-
const r = await T.readLastClosing(!0), e = r == null ? void 0 : r._id;
|
|
144
|
-
e && (S.value = O(e));
|
|
145
|
-
} catch {
|
|
146
|
-
d.open({
|
|
147
|
-
title: "Something went wrong",
|
|
148
|
-
message: "Error at fetching purchase orders",
|
|
149
|
-
type: "error"
|
|
150
|
-
});
|
|
151
|
-
} finally {
|
|
152
|
-
s.value = !1;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
async function _() {
|
|
156
|
-
D.value = [], s.value = !0;
|
|
157
|
-
try {
|
|
158
|
-
D.value = await p.readRequests();
|
|
159
|
-
} catch {
|
|
160
|
-
d.open({
|
|
161
|
-
title: "Something went wrong",
|
|
162
|
-
message: "Error at fetching purchase requests",
|
|
163
|
-
type: "error"
|
|
164
|
-
});
|
|
165
|
-
} finally {
|
|
166
|
-
s.value = !1;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function w() {
|
|
170
|
-
switch (a) {
|
|
171
|
-
case "receive/request":
|
|
172
|
-
return B();
|
|
173
|
-
case "approval":
|
|
174
|
-
return _();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function k(r, e) {
|
|
178
|
-
P.value = {
|
|
179
|
-
startDate: r,
|
|
180
|
-
endDate: e
|
|
181
|
-
}, w();
|
|
182
|
-
}
|
|
183
|
-
o.watchLocation(async (r) => {
|
|
184
|
-
if (!r) {
|
|
185
|
-
y.value = [];
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
await w();
|
|
189
|
-
});
|
|
190
|
-
const v = h(), N = h(Math.random().toString());
|
|
191
|
-
async function F(r, e) {
|
|
192
|
-
var f, b;
|
|
193
|
-
const u = Math.random().toString();
|
|
194
|
-
N.value = u;
|
|
195
|
-
const i = a === "receive/request" ? o.currentLocation : e == null ? void 0 : e.to, m = {
|
|
196
|
-
purchaseOrder: r,
|
|
197
|
-
transferTo: i == null ? void 0 : i.name,
|
|
198
|
-
transferToDbName: i == null ? void 0 : i.dbName,
|
|
199
|
-
show: !0,
|
|
200
|
-
canResubmit: !1,
|
|
201
|
-
canApprove: a === "approval",
|
|
202
|
-
"onUpdate:show"(A) {
|
|
203
|
-
v.value.show = A;
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
if (v.value = m, !(e || r.status !== W.enum.REQUESTING)) {
|
|
207
|
-
try {
|
|
208
|
-
e = (await p.readRequests(
|
|
209
|
-
`${r.supplier.internal}_${r.supplier._id}`
|
|
210
|
-
)).find((R) => R.purchaseOrderId === r._id);
|
|
211
|
-
} catch {
|
|
212
|
-
console.error("Error at fetching po request to check");
|
|
213
|
-
}
|
|
214
|
-
u === N.value && (v.value.canResubmit = !e, v.value.transferTo = (f = e == null ? void 0 : e.to) == null ? void 0 : f.name, v.value.transferToDbName = (b = e == null ? void 0 : e.to) == null ? void 0 : b.dbName);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
async function L(r, e, u, i) {
|
|
218
|
-
s.value = !0;
|
|
219
|
-
try {
|
|
220
|
-
await p.processPurchaseOrder(
|
|
221
|
-
{
|
|
222
|
-
operation: e,
|
|
223
|
-
doc: r,
|
|
224
|
-
options: (
|
|
225
|
-
// auto receive for supplier to warehouse
|
|
226
|
-
(e === l.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
227
|
-
e === l.enum.completeReceive) && c.autoReceiveWarehouse ? {
|
|
228
|
-
autoReceive: !0
|
|
229
|
-
} : void 0
|
|
230
|
-
)
|
|
231
|
-
},
|
|
232
|
-
i
|
|
233
|
-
), await new Promise((b) => setTimeout(b, 1e3));
|
|
234
|
-
const f = $().currentLocationDBName.startsWith("restaurant_");
|
|
235
|
-
e === l.enum.confirmDraft && r.effectiveAt && f ? d.open({
|
|
236
|
-
title: "Success",
|
|
237
|
-
message: `${u}. The backdate will be reflected once your POS has received this change.`,
|
|
238
|
-
type: "success"
|
|
239
|
-
}) : d.open({
|
|
240
|
-
title: "Success",
|
|
241
|
-
message: u,
|
|
242
|
-
type: "success"
|
|
243
|
-
});
|
|
244
|
-
} catch (m) {
|
|
245
|
-
d.open({
|
|
246
|
-
title: "Something went wrong",
|
|
247
|
-
message: "Please try again.",
|
|
248
|
-
type: "error"
|
|
249
|
-
}), console.error("Error when submitting PO operation", e, r, m);
|
|
250
|
-
} finally {
|
|
251
|
-
s.value = !1, w();
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
async function I(r, e, u) {
|
|
255
|
-
const i = re[e];
|
|
256
|
-
if (!i) {
|
|
257
|
-
d.open({
|
|
258
|
-
title: "Something went wrong",
|
|
259
|
-
message: `Cannot process order: ${G(e)}`,
|
|
260
|
-
type: "error"
|
|
261
|
-
});
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
const { successMessage: m, ...f } = i;
|
|
265
|
-
n.open({
|
|
266
|
-
title: f.title,
|
|
267
|
-
message: f.message,
|
|
268
|
-
primaryActions: f.primaryActions
|
|
269
|
-
}).onPrimary(() => {
|
|
270
|
-
L(r, e, m, u);
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
return {
|
|
274
|
-
purchaseOrders: y,
|
|
275
|
-
purchaseRequests: D,
|
|
276
|
-
updateDateRange: k,
|
|
277
|
-
fetchData: w,
|
|
278
|
-
loading: s,
|
|
279
|
-
transferDialogProps: g,
|
|
280
|
-
promptCreateTransferDialog: U,
|
|
281
|
-
promptUpdateTransferDialog: M,
|
|
282
|
-
transferDetailsProps: v,
|
|
283
|
-
promptShowTransferDetails: F,
|
|
284
|
-
submitAction: I
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function de(a, t, n) {
|
|
288
|
-
const o = (n == null ? void 0 : n.abbrev) ?? t.abbrev;
|
|
289
|
-
return `${K(a, !1)} ${o}`;
|
|
290
|
-
}
|
|
291
|
-
var te = /* @__PURE__ */ ((a) => (a.PURCHASE = "PURCHASE", a.TRANSFER = "TRANSFER", a))(te || {});
|
|
292
|
-
export {
|
|
293
|
-
te as P,
|
|
294
|
-
de as a,
|
|
295
|
-
ee as b,
|
|
296
|
-
re as d,
|
|
297
|
-
ue as f,
|
|
298
|
-
ie as u
|
|
299
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { n as o, j as s, Q as u, T as c } from "./app-Chj8x632.js";
|
|
2
|
-
import { defineStore as l } from "pinia";
|
|
3
|
-
import { ref as d } from "vue";
|
|
4
|
-
const n = o((t, e) => {
|
|
5
|
-
const r = s();
|
|
6
|
-
return {
|
|
7
|
-
async readSuppliers() {
|
|
8
|
-
const p = r.currentLocation.dbName, a = `${t.inventoryBackendUrl}/${p}/supplier`;
|
|
9
|
-
return await e.get(a);
|
|
10
|
-
},
|
|
11
|
-
async createSupplier(p) {
|
|
12
|
-
const a = r.currentLocation.dbName, i = `${t.inventoryBackendUrl}/${a}/supplier`;
|
|
13
|
-
return await e.post(i, p);
|
|
14
|
-
},
|
|
15
|
-
async updateSupplier(p) {
|
|
16
|
-
const a = r.currentLocation.dbName, i = `${t.inventoryBackendUrl}/${a}/supplier`;
|
|
17
|
-
return await e.put(i, p);
|
|
18
|
-
},
|
|
19
|
-
async deleteSupplier(p) {
|
|
20
|
-
const a = r.currentLocation.dbName, i = `${t.inventoryBackendUrl}/${a}/supplier`;
|
|
21
|
-
return await e.delete(i, p);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}), m = l("supplier", () => {
|
|
25
|
-
const t = d(new Array());
|
|
26
|
-
return {
|
|
27
|
-
// action
|
|
28
|
-
async readSuppliers() {
|
|
29
|
-
const e = n();
|
|
30
|
-
t.value = await e.readSuppliers();
|
|
31
|
-
},
|
|
32
|
-
async createSupplier(e) {
|
|
33
|
-
await n().createSupplier(e);
|
|
34
|
-
},
|
|
35
|
-
async updateSupplier(e) {
|
|
36
|
-
await n().updateSupplier(e);
|
|
37
|
-
},
|
|
38
|
-
async deleteSupplier(e) {
|
|
39
|
-
await n().deleteSupplier(e);
|
|
40
|
-
},
|
|
41
|
-
async init() {
|
|
42
|
-
const e = u();
|
|
43
|
-
try {
|
|
44
|
-
await this.readSuppliers();
|
|
45
|
-
} catch (r) {
|
|
46
|
-
throw r instanceof c || e.error("Error at reading suppliers"), r;
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
suppliers: t
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
export {
|
|
53
|
-
m as u
|
|
54
|
-
};
|