@feedmepos/mf-inventory-portal 0.0.21-dev.7 → 0.0.22-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/{ApprovalView-BYJfdiYM.js → ApprovalView-CtH8I01g.js} +4 -4
- package/dist/{BindingsDialog-BryZK4Tg.js → BindingsDialog-DFrk_fyd.js} +1 -1
- package/dist/{BindingsPicker-IWAltg_U.js → BindingsPicker-400gISaV.js} +1 -1
- package/dist/{BindingsTable-DDwukKAy.js → BindingsTable-CnFKI6iP.js} +1 -1
- package/dist/ClosingTemplateView--8m8cua_.js +919 -0
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CLBgszfX.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B9RU_arW.js} +1 -1
- package/dist/{IngredientsView-DgSzNCNX.js → IngredientsView-CRTAgKJz.js} +3 -3
- package/dist/{IntegrationView-BtXzjG3j.js → IntegrationView-CNFTKqjk.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sPzZAvKH.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-VkiVLx1K.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BYX1ubPe.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-Ke1-hYgN.js → PurchaseOrderPrintPreview-CJli-_Vn.js} +1 -1
- package/dist/{ReceiveRequestView-CE9BFQn3.js → ReceiveRequestView-DV_GDzJG.js} +6 -6
- package/dist/{RecipeView-K3f9W_AV.js → RecipeView-CTm_7oNG.js} +3 -3
- package/dist/{StockView-BH3wK8AT.js → StockView-DtHT2ulM.js} +6 -6
- package/dist/{SupplierView-DwVN-3IQ.js → SupplierView-B9A5R2Vm.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B0Vdby5t.js → TransferDetails.vue_vue_type_script_setup_true_lang-mUNCQTNw.js} +40 -39
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-DijNNVgt.js → TransferDialog.vue_vue_type_script_setup_true_lang-BwkUuXqj.js} +493 -501
- package/dist/{TransferTemplateView-ikRXcgOO.js → TransferTemplateView-DnyenkGu.js} +454 -498
- package/dist/{UnitView-yexlK1KM.js → UnitView-BL-jtVuZ.js} +4 -4
- package/dist/{WarehouseView-BjBJrjbZ.js → WarehouseView-BkUv1792.js} +2 -2
- package/dist/api/closing-template.d.ts +7 -0
- package/dist/{app-BD7MP1Oe.js → app-C-z1MfF6.js} +3992 -3929
- package/dist/app.d.ts +35 -0
- package/dist/app.js +1 -1
- package/dist/{decimal-Ct-e_mRV.js → decimal-DZz-_lgE.js} +1 -1
- package/dist/defineDeepModel-7VQajdPt.js +13 -0
- package/dist/format-time-from-id-9XFszs1J.js +15 -0
- package/dist/{id-to-date-Chhy1kB3.js → id-to-date-Bkue77uI.js} +1 -1
- package/dist/layout/layout-routes.d.ts +0 -1
- package/dist/{purchase-order-transaction-type-Bqu6bNsx.js → purchase-order-transaction-type-DHzMBgFs.js} +90 -101
- package/dist/router/name.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-DErisCtS.js → supplier-C6YWXF2Y.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-template-enabled-locations-CFCfbaOd.js +57 -0
- package/dist/views/closing-template/ClosingTemplateView.vue.d.ts +2 -0
- package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetails.vue.d.ts +2 -0
- package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetailsProps.d.ts +8 -0
- package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialog.vue.d.ts +22 -0
- package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialogProps.d.ts +10 -0
- package/dist/views/closing-template/components/closing-template-form/ClosingTemplateForm.vue.d.ts +16 -0
- package/dist/views/closing-template/components/closing-template-form/ClosingTemplateFormProps.d.ts +7 -0
- package/dist/views/closing-template/components/closing-template-form/components/ClosingTemplateItem.vue.d.ts +18 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +79 -0
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2165 -0
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2084 -0
- package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +1 -1
- package/dist/{xlsx-DyScN5Bf.js → xlsx-Dl6dAHFx.js} +1 -1
- package/dist/{xlsx.util-DEyeAnEa.js → xlsx.util-C1tUhDb8.js} +2 -2
- package/package.json +3 -3
package/dist/app.d.ts
CHANGED
|
@@ -141,6 +141,41 @@ export declare const i18nMessages: {
|
|
|
141
141
|
backdate: string;
|
|
142
142
|
};
|
|
143
143
|
};
|
|
144
|
+
closing: {
|
|
145
|
+
template: {
|
|
146
|
+
title: string;
|
|
147
|
+
create: {
|
|
148
|
+
title: string;
|
|
149
|
+
success: string;
|
|
150
|
+
successMessage: string;
|
|
151
|
+
error: string;
|
|
152
|
+
errorMessage: string;
|
|
153
|
+
};
|
|
154
|
+
update: {
|
|
155
|
+
title: string;
|
|
156
|
+
success: string;
|
|
157
|
+
successMessage: string;
|
|
158
|
+
error: string;
|
|
159
|
+
errorMessage: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
table: {
|
|
163
|
+
createdAt: string;
|
|
164
|
+
name: string;
|
|
165
|
+
noOfItems: string;
|
|
166
|
+
enabledOutlets: string;
|
|
167
|
+
reference: string;
|
|
168
|
+
};
|
|
169
|
+
form: {
|
|
170
|
+
items: {
|
|
171
|
+
selectItem: string;
|
|
172
|
+
addItem: string;
|
|
173
|
+
title: string;
|
|
174
|
+
};
|
|
175
|
+
name: string;
|
|
176
|
+
reference: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
144
179
|
ingredient: {
|
|
145
180
|
title: string;
|
|
146
181
|
code: string;
|
package/dist/app.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { c as d, ag as i } from "./app-C-z1MfF6.js";
|
|
2
|
+
import { getCurrentInstance as r, reactive as m, watch as u } from "vue";
|
|
3
|
+
function b(e = "modelValue") {
|
|
4
|
+
var o, n;
|
|
5
|
+
const s = ((o = r()) == null ? void 0 : o.props) ?? {}, a = ((n = r()) == null ? void 0 : n.emit) ?? (() => {
|
|
6
|
+
}), t = m(d(s[e] ?? {})), c = `update:${i(e)}`;
|
|
7
|
+
return u(t, (p) => {
|
|
8
|
+
a(c, p);
|
|
9
|
+
}), t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
b as d
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a6 as n } from "./app-C-z1MfF6.js";
|
|
2
|
+
function d(r) {
|
|
3
|
+
const t = a(r);
|
|
4
|
+
return t === null ? "" : n(t);
|
|
5
|
+
}
|
|
6
|
+
function a(r) {
|
|
7
|
+
const t = r.match(/\w+_(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z).*/);
|
|
8
|
+
if (!t) return null;
|
|
9
|
+
const e = /* @__PURE__ */ new Date(`${t[1]}`);
|
|
10
|
+
return isNaN(e.getTime()) ? null : e;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
d as f,
|
|
14
|
+
a as p
|
|
15
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { FmTabProps } from 'node_modules/@feedmepos/ui-library/dist/components/tab/FmTab.vue';
|
|
2
2
|
import { RouteName } from '../router/name';
|
|
3
|
-
export declare const showLocationForRoute: Record<string, boolean>;
|
|
4
3
|
export declare const activeTab: Record<RouteName, string>;
|
|
5
4
|
export declare const layoutRoutes: Array<FmTabProps>;
|
|
6
5
|
export declare const layoutRoutesMobile: FmTabProps[];
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { ref as w, computed as L, defineComponent as
|
|
3
|
-
import { i as
|
|
4
|
-
import { F as x, D as
|
|
5
|
-
import { useDialog as
|
|
1
|
+
import { n as W, j as A, ah as P, c as O, S as re, y as ae, a7 as oe, J as ne, K as se, ai as ce, ad as le, w as ie, b as ue, a as de } from "./app-C-z1MfF6.js";
|
|
2
|
+
import { ref as w, computed as L, defineComponent as me, onMounted as pe, resolveComponent as q, openBlock as E, createElementBlock as K, createElementVNode as N, createVNode as I, createCommentVNode as fe, createBlock as H } from "vue";
|
|
3
|
+
import { i as ve } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B9RU_arW.js";
|
|
4
|
+
import { F as x, D as M, R as C } from "./row-action.enum-PMKMRrZR.js";
|
|
5
|
+
import { useDialog as G, useSnackbar as J, FmButtonVariant as z } from "@feedmepos/ui-library";
|
|
6
|
+
import { f as he, p as ge } from "./format-time-from-id-9XFszs1J.js";
|
|
6
7
|
import { c as ye } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
7
8
|
import { useCoreStore as V, useI18n as be } from "@feedmepos/mf-common";
|
|
8
9
|
import { defineStore as we } from "pinia";
|
|
9
10
|
import { useRouter as Te } from "vue-router";
|
|
10
|
-
const Se =
|
|
11
|
-
const s =
|
|
11
|
+
const Se = W((a, n) => {
|
|
12
|
+
const s = A();
|
|
12
13
|
return {
|
|
13
14
|
async readRequests(e) {
|
|
14
15
|
const t = e ?? s.currentLocationDBName, r = `${a.inventoryBackendUrl}/${t}/purchase-request`;
|
|
@@ -38,8 +39,8 @@ const Se = z((a, n) => {
|
|
|
38
39
|
return await n.put(r, e);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
}),
|
|
42
|
-
[
|
|
42
|
+
}), Pe = {
|
|
43
|
+
[P.enum.confirmDraft]: {
|
|
43
44
|
primaryActions: {
|
|
44
45
|
text: "Confirm draft",
|
|
45
46
|
close: !0
|
|
@@ -48,7 +49,7 @@ const Se = z((a, n) => {
|
|
|
48
49
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
49
50
|
successMessage: "Purchase order draft has been confirmed"
|
|
50
51
|
},
|
|
51
|
-
[
|
|
52
|
+
[P.enum.cancelDraft]: {
|
|
52
53
|
primaryActions: {
|
|
53
54
|
text: "Cancel draft",
|
|
54
55
|
close: !0,
|
|
@@ -58,7 +59,7 @@ const Se = z((a, n) => {
|
|
|
58
59
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
59
60
|
successMessage: "Purchase order draft has been cancelled"
|
|
60
61
|
},
|
|
61
|
-
[
|
|
62
|
+
[P.enum.submitRequest]: {
|
|
62
63
|
primaryActions: {
|
|
63
64
|
text: "Submit request",
|
|
64
65
|
close: !0
|
|
@@ -67,7 +68,7 @@ const Se = z((a, n) => {
|
|
|
67
68
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
68
69
|
successMessage: "Purchase order draft has been submitted"
|
|
69
70
|
},
|
|
70
|
-
[
|
|
71
|
+
[P.enum.completeReceive]: {
|
|
71
72
|
primaryActions: {
|
|
72
73
|
text: "Mark received",
|
|
73
74
|
close: !0
|
|
@@ -76,7 +77,7 @@ const Se = z((a, n) => {
|
|
|
76
77
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
77
78
|
successMessage: "Purchase order has been marked as received"
|
|
78
79
|
},
|
|
79
|
-
[
|
|
80
|
+
[P.enum.approveRequest]: {
|
|
80
81
|
primaryActions: {
|
|
81
82
|
text: "Approve request",
|
|
82
83
|
close: !0
|
|
@@ -85,7 +86,7 @@ const Se = z((a, n) => {
|
|
|
85
86
|
message: "Purchase order will be approved.",
|
|
86
87
|
successMessage: "Purchase order has been approved"
|
|
87
88
|
},
|
|
88
|
-
[
|
|
89
|
+
[P.enum.rejectRequest]: {
|
|
89
90
|
primaryActions: {
|
|
90
91
|
text: "Reject request",
|
|
91
92
|
close: !0,
|
|
@@ -95,21 +96,10 @@ const Se = z((a, n) => {
|
|
|
95
96
|
message: "Purchase order will be rejected.",
|
|
96
97
|
successMessage: "Purchase order has been rejected"
|
|
97
98
|
}
|
|
98
|
-
}
|
|
99
|
-
function Pe(a) {
|
|
100
|
-
const n = J(a);
|
|
101
|
-
return n === null ? "" : ae(n);
|
|
102
|
-
}
|
|
103
|
-
function J(a) {
|
|
104
|
-
const n = a.match(/\w+_(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z).*/);
|
|
105
|
-
if (!n) return null;
|
|
106
|
-
const s = /* @__PURE__ */ new Date(`${n[1]}`);
|
|
107
|
-
return isNaN(s.getTime()) ? null : s;
|
|
108
|
-
}
|
|
109
|
-
const Q = z((a, n) => {
|
|
99
|
+
}, Q = W((a, n) => {
|
|
110
100
|
function s() {
|
|
111
101
|
var p;
|
|
112
|
-
const e = V(), t =
|
|
102
|
+
const e = V(), t = A(), r = t.businessLevel, l = `business_${((p = e.currentBusiness.value) == null ? void 0 : p._id) ?? ""}`, i = t.currentLocation.dbName;
|
|
113
103
|
return r ? l : i;
|
|
114
104
|
}
|
|
115
105
|
return {
|
|
@@ -118,7 +108,7 @@ const Q = z((a, n) => {
|
|
|
118
108
|
return n.get(r);
|
|
119
109
|
},
|
|
120
110
|
async getLocationTemplate(e) {
|
|
121
|
-
const r =
|
|
111
|
+
const r = A().currentLocation.dbName, l = `${a.inventoryBackendUrl}/${r}/purchase-order-template/${e}`;
|
|
122
112
|
return n.get(l);
|
|
123
113
|
},
|
|
124
114
|
async getBusinessTemplate(e) {
|
|
@@ -131,7 +121,7 @@ const Q = z((a, n) => {
|
|
|
131
121
|
return n.get(t);
|
|
132
122
|
},
|
|
133
123
|
async readLocationTemplates() {
|
|
134
|
-
const t =
|
|
124
|
+
const t = A().currentLocation.dbName, r = `${a.inventoryBackendUrl}/${t}/purchase-order-template`;
|
|
135
125
|
return n.get(r);
|
|
136
126
|
},
|
|
137
127
|
async readBusinessTemplates() {
|
|
@@ -153,7 +143,7 @@ const Q = z((a, n) => {
|
|
|
153
143
|
}
|
|
154
144
|
};
|
|
155
145
|
}), Ae = we("transferTemplateActions", () => {
|
|
156
|
-
const a =
|
|
146
|
+
const a = ke("receive/request"), n = G(), s = J(), e = Q(), t = w({});
|
|
157
147
|
function r() {
|
|
158
148
|
t.value = {
|
|
159
149
|
mode: x.CREATE,
|
|
@@ -179,12 +169,12 @@ const Q = z((a, n) => {
|
|
|
179
169
|
message: "Deleted template can no longer be retrieved",
|
|
180
170
|
primaryActions: {
|
|
181
171
|
text: "Delete",
|
|
182
|
-
variant:
|
|
172
|
+
variant: z.Destructive,
|
|
183
173
|
close: !0
|
|
184
174
|
},
|
|
185
175
|
secondaryActions: {
|
|
186
176
|
text: "Cancel",
|
|
187
|
-
variant:
|
|
177
|
+
variant: z.Plain,
|
|
188
178
|
close: !0
|
|
189
179
|
}
|
|
190
180
|
}).onPrimary(async () => {
|
|
@@ -226,7 +216,7 @@ const Q = z((a, n) => {
|
|
|
226
216
|
p.value.show = !1, l(O(d));
|
|
227
217
|
},
|
|
228
218
|
"onAction:use"(y) {
|
|
229
|
-
const v =
|
|
219
|
+
const v = A(), f = v.locations.find((m) => m.doc._id === y);
|
|
230
220
|
v.selectLocation(f), p.value.show = !1, S(O(d));
|
|
231
221
|
}
|
|
232
222
|
};
|
|
@@ -248,8 +238,8 @@ const Q = z((a, n) => {
|
|
|
248
238
|
transferFormDialogProps: a.transferDialogProps
|
|
249
239
|
};
|
|
250
240
|
}), $e = "use";
|
|
251
|
-
function
|
|
252
|
-
const { t: a } = be(), { viewTemplate: n, updateTemplate: s, deleteTemplate: e, useTemplate: t } = Ae(), r = w(new Array()), l = w(new Array()), i = w(!1), p =
|
|
241
|
+
function De() {
|
|
242
|
+
const { t: a } = be(), { viewTemplate: n, updateTemplate: s, deleteTemplate: e, useTemplate: t } = Ae(), r = w(new Array()), l = w(new Array()), i = w(!1), p = A(), T = Q();
|
|
253
243
|
async function S() {
|
|
254
244
|
if (r.value = [], l.value = [], !!p._currentLocation) {
|
|
255
245
|
i.value = !0;
|
|
@@ -273,7 +263,7 @@ function _e() {
|
|
|
273
263
|
try {
|
|
274
264
|
const [u] = await Promise.all([
|
|
275
265
|
T.getTemplate(m).catch((b) => {
|
|
276
|
-
if (b instanceof
|
|
266
|
+
if (b instanceof re && b.errorResponse.statusCode === 404)
|
|
277
267
|
return T.getBusinessTemplate(m);
|
|
278
268
|
throw b;
|
|
279
269
|
}),
|
|
@@ -305,7 +295,7 @@ function _e() {
|
|
|
305
295
|
accessorKey: "_id",
|
|
306
296
|
header: () => a("inventory.transfer.table.createdAt"),
|
|
307
297
|
cell(m) {
|
|
308
|
-
return
|
|
298
|
+
return he(`${m.getValue()}`);
|
|
309
299
|
},
|
|
310
300
|
enableSorting: !0
|
|
311
301
|
},
|
|
@@ -386,11 +376,11 @@ function _e() {
|
|
|
386
376
|
// value: useAction,
|
|
387
377
|
// color: 'text-fm-color-typo-primary'
|
|
388
378
|
// },
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
379
|
+
M[C.Details],
|
|
380
|
+
M[C.Edit],
|
|
381
|
+
M[C.Delete]
|
|
392
382
|
];
|
|
393
|
-
return ye(b, (
|
|
383
|
+
return ye(b, (F) => y(F, u));
|
|
394
384
|
},
|
|
395
385
|
enableSorting: !1,
|
|
396
386
|
size: 40,
|
|
@@ -410,15 +400,15 @@ function _e() {
|
|
|
410
400
|
loadTemplate: d
|
|
411
401
|
};
|
|
412
402
|
}
|
|
413
|
-
const
|
|
403
|
+
const _e = { class: "flex flex-col bg-white p-16 fm-corner-radius-lg gap-16" }, Ce = {
|
|
414
404
|
key: 0,
|
|
415
405
|
class: "flex gap-8 fm-typo-en-body-md-400 text-fm-color-typo-warning"
|
|
416
|
-
},
|
|
406
|
+
}, Ne = { class: "flex gap-12" }, Be = /* @__PURE__ */ me({
|
|
417
407
|
__name: "SelectTemplateDialog",
|
|
418
408
|
emits: ["close", "update:modelValue"],
|
|
419
409
|
setup(a, { emit: n }) {
|
|
420
|
-
const s = n, e = w(), t =
|
|
421
|
-
|
|
410
|
+
const s = n, e = w(), t = De(), r = Te(), l = A();
|
|
411
|
+
pe(() => {
|
|
422
412
|
t.fetchTemplates();
|
|
423
413
|
});
|
|
424
414
|
const i = L(() => t.loading.value), p = L(
|
|
@@ -430,7 +420,7 @@ const Ce = { class: "flex flex-col bg-white p-16 fm-corner-radius-lg gap-16" },
|
|
|
430
420
|
}))
|
|
431
421
|
);
|
|
432
422
|
function T() {
|
|
433
|
-
s("close"), r.push({ name:
|
|
423
|
+
s("close"), r.push({ name: oe.TRANSFER_TEMPLATE });
|
|
434
424
|
}
|
|
435
425
|
function S() {
|
|
436
426
|
s("close");
|
|
@@ -443,9 +433,9 @@ const Ce = { class: "flex flex-col bg-white p-16 fm-corner-radius-lg gap-16" },
|
|
|
443
433
|
}
|
|
444
434
|
return (v, f) => {
|
|
445
435
|
const m = q("FmIcon"), u = q("FmButton");
|
|
446
|
-
return E(), K("div",
|
|
436
|
+
return E(), K("div", _e, [
|
|
447
437
|
f[2] || (f[2] = N("div", { class: "h-32 text-fm-color-typo-primary fm-typo-en-title-md-600" }, "Select one template", -1)),
|
|
448
|
-
|
|
438
|
+
I(ae, {
|
|
449
439
|
"model-value": [e.value],
|
|
450
440
|
"onUpdate:modelValue": d,
|
|
451
441
|
items: p.value,
|
|
@@ -453,16 +443,16 @@ const Ce = { class: "flex flex-col bg-white p-16 fm-corner-radius-lg gap-16" },
|
|
|
453
443
|
"no-shadow": "",
|
|
454
444
|
"single-select": ""
|
|
455
445
|
}, null, 8, ["model-value", "items", "loading"]),
|
|
456
|
-
!i.value && !p.value.length ? (E(), K("div",
|
|
446
|
+
!i.value && !p.value.length ? (E(), K("div", Ce, [
|
|
457
447
|
N("div", null, [
|
|
458
|
-
|
|
448
|
+
I(m, {
|
|
459
449
|
name: "warning",
|
|
460
450
|
size: "sm"
|
|
461
451
|
})
|
|
462
452
|
]),
|
|
463
453
|
f[0] || (f[0] = N("div", null, "You have not configured any templates", -1))
|
|
464
|
-
])) :
|
|
465
|
-
N("div",
|
|
454
|
+
])) : fe("", !0),
|
|
455
|
+
N("div", Ne, [
|
|
466
456
|
f[1] || (f[1] = N("div", { class: "flex-1" }, null, -1)),
|
|
467
457
|
!i.value && !p.value.length ? (E(), H(u, {
|
|
468
458
|
key: 0,
|
|
@@ -476,7 +466,7 @@ const Ce = { class: "flex flex-col bg-white p-16 fm-corner-radius-lg gap-16" },
|
|
|
476
466
|
label: "Use template",
|
|
477
467
|
onClick: y
|
|
478
468
|
}, null, 8, ["loading", "disabled"])),
|
|
479
|
-
|
|
469
|
+
I(u, {
|
|
480
470
|
label: "Close",
|
|
481
471
|
variant: "tertiary",
|
|
482
472
|
onClick: S
|
|
@@ -486,7 +476,7 @@ const Ce = { class: "flex flex-col bg-white p-16 fm-corner-radius-lg gap-16" },
|
|
|
486
476
|
};
|
|
487
477
|
}
|
|
488
478
|
});
|
|
489
|
-
function
|
|
479
|
+
function Ue() {
|
|
490
480
|
let a = () => {
|
|
491
481
|
}, n = (e) => Promise.reject(e);
|
|
492
482
|
const s = new Promise((e, t) => {
|
|
@@ -503,22 +493,22 @@ function ke() {
|
|
|
503
493
|
}), s;
|
|
504
494
|
}
|
|
505
495
|
const B = w();
|
|
506
|
-
function
|
|
507
|
-
const s =
|
|
508
|
-
n != null && n.startDate && (n != null && n.endDate) ? n :
|
|
496
|
+
function ke(a, n) {
|
|
497
|
+
const s = G(), e = A(), t = ue(), r = w(!1), l = J(), i = Se(), p = w(new Array()), T = w(
|
|
498
|
+
n != null && n.startDate && (n != null && n.endDate) ? n : ve()
|
|
509
499
|
), S = L(() => {
|
|
510
500
|
const c = new Date(T.value.startDate), o = new Date(T.value.endDate);
|
|
511
501
|
return {
|
|
512
|
-
start:
|
|
513
|
-
end:
|
|
502
|
+
start: ne(c).toISOString(),
|
|
503
|
+
end: se(o).toISOString()
|
|
514
504
|
};
|
|
515
|
-
}), d = w(new Array()), y =
|
|
505
|
+
}), d = w(new Array()), y = ce(), v = w(null);
|
|
516
506
|
function f() {
|
|
517
|
-
const c =
|
|
507
|
+
const c = Ue();
|
|
518
508
|
let o;
|
|
519
509
|
return s.open({
|
|
520
510
|
title: "Select one template",
|
|
521
|
-
dialogComponent:
|
|
511
|
+
dialogComponent: Be,
|
|
522
512
|
dialogComponentProps: {
|
|
523
513
|
onClose() {
|
|
524
514
|
s.close(), c.resolve(o);
|
|
@@ -560,9 +550,9 @@ function Ee(a, n) {
|
|
|
560
550
|
async function b() {
|
|
561
551
|
p.value = [], r.value = !0;
|
|
562
552
|
try {
|
|
563
|
-
p.value = await i.getPurchaseOrders(S.value).then((h) => h.sort((g,
|
|
553
|
+
p.value = await i.getPurchaseOrders(S.value).then((h) => h.sort((g, $) => $._id.localeCompare(g._id)));
|
|
564
554
|
const c = await y.readLastClosing(!0), o = c == null ? void 0 : c._id;
|
|
565
|
-
o && (v.value =
|
|
555
|
+
o && (v.value = ge(o));
|
|
566
556
|
} catch {
|
|
567
557
|
l.open({
|
|
568
558
|
title: "Something went wrong",
|
|
@@ -573,7 +563,7 @@ function Ee(a, n) {
|
|
|
573
563
|
r.value = !1;
|
|
574
564
|
}
|
|
575
565
|
}
|
|
576
|
-
async function
|
|
566
|
+
async function F() {
|
|
577
567
|
d.value = [], r.value = !0;
|
|
578
568
|
try {
|
|
579
569
|
d.value = await i.readRequests();
|
|
@@ -592,10 +582,10 @@ function Ee(a, n) {
|
|
|
592
582
|
case "receive/request":
|
|
593
583
|
return b();
|
|
594
584
|
case "approval":
|
|
595
|
-
return
|
|
585
|
+
return F();
|
|
596
586
|
}
|
|
597
587
|
}
|
|
598
|
-
function
|
|
588
|
+
function Y(c, o) {
|
|
599
589
|
T.value = {
|
|
600
590
|
startDate: c,
|
|
601
591
|
endDate: o
|
|
@@ -610,32 +600,32 @@ function Ee(a, n) {
|
|
|
610
600
|
});
|
|
611
601
|
const _ = w(), j = w(Math.random().toString());
|
|
612
602
|
async function X(c, o) {
|
|
613
|
-
var
|
|
603
|
+
var D, k;
|
|
614
604
|
const h = Math.random().toString();
|
|
615
605
|
j.value = h;
|
|
616
|
-
const g = a === "receive/request" ? e.currentLocation : o == null ? void 0 : o.to,
|
|
606
|
+
const g = a === "receive/request" ? e.currentLocation : o == null ? void 0 : o.to, $ = {
|
|
617
607
|
purchaseOrder: c,
|
|
618
608
|
transferTo: g == null ? void 0 : g.name,
|
|
619
609
|
transferToDbName: g == null ? void 0 : g.dbName,
|
|
620
610
|
show: !0,
|
|
621
611
|
canResubmit: !1,
|
|
622
612
|
canApprove: a === "approval",
|
|
623
|
-
"onUpdate:show"(
|
|
624
|
-
_.value.show =
|
|
613
|
+
"onUpdate:show"(R) {
|
|
614
|
+
_.value.show = R;
|
|
625
615
|
}
|
|
626
616
|
};
|
|
627
|
-
if (_.value =
|
|
617
|
+
if (_.value = $, !(o || c.status !== le.enum.REQUESTING)) {
|
|
628
618
|
try {
|
|
629
619
|
o = (await i.readRequests(
|
|
630
620
|
`${c.supplier.internal}_${c.supplier._id}`
|
|
631
|
-
)).find((
|
|
621
|
+
)).find((te) => te.purchaseOrderId === c._id);
|
|
632
622
|
} catch {
|
|
633
623
|
console.error("Error at fetching po request to check");
|
|
634
624
|
}
|
|
635
|
-
h === j.value && (_.value.canResubmit = !o, _.value.transferTo = (
|
|
625
|
+
h === j.value && (_.value.canResubmit = !o, _.value.transferTo = (D = o == null ? void 0 : o.to) == null ? void 0 : D.name, _.value.transferToDbName = (k = o == null ? void 0 : o.to) == null ? void 0 : k.dbName);
|
|
636
626
|
}
|
|
637
627
|
}
|
|
638
|
-
async function
|
|
628
|
+
async function Z(c, o, h, g) {
|
|
639
629
|
r.value = !0;
|
|
640
630
|
try {
|
|
641
631
|
await i.processPurchaseOrder(
|
|
@@ -644,16 +634,16 @@ function Ee(a, n) {
|
|
|
644
634
|
doc: c,
|
|
645
635
|
options: (
|
|
646
636
|
// auto receive for supplier to warehouse
|
|
647
|
-
(o ===
|
|
648
|
-
o ===
|
|
637
|
+
(o === P.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
638
|
+
o === P.enum.completeReceive) && t.autoReceiveWarehouse ? {
|
|
649
639
|
autoReceive: !0
|
|
650
640
|
} : void 0
|
|
651
641
|
)
|
|
652
642
|
},
|
|
653
643
|
g
|
|
654
644
|
), await new Promise((k) => setTimeout(k, 1e3));
|
|
655
|
-
const
|
|
656
|
-
o ===
|
|
645
|
+
const D = A().currentLocationDBName.startsWith("restaurant_");
|
|
646
|
+
o === P.enum.confirmDraft && c.effectiveAt && D ? l.open({
|
|
657
647
|
title: "Success",
|
|
658
648
|
message: `${h}. The backdate will be reflected once your POS has received this change.`,
|
|
659
649
|
type: "success"
|
|
@@ -662,39 +652,39 @@ function Ee(a, n) {
|
|
|
662
652
|
message: h,
|
|
663
653
|
type: "success"
|
|
664
654
|
});
|
|
665
|
-
} catch (
|
|
655
|
+
} catch ($) {
|
|
666
656
|
l.open({
|
|
667
657
|
title: "Something went wrong",
|
|
668
658
|
message: "Please try again.",
|
|
669
659
|
type: "error"
|
|
670
|
-
}), console.error("Error when submitting PO operation", o, c,
|
|
660
|
+
}), console.error("Error when submitting PO operation", o, c, $);
|
|
671
661
|
} finally {
|
|
672
662
|
r.value = !1, U();
|
|
673
663
|
}
|
|
674
664
|
}
|
|
675
|
-
async function
|
|
676
|
-
const g =
|
|
665
|
+
async function ee(c, o, h) {
|
|
666
|
+
const g = Pe[o];
|
|
677
667
|
if (!g) {
|
|
678
668
|
l.open({
|
|
679
669
|
title: "Something went wrong",
|
|
680
|
-
message: `Cannot process order: ${
|
|
670
|
+
message: `Cannot process order: ${ie(o)}`,
|
|
681
671
|
type: "error"
|
|
682
672
|
});
|
|
683
673
|
return;
|
|
684
674
|
}
|
|
685
|
-
const { successMessage:
|
|
675
|
+
const { successMessage: $, ...D } = g;
|
|
686
676
|
s.open({
|
|
687
|
-
title:
|
|
688
|
-
message:
|
|
689
|
-
primaryActions:
|
|
677
|
+
title: D.title,
|
|
678
|
+
message: D.message,
|
|
679
|
+
primaryActions: D.primaryActions
|
|
690
680
|
}).onPrimary(() => {
|
|
691
|
-
|
|
681
|
+
Z(c, o, $, h);
|
|
692
682
|
});
|
|
693
683
|
}
|
|
694
684
|
return {
|
|
695
685
|
purchaseOrders: p,
|
|
696
686
|
purchaseRequests: d,
|
|
697
|
-
updateDateRange:
|
|
687
|
+
updateDateRange: Y,
|
|
698
688
|
fetchData: U,
|
|
699
689
|
loading: r,
|
|
700
690
|
transferDialogProps: B,
|
|
@@ -702,22 +692,21 @@ function Ee(a, n) {
|
|
|
702
692
|
promptUpdateTransferDialog: u,
|
|
703
693
|
transferDetailsProps: _,
|
|
704
694
|
promptShowTransferDetails: X,
|
|
705
|
-
submitAction:
|
|
695
|
+
submitAction: ee
|
|
706
696
|
};
|
|
707
697
|
}
|
|
708
698
|
function Ke(a, n, s) {
|
|
709
699
|
const e = (s == null ? void 0 : s.abbrev) ?? n.abbrev;
|
|
710
|
-
return `${
|
|
700
|
+
return `${de(a, !1)} ${e}`;
|
|
711
701
|
}
|
|
712
|
-
var
|
|
702
|
+
var Ee = /* @__PURE__ */ ((a) => (a.PURCHASE = "PURCHASE", a.TRANSFER = "TRANSFER", a))(Ee || {});
|
|
713
703
|
export {
|
|
714
|
-
|
|
704
|
+
Ee as P,
|
|
715
705
|
Q as a,
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
Ee as u
|
|
706
|
+
Ae as b,
|
|
707
|
+
De as c,
|
|
708
|
+
Se as d,
|
|
709
|
+
Pe as e,
|
|
710
|
+
Ke as f,
|
|
711
|
+
ke as u
|
|
723
712
|
};
|
package/dist/router/name.d.ts
CHANGED
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.v-enter-active[data-v-
|
|
1
|
+
.v-enter-active[data-v-849aa362],.v-leave-active[data-v-849aa362]{transition:opacity .1s ease}.v-enter-from[data-v-849aa362],.v-leave-to[data-v-849aa362]{opacity:0}.fm-status-badge-draft{background-color:var(--fm-color-neutral-gray-100);color:var(--fm-color-neutral-gray-500)}.fm-status-badge-receiving{background-color:var(--fm-color-system-blue-100);color:var(--fm-color-system-blue-400)}.fm-status-badge-cancel{background-color:var(--fm-color-system-red-100);color:var(--fm-color-system-red-400)}.fm-status-badge-complete{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}.fm-status-badge-processing,.fm-status-badge-requesting{background-color:var(--fm-color-system-orange-100);color:var(--fm-color-system-orange-400)}.fm-chip-transfer-info{background-color:var(--fm-color-system-blue-100);color:var(--fm-color-system-blue-400)}.fm-forecast-notification-low{background-color:var(--fm-color-system-red-100);color:var(--fm-color-system-red-400)}.fm-forecast-notification-mid{background-color:var(--fm-color-system-orange-100);color:var(--fm-color-system-orange-400)}.fm-forecast-notification-high{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}.fm-forecast-notification-indicator{display:inline-block;height:12px;width:12px;border-radius:9999px}.fm-forecast-notification-indicator-low{background-color:var(--fm-color-system-red-400)}.fm-forecast-notification-indicator-mid{background-color:var(--fm-color-system-orange-400)}.fm-forecast-notification-indicator-high{background-color:var(--fm-color-system-green-400)}.fm-droppable-field[data-v-311b22a0]{display:flex;flex-direction:column;gap:4px}.fm-droppable-field__container[data-v-311b22a0]{position:relative;background-color:var(--fm-color-neutral-white);padding:12px;border-radius:8px;border-width:2px;border-style:dashed;border-color:var(--fm-color-neutral-gray-300);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}.fm-droppable-field__container--disabled[data-v-311b22a0]{cursor:not-allowed;color:var(--fm-color-neutral-gray-200);border-color:var(--fm-color-neutral-gray-200)}.fm-droppable-field__container--dragging[data-v-311b22a0]{border-color:var(--fm-color-primary)}.fm-droppable-field__container--invalid[data-v-311b22a0]{border-color:var(--fm-color-system-red-300)}.fm-droppable-field__container[data-v-311b22a0]:hover:not(.fm-droppable-field__container--disabled){border-color:var(--fm-color-neutral-gray-400)}.fm-droppable-field__input[data-v-311b22a0]{cursor:pointer;opacity:0;position:absolute;top:0;left:0;height:100%;width:100%}.fm-droppable-field__input[data-v-311b22a0]:disabled{display:none;cursor:not-allowed}.map-button[data-v-272f5e8b]{border-top-width:1px;border-top-color:var(--fm-color-neutral-gray-200);color:var(--fm-color-neutral-gray-400);padding:.2rem 1rem;border-radius:8px}table[data-v-92a03d5c]{width:100%;border-spacing:unset;line-height:inherit}table td[data-v-92a03d5c],table th[data-v-92a03d5c]{padding:3px 5px;vertical-align:top}hr[data-v-92a03d5c]{border-collapse:unset;background:#888;height:2px;border:0px}.text-left[data-v-92a03d5c]{text-align:left}.text-right[data-v-92a03d5c]{text-align:right}.purchase-box[data-v-92a03d5c]{max-width:800px;margin:auto;padding:30px;border:1px solid #eee;box-shadow:0 0 10px #00000026;font-size:16px;line-height:1.5;font-family:Helvetica Neue,Helvetica,Helvetica,Arial,sans-serif;color:#555}.title[data-v-92a03d5c]{padding-bottom:0;font-size:30px;color:#333}.header[data-v-92a03d5c]{font-weight:600;color:#333}.sub-header[data-v-92a03d5c]{font-size:18px;color:#333}.caption[data-v-92a03d5c]{font-size:14px;color:#666}.address[data-v-92a03d5c]{font-size:16px;line-height:1.2;color:#666}.purchase-body[data-v-92a03d5c]{margin-top:30px}.item-header[data-v-92a03d5c]{border:0px;background:#ccc;color:#444}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as S, j as u, Q as m, T as y } from "./app-
|
|
1
|
+
import { n as S, j as u, Q as m, T as y } from "./app-C-z1MfF6.js";
|
|
2
2
|
import { useCoreStore as c } from "@feedmepos/mf-common";
|
|
3
3
|
import { defineStore as b } from "pinia";
|
|
4
4
|
import { ref as l, computed as v } from "vue";
|