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