@wisemen/wise-invoicing-web 0.16.0 → 0.18.0
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/{ApprovalReminderSettingsViewDataProvider-CpGYtZKw.js → ApprovalReminderSettingsViewDataProvider-BZBuz6EF.js} +4 -4
- package/dist/{BillingDocumentDetailViewDataProvider-CA71dgRN.js → BillingDocumentDetailViewDataProvider-BCADHPFR.js} +1080 -1079
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-CvUxfHDH.js → BillingDocumentPdf-ddBlGdIN.js} +4 -4
- package/dist/{CreditNoteDetailViewDataProvider-DK7hkA8d.js → CreditNoteDetailViewDataProvider-Donn5pVv.js} +222 -205
- package/dist/{CreditNotePdfViewDataProvider-DcQxB1p4.js → CreditNotePdfViewDataProvider-c-apCeCW.js} +3 -3
- package/dist/{DunningCaseSendDialog-BWbEi9Vr.js → DunningCaseSendDialog-fgL9OsV8.js} +3 -3
- package/dist/{InvoiceApprovalOutOfSyncIndicator-CptL1bbz.js → InvoiceApprovalOutOfSyncIndicator-BoPBNXx1.js} +1 -1
- package/dist/{InvoiceApprovalOverviewView-dsTZWXyZ.js → InvoiceApprovalOverviewView-BIiJ6gen.js} +9 -9
- package/dist/{InvoiceApprovalStatusBadge-6cSp2XOq.js → InvoiceApprovalStatusBadge-CaVSCtI0.js} +4 -4
- package/dist/{InvoiceApproveDialogDataProvider-DsxA74kh.js → InvoiceApproveDialogDataProvider-C9NhZX-D.js} +7 -7
- package/dist/{InvoiceDeliverySendDialog-byobpQe1.js → InvoiceDeliverySendDialog-BICcd6Cf.js} +186 -114
- package/dist/{InvoiceDetailViewDataProvider-DgNkoQNH.js → InvoiceDetailViewDataProvider-BppXFT6D.js} +609 -600
- package/dist/{InvoicePdfView-CA-nt_Qs.js → InvoicePdfView-BRJaAErd.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-CVgcgc9t.js → InvoicePdfViewDataProvider-J7NP1Dhh.js} +3 -3
- package/dist/{InvoicePublicProFormaPdfViewDataProvider-BIhn-msJ.js → InvoicePublicProFormaPdfViewDataProvider-mZaggXYf.js} +3 -3
- package/dist/{InvoicingFileUploadProvider-DFjM7Xcj.js → InvoicingFileUploadProvider-rU9APFrt.js} +2 -2
- package/dist/{IssuerSettingsViewDataProvider-2Gk7FgL2.js → IssuerSettingsViewDataProvider-D13f6rvi.js} +4 -4
- package/dist/{PeppolSettingsViewDataProvider-CLgFRfm_.js → PeppolSettingsViewDataProvider-DymLdaRM.js} +3 -3
- package/dist/{api.util-DMgdn9-w.js → api.util-sW4gNny-.js} +832 -779
- package/dist/{billingDocumentDetail.transformer-DFlbGUZp.js → billingDocumentDetail.transformer-DcNMzl46.js} +3 -2
- package/dist/client/index.d.ts +1 -1
- package/dist/client/sdk.gen.d.ts +1 -1
- package/dist/client/types.gen.d.ts +134 -70
- package/dist/client/zod.gen.d.ts +15385 -11665
- package/dist/{creditNoteDetail.query-D7J1umi4.js → creditNoteDetail.query-DiS_-xFz.js} +5 -3
- package/dist/{deliveryReason.util-iMVhwjiW.js → deliveryReason.util-KBh3q_-P.js} +2 -2
- package/dist/{dist-Ck8ZEByl.js → dist-C99_-gWv.js} +2 -2
- package/dist/{dist-ByzJNujV.js → dist-CyUNvdkD.js} +1 -1
- package/dist/{documentTitle.composable-QdSLs6eT.js → documentTitle.composable-Dl8Cm3v3.js} +1 -1
- package/dist/{i18n.lib-CEXUpXfo.js → i18n.lib-DckceEsg.js} +12 -2
- package/dist/index.d.ts +10 -0
- package/dist/index.js +789 -844
- package/dist/{invoice.service-NBqJSMkg.js → invoice.service-2QiktTs9.js} +14 -6
- package/dist/{invoiceApproval.service-Bk--tRnu.js → invoiceApproval.service-DXIKgCI_.js} +2 -2
- package/dist/{invoiceApprovalStatus.util-CYWPHuJD.js → invoiceApprovalStatus.util-CB5pi_hm.js} +2 -2
- package/dist/{invoiceCustomer.service-D13Cwb13.js → invoiceCustomer.service-BNQJt1KV.js} +2 -2
- package/dist/{invoiceDeliveryStatus.util-BExQWz3m.js → invoiceDeliveryStatus.util-Dp9hD1Tj.js} +3 -3
- package/dist/{invoiceDetail.query-CLvnFeZh.js → invoiceDetail.query-MIrBYgNS.js} +1 -1
- package/dist/{invoicingConfig.composable-BebjIIAC.js → invoicingConfig.composable-D-hxnEnh.js} +2 -2
- package/dist/{issuerSettings.query-P_gGS0ER.js → issuerSettings.query-CR7EtvNm.js} +2 -2
- package/dist/libs/i18n.lib.d.ts +10 -0
- package/dist/locales/en-US.json.d.ts +6 -1
- package/dist/locales/nl-BE.json.d.ts +6 -1
- package/dist/models/billing-document/billingDocumentDetail.model.d.ts +1 -0
- package/dist/modules/credit-note/api/mutations/creditNoteUpdate.mutation.d.ts +1 -0
- package/dist/modules/credit-note/models/update/creditNoteUpdateForm.model.d.ts +1 -0
- package/dist/modules/invoice/api/mutations/invoiceBulkFinalize.mutation.d.ts +1 -0
- package/dist/modules/invoice/api/mutations/invoiceUpdate.mutation.d.ts +1 -0
- package/dist/modules/invoice/api/services/invoice.service.d.ts +1 -1
- package/dist/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.d.ts +1 -1
- package/dist/modules/invoice/models/invoice/update/invoiceUpdateForm.model.d.ts +1 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +11 -1
- package/dist/{reminderConfig.query-s-gBYoPo.js → reminderConfig.query-DJmhJp6W.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/types/apiError.type.d.ts +2 -2
- package/package.json +4 -4
package/dist/{InvoiceDetailViewDataProvider-DgNkoQNH.js → InvoiceDetailViewDataProvider-BppXFT6D.js}
RENAMED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { t as e } from "./i18n.lib-
|
|
2
|
-
import { t, vt as n } from "./api.util-
|
|
3
|
-
import { S as r, T as i, a, b as o, c as s, l as c, m as l, r as u, x as d, y as f } from "./documentTitle.composable-
|
|
1
|
+
import { t as e } from "./i18n.lib-DckceEsg.js";
|
|
2
|
+
import { t, vt as n } from "./api.util-sW4gNny-.js";
|
|
3
|
+
import { S as r, T as i, a, b as o, c as s, l as c, m as l, r as u, x as d, y as f } from "./documentTitle.composable-Dl8Cm3v3.js";
|
|
4
4
|
import { r as p, t as m } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
5
|
-
import { n as h } from "./invoicingConfig.composable-
|
|
5
|
+
import { n as h } from "./invoicingConfig.composable-D-hxnEnh.js";
|
|
6
6
|
import { t as g } from "./search.composable-CU9OpyUB.js";
|
|
7
|
-
import { a as _, c as ee, i as te, n as v, t as y } from "./invoice.service-
|
|
7
|
+
import { a as _, c as ee, i as te, n as v, t as y } from "./invoice.service-2QiktTs9.js";
|
|
8
8
|
import { n as ne } from "./address.transformer-jGddczLV.js";
|
|
9
|
-
import { a as re, i as
|
|
10
|
-
import { n as
|
|
11
|
-
import { $ as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as je } from "./invoiceApprovalStatus.util-
|
|
15
|
-
import { t as Me } from "./invoiceCustomer.service-
|
|
16
|
-
import { i as Ne, n as Pe, r as Fe, t as Ie } from "./invoiceDeliveryStatus.util-
|
|
17
|
-
import { n as Le, t as Re } from "./InvoiceApprovalStatusBadge-
|
|
18
|
-
import { t as ze } from "./issuerSettings.query-
|
|
19
|
-
import { C as Be, E as Ve, S as He, T as Ue, _ as We, a as Ge, b as Ke, c as qe, d as Je, f as Ye, g as Xe, h as Ze, i as Qe, l as $e, m as et, n as tt, o as nt, p as rt, r as it, s as at, t as ot, u as st, v as ct, x as lt, y as ut } from "./BillingDocumentDetailViewDataProvider-
|
|
20
|
-
import { r as dt } from "./InvoicingFileUploadProvider-
|
|
21
|
-
import { i as ft, n as pt, r as mt, t as ht } from "./InvoiceApproveDialogDataProvider-
|
|
22
|
-
import { t as gt } from "./invoiceDetail.query-
|
|
23
|
-
import _t, { z as
|
|
24
|
-
import { useI18n as
|
|
25
|
-
import { Fragment as
|
|
26
|
-
import { ApiErrorUtil as Dt, useKeysetInfiniteQuery as Ot, useMutation as
|
|
9
|
+
import { a as re, c as ie, i as ae, o as b, r as oe, s as se, t as ce } from "./InvoiceDeliverySendDialog-BICcd6Cf.js";
|
|
10
|
+
import { n as le, t as ue } from "./download.util-LyRpGWKA.js";
|
|
11
|
+
import { $ as de, A as fe, G as pe, I as me, L as he, S as ge, T as _e, Tt as x, U as ve, V as ye, X as be, Y as xe, _ as Se, b as Ce, i as we, nt as Te, ot as S, pt as C, q as Ee, t as De, u as Oe, ut as ke, xt as Ae, yt as w } from "./dist-B33lNwLw.js";
|
|
12
|
+
import { n as T, r as E } from "./dist-CyUNvdkD.js";
|
|
13
|
+
import { t as D } from "./formango.util-D5c2ql--.js";
|
|
14
|
+
import { t as je } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
|
|
15
|
+
import { t as Me } from "./invoiceCustomer.service-BNQJt1KV.js";
|
|
16
|
+
import { i as Ne, n as Pe, r as Fe, t as Ie } from "./invoiceDeliveryStatus.util-Dp9hD1Tj.js";
|
|
17
|
+
import { n as Le, t as Re } from "./InvoiceApprovalStatusBadge-CaVSCtI0.js";
|
|
18
|
+
import { t as ze } from "./issuerSettings.query-CR7EtvNm.js";
|
|
19
|
+
import { C as Be, E as Ve, S as He, T as Ue, _ as We, a as Ge, b as Ke, c as qe, d as Je, f as Ye, g as Xe, h as Ze, i as Qe, l as $e, m as et, n as tt, o as nt, p as rt, r as it, s as at, t as ot, u as st, v as ct, x as lt, y as ut } from "./BillingDocumentDetailViewDataProvider-BCADHPFR.js";
|
|
20
|
+
import { r as dt } from "./InvoicingFileUploadProvider-rU9APFrt.js";
|
|
21
|
+
import { i as ft, n as pt, r as mt, t as ht } from "./InvoiceApproveDialogDataProvider-C9NhZX-D.js";
|
|
22
|
+
import { t as gt } from "./invoiceDetail.query-MIrBYgNS.js";
|
|
23
|
+
import _t, { z as O } from "zod";
|
|
24
|
+
import { useI18n as k } from "vue-i18n";
|
|
25
|
+
import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createSlots as vt, createTextVNode as yt, createVNode as I, defineComponent as L, mergeModels as bt, mergeProps as R, normalizeClass as xt, openBlock as z, ref as St, renderList as Ct, resolveDynamicComponent as wt, toDisplayString as B, unref as V, useModel as Tt, watch as Et, withCtx as H } from "vue";
|
|
26
|
+
import { ApiErrorUtil as Dt, useKeysetInfiniteQuery as Ot, useMutation as U, useOffsetInfiniteQuery as kt, useQuery as At } from "@wisemen/vue-core-api-utils";
|
|
27
27
|
import { RouterLink as jt, useRouter as Mt } from "vue-router";
|
|
28
28
|
import { Temporal as Nt } from "temporal-polyfill";
|
|
29
|
-
import { UIAutocomplete as Pt, UIBadge as Ft, UIBadgeLabel as It, UIBadgeSeparator as Lt, UIButton as Rt, UICheckbox as zt, UIClickableElement as Bt, UIColumnLayout as Vt, UIDateField as Ht, UIDetailList as Ut, UIDetailListGroup as Wt, UIDetailListGroupItem as
|
|
29
|
+
import { UIAutocomplete as Pt, UIBadge as Ft, UIBadgeLabel as It, UIBadgeSeparator as Lt, UIButton as Rt, UICheckbox as zt, UIClickableElement as Bt, UIColumnLayout as Vt, UIDateField as Ht, UIDetailList as Ut, UIDetailListGroup as Wt, UIDetailListGroupItem as W, UIDetailListGroupItemLabel as G, UIDetailListGroupItemValueText as K, UIDetailListGroupSeparator as Gt, UIDialog as Kt, UIDialogBody as qt, UIDialogFooter as q, UIDialogFooterCancel as J, UIDialogFooterSubmit as Jt, UIDialogHeader as Y, UIForm as Yt, UIFormDialog as X, UIFormFieldGrid as Xt, UIFormFieldGroup as Zt, UIFormSubmitButton as Qt, UIIconButton as $t, UINumberField as en, UIRowLayout as tn, UISelect as nn, UITable as rn, UITableCell as an, UITableCellInteractiveElement as on, UIText as Z, UITextField as sn, UITooltip as cn, UITooltipContent as ln, createAutocompleteOptions as un, createComponent as dn, createSelectOptions as fn, defineTableColumns as pn, useOverlay as mn, useToast as Q } from "@wisemen/vue-core-design-system";
|
|
30
30
|
import { useForm as $ } from "formango";
|
|
31
31
|
//#region src/modules/invoice/use-cases/detail/components/InvoiceApprovalBanner.vue?vue&type=script&setup=true&lang.ts
|
|
32
|
-
var
|
|
32
|
+
var hn = { class: "flex min-w-0 flex-1 flex-col gap-lg" }, gn = { class: "flex flex-col gap-xs pr-4xl" }, _n = {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "text-xs text-tertiary"
|
|
35
|
-
},
|
|
35
|
+
}, vn = {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "flex flex-wrap items-center gap-lg"
|
|
38
|
-
},
|
|
38
|
+
}, yn = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "absolute top-(--spacing-sm) right-(--spacing-sm) flex items-center gap-xxs rounded-full bg-error-solid px-sm py-xxs"
|
|
41
|
-
},
|
|
41
|
+
}, bn = /* @__PURE__ */ L({
|
|
42
42
|
__name: "InvoiceApprovalBanner",
|
|
43
43
|
props: {
|
|
44
44
|
isOutOfSync: { type: Boolean },
|
|
@@ -52,97 +52,97 @@ var mn = { class: "flex min-w-0 flex-1 flex-col gap-lg" }, hn = { class: "flex f
|
|
|
52
52
|
"viewProForma"
|
|
53
53
|
],
|
|
54
54
|
setup(e, { emit: t }) {
|
|
55
|
-
let n = e, r = t, i =
|
|
55
|
+
let n = e, r = t, i = k(), a = E(), o = j(() => n.approval?.sentAt ?? null), s = j(() => o.value !== null), c = j(() => n.approval?.status === f.REJECTED), l = j(() => o.value === null ? "" : a.toDate(o.value)), u = j(() => c.value ? "error" : n.isOutOfSync ? "warning" : "info"), d = j(() => n.isOutOfSync ? i.t("wise_invoicing.invoice.approval_banner.out_of_sync", { date: l.value }) : i.t("wise_invoicing.invoice.approval_banner.sent", { date: l.value })), p = j(() => {
|
|
56
56
|
if (n.isOutOfSync) return i.t("wise_invoicing.invoice.approval_banner.out_of_sync_supporting");
|
|
57
57
|
if (n.rejection === null || n.approval?.status === f.APPROVED) return null;
|
|
58
58
|
let e = i.t(je.getRejectionReasonTranslationKey(n.rejection.reason));
|
|
59
59
|
return i.t(c.value ? "wise_invoicing.invoice.approval_banner.rejected_reason" : "wise_invoicing.invoice.approval_banner.previously_rejected_reason", { reason: n.rejection.remark === null ? e : `${e} — ${n.rejection.remark}` });
|
|
60
|
-
}), m =
|
|
60
|
+
}), m = j(() => c.value || n.approval?.status !== f.REQUESTED ? null : n.approval.level), h = j(() => {
|
|
61
61
|
let e = m.value;
|
|
62
62
|
return e === null ? "" : i.t(je.getReminderLevelTranslationKey(e));
|
|
63
|
-
}), g =
|
|
63
|
+
}), g = j(() => {
|
|
64
64
|
let e = n.approval?.reminderSentAt ?? null;
|
|
65
65
|
return m.value === null || e === null ? null : i.t("wise_invoicing.invoice.approval_banner.last_reminder_sent", { time: a.toRelativeTime(e) });
|
|
66
|
-
}), _ =
|
|
66
|
+
}), _ = j(() => ({
|
|
67
67
|
error: "border-error-subtle bg-error-primary",
|
|
68
68
|
info: "border-primary bg-primary-alt",
|
|
69
69
|
warning: "border-warning-300 bg-warning-primary"
|
|
70
|
-
})[u.value]), ee =
|
|
70
|
+
})[u.value]), ee = j(() => ({
|
|
71
71
|
error: "rounded-full bg-error-secondary",
|
|
72
72
|
info: "rounded-lg border border-primary bg-primary shadow-xs",
|
|
73
73
|
warning: "rounded-full bg-warning-secondary"
|
|
74
|
-
})[u.value]), te =
|
|
74
|
+
})[u.value]), te = j(() => ({
|
|
75
75
|
error: "text-error-primary",
|
|
76
76
|
info: "text-tertiary",
|
|
77
77
|
warning: "text-warning-primary"
|
|
78
|
-
})[u.value]), v =
|
|
78
|
+
})[u.value]), v = j(() => u.value === "info" ? x : Te), y = j(() => ({
|
|
79
79
|
error: "text-error-primary",
|
|
80
80
|
info: "text-brand-secondary",
|
|
81
81
|
warning: "text-tertiary"
|
|
82
82
|
})[u.value]);
|
|
83
|
-
return (e, t) => s.value ? (
|
|
83
|
+
return (e, t) => s.value ? (z(), P("div", {
|
|
84
84
|
key: 0,
|
|
85
85
|
class: xt([_.value, "relative flex items-start gap-xl rounded-xl border p-xl shadow-xs"])
|
|
86
86
|
}, [
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
F("span", { class: xt([ee.value, "flex size-(--spacing-4xl) shrink-0 items-center justify-center"]) }, [(z(), M(wt(v.value), { class: xt([te.value, "size-(--spacing-xl)"]) }, null, 8, ["class"]))], 2),
|
|
88
|
+
F("div", hn, [F("div", gn, [I(V(Z), {
|
|
89
89
|
text: d.value,
|
|
90
90
|
class: "text-xs font-semibold text-secondary"
|
|
91
|
-
}, null, 8, ["text"]), p.value === null ?
|
|
92
|
-
default:
|
|
91
|
+
}, null, 8, ["text"]), p.value === null ? N("", !0) : (z(), P("p", _n, [yt(B(p.value) + " ", 1), n.proFormaFile !== null && n.isOutOfSync ? (z(), M(V(Bt), { key: 0 }, {
|
|
92
|
+
default: H(() => [F("button", {
|
|
93
93
|
class: xt([y.value, "underline-offset-2 hover:underline"]),
|
|
94
94
|
type: "button",
|
|
95
95
|
onClick: t[0] ||= (e) => r("viewProForma")
|
|
96
|
-
},
|
|
96
|
+
}, B(V(i).t("wise_invoicing.invoice.approval_banner.view_pro_forma")), 3)]),
|
|
97
97
|
_: 1
|
|
98
|
-
})) :
|
|
99
|
-
default:
|
|
98
|
+
})) : N("", !0)]))]), n.isOutOfSync || n.proFormaFile !== null ? (z(), P("div", vn, [n.isOutOfSync ? (z(), P(A, { key: 0 }, [I(V(Bt), null, {
|
|
99
|
+
default: H(() => [F("button", {
|
|
100
100
|
class: "text-xs font-semibold text-tertiary underline-offset-2 hover:underline",
|
|
101
101
|
type: "button",
|
|
102
102
|
onClick: t[1] ||= (e) => r("revertChanges")
|
|
103
|
-
},
|
|
103
|
+
}, B(V(i).t("wise_invoicing.invoice.approval_banner.revert_changes")), 1)]),
|
|
104
104
|
_: 1
|
|
105
|
-
}),
|
|
106
|
-
default:
|
|
105
|
+
}), I(V(Bt), null, {
|
|
106
|
+
default: H(() => [F("button", {
|
|
107
107
|
class: "text-xs font-semibold text-warning-primary underline-offset-2 hover:underline",
|
|
108
108
|
type: "button",
|
|
109
109
|
onClick: t[2] ||= (e) => r("sendNewRequest")
|
|
110
|
-
},
|
|
110
|
+
}, B(V(i).t("wise_invoicing.invoice.approval_banner.send_new_request")), 1)]),
|
|
111
111
|
_: 1
|
|
112
|
-
})], 64)) : (
|
|
113
|
-
default:
|
|
112
|
+
})], 64)) : (z(), P(A, { key: 1 }, [n.proFormaFile === null ? N("", !0) : (z(), M(V(Bt), { key: 0 }, {
|
|
113
|
+
default: H(() => [F("button", {
|
|
114
114
|
class: xt([y.value, "text-xs font-semibold underline-offset-2 hover:underline"]),
|
|
115
115
|
type: "button",
|
|
116
116
|
onClick: t[3] ||= (e) => r("viewProForma")
|
|
117
|
-
},
|
|
117
|
+
}, B(V(i).t("wise_invoicing.invoice.approval_banner.view_pro_forma")), 3)]),
|
|
118
118
|
_: 1
|
|
119
|
-
}))], 64))])) :
|
|
120
|
-
c.value ? (
|
|
121
|
-
text:
|
|
119
|
+
}))], 64))])) : N("", !0)]),
|
|
120
|
+
c.value ? (z(), P("span", yn, [I(V(de), { class: "size-(--spacing-lg) shrink-0 text-white" }), I(V(Z), {
|
|
121
|
+
text: V(i).t("wise_invoicing.invoice.approval_status.rejected"),
|
|
122
122
|
class: "text-xs text-white"
|
|
123
|
-
}, null, 8, ["text"])])) : m.value !== null && g.value !== null ? (
|
|
123
|
+
}, null, 8, ["text"])])) : m.value !== null && g.value !== null ? (z(), M(V(cn), {
|
|
124
124
|
key: 1,
|
|
125
125
|
"popover-side-offset": 8,
|
|
126
126
|
class: "absolute top-(--spacing-sm) right-(--spacing-sm)",
|
|
127
127
|
"popover-align": "center",
|
|
128
128
|
"popover-side": "bottom"
|
|
129
129
|
}, {
|
|
130
|
-
trigger:
|
|
130
|
+
trigger: H(() => [I(Le, {
|
|
131
131
|
icon: void 0,
|
|
132
132
|
label: h.value,
|
|
133
133
|
level: m.value,
|
|
134
134
|
size: "sm",
|
|
135
135
|
tone: "warning"
|
|
136
136
|
}, null, 8, ["label", "level"])]),
|
|
137
|
-
content:
|
|
138
|
-
default:
|
|
137
|
+
content: H(() => [I(V(ln), null, {
|
|
138
|
+
default: H(() => [I(V(Z), {
|
|
139
139
|
text: g.value,
|
|
140
140
|
class: "text-sm text-primary"
|
|
141
141
|
}, null, 8, ["text"])]),
|
|
142
142
|
_: 1
|
|
143
143
|
})]),
|
|
144
144
|
_: 1
|
|
145
|
-
})) : m.value === null ?
|
|
145
|
+
})) : m.value === null ? N("", !0) : (z(), M(Le, {
|
|
146
146
|
key: 2,
|
|
147
147
|
icon: void 0,
|
|
148
148
|
label: h.value,
|
|
@@ -151,13 +151,13 @@ var mn = { class: "flex min-w-0 flex-1 flex-col gap-lg" }, hn = { class: "flex f
|
|
|
151
151
|
size: "sm",
|
|
152
152
|
tone: "warning"
|
|
153
153
|
}, null, 8, ["label", "level"]))
|
|
154
|
-
], 2)) :
|
|
154
|
+
], 2)) : N("", !0);
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/modules/invoice/api/mutations/invoiceUpdate.mutation.ts
|
|
159
|
-
function
|
|
160
|
-
return
|
|
159
|
+
function xn() {
|
|
160
|
+
return U({
|
|
161
161
|
queryFn: (e) => y.update(e.params.invoiceUuid, e.body),
|
|
162
162
|
queryKeysToInvalidate: {
|
|
163
163
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -167,15 +167,15 @@ function bn() {
|
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/modules/invoice/components/InvoiceDeliveryStatusBadge.vue
|
|
170
|
-
var
|
|
170
|
+
var Sn = /* @__PURE__ */ L({
|
|
171
171
|
__name: "InvoiceDeliveryStatusBadge",
|
|
172
172
|
props: {
|
|
173
173
|
deliveryStatus: {},
|
|
174
174
|
size: { default: "sm" }
|
|
175
175
|
},
|
|
176
176
|
setup(e) {
|
|
177
|
-
let t = e, n =
|
|
178
|
-
return (e, n) => (
|
|
177
|
+
let t = e, n = k(), r = j(() => Ie.getMetadata(t.deliveryStatus)), i = j(() => n.t(r.value.translationKey));
|
|
178
|
+
return (e, n) => (z(), M(V(Ft), {
|
|
179
179
|
label: i.value,
|
|
180
180
|
color: r.value.tone,
|
|
181
181
|
size: t.size,
|
|
@@ -186,7 +186,7 @@ var xn = /* @__PURE__ */ I({
|
|
|
186
186
|
"size"
|
|
187
187
|
]));
|
|
188
188
|
}
|
|
189
|
-
}),
|
|
189
|
+
}), Cn = O.string().nullable(), wn = O.object({ subject: Cn }), Tn = /* @__PURE__ */ L({
|
|
190
190
|
__name: "InvoiceDetailHeaderSection",
|
|
191
191
|
props: {
|
|
192
192
|
isDisputed: { type: Boolean },
|
|
@@ -197,9 +197,9 @@ var xn = /* @__PURE__ */ I({
|
|
|
197
197
|
},
|
|
198
198
|
emits: ["togglePdfView"],
|
|
199
199
|
setup(e, { emit: t }) {
|
|
200
|
-
let n = e, r = t, i =
|
|
200
|
+
let n = e, r = t, i = k(), a = Q(), s = xn(), c = j(() => new Ue(n.invoice.status)), l = j(() => c.value.color), u = j(() => i.t(c.value.translationKey)), d = j(() => n.invoice.deliveryStatus !== o.UNSENT), f = j(() => Ie.isSent(n.invoice.deliveryStatus)), p = j(() => !n.invoice.isEditable), m = $({
|
|
201
201
|
initialState: { subject: n.invoice.subject },
|
|
202
|
-
schema:
|
|
202
|
+
schema: wn,
|
|
203
203
|
onSubmit: async (e) => {
|
|
204
204
|
let t = await s.execute({
|
|
205
205
|
body: {
|
|
@@ -208,24 +208,24 @@ var xn = /* @__PURE__ */ I({
|
|
|
208
208
|
},
|
|
209
209
|
params: { invoiceUuid: n.invoice.uuid }
|
|
210
210
|
});
|
|
211
|
-
t.isErr()
|
|
211
|
+
t.isErr() ? a.apiError(t.error) : oe.reflectBulkAction([n.invoice.uuid], { subject: e.subject });
|
|
212
212
|
}
|
|
213
213
|
}), h = m.register("subject");
|
|
214
|
-
return Ve({ form: m }), (e, t) => (
|
|
215
|
-
form:
|
|
214
|
+
return Ve({ form: m }), (e, t) => (z(), M(V(Yt), {
|
|
215
|
+
form: V(m),
|
|
216
216
|
"prompt-on-unsaved-changes": !1
|
|
217
217
|
}, {
|
|
218
|
-
default:
|
|
219
|
-
"fallback-title":
|
|
218
|
+
default: H(() => [I(ut, {
|
|
219
|
+
"fallback-title": V(i).t("wise_invoicing.invoice.detail.fallback_title"),
|
|
220
220
|
"is-disabled": p.value,
|
|
221
221
|
sequence: n.invoice.sequence,
|
|
222
222
|
"status-color": l.value,
|
|
223
223
|
"status-label": u.value,
|
|
224
|
-
icon:
|
|
225
|
-
"subject-field":
|
|
226
|
-
"subject-placeholder":
|
|
224
|
+
icon: V(Te),
|
|
225
|
+
"subject-field": V(h),
|
|
226
|
+
"subject-placeholder": V(i).t("wise_invoicing.invoice.detail.header.subject_placeholder")
|
|
227
227
|
}, {
|
|
228
|
-
actions:
|
|
228
|
+
actions: H(() => [I(ct, {
|
|
229
229
|
"is-pdf-view-active": n.isPdfViewActive,
|
|
230
230
|
"menu-groups": n.menuGroups,
|
|
231
231
|
"primary-buttons": n.primaryButtons,
|
|
@@ -235,13 +235,13 @@ var xn = /* @__PURE__ */ I({
|
|
|
235
235
|
"menu-groups",
|
|
236
236
|
"primary-buttons"
|
|
237
237
|
])]),
|
|
238
|
-
status:
|
|
238
|
+
status: H(() => [I(V(tn), {
|
|
239
239
|
gap: "xs",
|
|
240
240
|
class: "flex-wrap items-start"
|
|
241
241
|
}, {
|
|
242
|
-
default:
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
default: H(() => [
|
|
243
|
+
I(Fe, { "lifecycle-status": n.invoice.lifecycleStatus }, null, 8, ["lifecycle-status"]),
|
|
244
|
+
I(Pe, {
|
|
245
245
|
"is-sent": f.value,
|
|
246
246
|
"balance-due-amount": n.invoice.balanceDueAmount,
|
|
247
247
|
"gross-amount": n.invoice.grossAmount,
|
|
@@ -256,13 +256,13 @@ var xn = /* @__PURE__ */ I({
|
|
|
256
256
|
"settlement-status",
|
|
257
257
|
"total-credited-amount"
|
|
258
258
|
]),
|
|
259
|
-
n.invoice.isOverdue ? (
|
|
260
|
-
n.isDisputed ? (
|
|
261
|
-
d.value ? (
|
|
259
|
+
n.invoice.isOverdue ? (z(), M(Ke, { key: 0 })) : N("", !0),
|
|
260
|
+
n.isDisputed ? (z(), M(Ne, { key: 1 })) : N("", !0),
|
|
261
|
+
d.value ? (z(), M(Sn, {
|
|
262
262
|
key: 2,
|
|
263
263
|
"delivery-status": n.invoice.deliveryStatus
|
|
264
|
-
}, null, 8, ["delivery-status"])) :
|
|
265
|
-
|
|
264
|
+
}, null, 8, ["delivery-status"])) : N("", !0),
|
|
265
|
+
I(Re, {
|
|
266
266
|
approval: n.invoice.approval,
|
|
267
267
|
rejection: n.invoice.rejection,
|
|
268
268
|
"requires-prior-approval": n.invoice.requiresPriorApproval
|
|
@@ -288,11 +288,11 @@ var xn = /* @__PURE__ */ I({
|
|
|
288
288
|
_: 1
|
|
289
289
|
}, 8, ["form"]));
|
|
290
290
|
}
|
|
291
|
-
}),
|
|
291
|
+
}), En = { class: "grid w-full grid-cols-1 gap-md lg:grid-cols-3" }, Dn = /* @__PURE__ */ L({
|
|
292
292
|
__name: "InvoiceDetailLinkedCreditNotesSection",
|
|
293
293
|
props: { invoice: {} },
|
|
294
294
|
setup(e) {
|
|
295
|
-
let t = e, n =
|
|
295
|
+
let t = e, n = k(), r = p(), i = j(() => t.invoice.creditNotes.map((e) => {
|
|
296
296
|
let t = new Ue(e.status);
|
|
297
297
|
return {
|
|
298
298
|
uuid: e.uuid,
|
|
@@ -308,17 +308,17 @@ var xn = /* @__PURE__ */ I({
|
|
|
308
308
|
amount: e.grossAmount.amount > 0 ? -e.grossAmount.amount : e.grossAmount.amount
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
return (e, t) => i.value.length > 0 ? (
|
|
311
|
+
return (e, t) => i.value.length > 0 ? (z(), M(V(Vt), {
|
|
312
312
|
key: 0,
|
|
313
313
|
as: "section",
|
|
314
314
|
gap: "md",
|
|
315
315
|
class: "w-full"
|
|
316
316
|
}, {
|
|
317
|
-
default:
|
|
318
|
-
text:
|
|
317
|
+
default: H(() => [I(V(Z), {
|
|
318
|
+
text: V(n).t("wise_invoicing.invoice.detail.credit_notes.title"),
|
|
319
319
|
as: "h2",
|
|
320
320
|
class: "text-sm font-semibold text-primary"
|
|
321
|
-
}, null, 8, ["text"]),
|
|
321
|
+
}, null, 8, ["text"]), F("div", En, [(z(!0), P(A, null, Ct(i.value, (e) => (z(), M(V(jt), {
|
|
322
322
|
key: e.uuid,
|
|
323
323
|
to: {
|
|
324
324
|
name: "invoicing-credit-note-detail",
|
|
@@ -326,23 +326,23 @@ var xn = /* @__PURE__ */ I({
|
|
|
326
326
|
},
|
|
327
327
|
class: "min-w-0 rounded-lg border border-secondary bg-primary p-lg transition-colors hover:bg-secondary"
|
|
328
328
|
}, {
|
|
329
|
-
default:
|
|
329
|
+
default: H(() => [I(V(tn), {
|
|
330
330
|
align: "center",
|
|
331
331
|
gap: "md",
|
|
332
332
|
class: "min-w-0"
|
|
333
333
|
}, {
|
|
334
|
-
default:
|
|
335
|
-
|
|
334
|
+
default: H(() => [
|
|
335
|
+
I(V(Z), {
|
|
336
336
|
text: e.title,
|
|
337
337
|
class: "min-w-0 flex-1 truncate text-xs font-semibold text-primary"
|
|
338
338
|
}, null, 8, ["text"]),
|
|
339
|
-
|
|
339
|
+
I(V(Ft), {
|
|
340
340
|
label: e.statusLabel,
|
|
341
341
|
color: e.statusColor,
|
|
342
342
|
size: "sm",
|
|
343
343
|
variant: "translucent"
|
|
344
344
|
}, null, 8, ["label", "color"]),
|
|
345
|
-
|
|
345
|
+
I(V(Ft), {
|
|
346
346
|
label: e.amountLabel,
|
|
347
347
|
variant: "translucent",
|
|
348
348
|
size: "sm"
|
|
@@ -353,33 +353,34 @@ var xn = /* @__PURE__ */ I({
|
|
|
353
353
|
_: 2
|
|
354
354
|
}, 1032, ["to"]))), 128))])]),
|
|
355
355
|
_: 1
|
|
356
|
-
})) :
|
|
356
|
+
})) : N("", !0);
|
|
357
357
|
}
|
|
358
|
-
}),
|
|
359
|
-
deliveredOn:
|
|
360
|
-
dueOn:
|
|
361
|
-
issuedOn:
|
|
362
|
-
customFields:
|
|
363
|
-
externalRemarks:
|
|
364
|
-
poNumber:
|
|
365
|
-
preparedBy:
|
|
366
|
-
uuid:
|
|
367
|
-
name:
|
|
358
|
+
}), On = O.object({
|
|
359
|
+
deliveredOn: T.nullable(),
|
|
360
|
+
dueOn: T,
|
|
361
|
+
issuedOn: T,
|
|
362
|
+
customFields: O.array(O.custom()),
|
|
363
|
+
externalRemarks: O.string().nullable(),
|
|
364
|
+
poNumber: O.string().nullable(),
|
|
365
|
+
preparedBy: O.object({
|
|
366
|
+
uuid: O.uuid(),
|
|
367
|
+
name: O.string()
|
|
368
368
|
}),
|
|
369
|
-
|
|
369
|
+
reference: O.string().nullable(),
|
|
370
|
+
subject: O.string().nullable()
|
|
370
371
|
}).superRefine((t, n) => {
|
|
371
372
|
Temporal.PlainDate.compare(t.dueOn, t.issuedOn) < 0 && n.addIssue({
|
|
372
373
|
code: "custom",
|
|
373
374
|
message: e.global.t("invoicing.invoice.validation.due_date_after_issue_date"),
|
|
374
375
|
path: ["dueOn"]
|
|
375
376
|
});
|
|
376
|
-
}),
|
|
377
|
+
}), kn = /* @__PURE__ */ L({
|
|
377
378
|
__name: "InvoiceDetailRemarksSection",
|
|
378
379
|
props: { invoice: {} },
|
|
379
380
|
setup(e) {
|
|
380
|
-
let t = e, n =
|
|
381
|
-
initialState:
|
|
382
|
-
schema:
|
|
381
|
+
let t = e, n = k(), r = Q(), i = xn(), a = $({
|
|
382
|
+
initialState: j(() => v.toForm(t.invoice)),
|
|
383
|
+
schema: On,
|
|
383
384
|
onSubmit: async (e) => {
|
|
384
385
|
let n = await i.execute({
|
|
385
386
|
body: e,
|
|
@@ -387,16 +388,16 @@ var xn = /* @__PURE__ */ I({
|
|
|
387
388
|
});
|
|
388
389
|
n.isErr() && r.apiError(n.error);
|
|
389
390
|
}
|
|
390
|
-
}), o = a.register("externalRemarks"), s =
|
|
391
|
-
return Ve({ form: a }), (e, t) => (
|
|
392
|
-
form:
|
|
391
|
+
}), o = a.register("externalRemarks"), s = j(() => !t.invoice.isEditable);
|
|
392
|
+
return Ve({ form: a }), (e, t) => (z(), M(V(Yt), {
|
|
393
|
+
form: V(a),
|
|
393
394
|
"prompt-on-unsaved-changes": !1
|
|
394
395
|
}, {
|
|
395
|
-
default:
|
|
396
|
+
default: H(() => [I(We, {
|
|
396
397
|
"is-disabled": s.value,
|
|
397
|
-
placeholder:
|
|
398
|
-
"remarks-field":
|
|
399
|
-
title:
|
|
398
|
+
placeholder: V(n).t("wise_invoicing.invoice.detail.remarks.placeholder"),
|
|
399
|
+
"remarks-field": V(o),
|
|
400
|
+
title: V(n).t("wise_invoicing.invoice.detail.remarks.title")
|
|
400
401
|
}, null, 8, [
|
|
401
402
|
"is-disabled",
|
|
402
403
|
"placeholder",
|
|
@@ -409,7 +410,7 @@ var xn = /* @__PURE__ */ I({
|
|
|
409
410
|
});
|
|
410
411
|
//#endregion
|
|
411
412
|
//#region src/modules/invoice/api/queries/invoiceActivityLogIndex.query.ts
|
|
412
|
-
function
|
|
413
|
+
function An(e) {
|
|
413
414
|
return Ot("invoiceActivityLogIndex", {
|
|
414
415
|
params: { invoiceUuid: e },
|
|
415
416
|
queryFn: (t) => y.getActivityLogs(e.value, { pagination: t })
|
|
@@ -417,25 +418,25 @@ function kn(e) {
|
|
|
417
418
|
}
|
|
418
419
|
//#endregion
|
|
419
420
|
//#region src/modules/invoice/use-cases/detail/components/sidebar/InvoiceDetailSidebarActivityTab.vue
|
|
420
|
-
var
|
|
421
|
+
var jn = /* @__PURE__ */ L({
|
|
421
422
|
__name: "InvoiceDetailSidebarActivityTab",
|
|
422
423
|
props: { invoice: {} },
|
|
423
424
|
setup(e) {
|
|
424
|
-
let t = e, n =
|
|
425
|
+
let t = e, n = k(), { hasNextPage: r, isFetchingNextPage: i, isLoading: a, fetchNextPage: o, result: s } = An(j(() => t.invoice.uuid)), c = j(() => s.value.unwrapOr({
|
|
425
426
|
data: [],
|
|
426
427
|
meta: { next: null }
|
|
427
428
|
}).data);
|
|
428
|
-
return (e, s) => (
|
|
429
|
+
return (e, s) => (z(), M(Xe, {
|
|
429
430
|
"current-billing-document": {
|
|
430
|
-
role:
|
|
431
|
+
role: V(u).INVOICE,
|
|
431
432
|
uuid: t.invoice.uuid
|
|
432
433
|
},
|
|
433
|
-
"empty-message":
|
|
434
|
+
"empty-message": V(n).t("wise_invoicing.invoice.detail.sidebar.activity_empty"),
|
|
434
435
|
entries: c.value,
|
|
435
|
-
"fetch-next-page":
|
|
436
|
-
"has-next-page":
|
|
437
|
-
"is-fetching-next-page":
|
|
438
|
-
"is-loading":
|
|
436
|
+
"fetch-next-page": V(o),
|
|
437
|
+
"has-next-page": V(r),
|
|
438
|
+
"is-fetching-next-page": V(i),
|
|
439
|
+
"is-loading": V(a)
|
|
439
440
|
}, null, 8, [
|
|
440
441
|
"current-billing-document",
|
|
441
442
|
"empty-message",
|
|
@@ -446,7 +447,7 @@ var An = /* @__PURE__ */ I({
|
|
|
446
447
|
"is-loading"
|
|
447
448
|
]));
|
|
448
449
|
}
|
|
449
|
-
}),
|
|
450
|
+
}), Mn = /* @__PURE__ */ L({
|
|
450
451
|
__name: "CustomFieldFieldset",
|
|
451
452
|
props: /*@__PURE__*/ bt({
|
|
452
453
|
isDisabled: { type: Boolean },
|
|
@@ -462,17 +463,17 @@ var An = /* @__PURE__ */ I({
|
|
|
462
463
|
setup(e) {
|
|
463
464
|
let t = e, n = Tt(e, "modelValue");
|
|
464
465
|
function r(e) {
|
|
465
|
-
return
|
|
466
|
+
return le.findByDefinition(n.value, e);
|
|
466
467
|
}
|
|
467
468
|
function i(e, t) {
|
|
468
|
-
n.value =
|
|
469
|
+
n.value = le.upsert(n.value, e, t);
|
|
469
470
|
}
|
|
470
|
-
return (e, n) => t.definitions.length > 0 ? (
|
|
471
|
+
return (e, n) => t.definitions.length > 0 ? (z(), M(V(Vt), {
|
|
471
472
|
key: 0,
|
|
472
473
|
gap: t.size === "sm" ? "xs" : "md",
|
|
473
474
|
align: "stretch"
|
|
474
475
|
}, {
|
|
475
|
-
default:
|
|
476
|
+
default: H(() => [(z(!0), P(A, null, Ct(t.definitions, (e) => (z(), M(st, {
|
|
476
477
|
key: e.uuid,
|
|
477
478
|
currency: t.currency,
|
|
478
479
|
definition: e,
|
|
@@ -491,12 +492,12 @@ var An = /* @__PURE__ */ I({
|
|
|
491
492
|
"onUpdate:modelValue"
|
|
492
493
|
]))), 128))]),
|
|
493
494
|
_: 1
|
|
494
|
-
}, 8, ["gap"])) :
|
|
495
|
+
}, 8, ["gap"])) : N("", !0);
|
|
495
496
|
}
|
|
496
497
|
});
|
|
497
498
|
//#endregion
|
|
498
499
|
//#region src/modules/invoice/api/queries/invoiceCustomerDetail.query.ts
|
|
499
|
-
function
|
|
500
|
+
function Nn(e) {
|
|
500
501
|
return At("invoiceCustomerDetail", {
|
|
501
502
|
params: { customerUuid: e },
|
|
502
503
|
queryFn: () => Me.getByUuid(e.value)
|
|
@@ -504,7 +505,7 @@ function Mn(e) {
|
|
|
504
505
|
}
|
|
505
506
|
//#endregion
|
|
506
507
|
//#region src/modules/invoice/models/invoice/update/invoicePreparer.transformer.ts
|
|
507
|
-
var
|
|
508
|
+
var Pn = class {
|
|
508
509
|
static fromDto(e) {
|
|
509
510
|
let t = `${e.firstName ?? ""} ${e.lastName ?? ""}`.trim();
|
|
510
511
|
return {
|
|
@@ -512,28 +513,28 @@ var Nn = class {
|
|
|
512
513
|
name: t === "" ? e.email ?? e.uuid : t
|
|
513
514
|
};
|
|
514
515
|
}
|
|
515
|
-
},
|
|
516
|
+
}, Fn = class {
|
|
516
517
|
static toDto(e) {
|
|
517
518
|
return {
|
|
518
519
|
pagination: e.pagination,
|
|
519
520
|
search: ee.toDto(e.search)
|
|
520
521
|
};
|
|
521
522
|
}
|
|
522
|
-
},
|
|
523
|
+
}, In = class {
|
|
523
524
|
static async getAll(e) {
|
|
524
|
-
return (await t.fromPromise(n({ query:
|
|
525
|
-
data: e.data.items.map(
|
|
525
|
+
return (await t.fromPromise(n({ query: Fn.toDto(e) }))).map((e) => ({
|
|
526
|
+
data: e.data.items.map(Pn.fromDto),
|
|
526
527
|
meta: e.data.meta
|
|
527
528
|
}));
|
|
528
529
|
}
|
|
529
530
|
};
|
|
530
531
|
//#endregion
|
|
531
532
|
//#region src/modules/invoice/api/queries/invoiceUserSearch.query.ts
|
|
532
|
-
function
|
|
533
|
-
let t =
|
|
533
|
+
function Ln(e) {
|
|
534
|
+
let t = j(() => ({ search: e.params.search?.value }));
|
|
534
535
|
return kt("invoiceUserSearch", {
|
|
535
536
|
params: { queryParams: t },
|
|
536
|
-
queryFn: (t) =>
|
|
537
|
+
queryFn: (t) => In.getAll({
|
|
537
538
|
pagination: t,
|
|
538
539
|
search: e.params.search?.value ?? ""
|
|
539
540
|
})
|
|
@@ -541,7 +542,7 @@ function In(e) {
|
|
|
541
542
|
}
|
|
542
543
|
//#endregion
|
|
543
544
|
//#region src/modules/invoice/components/form/InvoiceFormPreparedByField.vue
|
|
544
|
-
var
|
|
545
|
+
var Rn = /* @__PURE__ */ L({
|
|
545
546
|
__name: "InvoiceFormPreparedByField",
|
|
546
547
|
props: {
|
|
547
548
|
isLoading: { type: Boolean },
|
|
@@ -550,20 +551,20 @@ var Ln = /* @__PURE__ */ I({
|
|
|
550
551
|
},
|
|
551
552
|
emits: ["nextPage", "updateSearch"],
|
|
552
553
|
setup(e, { emit: t }) {
|
|
553
|
-
let n = e, r = t, i =
|
|
554
|
+
let n = e, r = t, i = k(), a = j(() => un(n.users));
|
|
554
555
|
function o(e) {
|
|
555
556
|
return e.name;
|
|
556
557
|
}
|
|
557
558
|
function s(e) {
|
|
558
559
|
e !== null && (n.field.setValue(e), r("updateSearch", ""));
|
|
559
560
|
}
|
|
560
|
-
return (e, t) => (
|
|
561
|
+
return (e, t) => (z(), M(V(Pt), R(V(D)(n.field), {
|
|
561
562
|
"display-fn": o,
|
|
562
563
|
"is-loading": n.isLoading,
|
|
563
564
|
"is-required": !0,
|
|
564
565
|
items: a.value,
|
|
565
|
-
label:
|
|
566
|
-
placeholder:
|
|
566
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.created_by"),
|
|
567
|
+
placeholder: V(i).t("component.autocomplete.search_placeholder"),
|
|
567
568
|
"search-mode": "remote",
|
|
568
569
|
onNextPage: t[0] ||= (e) => r("nextPage"),
|
|
569
570
|
"onUpdate:modelValue": s,
|
|
@@ -575,7 +576,7 @@ var Ln = /* @__PURE__ */ I({
|
|
|
575
576
|
"placeholder"
|
|
576
577
|
]));
|
|
577
578
|
}
|
|
578
|
-
}),
|
|
579
|
+
}), zn = /* @__PURE__ */ L({
|
|
579
580
|
__name: "InvoiceUpdateDialog",
|
|
580
581
|
props: {
|
|
581
582
|
customFieldDefinitions: {},
|
|
@@ -583,18 +584,18 @@ var Ln = /* @__PURE__ */ I({
|
|
|
583
584
|
},
|
|
584
585
|
emits: ["close"],
|
|
585
586
|
setup(e, { emit: t }) {
|
|
586
|
-
let n = e, r = t, i =
|
|
587
|
+
let n = e, r = t, i = k(), a = Q(), o = xn(), s = ze(), c = h(), l = g({ debounceMs: 250 }), u = Ln({ params: { search: l.debouncedSearch } }), d = j(() => u.result.value.match({
|
|
587
588
|
err: () => [],
|
|
588
589
|
loading: () => [],
|
|
589
590
|
ok: (e) => e.data
|
|
590
|
-
})), f =
|
|
591
|
+
})), f = Nn(j(() => n.invoice.customer.uuid)), p = j(() => {
|
|
591
592
|
let e = f.result.value;
|
|
592
593
|
if (e.isOk()) return e.getValue().defaultPaymentTermDays;
|
|
593
594
|
let t = s.result.value;
|
|
594
595
|
return t.isOk() ? t.getValue().defaultPaymentTermDays ?? 0 : 0;
|
|
595
596
|
}), m = $({
|
|
596
|
-
initialState:
|
|
597
|
-
schema:
|
|
597
|
+
initialState: j(() => v.toForm(n.invoice)),
|
|
598
|
+
schema: On,
|
|
598
599
|
onSubmit: async (e) => {
|
|
599
600
|
let t = await o.execute({
|
|
600
601
|
body: e,
|
|
@@ -605,70 +606,71 @@ var Ln = /* @__PURE__ */ I({
|
|
|
605
606
|
onSubmitError: () => {
|
|
606
607
|
a.unableToSave();
|
|
607
608
|
}
|
|
608
|
-
}), _ = m.register("issuedOn"), ee = m.register("dueOn"), te = m.register("deliveredOn"), y = m.register("poNumber"), ne = m.register("
|
|
609
|
-
get: () =>
|
|
609
|
+
}), _ = m.register("issuedOn"), ee = m.register("dueOn"), te = m.register("deliveredOn"), y = m.register("poNumber"), ne = m.register("reference"), re = m.register("preparedBy"), ie = m.register("subject"), ae = m.register("customFields"), b = j({
|
|
610
|
+
get: () => ae.modelValue.value ?? [],
|
|
610
611
|
set: (e) => {
|
|
611
|
-
|
|
612
|
+
ae.setValue(e);
|
|
612
613
|
}
|
|
613
614
|
});
|
|
614
|
-
function
|
|
615
|
+
function oe(e) {
|
|
615
616
|
e !== null && ee.setValue(e.add({ days: p.value }));
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
+
function se(e) {
|
|
618
619
|
l.updateSearch(e);
|
|
619
620
|
}
|
|
620
|
-
return (e, t) => (
|
|
621
|
-
form:
|
|
621
|
+
return (e, t) => (z(), M(V(X), {
|
|
622
|
+
form: V(m),
|
|
622
623
|
size: "sm",
|
|
623
624
|
onClose: t[1] ||= (e) => r("close")
|
|
624
625
|
}, {
|
|
625
|
-
default:
|
|
626
|
-
|
|
627
|
-
icon:
|
|
626
|
+
default: H(() => [
|
|
627
|
+
I(V(Y), {
|
|
628
|
+
icon: V(w),
|
|
628
629
|
"is-description-hidden": !0,
|
|
629
|
-
title:
|
|
630
|
+
title: V(i).t("wise_invoicing.invoice.detail.header.edit_info"),
|
|
630
631
|
description: ""
|
|
631
632
|
}, null, 8, ["icon", "title"]),
|
|
632
|
-
|
|
633
|
-
default:
|
|
634
|
-
default:
|
|
633
|
+
I(V(qt), null, {
|
|
634
|
+
default: H(() => [I(V(Zt), null, {
|
|
635
|
+
default: H(() => [I(V(Xt), {
|
|
635
636
|
lg: 2,
|
|
636
637
|
sm: 1
|
|
637
638
|
}, {
|
|
638
|
-
default:
|
|
639
|
-
|
|
640
|
-
label:
|
|
639
|
+
default: H(() => [
|
|
640
|
+
I(V(Ht), R(V(D)(V(_)), {
|
|
641
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.invoice_date"),
|
|
641
642
|
"is-required": !0,
|
|
642
|
-
"onUpdate:modelValue":
|
|
643
|
+
"onUpdate:modelValue": oe
|
|
643
644
|
}), null, 16, ["label"]),
|
|
644
|
-
|
|
645
|
-
label:
|
|
645
|
+
I(V(Ht), R(V(D)(V(ee)), {
|
|
646
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.due_date"),
|
|
646
647
|
"is-required": !0,
|
|
647
|
-
"min-date":
|
|
648
|
+
"min-date": V(_).modelValue.value
|
|
648
649
|
}), null, 16, ["label", "min-date"]),
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
field:
|
|
652
|
-
"is-loading":
|
|
650
|
+
V(c).isDeliveryDateVisible.value ? (z(), M(V(Ht), R({ key: 0 }, V(D)(V(te)), { label: V(i).t("wise_invoicing.invoice.detail.header.delivery_date") }), null, 16, ["label"])) : N("", !0),
|
|
651
|
+
I(Rn, {
|
|
652
|
+
field: V(re),
|
|
653
|
+
"is-loading": V(u).isLoading.value,
|
|
653
654
|
users: d.value,
|
|
654
|
-
onNextPage:
|
|
655
|
-
onUpdateSearch:
|
|
655
|
+
onNextPage: V(u).fetchNextPage,
|
|
656
|
+
onUpdateSearch: se
|
|
656
657
|
}, null, 8, [
|
|
657
658
|
"field",
|
|
658
659
|
"is-loading",
|
|
659
660
|
"users",
|
|
660
661
|
"onNextPage"
|
|
661
662
|
]),
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
663
|
+
I(V(sn), R(V(D)(V(y)), { label: V(i).t("wise_invoicing.invoice.detail.header.po_number") }), null, 16, ["label"]),
|
|
664
|
+
I(V(sn), R(V(D)(V(ne)), { label: V(i).t("wise_invoicing.invoice.detail.header.reference") }), null, 16, ["label"]),
|
|
665
|
+
I(V(sn), R(V(D)(V(ie)), {
|
|
666
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.subject"),
|
|
667
|
+
placeholder: V(i).t("wise_invoicing.invoice.detail.header.subject_placeholder")
|
|
666
668
|
}), null, 16, ["label", "placeholder"])
|
|
667
669
|
]),
|
|
668
670
|
_: 1
|
|
669
|
-
}),
|
|
670
|
-
modelValue:
|
|
671
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
671
|
+
}), I(Mn, {
|
|
672
|
+
modelValue: b.value,
|
|
673
|
+
"onUpdate:modelValue": t[0] ||= (e) => b.value = e,
|
|
672
674
|
currency: n.invoice.currency,
|
|
673
675
|
definitions: n.customFieldDefinitions,
|
|
674
676
|
"is-disabled": !0,
|
|
@@ -684,22 +686,22 @@ var Ln = /* @__PURE__ */ I({
|
|
|
684
686
|
})]),
|
|
685
687
|
_: 1
|
|
686
688
|
}),
|
|
687
|
-
|
|
688
|
-
right:
|
|
689
|
+
I(V(q), null, {
|
|
690
|
+
right: H(() => [I(V(J), { label: "cancel" }), I(V(Jt), { label: V(i).t("wise_invoicing.invoice.detail.header.edit_info") }, null, 8, ["label"])]),
|
|
689
691
|
_: 1
|
|
690
692
|
})
|
|
691
693
|
]),
|
|
692
694
|
_: 1
|
|
693
695
|
}, 8, ["form"]));
|
|
694
696
|
}
|
|
695
|
-
}),
|
|
697
|
+
}), Bn = /* @__PURE__ */ L({
|
|
696
698
|
__name: "InvoiceDetailSidebarInfoTab",
|
|
697
699
|
props: {
|
|
698
700
|
customFieldDefinitions: {},
|
|
699
701
|
invoice: {}
|
|
700
702
|
},
|
|
701
703
|
setup(e) {
|
|
702
|
-
let t = e, n =
|
|
704
|
+
let t = e, n = k(), r = E(), i = h(), a = mn().create(zn), o = j(() => t.invoice.isEditable), s = j(() => b.filterByEntityType(t.customFieldDefinitions, c.INVOICE)), l = j(() => le.listByDefinitions(t.customFieldDefinitions, t.invoice.customFields)), u = j(() => {
|
|
703
705
|
if (!t.invoice.isOverdue) return null;
|
|
704
706
|
let e = t.invoice.dueOn.toZonedDateTime(Nt.Now.timeZoneId()).toInstant();
|
|
705
707
|
return r.toRelativeTime(e);
|
|
@@ -713,52 +715,59 @@ var Ln = /* @__PURE__ */ I({
|
|
|
713
715
|
function f(e) {
|
|
714
716
|
return e === null ? "-" : r.formatPlainDate(e);
|
|
715
717
|
}
|
|
716
|
-
return (e, r) => (
|
|
717
|
-
default:
|
|
718
|
-
|
|
719
|
-
default:
|
|
720
|
-
|
|
721
|
-
default:
|
|
722
|
-
icon:
|
|
723
|
-
label:
|
|
724
|
-
}, null, 8, ["icon", "label"]),
|
|
718
|
+
return (e, r) => (z(), M(V(Ut), { class: "px-2xl py-xl" }, {
|
|
719
|
+
default: H(() => [
|
|
720
|
+
I(V(Wt), { label: V(n).t("wise_invoicing.invoice.detail.sidebar.general") }, vt({
|
|
721
|
+
default: H(() => [
|
|
722
|
+
I(V(W), null, {
|
|
723
|
+
default: H(() => [I(V(G), {
|
|
724
|
+
icon: V(Ce),
|
|
725
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.invoice_id")
|
|
726
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: t.invoice.sequence ?? "-" }, null, 8, ["text"])]),
|
|
727
|
+
_: 1
|
|
728
|
+
}),
|
|
729
|
+
I(V(W), null, {
|
|
730
|
+
default: H(() => [I(V(G), {
|
|
731
|
+
icon: V(Ee),
|
|
732
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.po_number")
|
|
733
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: t.invoice.poNumber ?? "-" }, null, 8, ["text"])]),
|
|
725
734
|
_: 1
|
|
726
735
|
}),
|
|
727
|
-
|
|
728
|
-
default:
|
|
729
|
-
icon:
|
|
730
|
-
label:
|
|
731
|
-
}, null, 8, ["icon", "label"]),
|
|
736
|
+
I(V(W), null, {
|
|
737
|
+
default: H(() => [I(V(G), {
|
|
738
|
+
icon: V(Ee),
|
|
739
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.reference")
|
|
740
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: t.invoice.reference ?? "-" }, null, 8, ["text"])]),
|
|
732
741
|
_: 1
|
|
733
742
|
}),
|
|
734
|
-
|
|
735
|
-
default:
|
|
736
|
-
icon:
|
|
737
|
-
label:
|
|
738
|
-
}, null, 8, ["icon", "label"]),
|
|
743
|
+
I(V(W), null, {
|
|
744
|
+
default: H(() => [I(V(G), {
|
|
745
|
+
icon: V(Oe),
|
|
746
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.issuer")
|
|
747
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: t.invoice.issuer.name ?? "-" }, null, 8, ["text"])]),
|
|
739
748
|
_: 1
|
|
740
749
|
}),
|
|
741
|
-
|
|
742
|
-
default:
|
|
743
|
-
icon:
|
|
744
|
-
label:
|
|
745
|
-
}, null, 8, ["icon", "label"]),
|
|
750
|
+
I(V(W), null, {
|
|
751
|
+
default: H(() => [I(V(G), {
|
|
752
|
+
icon: V(Te),
|
|
753
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.invoice_date")
|
|
754
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: f(t.invoice.issueOn) }, null, 8, ["text"])]),
|
|
746
755
|
_: 1
|
|
747
756
|
}),
|
|
748
|
-
|
|
749
|
-
default:
|
|
750
|
-
icon:
|
|
751
|
-
label:
|
|
757
|
+
I(V(W), null, {
|
|
758
|
+
default: H(() => [I(V(G), {
|
|
759
|
+
icon: V(ke),
|
|
760
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.due_date"),
|
|
752
761
|
variant: t.invoice.isOverdue ? "error" : "default"
|
|
753
762
|
}, null, 8, [
|
|
754
763
|
"icon",
|
|
755
764
|
"label",
|
|
756
765
|
"variant"
|
|
757
|
-
]),
|
|
758
|
-
default:
|
|
766
|
+
]), I(V(tn), { gap: "xs" }, {
|
|
767
|
+
default: H(() => [I(V(K), {
|
|
759
768
|
text: f(t.invoice.dueOn),
|
|
760
769
|
variant: t.invoice.isOverdue ? "error" : "default"
|
|
761
|
-
}, null, 8, ["text", "variant"]), u.value === null ?
|
|
770
|
+
}, null, 8, ["text", "variant"]), u.value === null ? N("", !0) : (z(), M(V(Ft), {
|
|
762
771
|
key: 0,
|
|
763
772
|
label: u.value,
|
|
764
773
|
color: "error",
|
|
@@ -769,18 +778,18 @@ var Ln = /* @__PURE__ */ I({
|
|
|
769
778
|
})]),
|
|
770
779
|
_: 1
|
|
771
780
|
}),
|
|
772
|
-
|
|
773
|
-
default:
|
|
774
|
-
icon:
|
|
775
|
-
label:
|
|
776
|
-
}, null, 8, ["icon", "label"]),
|
|
781
|
+
V(i).isDeliveryDateVisible.value ? (z(), M(V(W), { key: 0 }, {
|
|
782
|
+
default: H(() => [I(V(G), {
|
|
783
|
+
icon: V(x),
|
|
784
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.delivery_date")
|
|
785
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: f(t.invoice.deliveredOn) }, null, 8, ["text"])]),
|
|
777
786
|
_: 1
|
|
778
|
-
})) :
|
|
779
|
-
(
|
|
780
|
-
default:
|
|
781
|
-
icon:
|
|
782
|
-
label:
|
|
783
|
-
}, null, 8, ["icon", "label"]),
|
|
787
|
+
})) : N("", !0),
|
|
788
|
+
(z(!0), P(A, null, Ct(l.value, (e) => (z(), M(V(W), { key: e.definition.uuid }, {
|
|
789
|
+
default: H(() => [I(V(G), {
|
|
790
|
+
icon: V(Ze)[e.definition.type],
|
|
791
|
+
label: V(b).getLabel(e.definition, V(n).locale.value)
|
|
792
|
+
}, null, 8, ["icon", "label"]), I(ae, {
|
|
784
793
|
definition: e.definition,
|
|
785
794
|
value: e.value
|
|
786
795
|
}, null, 8, ["definition", "value"])]),
|
|
@@ -790,39 +799,39 @@ var Ln = /* @__PURE__ */ I({
|
|
|
790
799
|
_: 2
|
|
791
800
|
}, [o.value ? {
|
|
792
801
|
name: "actions",
|
|
793
|
-
fn:
|
|
794
|
-
icon:
|
|
795
|
-
label:
|
|
802
|
+
fn: H(() => [I(V($t), {
|
|
803
|
+
icon: V(fe),
|
|
804
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.edit_info"),
|
|
796
805
|
variant: "tertiary",
|
|
797
806
|
onClick: d
|
|
798
807
|
}, null, 8, ["icon", "label"])]),
|
|
799
808
|
key: "0"
|
|
800
809
|
} : void 0]), 1032, ["label"]),
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
label:
|
|
810
|
+
I(et, { "original-invoice": t.invoice.originalInvoice }, null, 8, ["original-invoice"]),
|
|
811
|
+
I(V(Gt)),
|
|
812
|
+
I(V(Wt), {
|
|
813
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.bill_to"),
|
|
805
814
|
"collapse-options": {
|
|
806
815
|
isCollapsible: !0,
|
|
807
816
|
isOpenByDefault: !0,
|
|
808
817
|
badge: { label: t.invoice.customer.name ?? "-" }
|
|
809
818
|
}
|
|
810
819
|
}, {
|
|
811
|
-
default:
|
|
812
|
-
default:
|
|
813
|
-
|
|
820
|
+
default: H(() => [I(V(W), { orientation: "vertical" }, {
|
|
821
|
+
default: H(() => [
|
|
822
|
+
I(V(Z), {
|
|
814
823
|
text: t.invoice.customer.name ?? "-",
|
|
815
824
|
class: "text-xs font-medium text-primary"
|
|
816
825
|
}, null, 8, ["text"]),
|
|
817
|
-
t.invoice.customer.address ? (
|
|
818
|
-
text:
|
|
826
|
+
t.invoice.customer.address ? (z(), P(A, { key: 0 }, [I(V(Z), {
|
|
827
|
+
text: V(ne).formatLines(t.invoice.customer.address)[0] ?? "",
|
|
819
828
|
class: "text-xs text-primary"
|
|
820
|
-
}, null, 8, ["text"]), t.invoice.customer.address ? (
|
|
829
|
+
}, null, 8, ["text"]), t.invoice.customer.address ? (z(), M(V(Z), {
|
|
821
830
|
key: 0,
|
|
822
|
-
text:
|
|
831
|
+
text: V(ne).formatLines(t.invoice.customer.address)[1] ?? "",
|
|
823
832
|
class: "text-xs text-primary"
|
|
824
|
-
}, null, 8, ["text"])) :
|
|
825
|
-
t.invoice.recipient === null ?
|
|
833
|
+
}, null, 8, ["text"])) : N("", !0)], 64)) : N("", !0),
|
|
834
|
+
t.invoice.recipient === null ? N("", !0) : (z(), M(V(Z), {
|
|
826
835
|
key: 1,
|
|
827
836
|
text: t.invoice.recipient.email ?? "",
|
|
828
837
|
class: "text-xs text-primary"
|
|
@@ -832,20 +841,20 @@ var Ln = /* @__PURE__ */ I({
|
|
|
832
841
|
})]),
|
|
833
842
|
_: 1
|
|
834
843
|
}, 8, ["label", "collapse-options"]),
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
label:
|
|
844
|
+
I(V(Gt)),
|
|
845
|
+
I(V(Wt), {
|
|
846
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.bill_from"),
|
|
838
847
|
"collapse-options": {
|
|
839
848
|
isCollapsible: !0,
|
|
840
849
|
isOpenByDefault: !1,
|
|
841
850
|
badge: { label: t.invoice.issuer.email ?? "-" }
|
|
842
851
|
}
|
|
843
852
|
}, {
|
|
844
|
-
default:
|
|
845
|
-
default:
|
|
853
|
+
default: H(() => [I(V(W), { orientation: "vertical" }, {
|
|
854
|
+
default: H(() => [I(V(G), { label: t.invoice.issuer.email ?? "-" }, null, 8, ["label"]), t.invoice.issuer.address ? (z(), M(V(K), {
|
|
846
855
|
key: 0,
|
|
847
|
-
text:
|
|
848
|
-
}, null, 8, ["text"])) :
|
|
856
|
+
text: V(ne).format(t.invoice.issuer.address)
|
|
857
|
+
}, null, 8, ["text"])) : N("", !0)]),
|
|
849
858
|
_: 1
|
|
850
859
|
})]),
|
|
851
860
|
_: 1
|
|
@@ -854,20 +863,20 @@ var Ln = /* @__PURE__ */ I({
|
|
|
854
863
|
_: 1
|
|
855
864
|
}));
|
|
856
865
|
}
|
|
857
|
-
}),
|
|
866
|
+
}), Vn = /* @__PURE__ */ L({
|
|
858
867
|
__name: "InvoiceDetailSidebar",
|
|
859
868
|
props: {
|
|
860
869
|
customFieldDefinitions: {},
|
|
861
870
|
invoice: {}
|
|
862
871
|
},
|
|
863
872
|
setup(e) {
|
|
864
|
-
let t = e, n =
|
|
865
|
-
return (e, n) => (
|
|
873
|
+
let t = e, n = k(), r = E(), i = j(() => n.t("wise_invoicing.invoice.detail.sidebar.updated_on", { date: r.toDateTime(t.invoice.updatedAt) }));
|
|
874
|
+
return (e, n) => (z(), M(rt, {
|
|
866
875
|
"billing-document": t.invoice,
|
|
867
876
|
"updated-footer": i.value
|
|
868
877
|
}, {
|
|
869
|
-
activity:
|
|
870
|
-
info:
|
|
878
|
+
activity: H(() => [I(jn, { invoice: t.invoice }, null, 8, ["invoice"])]),
|
|
879
|
+
info: H(() => [I(Bn, {
|
|
871
880
|
"custom-field-definitions": t.customFieldDefinitions,
|
|
872
881
|
invoice: t.invoice
|
|
873
882
|
}, null, 8, ["custom-field-definitions", "invoice"])]),
|
|
@@ -877,7 +886,7 @@ var Ln = /* @__PURE__ */ I({
|
|
|
877
886
|
});
|
|
878
887
|
//#endregion
|
|
879
888
|
//#region src/modules/invoice/api/queries/invoicePaymentIndex.query.ts
|
|
880
|
-
function
|
|
889
|
+
function Hn(e) {
|
|
881
890
|
return At("invoicePaymentIndex", {
|
|
882
891
|
params: { invoiceUuid: e },
|
|
883
892
|
queryFn: () => y.getPayments(e.value)
|
|
@@ -885,49 +894,49 @@ function Vn(e) {
|
|
|
885
894
|
}
|
|
886
895
|
//#endregion
|
|
887
896
|
//#region src/modules/invoice/use-cases/detail/components/table/InvoiceDetailPaymentActionsCell.vue
|
|
888
|
-
var
|
|
897
|
+
var Un = /* @__PURE__ */ L({
|
|
889
898
|
__name: "InvoiceDetailPaymentActionsCell",
|
|
890
899
|
props: {
|
|
891
900
|
payment: {},
|
|
892
901
|
onDelete: { type: Function }
|
|
893
902
|
},
|
|
894
903
|
setup(e) {
|
|
895
|
-
let t = e, n =
|
|
896
|
-
return (e, r) => (
|
|
897
|
-
default:
|
|
898
|
-
default:
|
|
904
|
+
let t = e, n = k();
|
|
905
|
+
return (e, r) => (z(), M(V(an), null, {
|
|
906
|
+
default: H(() => [I(V(on), null, {
|
|
907
|
+
default: H(() => [t.payment.source === V(i).MANUAL ? (z(), M(V($t), {
|
|
899
908
|
key: 0,
|
|
900
|
-
label:
|
|
901
|
-
icon:
|
|
909
|
+
label: V(n).t("wise_invoicing.invoice.detail.payments.delete.title"),
|
|
910
|
+
icon: V(ye),
|
|
902
911
|
size: "sm",
|
|
903
912
|
variant: "tertiary",
|
|
904
913
|
onClick: r[0] ||= (e) => t.onDelete(t.payment)
|
|
905
|
-
}, null, 8, ["label", "icon"])) :
|
|
914
|
+
}, null, 8, ["label", "icon"])) : N("", !0)]),
|
|
906
915
|
_: 1
|
|
907
916
|
})]),
|
|
908
917
|
_: 1
|
|
909
918
|
}));
|
|
910
919
|
}
|
|
911
|
-
}),
|
|
920
|
+
}), Wn = /* @__PURE__ */ L({
|
|
912
921
|
__name: "InvoiceDetailPaymentManualCell",
|
|
913
922
|
props: { payment: {} },
|
|
914
923
|
setup(e) {
|
|
915
924
|
let t = e;
|
|
916
|
-
return (e, n) => (
|
|
917
|
-
default:
|
|
925
|
+
return (e, n) => (z(), M(V(an), null, {
|
|
926
|
+
default: H(() => [t.payment.source === V(i).MANUAL ? (z(), M(V(we), {
|
|
918
927
|
key: 0,
|
|
919
928
|
class: "size-4 text-brand-600"
|
|
920
|
-
})) :
|
|
929
|
+
})) : N("", !0)]),
|
|
921
930
|
_: 1
|
|
922
931
|
}));
|
|
923
932
|
}
|
|
924
|
-
}),
|
|
933
|
+
}), Gn = /* @__PURE__ */ L({
|
|
925
934
|
__name: "InvoiceDetailPaymentsTableTextCell",
|
|
926
935
|
props: { text: {} },
|
|
927
936
|
setup(e) {
|
|
928
937
|
let t = e;
|
|
929
|
-
return (e, n) => (
|
|
930
|
-
default:
|
|
938
|
+
return (e, n) => (z(), M(V(an), null, {
|
|
939
|
+
default: H(() => [I(V(Z), {
|
|
931
940
|
text: t.text ?? "-",
|
|
932
941
|
class: "text-sm/5 text-primary"
|
|
933
942
|
}, null, 8, ["text"])]),
|
|
@@ -937,9 +946,9 @@ var Hn = /* @__PURE__ */ I({
|
|
|
937
946
|
});
|
|
938
947
|
//#endregion
|
|
939
948
|
//#region src/modules/invoice/use-cases/detail/composables/invoiceDetailPaymentsTableColumns.composable.ts
|
|
940
|
-
function
|
|
941
|
-
let t =
|
|
942
|
-
return
|
|
949
|
+
function Kn(e) {
|
|
950
|
+
let t = k(), n = E(), r = p();
|
|
951
|
+
return j(() => pn()([
|
|
943
952
|
{
|
|
944
953
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.date"),
|
|
945
954
|
key: "date",
|
|
@@ -947,7 +956,7 @@ function Gn(e) {
|
|
|
947
956
|
max: "12rem",
|
|
948
957
|
min: "12rem"
|
|
949
958
|
},
|
|
950
|
-
component: (e) =>
|
|
959
|
+
component: (e) => dn(Gn, { text: n.formatPlainDate(e.date) })
|
|
951
960
|
},
|
|
952
961
|
{
|
|
953
962
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.reference"),
|
|
@@ -956,7 +965,7 @@ function Gn(e) {
|
|
|
956
965
|
max: "14rem",
|
|
957
966
|
min: "12rem"
|
|
958
967
|
},
|
|
959
|
-
component: (e) =>
|
|
968
|
+
component: (e) => dn(Gn, { text: e.paymentReference ?? "—" })
|
|
960
969
|
},
|
|
961
970
|
{
|
|
962
971
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.remark"),
|
|
@@ -965,7 +974,7 @@ function Gn(e) {
|
|
|
965
974
|
max: "1fr",
|
|
966
975
|
min: "12rem"
|
|
967
976
|
},
|
|
968
|
-
component: (e) =>
|
|
977
|
+
component: (e) => dn(Gn, { text: e.remarks ?? "—" })
|
|
969
978
|
},
|
|
970
979
|
{
|
|
971
980
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.manual"),
|
|
@@ -974,7 +983,7 @@ function Gn(e) {
|
|
|
974
983
|
max: "6rem",
|
|
975
984
|
min: "6rem"
|
|
976
985
|
},
|
|
977
|
-
component: (e) =>
|
|
986
|
+
component: (e) => dn(Wn, { payment: e })
|
|
978
987
|
},
|
|
979
988
|
{
|
|
980
989
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.amount"),
|
|
@@ -983,7 +992,7 @@ function Gn(e) {
|
|
|
983
992
|
max: "10rem",
|
|
984
993
|
min: "10rem"
|
|
985
994
|
},
|
|
986
|
-
component: (e) =>
|
|
995
|
+
component: (e) => dn(Gn, { text: r.formatMonetary(e.amount) })
|
|
987
996
|
},
|
|
988
997
|
{
|
|
989
998
|
headerLabel: "",
|
|
@@ -992,7 +1001,7 @@ function Gn(e) {
|
|
|
992
1001
|
max: "5rem",
|
|
993
1002
|
min: "5rem"
|
|
994
1003
|
},
|
|
995
|
-
component: (t) =>
|
|
1004
|
+
component: (t) => dn(Un, {
|
|
996
1005
|
payment: t,
|
|
997
1006
|
onDelete: e.onDelete
|
|
998
1007
|
})
|
|
@@ -1001,8 +1010,8 @@ function Gn(e) {
|
|
|
1001
1010
|
}
|
|
1002
1011
|
//#endregion
|
|
1003
1012
|
//#region src/modules/invoice/api/mutations/invoicePaymentCreate.mutation.ts
|
|
1004
|
-
function
|
|
1005
|
-
return
|
|
1013
|
+
function qn() {
|
|
1014
|
+
return U({
|
|
1006
1015
|
queryFn: (e) => y.createPayment(e.params.invoiceUuid, e.body),
|
|
1007
1016
|
queryKeysToInvalidate: {
|
|
1008
1017
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1014,19 +1023,19 @@ function Kn() {
|
|
|
1014
1023
|
}
|
|
1015
1024
|
//#endregion
|
|
1016
1025
|
//#region src/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.ts
|
|
1017
|
-
var
|
|
1018
|
-
amount:
|
|
1019
|
-
currency:
|
|
1026
|
+
var Jn = O.object({
|
|
1027
|
+
amount: O.number().positive(),
|
|
1028
|
+
currency: O.enum(s),
|
|
1020
1029
|
date: te,
|
|
1021
|
-
paymentReference:
|
|
1022
|
-
precision:
|
|
1023
|
-
remarks:
|
|
1024
|
-
}),
|
|
1030
|
+
paymentReference: O.string().nullable(),
|
|
1031
|
+
precision: O.number().int().nonnegative(),
|
|
1032
|
+
remarks: O.string().nullable()
|
|
1033
|
+
}), Yn = { class: "pr-md text-xs text-secondary" }, Xn = /* @__PURE__ */ L({
|
|
1025
1034
|
__name: "InvoicePaymentCreateDialog",
|
|
1026
1035
|
props: { invoice: {} },
|
|
1027
1036
|
emits: ["close"],
|
|
1028
1037
|
setup(e, { emit: t }) {
|
|
1029
|
-
let n = e, r = t, i =
|
|
1038
|
+
let n = e, r = t, i = k(), a = Q(), o = p(), s = qn(), c = j(() => o.getSymbol(n.invoice.grossAmount.currency)), l = j(() => m(1, n.invoice.grossAmount.precision)), u = $({
|
|
1030
1039
|
initialState: {
|
|
1031
1040
|
amount: null,
|
|
1032
1041
|
currency: n.invoice.grossAmount.currency,
|
|
@@ -1035,7 +1044,7 @@ var qn = D.object({
|
|
|
1035
1044
|
precision: n.invoice.grossAmount.precision,
|
|
1036
1045
|
remarks: null
|
|
1037
1046
|
},
|
|
1038
|
-
schema:
|
|
1047
|
+
schema: Jn,
|
|
1039
1048
|
onSubmit: async (e) => {
|
|
1040
1049
|
let t = await s.execute({
|
|
1041
1050
|
body: e,
|
|
@@ -1047,47 +1056,47 @@ var qn = D.object({
|
|
|
1047
1056
|
a.unableToSave();
|
|
1048
1057
|
}
|
|
1049
1058
|
}), d = u.register("amount"), f = u.register("date"), h = u.register("paymentReference"), g = u.register("remarks");
|
|
1050
|
-
return (e, t) => (
|
|
1051
|
-
form:
|
|
1059
|
+
return (e, t) => (z(), M(V(X), {
|
|
1060
|
+
form: V(u),
|
|
1052
1061
|
size: "sm",
|
|
1053
1062
|
onClose: t[0] ||= (e) => r("close")
|
|
1054
1063
|
}, {
|
|
1055
|
-
default:
|
|
1056
|
-
|
|
1057
|
-
title:
|
|
1058
|
-
description:
|
|
1059
|
-
icon:
|
|
1064
|
+
default: H(() => [
|
|
1065
|
+
I(V(Y), {
|
|
1066
|
+
title: V(i).t("wise_invoicing.invoice.detail.payments.create.title"),
|
|
1067
|
+
description: V(i).t("wise_invoicing.invoice.detail.payments.create.description"),
|
|
1068
|
+
icon: V(me)
|
|
1060
1069
|
}, null, 8, [
|
|
1061
1070
|
"title",
|
|
1062
1071
|
"description",
|
|
1063
1072
|
"icon"
|
|
1064
1073
|
]),
|
|
1065
|
-
|
|
1066
|
-
default:
|
|
1067
|
-
default:
|
|
1074
|
+
I(V(qt), null, {
|
|
1075
|
+
default: H(() => [I(V(Zt), null, {
|
|
1076
|
+
default: H(() => [I(V(Xt), {
|
|
1068
1077
|
lg: 2,
|
|
1069
1078
|
sm: 1
|
|
1070
1079
|
}, {
|
|
1071
|
-
default:
|
|
1072
|
-
|
|
1080
|
+
default: H(() => [
|
|
1081
|
+
I(V(en), R(V(D)(V(d)), {
|
|
1073
1082
|
"is-required": !0,
|
|
1074
|
-
label:
|
|
1083
|
+
label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.amount"),
|
|
1075
1084
|
min: l.value,
|
|
1076
1085
|
step: l.value
|
|
1077
1086
|
}), {
|
|
1078
|
-
right:
|
|
1087
|
+
right: H(() => [F("span", Yn, B(c.value.symbol), 1)]),
|
|
1079
1088
|
_: 1
|
|
1080
1089
|
}, 16, [
|
|
1081
1090
|
"label",
|
|
1082
1091
|
"min",
|
|
1083
1092
|
"step"
|
|
1084
1093
|
]),
|
|
1085
|
-
|
|
1094
|
+
I(V(Ht), R(V(D)(V(f)), {
|
|
1086
1095
|
"is-required": !0,
|
|
1087
|
-
label:
|
|
1096
|
+
label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.date")
|
|
1088
1097
|
}), null, 16, ["label"]),
|
|
1089
|
-
|
|
1090
|
-
|
|
1098
|
+
I(V(sn), R(V(D)(V(h)), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.reference") }), null, 16, ["label"]),
|
|
1099
|
+
I(V(sn), R(V(D)(V(g)), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.remarks") }), null, 16, ["label"])
|
|
1091
1100
|
]),
|
|
1092
1101
|
_: 1
|
|
1093
1102
|
})]),
|
|
@@ -1095,8 +1104,8 @@ var qn = D.object({
|
|
|
1095
1104
|
})]),
|
|
1096
1105
|
_: 1
|
|
1097
1106
|
}),
|
|
1098
|
-
|
|
1099
|
-
right:
|
|
1107
|
+
I(V(q), null, {
|
|
1108
|
+
right: H(() => [I(V(J)), I(V(Qt), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.submit") }, null, 8, ["label"])]),
|
|
1100
1109
|
_: 1
|
|
1101
1110
|
})
|
|
1102
1111
|
]),
|
|
@@ -1106,8 +1115,8 @@ var qn = D.object({
|
|
|
1106
1115
|
});
|
|
1107
1116
|
//#endregion
|
|
1108
1117
|
//#region src/modules/invoice/api/mutations/invoicePaymentDelete.mutation.ts
|
|
1109
|
-
function
|
|
1110
|
-
return
|
|
1118
|
+
function Zn() {
|
|
1119
|
+
return U({
|
|
1111
1120
|
queryFn: (e) => y.deletePayment(e.params.invoiceUuid, e.params.paymentUuid),
|
|
1112
1121
|
queryKeysToInvalidate: {
|
|
1113
1122
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1119,7 +1128,7 @@ function Xn() {
|
|
|
1119
1128
|
}
|
|
1120
1129
|
//#endregion
|
|
1121
1130
|
//#region src/modules/invoice/use-cases/detail/dialogs/InvoicePaymentDeleteDialog.vue
|
|
1122
|
-
var
|
|
1131
|
+
var Qn = /* @__PURE__ */ L({
|
|
1123
1132
|
__name: "InvoicePaymentDeleteDialog",
|
|
1124
1133
|
props: {
|
|
1125
1134
|
invoiceUuid: {},
|
|
@@ -1127,7 +1136,7 @@ var Zn = /* @__PURE__ */ I({
|
|
|
1127
1136
|
},
|
|
1128
1137
|
emits: ["close"],
|
|
1129
1138
|
setup(e, { emit: t }) {
|
|
1130
|
-
let n = e, r = t, i =
|
|
1139
|
+
let n = e, r = t, i = k(), a = Q(), o = p(), s = Zn(), c = j(() => o.formatMonetary(n.payment.amount)), l = $({
|
|
1131
1140
|
schema: _t.object({}),
|
|
1132
1141
|
onSubmit: async () => {
|
|
1133
1142
|
let e = await s.execute({ params: {
|
|
@@ -1137,37 +1146,37 @@ var Zn = /* @__PURE__ */ I({
|
|
|
1137
1146
|
e.isErr() ? a.apiError(e.error) : (a.show({ message: i.t("wise_invoicing.invoice.detail.payments.delete.success", { amount: c.value }) }), r("close"));
|
|
1138
1147
|
}
|
|
1139
1148
|
});
|
|
1140
|
-
return (e, t) => (
|
|
1141
|
-
form:
|
|
1149
|
+
return (e, t) => (z(), M(V(X), {
|
|
1150
|
+
form: V(l),
|
|
1142
1151
|
size: "xs",
|
|
1143
1152
|
onClose: t[0] ||= (e) => r("close")
|
|
1144
1153
|
}, {
|
|
1145
|
-
default:
|
|
1146
|
-
title:
|
|
1147
|
-
description:
|
|
1148
|
-
}, null, 8, ["title", "description"]),
|
|
1149
|
-
right:
|
|
1154
|
+
default: H(() => [I(V(Y), {
|
|
1155
|
+
title: V(i).t("wise_invoicing.invoice.detail.payments.delete.title"),
|
|
1156
|
+
description: V(i).t("wise_invoicing.invoice.detail.payments.delete.description", { amount: c.value })
|
|
1157
|
+
}, null, 8, ["title", "description"]), I(V(q), null, {
|
|
1158
|
+
right: H(() => [I(V(J)), I(V(Jt), {
|
|
1150
1159
|
"is-destructive": !0,
|
|
1151
|
-
label:
|
|
1160
|
+
label: V(i).t("wise_invoicing.invoice.detail.payments.delete.submit")
|
|
1152
1161
|
}, null, 8, ["label"])]),
|
|
1153
1162
|
_: 1
|
|
1154
1163
|
})]),
|
|
1155
1164
|
_: 1
|
|
1156
1165
|
}, 8, ["form"]));
|
|
1157
1166
|
}
|
|
1158
|
-
}),
|
|
1167
|
+
}), $n = /* @__PURE__ */ L({
|
|
1159
1168
|
__name: "InvoiceDetailPaymentsSection",
|
|
1160
1169
|
props: { invoice: {} },
|
|
1161
1170
|
setup(e) {
|
|
1162
|
-
let t = e, n =
|
|
1171
|
+
let t = e, n = k(), r = p(), i = j(() => t.invoice.uuid), a = j(() => t.invoice.balanceDueAmount === null ? null : r.formatMonetary(t.invoice.balanceDueAmount)), { isLoading: o, result: s } = Hn(i), c = mn(), l = c.create(Xn), u = c.create(Qn), d = j(() => s.value.match({
|
|
1163
1172
|
err: () => [],
|
|
1164
1173
|
loading: () => [],
|
|
1165
1174
|
ok: (e) => e
|
|
1166
|
-
})), f =
|
|
1175
|
+
})), f = j(() => s.value.match({
|
|
1167
1176
|
err: (e) => e,
|
|
1168
1177
|
loading: () => null,
|
|
1169
1178
|
ok: () => null
|
|
1170
|
-
})), m =
|
|
1179
|
+
})), m = j(() => !re.getMetadata(t.invoice.status).isTerminal);
|
|
1171
1180
|
function h() {
|
|
1172
1181
|
l.open({ invoice: t.invoice });
|
|
1173
1182
|
}
|
|
@@ -1177,49 +1186,49 @@ var Zn = /* @__PURE__ */ I({
|
|
|
1177
1186
|
payment: e
|
|
1178
1187
|
});
|
|
1179
1188
|
}
|
|
1180
|
-
let _ =
|
|
1181
|
-
return (e, t) => (
|
|
1182
|
-
default:
|
|
1189
|
+
let _ = Kn({ onDelete: g });
|
|
1190
|
+
return (e, t) => (z(), M(at, null, {
|
|
1191
|
+
default: H(() => [I(V(tn), {
|
|
1183
1192
|
justify: "between",
|
|
1184
1193
|
class: "w-full gap-lg border-b border-secondary px-lg py-md"
|
|
1185
1194
|
}, {
|
|
1186
|
-
default:
|
|
1187
|
-
default:
|
|
1188
|
-
text:
|
|
1195
|
+
default: H(() => [I(V(tn), { gap: "sm" }, {
|
|
1196
|
+
default: H(() => [I(V(Z), {
|
|
1197
|
+
text: V(n).t("wise_invoicing.invoice.detail.payments.title"),
|
|
1189
1198
|
as: "h2",
|
|
1190
1199
|
class: "text-sm font-semibold text-primary"
|
|
1191
|
-
}, null, 8, ["text"]), a.value === null ?
|
|
1200
|
+
}, null, 8, ["text"]), a.value === null ? N("", !0) : (z(), M(V(Ft), {
|
|
1192
1201
|
key: 0,
|
|
1193
1202
|
color: "gray",
|
|
1194
1203
|
size: "sm",
|
|
1195
1204
|
variant: "outline"
|
|
1196
1205
|
}, {
|
|
1197
|
-
default:
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1206
|
+
default: H(() => [
|
|
1207
|
+
I(V(It), { label: V(n).t("wise_invoicing.invoice.detail.payments.balance_due") }, null, 8, ["label"]),
|
|
1208
|
+
I(V(Lt)),
|
|
1209
|
+
I(V(It), { label: a.value }, null, 8, ["label"])
|
|
1201
1210
|
]),
|
|
1202
1211
|
_: 1
|
|
1203
1212
|
}))]),
|
|
1204
1213
|
_: 1
|
|
1205
|
-
}), m.value ? (
|
|
1214
|
+
}), m.value ? (z(), M(V(Rt), {
|
|
1206
1215
|
key: 0,
|
|
1207
|
-
label:
|
|
1208
|
-
"icon-left":
|
|
1216
|
+
label: V(n).t("wise_invoicing.invoice.detail.payments.add"),
|
|
1217
|
+
"icon-left": V(S),
|
|
1209
1218
|
size: "sm",
|
|
1210
1219
|
onClick: h
|
|
1211
|
-
}, null, 8, ["label", "icon-left"])) :
|
|
1220
|
+
}, null, 8, ["label", "icon-left"])) : N("", !0)]),
|
|
1212
1221
|
_: 1
|
|
1213
|
-
}),
|
|
1222
|
+
}), I(V(rn), {
|
|
1214
1223
|
"active-filter-count": 0,
|
|
1215
|
-
columns:
|
|
1224
|
+
columns: V(_),
|
|
1216
1225
|
data: d.value,
|
|
1217
1226
|
error: f.value,
|
|
1218
1227
|
"get-key": (e) => e.uuid,
|
|
1219
1228
|
"has-active-search": !1,
|
|
1220
1229
|
"header-actions": [],
|
|
1221
1230
|
"is-fetching-next-page": !1,
|
|
1222
|
-
"is-loading":
|
|
1231
|
+
"is-loading": V(o)
|
|
1223
1232
|
}, null, 8, [
|
|
1224
1233
|
"columns",
|
|
1225
1234
|
"data",
|
|
@@ -1233,40 +1242,40 @@ var Zn = /* @__PURE__ */ I({
|
|
|
1233
1242
|
});
|
|
1234
1243
|
//#endregion
|
|
1235
1244
|
//#region src/modules/invoice/api/mutations/invoiceUpdateLines.mutation.ts
|
|
1236
|
-
function
|
|
1237
|
-
return
|
|
1245
|
+
function er() {
|
|
1246
|
+
return U({
|
|
1238
1247
|
queryFn: (e) => y.updateLines(e.params.invoiceUuid, e.body),
|
|
1239
1248
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
1240
1249
|
});
|
|
1241
1250
|
}
|
|
1242
1251
|
//#endregion
|
|
1243
1252
|
//#region src/modules/invoice/api/mutations/invoiceApplyDiscount.mutation.ts
|
|
1244
|
-
function
|
|
1245
|
-
return
|
|
1253
|
+
function tr() {
|
|
1254
|
+
return U({
|
|
1246
1255
|
queryFn: (e) => y.applyDiscount(e.params.invoiceUuid, e.body),
|
|
1247
1256
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
1248
1257
|
});
|
|
1249
1258
|
}
|
|
1250
1259
|
//#endregion
|
|
1251
1260
|
//#region src/modules/invoice/models/invoice/update/invoiceApplyDiscountForm.model.ts
|
|
1252
|
-
var
|
|
1253
|
-
currency:
|
|
1254
|
-
precision:
|
|
1255
|
-
type:
|
|
1256
|
-
value:
|
|
1257
|
-
}).refine((e) => e.type !== l.PERCENTAGE || e.value <= 100, { path: ["value"] }),
|
|
1261
|
+
var nr = O.object({
|
|
1262
|
+
currency: O.enum(s),
|
|
1263
|
+
precision: O.number().int().nonnegative(),
|
|
1264
|
+
type: O.enum(l),
|
|
1265
|
+
value: O.number()
|
|
1266
|
+
}).refine((e) => e.type !== l.PERCENTAGE || e.value <= 100, { path: ["value"] }), rr = { class: "pr-md text-xs text-secondary" }, ir = /* @__PURE__ */ L({
|
|
1258
1267
|
__name: "InvoiceApplyDiscountDialog",
|
|
1259
1268
|
props: { invoice: {} },
|
|
1260
1269
|
emits: ["close"],
|
|
1261
1270
|
setup(e, { emit: t }) {
|
|
1262
|
-
let n = e, r = t, i =
|
|
1271
|
+
let n = e, r = t, i = k(), a = Q(), o = p(), s = tr(), c = j(() => fn([l.PERCENTAGE, l.AMOUNT])), u = $({
|
|
1263
1272
|
initialState: {
|
|
1264
1273
|
currency: n.invoice.grossAmount.currency,
|
|
1265
1274
|
precision: n.invoice.grossAmount.precision,
|
|
1266
1275
|
type: l.PERCENTAGE,
|
|
1267
1276
|
value: null
|
|
1268
1277
|
},
|
|
1269
|
-
schema:
|
|
1278
|
+
schema: nr,
|
|
1270
1279
|
onSubmit: async (e) => {
|
|
1271
1280
|
let t = await s.execute({
|
|
1272
1281
|
body: e,
|
|
@@ -1277,58 +1286,58 @@ var tr = D.object({
|
|
|
1277
1286
|
onSubmitError: () => {
|
|
1278
1287
|
a.unableToSave();
|
|
1279
1288
|
}
|
|
1280
|
-
}), d = u.register("value"), f = u.register("type"), m =
|
|
1289
|
+
}), d = u.register("value"), f = u.register("type"), m = j(() => f.modelValue.value === l.PERCENTAGE), h = j(() => f.modelValue.value === l.AMOUNT), g = j(() => o.getSymbol(n.invoice.grossAmount.currency));
|
|
1281
1290
|
function _(e) {
|
|
1282
1291
|
return i.t(`wise_invoicing.invoice.detail.global_discount.type.${e}`);
|
|
1283
1292
|
}
|
|
1284
|
-
return (e, t) => (
|
|
1285
|
-
form:
|
|
1293
|
+
return (e, t) => (z(), M(V(X), {
|
|
1294
|
+
form: V(u),
|
|
1286
1295
|
size: "sm",
|
|
1287
1296
|
onClose: t[0] ||= (e) => r("close")
|
|
1288
1297
|
}, {
|
|
1289
|
-
default:
|
|
1290
|
-
|
|
1291
|
-
title:
|
|
1292
|
-
description:
|
|
1293
|
-
icon:
|
|
1298
|
+
default: H(() => [
|
|
1299
|
+
I(V(Y), {
|
|
1300
|
+
title: V(i).t("wise_invoicing.invoice.detail.line_items.global_discount"),
|
|
1301
|
+
description: V(i).t("wise_invoicing.invoice.detail.global_discount.description"),
|
|
1302
|
+
icon: V(De)
|
|
1294
1303
|
}, null, 8, [
|
|
1295
1304
|
"title",
|
|
1296
1305
|
"description",
|
|
1297
1306
|
"icon"
|
|
1298
1307
|
]),
|
|
1299
|
-
|
|
1300
|
-
default:
|
|
1301
|
-
default:
|
|
1308
|
+
I(V(qt), null, {
|
|
1309
|
+
default: H(() => [I(V(Zt), null, {
|
|
1310
|
+
default: H(() => [I(V(Xt), {
|
|
1302
1311
|
lg: 2,
|
|
1303
1312
|
sm: 1
|
|
1304
1313
|
}, {
|
|
1305
|
-
default:
|
|
1306
|
-
|
|
1314
|
+
default: H(() => [
|
|
1315
|
+
I(V(nn), R(V(D)(V(f)), {
|
|
1307
1316
|
"display-fn": _,
|
|
1308
1317
|
"is-required": !0,
|
|
1309
1318
|
items: c.value,
|
|
1310
|
-
label:
|
|
1319
|
+
label: V(i).t("wise_invoicing.invoice.detail.global_discount.type.label")
|
|
1311
1320
|
}), null, 16, ["items", "label"]),
|
|
1312
|
-
m.value ? (
|
|
1313
|
-
hint:
|
|
1321
|
+
m.value ? (z(), M(V(en), R({ key: 0 }, V(D)(V(d)), {
|
|
1322
|
+
hint: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.hint"),
|
|
1314
1323
|
"is-required": !0,
|
|
1315
|
-
label:
|
|
1324
|
+
label: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
|
|
1316
1325
|
max: 100,
|
|
1317
1326
|
min: 0,
|
|
1318
1327
|
step: .01
|
|
1319
1328
|
}), {
|
|
1320
|
-
right:
|
|
1329
|
+
right: H(() => [...t[1] ||= [F("span", { class: "pr-md text-xs text-secondary" }, " % ", -1)]]),
|
|
1321
1330
|
_: 1
|
|
1322
|
-
}, 16, ["hint", "label"])) :
|
|
1323
|
-
h.value ? (
|
|
1331
|
+
}, 16, ["hint", "label"])) : N("", !0),
|
|
1332
|
+
h.value ? (z(), M(V(en), R({ key: 1 }, V(D)(V(d)), {
|
|
1324
1333
|
"is-required": !0,
|
|
1325
|
-
label:
|
|
1334
|
+
label: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
|
|
1326
1335
|
min: .01,
|
|
1327
1336
|
step: .01
|
|
1328
1337
|
}), {
|
|
1329
|
-
right:
|
|
1338
|
+
right: H(() => [F("span", rr, B(g.value.symbol), 1)]),
|
|
1330
1339
|
_: 1
|
|
1331
|
-
}, 16, ["label"])) :
|
|
1340
|
+
}, 16, ["label"])) : N("", !0)
|
|
1332
1341
|
]),
|
|
1333
1342
|
_: 1
|
|
1334
1343
|
})]),
|
|
@@ -1336,23 +1345,23 @@ var tr = D.object({
|
|
|
1336
1345
|
})]),
|
|
1337
1346
|
_: 1
|
|
1338
1347
|
}),
|
|
1339
|
-
|
|
1340
|
-
right:
|
|
1348
|
+
I(V(q), null, {
|
|
1349
|
+
right: H(() => [I(V(J)), I(V(Jt), { label: V(i).t("wise_invoicing.invoice.detail.global_discount.confirm") }, null, 8, ["label"])]),
|
|
1341
1350
|
_: 1
|
|
1342
1351
|
})
|
|
1343
1352
|
]),
|
|
1344
1353
|
_: 1
|
|
1345
1354
|
}, 8, ["form"]));
|
|
1346
1355
|
}
|
|
1347
|
-
}),
|
|
1356
|
+
}), ar = /* @__PURE__ */ L({
|
|
1348
1357
|
__name: "InvoiceLineItemsTableSection",
|
|
1349
1358
|
props: {
|
|
1350
1359
|
customFieldDefinitions: {},
|
|
1351
1360
|
invoice: {}
|
|
1352
1361
|
},
|
|
1353
1362
|
setup(e) {
|
|
1354
|
-
let t = e, n =
|
|
1355
|
-
isSaving:
|
|
1363
|
+
let t = e, n = j(() => t.invoice), r = h(), i = er(), a = j(() => t.invoice.isEditable), o = Ge({
|
|
1364
|
+
isSaving: j(() => i.isLoading.value),
|
|
1356
1365
|
billingDocument: () => n.value,
|
|
1357
1366
|
canEdit: a,
|
|
1358
1367
|
customFieldDefinitions: () => t.customFieldDefinitions,
|
|
@@ -1360,19 +1369,19 @@ var tr = D.object({
|
|
|
1360
1369
|
body: e,
|
|
1361
1370
|
params: { invoiceUuid: t.invoice.uuid }
|
|
1362
1371
|
})
|
|
1363
|
-
}), s =
|
|
1372
|
+
}), s = mn().create(ir);
|
|
1364
1373
|
function c() {
|
|
1365
1374
|
s.open({ invoice: t.invoice });
|
|
1366
1375
|
}
|
|
1367
|
-
return Ye(o), (e, n) => (
|
|
1368
|
-
default:
|
|
1369
|
-
|
|
1370
|
-
"show-apply-discount":
|
|
1376
|
+
return Ye(o), (e, n) => (z(), M(at, null, {
|
|
1377
|
+
default: H(() => [
|
|
1378
|
+
I(qe, {
|
|
1379
|
+
"show-apply-discount": V(r).isGlobalDiscountEnabled.value,
|
|
1371
1380
|
onApplyDiscount: c
|
|
1372
1381
|
}, null, 8, ["show-apply-discount"]),
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1382
|
+
I($e),
|
|
1383
|
+
I(nt, { "billing-document": t.invoice }, null, 8, ["billing-document"]),
|
|
1384
|
+
I(Je)
|
|
1376
1385
|
]),
|
|
1377
1386
|
_: 1
|
|
1378
1387
|
}));
|
|
@@ -1380,8 +1389,8 @@ var tr = D.object({
|
|
|
1380
1389
|
});
|
|
1381
1390
|
//#endregion
|
|
1382
1391
|
//#region src/modules/invoice/api/mutations/invoiceCreateCreditNote.mutation.ts
|
|
1383
|
-
function
|
|
1384
|
-
return
|
|
1392
|
+
function or() {
|
|
1393
|
+
return U({
|
|
1385
1394
|
queryFn: (e) => y.createCreditNote(e.params.invoiceUuid),
|
|
1386
1395
|
queryKeysToInvalidate: {
|
|
1387
1396
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1391,16 +1400,16 @@ function ar() {
|
|
|
1391
1400
|
}
|
|
1392
1401
|
//#endregion
|
|
1393
1402
|
//#region src/modules/invoice/api/mutations/invoiceDuplicate.mutation.ts
|
|
1394
|
-
function
|
|
1395
|
-
return
|
|
1403
|
+
function sr() {
|
|
1404
|
+
return U({
|
|
1396
1405
|
queryFn: (e) => y.duplicate(e.params.invoiceUuid),
|
|
1397
1406
|
queryKeysToInvalidate: { invoiceIndex: {} }
|
|
1398
1407
|
});
|
|
1399
1408
|
}
|
|
1400
1409
|
//#endregion
|
|
1401
1410
|
//#region src/modules/invoice/api/mutations/invoiceFinalize.mutation.ts
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1411
|
+
function cr() {
|
|
1412
|
+
return U({
|
|
1404
1413
|
queryFn: (e) => y.finalize(e.params.invoiceUuid),
|
|
1405
1414
|
queryKeysToInvalidate: {
|
|
1406
1415
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1410,8 +1419,8 @@ function sr() {
|
|
|
1410
1419
|
}
|
|
1411
1420
|
//#endregion
|
|
1412
1421
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsDraft.mutation.ts
|
|
1413
|
-
function
|
|
1414
|
-
return
|
|
1422
|
+
function lr() {
|
|
1423
|
+
return U({
|
|
1415
1424
|
queryFn: (e) => y.markAsDraft(e.params.invoiceUuid),
|
|
1416
1425
|
queryKeysToInvalidate: {
|
|
1417
1426
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1421,8 +1430,8 @@ function cr() {
|
|
|
1421
1430
|
}
|
|
1422
1431
|
//#endregion
|
|
1423
1432
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsPaid.mutation.ts
|
|
1424
|
-
function
|
|
1425
|
-
return
|
|
1433
|
+
function ur() {
|
|
1434
|
+
return U({
|
|
1426
1435
|
queryFn: (e) => y.markAsPaid(e.params.invoiceUuid),
|
|
1427
1436
|
queryKeysToInvalidate: {
|
|
1428
1437
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1432,8 +1441,8 @@ function lr() {
|
|
|
1432
1441
|
}
|
|
1433
1442
|
//#endregion
|
|
1434
1443
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsPriorApprovalRequired.mutation.ts
|
|
1435
|
-
function
|
|
1436
|
-
return
|
|
1444
|
+
function dr() {
|
|
1445
|
+
return U({
|
|
1437
1446
|
queryFn: (e) => y.markAsPriorApprovalRequired(e.params.invoiceUuid),
|
|
1438
1447
|
queryKeysToInvalidate: {
|
|
1439
1448
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1445,8 +1454,8 @@ function ur() {
|
|
|
1445
1454
|
}
|
|
1446
1455
|
//#endregion
|
|
1447
1456
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsProtested.mutation.ts
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1457
|
+
function fr() {
|
|
1458
|
+
return U({
|
|
1450
1459
|
queryFn: (e) => y.markAsProtested(e.params.invoiceUuid),
|
|
1451
1460
|
queryKeysToInvalidate: {
|
|
1452
1461
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1456,8 +1465,8 @@ function dr() {
|
|
|
1456
1465
|
}
|
|
1457
1466
|
//#endregion
|
|
1458
1467
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsReady.mutation.ts
|
|
1459
|
-
function
|
|
1460
|
-
return
|
|
1468
|
+
function pr() {
|
|
1469
|
+
return U({
|
|
1461
1470
|
queryFn: (e) => y.markAsReady(e.params.invoiceUuid),
|
|
1462
1471
|
queryKeysToInvalidate: {
|
|
1463
1472
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1467,8 +1476,8 @@ function fr() {
|
|
|
1467
1476
|
}
|
|
1468
1477
|
//#endregion
|
|
1469
1478
|
//#region src/modules/invoice/api/mutations/invoiceUnmarkAsPriorApprovalRequired.mutation.ts
|
|
1470
|
-
function
|
|
1471
|
-
return
|
|
1479
|
+
function mr() {
|
|
1480
|
+
return U({
|
|
1472
1481
|
queryFn: (e) => y.unmarkAsPriorApprovalRequired(e.params.invoiceUuid),
|
|
1473
1482
|
queryKeysToInvalidate: {
|
|
1474
1483
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1480,8 +1489,8 @@ function pr() {
|
|
|
1480
1489
|
}
|
|
1481
1490
|
//#endregion
|
|
1482
1491
|
//#region src/modules/invoice/api/mutations/invoiceWithdrawProtest.mutation.ts
|
|
1483
|
-
function
|
|
1484
|
-
return
|
|
1492
|
+
function hr() {
|
|
1493
|
+
return U({
|
|
1485
1494
|
queryFn: (e) => y.withdrawProtest(e.params.invoiceUuid),
|
|
1486
1495
|
queryKeysToInvalidate: {
|
|
1487
1496
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1491,8 +1500,8 @@ function mr() {
|
|
|
1491
1500
|
}
|
|
1492
1501
|
//#endregion
|
|
1493
1502
|
//#region src/modules/invoice/api/mutations/invoiceRestoreFromProForma.mutation.ts
|
|
1494
|
-
function
|
|
1495
|
-
return
|
|
1503
|
+
function gr() {
|
|
1504
|
+
return U({
|
|
1496
1505
|
queryFn: (e) => y.restoreFromProForma(e.params.invoiceUuid),
|
|
1497
1506
|
queryKeysToInvalidate: {
|
|
1498
1507
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1504,7 +1513,7 @@ function hr() {
|
|
|
1504
1513
|
}
|
|
1505
1514
|
//#endregion
|
|
1506
1515
|
//#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalRevertDialog.vue
|
|
1507
|
-
var
|
|
1516
|
+
var _r = /* @__PURE__ */ L({
|
|
1508
1517
|
__name: "InvoiceApprovalRevertDialog",
|
|
1509
1518
|
props: {
|
|
1510
1519
|
invoiceUuid: {},
|
|
@@ -1512,9 +1521,9 @@ var gr = /* @__PURE__ */ I({
|
|
|
1512
1521
|
},
|
|
1513
1522
|
emits: ["close", "reverted"],
|
|
1514
1523
|
setup(e, { emit: t }) {
|
|
1515
|
-
let n = e, r = t, i =
|
|
1524
|
+
let n = e, r = t, i = k(), a = Q(), o = E(), s = gr(), c = j(() => n.sentAt === null ? "" : o.toDate(n.sentAt)), l = $({
|
|
1516
1525
|
initialState: {},
|
|
1517
|
-
schema:
|
|
1526
|
+
schema: O.object({}),
|
|
1518
1527
|
onSubmit: async () => {
|
|
1519
1528
|
let e = await s.execute({ params: { invoiceUuid: n.invoiceUuid } });
|
|
1520
1529
|
e.isErr() ? a.apiError(e.error) : (a.show({ message: i.t("wise_invoicing.invoice.approval_revert.success") }), r("reverted"), r("close"));
|
|
@@ -1523,22 +1532,22 @@ var gr = /* @__PURE__ */ I({
|
|
|
1523
1532
|
a.unableToSave();
|
|
1524
1533
|
}
|
|
1525
1534
|
});
|
|
1526
|
-
return (e, t) => (
|
|
1527
|
-
form:
|
|
1535
|
+
return (e, t) => (z(), M(V(X), {
|
|
1536
|
+
form: V(l),
|
|
1528
1537
|
size: "sm",
|
|
1529
1538
|
onClose: t[0] ||= (e) => r("close")
|
|
1530
1539
|
}, {
|
|
1531
|
-
default:
|
|
1532
|
-
title:
|
|
1533
|
-
description:
|
|
1534
|
-
icon:
|
|
1540
|
+
default: H(() => [I(V(Y), {
|
|
1541
|
+
title: V(i).t("wise_invoicing.invoice.approval_revert.title"),
|
|
1542
|
+
description: V(i).t("wise_invoicing.invoice.approval_revert.description", { date: c.value }),
|
|
1543
|
+
icon: V(ve),
|
|
1535
1544
|
"icon-variant": "warning"
|
|
1536
1545
|
}, null, 8, [
|
|
1537
1546
|
"title",
|
|
1538
1547
|
"description",
|
|
1539
1548
|
"icon"
|
|
1540
|
-
]),
|
|
1541
|
-
default:
|
|
1549
|
+
]), I(V(q), null, {
|
|
1550
|
+
default: H(() => [I(V(J)), I(V(Jt), { label: V(i).t("wise_invoicing.invoice.approval_revert.submit") }, null, 8, ["label"])]),
|
|
1542
1551
|
_: 1
|
|
1543
1552
|
})]),
|
|
1544
1553
|
_: 1
|
|
@@ -1547,45 +1556,45 @@ var gr = /* @__PURE__ */ I({
|
|
|
1547
1556
|
});
|
|
1548
1557
|
//#endregion
|
|
1549
1558
|
//#region src/modules/invoice/api/mutations/invoiceDelete.mutation.ts
|
|
1550
|
-
function
|
|
1551
|
-
return
|
|
1559
|
+
function vr() {
|
|
1560
|
+
return U({
|
|
1552
1561
|
queryFn: (e) => y.delete(e.params.invoiceUuid),
|
|
1553
1562
|
queryKeysToInvalidate: { invoiceIndex: {} }
|
|
1554
1563
|
});
|
|
1555
1564
|
}
|
|
1556
1565
|
//#endregion
|
|
1557
1566
|
//#region src/modules/invoice/use-cases/detail/dialogs/InvoiceDeleteDialog.vue
|
|
1558
|
-
var
|
|
1567
|
+
var yr = /* @__PURE__ */ L({
|
|
1559
1568
|
__name: "InvoiceDeleteDialog",
|
|
1560
1569
|
props: { invoice: {} },
|
|
1561
1570
|
emits: ["close", "deleted"],
|
|
1562
1571
|
setup(e, { emit: t }) {
|
|
1563
|
-
let n = e, r = t, i =
|
|
1572
|
+
let n = e, r = t, i = k(), a = Mt(), o = Q(), s = vr(), c = $({
|
|
1564
1573
|
schema: _t.object({}),
|
|
1565
1574
|
onSubmit: async () => {
|
|
1566
1575
|
let e = await s.execute({ params: { invoiceUuid: n.invoice.uuid } });
|
|
1567
1576
|
e.isErr() ? o.apiError(e.error) : (o.show({ message: i.t("wise_invoicing.invoice.delete.success_toast") }), r("deleted"), r("close"), await a.push({ name: "invoicing-invoice-overview" }));
|
|
1568
1577
|
}
|
|
1569
1578
|
});
|
|
1570
|
-
return (e, t) => (
|
|
1571
|
-
form:
|
|
1579
|
+
return (e, t) => (z(), M(V(X), {
|
|
1580
|
+
form: V(c),
|
|
1572
1581
|
size: "xs",
|
|
1573
1582
|
onClose: t[0] ||= (e) => r("close")
|
|
1574
1583
|
}, {
|
|
1575
|
-
default:
|
|
1576
|
-
title:
|
|
1577
|
-
description:
|
|
1578
|
-
}, null, 8, ["title", "description"]),
|
|
1579
|
-
right:
|
|
1584
|
+
default: H(() => [I(V(Y), {
|
|
1585
|
+
title: V(i).t("wise_invoicing.invoice.delete.title"),
|
|
1586
|
+
description: V(i).t("wise_invoicing.invoice.delete.description")
|
|
1587
|
+
}, null, 8, ["title", "description"]), I(V(q), null, {
|
|
1588
|
+
right: H(() => [I(V(J), { label: "cancel" }), I(V(Jt), {
|
|
1580
1589
|
"is-destructive": !0,
|
|
1581
|
-
label:
|
|
1590
|
+
label: V(i).t("wise_invoicing.invoice.delete.submit_button")
|
|
1582
1591
|
}, null, 8, ["label"])]),
|
|
1583
1592
|
_: 1
|
|
1584
1593
|
})]),
|
|
1585
1594
|
_: 1
|
|
1586
1595
|
}, 8, ["form"]));
|
|
1587
1596
|
}
|
|
1588
|
-
}),
|
|
1597
|
+
}), br = { class: "flex flex-col gap-lg px-2xl" }, xr = /* @__PURE__ */ L({
|
|
1589
1598
|
__name: "InvoiceFinalizeOutOfSyncDialog",
|
|
1590
1599
|
props: {
|
|
1591
1600
|
sentAt: {},
|
|
@@ -1599,7 +1608,7 @@ var vr = /* @__PURE__ */ I({
|
|
|
1599
1608
|
"viewProForma"
|
|
1600
1609
|
],
|
|
1601
1610
|
setup(e, { emit: t }) {
|
|
1602
|
-
let n = e, r = t, i =
|
|
1611
|
+
let n = e, r = t, i = k(), a = E(), o = St(!1), s = j(() => n.sentAt === null ? "" : a.toDate(n.sentAt));
|
|
1603
1612
|
function c() {
|
|
1604
1613
|
r("finalizeAnyway"), r("close");
|
|
1605
1614
|
}
|
|
@@ -1609,52 +1618,52 @@ var vr = /* @__PURE__ */ I({
|
|
|
1609
1618
|
function u() {
|
|
1610
1619
|
r("sendNewRequest"), r("close");
|
|
1611
1620
|
}
|
|
1612
|
-
return (e, t) => (
|
|
1621
|
+
return (e, t) => (z(), M(V(Kt), {
|
|
1613
1622
|
size: "sm",
|
|
1614
1623
|
onClose: t[2] ||= (e) => r("close")
|
|
1615
1624
|
}, {
|
|
1616
|
-
default:
|
|
1617
|
-
|
|
1618
|
-
title:
|
|
1619
|
-
description:
|
|
1620
|
-
icon:
|
|
1625
|
+
default: H(() => [
|
|
1626
|
+
I(V(Y), {
|
|
1627
|
+
title: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.title"),
|
|
1628
|
+
description: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.description", { date: s.value }),
|
|
1629
|
+
icon: V(C),
|
|
1621
1630
|
"icon-variant": "warning"
|
|
1622
1631
|
}, null, 8, [
|
|
1623
1632
|
"title",
|
|
1624
1633
|
"description",
|
|
1625
1634
|
"icon"
|
|
1626
1635
|
]),
|
|
1627
|
-
|
|
1636
|
+
F("div", br, [n.proFormaFile === null ? N("", !0) : (z(), M(V(Bt), {
|
|
1628
1637
|
key: 0,
|
|
1629
1638
|
class: "self-start"
|
|
1630
1639
|
}, {
|
|
1631
|
-
default:
|
|
1640
|
+
default: H(() => [F("button", {
|
|
1632
1641
|
class: "text-sm font-semibold text-brand-secondary underline-offset-2 hover:underline",
|
|
1633
1642
|
type: "button",
|
|
1634
1643
|
onClick: t[0] ||= (e) => r("viewProForma")
|
|
1635
|
-
},
|
|
1644
|
+
}, B(V(i).t("wise_invoicing.invoice.approval_banner.view_pro_forma")), 1)]),
|
|
1636
1645
|
_: 1
|
|
1637
|
-
})),
|
|
1646
|
+
})), I(V(zt), {
|
|
1638
1647
|
modelValue: o.value,
|
|
1639
1648
|
"onUpdate:modelValue": t[1] ||= (e) => o.value = e,
|
|
1640
|
-
label:
|
|
1649
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.acknowledge")
|
|
1641
1650
|
}, null, 8, ["modelValue", "label"])]),
|
|
1642
|
-
|
|
1643
|
-
left:
|
|
1644
|
-
"icon-right":
|
|
1645
|
-
label:
|
|
1651
|
+
I(V(q), null, {
|
|
1652
|
+
left: H(() => [I(V(Rt), {
|
|
1653
|
+
"icon-right": V(x),
|
|
1654
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.send_new_request"),
|
|
1646
1655
|
variant: "tertiary",
|
|
1647
1656
|
onClick: u
|
|
1648
1657
|
}, null, 8, ["icon-right", "label"])]),
|
|
1649
|
-
right:
|
|
1650
|
-
label:
|
|
1658
|
+
right: H(() => [I(V(Rt), {
|
|
1659
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.revert_changes"),
|
|
1651
1660
|
variant: "secondary",
|
|
1652
1661
|
onClick: l
|
|
1653
|
-
}, null, 8, ["label"]),
|
|
1654
|
-
"disabled-reason": o.value ? null :
|
|
1662
|
+
}, null, 8, ["label"]), I(V(Rt), {
|
|
1663
|
+
"disabled-reason": o.value ? null : V(i).t("wise_invoicing.invoice.finalize_out_of_sync.acknowledge_required"),
|
|
1655
1664
|
"is-destructive": !0,
|
|
1656
1665
|
"is-disabled": !o.value,
|
|
1657
|
-
label:
|
|
1666
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.finalize_anyway"),
|
|
1658
1667
|
variant: "primary",
|
|
1659
1668
|
onClick: c
|
|
1660
1669
|
}, null, 8, [
|
|
@@ -1668,36 +1677,36 @@ var vr = /* @__PURE__ */ I({
|
|
|
1668
1677
|
_: 1
|
|
1669
1678
|
}));
|
|
1670
1679
|
}
|
|
1671
|
-
}),
|
|
1680
|
+
}), Sr = "customer_has_no_approval_email", Cr = /* @__PURE__ */ new Set([
|
|
1672
1681
|
a.AWAITING_APPROVAL,
|
|
1673
1682
|
a.EXPIRED,
|
|
1674
1683
|
a.REMINDER_1,
|
|
1675
1684
|
a.REMINDER_2
|
|
1676
1685
|
]);
|
|
1677
|
-
async function
|
|
1686
|
+
async function wr(e) {
|
|
1678
1687
|
if (e === null) return;
|
|
1679
1688
|
let t = await dt.getDownloadUrl(e.uuid);
|
|
1680
1689
|
t !== null && window.open(t, "_blank", "noopener");
|
|
1681
1690
|
}
|
|
1682
|
-
function
|
|
1683
|
-
let t =
|
|
1691
|
+
function Tr(e) {
|
|
1692
|
+
let t = k(), n = Q(), i = Mt(), s = h(), c = mn(), l = c.create(yr), u = c.create(ht), p = c.create(mt), m = c.create(_r), g = c.create(ft), _ = c.create(xr), ee = c.create(lt), te = c.create(ce), v = Be(), ne = or(), ie = sr(), ae = cr(), b = lr(), oe = ur(), se = dr(), le = fr(), de = pr(), fe = pt(), me = mr(), Ce = hr(), { shouldSkipConfirmation: Te } = He(), S = St(null), C = j(() => re.getMetadata(e.value.status)), Ee = j(() => S.value ?? e.value.isDisputed), De = j(() => e.value.status !== r.DRAFT && e.value.status !== r.READY), Oe = j(() => e.value.lifecycleStatus === d.FINALIZED);
|
|
1684
1693
|
function w(e) {
|
|
1685
1694
|
return C.value.actions.includes(e);
|
|
1686
1695
|
}
|
|
1687
|
-
let T =
|
|
1696
|
+
let T = j(() => je.getDisplayStatus({
|
|
1688
1697
|
approval: e.value.approval,
|
|
1689
1698
|
requiresPriorApproval: e.value.requiresPriorApproval
|
|
1690
|
-
})), E =
|
|
1699
|
+
})), E = j(() => {
|
|
1691
1700
|
let e = T.value;
|
|
1692
1701
|
return e === null || e === a.APPROVED ? null : e;
|
|
1693
|
-
}),
|
|
1694
|
-
async function
|
|
1702
|
+
}), D = j(() => E.value === null ? null : t.t("wise_invoicing.invoice.finalize.blocked_by_approval", { status: t.t(je.getMetadata(E.value).translationKey) })), Me = j(() => C.value.isEditable && !e.value.requiresPriorApproval), Ne = j(() => C.value.isEditable && e.value.requiresPriorApproval && !e.value.hasApprovalHistory), Pe = j(() => C.value.isEditable && e.value.requiresPriorApproval && (T.value !== a.APPROVED || e.value.hasChangesSinceApprovalSent)), Fe = j(() => Pe.value && w("finalize") && !e.value.hasApprovalHistory), Ie = j(() => C.value.isEditable && e.value.approval !== null && je.canMarkAsApproved(e.value.approval.status)), Le = j(() => C.value.isEditable && e.value.approvalUuid !== null && Cr.has(T.value)), Re = j(() => T.value === a.APPROVED && e.value.hasChangesSinceApprovalSent), ze = j(() => C.value.isEditable && e.value.approval?.status === f.REQUESTED);
|
|
1703
|
+
async function Ve() {
|
|
1695
1704
|
e.value.approvalUuid !== null && await g.open({
|
|
1696
1705
|
approvalUuid: e.value.approvalUuid,
|
|
1697
1706
|
invoiceUuid: e.value.uuid
|
|
1698
1707
|
});
|
|
1699
1708
|
}
|
|
1700
|
-
async function
|
|
1709
|
+
async function Ue(t) {
|
|
1701
1710
|
await m.open({
|
|
1702
1711
|
invoiceUuid: e.value.uuid,
|
|
1703
1712
|
sentAt: e.value.approval?.sentAt ?? null,
|
|
@@ -1706,29 +1715,29 @@ function wr(e) {
|
|
|
1706
1715
|
}
|
|
1707
1716
|
});
|
|
1708
1717
|
}
|
|
1709
|
-
async function
|
|
1710
|
-
await
|
|
1718
|
+
async function We() {
|
|
1719
|
+
await wr(e.value.approvalProFormaFile);
|
|
1711
1720
|
}
|
|
1712
|
-
async function
|
|
1721
|
+
async function Ge() {
|
|
1713
1722
|
e.value.approvalUuid !== null && await u.open({
|
|
1714
1723
|
approvalUuid: e.value.approvalUuid,
|
|
1715
1724
|
invoiceUuid: e.value.uuid
|
|
1716
1725
|
});
|
|
1717
1726
|
}
|
|
1718
|
-
async function
|
|
1727
|
+
async function Ke() {
|
|
1719
1728
|
e.value.approvalUuid !== null && await p.open({
|
|
1720
1729
|
approvalUuid: e.value.approvalUuid,
|
|
1721
1730
|
invoiceUuid: e.value.uuid
|
|
1722
1731
|
});
|
|
1723
1732
|
}
|
|
1724
|
-
async function
|
|
1725
|
-
let r = await
|
|
1733
|
+
async function qe() {
|
|
1734
|
+
let r = await fe.execute({ params: {
|
|
1726
1735
|
invoiceUuid: e.value.uuid,
|
|
1727
1736
|
hasActiveApproval: e.value.approval !== null
|
|
1728
1737
|
} });
|
|
1729
1738
|
if (r.isErr()) {
|
|
1730
1739
|
let i = s.getCustomerDetailRoute(e.value.customer.uuid);
|
|
1731
|
-
if (Dt.isExpectedApiError(r.error) && Dt.getApiErrorCode(r.error) ===
|
|
1740
|
+
if (Dt.isExpectedApiError(r.error) && Dt.getApiErrorCode(r.error) === Sr) {
|
|
1732
1741
|
n.show({
|
|
1733
1742
|
link: i === null ? void 0 : {
|
|
1734
1743
|
label: t.t("wise_invoicing.invoice.send_approval.view_customer_action"),
|
|
@@ -1745,67 +1754,67 @@ function wr(e) {
|
|
|
1745
1754
|
reference: e.value.sequence ?? e.value.subject ?? t.t("wise_invoicing.invoice.detail.fallback_title")
|
|
1746
1755
|
}) });
|
|
1747
1756
|
}
|
|
1748
|
-
async function
|
|
1749
|
-
let r = await
|
|
1757
|
+
async function Je() {
|
|
1758
|
+
let r = await se.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1750
1759
|
r.isErr() ? n.apiError(r.error) : n.show({ message: t.t("wise_invoicing.invoice.mark_as_needs_approval.success") });
|
|
1751
1760
|
}
|
|
1752
|
-
async function
|
|
1753
|
-
let r = await
|
|
1761
|
+
async function Ye() {
|
|
1762
|
+
let r = await me.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1754
1763
|
r.isErr() ? n.apiError(r.error) : n.show({ message: t.t("wise_invoicing.invoice.unmark_as_needs_approval.success") });
|
|
1755
1764
|
}
|
|
1756
1765
|
Et(() => e.value.isDisputed, (e) => {
|
|
1757
1766
|
S.value === e && (S.value = null);
|
|
1758
1767
|
});
|
|
1759
|
-
async function
|
|
1760
|
-
let r = await
|
|
1768
|
+
async function Xe() {
|
|
1769
|
+
let r = await ae.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1761
1770
|
return r.isErr() ? (n.apiError(r.error), !1) : (n.show({ message: t.t("wise_invoicing.invoice.finalize.success") }), !0);
|
|
1762
1771
|
}
|
|
1763
|
-
async function
|
|
1764
|
-
|
|
1772
|
+
async function Ze() {
|
|
1773
|
+
Re.value ? await _.open({
|
|
1765
1774
|
sentAt: e.value.approval?.sentAt ?? null,
|
|
1766
1775
|
proFormaFile: e.value.approvalProFormaFile,
|
|
1767
1776
|
onFinalizeAnyway: () => {
|
|
1768
|
-
|
|
1777
|
+
Xe();
|
|
1769
1778
|
},
|
|
1770
1779
|
onRevertChanges: () => {
|
|
1771
|
-
|
|
1772
|
-
|
|
1780
|
+
Ue({ onReverted: () => {
|
|
1781
|
+
Xe();
|
|
1773
1782
|
} });
|
|
1774
1783
|
},
|
|
1775
1784
|
onSendNewRequest: () => {
|
|
1776
|
-
|
|
1785
|
+
qe();
|
|
1777
1786
|
},
|
|
1778
1787
|
onViewProForma: () => {
|
|
1779
|
-
|
|
1788
|
+
We();
|
|
1780
1789
|
}
|
|
1781
|
-
}) : Te.value ? await
|
|
1790
|
+
}) : Te.value ? await Xe() : await ee.open({
|
|
1782
1791
|
billingDocumentType: "invoice",
|
|
1783
|
-
onConfirm:
|
|
1792
|
+
onConfirm: Xe
|
|
1784
1793
|
});
|
|
1785
1794
|
}
|
|
1786
|
-
async function
|
|
1795
|
+
async function Qe() {
|
|
1787
1796
|
let r = await de.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1788
1797
|
r.isErr() ? n.apiError(r.error) : n.show({ message: t.t("wise_invoicing.invoice.mark_as_ready.success") });
|
|
1789
1798
|
}
|
|
1790
|
-
async function
|
|
1791
|
-
let r = await
|
|
1799
|
+
async function $e() {
|
|
1800
|
+
let r = await b.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1792
1801
|
r.isErr() ? n.apiError(r.error) : n.show({ message: t.t("wise_invoicing.invoice.mark_as_draft.success") });
|
|
1793
1802
|
}
|
|
1794
|
-
async function
|
|
1803
|
+
async function et() {
|
|
1795
1804
|
let r = await oe.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1796
1805
|
r.isErr() ? n.apiError(r.error) : n.show({ message: t.t("wise_invoicing.invoice.mark_as_paid.success") });
|
|
1797
1806
|
}
|
|
1798
|
-
async function
|
|
1807
|
+
async function tt() {
|
|
1799
1808
|
S.value = !0;
|
|
1800
|
-
let r = await
|
|
1809
|
+
let r = await le.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1801
1810
|
r.isErr() ? (S.value = null, n.apiError(r.error)) : n.show({ message: t.t("wise_invoicing.invoice.mark_as_disputed.success") });
|
|
1802
1811
|
}
|
|
1803
|
-
async function
|
|
1812
|
+
async function nt() {
|
|
1804
1813
|
S.value = !1;
|
|
1805
|
-
let r = await
|
|
1814
|
+
let r = await Ce.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1806
1815
|
r.isErr() ? (S.value = null, n.apiError(r.error)) : n.show({ message: t.t("wise_invoicing.invoice.withdraw_dispute.success") });
|
|
1807
1816
|
}
|
|
1808
|
-
async function
|
|
1817
|
+
async function rt() {
|
|
1809
1818
|
await te.open({
|
|
1810
1819
|
invoiceUuid: e.value.uuid,
|
|
1811
1820
|
documents: [{
|
|
@@ -1814,15 +1823,15 @@ function wr(e) {
|
|
|
1814
1823
|
}]
|
|
1815
1824
|
});
|
|
1816
1825
|
}
|
|
1817
|
-
async function
|
|
1826
|
+
async function it() {
|
|
1818
1827
|
if (v.isLoading.value) return;
|
|
1819
1828
|
let r = await v.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1820
1829
|
r.isErr() ? n.apiError(r.error) : n.show({ message: t.t("wise_invoicing.delivery.reminder.sent") });
|
|
1821
1830
|
}
|
|
1822
|
-
async function
|
|
1831
|
+
async function at() {
|
|
1823
1832
|
await l.open({ invoice: e.value });
|
|
1824
1833
|
}
|
|
1825
|
-
async function
|
|
1834
|
+
async function ot() {
|
|
1826
1835
|
let r = await y.getByUuid(e.value.uuid);
|
|
1827
1836
|
if (r.isErr()) {
|
|
1828
1837
|
n.apiError(r.error);
|
|
@@ -1834,10 +1843,10 @@ function wr(e) {
|
|
|
1834
1843
|
return;
|
|
1835
1844
|
}
|
|
1836
1845
|
let a = await dt.getDownloadUrl(i.uuid);
|
|
1837
|
-
a !== null &&
|
|
1846
|
+
a !== null && ue.downloadUrl(a, i.name);
|
|
1838
1847
|
}
|
|
1839
|
-
async function
|
|
1840
|
-
let r = await
|
|
1848
|
+
async function st() {
|
|
1849
|
+
let r = await ie.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1841
1850
|
r.isErr() ? n.apiError(r.error) : n.show({
|
|
1842
1851
|
button: {
|
|
1843
1852
|
label: t.t("wise_invoicing.invoice.duplicate.view_action"),
|
|
@@ -1851,7 +1860,7 @@ function wr(e) {
|
|
|
1851
1860
|
message: t.t("wise_invoicing.invoice.duplicate.success")
|
|
1852
1861
|
});
|
|
1853
1862
|
}
|
|
1854
|
-
async function
|
|
1863
|
+
async function ct() {
|
|
1855
1864
|
let r = await ne.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1856
1865
|
r.isErr() ? n.apiError(r.error) : n.show({
|
|
1857
1866
|
button: {
|
|
@@ -1866,7 +1875,7 @@ function wr(e) {
|
|
|
1866
1875
|
message: t.t("wise_invoicing.credit_note.create.success")
|
|
1867
1876
|
});
|
|
1868
1877
|
}
|
|
1869
|
-
let
|
|
1878
|
+
let ut = j(() => [
|
|
1870
1879
|
{
|
|
1871
1880
|
isLoading: !1,
|
|
1872
1881
|
iconLeft: x,
|
|
@@ -1874,66 +1883,66 @@ function wr(e) {
|
|
|
1874
1883
|
label: t.t("wise_invoicing.invoice.detail.actions.send"),
|
|
1875
1884
|
variant: "primary",
|
|
1876
1885
|
visible: e.value.lifecycleStatus === d.FINALIZED,
|
|
1877
|
-
onClick:
|
|
1886
|
+
onClick: rt
|
|
1878
1887
|
},
|
|
1879
1888
|
{
|
|
1880
1889
|
isLoading: de.isLoading.value,
|
|
1881
|
-
iconRight:
|
|
1890
|
+
iconRight: we,
|
|
1882
1891
|
key: "markAsReady",
|
|
1883
1892
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_ready"),
|
|
1884
1893
|
visible: w("markAsReady"),
|
|
1885
|
-
onClick:
|
|
1894
|
+
onClick: Qe
|
|
1886
1895
|
},
|
|
1887
1896
|
{
|
|
1888
1897
|
isLoading: !1,
|
|
1889
|
-
iconLeft:
|
|
1898
|
+
iconLeft: Ae,
|
|
1890
1899
|
key: "markAsApproved",
|
|
1891
1900
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_approved"),
|
|
1892
|
-
visible:
|
|
1893
|
-
onClick:
|
|
1901
|
+
visible: Ie.value,
|
|
1902
|
+
onClick: Ge
|
|
1894
1903
|
},
|
|
1895
1904
|
{
|
|
1896
|
-
isLoading:
|
|
1905
|
+
isLoading: fe.isLoading.value,
|
|
1897
1906
|
iconLeft: x,
|
|
1898
1907
|
key: "sendApprovalRequest",
|
|
1899
1908
|
label: t.t("wise_invoicing.invoice.detail.actions.send_approval_request"),
|
|
1900
1909
|
variant: "primary",
|
|
1901
|
-
visible:
|
|
1902
|
-
onClick:
|
|
1910
|
+
visible: Fe.value,
|
|
1911
|
+
onClick: qe
|
|
1903
1912
|
},
|
|
1904
1913
|
{
|
|
1905
1914
|
isDisabled: E.value !== null,
|
|
1906
|
-
isLoading:
|
|
1907
|
-
disabledReason:
|
|
1908
|
-
iconLeft:
|
|
1915
|
+
isLoading: ae.isLoading.value,
|
|
1916
|
+
disabledReason: D.value,
|
|
1917
|
+
iconLeft: he,
|
|
1909
1918
|
key: "finalize",
|
|
1910
1919
|
label: t.t("wise_invoicing.invoice.detail.actions.finalize"),
|
|
1911
1920
|
variant: E.value === null ? "primary" : "secondary",
|
|
1912
|
-
visible: w("finalize") && !
|
|
1913
|
-
onClick:
|
|
1921
|
+
visible: w("finalize") && !Fe.value,
|
|
1922
|
+
onClick: Ze
|
|
1914
1923
|
}
|
|
1915
|
-
].filter((e) => e.visible)),
|
|
1924
|
+
].filter((e) => e.visible)), gt = j(() => {
|
|
1916
1925
|
let n = [
|
|
1917
1926
|
{
|
|
1918
|
-
icon:
|
|
1927
|
+
icon: ke,
|
|
1919
1928
|
key: "markAsProtested",
|
|
1920
1929
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_disputed"),
|
|
1921
|
-
visible:
|
|
1922
|
-
onSelect:
|
|
1930
|
+
visible: Oe.value && !Ee.value,
|
|
1931
|
+
onSelect: tt
|
|
1923
1932
|
},
|
|
1924
1933
|
{
|
|
1925
|
-
icon:
|
|
1934
|
+
icon: Ae,
|
|
1926
1935
|
key: "markAsPaid",
|
|
1927
1936
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_paid"),
|
|
1928
1937
|
visible: w("markAsPaid"),
|
|
1929
|
-
onSelect:
|
|
1938
|
+
onSelect: et
|
|
1930
1939
|
},
|
|
1931
1940
|
{
|
|
1932
|
-
icon:
|
|
1941
|
+
icon: we,
|
|
1933
1942
|
key: "withdrawProtest",
|
|
1934
1943
|
label: t.t("wise_invoicing.invoice.detail.actions.withdraw_dispute"),
|
|
1935
|
-
visible:
|
|
1936
|
-
onSelect:
|
|
1944
|
+
visible: Oe.value && Ee.value,
|
|
1945
|
+
onSelect: nt
|
|
1937
1946
|
}
|
|
1938
1947
|
], i = [
|
|
1939
1948
|
r.FINALIZED,
|
|
@@ -1947,78 +1956,78 @@ function wr(e) {
|
|
|
1947
1956
|
key: "sendReminder",
|
|
1948
1957
|
label: t.t("wise_invoicing.delivery.reminder.action"),
|
|
1949
1958
|
visible: e.value.lifecycleStatus === d.FINALIZED && [o.SENT, o.VIEWED].includes(e.value.deliveryStatus),
|
|
1950
|
-
onSelect:
|
|
1959
|
+
onSelect: it
|
|
1951
1960
|
},
|
|
1952
1961
|
{
|
|
1953
|
-
icon:
|
|
1962
|
+
icon: _e,
|
|
1954
1963
|
key: "downloadPdf",
|
|
1955
1964
|
label: t.t("wise_invoicing.common.download_pdf"),
|
|
1956
1965
|
visible: De.value,
|
|
1957
|
-
onSelect:
|
|
1966
|
+
onSelect: ot
|
|
1958
1967
|
},
|
|
1959
1968
|
{
|
|
1960
|
-
icon:
|
|
1969
|
+
icon: ve,
|
|
1961
1970
|
key: "backToDraft",
|
|
1962
1971
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_draft"),
|
|
1963
1972
|
visible: w("markAsDraft"),
|
|
1964
|
-
onSelect:
|
|
1973
|
+
onSelect: $e
|
|
1965
1974
|
},
|
|
1966
1975
|
{
|
|
1967
|
-
icon:
|
|
1976
|
+
icon: Se,
|
|
1968
1977
|
key: "duplicate",
|
|
1969
1978
|
label: t.t("wise_invoicing.invoice.detail.actions.duplicate"),
|
|
1970
1979
|
visible: !0,
|
|
1971
|
-
onSelect:
|
|
1980
|
+
onSelect: st
|
|
1972
1981
|
},
|
|
1973
1982
|
{
|
|
1974
|
-
icon:
|
|
1983
|
+
icon: xe,
|
|
1975
1984
|
key: "rejectApproval",
|
|
1976
1985
|
label: t.t("wise_invoicing.invoice.detail.actions.reject_approval"),
|
|
1977
|
-
visible:
|
|
1978
|
-
onSelect:
|
|
1986
|
+
visible: ze.value,
|
|
1987
|
+
onSelect: Ke
|
|
1979
1988
|
},
|
|
1980
1989
|
{
|
|
1981
1990
|
icon: x,
|
|
1982
1991
|
key: "sendApprovalRequest",
|
|
1983
1992
|
label: t.t("wise_invoicing.invoice.detail.actions.send_approval_request"),
|
|
1984
|
-
visible:
|
|
1985
|
-
onSelect:
|
|
1993
|
+
visible: Pe.value && !Fe.value,
|
|
1994
|
+
onSelect: qe
|
|
1986
1995
|
},
|
|
1987
1996
|
{
|
|
1988
|
-
icon:
|
|
1997
|
+
icon: ge,
|
|
1989
1998
|
key: "markAsNeedsApproval",
|
|
1990
1999
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_needs_approval"),
|
|
1991
|
-
visible:
|
|
1992
|
-
onSelect:
|
|
2000
|
+
visible: Me.value,
|
|
2001
|
+
onSelect: Je
|
|
1993
2002
|
},
|
|
1994
2003
|
{
|
|
1995
|
-
icon:
|
|
2004
|
+
icon: ve,
|
|
1996
2005
|
key: "unmarkAsNeedsApproval",
|
|
1997
2006
|
label: t.t("wise_invoicing.invoice.detail.actions.unmark_as_needs_approval"),
|
|
1998
|
-
visible:
|
|
1999
|
-
onSelect:
|
|
2007
|
+
visible: Ne.value,
|
|
2008
|
+
onSelect: Ye
|
|
2000
2009
|
}
|
|
2001
2010
|
], s = [
|
|
2002
2011
|
{
|
|
2003
|
-
icon:
|
|
2012
|
+
icon: pe,
|
|
2004
2013
|
key: "archiveApproval",
|
|
2005
2014
|
label: t.t("wise_invoicing.invoice.detail.actions.archive_approval"),
|
|
2006
|
-
visible:
|
|
2007
|
-
onSelect:
|
|
2015
|
+
visible: Le.value,
|
|
2016
|
+
onSelect: Ve
|
|
2008
2017
|
},
|
|
2009
2018
|
{
|
|
2010
|
-
icon:
|
|
2019
|
+
icon: be,
|
|
2011
2020
|
key: "createCreditNote",
|
|
2012
2021
|
label: t.t("wise_invoicing.invoice.detail.header.cancel_with_credit_note"),
|
|
2013
2022
|
visible: i,
|
|
2014
|
-
onSelect:
|
|
2023
|
+
onSelect: ct
|
|
2015
2024
|
},
|
|
2016
2025
|
{
|
|
2017
|
-
icon:
|
|
2026
|
+
icon: ye,
|
|
2018
2027
|
key: "delete",
|
|
2019
2028
|
label: t.t("wise_invoicing.invoice.detail.actions.delete"),
|
|
2020
2029
|
visible: C.value.isEditable,
|
|
2021
|
-
onSelect:
|
|
2030
|
+
onSelect: at
|
|
2022
2031
|
}
|
|
2023
2032
|
];
|
|
2024
2033
|
return [
|
|
@@ -2037,38 +2046,38 @@ function wr(e) {
|
|
|
2037
2046
|
].filter((e) => e.items.length > 0);
|
|
2038
2047
|
});
|
|
2039
2048
|
return {
|
|
2040
|
-
isActionMenuVisible:
|
|
2049
|
+
isActionMenuVisible: j(() => gt.value.length > 0),
|
|
2041
2050
|
isDisputed: Ee,
|
|
2042
|
-
menuGroups:
|
|
2043
|
-
primaryButtons:
|
|
2044
|
-
onRevertApprovalChanges:
|
|
2045
|
-
onSendApprovalRequest:
|
|
2046
|
-
onViewProForma:
|
|
2051
|
+
menuGroups: gt,
|
|
2052
|
+
primaryButtons: ut,
|
|
2053
|
+
onRevertApprovalChanges: Ue,
|
|
2054
|
+
onSendApprovalRequest: qe,
|
|
2055
|
+
onViewProForma: We
|
|
2047
2056
|
};
|
|
2048
2057
|
}
|
|
2049
2058
|
//#endregion
|
|
2050
2059
|
//#region src/modules/invoice/use-cases/detail/views/InvoiceDetailView.vue
|
|
2051
|
-
var
|
|
2060
|
+
var Er = /* @__PURE__ */ L({
|
|
2052
2061
|
__name: "InvoiceDetailView",
|
|
2053
2062
|
props: {
|
|
2054
2063
|
customFieldDefinitions: {},
|
|
2055
2064
|
invoice: {}
|
|
2056
2065
|
},
|
|
2057
2066
|
setup(e) {
|
|
2058
|
-
let t = e, n =
|
|
2067
|
+
let t = e, n = k(), r = St(!1), i = j(() => b.filterByView(t.customFieldDefinitions, ie.INVOICE_DETAIL)), { isDisputed: a, menuGroups: o, primaryButtons: s, onRevertApprovalChanges: c, onSendApprovalRequest: l, onViewProForma: u } = Tr(j(() => t.invoice)), f = j(() => [{
|
|
2059
2068
|
label: n.t("wise_invoicing.invoice.overview.title"),
|
|
2060
2069
|
to: { name: "invoicing-invoice-overview" }
|
|
2061
2070
|
}, { label: t.invoice.sequence ?? t.invoice.subject ?? n.t("wise_invoicing.invoice.detail.fallback_title") }]);
|
|
2062
|
-
return (e, p) => (
|
|
2071
|
+
return (e, p) => (z(), M(it, {
|
|
2063
2072
|
"billing-document": t.invoice,
|
|
2064
2073
|
breadcrumbs: f.value,
|
|
2065
|
-
title:
|
|
2074
|
+
title: V(n).t("wise_invoicing.invoice.detail.fallback_title")
|
|
2066
2075
|
}, {
|
|
2067
|
-
header:
|
|
2076
|
+
header: H(() => [I(Tn, {
|
|
2068
2077
|
invoice: t.invoice,
|
|
2069
|
-
"is-disputed":
|
|
2070
|
-
"menu-groups":
|
|
2071
|
-
"primary-buttons":
|
|
2078
|
+
"is-disputed": V(a),
|
|
2079
|
+
"menu-groups": V(o),
|
|
2080
|
+
"primary-buttons": V(s),
|
|
2072
2081
|
"is-pdf-view-active": r.value,
|
|
2073
2082
|
class: "w-full",
|
|
2074
2083
|
onTogglePdfView: p[0] ||= (e) => r.value = !r.value
|
|
@@ -2079,21 +2088,21 @@ var Tr = /* @__PURE__ */ I({
|
|
|
2079
2088
|
"primary-buttons",
|
|
2080
2089
|
"is-pdf-view-active"
|
|
2081
2090
|
])]),
|
|
2082
|
-
default:
|
|
2083
|
-
t.invoice.lifecycleStatus ===
|
|
2091
|
+
default: H(() => [
|
|
2092
|
+
t.invoice.lifecycleStatus === V(d).FINALIZED ? (z(), M(Qe, {
|
|
2084
2093
|
key: 0,
|
|
2085
2094
|
"invoice-uuid": t.invoice.uuid
|
|
2086
|
-
}, null, 8, ["invoice-uuid"])) :
|
|
2087
|
-
|
|
2095
|
+
}, null, 8, ["invoice-uuid"])) : N("", !0),
|
|
2096
|
+
V(re).isEditable(t.invoice.status) ? (z(), M(bn, {
|
|
2088
2097
|
key: 1,
|
|
2089
2098
|
approval: t.invoice.approval,
|
|
2090
2099
|
"is-out-of-sync": t.invoice.hasChangesSinceApprovalSent,
|
|
2091
2100
|
"pro-forma-file": t.invoice.approvalProFormaFile,
|
|
2092
2101
|
rejection: t.invoice.rejection,
|
|
2093
2102
|
class: "w-full",
|
|
2094
|
-
onRevertChanges:
|
|
2095
|
-
onSendNewRequest:
|
|
2096
|
-
onViewProForma:
|
|
2103
|
+
onRevertChanges: V(c),
|
|
2104
|
+
onSendNewRequest: V(l),
|
|
2105
|
+
onViewProForma: V(u)
|
|
2097
2106
|
}, null, 8, [
|
|
2098
2107
|
"approval",
|
|
2099
2108
|
"is-out-of-sync",
|
|
@@ -2102,32 +2111,32 @@ var Tr = /* @__PURE__ */ I({
|
|
|
2102
2111
|
"onRevertChanges",
|
|
2103
2112
|
"onSendNewRequest",
|
|
2104
2113
|
"onViewProForma"
|
|
2105
|
-
])) :
|
|
2106
|
-
r.value ? (
|
|
2114
|
+
])) : N("", !0),
|
|
2115
|
+
r.value ? (z(), M(tt, {
|
|
2107
2116
|
key: 2,
|
|
2108
2117
|
"billing-document": t.invoice,
|
|
2109
2118
|
class: "w-full"
|
|
2110
|
-
}, null, 8, ["billing-document"])) : (
|
|
2111
|
-
|
|
2119
|
+
}, null, 8, ["billing-document"])) : (z(), P(A, { key: 3 }, [
|
|
2120
|
+
I(ar, {
|
|
2112
2121
|
"custom-field-definitions": i.value,
|
|
2113
2122
|
invoice: t.invoice
|
|
2114
2123
|
}, null, 8, ["custom-field-definitions", "invoice"]),
|
|
2115
|
-
|
|
2124
|
+
V(re).isEditable(t.invoice.status) ? N("", !0) : (z(), M($n, {
|
|
2116
2125
|
key: 0,
|
|
2117
2126
|
invoice: t.invoice,
|
|
2118
2127
|
class: "w-full"
|
|
2119
2128
|
}, null, 8, ["invoice"])),
|
|
2120
|
-
|
|
2129
|
+
I(Dn, {
|
|
2121
2130
|
invoice: t.invoice,
|
|
2122
2131
|
class: "w-full"
|
|
2123
2132
|
}, null, 8, ["invoice"]),
|
|
2124
|
-
|
|
2133
|
+
I(kn, {
|
|
2125
2134
|
invoice: t.invoice,
|
|
2126
2135
|
class: "w-full"
|
|
2127
2136
|
}, null, 8, ["invoice"])
|
|
2128
2137
|
], 64))
|
|
2129
2138
|
]),
|
|
2130
|
-
sidebar:
|
|
2139
|
+
sidebar: H(() => [I(Vn, {
|
|
2131
2140
|
"custom-field-definitions": i.value,
|
|
2132
2141
|
invoice: t.invoice
|
|
2133
2142
|
}, null, 8, ["custom-field-definitions", "invoice"])]),
|
|
@@ -2138,20 +2147,20 @@ var Tr = /* @__PURE__ */ I({
|
|
|
2138
2147
|
"title"
|
|
2139
2148
|
]));
|
|
2140
2149
|
}
|
|
2141
|
-
}),
|
|
2150
|
+
}), Dr = /* @__PURE__ */ L({
|
|
2142
2151
|
__name: "InvoiceDetailViewDataProvider",
|
|
2143
2152
|
props: { invoiceUuid: {} },
|
|
2144
2153
|
setup(e) {
|
|
2145
|
-
let t = e, n =
|
|
2154
|
+
let t = e, n = k(), r = j(() => [{
|
|
2146
2155
|
label: n.t("wise_invoicing.invoice.overview.title"),
|
|
2147
2156
|
to: { name: "invoicing-invoice-overview" }
|
|
2148
|
-
}]), i = gt(
|
|
2149
|
-
return (e, t) => (
|
|
2150
|
-
"custom-field-definitions-query":
|
|
2151
|
-
query:
|
|
2157
|
+
}]), i = gt(j(() => t.invoiceUuid)), a = se();
|
|
2158
|
+
return (e, t) => (z(), M(ot, {
|
|
2159
|
+
"custom-field-definitions-query": V(a),
|
|
2160
|
+
query: V(i),
|
|
2152
2161
|
"loading-breadcrumbs": r.value
|
|
2153
2162
|
}, {
|
|
2154
|
-
default:
|
|
2163
|
+
default: H(({ billingDocument: e, customFieldDefinitions: t }) => [I(Er, {
|
|
2155
2164
|
"custom-field-definitions": t,
|
|
2156
2165
|
invoice: e
|
|
2157
2166
|
}, null, 8, ["custom-field-definitions", "invoice"])]),
|
|
@@ -2164,4 +2173,4 @@ var Tr = /* @__PURE__ */ I({
|
|
|
2164
2173
|
}
|
|
2165
2174
|
});
|
|
2166
2175
|
//#endregion
|
|
2167
|
-
export {
|
|
2176
|
+
export { Dr as default };
|