@wisemen/wise-invoicing-web 0.9.0 → 0.10.1
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.
- package/dist/{ApprovalReminderSettingsViewDataProvider-Dsp3ee3c.js → ApprovalReminderSettingsViewDataProvider-BS2YoGgl.js} +3 -3
- package/dist/{BillingDocumentDetailViewDataProvider-LDF8-wk8.js → BillingDocumentDetailViewDataProvider-SiA3wKE3.js} +59 -55
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-BYn3lUyl.js → BillingDocumentPdf-TtgJo1fO.js} +70 -64
- package/dist/{CreditNoteDetailViewDataProvider-rfc8cExF.js → CreditNoteDetailViewDataProvider-DM1LLE4c.js} +6 -6
- package/dist/{CreditNotePdfViewDataProvider-Co4R7QJx.js → CreditNotePdfViewDataProvider-PFBp22fM.js} +3 -3
- package/dist/{CustomFieldValueText-BP4bKQh7.js → CustomFieldValueText-WtQNcTYC.js} +2 -2
- package/dist/{DunningCaseDetailViewDataProvider-BNByfQTc.js → DunningCaseDetailViewDataProvider-CErdX-pv.js} +4 -4
- package/dist/{DunningCaseOverviewView-Dvwaw597.js → DunningCaseOverviewView-WwD9JXjB.js} +3 -3
- package/dist/{DunningCaseReminderPdfViewDataProvider-D1avIVyK.js → DunningCaseReminderPdfViewDataProvider-D-CfDeC8.js} +1 -1
- package/dist/{DunningCaseSendDialog-DwB_jFum.js → DunningCaseSendDialog-BVO1RRnK.js} +3 -3
- package/dist/{InvoiceApprovalOutOfSyncIndicator-B_9HLzpt.js → InvoiceApprovalOutOfSyncIndicator-DjdyQOVZ.js} +1 -1
- package/dist/{InvoiceApprovalOverviewView-jawT-M1t.js → InvoiceApprovalOverviewView-DIaEGjCD.js} +6 -6
- package/dist/{InvoiceApprovalStatusBadge-D6Sr6JmN.js → InvoiceApprovalStatusBadge-C2Wj9b_Z.js} +2 -2
- package/dist/{InvoiceApproveDialogDataProvider-Bwb8bP1e.js → InvoiceApproveDialogDataProvider-C2gzD-Qi.js} +6 -6
- package/dist/{InvoiceDetailViewDataProvider-BYYhc2v7.js → InvoiceDetailViewDataProvider-Cgr1UV3A.js} +14 -14
- package/dist/{InvoiceOverviewViewDataProvider-CLgV-Jcv.js → InvoiceOverviewViewDataProvider-iGeaSZr2.js} +650 -613
- package/dist/{InvoicePdfView-BIDvRCr4.js → InvoicePdfView-HE5xfefh.js} +1 -1
- package/dist/{InvoicePdfViewDataProvider-Ct1HBqqa.js → InvoicePdfViewDataProvider-D_nfLvjE.js} +3 -3
- package/dist/{InvoicePublicPdfViewDataProvider-DS0Q-BEX.js → InvoicePublicPdfViewDataProvider-BfH3d4Yp.js} +3 -3
- package/dist/{InvoicePublicProFormaPdfViewDataProvider-DqWKGeAm.js → InvoicePublicProFormaPdfViewDataProvider-DuULDBXH.js} +3 -3
- package/dist/{InvoicingFileUploadProvider-Dl1LvCPm.js → InvoicingFileUploadProvider-BsK5eRGE.js} +1 -1
- package/dist/{IssuerSettingsViewDataProvider-CXyyCvoZ.js → IssuerSettingsViewDataProvider-Ca7GPCDE.js} +2 -2
- package/dist/{PeppolSettingsViewDataProvider-Cptga29B.js → PeppolSettingsViewDataProvider-ZdJQGqux.js} +1 -1
- package/dist/{ReminderSettingsViewDataProvider-BZgzQIxM.js → ReminderSettingsViewDataProvider-DKn_gUae.js} +3 -3
- package/dist/{api.util-CR2xLnNj.js → api.util-B3JqQVJA.js} +918 -880
- package/dist/{billingDocumentDetail.transformer-D1f6Nv-U.js → billingDocumentDetail.transformer-SThiU53H.js} +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/sdk.gen.d.ts +32 -1
- package/dist/client/types.gen.d.ts +94 -9
- package/dist/client/zod.gen.d.ts +317 -9
- package/dist/composables/invoicingConfig.composable.d.ts +2 -0
- package/dist/{creditNoteDetail.query-DGeG9_sO.js → creditNoteDetail.query-CJFCcuup.js} +2 -2
- package/dist/{i18n.lib-MOiHLIGc.js → i18n.lib-CN9MRGQ0.js} +2 -6
- package/dist/index.d.ts +2 -6
- package/dist/index.js +27 -27
- package/dist/{invoice.service-Fv4F4aZq.js → invoice.service-CqfnsDYm.js} +221 -227
- package/dist/{invoiceApproval.service-DJvXagC7.js → invoiceApproval.service-DR9g1Dek.js} +2 -2
- package/dist/{invoiceApprovalStatus.util-B98WeAf0.js → invoiceApprovalStatus.util-Nd4E3qlZ.js} +1 -1
- package/dist/{invoiceCustomer.service-CDyrtcwH.js → invoiceCustomer.service-D55paEPq.js} +2 -2
- package/dist/{invoiceDetail.query-UHE0NCLh.js → invoiceDetail.query-CbfNqxKy.js} +1 -1
- package/dist/{invoiceIndexCache.util-CLM7FO6z.js → invoiceIndexCache.util-DrAs1VPN.js} +2 -2
- package/dist/{invoicingConfig.composable-UC7tGtBj.js → invoicingConfig.composable-DnGwITQJ.js} +15 -14
- package/dist/{issuerSettings.query-CoiXblSm.js → issuerSettings.query-BOgWdNmP.js} +1 -1
- package/dist/libs/i18n.lib.d.ts +2 -6
- package/dist/locales/en-US.json.d.ts +1 -3
- package/dist/locales/nl-BE.json.d.ts +1 -3
- package/dist/modules/invoice/api/mutations/invoiceBulkFinalize.mutation.d.ts +2 -2
- package/dist/modules/invoice/api/mutations/invoiceBulkMarkAsReady.mutation.d.ts +2 -2
- package/dist/modules/invoice/api/mutations/invoiceBulkSend.mutation.d.ts +2 -2
- package/dist/modules/invoice/api/mutations/invoiceBulkSendApproval.mutation.d.ts +2 -2
- package/dist/modules/invoice/api/services/invoice.service.d.ts +9 -8
- package/dist/modules/invoice/models/invoice/bulk/invoiceBulkTarget.model.d.ts +15 -0
- package/dist/modules/invoice/models/invoice/bulk/invoiceBulkTarget.transformer.d.ts +10 -0
- package/dist/modules/invoice/models/invoice/bulk/invoiceBulkTarget.transformer.spec.d.ts +1 -0
- package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.transformer.d.ts +7 -1
- package/dist/modules/invoice/use-cases/overview/components/InvoiceOverviewBulkActionBar.vue.d.ts +0 -3
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewBulkActionPlan.composable.d.ts +36 -0
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewBulkActionPlan.composable.spec.d.ts +1 -0
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewBulkSendEligibility.composable.d.ts +4 -1
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewFilters.composable.d.ts +1 -1
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewSelection.composable.d.ts +28 -15
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewSelection.composable.spec.d.ts +1 -0
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewTableColumns.composable.d.ts +0 -4
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkFinalizeDialog.vue.d.ts +2 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkMarkAsReadyDialog.vue.d.ts +2 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendApprovalDialog.vue.d.ts +2 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendDialog.vue.d.ts +2 -0
- package/dist/modules/invoice/use-cases/overview/views/InvoiceOverviewView.vue.d.ts +2 -2
- package/dist/{reminderConfig.query-aRFzY6uZ.js → reminderConfig.query-BIfCEIYX.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/modules/invoice/use-cases/overview/components/InvoiceOverviewTableSelectionCell.vue.d.ts +0 -10
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import "./api.util-
|
|
2
|
+
import "./api.util-B3JqQVJA.js";
|
|
3
3
|
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, t as u, u as d, v as f, x as p, y as m } from "./documentTitle.composable-RvqrZTBa.js";
|
|
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-
|
|
8
|
-
import { a as x, i as S, n as
|
|
9
|
-
import { r as
|
|
10
|
-
import { L as
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import { a as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { a as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import { z as
|
|
23
|
-
import { useI18n as
|
|
24
|
-
import { Fragment as
|
|
25
|
-
import { useMutation as
|
|
26
|
-
import { useLocalStorage as
|
|
27
|
-
import { RouterLink as
|
|
28
|
-
import { Temporal as
|
|
29
|
-
import { UIAutocomplete as
|
|
30
|
-
import { useForm as
|
|
31
|
-
import { useRouteQuery as
|
|
7
|
+
import { t as b } from "./invoice.service-CqfnsDYm.js";
|
|
8
|
+
import { a as x, i as S, n as ee, r as te, t as ne } from "./CustomFieldValueText-WtQNcTYC.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-Nd4E3qlZ.js";
|
|
17
|
+
import { n as Ee, t as De } from "./InvoiceApprovalOutOfSyncIndicator-DjdyQOVZ.js";
|
|
18
|
+
import { a as Oe, i as ke, n as Ae, o as je, r as Me, t as O } from "./invoiceIndexCache.util-DrAs1VPN.js";
|
|
19
|
+
import { t as Ne } from "./InvoiceApprovalStatusBadge-C2Wj9b_Z.js";
|
|
20
|
+
import { t as Pe } from "./issuerSettings.query-BOgWdNmP.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
|
|
34
|
-
let t =
|
|
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
|
|
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
|
|
52
|
-
return
|
|
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
|
|
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 =
|
|
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) => (
|
|
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:
|
|
98
|
-
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
|
-
}),
|
|
111
|
-
uuid:
|
|
112
|
-
name:
|
|
113
|
-
type:
|
|
114
|
-
}),
|
|
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 =
|
|
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 =
|
|
122
|
+
})), u = Ot({
|
|
123
123
|
initialState: { customer: null },
|
|
124
|
-
schema:
|
|
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) => (
|
|
141
|
-
form:
|
|
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:
|
|
146
|
-
|
|
147
|
-
title:
|
|
148
|
-
description:
|
|
149
|
-
icon:
|
|
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
|
-
|
|
156
|
-
default:
|
|
155
|
+
I(V(ot), null, {
|
|
156
|
+
default: H(() => [I(Mt, {
|
|
157
157
|
customers: l.value,
|
|
158
|
-
field:
|
|
159
|
-
"is-loading":
|
|
160
|
-
onNextPage:
|
|
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
|
-
|
|
171
|
-
right:
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
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 =
|
|
201
|
-
return (e, t) => n.selectedCount > 0 ? (
|
|
202
|
-
default:
|
|
203
|
-
|
|
204
|
-
text:
|
|
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 ? (
|
|
205
|
+
n.canMarkAsReady ? (R(), M(V(W), {
|
|
208
206
|
key: 0,
|
|
209
|
-
label:
|
|
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"])) :
|
|
212
|
-
n.canFinalize ? (
|
|
209
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
210
|
+
n.canFinalize ? (R(), M(V(W), {
|
|
213
211
|
key: 1,
|
|
214
|
-
label:
|
|
212
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.finalize.action"),
|
|
215
213
|
onClick: t[1] ||= (e) => r("finalize")
|
|
216
|
-
}, null, 8, ["label"])) :
|
|
217
|
-
n.canSend ? (
|
|
214
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
215
|
+
n.canSend ? (R(), M(V(W), {
|
|
218
216
|
key: 2,
|
|
219
|
-
label:
|
|
217
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.send.action"),
|
|
220
218
|
onClick: t[2] ||= (e) => r("send")
|
|
221
|
-
}, null, 8, ["label"])) :
|
|
222
|
-
n.canSendApproval ? (
|
|
219
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
220
|
+
n.canSendApproval ? (R(), M(V(W), {
|
|
223
221
|
key: 3,
|
|
224
|
-
label:
|
|
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"])) :
|
|
227
|
-
|
|
228
|
-
|
|
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[
|
|
228
|
+
onClick: t[4] ||= (e) => r("cancel")
|
|
237
229
|
}, null, 8, ["label"])
|
|
238
230
|
]),
|
|
239
231
|
_: 1
|
|
240
|
-
})])) :
|
|
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
|
|
246
|
-
let t =
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
|
254
|
-
|
|
255
|
-
}, { debounce: 300 }), { canSend:
|
|
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
|
|
263
|
+
function Bt(e, t) {
|
|
263
264
|
try {
|
|
264
265
|
switch (e) {
|
|
265
|
-
case d.DATE: return
|
|
266
|
-
case d.TIMESTAMP: return
|
|
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 =
|
|
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
|
|
358
|
-
let t =
|
|
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 =
|
|
364
|
+
let r = Q.getKey(n), i = te.getLabel(n, t.locale.value);
|
|
364
365
|
switch (n.type) {
|
|
365
|
-
case d.BOOLEAN: return
|
|
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
|
|
373
|
+
return ve({
|
|
373
374
|
customUnit: a,
|
|
374
375
|
defaultValue: {
|
|
375
|
-
operator:
|
|
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
|
|
387
|
+
case d.NUMBER: return ve({
|
|
387
388
|
defaultValue: {
|
|
388
|
-
operator:
|
|
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
|
|
399
|
+
case d.SINGLE_SELECT: return _e({
|
|
399
400
|
defaultValue: {
|
|
400
|
-
operator:
|
|
401
|
+
operator: E.INCLUDES,
|
|
401
402
|
value: []
|
|
402
403
|
},
|
|
403
404
|
disableOperators: !0,
|
|
404
|
-
displayFn: (e) =>
|
|
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
|
|
413
|
+
case d.TIMESTAMP: return w({
|
|
413
414
|
defaultValue: {
|
|
414
|
-
operator:
|
|
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 =
|
|
426
|
+
}), c = ye({
|
|
426
427
|
actionGroup: { name: "invoices" },
|
|
427
428
|
filters: [
|
|
428
|
-
|
|
429
|
+
w({
|
|
429
430
|
defaultValue: {
|
|
430
|
-
operator:
|
|
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
|
-
|
|
440
|
+
T({
|
|
440
441
|
defaultValue: {
|
|
441
|
-
operator:
|
|
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
|
-
|
|
452
|
+
_e({
|
|
452
453
|
defaultValue: {
|
|
453
|
-
operator:
|
|
454
|
+
operator: E.INCLUDES,
|
|
454
455
|
value: []
|
|
455
456
|
},
|
|
456
457
|
disableOperators: !0,
|
|
457
|
-
displayFn: (e) => t.t(
|
|
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
|
-
|
|
463
|
+
_e({
|
|
463
464
|
defaultValue: {
|
|
464
|
-
operator:
|
|
465
|
+
operator: E.INCLUDES,
|
|
465
466
|
value: []
|
|
466
467
|
},
|
|
467
468
|
disableOperators: !0,
|
|
468
|
-
displayFn: (e) => t.t(
|
|
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
|
-
|
|
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 =
|
|
482
|
+
}), l = j(() => {
|
|
482
483
|
let e = c.values.value.customerUuids.value;
|
|
483
484
|
return e?.length ? e : null;
|
|
484
|
-
}), u =
|
|
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 =
|
|
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 =
|
|
494
|
+
}), p = j(() => {
|
|
494
495
|
let e = c.values.value.lifecycleStatuses.value;
|
|
495
496
|
return e?.length ? e : null;
|
|
496
|
-
}), h =
|
|
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:
|
|
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
|
|
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
|
|
526
|
-
let e =
|
|
532
|
+
function Ut() {
|
|
533
|
+
let e = A();
|
|
527
534
|
return {
|
|
528
|
-
getFilters: (e) => e === "all" ? {} :
|
|
529
|
-
tabs:
|
|
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: "
|
|
552
|
-
label: e.t("wise_invoicing.invoice.overview.tabs.
|
|
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 =
|
|
561
|
-
let
|
|
562
|
-
return
|
|
563
|
-
}),
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
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__ */
|
|
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 =
|
|
607
|
-
let e =
|
|
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) => (
|
|
623
|
-
default:
|
|
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:
|
|
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
|
-
},
|
|
632
|
+
}, B(a.value), 9, qt))]),
|
|
632
633
|
_: 1
|
|
633
634
|
})]),
|
|
634
635
|
_: 1
|
|
635
636
|
}));
|
|
636
637
|
}
|
|
637
|
-
}), Yt = /* @__PURE__ */
|
|
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) => (
|
|
647
|
-
default:
|
|
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:
|
|
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 ? (
|
|
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__ */
|
|
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) => (
|
|
668
|
-
default:
|
|
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
|
-
})) : (
|
|
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__ */
|
|
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 =
|
|
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(
|
|
691
|
+
let e = t.value.toZonedDateTime($e.Now.timeZoneId()).toInstant();
|
|
691
692
|
return n.toRelativeTime(e);
|
|
692
693
|
});
|
|
693
|
-
return (e, n) => (
|
|
694
|
-
default:
|
|
695
|
-
default:
|
|
696
|
-
class:
|
|
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 ?
|
|
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__ */
|
|
714
|
+
}), Qt = /* @__PURE__ */ L({
|
|
714
715
|
__name: "InvoiceOverviewTableIssuedDateCell",
|
|
715
716
|
props: { value: {} },
|
|
716
717
|
setup(e) {
|
|
717
|
-
let t = e, n =
|
|
718
|
-
return (e, t) => (
|
|
719
|
-
default:
|
|
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__ */
|
|
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) => (
|
|
735
|
-
default:
|
|
736
|
-
default:
|
|
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__ */
|
|
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 =
|
|
751
|
-
return (e, r) => (
|
|
752
|
-
default:
|
|
753
|
-
default:
|
|
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
|
-
},
|
|
757
|
+
}, B(t.customerName), 9, tn), t.type === V(p).CREDIT_NOTE ? (R(), M(V(le), {
|
|
757
758
|
key: 0,
|
|
758
|
-
"aria-label":
|
|
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"])) :
|
|
762
|
+
}, null, 8, ["aria-label"])) : N("", !0)]),
|
|
762
763
|
_: 1
|
|
763
|
-
}),
|
|
764
|
+
}), F("span", {
|
|
764
765
|
title: t.subject ?? void 0,
|
|
765
766
|
class: "truncate text-xs/4 text-secondary"
|
|
766
|
-
},
|
|
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
|
-
}),
|
|
771
|
+
}), an = /* @__PURE__ */ L({
|
|
791
772
|
__name: "InvoiceOverviewTableSentCell",
|
|
792
773
|
props: { deliveryStatus: {} },
|
|
793
774
|
setup(e) {
|
|
794
|
-
let t = e, n =
|
|
795
|
-
return (e, i) => (
|
|
796
|
-
default:
|
|
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 ===
|
|
780
|
+
})) : t.deliveryStatus === V(f).PROCESSING ? (R(), M(V(pt), {
|
|
800
781
|
key: 1,
|
|
801
|
-
"aria-label":
|
|
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 ===
|
|
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:
|
|
812
|
-
default:
|
|
813
|
-
"aria-label":
|
|
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:
|
|
819
|
-
default:
|
|
820
|
-
text:
|
|
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
|
-
})) :
|
|
807
|
+
})) : N("", !0)]),
|
|
827
808
|
_: 1
|
|
828
809
|
}));
|
|
829
810
|
}
|
|
830
|
-
}),
|
|
811
|
+
}), on = /* @__PURE__ */ L({
|
|
831
812
|
__name: "InvoiceOverviewTableSequenceCell",
|
|
832
813
|
props: { sequence: {} },
|
|
833
814
|
setup(e) {
|
|
834
|
-
return (t, n) => (
|
|
835
|
-
default:
|
|
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
|
-
}),
|
|
820
|
+
}), sn = /* @__PURE__ */ L({
|
|
840
821
|
__name: "InvoiceOverviewTableStatusCell",
|
|
841
822
|
props: { value: {} },
|
|
842
823
|
setup(e) {
|
|
843
|
-
let t = e, n =
|
|
844
|
-
return (e, i) => (
|
|
845
|
-
default:
|
|
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
|
|
869
|
-
let n =
|
|
870
|
-
return
|
|
871
|
-
let r = e?.
|
|
872
|
-
headerLabel:
|
|
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) =>
|
|
859
|
+
component: (t) => Y(Xt, {
|
|
879
860
|
definition: e,
|
|
880
861
|
value: t.customFields.find((t) => t.definitionUuid === e.uuid)
|
|
881
862
|
})
|
|
882
|
-
})) ?? []
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
958
|
+
component: (e) => Y(Jt, { value: e })
|
|
990
959
|
},
|
|
991
|
-
...
|
|
960
|
+
...r
|
|
992
961
|
]);
|
|
993
962
|
});
|
|
994
963
|
}
|
|
995
964
|
//#endregion
|
|
996
965
|
//#region src/modules/invoice/api/mutations/invoiceBulkFinalize.mutation.ts
|
|
997
|
-
function
|
|
998
|
-
return
|
|
999
|
-
queryFn: (e) => b.bulkFinalize(e.params.
|
|
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
|
|
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
|
-
},
|
|
1015
|
-
approvalStatus:
|
|
1016
|
-
level:
|
|
1017
|
-
}),
|
|
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 =
|
|
1018
|
+
let e = dn.safeParse(n.errors[0]?.errors[0]?.meta);
|
|
1050
1019
|
if (!e.success) continue;
|
|
1051
|
-
let r =
|
|
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] =
|
|
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 ?
|
|
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
|
-
}
|
|
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__ */
|
|
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) => (
|
|
1135
|
+
return (e, t) => (R(), M(V(at), {
|
|
1125
1136
|
size: "sm",
|
|
1126
1137
|
onClose: t[1] ||= (e) => r("close")
|
|
1127
1138
|
}, {
|
|
1128
|
-
default:
|
|
1129
|
-
|
|
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
|
-
|
|
1139
|
-
default:
|
|
1140
|
-
default:
|
|
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:
|
|
1146
|
-
default:
|
|
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:
|
|
1151
|
-
to:
|
|
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:
|
|
1165
|
+
default: H(() => [Le(B(V($).getInvoiceLabel(e)), 1)]),
|
|
1155
1166
|
_: 2
|
|
1156
|
-
}, 1032, ["to"]), n.skipReasons?.[e.uuid] === void 0 ?
|
|
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
|
-
})) :
|
|
1173
|
+
})) : N("", !0)], 64)) : (R(), P("p", mn, B(n.previewErrorLabel), 1))]),
|
|
1163
1174
|
_: 1
|
|
1164
1175
|
})]),
|
|
1165
1176
|
_: 1
|
|
1166
1177
|
}),
|
|
1167
|
-
|
|
1168
|
-
right:
|
|
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__ */
|
|
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 =
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
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
|
-
})
|
|
1215
|
+
});
|
|
1202
1216
|
async function S() {
|
|
1203
|
-
let e =
|
|
1204
|
-
if (e
|
|
1217
|
+
let e = v.value;
|
|
1218
|
+
if (e === null || l.value) return;
|
|
1205
1219
|
l.value = !0;
|
|
1206
|
-
let t = await s.execute({ params: {
|
|
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 =
|
|
1212
|
-
u.value = t.value,
|
|
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 }) }),
|
|
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:
|
|
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
|
|
1222
|
-
|
|
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
|
|
1227
|
-
if (
|
|
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 =
|
|
1247
|
+
u.value = t.value, c.value = !1;
|
|
1232
1248
|
}
|
|
1233
|
-
return
|
|
1234
|
-
|
|
1235
|
-
}), (e, t) => (
|
|
1236
|
-
"confirm-label":
|
|
1237
|
-
description:
|
|
1238
|
-
icon:
|
|
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":
|
|
1242
|
-
"none-processable-label":
|
|
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
|
|
1245
|
-
"processable-label":
|
|
1246
|
-
"skip-reasons":
|
|
1247
|
-
"skipped-invoices": _
|
|
1248
|
-
"skipped-preview-label":
|
|
1249
|
-
title:
|
|
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
|
|
1274
|
-
queryFn: (e) => b.bulkMarkAsReady(e.params.
|
|
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__ */
|
|
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 =
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
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 =
|
|
1294
|
-
if (e
|
|
1312
|
+
let e = v.value;
|
|
1313
|
+
if (e === null || l.value) return;
|
|
1295
1314
|
l.value = !0;
|
|
1296
|
-
let t = await s.execute({ params: {
|
|
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 =
|
|
1302
|
-
u.value = t.value,
|
|
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 }) }),
|
|
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:
|
|
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
|
-
|
|
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
|
|
1317
|
-
if (
|
|
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 =
|
|
1342
|
+
u.value = t.value, c.value = !1;
|
|
1322
1343
|
}
|
|
1323
|
-
return
|
|
1344
|
+
return He(() => {
|
|
1324
1345
|
S();
|
|
1325
|
-
}), (e, t) => (
|
|
1326
|
-
"confirm-label":
|
|
1327
|
-
description:
|
|
1328
|
-
icon:
|
|
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":
|
|
1332
|
-
"none-processable-label":
|
|
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
|
|
1335
|
-
"processable-label":
|
|
1336
|
-
"skipped-invoices": _
|
|
1337
|
-
"skipped-preview-label":
|
|
1338
|
-
title:
|
|
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
|
|
1362
|
-
queryFn: (e) => b.bulkSendApproval(e.params.
|
|
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__ */
|
|
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 =
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
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 =
|
|
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
|
-
})
|
|
1427
|
+
});
|
|
1404
1428
|
async function S() {
|
|
1405
|
-
let e =
|
|
1406
|
-
if (e
|
|
1407
|
-
let t = _.value, i =
|
|
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: {
|
|
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 =
|
|
1415
|
-
if (
|
|
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:
|
|
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 }) }),
|
|
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:
|
|
1429
|
-
message: o.t("wise_invoicing.invoice.overview.bulk.send_approval.skipped", { count:
|
|
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
|
|
1436
|
-
|
|
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
|
|
1441
|
-
if (
|
|
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 =
|
|
1471
|
+
d.value = t.value, l.value = !1;
|
|
1446
1472
|
}
|
|
1447
|
-
return
|
|
1448
|
-
|
|
1449
|
-
}), (e, t) => (
|
|
1450
|
-
"confirm-label":
|
|
1451
|
-
description:
|
|
1452
|
-
icon:
|
|
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":
|
|
1456
|
-
"none-processable-label":
|
|
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
|
|
1459
|
-
"processable-label":
|
|
1460
|
-
"skip-reasons":
|
|
1461
|
-
"skipped-invoices": _
|
|
1462
|
-
"skipped-preview-label":
|
|
1463
|
-
title:
|
|
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
|
|
1488
|
-
queryFn: (e) => b.bulkSend(e.params.
|
|
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__ */
|
|
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 =
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
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 =
|
|
1508
|
-
if (e
|
|
1536
|
+
let e = v.value;
|
|
1537
|
+
if (e === null || l.value) return;
|
|
1509
1538
|
l.value = !0;
|
|
1510
|
-
let t = await s.execute({ params: {
|
|
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 =
|
|
1516
|
-
u.value = t.value,
|
|
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:
|
|
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
|
-
|
|
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
|
|
1528
|
-
if (
|
|
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 =
|
|
1563
|
+
u.value = t.value, c.value = !1;
|
|
1533
1564
|
}
|
|
1534
|
-
return
|
|
1565
|
+
return He(() => {
|
|
1535
1566
|
S();
|
|
1536
|
-
}), (e, t) => (
|
|
1537
|
-
"confirm-label":
|
|
1538
|
-
description:
|
|
1539
|
-
icon:
|
|
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":
|
|
1543
|
-
"none-processable-label":
|
|
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
|
|
1546
|
-
"processable-label":
|
|
1547
|
-
"skipped-invoices": _
|
|
1548
|
-
"skipped-preview-label":
|
|
1549
|
-
title:
|
|
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__ */
|
|
1599
|
+
}), On = /* @__PURE__ */ L({
|
|
1569
1600
|
__name: "DateRangeFilterButton",
|
|
1570
|
-
props: /*@__PURE__*/
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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) => (
|
|
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:
|
|
1633
|
+
trigger: H(() => [I(V(W), {
|
|
1603
1634
|
"aria-label": t.ariaLabel,
|
|
1604
1635
|
label: s.value,
|
|
1605
|
-
"icon-right":
|
|
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:
|
|
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"]),
|
|
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:
|
|
1622
|
-
|
|
1623
|
-
label:
|
|
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
|
-
|
|
1628
|
-
label:
|
|
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
|
-
|
|
1633
|
-
label:
|
|
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__ */
|
|
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 =
|
|
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 =
|
|
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:
|
|
1695
|
+
customFieldDefinitions: ee.value
|
|
1665
1696
|
});
|
|
1666
|
-
|
|
1667
|
-
let
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
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
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
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
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
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
|
-
|
|
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
|
|
1746
|
+
async function Ne() {
|
|
1715
1747
|
await d.open({
|
|
1716
|
-
invoices:
|
|
1748
|
+
invoices: T.selectedInvoices.value,
|
|
1749
|
+
matching: T.matching.value,
|
|
1717
1750
|
onMarkedAsReady: () => {
|
|
1718
|
-
|
|
1751
|
+
T.clearSelection();
|
|
1719
1752
|
}
|
|
1720
1753
|
});
|
|
1721
1754
|
}
|
|
1722
|
-
async function
|
|
1755
|
+
async function Pe() {
|
|
1723
1756
|
await l.open({
|
|
1724
|
-
invoices:
|
|
1757
|
+
invoices: T.selectedInvoices.value,
|
|
1758
|
+
matching: T.matching.value,
|
|
1725
1759
|
onFinalized: () => {
|
|
1726
|
-
|
|
1760
|
+
T.clearSelection();
|
|
1727
1761
|
}
|
|
1728
1762
|
});
|
|
1729
1763
|
}
|
|
1730
|
-
async function
|
|
1764
|
+
async function Fe() {
|
|
1731
1765
|
await m.open({
|
|
1732
|
-
invoices:
|
|
1766
|
+
invoices: T.selectedInvoices.value,
|
|
1767
|
+
matching: T.matching.value,
|
|
1733
1768
|
onSent: () => {
|
|
1734
|
-
|
|
1769
|
+
T.clearSelection();
|
|
1735
1770
|
}
|
|
1736
1771
|
});
|
|
1737
1772
|
}
|
|
1738
|
-
async function
|
|
1773
|
+
async function k() {
|
|
1739
1774
|
await h.open({
|
|
1740
|
-
invoices:
|
|
1775
|
+
invoices: T.selectedInvoices.value,
|
|
1776
|
+
matching: T.matching.value,
|
|
1741
1777
|
onSent: () => {
|
|
1742
|
-
|
|
1778
|
+
T.clearSelection();
|
|
1743
1779
|
}
|
|
1744
1780
|
});
|
|
1745
1781
|
}
|
|
1746
|
-
function
|
|
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) => (
|
|
1756
|
-
"page-actions-left":
|
|
1757
|
-
modelValue:
|
|
1758
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
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:
|
|
1762
|
-
default:
|
|
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
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
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":
|
|
1786
|
-
placeholder:
|
|
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
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
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
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
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
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
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__*/
|
|
1902
|
+
}), jn = /*@__PURE__*/ L({
|
|
1866
1903
|
__name: "InvoiceOverviewViewDataProvider",
|
|
1867
1904
|
props: { onCreateInvoice: { type: Function } },
|
|
1868
1905
|
setup(e) {
|
|
1869
|
-
let t = S(
|
|
1870
|
-
return (r, i) => (
|
|
1871
|
-
customFieldDefinitions:
|
|
1872
|
-
issuerSettings:
|
|
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:
|
|
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:
|
|
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:
|
|
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 {
|
|
1929
|
+
export { At as i, Mn as n, Xt as r, Nn as t };
|