@wisemen/wise-invoicing-web 0.11.2 → 0.11.3

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 (32) hide show
  1. package/dist/{ApprovalReminderSettingsViewDataProvider-D0kpogSQ.js → ApprovalReminderSettingsViewDataProvider-BOzuwgOd.js} +2 -6
  2. package/dist/{BillingDocumentDetailViewDataProvider-D_oc3-0D.js → BillingDocumentDetailViewDataProvider-a3kGQ6K1.js} +75 -167
  3. package/dist/{BillingDocumentPdf-wlv-k8KE.js → BillingDocumentPdf-DrOZdixo.js} +12 -18
  4. package/dist/{CreditNoteDetailViewDataProvider-DoFm2xgo.js → CreditNoteDetailViewDataProvider-9CTOmMw8.js} +6 -26
  5. package/dist/{CreditNotePdfViewDataProvider-QpzNsVsK.js → CreditNotePdfViewDataProvider-DX_y_ZIS.js} +2 -2
  6. package/dist/{DataProvider-C3uEds9v.js → DataProvider-BtnD-BzI.js} +1 -1
  7. package/dist/{DunningCaseSendDialog-Bol8NF1J.js → DunningCaseSendDialog-BFGLaor0.js} +3 -11
  8. package/dist/{InvoiceApprovalOutOfSyncIndicator-C4ZLDRiv.js → InvoiceApprovalOutOfSyncIndicator-Pc40MY4q.js} +1 -1
  9. package/dist/{InvoiceApprovalOverviewView-BAmEOum7.js → InvoiceApprovalOverviewView-wBqCXtEF.js} +5 -13
  10. package/dist/{InvoiceApproveDialogDataProvider-S81Mc5oS.js → InvoiceApproveDialogDataProvider-DUeMi7qI.js} +10 -26
  11. package/dist/{InvoiceDetailViewDataProvider-Dqu6qlky.js → InvoiceDetailViewDataProvider-Dy4AN8tQ.js} +40 -114
  12. package/dist/{InvoicePdfView-D0G-Pik3.js → InvoicePdfView-B-DBwFx-.js} +1 -1
  13. package/dist/{InvoicePdfViewDataProvider-DXXbPe-Z.js → InvoicePdfViewDataProvider-aRN8o_EF.js} +3 -3
  14. package/dist/{InvoicePublicProFormaPdfViewDataProvider-CdGFZD-G.js → InvoicePublicProFormaPdfViewDataProvider-CGddJNyW.js} +3 -3
  15. package/dist/{IssuerSettingsViewDataProvider-Ca7GPCDE.js → IssuerSettingsViewDataProvider-BlKorJfv.js} +2 -6
  16. package/dist/{PeppolSettingsViewDataProvider-ZdJQGqux.js → PeppolSettingsViewDataProvider-CH0iMxBL.js} +4 -18
  17. package/dist/{dist-DALBiuub.js → dist-BZgvL8_m.js} +19 -30
  18. package/dist/index.js +4496 -227
  19. package/dist/{invoice.service-jakQLnDu.js → invoice.service-CXCNJz0L.js} +1 -1
  20. package/dist/{invoiceCustomer.service-Bp59E0ZJ.js → invoiceCustomer.service-CknXiBt9.js} +1 -1
  21. package/dist/{invoiceDetail.query-BBhA0ZAn.js → invoiceDetail.query-Cp9AnTrw.js} +1 -1
  22. package/dist/{invoiceIndexCache.util-Ba2MGULh.js → invoiceIndexCache.util-By0N8jal.js} +1 -5
  23. package/dist/{src-DUSgQTKr.js → src-Vz2dm4sM.js} +1 -3
  24. package/package.json +2 -2
  25. package/dist/DunningCaseDetailViewDataProvider-uRJFWZtQ.js +0 -439
  26. package/dist/DunningCaseOverviewView-DpQoXamE.js +0 -799
  27. package/dist/DunningCaseReminderPdfViewDataProvider-D-CfDeC8.js +0 -490
  28. package/dist/InvoiceOverviewViewDataProvider-WKzgF7cl.js +0 -1929
  29. package/dist/InvoicePublicPdfViewDataProvider-ndVoAAY3.js +0 -45
  30. package/dist/ReminderSettingsViewDataProvider-DTC0Ud5z.js +0 -709
  31. package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
  32. /package/dist/{DunningCaseReminderPdfViewDataProvider.css → index.css} +0 -0
