@feedmepos/mf-inventory-portal 0.0.23-dev.9 → 0.0.24-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App-D3sNH2MR.js +276 -0
- package/dist/{ApprovalView-e85YmdZN.js → ApprovalView-DHnRx0hJ.js} +17 -20
- package/dist/{BindingsDialog-giBUD0IH.js → BindingsDialog-oTeg2Dai.js} +6 -6
- package/dist/{BindingsPicker-CC4MmPbF.js → BindingsPicker-CWdjmMJ3.js} +8 -9
- package/dist/{BindingsTable-WphZdzrA.js → BindingsTable-bKLR1OKX.js} +18 -22
- package/dist/ClosingDraftView-CIQVz7lY.js +1225 -0
- package/dist/{ClosingTemplateView-1lzoDyet.js → ClosingTemplateView-D5pLzQwU.js} +259 -274
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-ClLDcchC.js +142 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Cv-vvzr5.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B_c6Vn6P.js} +23 -24
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DIFQcrc0.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DhpHOaRH.js} +50 -51
- package/dist/{IngredientGroupView-UegBM_JK.js → IngredientGroupView-4C437mso.js} +63 -70
- package/dist/IngredientsView-DoiGgjre.js +1706 -0
- package/dist/{IntegrationView-FYNNzKia.js → IntegrationView-8ZKE7MAM.js} +123 -126
- package/dist/{InventoryBindingForm-DsHv_IHG.js → InventoryBindingForm-CcnfliYQ.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BURSXafS.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B_J-6C9x.js} +116 -108
- package/dist/{InventoryBindingSummary-BLb4MRPZ.js → InventoryBindingSummary-CRdHCzNE.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BG78-DHs.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2-TypU0.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CqID5_7v.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BuQde75S.js} +20 -21
- package/dist/PublishView-t5gjGmK_.js +192 -0
- package/dist/{PurchaseOrderPrintPreview-BBMU3teq.js → PurchaseOrderPrintPreview-6i53Y-v1.js} +13 -14
- package/dist/ReceiveRequestView-uOeSh0Mr.js +1866 -0
- package/dist/RecipeView-BTWywckD.js +609 -0
- package/dist/StockView-DN2xk8ei.js +1817 -0
- package/dist/{SupplierView-B2aObtwK.js → SupplierView-l0XUg3J4.js} +185 -196
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CWMn6fFf.js +1327 -0
- package/dist/TransferTemplateView-wDKXpCWZ.js +1263 -0
- package/dist/UnitView-CUI-k-tS.js +648 -0
- package/dist/{WarehouseView-G8pej6Y2.js → WarehouseView-WsI_eG5r.js} +190 -197
- package/dist/api/adjustment-template.d.ts +25 -0
- package/dist/api/bill.d.ts +240 -84
- package/dist/api/inventory.d.ts +19 -6
- package/dist/api/netsuite.d.ts +3 -3
- package/dist/app-DntcWR3_.js +85558 -0
- package/dist/app.d.ts +85 -0
- package/dist/app.js +2 -2
- package/dist/components/FmCustomAttribute.vue.d.ts +23 -0
- package/dist/components/FmLockableField.vue.d.ts +37 -0
- package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +3 -1
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +3 -1
- package/dist/composable/defineDeepModel.d.ts +1 -1
- package/dist/{decimal-DC07xoJW.js → decimal-DTCTnMwO.js} +1 -1
- package/dist/format-unit-display-Hy48Iw5j.js +1215 -0
- package/dist/index-Bv9RYyTZ.js +29202 -0
- package/dist/{StockView-C5btudss.js → index-D4yJP9I2.js} +2220 -3863
- package/dist/layout/SingleColumnLayout.vue.d.ts +1 -0
- package/dist/router/name.d.ts +2 -0
- package/dist/stock-BsdmfT-b.js +125 -0
- package/dist/stores/feature.d.ts +41 -1
- package/dist/stores/integration/netsuite.d.ts +3 -2
- package/dist/stores/inventory.d.ts +20 -8
- package/dist/stores/location.d.ts +29 -1
- package/dist/stores/supplier.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/supplier-CXhkgC4M.js +77 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-B0G2XYSw.js → use-inventory-binding-dialog-DPMJmBCr.js} +10 -11
- package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +2 -0
- package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +18 -0
- package/dist/views/adjustment-template/import/export.d.ts +60 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +2 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +22 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +6 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplateReason.vue.d.ts +18 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +2 -0
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +1377 -0
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +16 -0
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +35 -0
- package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +20 -0
- package/dist/views/adjustment-template/wastage-template/props.d.ts +36 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +1351 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +198 -12
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +7 -4
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1559 -467
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +19 -0
- package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +4 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +2 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +72 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +73 -13
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +6 -3
- package/dist/views/ingredients/components/convert/ConvertFormProps.d.ts +1 -0
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +4 -2
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +1 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +2 -1
- package/dist/views/publish/PublishView.vue.d.ts +2 -0
- package/dist/views/receive-request/components/netsuite/NetSuiteInfo.vue.d.ts +12 -0
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +13 -0
- package/dist/views/receive-request/components/netsuite/NetSuiteSync.vue.d.ts +12 -0
- package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +13 -0
- package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +86 -17
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +4 -2
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +126 -24
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +126 -24
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +120 -42
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +6 -4
- package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +4 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +2 -1
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +72 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +72 -12
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +2 -1
- package/dist/vue-i18n-ByVzHsI7.js +2365 -0
- package/package.json +5 -4
- package/dist/App-ByLgARNp.js +0 -259
- package/dist/ClosingDraftView-CQM1Sx45.js +0 -755
- package/dist/FmDroppableField-8RzKjEdL.js +0 -154
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BvkN-71q.js +0 -436
- package/dist/FmMultiselectDialog-DScMA6iG.js +0 -415
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-t4pim_k9.js +0 -51
- package/dist/IngredientsView-BfW-jZLM.js +0 -1666
- package/dist/ReceiveRequestView-vbANEzne.js +0 -4165
- package/dist/RecipeView-DW4DY0C0.js +0 -598
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +0 -135
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-B2LOvVef.js +0 -1229
- package/dist/TransferTemplateView-BKumN_p6.js +0 -1262
- package/dist/UnitView-CHLucv9s.js +0 -648
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BXjk74IB.js +0 -33538
- package/dist/date2-CWAt9bRf.js +0 -117
- package/dist/dayjs.min-D3jPOnu6.js +0 -282
- package/dist/defineDeepModel-CiD4GtOw.js +0 -13
- package/dist/feature-6tcLMotY.js +0 -92
- package/dist/form-mode.enum-BKiNVH6A.js +0 -4
- package/dist/format-time-from-id-CYU5Z9Mt.js +0 -15
- package/dist/format-unit-display-CY-0bznr.js +0 -1217
- package/dist/fuzzy-BMkhNYLR.js +0 -41
- package/dist/index-BXwQa14X.js +0 -45
- package/dist/index-CRLd5xyg.js +0 -22283
- package/dist/index-DqwAtOgI.js +0 -12087
- package/dist/netsuite-fYUUk_ss.js +0 -225
- package/dist/row-action.enum-7rGLGZ5v.js +0 -55
- package/dist/rules-BmRGm3yv.js +0 -203
- package/dist/stock-CEX0DP2B.js +0 -111
- package/dist/supplier-CdJmZr7w.js +0 -77
- package/dist/use-template-enabled-locations-2-xbPJWHCs.js +0 -86
- package/dist/xlsx-CTOKp7SQ.js +0 -24004
- package/dist/xlsx.util-D5NFSfDg.js +0 -78
|
@@ -1,1229 +0,0 @@
|
|
|
1
|
-
import { ref as L, computed as Y, h as ee, defineComponent as Qe, resolveComponent as se, openBlock as p, createBlock as W, unref as n, isRef as We, withCtx as fe, createElementVNode as r, createElementBlock as D, createVNode as z, createCommentVNode as q, Fragment as ae, toDisplayString as v, normalizeClass as pe, renderList as ve } from "vue";
|
|
2
|
-
import { i as Je } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BvkN-71q.js";
|
|
3
|
-
import { k as Ze, u as he, G as w, r as Xe, c as Ue, y as U, s as Le, w as Ee } from "./app-BXjk74IB.js";
|
|
4
|
-
import { t as et, b as tt, h as je, d as $e } from "./date2-CWAt9bRf.js";
|
|
5
|
-
import { F as Ie } from "./form-mode.enum-BKiNVH6A.js";
|
|
6
|
-
import { useDialog as Be, useSnackbar as Ke, useProxiedModel as rt } from "@feedmepos/ui-library";
|
|
7
|
-
import { p as st, f as be } from "./format-time-from-id-CYU5Z9Mt.js";
|
|
8
|
-
import { u as Ve } from "./feature-6tcLMotY.js";
|
|
9
|
-
import { b as at, u as nt, f as Ge, P as ne } from "./format-unit-display-CY-0bznr.js";
|
|
10
|
-
import { c as Fe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
11
|
-
import { D as M, R as T } from "./row-action.enum-7rGLGZ5v.js";
|
|
12
|
-
import { i as Re, c as ye, a as ie, k as ot, j as Me } from "./rules-BmRGm3yv.js";
|
|
13
|
-
import { F as lt } from "./decimal-DC07xoJW.js";
|
|
14
|
-
import { useI18n as He } from "@feedmepos/mf-common";
|
|
15
|
-
import { E as ct } from "./empty-placeholder-wf6-BWE8.js";
|
|
16
|
-
import { u as it } from "./netsuite-fYUUk_ss.js";
|
|
17
|
-
const ze = Ze((m, _) => {
|
|
18
|
-
const i = he();
|
|
19
|
-
return {
|
|
20
|
-
async readRequests(s) {
|
|
21
|
-
const S = s ?? i.currentLocationDBName, g = `${m.inventoryBackendUrl}/${S}/purchase-request`;
|
|
22
|
-
return await _.get(g);
|
|
23
|
-
},
|
|
24
|
-
async getPurchaseOrders({
|
|
25
|
-
start: s,
|
|
26
|
-
end: S
|
|
27
|
-
}) {
|
|
28
|
-
const g = i.currentLocationDBName, N = `${m.inventoryBackendUrl}/${g}/purchase-order`;
|
|
29
|
-
return await _.get(`${N}?start=${s}&end=${S}`);
|
|
30
|
-
},
|
|
31
|
-
async getPurchaseOrderById(s) {
|
|
32
|
-
const S = i.currentLocationDBName, g = `${m.inventoryBackendUrl}/${S}/purchase-order`;
|
|
33
|
-
return await _.get(`${g}/${s}`);
|
|
34
|
-
},
|
|
35
|
-
async processPurchaseOrder(s, S) {
|
|
36
|
-
const g = i.currentLocationDBName, N = S || g, P = `${m.inventoryBackendUrl}/${N}/purchase-order/run-operation`;
|
|
37
|
-
return await _.put(P, s);
|
|
38
|
-
},
|
|
39
|
-
async createPurchaseOrder(s) {
|
|
40
|
-
const S = i.currentLocationDBName, g = `${m.inventoryBackendUrl}/${S}/purchase-order`;
|
|
41
|
-
return await _.post(g, s);
|
|
42
|
-
},
|
|
43
|
-
async updatePurchaseOrder(s) {
|
|
44
|
-
const S = i.currentLocationDBName, g = `${m.inventoryBackendUrl}/${S}/purchase-order`;
|
|
45
|
-
return await _.put(g, s);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}), Ye = {
|
|
49
|
-
[w.enum.confirmDraft]: {
|
|
50
|
-
primaryActions: {
|
|
51
|
-
text: "Confirm draft",
|
|
52
|
-
close: !0
|
|
53
|
-
},
|
|
54
|
-
title: "Confirm draft?",
|
|
55
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
56
|
-
successMessage: "Purchase order draft has been confirmed"
|
|
57
|
-
},
|
|
58
|
-
[w.enum.cancelDraft]: {
|
|
59
|
-
primaryActions: {
|
|
60
|
-
text: "Cancel draft",
|
|
61
|
-
close: !0,
|
|
62
|
-
variant: "destructive"
|
|
63
|
-
},
|
|
64
|
-
title: "Cancel draft?",
|
|
65
|
-
message: "Purchase order cannot be changed after cancelled draft.",
|
|
66
|
-
successMessage: "Purchase order draft has been cancelled"
|
|
67
|
-
},
|
|
68
|
-
[w.enum.submitRequest]: {
|
|
69
|
-
primaryActions: {
|
|
70
|
-
text: "Submit request",
|
|
71
|
-
close: !0
|
|
72
|
-
},
|
|
73
|
-
title: "Confirm draft?",
|
|
74
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
75
|
-
successMessage: "Purchase order draft has been submitted"
|
|
76
|
-
},
|
|
77
|
-
[w.enum.completeReceive]: {
|
|
78
|
-
primaryActions: {
|
|
79
|
-
text: "Mark received",
|
|
80
|
-
close: !0
|
|
81
|
-
},
|
|
82
|
-
title: "Mark as received",
|
|
83
|
-
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
84
|
-
successMessage: "Purchase order has been marked as received"
|
|
85
|
-
},
|
|
86
|
-
[w.enum.approveRequest]: {
|
|
87
|
-
primaryActions: {
|
|
88
|
-
text: "Approve request",
|
|
89
|
-
close: !0
|
|
90
|
-
},
|
|
91
|
-
title: "Approve request?",
|
|
92
|
-
message: "Purchase order will be approved.",
|
|
93
|
-
successMessage: "Purchase order has been approved"
|
|
94
|
-
},
|
|
95
|
-
[w.enum.rejectRequest]: {
|
|
96
|
-
primaryActions: {
|
|
97
|
-
text: "Reject request",
|
|
98
|
-
close: !0,
|
|
99
|
-
variant: "destructive"
|
|
100
|
-
},
|
|
101
|
-
title: "Reject request?",
|
|
102
|
-
message: "Purchase order will be rejected.",
|
|
103
|
-
successMessage: "Purchase order has been rejected"
|
|
104
|
-
}
|
|
105
|
-
}, de = L();
|
|
106
|
-
function jr(m, _) {
|
|
107
|
-
const i = Be(), s = he(), S = Ve(), g = at(), N = nt(), P = L(!1), u = Ke(), E = ze(), l = L(new Array()), f = L(
|
|
108
|
-
_ != null && _.startDate && (_ != null && _.endDate) ? _ : Je()
|
|
109
|
-
), h = Y(() => {
|
|
110
|
-
const d = new Date(f.value.startDate), e = new Date(f.value.endDate);
|
|
111
|
-
return {
|
|
112
|
-
start: et(d).toISOString(),
|
|
113
|
-
end: tt(e).toISOString()
|
|
114
|
-
};
|
|
115
|
-
}), b = L(new Array()), O = Xe(), G = L(null);
|
|
116
|
-
async function ge(d) {
|
|
117
|
-
let e;
|
|
118
|
-
if (S.mustUsePoTemplate && !(d != null && d.template) && (e = await g.getTemplateId(), !e))
|
|
119
|
-
return;
|
|
120
|
-
const t = {
|
|
121
|
-
mode: Ie.CREATE,
|
|
122
|
-
modelValue: d || void 0,
|
|
123
|
-
show: !0,
|
|
124
|
-
"onUpdate:show"(a) {
|
|
125
|
-
de.value.show = a;
|
|
126
|
-
},
|
|
127
|
-
templateId: e,
|
|
128
|
-
lastClosingDate: G.value
|
|
129
|
-
};
|
|
130
|
-
de.value = t;
|
|
131
|
-
}
|
|
132
|
-
function ue(d) {
|
|
133
|
-
const e = {
|
|
134
|
-
mode: Ie.UPDATE,
|
|
135
|
-
modelValue: Ue(d),
|
|
136
|
-
show: !0,
|
|
137
|
-
"onUpdate:show"(t) {
|
|
138
|
-
de.value.show = t;
|
|
139
|
-
},
|
|
140
|
-
lastClosingDate: G.value
|
|
141
|
-
};
|
|
142
|
-
de.value = e;
|
|
143
|
-
}
|
|
144
|
-
async function _e() {
|
|
145
|
-
l.value = [], P.value = !0;
|
|
146
|
-
try {
|
|
147
|
-
l.value = await E.getPurchaseOrders(h.value).then((t) => t.sort((a, c) => c._id.localeCompare(a._id)));
|
|
148
|
-
const d = await O.readLastClosing(!0), e = d == null ? void 0 : d._id;
|
|
149
|
-
e && (G.value = st(e)), S.mustUsePoTemplate && await N.fetchTemplates();
|
|
150
|
-
} catch {
|
|
151
|
-
u.open({
|
|
152
|
-
title: "Something went wrong",
|
|
153
|
-
message: "Error at fetching purchase orders",
|
|
154
|
-
type: "error"
|
|
155
|
-
});
|
|
156
|
-
} finally {
|
|
157
|
-
P.value = !1;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
async function Q() {
|
|
161
|
-
b.value = [], P.value = !0;
|
|
162
|
-
try {
|
|
163
|
-
b.value = await E.readRequests().then((d) => d.reverse());
|
|
164
|
-
} catch {
|
|
165
|
-
u.open({
|
|
166
|
-
title: "Something went wrong",
|
|
167
|
-
message: "Error at fetching purchase requests",
|
|
168
|
-
type: "error"
|
|
169
|
-
});
|
|
170
|
-
} finally {
|
|
171
|
-
P.value = !1;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
function oe() {
|
|
175
|
-
switch (m) {
|
|
176
|
-
case "receive/request":
|
|
177
|
-
return _e();
|
|
178
|
-
case "approval":
|
|
179
|
-
return Q();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function we(d, e) {
|
|
183
|
-
f.value = {
|
|
184
|
-
startDate: d,
|
|
185
|
-
endDate: e
|
|
186
|
-
}, oe();
|
|
187
|
-
}
|
|
188
|
-
s.watchLocation(async (d) => {
|
|
189
|
-
if (!d) {
|
|
190
|
-
l.value = [];
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
await oe();
|
|
194
|
-
});
|
|
195
|
-
const J = L(), me = L(Math.random().toString());
|
|
196
|
-
async function Z(d, e) {
|
|
197
|
-
var R, k;
|
|
198
|
-
const t = Math.random().toString();
|
|
199
|
-
me.value = t;
|
|
200
|
-
const a = m === "receive/request" ? s.currentLocation : e == null ? void 0 : e.to, c = {
|
|
201
|
-
poRequest: e,
|
|
202
|
-
purchaseOrder: d,
|
|
203
|
-
transferTo: a == null ? void 0 : a.name,
|
|
204
|
-
transferToDbName: a == null ? void 0 : a.dbName,
|
|
205
|
-
show: !0,
|
|
206
|
-
canResubmit: !1,
|
|
207
|
-
canApprove: m === "approval",
|
|
208
|
-
"onUpdate:show"($) {
|
|
209
|
-
J.value.show = $;
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
if (J.value = c, !(e || d.status !== U.enum.REQUESTING)) {
|
|
213
|
-
try {
|
|
214
|
-
e = (await E.readRequests(
|
|
215
|
-
`${d.supplier.internal}_${d.supplier._id}`
|
|
216
|
-
)).find((o) => o.purchaseOrderId === d._id);
|
|
217
|
-
} catch {
|
|
218
|
-
console.error("Error at fetching po request to check");
|
|
219
|
-
}
|
|
220
|
-
t === me.value && (J.value.canResubmit = !e, J.value.transferTo = (R = e == null ? void 0 : e.to) == null ? void 0 : R.name, J.value.transferToDbName = (k = e == null ? void 0 : e.to) == null ? void 0 : k.dbName);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
async function le(d, e, t, a) {
|
|
224
|
-
P.value = !0;
|
|
225
|
-
try {
|
|
226
|
-
await E.processPurchaseOrder(
|
|
227
|
-
{
|
|
228
|
-
operation: e,
|
|
229
|
-
doc: d,
|
|
230
|
-
options: (
|
|
231
|
-
// auto receive for supplier to warehouse
|
|
232
|
-
(e === w.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
233
|
-
e === w.enum.completeReceive) && S.autoReceiveWarehouse ? {
|
|
234
|
-
autoReceive: !0
|
|
235
|
-
} : void 0
|
|
236
|
-
)
|
|
237
|
-
},
|
|
238
|
-
a
|
|
239
|
-
), await new Promise((k) => setTimeout(k, 1e3));
|
|
240
|
-
const R = he().currentLocationDBName.startsWith("restaurant_");
|
|
241
|
-
e === w.enum.confirmDraft && d.effectiveAt && R ? u.open({
|
|
242
|
-
title: "Success",
|
|
243
|
-
message: `${t}. The backdate will be reflected once your POS has received this change.`,
|
|
244
|
-
type: "success"
|
|
245
|
-
}) : u.open({
|
|
246
|
-
title: "Success",
|
|
247
|
-
message: t,
|
|
248
|
-
type: "success"
|
|
249
|
-
});
|
|
250
|
-
} catch (c) {
|
|
251
|
-
u.open({
|
|
252
|
-
title: "Something went wrong",
|
|
253
|
-
message: "Please try again.",
|
|
254
|
-
type: "error"
|
|
255
|
-
}), console.error("Error when submitting PO operation", e, d, c);
|
|
256
|
-
} finally {
|
|
257
|
-
P.value = !1, oe();
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
async function Se(d, e, t) {
|
|
261
|
-
const a = Ye[e];
|
|
262
|
-
if (!a) {
|
|
263
|
-
u.open({
|
|
264
|
-
title: "Something went wrong",
|
|
265
|
-
message: `Cannot process order: ${Le(e)}`,
|
|
266
|
-
type: "error"
|
|
267
|
-
});
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
const { successMessage: c, ...R } = a;
|
|
271
|
-
i.open({
|
|
272
|
-
title: R.title,
|
|
273
|
-
message: R.message,
|
|
274
|
-
primaryActions: R.primaryActions
|
|
275
|
-
}).onPrimary(() => {
|
|
276
|
-
le(d, e, c, t);
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
return {
|
|
280
|
-
purchaseOrders: l,
|
|
281
|
-
purchaseRequests: b,
|
|
282
|
-
updateDateRange: we,
|
|
283
|
-
fetchData: oe,
|
|
284
|
-
loading: P,
|
|
285
|
-
transferDialogProps: de,
|
|
286
|
-
promptCreateTransferDialog: ge,
|
|
287
|
-
promptUpdateTransferDialog: ue,
|
|
288
|
-
transferDetailsProps: J,
|
|
289
|
-
promptShowTransferDetails: Z,
|
|
290
|
-
submitAction: Se
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
function ut(m, _) {
|
|
294
|
-
return _.reduce(
|
|
295
|
-
(s, S) => {
|
|
296
|
-
const g = S.received.find((N) => N.sku._id === m._id);
|
|
297
|
-
return g && (s = Re(s, g.amount)), s;
|
|
298
|
-
},
|
|
299
|
-
lt.toPrecision(ye(0), m.unit.precision)
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
function dt(m, _) {
|
|
303
|
-
const { name: i, address: s, regNo: S } = _.doc.profile, g = {
|
|
304
|
-
name: i,
|
|
305
|
-
registrationNumber: S,
|
|
306
|
-
line1: s == null ? void 0 : s.line1,
|
|
307
|
-
line2: s == null ? void 0 : s.line2,
|
|
308
|
-
postcode: s == null ? void 0 : s.postcode,
|
|
309
|
-
city: s == null ? void 0 : s.city,
|
|
310
|
-
state: s == null ? void 0 : s.state,
|
|
311
|
-
country: s == null ? void 0 : s.country
|
|
312
|
-
}, N = {
|
|
313
|
-
name: m.supplier.name,
|
|
314
|
-
registrationNumber: m.supplier.registrationNumber,
|
|
315
|
-
line1: m.supplier.address.line1,
|
|
316
|
-
line2: m.supplier.address.line2,
|
|
317
|
-
postcode: m.supplier.address.postcode,
|
|
318
|
-
city: m.supplier.address.city,
|
|
319
|
-
state: m.supplier.address.state,
|
|
320
|
-
country: m.supplier.address.country
|
|
321
|
-
}, P = m.items.map((f) => {
|
|
322
|
-
const { sku: h, measurement: b } = f, O = ie(
|
|
323
|
-
ut(f.sku, m.deliveryOrder || []),
|
|
324
|
-
!1
|
|
325
|
-
);
|
|
326
|
-
return {
|
|
327
|
-
code: h.code,
|
|
328
|
-
description: h.name,
|
|
329
|
-
quantity: Ge(f.quantity, h.unit, f.measurement),
|
|
330
|
-
unit: (b == null ? void 0 : b.abbrev) || h.unit.abbrev,
|
|
331
|
-
received: O
|
|
332
|
-
};
|
|
333
|
-
}), u = m.deliveryOrder.map((f) => ({
|
|
334
|
-
createdAt: je(new Date(f.createdAt)),
|
|
335
|
-
ref: f.deliveryOrderNumber,
|
|
336
|
-
remark: f.remark || "",
|
|
337
|
-
items: f.received.map((h) => {
|
|
338
|
-
var b;
|
|
339
|
-
return {
|
|
340
|
-
code: h.sku.code,
|
|
341
|
-
description: h.sku.name,
|
|
342
|
-
quantity: ie(h.amount),
|
|
343
|
-
unit: ((b = h.measurement) == null ? void 0 : b.abbrev) || h.sku.unit.abbrev
|
|
344
|
-
};
|
|
345
|
-
})
|
|
346
|
-
})), E = {
|
|
347
|
-
orderNumber: m.seqNumber.toString(),
|
|
348
|
-
createdAt: be(m._id),
|
|
349
|
-
ref: m.ref || "",
|
|
350
|
-
remark: m.remark || "",
|
|
351
|
-
buyer: g,
|
|
352
|
-
supplier: N,
|
|
353
|
-
items: P,
|
|
354
|
-
status: m.status,
|
|
355
|
-
deliveryOrders: u
|
|
356
|
-
}, l = new URL(window.location.href);
|
|
357
|
-
l.pathname = l.hostname.includes("inventory.feedme") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", l.searchParams.append("data", JSON.stringify(E)), window.open(l.href, "_blank", "noreferrer");
|
|
358
|
-
}
|
|
359
|
-
const ce = {
|
|
360
|
-
submitRequest: {
|
|
361
|
-
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
362
|
-
color: "text-fm-color-typo-primary",
|
|
363
|
-
value: w.enum.submitRequest
|
|
364
|
-
},
|
|
365
|
-
confirmDraft: {
|
|
366
|
-
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
367
|
-
color: "text-fm-color-typo-primary",
|
|
368
|
-
value: w.enum.confirmDraft
|
|
369
|
-
},
|
|
370
|
-
cancelDraft: {
|
|
371
|
-
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
372
|
-
color: "text-fm-color-typo-error",
|
|
373
|
-
value: w.enum.cancelDraft
|
|
374
|
-
},
|
|
375
|
-
approveRequest: {
|
|
376
|
-
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
377
|
-
color: "text-fm-color-typo-primary",
|
|
378
|
-
value: w.enum.approveRequest
|
|
379
|
-
},
|
|
380
|
-
rejectRequest: {
|
|
381
|
-
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
382
|
-
color: "text-fm-color-typo-error",
|
|
383
|
-
value: w.enum.rejectRequest
|
|
384
|
-
},
|
|
385
|
-
processRequest: {
|
|
386
|
-
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
387
|
-
color: "text-fm-color-typo-primary",
|
|
388
|
-
value: w.enum.processRequest
|
|
389
|
-
},
|
|
390
|
-
receiveStock: {
|
|
391
|
-
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
392
|
-
color: "text-fm-color-typo-primary",
|
|
393
|
-
value: w.enum.receiveStock
|
|
394
|
-
},
|
|
395
|
-
completeReceive: {
|
|
396
|
-
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
397
|
-
color: "text-fm-color-typo-primary",
|
|
398
|
-
value: w.enum.completeReceive
|
|
399
|
-
}
|
|
400
|
-
};
|
|
401
|
-
function Br(m, _) {
|
|
402
|
-
const i = he(), { t: s } = He();
|
|
403
|
-
function S(l) {
|
|
404
|
-
switch (l.status) {
|
|
405
|
-
case "DRAFT":
|
|
406
|
-
return [
|
|
407
|
-
M[T.Update],
|
|
408
|
-
M[T.Details],
|
|
409
|
-
l.supplier.internal === "restaurant" || l.supplier.internal === "warehouse" ? ce[w.enum.submitRequest] : ce[w.enum.confirmDraft],
|
|
410
|
-
ce[w.enum.cancelDraft],
|
|
411
|
-
M[T.Print]
|
|
412
|
-
];
|
|
413
|
-
case "RECEIVING":
|
|
414
|
-
return [
|
|
415
|
-
ce[w.enum.completeReceive],
|
|
416
|
-
M[T.Details],
|
|
417
|
-
M[T.Print]
|
|
418
|
-
];
|
|
419
|
-
case "REQUESTING":
|
|
420
|
-
return m === "receive/request" ? [M[T.Details], M[T.Print]] : [
|
|
421
|
-
ce[w.enum.approveRequest],
|
|
422
|
-
ce[w.enum.rejectRequest],
|
|
423
|
-
M[T.Details],
|
|
424
|
-
M[T.Print]
|
|
425
|
-
];
|
|
426
|
-
case "PROCESSING":
|
|
427
|
-
return [M[T.Details], M[T.Print]];
|
|
428
|
-
case "COMPLETE":
|
|
429
|
-
case "CANCEL":
|
|
430
|
-
default:
|
|
431
|
-
return [M[T.Details], M[T.Print]];
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
function g(l) {
|
|
435
|
-
return Object.values(w.enum).includes(l);
|
|
436
|
-
}
|
|
437
|
-
async function N(l, f, h) {
|
|
438
|
-
var O, G;
|
|
439
|
-
const b = Ue(f);
|
|
440
|
-
if (l === T.Print) {
|
|
441
|
-
dt(b, i.currentLocation);
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
if (l === T.Details) {
|
|
445
|
-
_.promptShowTransferDetails(b, h);
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
if (l === T.Update) {
|
|
449
|
-
(O = _.promptUpdateTransferDialog) == null || O.call(_, b);
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
if (g(l)) {
|
|
453
|
-
_.submitAction(f, l, (G = h == null ? void 0 : h.to) == null ? void 0 : G.dbName);
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
function P() {
|
|
458
|
-
return [
|
|
459
|
-
{
|
|
460
|
-
accessorKey: "seqNumber",
|
|
461
|
-
header: () => s("inventory.transfer.table.seqNo"),
|
|
462
|
-
enableSorting: !0,
|
|
463
|
-
size: 80,
|
|
464
|
-
sortUndefined: "last"
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
accessorKey: "_id",
|
|
468
|
-
header: () => s("inventory.transfer.table.createdAt"),
|
|
469
|
-
cell(l) {
|
|
470
|
-
return be(`${l.getValue()}`);
|
|
471
|
-
},
|
|
472
|
-
enableSorting: !0
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
accessorKey: "supplier.name",
|
|
476
|
-
header: () => s("inventory.transfer.table.transferFrom"),
|
|
477
|
-
enableSorting: !0,
|
|
478
|
-
size: 200
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
accessorKey: "items.length",
|
|
482
|
-
header: () => s("inventory.transfer.table.noOfItems"),
|
|
483
|
-
enableSorting: !1,
|
|
484
|
-
meta: {
|
|
485
|
-
width: "10rem"
|
|
486
|
-
}
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
accessorKey: "ref",
|
|
490
|
-
header: () => s("inventory.transfer.table.reference"),
|
|
491
|
-
enableSorting: !1,
|
|
492
|
-
size: "auto"
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
accessorKey: "status",
|
|
496
|
-
header: () => s("inventory.transfer.table.status"),
|
|
497
|
-
cell(l) {
|
|
498
|
-
const f = s(`inventory.transfer.status.${l.getValue() ?? ""}`), h = `${l.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
499
|
-
return ee(
|
|
500
|
-
"div",
|
|
501
|
-
{
|
|
502
|
-
class: "flex"
|
|
503
|
-
},
|
|
504
|
-
ee(
|
|
505
|
-
"div",
|
|
506
|
-
{
|
|
507
|
-
class: `fm-status-badge fm-status-badge-${h}`
|
|
508
|
-
},
|
|
509
|
-
f
|
|
510
|
-
)
|
|
511
|
-
);
|
|
512
|
-
},
|
|
513
|
-
enableSorting: !0,
|
|
514
|
-
size: 200
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
id: "action",
|
|
518
|
-
cell(l) {
|
|
519
|
-
const f = l.row.original, h = S(f);
|
|
520
|
-
return Fe(h, (b) => N(b, f));
|
|
521
|
-
},
|
|
522
|
-
enableSorting: !1,
|
|
523
|
-
size: 40,
|
|
524
|
-
meta: {
|
|
525
|
-
cellClass: "",
|
|
526
|
-
headerClass: ""
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
];
|
|
530
|
-
}
|
|
531
|
-
function u() {
|
|
532
|
-
return [
|
|
533
|
-
{
|
|
534
|
-
accessorKey: "purchaseOrder.seqNumber",
|
|
535
|
-
header: () => s("inventory.transfer.table.seqNo"),
|
|
536
|
-
enableSorting: !0,
|
|
537
|
-
size: 80,
|
|
538
|
-
sortUndefined: "last"
|
|
539
|
-
},
|
|
540
|
-
{
|
|
541
|
-
accessorKey: "purchaseOrder._id",
|
|
542
|
-
header: () => s("inventory.transfer.table.createdAt"),
|
|
543
|
-
cell(l) {
|
|
544
|
-
return be(`${l.getValue()}`);
|
|
545
|
-
},
|
|
546
|
-
enableSorting: !0
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
accessorKey: "to.name",
|
|
550
|
-
header: () => s("inventory.transfer.table.transferTo"),
|
|
551
|
-
enableSorting: !1,
|
|
552
|
-
size: 200
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
accessorKey: "purchaseOrder.items.length",
|
|
556
|
-
header: () => s("inventory.transfer.table.noOfItems"),
|
|
557
|
-
enableSorting: !1
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
accessorKey: "purchaseOrder.ref",
|
|
561
|
-
header: () => s("inventory.transfer.table.reference"),
|
|
562
|
-
enableSorting: !1,
|
|
563
|
-
size: "auto"
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
accessorKey: "purchaseOrder.status",
|
|
567
|
-
header: () => s("inventory.transfer.table.status"),
|
|
568
|
-
cell(l) {
|
|
569
|
-
const f = s(`inventory.transfer.status.${l.getValue() ?? ""}`), h = `${l.getValue() ?? ""}`.toLocaleLowerCase("en-us");
|
|
570
|
-
return ee(
|
|
571
|
-
"div",
|
|
572
|
-
{
|
|
573
|
-
class: "flex"
|
|
574
|
-
},
|
|
575
|
-
ee(
|
|
576
|
-
"div",
|
|
577
|
-
{
|
|
578
|
-
class: `fm-status-badge fm-status-badge-${h}`
|
|
579
|
-
},
|
|
580
|
-
f
|
|
581
|
-
)
|
|
582
|
-
);
|
|
583
|
-
},
|
|
584
|
-
enableSorting: !0
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
id: "action",
|
|
588
|
-
cell(l) {
|
|
589
|
-
const f = l.row.original, h = f.purchaseOrder ? S(f.purchaseOrder) : [];
|
|
590
|
-
return Fe(
|
|
591
|
-
h,
|
|
592
|
-
(b) => f.purchaseOrder ? N(b, f.purchaseOrder, f) : void 0
|
|
593
|
-
);
|
|
594
|
-
},
|
|
595
|
-
enableSorting: !1,
|
|
596
|
-
size: 40,
|
|
597
|
-
meta: {
|
|
598
|
-
cellClass: "",
|
|
599
|
-
headerClass: ""
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
];
|
|
603
|
-
}
|
|
604
|
-
const E = Y(() => m === "receive/request" ? P() : u());
|
|
605
|
-
return {
|
|
606
|
-
get columnDefs() {
|
|
607
|
-
return E.value;
|
|
608
|
-
}
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
const mt = { class: "flex flex-col gap-16 w-full h-full" }, ft = {
|
|
612
|
-
key: 0,
|
|
613
|
-
class: "flex flex-row-reverse"
|
|
614
|
-
}, pt = { class: "flex justify-between" }, vt = { class: "fm-typo-en-body-lg-600" }, yt = { class: "flex flex-col gap-8" }, ht = { class: "flex flex-col gap-4" }, bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex gap-1" }, _t = { class: "fm-typo-en-body-lg-600" }, wt = {
|
|
615
|
-
key: 0,
|
|
616
|
-
class: "flex flex-col gap-4"
|
|
617
|
-
}, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-lg-600" }, Ot = { class: "flex flex-col gap-4" }, Dt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, kt = { class: "fm-typo-en-body-lg-600" }, At = {
|
|
618
|
-
key: 1,
|
|
619
|
-
class: "flex flex-col gap-4"
|
|
620
|
-
}, xt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qt = { class: "fm-typo-en-body-lg-600" }, Nt = {
|
|
621
|
-
key: 2,
|
|
622
|
-
class: "flex flex-col gap-4"
|
|
623
|
-
}, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ct = { class: "fm-typo-en-body-lg-600" }, Tt = {
|
|
624
|
-
key: 3,
|
|
625
|
-
class: "flex flex-col gap-4"
|
|
626
|
-
}, Et = { class: "fm-typo-en-body-lg-600" }, $t = {
|
|
627
|
-
key: 4,
|
|
628
|
-
class: "flex flex-col gap-4"
|
|
629
|
-
}, It = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ft = { class: "fm-typo-en-body-lg-600" }, Mt = {
|
|
630
|
-
key: 5,
|
|
631
|
-
class: "flex flex-col gap-4"
|
|
632
|
-
}, Ut = { class: "fm-typo-en-body-lg-600" }, Lt = {
|
|
633
|
-
key: 6,
|
|
634
|
-
class: "flex flex-col gap-4"
|
|
635
|
-
}, jt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-lg-600" }, Kt = {
|
|
636
|
-
key: 7,
|
|
637
|
-
class: "flex flex-col gap-4"
|
|
638
|
-
}, Vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-lg-600" }, Ht = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, zt = { class: "flex flex-col gap-8" }, Yt = { class: "fm-typo-en-body-lg-600" }, Qt = { class: "flex w-full gap-4" }, Wt = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Jt = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Zt = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Xt = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, er = {
|
|
639
|
-
key: 0,
|
|
640
|
-
class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
641
|
-
}, tr = { class: "py-8" }, rr = { class: "flex justify-end gap-4 items-center" }, sr = { class: "fm-typo-en-body-lg-600" }, ar = {
|
|
642
|
-
key: 2,
|
|
643
|
-
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
644
|
-
}, nr = {
|
|
645
|
-
key: 0,
|
|
646
|
-
class: "flex flex-col items-center gap-8 h-full"
|
|
647
|
-
}, or = ["src"], lr = { class: "fm-typo-en-body-lg-600" }, cr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, ir = {
|
|
648
|
-
key: 1,
|
|
649
|
-
class: "px-4 flex flex-col"
|
|
650
|
-
}, ur = { class: "flex gap-12 content-stretch" }, dr = {
|
|
651
|
-
class: "flex flex-col w-24",
|
|
652
|
-
name: "circles"
|
|
653
|
-
}, mr = { class: "flex-1 flex flex-col items-center" }, fr = { class: "flex-1 flex flex-col items-center" }, pr = {
|
|
654
|
-
class: "py-12 flex flex-col gap-4",
|
|
655
|
-
name: "received-at header"
|
|
656
|
-
}, vr = { class: "fm-typo-en-body-lg-400" }, yr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, hr = { class: "flex gap-12 content-stretch" }, br = {
|
|
657
|
-
class: "flex flex-col w-24",
|
|
658
|
-
name: "circles"
|
|
659
|
-
}, gr = { class: "flex-1 flex flex-col items-center" }, _r = {
|
|
660
|
-
class: "py-12 flex flex-col gap-4 flex-1",
|
|
661
|
-
name: "delivery details"
|
|
662
|
-
}, wr = { class: "flex flex-col gap-8" }, Sr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Rr = { class: "flex flex-col gap-4" }, Or = { class: "flex gap-8 xs:flex-col" }, Kr = /* @__PURE__ */ Qe({
|
|
663
|
-
__name: "TransferDetails",
|
|
664
|
-
props: {
|
|
665
|
-
poRequest: {},
|
|
666
|
-
purchaseOrder: {},
|
|
667
|
-
transferTo: {},
|
|
668
|
-
transferToDbName: {},
|
|
669
|
-
show: { type: Boolean },
|
|
670
|
-
canResubmit: { type: Boolean },
|
|
671
|
-
canApprove: { type: Boolean }
|
|
672
|
-
},
|
|
673
|
-
emits: ["update:show", "submitted"],
|
|
674
|
-
setup(m, { emit: _ }) {
|
|
675
|
-
const i = m, s = _, S = Be(), g = Ke(), N = it(), P = Ve(), { t: u } = He(), E = Y(
|
|
676
|
-
() => {
|
|
677
|
-
var e, t, a, c;
|
|
678
|
-
return ((t = (e = i.purchaseOrder) == null ? void 0 : e.supplier) == null ? void 0 : t.internal) === "restaurant" || ((c = (a = i.purchaseOrder) == null ? void 0 : a.supplier) == null ? void 0 : c.internal) === "warehouse" ? ne.TRANSFER : ne.PURCHASE;
|
|
679
|
-
}
|
|
680
|
-
), l = Y(() => {
|
|
681
|
-
var e, t, a;
|
|
682
|
-
return E.value === ne.TRANSFER && ((e = i.transferToDbName) == null ? void 0 : e.startsWith("restaurant")) && ((a = (t = i.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : a.internal) === "restaurant";
|
|
683
|
-
}), f = [
|
|
684
|
-
{
|
|
685
|
-
label: u("inventory.transfer.receiveRequest.details.overview"),
|
|
686
|
-
value: "overview"
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
label: u("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
690
|
-
value: "deliveryHistory"
|
|
691
|
-
}
|
|
692
|
-
], h = L(f[0]), b = L(!1), O = L(""), G = L(!0), ge = ze(), ue = rt(i, "show");
|
|
693
|
-
async function _e(e, t, a) {
|
|
694
|
-
O.value = t, b.value = !0, G.value = !1;
|
|
695
|
-
try {
|
|
696
|
-
await ge.processPurchaseOrder(
|
|
697
|
-
{
|
|
698
|
-
operation: t,
|
|
699
|
-
doc: e,
|
|
700
|
-
options: (
|
|
701
|
-
// auto receive for supplier to warehouse
|
|
702
|
-
(t === w.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
703
|
-
t === w.enum.completeReceive) && P.autoReceiveWarehouse ? {
|
|
704
|
-
autoReceive: !0
|
|
705
|
-
} : void 0
|
|
706
|
-
)
|
|
707
|
-
},
|
|
708
|
-
i.transferToDbName
|
|
709
|
-
), await new Promise((c) => setTimeout(c, 1e3)), g.open({
|
|
710
|
-
title: "Success",
|
|
711
|
-
message: a,
|
|
712
|
-
type: "success"
|
|
713
|
-
}), s("update:show", !1), s("submitted");
|
|
714
|
-
} catch (c) {
|
|
715
|
-
g.open({
|
|
716
|
-
title: "Something went wrong",
|
|
717
|
-
message: "Please try again.",
|
|
718
|
-
type: "error"
|
|
719
|
-
}), console.error("Error when submitting PO operation", t, e, c);
|
|
720
|
-
} finally {
|
|
721
|
-
O.value = "", b.value = !1, G.value = !0;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
async function Q(e) {
|
|
725
|
-
const t = Ye[e];
|
|
726
|
-
if (!t) {
|
|
727
|
-
g.open({
|
|
728
|
-
title: "Something went wrong",
|
|
729
|
-
message: `Cannot process order: ${Le(e)}`,
|
|
730
|
-
type: "error"
|
|
731
|
-
});
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
const { successMessage: a, ...c } = t;
|
|
735
|
-
S.open({
|
|
736
|
-
title: c.title,
|
|
737
|
-
message: c.message,
|
|
738
|
-
primaryActions: c.primaryActions
|
|
739
|
-
}).onPrimary(() => {
|
|
740
|
-
i.purchaseOrder && _e(i.purchaseOrder, e, a);
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
const oe = Y(() => {
|
|
744
|
-
var e, t;
|
|
745
|
-
return ((e = i.purchaseOrder) == null ? void 0 : e.status) === U.enum.RECEIVING || ((t = i.purchaseOrder) == null ? void 0 : t.status) === U.enum.COMPLETE;
|
|
746
|
-
}), we = Y(
|
|
747
|
-
() => {
|
|
748
|
-
var e, t, a, c, R, k;
|
|
749
|
-
return N.getLocationSubsidiary(
|
|
750
|
-
((a = (t = (e = i.purchaseOrder) == null ? void 0 : e.netSuite) == null ? void 0 : t.subsidiary) == null ? void 0 : a.id) || ((k = (R = (c = i.poRequest) == null ? void 0 : c.netSuite) == null ? void 0 : R.subsidiary) == null ? void 0 : k.id)
|
|
751
|
-
).fullName;
|
|
752
|
-
}
|
|
753
|
-
), J = Y(() => {
|
|
754
|
-
var e, t, a, c, R, k;
|
|
755
|
-
return (t = (e = i.purchaseOrder) == null ? void 0 : e.deliveryFullfillment) != null && t.length && ((c = (a = i.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) == null ? void 0 : c.length) > 0 ? (k = (R = i.purchaseOrder) == null ? void 0 : R.deliveryFullfillment) == null ? void 0 : k.map(($) => {
|
|
756
|
-
var o;
|
|
757
|
-
return (o = $.netSuite) == null ? void 0 : o.refNo;
|
|
758
|
-
}).join(", ") : "-";
|
|
759
|
-
}), me = Y(() => {
|
|
760
|
-
var k, $, o;
|
|
761
|
-
const a = (((k = i.purchaseOrder) == null ? void 0 : k.deliveryOrder) ?? []).flatMap((x) => x.received ?? []).reduce(
|
|
762
|
-
(x, I) => {
|
|
763
|
-
const j = x[I.sku._id] ?? [];
|
|
764
|
-
return x[I.sku._id] = [...j, I], x;
|
|
765
|
-
},
|
|
766
|
-
{}
|
|
767
|
-
), c = Object.entries(a).reduce(
|
|
768
|
-
(x, [I, j]) => {
|
|
769
|
-
const A = j.reduce((F, V) => {
|
|
770
|
-
const H = ot(
|
|
771
|
-
F,
|
|
772
|
-
Math.max(F.precision, V.amount.precision)
|
|
773
|
-
);
|
|
774
|
-
return Re(H, V.amount);
|
|
775
|
-
}, ye(0));
|
|
776
|
-
return x[I] = A, x;
|
|
777
|
-
},
|
|
778
|
-
{}
|
|
779
|
-
), R = (($ = i.purchaseOrder) == null ? void 0 : $.items) ?? [];
|
|
780
|
-
for (const x of R)
|
|
781
|
-
c[o = x.sku._id] ?? (c[o] = ye(0));
|
|
782
|
-
return c;
|
|
783
|
-
}), Z = Y(() => {
|
|
784
|
-
var k, $;
|
|
785
|
-
const e = ((k = i.purchaseOrder) == null ? void 0 : k.deliveryOrder) ?? [], t = (($ = i.purchaseOrder) == null ? void 0 : $.deliveryFullfillment) ?? [], a = [
|
|
786
|
-
...e.map((o) => ({
|
|
787
|
-
createdAt: o.createdAt,
|
|
788
|
-
type: "grn",
|
|
789
|
-
doc: o
|
|
790
|
-
})),
|
|
791
|
-
...t.map((o) => ({
|
|
792
|
-
createdAt: o.createdAt,
|
|
793
|
-
type: "fulfillment",
|
|
794
|
-
doc: o
|
|
795
|
-
}))
|
|
796
|
-
];
|
|
797
|
-
a.reverse().sort((o, x) => o.createdAt.localeCompare(x.createdAt));
|
|
798
|
-
function c(o) {
|
|
799
|
-
var I, j, A, F, V, H, X;
|
|
800
|
-
const x = t.findIndex((y) => y.id === o.fullfillmentId);
|
|
801
|
-
return {
|
|
802
|
-
header: "Received",
|
|
803
|
-
date: $e(new Date(o.createdAt)),
|
|
804
|
-
info: [
|
|
805
|
-
{
|
|
806
|
-
label: "Received by",
|
|
807
|
-
values: [(I = o.createdBy) == null ? void 0 : I.name]
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
label: "Received items",
|
|
811
|
-
values: o.received.map((y) => {
|
|
812
|
-
var C;
|
|
813
|
-
return `(${y.sku.code}) ${y.sku.name}: ${ie(y.amount, !1)} ${((C = y.measurement) == null ? void 0 : C.abbrev) ?? y.sku.unit.abbrev}`;
|
|
814
|
-
})
|
|
815
|
-
},
|
|
816
|
-
o.deliveryOrderNumber ? {
|
|
817
|
-
label: "Delivery order no.",
|
|
818
|
-
values: [o.deliveryOrderNumber]
|
|
819
|
-
} : null,
|
|
820
|
-
o.remark ? {
|
|
821
|
-
label: "Remark",
|
|
822
|
-
values: [o.remark]
|
|
823
|
-
} : null,
|
|
824
|
-
x > -1 ? {
|
|
825
|
-
label: "Fulfilment's sequence",
|
|
826
|
-
values: [`${x + 1}`]
|
|
827
|
-
} : null,
|
|
828
|
-
(A = (j = t[x]) == null ? void 0 : j.netSuite) != null && A.refNo ? {
|
|
829
|
-
label: "Fulfillment's ref no. (Netsuite)",
|
|
830
|
-
values: [(V = (F = t[x]) == null ? void 0 : F.netSuite) == null ? void 0 : V.refNo]
|
|
831
|
-
} : null,
|
|
832
|
-
(H = o == null ? void 0 : o.netSuite) != null && H.refNo ? {
|
|
833
|
-
label: "Item receipt (Netsuite)",
|
|
834
|
-
values: [(X = o == null ? void 0 : o.netSuite) == null ? void 0 : X.refNo]
|
|
835
|
-
} : null
|
|
836
|
-
].filter((y) => y)
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
function R(o) {
|
|
840
|
-
var I, j;
|
|
841
|
-
const x = t.findIndex((A) => A.id === o.id);
|
|
842
|
-
return {
|
|
843
|
-
header: "Fulfillment",
|
|
844
|
-
date: $e(new Date(o.createdAt)),
|
|
845
|
-
info: [
|
|
846
|
-
{
|
|
847
|
-
label: "Sequence",
|
|
848
|
-
values: [String(x + 1)]
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
label: "Receiveable items",
|
|
852
|
-
values: o.items.map((A) => {
|
|
853
|
-
var F;
|
|
854
|
-
return `(${A.sku.code}) ${A.sku.name}: ${ie(A.amount, !1)} ${((F = A.measurement) == null ? void 0 : F.abbrev) ?? A.sku.unit.abbrev}`;
|
|
855
|
-
})
|
|
856
|
-
},
|
|
857
|
-
(I = o.netSuite) != null && I.refNo ? {
|
|
858
|
-
label: "Ref no. (Netsuite)",
|
|
859
|
-
values: [(j = o.netSuite) == null ? void 0 : j.refNo]
|
|
860
|
-
} : null
|
|
861
|
-
].filter((A) => A)
|
|
862
|
-
};
|
|
863
|
-
}
|
|
864
|
-
return a.map((o) => {
|
|
865
|
-
switch (o.type) {
|
|
866
|
-
case "grn":
|
|
867
|
-
return c(o.doc);
|
|
868
|
-
case "fulfillment":
|
|
869
|
-
return R(o.doc);
|
|
870
|
-
}
|
|
871
|
-
});
|
|
872
|
-
}), le = L(!1);
|
|
873
|
-
async function Se() {
|
|
874
|
-
le.value || S.open({
|
|
875
|
-
title: "Sync with NetSuite",
|
|
876
|
-
contentComponent: ee("div", [
|
|
877
|
-
ee("p", "Are you sure you want to sync now?"),
|
|
878
|
-
ee("br"),
|
|
879
|
-
ee(
|
|
880
|
-
"p",
|
|
881
|
-
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
882
|
-
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
883
|
-
)
|
|
884
|
-
]),
|
|
885
|
-
primaryActions: {
|
|
886
|
-
text: "Sync",
|
|
887
|
-
close: !0,
|
|
888
|
-
variant: "destructive"
|
|
889
|
-
},
|
|
890
|
-
secondaryActions: { text: "Not now", close: !0 }
|
|
891
|
-
}).onPrimary(async () => {
|
|
892
|
-
var e, t, a, c;
|
|
893
|
-
try {
|
|
894
|
-
le.value = !0;
|
|
895
|
-
const R = (t = (e = i.purchaseOrder) == null ? void 0 : e.netSuite) != null && t.id ? "purchaseOrder" : "purchaseOrderRequest", k = R === "purchaseOrder" ? (a = i.purchaseOrder) == null ? void 0 : a._id : (c = i.poRequest) == null ? void 0 : c._id;
|
|
896
|
-
if (!k) {
|
|
897
|
-
g.open({
|
|
898
|
-
title: "Error",
|
|
899
|
-
message: "Invalid sync ID",
|
|
900
|
-
type: "error"
|
|
901
|
-
});
|
|
902
|
-
return;
|
|
903
|
-
}
|
|
904
|
-
await N.syncTransferOrder(R, k), g.open({
|
|
905
|
-
title: "Sync with NetSuite",
|
|
906
|
-
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
907
|
-
type: "success"
|
|
908
|
-
});
|
|
909
|
-
} catch {
|
|
910
|
-
g.open({
|
|
911
|
-
title: "Error",
|
|
912
|
-
message: "Failed to sync with NetSuite",
|
|
913
|
-
type: "error"
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
setTimeout(() => {
|
|
917
|
-
le.value = !1;
|
|
918
|
-
}, 5e3);
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
const d = Y(() => {
|
|
922
|
-
var t;
|
|
923
|
-
const e = {
|
|
924
|
-
...ye(0),
|
|
925
|
-
currency: Ee()
|
|
926
|
-
};
|
|
927
|
-
return ((t = i.purchaseOrder) == null ? void 0 : t.items.reduce((a, c) => ({
|
|
928
|
-
...Re(a, c.totalCost ?? e),
|
|
929
|
-
currency: Ee()
|
|
930
|
-
}), e)) ?? e;
|
|
931
|
-
});
|
|
932
|
-
return (e, t) => {
|
|
933
|
-
var I, j;
|
|
934
|
-
const a = se("FmButton"), c = se("FmButtonGroup"), R = se("FmChip"), k = se("FmMenuDivider"), $ = se("FmCard"), o = se("FmSpacer"), x = se("FmSideSheet");
|
|
935
|
-
return p(), W(x, {
|
|
936
|
-
header: n(u)("inventory.transfer.receiveRequest.details.title") + ((I = e.purchaseOrder) != null && I.seqNumber ? ` #${(j = e.purchaseOrder) == null ? void 0 : j.seqNumber}` : ""),
|
|
937
|
-
modelValue: n(ue),
|
|
938
|
-
"onUpdate:modelValue": t[9] || (t[9] = (A) => We(ue) ? ue.value = A : null),
|
|
939
|
-
"dismiss-away": G.value,
|
|
940
|
-
"close-button": "",
|
|
941
|
-
"max-width": 600
|
|
942
|
-
}, {
|
|
943
|
-
default: fe(() => {
|
|
944
|
-
var A, F, V, H, X;
|
|
945
|
-
return [
|
|
946
|
-
r("div", mt, [
|
|
947
|
-
n(N).isEnabled && i.purchaseOrder != null && // purchaseOrder?.status !== F_PURCHASE_ORDER_STATUS.enum.DRAFT &&
|
|
948
|
-
((F = (A = e.purchaseOrder) == null ? void 0 : A.netSuite) != null && F.id || (H = (V = e.poRequest) == null ? void 0 : V.netSuite) != null && H.id) && !l.value ? (p(), D("div", ft, [
|
|
949
|
-
z(a, {
|
|
950
|
-
"prepend-icon": "sync",
|
|
951
|
-
variant: "primary",
|
|
952
|
-
label: "NetSuite",
|
|
953
|
-
loading: le.value,
|
|
954
|
-
onClick: Se
|
|
955
|
-
}, null, 8, ["loading"])
|
|
956
|
-
])) : q("", !0),
|
|
957
|
-
r("div", null, [
|
|
958
|
-
z(c, {
|
|
959
|
-
items: f,
|
|
960
|
-
modelValue: h.value,
|
|
961
|
-
"onUpdate:modelValue": t[0] || (t[0] = (y) => h.value = y)
|
|
962
|
-
}, null, 8, ["modelValue"])
|
|
963
|
-
]),
|
|
964
|
-
h.value.value === "overview" ? (p(), D(ae, { key: 1 }, [
|
|
965
|
-
r("div", null, [
|
|
966
|
-
z($, {
|
|
967
|
-
variant: "outlined",
|
|
968
|
-
class: "flex flex-col gap-8 px-12 py-16"
|
|
969
|
-
}, {
|
|
970
|
-
default: fe(() => {
|
|
971
|
-
var y, C, B, te, re, K, Oe, De, ke, Ae, xe, qe, Ne, Pe, Ce, Te;
|
|
972
|
-
return [
|
|
973
|
-
r("div", pt, [
|
|
974
|
-
r("div", vt, v(n(u)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
975
|
-
r("div", null, [
|
|
976
|
-
z(R, {
|
|
977
|
-
label: n(u)(`inventory.transfer.status.${(y = e.purchaseOrder) == null ? void 0 : y.status}`),
|
|
978
|
-
class: pe(`fm-status-badge fm-status-badge-${(B = (C = e.purchaseOrder) == null ? void 0 : C.status) == null ? void 0 : B.toLocaleLowerCase("en-us")}`),
|
|
979
|
-
compact: ""
|
|
980
|
-
}, null, 8, ["label", "class"])
|
|
981
|
-
])
|
|
982
|
-
]),
|
|
983
|
-
z(k),
|
|
984
|
-
r("div", yt, [
|
|
985
|
-
r("div", ht, [
|
|
986
|
-
r("div", bt, [
|
|
987
|
-
r("div", gt, v(n(u)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
988
|
-
]),
|
|
989
|
-
r("div", _t, v(n(be)(((te = e.purchaseOrder) == null ? void 0 : te._id) ?? "")), 1)
|
|
990
|
-
]),
|
|
991
|
-
(re = e.purchaseOrder) != null && re.effectiveAt ? (p(), D("div", wt, [
|
|
992
|
-
r("div", St, v(n(u)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
993
|
-
r("div", Rt, v(n(je)(new Date((K = e.purchaseOrder) == null ? void 0 : K.effectiveAt))), 1)
|
|
994
|
-
])) : q("", !0),
|
|
995
|
-
r("div", Ot, [
|
|
996
|
-
r("div", Dt, v(n(u)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
997
|
-
r("div", kt, v(n(u)(
|
|
998
|
-
`inventory.transfer.receiveRequest.details.type.${E.value.toLocaleLowerCase("en-US")}`
|
|
999
|
-
)), 1)
|
|
1000
|
-
]),
|
|
1001
|
-
(De = (Oe = e.purchaseOrder) == null ? void 0 : Oe.supplier) != null && De.name ? (p(), D("div", At, [
|
|
1002
|
-
r("div", xt, v(n(u)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1003
|
-
r("div", qt, v((Ae = (ke = e.purchaseOrder) == null ? void 0 : ke.supplier) == null ? void 0 : Ae.name), 1)
|
|
1004
|
-
])) : q("", !0),
|
|
1005
|
-
e.transferTo ? (p(), D("div", Nt, [
|
|
1006
|
-
r("div", Pt, v(n(u)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
1007
|
-
r("div", Ct, v(e.transferTo), 1)
|
|
1008
|
-
])) : q("", !0),
|
|
1009
|
-
n(N).isEnabled ? (p(), D("div", Tt, [
|
|
1010
|
-
t[10] || (t[10] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite subsidiary ", -1)),
|
|
1011
|
-
r("div", Et, v(we.value || "-"), 1)
|
|
1012
|
-
])) : q("", !0),
|
|
1013
|
-
n(N).isEnabled && !l.value ? (p(), D("div", $t, [
|
|
1014
|
-
r("div", It, " NetSuite " + v(E.value === n(ne).PURCHASE ? "Purchase order" : "Transfer order") + " ID ", 1),
|
|
1015
|
-
r("div", Ft, v(((qe = (xe = e.purchaseOrder) == null ? void 0 : xe.netSuite) == null ? void 0 : qe.id) || ((Pe = (Ne = e.poRequest) == null ? void 0 : Ne.netSuite) == null ? void 0 : Pe.id) || "-"), 1)
|
|
1016
|
-
])) : q("", !0),
|
|
1017
|
-
n(N).isEnabled && E.value === n(ne).TRANSFER && !l.value ? (p(), D("div", Mt, [
|
|
1018
|
-
t[11] || (t[11] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1019
|
-
r("div", Ut, v(J.value), 1)
|
|
1020
|
-
])) : q("", !0),
|
|
1021
|
-
(Ce = e.purchaseOrder) != null && Ce.ref ? (p(), D("div", Lt, [
|
|
1022
|
-
r("div", jt, v(n(u)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1023
|
-
r("div", Bt, v(e.purchaseOrder.ref), 1)
|
|
1024
|
-
])) : q("", !0),
|
|
1025
|
-
(Te = e.purchaseOrder) != null && Te.remark ? (p(), D("div", Kt, [
|
|
1026
|
-
r("div", Vt, v(n(u)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1027
|
-
r("div", Gt, v(e.purchaseOrder.remark), 1)
|
|
1028
|
-
])) : q("", !0)
|
|
1029
|
-
])
|
|
1030
|
-
];
|
|
1031
|
-
}),
|
|
1032
|
-
_: 1
|
|
1033
|
-
})
|
|
1034
|
-
]),
|
|
1035
|
-
r("div", Ht, [
|
|
1036
|
-
r("div", zt, [
|
|
1037
|
-
r("div", Yt, v(oe.value ? n(u)("inventory.transfer.receiveRequest.details.receivedItems") : n(u)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1038
|
-
(p(!0), D(ae, null, ve(((X = e.purchaseOrder) == null ? void 0 : X.items) ?? [], (y) => (p(), D("div", {
|
|
1039
|
-
key: y.code,
|
|
1040
|
-
class: "flex flex-col"
|
|
1041
|
-
}, [
|
|
1042
|
-
r("div", Qt, [
|
|
1043
|
-
r("div", Wt, v(y.name), 1),
|
|
1044
|
-
r("div", Jt, v(n(ie)(me.value[y.sku._id], !1)) + "/" + v(n(Ge)(y.quantity, y.sku.unit, y.measurement)), 1)
|
|
1045
|
-
]),
|
|
1046
|
-
r("div", Zt, [
|
|
1047
|
-
r("div", Xt, v(y.code), 1),
|
|
1048
|
-
y.totalCost && n(P).enableTotalCost ? (p(), D("div", er, " (" + v(n(Me)(y.totalCost)) + ") ", 1)) : q("", !0)
|
|
1049
|
-
])
|
|
1050
|
-
]))), 128)),
|
|
1051
|
-
+n(ie)(d.value) ? (p(), D(ae, { key: 0 }, [
|
|
1052
|
-
r("div", tr, [
|
|
1053
|
-
z(k)
|
|
1054
|
-
]),
|
|
1055
|
-
r("div", rr, [
|
|
1056
|
-
t[12] || (t[12] = r("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
1057
|
-
r("div", sr, v(n(Me)(d.value)), 1)
|
|
1058
|
-
])
|
|
1059
|
-
], 64)) : q("", !0)
|
|
1060
|
-
])
|
|
1061
|
-
])
|
|
1062
|
-
], 64)) : q("", !0),
|
|
1063
|
-
h.value.value === "deliveryHistory" ? (p(), D("div", ar, [
|
|
1064
|
-
Z.value.length ? (p(), D("div", ir, [
|
|
1065
|
-
(p(!0), D(ae, null, ve(Z.value, (y, C) => (p(), D(ae, { key: C }, [
|
|
1066
|
-
r("div", ur, [
|
|
1067
|
-
r("div", dr, [
|
|
1068
|
-
r("div", mr, [
|
|
1069
|
-
r("div", {
|
|
1070
|
-
class: pe([
|
|
1071
|
-
{
|
|
1072
|
-
"bg-fm-color-primary": C !== 0,
|
|
1073
|
-
"bg-white": C === 0
|
|
1074
|
-
},
|
|
1075
|
-
"w-[2px] h-full"
|
|
1076
|
-
])
|
|
1077
|
-
}, null, 2)
|
|
1078
|
-
]),
|
|
1079
|
-
t[13] || (t[13] = r("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1080
|
-
r("div", fr, [
|
|
1081
|
-
r("div", {
|
|
1082
|
-
class: pe([
|
|
1083
|
-
{
|
|
1084
|
-
"bg-fm-color-primary": C < Z.value.length - 1,
|
|
1085
|
-
"bg-white": C >= Z.value.length - 1
|
|
1086
|
-
},
|
|
1087
|
-
"w-[2px] h-full"
|
|
1088
|
-
])
|
|
1089
|
-
}, null, 2)
|
|
1090
|
-
])
|
|
1091
|
-
]),
|
|
1092
|
-
r("div", pr, [
|
|
1093
|
-
r("div", vr, v(y.header), 1),
|
|
1094
|
-
r("div", yr, v(y.date), 1)
|
|
1095
|
-
])
|
|
1096
|
-
]),
|
|
1097
|
-
r("div", hr, [
|
|
1098
|
-
r("div", br, [
|
|
1099
|
-
r("div", gr, [
|
|
1100
|
-
r("div", {
|
|
1101
|
-
class: pe([
|
|
1102
|
-
{
|
|
1103
|
-
"bg-fm-color-primary": C < Z.value.length - 1,
|
|
1104
|
-
"bg-white": C >= Z.value.length - 1
|
|
1105
|
-
},
|
|
1106
|
-
"w-[2px] h-full"
|
|
1107
|
-
])
|
|
1108
|
-
}, null, 2)
|
|
1109
|
-
])
|
|
1110
|
-
]),
|
|
1111
|
-
r("div", _r, [
|
|
1112
|
-
z($, {
|
|
1113
|
-
variant: "outlined",
|
|
1114
|
-
class: "py-12 px-16"
|
|
1115
|
-
}, {
|
|
1116
|
-
default: fe(() => [
|
|
1117
|
-
r("div", wr, [
|
|
1118
|
-
(p(!0), D(ae, null, ve(y.info, (B, te) => (p(), D("div", {
|
|
1119
|
-
key: te,
|
|
1120
|
-
class: "flex flex-col gap-4"
|
|
1121
|
-
}, [
|
|
1122
|
-
r("div", Sr, v(B == null ? void 0 : B.label), 1),
|
|
1123
|
-
r("div", Rr, [
|
|
1124
|
-
(p(!0), D(ae, null, ve(B == null ? void 0 : B.values, (re, K) => (p(), D("div", {
|
|
1125
|
-
key: K,
|
|
1126
|
-
class: "fm-typo-en-body-lg-600"
|
|
1127
|
-
}, v(re), 1))), 128))
|
|
1128
|
-
])
|
|
1129
|
-
]))), 128))
|
|
1130
|
-
])
|
|
1131
|
-
]),
|
|
1132
|
-
_: 2
|
|
1133
|
-
}, 1024)
|
|
1134
|
-
])
|
|
1135
|
-
])
|
|
1136
|
-
], 64))), 128))
|
|
1137
|
-
])) : (p(), D("div", nr, [
|
|
1138
|
-
z(o),
|
|
1139
|
-
r("div", null, [
|
|
1140
|
-
r("img", {
|
|
1141
|
-
src: n(ct),
|
|
1142
|
-
alt: "List is empty"
|
|
1143
|
-
}, null, 8, or)
|
|
1144
|
-
]),
|
|
1145
|
-
r("div", lr, v(n(u)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
1146
|
-
r("div", cr, v(n(u)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
1147
|
-
z(o),
|
|
1148
|
-
z(o)
|
|
1149
|
-
]))
|
|
1150
|
-
])) : q("", !0)
|
|
1151
|
-
])
|
|
1152
|
-
];
|
|
1153
|
-
}),
|
|
1154
|
-
"side-sheet-footer": fe(() => {
|
|
1155
|
-
var A, F, V, H, X, y, C, B, te, re;
|
|
1156
|
-
return [
|
|
1157
|
-
r("div", Or, [
|
|
1158
|
-
((A = e.purchaseOrder) == null ? void 0 : A.status) === n(U).enum.DRAFT && E.value === n(ne).PURCHASE ? (p(), W(a, {
|
|
1159
|
-
key: 0,
|
|
1160
|
-
label: n(u)("inventory.transfer.receiveRequest.actions.confirmDraft"),
|
|
1161
|
-
onClick: t[1] || (t[1] = (K) => Q("confirmDraft")),
|
|
1162
|
-
loading: O.value === "confirmDraft",
|
|
1163
|
-
disabled: O.value !== "confirmDraft" && b.value
|
|
1164
|
-
}, null, 8, ["label", "loading", "disabled"])) : q("", !0),
|
|
1165
|
-
((F = e.purchaseOrder) == null ? void 0 : F.status) === n(U).enum.DRAFT && E.value === n(ne).TRANSFER ? (p(), W(a, {
|
|
1166
|
-
key: 1,
|
|
1167
|
-
label: n(u)("inventory.transfer.receiveRequest.actions.submitRequest"),
|
|
1168
|
-
onClick: t[2] || (t[2] = (K) => Q("submitRequest")),
|
|
1169
|
-
loading: O.value === "submitRequest",
|
|
1170
|
-
disabled: O.value !== "submitRequest" && b.value
|
|
1171
|
-
}, null, 8, ["label", "loading", "disabled"])) : q("", !0),
|
|
1172
|
-
((V = e.purchaseOrder) == null ? void 0 : V.status) === n(U).enum.DRAFT ? (p(), W(a, {
|
|
1173
|
-
key: 2,
|
|
1174
|
-
label: n(u)("inventory.transfer.receiveRequest.actions.cancelDraft"),
|
|
1175
|
-
onClick: t[3] || (t[3] = (K) => Q("cancelDraft")),
|
|
1176
|
-
loading: O.value === "cancelDraft",
|
|
1177
|
-
disabled: O.value !== "cancelDraft" && b.value,
|
|
1178
|
-
variant: "destructive"
|
|
1179
|
-
}, null, 8, ["label", "loading", "disabled"])) : q("", !0),
|
|
1180
|
-
((H = e.purchaseOrder) == null ? void 0 : H.status) === n(U).enum.RECEIVING ? (p(), W(a, {
|
|
1181
|
-
key: 3,
|
|
1182
|
-
label: n(u)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
1183
|
-
onClick: t[4] || (t[4] = (K) => Q("completeReceive")),
|
|
1184
|
-
loading: O.value === "completeReceive",
|
|
1185
|
-
disabled: O.value !== "completeReceive" && b.value
|
|
1186
|
-
}, null, 8, ["label", "loading", "disabled"])) : q("", !0),
|
|
1187
|
-
e.canResubmit ? (p(), W(a, {
|
|
1188
|
-
key: 4,
|
|
1189
|
-
label: n(u)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
|
|
1190
|
-
onClick: t[5] || (t[5] = (K) => Q("submitRequest")),
|
|
1191
|
-
loading: O.value === "submitRequest",
|
|
1192
|
-
disabled: O.value !== "submitRequest" && b.value
|
|
1193
|
-
}, null, 8, ["label", "loading", "disabled"])) : q("", !0),
|
|
1194
|
-
(((X = e.purchaseOrder) == null ? void 0 : X.status) === n(U).enum.REQUESTING || ((y = e.purchaseOrder) == null ? void 0 : y.status) === n(U).enum.PROCESSING) && e.canApprove ? (p(), W(a, {
|
|
1195
|
-
key: 5,
|
|
1196
|
-
label: n(u)("inventory.transfer.approval.actions.approveRequest"),
|
|
1197
|
-
onClick: t[6] || (t[6] = (K) => Q("approveRequest")),
|
|
1198
|
-
loading: O.value === "approveRequest",
|
|
1199
|
-
disabled: O.value !== "approveRequest" && b.value
|
|
1200
|
-
}, null, 8, ["label", "loading", "disabled"])) : q("", !0),
|
|
1201
|
-
((C = e.purchaseOrder) == null ? void 0 : C.status) === n(U).enum.REQUESTING && e.canApprove ? (p(), W(a, {
|
|
1202
|
-
key: 6,
|
|
1203
|
-
label: n(u)("inventory.transfer.approval.actions.rejectRequest"),
|
|
1204
|
-
onClick: t[7] || (t[7] = (K) => Q("rejectRequest")),
|
|
1205
|
-
loading: O.value === "rejectRequest",
|
|
1206
|
-
disabled: O.value !== "rejectRequest" && b.value,
|
|
1207
|
-
variant: "destructive"
|
|
1208
|
-
}, null, 8, ["label", "loading", "disabled"])) : q("", !0),
|
|
1209
|
-
((B = e.purchaseOrder) == null ? void 0 : B.status) !== n(U).enum.COMPLETE && ((te = e.purchaseOrder) == null ? void 0 : te.status) !== n(U).enum.CANCEL && (((re = e.purchaseOrder) == null ? void 0 : re.status) !== n(U).enum.REQUESTING || e.canApprove) ? (p(), W(a, {
|
|
1210
|
-
key: 7,
|
|
1211
|
-
label: n(u)("common.close"),
|
|
1212
|
-
variant: "tertiary",
|
|
1213
|
-
onClick: t[8] || (t[8] = (K) => s("update:show", !1))
|
|
1214
|
-
}, null, 8, ["label"])) : q("", !0)
|
|
1215
|
-
])
|
|
1216
|
-
];
|
|
1217
|
-
}),
|
|
1218
|
-
_: 1
|
|
1219
|
-
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1220
|
-
};
|
|
1221
|
-
}
|
|
1222
|
-
});
|
|
1223
|
-
export {
|
|
1224
|
-
Kr as _,
|
|
1225
|
-
jr as a,
|
|
1226
|
-
Br as b,
|
|
1227
|
-
ut as g,
|
|
1228
|
-
ze as u
|
|
1229
|
-
};
|