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