@feedmepos/mf-report 5.21.24 → 5.21.25
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as J, mergeModels as
|
|
1
|
+
import { defineComponent as J, mergeModels as Ve, useModel as te, computed as q, resolveComponent as V, createElementBlock as U, openBlock as _, createElementVNode as t, createCommentVNode as L, normalizeClass as Ie, Fragment as ke, createBlock as j, withCtx as xe, toDisplayString as C, renderList as De, createVNode as l, unref as d, h as k, normalizeStyle as tt, createTextVNode as ot, ref as z, onUnmounted as Re, watch as Ce, isRef as Te, resolveDynamicComponent as Fe, mergeProps as Qe, onMounted as Ge } from "vue";
|
|
2
2
|
import { useRouter as be, useRoute as at } from "vue-router";
|
|
3
|
-
import { u as oe, I as he, d as
|
|
3
|
+
import { u as oe, I as he, d as Se, z as lt, A as nt, e as Ae, f as Pe, b as we, B as ve, E as st, o as rt, y as Me, G as je, H as Ke, J as Le, K as ze, L as it, M as dt, N as mt, O as qe, c as Ze, P as pt, Q as ut, R as ct, S as ft, T as gt } from "./vue-i18n-D1iec8Wy.js";
|
|
4
4
|
import { u as Oe } from "./message-dialog-UoMWOnil.js";
|
|
5
5
|
import { useSnackbar as _e } from "@feedmepos/ui-library";
|
|
6
6
|
import { storeToRefs as Ee } from "pinia";
|
|
@@ -10,7 +10,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
10
10
|
class: "w-[24px] flex items-center"
|
|
11
11
|
}, B = /* @__PURE__ */ J({
|
|
12
12
|
__name: "MappingField",
|
|
13
|
-
props: /* @__PURE__ */
|
|
13
|
+
props: /* @__PURE__ */ Ve({
|
|
14
14
|
removable: {
|
|
15
15
|
type: Boolean,
|
|
16
16
|
default: !1
|
|
@@ -35,7 +35,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
35
35
|
modelValue: { required: !0 },
|
|
36
36
|
modelModifiers: {}
|
|
37
37
|
}),
|
|
38
|
-
emits: /* @__PURE__ */
|
|
38
|
+
emits: /* @__PURE__ */ Ve(["remove"], ["update:modelValue"]),
|
|
39
39
|
setup(g, { emit: a }) {
|
|
40
40
|
const e = te(g, "modelValue"), i = g, x = q(
|
|
41
41
|
() => Object.keys(i.options).map((F) => {
|
|
@@ -57,7 +57,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
57
57
|
const D = a;
|
|
58
58
|
return (F, y) => {
|
|
59
59
|
var $;
|
|
60
|
-
const b = V("FmTextField"),
|
|
60
|
+
const b = V("FmTextField"), m = V("FmTooltip"), K = V("FmIcon");
|
|
61
61
|
return _(), U("div", vt, [
|
|
62
62
|
t("div", {
|
|
63
63
|
class: Ie(`${g.removable ? "w-[calc(100%-24px)]" : "w-[100%]"} flex flex-col items-start gap-[4px]`)
|
|
@@ -71,7 +71,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
71
71
|
type: g.type,
|
|
72
72
|
rules: g.rules,
|
|
73
73
|
"onUpdate:modelValue": y[0] || (y[0] = (u) => T(x.value[0].key, u))
|
|
74
|
-
}, null, 8, ["model-value", "placeholder", "type", "rules"])) : (_(), j(
|
|
74
|
+
}, null, 8, ["model-value", "placeholder", "type", "rules"])) : (_(), j(m, {
|
|
75
75
|
key: 1,
|
|
76
76
|
content: ($ = e.value[x.value[0].key]) == null ? void 0 : $.toString(),
|
|
77
77
|
class: "w-[100%]"
|
|
@@ -95,8 +95,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
95
95
|
placeholder: u.placeholder,
|
|
96
96
|
type: g.type,
|
|
97
97
|
rules: g.rules,
|
|
98
|
-
"onUpdate:modelValue": (
|
|
99
|
-
}, null, 8, ["model-value", "placeholder", "type", "rules", "onUpdate:modelValue"])) : (_(), j(
|
|
98
|
+
"onUpdate:modelValue": (p) => T(u.key, p)
|
|
99
|
+
}, null, 8, ["model-value", "placeholder", "type", "rules", "onUpdate:modelValue"])) : (_(), j(m, {
|
|
100
100
|
key: 1,
|
|
101
101
|
content: (c = e.value[u.key]) == null ? void 0 : c.toString(),
|
|
102
102
|
class: "w-[100%]"
|
|
@@ -127,9 +127,9 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
127
127
|
placeholder: u.placeholder,
|
|
128
128
|
type: g.type,
|
|
129
129
|
rules: g.rules,
|
|
130
|
-
"onUpdate:modelValue": (
|
|
130
|
+
"onUpdate:modelValue": (p) => T(u.key, p)
|
|
131
131
|
}, null, 8, ["model-value", "placeholder", "type", "rules", "onUpdate:modelValue"])
|
|
132
|
-
], 2)) : (_(), j(
|
|
132
|
+
], 2)) : (_(), j(m, {
|
|
133
133
|
key: 1,
|
|
134
134
|
content: (c = e.value[u.key]) == null ? void 0 : c.toString(),
|
|
135
135
|
class: "w-[50%]"
|
|
@@ -162,7 +162,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
162
162
|
class: "flex flex-col w-[100%] justify-start"
|
|
163
163
|
}, It = { class: "text-nowrap overflow-hidden text-ellipsis font-semibold" }, Ut = { class: "w-[100%]" }, Rt = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Pt = { class: "flex flex-col w-[100%] justify-between" }, Mt = { class: "text-nowrap w-[50%] overflow-hidden text-ellipsis font-semibold" }, jt = { class: "w-[100%]" }, Ue = /* @__PURE__ */ J({
|
|
164
164
|
__name: "UploadSection",
|
|
165
|
-
props: /* @__PURE__ */
|
|
165
|
+
props: /* @__PURE__ */ Ve({
|
|
166
166
|
label: {
|
|
167
167
|
type: String,
|
|
168
168
|
default: "upload"
|
|
@@ -186,16 +186,16 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
186
186
|
emits: ["update:modelValue"],
|
|
187
187
|
setup(g) {
|
|
188
188
|
const { t: a } = oe(), e = te(g, "modelValue"), i = g, x = (b) => {
|
|
189
|
-
const
|
|
189
|
+
const m = "font-medium px-1 py-1 rounded-md inline-block mr-2";
|
|
190
190
|
switch (b) {
|
|
191
191
|
case "SUCCESS":
|
|
192
|
-
return `${
|
|
192
|
+
return `${m} bg-green-700 bg-opacity-10 text-green-700`;
|
|
193
193
|
case "SKIPPED":
|
|
194
|
-
return `${
|
|
194
|
+
return `${m} bg-gray-400 bg-opacity-10 text-gray-700`;
|
|
195
195
|
case "FAILED":
|
|
196
|
-
return `${
|
|
196
|
+
return `${m} bg-red-700 bg-opacity-10 text-red-700`;
|
|
197
197
|
default:
|
|
198
|
-
return `${
|
|
198
|
+
return `${m} bg-blue-700 bg-opacity-10`;
|
|
199
199
|
}
|
|
200
200
|
}, T = q(() => {
|
|
201
201
|
switch (e.value.name) {
|
|
@@ -210,7 +210,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
210
210
|
{
|
|
211
211
|
accessorKey: "createdAt",
|
|
212
212
|
header: () => k("p", { class: "min-w-[70px] text-nowrap text-ellipsis" }, "Logged At"),
|
|
213
|
-
cell: (b) =>
|
|
213
|
+
cell: (b) => Se(b.getValue()).format("YYYY-MM-DD HH:mm:ss")
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
// use an existing key but render full cron info from the row
|
|
@@ -218,28 +218,32 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
218
218
|
header: () => k("p", { class: "min-w-[270px] text-nowrap text-ellipsis" }, "Cron Info"),
|
|
219
219
|
cell: (b) => {
|
|
220
220
|
var $;
|
|
221
|
-
const
|
|
222
|
-
console.log(
|
|
221
|
+
const m = ($ = b.row) == null ? void 0 : $.original;
|
|
222
|
+
console.log(m);
|
|
223
223
|
const K = [
|
|
224
224
|
{
|
|
225
225
|
label: "Last Upload",
|
|
226
|
-
value:
|
|
226
|
+
value: m != null && m.lastUploadDate ? Se(m.lastUploadDate).format("YYYY-MM-DD HH:mm:ss") : "-"
|
|
227
227
|
},
|
|
228
228
|
{
|
|
229
229
|
label: "Heartbeat",
|
|
230
|
-
value:
|
|
230
|
+
value: m != null && m.restaurantHeartBeat ? Se(m.restaurantHeartBeat).format("YYYY-MM-DD HH:mm:ss") : "-"
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
label: "Start",
|
|
234
|
-
value:
|
|
234
|
+
value: m != null && m.startDate ? Se(m.startDate).format("YYYY-MM-DD HH:mm:ss") : "-"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "Failed At",
|
|
238
|
+
value: m != null && m.processingDate ? Se(m.processingDate).format("YYYY-MM-DD HH:mm:ss") : "-"
|
|
235
239
|
},
|
|
236
240
|
{
|
|
237
241
|
label: "Pending Days",
|
|
238
|
-
value: typeof (
|
|
242
|
+
value: typeof (m == null ? void 0 : m.pendingDays) == "number" && !Number.isNaN(m.pendingDays) ? m.pendingDays.toString() : "-"
|
|
239
243
|
},
|
|
240
244
|
{
|
|
241
245
|
label: "Delay Days",
|
|
242
|
-
value: typeof (
|
|
246
|
+
value: typeof (m == null ? void 0 : m.delayDays) == "number" && !Number.isNaN(m.delayDays) ? m.delayDays.toString() : "-"
|
|
243
247
|
}
|
|
244
248
|
];
|
|
245
249
|
return k(
|
|
@@ -262,14 +266,14 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
262
266
|
"div",
|
|
263
267
|
{ class: "space-y-2 pt-2 pb-2" },
|
|
264
268
|
b.getValue().map(
|
|
265
|
-
(
|
|
269
|
+
(m) => k("div", { class: "min-w-[320px] whitespace-normal break-words flex items-center" }, [
|
|
266
270
|
k("span", { class: "mr-2" }, "•"),
|
|
267
|
-
|
|
271
|
+
m.status ? k(
|
|
268
272
|
"div",
|
|
269
|
-
{ class: x(
|
|
270
|
-
|
|
273
|
+
{ class: x(m.status) },
|
|
274
|
+
m.status
|
|
271
275
|
) : null,
|
|
272
|
-
k("span", {},
|
|
276
|
+
k("span", {}, m.message.toString())
|
|
273
277
|
])
|
|
274
278
|
)
|
|
275
279
|
) : k("p", { class: "min-w-[320px] whitespace-normal break-words" }, "No messages"),
|
|
@@ -278,27 +282,27 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
278
282
|
},
|
|
279
283
|
enableSorting: !1
|
|
280
284
|
}
|
|
281
|
-
], F = q(() => i.errorLogs.filter((
|
|
285
|
+
], F = q(() => i.errorLogs.filter((m) => !m.isRead).length > 0), y = () => {
|
|
282
286
|
F.value && nt(i.integrationId).then(() => {
|
|
283
287
|
i.errorLogs.forEach((b) => b.isRead = !0);
|
|
284
288
|
}).catch((b) => {
|
|
285
289
|
console.error("Failed to mark error logs as read:", b);
|
|
286
290
|
});
|
|
287
291
|
};
|
|
288
|
-
return (b,
|
|
292
|
+
return (b, m) => {
|
|
289
293
|
var v, h;
|
|
290
|
-
const K = V("FmBadge"), $ = V("FmTable"), u = V("FmSideSheet"), c = V("FmSwitch"),
|
|
294
|
+
const K = V("FmBadge"), $ = V("FmTable"), u = V("FmSideSheet"), c = V("FmSwitch"), p = V("FmTextField"), f = V("FmTimePicker");
|
|
291
295
|
return _(), U(ke, null, [
|
|
292
296
|
t("div", kt, [
|
|
293
297
|
t("div", Ct, C(d(a)("report.integration.auto", { label: g.label })), 1),
|
|
294
298
|
t("div", $t, [
|
|
295
|
-
g.label == "upload" ? (_(), U("div", St, C(d(a)("report.integration.lastUploadDate")) + ": " + C(g.lastUploadDate ? d(
|
|
299
|
+
g.label == "upload" ? (_(), U("div", St, C(d(a)("report.integration.lastUploadDate")) + ": " + C(g.lastUploadDate ? d(Se)(g.lastUploadDate).format("MMMM D, YYYY h:mm A") : d(a)("report.integration.noData.title")), 1)) : L("", !0),
|
|
296
300
|
l(u, {
|
|
297
301
|
header: "Cron Job Error Log",
|
|
298
302
|
"dismiss-away": "",
|
|
299
303
|
"max-width": 980,
|
|
300
304
|
"close-button": !1,
|
|
301
|
-
"onOn:clickedAway":
|
|
305
|
+
"onOn:clickedAway": m[0] || (m[0] = () => y())
|
|
302
306
|
}, {
|
|
303
307
|
"side-sheet-button": xe(() => [
|
|
304
308
|
g.label == "upload" ? (_(), U("div", Vt, [
|
|
@@ -341,7 +345,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
341
345
|
t("div", Ft, C(d(a)("report.common.enable")), 1),
|
|
342
346
|
l(c, {
|
|
343
347
|
modelValue: e.value.enable,
|
|
344
|
-
"onUpdate:modelValue":
|
|
348
|
+
"onUpdate:modelValue": m[1] || (m[1] = (r) => e.value.enable = r),
|
|
345
349
|
style: { gap: "0px" }
|
|
346
350
|
}, null, 8, ["modelValue"])
|
|
347
351
|
])
|
|
@@ -349,10 +353,10 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
349
353
|
T.value ? (_(), U("div", Nt, [
|
|
350
354
|
t("div", It, C(d(a)("report.common.email")), 1),
|
|
351
355
|
t("div", Ut, [
|
|
352
|
-
l(
|
|
356
|
+
l(p, {
|
|
353
357
|
"model-value": (e.value.emails || []).join(","),
|
|
354
358
|
placeholder: "Email",
|
|
355
|
-
"onUpdate:modelValue":
|
|
359
|
+
"onUpdate:modelValue": m[2] || (m[2] = (r) => {
|
|
356
360
|
switch (e.value.name) {
|
|
357
361
|
case d(he).AutoCount:
|
|
358
362
|
case d(he).SQL:
|
|
@@ -370,8 +374,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
370
374
|
t("div", jt, [
|
|
371
375
|
l(f, {
|
|
372
376
|
class: "gap-[0px]",
|
|
373
|
-
"model-value": d(
|
|
374
|
-
"onUpdate:modelValue":
|
|
377
|
+
"model-value": d(Se)().hour(((v = e.value.triggerTime) == null ? void 0 : v.hour) ?? 0).minute(((h = e.value.triggerTime) == null ? void 0 : h.minute) ?? 0).format("HH:mm"),
|
|
378
|
+
"onUpdate:modelValue": m[3] || (m[3] = (r) => {
|
|
375
379
|
r && (e.value.triggerTime.hour = Number(r.split(":")[0]), e.value.triggerTime.minute = Number(r.split(":")[1]));
|
|
376
380
|
})
|
|
377
381
|
}, null, 8, ["model-value"])
|
|
@@ -388,7 +392,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
388
392
|
delayDay: { placeholder: d(a)("report.integration.delayDay"), editable: !0 }
|
|
389
393
|
},
|
|
390
394
|
rules: [(r) => r > 0 || "Delay days must be greater than 0"],
|
|
391
|
-
"onUpdate:modelValue":
|
|
395
|
+
"onUpdate:modelValue": m[4] || (m[4] = (r) => {
|
|
392
396
|
e.value.delayDay = r.delayDay;
|
|
393
397
|
})
|
|
394
398
|
}, null, 8, ["model-value", "options", "rules"])
|
|
@@ -401,7 +405,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
401
405
|
class: "w-[24px] flex items-center"
|
|
402
406
|
}, et = /* @__PURE__ */ J({
|
|
403
407
|
__name: "MappingDropdown",
|
|
404
|
-
props: /* @__PURE__ */
|
|
408
|
+
props: /* @__PURE__ */ Ve({
|
|
405
409
|
removable: {
|
|
406
410
|
type: Boolean,
|
|
407
411
|
default: !1
|
|
@@ -426,65 +430,65 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
426
430
|
modelValue: { required: !0 },
|
|
427
431
|
modelModifiers: {}
|
|
428
432
|
}),
|
|
429
|
-
emits: /* @__PURE__ */
|
|
433
|
+
emits: /* @__PURE__ */ Ve(["remove"], ["update:modelValue"]),
|
|
430
434
|
setup(g, { emit: a }) {
|
|
431
435
|
const e = te(g, "modelValue"), i = g, x = q(
|
|
432
436
|
() => Object.keys(i.options).map((b) => {
|
|
433
|
-
const
|
|
437
|
+
const m = i.options[b];
|
|
434
438
|
return {
|
|
435
|
-
placeholder:
|
|
439
|
+
placeholder: m.placeholder,
|
|
436
440
|
key: b,
|
|
437
|
-
editable:
|
|
438
|
-
dropdownOptions:
|
|
441
|
+
editable: m.editable,
|
|
442
|
+
dropdownOptions: m.dropdownOptions
|
|
439
443
|
};
|
|
440
444
|
})
|
|
441
|
-
), T = (b,
|
|
442
|
-
i.singleValueMode ? e.value = i.type === "number" ? Number(b) : b :
|
|
445
|
+
), T = (b, m) => {
|
|
446
|
+
i.singleValueMode ? e.value = i.type === "number" ? Number(b) : b : m && (e.value = {
|
|
443
447
|
...e.value,
|
|
444
|
-
[
|
|
448
|
+
[m]: i.type === "number" ? Number(b) : b
|
|
445
449
|
});
|
|
446
450
|
}, D = (b) => {
|
|
447
|
-
var
|
|
448
|
-
return i.singleValueMode ? i.options.key.placeholder : (
|
|
451
|
+
var m;
|
|
452
|
+
return i.singleValueMode ? i.options.key.placeholder : (m = e.value[b.key]) == null ? void 0 : m.toString();
|
|
449
453
|
}, F = (b) => i.singleValueMode ? e.value : e.value[b.key], y = a;
|
|
450
|
-
return (b,
|
|
454
|
+
return (b, m) => {
|
|
451
455
|
const K = V("FmSelect"), $ = V("FmTextField"), u = V("FmTooltip"), c = V("FmIcon");
|
|
452
456
|
return _(), U("div", Lt, [
|
|
453
457
|
t("div", {
|
|
454
458
|
class: Ie(`${g.removable ? "w-[calc(100%-24px)] flex-row" : "w-[100%] flex-col"} flex items-center gap-[4px]`),
|
|
455
459
|
style: { alignItems: "start" }
|
|
456
460
|
}, [
|
|
457
|
-
(_(!0), U(ke, null, De(x.value, (
|
|
458
|
-
key:
|
|
461
|
+
(_(!0), U(ke, null, De(x.value, (p) => (_(), U(ke, {
|
|
462
|
+
key: p.key
|
|
459
463
|
}, [
|
|
460
|
-
|
|
464
|
+
p.editable ? (_(), U("div", {
|
|
461
465
|
key: 0,
|
|
462
466
|
class: Ie(g.removable ? "w-[50%]" : "w-[100%]")
|
|
463
467
|
}, [
|
|
464
|
-
|
|
468
|
+
p.dropdownOptions ? (_(), j(K, {
|
|
465
469
|
key: 0,
|
|
466
470
|
searchable: "",
|
|
467
471
|
"search-target": "label",
|
|
468
|
-
"model-value": F(
|
|
469
|
-
placeholder:
|
|
470
|
-
items:
|
|
472
|
+
"model-value": F(p),
|
|
473
|
+
placeholder: p.placeholder,
|
|
474
|
+
items: p.dropdownOptions,
|
|
471
475
|
"shift-menu": !0,
|
|
472
|
-
"onUpdate:modelValue": (f) => T(f,
|
|
476
|
+
"onUpdate:modelValue": (f) => T(f, p.key)
|
|
473
477
|
}, null, 8, ["model-value", "placeholder", "items", "onUpdate:modelValue"])) : (_(), j($, {
|
|
474
478
|
key: 1,
|
|
475
|
-
"model-value": F(
|
|
476
|
-
placeholder:
|
|
479
|
+
"model-value": F(p),
|
|
480
|
+
placeholder: p.placeholder,
|
|
477
481
|
type: g.type,
|
|
478
482
|
rules: g.rules,
|
|
479
|
-
"onUpdate:modelValue": (f) => T(f,
|
|
483
|
+
"onUpdate:modelValue": (f) => T(f, p.key)
|
|
480
484
|
}, null, 8, ["model-value", "placeholder", "type", "rules", "onUpdate:modelValue"]))
|
|
481
485
|
], 2)) : (_(), j(u, {
|
|
482
486
|
key: 1,
|
|
483
|
-
content: D(
|
|
487
|
+
content: D(p),
|
|
484
488
|
class: "w-[50%]"
|
|
485
489
|
}, {
|
|
486
490
|
default: xe(() => [
|
|
487
|
-
t("div", Ot, C(D(
|
|
491
|
+
t("div", Ot, C(D(p)), 1)
|
|
488
492
|
]),
|
|
489
493
|
_: 2
|
|
490
494
|
}, 1032, ["content"]))
|
|
@@ -495,7 +499,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
495
499
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
496
500
|
name: "delete",
|
|
497
501
|
size: "md",
|
|
498
|
-
onClick:
|
|
502
|
+
onClick: m[0] || (m[0] = (p) => y("remove"))
|
|
499
503
|
})
|
|
500
504
|
])) : L("", !0)
|
|
501
505
|
]);
|
|
@@ -531,8 +535,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
531
535
|
"flex flex-row items-center w-full font-medium text-gray-600 mb-2"
|
|
532
536
|
])
|
|
533
537
|
}, [
|
|
534
|
-
(_(!0), U(ke, null, De(e.headerItems, (b,
|
|
535
|
-
key: `header-item-${
|
|
538
|
+
(_(!0), U(ke, null, De(e.headerItems, (b, m) => (_(), U("div", {
|
|
539
|
+
key: `header-item-${m}`,
|
|
536
540
|
class: "w-[50%]"
|
|
537
541
|
}, [
|
|
538
542
|
y < i.value ? (_(), U(ke, { key: 0 }, [
|
|
@@ -548,8 +552,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
548
552
|
"is-take-whole-row": !1,
|
|
549
553
|
removable: e.removable,
|
|
550
554
|
"onUpdate:modelValue": (b) => {
|
|
551
|
-
const
|
|
552
|
-
|
|
555
|
+
const m = [...e.rows];
|
|
556
|
+
m[y] = b, x("update:rows", m);
|
|
553
557
|
},
|
|
554
558
|
onRemove: () => x("remove", e.mappingType || "", y)
|
|
555
559
|
}, null, 8, ["model-value", "options", "removable", "onUpdate:modelValue", "onRemove"])) : (_(), j(et, {
|
|
@@ -558,8 +562,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
558
562
|
options: e.fieldsOptions || {},
|
|
559
563
|
removable: e.removable,
|
|
560
564
|
"onUpdate:modelValue": (b) => {
|
|
561
|
-
const
|
|
562
|
-
|
|
565
|
+
const m = [...e.rows];
|
|
566
|
+
m[y] = b, x("update:rows", m);
|
|
563
567
|
},
|
|
564
568
|
onRemove: () => x("remove", e.mappingType || "", y)
|
|
565
569
|
}, null, 8, ["model-value", "options", "removable", "onUpdate:modelValue", "onRemove"]))
|
|
@@ -583,7 +587,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
583
587
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
584
588
|
}, ko = /* @__PURE__ */ J({
|
|
585
589
|
__name: "Setting",
|
|
586
|
-
props: /* @__PURE__ */
|
|
590
|
+
props: /* @__PURE__ */ Ve({
|
|
587
591
|
tenantOptions: {
|
|
588
592
|
type: Object,
|
|
589
593
|
required: !0
|
|
@@ -606,7 +610,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
606
610
|
}),
|
|
607
611
|
emits: ["update:modelValue"],
|
|
608
612
|
setup(g) {
|
|
609
|
-
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = z(!1),
|
|
613
|
+
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = z(!1), m = q(
|
|
610
614
|
() => y.map((s) => ({ label: s.name, value: s.id }))
|
|
611
615
|
), K = q(() => {
|
|
612
616
|
var s, n;
|
|
@@ -653,7 +657,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
653
657
|
}
|
|
654
658
|
});
|
|
655
659
|
}
|
|
656
|
-
async function
|
|
660
|
+
async function p() {
|
|
657
661
|
await D(async () => {
|
|
658
662
|
try {
|
|
659
663
|
await je(e.value._id, e.value), await x.getSettings();
|
|
@@ -739,7 +743,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
739
743
|
variant: "primary",
|
|
740
744
|
label: d(a)("report.common.update"),
|
|
741
745
|
"prepend-icon": "update",
|
|
742
|
-
onClick:
|
|
746
|
+
onClick: p
|
|
743
747
|
}, null, 8, ["label"])
|
|
744
748
|
])
|
|
745
749
|
])
|
|
@@ -787,7 +791,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
787
791
|
modelValue: e.value.platform.locationIds,
|
|
788
792
|
"onUpdate:modelValue": n[1] || (n[1] = (ee) => e.value.platform.locationIds = ee),
|
|
789
793
|
multiselect: !0,
|
|
790
|
-
items:
|
|
794
|
+
items: m.value,
|
|
791
795
|
placeholder: "Select location",
|
|
792
796
|
class: "flex-grow"
|
|
793
797
|
}, null, 8, ["modelValue", "items"])
|
|
@@ -1024,35 +1028,35 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1024
1028
|
emits: ["update:modelValue"],
|
|
1025
1029
|
setup(g) {
|
|
1026
1030
|
const a = z([]), { t: e } = oe(), i = q(
|
|
1027
|
-
() => a.value.reduce((
|
|
1028
|
-
const $ =
|
|
1029
|
-
|
|
1031
|
+
() => a.value.reduce((m, K) => {
|
|
1032
|
+
const $ = m.length, { invoice: u, payments: c } = K;
|
|
1033
|
+
m[$] = {
|
|
1030
1034
|
date: u.Date,
|
|
1031
1035
|
contact: u.Contact.ContactID,
|
|
1032
1036
|
status: u.Status,
|
|
1033
1037
|
ref: u.Reference
|
|
1034
1038
|
};
|
|
1035
|
-
for (let
|
|
1036
|
-
const f = $ +
|
|
1037
|
-
|
|
1038
|
-
...
|
|
1039
|
-
itemDescription: u.LineItems[
|
|
1040
|
-
itemQuantity: u.LineItems[
|
|
1041
|
-
itemUnitAmount: u.LineItems[
|
|
1039
|
+
for (let p = 0; p < Math.max(u.LineItems.length, c.length); p++) {
|
|
1040
|
+
const f = $ + p;
|
|
1041
|
+
m[f] || (m[f] = {}), u.LineItems[p] && (m[f] = {
|
|
1042
|
+
...m[f],
|
|
1043
|
+
itemDescription: u.LineItems[p].Description,
|
|
1044
|
+
itemQuantity: u.LineItems[p].Quantity,
|
|
1045
|
+
itemUnitAmount: u.LineItems[p].UnitAmount,
|
|
1042
1046
|
// itemCode: invoice.LineItems[i].ItemCode,
|
|
1043
|
-
itemAccount: u.LineItems[
|
|
1044
|
-
itemTax: u.LineItems[
|
|
1045
|
-
itemTaxType: u.LineItems[
|
|
1046
|
-
itemLineAmount: u.LineItems[
|
|
1047
|
-
itemDiscount: u.LineItems[
|
|
1048
|
-
}), c[
|
|
1049
|
-
...
|
|
1050
|
-
paymentAccount: c[
|
|
1051
|
-
paymentReference: c[
|
|
1052
|
-
paymentAmount: c[
|
|
1047
|
+
itemAccount: u.LineItems[p].AccountCode,
|
|
1048
|
+
itemTax: u.LineItems[p].TaxAmount,
|
|
1049
|
+
itemTaxType: u.LineItems[p].TaxType,
|
|
1050
|
+
itemLineAmount: u.LineItems[p].LineAmount,
|
|
1051
|
+
itemDiscount: u.LineItems[p].DiscountAmount
|
|
1052
|
+
}), c[p] && (m[f] = {
|
|
1053
|
+
...m[f],
|
|
1054
|
+
paymentAccount: c[p].Account.Code,
|
|
1055
|
+
paymentReference: c[p].Reference,
|
|
1056
|
+
paymentAmount: c[p].Amount
|
|
1053
1057
|
});
|
|
1054
1058
|
}
|
|
1055
|
-
return
|
|
1059
|
+
return m;
|
|
1056
1060
|
}, [])
|
|
1057
1061
|
), x = [
|
|
1058
1062
|
{
|
|
@@ -1137,8 +1141,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1137
1141
|
if (T.value._id)
|
|
1138
1142
|
try {
|
|
1139
1143
|
D.value = !0, a.value = await Le(T.value._id);
|
|
1140
|
-
} catch (
|
|
1141
|
-
F.open({ message:
|
|
1144
|
+
} catch (m) {
|
|
1145
|
+
F.open({ message: m.message, type: "error" });
|
|
1142
1146
|
} finally {
|
|
1143
1147
|
D.value = !1;
|
|
1144
1148
|
}
|
|
@@ -1150,19 +1154,19 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1150
1154
|
async function b() {
|
|
1151
1155
|
try {
|
|
1152
1156
|
T.value._id ? (D.value = !0, await ze(T.value._id), F.open({ message: "Upload successful", type: "success" })) : F.open({ message: "Invalid accounting setting", type: "error" });
|
|
1153
|
-
} catch (
|
|
1154
|
-
|
|
1157
|
+
} catch (m) {
|
|
1158
|
+
m.message && F.open({ message: m.message, type: "error" }), m.errors && m.errors.forEach((K) => F.open({ message: K.Message, type: "error" }));
|
|
1155
1159
|
} finally {
|
|
1156
1160
|
D.value = !1;
|
|
1157
1161
|
}
|
|
1158
1162
|
}
|
|
1159
|
-
return (
|
|
1163
|
+
return (m, K) => {
|
|
1160
1164
|
const $ = V("FmButton"), u = V("FmCircularProgress"), c = V("FmTable");
|
|
1161
1165
|
return _(), U("div", Co, [
|
|
1162
1166
|
t("div", $o, [
|
|
1163
1167
|
l(Be, {
|
|
1164
1168
|
"date-range": d(y),
|
|
1165
|
-
"onUpdate:dateRange": K[0] || (K[0] = (
|
|
1169
|
+
"onUpdate:dateRange": K[0] || (K[0] = (p) => Te(y) ? y.value = p : null),
|
|
1166
1170
|
compare: !1
|
|
1167
1171
|
}, null, 8, ["date-range"]),
|
|
1168
1172
|
l($, {
|
|
@@ -1220,7 +1224,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1220
1224
|
return null;
|
|
1221
1225
|
}
|
|
1222
1226
|
});
|
|
1223
|
-
async function
|
|
1227
|
+
async function m() {
|
|
1224
1228
|
if (e.value._id)
|
|
1225
1229
|
try {
|
|
1226
1230
|
const u = await it(e.value._id);
|
|
@@ -1268,15 +1272,15 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1268
1272
|
return [(u = e.value.platform) == null ? void 0 : u.accessToken, x.value.isLoaded];
|
|
1269
1273
|
},
|
|
1270
1274
|
(u) => {
|
|
1271
|
-
var c,
|
|
1272
|
-
u && (
|
|
1275
|
+
var c, p;
|
|
1276
|
+
u && (m(), (p = (c = e.value.platform) == null ? void 0 : c.tenant) != null && p.id && x.value.isLoaded && (K(), $()));
|
|
1273
1277
|
},
|
|
1274
1278
|
{ immediate: !0 }
|
|
1275
1279
|
), (u, c) => {
|
|
1276
1280
|
var v, h, r;
|
|
1277
|
-
const
|
|
1281
|
+
const p = V("FmPageHead"), f = V("FmTabs");
|
|
1278
1282
|
return _(), U("div", Do, [
|
|
1279
|
-
l(
|
|
1283
|
+
l(p, {
|
|
1280
1284
|
title: ((v = e.value) == null ? void 0 : v.name) || "Xero",
|
|
1281
1285
|
"back-button": !0,
|
|
1282
1286
|
style: { paddingLeft: "0px", paddingRight: "0px" },
|
|
@@ -1414,7 +1418,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1414
1418
|
class: "flex flex-col h-full"
|
|
1415
1419
|
}, Uo = { class: "flex flex-col gap-16 pb-[24px]" }, Ro = { class: "flex flex-row justify-between items-center gap-2" }, Po = { class: "fm-typo-en-title-sm-800" }, Mo = { class: "flex flex-row gap-2 items-center" }, jo = { class: "relative group cursor-pointer" }, Lo = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, Oo = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, Eo = { class: "w-[90%] flex flex-col gap-24" }, Bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yo = { class: "flex flex-col justify-between" }, qo = { class: "w-[25%] font-semibold" }, Ho = { class: "flex-grow" }, zo = { class: "flex flex-col justify-between" }, Qo = { class: "w-[25%] font-semibold" }, Go = { class: "flex-grow" }, Xo = { class: "flex flex-col gap-16" }, Wo = { class: "fm-typo-en-title-sm-800" }, Jo = { class: "flex flex-col max-w-[100%]" }, Zo = { class: "w-[25%] font-semibold" }, ea = { class: "flex-grow" }, ta = { class: "flex flex-col max-w-[100%]" }, oa = { class: "w-[25%] font-semibold" }, aa = { class: "flex flex-col max-w-[100%]" }, la = { class: "w-[25%] font-semibold" }, na = { class: "flex flex-col max-w-[100%]" }, sa = { class: "flex flex-col gap-16" }, ra = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, ia = { class: "flex flex-col gap-16 pt-3 pb-3" }, da = { class: "flex flex-row items-center gap-5" }, ma = { class: "fm-typo-en-title-sm-800" }, pa = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, ua = { class: "flex flex-row items-center justify-between gap-x-16" }, ca = { class: "fm-typo-en-title-sm-800" }, fa = { class: "flex flex-row items-center justify-between gap-x-16" }, ga = { class: "fm-typo-en-title-sm-800" }, va = { class: "flex flex-row items-center justify-between gap-x-16" }, ya = { class: "fm-typo-en-title-sm-800" }, xa = { class: "flex flex-row items-center justify-between gap-x-16" }, ba = { class: "fm-typo-en-title-sm-800" }, wa = /* @__PURE__ */ J({
|
|
1416
1420
|
__name: "Setting",
|
|
1417
|
-
props: /* @__PURE__ */
|
|
1421
|
+
props: /* @__PURE__ */ Ve({
|
|
1418
1422
|
errorLogs: {}
|
|
1419
1423
|
}, {
|
|
1420
1424
|
modelValue: { required: !0 },
|
|
@@ -1425,7 +1429,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1425
1429
|
const a = te(g, "modelValue"), e = _e(), i = Ae(), x = be(), { promptLoader: T } = Pe(), { promptMessage: D } = Oe(), { restaurants: F } = we(), y = q(
|
|
1426
1430
|
() => F.map((r) => ({ label: r.name, value: r.id }))
|
|
1427
1431
|
), { t: b } = oe();
|
|
1428
|
-
async function
|
|
1432
|
+
async function m() {
|
|
1429
1433
|
await D({
|
|
1430
1434
|
message: b("report.messages.confirmDelete", { name: a.value.name }),
|
|
1431
1435
|
title: b("report.common.delete")
|
|
@@ -1507,7 +1511,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1507
1511
|
label: b("report.integration.grouping.byDaySeparatePayment"),
|
|
1508
1512
|
value: ve.BY_DAY_SEPARATE_PAYMENT
|
|
1509
1513
|
}
|
|
1510
|
-
],
|
|
1514
|
+
], p = [
|
|
1511
1515
|
{
|
|
1512
1516
|
label: "NORMAL",
|
|
1513
1517
|
value: "NORMAL"
|
|
@@ -1564,7 +1568,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1564
1568
|
l(n, {
|
|
1565
1569
|
variant: "tertiary",
|
|
1566
1570
|
label: d(b)("report.common.delete"),
|
|
1567
|
-
onClick:
|
|
1571
|
+
onClick: m
|
|
1568
1572
|
}, null, 8, ["label"]),
|
|
1569
1573
|
l(n, {
|
|
1570
1574
|
variant: "primary",
|
|
@@ -1639,7 +1643,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1639
1643
|
modelValue: a.value.platform.mappings.myinvoisAction,
|
|
1640
1644
|
"onUpdate:modelValue": o[5] || (o[5] = (w) => a.value.platform.mappings.myinvoisAction = w),
|
|
1641
1645
|
multiselect: !1,
|
|
1642
|
-
items:
|
|
1646
|
+
items: p,
|
|
1643
1647
|
placeholder: "Select MyInvois Action",
|
|
1644
1648
|
class: "flex-grow"
|
|
1645
1649
|
}, null, 8, ["modelValue"])
|
|
@@ -1872,13 +1876,13 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1872
1876
|
if (!$) return $;
|
|
1873
1877
|
const u = new Date(K.date);
|
|
1874
1878
|
if (isNaN(u.getTime())) return $;
|
|
1875
|
-
const c = String(u.getFullYear()),
|
|
1879
|
+
const c = String(u.getFullYear()), p = String(u.getMonth() + 1).padStart(2, "0"), f = String(u.getDate()).padStart(2, "0");
|
|
1876
1880
|
return $.replace(/\[(YYYY|MM|DD)\]/g, (v, h) => {
|
|
1877
1881
|
switch (h) {
|
|
1878
1882
|
case "YYYY":
|
|
1879
1883
|
return c;
|
|
1880
1884
|
case "MM":
|
|
1881
|
-
return
|
|
1885
|
+
return p;
|
|
1882
1886
|
case "DD":
|
|
1883
1887
|
return f;
|
|
1884
1888
|
default:
|
|
@@ -1888,7 +1892,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1888
1892
|
}
|
|
1889
1893
|
const i = q(
|
|
1890
1894
|
() => a.value.reduce((K, $) => {
|
|
1891
|
-
const u = K.length, { invoice: c, payments:
|
|
1895
|
+
const u = K.length, { invoice: c, payments: p } = $;
|
|
1892
1896
|
K[u] = {
|
|
1893
1897
|
no: e(c),
|
|
1894
1898
|
date: c.date,
|
|
@@ -1896,7 +1900,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1896
1900
|
status: c.status,
|
|
1897
1901
|
title: c.title
|
|
1898
1902
|
};
|
|
1899
|
-
for (let f = 0; f < Math.max(c.form_items.length,
|
|
1903
|
+
for (let f = 0; f < Math.max(c.form_items.length, p.length); f++) {
|
|
1900
1904
|
const v = u + f;
|
|
1901
1905
|
K[v] || (K[v] = {});
|
|
1902
1906
|
const h = c.form_items[f];
|
|
@@ -1909,7 +1913,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
1909
1913
|
itemTaxCode: h._tax_code_name,
|
|
1910
1914
|
itemDiscount: h.discount
|
|
1911
1915
|
});
|
|
1912
|
-
const r =
|
|
1916
|
+
const r = p[f];
|
|
1913
1917
|
r && (K[v] = {
|
|
1914
1918
|
...K[v],
|
|
1915
1919
|
paymentNo: r.number,
|
|
@@ -2023,7 +2027,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2023
2027
|
immediate: !0
|
|
2024
2028
|
}
|
|
2025
2029
|
);
|
|
2026
|
-
async function
|
|
2030
|
+
async function m() {
|
|
2027
2031
|
try {
|
|
2028
2032
|
D.value._id ? (F.value = !0, await ze(D.value._id), y.open({ message: x("report.integration.uploadSuccess"), type: "success" })) : y.open({ message: x("report.integration.error.invalid"), type: "error" });
|
|
2029
2033
|
} catch (K) {
|
|
@@ -2033,7 +2037,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2033
2037
|
}
|
|
2034
2038
|
}
|
|
2035
2039
|
return (K, $) => {
|
|
2036
|
-
const u = V("FmButton"), c = V("FmCircularProgress"),
|
|
2040
|
+
const u = V("FmButton"), c = V("FmCircularProgress"), p = V("FmTable");
|
|
2037
2041
|
return _(), U("div", _a, [
|
|
2038
2042
|
t("div", ha, [
|
|
2039
2043
|
l(Be, {
|
|
@@ -2045,13 +2049,13 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2045
2049
|
loading: F.value,
|
|
2046
2050
|
variant: "primary",
|
|
2047
2051
|
label: d(x)("report.common.upload"),
|
|
2048
|
-
onClick:
|
|
2052
|
+
onClick: m
|
|
2049
2053
|
}, null, 8, ["loading", "label"])
|
|
2050
2054
|
]),
|
|
2051
2055
|
F.value ? (_(), U("div", ka, [
|
|
2052
2056
|
l(c, { size: "xl" }),
|
|
2053
2057
|
t("span", Ca, C(d(x)("report.integration.table.loading")), 1)
|
|
2054
|
-
])) : i.value.length > 0 ? (_(), j(
|
|
2058
|
+
])) : i.value.length > 0 ? (_(), j(p, {
|
|
2055
2059
|
key: 1,
|
|
2056
2060
|
class: "flex overflow-y-auto p-5 border border-fm-color-border-secondary rounded-lg h-auto",
|
|
2057
2061
|
"row-data": i.value,
|
|
@@ -2091,7 +2095,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2091
2095
|
});
|
|
2092
2096
|
return (F, y) => {
|
|
2093
2097
|
var K;
|
|
2094
|
-
const b = V("FmPageHead"),
|
|
2098
|
+
const b = V("FmPageHead"), m = V("FmTabs");
|
|
2095
2099
|
return _(), U("div", Sa, [
|
|
2096
2100
|
l(b, {
|
|
2097
2101
|
title: ((K = e.value) == null ? void 0 : K.name) || "Bukku",
|
|
@@ -2104,7 +2108,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2104
2108
|
])),
|
|
2105
2109
|
_: 1
|
|
2106
2110
|
}, 8, ["title"]),
|
|
2107
|
-
l(
|
|
2111
|
+
l(m, {
|
|
2108
2112
|
"model-value": i.value,
|
|
2109
2113
|
"onUpdate:modelValue": y[1] || (y[1] = ($) => i.value = $),
|
|
2110
2114
|
items: x
|
|
@@ -2123,7 +2127,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2123
2127
|
class: "flex flex-col h-full"
|
|
2124
2128
|
}, Ka = { class: "flex flex-col gap-16 pb-[24px]" }, Ta = { class: "flex flex-row justify-between items-center gap-2" }, Fa = { class: "flex flex-row gap-2 items-center" }, Na = { class: "relative group cursor-pointer" }, Ia = { class: "absolute left-1/2 -translate-x-2/3 top-full mt-2 w-max bg-gray-900 text-white text-sm px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity" }, Ua = { class: "flex flex-col gap-24 pt-[24px] overflow-scroll" }, Ra = { class: "w-[90%] flex flex-col gap-24" }, Pa = { class: "flex flex-col gap-16" }, Ma = { class: "fm-typo-en-title-sm-800" }, ja = { class: "flex flex-col max-w-[100%]" }, La = { class: "w-[25%] font-semibold" }, Oa = { class: "flex-grow" }, Ea = { class: "flex flex-col max-w-[100%]" }, Ba = { class: "w-[25%] font-semibold" }, Ya = { class: "flex flex-col max-w-[100%]" }, qa = { class: "w-[25%] font-semibold" }, Ha = { class: "flex flex-col gap-16" }, za = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Qa = { class: "flex flex-col gap-16 pt-3 pb-3" }, Ga = { class: "flex flex-row items-center gap-5" }, Xa = { class: "fm-typo-en-title-sm-800" }, Wa = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Ja = { class: "flex flex-row items-center justify-between gap-x-16" }, Za = { class: "fm-typo-en-title-sm-800" }, el = { class: "flex flex-row items-center justify-between gap-x-16" }, tl = { class: "fm-typo-en-title-sm-800" }, ol = { class: "flex flex-row items-center justify-between gap-x-16" }, al = { class: "fm-typo-en-title-sm-800" }, ll = { class: "flex flex-row items-center justify-between gap-x-16" }, nl = { class: "fm-typo-en-title-sm-800" }, sl = /* @__PURE__ */ J({
|
|
2125
2129
|
__name: "Setting",
|
|
2126
|
-
props: /* @__PURE__ */
|
|
2130
|
+
props: /* @__PURE__ */ Ve({
|
|
2127
2131
|
errorLogs: {}
|
|
2128
2132
|
}, {
|
|
2129
2133
|
modelValue: { required: !0 },
|
|
@@ -2134,7 +2138,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2134
2138
|
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = q(
|
|
2135
2139
|
() => y.map((h) => ({ label: h.name, value: h.id }))
|
|
2136
2140
|
);
|
|
2137
|
-
async function
|
|
2141
|
+
async function m() {
|
|
2138
2142
|
await F({
|
|
2139
2143
|
message: a("report.messages.confirmDelete", { name: e.value.name }),
|
|
2140
2144
|
title: a("report.common.delete")
|
|
@@ -2194,7 +2198,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2194
2198
|
value: ve.BY_DAY_CATEGORY
|
|
2195
2199
|
}
|
|
2196
2200
|
];
|
|
2197
|
-
function
|
|
2201
|
+
function p({
|
|
2198
2202
|
key: h,
|
|
2199
2203
|
value: r
|
|
2200
2204
|
}) {
|
|
@@ -2237,7 +2241,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2237
2241
|
l(s, {
|
|
2238
2242
|
variant: "tertiary",
|
|
2239
2243
|
label: d(a)("report.common.remove"),
|
|
2240
|
-
onClick:
|
|
2244
|
+
onClick: m
|
|
2241
2245
|
}, null, 8, ["label"]),
|
|
2242
2246
|
l(s, {
|
|
2243
2247
|
variant: "primary",
|
|
@@ -2291,12 +2295,12 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2291
2295
|
l(B, {
|
|
2292
2296
|
"model-value": { key: "Project", account: e.value.platform.mappings.project },
|
|
2293
2297
|
options: f("Project"),
|
|
2294
|
-
"onUpdate:modelValue": r[3] || (r[3] = (I) =>
|
|
2298
|
+
"onUpdate:modelValue": r[3] || (r[3] = (I) => p({ key: "project", value: I.account }))
|
|
2295
2299
|
}, null, 8, ["model-value", "options"]),
|
|
2296
2300
|
l(B, {
|
|
2297
2301
|
"model-value": { key: "Debtor", account: e.value.platform.mappings.debtor },
|
|
2298
2302
|
options: f("Debtor"),
|
|
2299
|
-
"onUpdate:modelValue": r[4] || (r[4] = (I) =>
|
|
2303
|
+
"onUpdate:modelValue": r[4] || (r[4] = (I) => p({ key: "debtor", value: I.account }))
|
|
2300
2304
|
}, null, 8, ["model-value", "options"]),
|
|
2301
2305
|
l(B, {
|
|
2302
2306
|
"model-value": {
|
|
@@ -2333,7 +2337,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2333
2337
|
account: e.value.platform.mappings.invoiceDocNo
|
|
2334
2338
|
},
|
|
2335
2339
|
options: f("Invoice no"),
|
|
2336
|
-
"onUpdate:modelValue": r[6] || (r[6] = (I) =>
|
|
2340
|
+
"onUpdate:modelValue": r[6] || (r[6] = (I) => p({ key: "invoiceDocNo", value: I.account }))
|
|
2337
2341
|
}, null, 8, ["model-value", "options"]),
|
|
2338
2342
|
l(B, {
|
|
2339
2343
|
"model-value": {
|
|
@@ -2341,7 +2345,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2341
2345
|
account: e.value.platform.mappings.creditNoteDocNo
|
|
2342
2346
|
},
|
|
2343
2347
|
options: f("Credit note no"),
|
|
2344
|
-
"onUpdate:modelValue": r[7] || (r[7] = (I) =>
|
|
2348
|
+
"onUpdate:modelValue": r[7] || (r[7] = (I) => p({ key: "creditNoteDocNo", value: I.account }))
|
|
2345
2349
|
}, null, 8, ["model-value", "options"]),
|
|
2346
2350
|
l(B, {
|
|
2347
2351
|
"model-value": {
|
|
@@ -2349,7 +2353,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2349
2353
|
account: e.value.platform.mappings.paymentDocNo
|
|
2350
2354
|
},
|
|
2351
2355
|
options: f("Payment no"),
|
|
2352
|
-
"onUpdate:modelValue": r[8] || (r[8] = (I) =>
|
|
2356
|
+
"onUpdate:modelValue": r[8] || (r[8] = (I) => p({ key: "paymentDocNo", value: I.account }))
|
|
2353
2357
|
}, null, 8, ["model-value", "options"]),
|
|
2354
2358
|
l(B, {
|
|
2355
2359
|
"model-value": {
|
|
@@ -2357,7 +2361,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2357
2361
|
account: e.value.platform.mappings.refundDocNo
|
|
2358
2362
|
},
|
|
2359
2363
|
options: f("Refund no"),
|
|
2360
|
-
"onUpdate:modelValue": r[9] || (r[9] = (I) =>
|
|
2364
|
+
"onUpdate:modelValue": r[9] || (r[9] = (I) => p({ key: "refundDocNo", value: I.account }))
|
|
2361
2365
|
}, null, 8, ["model-value", "options"])
|
|
2362
2366
|
])
|
|
2363
2367
|
]),
|
|
@@ -2490,33 +2494,33 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2490
2494
|
emits: ["update:modelValue"],
|
|
2491
2495
|
setup(g) {
|
|
2492
2496
|
const { t: a } = oe(), e = z([]), i = q(
|
|
2493
|
-
() => e.value.reduce((
|
|
2494
|
-
const $ =
|
|
2495
|
-
|
|
2497
|
+
() => e.value.reduce((m, K) => {
|
|
2498
|
+
const $ = m.length, { invoice: u, payments: c } = K;
|
|
2499
|
+
m[$] = {
|
|
2496
2500
|
date: u.DocDate,
|
|
2497
2501
|
docNo: u.DocNo,
|
|
2498
2502
|
projNo: u.ProjNo,
|
|
2499
2503
|
debtor: u.DebtorCode,
|
|
2500
2504
|
description: u.Description
|
|
2501
2505
|
};
|
|
2502
|
-
for (let
|
|
2503
|
-
const f = $ +
|
|
2504
|
-
|
|
2505
|
-
...
|
|
2506
|
-
itemDescription: u._items[
|
|
2507
|
-
itemUnitPrice: u._items[
|
|
2508
|
-
itemAccount: u._items[
|
|
2509
|
-
itemTaxCode: u._items[
|
|
2510
|
-
itemTax: u._items[
|
|
2511
|
-
}), c[
|
|
2512
|
-
...
|
|
2513
|
-
paymentDocNo: c[
|
|
2514
|
-
paymentMethod: c[
|
|
2515
|
-
paymentDescription: c[
|
|
2516
|
-
paymentAmount: c[
|
|
2506
|
+
for (let p = 0; p < Math.max(u._items.length, c.length); p++) {
|
|
2507
|
+
const f = $ + p;
|
|
2508
|
+
m[f] || (m[f] = {}), u._items[p] && (m[f] = {
|
|
2509
|
+
...m[f],
|
|
2510
|
+
itemDescription: u._items[p].DetailDescription,
|
|
2511
|
+
itemUnitPrice: u._items[p].Amount,
|
|
2512
|
+
itemAccount: u._items[p].AccNo,
|
|
2513
|
+
itemTaxCode: u._items[p].TaxType,
|
|
2514
|
+
itemTax: u._items[p].Tax
|
|
2515
|
+
}), c[p] && (m[f] = {
|
|
2516
|
+
...m[f],
|
|
2517
|
+
paymentDocNo: c[p].DocNo,
|
|
2518
|
+
paymentMethod: c[p].paymentMethod,
|
|
2519
|
+
paymentDescription: c[p].Description,
|
|
2520
|
+
paymentAmount: c[p].PaymentAmt
|
|
2517
2521
|
});
|
|
2518
2522
|
}
|
|
2519
|
-
return
|
|
2523
|
+
return m;
|
|
2520
2524
|
}, [])
|
|
2521
2525
|
), x = [
|
|
2522
2526
|
{
|
|
@@ -2596,8 +2600,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2596
2600
|
if (T.value._id)
|
|
2597
2601
|
try {
|
|
2598
2602
|
D.value = !0, e.value = await Le(T.value._id);
|
|
2599
|
-
} catch (
|
|
2600
|
-
F.open({ message:
|
|
2603
|
+
} catch (m) {
|
|
2604
|
+
F.open({ message: m.message, type: "error" });
|
|
2601
2605
|
} finally {
|
|
2602
2606
|
D.value = !1;
|
|
2603
2607
|
}
|
|
@@ -2609,19 +2613,19 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2609
2613
|
async function b() {
|
|
2610
2614
|
try {
|
|
2611
2615
|
T.value._id ? (D.value = !0, await qe(T.value._id)) : F.open({ message: "Invalid accounting setting", type: "error" });
|
|
2612
|
-
} catch (
|
|
2613
|
-
F.open({ message:
|
|
2616
|
+
} catch (m) {
|
|
2617
|
+
F.open({ message: m.message, type: "error" });
|
|
2614
2618
|
} finally {
|
|
2615
2619
|
D.value = !1;
|
|
2616
2620
|
}
|
|
2617
2621
|
}
|
|
2618
|
-
return (
|
|
2622
|
+
return (m, K) => {
|
|
2619
2623
|
const $ = V("FmButton"), u = V("FmCircularProgress"), c = V("FmTable");
|
|
2620
2624
|
return _(), U("div", rl, [
|
|
2621
2625
|
t("div", il, [
|
|
2622
2626
|
l(Be, {
|
|
2623
2627
|
"date-range": d(y),
|
|
2624
|
-
"onUpdate:dateRange": K[0] || (K[0] = (
|
|
2628
|
+
"onUpdate:dateRange": K[0] || (K[0] = (p) => Te(y) ? y.value = p : null),
|
|
2625
2629
|
compare: !1
|
|
2626
2630
|
}, null, 8, ["date-range"]),
|
|
2627
2631
|
l($, {
|
|
@@ -2674,7 +2678,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2674
2678
|
});
|
|
2675
2679
|
return (F, y) => {
|
|
2676
2680
|
var K;
|
|
2677
|
-
const b = V("FmPageHead"),
|
|
2681
|
+
const b = V("FmPageHead"), m = V("FmTabs");
|
|
2678
2682
|
return _(), U("div", ul, [
|
|
2679
2683
|
l(b, {
|
|
2680
2684
|
title: ((K = e.value) == null ? void 0 : K.name) || "AutoCount",
|
|
@@ -2687,7 +2691,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2687
2691
|
])),
|
|
2688
2692
|
_: 1
|
|
2689
2693
|
}, 8, ["title"]),
|
|
2690
|
-
l(
|
|
2694
|
+
l(m, {
|
|
2691
2695
|
"model-value": i.value,
|
|
2692
2696
|
"onUpdate:modelValue": y[1] || (y[1] = ($) => i.value = $),
|
|
2693
2697
|
items: x
|
|
@@ -2715,7 +2719,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2715
2719
|
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = q(
|
|
2716
2720
|
() => y.map((r) => ({ label: r.name, value: r.id }))
|
|
2717
2721
|
);
|
|
2718
|
-
async function
|
|
2722
|
+
async function m() {
|
|
2719
2723
|
await F({
|
|
2720
2724
|
message: a("report.messages.confirmDelete", { name: e.value.name }),
|
|
2721
2725
|
title: a("report.common.delete")
|
|
@@ -2769,7 +2773,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2769
2773
|
var s, n;
|
|
2770
2774
|
(n = (s = e.value) == null ? void 0 : s.platform) != null && n.mappings && (e.value.platform.mappings[r] = o);
|
|
2771
2775
|
}
|
|
2772
|
-
function
|
|
2776
|
+
function p(r) {
|
|
2773
2777
|
return {
|
|
2774
2778
|
key: { placeholder: r, editable: !1 },
|
|
2775
2779
|
account: { placeholder: r, editable: !0 }
|
|
@@ -2830,7 +2834,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2830
2834
|
l(n, {
|
|
2831
2835
|
variant: "tertiary",
|
|
2832
2836
|
label: d(a)("report.common.delete"),
|
|
2833
|
-
onClick:
|
|
2837
|
+
onClick: m
|
|
2834
2838
|
}, null, 8, ["label"]),
|
|
2835
2839
|
l(n, {
|
|
2836
2840
|
variant: "primary",
|
|
@@ -2883,7 +2887,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2883
2887
|
t("div", Nl, [
|
|
2884
2888
|
l(B, {
|
|
2885
2889
|
"model-value": { key: "Debtor", account: e.value.platform.mappings.debtor },
|
|
2886
|
-
options:
|
|
2890
|
+
options: p("Debtor"),
|
|
2887
2891
|
"onUpdate:modelValue": o[3] || (o[3] = (O) => c({ key: "debtor", value: O.account }))
|
|
2888
2892
|
}, null, 8, ["model-value", "options"]),
|
|
2889
2893
|
l(B, {
|
|
@@ -2891,7 +2895,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2891
2895
|
key: "Project header",
|
|
2892
2896
|
account: e.value.platform.mappings.projectHeader
|
|
2893
2897
|
},
|
|
2894
|
-
options:
|
|
2898
|
+
options: p("Project header"),
|
|
2895
2899
|
"onUpdate:modelValue": o[4] || (o[4] = (O) => c({ key: "projectHeader", value: O.account }))
|
|
2896
2900
|
}, null, 8, ["model-value", "options"]),
|
|
2897
2901
|
l(B, {
|
|
@@ -2899,7 +2903,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2899
2903
|
key: "Project detail",
|
|
2900
2904
|
account: e.value.platform.mappings.projectDetail
|
|
2901
2905
|
},
|
|
2902
|
-
options:
|
|
2906
|
+
options: p("Project detail"),
|
|
2903
2907
|
"onUpdate:modelValue": o[5] || (o[5] = (O) => c({ key: "projectDetail", value: O.account }))
|
|
2904
2908
|
}, null, 8, ["model-value", "options"]),
|
|
2905
2909
|
l(B, {
|
|
@@ -2907,7 +2911,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2907
2911
|
key: "Custom attribute tag",
|
|
2908
2912
|
account: e.value.platform.mappings.customAttribute
|
|
2909
2913
|
},
|
|
2910
|
-
options:
|
|
2914
|
+
options: p("Custom attribute tag"),
|
|
2911
2915
|
"onUpdate:modelValue": o[6] || (o[6] = (O) => c({ key: "customAttribute", value: O.account }))
|
|
2912
2916
|
}, null, 8, ["model-value", "options"])
|
|
2913
2917
|
]),
|
|
@@ -2952,7 +2956,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2952
2956
|
key: "Invoice no",
|
|
2953
2957
|
account: e.value.platform.mappings.invoiceDocNo
|
|
2954
2958
|
},
|
|
2955
|
-
options:
|
|
2959
|
+
options: p("Invoice no"),
|
|
2956
2960
|
"onUpdate:modelValue": o[8] || (o[8] = (O) => c({ key: "invoiceDocNo", value: O.account }))
|
|
2957
2961
|
}, null, 8, ["model-value", "options"]),
|
|
2958
2962
|
l(B, {
|
|
@@ -2960,7 +2964,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2960
2964
|
key: "Credit note no",
|
|
2961
2965
|
account: e.value.platform.mappings.creditNoteDocNo
|
|
2962
2966
|
},
|
|
2963
|
-
options:
|
|
2967
|
+
options: p("Credit note no"),
|
|
2964
2968
|
"onUpdate:modelValue": o[9] || (o[9] = (O) => c({ key: "creditNoteDocNo", value: O.account }))
|
|
2965
2969
|
}, null, 8, ["model-value", "options"]),
|
|
2966
2970
|
l(B, {
|
|
@@ -2968,7 +2972,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2968
2972
|
key: "Payment no",
|
|
2969
2973
|
account: e.value.platform.mappings.paymentDocNo
|
|
2970
2974
|
},
|
|
2971
|
-
options:
|
|
2975
|
+
options: p("Payment no"),
|
|
2972
2976
|
"onUpdate:modelValue": o[10] || (o[10] = (O) => c({ key: "paymentDocNo", value: O.account }))
|
|
2973
2977
|
}, null, 8, ["model-value", "options"]),
|
|
2974
2978
|
l(B, {
|
|
@@ -2976,7 +2980,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
2976
2980
|
key: "Refund no",
|
|
2977
2981
|
account: e.value.platform.mappings.refundDocNo
|
|
2978
2982
|
},
|
|
2979
|
-
options:
|
|
2983
|
+
options: p("Refund no"),
|
|
2980
2984
|
"onUpdate:modelValue": o[11] || (o[11] = (O) => c({ key: "refundDocNo", value: O.account }))
|
|
2981
2985
|
}, null, 8, ["model-value", "options"])
|
|
2982
2986
|
])
|
|
@@ -3185,9 +3189,9 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3185
3189
|
invoices: [],
|
|
3186
3190
|
deliveryOrders: []
|
|
3187
3191
|
}), i = q(
|
|
3188
|
-
() => e.value.invoices.reduce((
|
|
3189
|
-
const v =
|
|
3190
|
-
|
|
3192
|
+
() => e.value.invoices.reduce((p, f) => {
|
|
3193
|
+
const v = p.length, { invoice: h, payments: r } = f;
|
|
3194
|
+
p[v] = {
|
|
3191
3195
|
date: h.DocDate,
|
|
3192
3196
|
docNo: h.DocNo,
|
|
3193
3197
|
debtor: h.Code,
|
|
@@ -3195,15 +3199,15 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3195
3199
|
};
|
|
3196
3200
|
for (let o = 0; o < Math.max(h._items.length, r.length); o++) {
|
|
3197
3201
|
const s = v + o;
|
|
3198
|
-
|
|
3199
|
-
...
|
|
3202
|
+
p[s] || (p[s] = {}), h._items[o] && (p[s] = {
|
|
3203
|
+
...p[s],
|
|
3200
3204
|
itemDescription: h._items[o].Description_DTL,
|
|
3201
3205
|
itemUnitPrice: h._items[o].UnitPrice,
|
|
3202
3206
|
itemAccount: h._items[o].ACCOUNT,
|
|
3203
3207
|
itemTaxCode: h._items[o].Tax,
|
|
3204
3208
|
itemTax: h._items[o].TaxAmt
|
|
3205
|
-
}), r[o] && (
|
|
3206
|
-
...
|
|
3209
|
+
}), r[o] && (p[s] = {
|
|
3210
|
+
...p[s],
|
|
3207
3211
|
paymentDocNo: r[o].DOCNO_Header,
|
|
3208
3212
|
paymentMethod: r[o].PAYMENTMETHOD,
|
|
3209
3213
|
paymentAccount: r[o].CODE,
|
|
@@ -3211,7 +3215,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3211
3215
|
paymentAmount: r[o].KOAMT
|
|
3212
3216
|
});
|
|
3213
3217
|
}
|
|
3214
|
-
return
|
|
3218
|
+
return p;
|
|
3215
3219
|
}, [])
|
|
3216
3220
|
), x = [
|
|
3217
3221
|
{
|
|
@@ -3280,9 +3284,9 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3280
3284
|
enableSorting: !1
|
|
3281
3285
|
}
|
|
3282
3286
|
], T = q(
|
|
3283
|
-
() => e.value.deliveryOrders.reduce((
|
|
3284
|
-
const v =
|
|
3285
|
-
|
|
3287
|
+
() => e.value.deliveryOrders.reduce((p, f) => {
|
|
3288
|
+
const v = p.length, { _items: h } = f;
|
|
3289
|
+
p[v] = {
|
|
3286
3290
|
date: f.DocDate,
|
|
3287
3291
|
docNo: f.DocNo,
|
|
3288
3292
|
supplierCode: f.Code,
|
|
@@ -3290,8 +3294,8 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3290
3294
|
};
|
|
3291
3295
|
for (let r = 0; r < h.length; r++) {
|
|
3292
3296
|
const o = v + r;
|
|
3293
|
-
|
|
3294
|
-
...
|
|
3297
|
+
p[o] || (p[o] = {}), h[r] && (p[o] = {
|
|
3298
|
+
...p[o],
|
|
3295
3299
|
accountCode: h[r].ACCOUNT,
|
|
3296
3300
|
itemCode: h[r].ItemCode,
|
|
3297
3301
|
itemDescription: h[r].Description_DTL,
|
|
@@ -3303,7 +3307,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3303
3307
|
// itemTax: _items[i].TaxAmt
|
|
3304
3308
|
});
|
|
3305
3309
|
}
|
|
3306
|
-
return
|
|
3310
|
+
return p;
|
|
3307
3311
|
}, [])
|
|
3308
3312
|
), D = [
|
|
3309
3313
|
{
|
|
@@ -3361,15 +3365,15 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3361
3365
|
header: "Item Amount",
|
|
3362
3366
|
enableSorting: !1
|
|
3363
3367
|
}
|
|
3364
|
-
], F = te(g, "modelValue"), y = z(!1), b = _e(), { dateRange:
|
|
3368
|
+
], F = te(g, "modelValue"), y = z(!1), b = _e(), { dateRange: m } = Ee(we());
|
|
3365
3369
|
Ce(
|
|
3366
|
-
() =>
|
|
3370
|
+
() => m.value,
|
|
3367
3371
|
async () => {
|
|
3368
3372
|
if (F.value._id)
|
|
3369
3373
|
try {
|
|
3370
3374
|
y.value = !0, e.value = await Le(F.value._id);
|
|
3371
|
-
} catch (
|
|
3372
|
-
b.open({ message:
|
|
3375
|
+
} catch (p) {
|
|
3376
|
+
b.open({ message: p.message, type: "error" });
|
|
3373
3377
|
} finally {
|
|
3374
3378
|
y.value = !1;
|
|
3375
3379
|
}
|
|
@@ -3385,15 +3389,15 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3385
3389
|
return;
|
|
3386
3390
|
}
|
|
3387
3391
|
y.value = !0, await qe(F.value._id, [c.value]);
|
|
3388
|
-
} catch (
|
|
3389
|
-
b.open({ message:
|
|
3392
|
+
} catch (p) {
|
|
3393
|
+
b.open({ message: p.message, type: "error" });
|
|
3390
3394
|
} finally {
|
|
3391
3395
|
y.value = !1;
|
|
3392
3396
|
}
|
|
3393
3397
|
}
|
|
3394
3398
|
const $ = q(() => {
|
|
3395
|
-
const { flags:
|
|
3396
|
-
return
|
|
3399
|
+
const { flags: p } = Ze();
|
|
3400
|
+
return p.some(
|
|
3397
3401
|
(f) => f.key === "report_portal_integration_custom_sql" && f.value === !0
|
|
3398
3402
|
);
|
|
3399
3403
|
}), u = [
|
|
@@ -3410,13 +3414,13 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3410
3414
|
}
|
|
3411
3415
|
] : []
|
|
3412
3416
|
], c = z(u[0].value);
|
|
3413
|
-
return (
|
|
3417
|
+
return (p, f) => {
|
|
3414
3418
|
const v = V("FmButton"), h = V("FmCircularProgress"), r = V("FmTabs"), o = V("FmTable");
|
|
3415
3419
|
return _(), U("div", Xl, [
|
|
3416
3420
|
t("div", Wl, [
|
|
3417
3421
|
l(Be, {
|
|
3418
|
-
"date-range": d(
|
|
3419
|
-
"onUpdate:dateRange": f[0] || (f[0] = (s) => Te(
|
|
3422
|
+
"date-range": d(m),
|
|
3423
|
+
"onUpdate:dateRange": f[0] || (f[0] = (s) => Te(m) ? m.value = s : null),
|
|
3420
3424
|
compare: !1
|
|
3421
3425
|
}, null, 8, ["date-range"]),
|
|
3422
3426
|
l(v, {
|
|
@@ -3482,7 +3486,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3482
3486
|
});
|
|
3483
3487
|
return (F, y) => {
|
|
3484
3488
|
var K;
|
|
3485
|
-
const b = V("FmPageHead"),
|
|
3489
|
+
const b = V("FmPageHead"), m = V("FmTabs");
|
|
3486
3490
|
return _(), U("div", on, [
|
|
3487
3491
|
l(b, {
|
|
3488
3492
|
title: ((K = e.value) == null ? void 0 : K.name) || "SQL",
|
|
@@ -3495,7 +3499,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3495
3499
|
])),
|
|
3496
3500
|
_: 1
|
|
3497
3501
|
}, 8, ["title"]),
|
|
3498
|
-
l(
|
|
3502
|
+
l(m, {
|
|
3499
3503
|
"model-value": i.value,
|
|
3500
3504
|
"onUpdate:modelValue": y[1] || (y[1] = ($) => i.value = $),
|
|
3501
3505
|
items: x
|
|
@@ -3526,7 +3530,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3526
3530
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
3527
3531
|
}, as = /* @__PURE__ */ J({
|
|
3528
3532
|
__name: "Setting",
|
|
3529
|
-
props: /* @__PURE__ */
|
|
3533
|
+
props: /* @__PURE__ */ Ve({
|
|
3530
3534
|
retrievedMethods: {
|
|
3531
3535
|
type: Object,
|
|
3532
3536
|
required: !0
|
|
@@ -3548,7 +3552,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3548
3552
|
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = q(
|
|
3549
3553
|
() => y.map((r) => ({ label: r.name, value: r.id }))
|
|
3550
3554
|
);
|
|
3551
|
-
function
|
|
3555
|
+
function m(r) {
|
|
3552
3556
|
var o;
|
|
3553
3557
|
!((o = g.retrievedMethods) != null && o.data) || !Array.isArray(g.retrievedMethods.data) || r.forEach((s) => {
|
|
3554
3558
|
const n = g.retrievedMethods.data.find((A) => A.value == s.id);
|
|
@@ -3571,7 +3575,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3571
3575
|
await D(async () => {
|
|
3572
3576
|
var r, o, s;
|
|
3573
3577
|
try {
|
|
3574
|
-
(s = (o = (r = e.value) == null ? void 0 : r.platform) == null ? void 0 : o.mappings) != null && s.paymentMethods &&
|
|
3578
|
+
(s = (o = (r = e.value) == null ? void 0 : r.platform) == null ? void 0 : o.mappings) != null && s.paymentMethods && m(e.value.platform.mappings.paymentMethods), await je(e.value._id, e.value), await x.getSettings();
|
|
3575
3579
|
} catch (n) {
|
|
3576
3580
|
i.open({ type: "error", message: n.message });
|
|
3577
3581
|
}
|
|
@@ -3605,7 +3609,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3605
3609
|
}
|
|
3606
3610
|
]);
|
|
3607
3611
|
}
|
|
3608
|
-
const
|
|
3612
|
+
const p = [
|
|
3609
3613
|
{
|
|
3610
3614
|
label: "By day",
|
|
3611
3615
|
value: ve.BY_DAY
|
|
@@ -3778,7 +3782,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
3778
3782
|
modelValue: e.value.platform.grouping,
|
|
3779
3783
|
"onUpdate:modelValue": o[5] || (o[5] = (w) => e.value.platform.grouping = w),
|
|
3780
3784
|
multiselect: !1,
|
|
3781
|
-
items:
|
|
3785
|
+
items: p,
|
|
3782
3786
|
placeholder: d(a)("report.integration.grouping.title"),
|
|
3783
3787
|
class: "flex-grow",
|
|
3784
3788
|
disabled: ""
|
|
@@ -4014,7 +4018,7 @@ const vt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-betwe
|
|
|
4014
4018
|
});
|
|
4015
4019
|
function ls(g) {
|
|
4016
4020
|
return g.reduce((a, e) => {
|
|
4017
|
-
var T, D, F, y, b,
|
|
4021
|
+
var T, D, F, y, b, m, K, $, u, c, p, f, v, h, r, o, s, n, A, N, M, Y;
|
|
4018
4022
|
const { invoice: i } = e, x = a.length;
|
|
4019
4023
|
a[x] = {
|
|
4020
4024
|
invoice_date: i.invoice_date,
|
|
@@ -4028,11 +4032,11 @@ function ls(g) {
|
|
|
4028
4032
|
item_price: (F = i.items[0]) == null ? void 0 : F.price,
|
|
4029
4033
|
item_tax: (y = i.items[0]) == null ? void 0 : y.total_tax,
|
|
4030
4034
|
item_tax_label: ((b = i.items[0]) == null ? void 0 : b.tax_label) || "-",
|
|
4031
|
-
payment_amount: ((K = (
|
|
4035
|
+
payment_amount: ((K = (m = i.transactions) == null ? void 0 : m[0]) == null ? void 0 : K.amount) || void 0,
|
|
4032
4036
|
payment_method: ((u = ($ = i.transactions) == null ? void 0 : $[0]) == null ? void 0 : u.payment_method) || "-",
|
|
4033
4037
|
payment_term: ((c = i == null ? void 0 : i.payment_term) == null ? void 0 : c.name) || ""
|
|
4034
4038
|
};
|
|
4035
|
-
for (let E = 1; E < Math.max(((
|
|
4039
|
+
for (let E = 1; E < Math.max(((p = i.items) == null ? void 0 : p.length) || 0, ((f = i.transactions) == null ? void 0 : f.length) || 0); E++) {
|
|
4036
4040
|
const G = x + E;
|
|
4037
4041
|
a[G] || (a[G] = {});
|
|
4038
4042
|
const W = i.items[E];
|
|
@@ -4129,7 +4133,7 @@ const ns = [
|
|
|
4129
4133
|
];
|
|
4130
4134
|
function ss(g) {
|
|
4131
4135
|
return g.reduce((a, e) => {
|
|
4132
|
-
var F, y, b,
|
|
4136
|
+
var F, y, b, m, K, $, u, c, p, f, v, h, r, o;
|
|
4133
4137
|
const { invoice: i, payments: x } = e, T = a.length;
|
|
4134
4138
|
a[T] = {
|
|
4135
4139
|
invoice_date: i.invoice_date,
|
|
@@ -4137,13 +4141,13 @@ function ss(g) {
|
|
|
4137
4141
|
total: i.total,
|
|
4138
4142
|
item_code: (y = i.items[0]) == null ? void 0 : y.code,
|
|
4139
4143
|
item_description: (b = i.items[0]) == null ? void 0 : b.description,
|
|
4140
|
-
item_price: (
|
|
4144
|
+
item_price: (m = i.items[0]) == null ? void 0 : m.price,
|
|
4141
4145
|
item_tax_label: ((K = i.items[0]) == null ? void 0 : K.tax_label) ?? "",
|
|
4142
4146
|
item_tax_amount: (($ = i.items[0]) == null ? void 0 : $.total_tax) ?? "",
|
|
4143
4147
|
service_charge_amount: ((u = i.service_charges[0]) == null ? void 0 : u.total) ?? "",
|
|
4144
4148
|
rounding: i.rounding ?? 0,
|
|
4145
4149
|
payment_term_id: i.payment_term.name ?? "",
|
|
4146
|
-
payment_term_amount: ((
|
|
4150
|
+
payment_term_amount: ((p = (c = x[0]) == null ? void 0 : c.ids[0]) == null ? void 0 : p.amount) ?? "",
|
|
4147
4151
|
payment_method: ((f = x[0]) == null ? void 0 : f.payment_method_name) || ""
|
|
4148
4152
|
};
|
|
4149
4153
|
const D = Math.max(
|
|
@@ -4259,8 +4263,8 @@ const rs = [
|
|
|
4259
4263
|
if (e.value._id)
|
|
4260
4264
|
try {
|
|
4261
4265
|
i.value = !0, D.value = await Le(e.value._id);
|
|
4262
|
-
} catch (
|
|
4263
|
-
x.open({ message:
|
|
4266
|
+
} catch (m) {
|
|
4267
|
+
x.open({ message: m.message, type: "error" });
|
|
4264
4268
|
} finally {
|
|
4265
4269
|
i.value = !1;
|
|
4266
4270
|
}
|
|
@@ -4289,19 +4293,19 @@ const rs = [
|
|
|
4289
4293
|
async function b() {
|
|
4290
4294
|
try {
|
|
4291
4295
|
e.value._id && e.value.platform.subdomain && e.value.platform.api_key ? (i.value = !0, await ze(e.value._id), x.open({ message: "Upload successful", type: "success" })) : x.open({ message: "Invalid accounting setting", type: "error" });
|
|
4292
|
-
} catch (
|
|
4293
|
-
|
|
4296
|
+
} catch (m) {
|
|
4297
|
+
m.message && x.open({ message: m.message, type: "error" }), m.errors && m.errors.forEach((K) => x.open({ message: K, type: "error" }));
|
|
4294
4298
|
} finally {
|
|
4295
4299
|
i.value = !1;
|
|
4296
4300
|
}
|
|
4297
4301
|
}
|
|
4298
|
-
return (
|
|
4302
|
+
return (m, K) => {
|
|
4299
4303
|
const $ = V("FmButton"), u = V("FmCircularProgress"), c = V("FmTable");
|
|
4300
4304
|
return _(), U("div", is, [
|
|
4301
4305
|
t("div", ds, [
|
|
4302
4306
|
l(Be, {
|
|
4303
4307
|
"date-range": d(T),
|
|
4304
|
-
"onUpdate:dateRange": K[0] || (K[0] = (
|
|
4308
|
+
"onUpdate:dateRange": K[0] || (K[0] = (p) => Te(T) ? T.value = p : null),
|
|
4305
4309
|
compare: !1
|
|
4306
4310
|
}, null, 8, ["date-range"]),
|
|
4307
4311
|
l($, {
|
|
@@ -4325,7 +4329,7 @@ const rs = [
|
|
|
4325
4329
|
}
|
|
4326
4330
|
}), cs = { class: "h-full relative flex flex-col" }, fs = { class: "py-16 px-16 overflow-hidden flex-grow relative" }, gs = /* @__PURE__ */ J({
|
|
4327
4331
|
__name: "Biztory",
|
|
4328
|
-
props: /* @__PURE__ */
|
|
4332
|
+
props: /* @__PURE__ */ Ve({
|
|
4329
4333
|
errorLogs: {}
|
|
4330
4334
|
}, {
|
|
4331
4335
|
modelValue: { required: !0 },
|
|
@@ -4362,13 +4366,13 @@ const rs = [
|
|
|
4362
4366
|
default:
|
|
4363
4367
|
return null;
|
|
4364
4368
|
}
|
|
4365
|
-
}), y = z({}), b = z({}),
|
|
4369
|
+
}), y = z({}), b = z({}), m = (p, f) => p.map((v) => ({
|
|
4366
4370
|
label: f.length > 2 ? `ID:${v[f[2]]} [${v[f[0]]}] ${v[f[1]]}` : `[${v[f[0]]}] ${v[f[1]]}`,
|
|
4367
4371
|
value: v.id,
|
|
4368
4372
|
cnId: v.cnId ? v.cnId : null
|
|
4369
|
-
})), K = (
|
|
4373
|
+
})), K = (p) => m(p, ["wallet", "name"]), $ = (p) => m(p, ["id", "name"]), u = async (p, f, v, h) => {
|
|
4370
4374
|
try {
|
|
4371
|
-
const r = await
|
|
4375
|
+
const r = await p(e.value._id);
|
|
4372
4376
|
v.value.data = f(r);
|
|
4373
4377
|
} catch (r) {
|
|
4374
4378
|
console.error(h, r), v.value.isError = !0;
|
|
@@ -4376,8 +4380,8 @@ const rs = [
|
|
|
4376
4380
|
v.value.isLoaded = !0;
|
|
4377
4381
|
}
|
|
4378
4382
|
}, c = async () => {
|
|
4379
|
-
var
|
|
4380
|
-
(
|
|
4383
|
+
var p, f;
|
|
4384
|
+
(p = e.value.platform.mappings) != null && p.version && await u(
|
|
4381
4385
|
pt,
|
|
4382
4386
|
K,
|
|
4383
4387
|
y,
|
|
@@ -4390,9 +4394,9 @@ const rs = [
|
|
|
4390
4394
|
), y.value.isLoaded = !0, b.value.isLoaded = !0;
|
|
4391
4395
|
};
|
|
4392
4396
|
return Ge(c), Ce(() => {
|
|
4393
|
-
var
|
|
4394
|
-
return (
|
|
4395
|
-
}, c), (
|
|
4397
|
+
var p;
|
|
4398
|
+
return (p = e.value.platform.mappings) == null ? void 0 : p.version;
|
|
4399
|
+
}, c), (p, f) => {
|
|
4396
4400
|
var r, o, s;
|
|
4397
4401
|
const v = V("FmPageHead"), h = V("FmTabs");
|
|
4398
4402
|
return _(), U("div", cs, [
|
|
@@ -4433,9 +4437,9 @@ const rs = [
|
|
|
4433
4437
|
emits: ["update:modelValue"],
|
|
4434
4438
|
setup(g) {
|
|
4435
4439
|
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = q(
|
|
4436
|
-
() => y.map((
|
|
4440
|
+
() => y.map((p) => ({ label: p.name, value: p.id }))
|
|
4437
4441
|
);
|
|
4438
|
-
async function
|
|
4442
|
+
async function m() {
|
|
4439
4443
|
await F({
|
|
4440
4444
|
message: a("report.messages.confirmDelete", { name: e.value.name }),
|
|
4441
4445
|
title: a("report.common.delete")
|
|
@@ -4451,21 +4455,21 @@ const rs = [
|
|
|
4451
4455
|
await D(async () => {
|
|
4452
4456
|
try {
|
|
4453
4457
|
await je(e.value._id, e.value), await x.getSettings();
|
|
4454
|
-
} catch (
|
|
4455
|
-
i.open({ type: "error", message:
|
|
4458
|
+
} catch (p) {
|
|
4459
|
+
i.open({ type: "error", message: p.message });
|
|
4456
4460
|
}
|
|
4457
4461
|
});
|
|
4458
4462
|
}
|
|
4459
|
-
function $(
|
|
4463
|
+
function $(p, f) {
|
|
4460
4464
|
var v, h;
|
|
4461
|
-
(h = (v = e.value.platform) == null ? void 0 : v.mappings) != null && h[
|
|
4465
|
+
(h = (v = e.value.platform) == null ? void 0 : v.mappings) != null && h[p] && (e.value.platform.mappings[p] = e.value.platform.mappings[p].filter(
|
|
4462
4466
|
(r, o) => o !== f
|
|
4463
4467
|
));
|
|
4464
4468
|
}
|
|
4465
|
-
function u(
|
|
4469
|
+
function u(p) {
|
|
4466
4470
|
var f, v;
|
|
4467
|
-
(v = (f = e.value.platform) == null ? void 0 : f.mappings) != null && v[
|
|
4468
|
-
...e.value.platform.mappings[
|
|
4471
|
+
(v = (f = e.value.platform) == null ? void 0 : f.mappings) != null && v[p] && (e.value.platform.mappings[p] = [
|
|
4472
|
+
...e.value.platform.mappings[p],
|
|
4469
4473
|
{
|
|
4470
4474
|
key: "",
|
|
4471
4475
|
name: "",
|
|
@@ -4478,14 +4482,14 @@ const rs = [
|
|
|
4478
4482
|
await D(async () => {
|
|
4479
4483
|
try {
|
|
4480
4484
|
await Ke(e.value._id), await x.getSettings();
|
|
4481
|
-
} catch (
|
|
4482
|
-
i.open({ type: "error", message:
|
|
4485
|
+
} catch (p) {
|
|
4486
|
+
i.open({ type: "error", message: p.message });
|
|
4483
4487
|
}
|
|
4484
4488
|
});
|
|
4485
4489
|
}
|
|
4486
4490
|
return Re(async () => {
|
|
4487
4491
|
await x.getSettings();
|
|
4488
|
-
}), (
|
|
4492
|
+
}), (p, f) => {
|
|
4489
4493
|
var n, A, N, M, Y;
|
|
4490
4494
|
const v = V("FmIcon"), h = V("FmButton"), r = V("FmMenuDivider"), o = V("FmTextField"), s = V("FmSelect");
|
|
4491
4495
|
return (A = (n = e.value) == null ? void 0 : n.platform) != null && A.mappings ? (_(), U("div", vs, [
|
|
@@ -4504,7 +4508,7 @@ const rs = [
|
|
|
4504
4508
|
l(h, {
|
|
4505
4509
|
variant: "tertiary",
|
|
4506
4510
|
label: d(a)("report.common.delete"),
|
|
4507
|
-
onClick:
|
|
4511
|
+
onClick: m
|
|
4508
4512
|
}, null, 8, ["label"]),
|
|
4509
4513
|
l(h, {
|
|
4510
4514
|
variant: "primary",
|
|
@@ -4642,13 +4646,13 @@ const rs = [
|
|
|
4642
4646
|
T.value = !1;
|
|
4643
4647
|
}
|
|
4644
4648
|
}
|
|
4645
|
-
return (b,
|
|
4649
|
+
return (b, m) => {
|
|
4646
4650
|
const K = V("FmButton"), $ = V("FmCircularProgress"), u = V("FmTable");
|
|
4647
4651
|
return _(), U("div", Is, [
|
|
4648
4652
|
t("div", Us, [
|
|
4649
4653
|
l(Be, {
|
|
4650
4654
|
"date-range": d(F),
|
|
4651
|
-
"onUpdate:dateRange":
|
|
4655
|
+
"onUpdate:dateRange": m[0] || (m[0] = (c) => Te(F) ? F.value = c : null),
|
|
4652
4656
|
compare: !1
|
|
4653
4657
|
}, null, 8, ["date-range"]),
|
|
4654
4658
|
l(K, {
|
|
@@ -4701,7 +4705,7 @@ const rs = [
|
|
|
4701
4705
|
});
|
|
4702
4706
|
return (F, y) => {
|
|
4703
4707
|
var K;
|
|
4704
|
-
const b = V("FmPageHead"),
|
|
4708
|
+
const b = V("FmPageHead"), m = V("FmTabs");
|
|
4705
4709
|
return _(), U("div", js, [
|
|
4706
4710
|
l(b, {
|
|
4707
4711
|
title: ((K = e.value) == null ? void 0 : K.name) || "AutoCount",
|
|
@@ -4714,7 +4718,7 @@ const rs = [
|
|
|
4714
4718
|
])),
|
|
4715
4719
|
_: 1
|
|
4716
4720
|
}, 8, ["title"]),
|
|
4717
|
-
l(
|
|
4721
|
+
l(m, {
|
|
4718
4722
|
"model-value": i.value,
|
|
4719
4723
|
"onUpdate:modelValue": y[1] || (y[1] = ($) => i.value = $),
|
|
4720
4724
|
items: x
|
|
@@ -4745,7 +4749,7 @@ const rs = [
|
|
|
4745
4749
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
4746
4750
|
}, Dr = { class: "flex flex-col gap-16" }, Kr = { class: "fm-typo-en-title-sm-800" }, Tr = { class: "flex flex-row items-center w-[100%] justify-start" }, Fr = { class: "text-nowrap w-[calc(25%-4px)] overflow-hidden text-ellipsis" }, Nr = { class: "flex flex-row items-center w-[100%] justify-start" }, Ir = { class: "text-nowrap w-[calc(25%-4px)] overflow-hidden text-ellipsis" }, Ur = { class: "flex flex-row items-center w-[100%] justify-start" }, Rr = { class: "text-nowrap w-[calc(25%-4px)] overflow-hidden text-ellipsis" }, Pr = { class: "flex flex-col gap-16 pt-3 pb-3" }, Mr = { class: "flex flex-row items-center gap-5" }, jr = { class: "fm-typo-en-title-sm-800" }, Lr = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Or = { class: "flex flex-row items-center justify-between gap-x-16" }, Er = { class: "fm-typo-en-title-sm-800" }, Br = { class: "flex flex-row items-center justify-between gap-x-16" }, Yr = { class: "fm-typo-en-title-sm-800" }, qr = { class: "flex flex-row items-center justify-between gap-x-16" }, Hr = { class: "fm-typo-en-title-sm-800" }, zr = { class: "flex flex-row items-center justify-between gap-x-16" }, Qr = { class: "fm-typo-en-title-sm-800" }, Gr = { class: "xs:grid-cols-1 grid-cols-2 grid gap-16" }, Xr = /* @__PURE__ */ J({
|
|
4747
4751
|
__name: "Setting",
|
|
4748
|
-
props: /* @__PURE__ */
|
|
4752
|
+
props: /* @__PURE__ */ Ve({
|
|
4749
4753
|
retrievedDebtors: {
|
|
4750
4754
|
type: Object,
|
|
4751
4755
|
required: !0
|
|
@@ -4767,7 +4771,7 @@ const rs = [
|
|
|
4767
4771
|
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = q(
|
|
4768
4772
|
() => y.map((o) => ({ label: o.name, value: o.id }))
|
|
4769
4773
|
);
|
|
4770
|
-
let
|
|
4774
|
+
let m = z("");
|
|
4771
4775
|
async function K() {
|
|
4772
4776
|
await F({
|
|
4773
4777
|
message: a("report.messages.confirmDelete", { name: e.value.name }),
|
|
@@ -4816,7 +4820,7 @@ const rs = [
|
|
|
4816
4820
|
}
|
|
4817
4821
|
]);
|
|
4818
4822
|
}
|
|
4819
|
-
const
|
|
4823
|
+
const p = [
|
|
4820
4824
|
{
|
|
4821
4825
|
label: "By day",
|
|
4822
4826
|
value: ve.BY_DAY
|
|
@@ -4855,7 +4859,7 @@ const rs = [
|
|
|
4855
4859
|
const s = g.retrievedDebtors.data.find(
|
|
4856
4860
|
(n) => n.valueAccNo === o || n.value === o
|
|
4857
4861
|
);
|
|
4858
|
-
s && (
|
|
4862
|
+
s && (m.value = o, e.value.platform.mappings.debtorCode = s.valueAccNo, e.value.platform.mappings.debtorName = s.valueCompanyName);
|
|
4859
4863
|
}
|
|
4860
4864
|
return Ce(
|
|
4861
4865
|
() => g.retrievedDebtors.isLoaded,
|
|
@@ -4865,7 +4869,7 @@ const rs = [
|
|
|
4865
4869
|
const n = g.retrievedDebtors.data.find(
|
|
4866
4870
|
(A) => A.valueAccNo === e.value.platform.mappings.debtorCode
|
|
4867
4871
|
);
|
|
4868
|
-
n != null && (
|
|
4872
|
+
n != null && (m.value = n.value);
|
|
4869
4873
|
}
|
|
4870
4874
|
},
|
|
4871
4875
|
{ immediate: !0 }
|
|
@@ -4979,7 +4983,7 @@ const rs = [
|
|
|
4979
4983
|
modelValue: e.value.platform.grouping,
|
|
4980
4984
|
"onUpdate:modelValue": s[6] || (s[6] = (S) => e.value.platform.grouping = S),
|
|
4981
4985
|
multiselect: !1,
|
|
4982
|
-
items:
|
|
4986
|
+
items: p,
|
|
4983
4987
|
placeholder: d(a)("report.integration.grouping.title"),
|
|
4984
4988
|
class: "flex-grow"
|
|
4985
4989
|
}, null, 8, ["modelValue", "placeholder"])
|
|
@@ -4992,9 +4996,9 @@ const rs = [
|
|
|
4992
4996
|
})),
|
|
4993
4997
|
g.retrievedDebtors.isLoaded && g.retrievedDebtors.data && ((le = g.retrievedDebtors.data) == null ? void 0 : le.length) != 0 && !g.retrievedDebtors.isError ? (_(), U("div", kr, [
|
|
4994
4998
|
l(Y, {
|
|
4995
|
-
modelValue: d(
|
|
4999
|
+
modelValue: d(m),
|
|
4996
5000
|
"onUpdate:modelValue": [
|
|
4997
|
-
s[7] || (s[7] = (S) => Te(
|
|
5001
|
+
s[7] || (s[7] = (S) => Te(m) ? m.value = S : m = S),
|
|
4998
5002
|
r
|
|
4999
5003
|
],
|
|
5000
5004
|
items: g.retrievedDebtors.data,
|
|
@@ -5294,7 +5298,7 @@ const rs = [
|
|
|
5294
5298
|
});
|
|
5295
5299
|
function Wr(g) {
|
|
5296
5300
|
return g.reduce((a, e) => {
|
|
5297
|
-
var F, y, b,
|
|
5301
|
+
var F, y, b, m, K, $, u, c, p, f, v, h, r, o;
|
|
5298
5302
|
const { invoice: i, payments: x } = e, T = a.length;
|
|
5299
5303
|
a[T] = {
|
|
5300
5304
|
docNo: i.master.docNo,
|
|
@@ -5303,13 +5307,13 @@ function Wr(g) {
|
|
|
5303
5307
|
itemProductCode: (F = i.details[0]) == null ? void 0 : F.productCode,
|
|
5304
5308
|
description: (y = i.details[0]) == null ? void 0 : y.description,
|
|
5305
5309
|
qty: (b = i.details[0]) == null ? void 0 : b.qty,
|
|
5306
|
-
unitPrice: (
|
|
5310
|
+
unitPrice: (m = i.details[0]) == null ? void 0 : m.unitPrice,
|
|
5307
5311
|
roundAdj: i.master.roundAdj,
|
|
5308
5312
|
discount: (K = i.details[0]) == null ? void 0 : K.discount,
|
|
5309
5313
|
taxCode: ($ = i.details[0]) == null ? void 0 : $.taxCode,
|
|
5310
5314
|
creditTerm: i.master.creditTerm,
|
|
5311
5315
|
docType: (u = x[0]) == null ? void 0 : u.master.docType,
|
|
5312
|
-
paymentMethod: (
|
|
5316
|
+
paymentMethod: (p = (c = x[0]) == null ? void 0 : c.paymentDetails[0]) == null ? void 0 : p.paymentMethod,
|
|
5313
5317
|
amount: ((f = x[0]) == null ? void 0 : f.details[0].amount) || 0,
|
|
5314
5318
|
currencyCode: (v = x[0]) == null ? void 0 : v.master.currencyCode,
|
|
5315
5319
|
journalType: (h = x[0]) == null ? void 0 : h.master.journalType
|
|
@@ -5449,18 +5453,18 @@ const Jr = [
|
|
|
5449
5453
|
immediate: !0
|
|
5450
5454
|
}
|
|
5451
5455
|
);
|
|
5452
|
-
const b = q(() => Wr(y.value)),
|
|
5453
|
-
var
|
|
5454
|
-
const c = (
|
|
5456
|
+
const b = q(() => Wr(y.value)), m = q(() => Jr), K = q(() => {
|
|
5457
|
+
var p;
|
|
5458
|
+
const c = (p = D.find(
|
|
5455
5459
|
(f) => f.platform === he.AutoCountCloud
|
|
5456
|
-
)) == null ? void 0 :
|
|
5460
|
+
)) == null ? void 0 : p.flags;
|
|
5457
5461
|
return c ? F(c) : !1;
|
|
5458
5462
|
});
|
|
5459
5463
|
async function $() {
|
|
5460
5464
|
try {
|
|
5461
5465
|
e.value._id && e.value.platform.apiKey ? (i.value = !0, await ze(e.value._id), x.open({ message: a("report.integration.uploadSuccess"), type: "success" })) : x.open({ message: a("report.integration.invalidSetting"), type: "error" });
|
|
5462
5466
|
} catch (c) {
|
|
5463
|
-
c.message && x.open({ message: c.message, type: "error" }), c.errors && c.errors.forEach((
|
|
5467
|
+
c.message && x.open({ message: c.message, type: "error" }), c.errors && c.errors.forEach((p) => x.open({ message: p, type: "error" }));
|
|
5464
5468
|
} finally {
|
|
5465
5469
|
i.value = !1;
|
|
5466
5470
|
}
|
|
@@ -5474,13 +5478,13 @@ const Jr = [
|
|
|
5474
5478
|
i.value = !1;
|
|
5475
5479
|
}
|
|
5476
5480
|
}
|
|
5477
|
-
return (c,
|
|
5481
|
+
return (c, p) => {
|
|
5478
5482
|
const f = V("FmButton"), v = V("FmCircularProgress"), h = V("FmTable");
|
|
5479
5483
|
return _(), U("div", Zr, [
|
|
5480
5484
|
t("div", ei, [
|
|
5481
5485
|
l(Be, {
|
|
5482
5486
|
"date-range": d(T),
|
|
5483
|
-
"onUpdate:dateRange":
|
|
5487
|
+
"onUpdate:dateRange": p[0] || (p[0] = (r) => Te(T) ? T.value = r : null),
|
|
5484
5488
|
compare: !1
|
|
5485
5489
|
}, null, 8, ["date-range"]),
|
|
5486
5490
|
t("div", ti, [
|
|
@@ -5506,7 +5510,7 @@ const Jr = [
|
|
|
5506
5510
|
key: 1,
|
|
5507
5511
|
class: "flex overflow-y-auto p-5 border border-fm-color-border-secondary rounded-lg h-auto",
|
|
5508
5512
|
"row-data": b.value,
|
|
5509
|
-
"column-defs":
|
|
5513
|
+
"column-defs": m.value
|
|
5510
5514
|
}, null, 8, ["row-data", "column-defs"]))
|
|
5511
5515
|
]);
|
|
5512
5516
|
};
|
|
@@ -5550,24 +5554,24 @@ const Jr = [
|
|
|
5550
5554
|
}), F = z({}), y = z({}), b = (u) => u.data.map((c) => ({
|
|
5551
5555
|
label: c.location + " - " + c.description,
|
|
5552
5556
|
value: c.location
|
|
5553
|
-
})),
|
|
5557
|
+
})), m = (u) => u.data.map((c) => ({
|
|
5554
5558
|
label: c.AccNo + " - " + c.CompanyName,
|
|
5555
5559
|
value: c.AccNo + " - " + c.CompanyName,
|
|
5556
5560
|
valueAccNo: c.AccNo,
|
|
5557
5561
|
valueCompanyName: c.CompanyName
|
|
5558
|
-
})), K = async (u, c,
|
|
5562
|
+
})), K = async (u, c, p, f) => {
|
|
5559
5563
|
try {
|
|
5560
5564
|
const v = await u(e.value._id);
|
|
5561
|
-
|
|
5565
|
+
p.value.data = c(v);
|
|
5562
5566
|
} catch (v) {
|
|
5563
|
-
console.error(f, v),
|
|
5567
|
+
console.error(f, v), p.value.isError = !0;
|
|
5564
5568
|
} finally {
|
|
5565
|
-
|
|
5569
|
+
p.value.isLoaded = !0;
|
|
5566
5570
|
}
|
|
5567
5571
|
}, $ = async () => {
|
|
5568
5572
|
await K(
|
|
5569
5573
|
ct,
|
|
5570
|
-
|
|
5574
|
+
m,
|
|
5571
5575
|
y,
|
|
5572
5576
|
"Failed to fetch debtors:"
|
|
5573
5577
|
), await K(
|
|
@@ -5581,9 +5585,9 @@ const Jr = [
|
|
|
5581
5585
|
e.value.platform.apiKey && e.value.platform.accountBookId && e.value.platform.keyId ? $() : (F.value.isLoaded = !0, y.value.isLoaded = !0, F.value.isError = !0, y.value.isError = !0);
|
|
5582
5586
|
}), (u, c) => {
|
|
5583
5587
|
var v, h, r;
|
|
5584
|
-
const
|
|
5588
|
+
const p = V("FmPageHead"), f = V("FmTabs");
|
|
5585
5589
|
return _(), U("div", ni, [
|
|
5586
|
-
l(
|
|
5590
|
+
l(p, {
|
|
5587
5591
|
title: ((v = e.value) == null ? void 0 : v.name) || "Autocount Cloud",
|
|
5588
5592
|
"back-button": !0,
|
|
5589
5593
|
style: { paddingLeft: "0px", paddingRight: "0px" },
|
|
@@ -5622,7 +5626,7 @@ const Jr = [
|
|
|
5622
5626
|
const { t: a } = oe(), e = te(g, "modelValue"), i = _e(), x = Ae(), T = be(), { promptLoader: D } = Pe(), { promptMessage: F } = Oe(), { restaurants: y } = we(), b = q(
|
|
5623
5627
|
() => y.map((f) => ({ label: f.name, value: f.id }))
|
|
5624
5628
|
);
|
|
5625
|
-
async function
|
|
5629
|
+
async function m() {
|
|
5626
5630
|
await F({
|
|
5627
5631
|
message: a("report.messages.confirmDelete", { name: e.value.name }),
|
|
5628
5632
|
title: a("report.common.delete")
|
|
@@ -5666,7 +5670,7 @@ const Jr = [
|
|
|
5666
5670
|
value: ve.BY_INVOICE_ITEM
|
|
5667
5671
|
}
|
|
5668
5672
|
];
|
|
5669
|
-
async function
|
|
5673
|
+
async function p() {
|
|
5670
5674
|
await D(async () => {
|
|
5671
5675
|
try {
|
|
5672
5676
|
await Ke(e.value._id), await x.getSettings();
|
|
@@ -5689,14 +5693,14 @@ const Jr = [
|
|
|
5689
5693
|
l(h, {
|
|
5690
5694
|
name: "refresh",
|
|
5691
5695
|
class: "p-2 bg-gray-100 rounded-full",
|
|
5692
|
-
onClick:
|
|
5696
|
+
onClick: p
|
|
5693
5697
|
}),
|
|
5694
5698
|
t("span", ci, C(d(a)("report.integration.refreshSetting")), 1)
|
|
5695
5699
|
]),
|
|
5696
5700
|
l(r, {
|
|
5697
5701
|
variant: "tertiary",
|
|
5698
5702
|
label: d(a)("report.common.delete"),
|
|
5699
|
-
onClick:
|
|
5703
|
+
onClick: m
|
|
5700
5704
|
}, null, 8, ["label"]),
|
|
5701
5705
|
l(r, {
|
|
5702
5706
|
variant: "primary",
|
|
@@ -5953,7 +5957,7 @@ const Jr = [
|
|
|
5953
5957
|
}), i = q(() => e.value.invoices.reduce((o, s) => {
|
|
5954
5958
|
for (const n of s._items)
|
|
5955
5959
|
o.push({
|
|
5956
|
-
rDate:
|
|
5960
|
+
rDate: Se(s.rDate).format("D-MMM-YY"),
|
|
5957
5961
|
rNo: s.rNo,
|
|
5958
5962
|
debtorCode: s.debtorCode,
|
|
5959
5963
|
debtorName: s.debtorName,
|
|
@@ -6004,7 +6008,7 @@ const Jr = [
|
|
|
6004
6008
|
}, [])), T = q(() => e.value.creditNotes.reduce((o, s) => {
|
|
6005
6009
|
for (const n of s._items)
|
|
6006
6010
|
o.push({
|
|
6007
|
-
rDate:
|
|
6011
|
+
rDate: Se(s.rDate).format("D-MMM-YY"),
|
|
6008
6012
|
rNo: s.rNo,
|
|
6009
6013
|
debtorCode: s.debtorCode,
|
|
6010
6014
|
debtorName: s.debtorName,
|
|
@@ -6028,7 +6032,7 @@ const Jr = [
|
|
|
6028
6032
|
}, [])), D = q(() => e.value.purchaseOrders.reduce((o, s) => {
|
|
6029
6033
|
for (const n of s._skus)
|
|
6030
6034
|
o.push({
|
|
6031
|
-
_date:
|
|
6035
|
+
_date: Se(s._date).format("D-MMM-YY"),
|
|
6032
6036
|
_no: s._no,
|
|
6033
6037
|
code: n.code,
|
|
6034
6038
|
particular: n.particular,
|
|
@@ -6041,7 +6045,7 @@ const Jr = [
|
|
|
6041
6045
|
o.push({
|
|
6042
6046
|
poNo: s.poNo,
|
|
6043
6047
|
rNo: s.rNo,
|
|
6044
|
-
rDate:
|
|
6048
|
+
rDate: Se(s.rDate).format("D-MMM-YY"),
|
|
6045
6049
|
debtorCode: s.debtorCode,
|
|
6046
6050
|
debtorName: s.debtorName,
|
|
6047
6051
|
salesType: s.salesType,
|
|
@@ -6173,7 +6177,7 @@ const Jr = [
|
|
|
6173
6177
|
header: () => k("p", { class: "min-w-[100px] text-nowrap text-ellipsis" }, "Account Code"),
|
|
6174
6178
|
enableSorting: !1
|
|
6175
6179
|
}
|
|
6176
|
-
],
|
|
6180
|
+
], m = [...b], K = [
|
|
6177
6181
|
{
|
|
6178
6182
|
accessorKey: "_date",
|
|
6179
6183
|
header: () => k("p", { class: "min-w-[90px] text-nowrap text-ellipsis" }, "Date"),
|
|
@@ -6285,7 +6289,7 @@ const Jr = [
|
|
|
6285
6289
|
header: () => k("p", { class: "min-w-[100px] text-nowrap text-ellipsis" }, "Net Amt"),
|
|
6286
6290
|
enableSorting: !1
|
|
6287
6291
|
}
|
|
6288
|
-
], u = te(g, "modelValue"), c = z(!1),
|
|
6292
|
+
], u = te(g, "modelValue"), c = z(!1), p = _e(), { dateRange: f } = Ee(we());
|
|
6289
6293
|
Ce(
|
|
6290
6294
|
() => f.value,
|
|
6291
6295
|
async () => {
|
|
@@ -6293,7 +6297,7 @@ const Jr = [
|
|
|
6293
6297
|
try {
|
|
6294
6298
|
c.value = !0, e.value = await Le(u.value._id);
|
|
6295
6299
|
} catch (o) {
|
|
6296
|
-
|
|
6300
|
+
p.open({ message: o.message, type: "error" });
|
|
6297
6301
|
} finally {
|
|
6298
6302
|
c.value = !1;
|
|
6299
6303
|
}
|
|
@@ -6304,9 +6308,9 @@ const Jr = [
|
|
|
6304
6308
|
);
|
|
6305
6309
|
async function v() {
|
|
6306
6310
|
try {
|
|
6307
|
-
u.value._id ? (c.value = !0, await qe(u.value._id, [r.value])) :
|
|
6311
|
+
u.value._id ? (c.value = !0, await qe(u.value._id, [r.value])) : p.open({ message: "Invalid accounting setting", type: "error" });
|
|
6308
6312
|
} catch (o) {
|
|
6309
|
-
|
|
6313
|
+
p.open({ message: o.message, type: "error" });
|
|
6310
6314
|
} finally {
|
|
6311
6315
|
c.value = !1;
|
|
6312
6316
|
}
|
|
@@ -6373,7 +6377,7 @@ const Jr = [
|
|
|
6373
6377
|
key: 1,
|
|
6374
6378
|
class: "flex overflow-y-auto p-5 border border-fm-color-border-secondary rounded-lg",
|
|
6375
6379
|
"row-data": T.value,
|
|
6376
|
-
"column-defs":
|
|
6380
|
+
"column-defs": m
|
|
6377
6381
|
}, null, 8, ["row-data"])) : r.value === "DELIVERY_ORDER" ? (_(), j(M, {
|
|
6378
6382
|
key: 2,
|
|
6379
6383
|
class: "flex overflow-y-auto p-5 border border-fm-color-border-secondary rounded-lg",
|
|
@@ -6426,7 +6430,7 @@ const Jr = [
|
|
|
6426
6430
|
});
|
|
6427
6431
|
return (F, y) => {
|
|
6428
6432
|
var K;
|
|
6429
|
-
const b = V("FmPageHead"),
|
|
6433
|
+
const b = V("FmPageHead"), m = V("FmTabs");
|
|
6430
6434
|
return _(), U("div", ji, [
|
|
6431
6435
|
l(b, {
|
|
6432
6436
|
title: ((K = e.value) == null ? void 0 : K.name) || "Synergy",
|
|
@@ -6439,7 +6443,7 @@ const Jr = [
|
|
|
6439
6443
|
])),
|
|
6440
6444
|
_: 1
|
|
6441
6445
|
}, 8, ["title"]),
|
|
6442
|
-
l(
|
|
6446
|
+
l(m, {
|
|
6443
6447
|
"model-value": i.value,
|
|
6444
6448
|
"onUpdate:modelValue": y[1] || (y[1] = ($) => i.value = $),
|
|
6445
6449
|
items: x
|
|
@@ -6463,7 +6467,7 @@ const Jr = [
|
|
|
6463
6467
|
() => i.settings,
|
|
6464
6468
|
async (F) => {
|
|
6465
6469
|
var b;
|
|
6466
|
-
const y = F.find((
|
|
6470
|
+
const y = F.find((m) => m._id === e.id);
|
|
6467
6471
|
y && (x.value = y, a.value = (b = x.value.platform) == null ? void 0 : b.name, x.value._id && (T.value = await gt(x.value._id)));
|
|
6468
6472
|
},
|
|
6469
6473
|
{ immediate: !0 }
|