@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,1892 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import "./api.util-CkIRZS3h.js";
3
+ import { T as t, _ as n, a as r, b as i, c as a, d as o, k as s, l as c, o as l, t as u, u as d, v as f, x as p, y as m } from "./documentTitle.composable-CRJjS6p-.js";
4
+ import { n as h, r as g, t as _ } from "./useCurrencyFormat.composable-MtZaqKnO.js";
5
+ import { t as v } from "./search.composable-CU9OpyUB.js";
6
+ import { t as y } from "./src-DUSgQTKr.js";
7
+ import { t as b } from "./invoice.service-B1w16_Md.js";
8
+ import { r as x, t as S } from "./plainDate.transformer-Bhiz9jW7.js";
9
+ import { $ as ee, G as te, O as ne, W as re, X as ie, dt as C, i as ae, u as oe } from "./dist-BD7Allff.js";
10
+ import { n as se, t as ce } from "./customerUuid.model-ClN4Vi9n.js";
11
+ import { n as le } from "./dist-boJIIxnT.js";
12
+ import { t as ue } from "./DataProvider-C3uEds9v.js";
13
+ import { a as de, c as fe, d as w, f as pe, i as me, l as T, n as he, o as ge, r as E, s as _e, t as ve, u as ye } from "./dist-D5agTXFI.js";
14
+ import { t as be } from "./formango.util-D5c2ql--.js";
15
+ import { i as xe, n as Se, r as Ce, t as we } from "./CustomFieldValueText-BjRVovZL.js";
16
+ import { t as D } from "./invoiceApprovalStatus.util-DohOKR4q.js";
17
+ import { n as Te, t as Ee } from "./InvoiceApprovalOutOfSyncIndicator-CP2GLaeh.js";
18
+ import { a as De, i as Oe, n as ke, o as Ae, r as je, t as O } from "./invoiceIndexCache.util-jHsrFwcA.js";
19
+ import { t as Me } from "./InvoiceApprovalStatusBadge-CcX8agTF.js";
20
+ import { t as Ne } from "./issuerSettings.query-CDFk2GiP.js";
21
+ import { t as Pe } from "./dashboard-BaWGNEek.js";
22
+ import { z as k } from "zod";
23
+ import { useI18n as A } from "vue-i18n";
24
+ import { Fragment as Fe, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createTextVNode as Ie, createVNode as I, defineComponent as L, isRef as Le, mergeModels as Re, mergeProps as ze, normalizeClass as Be, onMounted as Ve, openBlock as R, ref as z, renderList as He, renderSlot as Ue, shallowRef as We, toDisplayString as B, unref as V, useModel as Ge, watch as Ke, withCtx as H } from "vue";
25
+ import { useMutation as U, useOffsetInfiniteQuery as qe } from "@wisemen/vue-core-api-utils";
26
+ import { useLocalStorage as Je, watchDebounced as Ye } from "@vueuse/core";
27
+ import { RouterLink as Xe, useRouter as Ze } from "vue-router";
28
+ import { Temporal as Qe } from "temporal-polyfill";
29
+ import { UIAutocomplete as $e, UIBadge as et, UIButton as W, UICheckbox as tt, UIColumnLayout as G, UIDashboardPage as nt, UIDashboardPageActions as rt, UIDateRangePicker as it, UIDialog as at, UIDialogBody as ot, UIDialogFooter as st, UIDialogFooterCancel as ct, UIDialogFooterPrimary as lt, UIDialogFooterSubmit as ut, UIDialogHeader as dt, UIFormDialog as ft, UILoader as pt, UIPopover as mt, UIRowLayout as K, UITable as ht, UITableCell as q, UITableCellInteractiveElement as gt, UITableCellText as _t, UITabs as vt, UITabsItem as yt, UITabsList as bt, UIText as J, UITextField as xt, UITooltip as St, UITooltipContent as Ct, createAutocompleteOptions as wt, createComponent as Y, defineTableColumns as Tt, useOverlay as Et, useTableCustomizeColumns as Dt, useToast as X } from "@wisemen/vue-core-design-system";
30
+ import { useForm as Ot } from "formango";
31
+ import { useRouteQuery as kt } from "@vueuse/router";
32
+ //#region src/modules/invoice/api/queries/invoiceIndex.query.ts
33
+ function At(e) {
34
+ let t = j(() => ({
35
+ filters: e?.params?.filters?.value,
36
+ search: e?.params?.search?.value,
37
+ sort: e?.params?.sort?.value ?? []
38
+ }));
39
+ return qe("invoiceIndex", {
40
+ params: { queryParams: t },
41
+ queryFn: (t) => b.getAll({
42
+ filters: e?.params?.filters?.value,
43
+ pagination: t,
44
+ search: e?.params?.search?.value,
45
+ sort: e?.params?.sort?.value ?? []
46
+ })
47
+ });
48
+ }
49
+ //#endregion
50
+ //#region src/modules/invoice/api/mutations/invoiceCreate.mutation.ts
51
+ function jt() {
52
+ return U({
53
+ queryFn: (e) => b.create(e.body),
54
+ queryKeysToInvalidate: { invoiceIndex: {} }
55
+ });
56
+ }
57
+ //#endregion
58
+ //#region src/modules/invoice/components/form/InvoiceFormCustomerField.vue
59
+ var Mt = /* @__PURE__ */ L({
60
+ __name: "InvoiceFormCustomerField",
61
+ props: {
62
+ isLoading: { type: Boolean },
63
+ customers: {},
64
+ field: {}
65
+ },
66
+ emits: ["nextPage", "updateSearch"],
67
+ setup(e, { emit: t }) {
68
+ let n = e, r = t, i = A(), a = j(() => wt(n.customers));
69
+ function s(e) {
70
+ return e.name;
71
+ }
72
+ function c(e) {
73
+ switch (e) {
74
+ case o.BUSINESS: return i.t("wise_invoicing.customer.type.business");
75
+ case o.INDIVIDUAL: return i.t("wise_invoicing.customer.type.individual");
76
+ }
77
+ return "-";
78
+ }
79
+ function l(e) {
80
+ return { description: {
81
+ layout: "block",
82
+ value: c(e.type)
83
+ } };
84
+ }
85
+ function u(e) {
86
+ r("updateSearch", e);
87
+ }
88
+ function d(e) {
89
+ n.field.setValue(e), e !== null && r("updateSearch", "");
90
+ }
91
+ return (e, t) => (R(), M(V($e), ze(V(be)(n.field), {
92
+ "display-fn": s,
93
+ "get-item-config": l,
94
+ "is-loading": n.isLoading,
95
+ "is-required": !0,
96
+ items: a.value,
97
+ label: V(i).t("wise_invoicing.invoice.create.fields.customer"),
98
+ placeholder: V(i).t("component.autocomplete.search_placeholder"),
99
+ "search-mode": "remote",
100
+ onNextPage: t[0] ||= (e) => r("nextPage"),
101
+ "onUpdate:modelValue": d,
102
+ "onUpdate:search": u
103
+ }), null, 16, [
104
+ "is-loading",
105
+ "items",
106
+ "label",
107
+ "placeholder"
108
+ ]));
109
+ }
110
+ }), Nt = k.enum(o), Pt = k.object({
111
+ uuid: ce,
112
+ name: k.string().min(1),
113
+ type: Nt
114
+ }), Ft = k.object({ customer: Pt }), It = /* @__PURE__ */ L({
115
+ __name: "InvoiceCreateDialog",
116
+ emits: ["close"],
117
+ setup(e, { emit: t }) {
118
+ let n = t, r = A(), i = X(), a = Ze(), o = jt(), s = v({ debounceMs: 250 }), c = Te({ params: { search: s.debouncedSearch } }), l = j(() => c.result.value.match({
119
+ err: () => [],
120
+ loading: () => [],
121
+ ok: (e) => e.data
122
+ })), u = Ot({
123
+ initialState: { customer: null },
124
+ schema: Ft,
125
+ onSubmit: async (e) => {
126
+ let t = await o.execute({ body: e });
127
+ if (t.isErr()) {
128
+ i.apiError(t.error);
129
+ return;
130
+ }
131
+ n("close"), await a.push({
132
+ name: "invoicing-invoice-detail",
133
+ params: { invoiceUuid: t.value }
134
+ });
135
+ }
136
+ }), d = u.register("customer");
137
+ function f(e) {
138
+ s.updateSearch(e);
139
+ }
140
+ return (e, t) => (R(), M(V(ft), {
141
+ form: V(u),
142
+ size: "xs",
143
+ onClose: t[0] ||= (e) => n("close")
144
+ }, {
145
+ default: H(() => [
146
+ I(V(dt), {
147
+ title: V(r).t("wise_invoicing.invoice.create.modal_title"),
148
+ description: V(r).t("wise_invoicing.invoice.create.modal_description"),
149
+ icon: V(re)
150
+ }, null, 8, [
151
+ "title",
152
+ "description",
153
+ "icon"
154
+ ]),
155
+ I(V(ot), null, {
156
+ default: H(() => [I(Mt, {
157
+ customers: l.value,
158
+ field: V(d),
159
+ "is-loading": V(c).isLoading.value,
160
+ onNextPage: V(c).fetchNextPage,
161
+ onUpdateSearch: f
162
+ }, null, 8, [
163
+ "customers",
164
+ "field",
165
+ "is-loading",
166
+ "onNextPage"
167
+ ])]),
168
+ _: 1
169
+ }),
170
+ I(V(st), null, {
171
+ right: H(() => [I(V(ct), { label: "cancel" }), I(V(ut), { label: V(r).t("wise_invoicing.invoice.create.confirm") }, null, 8, ["label"])]),
172
+ _: 1
173
+ })
174
+ ]),
175
+ _: 1
176
+ }, 8, ["form"]));
177
+ }
178
+ }), Lt = {
179
+ key: 0,
180
+ class: "pointer-events-none fixed inset-x-0 bottom-4 z-20 flex justify-center px-lg"
181
+ }, Rt = /* @__PURE__ */ L({
182
+ __name: "InvoiceOverviewBulkActionBar",
183
+ props: {
184
+ canFinalize: { type: Boolean },
185
+ canMarkAsReady: { type: Boolean },
186
+ canSelectAll: { type: Boolean },
187
+ canSend: { type: Boolean },
188
+ canSendApproval: { type: Boolean },
189
+ selectedCount: {}
190
+ },
191
+ emits: [
192
+ "cancel",
193
+ "finalize",
194
+ "markAsReady",
195
+ "selectAll",
196
+ "send",
197
+ "sendApproval"
198
+ ],
199
+ setup(e, { emit: t }) {
200
+ let n = e, r = t, i = A();
201
+ return (e, t) => n.selectedCount > 0 ? (R(), P("div", Lt, [I(V(K), { class: "pointer-events-auto rounded-xl border border-secondary bg-primary px-lg py-sm shadow-lg" }, {
202
+ default: H(() => [
203
+ I(V(J), {
204
+ text: V(i).t("wise_invoicing.invoice.overview.bulk.selected_documents", { count: n.selectedCount }),
205
+ class: "text-sm text-secondary"
206
+ }, null, 8, ["text"]),
207
+ n.canMarkAsReady ? (R(), M(V(W), {
208
+ key: 0,
209
+ label: V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.action"),
210
+ onClick: t[0] ||= (e) => r("markAsReady")
211
+ }, null, 8, ["label"])) : N("", !0),
212
+ n.canFinalize ? (R(), M(V(W), {
213
+ key: 1,
214
+ label: V(i).t("wise_invoicing.invoice.overview.bulk.finalize.action"),
215
+ onClick: t[1] ||= (e) => r("finalize")
216
+ }, null, 8, ["label"])) : N("", !0),
217
+ n.canSend ? (R(), M(V(W), {
218
+ key: 2,
219
+ label: V(i).t("wise_invoicing.invoice.overview.bulk.send.action"),
220
+ onClick: t[2] ||= (e) => r("send")
221
+ }, null, 8, ["label"])) : N("", !0),
222
+ n.canSendApproval ? (R(), M(V(W), {
223
+ key: 3,
224
+ label: V(i).t("wise_invoicing.invoice.overview.bulk.send_approval.action"),
225
+ onClick: t[3] ||= (e) => r("sendApproval")
226
+ }, null, 8, ["label"])) : N("", !0),
227
+ n.canSelectAll ? (R(), M(V(W), {
228
+ key: 4,
229
+ label: V(i).t("wise_invoicing.invoice.overview.bulk.select_all"),
230
+ variant: "secondary",
231
+ onClick: t[4] ||= (e) => r("selectAll")
232
+ }, null, 8, ["label"])) : N("", !0),
233
+ I(V(W), {
234
+ label: V(i).t("wise_invoicing.invoice.overview.bulk.cancel"),
235
+ variant: "tertiary",
236
+ onClick: t[5] ||= (e) => r("cancel")
237
+ }, null, 8, ["label"])
238
+ ]),
239
+ _: 1
240
+ })])) : N("", !0);
241
+ }
242
+ });
243
+ //#endregion
244
+ //#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewBulkSendEligibility.composable.ts
245
+ function zt(e) {
246
+ let t = z(null), n = j(() => e.selectedInvoices().filter((e) => e.status === i.FINALIZED).map((e) => e.uuid)), r = j(() => n.value.toSorted().join(","));
247
+ return Ye(r, async (e) => {
248
+ let i = n.value;
249
+ if (i.length === 0) {
250
+ t.value = null;
251
+ return;
252
+ }
253
+ let a = await b.previewBulkSend(i);
254
+ r.value === e && (t.value = a.isErr() ? i.length : a.value.meta.processed);
255
+ }, { debounce: 300 }), { canSend: j(() => n.value.length > 0 && (t.value ?? 0) > 0) };
256
+ }
257
+ //#endregion
258
+ //#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewCustomFieldFilter.util.ts
259
+ function Z(e) {
260
+ return Array.isArray(e) && e.every((e) => typeof e == "string");
261
+ }
262
+ function Bt(e, t) {
263
+ try {
264
+ switch (e) {
265
+ case d.DATE: return S.toDto(S.fromDto(t));
266
+ case d.TIMESTAMP: return x.toDto(x.fromDto(t));
267
+ default: return t;
268
+ }
269
+ } catch {
270
+ return null;
271
+ }
272
+ }
273
+ var Q = class {
274
+ static getFreeformOptions(e, t) {
275
+ let n = t.trim();
276
+ if (n.length === 0) return [];
277
+ let r = Bt(e.type, n);
278
+ return r === null ? [] : [r];
279
+ }
280
+ static getKey(e) {
281
+ return `custom-field-${e.uuid}`;
282
+ }
283
+ static getMajorUnitRule(e, t, n) {
284
+ let r = this.getRuleNumber(e, t);
285
+ return r === void 0 || n === void 0 ? void 0 : _(r, n);
286
+ }
287
+ static getMonetaryCurrency(e, t) {
288
+ let n = e.rules?.currencies;
289
+ if (!Array.isArray(n)) return t;
290
+ let r = new Set(Object.values(a)), i = n.filter((e) => typeof e == "string" && r.has(e));
291
+ return i.includes(t) ? t : i[0] ?? t;
292
+ }
293
+ static getRuleNumber(e, t) {
294
+ let n = e.rules?.[t];
295
+ return typeof n == "number" ? n : void 0;
296
+ }
297
+ static toFilters(e, t, n) {
298
+ switch (e.type) {
299
+ case d.BOOLEAN: return typeof t == "boolean" ? [{
300
+ definitionUuid: e.uuid,
301
+ type: d.BOOLEAN,
302
+ value: t
303
+ }] : [];
304
+ case d.MONETARY: {
305
+ let r = this.getRuleNumber(e, "precision"), i = this.getMonetaryCurrency(e, n);
306
+ return typeof t == "number" && r !== void 0 ? [{
307
+ definitionUuid: e.uuid,
308
+ type: d.MONETARY,
309
+ value: {
310
+ amount: h(t, r),
311
+ currency: i,
312
+ precision: r
313
+ }
314
+ }] : [];
315
+ }
316
+ case d.NUMBER: return typeof t == "number" ? [{
317
+ definitionUuid: e.uuid,
318
+ type: d.NUMBER,
319
+ value: t
320
+ }] : [];
321
+ case d.MULTI_SELECT: return Z(t) && t.length > 0 ? [{
322
+ definitionUuid: e.uuid,
323
+ type: d.MULTI_SELECT,
324
+ value: t
325
+ }] : [];
326
+ case d.TEXT_ARRAY: return Z(t) && t.length > 0 ? [{
327
+ definitionUuid: e.uuid,
328
+ type: d.TEXT_ARRAY,
329
+ value: t
330
+ }] : [];
331
+ case d.DATE: return Z(t) ? t.map((t) => ({
332
+ definitionUuid: e.uuid,
333
+ type: d.DATE,
334
+ value: t
335
+ })) : [];
336
+ case d.SINGLE_SELECT: return Z(t) ? t.map((t) => ({
337
+ definitionUuid: e.uuid,
338
+ type: d.SINGLE_SELECT,
339
+ value: t
340
+ })) : [];
341
+ case d.TEXT: return Z(t) ? t.map((t) => ({
342
+ definitionUuid: e.uuid,
343
+ type: d.TEXT,
344
+ value: t
345
+ })) : [];
346
+ case d.TIMESTAMP: return Z(t) ? t.map((t) => ({
347
+ definitionUuid: e.uuid,
348
+ type: d.TIMESTAMP,
349
+ value: t
350
+ })) : [];
351
+ default: throw TypeError("Unsupported custom field definition type");
352
+ }
353
+ }
354
+ };
355
+ //#endregion
356
+ //#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewDataTableFilters.composable.ts
357
+ function Vt(e) {
358
+ let t = A(), n = v({ debounceMs: 250 }), i = Te({ params: { search: n.debouncedSearch } }), a = j(() => i.result.value.match({
359
+ err: () => [],
360
+ loading: () => [],
361
+ ok: (e) => e.data
362
+ })), o = e.customFieldDefinitions.map((n) => {
363
+ let r = Q.getKey(n), i = Ce.getLabel(n, t.locale.value);
364
+ switch (n.type) {
365
+ case d.BOOLEAN: return fe({
366
+ entityLabel: i,
367
+ key: r,
368
+ label: i
369
+ });
370
+ case d.MONETARY: {
371
+ let t = Q.getRuleNumber(n, "precision"), a = Q.getMonetaryCurrency(n, e.currency);
372
+ return w({
373
+ customUnit: a,
374
+ defaultValue: {
375
+ operator: ye.EQUALS,
376
+ value: null
377
+ },
378
+ disableOperators: !0,
379
+ key: r,
380
+ label: i,
381
+ max: Q.getMajorUnitRule(n, "max", t),
382
+ min: Q.getMajorUnitRule(n, "min", t),
383
+ step: t === void 0 ? void 0 : 1 / 10 ** t
384
+ });
385
+ }
386
+ case d.NUMBER: return w({
387
+ defaultValue: {
388
+ operator: ye.EQUALS,
389
+ value: null
390
+ },
391
+ disableOperators: !0,
392
+ key: r,
393
+ label: i,
394
+ max: Q.getRuleNumber(n, "max"),
395
+ min: Q.getRuleNumber(n, "min")
396
+ });
397
+ case d.MULTI_SELECT:
398
+ case d.SINGLE_SELECT: return de({
399
+ defaultValue: {
400
+ operator: E.INCLUDES,
401
+ value: []
402
+ },
403
+ disableOperators: !0,
404
+ displayFn: (e) => Ce.getChoiceLabel(n, e, t.locale.value),
405
+ key: r,
406
+ label: i,
407
+ options: () => n.choices.map((e) => e.value)
408
+ });
409
+ case d.DATE:
410
+ case d.TEXT:
411
+ case d.TEXT_ARRAY:
412
+ case d.TIMESTAMP: return pe({
413
+ defaultValue: {
414
+ operator: E.INCLUDES,
415
+ value: []
416
+ },
417
+ disableOperators: !0,
418
+ displayFn: (e) => e,
419
+ key: r,
420
+ label: i,
421
+ options: (e) => Promise.resolve(Q.getFreeformOptions(n, e))
422
+ });
423
+ default: throw TypeError("Unsupported custom field definition type");
424
+ }
425
+ }), s = me({
426
+ actionGroup: { name: "invoices" },
427
+ filters: [
428
+ pe({
429
+ defaultValue: {
430
+ operator: E.INCLUDES,
431
+ value: []
432
+ },
433
+ disableOperators: !0,
434
+ displayFn: (e) => a.value.find((t) => t.uuid === e)?.name ?? e,
435
+ key: "customerUuids",
436
+ label: t.t("wise_invoicing.invoice.overview.filters.customer"),
437
+ options: async (e) => (n.updateSearch(e), await new Promise((e) => setTimeout(e, 0)), a.value.map((e) => e.uuid))
438
+ }),
439
+ T({
440
+ defaultValue: {
441
+ operator: ve.IS_BETWEEN,
442
+ value: {
443
+ from: null,
444
+ until: null
445
+ }
446
+ },
447
+ disableOperators: !0,
448
+ key: "dueOnRange",
449
+ label: t.t("wise_invoicing.invoice.overview.filters.due_on")
450
+ }),
451
+ de({
452
+ defaultValue: {
453
+ operator: E.INCLUDES,
454
+ value: []
455
+ },
456
+ disableOperators: !0,
457
+ displayFn: (e) => t.t(Se.getLifecycleMetadata(e).translationKey),
458
+ key: "lifecycleStatuses",
459
+ label: t.t("wise_invoicing.invoice.overview.filters.lifecycle"),
460
+ options: () => Object.values(m)
461
+ }),
462
+ de({
463
+ defaultValue: {
464
+ operator: E.INCLUDES,
465
+ value: []
466
+ },
467
+ disableOperators: !0,
468
+ displayFn: (e) => t.t(D.getFilterTranslationKey(e)),
469
+ key: "approvalStatuses",
470
+ label: t.t("wise_invoicing.invoice.overview.filters.approval"),
471
+ options: () => Object.values(r)
472
+ }),
473
+ fe({
474
+ defaultValue: null,
475
+ entityLabel: t.t("wise_invoicing.invoice.overview.filters.out_of_sync"),
476
+ key: "hasChangesSinceApprovalSent",
477
+ label: t.t("wise_invoicing.invoice.overview.filters.out_of_sync")
478
+ }),
479
+ ...o
480
+ ]
481
+ }), c = j(() => {
482
+ let e = s.values.value.customerUuids.value;
483
+ return e?.length ? e : null;
484
+ }), l = j(() => {
485
+ let e = s.values.value.dueOnRange.value;
486
+ return e.from === null || e.until === null ? null : e;
487
+ }), u = j(() => {
488
+ let t = s.values.value;
489
+ return e.customFieldDefinitions.flatMap((n) => {
490
+ let r = t[Q.getKey(n)], i = typeof r == "object" && r && "value" in r ? r.value : r;
491
+ return Q.toFilters(n, i, e.currency);
492
+ });
493
+ }), f = j(() => {
494
+ let e = s.values.value.lifecycleStatuses.value;
495
+ return e?.length ? e : null;
496
+ }), p = j(() => {
497
+ let e = s.values.value.approvalStatuses.value;
498
+ return e?.length ? e : null;
499
+ });
500
+ return {
501
+ hasChangesSinceApprovalSent: j(() => {
502
+ let e = s.values.value.hasChangesSinceApprovalSent;
503
+ return typeof e == "boolean" ? e : null;
504
+ }),
505
+ approvalStatuses: p,
506
+ customerUuids: c,
507
+ customFields: u,
508
+ dueOnRange: l,
509
+ filters: s,
510
+ lifecycleStatuses: f
511
+ };
512
+ }
513
+ //#endregion
514
+ //#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewFilters.composable.ts
515
+ var Ht = {
516
+ awaiting_payment: {
517
+ settlementStatuses: [t.UNPAID, t.PARTIALLY_PAID],
518
+ statuses: [i.SENT]
519
+ },
520
+ credited: { settlementStatuses: [t.CREDITED] },
521
+ overdue: { isOverdue: !0 },
522
+ paid: { settlementStatuses: [t.PAID, t.OVERPAID] },
523
+ settled: { settlementStatuses: [t.SETTLED] }
524
+ };
525
+ function Ut() {
526
+ let e = A();
527
+ return {
528
+ getFilters: (e) => e === "all" ? {} : Ht[e],
529
+ tabs: j(() => [
530
+ {
531
+ key: "all",
532
+ label: e.t("wise_invoicing.invoice.overview.tabs.all")
533
+ },
534
+ {
535
+ key: "awaiting_payment",
536
+ label: e.t("wise_invoicing.invoice.overview.tabs.awaiting_payment")
537
+ },
538
+ {
539
+ key: "paid",
540
+ label: e.t("wise_invoicing.invoice.overview.tabs.paid")
541
+ },
542
+ {
543
+ key: "overdue",
544
+ label: e.t("wise_invoicing.invoice.overview.tabs.overdue")
545
+ },
546
+ {
547
+ key: "credited",
548
+ label: e.t("wise_invoicing.invoice.overview.tabs.credited")
549
+ },
550
+ {
551
+ key: "settled",
552
+ label: e.t("wise_invoicing.invoice.overview.tabs.settled")
553
+ }
554
+ ])
555
+ };
556
+ }
557
+ //#endregion
558
+ //#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewSelection.composable.ts
559
+ function Wt(e) {
560
+ let t = We([]), n = j(() => {
561
+ let n = new Set(t.value);
562
+ return e.rows().filter((e) => n.has(e.uuid));
563
+ }), r = j(() => {
564
+ let t = e.rows();
565
+ return t.length > 0 && n.value.length === t.length;
566
+ }), i = j(() => e.rows().length > 0 && !r.value), a = j(() => n.value.length);
567
+ function o(e) {
568
+ return t.value.includes(e);
569
+ }
570
+ function s() {
571
+ let n = new Set(e.rows().map((e) => e.uuid));
572
+ t.value = t.value.filter((e) => n.has(e));
573
+ }
574
+ function c(e) {
575
+ if (o(e)) {
576
+ t.value = t.value.filter((t) => t !== e);
577
+ return;
578
+ }
579
+ t.value = [...t.value, e];
580
+ }
581
+ function l() {
582
+ t.value = e.rows().map((e) => e.uuid);
583
+ }
584
+ function u() {
585
+ t.value = [];
586
+ }
587
+ return {
588
+ isSelected: o,
589
+ allSelected: r,
590
+ canSelectAll: i,
591
+ clearSelection: u,
592
+ selectAll: l,
593
+ selectedCount: a,
594
+ selectedIds: t,
595
+ selectedInvoices: n,
596
+ syncSelection: s,
597
+ toggleRow: c
598
+ };
599
+ }
600
+ //#endregion
601
+ //#region src/modules/invoice/use-cases/overview/components/InvoiceOverviewTableAmountCell.vue?vue&type=script&setup=true&lang.ts
602
+ var Gt = { class: "font-medium text-secondary" }, Kt = ["title"], qt = /* @__PURE__ */ L({
603
+ __name: "InvoiceOverviewTableAmountCell",
604
+ props: { value: {} },
605
+ setup(e) {
606
+ let t = e, n = A(), r = g(), i = j(() => r.formatMonetary(t.value.total)), a = j(() => {
607
+ let e = Ae.getSubtextParts({
608
+ balanceDueAmount: t.value.balanceDueAmount,
609
+ grossAmount: t.value.grossAmount,
610
+ paidAmount: t.value.paidAmount,
611
+ settlementStatus: t.value.settlementStatus,
612
+ totalCreditedAmount: t.value.totalCreditedAmount
613
+ });
614
+ return e == null ? null : e.paidAmount !== null && e.overpaidAmount !== null ? n.t("wise_invoicing.invoice.status_subtext.paid_overpaid", {
615
+ overpaidAmount: r.formatMonetary(e.overpaidAmount),
616
+ paidAmount: r.formatMonetary(e.paidAmount)
617
+ }) : e.paidAmount !== null && e.creditedAmount !== null ? n.t("wise_invoicing.invoice.status_subtext.paid_credited", {
618
+ creditedAmount: r.formatMonetary(e.creditedAmount),
619
+ paidAmount: r.formatMonetary(e.paidAmount)
620
+ }) : e.paidAmount === null ? e.creditedAmount === null ? null : n.t("wise_invoicing.invoice.status_subtext.credited", { creditedAmount: r.formatMonetary(e.creditedAmount) }) : n.t("wise_invoicing.invoice.status_subtext.paid", { paidAmount: r.formatMonetary(e.paidAmount) });
621
+ });
622
+ return (e, t) => (R(), M(V(q), null, {
623
+ default: H(() => [I(V(G), {
624
+ gap: "xxs",
625
+ class: "text-sm/tight"
626
+ }, {
627
+ default: H(() => [F("span", Gt, B(i.value), 1), a.value === null ? N("", !0) : (R(), P("span", {
628
+ key: 0,
629
+ title: a.value,
630
+ class: "truncate text-xs text-secondary"
631
+ }, B(a.value), 9, Kt))]),
632
+ _: 1
633
+ })]),
634
+ _: 1
635
+ }));
636
+ }
637
+ }), Jt = /* @__PURE__ */ L({
638
+ __name: "InvoiceOverviewTableApprovalCell",
639
+ props: {
640
+ hasChangesSinceApprovalSent: { type: Boolean },
641
+ approval: {},
642
+ requiresPriorApproval: { type: Boolean }
643
+ },
644
+ setup(e) {
645
+ let t = e;
646
+ return (e, n) => (R(), M(V(q), null, {
647
+ default: H(() => [I(V(K), {
648
+ align: "center",
649
+ gap: "xs"
650
+ }, {
651
+ default: H(() => [I(Me, {
652
+ approval: t.approval,
653
+ "requires-prior-approval": t.requiresPriorApproval
654
+ }, null, 8, ["approval", "requires-prior-approval"]), t.hasChangesSinceApprovalSent ? (R(), M(Ee, { key: 0 })) : N("", !0)]),
655
+ _: 1
656
+ })]),
657
+ _: 1
658
+ }));
659
+ }
660
+ }), Yt = /* @__PURE__ */ L({
661
+ __name: "InvoiceOverviewTableCustomFieldCell",
662
+ props: {
663
+ definition: {},
664
+ value: {}
665
+ },
666
+ setup(e) {
667
+ return (t, n) => (R(), M(V(q), null, {
668
+ default: H(() => [e.value === void 0 ? (R(), M(V(J), {
669
+ key: 1,
670
+ text: "-",
671
+ class: "text-sm/5 text-primary"
672
+ })) : (R(), M(we, {
673
+ key: 0,
674
+ definition: e.definition,
675
+ value: e.value,
676
+ size: "md"
677
+ }, null, 8, ["definition", "value"]))]),
678
+ _: 1
679
+ }));
680
+ }
681
+ }), Xt = /* @__PURE__ */ L({
682
+ __name: "InvoiceOverviewTableDueDateCell",
683
+ props: {
684
+ isOverdue: { type: Boolean },
685
+ value: {}
686
+ },
687
+ setup(e) {
688
+ let t = e, n = le(), r = j(() => t.value === null ? "-" : n.formatPlainDate(t.value)), i = j(() => {
689
+ if (!t.isOverdue || t.value === null) return null;
690
+ let e = t.value.toZonedDateTime(Qe.Now.timeZoneId()).toInstant();
691
+ return n.toRelativeTime(e);
692
+ });
693
+ return (e, n) => (R(), M(V(q), null, {
694
+ default: H(() => [I(V(K), { gap: "sm" }, {
695
+ default: H(() => [I(V(J), {
696
+ class: Be([{
697
+ "text-error-primary": t.isOverdue,
698
+ "text-primary": !t.isOverdue
699
+ }, "text-sm"]),
700
+ text: r.value
701
+ }, null, 8, ["class", "text"]), i.value === null ? N("", !0) : (R(), M(V(et), {
702
+ key: 0,
703
+ label: i.value,
704
+ color: "error",
705
+ size: "sm",
706
+ variant: "translucent"
707
+ }, null, 8, ["label"]))]),
708
+ _: 1
709
+ })]),
710
+ _: 1
711
+ }));
712
+ }
713
+ }), Zt = /* @__PURE__ */ L({
714
+ __name: "InvoiceOverviewTableIssuedDateCell",
715
+ props: { value: {} },
716
+ setup(e) {
717
+ let t = e, n = le(), r = j(() => t.value === null ? "-" : n.formatPlainDate(t.value));
718
+ return (e, t) => (R(), M(V(q), null, {
719
+ default: H(() => [I(V(J), {
720
+ text: r.value,
721
+ class: "text-sm/5 text-primary"
722
+ }, null, 8, ["text"])]),
723
+ _: 1
724
+ }));
725
+ }
726
+ }), Qt = /* @__PURE__ */ L({
727
+ __name: "InvoiceOverviewTableLifecycleCell",
728
+ props: {
729
+ isDisputed: { type: Boolean },
730
+ lifecycleStatus: {}
731
+ },
732
+ setup(e) {
733
+ let t = e;
734
+ return (e, n) => (R(), M(V(q), null, {
735
+ default: H(() => [I(V(K), { gap: "xs" }, {
736
+ default: H(() => [I(Oe, { "lifecycle-status": t.lifecycleStatus }, null, 8, ["lifecycle-status"]), t.isDisputed ? (R(), M(De, { key: 0 })) : N("", !0)]),
737
+ _: 1
738
+ })]),
739
+ _: 1
740
+ }));
741
+ }
742
+ }), $t = { class: "flex flex-col leading-tight" }, en = ["title"], tn = ["title"], nn = /* @__PURE__ */ L({
743
+ __name: "InvoiceOverviewTableNameCell",
744
+ props: {
745
+ customerName: {},
746
+ subject: {},
747
+ type: {}
748
+ },
749
+ setup(e) {
750
+ let t = e, n = A();
751
+ return (e, r) => (R(), M(V(q), null, {
752
+ default: H(() => [F("div", $t, [I(V(K), null, {
753
+ default: H(() => [F("span", {
754
+ title: t.customerName,
755
+ class: "truncate text-sm/4 font-medium text-primary"
756
+ }, B(t.customerName), 9, en), t.type === V(p).CREDIT_NOTE ? (R(), M(V(ee), {
757
+ key: 0,
758
+ "aria-label": V(n).t("wise_invoicing.invoice.type.credit_note"),
759
+ class: "size-3 shrink-0 text-warning-primary",
760
+ role: "img"
761
+ }, null, 8, ["aria-label"])) : N("", !0)]),
762
+ _: 1
763
+ }), F("span", {
764
+ title: t.subject ?? void 0,
765
+ class: "truncate text-xs/4 text-secondary"
766
+ }, B(t.subject ?? "-"), 9, tn)])]),
767
+ _: 1
768
+ }));
769
+ }
770
+ }), rn = /* @__PURE__ */ L({
771
+ __name: "InvoiceOverviewTableSelectionCell",
772
+ props: { isSelected: { type: Boolean } },
773
+ emits: ["toggle"],
774
+ setup(e, { emit: t }) {
775
+ let n = e, r = t, i = A();
776
+ return (e, t) => (R(), M(V(q), null, {
777
+ default: H(() => [I(V(gt), null, {
778
+ default: H(() => [I(V(tt), {
779
+ label: V(i).t("wise_invoicing.invoice.overview.bulk.select_document"),
780
+ "model-value": n.isSelected,
781
+ "is-label-hidden": !0,
782
+ class: "mx-auto",
783
+ "onUpdate:modelValue": t[0] ||= (e) => r("toggle")
784
+ }, null, 8, ["label", "model-value"])]),
785
+ _: 1
786
+ })]),
787
+ _: 1
788
+ }));
789
+ }
790
+ }), an = /* @__PURE__ */ L({
791
+ __name: "InvoiceOverviewTableSentCell",
792
+ props: { deliveryStatus: {} },
793
+ setup(e) {
794
+ let t = e, n = A(), r = j(() => [f.SENT, f.VIEWED].includes(t.deliveryStatus));
795
+ return (e, i) => (R(), M(V(q), null, {
796
+ default: H(() => [r.value ? (R(), M(V(ae), {
797
+ key: 0,
798
+ class: "size-4 text-brand-600"
799
+ })) : t.deliveryStatus === V(f).PROCESSING ? (R(), M(V(pt), {
800
+ key: 1,
801
+ "aria-label": V(n).t("wise_invoicing.invoice.delivery_status.processing"),
802
+ "aria-hidden": "false",
803
+ role: "img",
804
+ class: "size-4 text-tertiary"
805
+ }, null, 8, ["aria-label"])) : t.deliveryStatus === V(f).FAILED ? (R(), M(V(St), {
806
+ key: 2,
807
+ "popover-side-offset": 8,
808
+ "popover-align": "center",
809
+ "popover-side": "bottom"
810
+ }, {
811
+ trigger: H(() => [I(V(gt), null, {
812
+ default: H(() => [I(V(oe), {
813
+ "aria-label": V(n).t("wise_invoicing.invoice.overview.send_failed"),
814
+ class: "size-4 text-error-primary"
815
+ }, null, 8, ["aria-label"])]),
816
+ _: 1
817
+ })]),
818
+ content: H(() => [I(V(Ct), null, {
819
+ default: H(() => [I(V(J), {
820
+ text: V(n).t("wise_invoicing.invoice.overview.send_failed"),
821
+ class: "text-sm text-primary"
822
+ }, null, 8, ["text"])]),
823
+ _: 1
824
+ })]),
825
+ _: 1
826
+ })) : N("", !0)]),
827
+ _: 1
828
+ }));
829
+ }
830
+ }), on = /* @__PURE__ */ L({
831
+ __name: "InvoiceOverviewTableSequenceCell",
832
+ props: { sequence: {} },
833
+ setup(e) {
834
+ return (t, n) => (R(), M(V(q), null, {
835
+ default: H(() => [I(V(_t), { text: e.sequence ?? "-" }, null, 8, ["text"])]),
836
+ _: 1
837
+ }));
838
+ }
839
+ }), sn = /* @__PURE__ */ L({
840
+ __name: "InvoiceOverviewTableStatusCell",
841
+ props: { value: {} },
842
+ setup(e) {
843
+ let t = e, n = j(() => t.value.type === p.CREDIT_NOTE), r = j(() => ke.isSent(t.value.deliveryStatus));
844
+ return (e, i) => (R(), M(V(q), null, {
845
+ default: H(() => [n.value ? N("", !0) : (R(), M(je, {
846
+ key: 0,
847
+ "is-sent": r.value,
848
+ "balance-due-amount": t.value.balanceDueAmount,
849
+ "gross-amount": t.value.grossAmount,
850
+ "paid-amount": t.value.paidAmount,
851
+ "settlement-status": t.value.settlementStatus,
852
+ "show-subtext": !1,
853
+ "total-credited-amount": t.value.totalCreditedAmount
854
+ }, null, 8, [
855
+ "is-sent",
856
+ "balance-due-amount",
857
+ "gross-amount",
858
+ "paid-amount",
859
+ "settlement-status",
860
+ "total-credited-amount"
861
+ ]))]),
862
+ _: 1
863
+ }));
864
+ }
865
+ });
866
+ //#endregion
867
+ //#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewTableColumns.composable.ts
868
+ function cn(e) {
869
+ let t = A();
870
+ return j(() => {
871
+ let n = e?.selection, r = e?.customFieldDefinitions?.().map((e) => ({
872
+ headerLabel: Ce.getLabel(e, t.locale.value),
873
+ key: Q.getKey(e),
874
+ size: {
875
+ max: "1fr",
876
+ min: "10rem"
877
+ },
878
+ component: (t) => Y(Yt, {
879
+ definition: e,
880
+ value: t.customFields.find((t) => t.definitionUuid === e.uuid)
881
+ })
882
+ })) ?? [], i = n === void 0 ? [] : [{
883
+ headerLabel: "",
884
+ key: "selection",
885
+ size: {
886
+ max: "2.5rem",
887
+ min: "2.5rem"
888
+ },
889
+ component: (e) => Y(rn, {
890
+ isSelected: n.isSelected(e.uuid),
891
+ onToggle: () => n.toggleRow(e.uuid)
892
+ })
893
+ }];
894
+ return Tt()([
895
+ ...i,
896
+ {
897
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.recipient"),
898
+ key: s.CUSTOMER,
899
+ size: {
900
+ max: "16rem",
901
+ min: "16rem"
902
+ },
903
+ component: (e) => Y(nn, {
904
+ customerName: e.customerName,
905
+ subject: e.subject,
906
+ type: e.type
907
+ })
908
+ },
909
+ {
910
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.invoice_number"),
911
+ key: s.SEQUENCE,
912
+ size: {
913
+ max: "9rem",
914
+ min: "9rem"
915
+ },
916
+ component: (e) => Y(on, { sequence: e.sequence })
917
+ },
918
+ {
919
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.lifecycle"),
920
+ key: "lifecycleStatus",
921
+ size: {
922
+ max: "12rem",
923
+ min: "8rem"
924
+ },
925
+ component: (e) => Y(Qt, {
926
+ isDisputed: e.isDisputed,
927
+ lifecycleStatus: e.lifecycleStatus
928
+ })
929
+ },
930
+ {
931
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.invoice_date"),
932
+ key: s.ISSUED_ON,
933
+ size: {
934
+ max: "8rem",
935
+ min: "8rem"
936
+ },
937
+ component: (e) => Y(Zt, { value: e.issuedOn })
938
+ },
939
+ {
940
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.sent"),
941
+ key: "deliveryStatus",
942
+ size: {
943
+ max: "8rem",
944
+ min: "8rem"
945
+ },
946
+ component: (e) => Y(an, { deliveryStatus: e.deliveryStatus })
947
+ },
948
+ {
949
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.settlement"),
950
+ key: "status",
951
+ size: {
952
+ max: "10rem",
953
+ min: "10rem"
954
+ },
955
+ component: (e) => Y(sn, { value: e })
956
+ },
957
+ {
958
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.approval"),
959
+ key: "approval",
960
+ size: {
961
+ max: "12rem",
962
+ min: "10rem"
963
+ },
964
+ component: (e) => Y(Jt, {
965
+ hasChangesSinceApprovalSent: e.hasChangesSinceApprovalSent && e.lifecycleStatus !== m.FINALIZED,
966
+ approval: e.approval,
967
+ requiresPriorApproval: e.requiresPriorApproval
968
+ })
969
+ },
970
+ {
971
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.due_date"),
972
+ key: "dueOn",
973
+ size: {
974
+ max: "16rem",
975
+ min: "16rem"
976
+ },
977
+ component: (e) => Y(Xt, {
978
+ isOverdue: e.isOverdue,
979
+ value: e.dueOn
980
+ })
981
+ },
982
+ {
983
+ headerLabel: t.t("wise_invoicing.invoice.overview.columns.amount_excl_vat"),
984
+ key: s.NET_AMOUNT,
985
+ size: {
986
+ max: "1fr",
987
+ min: "10rem"
988
+ },
989
+ component: (e) => Y(qt, { value: e })
990
+ },
991
+ ...r
992
+ ]);
993
+ });
994
+ }
995
+ //#endregion
996
+ //#region src/modules/invoice/api/mutations/invoiceBulkFinalize.mutation.ts
997
+ function ln() {
998
+ return U({
999
+ queryFn: (e) => b.bulkFinalize(e.params.invoiceUuids),
1000
+ queryKeysToInvalidate: { invoiceDetail: {} }
1001
+ });
1002
+ }
1003
+ //#endregion
1004
+ //#region src/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.ts
1005
+ var un = {
1006
+ approval_already_sent_error: "wise_invoicing.invoice.overview.bulk.skip_reason.approval_already_sent",
1007
+ approval_requires_customer_prior_approval: "wise_invoicing.invoice.overview.bulk.skip_reason.approval_not_required",
1008
+ approval_requires_editable_invoice: "wise_invoicing.invoice.overview.bulk.skip_reason.not_editable",
1009
+ approval_requires_standard_invoice: "wise_invoicing.invoice.overview.bulk.skip_reason.not_standard",
1010
+ customer_has_no_approval_email: "wise_invoicing.invoice.overview.bulk.skip_reason.no_approval_email",
1011
+ customer_has_no_default_recipient: "wise_invoicing.invoice.overview.bulk.skip_reason.no_recipient",
1012
+ invoice_finalization_requires_approval: "wise_invoicing.invoice.finalize.blocked_by_approval",
1013
+ invoice_not_found: "wise_invoicing.invoice.overview.bulk.skip_reason.not_found"
1014
+ }, dn = k.object({
1015
+ approvalStatus: k.enum(n).nullable(),
1016
+ level: k.enum(l).nullable()
1017
+ }), fn = "wise_invoicing.invoice.overview.bulk.skip_reason.unknown", $ = class {
1018
+ static createEmptyPreview() {
1019
+ return {
1020
+ skipped: [],
1021
+ meta: {
1022
+ processed: 0,
1023
+ skipped: 0,
1024
+ total: 0
1025
+ }
1026
+ };
1027
+ }
1028
+ static createSkippedToast(e) {
1029
+ let t = [], n = {};
1030
+ for (let [r, i] of e.invoices.entries()) {
1031
+ let a = `invoice${r}`, o = e.reasons?.[i.uuid];
1032
+ t.push(o === void 0 ? `{${a}}` : `{${a}}: ${o}`), n[a] = {
1033
+ label: this.getInvoiceLabel(i),
1034
+ to: this.getInvoiceDetailLink(i)
1035
+ };
1036
+ }
1037
+ let r = t.join(e.reasons === void 0 ? ", " : " ");
1038
+ return {
1039
+ id: e.id,
1040
+ duration: Infinity,
1041
+ interactableModels: n,
1042
+ message: r === "" ? e.message : `${e.message} ${r}`,
1043
+ variant: "error"
1044
+ };
1045
+ }
1046
+ static getBlockingApprovalStatusKeys(e) {
1047
+ let t = {};
1048
+ for (let n of e) {
1049
+ let e = dn.safeParse(n.errors[0]?.errors[0]?.meta);
1050
+ if (!e.success) continue;
1051
+ let r = D.getDisplayStatus({
1052
+ approval: e.data.approvalStatus === null ? null : {
1053
+ reminderSentAt: null,
1054
+ sentAt: null,
1055
+ level: e.data.level,
1056
+ status: e.data.approvalStatus
1057
+ },
1058
+ requiresPriorApproval: !0
1059
+ });
1060
+ r !== null && (t[n.uuid] = D.getMetadata(r).translationKey);
1061
+ }
1062
+ return t;
1063
+ }
1064
+ static getInvoiceDetailLink(e) {
1065
+ return e.type === p.CREDIT_NOTE ? {
1066
+ name: "invoicing-credit-note-detail",
1067
+ params: { creditNoteUuid: e.uuid }
1068
+ } : {
1069
+ name: "invoicing-invoice-detail",
1070
+ params: { invoiceUuid: e.uuid }
1071
+ };
1072
+ }
1073
+ static getInvoiceLabel(e) {
1074
+ return e.sequence ?? e.subject ?? e.customerName;
1075
+ }
1076
+ static getSkipReasonKeys(e) {
1077
+ let t = {};
1078
+ for (let n of e) {
1079
+ let e = n.errors[0]?.errors[0]?.code;
1080
+ t[n.uuid] = e === void 0 ? fn : un[e] ?? fn;
1081
+ }
1082
+ return t;
1083
+ }
1084
+ static getUnskippedInvoiceUuids(e, t) {
1085
+ let n = new Set(t.map((e) => e.uuid));
1086
+ return e.filter((e) => !n.has(e.uuid)).map((e) => e.uuid);
1087
+ }
1088
+ }, pn = {
1089
+ key: 0,
1090
+ class: "text-sm text-error-primary"
1091
+ }, mn = {
1092
+ key: 1,
1093
+ class: "text-sm text-secondary"
1094
+ }, hn = {
1095
+ key: 0,
1096
+ class: "text-sm text-primary"
1097
+ }, gn = {
1098
+ key: 1,
1099
+ class: "text-sm text-secondary"
1100
+ }, _n = { class: "text-sm text-secondary" }, vn = {
1101
+ key: 0,
1102
+ class: "text-xs text-tertiary"
1103
+ }, yn = /* @__PURE__ */ L({
1104
+ __name: "InvoiceOverviewBulkActionDialog",
1105
+ props: {
1106
+ title: {},
1107
+ isPreviewLoading: { type: Boolean },
1108
+ isSubmitting: { type: Boolean },
1109
+ confirmLabel: {},
1110
+ description: {},
1111
+ icon: {},
1112
+ loadingLabel: {},
1113
+ noneProcessableLabel: {},
1114
+ previewErrorLabel: {},
1115
+ processableCount: {},
1116
+ processableLabel: {},
1117
+ skippedInvoices: {},
1118
+ skippedPreviewLabel: {},
1119
+ skipReasons: {}
1120
+ },
1121
+ emits: ["close", "confirm"],
1122
+ setup(e, { emit: t }) {
1123
+ let n = e, r = t;
1124
+ return (e, t) => (R(), M(V(at), {
1125
+ size: "sm",
1126
+ onClose: t[1] ||= (e) => r("close")
1127
+ }, {
1128
+ default: H(() => [
1129
+ I(V(dt), {
1130
+ title: n.title,
1131
+ description: n.description,
1132
+ icon: n.icon
1133
+ }, null, 8, [
1134
+ "title",
1135
+ "description",
1136
+ "icon"
1137
+ ]),
1138
+ I(V(ot), null, {
1139
+ default: H(() => [I(V(G), null, {
1140
+ default: H(() => [n.previewErrorLabel === null ? n.isPreviewLoading ? (R(), P("p", mn, B(n.loadingLabel), 1)) : (R(), P(Fe, { key: 2 }, [n.processableCount > 0 ? (R(), P("p", hn, B(n.processableLabel), 1)) : (R(), P("p", gn, B(n.noneProcessableLabel), 1)), n.skippedInvoices.length > 0 ? (R(), M(V(G), {
1141
+ key: 2,
1142
+ gap: "sm",
1143
+ class: "rounded-lg border border-secondary bg-secondary p-md"
1144
+ }, {
1145
+ default: H(() => [F("p", _n, B(n.skippedPreviewLabel), 1), I(V(G), { gap: "xs" }, {
1146
+ default: H(() => [(R(!0), P(Fe, null, He(n.skippedInvoices, (e) => (R(), M(V(G), {
1147
+ key: e.uuid,
1148
+ gap: "none"
1149
+ }, {
1150
+ default: H(() => [I(V(Xe), {
1151
+ to: V($).getInvoiceDetailLink(e),
1152
+ class: "text-sm text-brand-primary hover:underline"
1153
+ }, {
1154
+ default: H(() => [Ie(B(V($).getInvoiceLabel(e)), 1)]),
1155
+ _: 2
1156
+ }, 1032, ["to"]), n.skipReasons?.[e.uuid] === void 0 ? N("", !0) : (R(), P("p", vn, B(n.skipReasons[e.uuid]), 1))]),
1157
+ _: 2
1158
+ }, 1024))), 128))]),
1159
+ _: 1
1160
+ })]),
1161
+ _: 1
1162
+ })) : N("", !0)], 64)) : (R(), P("p", pn, B(n.previewErrorLabel), 1))]),
1163
+ _: 1
1164
+ })]),
1165
+ _: 1
1166
+ }),
1167
+ I(V(st), null, {
1168
+ right: H(() => [I(V(ct)), I(V(lt), {
1169
+ "is-disabled": n.isPreviewLoading || n.processableCount === 0,
1170
+ "is-loading": n.isSubmitting,
1171
+ label: n.confirmLabel,
1172
+ onClick: t[0] ||= (e) => r("confirm")
1173
+ }, null, 8, [
1174
+ "is-disabled",
1175
+ "is-loading",
1176
+ "label"
1177
+ ])]),
1178
+ _: 1
1179
+ })
1180
+ ]),
1181
+ _: 1
1182
+ }));
1183
+ }
1184
+ }), bn = /* @__PURE__ */ L({
1185
+ __name: "InvoiceOverviewBulkFinalizeDialog",
1186
+ props: {
1187
+ invoices: {},
1188
+ onFinalized: { type: Function }
1189
+ },
1190
+ emits: ["close"],
1191
+ setup(e, { emit: t }) {
1192
+ let n = e, r = t, a = A(), o = X(), s = ln(), c = z(!0), l = z(!1), u = z(null), d = z(null), f = j(() => n.invoices.filter((e) => e.status === i.READY)), p = j(() => f.value.map((e) => e.uuid)), h = j(() => u.value?.meta.processed ?? 0), g = j(() => $.getUnskippedInvoiceUuids(f.value, u.value?.skipped ?? [])), _ = j(() => {
1193
+ let e = new Set(g.value);
1194
+ return n.invoices.filter((t) => !e.has(t.uuid));
1195
+ }), v = j(() => _.value.length), y = j(() => {
1196
+ let e = u.value?.skipped ?? [], t = $.getSkipReasonKeys(e), n = $.getBlockingApprovalStatusKeys(e);
1197
+ return Object.fromEntries(Object.entries(t).map(([e, t]) => {
1198
+ let r = n[e];
1199
+ return [e, a.t(t, { status: r === void 0 ? "" : a.t(r) })];
1200
+ }));
1201
+ }), x = j(() => u.value === null ? n.invoices.length : h.value);
1202
+ async function S() {
1203
+ let e = g.value;
1204
+ if (e.length === 0 || l.value) return;
1205
+ l.value = !0;
1206
+ let t = await s.execute({ params: { invoiceUuids: e } });
1207
+ if (l.value = !1, t.isErr()) {
1208
+ o.apiError(t.error);
1209
+ return;
1210
+ }
1211
+ let c = new Set(t.value.skipped.map((e) => e.uuid)), d = e.filter((e) => !c.has(e));
1212
+ u.value = t.value, d.length > 0 && O.reflectBulkAction(d, {
1213
+ lifecycleStatus: m.FINALIZED,
1214
+ status: i.FINALIZED
1215
+ }), t.value.meta.processed > 0 && o.show({ message: a.t("wise_invoicing.invoice.overview.bulk.finalize.success", { count: t.value.meta.processed }) }), v.value > 0 && o.show($.createSkippedToast({
1216
+ id: "invoice-overview-bulk-finalize-skipped",
1217
+ invoices: _.value,
1218
+ message: a.t("wise_invoicing.invoice.overview.bulk.finalize.skipped", { count: v.value })
1219
+ })), t.value.meta.processed !== 0 && (n.onFinalized(), r("close"));
1220
+ }
1221
+ async function ee() {
1222
+ if (c.value = !0, p.value.length === 0) {
1223
+ u.value = $.createEmptyPreview(), c.value = !1;
1224
+ return;
1225
+ }
1226
+ let e = await b.previewBulkFinalize(p.value);
1227
+ if (e.isErr()) {
1228
+ d.value = a.t("wise_invoicing.invoice.overview.bulk.preview_error"), c.value = !1;
1229
+ return;
1230
+ }
1231
+ u.value = e.value, c.value = !1;
1232
+ }
1233
+ return Ve(() => {
1234
+ ee();
1235
+ }), (e, t) => (R(), M(yn, {
1236
+ "confirm-label": V(a).t("wise_invoicing.invoice.overview.bulk.finalize.confirm"),
1237
+ description: V(a).t("wise_invoicing.invoice.overview.bulk.finalize.description"),
1238
+ icon: V(ne),
1239
+ "is-preview-loading": c.value,
1240
+ "is-submitting": l.value,
1241
+ "loading-label": V(a).t("wise_invoicing.invoice.overview.bulk.finalize.loading"),
1242
+ "none-processable-label": V(a).t("wise_invoicing.invoice.overview.bulk.finalize.none_processable"),
1243
+ "preview-error-label": d.value,
1244
+ "processable-count": h.value,
1245
+ "processable-label": V(a).t("wise_invoicing.invoice.overview.bulk.finalize.processable", { count: h.value }),
1246
+ "skip-reasons": y.value,
1247
+ "skipped-invoices": _.value,
1248
+ "skipped-preview-label": V(a).t("wise_invoicing.invoice.overview.bulk.finalize.skipped_preview", { count: v.value }),
1249
+ title: V(a).t("wise_invoicing.invoice.overview.bulk.finalize.title", { count: x.value }),
1250
+ onClose: t[0] ||= (e) => r("close"),
1251
+ onConfirm: S
1252
+ }, null, 8, [
1253
+ "confirm-label",
1254
+ "description",
1255
+ "icon",
1256
+ "is-preview-loading",
1257
+ "is-submitting",
1258
+ "loading-label",
1259
+ "none-processable-label",
1260
+ "preview-error-label",
1261
+ "processable-count",
1262
+ "processable-label",
1263
+ "skip-reasons",
1264
+ "skipped-invoices",
1265
+ "skipped-preview-label",
1266
+ "title"
1267
+ ]));
1268
+ }
1269
+ });
1270
+ //#endregion
1271
+ //#region src/modules/invoice/api/mutations/invoiceBulkMarkAsReady.mutation.ts
1272
+ function xn() {
1273
+ return U({
1274
+ queryFn: (e) => b.bulkMarkAsReady(e.params.invoiceUuids),
1275
+ queryKeysToInvalidate: { invoiceDetail: {} }
1276
+ });
1277
+ }
1278
+ //#endregion
1279
+ //#region src/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkMarkAsReadyDialog.vue
1280
+ var Sn = /* @__PURE__ */ L({
1281
+ __name: "InvoiceOverviewBulkMarkAsReadyDialog",
1282
+ props: {
1283
+ invoices: {},
1284
+ onMarkedAsReady: { type: Function }
1285
+ },
1286
+ emits: ["close"],
1287
+ setup(e, { emit: t }) {
1288
+ let n = e, r = t, a = A(), o = X(), s = xn(), c = z(!0), l = z(!1), u = z(null), d = z(null), f = j(() => n.invoices.filter((e) => e.status === i.DRAFT)), p = j(() => f.value.map((e) => e.uuid)), h = j(() => u.value?.meta.processed ?? 0), g = j(() => $.getUnskippedInvoiceUuids(f.value, u.value?.skipped ?? [])), _ = j(() => {
1289
+ let e = new Set(g.value);
1290
+ return n.invoices.filter((t) => !e.has(t.uuid));
1291
+ }), v = j(() => _.value.length), y = j(() => u.value === null ? n.invoices.length : h.value);
1292
+ async function x() {
1293
+ let e = g.value;
1294
+ if (e.length === 0 || l.value) return;
1295
+ l.value = !0;
1296
+ let t = await s.execute({ params: { invoiceUuids: e } });
1297
+ if (l.value = !1, t.isErr()) {
1298
+ o.apiError(t.error);
1299
+ return;
1300
+ }
1301
+ let c = new Set(t.value.skipped.map((e) => e.uuid)), d = e.filter((e) => !c.has(e));
1302
+ u.value = t.value, d.length > 0 && O.reflectBulkAction(d, {
1303
+ lifecycleStatus: m.READY,
1304
+ status: i.READY
1305
+ }), t.value.meta.processed > 0 && o.show({ message: a.t("wise_invoicing.invoice.overview.bulk.mark_as_ready.success", { count: t.value.meta.processed }) }), v.value > 0 && o.show($.createSkippedToast({
1306
+ id: "invoice-overview-bulk-mark-as-ready-skipped",
1307
+ invoices: _.value,
1308
+ message: a.t("wise_invoicing.invoice.overview.bulk.mark_as_ready.skipped", { count: v.value })
1309
+ })), t.value.meta.processed !== 0 && (n.onMarkedAsReady(), r("close"));
1310
+ }
1311
+ async function S() {
1312
+ if (c.value = !0, p.value.length === 0) {
1313
+ u.value = $.createEmptyPreview(), c.value = !1;
1314
+ return;
1315
+ }
1316
+ let e = await b.previewBulkMarkAsReady(p.value);
1317
+ if (e.isErr()) {
1318
+ d.value = a.t("wise_invoicing.invoice.overview.bulk.preview_error"), c.value = !1;
1319
+ return;
1320
+ }
1321
+ u.value = e.value, c.value = !1;
1322
+ }
1323
+ return Ve(() => {
1324
+ S();
1325
+ }), (e, t) => (R(), M(yn, {
1326
+ "confirm-label": V(a).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.confirm"),
1327
+ description: V(a).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.description"),
1328
+ icon: V(re),
1329
+ "is-preview-loading": c.value,
1330
+ "is-submitting": l.value,
1331
+ "loading-label": V(a).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.loading"),
1332
+ "none-processable-label": V(a).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.none_processable"),
1333
+ "preview-error-label": d.value,
1334
+ "processable-count": h.value,
1335
+ "processable-label": V(a).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.processable", { count: h.value }),
1336
+ "skipped-invoices": _.value,
1337
+ "skipped-preview-label": V(a).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.skipped_preview", { count: v.value }),
1338
+ title: V(a).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.title", { count: y.value }),
1339
+ onClose: t[0] ||= (e) => r("close"),
1340
+ onConfirm: x
1341
+ }, null, 8, [
1342
+ "confirm-label",
1343
+ "description",
1344
+ "icon",
1345
+ "is-preview-loading",
1346
+ "is-submitting",
1347
+ "loading-label",
1348
+ "none-processable-label",
1349
+ "preview-error-label",
1350
+ "processable-count",
1351
+ "processable-label",
1352
+ "skipped-invoices",
1353
+ "skipped-preview-label",
1354
+ "title"
1355
+ ]));
1356
+ }
1357
+ });
1358
+ //#endregion
1359
+ //#region src/modules/invoice/api/mutations/invoiceBulkSendApproval.mutation.ts
1360
+ function Cn() {
1361
+ return U({
1362
+ queryFn: (e) => b.bulkSendApproval(e.params.invoiceUuids),
1363
+ queryKeysToInvalidate: {
1364
+ invoiceApprovalIndex: {},
1365
+ invoiceDetail: {}
1366
+ }
1367
+ });
1368
+ }
1369
+ //#endregion
1370
+ //#region src/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendApprovalDialog.vue
1371
+ var wn = /* @__PURE__ */ L({
1372
+ __name: "InvoiceOverviewBulkSendApprovalDialog",
1373
+ props: {
1374
+ invoices: {},
1375
+ onSent: { type: Function }
1376
+ },
1377
+ emits: ["close"],
1378
+ setup(e, { emit: t }) {
1379
+ let i = e, a = t, o = A(), s = X(), c = Cn(), l = z(!0), u = z(!1), d = z(null), f = z(null), p = j(() => i.invoices.filter((e) => {
1380
+ let t = D.getDisplayStatus({
1381
+ approval: e.approval,
1382
+ requiresPriorApproval: e.requiresPriorApproval
1383
+ });
1384
+ return t !== null && t !== r.APPROVED;
1385
+ })), m = j(() => p.value.map((e) => e.uuid)), h = j(() => d.value?.meta.processed ?? 0), g = j(() => $.getUnskippedInvoiceUuids(p.value, d.value?.skipped ?? [])), _ = j(() => {
1386
+ let e = new Set(g.value);
1387
+ return i.invoices.filter((t) => !e.has(t.uuid));
1388
+ }), v = j(() => _.value.length), y = j(() => {
1389
+ let e = $.getSkipReasonKeys(d.value?.skipped ?? []), t = {};
1390
+ for (let n of _.value) {
1391
+ let i = e[n.uuid];
1392
+ if (i !== void 0) {
1393
+ t[n.uuid] = o.t(i);
1394
+ continue;
1395
+ }
1396
+ let a = D.getDisplayStatus({
1397
+ approval: n.approval,
1398
+ requiresPriorApproval: n.requiresPriorApproval
1399
+ });
1400
+ t[n.uuid] = a === r.APPROVED ? o.t("wise_invoicing.invoice.overview.bulk.skip_reason.already_approved") : o.t("wise_invoicing.invoice.overview.bulk.skip_reason.approval_not_required");
1401
+ }
1402
+ return t;
1403
+ }), x = j(() => d.value === null ? i.invoices.length : h.value);
1404
+ async function S() {
1405
+ let e = g.value;
1406
+ if (e.length === 0 || u.value) return;
1407
+ let t = _.value, r = y.value;
1408
+ u.value = !0;
1409
+ let l = await c.execute({ params: { invoiceUuids: e } });
1410
+ if (u.value = !1, l.isErr()) {
1411
+ s.apiError(l.error);
1412
+ return;
1413
+ }
1414
+ let d = new Set(l.value.skipped.map((e) => e.uuid)), f = [...t, ...i.invoices.filter((e) => d.has(e.uuid))], p = e.filter((e) => !d.has(e));
1415
+ if (p.length > 0 && O.reflectBulkAction(p, {
1416
+ hasChangesSinceApprovalSent: !1,
1417
+ approval: {
1418
+ reminderSentAt: null,
1419
+ sentAt: Qe.Now.instant(),
1420
+ level: null,
1421
+ status: n.REQUESTED
1422
+ }
1423
+ }), l.value.meta.processed > 0 && s.show({ message: o.t("wise_invoicing.invoice.overview.bulk.send_approval.success", { count: l.value.meta.processed }) }), f.length > 0) {
1424
+ let e = { ...r }, t = $.getSkipReasonKeys(l.value.skipped);
1425
+ for (let [n, r] of Object.entries(t)) e[n] = o.t(r);
1426
+ s.show($.createSkippedToast({
1427
+ id: "invoice-overview-bulk-send-approval-skipped",
1428
+ invoices: f,
1429
+ message: o.t("wise_invoicing.invoice.overview.bulk.send_approval.skipped", { count: f.length }),
1430
+ reasons: e
1431
+ }));
1432
+ }
1433
+ l.value.meta.processed !== 0 && (i.onSent(), a("close"));
1434
+ }
1435
+ async function ee() {
1436
+ if (l.value = !0, m.value.length === 0) {
1437
+ d.value = $.createEmptyPreview(), l.value = !1;
1438
+ return;
1439
+ }
1440
+ let e = await b.previewBulkSendApproval(m.value);
1441
+ if (e.isErr()) {
1442
+ f.value = o.t("wise_invoicing.invoice.overview.bulk.preview_error"), l.value = !1;
1443
+ return;
1444
+ }
1445
+ d.value = e.value, l.value = !1;
1446
+ }
1447
+ return Ve(() => {
1448
+ ee();
1449
+ }), (e, t) => (R(), M(yn, {
1450
+ "confirm-label": V(o).t("wise_invoicing.invoice.overview.bulk.send_approval.confirm"),
1451
+ description: V(o).t("wise_invoicing.invoice.overview.bulk.send_approval.description"),
1452
+ icon: V(C),
1453
+ "is-preview-loading": l.value,
1454
+ "is-submitting": u.value,
1455
+ "loading-label": V(o).t("wise_invoicing.invoice.overview.bulk.send_approval.loading"),
1456
+ "none-processable-label": V(o).t("wise_invoicing.invoice.overview.bulk.send_approval.none_processable"),
1457
+ "preview-error-label": f.value,
1458
+ "processable-count": h.value,
1459
+ "processable-label": V(o).t("wise_invoicing.invoice.overview.bulk.send_approval.processable", { count: h.value }),
1460
+ "skip-reasons": y.value,
1461
+ "skipped-invoices": _.value,
1462
+ "skipped-preview-label": V(o).t("wise_invoicing.invoice.overview.bulk.send_approval.skipped_preview", { count: v.value }),
1463
+ title: V(o).t("wise_invoicing.invoice.overview.bulk.send_approval.title", { count: x.value }),
1464
+ onClose: t[0] ||= (e) => a("close"),
1465
+ onConfirm: S
1466
+ }, null, 8, [
1467
+ "confirm-label",
1468
+ "description",
1469
+ "icon",
1470
+ "is-preview-loading",
1471
+ "is-submitting",
1472
+ "loading-label",
1473
+ "none-processable-label",
1474
+ "preview-error-label",
1475
+ "processable-count",
1476
+ "processable-label",
1477
+ "skip-reasons",
1478
+ "skipped-invoices",
1479
+ "skipped-preview-label",
1480
+ "title"
1481
+ ]));
1482
+ }
1483
+ });
1484
+ //#endregion
1485
+ //#region src/modules/invoice/api/mutations/invoiceBulkSend.mutation.ts
1486
+ function Tn() {
1487
+ return U({
1488
+ queryFn: (e) => b.bulkSend(e.params.invoiceUuids),
1489
+ queryKeysToInvalidate: { invoiceDetail: {} }
1490
+ });
1491
+ }
1492
+ //#endregion
1493
+ //#region src/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendDialog.vue
1494
+ var En = /* @__PURE__ */ L({
1495
+ __name: "InvoiceOverviewBulkSendDialog",
1496
+ props: {
1497
+ invoices: {},
1498
+ onSent: { type: Function }
1499
+ },
1500
+ emits: ["close"],
1501
+ setup(e, { emit: t }) {
1502
+ let n = e, r = t, a = A(), o = X(), s = Tn(), c = z(!0), l = z(!1), u = z(null), d = z(null), p = j(() => n.invoices.filter((e) => e.status === i.FINALIZED)), m = j(() => p.value.map((e) => e.uuid)), h = j(() => u.value?.meta.processed ?? 0), g = j(() => $.getUnskippedInvoiceUuids(p.value, u.value?.skipped ?? [])), _ = j(() => {
1503
+ let e = new Set(g.value);
1504
+ return n.invoices.filter((t) => !e.has(t.uuid));
1505
+ }), v = j(() => _.value.length), y = j(() => u.value === null ? n.invoices.length : h.value);
1506
+ async function x() {
1507
+ let e = g.value;
1508
+ if (e.length === 0 || l.value) return;
1509
+ l.value = !0;
1510
+ let t = await s.execute({ params: { invoiceUuids: e } });
1511
+ if (l.value = !1, t.isErr()) {
1512
+ o.apiError(t.error);
1513
+ return;
1514
+ }
1515
+ let i = new Set(t.value.skipped.map((e) => e.uuid)), c = e.filter((e) => !i.has(e));
1516
+ u.value = t.value, c.length > 0 && O.reflectBulkAction(c, { deliveryStatus: f.PROCESSING }), t.value.meta.processed > 0 && o.show({ message: a.t("wise_invoicing.invoice.overview.bulk.send.success", { count: t.value.meta.processed }) }), v.value > 0 && o.show($.createSkippedToast({
1517
+ id: "invoice-overview-bulk-send-skipped",
1518
+ invoices: _.value,
1519
+ message: a.t("wise_invoicing.invoice.overview.bulk.send.skipped", { count: v.value })
1520
+ })), t.value.meta.processed !== 0 && (n.onSent(), r("close"));
1521
+ }
1522
+ async function S() {
1523
+ if (c.value = !0, m.value.length === 0) {
1524
+ u.value = $.createEmptyPreview(), c.value = !1;
1525
+ return;
1526
+ }
1527
+ let e = await b.previewBulkSend(m.value);
1528
+ if (e.isErr()) {
1529
+ d.value = a.t("wise_invoicing.invoice.overview.bulk.preview_error"), c.value = !1;
1530
+ return;
1531
+ }
1532
+ u.value = e.value, c.value = !1;
1533
+ }
1534
+ return Ve(() => {
1535
+ S();
1536
+ }), (e, t) => (R(), M(yn, {
1537
+ "confirm-label": V(a).t("wise_invoicing.invoice.overview.bulk.send.confirm"),
1538
+ description: V(a).t("wise_invoicing.invoice.overview.bulk.send.description"),
1539
+ icon: V(C),
1540
+ "is-preview-loading": c.value,
1541
+ "is-submitting": l.value,
1542
+ "loading-label": V(a).t("wise_invoicing.invoice.overview.bulk.send.loading"),
1543
+ "none-processable-label": V(a).t("wise_invoicing.invoice.overview.bulk.send.none_processable"),
1544
+ "preview-error-label": d.value,
1545
+ "processable-count": h.value,
1546
+ "processable-label": V(a).t("wise_invoicing.invoice.overview.bulk.send.processable", { count: h.value }),
1547
+ "skipped-invoices": _.value,
1548
+ "skipped-preview-label": V(a).t("wise_invoicing.invoice.overview.bulk.send.skipped_preview", { count: v.value }),
1549
+ title: V(a).t("wise_invoicing.invoice.overview.bulk.send.title", { count: y.value }),
1550
+ onClose: t[0] ||= (e) => r("close"),
1551
+ onConfirm: x
1552
+ }, null, 8, [
1553
+ "confirm-label",
1554
+ "description",
1555
+ "icon",
1556
+ "is-preview-loading",
1557
+ "is-submitting",
1558
+ "loading-label",
1559
+ "none-processable-label",
1560
+ "preview-error-label",
1561
+ "processable-count",
1562
+ "processable-label",
1563
+ "skipped-invoices",
1564
+ "skipped-preview-label",
1565
+ "title"
1566
+ ]));
1567
+ }
1568
+ }), Dn = /* @__PURE__ */ L({
1569
+ __name: "DateRangeFilterButton",
1570
+ props: /*@__PURE__*/ Re({ ariaLabel: {} }, {
1571
+ modelValue: { default: null },
1572
+ modelModifiers: {}
1573
+ }),
1574
+ emits: ["update:modelValue"],
1575
+ setup(e) {
1576
+ let t = e, n = Ge(e, "modelValue"), r = A(), i = z(!1), a = z({
1577
+ from: null,
1578
+ until: null
1579
+ });
1580
+ Ke(i, (e) => {
1581
+ e && (a.value = {
1582
+ from: n.value?.from ?? null,
1583
+ until: n.value?.until ?? null
1584
+ });
1585
+ });
1586
+ let o = le(), s = j(() => n.value === null ? r.t("component.date_range_filter_button.select_dates") : n.value.from !== null && n.value.until !== null && n.value.from.equals(n.value.until) ? o.formatPlainDate(n.value.from) : `${n.value.from === null ? "-" : o.formatPlainDate(n.value.from)} - ${n.value.until === null ? "-" : o.formatPlainDate(n.value.until)}`);
1587
+ function c() {
1588
+ n.value = a.value.from !== null || a.value.until !== null ? { ...a.value } : null, i.value = !1;
1589
+ }
1590
+ function l() {
1591
+ i.value = !1;
1592
+ }
1593
+ function u() {
1594
+ n.value = null, i.value = !1;
1595
+ }
1596
+ return (e, n) => (R(), M(V(mt), {
1597
+ "is-open": i.value,
1598
+ "onUpdate:isOpen": n[1] ||= (e) => i.value = e,
1599
+ "popover-side": "bottom",
1600
+ "popover-align": "end"
1601
+ }, {
1602
+ trigger: H(() => [I(V(W), {
1603
+ "aria-label": t.ariaLabel,
1604
+ label: s.value,
1605
+ "icon-right": V(ie),
1606
+ variant: "secondary"
1607
+ }, null, 8, [
1608
+ "aria-label",
1609
+ "label",
1610
+ "icon-right"
1611
+ ])]),
1612
+ content: H(() => [I(V(it), {
1613
+ modelValue: a.value,
1614
+ "onUpdate:modelValue": n[0] ||= (e) => a.value = e,
1615
+ class: "p-lg"
1616
+ }, null, 8, ["modelValue"]), I(V(K), {
1617
+ justify: "end",
1618
+ gap: "sm",
1619
+ class: "border-t border-secondary p-md"
1620
+ }, {
1621
+ default: H(() => [
1622
+ I(V(W), {
1623
+ label: V(r).t("shared.cancel"),
1624
+ variant: "tertiary",
1625
+ onClick: l
1626
+ }, null, 8, ["label"]),
1627
+ I(V(W), {
1628
+ label: V(r).t("shared.clear"),
1629
+ variant: "tertiary",
1630
+ onClick: u
1631
+ }, null, 8, ["label"]),
1632
+ I(V(W), {
1633
+ label: V(r).t("component.filters_date_range_dialog.apply"),
1634
+ variant: "primary",
1635
+ onClick: c
1636
+ }, null, 8, ["label"])
1637
+ ]),
1638
+ _: 1
1639
+ })]),
1640
+ _: 1
1641
+ }, 8, ["is-open"]));
1642
+ }
1643
+ }), On = { class: "relative flex min-h-0 flex-1 flex-col" }, kn = /* @__PURE__ */ L({
1644
+ __name: "InvoiceOverviewView",
1645
+ props: {
1646
+ currency: {},
1647
+ customFieldDefinitions: {},
1648
+ onCreateInvoice: { type: Function }
1649
+ },
1650
+ setup(e) {
1651
+ let t = e, n = A(), a = u(), o = Et(), c = o.create(It), l = o.create(bn), d = o.create(Sn), m = o.create(En), h = o.create(wn), g = v({ debounceMs: 300 }), _ = kt("tab", "all"), b = y({
1652
+ initialValues: [{
1653
+ direction: "desc",
1654
+ key: s.ISSUED_ON
1655
+ }],
1656
+ keys: [
1657
+ s.CUSTOMER,
1658
+ s.SEQUENCE,
1659
+ s.ISSUED_ON,
1660
+ s.NET_AMOUNT
1661
+ ]
1662
+ }), x = Ut(), { hasChangesSinceApprovalSent: S, approvalStatuses: ee, customerUuids: ne, customFields: re, dueOnRange: ie, filters: C, lifecycleStatuses: ae } = Vt({
1663
+ currency: t.currency,
1664
+ customFieldDefinitions: t.customFieldDefinitions
1665
+ });
1666
+ he(C);
1667
+ let oe = z(null), ce = j(() => x.getFilters(_.value)), { isFetchingNextPage: le, isLoading: ue, fetchNextPage: de, refetch: fe, result: w } = At({ params: {
1668
+ filters: j(() => ({
1669
+ hasChangesSinceApprovalSent: S.value,
1670
+ issuedOnRange: oe.value,
1671
+ approvalStatuses: ee.value,
1672
+ customerUuids: ne.value,
1673
+ customFields: re.value,
1674
+ dueOnRange: ie.value,
1675
+ lifecycleStatuses: ae.value,
1676
+ ...ce.value
1677
+ })),
1678
+ search: g.debouncedSearch,
1679
+ sort: b.values
1680
+ } });
1681
+ a.set(() => n.t("wise_invoicing.invoice.overview.title"));
1682
+ let pe = { name: () => n.t("wise_invoicing.invoice.overview.title") }, me = j(() => w.value.isOk() ? w.value.getValue().data : []), T = Wt({ rows: () => me.value });
1683
+ se({
1684
+ refetch: fe,
1685
+ sendingUuids: () => me.value.filter((e) => e.deliveryStatus === f.PROCESSING).map((e) => e.uuid)
1686
+ });
1687
+ let E = cn({
1688
+ customFieldDefinitions: () => t.customFieldDefinitions,
1689
+ selection: {
1690
+ isSelected: T.isSelected,
1691
+ toggleRow: T.toggleRow
1692
+ }
1693
+ }), { customizedColumns: ve, customizeTableAction: ye } = Dt({
1694
+ actionGroup: pe,
1695
+ availableColumns: E,
1696
+ initialState: Je("invoice-overview-columns", []).value
1697
+ }), be = j(() => w.value.isErr() ? w.value.getError() : null), xe = j(() => C.activeFilters.value.length), Se = j(() => (g.debouncedSearch.value?.trim().length ?? 0) > 0), Ce = j(() => T.selectedInvoices.value.some((e) => e.status === i.READY)), we = j(() => T.selectedInvoices.value.some((e) => e.status === i.DRAFT)), { canSend: Te } = zt({ selectedInvoices: () => T.selectedInvoices.value }), Ee = j(() => T.selectedInvoices.value.some((e) => {
1698
+ let t = D.getDisplayStatus({
1699
+ approval: e.approval,
1700
+ requiresPriorApproval: e.requiresPriorApproval
1701
+ });
1702
+ return t !== null && t !== r.APPROVED;
1703
+ }));
1704
+ Ke(me, () => {
1705
+ T.syncSelection();
1706
+ });
1707
+ function De() {
1708
+ if (t.onCreateInvoice !== void 0) {
1709
+ t.onCreateInvoice();
1710
+ return;
1711
+ }
1712
+ c.open();
1713
+ }
1714
+ async function Oe() {
1715
+ await d.open({
1716
+ invoices: T.selectedInvoices.value,
1717
+ onMarkedAsReady: () => {
1718
+ T.clearSelection();
1719
+ }
1720
+ });
1721
+ }
1722
+ async function ke() {
1723
+ await l.open({
1724
+ invoices: T.selectedInvoices.value,
1725
+ onFinalized: () => {
1726
+ T.clearSelection();
1727
+ }
1728
+ });
1729
+ }
1730
+ async function Ae() {
1731
+ await m.open({
1732
+ invoices: T.selectedInvoices.value,
1733
+ onSent: () => {
1734
+ T.clearSelection();
1735
+ }
1736
+ });
1737
+ }
1738
+ async function je() {
1739
+ await h.open({
1740
+ invoices: T.selectedInvoices.value,
1741
+ onSent: () => {
1742
+ T.clearSelection();
1743
+ }
1744
+ });
1745
+ }
1746
+ function O(e) {
1747
+ return e.type === p.CREDIT_NOTE ? {
1748
+ name: "invoicing-credit-note-detail",
1749
+ params: { creditNoteUuid: e.uuid }
1750
+ } : {
1751
+ name: "invoicing-invoice-detail",
1752
+ params: { invoiceUuid: e.uuid }
1753
+ };
1754
+ }
1755
+ return (e, t) => (R(), M(V(nt), { title: V(n).t("wise_invoicing.invoice.overview.title") }, {
1756
+ "page-actions-left": H(() => [I(V(vt), {
1757
+ modelValue: V(_),
1758
+ "onUpdate:modelValue": t[0] ||= (e) => Le(_) ? _.value = e : null,
1759
+ variant: "button-border"
1760
+ }, {
1761
+ default: H(() => [I(V(bt), null, {
1762
+ default: H(() => [(R(!0), P(Fe, null, He(V(x).tabs.value, (e) => (R(), M(V(yt), {
1763
+ key: e.key,
1764
+ value: e.key,
1765
+ label: e.label
1766
+ }, null, 8, ["value", "label"]))), 128))]),
1767
+ _: 1
1768
+ })]),
1769
+ _: 1
1770
+ }, 8, ["modelValue"])]),
1771
+ "page-actions-right": H(() => [I(V(K), {
1772
+ justify: "between",
1773
+ class: "items-stretch"
1774
+ }, {
1775
+ default: H(() => [I(Dn, {
1776
+ modelValue: oe.value,
1777
+ "onUpdate:modelValue": t[1] ||= (e) => oe.value = e,
1778
+ "aria-label": V(n).t("wise_invoicing.invoice.overview.filters.issued_on")
1779
+ }, null, 8, ["modelValue", "aria-label"]), I(V(K), { justify: "end" }, {
1780
+ default: H(() => [
1781
+ I(V(xt), {
1782
+ modelValue: V(g).search.value,
1783
+ "onUpdate:modelValue": t[2] ||= (e) => V(g).search.value = e,
1784
+ label: null,
1785
+ "icon-left": V(te),
1786
+ placeholder: V(n).t("wise_invoicing.common.search"),
1787
+ size: "sm",
1788
+ type: "search"
1789
+ }, null, 8, [
1790
+ "modelValue",
1791
+ "icon-left",
1792
+ "placeholder"
1793
+ ]),
1794
+ Ue(e.$slots, "actions"),
1795
+ I(V(W), {
1796
+ label: V(n).t("wise_invoicing.invoice.create.title"),
1797
+ onClick: De
1798
+ }, null, 8, ["label"])
1799
+ ]),
1800
+ _: 3
1801
+ })]),
1802
+ _: 3
1803
+ })]),
1804
+ default: H(() => [I(V(rt), null, {
1805
+ default: H(() => [I(V(K), { justify: "between" }, {
1806
+ default: H(() => [I(V(ge)), I(V(_e))]),
1807
+ _: 1
1808
+ })]),
1809
+ _: 1
1810
+ }), F("div", On, [I(V(ht), {
1811
+ columns: V(ve),
1812
+ data: me.value,
1813
+ "is-loading": V(ue),
1814
+ "is-fetching-next-page": V(le),
1815
+ error: be.value,
1816
+ "has-active-search": Se.value,
1817
+ "active-filter-count": xe.value,
1818
+ "get-key": (e) => e.uuid,
1819
+ "header-actions": [V(ye)],
1820
+ "get-link": O,
1821
+ "get-action-model": (e) => ({
1822
+ modelName: "Invoice",
1823
+ key: e.uuid,
1824
+ ...e
1825
+ }),
1826
+ onNextPage: V(de),
1827
+ onClearSearch: t[3] ||= (e) => V(g).clear(),
1828
+ onClearFilters: t[4] ||= (e) => V(C).clearAll()
1829
+ }, null, 8, [
1830
+ "columns",
1831
+ "data",
1832
+ "is-loading",
1833
+ "is-fetching-next-page",
1834
+ "error",
1835
+ "has-active-search",
1836
+ "active-filter-count",
1837
+ "get-key",
1838
+ "header-actions",
1839
+ "get-action-model",
1840
+ "onNextPage"
1841
+ ]), I(Rt, {
1842
+ "can-finalize": Ce.value,
1843
+ "can-select-all": V(T).canSelectAll.value,
1844
+ "can-mark-as-ready": we.value,
1845
+ "can-send": V(Te),
1846
+ "can-send-approval": Ee.value,
1847
+ "selected-count": V(T).selectedCount.value,
1848
+ onCancel: t[5] ||= (e) => V(T).clearSelection(),
1849
+ onFinalize: t[6] ||= (e) => ke(),
1850
+ onMarkAsReady: t[7] ||= (e) => Oe(),
1851
+ onSelectAll: t[8] ||= (e) => V(T).selectAll(),
1852
+ onSend: t[9] ||= (e) => Ae(),
1853
+ onSendApproval: t[10] ||= (e) => je()
1854
+ }, null, 8, [
1855
+ "can-finalize",
1856
+ "can-select-all",
1857
+ "can-mark-as-ready",
1858
+ "can-send",
1859
+ "can-send-approval",
1860
+ "selected-count"
1861
+ ])])]),
1862
+ _: 3
1863
+ }, 8, ["title"]));
1864
+ }
1865
+ }), An = /*@__PURE__*/ L({
1866
+ __name: "InvoiceOverviewViewDataProvider",
1867
+ props: { onCreateInvoice: { type: Function } },
1868
+ setup(e) {
1869
+ let t = xe(j(() => ({ entityTypes: [c.INVOICE] }))), n = Ne();
1870
+ return (r, i) => (R(), M(ue, { queries: {
1871
+ customFieldDefinitions: V(t),
1872
+ issuerSettings: V(n)
1873
+ } }, {
1874
+ default: H(({ data: t }) => [I(kn, {
1875
+ currency: t.issuerSettings.currency,
1876
+ "custom-field-definitions": t.customFieldDefinitions,
1877
+ "on-create-invoice": e.onCreateInvoice
1878
+ }, {
1879
+ actions: H(() => [Ue(r.$slots, "actions")]),
1880
+ _: 3
1881
+ }, 8, [
1882
+ "currency",
1883
+ "custom-field-definitions",
1884
+ "on-create-invoice"
1885
+ ])]),
1886
+ loading: H(() => [I(V(Pe).PageLoadingState, { breadcrumbs: [] })]),
1887
+ _: 3
1888
+ }, 8, ["queries"]));
1889
+ }
1890
+ }), jn = /* @__PURE__ */ e({ default: () => Mn }), Mn = An;
1891
+ //#endregion
1892
+ export { jn as n, At as r, Mn as t };