@wisemen/wise-invoicing-web 0.0.4 → 0.0.6
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/{BillingDocumentDetailViewDataProvider-pePmiXWb.js → BillingDocumentDetailViewDataProvider-BGE-p_FL.js} +953 -863
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-Dg5JlQE1.js → BillingDocumentPdf-Ca81NkZq.js} +4 -4
- package/dist/{CreditNoteDetailViewDataProvider-C-A0jyVr.js → CreditNoteDetailViewDataProvider-b5dY_4mH.js} +181 -181
- package/dist/{CreditNotePdfViewDataProvider-DNUvFVDj.js → CreditNotePdfViewDataProvider-C2QqCdQ7.js} +3 -3
- package/dist/{CustomFieldValueText-DDQq-975.js → CustomFieldValueText-ne5yy02J.js} +2 -2
- package/dist/DataProvider-Dj34ljUX.js +75 -0
- package/dist/{DunningCaseDetailViewDataProvider-0WV-7-vg.js → DunningCaseDetailViewDataProvider-jsh-LlGx.js} +68 -59
- package/dist/DunningCaseOverviewView-WbXalMt6.js +747 -0
- package/dist/{DunningCaseReminderPdfViewDataProvider-DcM-7ECg.js → DunningCaseReminderPdfViewDataProvider-B3Y2aYFf.js} +1 -1
- package/dist/DunningCaseSendDialog-D7jAZ8yT.js +349 -0
- package/dist/{InvoiceDetailViewDataProvider-BDL9lAWe.js → InvoiceDetailViewDataProvider-BAVdcJay.js} +589 -498
- package/dist/{InvoiceOverviewViewDataProvider-B_jrcC_8.js → InvoiceOverviewViewDataProvider-BT9cuQXw.js} +546 -482
- package/dist/{InvoicePdfView-Bygb-9z6.js → InvoicePdfView-BpIaYdZX.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-nBk3XNrE.js → InvoicePdfViewDataProvider-DGCnmNE-.js} +3 -3
- package/dist/{InvoicePublicPdfViewDataProvider-DHJP_-7-.js → InvoicePublicPdfViewDataProvider-KV0_hKUI.js} +3 -3
- package/dist/{IssuerSettingsViewDataProvider-Dk_Q6w6f.js → IssuerSettingsViewDataProvider-Bs4rEES2.js} +4 -4
- package/dist/ReminderSettingsViewDataProvider-D4bRLLXx.js +711 -0
- package/dist/{api.util-Dm_TQedZ.js → api.util-BCSgCfpS.js} +528 -509
- package/dist/{billingDocumentDetail.transformer-zMTbka5p.js → billingDocumentDetail.transformer-DIKAl4_L.js} +58 -89
- package/dist/client/index.d.ts +1 -1
- package/dist/client/types.gen.d.ts +28 -5
- package/dist/client/zod.gen.d.ts +869 -623
- package/dist/{creditNoteDetail.query-BZqgZRSu.js → creditNoteDetail.query-DHP69UiB.js} +13 -13
- package/dist/{dist-DP8KNFVD.js → dist-D9lp7NDv.js} +20 -36
- package/dist/{dist-DJ8yJcb9.js → dist-PErDVE6-.js} +621 -671
- package/dist/{documentTitle.composable-CeaFddr1.js → documentTitle.composable-4ApFl9TZ.js} +10 -8
- package/dist/{i18n.lib-DUbAMBRb.js → i18n.lib-BGcQ_OBF.js} +50 -2
- package/dist/index.d.ts +51 -2
- package/dist/index.js +78 -78
- package/dist/{invoice.service-ChHEtXBA.js → invoice.service-DG5eacZC.js} +46 -46
- package/dist/{invoiceDeliveryStatus.util-BsA-MlA3.js → invoiceDeliveryStatus.util-CX-IdqAu.js} +28 -28
- package/dist/{invoiceDetail.query-O_CGvdwg.js → invoiceDetail.query-C_IMGjOX.js} +1 -1
- package/dist/{invoicingConfig.composable-c6w_aMm1.js → invoicingConfig.composable-Kad_HHx_.js} +2 -2
- package/dist/{issuerSettings.query-RqtrZFaB.js → issuerSettings.query-6wnSPphB.js} +2 -2
- package/dist/libs/i18n.lib.d.ts +50 -2
- package/dist/locales/en-US.json.d.ts +25 -1
- package/dist/locales/nl-BE.json.d.ts +25 -1
- package/dist/models/billing-document/billingDocumentLineItemGroupUpdateForm.model.d.ts +9 -3
- package/dist/modules/dunning-case/actions/dunningCase.actions.d.ts +12 -0
- package/dist/modules/dunning-case/actions/dunningCaseNavigateToCustomer.action.d.ts +1 -0
- package/dist/modules/dunning-case/actions/dunningCaseNavigateToDetail.action.d.ts +1 -0
- package/dist/modules/dunning-case/api/mutations/reminderConfigUpdate.mutation.d.ts +2 -0
- package/dist/modules/dunning-case/models/dunningCase.model.d.ts +12 -3
- package/dist/modules/dunning-case/models/reminderConfigForm.model.d.ts +3 -1
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue.d.ts +13 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewCustomerCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewDaysOverdueCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewLastReminderCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewLevelCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewMetrics.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewOutstandingCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewReminderCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewActionsCell.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewLastReminderCell.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewReminderCell.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.d.ts +24 -0
- package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/dialogs/dunningCaseBulkSendDialog.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +3 -1
- package/dist/modules/dunning-case/use-cases/settings/components/reminderLadderFeeNotice.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +3 -1
- package/dist/modules/invoice/api/invoiceIndexCache.util.d.ts +4 -4
- package/dist/modules/invoice/api/queries/invoiceUserSearch.query.d.ts +3 -0
- package/dist/modules/invoice/api/query-keys/invoice.queryKeys.d.ts +8 -0
- package/dist/modules/invoice/api/services/invoiceUser.service.d.ts +6 -0
- package/dist/modules/invoice/components/form/InvoiceFormPreparedByField.vue.d.ts +16 -0
- package/dist/modules/invoice/models/invoice/update/invoicePreparer.model.d.ts +4 -0
- package/dist/modules/invoice/models/invoice/update/invoicePreparer.transformer.d.ts +5 -0
- package/dist/modules/invoice/models/invoice/update/invoiceUserSearchQueryParams.model.d.ts +3 -0
- package/dist/modules/invoice/models/invoice/update/invoiceUserSearchQueryParams.transformer.d.ts +6 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +1 -0
- package/dist/{plainDate.transformer-BxvJpJOv.js → plainDate.transformer-Dfe5r84P.js} +32 -1
- package/dist/{reminderConfig.query-DzTN2AvU.js → reminderConfig.query-hmDNKreg.js} +105 -91
- package/dist/search.composable-BCtYqudV.js +52 -0
- package/dist/style.css +1 -1
- package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +6 -6
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +1 -1
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsRowMutations.composable.d.ts +2 -2
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsRowMutations.composable.spec.d.ts +1 -0
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsTableDrag.composable.d.ts +3 -1
- package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableField.vue.d.ts +2 -0
- package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableTextField.vue.d.ts +1 -0
- package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +19 -0
- package/dist/ui/data-provider/DataProviderErrorState.vue.d.ts +7 -0
- package/dist/ui/data-provider/dataProviderErrorState.spec.d.ts +1 -0
- package/package.json +6 -1
- package/dist/DataProvider-CfHLB3rH.js +0 -48
- package/dist/DunningCaseOverviewView-CHdzfbhb.js +0 -553
- package/dist/DunningCaseSendDialog-DBtwr2ue.js +0 -350
- package/dist/ReminderSettingsViewDataProvider-CDBjfU7R.js +0 -668
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import "./api.util-
|
|
3
|
-
import {
|
|
2
|
+
import "./api.util-BCSgCfpS.js";
|
|
3
|
+
import { a as t, b as n, c as r, g as i, h as a, m as o, o as s, p as c, s as l, t as u, w as d } from "./documentTitle.composable-4ApFl9TZ.js";
|
|
4
4
|
import { n as f, r as p, t as m } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { n as D } from "./dist-
|
|
12
|
-
import {
|
|
5
|
+
import { t as h } from "./search.composable-BCtYqudV.js";
|
|
6
|
+
import { t as g } from "./src-BFgnUugN.js";
|
|
7
|
+
import { t as _ } from "./invoice.service-DG5eacZC.js";
|
|
8
|
+
import { t as v } from "./plainDate.transformer-Dfe5r84P.js";
|
|
9
|
+
import { G as y, H as b, I as x, L as S, tt as C, w as ee } from "./dist-D9lp7NDv.js";
|
|
10
|
+
import { n as w } from "./dist-YTXTCfo1.js";
|
|
11
|
+
import { a as te, c as ne, d as re, f as ie, i as T, l as ae, n as oe, o as se, r as E, s as ce, t as D, u as le } from "./dist-PErDVE6-.js";
|
|
12
|
+
import { a as ue } from "./billingDocumentDetail.transformer-DIKAl4_L.js";
|
|
13
|
+
import { i as de, n as O, r as fe, t as pe } from "./CustomFieldValueText-ne5yy02J.js";
|
|
13
14
|
import { t as me } from "./customerUuid.model-GUFYq3O2.js";
|
|
14
|
-
import { t as he } from "./DataProvider-
|
|
15
|
+
import { t as he } from "./DataProvider-Dj34ljUX.js";
|
|
15
16
|
import { t as ge } from "./formango.util-D5c2ql--.js";
|
|
16
|
-
import { c as _e, l as ve, n as ye, o as be, s as xe, t as Se, u as Ce } from "./invoiceDeliveryStatus.util-
|
|
17
|
-
import { t as we } from "./issuerSettings.query-
|
|
17
|
+
import { c as _e, l as ve, n as ye, o as be, s as xe, t as Se, u as Ce } from "./invoiceDeliveryStatus.util-CX-IdqAu.js";
|
|
18
|
+
import { t as we } from "./issuerSettings.query-6wnSPphB.js";
|
|
18
19
|
import { t as Te } from "./dashboard-BaWGNEek.js";
|
|
19
20
|
import { RouterLink as Ee, useRouter as De } from "vue-router";
|
|
20
21
|
import { z as k } from "zod";
|
|
21
22
|
import { useI18n as A } from "vue-i18n";
|
|
22
|
-
import { Fragment as
|
|
23
|
-
import { QueryClient as
|
|
24
|
-
import { useLocalStorage as
|
|
25
|
-
import { Temporal as
|
|
26
|
-
import { UIAutocomplete as
|
|
27
|
-
import { useForm as
|
|
28
|
-
import { useRouteQuery as
|
|
23
|
+
import { Fragment as Oe, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createTextVNode as ke, createVNode as I, defineComponent as L, isRef as Ae, mergeModels as je, mergeProps as Me, normalizeClass as Ne, onMounted as Pe, openBlock as R, ref as z, renderList as Fe, renderSlot as Ie, toDisplayString as B, unref as V, useModel as Le, watch as Re, withCtx as H } from "vue";
|
|
24
|
+
import { QueryClient as ze, getTanstackQueryClient as Be, useMutation as U, useOffsetInfiniteQuery as Ve } from "@wisemen/vue-core-api-utils";
|
|
25
|
+
import { useLocalStorage as He, watchDebounced as Ue } from "@vueuse/core";
|
|
26
|
+
import { Temporal as We } from "temporal-polyfill";
|
|
27
|
+
import { UIAutocomplete as Ge, UIBadge as Ke, UIButton as W, UICheckbox as qe, UIColumnLayout as G, UIDashboardPage as Je, UIDashboardPageActions as Ye, UIDateRangePicker as Xe, UIDialog as Ze, UIDialogBody as Qe, UIDialogFooter as $e, UIDialogFooterCancel as et, UIDialogFooterPrimary as tt, UIDialogFooterSubmit as nt, UIDialogHeader as rt, UIFormDialog as it, UIPopover as at, UIRowLayout as K, UITable as ot, UITableCell as q, UITableCellInteractiveElement as st, UITableCellText as ct, UITabs as lt, UITabsItem as ut, UITabsList as dt, UIText as ft, UITextField as pt, createAutocompleteOptions as mt, createComponent as J, defineTableColumns as ht, useOverlay as gt, useTableCustomizeColumns as _t, useToast as Y } from "@wisemen/vue-core-design-system";
|
|
28
|
+
import { useForm as vt } from "formango";
|
|
29
|
+
import { useRouteQuery as yt } from "@vueuse/router";
|
|
29
30
|
//#region src/modules/invoice/api/queries/invoiceIndex.query.ts
|
|
30
|
-
function
|
|
31
|
-
let t =
|
|
31
|
+
function bt(e) {
|
|
32
|
+
let t = j(() => ({
|
|
32
33
|
filters: e?.params?.filters?.value,
|
|
33
34
|
search: e?.params?.search?.value,
|
|
34
35
|
sort: e?.params?.sort?.value ?? []
|
|
35
36
|
}));
|
|
36
|
-
return
|
|
37
|
+
return Ve("invoiceIndex", {
|
|
37
38
|
params: { queryParams: t },
|
|
38
|
-
queryFn: (t) =>
|
|
39
|
+
queryFn: (t) => _.getAll({
|
|
39
40
|
filters: e?.params?.filters?.value,
|
|
40
41
|
pagination: t,
|
|
41
42
|
search: e?.params?.search?.value,
|
|
@@ -45,17 +46,17 @@ function yt(e) {
|
|
|
45
46
|
}
|
|
46
47
|
//#endregion
|
|
47
48
|
//#region src/modules/invoice/api/mutations/invoiceCreate.mutation.ts
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
queryFn: (e) =>
|
|
49
|
+
function xt() {
|
|
50
|
+
return U({
|
|
51
|
+
queryFn: (e) => _.create(e.body),
|
|
51
52
|
queryKeysToInvalidate: { invoiceIndex: {} }
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
//#endregion
|
|
55
56
|
//#region src/modules/invoice/api/queries/invoiceCustomerSearch.query.ts
|
|
56
|
-
function
|
|
57
|
-
let t =
|
|
58
|
-
return
|
|
57
|
+
function St(e) {
|
|
58
|
+
let t = j(() => ({ search: e.params.search?.value }));
|
|
59
|
+
return Ve("invoiceCustomerSearch", {
|
|
59
60
|
params: { queryParams: t },
|
|
60
61
|
queryFn: (t) => Ce.getAll({
|
|
61
62
|
pagination: t,
|
|
@@ -65,7 +66,7 @@ function xt(e) {
|
|
|
65
66
|
}
|
|
66
67
|
//#endregion
|
|
67
68
|
//#region src/modules/invoice/components/form/InvoiceFormCustomerField.vue
|
|
68
|
-
var
|
|
69
|
+
var Ct = /* @__PURE__ */ L({
|
|
69
70
|
__name: "InvoiceFormCustomerField",
|
|
70
71
|
props: {
|
|
71
72
|
isLoading: { type: Boolean },
|
|
@@ -74,7 +75,7 @@ var St = /* @__PURE__ */ R({
|
|
|
74
75
|
},
|
|
75
76
|
emits: ["nextPage", "updateSearch"],
|
|
76
77
|
setup(e, { emit: t }) {
|
|
77
|
-
let n = e, i = t, a = A(), o =
|
|
78
|
+
let n = e, i = t, a = A(), o = j(() => mt(n.customers));
|
|
78
79
|
function s(e) {
|
|
79
80
|
return e.name;
|
|
80
81
|
}
|
|
@@ -97,14 +98,14 @@ var St = /* @__PURE__ */ R({
|
|
|
97
98
|
function d(e) {
|
|
98
99
|
n.field.setValue(e), e !== null && i("updateSearch", "");
|
|
99
100
|
}
|
|
100
|
-
return (e, t) => (
|
|
101
|
+
return (e, t) => (R(), M(V(Ge), Me(V(ge)(n.field), {
|
|
101
102
|
"display-fn": s,
|
|
102
103
|
"get-item-config": l,
|
|
103
104
|
"is-loading": n.isLoading,
|
|
104
105
|
"is-required": !0,
|
|
105
106
|
items: o.value,
|
|
106
|
-
label:
|
|
107
|
-
placeholder:
|
|
107
|
+
label: V(a).t("wise_invoicing.invoice.create.fields.customer"),
|
|
108
|
+
placeholder: V(a).t("component.autocomplete.search_placeholder"),
|
|
108
109
|
"search-mode": "remote",
|
|
109
110
|
onNextPage: t[0] ||= (e) => i("nextPage"),
|
|
110
111
|
"onUpdate:modelValue": d,
|
|
@@ -116,21 +117,21 @@ var St = /* @__PURE__ */ R({
|
|
|
116
117
|
"placeholder"
|
|
117
118
|
]));
|
|
118
119
|
}
|
|
119
|
-
}),
|
|
120
|
+
}), wt = k.enum(r), Tt = k.object({
|
|
120
121
|
uuid: me,
|
|
121
122
|
name: k.string().min(1),
|
|
122
|
-
type:
|
|
123
|
-
}),
|
|
123
|
+
type: wt
|
|
124
|
+
}), Et = k.object({ customer: Tt }), Dt = /* @__PURE__ */ L({
|
|
124
125
|
__name: "InvoiceCreateDialog",
|
|
125
126
|
emits: ["close"],
|
|
126
127
|
setup(e, { emit: t }) {
|
|
127
|
-
let n = t, r = A(), i =
|
|
128
|
+
let n = t, r = A(), i = Y(), a = De(), o = xt(), s = h({ debounceMs: 250 }), c = St({ params: { search: s.debouncedSearch } }), l = j(() => c.result.value.match({
|
|
128
129
|
err: () => [],
|
|
129
130
|
loading: () => [],
|
|
130
131
|
ok: (e) => e.data
|
|
131
|
-
})), u =
|
|
132
|
+
})), u = vt({
|
|
132
133
|
initialState: { customer: null },
|
|
133
|
-
schema:
|
|
134
|
+
schema: Et,
|
|
134
135
|
onSubmit: async (e) => {
|
|
135
136
|
let t = await o.execute({ body: e });
|
|
136
137
|
if (t.isErr()) {
|
|
@@ -146,28 +147,28 @@ var St = /* @__PURE__ */ R({
|
|
|
146
147
|
function f(e) {
|
|
147
148
|
s.updateSearch(e);
|
|
148
149
|
}
|
|
149
|
-
return (e, t) => (
|
|
150
|
-
form:
|
|
150
|
+
return (e, t) => (R(), M(V(it), {
|
|
151
|
+
form: V(u),
|
|
151
152
|
size: "xs",
|
|
152
153
|
onClose: t[0] ||= (e) => n("close")
|
|
153
154
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
|
|
156
|
-
title:
|
|
157
|
-
description:
|
|
158
|
-
icon:
|
|
155
|
+
default: H(() => [
|
|
156
|
+
I(V(rt), {
|
|
157
|
+
title: V(r).t("wise_invoicing.invoice.create.modal_title"),
|
|
158
|
+
description: V(r).t("wise_invoicing.invoice.create.modal_description"),
|
|
159
|
+
icon: V(x),
|
|
159
160
|
"is-description-visible": !0
|
|
160
161
|
}, null, 8, [
|
|
161
162
|
"title",
|
|
162
163
|
"description",
|
|
163
164
|
"icon"
|
|
164
165
|
]),
|
|
165
|
-
|
|
166
|
-
default:
|
|
166
|
+
I(V(Qe), null, {
|
|
167
|
+
default: H(() => [I(Ct, {
|
|
167
168
|
customers: l.value,
|
|
168
|
-
field:
|
|
169
|
-
"is-loading":
|
|
170
|
-
onNextPage:
|
|
169
|
+
field: V(d),
|
|
170
|
+
"is-loading": V(c).isLoading.value,
|
|
171
|
+
onNextPage: V(c).fetchNextPage,
|
|
171
172
|
onUpdateSearch: f
|
|
172
173
|
}, null, 8, [
|
|
173
174
|
"customers",
|
|
@@ -177,18 +178,18 @@ var St = /* @__PURE__ */ R({
|
|
|
177
178
|
])]),
|
|
178
179
|
_: 1
|
|
179
180
|
}),
|
|
180
|
-
|
|
181
|
-
right:
|
|
181
|
+
I(V($e), null, {
|
|
182
|
+
right: H(() => [I(V(et), { label: "cancel" }), I(V(nt), { label: V(r).t("wise_invoicing.invoice.create.confirm") }, null, 8, ["label"])]),
|
|
182
183
|
_: 1
|
|
183
184
|
})
|
|
184
185
|
]),
|
|
185
186
|
_: 1
|
|
186
187
|
}, 8, ["form"]));
|
|
187
188
|
}
|
|
188
|
-
}),
|
|
189
|
+
}), Ot = {
|
|
189
190
|
key: 0,
|
|
190
191
|
class: "pointer-events-none fixed inset-x-0 bottom-4 z-20 flex justify-center px-lg"
|
|
191
|
-
},
|
|
192
|
+
}, kt = { class: "text-sm text-secondary" }, At = /* @__PURE__ */ L({
|
|
192
193
|
__name: "InvoiceOverviewBulkActionBar",
|
|
193
194
|
props: {
|
|
194
195
|
canFinalize: { type: Boolean },
|
|
@@ -206,75 +207,75 @@ var St = /* @__PURE__ */ R({
|
|
|
206
207
|
],
|
|
207
208
|
setup(e, { emit: t }) {
|
|
208
209
|
let n = e, r = t, i = A();
|
|
209
|
-
return (e, t) => n.selectedCount > 0 ? (
|
|
210
|
-
default:
|
|
211
|
-
|
|
212
|
-
n.canMarkAsReady ? (
|
|
210
|
+
return (e, t) => n.selectedCount > 0 ? (R(), P("div", Ot, [I(V(K), { class: "pointer-events-auto rounded-xl border border-secondary bg-primary px-lg py-sm shadow-lg" }, {
|
|
211
|
+
default: H(() => [
|
|
212
|
+
F("span", kt, B(V(i).t("wise_invoicing.invoice.overview.bulk.selected_documents", { count: n.selectedCount })), 1),
|
|
213
|
+
n.canMarkAsReady ? (R(), M(V(W), {
|
|
213
214
|
key: 0,
|
|
214
|
-
label:
|
|
215
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.action"),
|
|
215
216
|
onClick: t[0] ||= (e) => r("markAsReady")
|
|
216
|
-
}, null, 8, ["label"])) :
|
|
217
|
-
n.canFinalize ? (
|
|
217
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
218
|
+
n.canFinalize ? (R(), M(V(W), {
|
|
218
219
|
key: 1,
|
|
219
|
-
label:
|
|
220
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.finalize.action"),
|
|
220
221
|
onClick: t[1] ||= (e) => r("finalize")
|
|
221
|
-
}, null, 8, ["label"])) :
|
|
222
|
-
n.canSend ? (
|
|
222
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
223
|
+
n.canSend ? (R(), M(V(W), {
|
|
223
224
|
key: 2,
|
|
224
|
-
label:
|
|
225
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.send.action"),
|
|
225
226
|
onClick: t[2] ||= (e) => r("send")
|
|
226
|
-
}, null, 8, ["label"])) :
|
|
227
|
-
n.canSelectAll ? (
|
|
227
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
228
|
+
n.canSelectAll ? (R(), M(V(W), {
|
|
228
229
|
key: 3,
|
|
229
|
-
label:
|
|
230
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.select_all"),
|
|
230
231
|
variant: "secondary",
|
|
231
232
|
onClick: t[3] ||= (e) => r("selectAll")
|
|
232
|
-
}, null, 8, ["label"])) :
|
|
233
|
-
|
|
234
|
-
label:
|
|
233
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
234
|
+
I(V(W), {
|
|
235
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.cancel"),
|
|
235
236
|
variant: "tertiary",
|
|
236
237
|
onClick: t[4] ||= (e) => r("cancel")
|
|
237
238
|
}, null, 8, ["label"])
|
|
238
239
|
]),
|
|
239
240
|
_: 1
|
|
240
|
-
})])) :
|
|
241
|
+
})])) : N("", !0);
|
|
241
242
|
}
|
|
242
243
|
});
|
|
243
244
|
//#endregion
|
|
244
245
|
//#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewBulkSendEligibility.composable.ts
|
|
245
|
-
function
|
|
246
|
-
let t =
|
|
247
|
-
return
|
|
246
|
+
function jt(e) {
|
|
247
|
+
let t = z(null), n = j(() => e.selectedInvoices().filter((e) => e.status === a.FINALIZED).map((e) => e.uuid)), r = j(() => n.value.toSorted().join(","));
|
|
248
|
+
return Ue(r, async (e) => {
|
|
248
249
|
let i = n.value;
|
|
249
250
|
if (i.length === 0) {
|
|
250
251
|
t.value = null;
|
|
251
252
|
return;
|
|
252
253
|
}
|
|
253
|
-
let a = await
|
|
254
|
+
let a = await _.previewBulkSend(i);
|
|
254
255
|
r.value === e && (t.value = a.isErr() ? i.length : a.value.meta.processed);
|
|
255
|
-
}, { debounce: 300 }), { canSend:
|
|
256
|
+
}, { debounce: 300 }), { canSend: j(() => n.value.length > 0 && (t.value ?? 0) > 0) };
|
|
256
257
|
}
|
|
257
258
|
//#endregion
|
|
258
259
|
//#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewCustomFieldFilter.util.ts
|
|
259
|
-
function
|
|
260
|
+
function X(e) {
|
|
260
261
|
return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
261
262
|
}
|
|
262
|
-
function
|
|
263
|
+
function Mt(e, t) {
|
|
263
264
|
try {
|
|
264
265
|
switch (e) {
|
|
265
|
-
case l.DATE: return
|
|
266
|
-
case l.TIMESTAMP: return
|
|
266
|
+
case l.DATE: return v.toDto(v.fromDto(t));
|
|
267
|
+
case l.TIMESTAMP: return ue.toDto(ue.fromDto(t));
|
|
267
268
|
default: return t;
|
|
268
269
|
}
|
|
269
270
|
} catch {
|
|
270
271
|
return null;
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
|
-
var
|
|
274
|
+
var Z = 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 = Mt(e.type, n);
|
|
278
279
|
return r === null ? [] : [r];
|
|
279
280
|
}
|
|
280
281
|
static getKey(e) {
|
|
@@ -284,11 +285,11 @@ var Q = class {
|
|
|
284
285
|
let r = this.getRuleNumber(e, t);
|
|
285
286
|
return r === void 0 || n === void 0 ? void 0 : m(r, n);
|
|
286
287
|
}
|
|
287
|
-
static getMonetaryCurrency(e,
|
|
288
|
+
static getMonetaryCurrency(e, n) {
|
|
288
289
|
let r = e.rules?.currencies;
|
|
289
|
-
if (!Array.isArray(r)) return
|
|
290
|
-
let i = new Set(Object.values(
|
|
291
|
-
return a.includes(
|
|
290
|
+
if (!Array.isArray(r)) return n;
|
|
291
|
+
let i = new Set(Object.values(t)), a = r.filter((e) => typeof e == "string" && i.has(e));
|
|
292
|
+
return a.includes(n) ? n : a[0] ?? n;
|
|
292
293
|
}
|
|
293
294
|
static getRuleNumber(e, t) {
|
|
294
295
|
let n = e.rules?.[t];
|
|
@@ -318,32 +319,32 @@ var Q = class {
|
|
|
318
319
|
type: l.NUMBER,
|
|
319
320
|
value: t
|
|
320
321
|
}] : [];
|
|
321
|
-
case l.MULTI_SELECT: return
|
|
322
|
+
case l.MULTI_SELECT: return X(t) && t.length > 0 ? [{
|
|
322
323
|
definitionUuid: e.uuid,
|
|
323
324
|
type: l.MULTI_SELECT,
|
|
324
325
|
value: t
|
|
325
326
|
}] : [];
|
|
326
|
-
case l.TEXT_ARRAY: return
|
|
327
|
+
case l.TEXT_ARRAY: return X(t) && t.length > 0 ? [{
|
|
327
328
|
definitionUuid: e.uuid,
|
|
328
329
|
type: l.TEXT_ARRAY,
|
|
329
330
|
value: t
|
|
330
331
|
}] : [];
|
|
331
|
-
case l.DATE: return
|
|
332
|
+
case l.DATE: return X(t) ? t.map((t) => ({
|
|
332
333
|
definitionUuid: e.uuid,
|
|
333
334
|
type: l.DATE,
|
|
334
335
|
value: t
|
|
335
336
|
})) : [];
|
|
336
|
-
case l.SINGLE_SELECT: return
|
|
337
|
+
case l.SINGLE_SELECT: return X(t) ? t.map((t) => ({
|
|
337
338
|
definitionUuid: e.uuid,
|
|
338
339
|
type: l.SINGLE_SELECT,
|
|
339
340
|
value: t
|
|
340
341
|
})) : [];
|
|
341
|
-
case l.TEXT: return
|
|
342
|
+
case l.TEXT: return X(t) ? t.map((t) => ({
|
|
342
343
|
definitionUuid: e.uuid,
|
|
343
344
|
type: l.TEXT,
|
|
344
345
|
value: t
|
|
345
346
|
})) : [];
|
|
346
|
-
case l.TIMESTAMP: return
|
|
347
|
+
case l.TIMESTAMP: return X(t) ? t.map((t) => ({
|
|
347
348
|
definitionUuid: e.uuid,
|
|
348
349
|
type: l.TIMESTAMP,
|
|
349
350
|
value: t
|
|
@@ -354,50 +355,50 @@ 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 = A(), n =
|
|
358
|
+
function Nt(e) {
|
|
359
|
+
let t = A(), n = h({ debounceMs: 250 }), r = St({ params: { search: n.debouncedSearch } }), i = j(() => r.result.value.match({
|
|
359
360
|
err: () => [],
|
|
360
361
|
loading: () => [],
|
|
361
362
|
ok: (e) => e.data
|
|
362
363
|
})), a = e.customFieldDefinitions.map((n) => {
|
|
363
|
-
let r =
|
|
364
|
+
let r = Z.getKey(n), i = O.getLabel(n, t.locale.value);
|
|
364
365
|
switch (n.type) {
|
|
365
|
-
case l.BOOLEAN: return
|
|
366
|
+
case l.BOOLEAN: return ne({
|
|
366
367
|
entityLabel: i,
|
|
367
368
|
key: r,
|
|
368
369
|
label: i
|
|
369
370
|
});
|
|
370
371
|
case l.MONETARY: {
|
|
371
|
-
let t =
|
|
372
|
-
return
|
|
372
|
+
let t = Z.getRuleNumber(n, "precision"), a = Z.getMonetaryCurrency(n, e.currency);
|
|
373
|
+
return re({
|
|
373
374
|
customUnit: a,
|
|
374
375
|
defaultValue: {
|
|
375
|
-
operator:
|
|
376
|
+
operator: le.EQUALS,
|
|
376
377
|
value: null
|
|
377
378
|
},
|
|
378
379
|
disableOperators: !0,
|
|
379
380
|
key: r,
|
|
380
381
|
label: i,
|
|
381
|
-
max:
|
|
382
|
-
min:
|
|
382
|
+
max: Z.getMajorUnitRule(n, "max", t),
|
|
383
|
+
min: Z.getMajorUnitRule(n, "min", t),
|
|
383
384
|
step: t === void 0 ? void 0 : 1 / 10 ** t
|
|
384
385
|
});
|
|
385
386
|
}
|
|
386
|
-
case l.NUMBER: return
|
|
387
|
+
case l.NUMBER: return re({
|
|
387
388
|
defaultValue: {
|
|
388
|
-
operator:
|
|
389
|
+
operator: le.EQUALS,
|
|
389
390
|
value: null
|
|
390
391
|
},
|
|
391
392
|
disableOperators: !0,
|
|
392
393
|
key: r,
|
|
393
394
|
label: i,
|
|
394
|
-
max:
|
|
395
|
-
min:
|
|
395
|
+
max: Z.getRuleNumber(n, "max"),
|
|
396
|
+
min: Z.getRuleNumber(n, "min")
|
|
396
397
|
});
|
|
397
398
|
case l.MULTI_SELECT:
|
|
398
|
-
case l.SINGLE_SELECT: return
|
|
399
|
+
case l.SINGLE_SELECT: return te({
|
|
399
400
|
defaultValue: {
|
|
400
|
-
operator:
|
|
401
|
+
operator: E.INCLUDES,
|
|
401
402
|
value: []
|
|
402
403
|
},
|
|
403
404
|
disableOperators: !0,
|
|
@@ -409,25 +410,25 @@ function Mt(e) {
|
|
|
409
410
|
case l.DATE:
|
|
410
411
|
case l.TEXT:
|
|
411
412
|
case l.TEXT_ARRAY:
|
|
412
|
-
case l.TIMESTAMP: return
|
|
413
|
+
case l.TIMESTAMP: return ie({
|
|
413
414
|
defaultValue: {
|
|
414
|
-
operator:
|
|
415
|
+
operator: E.INCLUDES,
|
|
415
416
|
value: []
|
|
416
417
|
},
|
|
417
418
|
disableOperators: !0,
|
|
418
419
|
displayFn: (e) => e,
|
|
419
420
|
key: r,
|
|
420
421
|
label: i,
|
|
421
|
-
options: (e) => Promise.resolve(
|
|
422
|
+
options: (e) => Promise.resolve(Z.getFreeformOptions(n, e))
|
|
422
423
|
});
|
|
423
424
|
default: throw TypeError("Unsupported custom field definition type");
|
|
424
425
|
}
|
|
425
|
-
}),
|
|
426
|
+
}), s = T({
|
|
426
427
|
actionGroup: { name: "invoices" },
|
|
427
428
|
filters: [
|
|
428
|
-
|
|
429
|
+
ie({
|
|
429
430
|
defaultValue: {
|
|
430
|
-
operator:
|
|
431
|
+
operator: E.INCLUDES,
|
|
431
432
|
value: []
|
|
432
433
|
},
|
|
433
434
|
disableOperators: !0,
|
|
@@ -436,9 +437,9 @@ function Mt(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)), i.value.map((e) => e.uuid))
|
|
438
439
|
}),
|
|
439
|
-
|
|
440
|
+
ae({
|
|
440
441
|
defaultValue: {
|
|
441
|
-
operator:
|
|
442
|
+
operator: D.IS_BETWEEN,
|
|
442
443
|
value: {
|
|
443
444
|
from: null,
|
|
444
445
|
until: null
|
|
@@ -448,60 +449,60 @@ function Mt(e) {
|
|
|
448
449
|
key: "dueOnRange",
|
|
449
450
|
label: t.t("wise_invoicing.invoice.overview.filters.due_on")
|
|
450
451
|
}),
|
|
451
|
-
|
|
452
|
+
te({
|
|
452
453
|
defaultValue: {
|
|
453
|
-
operator:
|
|
454
|
+
operator: E.INCLUDES,
|
|
454
455
|
value: []
|
|
455
456
|
},
|
|
456
457
|
disableOperators: !0,
|
|
457
458
|
displayFn: (e) => t.t(de.getLifecycleMetadata(e).translationKey),
|
|
458
459
|
key: "lifecycleStatuses",
|
|
459
460
|
label: t.t("wise_invoicing.invoice.overview.filters.lifecycle"),
|
|
460
|
-
options: () => Object.values(
|
|
461
|
+
options: () => Object.values(o)
|
|
461
462
|
}),
|
|
462
463
|
...a
|
|
463
464
|
]
|
|
464
|
-
}),
|
|
465
|
-
let e =
|
|
465
|
+
}), c = j(() => {
|
|
466
|
+
let e = s.values.value.customerUuids.value;
|
|
466
467
|
return e?.length ? e : null;
|
|
467
|
-
}), u =
|
|
468
|
-
let e =
|
|
468
|
+
}), u = j(() => {
|
|
469
|
+
let e = s.values.value.dueOnRange.value;
|
|
469
470
|
return e.from === null || e.until === null ? null : e;
|
|
470
471
|
});
|
|
471
472
|
return {
|
|
472
|
-
customerUuids:
|
|
473
|
-
customFields:
|
|
474
|
-
let t =
|
|
473
|
+
customerUuids: c,
|
|
474
|
+
customFields: j(() => {
|
|
475
|
+
let t = s.values.value;
|
|
475
476
|
return e.customFieldDefinitions.flatMap((n) => {
|
|
476
|
-
let r = t[
|
|
477
|
-
return
|
|
477
|
+
let r = t[Z.getKey(n)], i = typeof r == "object" && r && "value" in r ? r.value : r;
|
|
478
|
+
return Z.toFilters(n, i, e.currency);
|
|
478
479
|
});
|
|
479
480
|
}),
|
|
480
481
|
dueOnRange: u,
|
|
481
|
-
filters:
|
|
482
|
-
lifecycleStatuses:
|
|
483
|
-
let e =
|
|
482
|
+
filters: s,
|
|
483
|
+
lifecycleStatuses: j(() => {
|
|
484
|
+
let e = s.values.value.lifecycleStatuses.value;
|
|
484
485
|
return e?.length ? e : null;
|
|
485
486
|
})
|
|
486
487
|
};
|
|
487
488
|
}
|
|
488
489
|
//#endregion
|
|
489
490
|
//#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewFilters.composable.ts
|
|
490
|
-
var
|
|
491
|
+
var Pt = {
|
|
491
492
|
awaiting_payment: {
|
|
492
|
-
settlementStatuses: [
|
|
493
|
-
statuses: [
|
|
493
|
+
settlementStatuses: [n.UNPAID, n.PARTIALLY_PAID],
|
|
494
|
+
statuses: [a.SENT]
|
|
494
495
|
},
|
|
495
|
-
credited: { settlementStatuses: [
|
|
496
|
+
credited: { settlementStatuses: [n.CREDITED] },
|
|
496
497
|
overdue: { isOverdue: !0 },
|
|
497
|
-
paid: { settlementStatuses: [
|
|
498
|
-
settled: { settlementStatuses: [
|
|
498
|
+
paid: { settlementStatuses: [n.PAID, n.OVERPAID] },
|
|
499
|
+
settled: { settlementStatuses: [n.SETTLED] }
|
|
499
500
|
};
|
|
500
|
-
function
|
|
501
|
+
function Ft() {
|
|
501
502
|
let e = A();
|
|
502
503
|
return {
|
|
503
|
-
getFilters: (e) => e === "all" ? {} :
|
|
504
|
-
tabs:
|
|
504
|
+
getFilters: (e) => e === "all" ? {} : Pt[e],
|
|
505
|
+
tabs: j(() => [
|
|
505
506
|
{
|
|
506
507
|
key: "all",
|
|
507
508
|
label: e.t("wise_invoicing.invoice.overview.tabs.all")
|
|
@@ -531,14 +532,14 @@ function Pt() {
|
|
|
531
532
|
}
|
|
532
533
|
//#endregion
|
|
533
534
|
//#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewSelection.composable.ts
|
|
534
|
-
function
|
|
535
|
-
let t =
|
|
535
|
+
function It(e) {
|
|
536
|
+
let t = z([]), n = j(() => {
|
|
536
537
|
let n = new Set(t.value);
|
|
537
538
|
return e.rows().filter((e) => n.has(e.uuid));
|
|
538
|
-
}), r =
|
|
539
|
+
}), r = j(() => {
|
|
539
540
|
let t = e.rows();
|
|
540
541
|
return t.length > 0 && n.value.length === t.length;
|
|
541
|
-
}), i =
|
|
542
|
+
}), i = j(() => e.rows().length > 0 && !r.value), a = j(() => n.value.length);
|
|
542
543
|
function o(e) {
|
|
543
544
|
return t.value.includes(e);
|
|
544
545
|
}
|
|
@@ -574,11 +575,11 @@ function Ft(e) {
|
|
|
574
575
|
}
|
|
575
576
|
//#endregion
|
|
576
577
|
//#region src/modules/invoice/use-cases/overview/components/InvoiceOverviewTableAmountCell.vue?vue&type=script&setup=true&lang.ts
|
|
577
|
-
var
|
|
578
|
+
var Lt = { class: "font-medium text-secondary" }, Rt = ["title"], zt = /* @__PURE__ */ L({
|
|
578
579
|
__name: "InvoiceOverviewTableAmountCell",
|
|
579
580
|
props: { value: {} },
|
|
580
581
|
setup(e) {
|
|
581
|
-
let t = e, n = A(), r = p(), i =
|
|
582
|
+
let t = e, n = A(), r = p(), i = j(() => r.formatMonetary(t.value.total)), a = j(() => {
|
|
582
583
|
let e = ve.getSubtextParts({
|
|
583
584
|
balanceDueAmount: t.value.balanceDueAmount,
|
|
584
585
|
grossAmount: t.value.grossAmount,
|
|
@@ -594,34 +595,34 @@ var It = { class: "font-medium text-secondary" }, Lt = ["title"], Rt = /* @__PUR
|
|
|
594
595
|
paidAmount: r.formatMonetary(e.paidAmount)
|
|
595
596
|
}) : 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) });
|
|
596
597
|
});
|
|
597
|
-
return (e, t) => (
|
|
598
|
-
default:
|
|
598
|
+
return (e, t) => (R(), M(V(q), null, {
|
|
599
|
+
default: H(() => [I(V(G), {
|
|
599
600
|
gap: "xxs",
|
|
600
601
|
class: "text-sm/tight"
|
|
601
602
|
}, {
|
|
602
|
-
default:
|
|
603
|
+
default: H(() => [F("span", Lt, B(i.value), 1), a.value === null ? N("", !0) : (R(), P("span", {
|
|
603
604
|
key: 0,
|
|
604
605
|
title: a.value,
|
|
605
606
|
class: "truncate text-xs text-secondary"
|
|
606
|
-
},
|
|
607
|
+
}, B(a.value), 9, Rt))]),
|
|
607
608
|
_: 1
|
|
608
609
|
})]),
|
|
609
610
|
_: 1
|
|
610
611
|
}));
|
|
611
612
|
}
|
|
612
|
-
}),
|
|
613
|
+
}), Bt = /* @__PURE__ */ L({
|
|
613
614
|
__name: "InvoiceOverviewTableCustomFieldCell",
|
|
614
615
|
props: {
|
|
615
616
|
definition: {},
|
|
616
617
|
value: {}
|
|
617
618
|
},
|
|
618
619
|
setup(e) {
|
|
619
|
-
return (t, n) => (
|
|
620
|
-
default:
|
|
620
|
+
return (t, n) => (R(), M(V(q), null, {
|
|
621
|
+
default: H(() => [e.value === void 0 ? (R(), M(V(ft), {
|
|
621
622
|
key: 1,
|
|
622
623
|
text: "-",
|
|
623
624
|
class: "text-sm/5 text-primary"
|
|
624
|
-
})) : (
|
|
625
|
+
})) : (R(), M(pe, {
|
|
625
626
|
key: 0,
|
|
626
627
|
definition: e.definition,
|
|
627
628
|
value: e.value,
|
|
@@ -630,27 +631,27 @@ var It = { class: "font-medium text-secondary" }, Lt = ["title"], Rt = /* @__PUR
|
|
|
630
631
|
_: 1
|
|
631
632
|
}));
|
|
632
633
|
}
|
|
633
|
-
}),
|
|
634
|
+
}), Vt = /* @__PURE__ */ L({
|
|
634
635
|
__name: "InvoiceOverviewTableDueDateCell",
|
|
635
636
|
props: {
|
|
636
637
|
isOverdue: { type: Boolean },
|
|
637
638
|
value: {}
|
|
638
639
|
},
|
|
639
640
|
setup(e) {
|
|
640
|
-
let t = e, n =
|
|
641
|
+
let t = e, n = w(), r = j(() => t.value === null ? "-" : n.formatPlainDate(t.value)), i = j(() => {
|
|
641
642
|
if (!t.isOverdue || t.value === null) return null;
|
|
642
|
-
let e = t.value.toZonedDateTime(
|
|
643
|
+
let e = t.value.toZonedDateTime(We.Now.timeZoneId()).toInstant();
|
|
643
644
|
return n.toRelativeTime(e);
|
|
644
645
|
});
|
|
645
|
-
return (e, n) => (
|
|
646
|
-
default:
|
|
647
|
-
default:
|
|
648
|
-
class:
|
|
646
|
+
return (e, n) => (R(), M(V(q), null, {
|
|
647
|
+
default: H(() => [I(V(K), { gap: "sm" }, {
|
|
648
|
+
default: H(() => [I(V(ft), {
|
|
649
|
+
class: Ne([{
|
|
649
650
|
"text-error-primary": t.isOverdue,
|
|
650
651
|
"text-primary": !t.isOverdue
|
|
651
652
|
}, "text-sm"]),
|
|
652
653
|
text: r.value
|
|
653
|
-
}, null, 8, ["class", "text"]), i.value === null ?
|
|
654
|
+
}, null, 8, ["class", "text"]), i.value === null ? N("", !0) : (R(), M(V(Ke), {
|
|
654
655
|
key: 0,
|
|
655
656
|
label: i.value,
|
|
656
657
|
color: "error",
|
|
@@ -662,20 +663,20 @@ var It = { class: "font-medium text-secondary" }, Lt = ["title"], Rt = /* @__PUR
|
|
|
662
663
|
_: 1
|
|
663
664
|
}));
|
|
664
665
|
}
|
|
665
|
-
}),
|
|
666
|
+
}), Ht = /* @__PURE__ */ L({
|
|
666
667
|
__name: "InvoiceOverviewTableIssuedDateCell",
|
|
667
668
|
props: { value: {} },
|
|
668
669
|
setup(e) {
|
|
669
|
-
let t = e, n =
|
|
670
|
-
return (e, t) => (
|
|
671
|
-
default:
|
|
670
|
+
let t = e, n = w(), r = j(() => t.value === null ? "-" : n.formatPlainDate(t.value));
|
|
671
|
+
return (e, t) => (R(), M(V(q), null, {
|
|
672
|
+
default: H(() => [I(V(ft), {
|
|
672
673
|
text: r.value,
|
|
673
674
|
class: "text-sm/5 text-primary"
|
|
674
675
|
}, null, 8, ["text"])]),
|
|
675
676
|
_: 1
|
|
676
677
|
}));
|
|
677
678
|
}
|
|
678
|
-
}),
|
|
679
|
+
}), Ut = /* @__PURE__ */ L({
|
|
679
680
|
__name: "InvoiceOverviewTableLifecycleCell",
|
|
680
681
|
props: {
|
|
681
682
|
isDisputed: { type: Boolean },
|
|
@@ -683,15 +684,15 @@ var It = { class: "font-medium text-secondary" }, Lt = ["title"], Rt = /* @__PUR
|
|
|
683
684
|
},
|
|
684
685
|
setup(e) {
|
|
685
686
|
let t = e;
|
|
686
|
-
return (e, n) => (
|
|
687
|
-
default:
|
|
688
|
-
default:
|
|
687
|
+
return (e, n) => (R(), M(V(q), null, {
|
|
688
|
+
default: H(() => [I(V(K), { gap: "xs" }, {
|
|
689
|
+
default: H(() => [I(xe, { "lifecycle-status": t.lifecycleStatus }, null, 8, ["lifecycle-status"]), t.isDisputed ? (R(), M(_e, { key: 0 })) : N("", !0)]),
|
|
689
690
|
_: 1
|
|
690
691
|
})]),
|
|
691
692
|
_: 1
|
|
692
693
|
}));
|
|
693
694
|
}
|
|
694
|
-
}),
|
|
695
|
+
}), Wt = { class: "flex flex-col leading-tight" }, Gt = ["title"], Kt = ["title"], qt = /* @__PURE__ */ L({
|
|
695
696
|
__name: "InvoiceOverviewTableNameCell",
|
|
696
697
|
props: {
|
|
697
698
|
customerName: {},
|
|
@@ -700,35 +701,35 @@ var It = { class: "font-medium text-secondary" }, Lt = ["title"], Rt = /* @__PUR
|
|
|
700
701
|
},
|
|
701
702
|
setup(e) {
|
|
702
703
|
let t = e, n = A();
|
|
703
|
-
return (e, r) => (
|
|
704
|
-
default:
|
|
705
|
-
default:
|
|
704
|
+
return (e, r) => (R(), M(V(q), null, {
|
|
705
|
+
default: H(() => [F("div", Wt, [I(V(K), null, {
|
|
706
|
+
default: H(() => [F("span", {
|
|
706
707
|
title: t.customerName,
|
|
707
708
|
class: "truncate text-sm/4 font-medium text-primary"
|
|
708
|
-
},
|
|
709
|
+
}, B(t.customerName), 9, Gt), t.type === V(i).CREDIT_NOTE ? (R(), M(V(y), {
|
|
709
710
|
key: 0,
|
|
710
|
-
"aria-label":
|
|
711
|
+
"aria-label": V(n).t("wise_invoicing.invoice.type.credit_note"),
|
|
711
712
|
class: "size-3 shrink-0 text-warning-primary",
|
|
712
713
|
role: "img"
|
|
713
|
-
}, null, 8, ["aria-label"])) :
|
|
714
|
+
}, null, 8, ["aria-label"])) : N("", !0)]),
|
|
714
715
|
_: 1
|
|
715
|
-
}),
|
|
716
|
+
}), F("span", {
|
|
716
717
|
title: t.subject ?? void 0,
|
|
717
718
|
class: "truncate text-xs/4 text-secondary"
|
|
718
|
-
},
|
|
719
|
+
}, B(t.subject ?? "-"), 9, Kt)])]),
|
|
719
720
|
_: 1
|
|
720
721
|
}));
|
|
721
722
|
}
|
|
722
|
-
}),
|
|
723
|
+
}), Jt = /* @__PURE__ */ L({
|
|
723
724
|
__name: "InvoiceOverviewTableSelectionCell",
|
|
724
725
|
props: { isSelected: { type: Boolean } },
|
|
725
726
|
emits: ["toggle"],
|
|
726
727
|
setup(e, { emit: t }) {
|
|
727
728
|
let n = e, r = t, i = A();
|
|
728
|
-
return (e, t) => (
|
|
729
|
-
default:
|
|
730
|
-
default:
|
|
731
|
-
label:
|
|
729
|
+
return (e, t) => (R(), M(V(q), null, {
|
|
730
|
+
default: H(() => [I(V(st), null, {
|
|
731
|
+
default: H(() => [I(V(qe), {
|
|
732
|
+
label: V(i).t("wise_invoicing.invoice.overview.bulk.select_document"),
|
|
732
733
|
"model-value": n.isSelected,
|
|
733
734
|
"is-label-hidden": !0,
|
|
734
735
|
class: "mx-auto",
|
|
@@ -739,35 +740,35 @@ var It = { class: "font-medium text-secondary" }, Lt = ["title"], Rt = /* @__PUR
|
|
|
739
740
|
_: 1
|
|
740
741
|
}));
|
|
741
742
|
}
|
|
742
|
-
}),
|
|
743
|
+
}), Yt = /* @__PURE__ */ L({
|
|
743
744
|
__name: "InvoiceOverviewTableSentCell",
|
|
744
745
|
props: { deliveryStatus: {} },
|
|
745
746
|
setup(e) {
|
|
746
|
-
let t = e, n =
|
|
747
|
-
return (e, t) => (
|
|
748
|
-
default:
|
|
747
|
+
let t = e, n = j(() => [c.SENT, c.VIEWED].includes(t.deliveryStatus));
|
|
748
|
+
return (e, t) => (R(), M(V(q), null, {
|
|
749
|
+
default: H(() => [n.value ? (R(), M(V(be), {
|
|
749
750
|
key: 0,
|
|
750
751
|
class: "size-4 text-brand-600"
|
|
751
|
-
})) :
|
|
752
|
+
})) : N("", !0)]),
|
|
752
753
|
_: 1
|
|
753
754
|
}));
|
|
754
755
|
}
|
|
755
|
-
}),
|
|
756
|
+
}), Xt = /* @__PURE__ */ L({
|
|
756
757
|
__name: "InvoiceOverviewTableSequenceCell",
|
|
757
758
|
props: { sequence: {} },
|
|
758
759
|
setup(e) {
|
|
759
|
-
return (t, n) => (
|
|
760
|
-
default:
|
|
760
|
+
return (t, n) => (R(), M(V(q), null, {
|
|
761
|
+
default: H(() => [I(V(ct), { text: e.sequence ?? "-" }, null, 8, ["text"])]),
|
|
761
762
|
_: 1
|
|
762
763
|
}));
|
|
763
764
|
}
|
|
764
|
-
}),
|
|
765
|
+
}), Zt = /* @__PURE__ */ L({
|
|
765
766
|
__name: "InvoiceOverviewTableStatusCell",
|
|
766
767
|
props: { value: {} },
|
|
767
768
|
setup(e) {
|
|
768
|
-
let t = e, n =
|
|
769
|
-
return (e, i) => (
|
|
770
|
-
default:
|
|
769
|
+
let t = e, n = j(() => t.value.type === i.CREDIT_NOTE), r = j(() => Se.isSent(t.value.deliveryStatus));
|
|
770
|
+
return (e, i) => (R(), M(V(q), null, {
|
|
771
|
+
default: H(() => [n.value ? N("", !0) : (R(), M(ye, {
|
|
771
772
|
key: 0,
|
|
772
773
|
"is-sent": r.value,
|
|
773
774
|
"balance-due-amount": t.value.balanceDueAmount,
|
|
@@ -790,149 +791,202 @@ var It = { class: "font-medium text-secondary" }, Lt = ["title"], Rt = /* @__PUR
|
|
|
790
791
|
});
|
|
791
792
|
//#endregion
|
|
792
793
|
//#region src/modules/invoice/use-cases/overview/composables/invoiceOverviewTableColumns.composable.ts
|
|
793
|
-
function
|
|
794
|
-
let
|
|
795
|
-
return
|
|
796
|
-
let
|
|
797
|
-
headerLabel: O.getLabel(e,
|
|
798
|
-
key:
|
|
794
|
+
function Qt(e) {
|
|
795
|
+
let t = A();
|
|
796
|
+
return j(() => {
|
|
797
|
+
let n = e?.selection, r = e?.customFieldDefinitions?.().map((e) => ({
|
|
798
|
+
headerLabel: O.getLabel(e, t.locale.value),
|
|
799
|
+
key: Z.getKey(e),
|
|
799
800
|
size: {
|
|
800
801
|
max: "1fr",
|
|
801
802
|
min: "10rem"
|
|
802
803
|
},
|
|
803
|
-
component: (t) =>
|
|
804
|
+
component: (t) => J(Bt, {
|
|
804
805
|
definition: e,
|
|
805
806
|
value: t.customFields.find((t) => t.definitionUuid === e.uuid)
|
|
806
807
|
})
|
|
807
|
-
})) ?? [],
|
|
808
|
+
})) ?? [], i = n === void 0 ? [] : [{
|
|
808
809
|
headerLabel: "",
|
|
809
810
|
key: "selection",
|
|
810
811
|
size: {
|
|
811
812
|
max: "2.5rem",
|
|
812
813
|
min: "2.5rem"
|
|
813
814
|
},
|
|
814
|
-
component: (e) =>
|
|
815
|
-
isSelected:
|
|
816
|
-
onToggle: () =>
|
|
815
|
+
component: (e) => J(Jt, {
|
|
816
|
+
isSelected: n.isSelected(e.uuid),
|
|
817
|
+
onToggle: () => n.toggleRow(e.uuid)
|
|
817
818
|
})
|
|
818
819
|
}];
|
|
819
|
-
return
|
|
820
|
-
...
|
|
820
|
+
return ht()([
|
|
821
|
+
...i,
|
|
821
822
|
{
|
|
822
|
-
headerLabel:
|
|
823
|
-
key:
|
|
823
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.recipient"),
|
|
824
|
+
key: d.CUSTOMER,
|
|
824
825
|
size: {
|
|
825
826
|
max: "16rem",
|
|
826
827
|
min: "16rem"
|
|
827
828
|
},
|
|
828
|
-
component: (e) =>
|
|
829
|
+
component: (e) => J(qt, {
|
|
829
830
|
customerName: e.customerName,
|
|
830
831
|
subject: e.subject,
|
|
831
832
|
type: e.type
|
|
832
833
|
})
|
|
833
834
|
},
|
|
834
835
|
{
|
|
835
|
-
headerLabel:
|
|
836
|
-
key:
|
|
836
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.id"),
|
|
837
|
+
key: d.SEQUENCE,
|
|
837
838
|
size: {
|
|
838
839
|
max: "9rem",
|
|
839
840
|
min: "9rem"
|
|
840
841
|
},
|
|
841
|
-
component: (e) =>
|
|
842
|
+
component: (e) => J(Xt, { sequence: e.sequence })
|
|
842
843
|
},
|
|
843
844
|
{
|
|
844
|
-
headerLabel:
|
|
845
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.lifecycle"),
|
|
845
846
|
key: "lifecycleStatus",
|
|
846
847
|
size: {
|
|
847
848
|
max: "12rem",
|
|
848
849
|
min: "8rem"
|
|
849
850
|
},
|
|
850
|
-
component: (e) =>
|
|
851
|
+
component: (e) => J(Ut, {
|
|
851
852
|
isDisputed: e.isDisputed,
|
|
852
853
|
lifecycleStatus: e.lifecycleStatus
|
|
853
854
|
})
|
|
854
855
|
},
|
|
855
856
|
{
|
|
856
|
-
headerLabel:
|
|
857
|
-
key:
|
|
857
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.invoice_date"),
|
|
858
|
+
key: d.ISSUED_ON,
|
|
858
859
|
size: {
|
|
859
860
|
max: "8rem",
|
|
860
861
|
min: "8rem"
|
|
861
862
|
},
|
|
862
|
-
component: (e) =>
|
|
863
|
+
component: (e) => J(Ht, { value: e.issuedOn })
|
|
863
864
|
},
|
|
864
865
|
{
|
|
865
|
-
headerLabel:
|
|
866
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.sent"),
|
|
866
867
|
key: "deliveryStatus",
|
|
867
868
|
size: {
|
|
868
869
|
max: "8rem",
|
|
869
870
|
min: "8rem"
|
|
870
871
|
},
|
|
871
|
-
component: (e) =>
|
|
872
|
+
component: (e) => J(Yt, { deliveryStatus: e.deliveryStatus })
|
|
872
873
|
},
|
|
873
874
|
{
|
|
874
|
-
headerLabel:
|
|
875
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.settlement"),
|
|
875
876
|
key: "status",
|
|
876
877
|
size: {
|
|
877
878
|
max: "10rem",
|
|
878
879
|
min: "10rem"
|
|
879
880
|
},
|
|
880
|
-
component: (e) =>
|
|
881
|
+
component: (e) => J(Zt, { value: e })
|
|
881
882
|
},
|
|
882
883
|
{
|
|
883
|
-
headerLabel:
|
|
884
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.due_date"),
|
|
884
885
|
key: "dueOn",
|
|
885
886
|
size: {
|
|
886
887
|
max: "14rem",
|
|
887
888
|
min: "12rem"
|
|
888
889
|
},
|
|
889
|
-
component: (e) =>
|
|
890
|
+
component: (e) => J(Vt, {
|
|
890
891
|
isOverdue: e.isOverdue,
|
|
891
892
|
value: e.dueOn
|
|
892
893
|
})
|
|
893
894
|
},
|
|
894
895
|
{
|
|
895
|
-
headerLabel:
|
|
896
|
-
key:
|
|
896
|
+
headerLabel: t.t("wise_invoicing.invoice.overview.columns.amount_excl_vat"),
|
|
897
|
+
key: d.NET_AMOUNT,
|
|
897
898
|
size: {
|
|
898
899
|
max: "1fr",
|
|
899
900
|
min: "10rem"
|
|
900
901
|
},
|
|
901
|
-
component: (e) =>
|
|
902
|
+
component: (e) => J(zt, { value: e })
|
|
902
903
|
},
|
|
903
|
-
...
|
|
904
|
+
...r
|
|
904
905
|
]);
|
|
905
906
|
});
|
|
906
907
|
}
|
|
907
908
|
//#endregion
|
|
908
909
|
//#region src/modules/invoice/api/invoiceIndexCache.util.ts
|
|
909
|
-
var
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
910
|
+
var $t = 3e5, Q = /* @__PURE__ */ new Map(), en = null, tn = null;
|
|
911
|
+
function nn(e) {
|
|
912
|
+
return typeof e == "object" && !!e && "pages" in e && Array.isArray(e.pages);
|
|
913
|
+
}
|
|
914
|
+
function rn(e) {
|
|
915
|
+
return nn(e) ? e.pages.flatMap((e) => e.isOk() ? e.getValue().data : []) : [];
|
|
916
|
+
}
|
|
917
|
+
function an(e) {
|
|
918
|
+
return Object.keys(e);
|
|
919
|
+
}
|
|
920
|
+
function on(e, t) {
|
|
921
|
+
let n = an(t.patch);
|
|
922
|
+
return n.every((n) => e[n] === t.patch[n]) ? !0 : n.some((n) => n in t.serverValues && e[n] !== t.serverValues[n]);
|
|
923
|
+
}
|
|
924
|
+
function sn() {
|
|
925
|
+
return Be().getQueryCache().findAll({ predicate: (e) => e.queryKey[0] === "invoiceIndex" }).flatMap((e) => rn(e.state.data));
|
|
926
|
+
}
|
|
927
|
+
function cn(e, t) {
|
|
928
|
+
return e === void 0 ? {} : Object.fromEntries(an(t).map((t) => [t, e[t]]));
|
|
929
|
+
}
|
|
930
|
+
function ln() {
|
|
931
|
+
new ze(Be()).update("invoiceIndex", {
|
|
932
|
+
by: (e) => Q.has(e.uuid),
|
|
933
|
+
value: (e) => ({
|
|
934
|
+
...e,
|
|
935
|
+
...Q.get(e.uuid)?.patch
|
|
936
|
+
})
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
function un(e) {
|
|
940
|
+
let t = Date.now() - $t;
|
|
941
|
+
for (let [e, n] of Q) n.patchedAt <= t && Q.delete(e);
|
|
942
|
+
for (let t of e) {
|
|
943
|
+
let e = Q.get(t.uuid);
|
|
944
|
+
e !== void 0 && on(t, e) && Q.delete(t.uuid);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
function dn() {
|
|
948
|
+
tn?.(), tn = null, en = null;
|
|
949
|
+
}
|
|
950
|
+
function fn(e) {
|
|
951
|
+
if (e.type !== "updated" || e.action.type !== "success" || e.action.manual === !0 || e.query.queryKey[0] !== "invoiceIndex") return;
|
|
952
|
+
let t = e.query.state.data;
|
|
953
|
+
if (un(rn(t)), Q.size === 0) {
|
|
954
|
+
dn();
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
ln();
|
|
958
|
+
}
|
|
959
|
+
function pn() {
|
|
960
|
+
let e = Be().getQueryCache();
|
|
961
|
+
en !== e && (dn(), en = e, tn = e.subscribe(fn));
|
|
962
|
+
}
|
|
963
|
+
var mn = class {
|
|
915
964
|
static reflectBulkAction(e, t) {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
965
|
+
if (e.length === 0) return;
|
|
966
|
+
let n = Date.now(), r = new Map(sn().map((e) => [e.uuid, e]));
|
|
967
|
+
for (let i of e) {
|
|
968
|
+
let e = Q.get(i);
|
|
969
|
+
Q.set(i, {
|
|
970
|
+
patchedAt: n,
|
|
971
|
+
patch: {
|
|
972
|
+
...e?.patch,
|
|
922
973
|
...t
|
|
923
|
-
}
|
|
974
|
+
},
|
|
975
|
+
serverValues: {
|
|
976
|
+
...cn(r.get(i), t),
|
|
977
|
+
...e?.serverValues
|
|
978
|
+
}
|
|
924
979
|
});
|
|
925
980
|
}
|
|
926
|
-
|
|
927
|
-
for (let e of Qt) setTimeout(i, e);
|
|
981
|
+
ln(), pn();
|
|
928
982
|
}
|
|
929
983
|
};
|
|
930
984
|
//#endregion
|
|
931
985
|
//#region src/modules/invoice/api/mutations/invoiceBulkFinalize.mutation.ts
|
|
932
|
-
function
|
|
933
|
-
return
|
|
934
|
-
queryFn: (e) =>
|
|
935
|
-
queryKeysToInvalidate: {
|
|
986
|
+
function hn() {
|
|
987
|
+
return U({
|
|
988
|
+
queryFn: (e) => _.bulkFinalize(e.params.invoiceUuids),
|
|
989
|
+
queryKeysToInvalidate: { invoiceDetail: {} }
|
|
936
990
|
});
|
|
937
991
|
}
|
|
938
992
|
//#endregion
|
|
@@ -967,7 +1021,7 @@ var $ = class {
|
|
|
967
1021
|
};
|
|
968
1022
|
}
|
|
969
1023
|
static getInvoiceDetailLink(e) {
|
|
970
|
-
return e.type ===
|
|
1024
|
+
return e.type === i.CREDIT_NOTE ? {
|
|
971
1025
|
name: "invoicing-credit-note-detail",
|
|
972
1026
|
params: { creditNoteUuid: e.uuid }
|
|
973
1027
|
} : {
|
|
@@ -982,16 +1036,19 @@ var $ = class {
|
|
|
982
1036
|
let n = new Set(t.map((e) => e.uuid));
|
|
983
1037
|
return e.filter((e) => !n.has(e.uuid)).map((e) => e.uuid);
|
|
984
1038
|
}
|
|
985
|
-
},
|
|
1039
|
+
}, gn = {
|
|
986
1040
|
key: 0,
|
|
1041
|
+
class: "text-sm text-error-primary"
|
|
1042
|
+
}, _n = {
|
|
1043
|
+
key: 1,
|
|
987
1044
|
class: "text-sm text-secondary"
|
|
988
|
-
},
|
|
1045
|
+
}, vn = {
|
|
989
1046
|
key: 0,
|
|
990
1047
|
class: "text-sm text-primary"
|
|
991
|
-
},
|
|
1048
|
+
}, yn = {
|
|
992
1049
|
key: 1,
|
|
993
1050
|
class: "text-sm text-secondary"
|
|
994
|
-
},
|
|
1051
|
+
}, bn = { class: "text-sm text-secondary" }, xn = /* @__PURE__ */ L({
|
|
995
1052
|
__name: "InvoiceOverviewBulkActionDialog",
|
|
996
1053
|
props: {
|
|
997
1054
|
title: {},
|
|
@@ -1002,6 +1059,7 @@ var $ = class {
|
|
|
1002
1059
|
icon: {},
|
|
1003
1060
|
loadingLabel: {},
|
|
1004
1061
|
noneProcessableLabel: {},
|
|
1062
|
+
previewErrorLabel: {},
|
|
1005
1063
|
processableCount: {},
|
|
1006
1064
|
processableLabel: {},
|
|
1007
1065
|
skippedInvoices: {},
|
|
@@ -1010,12 +1068,12 @@ var $ = class {
|
|
|
1010
1068
|
emits: ["close", "confirm"],
|
|
1011
1069
|
setup(e, { emit: t }) {
|
|
1012
1070
|
let n = e, r = t;
|
|
1013
|
-
return (e, t) => (
|
|
1071
|
+
return (e, t) => (R(), M(V(Ze), {
|
|
1014
1072
|
size: "sm",
|
|
1015
1073
|
onClose: t[1] ||= (e) => r("close")
|
|
1016
1074
|
}, {
|
|
1017
|
-
default:
|
|
1018
|
-
|
|
1075
|
+
default: H(() => [
|
|
1076
|
+
I(V(rt), {
|
|
1019
1077
|
title: n.title,
|
|
1020
1078
|
description: n.description,
|
|
1021
1079
|
icon: n.icon,
|
|
@@ -1025,32 +1083,32 @@ var $ = class {
|
|
|
1025
1083
|
"description",
|
|
1026
1084
|
"icon"
|
|
1027
1085
|
]),
|
|
1028
|
-
|
|
1029
|
-
default:
|
|
1030
|
-
default:
|
|
1086
|
+
I(V(Qe), null, {
|
|
1087
|
+
default: H(() => [I(V(G), null, {
|
|
1088
|
+
default: H(() => [n.previewErrorLabel === null ? n.isPreviewLoading ? (R(), P("p", _n, B(n.loadingLabel), 1)) : (R(), P(Oe, { key: 2 }, [n.processableCount > 0 ? (R(), P("p", vn, B(n.processableLabel), 1)) : (R(), P("p", yn, B(n.noneProcessableLabel), 1)), n.skippedInvoices.length > 0 ? (R(), M(V(G), {
|
|
1031
1089
|
key: 2,
|
|
1032
1090
|
gap: "sm",
|
|
1033
1091
|
class: "rounded-lg border border-secondary bg-secondary p-md"
|
|
1034
1092
|
}, {
|
|
1035
|
-
default:
|
|
1036
|
-
default:
|
|
1093
|
+
default: H(() => [F("p", bn, B(n.skippedPreviewLabel), 1), I(V(G), { gap: "xs" }, {
|
|
1094
|
+
default: H(() => [(R(!0), P(Oe, null, Fe(n.skippedInvoices, (e) => (R(), M(V(Ee), {
|
|
1037
1095
|
key: e.uuid,
|
|
1038
|
-
to:
|
|
1096
|
+
to: V($).getInvoiceDetailLink(e),
|
|
1039
1097
|
class: "text-sm text-brand-primary hover:underline"
|
|
1040
1098
|
}, {
|
|
1041
|
-
default:
|
|
1099
|
+
default: H(() => [ke(B(V($).getInvoiceLabel(e)), 1)]),
|
|
1042
1100
|
_: 2
|
|
1043
1101
|
}, 1032, ["to"]))), 128))]),
|
|
1044
1102
|
_: 1
|
|
1045
1103
|
})]),
|
|
1046
1104
|
_: 1
|
|
1047
|
-
})) :
|
|
1105
|
+
})) : N("", !0)], 64)) : (R(), P("p", gn, B(n.previewErrorLabel), 1))]),
|
|
1048
1106
|
_: 1
|
|
1049
1107
|
})]),
|
|
1050
1108
|
_: 1
|
|
1051
1109
|
}),
|
|
1052
|
-
|
|
1053
|
-
right:
|
|
1110
|
+
I(V($e), null, {
|
|
1111
|
+
right: H(() => [I(V(et)), I(V(tt), {
|
|
1054
1112
|
"is-disabled": n.isPreviewLoading || n.processableCount === 0,
|
|
1055
1113
|
"is-loading": n.isSubmitting,
|
|
1056
1114
|
label: n.confirmLabel,
|
|
@@ -1066,7 +1124,7 @@ var $ = class {
|
|
|
1066
1124
|
_: 1
|
|
1067
1125
|
}));
|
|
1068
1126
|
}
|
|
1069
|
-
}),
|
|
1127
|
+
}), Sn = /* @__PURE__ */ L({
|
|
1070
1128
|
__name: "InvoiceOverviewBulkFinalizeDialog",
|
|
1071
1129
|
props: {
|
|
1072
1130
|
invoices: {},
|
|
@@ -1074,58 +1132,59 @@ var $ = class {
|
|
|
1074
1132
|
},
|
|
1075
1133
|
emits: ["close"],
|
|
1076
1134
|
setup(e, { emit: t }) {
|
|
1077
|
-
let n = e, r = t, i = A(),
|
|
1078
|
-
let e = new Set(
|
|
1135
|
+
let n = e, r = t, i = A(), s = Y(), c = hn(), l = z(!0), u = z(!1), d = z(null), f = z(null), p = j(() => n.invoices.filter((e) => e.status === a.READY)), m = j(() => p.value.map((e) => e.uuid)), h = j(() => d.value?.meta.processed ?? 0), g = j(() => $.getUnskippedInvoiceUuids(p.value, d.value?.skipped ?? [])), v = j(() => {
|
|
1136
|
+
let e = new Set(g.value);
|
|
1079
1137
|
return n.invoices.filter((t) => !e.has(t.uuid));
|
|
1080
|
-
}),
|
|
1081
|
-
async function
|
|
1082
|
-
let e =
|
|
1138
|
+
}), y = j(() => v.value.length), b = j(() => d.value === null ? n.invoices.length : h.value);
|
|
1139
|
+
async function x() {
|
|
1140
|
+
let e = g.value;
|
|
1083
1141
|
if (e.length === 0 || u.value) return;
|
|
1084
1142
|
u.value = !0;
|
|
1085
|
-
let t = await
|
|
1143
|
+
let t = await c.execute({ params: { invoiceUuids: e } });
|
|
1086
1144
|
if (u.value = !1, t.isErr()) {
|
|
1087
|
-
|
|
1145
|
+
s.apiError(t.error);
|
|
1088
1146
|
return;
|
|
1089
1147
|
}
|
|
1090
1148
|
let l = new Set(t.value.skipped.map((e) => e.uuid)), f = e.filter((e) => !l.has(e));
|
|
1091
|
-
d.value = t.value, f.length > 0 &&
|
|
1092
|
-
lifecycleStatus:
|
|
1093
|
-
status:
|
|
1094
|
-
}), t.value.meta.processed > 0 &&
|
|
1149
|
+
d.value = t.value, f.length > 0 && mn.reflectBulkAction(f, {
|
|
1150
|
+
lifecycleStatus: o.FINALIZED,
|
|
1151
|
+
status: a.FINALIZED
|
|
1152
|
+
}), t.value.meta.processed > 0 && s.show({ message: i.t("wise_invoicing.invoice.overview.bulk.finalize.success", { count: t.value.meta.processed }) }), y.value > 0 && s.show($.createSkippedToast({
|
|
1095
1153
|
id: "invoice-overview-bulk-finalize-skipped",
|
|
1096
|
-
invoices:
|
|
1097
|
-
message: i.t("wise_invoicing.invoice.overview.bulk.finalize.skipped", { count:
|
|
1154
|
+
invoices: v.value,
|
|
1155
|
+
message: i.t("wise_invoicing.invoice.overview.bulk.finalize.skipped", { count: y.value })
|
|
1098
1156
|
})), t.value.meta.processed !== 0 && (n.onFinalized(), r("close"));
|
|
1099
1157
|
}
|
|
1100
|
-
async function
|
|
1101
|
-
if (l.value = !0,
|
|
1158
|
+
async function S() {
|
|
1159
|
+
if (l.value = !0, m.value.length === 0) {
|
|
1102
1160
|
d.value = $.createEmptyPreview(), l.value = !1;
|
|
1103
1161
|
return;
|
|
1104
1162
|
}
|
|
1105
|
-
let e = await
|
|
1163
|
+
let e = await _.previewBulkFinalize(m.value);
|
|
1106
1164
|
if (e.isErr()) {
|
|
1107
|
-
|
|
1165
|
+
f.value = i.t("wise_invoicing.invoice.overview.bulk.preview_error"), l.value = !1;
|
|
1108
1166
|
return;
|
|
1109
1167
|
}
|
|
1110
1168
|
d.value = e.value, l.value = !1;
|
|
1111
1169
|
}
|
|
1112
|
-
return
|
|
1113
|
-
|
|
1114
|
-
}), (e, t) => (
|
|
1115
|
-
"confirm-label":
|
|
1116
|
-
description:
|
|
1117
|
-
icon:
|
|
1170
|
+
return Pe(() => {
|
|
1171
|
+
S();
|
|
1172
|
+
}), (e, t) => (R(), M(xn, {
|
|
1173
|
+
"confirm-label": V(i).t("wise_invoicing.invoice.overview.bulk.finalize.confirm"),
|
|
1174
|
+
description: V(i).t("wise_invoicing.invoice.overview.bulk.finalize.description"),
|
|
1175
|
+
icon: V(ee),
|
|
1118
1176
|
"is-preview-loading": l.value,
|
|
1119
1177
|
"is-submitting": u.value,
|
|
1120
|
-
"loading-label":
|
|
1121
|
-
"none-processable-label":
|
|
1122
|
-
"
|
|
1123
|
-
"processable-
|
|
1124
|
-
"
|
|
1125
|
-
"skipped-
|
|
1126
|
-
|
|
1178
|
+
"loading-label": V(i).t("wise_invoicing.invoice.overview.bulk.finalize.loading"),
|
|
1179
|
+
"none-processable-label": V(i).t("wise_invoicing.invoice.overview.bulk.finalize.none_processable"),
|
|
1180
|
+
"preview-error-label": f.value,
|
|
1181
|
+
"processable-count": h.value,
|
|
1182
|
+
"processable-label": V(i).t("wise_invoicing.invoice.overview.bulk.finalize.processable", { count: h.value }),
|
|
1183
|
+
"skipped-invoices": v.value,
|
|
1184
|
+
"skipped-preview-label": V(i).t("wise_invoicing.invoice.overview.bulk.finalize.skipped_preview", { count: y.value }),
|
|
1185
|
+
title: V(i).t("wise_invoicing.invoice.overview.bulk.finalize.title", { count: b.value }),
|
|
1127
1186
|
onClose: t[0] ||= (e) => r("close"),
|
|
1128
|
-
onConfirm:
|
|
1187
|
+
onConfirm: x
|
|
1129
1188
|
}, null, 8, [
|
|
1130
1189
|
"confirm-label",
|
|
1131
1190
|
"description",
|
|
@@ -1134,6 +1193,7 @@ var $ = class {
|
|
|
1134
1193
|
"is-submitting",
|
|
1135
1194
|
"loading-label",
|
|
1136
1195
|
"none-processable-label",
|
|
1196
|
+
"preview-error-label",
|
|
1137
1197
|
"processable-count",
|
|
1138
1198
|
"processable-label",
|
|
1139
1199
|
"skipped-invoices",
|
|
@@ -1144,15 +1204,15 @@ var $ = class {
|
|
|
1144
1204
|
});
|
|
1145
1205
|
//#endregion
|
|
1146
1206
|
//#region src/modules/invoice/api/mutations/invoiceBulkMarkAsReady.mutation.ts
|
|
1147
|
-
function
|
|
1148
|
-
return
|
|
1149
|
-
queryFn: (e) =>
|
|
1150
|
-
queryKeysToInvalidate: {
|
|
1207
|
+
function Cn() {
|
|
1208
|
+
return U({
|
|
1209
|
+
queryFn: (e) => _.bulkMarkAsReady(e.params.invoiceUuids),
|
|
1210
|
+
queryKeysToInvalidate: { invoiceDetail: {} }
|
|
1151
1211
|
});
|
|
1152
1212
|
}
|
|
1153
1213
|
//#endregion
|
|
1154
1214
|
//#region src/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkMarkAsReadyDialog.vue
|
|
1155
|
-
var
|
|
1215
|
+
var wn = /* @__PURE__ */ L({
|
|
1156
1216
|
__name: "InvoiceOverviewBulkMarkAsReadyDialog",
|
|
1157
1217
|
props: {
|
|
1158
1218
|
invoices: {},
|
|
@@ -1160,58 +1220,59 @@ var ln = /* @__PURE__ */ R({
|
|
|
1160
1220
|
},
|
|
1161
1221
|
emits: ["close"],
|
|
1162
1222
|
setup(e, { emit: t }) {
|
|
1163
|
-
let n = e, r = t, i = A(),
|
|
1164
|
-
let e = new Set(
|
|
1223
|
+
let n = e, r = t, i = A(), s = Y(), c = Cn(), l = z(!0), u = z(!1), d = z(null), f = z(null), p = j(() => n.invoices.filter((e) => e.status === a.DRAFT)), m = j(() => p.value.map((e) => e.uuid)), h = j(() => d.value?.meta.processed ?? 0), g = j(() => $.getUnskippedInvoiceUuids(p.value, d.value?.skipped ?? [])), v = j(() => {
|
|
1224
|
+
let e = new Set(g.value);
|
|
1165
1225
|
return n.invoices.filter((t) => !e.has(t.uuid));
|
|
1166
|
-
}),
|
|
1167
|
-
async function
|
|
1168
|
-
let e =
|
|
1226
|
+
}), y = j(() => v.value.length), b = j(() => d.value === null ? n.invoices.length : h.value);
|
|
1227
|
+
async function S() {
|
|
1228
|
+
let e = g.value;
|
|
1169
1229
|
if (e.length === 0 || u.value) return;
|
|
1170
1230
|
u.value = !0;
|
|
1171
|
-
let t = await
|
|
1231
|
+
let t = await c.execute({ params: { invoiceUuids: e } });
|
|
1172
1232
|
if (u.value = !1, t.isErr()) {
|
|
1173
|
-
|
|
1233
|
+
s.apiError(t.error);
|
|
1174
1234
|
return;
|
|
1175
1235
|
}
|
|
1176
1236
|
let l = new Set(t.value.skipped.map((e) => e.uuid)), f = e.filter((e) => !l.has(e));
|
|
1177
|
-
d.value = t.value, f.length > 0 &&
|
|
1178
|
-
lifecycleStatus:
|
|
1179
|
-
status:
|
|
1180
|
-
}), t.value.meta.processed > 0 &&
|
|
1237
|
+
d.value = t.value, f.length > 0 && mn.reflectBulkAction(f, {
|
|
1238
|
+
lifecycleStatus: o.READY,
|
|
1239
|
+
status: a.READY
|
|
1240
|
+
}), t.value.meta.processed > 0 && s.show({ message: i.t("wise_invoicing.invoice.overview.bulk.mark_as_ready.success", { count: t.value.meta.processed }) }), y.value > 0 && s.show($.createSkippedToast({
|
|
1181
1241
|
id: "invoice-overview-bulk-mark-as-ready-skipped",
|
|
1182
|
-
invoices:
|
|
1183
|
-
message: i.t("wise_invoicing.invoice.overview.bulk.mark_as_ready.skipped", { count:
|
|
1242
|
+
invoices: v.value,
|
|
1243
|
+
message: i.t("wise_invoicing.invoice.overview.bulk.mark_as_ready.skipped", { count: y.value })
|
|
1184
1244
|
})), t.value.meta.processed !== 0 && (n.onMarkedAsReady(), r("close"));
|
|
1185
1245
|
}
|
|
1186
|
-
async function
|
|
1187
|
-
if (l.value = !0,
|
|
1246
|
+
async function C() {
|
|
1247
|
+
if (l.value = !0, m.value.length === 0) {
|
|
1188
1248
|
d.value = $.createEmptyPreview(), l.value = !1;
|
|
1189
1249
|
return;
|
|
1190
1250
|
}
|
|
1191
|
-
let e = await
|
|
1251
|
+
let e = await _.previewBulkMarkAsReady(m.value);
|
|
1192
1252
|
if (e.isErr()) {
|
|
1193
|
-
|
|
1253
|
+
f.value = i.t("wise_invoicing.invoice.overview.bulk.preview_error"), l.value = !1;
|
|
1194
1254
|
return;
|
|
1195
1255
|
}
|
|
1196
1256
|
d.value = e.value, l.value = !1;
|
|
1197
1257
|
}
|
|
1198
|
-
return
|
|
1199
|
-
|
|
1200
|
-
}), (e, t) => (
|
|
1201
|
-
"confirm-label":
|
|
1202
|
-
description:
|
|
1203
|
-
icon:
|
|
1258
|
+
return Pe(() => {
|
|
1259
|
+
C();
|
|
1260
|
+
}), (e, t) => (R(), M(xn, {
|
|
1261
|
+
"confirm-label": V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.confirm"),
|
|
1262
|
+
description: V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.description"),
|
|
1263
|
+
icon: V(x),
|
|
1204
1264
|
"is-preview-loading": l.value,
|
|
1205
1265
|
"is-submitting": u.value,
|
|
1206
|
-
"loading-label":
|
|
1207
|
-
"none-processable-label":
|
|
1208
|
-
"
|
|
1209
|
-
"processable-
|
|
1210
|
-
"
|
|
1211
|
-
"skipped-
|
|
1212
|
-
|
|
1266
|
+
"loading-label": V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.loading"),
|
|
1267
|
+
"none-processable-label": V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.none_processable"),
|
|
1268
|
+
"preview-error-label": f.value,
|
|
1269
|
+
"processable-count": h.value,
|
|
1270
|
+
"processable-label": V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.processable", { count: h.value }),
|
|
1271
|
+
"skipped-invoices": v.value,
|
|
1272
|
+
"skipped-preview-label": V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.skipped_preview", { count: y.value }),
|
|
1273
|
+
title: V(i).t("wise_invoicing.invoice.overview.bulk.mark_as_ready.title", { count: b.value }),
|
|
1213
1274
|
onClose: t[0] ||= (e) => r("close"),
|
|
1214
|
-
onConfirm:
|
|
1275
|
+
onConfirm: S
|
|
1215
1276
|
}, null, 8, [
|
|
1216
1277
|
"confirm-label",
|
|
1217
1278
|
"description",
|
|
@@ -1220,6 +1281,7 @@ var ln = /* @__PURE__ */ R({
|
|
|
1220
1281
|
"is-submitting",
|
|
1221
1282
|
"loading-label",
|
|
1222
1283
|
"none-processable-label",
|
|
1284
|
+
"preview-error-label",
|
|
1223
1285
|
"processable-count",
|
|
1224
1286
|
"processable-label",
|
|
1225
1287
|
"skipped-invoices",
|
|
@@ -1230,15 +1292,15 @@ var ln = /* @__PURE__ */ R({
|
|
|
1230
1292
|
});
|
|
1231
1293
|
//#endregion
|
|
1232
1294
|
//#region src/modules/invoice/api/mutations/invoiceBulkSend.mutation.ts
|
|
1233
|
-
function
|
|
1234
|
-
return
|
|
1235
|
-
queryFn: (e) =>
|
|
1236
|
-
queryKeysToInvalidate: {
|
|
1295
|
+
function Tn() {
|
|
1296
|
+
return U({
|
|
1297
|
+
queryFn: (e) => _.bulkSend(e.params.invoiceUuids),
|
|
1298
|
+
queryKeysToInvalidate: { invoiceDetail: {} }
|
|
1237
1299
|
});
|
|
1238
1300
|
}
|
|
1239
1301
|
//#endregion
|
|
1240
1302
|
//#region src/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendDialog.vue
|
|
1241
|
-
var
|
|
1303
|
+
var En = /* @__PURE__ */ L({
|
|
1242
1304
|
__name: "InvoiceOverviewBulkSendDialog",
|
|
1243
1305
|
props: {
|
|
1244
1306
|
invoices: {},
|
|
@@ -1246,55 +1308,56 @@ var dn = /* @__PURE__ */ R({
|
|
|
1246
1308
|
},
|
|
1247
1309
|
emits: ["close"],
|
|
1248
1310
|
setup(e, { emit: t }) {
|
|
1249
|
-
let n = e, r = t,
|
|
1250
|
-
let e = new Set(
|
|
1311
|
+
let n = e, r = t, i = A(), o = Y(), s = Tn(), l = z(!0), u = z(!1), d = z(null), f = z(null), p = j(() => n.invoices.filter((e) => e.status === a.FINALIZED)), m = j(() => p.value.map((e) => e.uuid)), h = j(() => d.value?.meta.processed ?? 0), g = j(() => $.getUnskippedInvoiceUuids(p.value, d.value?.skipped ?? [])), v = j(() => {
|
|
1312
|
+
let e = new Set(g.value);
|
|
1251
1313
|
return n.invoices.filter((t) => !e.has(t.uuid));
|
|
1252
|
-
}),
|
|
1253
|
-
async function
|
|
1254
|
-
let e =
|
|
1314
|
+
}), y = j(() => v.value.length), b = j(() => d.value === null ? n.invoices.length : h.value);
|
|
1315
|
+
async function x() {
|
|
1316
|
+
let e = g.value;
|
|
1255
1317
|
if (e.length === 0 || u.value) return;
|
|
1256
1318
|
u.value = !0;
|
|
1257
|
-
let t = await
|
|
1319
|
+
let t = await s.execute({ params: { invoiceUuids: e } });
|
|
1258
1320
|
if (u.value = !1, t.isErr()) {
|
|
1259
|
-
|
|
1321
|
+
o.apiError(t.error);
|
|
1260
1322
|
return;
|
|
1261
1323
|
}
|
|
1262
|
-
let
|
|
1263
|
-
d.value = t.value, l.length > 0 &&
|
|
1324
|
+
let a = new Set(t.value.skipped.map((e) => e.uuid)), l = e.filter((e) => !a.has(e));
|
|
1325
|
+
d.value = t.value, l.length > 0 && mn.reflectBulkAction(l, { deliveryStatus: c.PROCESSING }), t.value.meta.processed > 0 && o.show({ message: i.t("wise_invoicing.invoice.overview.bulk.send.success", { count: t.value.meta.processed }) }), y.value > 0 && o.show($.createSkippedToast({
|
|
1264
1326
|
id: "invoice-overview-bulk-send-skipped",
|
|
1265
|
-
invoices:
|
|
1266
|
-
message:
|
|
1327
|
+
invoices: v.value,
|
|
1328
|
+
message: i.t("wise_invoicing.invoice.overview.bulk.send.skipped", { count: y.value })
|
|
1267
1329
|
})), t.value.meta.processed !== 0 && (n.onSent(), r("close"));
|
|
1268
1330
|
}
|
|
1269
|
-
async function
|
|
1270
|
-
if (l.value = !0,
|
|
1331
|
+
async function S() {
|
|
1332
|
+
if (l.value = !0, m.value.length === 0) {
|
|
1271
1333
|
d.value = $.createEmptyPreview(), l.value = !1;
|
|
1272
1334
|
return;
|
|
1273
1335
|
}
|
|
1274
|
-
let e = await
|
|
1336
|
+
let e = await _.previewBulkSend(m.value);
|
|
1275
1337
|
if (e.isErr()) {
|
|
1276
|
-
|
|
1338
|
+
f.value = i.t("wise_invoicing.invoice.overview.bulk.preview_error"), l.value = !1;
|
|
1277
1339
|
return;
|
|
1278
1340
|
}
|
|
1279
1341
|
d.value = e.value, l.value = !1;
|
|
1280
1342
|
}
|
|
1281
|
-
return
|
|
1282
|
-
|
|
1283
|
-
}), (e, t) => (
|
|
1284
|
-
"confirm-label":
|
|
1285
|
-
description:
|
|
1286
|
-
icon:
|
|
1343
|
+
return Pe(() => {
|
|
1344
|
+
S();
|
|
1345
|
+
}), (e, t) => (R(), M(xn, {
|
|
1346
|
+
"confirm-label": V(i).t("wise_invoicing.invoice.overview.bulk.send.confirm"),
|
|
1347
|
+
description: V(i).t("wise_invoicing.invoice.overview.bulk.send.description"),
|
|
1348
|
+
icon: V(C),
|
|
1287
1349
|
"is-preview-loading": l.value,
|
|
1288
1350
|
"is-submitting": u.value,
|
|
1289
|
-
"loading-label":
|
|
1290
|
-
"none-processable-label":
|
|
1291
|
-
"
|
|
1292
|
-
"processable-
|
|
1293
|
-
"
|
|
1294
|
-
"skipped-
|
|
1295
|
-
|
|
1351
|
+
"loading-label": V(i).t("wise_invoicing.invoice.overview.bulk.send.loading"),
|
|
1352
|
+
"none-processable-label": V(i).t("wise_invoicing.invoice.overview.bulk.send.none_processable"),
|
|
1353
|
+
"preview-error-label": f.value,
|
|
1354
|
+
"processable-count": h.value,
|
|
1355
|
+
"processable-label": V(i).t("wise_invoicing.invoice.overview.bulk.send.processable", { count: h.value }),
|
|
1356
|
+
"skipped-invoices": v.value,
|
|
1357
|
+
"skipped-preview-label": V(i).t("wise_invoicing.invoice.overview.bulk.send.skipped_preview", { count: y.value }),
|
|
1358
|
+
title: V(i).t("wise_invoicing.invoice.overview.bulk.send.title", { count: b.value }),
|
|
1296
1359
|
onClose: t[0] ||= (e) => r("close"),
|
|
1297
|
-
onConfirm:
|
|
1360
|
+
onConfirm: x
|
|
1298
1361
|
}, null, 8, [
|
|
1299
1362
|
"confirm-label",
|
|
1300
1363
|
"description",
|
|
@@ -1303,6 +1366,7 @@ var dn = /* @__PURE__ */ R({
|
|
|
1303
1366
|
"is-submitting",
|
|
1304
1367
|
"loading-label",
|
|
1305
1368
|
"none-processable-label",
|
|
1369
|
+
"preview-error-label",
|
|
1306
1370
|
"processable-count",
|
|
1307
1371
|
"processable-label",
|
|
1308
1372
|
"skipped-invoices",
|
|
@@ -1310,25 +1374,25 @@ var dn = /* @__PURE__ */ R({
|
|
|
1310
1374
|
"title"
|
|
1311
1375
|
]));
|
|
1312
1376
|
}
|
|
1313
|
-
}),
|
|
1377
|
+
}), Dn = /* @__PURE__ */ L({
|
|
1314
1378
|
__name: "DateRangeFilterButton",
|
|
1315
|
-
props: /*@__PURE__*/
|
|
1379
|
+
props: /*@__PURE__*/ je({ ariaLabel: {} }, {
|
|
1316
1380
|
modelValue: { default: null },
|
|
1317
1381
|
modelModifiers: {}
|
|
1318
1382
|
}),
|
|
1319
1383
|
emits: ["update:modelValue"],
|
|
1320
1384
|
setup(e) {
|
|
1321
|
-
let t = e, n =
|
|
1385
|
+
let t = e, n = Le(e, "modelValue"), r = A(), i = z(!1), a = z({
|
|
1322
1386
|
from: null,
|
|
1323
1387
|
until: null
|
|
1324
1388
|
});
|
|
1325
|
-
|
|
1389
|
+
Re(i, (e) => {
|
|
1326
1390
|
e && (a.value = {
|
|
1327
1391
|
from: n.value?.from ?? null,
|
|
1328
1392
|
until: n.value?.until ?? null
|
|
1329
1393
|
});
|
|
1330
1394
|
});
|
|
1331
|
-
let o =
|
|
1395
|
+
let o = w(), 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)}`);
|
|
1332
1396
|
function c() {
|
|
1333
1397
|
n.value = a.value.from !== null || a.value.until !== null ? { ...a.value } : null, i.value = !1;
|
|
1334
1398
|
}
|
|
@@ -1338,44 +1402,44 @@ var dn = /* @__PURE__ */ R({
|
|
|
1338
1402
|
function u() {
|
|
1339
1403
|
n.value = null, i.value = !1;
|
|
1340
1404
|
}
|
|
1341
|
-
return (e, n) => (
|
|
1405
|
+
return (e, n) => (R(), M(V(at), {
|
|
1342
1406
|
"is-open": i.value,
|
|
1343
1407
|
"onUpdate:isOpen": n[1] ||= (e) => i.value = e,
|
|
1344
1408
|
"popover-side": "bottom",
|
|
1345
1409
|
"popover-align": "end"
|
|
1346
1410
|
}, {
|
|
1347
|
-
trigger:
|
|
1411
|
+
trigger: H(() => [I(V(W), {
|
|
1348
1412
|
"aria-label": t.ariaLabel,
|
|
1349
1413
|
label: s.value,
|
|
1350
|
-
"icon-right":
|
|
1414
|
+
"icon-right": V(b),
|
|
1351
1415
|
variant: "secondary"
|
|
1352
1416
|
}, null, 8, [
|
|
1353
1417
|
"aria-label",
|
|
1354
1418
|
"label",
|
|
1355
1419
|
"icon-right"
|
|
1356
1420
|
])]),
|
|
1357
|
-
content:
|
|
1421
|
+
content: H(() => [I(V(Xe), {
|
|
1358
1422
|
modelValue: a.value,
|
|
1359
1423
|
"onUpdate:modelValue": n[0] ||= (e) => a.value = e,
|
|
1360
1424
|
class: "p-lg"
|
|
1361
|
-
}, null, 8, ["modelValue"]),
|
|
1425
|
+
}, null, 8, ["modelValue"]), I(V(K), {
|
|
1362
1426
|
justify: "end",
|
|
1363
1427
|
gap: "sm",
|
|
1364
1428
|
class: "border-t border-secondary p-md"
|
|
1365
1429
|
}, {
|
|
1366
|
-
default:
|
|
1367
|
-
|
|
1368
|
-
label:
|
|
1430
|
+
default: H(() => [
|
|
1431
|
+
I(V(W), {
|
|
1432
|
+
label: V(r).t("shared.cancel"),
|
|
1369
1433
|
variant: "tertiary",
|
|
1370
1434
|
onClick: l
|
|
1371
1435
|
}, null, 8, ["label"]),
|
|
1372
|
-
|
|
1373
|
-
label:
|
|
1436
|
+
I(V(W), {
|
|
1437
|
+
label: V(r).t("shared.clear"),
|
|
1374
1438
|
variant: "tertiary",
|
|
1375
1439
|
onClick: u
|
|
1376
1440
|
}, null, 8, ["label"]),
|
|
1377
|
-
|
|
1378
|
-
label:
|
|
1441
|
+
I(V(W), {
|
|
1442
|
+
label: V(r).t("component.filters_date_range_dialog.apply"),
|
|
1379
1443
|
variant: "primary",
|
|
1380
1444
|
onClick: c
|
|
1381
1445
|
}, null, 8, ["label"])
|
|
@@ -1385,7 +1449,7 @@ var dn = /* @__PURE__ */ R({
|
|
|
1385
1449
|
_: 1
|
|
1386
1450
|
}, 8, ["is-open"]));
|
|
1387
1451
|
}
|
|
1388
|
-
}),
|
|
1452
|
+
}), On = { class: "relative flex min-h-0 flex-1 flex-col" }, kn = /* @__PURE__ */ L({
|
|
1389
1453
|
__name: "InvoiceOverviewView",
|
|
1390
1454
|
props: {
|
|
1391
1455
|
currency: {},
|
|
@@ -1393,82 +1457,82 @@ var dn = /* @__PURE__ */ R({
|
|
|
1393
1457
|
onCreateInvoice: { type: Function }
|
|
1394
1458
|
},
|
|
1395
1459
|
setup(e) {
|
|
1396
|
-
let
|
|
1460
|
+
let t = e, n = A(), r = u(), o = gt(), s = o.create(Dt), c = o.create(Sn), l = o.create(wn), f = o.create(En), p = h({ debounceMs: 300 }), m = yt("tab", "all"), _ = g({
|
|
1397
1461
|
initialValues: [{
|
|
1398
1462
|
direction: "desc",
|
|
1399
|
-
key:
|
|
1463
|
+
key: d.ISSUED_ON
|
|
1400
1464
|
}],
|
|
1401
1465
|
keys: [
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1466
|
+
d.CUSTOMER,
|
|
1467
|
+
d.SEQUENCE,
|
|
1468
|
+
d.ISSUED_ON,
|
|
1469
|
+
d.NET_AMOUNT
|
|
1406
1470
|
]
|
|
1407
|
-
}),
|
|
1408
|
-
currency:
|
|
1409
|
-
customFieldDefinitions:
|
|
1471
|
+
}), v = Ft(), { customerUuids: y, customFields: b, dueOnRange: x, filters: C, lifecycleStatuses: ee } = Nt({
|
|
1472
|
+
currency: t.currency,
|
|
1473
|
+
customFieldDefinitions: t.customFieldDefinitions
|
|
1410
1474
|
});
|
|
1411
|
-
|
|
1412
|
-
let
|
|
1413
|
-
filters:
|
|
1414
|
-
issuedOnRange:
|
|
1415
|
-
customerUuids:
|
|
1416
|
-
customFields:
|
|
1417
|
-
dueOnRange:
|
|
1418
|
-
lifecycleStatuses:
|
|
1419
|
-
...
|
|
1475
|
+
oe(C);
|
|
1476
|
+
let w = z(null), te = j(() => v.getFilters(m.value)), { isFetchingNextPage: ne, isLoading: re, fetchNextPage: ie, result: T } = bt({ params: {
|
|
1477
|
+
filters: j(() => ({
|
|
1478
|
+
issuedOnRange: w.value,
|
|
1479
|
+
customerUuids: y.value,
|
|
1480
|
+
customFields: b.value,
|
|
1481
|
+
dueOnRange: x.value,
|
|
1482
|
+
lifecycleStatuses: ee.value,
|
|
1483
|
+
...te.value
|
|
1420
1484
|
})),
|
|
1421
1485
|
search: p.debouncedSearch,
|
|
1422
|
-
sort:
|
|
1486
|
+
sort: _.values
|
|
1423
1487
|
} });
|
|
1424
|
-
|
|
1425
|
-
let
|
|
1426
|
-
customFieldDefinitions: () =>
|
|
1488
|
+
r.set(() => n.t("wise_invoicing.invoice.overview.title"));
|
|
1489
|
+
let ae = { name: () => n.t("wise_invoicing.invoice.overview.title") }, E = j(() => T.value.isOk() ? T.value.getValue().data : []), D = It({ rows: () => E.value }), le = Qt({
|
|
1490
|
+
customFieldDefinitions: () => t.customFieldDefinitions,
|
|
1427
1491
|
selection: {
|
|
1428
|
-
isSelected:
|
|
1429
|
-
toggleRow:
|
|
1492
|
+
isSelected: D.isSelected,
|
|
1493
|
+
toggleRow: D.toggleRow
|
|
1430
1494
|
}
|
|
1431
|
-
}), { customizedColumns:
|
|
1432
|
-
actionGroup:
|
|
1433
|
-
availableColumns:
|
|
1434
|
-
initialState:
|
|
1435
|
-
}), O =
|
|
1436
|
-
|
|
1437
|
-
|
|
1495
|
+
}), { customizedColumns: ue, customizeTableAction: de } = _t({
|
|
1496
|
+
actionGroup: ae,
|
|
1497
|
+
availableColumns: le,
|
|
1498
|
+
initialState: He("invoice-overview-columns", []).value
|
|
1499
|
+
}), O = j(() => T.value.isErr() ? T.value.getError() : null), fe = j(() => C.activeFilters.value.length), pe = j(() => (p.debouncedSearch.value?.trim().length ?? 0) > 0), me = j(() => D.selectedInvoices.value.some((e) => e.status === a.READY)), he = j(() => D.selectedInvoices.value.some((e) => e.status === a.DRAFT)), { canSend: ge } = jt({ selectedInvoices: () => D.selectedInvoices.value });
|
|
1500
|
+
Re(E, () => {
|
|
1501
|
+
D.syncSelection();
|
|
1438
1502
|
});
|
|
1439
1503
|
function _e() {
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1504
|
+
if (t.onCreateInvoice !== void 0) {
|
|
1505
|
+
t.onCreateInvoice();
|
|
1442
1506
|
return;
|
|
1443
1507
|
}
|
|
1444
|
-
|
|
1508
|
+
s.open();
|
|
1445
1509
|
}
|
|
1446
1510
|
async function ve() {
|
|
1447
|
-
await
|
|
1448
|
-
invoices:
|
|
1511
|
+
await l.open({
|
|
1512
|
+
invoices: D.selectedInvoices.value,
|
|
1449
1513
|
onMarkedAsReady: () => {
|
|
1450
|
-
|
|
1514
|
+
D.clearSelection();
|
|
1451
1515
|
}
|
|
1452
1516
|
});
|
|
1453
1517
|
}
|
|
1454
1518
|
async function ye() {
|
|
1455
|
-
await
|
|
1456
|
-
invoices:
|
|
1519
|
+
await c.open({
|
|
1520
|
+
invoices: D.selectedInvoices.value,
|
|
1457
1521
|
onFinalized: () => {
|
|
1458
|
-
|
|
1522
|
+
D.clearSelection();
|
|
1459
1523
|
}
|
|
1460
1524
|
});
|
|
1461
1525
|
}
|
|
1462
1526
|
async function be() {
|
|
1463
1527
|
await f.open({
|
|
1464
|
-
invoices:
|
|
1528
|
+
invoices: D.selectedInvoices.value,
|
|
1465
1529
|
onSent: () => {
|
|
1466
|
-
|
|
1530
|
+
D.clearSelection();
|
|
1467
1531
|
}
|
|
1468
1532
|
});
|
|
1469
1533
|
}
|
|
1470
1534
|
function xe(e) {
|
|
1471
|
-
return e.type ===
|
|
1535
|
+
return e.type === i.CREDIT_NOTE ? {
|
|
1472
1536
|
name: "invoicing-credit-note-detail",
|
|
1473
1537
|
params: { creditNoteUuid: e.uuid }
|
|
1474
1538
|
} : {
|
|
@@ -1476,14 +1540,14 @@ var dn = /* @__PURE__ */ R({
|
|
|
1476
1540
|
params: { invoiceUuid: e.uuid }
|
|
1477
1541
|
};
|
|
1478
1542
|
}
|
|
1479
|
-
return (e, t) => (
|
|
1480
|
-
"page-actions-left":
|
|
1481
|
-
modelValue:
|
|
1482
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
1543
|
+
return (e, t) => (R(), M(V(Je), { title: V(n).t("wise_invoicing.invoice.overview.title") }, {
|
|
1544
|
+
"page-actions-left": H(() => [I(V(lt), {
|
|
1545
|
+
modelValue: V(m),
|
|
1546
|
+
"onUpdate:modelValue": t[0] ||= (e) => Ae(m) ? m.value = e : null,
|
|
1483
1547
|
variant: "button-border"
|
|
1484
1548
|
}, {
|
|
1485
|
-
default:
|
|
1486
|
-
default:
|
|
1549
|
+
default: H(() => [I(V(dt), null, {
|
|
1550
|
+
default: H(() => [(R(!0), P(Oe, null, Fe(V(v).tabs.value, (e) => (R(), M(V(ut), {
|
|
1487
1551
|
key: e.key,
|
|
1488
1552
|
value: e.key,
|
|
1489
1553
|
label: e.label
|
|
@@ -1492,22 +1556,22 @@ var dn = /* @__PURE__ */ R({
|
|
|
1492
1556
|
})]),
|
|
1493
1557
|
_: 1
|
|
1494
1558
|
}, 8, ["modelValue"])]),
|
|
1495
|
-
"page-actions-right":
|
|
1559
|
+
"page-actions-right": H(() => [I(V(K), {
|
|
1496
1560
|
justify: "between",
|
|
1497
1561
|
class: "items-stretch"
|
|
1498
1562
|
}, {
|
|
1499
|
-
default:
|
|
1500
|
-
modelValue:
|
|
1501
|
-
"onUpdate:modelValue": t[1] ||= (e) =>
|
|
1502
|
-
"aria-label":
|
|
1503
|
-
}, null, 8, ["modelValue", "aria-label"]),
|
|
1504
|
-
default:
|
|
1505
|
-
|
|
1506
|
-
modelValue:
|
|
1507
|
-
"onUpdate:modelValue": t[2] ||= (e) =>
|
|
1563
|
+
default: H(() => [I(Dn, {
|
|
1564
|
+
modelValue: w.value,
|
|
1565
|
+
"onUpdate:modelValue": t[1] ||= (e) => w.value = e,
|
|
1566
|
+
"aria-label": V(n).t("wise_invoicing.invoice.overview.filters.issued_on")
|
|
1567
|
+
}, null, 8, ["modelValue", "aria-label"]), I(V(K), { justify: "end" }, {
|
|
1568
|
+
default: H(() => [
|
|
1569
|
+
I(V(pt), {
|
|
1570
|
+
modelValue: V(p).search.value,
|
|
1571
|
+
"onUpdate:modelValue": t[2] ||= (e) => V(p).search.value = e,
|
|
1508
1572
|
label: null,
|
|
1509
|
-
"icon-left":
|
|
1510
|
-
placeholder:
|
|
1573
|
+
"icon-left": V(S),
|
|
1574
|
+
placeholder: V(n).t("wise_invoicing.common.search"),
|
|
1511
1575
|
size: "sm",
|
|
1512
1576
|
type: "search"
|
|
1513
1577
|
}, null, 8, [
|
|
@@ -1515,9 +1579,9 @@ var dn = /* @__PURE__ */ R({
|
|
|
1515
1579
|
"icon-left",
|
|
1516
1580
|
"placeholder"
|
|
1517
1581
|
]),
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
label:
|
|
1582
|
+
Ie(e.$slots, "actions"),
|
|
1583
|
+
I(V(W), {
|
|
1584
|
+
label: V(n).t("wise_invoicing.invoice.create.title"),
|
|
1521
1585
|
onClick: _e
|
|
1522
1586
|
}, null, 8, ["label"])
|
|
1523
1587
|
]),
|
|
@@ -1525,31 +1589,31 @@ var dn = /* @__PURE__ */ R({
|
|
|
1525
1589
|
})]),
|
|
1526
1590
|
_: 3
|
|
1527
1591
|
})]),
|
|
1528
|
-
default:
|
|
1529
|
-
default:
|
|
1530
|
-
default:
|
|
1592
|
+
default: H(() => [I(V(Ye), null, {
|
|
1593
|
+
default: H(() => [I(V(K), { justify: "between" }, {
|
|
1594
|
+
default: H(() => [I(V(se)), I(V(ce))]),
|
|
1531
1595
|
_: 1
|
|
1532
1596
|
})]),
|
|
1533
1597
|
_: 1
|
|
1534
|
-
}),
|
|
1535
|
-
columns:
|
|
1536
|
-
data:
|
|
1537
|
-
"is-loading":
|
|
1538
|
-
"is-fetching-next-page":
|
|
1598
|
+
}), F("div", On, [I(V(ot), {
|
|
1599
|
+
columns: V(ue),
|
|
1600
|
+
data: E.value,
|
|
1601
|
+
"is-loading": V(re),
|
|
1602
|
+
"is-fetching-next-page": V(ne),
|
|
1539
1603
|
error: O.value,
|
|
1540
1604
|
"has-active-search": pe.value,
|
|
1541
1605
|
"active-filter-count": fe.value,
|
|
1542
1606
|
"get-key": (e) => e.uuid,
|
|
1543
|
-
"header-actions": [
|
|
1607
|
+
"header-actions": [V(de)],
|
|
1544
1608
|
"get-link": xe,
|
|
1545
1609
|
"get-action-model": (e) => ({
|
|
1546
1610
|
modelName: "Invoice",
|
|
1547
1611
|
key: e.uuid,
|
|
1548
1612
|
...e
|
|
1549
1613
|
}),
|
|
1550
|
-
onNextPage:
|
|
1551
|
-
onClearSearch: t[3] ||= (e) =>
|
|
1552
|
-
onClearFilters: t[4] ||= (e) =>
|
|
1614
|
+
onNextPage: V(ie),
|
|
1615
|
+
onClearSearch: t[3] ||= (e) => V(p).clear(),
|
|
1616
|
+
onClearFilters: t[4] ||= (e) => V(C).clearAll()
|
|
1553
1617
|
}, null, 8, [
|
|
1554
1618
|
"columns",
|
|
1555
1619
|
"data",
|
|
@@ -1562,16 +1626,16 @@ var dn = /* @__PURE__ */ R({
|
|
|
1562
1626
|
"header-actions",
|
|
1563
1627
|
"get-action-model",
|
|
1564
1628
|
"onNextPage"
|
|
1565
|
-
]),
|
|
1629
|
+
]), I(At, {
|
|
1566
1630
|
"can-finalize": me.value,
|
|
1567
|
-
"can-select-all":
|
|
1631
|
+
"can-select-all": V(D).canSelectAll.value,
|
|
1568
1632
|
"can-mark-as-ready": he.value,
|
|
1569
|
-
"can-send":
|
|
1570
|
-
"selected-count":
|
|
1571
|
-
onCancel: t[5] ||= (e) =>
|
|
1633
|
+
"can-send": V(ge),
|
|
1634
|
+
"selected-count": V(D).selectedCount.value,
|
|
1635
|
+
onCancel: t[5] ||= (e) => V(D).clearSelection(),
|
|
1572
1636
|
onFinalize: t[6] ||= (e) => ye(),
|
|
1573
1637
|
onMarkAsReady: t[7] ||= (e) => ve(),
|
|
1574
|
-
onSelectAll: t[8] ||= (e) =>
|
|
1638
|
+
onSelectAll: t[8] ||= (e) => V(D).selectAll(),
|
|
1575
1639
|
onSend: t[9] ||= (e) => be()
|
|
1576
1640
|
}, null, 8, [
|
|
1577
1641
|
"can-finalize",
|
|
@@ -1583,31 +1647,31 @@ var dn = /* @__PURE__ */ R({
|
|
|
1583
1647
|
_: 3
|
|
1584
1648
|
}, 8, ["title"]));
|
|
1585
1649
|
}
|
|
1586
|
-
}),
|
|
1650
|
+
}), An = /*@__PURE__*/ L({
|
|
1587
1651
|
__name: "InvoiceOverviewViewDataProvider",
|
|
1588
1652
|
props: { onCreateInvoice: { type: Function } },
|
|
1589
1653
|
setup(e) {
|
|
1590
|
-
let t = fe(
|
|
1591
|
-
return (r, i) => (
|
|
1592
|
-
customFieldDefinitions:
|
|
1593
|
-
issuerSettings:
|
|
1654
|
+
let t = fe(j(() => ({ entityTypes: [s.INVOICE] }))), n = we();
|
|
1655
|
+
return (r, i) => (R(), M(he, { queries: {
|
|
1656
|
+
customFieldDefinitions: V(t),
|
|
1657
|
+
issuerSettings: V(n)
|
|
1594
1658
|
} }, {
|
|
1595
|
-
default:
|
|
1659
|
+
default: H(({ data: t }) => [I(kn, {
|
|
1596
1660
|
currency: t.issuerSettings.currency,
|
|
1597
1661
|
"custom-field-definitions": t.customFieldDefinitions,
|
|
1598
1662
|
"on-create-invoice": e.onCreateInvoice
|
|
1599
1663
|
}, {
|
|
1600
|
-
actions:
|
|
1664
|
+
actions: H(() => [Ie(r.$slots, "actions")]),
|
|
1601
1665
|
_: 3
|
|
1602
1666
|
}, 8, [
|
|
1603
1667
|
"currency",
|
|
1604
1668
|
"custom-field-definitions",
|
|
1605
1669
|
"on-create-invoice"
|
|
1606
1670
|
])]),
|
|
1607
|
-
loading:
|
|
1671
|
+
loading: H(() => [I(V(Te).PageLoadingState, { breadcrumbs: [] })]),
|
|
1608
1672
|
_: 3
|
|
1609
1673
|
}, 8, ["queries"]));
|
|
1610
1674
|
}
|
|
1611
|
-
}),
|
|
1675
|
+
}), jn = /* @__PURE__ */ e({ default: () => Mn }), Mn = An;
|
|
1612
1676
|
//#endregion
|
|
1613
|
-
export {
|
|
1677
|
+
export { jn as n, bt as r, Mn as t };
|