@wisemen/wise-invoicing-web 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/{ApprovalReminderSettingsViewDataProvider-D-qXZrPT.js → ApprovalReminderSettingsViewDataProvider-DwtfyQpx.js} +4 -4
  2. package/dist/{BillingDocumentDetailViewDataProvider-DDdtlW-2.js → BillingDocumentDetailViewDataProvider-TJUwMhtn.js} +1373 -1217
  3. package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
  4. package/dist/{BillingDocumentPdf-ehdFB6mr.js → BillingDocumentPdf-PU9Ldfhs.js} +20 -13
  5. package/dist/{CreditNoteDetailViewDataProvider-11a-JO3H.js → CreditNoteDetailViewDataProvider-DOPmal5D.js} +89 -89
  6. package/dist/{CreditNotePdfViewDataProvider-bfeaya3P.js → CreditNotePdfViewDataProvider-BH7MaReQ.js} +2 -2
  7. package/dist/{CustomFieldValueText-CZQXGE5F.js → CustomFieldValueText-BjRVovZL.js} +25 -25
  8. package/dist/DunningCaseDetailViewDataProvider-CW8ijY3H.js +439 -0
  9. package/dist/{DunningCaseOverviewView-y_bCmi5j.js → DunningCaseOverviewView-Cfo-4VIw.js} +255 -203
  10. package/dist/{DunningCaseReminderPdfViewDataProvider-DNODfED_.js → DunningCaseReminderPdfViewDataProvider-Dr-CS_VQ.js} +4 -3
  11. package/dist/{DunningCaseSendDialog-BPXcqit5.js → DunningCaseSendDialog-BYFXJYMM.js} +83 -72
  12. package/dist/InvoiceApprovalOutOfSyncIndicator-CP2GLaeh.js +45 -0
  13. package/dist/InvoiceApprovalOverviewView-Cjdu9iZC.js +814 -0
  14. package/dist/InvoiceApprovalStatusBadge-CcX8agTF.js +127 -0
  15. package/dist/InvoiceApproveDialogDataProvider-4wNAetBn.js +377 -0
  16. package/dist/{InvoiceDetailViewDataProvider-BYeaaQzL.js → InvoiceDetailViewDataProvider-C9O3hXGo.js} +750 -692
  17. package/dist/InvoiceOverviewViewDataProvider-DBdw7FvZ.js +1892 -0
  18. package/dist/{InvoicePdfView-BJRTg_TH.js → InvoicePdfView-CvU9bRVd.js} +10 -4
  19. package/dist/{InvoicePdfViewDataProvider-CwI_uGm3.js → InvoicePdfViewDataProvider-CFjHQ58K.js} +3 -3
  20. package/dist/{InvoicePublicPdfViewDataProvider-uZUfsr5K.js → InvoicePublicPdfViewDataProvider-DDv-LdBU.js} +3 -3
  21. package/dist/InvoicePublicProFormaPdfViewDataProvider-BTjJnELb.js +47 -0
  22. package/dist/{InvoicingFileUploadProvider-D9Xk4rQM.js → InvoicingFileUploadProvider-Kcq7kSSt.js} +2 -2
  23. package/dist/{IssuerSettingsViewDataProvider-CGRa8F-2.js → IssuerSettingsViewDataProvider-BuSIVnIl.js} +3 -3
  24. package/dist/{ReminderSettingsViewDataProvider-1ucp3z2T.js → ReminderSettingsViewDataProvider-CH7gSXnj.js} +100 -102
  25. package/dist/{api.util-C_kMGlJN.js → api.util-CkIRZS3h.js} +985 -930
  26. package/dist/{billingDocumentDetail.transformer-Da6_-Hv9.js → billingDocumentDetail.transformer-Bfd8geNo.js} +5 -7
  27. package/dist/client/index.d.ts +2 -2
  28. package/dist/client/sdk.gen.d.ts +2 -1
  29. package/dist/client/types.gen.d.ts +114 -31
  30. package/dist/client/zod.gen.d.ts +343 -78
  31. package/dist/composables/sending-refetch/sendingRefetch.composable.d.ts +7 -0
  32. package/dist/composables/sending-refetch/sendingRefetch.composable.spec.d.ts +1 -0
  33. package/dist/{creditNoteDetail.query-DLR7L0Ep.js → creditNoteDetail.query-tLnfqsEB.js} +27 -27
  34. package/dist/customerUuid.model-ClN4Vi9n.js +18 -0
  35. package/dist/{dist-Cxdm09Lp.js → dist-BD7Allff.js} +143 -95
  36. package/dist/{dist-CoztMdYH.js → dist-D5agTXFI.js} +61 -61
  37. package/dist/{documentTitle.composable-DsBbzhXN.js → documentTitle.composable-CRJjS6p-.js} +19 -17
  38. package/dist/{i18n.lib-Cvr8pcDw.js → i18n.lib--mzprLMR.js} +88 -54
  39. package/dist/index.d.ts +56 -22
  40. package/dist/index.js +193 -201
  41. package/dist/{invoice.service-DEEA9mal.js → invoice.service-B1w16_Md.js} +184 -172
  42. package/dist/{invoiceApproval.service-DvL3LliM.js → invoiceApproval.service-BHAJmFkU.js} +8 -8
  43. package/dist/{invoiceApprovalStatus.util-3Zh10Pj8.js → invoiceApprovalStatus.util-DohOKR4q.js} +42 -38
  44. package/dist/invoiceCustomer.service-DpVfpQUD.js +39 -0
  45. package/dist/{invoiceDetail.query-CRoH_SgM.js → invoiceDetail.query-CfyNSXLS.js} +1 -1
  46. package/dist/{invoiceDeliveryStatus.util-nCsqDypY.js → invoiceIndexCache.util-jHsrFwcA.js} +128 -51
  47. package/dist/{invoicingConfig.composable-rxjGK882.js → invoicingConfig.composable-COn1rKRf.js} +2 -2
  48. package/dist/{issuerSettings.query-Dc5gsaEm.js → issuerSettings.query-CDFk2GiP.js} +3 -2
  49. package/dist/libs/i18n.lib.d.ts +56 -22
  50. package/dist/locales/en-US.json.d.ts +44 -27
  51. package/dist/locales/nl-BE.json.d.ts +44 -27
  52. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.model.d.ts +8 -1
  53. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.util.d.ts +12 -0
  54. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.util.spec.d.ts +1 -0
  55. package/dist/models/billing-document/billingDocumentDetail.model.d.ts +2 -6
  56. package/dist/modules/dunning-case/api/mutations/dunningCaseReminderRetry.mutation.d.ts +4 -0
  57. package/dist/modules/dunning-case/api/services/dunningCase.service.d.ts +2 -1
  58. package/dist/modules/dunning-case/models/dunningCase.model.d.ts +5 -0
  59. package/dist/modules/dunning-case/models/dunningCaseReminderPdf.model.d.ts +0 -4
  60. package/dist/modules/dunning-case/models/dunningCaseReminderPdf.transformer.d.ts +0 -1
  61. package/dist/modules/dunning-case/test/builders/dunningCaseReminderPdfDto.builder.d.ts +1 -0
  62. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue.d.ts +2 -0
  63. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.d.ts +2 -2
  64. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.spec.d.ts +1 -0
  65. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.d.ts +1 -0
  66. package/dist/modules/dunning-case/use-cases/pdf/components/DunningCaseReminderPdfTable.vue.d.ts +0 -4
  67. package/dist/modules/dunning-case/use-cases/send/dialogs/DunningCaseBulkSendDialog.vue.d.ts +2 -1
  68. package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +4 -4
  69. package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +2 -2
  70. package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.spec.d.ts +1 -0
  71. package/dist/modules/invoice/api/mutations/invoiceRejectApproval.mutation.d.ts +8 -0
  72. package/dist/modules/invoice/api/queries/invoicePublicProFormaDetail.query.d.ts +2 -0
  73. package/dist/modules/invoice/api/query-keys/invoice.queryKeys.d.ts +6 -0
  74. package/dist/modules/invoice/api/services/invoice.service.d.ts +1 -0
  75. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.d.ts +4 -2
  76. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.spec.d.ts +1 -0
  77. package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.d.ts +8 -0
  78. package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +1 -0
  79. package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.model.d.ts +2 -3
  80. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.model.d.ts +2 -9
  81. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.util.d.ts +4 -2
  82. package/dist/modules/invoice/models/invoice/payment/invoicePaymentCreate.transformer.spec.d.ts +1 -0
  83. package/dist/modules/invoice/models/invoice/pdf/invoicePdfDetail.transformer.d.ts +2 -1
  84. package/dist/modules/invoice/routes/invoice.routes.d.ts +4 -0
  85. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue.d.ts +1 -0
  86. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialogDataProvider.vue.d.ts +13 -0
  87. package/dist/modules/invoice/use-cases/detail/dialogs/InvoicePaymentDeleteDialog.vue.d.ts +13 -0
  88. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewDataTableFilters.composable.d.ts +2 -3
  89. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewSelection.composable.d.ts +11 -9
  90. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +2 -2
  91. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendApprovalDialog.vue.d.ts +3 -1
  92. package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.d.ts +7 -4
  93. package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.spec.d.ts +1 -0
  94. package/dist/modules/invoice/use-cases/pdf/components/BillingDocumentPdf.vue.d.ts +1 -0
  95. package/dist/modules/invoice/use-cases/pdf/components/InvoicePdfWatermark.vue.d.ts +4 -1
  96. package/dist/modules/invoice/use-cases/pdf/views/InvoicePdfView.vue.d.ts +1 -0
  97. package/dist/modules/invoice/use-cases/pdf/views/InvoicePublicProFormaPdfViewDataProvider.vue.d.ts +3 -0
  98. package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.action.d.ts +2 -0
  99. package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.spec.d.ts +1 -0
  100. package/dist/modules/invoice-approval/models/invoiceApprovalIndex.transformer.spec.d.ts +1 -0
  101. package/dist/modules/invoice-approval/models/invoiceApprovalIndexQueryParams.transformer.spec.d.ts +1 -0
  102. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverview.composable.d.ts +5 -6
  103. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewFilters.composable.d.ts +0 -5
  104. package/dist/modules/settings/models/issuer-settings/issuerSettings.model.d.ts +1 -0
  105. package/dist/{reminderConfig.query-snaHQmrY.js → reminderConfig.query-DSO0ekC_.js} +112 -105
  106. package/dist/routes/invoicingPublicRoutes.composable.d.ts +4 -0
  107. package/dist/style.css +1 -1
  108. package/dist/ui/billing-document/sidebar/BillingDocumentDetailSidebarActivityApprovalDetails.vue.d.ts +7 -0
  109. package/package.json +2 -2
  110. package/dist/DunningCaseDetailViewDataProvider-DC-ziMoO.js +0 -409
  111. package/dist/InvoiceApprovalOverviewView-DZ14mi4L.js +0 -870
  112. package/dist/InvoiceApprovalStatusBadge-U-dW2hR4.js +0 -161
  113. package/dist/InvoiceApproveDialog-2LXneG2r.js +0 -308
  114. package/dist/InvoiceOverviewBulkSendApprovalDialog-99dfuN4i.js +0 -318
  115. package/dist/InvoiceOverviewViewDataProvider-CZIQeftL.js +0 -1620
  116. package/dist/customerUuid.model-GUFYq3O2.js +0 -5
  117. package/dist/modules/invoice-approval/actions/invoiceApprovalUnmarkAsNeedsApproval.action.d.ts +0 -1
