@wisemen/wise-invoicing-web 0.0.3 → 0.0.4
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/{BillingDocumentDetailViewDataProvider-CwonTh2r.js → BillingDocumentDetailViewDataProvider-pePmiXWb.js} +332 -332
- package/dist/{BillingDocumentPdf-GWCCjE6F.js → BillingDocumentPdf-Dg5JlQE1.js} +8 -8
- package/dist/{CreditNoteDetailViewDataProvider-CaucKK9o.js → CreditNoteDetailViewDataProvider-C-A0jyVr.js} +5 -5
- package/dist/{CreditNotePdfViewDataProvider-CDkvm-3m.js → CreditNotePdfViewDataProvider-DNUvFVDj.js} +2 -2
- package/dist/{CustomFieldValueText-CC9spLWf.js → CustomFieldValueText-DDQq-975.js} +1 -1
- package/dist/{DunningCaseDetailViewDataProvider-1Ui9yqUb.js → DunningCaseDetailViewDataProvider-0WV-7-vg.js} +110 -113
- package/dist/DunningCaseOverviewView-CHdzfbhb.js +553 -0
- package/dist/{DunningCaseReminderPdfViewDataProvider-CVnr9ge6.js → DunningCaseReminderPdfViewDataProvider-DcM-7ECg.js} +4 -1
- package/dist/DunningCaseSendDialog-DBtwr2ue.js +350 -0
- package/dist/{InvoiceDetailViewDataProvider-DfRDFCEb.js → InvoiceDetailViewDataProvider-BDL9lAWe.js} +175 -174
- package/dist/{InvoiceOverviewViewDataProvider-CNK7H5r2.js → InvoiceOverviewViewDataProvider-B_jrcC_8.js} +54 -54
- package/dist/{InvoicePdfView-CrWU8Xa-.js → InvoicePdfView-Bygb-9z6.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-nHZoeRxn.js → InvoicePdfViewDataProvider-nBk3XNrE.js} +2 -2
- package/dist/{InvoicePublicPdfViewDataProvider-CXWSg2pq.js → InvoicePublicPdfViewDataProvider-DHJP_-7-.js} +2 -2
- package/dist/{IssuerSettingsViewDataProvider-DcA6rgOJ.js → IssuerSettingsViewDataProvider-Dk_Q6w6f.js} +2 -2
- package/dist/ReminderSettingsViewDataProvider-CDBjfU7R.js +668 -0
- package/dist/{billingDocumentDetail.transformer-tmy9Tf_b.js → billingDocumentDetail.transformer-zMTbka5p.js} +1 -1
- package/dist/composables/invoicingConfig.composable.d.ts +0 -2
- package/dist/{creditNoteDetail.query-BM2saU0n.js → creditNoteDetail.query-BZqgZRSu.js} +2 -2
- package/dist/{documentTitle.composable-D7XA-8iJ.js → documentTitle.composable-CeaFddr1.js} +28 -30
- package/dist/{invoicingConfig.composable-AjojW4qE.js → i18n.lib-DUbAMBRb.js} +8 -66
- package/dist/index.js +156 -157
- package/dist/{invoice.service-PsmVGGTR.js → invoice.service-ChHEtXBA.js} +13 -13
- package/dist/{invoiceDeliveryStatus.util-CL8K78pD.js → invoiceDeliveryStatus.util-BsA-MlA3.js} +27 -27
- package/dist/{invoiceDetail.query-D2eFdE0j.js → invoiceDetail.query-O_CGvdwg.js} +1 -1
- package/dist/invoicingConfig.composable-c6w_aMm1.js +60 -0
- package/dist/{issuerSettings.query-d5i7Wd7j.js → issuerSettings.query-RqtrZFaB.js} +1 -1
- package/dist/modules/dunning-case/api/queries/dunningCaseIndex.query.d.ts +0 -1
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseBulkSendStat.vue.d.ts +9 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseBulkSendSummary.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendFeeRow.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendInvoiceRow.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendInvoiceSummary.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendRecipientAlert.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/send/composables/dunningCaseReminderSubject.composable.d.ts +6 -0
- package/dist/modules/dunning-case/use-cases/send/composables/dunningCaseSendRecipient.composable.d.ts +16 -0
- package/dist/modules/dunning-case/use-cases/send/utils/dunningCaseSend.util.d.ts +13 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderFeeNotice.vue.d.ts +3 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderPanel.vue.d.ts +12 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +26 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderTimeline.vue.d.ts +13 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderTemplateTabs.vue.d.ts +20 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderTemplatesPanel.vue.d.ts +24 -0
- package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +41 -0
- package/dist/{reminderConfig.query-C7I3M2pu.js → reminderConfig.query-DzTN2AvU.js} +87 -100
- package/package.json +1 -1
- package/dist/DunningCaseOverviewView-Bvwaj4_y.js +0 -507
- package/dist/PermissionGuard-DDw-lDGL.js +0 -301
- package/dist/ReminderSettingsViewDataProvider-C4qz2Rli.js +0 -502
- package/dist/composables/permission-guard/permissionGuard.composable.d.ts +0 -4
- package/dist/modules/dunning-case/api/queries/dunningCaseIndex.query.spec.d.ts +0 -1
- package/dist/ui/permission-guard/PermissionGuard.vue.d.ts +0 -22
|
@@ -1,507 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { n as t } from "./invoicingConfig.composable-AjojW4qE.js";
|
|
3
|
-
import "./api.util-Dm_TQedZ.js";
|
|
4
|
-
import { t as n, v as r } from "./documentTitle.composable-D7XA-8iJ.js";
|
|
5
|
-
import { r as i } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
6
|
-
import { f as a, i as o, n as ee, o as s, p as c, r as l, s as u } from "./dist-DJ8yJcb9.js";
|
|
7
|
-
import { a as d, n as f, r as p } from "./reminderConfig.query-C7I3M2pu.js";
|
|
8
|
-
import { $ as te, A as ne, P as re, S as ie, c as m, et as ae, l as oe, nt as h, tt as se } from "./dist-DP8KNFVD.js";
|
|
9
|
-
import { a as ce, i as le, n as ue, s as g, t as de } from "./PermissionGuard-DDw-lDGL.js";
|
|
10
|
-
import { useRouter as fe } from "vue-router";
|
|
11
|
-
import { z as pe } from "zod";
|
|
12
|
-
import { useI18n as me } from "vue-i18n";
|
|
13
|
-
import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createVNode as C, defineComponent as w, nextTick as T, normalizeClass as he, normalizeStyle as ge, onMounted as E, openBlock as D, ref as O, renderList as k, toDisplayString as A, unref as j, watch as M, withCtx as N, withModifiers as _e } from "vue";
|
|
14
|
-
import { useMutation as P, useOffsetInfiniteQuery as F } from "@wisemen/vue-core-api-utils";
|
|
15
|
-
import { Temporal as I } from "temporal-polyfill";
|
|
16
|
-
import { UIBadge as ve, UIButton as L, UIDashboardPage as ye, UIDashboardPageContent as be, UIDialogBody as xe, UIDialogFooter as R, UIDialogFooterCancel as z, UIDialogFooterPrimary as Se, UIDialogHeader as B, UIDropdownMenu as Ce, UIDropdownMenuGroup as we, UIDropdownMenuItem as Te, UIEmptyState as Ee, UIFormDialog as V, UIIconButton as De, UITabs as Oe, UITabsItem as ke, UITabsList as Ae, useOverlay as je, useToast as H } from "@wisemen/vue-core-design-system";
|
|
17
|
-
import { useForm as U } from "formango";
|
|
18
|
-
//#region src/modules/dunning-case/api/queries/dunningCaseIndex.query.ts
|
|
19
|
-
function W(e, t) {
|
|
20
|
-
return e && t;
|
|
21
|
-
}
|
|
22
|
-
function G(e) {
|
|
23
|
-
let t = d(), n = v(() => ({
|
|
24
|
-
customerUuid: e.params.customerUuid?.value,
|
|
25
|
-
isOpen: e.params.isOpen?.value,
|
|
26
|
-
dunningCaseUuids: e.params.dunningCaseUuids?.value,
|
|
27
|
-
level: e.params.level?.value
|
|
28
|
-
}));
|
|
29
|
-
return F("dunningCaseIndex", {
|
|
30
|
-
isEnabled: v(() => W(t.has(r.DUNNING_CASE_READ), e.isEnabled?.value ?? !0)),
|
|
31
|
-
params: { queryParams: n },
|
|
32
|
-
queryFn: (e) => p.getAll({
|
|
33
|
-
...n.value,
|
|
34
|
-
pagination: e
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/modules/dunning-case/api/queries/dunningCaseCustomerIndex.query.ts
|
|
40
|
-
function K(e) {
|
|
41
|
-
let t = d(), n = v(() => ({ search: e.params.search?.value }));
|
|
42
|
-
return F("dunningCaseCustomerIndex", {
|
|
43
|
-
isEnabled: v(() => t.has(r.DUNNING_CASE_READ)),
|
|
44
|
-
params: { queryParams: n },
|
|
45
|
-
queryFn: (e) => g.getAll(n.value.search, e)
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewFilters.composable.ts
|
|
50
|
-
function Me() {
|
|
51
|
-
let e = me(), t = c({ debounceMs: 250 }), n = K({ params: { search: t.debouncedSearch } }), r = v(() => n.result.value.isOk() ? n.result.value.getValue().data : []), i = o({
|
|
52
|
-
actionGroup: { name: "dunning-cases" },
|
|
53
|
-
filters: [a({
|
|
54
|
-
defaultValue: {
|
|
55
|
-
operator: l.INCLUDES,
|
|
56
|
-
value: []
|
|
57
|
-
},
|
|
58
|
-
disableOperators: !0,
|
|
59
|
-
displayFn: (e) => r.value.find((t) => t.uuid === e)?.name ?? e,
|
|
60
|
-
key: "customerUuids",
|
|
61
|
-
label: e.t("module.dunning_case.overview.filter_customer"),
|
|
62
|
-
options: async (e) => i.values.value.customerUuids.value.length > 0 ? [] : (t.updateSearch(e), await T(), r.value.map((e) => e.uuid))
|
|
63
|
-
})]
|
|
64
|
-
});
|
|
65
|
-
return M(() => i.values.value.customerUuids, (e) => {
|
|
66
|
-
(e.operator !== l.INCLUDES || e.value.length > 1) && (i.values.value.customerUuids = {
|
|
67
|
-
operator: l.INCLUDES,
|
|
68
|
-
value: e.value.slice(-1)
|
|
69
|
-
});
|
|
70
|
-
}, {
|
|
71
|
-
deep: !0,
|
|
72
|
-
immediate: !0
|
|
73
|
-
}), {
|
|
74
|
-
customerUuid: v(() => i.values.value.customerUuids.value[0]),
|
|
75
|
-
filters: i
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/modules/dunning-case/api/mutations/dunningCaseBulkSend.mutation.ts
|
|
80
|
-
function q() {
|
|
81
|
-
return P({
|
|
82
|
-
queryFn: (e) => p.sendBulk(e.params.queryParams),
|
|
83
|
-
queryKeysToInvalidate: {
|
|
84
|
-
dunningCaseDetail: {},
|
|
85
|
-
dunningCaseIndex: {}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/modules/dunning-case/use-cases/send/dialogs/DunningCaseBulkSendDialog.vue?vue&type=script&setup=true&lang.ts
|
|
91
|
-
var Ne = {
|
|
92
|
-
key: 0,
|
|
93
|
-
class: "text-sm text-secondary"
|
|
94
|
-
}, J = {
|
|
95
|
-
key: 1,
|
|
96
|
-
class: "flex flex-col gap-md"
|
|
97
|
-
}, Pe = { class: "grid grid-cols-3 overflow-hidden rounded-md border border-secondary" }, Fe = { class: "border-r border-secondary p-lg" }, Ie = { class: "font-mono text-2xl font-semibold text-primary tabular-nums" }, Le = { class: "mt-xs text-xs font-medium text-secondary uppercase" }, Re = { class: "border-r border-secondary p-lg" }, Y = { class: "font-mono text-2xl font-semibold text-success-primary tabular-nums" }, X = { class: "mt-xs text-xs font-medium text-success-primary uppercase" }, Z = { class: "p-lg" }, ze = { class: "font-mono text-2xl font-semibold text-warning-primary tabular-nums" }, Be = { class: "mt-xs text-xs font-medium text-warning-primary uppercase" }, Ve = { class: "rounded-md bg-success-primary px-lg py-md text-sm font-medium text-success-primary" }, He = {
|
|
98
|
-
key: 0,
|
|
99
|
-
class: "rounded-md border border-secondary px-lg py-md text-sm text-secondary"
|
|
100
|
-
}, Ue = /* @__PURE__ */ w({
|
|
101
|
-
__name: "DunningCaseBulkSendDialog",
|
|
102
|
-
props: { onSent: { type: Function } },
|
|
103
|
-
emits: ["close"],
|
|
104
|
-
setup(e, { emit: t }) {
|
|
105
|
-
let n = e, r = t, i = {}, a = me(), o = H(), ee = q(), s = O(null), c = O(!0), l = v(() => s.value?.meta.processed ?? 0), u = v(() => s.value?.meta.skipped ?? 0), d = v(() => s.value?.meta.total ?? 0), f = U({
|
|
106
|
-
schema: pe.object({}),
|
|
107
|
-
onSubmit: async () => {
|
|
108
|
-
let e = await ee.execute({ params: { queryParams: i } });
|
|
109
|
-
if (e.isErr()) {
|
|
110
|
-
o.apiError(e.error);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
o.show({
|
|
114
|
-
duration: Infinity,
|
|
115
|
-
message: a.t("module.dunning_case.bulk_send.success", {
|
|
116
|
-
count: e.value.meta.processed,
|
|
117
|
-
processed: e.value.meta.processed,
|
|
118
|
-
skipped: e.value.meta.skipped
|
|
119
|
-
})
|
|
120
|
-
}), n.onSent(), r("close");
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
async function te() {
|
|
124
|
-
let e = await p.previewBulk(i);
|
|
125
|
-
if (e.isErr()) {
|
|
126
|
-
o.apiError(e.error), r("close");
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
s.value = e.value, c.value = !1;
|
|
130
|
-
}
|
|
131
|
-
return E(() => {
|
|
132
|
-
te();
|
|
133
|
-
}), (e, t) => (D(), y(j(V), {
|
|
134
|
-
form: j(f),
|
|
135
|
-
size: "md",
|
|
136
|
-
onClose: t[0] ||= (e) => r("close")
|
|
137
|
-
}, {
|
|
138
|
-
default: N(() => [
|
|
139
|
-
C(j(B), {
|
|
140
|
-
title: c.value ? j(a).t("module.dunning_case.bulk_send.title") : j(a).t("module.dunning_case.bulk_send.confirm_question", { count: l.value }),
|
|
141
|
-
description: j(a).t("module.dunning_case.bulk_send.description"),
|
|
142
|
-
"has-separator": !1,
|
|
143
|
-
icon: j(h)
|
|
144
|
-
}, null, 8, [
|
|
145
|
-
"title",
|
|
146
|
-
"description",
|
|
147
|
-
"icon"
|
|
148
|
-
]),
|
|
149
|
-
C(j(xe), null, {
|
|
150
|
-
default: N(() => [c.value ? (D(), x("p", Ne, A(j(a).t("module.dunning_case.bulk_send.loading")), 1)) : (D(), x("div", J, [
|
|
151
|
-
S("div", Pe, [
|
|
152
|
-
S("div", Fe, [S("p", Ie, A(d.value), 1), S("p", Le, A(j(a).t("module.dunning_case.bulk_send.total")), 1)]),
|
|
153
|
-
S("div", Re, [S("p", Y, A(l.value), 1), S("p", X, A(j(a).t("module.dunning_case.bulk_send.ready")), 1)]),
|
|
154
|
-
S("div", Z, [S("p", ze, A(u.value), 1), S("p", Be, A(j(a).t("module.dunning_case.bulk_send.skipped_label")), 1)])
|
|
155
|
-
]),
|
|
156
|
-
S("p", Ve, A(j(a).t("module.dunning_case.bulk_send.processable", { count: l.value })), 1),
|
|
157
|
-
u.value > 0 ? (D(), x("p", He, A(j(a).t("module.dunning_case.bulk_send.skipped", { count: u.value })), 1)) : b("", !0)
|
|
158
|
-
]))]),
|
|
159
|
-
_: 1
|
|
160
|
-
}),
|
|
161
|
-
C(j(R), { "has-separator": !1 }, {
|
|
162
|
-
right: N(() => [C(j(z)), C(j(Se), {
|
|
163
|
-
"icon-right": j(h),
|
|
164
|
-
"is-disabled": c.value || l.value === 0,
|
|
165
|
-
"is-loading": j(f).isSubmitting.value,
|
|
166
|
-
label: j(a).t("module.dunning_case.bulk_send.confirm", { count: l.value }),
|
|
167
|
-
onClick: j(f).submit
|
|
168
|
-
}, null, 8, [
|
|
169
|
-
"icon-right",
|
|
170
|
-
"is-disabled",
|
|
171
|
-
"is-loading",
|
|
172
|
-
"label",
|
|
173
|
-
"onClick"
|
|
174
|
-
])]),
|
|
175
|
-
_: 1
|
|
176
|
-
})
|
|
177
|
-
]),
|
|
178
|
-
_: 1
|
|
179
|
-
}, 8, ["form"]));
|
|
180
|
-
}
|
|
181
|
-
}), We = { class: "flex flex-col gap-3xl" }, Ge = { class: "flex flex-col gap-lg border-b border-secondary pb-3xl lg:flex-row lg:items-start lg:justify-between" }, Ke = { class: "text-lg font-semibold text-primary" }, qe = { class: "mt-xs text-sm text-secondary" }, Je = { class: "flex flex-wrap items-center gap-sm" }, Ye = {
|
|
182
|
-
key: 0,
|
|
183
|
-
class: "w-full"
|
|
184
|
-
}, Xe = ["aria-label"], Ze = { class: "text-xs font-semibold text-secondary uppercase" }, Qe = { class: "mt-xl font-mono text-4xl font-semibold text-primary" }, $e = { class: "mt-xs text-sm text-secondary" }, et = { class: "lg:col-span-2" }, tt = { class: "flex h-1.5 w-full overflow-hidden rounded-full bg-secondary" }, nt = { class: "mt-xl grid grid-cols-1 gap-md sm:grid-cols-3" }, rt = { class: "flex min-w-0 items-center gap-sm" }, it = { class: "truncate text-sm text-secondary" }, at = { class: "shrink-0 font-mono text-sm font-semibold text-primary tabular-nums" }, ot = { class: "overflow-hidden rounded-lg border border-secondary bg-primary shadow-sm" }, st = { class: "flex flex-col gap-md border-b border-secondary p-sm md:flex-row md:items-center md:justify-between" }, ct = { class: "flex flex-wrap items-center justify-end gap-sm" }, lt = { class: "flex flex-col gap-md border-b border-secondary p-sm sm:flex-row sm:items-center sm:justify-between" }, ut = {
|
|
185
|
-
key: 0,
|
|
186
|
-
class: "px-sm text-xs text-secondary"
|
|
187
|
-
}, dt = { class: "flex justify-end" }, ft = { class: "overflow-x-auto" }, pt = { class: "w-full min-w-240 table-fixed border-collapse text-left" }, mt = { class: "border-b border-secondary bg-secondary" }, ht = { class: "w-[28%] px-lg py-md text-xs font-medium text-secondary" }, gt = { class: "w-[18%] px-lg py-md text-xs font-medium text-secondary" }, _t = { class: "w-[24%] px-lg py-md text-xs font-medium text-secondary" }, vt = { class: "w-[18%] px-lg py-md text-right text-xs font-medium text-secondary" }, yt = { key: 0 }, bt = [
|
|
188
|
-
"aria-label",
|
|
189
|
-
"onClick",
|
|
190
|
-
"onKeydown"
|
|
191
|
-
], xt = { class: "px-lg py-md" }, St = { class: "flex min-w-0 items-center gap-sm" }, Ct = ["onClick"], wt = { class: "px-lg py-md" }, Tt = {
|
|
192
|
-
key: 0,
|
|
193
|
-
class: "flex min-w-0 flex-col items-start gap-xxs"
|
|
194
|
-
}, Et = { class: "flex min-w-0 items-center gap-sm" }, Dt = { class: "truncate text-xs text-primary" }, Ot = { class: "px-lg py-md" }, kt = { class: "flex flex-col items-start gap-xxs" }, At = {
|
|
195
|
-
key: 1,
|
|
196
|
-
class: "font-mono text-xs text-secondary tabular-nums"
|
|
197
|
-
}, jt = { class: "px-lg py-md text-right font-mono text-sm font-medium text-primary tabular-nums" }, Mt = { class: "px-lg py-md" }, Nt = {
|
|
198
|
-
key: 0,
|
|
199
|
-
class: "border-t border-secondary px-lg py-xl"
|
|
200
|
-
}, Pt = {
|
|
201
|
-
key: 1,
|
|
202
|
-
class: "p-xl text-center text-sm text-secondary"
|
|
203
|
-
}, Ft = {
|
|
204
|
-
key: 1,
|
|
205
|
-
class: "flex justify-center"
|
|
206
|
-
}, It = /*@__PURE__*/ w({
|
|
207
|
-
__name: "DunningCaseOverviewView",
|
|
208
|
-
setup(e) {
|
|
209
|
-
let a = me(), o = je(), c = fe(), l = i(), d = n(), p = t(), g = O("all"), pe = v(() => [
|
|
210
|
-
{
|
|
211
|
-
icon: re,
|
|
212
|
-
key: "all",
|
|
213
|
-
label: a.t("module.dunning_case.overview.filter_all")
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
icon: m,
|
|
217
|
-
key: "level-1",
|
|
218
|
-
label: a.t("module.dunning_case.level.reminder", { level: 1 })
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
icon: m,
|
|
222
|
-
key: "level-2",
|
|
223
|
-
label: a.t("module.dunning_case.level.reminder", { level: 2 })
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
icon: m,
|
|
227
|
-
key: "level-3",
|
|
228
|
-
label: a.t("module.dunning_case.level.reminder", { level: 3 })
|
|
229
|
-
}
|
|
230
|
-
]), w = v(() => g.value === "all" ? null : Number(g.value.replace("level-", ""))), T = v(() => !0), E = O(!0), { customerUuid: M, filters: P } = Me();
|
|
231
|
-
ee(P), d.set(() => a.t("module.dunning_case.title"));
|
|
232
|
-
let { hasNextPage: F, isFetching: xe, isFetchingNextPage: R, isLoading: z, fetchNextPage: Se, result: B } = G({ params: {
|
|
233
|
-
customerUuid: M,
|
|
234
|
-
isOpen: T,
|
|
235
|
-
level: v(() => w.value ?? void 0)
|
|
236
|
-
} }), V = v(() => xe.value && !z.value && !R.value), H = G({ params: {
|
|
237
|
-
customerUuid: M,
|
|
238
|
-
isOpen: T,
|
|
239
|
-
level: v(() => 1)
|
|
240
|
-
} }), U = G({ params: {
|
|
241
|
-
customerUuid: M,
|
|
242
|
-
isOpen: T,
|
|
243
|
-
level: v(() => 2)
|
|
244
|
-
} }), W = G({ params: {
|
|
245
|
-
customerUuid: M,
|
|
246
|
-
isOpen: T,
|
|
247
|
-
level: v(() => 3)
|
|
248
|
-
} }), K = v(() => !V.value && B.value.isOk() ? B.value.getValue().data : []), q = v(() => [
|
|
249
|
-
H,
|
|
250
|
-
U,
|
|
251
|
-
W
|
|
252
|
-
].map((e) => e.result.value.isOk() ? e.result.value.getValue().meta.total : null)), Ne = v(() => [
|
|
253
|
-
H,
|
|
254
|
-
U,
|
|
255
|
-
W
|
|
256
|
-
].some((e) => e.result.value.isErr())), J = v(() => q.value.every((e) => e !== null) ? q.value.reduce((e, t) => e + t, 0) : null), Pe = { left: {
|
|
257
|
-
icon: ne,
|
|
258
|
-
type: "icon"
|
|
259
|
-
} }, Fe = { left: {
|
|
260
|
-
icon: oe,
|
|
261
|
-
type: "icon"
|
|
262
|
-
} };
|
|
263
|
-
function Ie(e) {
|
|
264
|
-
return e === 0 ? a.t("module.dunning_case.level.none") : a.t("module.dunning_case.level.reminder", { level: e });
|
|
265
|
-
}
|
|
266
|
-
function Le(e) {
|
|
267
|
-
let t = I.Now.plainDateISO().until(e, { largestUnit: "days" }).days;
|
|
268
|
-
return t <= 0 ? a.t("module.dunning_case.overview.due_today") : a.t("module.dunning_case.overview.due_in_days", { count: t });
|
|
269
|
-
}
|
|
270
|
-
function Re(e) {
|
|
271
|
-
if (e.level === null) return null;
|
|
272
|
-
if (e.lastReminderSentAt === null) return a.t("module.dunning_case.overview.last_reminder_not_sent");
|
|
273
|
-
let t = I.Now.instant().epochMilliseconds - e.lastReminderSentAt.epochMilliseconds, n = Math.max(0, Math.floor(t / 864e5));
|
|
274
|
-
return a.t("module.dunning_case.overview.last_reminder_sent", {
|
|
275
|
-
days: n,
|
|
276
|
-
level: e.level
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
function Y(e) {
|
|
280
|
-
return p.getCustomerDetailRoute(e.customer.uuid);
|
|
281
|
-
}
|
|
282
|
-
function X(e) {
|
|
283
|
-
return le(e.latestCreatedReminder);
|
|
284
|
-
}
|
|
285
|
-
function Z(e) {
|
|
286
|
-
return e.blockedReason !== null;
|
|
287
|
-
}
|
|
288
|
-
function ze(e) {
|
|
289
|
-
return Z(e) || X(e) === "failed" || X(e) === "sending";
|
|
290
|
-
}
|
|
291
|
-
function Be(e) {
|
|
292
|
-
return Z(e) ? a.t("module.dunning_case.overview.blocked") : e.nextReminderOn === null ? a.t("module.dunning_case.overview.not_scheduled") : a.t("module.dunning_case.overview.send");
|
|
293
|
-
}
|
|
294
|
-
function Ve(e) {
|
|
295
|
-
return I.PlainDate.compare(e, I.Now.plainDateISO()) <= 0;
|
|
296
|
-
}
|
|
297
|
-
function He(e) {
|
|
298
|
-
o.create(ue, { props: { dunningCaseUuid: e.uuid } }).open();
|
|
299
|
-
}
|
|
300
|
-
function It() {
|
|
301
|
-
o.create(Ue, { props: { onSent: () => {
|
|
302
|
-
B.value;
|
|
303
|
-
} } }).open();
|
|
304
|
-
}
|
|
305
|
-
function Q(e) {
|
|
306
|
-
c.push({
|
|
307
|
-
name: "dunning-case-detail",
|
|
308
|
-
params: { dunningCaseUuid: e.uuid }
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
function $(e) {
|
|
312
|
-
let t = Y(e);
|
|
313
|
-
t !== null && c.push(t);
|
|
314
|
-
}
|
|
315
|
-
function Lt(e, t) {
|
|
316
|
-
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Q(t));
|
|
317
|
-
}
|
|
318
|
-
return (e, t) => (D(), y(j(ye), { title: j(a).t("module.dunning_case.title") }, {
|
|
319
|
-
default: N(() => [C(j(be), null, {
|
|
320
|
-
default: N(() => [S("div", We, [
|
|
321
|
-
S("div", Ge, [S("div", null, [S("h2", Ke, A(j(a).t("module.dunning_case.title")), 1), S("p", qe, A(j(a).t("module.dunning_case.overview.description")), 1)]), S("div", Je, [C(j(L), {
|
|
322
|
-
"icon-left": E.value ? j(ae) : j(ne),
|
|
323
|
-
label: j(a).t(E.value ? "module.dunning_case.overview.hide_metrics" : "module.dunning_case.overview.show_metrics"),
|
|
324
|
-
variant: "secondary",
|
|
325
|
-
onClick: t[0] ||= (e) => E.value = !E.value
|
|
326
|
-
}, null, 8, ["icon-left", "label"]), C(de, { permission: j(r).DUNNING_CASE_SEND }, {
|
|
327
|
-
default: N(() => [C(j(L), {
|
|
328
|
-
"icon-right": j(h),
|
|
329
|
-
label: j(a).t("module.dunning_case.overview.send_all"),
|
|
330
|
-
onClick: It
|
|
331
|
-
}, null, 8, ["icon-right", "label"])]),
|
|
332
|
-
_: 1
|
|
333
|
-
}, 8, ["permission"])])]),
|
|
334
|
-
E.value ? (D(), x("div", Ye, [S("section", {
|
|
335
|
-
"aria-label": j(a).t("module.dunning_case.overview.levels"),
|
|
336
|
-
class: "grid min-w-0 grid-cols-1 gap-2xl rounded-lg border border-secondary bg-primary p-2xl shadow-sm lg:grid-cols-3 lg:items-center"
|
|
337
|
-
}, [S("div", null, [
|
|
338
|
-
S("p", Ze, A(j(a).t("module.dunning_case.overview.levels")), 1),
|
|
339
|
-
S("p", Qe, A(J.value ?? "—"), 1),
|
|
340
|
-
S("p", $e, A(Ne.value ? j(a).t("module.dunning_case.overview.metrics_unavailable") : J.value === null ? j(a).t("module.dunning_case.common.loading") : j(a).t("module.dunning_case.overview.case_count", { count: J.value })), 1)
|
|
341
|
-
]), S("div", et, [S("div", tt, [(D(!0), x(_, null, k(q.value, (e, t) => (D(), x("span", {
|
|
342
|
-
key: t,
|
|
343
|
-
class: he({
|
|
344
|
-
"bg-brand-500": t === 0,
|
|
345
|
-
"bg-error-solid": t === 2,
|
|
346
|
-
"bg-warning-solid": t === 1
|
|
347
|
-
}),
|
|
348
|
-
style: ge({ flexGrow: e ?? 0 })
|
|
349
|
-
}, null, 6))), 128))]), S("div", nt, [(D(!0), x(_, null, k(q.value, (e, t) => (D(), x("div", {
|
|
350
|
-
key: t,
|
|
351
|
-
class: "flex items-center justify-between gap-xl"
|
|
352
|
-
}, [S("div", rt, [S("span", { class: he([{
|
|
353
|
-
"bg-brand-500": t === 0,
|
|
354
|
-
"bg-error-solid": t === 2,
|
|
355
|
-
"bg-warning-solid": t === 1
|
|
356
|
-
}, "size-2 shrink-0 rounded-full"]) }, null, 2), S("p", it, A(Ie(t + 1)), 1)]), S("p", at, A(e ?? "—"), 1)]))), 128))])])], 8, Xe)])) : b("", !0),
|
|
357
|
-
S("div", ot, [
|
|
358
|
-
S("div", st, [C(j(Oe), {
|
|
359
|
-
modelValue: g.value,
|
|
360
|
-
"onUpdate:modelValue": t[1] ||= (e) => g.value = e,
|
|
361
|
-
"aria-label": j(a).t("module.dunning_case.overview.filter_label"),
|
|
362
|
-
variant: "button-border"
|
|
363
|
-
}, {
|
|
364
|
-
default: N(() => [C(j(Ae), null, {
|
|
365
|
-
default: N(() => [(D(!0), x(_, null, k(pe.value, (e) => (D(), y(j(ke), {
|
|
366
|
-
key: e.key,
|
|
367
|
-
config: { left: {
|
|
368
|
-
icon: e.icon,
|
|
369
|
-
type: "icon"
|
|
370
|
-
} },
|
|
371
|
-
label: e.label,
|
|
372
|
-
value: e.key
|
|
373
|
-
}, null, 8, [
|
|
374
|
-
"config",
|
|
375
|
-
"label",
|
|
376
|
-
"value"
|
|
377
|
-
]))), 128))]),
|
|
378
|
-
_: 1
|
|
379
|
-
})]),
|
|
380
|
-
_: 1
|
|
381
|
-
}, 8, ["modelValue", "aria-label"]), S("div", ct, [C(de, { permission: j(r).DUNNING_CASE_SEND }, {
|
|
382
|
-
default: N(() => [C(j(L), {
|
|
383
|
-
"icon-right": j(h),
|
|
384
|
-
label: j(a).t("module.dunning_case.overview.send_all"),
|
|
385
|
-
size: "sm",
|
|
386
|
-
onClick: It
|
|
387
|
-
}, null, 8, ["icon-right", "label"])]),
|
|
388
|
-
_: 1
|
|
389
|
-
}, 8, ["permission"])])]),
|
|
390
|
-
S("div", lt, [j(P).activeFilters.value.length === 0 ? (D(), x("p", ut, A(j(a).t("module.dunning_case.overview.no_active_filters")), 1)) : (D(), y(j(s), { key: 1 })), S("div", dt, [C(j(u))])]),
|
|
391
|
-
S("div", ft, [S("table", pt, [S("thead", null, [S("tr", mt, [
|
|
392
|
-
S("th", ht, A(j(a).t("module.dunning_case.overview.table.customer")), 1),
|
|
393
|
-
S("th", gt, A(j(a).t("module.dunning_case.overview.table.level")), 1),
|
|
394
|
-
S("th", _t, A(j(a).t("module.dunning_case.overview.table.next_reminder")), 1),
|
|
395
|
-
S("th", vt, A(j(a).t("module.dunning_case.overview.table.outstanding")), 1),
|
|
396
|
-
t[3] ||= S("th", { class: "w-[12%] px-lg py-md" }, null, -1)
|
|
397
|
-
])]), K.value.length > 0 ? (D(), x("tbody", yt, [(D(!0), x(_, null, k(K.value, (e) => (D(), x("tr", {
|
|
398
|
-
key: e.uuid,
|
|
399
|
-
"aria-label": j(a).t("module.dunning_case.overview.view_case", { customer: e.customer.name }),
|
|
400
|
-
class: "cursor-pointer border-b border-secondary hover:bg-secondary focus-visible:bg-secondary focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:outline-none focus-visible:ring-inset",
|
|
401
|
-
tabindex: "0",
|
|
402
|
-
onClick: (t) => Q(e),
|
|
403
|
-
onKeydown: (t) => Lt(t, e)
|
|
404
|
-
}, [
|
|
405
|
-
S("td", xt, [S("div", St, [S("button", {
|
|
406
|
-
class: "truncate text-sm font-medium text-primary hover:underline",
|
|
407
|
-
type: "button",
|
|
408
|
-
onClick: _e((t) => Q(e), ["stop"])
|
|
409
|
-
}, A(e.customer.name), 9, Ct)])]),
|
|
410
|
-
S("td", wt, [e.level === null ? b("", !0) : (D(), x("div", Tt, [S("div", Et, [C(f, {
|
|
411
|
-
level: e.level,
|
|
412
|
-
size: "sm"
|
|
413
|
-
}, null, 8, ["level"]), S("span", Dt, A(Ie(e.level)), 1)])]))]),
|
|
414
|
-
S("td", Ot, [S("div", kt, [
|
|
415
|
-
e.nextReminderOn === null ? b("", !0) : (D(), y(j(ve), {
|
|
416
|
-
key: 0,
|
|
417
|
-
color: Ve(e.nextReminderOn) ? "success" : "warning",
|
|
418
|
-
label: Le(e.nextReminderOn),
|
|
419
|
-
size: "sm",
|
|
420
|
-
variant: "translucent"
|
|
421
|
-
}, null, 8, ["color", "label"])),
|
|
422
|
-
C(ce, {
|
|
423
|
-
"blocked-reason": e.blockedReason,
|
|
424
|
-
status: X(e)
|
|
425
|
-
}, null, 8, ["blocked-reason", "status"]),
|
|
426
|
-
!ze(e) && Re(e) !== null ? (D(), x("span", At, A(Re(e)), 1)) : b("", !0)
|
|
427
|
-
])]),
|
|
428
|
-
S("td", jt, A(j(l).formatMonetary(e.outstandingBalance)), 1),
|
|
429
|
-
S("td", Mt, [S("div", {
|
|
430
|
-
class: "flex items-center justify-end gap-xs",
|
|
431
|
-
onClick: t[2] ||= _e(() => {}, ["stop"])
|
|
432
|
-
}, [C(de, { permission: j(r).DUNNING_CASE_SEND }, {
|
|
433
|
-
default: N(() => [Z(e) && Y(e) !== null ? (D(), y(j(L), {
|
|
434
|
-
key: 0,
|
|
435
|
-
"icon-right": j(ie),
|
|
436
|
-
label: j(a).t("module.dunning_case.overview.fix"),
|
|
437
|
-
size: "sm",
|
|
438
|
-
variant: "secondary",
|
|
439
|
-
onClick: (t) => $(e)
|
|
440
|
-
}, null, 8, [
|
|
441
|
-
"icon-right",
|
|
442
|
-
"label",
|
|
443
|
-
"onClick"
|
|
444
|
-
])) : (D(), y(j(L), {
|
|
445
|
-
key: 1,
|
|
446
|
-
"icon-right": e.canSendReminder ? j(h) : void 0,
|
|
447
|
-
"is-disabled": Z(e) || !e.canSendReminder,
|
|
448
|
-
"is-loading": X(e) === "sending",
|
|
449
|
-
label: Be(e),
|
|
450
|
-
size: "sm",
|
|
451
|
-
variant: "secondary",
|
|
452
|
-
onClick: (t) => He(e)
|
|
453
|
-
}, null, 8, [
|
|
454
|
-
"icon-right",
|
|
455
|
-
"is-disabled",
|
|
456
|
-
"is-loading",
|
|
457
|
-
"label",
|
|
458
|
-
"onClick"
|
|
459
|
-
]))]),
|
|
460
|
-
_: 2
|
|
461
|
-
}, 1032, ["permission"]), C(j(Ce), { "popover-align": "end" }, {
|
|
462
|
-
trigger: N(() => [C(j(De), {
|
|
463
|
-
icon: j(se),
|
|
464
|
-
label: j(a).t("shared.actions"),
|
|
465
|
-
variant: "tertiary"
|
|
466
|
-
}, null, 8, ["icon", "label"])]),
|
|
467
|
-
content: N(() => [C(j(we), null, {
|
|
468
|
-
default: N(() => [C(j(Te), {
|
|
469
|
-
config: Pe,
|
|
470
|
-
label: j(a).t("module.dunning_case.overview.menu.view_case"),
|
|
471
|
-
onSelect: (t) => Q(e)
|
|
472
|
-
}, null, 8, ["label", "onSelect"]), Y(e) === null ? b("", !0) : (D(), y(j(Te), {
|
|
473
|
-
key: 0,
|
|
474
|
-
config: Fe,
|
|
475
|
-
label: j(a).t("module.dunning_case.overview.menu.view_customer"),
|
|
476
|
-
onSelect: (t) => $(e)
|
|
477
|
-
}, null, 8, ["label", "onSelect"]))]),
|
|
478
|
-
_: 2
|
|
479
|
-
}, 1024)]),
|
|
480
|
-
_: 2
|
|
481
|
-
}, 1024)])])
|
|
482
|
-
], 40, bt))), 128))])) : b("", !0)])]),
|
|
483
|
-
!j(z) && !V.value && K.value.length === 0 ? (D(), x("div", Nt, [C(j(Ee), {
|
|
484
|
-
title: j(a).t("module.dunning_case.overview.empty_open"),
|
|
485
|
-
icon: j(te)
|
|
486
|
-
}, null, 8, ["title", "icon"])])) : b("", !0),
|
|
487
|
-
j(z) || V.value ? (D(), x("div", Pt, A(j(a).t("module.dunning_case.common.loading")), 1)) : b("", !0)
|
|
488
|
-
]),
|
|
489
|
-
j(F) ? (D(), x("div", Ft, [C(j(L), {
|
|
490
|
-
"is-loading": j(R),
|
|
491
|
-
label: j(a).t("module.dunning_case.overview.load_more"),
|
|
492
|
-
variant: "secondary",
|
|
493
|
-
onClick: j(Se)
|
|
494
|
-
}, null, 8, [
|
|
495
|
-
"is-loading",
|
|
496
|
-
"label",
|
|
497
|
-
"onClick"
|
|
498
|
-
])])) : b("", !0)
|
|
499
|
-
])]),
|
|
500
|
-
_: 1
|
|
501
|
-
})]),
|
|
502
|
-
_: 1
|
|
503
|
-
}, 8, ["title"]));
|
|
504
|
-
}
|
|
505
|
-
}), Q = /* @__PURE__ */ e({ default: () => $ }), $ = It;
|
|
506
|
-
//#endregion
|
|
507
|
-
export { Q as n, G as r, $ as t };
|