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