@@ -0,0 +1,7 @@
1
+ import { BillingDocumentActivityLog } from '../../../models/billing-document/activity-log/billingDocumentActivityLog.model.ts';
2
+ type __VLS_Props = {
3
+ entry: BillingDocumentActivityLog;
4
+ };
5
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wisemen/wise-invoicing-web",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "private": false,
6
6
  "description": "Invoicing frontend package with Vue 3 components, composables and types",
7
7
  "author": "Wisemen",
@@ -91,7 +91,7 @@
91
91
  "typescript": "6.0.3",
92
92
  "vite": "^8.2.0",
93
93
  "vite-plugin-dts": "5.0.3",
94
- "vitest": "4.1.10",
94
+ "vitest": "^4.1.11",
95
95
  "vue": "3.5.40",
96
96
  "vue-i18n": "11.4.8",
97
97
  "vue-router": "5.2.0",
@@ -1,409 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import "./api.util-C_kMGlJN.js";
3
- import { t, w as n } from "./documentTitle.composable-DsBbzhXN.js";
4
- import { r } from "./useCurrencyFormat.composable-MtZaqKnO.js";
5
- import { n as i } from "./invoicingConfig.composable-rxjGK882.js";
6
- import { n as a } from "./reminderConfig.query-snaHQmrY.js";
7
- import { S as o, W as ee, Y as s, at as c, ct as l, et as te } from "./dist-Cxdm09Lp.js";
8
- import { a as u, i as ne, n as re, r as ie, t as ae } from "./DunningCaseSendDialog-BPXcqit5.js";
9
- import { n as oe } from "./dist-boJIIxnT.js";
10
- import { t as d } from "./DataProvider-C3uEds9v.js";
11
- import { useI18n as f } from "vue-i18n";
12
- import { Fragment as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createTextVNode as y, createVNode as b, defineComponent as x, normalizeClass as S, normalizeStyle as se, openBlock as C, ref as w, renderList as T, toDisplayString as E, unref as D, withCtx as O } from "vue";
13
- import { RouterLink as ce, useRouter as le } from "vue-router";
14
- import { Temporal as k } from "temporal-polyfill";
15
- import { UIBadge as A, UIButton as ue, UIDashboardPage as de, UIDashboardPageContent as fe, UIDashboardPageLoadingState as j, UITabs as pe, UITabsItem as M, UITabsList as me, UITooltip as he, UITooltipContent as ge, useOverlay as _e } from "@wisemen/vue-core-design-system";
16
- import { useViewModels as ve } from "@wisemen/vue-core-actions";
17
- //#region src/modules/dunning-case/use-cases/detail/views/DunningCaseDetailView.vue?vue&type=script&setup=true&lang.ts
18
- var ye = { class: "flex flex-col gap-4xl" }, be = { class: "flex flex-col gap-lg lg:flex-row lg:items-start lg:justify-between" }, xe = { class: "flex flex-wrap items-center gap-sm" }, Se = { class: "text-lg font-semibold text-primary" }, Ce = { key: 1 }, we = { class: "inline-flex items-center gap-xs rounded-sm border border-secondary px-sm py-px text-xs text-primary" }, Te = {
19
- key: 0,
20
- class: "mt-xs text-xs text-secondary"
21
- }, Ee = { class: "mt-xxs text-xs text-secondary" }, De = { class: "grid grid-cols-1 gap-3xl md:grid-cols-2 xl:grid-cols-[minmax(20rem,1.45fr)_minmax(10rem,0.7fr)_repeat(2,minmax(8rem,0.8fr))]" }, Oe = { class: "min-w-0 xl:col-start-1 xl:row-start-1 2xl:col-start-1 2xl:row-start-1" }, ke = { class: "text-xs font-medium text-secondary" }, Ae = { class: "mt-xs font-mono text-4xl font-semibold text-primary tabular-nums xl:text-5xl" }, je = { class: "mt-xs text-xs text-secondary" }, Me = {
22
- key: 0,
23
- class: "mt-xxs text-xs text-secondary"
24
- }, Ne = { class: "mt-xl flex h-(--spacing-md) overflow-hidden rounded-full bg-tertiary" }, Pe = { class: "flex flex-col justify-end gap-md xl:col-start-2 xl:row-start-1 xl:pb-xs" }, Fe = ["aria-label"], Ie = { class: "flex min-w-0 items-center gap-sm" }, Le = { class: "truncate text-xs text-secondary" }, Re = { class: "shrink-0 font-mono text-xs font-medium text-primary" }, ze = { class: "flex min-w-0 items-center gap-md xl:col-start-3 xl:row-start-1" }, Be = { class: "flex size-(--spacing-5xl) shrink-0 items-center justify-center rounded-full bg-brand-100" }, Ve = { class: "min-w-0" }, He = { class: "text-xs text-secondary" }, Ue = { class: "mt-xs font-mono text-xl font-semibold whitespace-nowrap text-primary xl:text-2xl" }, We = { class: "flex min-w-0 items-center gap-md xl:col-start-4 xl:row-start-1" }, Ge = { class: "flex size-(--spacing-5xl) shrink-0 items-center justify-center rounded-full bg-brand-100" }, Ke = { class: "text-xs text-secondary" }, qe = { class: "mt-xs font-mono text-2xl font-semibold text-primary" }, Je = {
25
- key: 0,
26
- class: "mt-xs text-xs text-secondary"
27
- }, Ye = { class: "grid gap-3xl xl:grid-cols-[minmax(0,2fr)_25.5rem]" }, Xe = { class: "min-w-0" }, Ze = { class: "overflow-hidden rounded-md border border-secondary bg-primary shadow-sm" }, Qe = { class: "border-b border-secondary px-xl pt-lg" }, $e = { class: "overflow-x-auto" }, et = {
28
- key: 0,
29
- class: "w-full min-w-200 table-fixed border-collapse text-left"
30
- }, tt = { class: "border-b border-secondary bg-secondary" }, nt = { class: "w-[20%] px-xl py-md text-xs font-medium text-secondary" }, rt = { class: "w-[26%] px-xl py-md text-xs font-medium text-secondary" }, it = { class: "w-[14%] px-xl py-md text-xs font-medium text-secondary" }, at = { class: "w-[20%] px-xl py-md text-xs font-medium text-secondary" }, ot = { class: "w-[20%] px-xl py-md text-right text-xs font-medium text-secondary" }, st = { class: "flex items-start gap-md" }, ct = [
31
- "aria-expanded",
32
- "aria-label",
33
- "onClick"
34
- ], lt = {
35
- key: 1,
36
- class: "size-(--spacing-xl) shrink-0"
37
- }, N = { class: "min-w-0" }, ut = {
38
- key: 0,
39
- class: "mt-xxs truncate text-xs text-secondary"
40
- }, dt = { class: "px-xl py-md font-mono text-xs" }, ft = { class: "px-xl py-md" }, pt = {
41
- key: 1,
42
- class: "flex items-center gap-xs text-xs text-primary"
43
- }, mt = { class: "px-xl py-md" }, ht = { class: "flex flex-col items-start gap-xs" }, gt = {
44
- key: 0,
45
- class: "text-xs text-secondary"
46
- }, _t = { class: "px-xl py-md text-right font-mono text-xs text-secondary tabular-nums" }, vt = { class: "font-medium" }, yt = {
47
- key: 0,
48
- class: "mt-xxs text-tertiary"
49
- }, bt = ["aria-hidden"], xt = {
50
- class: "p-none",
51
- colspan: "5"
52
- }, St = { class: "overflow-hidden" }, Ct = { class: "relative flex flex-col items-start gap-xs px-5xl py-md text-xs before:absolute before:inset-y-0 before:left-0 before:w-(--spacing-xxs) before:bg-brand-500" }, wt = {
53
- key: 1,
54
- class: "flex flex-col items-center justify-center gap-md px-xl py-2xl"
55
- }, Tt = { class: "flex size-(--spacing-3xl) items-center justify-center rounded-md border border-secondary" }, Et = { class: "text-sm font-semibold text-secondary" }, Dt = {
56
- key: 0,
57
- class: "ml-auto flex w-full max-w-140 flex-col px-xl"
58
- }, Ot = { class: "flex items-center justify-between gap-3xl border-b border-secondary py-lg text-sm text-primary" }, kt = { class: "shrink-0 font-mono text-2xl font-semibold tabular-nums" }, At = { class: "flex items-center justify-between gap-3xl py-lg text-sm text-primary" }, jt = { class: "shrink-0 font-mono text-sm font-medium tabular-nums" }, Mt = { class: "h-full rounded-md border border-secondary bg-primary p-xl shadow-sm" }, Nt = { class: "text-xl font-semibold text-primary" }, Pt = { class: "mt-2xl flex flex-col" }, Ft = { class: "flex w-(--spacing-3xl) shrink-0 flex-col items-center" }, It = {
59
- key: 0,
60
- class: "min-h-(--spacing-xl) w-px flex-1 bg-tertiary"
61
- }, Lt = { class: "text-sm font-semibold text-primary" }, Rt = { class: "mt-xxs text-sm text-secondary" }, P = /* @__PURE__ */ x({
62
- __name: "DunningCaseDetailView",
63
- props: { dunningCase: {} },
64
- setup(e) {
65
- let u = e, d = f(), x = _e(), j = r(), P = oe(), F = t(), I = i(), L = le(), R = w("overdue");
66
- function z(e) {
67
- return e.payments.length > 0 || e.creditNotes.length > 0;
68
- }
69
- let B = w(u.dunningCase.invoices.find(z)?.uuid ?? null);
70
- F.set(() => u.dunningCase.customer.name), ve(m(() => [{
71
- key: u.dunningCase.uuid,
72
- modelName: "DunningCase",
73
- ...u.dunningCase
74
- }]));
75
- let V = m(() => {
76
- let e = u.dunningCase.invoices.flatMap((e) => [...e.payments.map((t) => ({
77
- sortDate: t.date.toString(),
78
- amount: t.amount,
79
- date: t.date,
80
- invoiceSequence: e.sequence,
81
- key: t.uuid,
82
- settlementStatus: e.settlementStatus,
83
- type: "payment"
84
- })), ...e.creditNotes.map((e) => ({
85
- sortDate: e.finalizedOn.toString(),
86
- amount: e.grossAmount,
87
- date: e.finalizedOn,
88
- key: e.uuid,
89
- sequence: e.sequence,
90
- type: "credit-note"
91
- }))]);
92
- return u.dunningCase.nextReminderOn !== null && k.PlainDate.compare(u.dunningCase.nextReminderOn, k.Now.plainDateISO()) <= 0 && e.push({
93
- sortDate: k.Now.plainDateISO().toString(),
94
- date: u.dunningCase.nextReminderOn,
95
- key: `due-${u.dunningCase.nextReminderOn.toString()}`,
96
- type: "reminder-due"
97
- }), u.dunningCase.lastReminderSentAt !== null && e.push({
98
- sortDate: u.dunningCase.lastReminderSentAt.toString(),
99
- date: u.dunningCase.lastReminderSentAt,
100
- key: `reminder-${u.dunningCase.lastReminderSentAt.toString()}`,
101
- type: "reminder-sent"
102
- }), u.dunningCase.closedAt !== null && e.push({
103
- sortDate: u.dunningCase.closedAt.toString(),
104
- date: u.dunningCase.closedAt,
105
- key: `closed-${u.dunningCase.closedAt.toString()}`,
106
- type: "case-closed"
107
- }), e.toSorted((e, t) => t.sortDate.localeCompare(e.sortDate));
108
- }), H = m(() => u.dunningCase.invoices.filter((e) => k.PlainDate.compare(e.dueOn, k.Now.plainDateISO()) < 0).toSorted((e, t) => k.PlainDate.compare(e.dueOn, t.dueOn))), zt = m(() => u.dunningCase.invoices.filter((e) => k.PlainDate.compare(e.dueOn, k.Now.plainDateISO()) >= 0).toSorted((e, t) => k.PlainDate.compare(e.dueOn, t.dueOn))), U = m(() => R.value === "overdue" ? H.value : zt.value), W = m(() => u.dunningCase.invoices.filter((e) => e.isDisputed).length), G = m(() => ie(u.dunningCase.latestCreatedReminder)), K = m(() => H.value.filter((e) => !e.isDisputed)), q = m(() => K.value.reduce((e, t) => ({
109
- ...e,
110
- amount: e.amount + t.balanceDueAmount.amount
111
- }), {
112
- ...u.dunningCase.outstandingBalance,
113
- amount: 0
114
- })), J = m(() => re(K.value, u.dunningCase.outstandingBalance)), Bt = m(() => J.value.map((e, t) => ({
115
- amount: e,
116
- level: t
117
- })));
118
- function Vt(e) {
119
- return q.value.amount === 0 ? 0 : e / q.value.amount * 100;
120
- }
121
- let Y = m(() => I.getCustomerDetailRoute(u.dunningCase.customer.uuid)), Ht = m(() => [{
122
- label: d.t("module.dunning_case.title"),
123
- to: { name: "dunning-case-overview" }
124
- }, { label: u.dunningCase.customer.name }]);
125
- function Ut() {
126
- Y.value !== null && L.push(Y.value);
127
- }
128
- function X(e) {
129
- return e === 0 ? d.t("module.dunning_case.detail.overdue") : $(e);
130
- }
131
- function Z(e, t) {
132
- return d.t("module.dunning_case.detail.outstanding_split_tooltip", {
133
- amount: j.formatMonetary(t),
134
- label: X(e)
135
- });
136
- }
137
- function Wt(e) {
138
- return e.type === "credit-note" || e.type === "payment" || e.type === "reminder-due" ? P.formatPlainDate(e.date) : P.toDateTime(e.date);
139
- }
140
- function Gt(e) {
141
- switch (e.type) {
142
- case "case-closed": return d.t("module.dunning_case.detail.case_closed");
143
- case "credit-note": return d.t("module.dunning_case.detail.credit_note_activity", {
144
- amount: j.formatMonetary(e.amount),
145
- sequence: e.sequence
146
- });
147
- case "payment": return d.t("module.dunning_case.detail.payment_activity", {
148
- amount: j.formatMonetary(e.amount),
149
- invoice: e.invoiceSequence
150
- });
151
- case "reminder-due": return d.t("module.dunning_case.detail.reminder_due", { level: u.dunningCase.level });
152
- case "reminder-sent": return d.t("module.dunning_case.detail.reminder_sent");
153
- }
154
- }
155
- function Kt(e) {
156
- if (e.type === "reminder-due") return d.t("module.dunning_case.detail.today");
157
- let t = Wt(e);
158
- return e.type === "payment" && e.settlementStatus === n.PARTIALLY_PAID ? d.t("module.dunning_case.detail.payment_partially_paid", { date: t }) : t;
159
- }
160
- function Q(e) {
161
- return e.dueOn.until(k.Now.plainDateISO(), { largestUnit: "days" }).days;
162
- }
163
- function qt(e) {
164
- let t = Q(e);
165
- return t > 0 ? d.t("module.dunning_case.detail.days_ago", { count: t }) : t === 0 ? d.t("module.dunning_case.overview.due_today") : d.t("module.dunning_case.overview.due_in_days", { count: Math.abs(t) });
166
- }
167
- function $(e) {
168
- return e === 0 ? d.t("module.dunning_case.level.none") : d.t("module.dunning_case.level.reminder", { level: e });
169
- }
170
- function Jt(e) {
171
- switch (e) {
172
- case n.PARTIALLY_PAID: return "warning";
173
- case n.CREDITED:
174
- case n.OVERPAID:
175
- case n.PAID:
176
- case n.SETTLED: return "success";
177
- case n.UNPAID: return "error";
178
- }
179
- }
180
- function Yt() {
181
- x.create(ae, { props: { dunningCaseUuid: u.dunningCase.uuid } }).open();
182
- }
183
- function Xt(e) {
184
- B.value = B.value === e ? null : e;
185
- }
186
- return (e, t) => (C(), h(D(de), {
187
- breadcrumbs: Ht.value,
188
- title: u.dunningCase.customer.name
189
- }, {
190
- default: O(() => [b(D(fe), null, {
191
- default: O(() => [v("div", ye, [
192
- v("div", be, [v("div", null, [
193
- v("div", xe, [
194
- v("h2", Se, [Y.value === null ? (C(), _("span", Ce, E(u.dunningCase.customer.name), 1)) : (C(), _("button", {
195
- key: 0,
196
- class: "hover:underline",
197
- type: "button",
198
- onClick: Ut
199
- }, E(u.dunningCase.customer.name), 1))]),
200
- v("span", we, [b(a, { level: u.dunningCase.level }, null, 8, ["level"]), y(" " + E($(u.dunningCase.level)), 1)]),
201
- b(ne, {
202
- "blocked-reason": null,
203
- status: G.value
204
- }, null, 8, ["status"])
205
- ]),
206
- u.dunningCase.customer.vatNumber || u.dunningCase.customer.email ? (C(), _("p", Te, E([u.dunningCase.customer.vatNumber, u.dunningCase.customer.email].filter(Boolean).join(" · ")), 1)) : g("", !0),
207
- v("p", Ee, E(D(d).t("module.dunning_case.detail.last_synced", { date: D(P).toDateTime(u.dunningCase.updatedAt) })), 1)
208
- ]), u.dunningCase.canSendReminder ? (C(), h(D(ue), {
209
- key: 0,
210
- "icon-right": D(l),
211
- "is-loading": G.value === "sending",
212
- label: D(d).t("module.dunning_case.detail.send"),
213
- class: "w-fit self-start lg:ml-auto",
214
- size: "sm",
215
- onClick: Yt
216
- }, null, 8, [
217
- "icon-right",
218
- "is-loading",
219
- "label"
220
- ])) : g("", !0)]),
221
- v("div", De, [
222
- v("div", Oe, [
223
- v("p", ke, E(D(d).t("module.dunning_case.detail.outstanding")), 1),
224
- v("p", Ae, E(D(j).formatMonetary(u.dunningCase.outstandingBalance)), 1),
225
- v("p", je, E(D(d).t("module.dunning_case.detail.collected_summary", {
226
- billed: D(j).formatMonetary(u.dunningCase.totalInvoiced),
227
- collected: D(j).formatMonetary(u.dunningCase.totalPaid)
228
- })), 1),
229
- u.dunningCase.totalCredited.amount > 0 ? (C(), _("p", Me, E(D(d).t("module.dunning_case.detail.credited_summary", { credited: D(j).formatMonetary(u.dunningCase.totalCredited) })), 1)) : g("", !0),
230
- v("div", Ne, [(C(!0), _(p, null, T(J.value, (e, t) => (C(), _("span", {
231
- key: t,
232
- class: S([{
233
- "bg-quaternary": t === 0,
234
- "bg-brand-500": t === 1,
235
- "bg-error-solid": t === 3,
236
- "bg-warning-solid": t === 2
237
- }, "h-full"]),
238
- style: se({ width: `${Vt(e.amount)}%` })
239
- }, null, 6))), 128))])
240
- ]),
241
- v("div", Pe, [(C(!0), _(p, null, T(Bt.value, (e) => (C(), h(D(he), {
242
- key: e.level,
243
- "popover-side-offset": 8,
244
- "popover-align": "start",
245
- "popover-side": "top"
246
- }, {
247
- trigger: O(() => [v("button", {
248
- "aria-label": Z(e.level, e.amount),
249
- class: "flex min-w-0 items-center justify-between gap-lg rounded-sm border-none bg-transparent p-none text-left hover:bg-secondary focus-visible:outline-2 focus-visible:outline-brand-500 xl:flex-row xl:items-center xl:gap-lg",
250
- type: "button"
251
- }, [v("span", Ie, [v("span", { class: S([{
252
- "bg-quaternary": e.level === 0,
253
- "bg-brand-500": e.level === 1,
254
- "bg-error-solid": e.level === 3,
255
- "bg-warning-solid": e.level === 2
256
- }, "size-(--spacing-sm) shrink-0 rounded-full"]) }, null, 2), v("span", Le, E(X(e.level)), 1)]), v("span", Re, E(D(j).formatMonetary(e.amount)), 1)], 8, Fe)]),
257
- content: O(() => [b(D(ge), { class: "max-w-80! text-sm!" }, {
258
- default: O(() => [y(E(Z(e.level, e.amount)), 1)]),
259
- _: 2
260
- }, 1024)]),
261
- _: 2
262
- }, 1024))), 128))]),
263
- v("div", ze, [v("span", Be, [b(D(o), { class: "size-(--spacing-xl) text-brand-700" })]), v("div", Ve, [v("p", He, E(D(d).t("module.dunning_case.detail.next_reminder")), 1), v("p", Ue, E(u.dunningCase.nextReminderOn === null ? D(d).t("module.dunning_case.overview.not_scheduled") : D(P).formatPlainDate(u.dunningCase.nextReminderOn)), 1)])]),
264
- v("div", We, [v("span", Ge, [b(D(s), { class: "size-(--spacing-xl) text-brand-700" })]), v("div", null, [
265
- v("p", Ke, E(D(d).t("module.dunning_case.detail.invoices")), 1),
266
- v("p", qe, E(u.dunningCase.invoices.length), 1),
267
- W.value > 0 ? (C(), _("p", Je, E(D(d).t("module.dunning_case.detail.protested_count", { count: W.value })), 1)) : g("", !0)
268
- ])])
269
- ]),
270
- v("div", Ye, [v("main", Xe, [v("div", Ze, [
271
- v("div", Qe, [b(D(pe), {
272
- modelValue: R.value,
273
- "onUpdate:modelValue": t[0] ||= (e) => R.value = e,
274
- "aria-label": D(d).t("module.dunning_case.detail.invoice_tabs"),
275
- variant: "underline"
276
- }, {
277
- default: O(() => [b(D(me), null, {
278
- default: O(() => [b(D(M), {
279
- label: D(d).t("module.dunning_case.detail.overdue_invoices"),
280
- value: "overdue"
281
- }, null, 8, ["label"]), b(D(M), {
282
- label: D(d).t("module.dunning_case.detail.outstanding_invoices"),
283
- value: "outstanding"
284
- }, null, 8, ["label"])]),
285
- _: 1
286
- })]),
287
- _: 1
288
- }, 8, ["modelValue", "aria-label"])]),
289
- v("div", $e, [U.value.length > 0 ? (C(), _("table", et, [v("thead", null, [v("tr", tt, [
290
- v("th", nt, E(D(d).t("module.dunning_case.detail.table.invoice")), 1),
291
- v("th", rt, E(D(d).t("module.dunning_case.detail.table.due_date")), 1),
292
- v("th", it, E(D(d).t("module.dunning_case.detail.table.level")), 1),
293
- v("th", at, E(D(d).t("module.dunning_case.detail.table.status")), 1),
294
- v("th", ot, E(D(d).t("module.dunning_case.detail.table.remaining")), 1)
295
- ])]), v("tbody", null, [(C(!0), _(p, null, T(U.value, (e) => (C(), _(p, { key: e.uuid }, [v("tr", { class: S([{ "opacity-60": e.isDisputed }, "border-b border-secondary"]) }, [
296
- v("td", { class: S([{
297
- "before:opacity-0": B.value !== e.uuid,
298
- "before:opacity-100": B.value === e.uuid
299
- }, "relative px-xl py-md before:absolute before:inset-y-0 before:left-0 before:w-(--spacing-xxs) before:bg-brand-500"]) }, [v("div", st, [z(e) ? (C(), _("button", {
300
- key: 0,
301
- "aria-expanded": B.value === e.uuid,
302
- "aria-label": D(d).t(B.value === e.uuid ? "module.dunning_case.detail.collapse_updates" : "module.dunning_case.detail.expand_updates", { invoice: e.sequence }),
303
- class: "mt-xxs flex size-(--spacing-xl) shrink-0 items-center justify-center text-secondary hover:text-primary",
304
- type: "button",
305
- onClick: (t) => Xt(e.uuid)
306
- }, [b(D(ee), { class: S([{ "rotate-180": B.value === e.uuid }, "size-(--spacing-xl) transition-transform duration-200 ease-out motion-reduce:transition-none"]) }, null, 8, ["class"])], 8, ct)) : (C(), _("span", lt)), v("div", N, [b(D(ce), {
307
- to: {
308
- name: "invoicing-invoice-detail",
309
- params: { invoiceUuid: e.uuid }
310
- },
311
- class: "font-mono text-xs font-medium text-primary hover:underline"
312
- }, {
313
- default: O(() => [y(E(e.sequence), 1)]),
314
- _: 2
315
- }, 1032, ["to"]), e.subject === null ? g("", !0) : (C(), _("p", ut, E(e.subject), 1))])])], 2),
316
- v("td", dt, [v("span", { class: S([e.isDisputed ? "text-secondary" : Q(e) > 0 ? "text-error-primary" : "text-primary", "inline-flex items-center gap-xs whitespace-nowrap"]) }, [y(E(D(P).formatPlainDate(e.dueOn)) + " ", 1), v("span", { class: S([!e.isDisputed && Q(e) > 0 ? "\n border-error bg-error-primary\n text-error-primary\n " : "border-secondary bg-secondary text-secondary", "rounded-sm border px-sm py-px font-sans text-xs"]) }, E(qt(e)), 3)], 2)]),
317
- v("td", ft, [e.isDisputed ? (C(), h(D(A), {
318
- key: 0,
319
- label: D(d).t("module.dunning_case.detail.protested"),
320
- color: "error",
321
- size: "sm",
322
- variant: "translucent"
323
- }, null, 8, ["label"])) : R.value === "overdue" ? (C(), _("span", pt, [b(a, {
324
- level: e.level,
325
- size: "sm"
326
- }, null, 8, ["level"]), y(" " + E(e.level === 0 ? "–" : e.level), 1)])) : g("", !0)]),
327
- v("td", mt, [v("div", ht, [e.isDisputed ? (C(), _("p", gt, E(D(d).t("module.dunning_case.detail.excluded")), 1)) : R.value === "outstanding" ? (C(), h(D(A), {
328
- key: 1,
329
- label: D(d).t("module.dunning_case.detail.not_yet_due"),
330
- color: "gray",
331
- size: "sm",
332
- variant: "translucent"
333
- }, null, 8, ["label"])) : (C(), h(D(A), {
334
- key: 2,
335
- label: D(d).t(`module.dunning_case.settlement_status.${e.settlementStatus}`),
336
- color: Jt(e.settlementStatus),
337
- size: "sm",
338
- variant: "translucent"
339
- }, null, 8, ["label", "color"]))])]),
340
- v("td", _t, [v("p", vt, E(D(j).formatMonetary(e.balanceDueAmount)), 1), e.balanceDueAmount.amount === e.grossAmount.amount ? g("", !0) : (C(), _("p", yt, " /" + E(D(j).formatMonetary(e.grossAmount)), 1))])
341
- ], 2), z(e) ? (C(), _("tr", {
342
- key: `${e.uuid}-updates`,
343
- class: S({ "border-b border-secondary": B.value === e.uuid }),
344
- "aria-hidden": B.value !== e.uuid
345
- }, [v("td", xt, [v("div", { class: S([B.value === e.uuid ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0", "grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none"]) }, [v("div", St, [v("div", Ct, [(C(!0), _(p, null, T(e.payments, (e) => (C(), _("span", {
346
- key: e.uuid,
347
- class: "inline-flex items-center gap-sm rounded-sm bg-success-primary px-md py-sm text-success-primary"
348
- }, [t[1] ||= v("span", { class: "size-(--spacing-sm) shrink-0 rounded-full bg-success-solid" }, null, -1), y(" " + E(D(d).t("module.dunning_case.detail.payment_line", {
349
- amount: D(j).formatMonetary(e.amount),
350
- date: D(P).formatPlainDate(e.date)
351
- })), 1)]))), 128)), (C(!0), _(p, null, T(e.creditNotes, (e) => (C(), _("span", {
352
- key: e.uuid,
353
- class: "inline-flex items-center gap-sm rounded-sm bg-secondary px-md py-sm text-secondary"
354
- }, [t[2] ||= v("span", { class: "size-(--spacing-sm) shrink-0 rounded-full bg-quaternary" }, null, -1), y(" " + E(D(d).t("module.dunning_case.detail.credit_note_line", {
355
- amount: D(j).formatMonetary(e.grossAmount),
356
- date: D(P).formatPlainDate(e.finalizedOn),
357
- sequence: e.sequence
358
- })), 1)]))), 128))])])], 2)])], 10, bt)) : g("", !0)], 64))), 128))])])) : (C(), _("div", wt, [v("span", Tt, [b(D(c), { class: "size-(--spacing-xl) text-primary" })]), v("p", Et, E(D(d).t(R.value === "overdue" ? "module.dunning_case.detail.empty_overdue" : "module.dunning_case.detail.empty_outstanding")), 1)]))]),
359
- R.value === "overdue" ? (C(), _("div", Dt, [v("div", Ot, [v("span", null, E(D(d).t("module.dunning_case.detail.total_outstanding")), 1), v("span", kt, E(D(j).formatMonetary(q.value)), 1)]), v("div", At, [v("span", null, E(u.dunningCase.level === 0 ? D(d).t("module.dunning_case.detail.reminder_fee") : D(d).t("module.dunning_case.detail.fee", { level: u.dunningCase.level })), 1), v("span", jt, E(D(j).formatMonetary(u.dunningCase.totalFee)), 1)])])) : g("", !0)
360
- ])]), v("aside", Mt, [v("h2", Nt, E(D(d).t("module.dunning_case.detail.activity")), 1), v("ol", Pt, [(C(!0), _(p, null, T(V.value, (e, t) => (C(), _("li", {
361
- key: e.key,
362
- class: "flex gap-md"
363
- }, [v("div", Ft, [v("span", { class: S([{
364
- "bg-brand-100": e.type === "reminder-sent",
365
- "bg-error-secondary": e.type === "reminder-due",
366
- "bg-success-secondary": e.type === "payment" || e.type === "case-closed",
367
- "bg-tertiary": e.type === "credit-note"
368
- }, "flex size-(--spacing-3xl) shrink-0 items-center justify-center rounded-full"]) }, [e.type === "reminder-due" ? (C(), h(D(o), {
369
- key: 0,
370
- class: "size-(--spacing-lg) text-error-primary"
371
- })) : e.type === "payment" ? (C(), h(D(te), {
372
- key: 1,
373
- class: "size-(--spacing-lg) text-success-primary"
374
- })) : e.type === "credit-note" ? (C(), h(D(s), {
375
- key: 2,
376
- class: "size-(--spacing-lg) text-secondary"
377
- })) : e.type === "reminder-sent" ? (C(), h(D(l), {
378
- key: 3,
379
- class: "size-(--spacing-lg) text-brand-tertiary"
380
- })) : e.type === "case-closed" ? (C(), h(D(c), {
381
- key: 4,
382
- class: "size-(--spacing-lg) text-success-primary"
383
- })) : g("", !0)], 2), t < V.value.length - 1 ? (C(), _("span", It)) : g("", !0)]), v("div", { class: S([{ "pb-xl": t < V.value.length - 1 }, "pt-xs"]) }, [v("p", Lt, E(Gt(e)), 1), v("p", Rt, E(Kt(e)), 1)], 2)]))), 128))])])])
384
- ])]),
385
- _: 1
386
- })]),
387
- _: 1
388
- }, 8, ["breadcrumbs", "title"]));
389
- }
390
- }), F = /*@__PURE__*/ x({
391
- __name: "DunningCaseDetailViewDataProvider",
392
- props: { dunningCaseUuid: {} },
393
- setup(e) {
394
- let t = e, n = f(), r = u(m(() => t.dunningCaseUuid)), i = m(() => [{
395
- label: n.t("module.dunning_case.title"),
396
- to: { name: "dunning-case-overview" }
397
- }, {
398
- isLoading: !0,
399
- label: ""
400
- }]);
401
- return (e, t) => (C(), h(d, { queries: { dunningCase: D(r) } }, {
402
- default: O(({ data: e }) => [b(P, { "dunning-case": e.dunningCase }, null, 8, ["dunning-case"])]),
403
- loading: O(() => [b(D(j), { breadcrumbs: i.value }, null, 8, ["breadcrumbs"])]),
404
- _: 1
405
- }, 8, ["queries"]));
406
- }
407
- }), I = /* @__PURE__ */ e({ default: () => L }), L = F;
408
- //#endregion
409
- export { I as n, L as t };