@@ -1,799 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { t } from "./documentTitle.composable-RvqrZTBa.js";
3
- import { r as n } from "./useCurrencyFormat.composable-MtZaqKnO.js";
4
- import { n as r } from "./invoicingConfig.composable-k8p1Y_eJ.js";
5
- import { t as i } from "./search.composable-CU9OpyUB.js";
6
- import { n as a, r as o } from "./reminderConfig.query-BIfCEIYX.js";
7
- import { Ct as s, P as c, Q as l, Tt as u, W as d, l as f, u as p } from "./dist-BMzyJZTx.js";
8
- import { a as m, n as h, r as g, s as _, t as v } from "./DunningCaseSendDialog-Bol8NF1J.js";
9
- import { n as ee } from "./customerUuid.model-ClN4Vi9n.js";
10
- import { f as y, i as b, n as te, o as ne, r as x, s as re } from "./dist-DALBiuub.js";
11
- import { z as S } from "zod";
12
- import { useI18n as C } from "vue-i18n";
13
- import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createVNode as A, defineComponent as j, nextTick as M, normalizeClass as N, normalizeStyle as ie, onMounted as ae, openBlock as P, ref as F, renderList as I, toDisplayString as L, unref as R, watch as oe, withCtx as z } from "vue";
14
- import { useMutation as B, useOffsetInfiniteQuery as V } from "@wisemen/vue-core-api-utils";
15
- import { useRouter as H } from "vue-router";
16
- import { Temporal as U } from "temporal-polyfill";
17
- import { UIBadge as W, UIButton as G, UIDashboardPage as se, UIDialogBody as K, UIDialogFooter as q, UIDialogFooterCancel as J, UIDialogFooterPrimary as Y, UIDialogHeader as X, UIFormDialog as ce, UITable as le, UITableCell as Z, UITableCellInteractiveElement as ue, UITabs as de, UITabsItem as fe, UITabsList as pe, createComponent as Q, defineTableColumns as me, useOverlay as he, useToast as ge } from "@wisemen/vue-core-design-system";
18
- import { createAction as _e } from "@wisemen/vue-core-actions";
19
- import { useForm as ve } from "formango";
20
- //#region src/modules/dunning-case/api/queries/dunningCaseIndex.query.ts
21
- function $(e) {
22
- let t = T(() => ({
23
- customerUuid: e.params.customerUuid?.value,
24
- isOpen: e.params.isOpen?.value,
25
- dunningCaseUuids: e.params.dunningCaseUuids?.value,
26
- level: e.params.level?.value
27
- }));
28
- return V("dunningCaseIndex", {
29
- isEnabled: T(() => e.isEnabled?.value ?? !0),
30
- params: { queryParams: t },
31
- queryFn: (e) => o.getAll({
32
- ...t.value,
33
- pagination: e
34
- })
35
- });
36
- }
37
- //#endregion
38
- //#region src/modules/dunning-case/actions/dunningCaseNavigateToCustomer.action.ts
39
- function ye() {
40
- let e = C(), t = H(), n = r();
41
- return _e({
42
- id: "dunning-case-navigate-to-customer",
43
- isApplicable: (e) => {
44
- let t = e.targetedModelOfType("DunningCase");
45
- return t !== null && n.getCustomerDetailRoute(t.customer.uuid) !== null;
46
- },
47
- name: () => e.t("module.dunning_case.overview.menu.view_customer"),
48
- execute: (e) => {
49
- let r = e.targetedModelOfTypeOrThrow("DunningCase"), i = n.getCustomerDetailRoute(r.customer.uuid);
50
- i !== null && t.push(i);
51
- },
52
- icon: () => p
53
- });
54
- }
55
- //#endregion
56
- //#region src/modules/dunning-case/actions/dunningCaseNavigateToDetail.action.ts
57
- function be() {
58
- let e = C(), t = H();
59
- return _e({
60
- id: "dunning-case-navigate-to-detail",
61
- isApplicable: (e) => e.hasTargetedModelsOfType("DunningCase"),
62
- name: () => e.t("module.dunning_case.overview.menu.view_case"),
63
- execute: (e) => {
64
- let n = e.targetedModelOfTypeOrThrow("DunningCase");
65
- t.push({
66
- name: "dunning-case-detail",
67
- params: { dunningCaseUuid: n.uuid }
68
- });
69
- },
70
- icon: () => d
71
- });
72
- }
73
- //#endregion
74
- //#region src/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewMetrics.vue?vue&type=script&setup=true&lang.ts
75
- var xe = ["aria-label"], Se = { class: "text-xs font-semibold text-secondary uppercase" }, Ce = { class: "mt-xl font-mono text-4xl font-semibold text-primary" }, we = { class: "mt-xs text-sm text-secondary" }, Te = { class: "lg:col-span-2" }, Ee = { class: "flex h-1.5 w-full overflow-hidden rounded-full bg-secondary" }, De = { class: "mt-xl grid grid-cols-1 gap-md sm:grid-cols-3" }, Oe = { class: "flex min-w-0 items-center gap-sm" }, ke = { class: "truncate text-sm text-secondary" }, Ae = { class: "shrink-0 font-mono text-sm font-semibold text-primary tabular-nums" }, je = /* @__PURE__ */ j({
76
- __name: "DunningCaseOverviewMetrics",
77
- props: {
78
- hasLevelCountError: { type: Boolean },
79
- levelCounts: {},
80
- levelCountTotal: {}
81
- },
82
- setup(e) {
83
- let t = e, n = C(), r = T(() => t.hasLevelCountError ? n.t("module.dunning_case.overview.metrics_unavailable") : t.levelCountTotal === null ? n.t("module.dunning_case.common.loading") : n.t("module.dunning_case.overview.case_count", { count: t.levelCountTotal }));
84
- function i(e) {
85
- return e === 0 ? n.t("module.dunning_case.level.none") : n.t("module.dunning_case.level.reminder", { level: e });
86
- }
87
- return (t, a) => (P(), O("section", {
88
- "aria-label": R(n).t("module.dunning_case.overview.levels"),
89
- 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"
90
- }, [k("div", null, [
91
- k("p", Se, L(R(n).t("module.dunning_case.overview.levels")), 1),
92
- k("p", Ce, L(e.levelCountTotal ?? "—"), 1),
93
- k("p", we, L(r.value), 1)
94
- ]), k("div", Te, [k("div", Ee, [(P(!0), O(w, null, I(e.levelCounts, (e, t) => (P(), O("span", {
95
- key: t,
96
- class: N({
97
- "bg-brand-500": t === 0,
98
- "bg-error-solid": t === 2,
99
- "bg-warning-solid": t === 1
100
- }),
101
- style: ie({ flexGrow: e ?? 0 })
102
- }, null, 6))), 128))]), k("div", De, [(P(!0), O(w, null, I(e.levelCounts, (e, t) => (P(), O("div", {
103
- key: t,
104
- class: "flex items-center justify-between gap-xl"
105
- }, [k("div", Oe, [k("span", { class: N([{
106
- "bg-brand-500": t === 0,
107
- "bg-error-solid": t === 2,
108
- "bg-warning-solid": t === 1
109
- }, "size-2 shrink-0 rounded-full"]) }, null, 2), k("p", ke, L(i(t + 1)), 1)]), k("p", Ae, L(e ?? "—"), 1)]))), 128))])])], 8, xe));
110
- }
111
- }), Me = {
112
- uuid: "00000000-0000-4000-8000-000000000000",
113
- sentAt: null,
114
- hasErrors: !1
115
- };
116
- function Ne(e, t) {
117
- if (e === null || t === null) return e === t;
118
- let n = e.sentAt === null || t.sentAt === null ? e.sentAt === t.sentAt : e.sentAt.equals(t.sentAt);
119
- return e.uuid === t.uuid && n && e.hasErrors === t.hasErrors;
120
- }
121
- function Pe(e) {
122
- let t = T(() => !0), { isFetchingNextPage: n, isLoading: r, fetchNextPage: i, refetch: a, result: o } = $({ params: {
123
- customerUuid: e.customerUuid,
124
- isOpen: t,
125
- level: T(() => e.activeLevel.value ?? void 0)
126
- } });
127
- function s() {
128
- return o.value.isOk() ? o.value.getValue().data : [];
129
- }
130
- let c = F(/* @__PURE__ */ new Map()), l = T(() => s().map((e) => {
131
- let t = c.value.get(e.uuid);
132
- return t !== void 0 && Ne(e.latestCreatedReminder, t) ? {
133
- ...e,
134
- latestCreatedReminder: Me
135
- } : e;
136
- })), u = T(() => o.value.isErr() ? o.value.getError() : null);
137
- ee({
138
- refetch: a,
139
- sendingUuids: () => l.value.filter((e) => m(e.latestCreatedReminder) === "sending").map((e) => e.uuid),
140
- onLimitReached: () => {
141
- c.value = /* @__PURE__ */ new Map();
142
- }
143
- });
144
- let d = $({ params: {
145
- customerUuid: e.customerUuid,
146
- isOpen: t,
147
- level: T(() => 1)
148
- } }), f = $({ params: {
149
- customerUuid: e.customerUuid,
150
- isOpen: t,
151
- level: T(() => 2)
152
- } }), p = $({ params: {
153
- customerUuid: e.customerUuid,
154
- isOpen: t,
155
- level: T(() => 3)
156
- } }), h = T(() => [
157
- d,
158
- f,
159
- p
160
- ].map((e) => e.result.value.isOk() ? e.result.value.getValue().meta.total : null)), g = T(() => [
161
- d,
162
- f,
163
- p
164
- ].some((e) => e.result.value.isErr())), _ = T(() => h.value.every((e) => e !== null) ? h.value.reduce((e, t) => e + t, 0) : null);
165
- function v() {
166
- let e = s();
167
- return (t) => {
168
- let n = new Map(c.value);
169
- for (let r of e) t.includes(r.uuid) || n.set(r.uuid, r.latestCreatedReminder);
170
- c.value = n;
171
- };
172
- }
173
- return {
174
- hasLevelCountError: g,
175
- isFetchingNextPage: n,
176
- isLoading: r,
177
- data: l,
178
- error: u,
179
- fetchNextPage: i,
180
- levelCounts: h,
181
- levelCountTotal: _,
182
- trackBulkSend: v
183
- };
184
- }
185
- //#endregion
186
- //#region src/modules/dunning-case/api/queries/dunningCaseCustomerIndex.query.ts
187
- function Fe(e) {
188
- let t = T(() => ({ search: e.params.search?.value }));
189
- return V("dunningCaseCustomerIndex", {
190
- params: { queryParams: t },
191
- queryFn: (e) => _.getAll(t.value.search, e)
192
- });
193
- }
194
- //#endregion
195
- //#region src/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewFilters.composable.ts
196
- function Ie() {
197
- let e = C(), t = i({ debounceMs: 250 }), n = Fe({ params: { search: t.debouncedSearch } }), r = T(() => n.result.value.isOk() ? n.result.value.getValue().data : []), a = b({
198
- actionGroup: { name: "dunning-cases" },
199
- filters: [y({
200
- defaultValue: {
201
- operator: x.INCLUDES,
202
- value: []
203
- },
204
- disableOperators: !0,
205
- displayFn: (e) => r.value.find((t) => t.uuid === e)?.name ?? e,
206
- key: "customerUuids",
207
- label: e.t("module.dunning_case.overview.filter_customer"),
208
- options: async (e) => a.values.value.customerUuids.value.length > 0 ? [] : (t.updateSearch(e), await M(), r.value.map((e) => e.uuid))
209
- })]
210
- });
211
- return oe(() => a.values.value.customerUuids, (e) => {
212
- (e.operator !== x.INCLUDES || e.value.length > 1) && (a.values.value.customerUuids = {
213
- operator: x.INCLUDES,
214
- value: e.value.slice(-1)
215
- });
216
- }, {
217
- deep: !0,
218
- immediate: !0
219
- }), {
220
- customerUuid: T(() => a.values.value.customerUuids.value[0]),
221
- filters: a
222
- };
223
- }
224
- //#endregion
225
- //#region src/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue?vue&type=script&setup=true&lang.ts
226
- var Le = { class: "flex w-full items-center justify-end gap-xs" }, Re = /* @__PURE__ */ j({
227
- __name: "DunningCaseOverviewActionsCell",
228
- props: { item: {} },
229
- emits: [
230
- "retry",
231
- "send",
232
- "viewCustomer"
233
- ],
234
- setup(e, { emit: t }) {
235
- let n = e, i = t, a = C(), o = r(), s = T(() => o.getCustomerDetailRoute(n.item.customer.uuid)), l = T(() => n.item.blockedReason !== null), d = T(() => m(n.item.latestCreatedReminder)), f = T(() => n.item.canRetryReminder ? a.t("module.dunning_case.overview.retry") : l.value ? a.t("module.dunning_case.overview.blocked") : n.item.nextReminderOn === null ? a.t("module.dunning_case.overview.not_scheduled") : a.t("module.dunning_case.overview.send"));
236
- return (t, n) => (P(), E(R(Z), null, {
237
- default: z(() => [A(R(ue), { class: "w-full" }, {
238
- default: z(() => [k("div", Le, [l.value && s.value !== null ? (P(), E(R(G), {
239
- key: 0,
240
- "icon-right": R(c),
241
- label: R(a).t("module.dunning_case.overview.fix"),
242
- size: "sm",
243
- variant: "secondary",
244
- onClick: n[0] ||= (e) => i("viewCustomer")
245
- }, null, 8, ["icon-right", "label"])) : (P(), E(R(G), {
246
- key: 1,
247
- "icon-right": e.item.canSendReminder || e.item.canRetryReminder ? R(u) : void 0,
248
- "is-disabled": l.value || !e.item.canSendReminder && !e.item.canRetryReminder,
249
- "is-loading": d.value === "sending",
250
- label: f.value,
251
- size: "sm",
252
- variant: "secondary",
253
- onClick: n[1] ||= (t) => e.item.canRetryReminder ? i("retry") : i("send")
254
- }, null, 8, [
255
- "icon-right",
256
- "is-disabled",
257
- "is-loading",
258
- "label"
259
- ]))])]),
260
- _: 1
261
- })]),
262
- _: 1
263
- }));
264
- }
265
- }), ze = { class: "truncate text-sm font-medium text-primary" }, Be = /* @__PURE__ */ j({
266
- __name: "DunningCaseOverviewCustomerCell",
267
- props: { item: {} },
268
- setup(e) {
269
- return (t, n) => (P(), E(R(Z), null, {
270
- default: z(() => [k("span", ze, L(e.item.customer.name), 1)]),
271
- _: 1
272
- }));
273
- }
274
- }), Ve = /* @__PURE__ */ j({
275
- __name: "DunningCaseOverviewDaysOverdueCell",
276
- props: { item: {} },
277
- setup(e) {
278
- return (t, n) => (P(), E(R(Z), null, {
279
- default: z(() => [k("span", { class: N([{
280
- "text-error-primary": e.item.level === 3,
281
- "text-primary": e.item.level !== 3
282
- }, "w-full text-right font-mono text-sm tabular-nums"]) }, L(e.item.daysOverdue), 3)]),
283
- _: 1
284
- }));
285
- }
286
- }), He = {
287
- key: 0,
288
- class: "font-mono text-xs text-secondary tabular-nums"
289
- }, Ue = /* @__PURE__ */ j({
290
- __name: "DunningCaseOverviewLastReminderCell",
291
- props: { item: {} },
292
- setup(e) {
293
- let t = e, n = C(), r = T(() => {
294
- if (t.item.level === null) return null;
295
- if (t.item.lastReminderSentAt === null) return n.t("module.dunning_case.overview.last_reminder_not_sent");
296
- let e = U.Now.instant().epochMilliseconds - t.item.lastReminderSentAt.epochMilliseconds, r = Math.floor(e / 36e5);
297
- return r < 1 ? n.t("module.dunning_case.overview.last_reminder_sent_just_now", { level: t.item.level }) : r < 24 ? n.t("module.dunning_case.overview.last_reminder_sent_hours", {
298
- hours: r,
299
- level: t.item.level
300
- }) : n.t("module.dunning_case.overview.last_reminder_sent", {
301
- days: Math.floor(r / 24),
302
- level: t.item.level
303
- });
304
- });
305
- return (e, t) => (P(), E(R(Z), null, {
306
- default: z(() => [r.value === null ? D("", !0) : (P(), O("span", He, L(r.value), 1))]),
307
- _: 1
308
- }));
309
- }
310
- }), We = {
311
- key: 0,
312
- class: "flex min-w-0 items-center gap-sm"
313
- }, Ge = { class: "truncate text-xs text-primary" }, Ke = /* @__PURE__ */ j({
314
- __name: "DunningCaseOverviewLevelCell",
315
- props: { item: {} },
316
- setup(e) {
317
- let t = C();
318
- function n(e) {
319
- return e === 0 ? t.t("module.dunning_case.level.none") : t.t("module.dunning_case.level.reminder", { level: e });
320
- }
321
- return (t, r) => (P(), E(R(Z), null, {
322
- default: z(() => [e.item.level === null ? D("", !0) : (P(), O("div", We, [A(a, {
323
- level: e.item.level,
324
- size: "sm"
325
- }, null, 8, ["level"]), k("span", Ge, L(n(e.item.level)), 1)]))]),
326
- _: 1
327
- }));
328
- }
329
- }), qe = { class: "w-full text-right font-mono text-sm font-medium text-primary tabular-nums" }, Je = /* @__PURE__ */ j({
330
- __name: "DunningCaseOverviewOutstandingCell",
331
- props: { item: {} },
332
- setup(e) {
333
- let t = n();
334
- return (n, r) => (P(), E(R(Z), null, {
335
- default: z(() => [k("span", qe, L(R(t).formatMonetary(e.item.outstandingBalance)), 1)]),
336
- _: 1
337
- }));
338
- }
339
- }), Ye = { class: "flex flex-col items-start gap-xxs" }, Xe = /* @__PURE__ */ j({
340
- __name: "DunningCaseOverviewReminderCell",
341
- props: { item: {} },
342
- setup(e) {
343
- let t = e, n = C(), r = T(() => m(t.item.latestCreatedReminder));
344
- function i(e) {
345
- let t = U.Now.plainDateISO().until(e, { largestUnit: "days" }).days;
346
- return t <= 0 ? n.t("module.dunning_case.overview.due_today") : n.t("module.dunning_case.overview.due_in_days", { count: t });
347
- }
348
- function a(e) {
349
- return U.PlainDate.compare(e, U.Now.plainDateISO()) <= 0;
350
- }
351
- return (t, n) => (P(), E(R(Z), null, {
352
- default: z(() => [k("div", Ye, [e.item.nextReminderOn === null ? D("", !0) : (P(), E(R(W), {
353
- key: 0,
354
- color: a(e.item.nextReminderOn) ? "success" : "warning",
355
- label: i(e.item.nextReminderOn),
356
- size: "sm",
357
- variant: "translucent"
358
- }, null, 8, ["color", "label"])), A(h, {
359
- "blocked-reason": e.item.blockedReason,
360
- status: r.value
361
- }, null, 8, ["blocked-reason", "status"])])]),
362
- _: 1
363
- }));
364
- }
365
- });
366
- //#endregion
367
- //#region src/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.ts
368
- function Ze(e) {
369
- let t = C();
370
- return T(() => me()([
371
- {
372
- headerLabel: t.t("module.dunning_case.overview.table.customer"),
373
- key: "customer",
374
- size: {
375
- max: "1fr",
376
- min: "12rem"
377
- },
378
- component: (e) => Q(Be, { item: e })
379
- },
380
- {
381
- headerLabel: t.t("module.dunning_case.overview.table.level"),
382
- key: "level",
383
- size: {
384
- max: "10rem",
385
- min: "8rem"
386
- },
387
- component: (e) => Q(Ke, { item: e })
388
- },
389
- {
390
- headerLabel: t.t("module.dunning_case.overview.table.days_overdue"),
391
- key: "daysOverdue",
392
- size: {
393
- max: "9rem",
394
- min: "7rem"
395
- },
396
- component: (e) => Q(Ve, { item: e })
397
- },
398
- {
399
- headerLabel: t.t("module.dunning_case.overview.table.next_reminder"),
400
- key: "nextReminder",
401
- size: {
402
- max: "14rem",
403
- min: "10rem"
404
- },
405
- component: (e) => Q(Xe, { item: e })
406
- },
407
- {
408
- headerLabel: t.t("module.dunning_case.overview.table.last_reminder"),
409
- key: "lastReminder",
410
- size: {
411
- max: "12rem",
412
- min: "9rem"
413
- },
414
- component: (e) => Q(Ue, { item: e })
415
- },
416
- {
417
- headerLabel: t.t("module.dunning_case.overview.table.outstanding"),
418
- key: "outstanding",
419
- size: {
420
- max: "10rem",
421
- min: "8rem"
422
- },
423
- component: (e) => Q(Je, { item: e })
424
- },
425
- {
426
- headerLabel: "",
427
- key: "actions",
428
- size: {
429
- max: "11rem",
430
- min: "9rem"
431
- },
432
- component: (t) => Q(Re, {
433
- item: t,
434
- onRetry: () => e.onRetry(t),
435
- onSend: () => e.onSend(t),
436
- onViewCustomer: () => e.onViewCustomer(t)
437
- })
438
- }
439
- ]));
440
- }
441
- //#endregion
442
- //#region src/modules/dunning-case/api/mutations/dunningCaseBulkSend.mutation.ts
443
- function Qe() {
444
- return B({
445
- queryFn: (e) => o.sendBulk(e.params.queryParams),
446
- queryKeysToInvalidate: {
447
- dunningCaseDetail: {},
448
- dunningCaseIndex: {}
449
- }
450
- });
451
- }
452
- //#endregion
453
- //#region src/modules/dunning-case/use-cases/send/components/DunningCaseBulkSendStat.vue
454
- var $e = /* @__PURE__ */ j({
455
- __name: "DunningCaseBulkSendStat",
456
- props: {
457
- hasSeparator: { type: Boolean },
458
- label: {},
459
- tone: {},
460
- value: {}
461
- },
462
- setup(e) {
463
- let t = e;
464
- return (e, n) => (P(), O("div", { class: N([{ "border-r border-secondary": t.hasSeparator }, "p-lg"]) }, [k("p", { class: N([{
465
- "text-primary": t.tone === "default",
466
- "text-success-primary": t.tone === "success",
467
- "text-warning-primary": t.tone === "warning"
468
- }, "font-mono text-2xl font-semibold tabular-nums"]) }, L(t.value), 3), k("p", { class: N([{
469
- "text-secondary": t.tone === "default",
470
- "text-success-primary": t.tone === "success",
471
- "text-warning-primary": t.tone === "warning"
472
- }, "mt-xs text-xs font-medium uppercase"]) }, L(t.label), 3)], 2));
473
- }
474
- }), et = { class: "flex flex-col gap-md" }, tt = { class: "grid grid-cols-3 overflow-hidden rounded-md border border-secondary" }, nt = { class: "rounded-md bg-success-primary px-lg py-md text-sm font-medium text-success-primary" }, rt = {
475
- key: 0,
476
- class: "rounded-md border border-secondary px-lg py-md text-sm text-secondary"
477
- }, it = /* @__PURE__ */ j({
478
- __name: "DunningCaseBulkSendSummary",
479
- props: {
480
- processableCount: {},
481
- skippedCount: {},
482
- totalCount: {}
483
- },
484
- setup(e) {
485
- let t = e, n = C(), r = T(() => [
486
- {
487
- label: n.t("module.dunning_case.bulk_send.total"),
488
- tone: "default",
489
- value: t.totalCount
490
- },
491
- {
492
- label: n.t("module.dunning_case.bulk_send.ready"),
493
- tone: "success",
494
- value: t.processableCount
495
- },
496
- {
497
- label: n.t("module.dunning_case.bulk_send.skipped_label"),
498
- tone: "warning",
499
- value: t.skippedCount
500
- }
501
- ]);
502
- return (e, i) => (P(), O("div", et, [
503
- k("div", tt, [(P(!0), O(w, null, I(r.value, (e, t) => (P(), E($e, {
504
- key: e.label,
505
- "has-separator": t < r.value.length - 1,
506
- label: e.label,
507
- tone: e.tone,
508
- value: e.value
509
- }, null, 8, [
510
- "has-separator",
511
- "label",
512
- "tone",
513
- "value"
514
- ]))), 128))]),
515
- k("p", nt, L(R(n).t("module.dunning_case.bulk_send.processable", { count: t.processableCount })), 1),
516
- t.skippedCount > 0 ? (P(), O("p", rt, L(R(n).t("module.dunning_case.bulk_send.skipped", { count: t.skippedCount })), 1)) : D("", !0)
517
- ]));
518
- }
519
- }), at = {
520
- key: 0,
521
- class: "text-sm text-secondary"
522
- }, ot = /* @__PURE__ */ j({
523
- __name: "DunningCaseBulkSendDialog",
524
- props: { onSent: { type: Function } },
525
- emits: ["close"],
526
- setup(e, { emit: t }) {
527
- let n = e, r = t, i = {}, a = {
528
- customer_has_no_default_recipient: "module.dunning_case.bulk_send.skip_reason.customer_has_no_default_recipient",
529
- dunning_case_not_found: "module.dunning_case.bulk_send.skip_reason.dunning_case_not_found",
530
- dunning_case_reminder_config_not_found: "module.dunning_case.bulk_send.skip_reason.dunning_case_reminder_config_not_found",
531
- dunning_case_reminder_not_due: "module.dunning_case.bulk_send.skip_reason.dunning_case_reminder_not_due",
532
- dunning_case_reminder_pending: "module.dunning_case.bulk_send.skip_reason.dunning_case_reminder_pending"
533
- };
534
- function s(e) {
535
- return Object.hasOwn(a, e);
536
- }
537
- let c = C(), l = ge(), d = Qe(), f = F(null), p = F(!0), m = T(() => f.value?.meta.processed ?? 0);
538
- function h(e) {
539
- let t = e.errors.at(0)?.errors.at(0)?.code;
540
- return t !== void 0 && s(t) ? c.t(a[t]) : c.t("module.dunning_case.bulk_send.skip_reason.unknown");
541
- }
542
- function g(e) {
543
- let t = /* @__PURE__ */ new Map();
544
- for (let n of e) {
545
- let e = h(n);
546
- t.set(e, (t.get(e) ?? 0) + 1);
547
- }
548
- return Array.from(t, ([e, t]) => c.t("module.dunning_case.bulk_send.skip_reason_count", {
549
- count: t,
550
- reason: e
551
- })).join(", ");
552
- }
553
- let _ = ve({
554
- schema: S.object({}),
555
- onSubmit: async () => {
556
- let e = await d.execute({ params: { queryParams: i } });
557
- if (e.isErr()) {
558
- l.apiError(e.error);
559
- return;
560
- }
561
- let t = g(e.value.skipped);
562
- l.show({
563
- duration: Infinity,
564
- message: t === "" ? c.t("module.dunning_case.bulk_send.success", {
565
- count: e.value.meta.processed,
566
- processed: e.value.meta.processed,
567
- skipped: e.value.meta.skipped
568
- }) : c.t("module.dunning_case.bulk_send.success_with_reasons", {
569
- count: e.value.meta.processed,
570
- processed: e.value.meta.processed,
571
- skipped: e.value.meta.skipped,
572
- summary: t
573
- })
574
- }), n.onSent(e.value.skipped.map((e) => e.uuid)), r("close");
575
- }
576
- });
577
- async function v() {
578
- let e = await o.previewBulk(i);
579
- if (e.isErr()) {
580
- l.apiError(e.error), r("close");
581
- return;
582
- }
583
- f.value = e.value, p.value = !1;
584
- }
585
- return ae(() => {
586
- v();
587
- }), (e, t) => (P(), E(R(ce), {
588
- form: R(_),
589
- size: "md",
590
- onClose: t[0] ||= (e) => r("close")
591
- }, {
592
- default: z(() => [
593
- A(R(X), {
594
- title: p.value ? R(c).t("module.dunning_case.bulk_send.title") : R(c).t("module.dunning_case.bulk_send.confirm_question", { count: m.value }),
595
- description: R(c).t("module.dunning_case.bulk_send.description"),
596
- "has-separator": !1,
597
- icon: R(u)
598
- }, null, 8, [
599
- "title",
600
- "description",
601
- "icon"
602
- ]),
603
- A(R(K), null, {
604
- default: z(() => [f.value === null ? (P(), O("p", at, L(R(c).t("module.dunning_case.bulk_send.loading")), 1)) : (P(), E(it, {
605
- key: 1,
606
- "processable-count": f.value.meta.processed,
607
- "skipped-count": f.value.meta.skipped,
608
- "total-count": f.value.meta.total
609
- }, null, 8, [
610
- "processable-count",
611
- "skipped-count",
612
- "total-count"
613
- ]))]),
614
- _: 1
615
- }),
616
- A(R(q), { "has-separator": !1 }, {
617
- right: z(() => [A(R(J)), A(R(Y), {
618
- "icon-right": R(u),
619
- "is-disabled": p.value || m.value === 0,
620
- "is-loading": R(_).isSubmitting.value,
621
- label: R(c).t("module.dunning_case.bulk_send.confirm", { count: m.value }),
622
- onClick: R(_).submit
623
- }, null, 8, [
624
- "icon-right",
625
- "is-disabled",
626
- "is-loading",
627
- "label",
628
- "onClick"
629
- ])]),
630
- _: 1
631
- })
632
- ]),
633
- _: 1
634
- }, 8, ["form"]));
635
- }
636
- }), st = { class: "flex min-h-0 flex-1 flex-col gap-xl px-3xl py-xl" }, ct = { class: "flex shrink-0 flex-col gap-lg md:flex-row md:items-center md:justify-between" }, lt = { class: "text-lg font-semibold text-primary" }, ut = { class: "mt-xs text-sm text-secondary" }, dt = { class: "flex items-center gap-sm" }, ft = {
637
- key: 0,
638
- class: "shrink-0"
639
- }, pt = { class: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-secondary bg-primary shadow-sm" }, mt = { class: "flex flex-col gap-md border-b border-secondary p-sm md:flex-row md:items-center md:justify-between" }, ht = { class: "flex items-center justify-between gap-md border-b border-secondary p-sm" }, gt = {
640
- key: 0,
641
- class: "px-sm text-xs text-secondary"
642
- }, _t = { class: "relative flex min-h-0 flex-1 flex-col" }, vt = /*@__PURE__*/ j({
643
- __name: "DunningCaseOverviewView",
644
- setup(e) {
645
- let n = C(), i = he(), a = ge(), o = H(), c = t(), p = r(), m = g(), h = F("all"), _ = T(() => [
646
- {
647
- icon: l,
648
- key: "all",
649
- label: n.t("module.dunning_case.overview.filter_all")
650
- },
651
- {
652
- icon: f,
653
- key: "level-1",
654
- label: n.t("module.dunning_case.level.reminder", { level: 1 })
655
- },
656
- {
657
- icon: f,
658
- key: "level-2",
659
- label: n.t("module.dunning_case.level.reminder", { level: 2 })
660
- },
661
- {
662
- icon: f,
663
- key: "level-3",
664
- label: n.t("module.dunning_case.level.reminder", { level: 3 })
665
- }
666
- ]), ee = T(() => h.value === "all" ? null : Number(h.value.replace("level-", ""))), y = F(!0), { customerUuid: b, filters: x } = Ie();
667
- te(x), c.set(() => n.t("module.dunning_case.title"));
668
- let { hasLevelCountError: S, isFetchingNextPage: j, isLoading: M, data: N, error: ie, fetchNextPage: ae, levelCounts: oe, levelCountTotal: B, trackBulkSend: V } = Pe({
669
- customerUuid: b,
670
- activeLevel: ee
671
- }), U = T(() => x.activeFilters.value.length);
672
- function W(e) {
673
- i.create(v, { props: { dunningCaseUuid: e.uuid } }).open();
674
- }
675
- async function K(e) {
676
- if (e.latestCreatedReminder === null) return;
677
- let t = await m.execute({ params: { dunningCaseReminderUuid: e.latestCreatedReminder.uuid } });
678
- if (t.isErr()) {
679
- a.apiError(t.error);
680
- return;
681
- }
682
- a.show({
683
- duration: Infinity,
684
- message: n.t("module.dunning_case.retry.success", { customer: e.customer.name })
685
- });
686
- }
687
- function q() {
688
- i.create(ot, { props: { onSent: V() } }).open();
689
- }
690
- function J(e) {
691
- let t = p.getCustomerDetailRoute(e.customer.uuid);
692
- t !== null && o.push(t);
693
- }
694
- function Y(e) {
695
- return {
696
- name: "dunning-case-detail",
697
- params: { dunningCaseUuid: e.uuid }
698
- };
699
- }
700
- let X = be(), ce = ye(), Z = Ze({
701
- onRetry: (e) => {
702
- K(e);
703
- },
704
- onSend: W,
705
- onViewCustomer: J
706
- });
707
- return (e, t) => (P(), E(R(se), {
708
- title: R(n).t("module.dunning_case.title"),
709
- "is-title-hidden": !0
710
- }, {
711
- default: z(() => [k("div", st, [
712
- k("div", ct, [k("div", null, [k("h2", lt, L(R(n).t("module.dunning_case.title")), 1), k("p", ut, L(R(n).t("module.dunning_case.overview.description")), 1)]), k("div", dt, [A(R(G), {
713
- "icon-left": y.value ? R(s) : R(d),
714
- label: R(n).t(y.value ? "module.dunning_case.overview.hide_metrics" : "module.dunning_case.overview.show_metrics"),
715
- variant: "secondary",
716
- onClick: t[0] ||= (e) => y.value = !y.value
717
- }, null, 8, ["icon-left", "label"]), A(R(G), {
718
- "icon-right": R(u),
719
- label: R(n).t("module.dunning_case.overview.send_all"),
720
- onClick: q
721
- }, null, 8, ["icon-right", "label"])])]),
722
- y.value ? (P(), O("div", ft, [A(je, {
723
- "has-level-count-error": R(S),
724
- "level-counts": R(oe),
725
- "level-count-total": R(B)
726
- }, null, 8, [
727
- "has-level-count-error",
728
- "level-counts",
729
- "level-count-total"
730
- ])])) : D("", !0),
731
- k("div", pt, [
732
- k("div", mt, [A(R(de), {
733
- modelValue: h.value,
734
- "onUpdate:modelValue": t[1] ||= (e) => h.value = e,
735
- "aria-label": R(n).t("module.dunning_case.overview.filter_label"),
736
- variant: "button-border"
737
- }, {
738
- default: z(() => [A(R(pe), null, {
739
- default: z(() => [(P(!0), O(w, null, I(_.value, (e) => (P(), E(R(fe), {
740
- key: e.key,
741
- config: { left: {
742
- icon: e.icon,
743
- type: "icon"
744
- } },
745
- label: e.label,
746
- value: e.key
747
- }, null, 8, [
748
- "config",
749
- "label",
750
- "value"
751
- ]))), 128))]),
752
- _: 1
753
- })]),
754
- _: 1
755
- }, 8, ["modelValue", "aria-label"]), A(R(G), {
756
- "icon-right": R(u),
757
- label: R(n).t("module.dunning_case.overview.send_all"),
758
- size: "sm",
759
- onClick: q
760
- }, null, 8, ["icon-right", "label"])]),
761
- k("div", ht, [U.value === 0 ? (P(), O("p", gt, L(R(n).t("module.dunning_case.overview.no_active_filters")), 1)) : (P(), E(R(ne), { key: 1 })), A(R(re))]),
762
- k("div", _t, [A(R(le), {
763
- "active-filter-count": U.value,
764
- columns: R(Z),
765
- data: R(N),
766
- error: R(ie),
767
- "get-key": (e) => e.uuid,
768
- actions: [R(X), R(ce)],
769
- "get-action-model": (e) => ({
770
- key: e.uuid,
771
- modelName: "DunningCase",
772
- ...e
773
- }),
774
- "get-link": Y,
775
- "is-fetching-next-page": R(j),
776
- "is-loading": R(M),
777
- variant: "full-page",
778
- onClearFilters: t[2] ||= (e) => R(x).clearAll(),
779
- onNextPage: R(ae)
780
- }, null, 8, [
781
- "active-filter-count",
782
- "columns",
783
- "data",
784
- "error",
785
- "get-key",
786
- "actions",
787
- "get-action-model",
788
- "is-fetching-next-page",
789
- "is-loading",
790
- "onNextPage"
791
- ])])
792
- ])
793
- ])]),
794
- _: 1
795
- }, 8, ["title"]));
796
- }
797
- }), yt = /* @__PURE__ */ e({ default: () => bt }), bt = vt;
798
- //#endregion
799
- export { yt as n, $ as r, bt as t };