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