@wisemen/wise-invoicing-web 0.0.5 → 0.0.7
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-DdaNbuI2.js → BillingDocumentDetailViewDataProvider-CmHbMXp0.js} +463 -469
- package/dist/{BillingDocumentPdf-D_NOfBhQ.js → BillingDocumentPdf-Dj_s1l_p.js} +2 -2
- package/dist/{CreditNoteDetailViewDataProvider-5ljhBOoN.js → CreditNoteDetailViewDataProvider-DPePmzgn.js} +68 -68
- package/dist/{CreditNotePdfViewDataProvider-CiWZN7Zy.js → CreditNotePdfViewDataProvider-Dp0zI0fB.js} +2 -2
- package/dist/{CustomFieldValueText-ne5yy02J.js → CustomFieldValueText-BGbQwhON.js} +1 -1
- package/dist/{DunningCaseDetailViewDataProvider-CetbSmjq.js → DunningCaseDetailViewDataProvider-CInwZwMc.js} +8 -8
- package/dist/{DunningCaseOverviewView-Bq0BKVXG.js → DunningCaseOverviewView-DvOmEcJY.js} +4 -4
- package/dist/DunningCaseReminderPdfViewDataProvider-I0I_WQQB.js +490 -0
- package/dist/{DunningCaseSendDialog-C47X_JjC.js → DunningCaseSendDialog-DISQ1Fs3.js} +2 -2
- package/dist/{InvoiceDetailViewDataProvider-DYH2ODDi.js → InvoiceDetailViewDataProvider-YOlvUavt.js} +411 -411
- package/dist/{InvoiceOverviewViewDataProvider-BT9cuQXw.js → InvoiceOverviewViewDataProvider-i8tXATJE.js} +47 -47
- package/dist/{InvoicePdfView-ug0BiMqe.js → InvoicePdfView-Desmlys1.js} +1 -1
- package/dist/{InvoicePdfViewDataProvider-WvjMiEZG.js → InvoicePdfViewDataProvider--CHm0HAM.js} +2 -2
- package/dist/{InvoicePublicPdfViewDataProvider-BI9RQqYp.js → InvoicePublicPdfViewDataProvider-DoNBZsmi.js} +3 -3
- package/dist/{IssuerSettingsViewDataProvider-Bs4rEES2.js → IssuerSettingsViewDataProvider-COqHGUE6.js} +1 -1
- package/dist/{ReminderSettingsViewDataProvider-5n2EfxPG.js → ReminderSettingsViewDataProvider-Dys4bUU7.js} +2 -2
- package/dist/{address.transformer-B8C0pwT1.js → address.transformer-jGddczLV.js} +2 -73
- package/dist/{billingDocumentDetail.transformer-DIKAl4_L.js → billingDocumentDetail.transformer-BBn9R_cx.js} +32 -42
- package/dist/{creditNoteDetail.query-DHP69UiB.js → creditNoteDetail.query-BcPsB96h.js} +11 -11
- package/dist/customFieldValue.util-BwsX8exl.js +16 -0
- package/dist/{dist-PErDVE6-.js → dist-BBjpqvUl.js} +2 -2
- package/dist/dist-BFx8U4Su.js +72 -0
- package/dist/{dist-YTXTCfo1.js → dist-boJIIxnT.js} +1 -1
- package/dist/{i18n.lib-B74GKndD.js → i18n.lib-C6eb-F-e.js} +28 -6
- package/dist/index.d.ts +30 -3
- package/dist/index.js +186 -185
- package/dist/instant.transformer-KmBsH3E9.js +18 -0
- package/dist/{invoice.service-DG5eacZC.js → invoice.service-Bb8VqQvc.js} +38 -32
- package/dist/{invoiceDeliveryStatus.util-CX-IdqAu.js → invoiceDeliveryStatus.util-BPkGCQM6.js} +2 -2
- package/dist/{invoiceDetail.query-C_IMGjOX.js → invoiceDetail.query-Cek8nyaw.js} +1 -1
- package/dist/{invoicingConfig.composable-BYqn1I9n.js → invoicingConfig.composable-D8HuO3Sl.js} +1 -1
- package/dist/{issuerSettings.query-6wnSPphB.js → issuerSettings.query-Bvz-Oj5D.js} +13 -12
- package/dist/libs/i18n.lib.d.ts +24 -2
- package/dist/locales/en-US.json.d.ts +14 -3
- package/dist/locales/nl-BE.json.d.ts +14 -3
- package/dist/modules/dunning-case/models/dunningCase.model.d.ts +0 -1
- package/dist/modules/dunning-case/models/dunningCaseReminderPdf.model.d.ts +49 -0
- package/dist/modules/dunning-case/models/dunningCaseReminderPdf.transformer.d.ts +8 -0
- package/dist/modules/dunning-case/models/dunningCaseReminderPdf.transformer.spec.d.ts +1 -0
- package/dist/modules/dunning-case/test/builders/dunningCaseReminderPdfDto.builder.d.ts +27 -0
- package/dist/modules/dunning-case/use-cases/pdf/api/dunningCaseReminderPdf.query.d.ts +1 -1
- package/dist/modules/dunning-case/use-cases/pdf/api/dunningCaseReminderPdf.service.d.ts +2 -2
- package/dist/modules/dunning-case/use-cases/pdf/components/DunningCaseReminderPdfFooter.vue.d.ts +2 -2
- package/dist/modules/dunning-case/use-cases/pdf/components/DunningCaseReminderPdfHeader.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/pdf/components/DunningCaseReminderPdfTable.vue.d.ts +10 -16
- package/dist/modules/dunning-case/use-cases/pdf/components/DunningCaseReminderPdfTotals.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/pdf/utils/dunningCaseReminderPdf.util.d.ts +15 -6
- package/dist/modules/dunning-case/use-cases/pdf/views/DunningCaseReminderPdfView.vue.d.ts +2 -2
- package/dist/modules/invoice/api/mutations/invoiceUpdate.mutation.d.ts +1 -1
- package/dist/modules/invoice/api/queries/invoicePublicDetail.query.d.ts +1 -1
- package/dist/modules/invoice/models/invoice/pdf/invoicePdfDetail.model.d.ts +4 -0
- package/dist/percentage.util-Bl78kSSk.js +35 -0
- package/dist/{plainDate.transformer-Dfe5r84P.js → plainDate.transformer-BxvJpJOv.js} +1 -32
- package/dist/{reminderConfig.query-B9OQY7IT.js → reminderConfig.query-DsJNqqi7.js} +8 -8
- package/dist/style.css +1 -1
- package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +432 -432
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +36 -36
- package/package.json +1 -1
- package/dist/DunningCaseReminderPdfViewDataProvider-B3Y2aYFf.js +0 -239
- package/dist/download.util-PjaUQR6r.js +0 -9
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { l as e, m as t, s as n, t as r } from "./api.util-BCSgCfpS.js";
|
|
2
2
|
import { C as i, S as a, _ as o, g as s, h as c, i as l, l as u, n as d, o as f, r as p, s as m, t as h } from "./documentTitle.composable-4ApFl9TZ.js";
|
|
3
3
|
import { n as g, r as _, t as v } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
4
|
-
import { r as y, t as b } from "./invoice.service-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as te } from "./
|
|
8
|
-
import {
|
|
9
|
-
import { n as ke } from "./dist-
|
|
10
|
-
import { n as Ae
|
|
11
|
-
import { t as Me } from "./
|
|
12
|
-
import { t as Ne } from "./
|
|
13
|
-
import { t as Pe } from "./
|
|
14
|
-
import { t as Fe } from "./
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
4
|
+
import { r as y, t as b } from "./invoice.service-Bb8VqQvc.js";
|
|
5
|
+
import { t as x } from "./customFieldValue.util-BwsX8exl.js";
|
|
6
|
+
import { t as ee } from "./percentage.util-Bl78kSSk.js";
|
|
7
|
+
import { n as te } from "./invoicingConfig.composable-D8HuO3Sl.js";
|
|
8
|
+
import { t as ne } from "./dist-BFx8U4Su.js";
|
|
9
|
+
import { A as S, B as C, E as re, F as ie, H as ae, J as oe, K as se, M as ce, N as le, P as ue, R as de, Y as fe, _ as pe, b as me, et as he, f as ge, k as _e, m as ve, n as ye, o as be, p as xe, r as Se, s as Ce, t as we, tt as Te, u as Ee, w as De, y as Oe, z as ke } from "./dist-D9lp7NDv.js";
|
|
10
|
+
import { n as Ae } from "./dist-boJIIxnT.js";
|
|
11
|
+
import { n as je, t as Me } from "./CustomFieldValueText-BGbQwhON.js";
|
|
12
|
+
import { t as Ne } from "./DataProvider-Dj34ljUX.js";
|
|
13
|
+
import { t as Pe } from "./formango.util-D5c2ql--.js";
|
|
14
|
+
import { t as Fe } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
15
|
+
import { t as Ie } from "./dashboard-BaWGNEek.js";
|
|
16
|
+
import { n as Le, r as Re, t as ze } from "./BillingDocumentPdf-Dj_s1l_p.js";
|
|
17
|
+
import { useViewModels as Be } from "@wisemen/vue-core-actions";
|
|
18
|
+
import { RouterLink as Ve, useRouter as He } from "vue-router";
|
|
19
|
+
import Ue, { z as w } from "zod";
|
|
19
20
|
import { useI18n as T } from "vue-i18n";
|
|
20
|
-
import { Fragment as E, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createStaticVNode as
|
|
21
|
-
import { useMutation as
|
|
22
|
-
import { refDebounced as
|
|
23
|
-
import { Temporal as
|
|
24
|
-
import { UIActionTooltip as
|
|
25
|
-
import { useForm as
|
|
21
|
+
import { Fragment as E, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createStaticVNode as We, createTextVNode as Ge, createVNode as M, defineComponent as N, getCurrentInstance as Ke, guardReactiveProps as qe, h as Je, inject as Ye, isRef as Xe, mergeModels as Ze, mergeProps as P, nextTick as Qe, normalizeClass as $e, normalizeProps as et, normalizeStyle as tt, onBeforeUnmount as nt, onMounted as rt, onUnmounted as it, openBlock as F, provide as at, reactive as ot, ref as I, renderList as st, renderSlot as ct, resolveDynamicComponent as lt, toDisplayString as L, toRefs as ut, unref as R, useAttrs as dt, useModel as ft, useTemplateRef as pt, vShow as mt, watch as ht, withCtx as z, withDirectives as gt, withKeys as _t, withModifiers as vt } from "vue";
|
|
22
|
+
import { useMutation as yt } from "@wisemen/vue-core-api-utils";
|
|
23
|
+
import { refDebounced as bt, useInfiniteScroll as xt, useLocalStorage as St, useResizeObserver as Ct, watchDebounced as wt } from "@vueuse/core";
|
|
24
|
+
import { Temporal as Tt } from "temporal-polyfill";
|
|
25
|
+
import { UIActionTooltip as Et, UIBadge as Dt, UIButton as Ot, UICheckbox as kt, UIClickableElement as At, UIColumnLayout as jt, UIConfigProvider as Mt, UIDashboardPage as Nt, UIDashboardPageCenteredContentScrollable as Pt, UIDateField as Ft, UIDetailListGroup as It, UIDialogBody as Lt, UIDialogFooter as Rt, UIDialogFooterCancel as zt, UIDialogFooterSubmit as Bt, UIDialogHeader as Vt, UIDropdownMenu as Ht, UIDropdownMenuGroup as Ut, UIDropdownMenuItem as Wt, UIDropdownMenuSeparator as Gt, UIEmptyState as Kt, UIForm as qt, UIFormDialog as Jt, UIFormFileUpload as Yt, UIIconButton as Xt, UINumberField as Zt, UIPopover as Qt, UIRowLayout as B, UISelect as $t, UISelectDropdown as en, UISeparator as tn, UISwitch as nn, UITabs as rn, UITabsItem as an, UITabsList as on, UITagsField as sn, UIText as V, UITextField as cn, UITextareaField as ln, UITimeField as un, UITimeline as dn, UITimelineItem as fn, UITooltip as pn, UITooltipContent as mn, createSelectOptions as hn, useInjectConfigContext as gn, useOverlay as _n, useToast as vn } from "@wisemen/vue-core-design-system";
|
|
26
|
+
import { useForm as yn } from "formango";
|
|
26
27
|
//#region src/composables/form-auto-save/formAutoSave.composable.ts
|
|
27
|
-
var
|
|
28
|
-
function
|
|
28
|
+
var bn = 500;
|
|
29
|
+
function xn(e) {
|
|
29
30
|
let { debounceMs: t, form: n } = e;
|
|
30
31
|
async function r() {
|
|
31
32
|
!n.isSubmitting.value && n.isValid.value && n.isDirty.value && await n.submit();
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
debounce: t ??
|
|
34
|
+
wt(() => n.state.value, r, {
|
|
35
|
+
debounce: t ?? bn,
|
|
35
36
|
deep: !0
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
//#endregion
|
|
39
40
|
//#region src/models/billing-document/billingDocumentStatusEnum.model.ts
|
|
40
|
-
var
|
|
41
|
+
var Sn = class {
|
|
41
42
|
value;
|
|
42
43
|
colorMap = /* @__PURE__ */ new Map([
|
|
43
44
|
[c.CREDITED, "success"],
|
|
@@ -70,7 +71,7 @@ var xn = class {
|
|
|
70
71
|
get translationKey() {
|
|
71
72
|
return this.i18nKeyMap.get(this.value) ?? "wise_invoicing.invoice.status.draft";
|
|
72
73
|
}
|
|
73
|
-
},
|
|
74
|
+
}, Cn = new Set(Object.values(o)), wn = class i {
|
|
74
75
|
static async confirmUpload(e, t) {
|
|
75
76
|
let i = await r.fromPromise(n({
|
|
76
77
|
body: { blurHash: t },
|
|
@@ -96,7 +97,7 @@ var xn = class {
|
|
|
96
97
|
}));
|
|
97
98
|
}
|
|
98
99
|
static normalizeMimeType(e) {
|
|
99
|
-
return
|
|
100
|
+
return Cn.has(e) ? e : o.APPLICATION_OCTET_STREAM;
|
|
100
101
|
}
|
|
101
102
|
static preprocess(e) {
|
|
102
103
|
let t = i.normalizeMimeType(e.type);
|
|
@@ -105,9 +106,9 @@ var xn = class {
|
|
|
105
106
|
type: t
|
|
106
107
|
}));
|
|
107
108
|
}
|
|
108
|
-
},
|
|
109
|
-
function
|
|
110
|
-
let e =
|
|
109
|
+
}, Tn = "wise-invoicing.billing-document.finalize-confirmation.skip";
|
|
110
|
+
function En() {
|
|
111
|
+
let e = St(Tn, !1);
|
|
111
112
|
function t(t) {
|
|
112
113
|
e.value = t;
|
|
113
114
|
}
|
|
@@ -118,7 +119,7 @@ function Tn() {
|
|
|
118
119
|
}
|
|
119
120
|
//#endregion
|
|
120
121
|
//#region src/ui/billing-document/BillingDocumentFinalizeDialog.vue
|
|
121
|
-
var
|
|
122
|
+
var Dn = /* @__PURE__ */ N({
|
|
122
123
|
__name: "BillingDocumentFinalizeDialog",
|
|
123
124
|
props: {
|
|
124
125
|
billingDocumentType: {},
|
|
@@ -126,43 +127,43 @@ var En = /* @__PURE__ */ N({
|
|
|
126
127
|
},
|
|
127
128
|
emits: ["close"],
|
|
128
129
|
setup(e, { emit: t }) {
|
|
129
|
-
let n = e, r = t, i = T(), { setShouldSkipConfirmation: a } =
|
|
130
|
+
let n = e, r = t, i = T(), { setShouldSkipConfirmation: a } = En(), o = yn({
|
|
130
131
|
initialState: { doNotShowAgain: !1 },
|
|
131
|
-
schema:
|
|
132
|
+
schema: Ue.object({ doNotShowAgain: Ue.boolean() }),
|
|
132
133
|
onSubmit: async (e) => {
|
|
133
134
|
await n.onConfirm() && (e.doNotShowAgain && a(!0), r("close"));
|
|
134
135
|
}
|
|
135
136
|
}), s = o.register("doNotShowAgain", !1);
|
|
136
|
-
return (e, t) => (F(), O(R(
|
|
137
|
+
return (e, t) => (F(), O(R(Jt), {
|
|
137
138
|
form: R(o),
|
|
138
139
|
size: "sm",
|
|
139
140
|
onClose: t[0] ||= (e) => r("close")
|
|
140
141
|
}, {
|
|
141
|
-
default: z(() => [M(R(
|
|
142
|
+
default: z(() => [M(R(Vt), {
|
|
142
143
|
title: R(i).t(`wise_invoicing.${n.billingDocumentType}.finalize.confirmation.title`),
|
|
143
144
|
description: R(i).t(`wise_invoicing.${n.billingDocumentType}.finalize.confirmation.description`),
|
|
144
145
|
"is-description-visible": !0
|
|
145
|
-
}, null, 8, ["title", "description"]), M(R(
|
|
146
|
-
left: z(() => [M(R(
|
|
147
|
-
right: z(() => [M(R(
|
|
146
|
+
}, null, 8, ["title", "description"]), M(R(Rt), null, {
|
|
147
|
+
left: z(() => [M(R(kt), P(R(Pe)(R(s)), { label: R(i).t("wise_invoicing.common.do_not_show_again") }), null, 16, ["label"])]),
|
|
148
|
+
right: z(() => [M(R(zt)), M(R(Bt), { label: R(i).t(`wise_invoicing.${n.billingDocumentType}.finalize.confirmation.submit_button`) }, null, 8, ["label"])]),
|
|
148
149
|
_: 1
|
|
149
150
|
})]),
|
|
150
151
|
_: 1
|
|
151
152
|
}, 8, ["form"]));
|
|
152
153
|
}
|
|
153
|
-
}),
|
|
154
|
+
}), On = /* @__PURE__ */ N({
|
|
154
155
|
__name: "InvoiceOverdueBadge",
|
|
155
156
|
props: { size: { default: "sm" } },
|
|
156
157
|
setup(e) {
|
|
157
158
|
let t = e, n = T(), r = D(() => n.t("wise_invoicing.invoice.status.overdue"));
|
|
158
|
-
return (e, n) => (F(), O(R(
|
|
159
|
+
return (e, n) => (F(), O(R(Dt), {
|
|
159
160
|
label: r.value,
|
|
160
161
|
size: t.size,
|
|
161
162
|
color: "error",
|
|
162
163
|
variant: "translucent"
|
|
163
164
|
}, null, 8, ["label", "size"]));
|
|
164
165
|
}
|
|
165
|
-
}),
|
|
166
|
+
}), kn = { class: "flex size-9 items-center justify-center rounded-lg border border-primary bg-primary p-md shadow-xs" }, An = /* @__PURE__ */ N({
|
|
166
167
|
__name: "BillingDocumentDetailHeaderSection",
|
|
167
168
|
props: {
|
|
168
169
|
isDisabled: { type: Boolean },
|
|
@@ -176,24 +177,24 @@ var En = /* @__PURE__ */ N({
|
|
|
176
177
|
},
|
|
177
178
|
setup(e) {
|
|
178
179
|
let t = e, n = T();
|
|
179
|
-
return (e, r) => (F(), O(R(
|
|
180
|
+
return (e, r) => (F(), O(R(jt), { gap: "md" }, {
|
|
180
181
|
default: z(() => [M(R(B), {
|
|
181
182
|
justify: "between",
|
|
182
183
|
class: "w-full flex-wrap"
|
|
183
184
|
}, {
|
|
184
185
|
default: z(() => [M(R(B), { class: "flex-1" }, {
|
|
185
|
-
default: z(() => [j("div",
|
|
186
|
+
default: z(() => [j("div", kn, [(F(), O(lt(t.icon), { class: "size-5 text-secondary" }))]), M(R(jt), { gap: "none" }, {
|
|
186
187
|
default: z(() => [M(R(B), null, {
|
|
187
188
|
default: z(() => [
|
|
188
|
-
t.isDisabled ? (F(), O(R(
|
|
189
|
+
t.isDisabled ? (F(), O(R(pn), {
|
|
189
190
|
key: 0,
|
|
190
191
|
"popover-side-offset": 8,
|
|
191
192
|
"popover-align": "start",
|
|
192
193
|
"popover-side": "bottom"
|
|
193
194
|
}, {
|
|
194
|
-
trigger: z(() => [M(R(
|
|
195
|
-
content: z(() => [M(R(
|
|
196
|
-
default: z(() => [M(R(
|
|
195
|
+
trigger: z(() => [M(R(De), { class: "size-4 text-brand-primary" })]),
|
|
196
|
+
content: z(() => [M(R(mn), null, {
|
|
197
|
+
default: z(() => [M(R(jt), {
|
|
197
198
|
gap: "xs",
|
|
198
199
|
class: "max-w-80"
|
|
199
200
|
}, {
|
|
@@ -212,7 +213,7 @@ var En = /* @__PURE__ */ N({
|
|
|
212
213
|
as: "h1",
|
|
213
214
|
class: "text-lg font-semibold text-primary"
|
|
214
215
|
}, null, 8, ["text"]),
|
|
215
|
-
|
|
216
|
+
ct(e.$slots, "status", {}, () => [M(R(Dt), {
|
|
216
217
|
label: t.statusLabel,
|
|
217
218
|
color: t.statusColor,
|
|
218
219
|
size: "sm",
|
|
@@ -223,9 +224,9 @@ var En = /* @__PURE__ */ N({
|
|
|
223
224
|
}), t.isDisabled ? (F(), O(R(V), {
|
|
224
225
|
key: 0,
|
|
225
226
|
truncate: !1,
|
|
226
|
-
text: R(
|
|
227
|
+
text: R(ne).trimOrNull(t.subjectField.modelValue.value) ?? "-",
|
|
227
228
|
class: "text-sm wrap-break-word text-secondary"
|
|
228
|
-
}, null, 8, ["text"])) : (F(), O(R(
|
|
229
|
+
}, null, 8, ["text"])) : (F(), O(R(cn), P({ key: 1 }, R(Pe)(t.subjectField), {
|
|
229
230
|
label: null,
|
|
230
231
|
placeholder: t.subjectPlaceholder,
|
|
231
232
|
class: "min-w-80"
|
|
@@ -237,7 +238,7 @@ var En = /* @__PURE__ */ N({
|
|
|
237
238
|
justify: "end",
|
|
238
239
|
class: "flex-1"
|
|
239
240
|
}, {
|
|
240
|
-
default: z(() => [
|
|
241
|
+
default: z(() => [ct(e.$slots, "actions")]),
|
|
241
242
|
_: 3
|
|
242
243
|
})]),
|
|
243
244
|
_: 3
|
|
@@ -245,7 +246,7 @@ var En = /* @__PURE__ */ N({
|
|
|
245
246
|
_: 3
|
|
246
247
|
}));
|
|
247
248
|
}
|
|
248
|
-
}),
|
|
249
|
+
}), jn = /* @__PURE__ */ N({
|
|
249
250
|
__name: "BillingDocumentHeaderActions",
|
|
250
251
|
props: {
|
|
251
252
|
isPdfViewActive: { type: Boolean },
|
|
@@ -263,14 +264,14 @@ var En = /* @__PURE__ */ N({
|
|
|
263
264
|
}
|
|
264
265
|
return (e, t) => (F(), O(R(B), { class: "gap-sm" }, {
|
|
265
266
|
default: z(() => [
|
|
266
|
-
M(R(
|
|
267
|
-
"icon-left": R(
|
|
267
|
+
M(R(Ot), {
|
|
268
|
+
"icon-left": R(_e),
|
|
268
269
|
label: n.isPdfViewActive ? R(i).t("wise_invoicing.common.view_details") : R(i).t("wise_invoicing.common.view_pdf"),
|
|
269
270
|
size: "md",
|
|
270
271
|
variant: "secondary",
|
|
271
272
|
onClick: t[0] ||= (e) => r("togglePdfView")
|
|
272
273
|
}, null, 8, ["icon-left", "label"]),
|
|
273
|
-
(F(!0), A(E, null,
|
|
274
|
+
(F(!0), A(E, null, st(n.primaryButtons, (e) => (F(), O(R(Ot), {
|
|
274
275
|
key: e.key,
|
|
275
276
|
"icon-left": e.iconLeft,
|
|
276
277
|
"icon-right": e.iconRight,
|
|
@@ -292,14 +293,14 @@ var En = /* @__PURE__ */ N({
|
|
|
292
293
|
"variant",
|
|
293
294
|
"onClick"
|
|
294
295
|
]))), 128)),
|
|
295
|
-
a.value ? (F(), O(R(
|
|
296
|
-
trigger: z(() => [M(R(
|
|
297
|
-
icon: R(
|
|
296
|
+
a.value ? (F(), O(R(Ht), { key: 0 }, {
|
|
297
|
+
trigger: z(() => [M(R(Xt), {
|
|
298
|
+
icon: R(he),
|
|
298
299
|
label: R(i).t("wise_invoicing.invoice.detail.header.actions_more"),
|
|
299
300
|
variant: "tertiary"
|
|
300
301
|
}, null, 8, ["icon", "label"])]),
|
|
301
|
-
content: z(() => [(F(!0), A(E, null,
|
|
302
|
-
default: z(() => [(F(!0), A(E, null,
|
|
302
|
+
content: z(() => [(F(!0), A(E, null, st(n.menuGroups, (e, t) => (F(), A(E, { key: e.key }, [t > 0 ? (F(), O(R(Gt), { key: 0 })) : k("", !0), M(R(Ut), null, {
|
|
303
|
+
default: z(() => [(F(!0), A(E, null, st(e.items, (e) => (F(), O(R(Wt), {
|
|
303
304
|
key: e.key,
|
|
304
305
|
config: o(e),
|
|
305
306
|
"disabled-reason": e.disabledReason,
|
|
@@ -319,7 +320,7 @@ var En = /* @__PURE__ */ N({
|
|
|
319
320
|
_: 1
|
|
320
321
|
}));
|
|
321
322
|
}
|
|
322
|
-
}),
|
|
323
|
+
}), Mn = /* @__PURE__ */ N({
|
|
323
324
|
__name: "BillingDocumentDetailRemarksSection",
|
|
324
325
|
props: {
|
|
325
326
|
title: {},
|
|
@@ -329,7 +330,7 @@ var En = /* @__PURE__ */ N({
|
|
|
329
330
|
},
|
|
330
331
|
setup(e) {
|
|
331
332
|
let t = e;
|
|
332
|
-
return (e, n) => (F(), O(R(
|
|
333
|
+
return (e, n) => (F(), O(R(jt), {
|
|
333
334
|
as: "section",
|
|
334
335
|
gap: "md",
|
|
335
336
|
class: "w-full"
|
|
@@ -340,10 +341,10 @@ var En = /* @__PURE__ */ N({
|
|
|
340
341
|
class: "text-sm font-semibold text-primary"
|
|
341
342
|
}, null, 8, ["text"]), t.isDisabled ? (F(), O(R(V), {
|
|
342
343
|
key: 0,
|
|
343
|
-
text: R(
|
|
344
|
+
text: R(ne).trimOrNull(t.remarksField.modelValue.value) ?? "-",
|
|
344
345
|
truncate: !1,
|
|
345
346
|
class: "w-full text-sm whitespace-pre-wrap text-secondary"
|
|
346
|
-
}, null, 8, ["text"])) : (F(), O(R(
|
|
347
|
+
}, null, 8, ["text"])) : (F(), O(R(ln), P({ key: 1 }, R(Pe)(t.remarksField), {
|
|
347
348
|
"is-disabled": t.isDisabled,
|
|
348
349
|
label: null,
|
|
349
350
|
placeholder: t.placeholder,
|
|
@@ -353,16 +354,16 @@ var En = /* @__PURE__ */ N({
|
|
|
353
354
|
_: 1
|
|
354
355
|
}));
|
|
355
356
|
}
|
|
356
|
-
}),
|
|
357
|
+
}), Nn = {
|
|
357
358
|
key: 0,
|
|
358
359
|
class: "flex flex-col divide-y divide-secondary py-xl"
|
|
359
|
-
},
|
|
360
|
+
}, Pn = {
|
|
360
361
|
key: 1,
|
|
361
362
|
class: "flex size-full items-center justify-center py-xl"
|
|
362
|
-
},
|
|
363
|
+
}, Fn = { class: "text-xs text-primary" }, In = ["title"], Ln = {
|
|
363
364
|
key: 0,
|
|
364
365
|
class: "border-t border-secondary px-xl py-lg"
|
|
365
|
-
},
|
|
366
|
+
}, Rn = /* @__PURE__ */ N({
|
|
366
367
|
__name: "BillingDocumentDetailSidebarActivityContent",
|
|
367
368
|
props: {
|
|
368
369
|
hasNextPage: { type: Boolean },
|
|
@@ -381,7 +382,7 @@ var En = /* @__PURE__ */ N({
|
|
|
381
382
|
l.INVOICE_SENT,
|
|
382
383
|
l.CREDIT_NOTE_CREATED,
|
|
383
384
|
l.CREDIT_NOTE_UPDATED
|
|
384
|
-
], r = T(), i =
|
|
385
|
+
], r = T(), i = Ae(), a = D(() => t.entries.filter(o));
|
|
385
386
|
function o(e) {
|
|
386
387
|
return n.includes(e.action);
|
|
387
388
|
}
|
|
@@ -437,11 +438,11 @@ var En = /* @__PURE__ */ N({
|
|
|
437
438
|
}
|
|
438
439
|
function _(e) {
|
|
439
440
|
switch (e.action) {
|
|
440
|
-
case l.INVOICE_FINALIZED: return
|
|
441
|
-
case l.INVOICE_SENT: return
|
|
441
|
+
case l.INVOICE_FINALIZED: return ie;
|
|
442
|
+
case l.INVOICE_SENT: return Te;
|
|
442
443
|
case l.INVOICE_UPDATED:
|
|
443
|
-
case l.CREDIT_NOTE_UPDATED: return
|
|
444
|
-
case l.CREDIT_NOTE_CREATED: return
|
|
444
|
+
case l.CREDIT_NOTE_UPDATED: return le;
|
|
445
|
+
case l.CREDIT_NOTE_CREATED: return ae;
|
|
445
446
|
case l.INVOICE_CREATED: return C;
|
|
446
447
|
}
|
|
447
448
|
}
|
|
@@ -458,12 +459,12 @@ var En = /* @__PURE__ */ N({
|
|
|
458
459
|
return `${y(e)} · ${v(e)}`;
|
|
459
460
|
}
|
|
460
461
|
let ee = I(null);
|
|
461
|
-
return
|
|
462
|
+
return xt(ee, async () => {
|
|
462
463
|
!t.hasNextPage || t.isFetchingNextPage || await t.fetchNextPage();
|
|
463
|
-
}, { distance: 250 }), (e, n) => t.isLoading ? (F(), A("div",
|
|
464
|
+
}, { distance: 250 }), (e, n) => t.isLoading ? (F(), A("div", Nn, [(F(), A(E, null, st(5, (e) => j("div", {
|
|
464
465
|
key: e,
|
|
465
466
|
class: "flex flex-col gap-xs px-xl py-lg"
|
|
466
|
-
}, [...n[0] ||= [j("div", { class: "h-4 w-2/3 animate-pulse rounded-sm bg-secondary" }, null, -1), j("div", { class: "h-3 w-1/3 animate-pulse rounded-sm bg-secondary" }, null, -1)]])), 64))])) : a.value.length === 0 ? (F(), A("div",
|
|
467
|
+
}, [...n[0] ||= [j("div", { class: "h-4 w-2/3 animate-pulse rounded-sm bg-secondary" }, null, -1), j("div", { class: "h-3 w-1/3 animate-pulse rounded-sm bg-secondary" }, null, -1)]])), 64))])) : a.value.length === 0 ? (F(), A("div", Pn, [M(R(Kt), {
|
|
467
468
|
description: t.emptyMessage,
|
|
468
469
|
title: R(r).t("wise_invoicing.invoice.detail.sub_tabs.activity")
|
|
469
470
|
}, null, 8, ["description", "title"])])) : (F(), A("div", {
|
|
@@ -471,35 +472,35 @@ var En = /* @__PURE__ */ N({
|
|
|
471
472
|
ref_key: "scrollContainerRef",
|
|
472
473
|
ref: ee,
|
|
473
474
|
class: "h-full overflow-y-auto"
|
|
474
|
-
}, [M(R(
|
|
475
|
+
}, [M(R(dn), {
|
|
475
476
|
size: "md",
|
|
476
477
|
class: "p-xl"
|
|
477
478
|
}, {
|
|
478
|
-
default: z(() => [(F(!0), A(E, null,
|
|
479
|
+
default: z(() => [(F(!0), A(E, null, st(a.value, (e, t) => (F(), O(R(fn), {
|
|
479
480
|
key: t,
|
|
480
481
|
icon: _(e),
|
|
481
482
|
"is-last": t === a.value.length - 1
|
|
482
483
|
}, {
|
|
483
|
-
default: z(() => [j("p",
|
|
484
|
+
default: z(() => [j("p", Fn, [(F(!0), A(E, null, st(g(e), (e, t) => (F(), A(E, { key: `${t}-${e.text}` }, [e.to === void 0 ? (F(), A("span", {
|
|
484
485
|
key: 1,
|
|
485
|
-
class:
|
|
486
|
-
}, L(e.text), 3)) : (F(), O(R(
|
|
486
|
+
class: $e({ "font-semibold": e.variant === "emphasis" })
|
|
487
|
+
}, L(e.text), 3)) : (F(), O(R(Ve), {
|
|
487
488
|
key: 0,
|
|
488
489
|
to: e.to,
|
|
489
490
|
class: "font-semibold underline underline-offset-2 transition-colors hover:text-brand-700 focus-visible:text-brand-700 focus-visible:outline-none"
|
|
490
491
|
}, {
|
|
491
|
-
default: z(() => [
|
|
492
|
+
default: z(() => [Ge(L(e.text), 1)]),
|
|
492
493
|
_: 2
|
|
493
494
|
}, 1032, ["to"]))], 64))), 128))]), j("p", {
|
|
494
495
|
title: b(e),
|
|
495
496
|
class: "truncate text-xs text-tertiary"
|
|
496
|
-
}, L(x(e)), 9,
|
|
497
|
+
}, L(x(e)), 9, In)]),
|
|
497
498
|
_: 2
|
|
498
499
|
}, 1032, ["icon", "is-last"]))), 128))]),
|
|
499
500
|
_: 1
|
|
500
|
-
}), t.isFetchingNextPage ? (F(), A("div",
|
|
501
|
+
}), t.isFetchingNextPage ? (F(), A("div", Ln, [...n[1] ||= [j("div", { class: "h-4 w-full animate-pulse rounded-sm bg-secondary" }, null, -1)]])) : k("", !0)], 512));
|
|
501
502
|
}
|
|
502
|
-
}),
|
|
503
|
+
}), zn = /* @__PURE__ */ N({
|
|
503
504
|
__name: "CustomFieldList",
|
|
504
505
|
props: {
|
|
505
506
|
definitions: {},
|
|
@@ -511,16 +512,16 @@ var En = /* @__PURE__ */ N({
|
|
|
511
512
|
let r = t.definitions.find((t) => t.uuid === e.definitionUuid);
|
|
512
513
|
return {
|
|
513
514
|
definition: r,
|
|
514
|
-
label: r === void 0 ? e.definitionUuid :
|
|
515
|
+
label: r === void 0 ? e.definitionUuid : je.getLabel(r, n.locale.value),
|
|
515
516
|
value: e
|
|
516
517
|
};
|
|
517
518
|
}));
|
|
518
|
-
return (e, n) => r.value.length > 0 ? (F(), O(
|
|
519
|
+
return (e, n) => r.value.length > 0 ? (F(), O(lt(t.layout === "row" ? R(B) : R(jt)), {
|
|
519
520
|
key: 0,
|
|
520
521
|
align: t.layout === "row" ? "center" : void 0,
|
|
521
522
|
gap: t.layout === "row" ? "md" : "xs"
|
|
522
523
|
}, {
|
|
523
|
-
default: z(() => [(F(!0), A(E, null,
|
|
524
|
+
default: z(() => [(F(!0), A(E, null, st(r.value, (e) => (F(), O(R(B), {
|
|
524
525
|
key: e.value.definitionUuid,
|
|
525
526
|
align: "start",
|
|
526
527
|
gap: "xs",
|
|
@@ -529,7 +530,7 @@ var En = /* @__PURE__ */ N({
|
|
|
529
530
|
default: z(() => [M(R(V), {
|
|
530
531
|
text: `${e.label}:`,
|
|
531
532
|
class: "shrink-0 text-xs font-medium text-secondary"
|
|
532
|
-
}, null, 8, ["text"]), M(
|
|
533
|
+
}, null, 8, ["text"]), M(Me, {
|
|
533
534
|
definition: e.definition,
|
|
534
535
|
value: e.value
|
|
535
536
|
}, null, 8, ["definition", "value"])]),
|
|
@@ -538,13 +539,13 @@ var En = /* @__PURE__ */ N({
|
|
|
538
539
|
_: 1
|
|
539
540
|
}, 8, ["align", "gap"])) : k("", !0);
|
|
540
541
|
}
|
|
541
|
-
}),
|
|
542
|
+
}), Bn = /* @__PURE__ */ N({
|
|
542
543
|
__name: "BillingDocumentDetailSidebarOriginalInvoiceSection",
|
|
543
544
|
props: { originalInvoice: {} },
|
|
544
545
|
setup(e) {
|
|
545
546
|
let t = e, n = T(), r = _(), i = D(() => {
|
|
546
547
|
if (t.originalInvoice === null) return null;
|
|
547
|
-
let e = new
|
|
548
|
+
let e = new Sn(t.originalInvoice.status);
|
|
548
549
|
return {
|
|
549
550
|
uuid: t.originalInvoice.uuid,
|
|
550
551
|
amountLabel: r.formatMonetary(t.originalInvoice.grossAmount),
|
|
@@ -553,7 +554,7 @@ var En = /* @__PURE__ */ N({
|
|
|
553
554
|
statusLabel: n.t(e.translationKey)
|
|
554
555
|
};
|
|
555
556
|
});
|
|
556
|
-
return (e, t) => i.value ? (F(), O(R(
|
|
557
|
+
return (e, t) => i.value ? (F(), O(R(It), {
|
|
557
558
|
key: 0,
|
|
558
559
|
"collapse-options": {
|
|
559
560
|
isCollapsible: !0,
|
|
@@ -567,7 +568,7 @@ var En = /* @__PURE__ */ N({
|
|
|
567
568
|
},
|
|
568
569
|
label: R(n).t("wise_invoicing.invoice.detail.parent_invoice.title")
|
|
569
570
|
}, {
|
|
570
|
-
default: z(() => [M(R(
|
|
571
|
+
default: z(() => [M(R(Ve), {
|
|
571
572
|
to: {
|
|
572
573
|
name: "invoicing-invoice-detail",
|
|
573
574
|
params: { invoiceUuid: i.value.uuid }
|
|
@@ -589,10 +590,10 @@ var En = /* @__PURE__ */ N({
|
|
|
589
590
|
}, null, 8, ["text"]))]),
|
|
590
591
|
_: 1
|
|
591
592
|
}),
|
|
592
|
-
M(R(
|
|
593
|
+
M(R(Dt), {
|
|
593
594
|
label: i.value.statusLabel,
|
|
594
595
|
color: i.value.statusColor,
|
|
595
|
-
icon: R(
|
|
596
|
+
icon: R(xe),
|
|
596
597
|
size: "sm",
|
|
597
598
|
variant: "translucent"
|
|
598
599
|
}, null, 8, [
|
|
@@ -600,7 +601,7 @@ var En = /* @__PURE__ */ N({
|
|
|
600
601
|
"color",
|
|
601
602
|
"icon"
|
|
602
603
|
]),
|
|
603
|
-
M(R(
|
|
604
|
+
M(R(Dt), {
|
|
604
605
|
label: i.value.amountLabel,
|
|
605
606
|
color: "gray",
|
|
606
607
|
size: "sm",
|
|
@@ -612,11 +613,11 @@ var En = /* @__PURE__ */ N({
|
|
|
612
613
|
_: 1
|
|
613
614
|
}, 8, ["collapse-options", "label"])) : k("", !0);
|
|
614
615
|
}
|
|
615
|
-
}),
|
|
616
|
+
}), Vn = { class: "flex size-full items-center justify-center" }, Hn = /* @__PURE__ */ N({
|
|
616
617
|
__name: "BillingDocumentDetailSidebarActivityTab",
|
|
617
618
|
setup(e) {
|
|
618
619
|
let t = T();
|
|
619
|
-
return (e, n) => (F(), A("div",
|
|
620
|
+
return (e, n) => (F(), A("div", Vn, [M(R(Kt), {
|
|
620
621
|
title: R(t).t("wise_invoicing.invoice.detail.sub_tabs.activity"),
|
|
621
622
|
description: R(t).t("wise_invoicing.invoice.detail.sidebar.activity_empty")
|
|
622
623
|
}, null, 8, ["title", "description"])]));
|
|
@@ -624,40 +625,40 @@ var En = /* @__PURE__ */ N({
|
|
|
624
625
|
});
|
|
625
626
|
//#endregion
|
|
626
627
|
//#region src/modules/invoice/api/mutations/invoiceUpdateAttachments.mutation.ts
|
|
627
|
-
function
|
|
628
|
-
return
|
|
628
|
+
function Un() {
|
|
629
|
+
return yt({
|
|
629
630
|
queryFn: (e) => b.updateAttachments(e.params.invoiceUuid, e.body),
|
|
630
631
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
631
632
|
});
|
|
632
633
|
}
|
|
633
634
|
//#endregion
|
|
634
635
|
//#region src/models/file-reference/fileReferenceForm.model.ts
|
|
635
|
-
var
|
|
636
|
+
var Wn = w.object({
|
|
636
637
|
uuid: w.string(),
|
|
637
638
|
name: w.string(),
|
|
638
639
|
blurHash: w.string().nullable(),
|
|
639
640
|
mimeType: w.string(),
|
|
640
641
|
order: w.number(),
|
|
641
642
|
url: w.string().nullable()
|
|
642
|
-
}),
|
|
643
|
+
}), Gn = w.object({ attachments: Wn.array() }), Kn = {
|
|
643
644
|
confirmUpload: async (e, t) => {
|
|
644
|
-
let n = await
|
|
645
|
+
let n = await wn.confirmUpload(e, t);
|
|
645
646
|
if (n.isErr()) throw n.error;
|
|
646
647
|
},
|
|
647
648
|
getFileInfo: async (e, t) => {
|
|
648
|
-
let n = await
|
|
649
|
+
let n = await wn.getFileInfo(e, t);
|
|
649
650
|
if (n.isErr()) throw n.error;
|
|
650
651
|
return n.value;
|
|
651
652
|
}
|
|
652
|
-
},
|
|
653
|
+
}, qn = /* @__PURE__ */ N({
|
|
653
654
|
__name: "InvoicingFileUploadProvider",
|
|
654
655
|
setup(e) {
|
|
655
|
-
let t =
|
|
656
|
-
return (e, n) => (F(), O(R(
|
|
656
|
+
let t = gn();
|
|
657
|
+
return (e, n) => (F(), O(R(Mt), {
|
|
657
658
|
"address-autocomplete-adapter": R(t).addressAutocompleteAdapter.value,
|
|
658
659
|
"auto-close-toast": R(t).autoCloseToast.value,
|
|
659
660
|
"date-locale": R(t).dateLocale.value,
|
|
660
|
-
"file-upload-adapter": R(
|
|
661
|
+
"file-upload-adapter": R(Kn),
|
|
661
662
|
"google-maps-api-key": R(t).googleMapsApiKey.value,
|
|
662
663
|
"hour-cycle": R(t).hourCycle.value,
|
|
663
664
|
locale: R(t).locale.value,
|
|
@@ -666,7 +667,7 @@ var Un = w.object({
|
|
|
666
667
|
"reduced-motion": R(t).reducedMotion.value,
|
|
667
668
|
"show-navigation-arrows-in-top-bar": R(t).showNavigationArrowsInTopBar.value
|
|
668
669
|
}, {
|
|
669
|
-
default: z(() => [
|
|
670
|
+
default: z(() => [ct(e.$slots, "default")]),
|
|
670
671
|
_: 3
|
|
671
672
|
}, 8, [
|
|
672
673
|
"address-autocomplete-adapter",
|
|
@@ -682,13 +683,13 @@ var Un = w.object({
|
|
|
682
683
|
"show-navigation-arrows-in-top-bar"
|
|
683
684
|
]));
|
|
684
685
|
}
|
|
685
|
-
}),
|
|
686
|
+
}), Jn = 26214400, Yn = /* @__PURE__ */ N({
|
|
686
687
|
__name: "BillingDocumentDetailSidebarAttachmentsTab",
|
|
687
688
|
props: { billingDocument: {} },
|
|
688
689
|
setup(e) {
|
|
689
|
-
let t = e, n = T(), r =
|
|
690
|
+
let t = e, n = T(), r = vn(), i = Un(), a = yn({
|
|
690
691
|
initialState: D(() => y.toForm(t.billingDocument.attachments)),
|
|
691
|
-
schema:
|
|
692
|
+
schema: Gn,
|
|
692
693
|
onSubmit: async (e) => {
|
|
693
694
|
let n = await i.execute({
|
|
694
695
|
body: e,
|
|
@@ -698,23 +699,23 @@ var Un = w.object({
|
|
|
698
699
|
}
|
|
699
700
|
}), o = a.register("attachments");
|
|
700
701
|
function s(e) {
|
|
701
|
-
return e.size >
|
|
702
|
+
return e.size > Jn ? n.t("wise_invoicing.invoice.detail.sidebar.attachments_too_large") : !0;
|
|
702
703
|
}
|
|
703
|
-
return
|
|
704
|
+
return xn({ form: a }), (e, t) => (F(), O(R(qt), {
|
|
704
705
|
form: R(a),
|
|
705
706
|
"prompt-on-unsaved-changes": !1
|
|
706
707
|
}, {
|
|
707
|
-
default: z(() => [M(R(
|
|
708
|
+
default: z(() => [M(R(jt), {
|
|
708
709
|
gap: "md",
|
|
709
710
|
class: "px-2xl py-xl"
|
|
710
711
|
}, {
|
|
711
|
-
default: z(() => [M(
|
|
712
|
-
default: z(() => [M(R(
|
|
712
|
+
default: z(() => [M(qn, null, {
|
|
713
|
+
default: z(() => [M(R(Yt), P(R(Pe)(R(o)), {
|
|
713
714
|
accept: ["*/*"],
|
|
714
715
|
description: R(n).t("wise_invoicing.invoice.detail.sidebar.attachments_upload_description"),
|
|
715
716
|
hint: R(n).t("wise_invoicing.invoice.detail.sidebar.attachments_upload_hint"),
|
|
716
717
|
"is-valid-file": s,
|
|
717
|
-
preprocess: R(
|
|
718
|
+
preprocess: R(wn).preprocess,
|
|
718
719
|
class: "w-full"
|
|
719
720
|
}), null, 16, [
|
|
720
721
|
"description",
|
|
@@ -728,15 +729,15 @@ var Un = w.object({
|
|
|
728
729
|
_: 1
|
|
729
730
|
}, 8, ["form"]));
|
|
730
731
|
}
|
|
731
|
-
}),
|
|
732
|
+
}), Xn = { class: "w-full" }, Zn = { class: "px-lg pt-md" }, Qn = /* @__PURE__ */ N({
|
|
732
733
|
__name: "BillingDocumentDetailSidebarHeader",
|
|
733
|
-
props: /*@__PURE__*/
|
|
734
|
+
props: /*@__PURE__*/ Ze({ attachmentsCount: {} }, {
|
|
734
735
|
modelValue: { required: !0 },
|
|
735
736
|
modelModifiers: {}
|
|
736
737
|
}),
|
|
737
738
|
emits: ["update:modelValue"],
|
|
738
739
|
setup(e) {
|
|
739
|
-
let t = e, n =
|
|
740
|
+
let t = e, n = ft(e, "modelValue"), r = T(), i = D(() => [
|
|
740
741
|
{
|
|
741
742
|
key: "info",
|
|
742
743
|
label: r.t("wise_invoicing.invoice.detail.sub_tabs.details")
|
|
@@ -751,18 +752,18 @@ var Un = w.object({
|
|
|
751
752
|
label: r.t("wise_invoicing.invoice.detail.sub_tabs.activity")
|
|
752
753
|
}
|
|
753
754
|
]);
|
|
754
|
-
return (e, t) => (F(), A("div",
|
|
755
|
+
return (e, t) => (F(), A("div", Xn, [j("div", Zn, [M(R(V), {
|
|
755
756
|
text: R(r).t("wise_invoicing.invoice.detail.sidebar.details"),
|
|
756
757
|
class: "text-sm font-semibold text-primary"
|
|
757
|
-
}, null, 8, ["text"])]), M(R(
|
|
758
|
+
}, null, 8, ["text"])]), M(R(rn), {
|
|
758
759
|
modelValue: n.value,
|
|
759
760
|
"onUpdate:modelValue": t[0] ||= (e) => n.value = e,
|
|
760
761
|
"is-full-width": !0,
|
|
761
762
|
"underline-tabs-horizontal-list-padding": "lg",
|
|
762
763
|
variant: "underline"
|
|
763
764
|
}, {
|
|
764
|
-
default: z(() => [M(R(
|
|
765
|
-
default: z(() => [(F(!0), A(E, null,
|
|
765
|
+
default: z(() => [M(R(on), null, {
|
|
766
|
+
default: z(() => [(F(!0), A(E, null, st(i.value, (e) => (F(), O(R(an), {
|
|
766
767
|
key: e.key,
|
|
767
768
|
value: e.key,
|
|
768
769
|
label: e.label,
|
|
@@ -778,17 +779,17 @@ var Un = w.object({
|
|
|
778
779
|
_: 1
|
|
779
780
|
}, 8, ["modelValue"])]));
|
|
780
781
|
}
|
|
781
|
-
}),
|
|
782
|
+
}), $n = { class: "flex size-full min-h-0 flex-col overflow-hidden" }, er = { class: "mt-auto px-3xl py-xl" }, tr = /* @__PURE__ */ N({
|
|
782
783
|
__name: "BillingDocumentDetailSidebarLayout",
|
|
783
784
|
props: { updatedFooter: {} },
|
|
784
785
|
setup(e) {
|
|
785
786
|
let t = e;
|
|
786
|
-
return (e, n) => (F(), A("aside",
|
|
787
|
+
return (e, n) => (F(), A("aside", $n, [ct(e.$slots, "default"), j("div", er, [M(R(V), {
|
|
787
788
|
text: t.updatedFooter,
|
|
788
789
|
class: "text-right text-xs text-tertiary"
|
|
789
790
|
}, null, 8, ["text"])])]));
|
|
790
791
|
}
|
|
791
|
-
}),
|
|
792
|
+
}), nr = { class: "flex-1 overflow-y-auto" }, rr = /* @__PURE__ */ N({
|
|
792
793
|
__name: "BillingDocumentDetailSidebar",
|
|
793
794
|
props: {
|
|
794
795
|
billingDocument: {},
|
|
@@ -796,28 +797,28 @@ var Un = w.object({
|
|
|
796
797
|
},
|
|
797
798
|
setup(e) {
|
|
798
799
|
let t = e, n = I("info");
|
|
799
|
-
return (e, r) => (F(), O(
|
|
800
|
-
default: z(() => [M(
|
|
800
|
+
return (e, r) => (F(), O(tr, { "updated-footer": t.updatedFooter }, {
|
|
801
|
+
default: z(() => [M(Qn, {
|
|
801
802
|
modelValue: n.value,
|
|
802
803
|
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
803
804
|
"attachments-count": t.billingDocument.attachments.length
|
|
804
|
-
}, null, 8, ["modelValue", "attachments-count"]), j("div",
|
|
805
|
+
}, null, 8, ["modelValue", "attachments-count"]), j("div", nr, [n.value === "info" ? ct(e.$slots, "info", {}, void 0, void 0, 0) : n.value === "attachments" ? (F(), O(Yn, {
|
|
805
806
|
key: 1,
|
|
806
807
|
"billing-document": t.billingDocument
|
|
807
|
-
}, null, 8, ["billing-document"])) :
|
|
808
|
+
}, null, 8, ["billing-document"])) : ct(e.$slots, "activity", {}, () => [M(Hn)], void 0, 2)])]),
|
|
808
809
|
_: 3
|
|
809
810
|
}, 8, ["updated-footer"]));
|
|
810
811
|
}
|
|
811
812
|
});
|
|
812
813
|
//#endregion
|
|
813
814
|
//#region src/utils/context.util.ts
|
|
814
|
-
function
|
|
815
|
+
function ir(e) {
|
|
815
816
|
let t = Symbol(e);
|
|
816
817
|
function n(e) {
|
|
817
|
-
return
|
|
818
|
+
return at(t, e), e;
|
|
818
819
|
}
|
|
819
820
|
function r(n) {
|
|
820
|
-
let r =
|
|
821
|
+
let r = Ye(t, n ?? void 0);
|
|
821
822
|
if (r === void 0 && n === void 0) throw Error(`${e} context is not provided.`);
|
|
822
823
|
return r ?? null;
|
|
823
824
|
}
|
|
@@ -825,12 +826,12 @@ function rr(e) {
|
|
|
825
826
|
}
|
|
826
827
|
//#endregion
|
|
827
828
|
//#region src/ui/billing-document/table/billingDocumentLineItemsTable.context.ts
|
|
828
|
-
var [
|
|
829
|
+
var [ar, or] = ir("BillingDocumentLineItemsTable"), sr = [
|
|
829
830
|
i._0,
|
|
830
831
|
i._6,
|
|
831
832
|
i._12,
|
|
832
833
|
i._21
|
|
833
|
-
],
|
|
834
|
+
], cr = [
|
|
834
835
|
a.PIECE,
|
|
835
836
|
a.HOUR,
|
|
836
837
|
a.DAY,
|
|
@@ -1205,16 +1206,16 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1205
1206
|
let t = e.trim();
|
|
1206
1207
|
return t === "" ? null : t;
|
|
1207
1208
|
}
|
|
1208
|
-
},
|
|
1209
|
+
}, lr = {
|
|
1209
1210
|
key: 0,
|
|
1210
1211
|
class: "pointer-events-none absolute inset-x-0 bottom-4 z-20 flex justify-center px-md"
|
|
1211
|
-
},
|
|
1212
|
+
}, ur = { class: "pointer-events-auto flex max-w-full items-center gap-xs overflow-x-auto rounded-xl border border-secondary bg-primary p-xs shadow-lg" }, dr = {
|
|
1212
1213
|
"aria-live": "polite",
|
|
1213
1214
|
class: "px-sm text-sm font-medium whitespace-nowrap text-secondary"
|
|
1214
|
-
},
|
|
1215
|
+
}, fr = { class: "w-40 py-xxs" }, pr = ["onClick"], mr = { class: "max-h-64 w-44 overflow-y-auto py-xxs" }, hr = ["onClick"], gr = { class: "max-h-64 w-56 overflow-y-auto py-xxs" }, _r = ["onClick"], vr = /* @__PURE__ */ N({
|
|
1215
1216
|
__name: "BillingDocumentLineItemsBulkActionBar",
|
|
1216
1217
|
setup(e) {
|
|
1217
|
-
let t = T(), n =
|
|
1218
|
+
let t = T(), n = or(), r = I(!1), i = I(!1), a = I(!1), o = D(() => n.rows.value.filter(H.isGroupRow));
|
|
1218
1219
|
function s(e) {
|
|
1219
1220
|
return t.t(`wise_invoicing.invoice.detail.line_items.units.${e}`);
|
|
1220
1221
|
}
|
|
@@ -1230,34 +1231,34 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1230
1231
|
function d(e) {
|
|
1231
1232
|
a.value = !1, n.mutations.moveSelectedLinesToGroup(e);
|
|
1232
1233
|
}
|
|
1233
|
-
return (e, f) => R(n).isEditable.value && R(n).selection.selectedCount.value > 0 ? (F(), A("div",
|
|
1234
|
-
j("span",
|
|
1234
|
+
return (e, f) => R(n).isEditable.value && R(n).selection.selectedCount.value > 0 ? (F(), A("div", lr, [j("div", ur, [
|
|
1235
|
+
j("span", dr, L(R(t).t("wise_invoicing.invoice.detail.line_items.items_selected", { count: R(n).selection.selectedCount.value })), 1),
|
|
1235
1236
|
f[7] ||= j("span", { class: "mx-xxs h-5 w-px bg-secondary" }, null, -1),
|
|
1236
|
-
M(R(
|
|
1237
|
+
M(R(Ot), {
|
|
1237
1238
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.bulk_group"),
|
|
1238
|
-
"icon-left": R(
|
|
1239
|
+
"icon-left": R(ke),
|
|
1239
1240
|
size: "sm",
|
|
1240
1241
|
variant: "tertiary",
|
|
1241
1242
|
onClick: f[0] ||= (e) => R(n).mutations.groupSelectedLines()
|
|
1242
1243
|
}, null, 8, ["label", "icon-left"]),
|
|
1243
|
-
M(R(
|
|
1244
|
+
M(R(Ot), {
|
|
1244
1245
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.bulk_duplicate"),
|
|
1245
|
-
"icon-left": R(
|
|
1246
|
+
"icon-left": R(ge),
|
|
1246
1247
|
size: "sm",
|
|
1247
1248
|
variant: "tertiary",
|
|
1248
1249
|
onClick: f[1] ||= (e) => R(n).mutations.duplicateSelectedLines()
|
|
1249
1250
|
}, null, 8, ["label", "icon-left"]),
|
|
1250
|
-
M(R(
|
|
1251
|
+
M(R(Qt), {
|
|
1251
1252
|
"is-open": r.value,
|
|
1252
1253
|
"onUpdate:isOpen": f[2] ||= (e) => r.value = e,
|
|
1253
1254
|
"popover-side-offset": 6,
|
|
1254
1255
|
"popover-align": "center",
|
|
1255
1256
|
"popover-side": "top"
|
|
1256
1257
|
}, {
|
|
1257
|
-
trigger: z(() => [M(R(
|
|
1258
|
+
trigger: z(() => [M(R(Ot), {
|
|
1258
1259
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.bulk_set_vat"),
|
|
1259
|
-
"icon-left": R(
|
|
1260
|
-
"icon-right": R(
|
|
1260
|
+
"icon-left": R(Ee),
|
|
1261
|
+
"icon-right": R(de),
|
|
1261
1262
|
size: "sm",
|
|
1262
1263
|
variant: "tertiary"
|
|
1263
1264
|
}, null, 8, [
|
|
@@ -1265,25 +1266,25 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1265
1266
|
"icon-left",
|
|
1266
1267
|
"icon-right"
|
|
1267
1268
|
])]),
|
|
1268
|
-
content: z(() => [j("div",
|
|
1269
|
+
content: z(() => [j("div", fr, [(F(!0), A(E, null, st(R(sr), (e) => (F(), A("button", {
|
|
1269
1270
|
key: e,
|
|
1270
1271
|
class: "flex w-full items-center px-md py-sm text-left text-sm text-primary transition-colors hover:bg-secondary",
|
|
1271
1272
|
type: "button",
|
|
1272
1273
|
onClick: (t) => l(e)
|
|
1273
|
-
}, L(Number(e)) + "% ", 9,
|
|
1274
|
+
}, L(Number(e)) + "% ", 9, pr))), 128))])]),
|
|
1274
1275
|
_: 1
|
|
1275
1276
|
}, 8, ["is-open"]),
|
|
1276
|
-
M(R(
|
|
1277
|
+
M(R(Qt), {
|
|
1277
1278
|
"is-open": i.value,
|
|
1278
1279
|
"onUpdate:isOpen": f[3] ||= (e) => i.value = e,
|
|
1279
1280
|
"popover-side-offset": 6,
|
|
1280
1281
|
"popover-align": "center",
|
|
1281
1282
|
"popover-side": "top"
|
|
1282
1283
|
}, {
|
|
1283
|
-
trigger: z(() => [M(R(
|
|
1284
|
+
trigger: z(() => [M(R(Ot), {
|
|
1284
1285
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.bulk_set_unit"),
|
|
1285
|
-
"icon-left": R(
|
|
1286
|
-
"icon-right": R(
|
|
1286
|
+
"icon-left": R(ve),
|
|
1287
|
+
"icon-right": R(de),
|
|
1287
1288
|
size: "sm",
|
|
1288
1289
|
variant: "tertiary"
|
|
1289
1290
|
}, null, 8, [
|
|
@@ -1291,15 +1292,15 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1291
1292
|
"icon-left",
|
|
1292
1293
|
"icon-right"
|
|
1293
1294
|
])]),
|
|
1294
|
-
content: z(() => [j("div",
|
|
1295
|
+
content: z(() => [j("div", mr, [(F(!0), A(E, null, st(R(cr), (e) => (F(), A("button", {
|
|
1295
1296
|
key: e,
|
|
1296
1297
|
class: "flex w-full items-center px-md py-sm text-left text-sm text-primary transition-colors hover:bg-secondary",
|
|
1297
1298
|
type: "button",
|
|
1298
1299
|
onClick: (t) => u(e)
|
|
1299
|
-
}, L(s(e)), 9,
|
|
1300
|
+
}, L(s(e)), 9, hr))), 128))])]),
|
|
1300
1301
|
_: 1
|
|
1301
1302
|
}, 8, ["is-open"]),
|
|
1302
|
-
o.value.length > 0 ? (F(), O(R(
|
|
1303
|
+
o.value.length > 0 ? (F(), O(R(Qt), {
|
|
1303
1304
|
key: 0,
|
|
1304
1305
|
"is-open": a.value,
|
|
1305
1306
|
"onUpdate:isOpen": f[4] ||= (e) => a.value = e,
|
|
@@ -1307,10 +1308,10 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1307
1308
|
"popover-align": "center",
|
|
1308
1309
|
"popover-side": "top"
|
|
1309
1310
|
}, {
|
|
1310
|
-
trigger: z(() => [M(R(
|
|
1311
|
+
trigger: z(() => [M(R(Ot), {
|
|
1311
1312
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.bulk_move_to_group"),
|
|
1312
|
-
"icon-left": R(
|
|
1313
|
-
"icon-right": R(
|
|
1313
|
+
"icon-left": R(ce),
|
|
1314
|
+
"icon-right": R(de),
|
|
1314
1315
|
size: "sm",
|
|
1315
1316
|
variant: "tertiary"
|
|
1316
1317
|
}, null, 8, [
|
|
@@ -1318,24 +1319,24 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1318
1319
|
"icon-left",
|
|
1319
1320
|
"icon-right"
|
|
1320
1321
|
])]),
|
|
1321
|
-
content: z(() => [j("div",
|
|
1322
|
+
content: z(() => [j("div", gr, [(F(!0), A(E, null, st(o.value, (e) => (F(), A("button", {
|
|
1322
1323
|
key: e.id,
|
|
1323
1324
|
class: "flex w-full items-center truncate px-md py-sm text-left text-sm text-primary transition-colors hover:bg-secondary",
|
|
1324
1325
|
type: "button",
|
|
1325
1326
|
onClick: (t) => d(e.id)
|
|
1326
|
-
}, L(c(e)), 9,
|
|
1327
|
+
}, L(c(e)), 9, _r))), 128))])]),
|
|
1327
1328
|
_: 1
|
|
1328
1329
|
}, 8, ["is-open"])) : k("", !0),
|
|
1329
1330
|
f[8] ||= j("span", { class: "mx-xxs h-5 w-px bg-secondary" }, null, -1),
|
|
1330
|
-
M(R(
|
|
1331
|
-
icon: R(
|
|
1331
|
+
M(R(Xt), {
|
|
1332
|
+
icon: R(me),
|
|
1332
1333
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.delete_all"),
|
|
1333
1334
|
size: "sm",
|
|
1334
1335
|
variant: "destructive-tertiary",
|
|
1335
1336
|
onClick: f[5] ||= (e) => R(n).mutations.deleteSelectedLines()
|
|
1336
1337
|
}, null, 8, ["icon", "label"]),
|
|
1337
|
-
M(R(
|
|
1338
|
-
icon: R(
|
|
1338
|
+
M(R(Xt), {
|
|
1339
|
+
icon: R(ue),
|
|
1339
1340
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.bulk_clear"),
|
|
1340
1341
|
size: "sm",
|
|
1341
1342
|
variant: "tertiary",
|
|
@@ -1343,7 +1344,7 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1343
1344
|
}, null, 8, ["icon", "label"])
|
|
1344
1345
|
])])) : k("", !0);
|
|
1345
1346
|
}
|
|
1346
|
-
}),
|
|
1347
|
+
}), yr = class {
|
|
1347
1348
|
static getDisplayGrossLineTotal(e, t, n) {
|
|
1348
1349
|
return e === s.CREDIT_NOTE && n ? Math.abs(t) : this.getDisplayNumber(e, t);
|
|
1349
1350
|
}
|
|
@@ -1356,7 +1357,7 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1356
1357
|
static getDisplayNumber(e, t) {
|
|
1357
1358
|
return e !== s.CREDIT_NOTE || t <= 0 ? t : -t;
|
|
1358
1359
|
}
|
|
1359
|
-
},
|
|
1360
|
+
}, br = ["aria-label"], xr = { class: "w-72 py-xxs" }, Sr = { class: "text-sm font-semibold text-primary" }, Cr = { class: "text-xs text-tertiary" }, wr = { class: "text-sm font-semibold text-primary" }, Tr = { class: "text-xs text-tertiary" }, Er = /* @__PURE__ */ N({
|
|
1360
1361
|
__name: "BillingDocumentLineItemsInsertIndicator",
|
|
1361
1362
|
props: {
|
|
1362
1363
|
canAddGroup: {
|
|
@@ -1368,20 +1369,20 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1368
1369
|
},
|
|
1369
1370
|
emits: ["addGroup", "addLine"],
|
|
1370
1371
|
setup(e, { emit: t }) {
|
|
1371
|
-
let n = e, r = t, i = T(), a = I(!1), o =
|
|
1372
|
+
let n = e, r = t, i = T(), a = I(!1), o = pt("popoverAnchorRef"), s = D(() => n.placement === "end");
|
|
1372
1373
|
function c() {
|
|
1373
1374
|
a.value = !1, r("addLine");
|
|
1374
1375
|
}
|
|
1375
1376
|
function l() {
|
|
1376
1377
|
a.value = !1, r("addGroup");
|
|
1377
1378
|
}
|
|
1378
|
-
return (e, t) => (F(), A("div", { class:
|
|
1379
|
-
j("div", { class:
|
|
1379
|
+
return (e, t) => (F(), A("div", { class: $e([[s.value ? "top-0" : "top-0 -translate-y-1/2"], "group pointer-events-none absolute inset-x-0 z-20 h-5 w-full overflow-visible"]) }, [
|
|
1380
|
+
j("div", { class: $e([[s.value ? "top-0 -translate-y-1/2" : "top-1/2 -translate-y-1/2"], "absolute inset-x-0 h-3"]) }, null, 2),
|
|
1380
1381
|
j("div", {
|
|
1381
|
-
class:
|
|
1382
|
-
style:
|
|
1382
|
+
class: $e([[s.value ? "top-0 -translate-y-1/2" : "top-1/2 -translate-y-1/2"], "absolute inset-x-0 z-30 h-px w-full bg-brand-500 opacity-0 transition-opacity group-hover:opacity-100 group-has-focus-visible:opacity-100"]),
|
|
1383
|
+
style: tt(a.value ? { opacity: 1 } : void 0)
|
|
1383
1384
|
}, null, 6),
|
|
1384
|
-
j("div", { class:
|
|
1385
|
+
j("div", { class: $e([[s.value ? "top-0 -translate-y-1/2" : "top-1/2 -translate-y-1/2"], "pointer-events-auto absolute inset-x-0 z-40 px-md"]) }, [M(R(Qt), {
|
|
1385
1386
|
"is-open": a.value,
|
|
1386
1387
|
"onUpdate:isOpen": t[0] ||= (e) => a.value = e,
|
|
1387
1388
|
"popover-anchor-reference-element": o.value,
|
|
@@ -1396,22 +1397,22 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1396
1397
|
}, [j("span", {
|
|
1397
1398
|
ref_key: "popoverAnchorRef",
|
|
1398
1399
|
ref: o,
|
|
1399
|
-
class:
|
|
1400
|
-
}, [M(R(C), { class: "size-3" })], 2)], 8,
|
|
1401
|
-
content: z(() => [j("div",
|
|
1400
|
+
class: $e([a.value ? "opacity-100" : void 0, "flex size-5 items-center justify-center rounded-sm bg-brand-500 text-white opacity-0 shadow-sm transition-all group-hover:opacity-100 group-hover/trigger:bg-brand-700 group-focus-visible/trigger:opacity-100 group-has-focus-visible:opacity-100"])
|
|
1401
|
+
}, [M(R(C), { class: "size-3" })], 2)], 8, br)]),
|
|
1402
|
+
content: z(() => [j("div", xr, [j("button", {
|
|
1402
1403
|
class: "flex w-full items-center gap-md px-md py-sm text-left transition-colors hover:bg-secondary",
|
|
1403
1404
|
type: "button",
|
|
1404
1405
|
onClick: c
|
|
1405
|
-
}, [M(R(C), { class: "size-5 shrink-0 text-tertiary" }), M(R(
|
|
1406
|
-
default: z(() => [j("span",
|
|
1406
|
+
}, [M(R(C), { class: "size-5 shrink-0 text-tertiary" }), M(R(jt), { gap: "none" }, {
|
|
1407
|
+
default: z(() => [j("span", Sr, L(R(i).t("wise_invoicing.invoice.detail.line_items.new_line_item")), 1), j("span", Cr, L(R(i).t("wise_invoicing.invoice.detail.line_items.new_line_item_description")), 1)]),
|
|
1407
1408
|
_: 1
|
|
1408
1409
|
})]), n.canAddGroup ? (F(), A("button", {
|
|
1409
1410
|
key: 0,
|
|
1410
1411
|
class: "flex w-full items-center gap-md border-t border-secondary px-md py-sm text-left transition-colors hover:bg-secondary",
|
|
1411
1412
|
type: "button",
|
|
1412
1413
|
onClick: l
|
|
1413
|
-
}, [M(R(
|
|
1414
|
-
default: z(() => [j("span",
|
|
1414
|
+
}, [M(R(ke), { class: "size-5 shrink-0 text-tertiary" }), M(R(jt), { gap: "none" }, {
|
|
1415
|
+
default: z(() => [j("span", wr, L(R(i).t("wise_invoicing.invoice.detail.line_items.new_group")), 1), j("span", Tr, L(R(i).t("wise_invoicing.invoice.detail.line_items.new_group_description")), 1)]),
|
|
1415
1416
|
_: 1
|
|
1416
1417
|
})])) : k("", !0)])]),
|
|
1417
1418
|
_: 1
|
|
@@ -1421,7 +1422,7 @@ var [ir, ar] = rr("BillingDocumentLineItemsTable"), or = [
|
|
|
1421
1422
|
});
|
|
1422
1423
|
//#endregion
|
|
1423
1424
|
//#region src/models/billing-document/billingDocumentLineItemGroupUpdateForm.model.ts
|
|
1424
|
-
function
|
|
1425
|
+
function Dr(e) {
|
|
1425
1426
|
return w.object({
|
|
1426
1427
|
name: w.string().trim().min(1, e.nameRequired),
|
|
1427
1428
|
description: w.string().nullable()
|
|
@@ -1429,7 +1430,7 @@ function Er(e) {
|
|
|
1429
1430
|
}
|
|
1430
1431
|
//#endregion
|
|
1431
1432
|
//#region src/ui/billing-document/table/BillingDocumentLineItemDeleteDialog.vue
|
|
1432
|
-
var
|
|
1433
|
+
var Or = /* @__PURE__ */ N({
|
|
1433
1434
|
__name: "BillingDocumentLineItemDeleteDialog",
|
|
1434
1435
|
props: {
|
|
1435
1436
|
name: {},
|
|
@@ -1443,9 +1444,9 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1443
1444
|
let n = e, r = t, i = T(), a = D(() => n.name.toUpperCase()), o = D(() => n.type === "line" ? i.t("wise_invoicing.invoice.detail.line_items.delete_dialog.line.description") : i.t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.description", {
|
|
1444
1445
|
name: n.name,
|
|
1445
1446
|
count: n.lineCount ?? 0
|
|
1446
|
-
})), s =
|
|
1447
|
+
})), s = yn({
|
|
1447
1448
|
initialState: { confirmation: "" },
|
|
1448
|
-
schema:
|
|
1449
|
+
schema: Ue.object({ confirmation: Ue.string().refine((e) => e === a.value, { message: i.t("wise_invoicing.invoice.detail.line_items.delete_dialog.confirmation.validation") }) }),
|
|
1449
1450
|
onSubmit: () => {
|
|
1450
1451
|
n.type === "line" && n.onDeleteLine !== void 0 && (n.onDeleteLine(), r("close"));
|
|
1451
1452
|
}
|
|
@@ -1453,16 +1454,16 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1453
1454
|
function l(e) {
|
|
1454
1455
|
n.type === "group" && n.onDeleteGroup !== void 0 && (n.onDeleteGroup({ deleteLines: e }), r("close"));
|
|
1455
1456
|
}
|
|
1456
|
-
return (e, t) => (F(), O(R(
|
|
1457
|
+
return (e, t) => (F(), O(R(Jt), {
|
|
1457
1458
|
form: R(s),
|
|
1458
1459
|
"enable-click-outside-if-dirty": !0,
|
|
1459
1460
|
size: "sm",
|
|
1460
1461
|
onClose: t[2] ||= (e) => r("close")
|
|
1461
1462
|
}, {
|
|
1462
1463
|
default: z(() => [
|
|
1463
|
-
M(R(
|
|
1464
|
+
M(R(Vt), {
|
|
1464
1465
|
description: o.value,
|
|
1465
|
-
icon: R(
|
|
1466
|
+
icon: R(se),
|
|
1466
1467
|
"is-description-visible": !0,
|
|
1467
1468
|
title: n.type === "line" ? R(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.line.title") : R(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.title")
|
|
1468
1469
|
}, null, 8, [
|
|
@@ -1470,30 +1471,30 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1470
1471
|
"icon",
|
|
1471
1472
|
"title"
|
|
1472
1473
|
]),
|
|
1473
|
-
M(R(
|
|
1474
|
-
default: z(() => [M(R(
|
|
1474
|
+
M(R(Lt), null, {
|
|
1475
|
+
default: z(() => [M(R(cn), P(R(Pe)(R(c)), {
|
|
1475
1476
|
"error-message": null,
|
|
1476
1477
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.confirmation.label", { name: a.value }),
|
|
1477
1478
|
placeholder: a.value
|
|
1478
1479
|
}), null, 16, ["label", "placeholder"])]),
|
|
1479
1480
|
_: 1
|
|
1480
1481
|
}),
|
|
1481
|
-
M(R(
|
|
1482
|
+
M(R(Rt), null, {
|
|
1482
1483
|
right: z(() => [
|
|
1483
|
-
M(R(
|
|
1484
|
-
n.type === "line" ? (F(), O(R(
|
|
1484
|
+
M(R(zt)),
|
|
1485
|
+
n.type === "line" ? (F(), O(R(Bt), {
|
|
1485
1486
|
key: 0,
|
|
1486
1487
|
"is-destructive": !0,
|
|
1487
1488
|
"is-disabled": !R(s).isValid.value,
|
|
1488
1489
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.line.confirm")
|
|
1489
|
-
}, null, 8, ["is-disabled", "label"])) : (F(), O(R(
|
|
1490
|
+
}, null, 8, ["is-disabled", "label"])) : (F(), O(R(Ot), {
|
|
1490
1491
|
key: 1,
|
|
1491
1492
|
"is-disabled": !R(s).isValid.value,
|
|
1492
1493
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.keep_lines"),
|
|
1493
1494
|
variant: "secondary",
|
|
1494
1495
|
onClick: t[0] ||= (e) => l(!1)
|
|
1495
1496
|
}, null, 8, ["is-disabled", "label"])),
|
|
1496
|
-
n.type === "group" ? (F(), O(R(
|
|
1497
|
+
n.type === "group" ? (F(), O(R(Ot), {
|
|
1497
1498
|
key: 2,
|
|
1498
1499
|
"is-disabled": !R(s).isValid.value,
|
|
1499
1500
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.delete_dialog.group.delete_with_lines"),
|
|
@@ -1507,7 +1508,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1507
1508
|
_: 1
|
|
1508
1509
|
}, 8, ["form"]));
|
|
1509
1510
|
}
|
|
1510
|
-
}),
|
|
1511
|
+
}), kr = ["aria-label"], Ar = /* @__PURE__ */ N({
|
|
1511
1512
|
__name: "BillingDocumentLineItemsDragHandle",
|
|
1512
1513
|
setup(e) {
|
|
1513
1514
|
let t = T();
|
|
@@ -1520,21 +1521,21 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1520
1521
|
width: "100%",
|
|
1521
1522
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1522
1523
|
"data-line-item-drag-handle": ""
|
|
1523
|
-
}, [...n[0] ||= [
|
|
1524
|
+
}, [...n[0] ||= [We("<path d=\"M9 6C9.55228 6 10 5.55228 10 5C10 4.44772 9.55228 4 9 4C8.44772 4 8 4.44772 8 5C8 5.55228 8.44772 6 9 6Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></path><path d=\"M9 13C9.55228 13 10 12.5523 10 12C10 11.4477 9.55228 11 9 11C8.44772 11 8 11.4477 8 12C8 12.5523 8.44772 13 9 13Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></path><path d=\"M9 20C9.55228 20 10 19.5523 10 19C10 18.4477 9.55228 18 9 18C8.44772 18 8 18.4477 8 19C8 19.5523 8.44772 20 9 20Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></path><path d=\"M15 6C15.5523 6 16 5.55228 16 5C16 4.44772 15.5523 4 15 4C14.4477 4 14 4.44772 14 5C14 5.55228 14.4477 6 15 6Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></path><path d=\"M15 13C15.5523 13 16 12.5523 16 12C16 11.4477 15.5523 11 15 11C14.4477 11 14 11.4477 14 12C14 12.5523 14.4477 13 15 13Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></path><path d=\"M15 20C15.5523 20 16 19.5523 16 19C16 18.4477 15.5523 18 15 18C14.4477 18 14 18.4477 14 19C14 19.5523 14.4477 20 15 20Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"></path>", 6)]], 8, kr));
|
|
1524
1525
|
}
|
|
1525
|
-
}),
|
|
1526
|
+
}), jr = ["for"], Mr = { key: 0 }, Nr = {
|
|
1526
1527
|
key: 0,
|
|
1527
1528
|
"aria-hidden": "true",
|
|
1528
1529
|
class: "pointer-events-none shrink-0 pl-lg text-sm text-tertiary select-none"
|
|
1529
|
-
},
|
|
1530
|
+
}, Pr = {
|
|
1530
1531
|
key: 1,
|
|
1531
1532
|
"aria-hidden": "true",
|
|
1532
1533
|
class: "pointer-events-none shrink-0 pr-lg text-sm text-error-primary select-none"
|
|
1533
|
-
},
|
|
1534
|
+
}, Fr = ["id", "title"], Ir = {
|
|
1534
1535
|
key: 3,
|
|
1535
1536
|
"aria-hidden": "true",
|
|
1536
1537
|
class: "pointer-events-none shrink-0 pr-lg text-sm text-tertiary select-none"
|
|
1537
|
-
},
|
|
1538
|
+
}, Lr = /*#__PURE__*/ Fe(/* @__PURE__ */ N({
|
|
1538
1539
|
inheritAttrs: !1,
|
|
1539
1540
|
__name: "BillingDocumentLineItemsTableField",
|
|
1540
1541
|
props: {
|
|
@@ -1556,18 +1557,18 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1556
1557
|
},
|
|
1557
1558
|
emits: ["blur"],
|
|
1558
1559
|
setup(e, { emit: t }) {
|
|
1559
|
-
let n = e, r = t, i =
|
|
1560
|
+
let n = e, r = t, i = dt(), a = D(() => n.isTouched && n.errorMessage !== null), o = D(() => i.type === "number"), s = D(() => n.align === "right"), c = D(() => `${n.id}-error`);
|
|
1560
1561
|
return (e, t) => (F(), A(E, null, [j("label", {
|
|
1561
1562
|
for: n.id,
|
|
1562
1563
|
class: "sr-only"
|
|
1563
|
-
}, [
|
|
1564
|
+
}, [Ge(L(n.label), 1), n.isRequired ? (F(), A("span", Mr, "*")) : k("", !0)], 8, jr), j("div", { class: $e([[
|
|
1564
1565
|
n.width === "content" ? "w-auto max-w-full" : "w-full",
|
|
1565
1566
|
n.variant === "outlined" && !a.value ? "bg-primary" : "\n bg-transparent\n ",
|
|
1566
1567
|
n.isDisabled ? "cursor-not-allowed" : "cursor-text",
|
|
1567
1568
|
a.value && !n.isDisabled ? "bg-primary ring-2 ring-error-500 ring-inset" : n.isDisabled ? "" : "\n focus-within:z-10 focus-within:bg-primary focus-within:ring-2\n focus-within:ring-brand-500 focus-within:ring-inset\n "
|
|
1568
1569
|
], "relative flex h-11 items-center rounded-md border border-transparent transition-[background-color,box-shadow] duration-100 motion-reduce:transition-none"]) }, [
|
|
1569
|
-
n.prefix ? (F(), A("span",
|
|
1570
|
-
(F(), O(
|
|
1570
|
+
n.prefix ? (F(), A("span", Nr, L(n.prefix), 1)) : k("", !0),
|
|
1571
|
+
(F(), O(lt(n.as), P(R(i), {
|
|
1571
1572
|
id: n.id,
|
|
1572
1573
|
disabled: n.isDisabled,
|
|
1573
1574
|
required: n.isRequired,
|
|
@@ -1582,7 +1583,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1582
1583
|
], "relative z-1 h-full border-none bg-transparent text-sm text-primary tabular-nums outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:text-disabled"],
|
|
1583
1584
|
onBlur: t[0] ||= (e) => r("blur", e)
|
|
1584
1585
|
}), {
|
|
1585
|
-
default: z(() => [
|
|
1586
|
+
default: z(() => [ct(e.$slots, "default", {}, void 0, !0)]),
|
|
1586
1587
|
_: 3
|
|
1587
1588
|
}, 16, [
|
|
1588
1589
|
"id",
|
|
@@ -1593,19 +1594,19 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1593
1594
|
"aria-describedby",
|
|
1594
1595
|
"class"
|
|
1595
1596
|
])),
|
|
1596
|
-
n.isRequired && !a.value ? (F(), A("span",
|
|
1597
|
+
n.isRequired && !a.value ? (F(), A("span", Pr, " * ")) : k("", !0),
|
|
1597
1598
|
a.value ? (F(), A("span", {
|
|
1598
1599
|
key: 2,
|
|
1599
1600
|
id: c.value,
|
|
1600
1601
|
title: n.errorMessage ?? void 0,
|
|
1601
1602
|
class: "pointer-events-none min-w-0 shrink truncate pr-lg text-xs text-error-primary"
|
|
1602
|
-
}, L(n.errorMessage), 9,
|
|
1603
|
-
n.suffix ? (F(), A("span",
|
|
1603
|
+
}, L(n.errorMessage), 9, Fr)) : k("", !0),
|
|
1604
|
+
n.suffix ? (F(), A("span", Ir, L(n.suffix), 1)) : k("", !0)
|
|
1604
1605
|
], 2)], 64));
|
|
1605
1606
|
}
|
|
1606
|
-
}), [["__scopeId", "data-v-38f52859"]]),
|
|
1607
|
+
}), [["__scopeId", "data-v-38f52859"]]), Rr = /* @__PURE__ */ N({
|
|
1607
1608
|
__name: "BillingDocumentLineItemsTableTextField",
|
|
1608
|
-
props: /*@__PURE__*/
|
|
1609
|
+
props: /*@__PURE__*/ Ze({
|
|
1609
1610
|
id: {},
|
|
1610
1611
|
isDisabled: { type: Boolean },
|
|
1611
1612
|
isRequired: { type: Boolean },
|
|
@@ -1619,26 +1620,26 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1619
1620
|
modelValue: { required: !0 },
|
|
1620
1621
|
modelModifiers: {}
|
|
1621
1622
|
}),
|
|
1622
|
-
emits: /*@__PURE__*/
|
|
1623
|
+
emits: /*@__PURE__*/ Ze(["blur"], ["update:modelValue"]),
|
|
1623
1624
|
setup(e, { emit: t }) {
|
|
1624
|
-
let n = e, r = t, i =
|
|
1625
|
-
return (e, t) => (F(), O(
|
|
1625
|
+
let n = e, r = t, i = ft(e, "modelValue");
|
|
1626
|
+
return (e, t) => (F(), O(Lr, P(n, {
|
|
1626
1627
|
value: i.value ?? "",
|
|
1627
1628
|
type: "text",
|
|
1628
1629
|
onBlur: t[0] ||= (e) => r("blur", e),
|
|
1629
1630
|
onInput: t[1] ||= (e) => i.value = e.target.value
|
|
1630
1631
|
}), null, 16, ["value"]));
|
|
1631
1632
|
}
|
|
1632
|
-
}),
|
|
1633
|
+
}), zr = ["data-line-item-row-id"], Br = {
|
|
1633
1634
|
key: 0,
|
|
1634
1635
|
class: "relative overflow-visible px-xs py-none"
|
|
1635
|
-
},
|
|
1636
|
+
}, Vr = {
|
|
1636
1637
|
key: 1,
|
|
1637
1638
|
class: "px-xs py-none text-center"
|
|
1638
|
-
},
|
|
1639
|
+
}, Hr = ["colspan"], Ur = ["aria-label", "aria-expanded"], Wr = { class: "px-lg py-none text-right text-sm font-semibold text-secondary tabular-nums" }, Gr = {
|
|
1639
1640
|
key: 2,
|
|
1640
1641
|
class: "px-md py-none"
|
|
1641
|
-
},
|
|
1642
|
+
}, Kr = /* @__PURE__ */ N({
|
|
1642
1643
|
__name: "BillingDocumentLineItemsTableGroupRow",
|
|
1643
1644
|
props: {
|
|
1644
1645
|
isCollapsed: { type: Boolean },
|
|
@@ -1648,19 +1649,19 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1648
1649
|
},
|
|
1649
1650
|
emits: ["toggleCollapse"],
|
|
1650
1651
|
setup(e, { emit: t }) {
|
|
1651
|
-
let n = e, r = t, i = T(), a = _(), o =
|
|
1652
|
+
let n = e, r = t, i = T(), a = _(), o = or(), s = _n().create(Or), c = pt("editFieldsRef"), l = I(n.group.name === ""), u = I("name"), d = D(() => n.group.name || i.t("wise_invoicing.invoice.detail.line_items.group_placeholder"));
|
|
1652
1653
|
function f(e, t) {
|
|
1653
1654
|
return Math.min(Math.max((e == null || e === "" ? t : e).length, 10), 64);
|
|
1654
1655
|
}
|
|
1655
1656
|
function p(e) {
|
|
1656
1657
|
return e.name !== n.group.name || e.description !== n.group.description;
|
|
1657
1658
|
}
|
|
1658
|
-
let m =
|
|
1659
|
+
let m = yn({
|
|
1659
1660
|
initialState: D(() => ({
|
|
1660
1661
|
name: n.group.name,
|
|
1661
1662
|
description: n.group.description
|
|
1662
1663
|
})),
|
|
1663
|
-
schema:
|
|
1664
|
+
schema: Dr({ nameRequired: i.t("wise_invoicing.invoice.detail.line_items.group_name_required") }),
|
|
1664
1665
|
onSubmit: (e) => {
|
|
1665
1666
|
p(e) && o.mutations.updateGroup(n.group.id, e);
|
|
1666
1667
|
}
|
|
@@ -1669,17 +1670,17 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1669
1670
|
let e = !x.value;
|
|
1670
1671
|
for (let t of b.value) e !== o.selection.isSelected(t) && o.selection.toggleRow(t);
|
|
1671
1672
|
}
|
|
1672
|
-
let
|
|
1673
|
-
function
|
|
1673
|
+
let ne = D(() => n.total === null ? null : a.format(o.meta.value.currency, n.total));
|
|
1674
|
+
function S(e) {
|
|
1674
1675
|
return `billing-document-line-items-group-${e}-${n.group.id}`;
|
|
1675
1676
|
}
|
|
1676
|
-
async function
|
|
1677
|
-
await
|
|
1678
|
-
let t = c.value?.querySelector(`input[id="${
|
|
1677
|
+
async function C(e) {
|
|
1678
|
+
await Qe();
|
|
1679
|
+
let t = c.value?.querySelector(`input[id="${S(e)}"]`);
|
|
1679
1680
|
t?.focus(), t?.select();
|
|
1680
1681
|
}
|
|
1681
1682
|
async function re(e = "name") {
|
|
1682
|
-
o.isEditable.value && (u.value = e, l.value = !0, await
|
|
1683
|
+
o.isEditable.value && (u.value = e, l.value = !0, await C(e));
|
|
1683
1684
|
}
|
|
1684
1685
|
async function ie() {
|
|
1685
1686
|
await s.open({
|
|
@@ -1691,12 +1692,12 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1691
1692
|
}
|
|
1692
1693
|
});
|
|
1693
1694
|
}
|
|
1694
|
-
|
|
1695
|
-
l.value && await
|
|
1695
|
+
rt(async () => {
|
|
1696
|
+
l.value && await C(u.value);
|
|
1696
1697
|
});
|
|
1697
1698
|
async function ae(e) {
|
|
1698
1699
|
if (!c.value?.contains(e.relatedTarget)) {
|
|
1699
|
-
if (await
|
|
1700
|
+
if (await Qe(), !m.isValid.value) {
|
|
1700
1701
|
l.value = !0;
|
|
1701
1702
|
return;
|
|
1702
1703
|
}
|
|
@@ -1704,13 +1705,13 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1704
1705
|
}
|
|
1705
1706
|
}
|
|
1706
1707
|
async function oe() {
|
|
1707
|
-
if (await
|
|
1708
|
+
if (await Qe(), !m.isValid.value) {
|
|
1708
1709
|
h.onBlur();
|
|
1709
1710
|
return;
|
|
1710
1711
|
}
|
|
1711
1712
|
await m.submit(), l.value = !1;
|
|
1712
1713
|
}
|
|
1713
|
-
return
|
|
1714
|
+
return wt(() => m.state.value, async () => {
|
|
1714
1715
|
o.isEditable.value && m.isValid.value && p(m.state.value) && await m.submit();
|
|
1715
1716
|
}, {
|
|
1716
1717
|
debounce: 500,
|
|
@@ -1721,9 +1722,9 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1721
1722
|
"data-line-item-row-type": "group",
|
|
1722
1723
|
"data-line-item-row": ""
|
|
1723
1724
|
}, [
|
|
1724
|
-
R(o).isEditable.value ? (F(), A("td",
|
|
1725
|
-
R(o).isEditable.value ? (F(), A("td",
|
|
1726
|
-
id:
|
|
1725
|
+
R(o).isEditable.value ? (F(), A("td", Br, [M(Ar)])) : k("", !0),
|
|
1726
|
+
R(o).isEditable.value ? (F(), A("td", Vr, [M(R(kt), {
|
|
1727
|
+
id: S("select-group"),
|
|
1727
1728
|
"model-value": x.value || ee.value,
|
|
1728
1729
|
"is-indeterminate": ee.value,
|
|
1729
1730
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.select_group"),
|
|
@@ -1751,7 +1752,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1751
1752
|
class: "flex shrink-0 items-center justify-center rounded-sm text-tertiary transition-colors hover:text-primary",
|
|
1752
1753
|
type: "button",
|
|
1753
1754
|
onClick: t[0] ||= (e) => r("toggleCollapse")
|
|
1754
|
-
}, [M(R(
|
|
1755
|
+
}, [M(R(de), { class: $e([n.isCollapsed ? "-rotate-90" : "rotate-0", "size-4 transition-transform duration-200 motion-reduce:transition-none"]) }, null, 8, ["class"])], 8, Ur),
|
|
1755
1756
|
j("div", {
|
|
1756
1757
|
ref_key: "editFieldsRef",
|
|
1757
1758
|
ref: c,
|
|
@@ -1763,8 +1764,8 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1763
1764
|
gap: "xs",
|
|
1764
1765
|
onFocusout: ae
|
|
1765
1766
|
}, {
|
|
1766
|
-
default: z(() => [M(
|
|
1767
|
-
id:
|
|
1767
|
+
default: z(() => [M(Rr, P({
|
|
1768
|
+
id: S("name"),
|
|
1768
1769
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.group_label"),
|
|
1769
1770
|
placeholder: R(i).t("wise_invoicing.invoice.detail.line_items.group_placeholder"),
|
|
1770
1771
|
size: v.value,
|
|
@@ -1773,22 +1774,22 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1773
1774
|
class: "font-semibold",
|
|
1774
1775
|
variant: "ghost",
|
|
1775
1776
|
width: "content"
|
|
1776
|
-
}, R(
|
|
1777
|
+
}, R(Pe)(R(h)), { onKeydown: _t(vt(oe, ["prevent"]), ["enter"]) }), null, 16, [
|
|
1777
1778
|
"id",
|
|
1778
1779
|
"label",
|
|
1779
1780
|
"placeholder",
|
|
1780
1781
|
"size",
|
|
1781
1782
|
"is-disabled",
|
|
1782
1783
|
"onKeydown"
|
|
1783
|
-
]), M(
|
|
1784
|
-
id:
|
|
1784
|
+
]), M(Rr, P({
|
|
1785
|
+
id: S("description"),
|
|
1785
1786
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.group_description_label"),
|
|
1786
1787
|
placeholder: R(i).t("wise_invoicing.invoice.detail.line_items.group_description_placeholder"),
|
|
1787
1788
|
size: y.value,
|
|
1788
1789
|
"is-disabled": !R(o).isEditable.value,
|
|
1789
1790
|
variant: "ghost",
|
|
1790
1791
|
width: "content"
|
|
1791
|
-
}, R(
|
|
1792
|
+
}, R(Pe)(R(g)), { onKeydown: _t(vt(oe, ["prevent"]), ["enter"]) }), null, 16, [
|
|
1792
1793
|
"id",
|
|
1793
1794
|
"label",
|
|
1794
1795
|
"placeholder",
|
|
@@ -1804,7 +1805,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1804
1805
|
class: "min-w-0"
|
|
1805
1806
|
}, {
|
|
1806
1807
|
default: z(() => [
|
|
1807
|
-
R(o).isEditable.value ? (F(), O(R(
|
|
1808
|
+
R(o).isEditable.value ? (F(), O(R(At), {
|
|
1808
1809
|
key: 0,
|
|
1809
1810
|
class: "min-w-0 shrink-0 rounded-sm"
|
|
1810
1811
|
}, {
|
|
@@ -1819,7 +1820,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1819
1820
|
text: d.value,
|
|
1820
1821
|
class: "shrink-0 text-sm font-semibold text-primary"
|
|
1821
1822
|
}, null, 8, ["text"])),
|
|
1822
|
-
M(R(
|
|
1823
|
+
M(R(Dt), {
|
|
1823
1824
|
label: String(b.value.length),
|
|
1824
1825
|
"aria-label": R(i).t("wise_invoicing.invoice.detail.line_items.group_item_count", { count: b.value.length }),
|
|
1825
1826
|
color: "gray",
|
|
@@ -1827,7 +1828,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1827
1828
|
variant: "translucent",
|
|
1828
1829
|
class: "shrink-0"
|
|
1829
1830
|
}, null, 8, ["label", "aria-label"]),
|
|
1830
|
-
n.group.description ? (F(), A(E, { key: 2 }, [R(o).isEditable.value ? (F(), O(R(
|
|
1831
|
+
n.group.description ? (F(), A(E, { key: 2 }, [R(o).isEditable.value ? (F(), O(R(At), {
|
|
1831
1832
|
key: 0,
|
|
1832
1833
|
class: "min-w-0 rounded-sm"
|
|
1833
1834
|
}, {
|
|
@@ -1845,7 +1846,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1845
1846
|
]),
|
|
1846
1847
|
_: 1
|
|
1847
1848
|
}))], 512),
|
|
1848
|
-
M(
|
|
1849
|
+
M(zn, {
|
|
1849
1850
|
definitions: R(o).groupCustomFieldDefinitions.value,
|
|
1850
1851
|
values: n.group.customFields,
|
|
1851
1852
|
class: "shrink-0",
|
|
@@ -1853,15 +1854,15 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1853
1854
|
}, null, 8, ["definitions", "values"])
|
|
1854
1855
|
]),
|
|
1855
1856
|
_: 1
|
|
1856
|
-
})], 8,
|
|
1857
|
-
j("td",
|
|
1858
|
-
R(o).isEditable.value ? (F(), A("td",
|
|
1857
|
+
})], 8, Hr),
|
|
1858
|
+
j("td", Wr, L(ne.value), 1),
|
|
1859
|
+
R(o).isEditable.value ? (F(), A("td", Gr, [M(R(B), {
|
|
1859
1860
|
justify: "end",
|
|
1860
1861
|
gap: "xxs",
|
|
1861
1862
|
class: "opacity-0 transition group-focus-within/row:opacity-100 group-hover/row:opacity-100"
|
|
1862
1863
|
}, {
|
|
1863
|
-
default: z(() => [M(R(
|
|
1864
|
-
icon: R(
|
|
1864
|
+
default: z(() => [M(R(Xt), {
|
|
1865
|
+
icon: R(Ce),
|
|
1865
1866
|
"is-disabled": !R(o).isEditable.value,
|
|
1866
1867
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.edit_group"),
|
|
1867
1868
|
variant: "tertiary",
|
|
@@ -1870,8 +1871,8 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1870
1871
|
"icon",
|
|
1871
1872
|
"is-disabled",
|
|
1872
1873
|
"label"
|
|
1873
|
-
]), M(R(
|
|
1874
|
-
icon: R(
|
|
1874
|
+
]), M(R(Xt), {
|
|
1875
|
+
icon: R(me),
|
|
1875
1876
|
"is-disabled": !R(o).isEditable.value,
|
|
1876
1877
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.delete_group"),
|
|
1877
1878
|
variant: "destructive-tertiary",
|
|
@@ -1883,9 +1884,9 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1883
1884
|
])]),
|
|
1884
1885
|
_: 1
|
|
1885
1886
|
})])) : k("", !0)
|
|
1886
|
-
], 8,
|
|
1887
|
+
], 8, zr));
|
|
1887
1888
|
}
|
|
1888
|
-
}),
|
|
1889
|
+
}), qr = w.object({
|
|
1889
1890
|
name: w.string().trim().min(1),
|
|
1890
1891
|
description: w.string().nullable(),
|
|
1891
1892
|
discountPercentage: w.number().min(0).max(100).nullable(),
|
|
@@ -1893,7 +1894,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1893
1894
|
unit: w.enum(a),
|
|
1894
1895
|
unitPrice: w.number().nonnegative().max(5e11),
|
|
1895
1896
|
vatRate: w.enum(i)
|
|
1896
|
-
}),
|
|
1897
|
+
}), Jr = w.object({
|
|
1897
1898
|
name: w.string().trim().min(1),
|
|
1898
1899
|
description: w.string().nullable(),
|
|
1899
1900
|
discountPercentage: w.number().min(0).max(100).nullable(),
|
|
@@ -1901,14 +1902,7 @@ var Dr = /* @__PURE__ */ N({
|
|
|
1901
1902
|
unit: w.enum(a),
|
|
1902
1903
|
unitPrice: w.number().nonnegative().max(5e11),
|
|
1903
1904
|
vatRate: w.enum(i)
|
|
1904
|
-
})
|
|
1905
|
-
static findByDefinition(e, t) {
|
|
1906
|
-
return e.find((e) => e.definitionUuid === t) ?? null;
|
|
1907
|
-
}
|
|
1908
|
-
static upsert(e, t, n) {
|
|
1909
|
-
return n === null ? e.filter((e) => e.definitionUuid !== t) : e.some((e) => e.definitionUuid === t) ? e.map((e) => e.definitionUuid === t ? n : e) : [...e, n];
|
|
1910
|
-
}
|
|
1911
|
-
};
|
|
1905
|
+
});
|
|
1912
1906
|
//#endregion
|
|
1913
1907
|
//#region src/modules/custom-field/composables/customFieldValueModel.composable.ts
|
|
1914
1908
|
function Yr(e) {
|
|
@@ -1949,7 +1943,7 @@ function Yr(e) {
|
|
|
1949
1943
|
};
|
|
1950
1944
|
}
|
|
1951
1945
|
}), l = D({
|
|
1952
|
-
get: () => i.value?.type === m.DATE && i.value.value instanceof
|
|
1946
|
+
get: () => i.value?.type === m.DATE && i.value.value instanceof Tt.PlainDate ? i.value.value : null,
|
|
1953
1947
|
set: (e) => {
|
|
1954
1948
|
i.value = e === null ? null : {
|
|
1955
1949
|
definitionUuid: n().uuid,
|
|
@@ -1957,7 +1951,7 @@ function Yr(e) {
|
|
|
1957
1951
|
value: e
|
|
1958
1952
|
};
|
|
1959
1953
|
}
|
|
1960
|
-
}), u = D(() => i.value?.type === m.TIMESTAMP ? i.value.value.toZonedDateTimeISO(
|
|
1954
|
+
}), u = D(() => i.value?.type === m.TIMESTAMP ? i.value.value.toZonedDateTimeISO(Tt.Now.timeZoneId()) : null);
|
|
1961
1955
|
function d(e, t) {
|
|
1962
1956
|
if (e === null) {
|
|
1963
1957
|
i.value = null;
|
|
@@ -1967,8 +1961,8 @@ function Yr(e) {
|
|
|
1967
1961
|
definitionUuid: n().uuid,
|
|
1968
1962
|
type: m.TIMESTAMP,
|
|
1969
1963
|
value: e.toZonedDateTime({
|
|
1970
|
-
plainTime: t ?? new
|
|
1971
|
-
timeZone:
|
|
1964
|
+
plainTime: t ?? new Tt.PlainTime(),
|
|
1965
|
+
timeZone: Tt.Now.timeZoneId()
|
|
1972
1966
|
}).toInstant()
|
|
1973
1967
|
};
|
|
1974
1968
|
}
|
|
@@ -2031,7 +2025,7 @@ function Yr(e) {
|
|
|
2031
2025
|
//#region src/modules/custom-field/components/CustomFieldValueInput.vue
|
|
2032
2026
|
var Xr = /* @__PURE__ */ N({
|
|
2033
2027
|
__name: "CustomFieldValueInput",
|
|
2034
|
-
props: /*@__PURE__*/
|
|
2028
|
+
props: /*@__PURE__*/ Ze({
|
|
2035
2029
|
isDisabled: { type: Boolean },
|
|
2036
2030
|
isLabelHidden: { type: Boolean },
|
|
2037
2031
|
currency: {},
|
|
@@ -2045,25 +2039,25 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2045
2039
|
}),
|
|
2046
2040
|
emits: ["update:modelValue"],
|
|
2047
2041
|
setup(e) {
|
|
2048
|
-
let t = e, n =
|
|
2042
|
+
let t = e, n = ft(e, "modelValue"), r = T(), i = Yr({
|
|
2049
2043
|
currency: () => t.currency,
|
|
2050
2044
|
definition: () => t.definition,
|
|
2051
2045
|
precision: () => t.precision,
|
|
2052
2046
|
value: n
|
|
2053
2047
|
}), a = D(() => {
|
|
2054
|
-
let e =
|
|
2048
|
+
let e = je.getLabel(t.definition, r.locale.value);
|
|
2055
2049
|
return t.definition.type === m.MONETARY ? `${e} (${t.currency})` : e;
|
|
2056
2050
|
}), o = D(() => ({
|
|
2057
2051
|
isDisabled: t.isDisabled ?? !1,
|
|
2058
2052
|
isLabelHidden: t.isLabelHidden ?? !1,
|
|
2059
2053
|
isRequired: t.definition.isRequired,
|
|
2060
|
-
helpText: t.definition.description === null ? null :
|
|
2054
|
+
helpText: t.definition.description === null ? null : je.getLocalizedValue(t.definition.description, r.locale.value),
|
|
2061
2055
|
label: a.value
|
|
2062
|
-
})), s = D(() =>
|
|
2056
|
+
})), s = D(() => hn(t.definition.choices.toSorted((e, t) => e.order - t.order).map((e) => e.value))), c = D(() => n.value?.type === m.DATE ? n.value.value === "infinity" ? r.t("wise_invoicing.custom_field.date.infinity") : n.value.value === "-infinity" ? r.t("wise_invoicing.custom_field.date.negative_infinity") : null : null);
|
|
2063
2057
|
function l(e) {
|
|
2064
|
-
return
|
|
2058
|
+
return je.getChoiceLabel(t.definition, e, r.locale.value);
|
|
2065
2059
|
}
|
|
2066
|
-
return (e, n) => t.definition.type === R(m).TEXT ? (F(), O(R(
|
|
2060
|
+
return (e, n) => t.definition.type === R(m).TEXT ? (F(), O(R(cn), P({
|
|
2067
2061
|
key: 0,
|
|
2068
2062
|
modelValue: R(i).text.value,
|
|
2069
2063
|
"onUpdate:modelValue": n[0] ||= (e) => R(i).text.value = e
|
|
@@ -2074,7 +2068,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2074
2068
|
"modelValue",
|
|
2075
2069
|
"placeholder",
|
|
2076
2070
|
"size"
|
|
2077
|
-
])) : t.definition.type === R(m).TEXT_ARRAY ? (F(), O(R(
|
|
2071
|
+
])) : t.definition.type === R(m).TEXT_ARRAY ? (F(), O(R(sn), P({
|
|
2078
2072
|
key: 1,
|
|
2079
2073
|
modelValue: R(i).textArray.value,
|
|
2080
2074
|
"onUpdate:modelValue": n[1] ||= (e) => R(i).textArray.value = e
|
|
@@ -2085,15 +2079,15 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2085
2079
|
"modelValue",
|
|
2086
2080
|
"placeholder",
|
|
2087
2081
|
"size"
|
|
2088
|
-
])) : t.definition.type === R(m).NUMBER ? (F(), O(R(
|
|
2082
|
+
])) : t.definition.type === R(m).NUMBER ? (F(), O(R(Zt), P({
|
|
2089
2083
|
key: 2,
|
|
2090
2084
|
modelValue: R(i).number.value,
|
|
2091
2085
|
"onUpdate:modelValue": n[2] ||= (e) => R(i).number.value = e
|
|
2092
|
-
}, o.value, { placeholder: t.placeholder }), null, 16, ["modelValue", "placeholder"])) : t.definition.type === R(m).BOOLEAN ? (F(), O(R(
|
|
2086
|
+
}, o.value, { placeholder: t.placeholder }), null, 16, ["modelValue", "placeholder"])) : t.definition.type === R(m).BOOLEAN ? (F(), O(R(nn), P({
|
|
2093
2087
|
key: 3,
|
|
2094
2088
|
modelValue: R(i).boolean.value,
|
|
2095
2089
|
"onUpdate:modelValue": n[3] ||= (e) => R(i).boolean.value = e
|
|
2096
|
-
}, o.value), null, 16, ["modelValue"])) : t.definition.type === R(m).DATE ? (F(), O(R(
|
|
2090
|
+
}, o.value), null, 16, ["modelValue"])) : t.definition.type === R(m).DATE ? (F(), O(R(Ft), P({
|
|
2097
2091
|
key: 4,
|
|
2098
2092
|
modelValue: R(i).date.value,
|
|
2099
2093
|
"onUpdate:modelValue": n[4] ||= (e) => R(i).date.value = e
|
|
@@ -2111,7 +2105,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2111
2105
|
align: "start",
|
|
2112
2106
|
gap: "xs"
|
|
2113
2107
|
}, {
|
|
2114
|
-
default: z(() => [M(R(
|
|
2108
|
+
default: z(() => [M(R(Ft), P({
|
|
2115
2109
|
modelValue: R(i).timestampDate.value,
|
|
2116
2110
|
"onUpdate:modelValue": n[5] ||= (e) => R(i).timestampDate.value = e
|
|
2117
2111
|
}, o.value, {
|
|
@@ -2121,7 +2115,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2121
2115
|
"modelValue",
|
|
2122
2116
|
"placeholder",
|
|
2123
2117
|
"size"
|
|
2124
|
-
]), M(R(
|
|
2118
|
+
]), M(R(un), {
|
|
2125
2119
|
modelValue: R(i).timestampTime.value,
|
|
2126
2120
|
"onUpdate:modelValue": n[6] ||= (e) => R(i).timestampTime.value = e,
|
|
2127
2121
|
"is-disabled": t.isDisabled || R(i).timestampDate.value === null,
|
|
@@ -2137,7 +2131,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2137
2131
|
"size"
|
|
2138
2132
|
])]),
|
|
2139
2133
|
_: 1
|
|
2140
|
-
})) : t.definition.type === R(m).SINGLE_SELECT ? (F(), O(R(
|
|
2134
|
+
})) : t.definition.type === R(m).SINGLE_SELECT ? (F(), O(R($t), P({
|
|
2141
2135
|
key: 6,
|
|
2142
2136
|
modelValue: R(i).singleSelect.value,
|
|
2143
2137
|
"onUpdate:modelValue": n[7] ||= (e) => R(i).singleSelect.value = e
|
|
@@ -2151,7 +2145,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2151
2145
|
"items",
|
|
2152
2146
|
"placeholder",
|
|
2153
2147
|
"size"
|
|
2154
|
-
])) : t.definition.type === R(m).MULTI_SELECT ? (F(), O(R(
|
|
2148
|
+
])) : t.definition.type === R(m).MULTI_SELECT ? (F(), O(R($t), P({
|
|
2155
2149
|
key: 7,
|
|
2156
2150
|
modelValue: R(i).multiSelect.value,
|
|
2157
2151
|
"onUpdate:modelValue": n[8] ||= (e) => R(i).multiSelect.value = e
|
|
@@ -2165,7 +2159,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2165
2159
|
"items",
|
|
2166
2160
|
"placeholder",
|
|
2167
2161
|
"size"
|
|
2168
|
-
])) : t.definition.type === R(m).MONETARY ? (F(), O(R(
|
|
2162
|
+
])) : t.definition.type === R(m).MONETARY ? (F(), O(R(Zt), P({
|
|
2169
2163
|
key: 8,
|
|
2170
2164
|
modelValue: R(i).monetary.value,
|
|
2171
2165
|
"onUpdate:modelValue": n[9] ||= (e) => R(i).monetary.value = e
|
|
@@ -2173,7 +2167,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2173
2167
|
}
|
|
2174
2168
|
}), Zr = /* @__PURE__ */ N({
|
|
2175
2169
|
__name: "BillingDocumentLineItemsTableNumberField",
|
|
2176
|
-
props: /*@__PURE__*/
|
|
2170
|
+
props: /*@__PURE__*/ Ze({
|
|
2177
2171
|
id: {},
|
|
2178
2172
|
isDisabled: { type: Boolean },
|
|
2179
2173
|
isTouched: { type: Boolean },
|
|
@@ -2189,13 +2183,13 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2189
2183
|
modelValue: { required: !0 },
|
|
2190
2184
|
modelModifiers: {}
|
|
2191
2185
|
}),
|
|
2192
|
-
emits: /*@__PURE__*/
|
|
2186
|
+
emits: /*@__PURE__*/ Ze(["blur"], ["update:modelValue"]),
|
|
2193
2187
|
setup(e, { emit: t }) {
|
|
2194
|
-
let n = e, r = t, i =
|
|
2188
|
+
let n = e, r = t, i = ft(e, "modelValue"), a = I(s(i.value)), o = I(!1);
|
|
2195
2189
|
function s(e) {
|
|
2196
2190
|
return e === null ? "" : String(e);
|
|
2197
2191
|
}
|
|
2198
|
-
|
|
2192
|
+
ht(i, (e) => {
|
|
2199
2193
|
o.value || (a.value = s(e));
|
|
2200
2194
|
});
|
|
2201
2195
|
function c() {
|
|
@@ -2213,7 +2207,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2213
2207
|
function u(e) {
|
|
2214
2208
|
o.value = !1, a.value = s(i.value), r("blur", e);
|
|
2215
2209
|
}
|
|
2216
|
-
return (e, t) => (F(), O(
|
|
2210
|
+
return (e, t) => (F(), O(Lr, P(n, {
|
|
2217
2211
|
value: a.value,
|
|
2218
2212
|
align: "right",
|
|
2219
2213
|
type: "number",
|
|
@@ -2230,7 +2224,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2230
2224
|
"aria-controls"
|
|
2231
2225
|
], $r = /* @__PURE__ */ N({
|
|
2232
2226
|
__name: "BillingDocumentLineItemsTableSelectField",
|
|
2233
|
-
props: /*@__PURE__*/
|
|
2227
|
+
props: /*@__PURE__*/ Ze({
|
|
2234
2228
|
id: {},
|
|
2235
2229
|
isDisabled: { type: Boolean },
|
|
2236
2230
|
isTouched: { type: Boolean },
|
|
@@ -2242,13 +2236,13 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2242
2236
|
modelValue: { required: !0 },
|
|
2243
2237
|
modelModifiers: {}
|
|
2244
2238
|
}),
|
|
2245
|
-
emits: /*@__PURE__*/
|
|
2239
|
+
emits: /*@__PURE__*/ Ze(["blur"], ["update:modelValue"]),
|
|
2246
2240
|
setup(e, { emit: t }) {
|
|
2247
|
-
let n = e, r = t, i =
|
|
2241
|
+
let n = e, r = t, i = ft(e, "modelValue"), a = D(() => n.isTouched && n.errorMessage !== null), o = D(() => hn(n.options.map((e) => e.value))), s = D(() => n.options.find((e) => e.value === i.value)?.label ?? null);
|
|
2248
2242
|
function c(e) {
|
|
2249
2243
|
return n.options.find((t) => t.value === e)?.label ?? e;
|
|
2250
2244
|
}
|
|
2251
|
-
return (e, t) => (F(), A("div", { class:
|
|
2245
|
+
return (e, t) => (F(), A("div", { class: $e([[n.isDisabled ? "cursor-not-allowed" : "cursor-pointer", a.value && !n.isDisabled ? "bg-primary ring-2 ring-error-500 ring-inset" : n.isDisabled ? "" : "\n focus-within:z-10 focus-within:bg-primary focus-within:ring-2\n focus-within:ring-brand-500 focus-within:ring-inset\n "], "relative flex h-11 w-full items-center rounded-md border border-transparent bg-transparent transition-[background-color,box-shadow] duration-100 motion-reduce:transition-none"]) }, [M(R(en), {
|
|
2252
2246
|
id: n.id,
|
|
2253
2247
|
modelValue: i.value,
|
|
2254
2248
|
"onUpdate:modelValue": t[0] ||= (e) => i.value = e,
|
|
@@ -2270,7 +2264,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2270
2264
|
"aria-controls": `${n.id}-content`,
|
|
2271
2265
|
role: "combobox",
|
|
2272
2266
|
class: "relative z-1 flex size-full items-center justify-between border-none bg-transparent px-lg text-sm outline-none disabled:cursor-not-allowed"
|
|
2273
|
-
}, [j("span", { class:
|
|
2267
|
+
}, [j("span", { class: $e([n.isDisabled ? "text-disabled" : s.value === null ? "text-placeholder" : "text-primary"]) }, L(s.value ?? n.placeholder ?? ""), 3), n.isDisabled ? k("", !0) : (F(), O(R(de), {
|
|
2274
2268
|
key: 0,
|
|
2275
2269
|
class: "size-4 shrink-0 text-tertiary"
|
|
2276
2270
|
}))], 8, Qr)]),
|
|
@@ -2286,7 +2280,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2286
2280
|
}
|
|
2287
2281
|
}), ei = /* @__PURE__ */ N({
|
|
2288
2282
|
__name: "BillingDocumentLineItemsTableCustomField",
|
|
2289
|
-
props: /*@__PURE__*/
|
|
2283
|
+
props: /*@__PURE__*/ Ze({
|
|
2290
2284
|
id: {},
|
|
2291
2285
|
isDisabled: { type: Boolean },
|
|
2292
2286
|
currency: {},
|
|
@@ -2298,16 +2292,16 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2298
2292
|
}),
|
|
2299
2293
|
emits: ["update:modelValue"],
|
|
2300
2294
|
setup(e) {
|
|
2301
|
-
let t = e, n =
|
|
2295
|
+
let t = e, n = ft(e, "modelValue"), r = T(), i = _(), a = Yr({
|
|
2302
2296
|
currency: () => t.currency,
|
|
2303
2297
|
definition: () => t.definition,
|
|
2304
2298
|
precision: () => t.precision,
|
|
2305
2299
|
value: n
|
|
2306
|
-
}), o = D(() =>
|
|
2307
|
-
label:
|
|
2300
|
+
}), o = D(() => je.getLabel(t.definition, r.locale.value)), s = D(() => i.getSymbol(t.currency)), c = D(() => t.definition.choices.toSorted((e, t) => e.order - t.order).map((e) => ({
|
|
2301
|
+
label: je.getChoiceLabel(t.definition, e.value, r.locale.value),
|
|
2308
2302
|
value: e.value
|
|
2309
2303
|
})));
|
|
2310
|
-
return (e, r) => t.definition.type === R(m).TEXT ? (F(), O(
|
|
2304
|
+
return (e, r) => t.definition.type === R(m).TEXT ? (F(), O(Rr, {
|
|
2311
2305
|
key: 0,
|
|
2312
2306
|
id: t.id,
|
|
2313
2307
|
modelValue: R(a).text.value,
|
|
@@ -2401,7 +2395,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2401
2395
|
}, li = { class: "px-lg py-none text-right text-sm text-secondary tabular-nums" }, ui = { class: "p-none" }, di = { class: "px-lg py-none text-right text-sm font-medium text-primary tabular-nums" }, fi = {
|
|
2402
2396
|
key: 3,
|
|
2403
2397
|
class: "px-md py-none"
|
|
2404
|
-
}, pi = /*#__PURE__*/
|
|
2398
|
+
}, pi = /*#__PURE__*/ Fe(/* @__PURE__ */ N({
|
|
2405
2399
|
__name: "BillingDocumentLineItemsTableRow",
|
|
2406
2400
|
props: {
|
|
2407
2401
|
isAppearing: { type: Boolean },
|
|
@@ -2410,21 +2404,21 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2410
2404
|
net: {}
|
|
2411
2405
|
},
|
|
2412
2406
|
setup(e) {
|
|
2413
|
-
let t = e, n = T(), r = _(), i =
|
|
2407
|
+
let t = e, n = T(), r = _(), i = te(), a = _n().create(Or), o = or(), c = sr.map((e) => ({
|
|
2414
2408
|
label: `${Number(e)}%`,
|
|
2415
2409
|
value: e
|
|
2416
|
-
})), l =
|
|
2410
|
+
})), l = cr.map((e) => ({
|
|
2417
2411
|
label: n.t(`wise_invoicing.invoice.detail.line_items.units.${e}`),
|
|
2418
2412
|
value: e
|
|
2419
|
-
})), u = D(() => r.getSymbol(o.meta.value.currency)), d = D(() => o.meta.value.documentType === s.CREDIT_NOTE).value ?
|
|
2420
|
-
initialState: D(() =>
|
|
2413
|
+
})), u = D(() => r.getSymbol(o.meta.value.currency)), d = D(() => o.meta.value.documentType === s.CREDIT_NOTE).value ? Jr : qr, f = D(() => !o.isEditable.value || t.line.isDiscount), p = yn({
|
|
2414
|
+
initialState: D(() => oe(t.line)),
|
|
2421
2415
|
schema: d,
|
|
2422
2416
|
onSubmit: (e) => {
|
|
2423
|
-
|
|
2417
|
+
se(t.line, e) || o.mutations.updateAllFields(t.line.id, e);
|
|
2424
2418
|
}
|
|
2425
|
-
}), m = p.register("name"), h = p.register("description"), g = p.register("quantity"), v = p.register("unit"), y = p.register("unitPrice"), b = p.register("discountPercentage"),
|
|
2419
|
+
}), m = p.register("name"), h = p.register("description"), g = p.register("quantity"), v = p.register("unit"), y = p.register("unitPrice"), b = p.register("discountPercentage"), ee = p.register("vatRate"), ne = D(() => o.lineCustomFieldDefinitions.value.map((e) => ({
|
|
2426
2420
|
definition: e,
|
|
2427
|
-
value:
|
|
2421
|
+
value: x.findByDefinition(t.line.customFields, e.uuid)
|
|
2428
2422
|
})));
|
|
2429
2423
|
function S(e) {
|
|
2430
2424
|
return `billing-document-line-items-${e}-${t.line.id}`;
|
|
@@ -2432,7 +2426,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2432
2426
|
function C() {
|
|
2433
2427
|
return t.line.name || t.line.description || n.t("wise_invoicing.invoice.detail.line_items.delete_dialog.line.unnamed");
|
|
2434
2428
|
}
|
|
2435
|
-
async function
|
|
2429
|
+
async function re() {
|
|
2436
2430
|
await a.open({
|
|
2437
2431
|
name: C(),
|
|
2438
2432
|
type: "line",
|
|
@@ -2441,13 +2435,13 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2441
2435
|
}
|
|
2442
2436
|
});
|
|
2443
2437
|
}
|
|
2444
|
-
function re(e) {
|
|
2445
|
-
return r.format(o.meta.value.currency, vr.getDisplayNumber(o.meta.value.documentType, e));
|
|
2446
|
-
}
|
|
2447
2438
|
function ie(e) {
|
|
2448
|
-
return r.format(o.meta.value.currency,
|
|
2439
|
+
return r.format(o.meta.value.currency, yr.getDisplayNumber(o.meta.value.documentType, e));
|
|
2449
2440
|
}
|
|
2450
2441
|
function ae(e) {
|
|
2442
|
+
return r.format(o.meta.value.currency, yr.getDisplayGrossLineTotal(o.meta.value.documentType, e, t.line.isDiscount));
|
|
2443
|
+
}
|
|
2444
|
+
function oe(e) {
|
|
2451
2445
|
return {
|
|
2452
2446
|
name: e.name,
|
|
2453
2447
|
description: e.description,
|
|
@@ -2458,11 +2452,11 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2458
2452
|
vatRate: e.vatRate
|
|
2459
2453
|
};
|
|
2460
2454
|
}
|
|
2461
|
-
function
|
|
2455
|
+
function se(e, t) {
|
|
2462
2456
|
return e.name === t.name && e.description === t.description && e.quantity === t.quantity && e.unit === t.unit && e.unitPrice === t.unitPrice && (e.discountPercentage?.getValue() ?? null) === t.discountPercentage && e.vatRate === t.vatRate;
|
|
2463
2457
|
}
|
|
2464
|
-
return
|
|
2465
|
-
!o.isEditable.value || !p.isValid.value ||
|
|
2458
|
+
return ht(() => [p.state.value, p.isValid.value], async () => {
|
|
2459
|
+
!o.isEditable.value || !p.isValid.value || se(t.line, p.state.value) || await p.submit();
|
|
2466
2460
|
}, { deep: !0 }), (e, r) => (F(), A("tr", {
|
|
2467
2461
|
"data-line-item-row-id": t.line.id,
|
|
2468
2462
|
"data-appearing": t.isAppearing ? "true" : void 0,
|
|
@@ -2470,11 +2464,11 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2470
2464
|
"data-line-item-row-type": "line",
|
|
2471
2465
|
"data-line-item-row": ""
|
|
2472
2466
|
}, [
|
|
2473
|
-
R(o).isEditable.value ? (F(), A("td", ni, [M(
|
|
2467
|
+
R(o).isEditable.value ? (F(), A("td", ni, [M(Ar)])) : k("", !0),
|
|
2474
2468
|
R(o).isEditable.value ? (F(), A("td", {
|
|
2475
2469
|
key: 1,
|
|
2476
|
-
class:
|
|
2477
|
-
}, [M(R(
|
|
2470
|
+
class: $e([t.line.groupId === null ? "px-xs" : "pr-xs pl-lg", "py-none text-center"])
|
|
2471
|
+
}, [M(R(kt), {
|
|
2478
2472
|
id: S("select-row"),
|
|
2479
2473
|
"model-value": R(o).selection.isSelected(t.line.id),
|
|
2480
2474
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.item"),
|
|
@@ -2487,29 +2481,29 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2487
2481
|
"label",
|
|
2488
2482
|
"is-disabled"
|
|
2489
2483
|
])], 2)) : k("", !0),
|
|
2490
|
-
j("td", ri, [j("div", { class:
|
|
2484
|
+
j("td", ri, [j("div", { class: $e(t.line.groupId === null ? void 0 : "\n ml-sm border-l-2 border-secondary pl-md\n ") }, [M(Rr, P({
|
|
2491
2485
|
id: S("name"),
|
|
2492
2486
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.item"),
|
|
2493
2487
|
placeholder: R(n).t("wise_invoicing.invoice.detail.line_items.item_placeholder"),
|
|
2494
2488
|
"is-disabled": !R(o).isEditable.value
|
|
2495
|
-
}, R(
|
|
2489
|
+
}, R(Pe)(R(m))), null, 16, [
|
|
2496
2490
|
"id",
|
|
2497
2491
|
"label",
|
|
2498
2492
|
"placeholder",
|
|
2499
2493
|
"is-disabled"
|
|
2500
2494
|
])], 2)]),
|
|
2501
|
-
j("td", ii, [M(
|
|
2495
|
+
j("td", ii, [M(Rr, P({
|
|
2502
2496
|
id: S("description"),
|
|
2503
2497
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.item_description"),
|
|
2504
2498
|
placeholder: R(n).t("wise_invoicing.invoice.detail.line_items.item_description_placeholder"),
|
|
2505
2499
|
"is-disabled": !R(o).isEditable.value
|
|
2506
|
-
}, R(
|
|
2500
|
+
}, R(Pe)(R(h))), null, 16, [
|
|
2507
2501
|
"id",
|
|
2508
2502
|
"label",
|
|
2509
2503
|
"placeholder",
|
|
2510
2504
|
"is-disabled"
|
|
2511
2505
|
])]),
|
|
2512
|
-
(F(!0), A(E, null,
|
|
2506
|
+
(F(!0), A(E, null, st(ne.value, (e) => (F(), A("td", {
|
|
2513
2507
|
key: e.definition.uuid,
|
|
2514
2508
|
class: "p-none"
|
|
2515
2509
|
}, [R(o).isEditable.value ? (F(), O(ei, {
|
|
@@ -2526,7 +2520,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2526
2520
|
"definition",
|
|
2527
2521
|
"model-value",
|
|
2528
2522
|
"precision"
|
|
2529
|
-
])) : e.value === null ? k("", !0) : (F(), O(
|
|
2523
|
+
])) : e.value === null ? k("", !0) : (F(), O(Me, {
|
|
2530
2524
|
key: 1,
|
|
2531
2525
|
definition: e.definition,
|
|
2532
2526
|
value: e.value,
|
|
@@ -2538,7 +2532,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2538
2532
|
"is-disabled": !R(o).isEditable.value,
|
|
2539
2533
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.qty"),
|
|
2540
2534
|
step: "0.01"
|
|
2541
|
-
}, R(
|
|
2535
|
+
}, R(Pe)(R(g))), null, 16, [
|
|
2542
2536
|
"id",
|
|
2543
2537
|
"is-disabled",
|
|
2544
2538
|
"label"
|
|
@@ -2548,7 +2542,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2548
2542
|
"is-disabled": !R(o).isEditable.value,
|
|
2549
2543
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.unit"),
|
|
2550
2544
|
options: R(l)
|
|
2551
|
-
}, R(
|
|
2545
|
+
}, R(Pe)(R(v))), null, 16, [
|
|
2552
2546
|
"id",
|
|
2553
2547
|
"is-disabled",
|
|
2554
2548
|
"label",
|
|
@@ -2562,7 +2556,7 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2562
2556
|
suffix: u.value.position === "suffix" ? u.value.symbol : void 0,
|
|
2563
2557
|
min: "0",
|
|
2564
2558
|
step: "0.01"
|
|
2565
|
-
}, R(
|
|
2559
|
+
}, R(Pe)(R(y))), null, 16, [
|
|
2566
2560
|
"id",
|
|
2567
2561
|
"is-disabled",
|
|
2568
2562
|
"label",
|
|
@@ -2578,31 +2572,31 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2578
2572
|
max: "100",
|
|
2579
2573
|
step: "0.01",
|
|
2580
2574
|
suffix: "%"
|
|
2581
|
-
}, R(
|
|
2575
|
+
}, R(Pe)(R(b))), null, 16, [
|
|
2582
2576
|
"id",
|
|
2583
2577
|
"label",
|
|
2584
2578
|
"is-disabled"
|
|
2585
2579
|
])])) : k("", !0),
|
|
2586
|
-
j("td", li, L(
|
|
2580
|
+
j("td", li, L(ie(t.net)), 1),
|
|
2587
2581
|
j("td", ui, [M($r, P({
|
|
2588
2582
|
id: S("vat-rate"),
|
|
2589
2583
|
"is-disabled": !R(o).isEditable.value,
|
|
2590
2584
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.vat"),
|
|
2591
2585
|
options: R(c)
|
|
2592
|
-
}, R(
|
|
2586
|
+
}, R(Pe)(R(ee))), null, 16, [
|
|
2593
2587
|
"id",
|
|
2594
2588
|
"is-disabled",
|
|
2595
2589
|
"label",
|
|
2596
2590
|
"options"
|
|
2597
2591
|
])]),
|
|
2598
|
-
j("td", di, L(
|
|
2592
|
+
j("td", di, L(ae(t.gross)), 1),
|
|
2599
2593
|
R(o).isEditable.value ? (F(), A("td", fi, [M(R(B), {
|
|
2600
2594
|
justify: "end",
|
|
2601
2595
|
gap: "xxs",
|
|
2602
2596
|
class: "opacity-0 transition group-focus-within/row:opacity-100 group-hover/row:opacity-100"
|
|
2603
2597
|
}, {
|
|
2604
|
-
default: z(() => [M(R(
|
|
2605
|
-
icon: R(
|
|
2598
|
+
default: z(() => [M(R(Xt), {
|
|
2599
|
+
icon: R(ge),
|
|
2606
2600
|
"is-disabled": !R(o).isEditable.value,
|
|
2607
2601
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.duplicate"),
|
|
2608
2602
|
variant: "tertiary",
|
|
@@ -2611,12 +2605,12 @@ var Xr = /* @__PURE__ */ N({
|
|
|
2611
2605
|
"icon",
|
|
2612
2606
|
"is-disabled",
|
|
2613
2607
|
"label"
|
|
2614
|
-
]), M(R(
|
|
2615
|
-
icon: R(
|
|
2608
|
+
]), M(R(Xt), {
|
|
2609
|
+
icon: R(me),
|
|
2616
2610
|
"is-disabled": !R(o).isEditable.value,
|
|
2617
2611
|
label: R(n).t("wise_invoicing.invoice.detail.line_items.delete"),
|
|
2618
2612
|
variant: "destructive-tertiary",
|
|
2619
|
-
onClick:
|
|
2613
|
+
onClick: re
|
|
2620
2614
|
}, null, 8, [
|
|
2621
2615
|
"icon",
|
|
2622
2616
|
"is-disabled",
|
|
@@ -2730,7 +2724,7 @@ function yi(e) {
|
|
|
2730
2724
|
}
|
|
2731
2725
|
}
|
|
2732
2726
|
async function a(e, t) {
|
|
2733
|
-
e !== null && (await
|
|
2727
|
+
e !== null && (await Qe(), n(e, t));
|
|
2734
2728
|
}
|
|
2735
2729
|
return { onKeydown: i };
|
|
2736
2730
|
}
|
|
@@ -3554,8 +3548,8 @@ Q.prototype = {
|
|
|
3554
3548
|
if (n = b, i = K(n), jo(X, t, q, r, n, i, e, !1) !== !1) return g(), t.insertBefore(q, b), J = t, v(), _(!0);
|
|
3555
3549
|
} else if (n.parentNode === t) {
|
|
3556
3550
|
i = K(n);
|
|
3557
|
-
var x = 0, ee, te = q.parentNode !== t,
|
|
3558
|
-
so !== n && (ee = i[
|
|
3551
|
+
var x = 0, ee, te = q.parentNode !== t, ne = !Co(q.animated && q.toRect || r, n.animated && n.toRect || i, f), S = f ? "top" : "left", C = ga(n, "top", "top") || ga(q, "top", "top"), re = C ? C.scrollTop : void 0;
|
|
3552
|
+
so !== n && (ee = i[S], lo = !1, uo = !ne && o.invertSwap || te), x = Io(e, n, i, f, ne ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, uo, so === n);
|
|
3559
3553
|
var ie;
|
|
3560
3554
|
if (x !== 0) {
|
|
3561
3555
|
var ae = ya(q);
|
|
@@ -3568,7 +3562,7 @@ Q.prototype = {
|
|
|
3568
3562
|
var oe = n.nextElementSibling, se = !1;
|
|
3569
3563
|
se = x === 1;
|
|
3570
3564
|
var ce = jo(X, t, q, r, n, i, e, se);
|
|
3571
|
-
if (ce !== !1) return (ce === 1 || ce === -1) && (se = ce === 1), ho = !0, setTimeout(No, 30), g(), se && !oe ? t.appendChild(q) : n.parentNode.insertBefore(q, se ? oe : n),
|
|
3565
|
+
if (ce !== !1) return (ce === 1 || ce === -1) && (se = ce === 1), ho = !0, setTimeout(No, 30), g(), se && !oe ? t.appendChild(q) : n.parentNode.insertBefore(q, se ? oe : n), C && Oa(C, 0, re - C.scrollTop), J = q.parentNode, ee !== void 0 && !uo && (fo = Math.abs(ee - K(n)[S])), v(), _(!0);
|
|
3572
3566
|
}
|
|
3573
3567
|
if (t.contains(q)) return _(!1);
|
|
3574
3568
|
}
|
|
@@ -3852,9 +3846,9 @@ var Qo = Ea(function(e, t, n, r) {
|
|
|
3852
3846
|
Uo !== n && (Uo = n, Xo(), Ho = t.scroll, u = t.scrollFn, Ho === !0 && (Ho = Sa(n, !0)));
|
|
3853
3847
|
var d = 0, f = Ho;
|
|
3854
3848
|
do {
|
|
3855
|
-
var p = f, m = K(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, ee = void 0, te = p.scrollWidth,
|
|
3856
|
-
p === c ? (x = y < te && (
|
|
3857
|
-
var ie = x && (Math.abs(v - i) <= o &&
|
|
3849
|
+
var p = f, m = K(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, ee = void 0, te = p.scrollWidth, ne = p.scrollHeight, S = G(p), C = p.scrollLeft, re = p.scrollTop;
|
|
3850
|
+
p === c ? (x = y < te && (S.overflowX === "auto" || S.overflowX === "scroll" || S.overflowX === "visible"), ee = b < ne && (S.overflowY === "auto" || S.overflowY === "scroll" || S.overflowY === "visible")) : (x = y < te && (S.overflowX === "auto" || S.overflowX === "scroll"), ee = b < ne && (S.overflowY === "auto" || S.overflowY === "scroll"));
|
|
3851
|
+
var ie = x && (Math.abs(v - i) <= o && C + y < te) - (Math.abs(_ - i) <= o && !!C), ae = ee && (Math.abs(g - a) <= o && re + b < ne) - (Math.abs(h - a) <= o && !!re);
|
|
3858
3852
|
if (!$[d]) for (var oe = 0; oe <= d; oe++) $[oe] || ($[oe] = {});
|
|
3859
3853
|
($[d].vx != ie || $[d].vy != ae || $[d].el !== p) && ($[d].el = p, $[d].vx = ie, $[d].vy = ae, clearInterval($[d].pid), (ie != 0 || ae != 0) && (l = !0, $[d].pid = setInterval(function() {
|
|
3860
3854
|
r && this.layer === 0 && Q.active._onTouchMove(qo);
|
|
@@ -3903,10 +3897,10 @@ function ns(e) {
|
|
|
3903
3897
|
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
3904
3898
|
}
|
|
3905
3899
|
function rs(e) {
|
|
3906
|
-
|
|
3900
|
+
Ke() && it(e);
|
|
3907
3901
|
}
|
|
3908
3902
|
function is(e) {
|
|
3909
|
-
|
|
3903
|
+
Ke() ? rt(e) : Qe(e);
|
|
3910
3904
|
}
|
|
3911
3905
|
var as = null, os = null;
|
|
3912
3906
|
function ss(e = null, t = null) {
|
|
@@ -3920,7 +3914,7 @@ function cs() {
|
|
|
3920
3914
|
}
|
|
3921
3915
|
var ls = Symbol("cloneElement");
|
|
3922
3916
|
function us(...e) {
|
|
3923
|
-
let t =
|
|
3917
|
+
let t = Ke()?.proxy, n = null, r = e[0], [, i, a] = e;
|
|
3924
3918
|
Array.isArray(R(i)) || (a = i, i = null);
|
|
3925
3919
|
let o = null, { immediate: s = !0, clone: c = ns, forceFallback: l, fallbackOnBody: u, customUpdate: d } = R(a) ?? {};
|
|
3926
3920
|
function f(e) {
|
|
@@ -3932,7 +3926,7 @@ function us(...e) {
|
|
|
3932
3926
|
function p(e) {
|
|
3933
3927
|
let t = e.item[ls];
|
|
3934
3928
|
if (!Fi(t)) {
|
|
3935
|
-
if (Ri(e.item),
|
|
3929
|
+
if (Ri(e.item), Xe(i)) {
|
|
3936
3930
|
let n = [...R(i)];
|
|
3937
3931
|
i.value = Pi(n, e.newDraggableIndex, t);
|
|
3938
3932
|
return;
|
|
@@ -3946,7 +3940,7 @@ function us(...e) {
|
|
|
3946
3940
|
Ri(s);
|
|
3947
3941
|
return;
|
|
3948
3942
|
}
|
|
3949
|
-
if (
|
|
3943
|
+
if (Xe(i)) {
|
|
3950
3944
|
let e = [...R(i)];
|
|
3951
3945
|
i.value = Ni(e, a);
|
|
3952
3946
|
return;
|
|
@@ -3959,7 +3953,7 @@ function us(...e) {
|
|
|
3959
3953
|
return;
|
|
3960
3954
|
}
|
|
3961
3955
|
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, newDraggableIndex: o } = e;
|
|
3962
|
-
if (Ri(n), Li(t, n, r),
|
|
3956
|
+
if (Ri(n), Li(t, n, r), Xe(i)) {
|
|
3963
3957
|
let e = [...R(i)];
|
|
3964
3958
|
i.value = Ai(e, a, o);
|
|
3965
3959
|
return;
|
|
@@ -3982,7 +3976,7 @@ function us(...e) {
|
|
|
3982
3976
|
} finally {
|
|
3983
3977
|
n = null;
|
|
3984
3978
|
}
|
|
3985
|
-
|
|
3979
|
+
Qe(() => {
|
|
3986
3980
|
if (ss(), o) throw o;
|
|
3987
3981
|
});
|
|
3988
3982
|
}
|
|
@@ -4006,7 +4000,7 @@ function us(...e) {
|
|
|
4006
4000
|
let b = (e) => {
|
|
4007
4001
|
e = v(e), o && x.destroy(), o = new Q(e, y());
|
|
4008
4002
|
};
|
|
4009
|
-
|
|
4003
|
+
ht(() => a, () => {
|
|
4010
4004
|
o && Ui(y(), (e, t) => {
|
|
4011
4005
|
o?.option(e, t);
|
|
4012
4006
|
});
|
|
@@ -4100,7 +4094,7 @@ N({
|
|
|
4100
4094
|
let r = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
|
|
4101
4095
|
return e[r] = (...e) => n(t, ...e), e;
|
|
4102
4096
|
}, {}), o = D(() => {
|
|
4103
|
-
let t =
|
|
4097
|
+
let t = ut(e), { modelValue: n } = t, r = Ei(t, ["modelValue"]), o = Object.entries(r).reduce((e, [t, n]) => {
|
|
4104
4098
|
let r = R(n);
|
|
4105
4099
|
return r !== void 0 && (e[t] = r), e;
|
|
4106
4100
|
}, {});
|
|
@@ -4108,8 +4102,8 @@ N({
|
|
|
4108
4102
|
}), s = D({
|
|
4109
4103
|
get: () => e.modelValue,
|
|
4110
4104
|
set: (e) => n("update:modelValue", e)
|
|
4111
|
-
}), c = I(), l =
|
|
4112
|
-
return r(l), () =>
|
|
4105
|
+
}), c = I(), l = ot(us(e.target || c, s, o));
|
|
4106
|
+
return r(l), () => Je(e.tag || "div", { ref: c }, (t?.default)?.call(t, l));
|
|
4113
4107
|
}
|
|
4114
4108
|
});
|
|
4115
4109
|
var ps = {
|
|
@@ -4225,18 +4219,18 @@ function gs(e) {
|
|
|
4225
4219
|
}
|
|
4226
4220
|
}),
|
|
4227
4221
|
set: () => {}
|
|
4228
|
-
}),
|
|
4229
|
-
function
|
|
4222
|
+
}), ne = us(e.tbodyRef, te);
|
|
4223
|
+
function S() {
|
|
4230
4224
|
let t = e.tbodyRef.value;
|
|
4231
|
-
t !== null &&
|
|
4225
|
+
t !== null && ne.start(t);
|
|
4232
4226
|
}
|
|
4233
|
-
return
|
|
4227
|
+
return nt(() => {
|
|
4234
4228
|
v(), p(), h();
|
|
4235
4229
|
}), {
|
|
4236
4230
|
isDragging: t,
|
|
4237
4231
|
dragVersion: n,
|
|
4238
4232
|
dropIntent: r,
|
|
4239
|
-
restart:
|
|
4233
|
+
restart: S
|
|
4240
4234
|
};
|
|
4241
4235
|
}
|
|
4242
4236
|
//#endregion
|
|
@@ -4265,8 +4259,8 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4265
4259
|
}, js = /* @__PURE__ */ N({
|
|
4266
4260
|
__name: "BillingDocumentLineItemsTableGrid",
|
|
4267
4261
|
setup(e) {
|
|
4268
|
-
let t = T(), n =
|
|
4269
|
-
label:
|
|
4262
|
+
let t = T(), n = or(), r = te(), i = D(() => n.lineCustomFieldDefinitions.value.map((e) => ({
|
|
4263
|
+
label: je.getLabel(e, t.locale.value),
|
|
4270
4264
|
widthInRem: 12
|
|
4271
4265
|
}))), a = D(() => {
|
|
4272
4266
|
let e = de(), a = e.map((e) => H.createBillingDocumentLineItemTotals(e)), o = fe(e.map((e) => e.quantity), 5, 8), s = fe(e.map((e) => e.unitPrice), 7, 11), c = fe(e.map((e) => e.discountPercentage?.getValue() ?? 0), 6.5, 9), l = fe(a.map((e) => e.net), 8, 12), u = fe(a.map((e) => e.gross), 8, 12), d = [
|
|
@@ -4326,7 +4320,7 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4326
4320
|
}
|
|
4327
4321
|
];
|
|
4328
4322
|
return n.isEditable.value ? d : d.filter((e) => !e.isHidden);
|
|
4329
|
-
}), o = D(() => a.value.length), s = D(() => a.value.filter((e) => e.label !== void 0)), c = D(() => Math.max(s.value.length - 1, 1)), l = n.displayRows, u =
|
|
4323
|
+
}), o = D(() => a.value.length), s = D(() => a.value.filter((e) => e.label !== void 0)), c = D(() => Math.max(s.value.length - 1, 1)), l = n.displayRows, u = pt("tbodyRef"), d = pt("scrollContainerRef"), f = pt("tableRef"), p = I(!1), m = I(!1);
|
|
4330
4324
|
function h() {
|
|
4331
4325
|
let e = d.value;
|
|
4332
4326
|
if (e === null) {
|
|
@@ -4343,7 +4337,7 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4343
4337
|
left: e * Math.max(t.clientWidth * .75, 320)
|
|
4344
4338
|
});
|
|
4345
4339
|
}
|
|
4346
|
-
|
|
4340
|
+
Ct(d, h), Ct(f, h), rt(h);
|
|
4347
4341
|
let { isDragging: _, dragVersion: v, dropIntent: y, restart: b } = gs({
|
|
4348
4342
|
isEditable: n.isEditable,
|
|
4349
4343
|
moveLineByIndex: (e, t, r) => {
|
|
@@ -4356,7 +4350,7 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4356
4350
|
let t = n.rows.value.findIndex((t) => t.id === e);
|
|
4357
4351
|
return t === -1 ? null : n.mutations.addLine(t + 1);
|
|
4358
4352
|
}
|
|
4359
|
-
function
|
|
4353
|
+
function ee(e) {
|
|
4360
4354
|
let t = n.rows.value, r = t.findIndex((t) => t.id === e);
|
|
4361
4355
|
if (r === -1) return null;
|
|
4362
4356
|
let i = null;
|
|
@@ -4369,18 +4363,18 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4369
4363
|
}
|
|
4370
4364
|
return n.mutations.deleteLine(e), i;
|
|
4371
4365
|
}
|
|
4372
|
-
let
|
|
4366
|
+
let ne = yi({
|
|
4373
4367
|
isEditable: n.isEditable,
|
|
4374
4368
|
addLineBelow: x,
|
|
4375
|
-
deleteEmptyLine:
|
|
4369
|
+
deleteEmptyLine: ee,
|
|
4376
4370
|
duplicateLine: (e) => n.mutations.duplicateLine(e),
|
|
4377
4371
|
tbodyRef: u
|
|
4378
|
-
}),
|
|
4379
|
-
|
|
4380
|
-
|
|
4372
|
+
}), S = I(0);
|
|
4373
|
+
ht(v, async () => {
|
|
4374
|
+
S.value += 1, await Qe(), b();
|
|
4381
4375
|
}, { flush: "post" });
|
|
4382
|
-
let
|
|
4383
|
-
|
|
4376
|
+
let C = I(/* @__PURE__ */ new Set()), re = I(null), ie;
|
|
4377
|
+
nt(() => {
|
|
4384
4378
|
ie !== void 0 && clearTimeout(ie);
|
|
4385
4379
|
});
|
|
4386
4380
|
function ae(e) {
|
|
@@ -4389,23 +4383,23 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4389
4383
|
let oe = D(() => {
|
|
4390
4384
|
let e = /* @__PURE__ */ new Map();
|
|
4391
4385
|
for (let t of l.value) if (H.isLineRow(t.line) && t.line.groupId !== null && t.gross !== null) {
|
|
4392
|
-
let r = e.get(t.line.groupId) ?? 0, i =
|
|
4386
|
+
let r = e.get(t.line.groupId) ?? 0, i = yr.getDisplayGrossLineTotal(n.meta.value.documentType, t.gross, t.line.isDiscount);
|
|
4393
4387
|
e.set(t.line.groupId, r + i);
|
|
4394
4388
|
}
|
|
4395
4389
|
return e;
|
|
4396
4390
|
}), se = D(() => l.value.filter((e) => {
|
|
4397
4391
|
if (!H.isLineRow(e.line)) return !0;
|
|
4398
4392
|
let { groupId: t } = e.line;
|
|
4399
|
-
return t === null || !
|
|
4393
|
+
return t === null || !C.value.has(t);
|
|
4400
4394
|
})), ce = D(() => `${a.value.reduce((e, t) => e + (t.widthInRem ?? t.minWidthInRem ?? 0), 0)}rem`);
|
|
4401
4395
|
function le(e) {
|
|
4402
|
-
let t = new Set(
|
|
4403
|
-
t.has(e) ? (t.delete(e), pe(e)) : t.add(e),
|
|
4396
|
+
let t = new Set(C.value);
|
|
4397
|
+
t.has(e) ? (t.delete(e), pe(e)) : t.add(e), C.value = t;
|
|
4404
4398
|
}
|
|
4405
4399
|
function ue(e) {
|
|
4406
|
-
if (!
|
|
4407
|
-
let t = new Set(
|
|
4408
|
-
t.delete(e),
|
|
4400
|
+
if (!C.value.has(e)) return;
|
|
4401
|
+
let t = new Set(C.value);
|
|
4402
|
+
t.delete(e), C.value = t, pe(e);
|
|
4409
4403
|
}
|
|
4410
4404
|
function de() {
|
|
4411
4405
|
return n.rows.value.filter((e) => H.isLineRow(e));
|
|
@@ -4428,7 +4422,7 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4428
4422
|
}
|
|
4429
4423
|
function he(e) {
|
|
4430
4424
|
let t = se.value[e - 1]?.line;
|
|
4431
|
-
if (t !== void 0 && H.isGroupRow(t) &&
|
|
4425
|
+
if (t !== void 0 && H.isGroupRow(t) && C.value.has(t.id)) {
|
|
4432
4426
|
let e = l.value.findIndex((e) => e.line.id === t.id);
|
|
4433
4427
|
if (e !== -1) return e + 1;
|
|
4434
4428
|
}
|
|
@@ -4439,11 +4433,11 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4439
4433
|
return !(n !== void 0 && H.isGroupRow(n) || r !== void 0 && H.isLineRow(r) && r.groupId !== null);
|
|
4440
4434
|
}
|
|
4441
4435
|
async function _e(e) {
|
|
4442
|
-
await
|
|
4436
|
+
await Qe();
|
|
4443
4437
|
let t = u.value?.querySelector(`input[id="billing-document-line-items-name-${e}"]`);
|
|
4444
4438
|
t?.focus(), t?.select();
|
|
4445
4439
|
}
|
|
4446
|
-
function
|
|
4440
|
+
function ve(e) {
|
|
4447
4441
|
if (!n.isEditable.value) return;
|
|
4448
4442
|
let t = n.mutations.addLine(he(e)), r = n.rows.value.find((e) => e.id === t);
|
|
4449
4443
|
r !== void 0 && H.isLineRow(r) && r.groupId !== null && ue(r.groupId), _e(t);
|
|
@@ -4455,25 +4449,25 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4455
4449
|
j("div", {
|
|
4456
4450
|
ref_key: "scrollContainerRef",
|
|
4457
4451
|
ref: d,
|
|
4458
|
-
class:
|
|
4452
|
+
class: $e([R(_) ? "select-none" : void 0, "overflow-x-auto overflow-y-hidden"]),
|
|
4459
4453
|
"data-test-id": "billing-document-line-items-scroll-container",
|
|
4460
4454
|
onScroll: h
|
|
4461
4455
|
}, [j("table", {
|
|
4462
4456
|
ref_key: "tableRef",
|
|
4463
4457
|
ref: f,
|
|
4464
|
-
style:
|
|
4458
|
+
style: tt({
|
|
4465
4459
|
minWidth: ce.value,
|
|
4466
4460
|
width: "100%"
|
|
4467
4461
|
}),
|
|
4468
4462
|
class: "table-fixed text-left"
|
|
4469
4463
|
}, [
|
|
4470
|
-
j("colgroup", null, [(F(!0), A(E, null,
|
|
4464
|
+
j("colgroup", null, [(F(!0), A(E, null, st(a.value, (e, t) => (F(), A("col", {
|
|
4471
4465
|
key: t,
|
|
4472
|
-
style:
|
|
4466
|
+
style: tt(e.widthInRem === void 0 ? {} : { width: `${e.widthInRem}rem` })
|
|
4473
4467
|
}, null, 4))), 128))]),
|
|
4474
4468
|
j("thead", null, [j("tr", vs, [
|
|
4475
4469
|
R(n).isEditable.value ? (F(), A("th", ys)) : k("", !0),
|
|
4476
|
-
R(n).isEditable.value ? (F(), A("th", bs, [M(R(
|
|
4470
|
+
R(n).isEditable.value ? (F(), A("th", bs, [M(R(kt), {
|
|
4477
4471
|
id: "billing-document-line-items-select-all",
|
|
4478
4472
|
"model-value": R(n).selection.allSelected.value || R(n).selection.indeterminate.value,
|
|
4479
4473
|
"is-indeterminate": R(n).selection.indeterminate.value,
|
|
@@ -4487,38 +4481,38 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4487
4481
|
"label",
|
|
4488
4482
|
"is-disabled"
|
|
4489
4483
|
])])) : k("", !0),
|
|
4490
|
-
(F(!0), A(E, null,
|
|
4484
|
+
(F(!0), A(E, null, st(s.value, (e, t) => (F(), A("th", {
|
|
4491
4485
|
key: t,
|
|
4492
|
-
class:
|
|
4486
|
+
class: $e([e.align === "right" ? "text-right" : "text-left", "h-11 px-lg py-sm text-xs font-semibold text-tertiary"]),
|
|
4493
4487
|
scope: "col"
|
|
4494
4488
|
}, L(e.label), 3))), 128)),
|
|
4495
4489
|
R(n).isEditable.value ? (F(), A("th", xs)) : k("", !0)
|
|
4496
4490
|
])]),
|
|
4497
4491
|
(F(), A("tbody", {
|
|
4498
|
-
key:
|
|
4492
|
+
key: S.value,
|
|
4499
4493
|
ref_key: "tbodyRef",
|
|
4500
4494
|
ref: u,
|
|
4501
4495
|
"data-drop-intent": R(y) ?? void 0,
|
|
4502
|
-
onKeydownCapture: r[3] ||= (...e) => R(
|
|
4496
|
+
onKeydownCapture: r[3] ||= (...e) => R(ne).onKeydown && R(ne).onKeydown(...e)
|
|
4503
4497
|
}, [
|
|
4504
|
-
(F(!0), A(E, null,
|
|
4498
|
+
(F(!0), A(E, null, st(se.value, (e, r) => (F(), A(E, { key: e.line.id }, [R(n).isEditable.value ? gt((F(), A("tr", Cs, [j("td", {
|
|
4505
4499
|
colspan: o.value,
|
|
4506
4500
|
class: "relative h-0 overflow-visible p-none"
|
|
4507
|
-
}, [M(
|
|
4501
|
+
}, [M(Er, {
|
|
4508
4502
|
"can-add-group": ge(r),
|
|
4509
4503
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.insert_line"),
|
|
4510
|
-
onAddLine: (e) =>
|
|
4504
|
+
onAddLine: (e) => ve(r),
|
|
4511
4505
|
onAddGroup: (e) => be(r)
|
|
4512
4506
|
}, null, 8, [
|
|
4513
4507
|
"can-add-group",
|
|
4514
4508
|
"label",
|
|
4515
4509
|
"onAddLine",
|
|
4516
4510
|
"onAddGroup"
|
|
4517
|
-
])], 8, ws)], 512)), [[
|
|
4511
|
+
])], 8, ws)], 512)), [[mt, !R(_)]]) : k("", !0), R(H).isGroupRow(e.line) ? (F(), O(Kr, {
|
|
4518
4512
|
key: 1,
|
|
4519
4513
|
"content-column-span": c.value,
|
|
4520
4514
|
group: e.line,
|
|
4521
|
-
"is-collapsed":
|
|
4515
|
+
"is-collapsed": C.value.has(e.line.id),
|
|
4522
4516
|
total: oe.value.get(e.line.id) ?? null,
|
|
4523
4517
|
onToggleCollapse: (t) => le(e.line.id)
|
|
4524
4518
|
}, null, 8, [
|
|
@@ -4539,16 +4533,16 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4539
4533
|
"gross",
|
|
4540
4534
|
"is-appearing"
|
|
4541
4535
|
]))], 64))), 128)),
|
|
4542
|
-
se.value.length > 0 && R(n).isEditable.value ?
|
|
4536
|
+
se.value.length > 0 && R(n).isEditable.value ? gt((F(), A("tr", Ts, [j("td", {
|
|
4543
4537
|
colspan: o.value,
|
|
4544
4538
|
class: "relative h-5 overflow-visible p-none"
|
|
4545
|
-
}, [M(
|
|
4539
|
+
}, [M(Er, {
|
|
4546
4540
|
"can-add-group": ge(se.value.length),
|
|
4547
4541
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.insert_line"),
|
|
4548
4542
|
placement: "end",
|
|
4549
|
-
onAddLine: r[1] ||= (e) =>
|
|
4543
|
+
onAddLine: r[1] ||= (e) => ve(se.value.length),
|
|
4550
4544
|
onAddGroup: r[2] ||= (e) => be(se.value.length)
|
|
4551
|
-
}, null, 8, ["can-add-group", "label"])], 8, Es)], 512)), [[
|
|
4545
|
+
}, null, 8, ["can-add-group", "label"])], 8, Es)], 512)), [[mt, !R(_)]]) : k("", !0),
|
|
4552
4546
|
se.value.length === 0 && !R(n).isEditable.value ? (F(), A("tr", Ds, [j("td", {
|
|
4553
4547
|
colspan: o.value,
|
|
4554
4548
|
class: "px-lg py-xl text-center"
|
|
@@ -4558,16 +4552,16 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4558
4552
|
}, null, 8, ["text"])], 8, Os)])) : k("", !0)
|
|
4559
4553
|
], 40, Ss))
|
|
4560
4554
|
], 4)], 34),
|
|
4561
|
-
p.value ? (F(), A("div", ks, [M(R(
|
|
4562
|
-
icon: R(
|
|
4555
|
+
p.value ? (F(), A("div", ks, [M(R(Xt), {
|
|
4556
|
+
icon: R(Oe),
|
|
4563
4557
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.scroll_left"),
|
|
4564
4558
|
class: "pointer-events-auto shadow-md",
|
|
4565
4559
|
size: "sm",
|
|
4566
4560
|
variant: "secondary",
|
|
4567
4561
|
onClick: r[4] ||= (e) => g(-1)
|
|
4568
4562
|
}, null, 8, ["icon", "label"])])) : k("", !0),
|
|
4569
|
-
m.value ? (F(), A("div", As, [M(R(
|
|
4570
|
-
icon: R(
|
|
4563
|
+
m.value ? (F(), A("div", As, [M(R(Xt), {
|
|
4564
|
+
icon: R(ye),
|
|
4571
4565
|
label: R(t).t("wise_invoicing.invoice.detail.line_items.scroll_right"),
|
|
4572
4566
|
class: "pointer-events-auto shadow-md",
|
|
4573
4567
|
size: "sm",
|
|
@@ -4584,7 +4578,7 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4584
4578
|
} },
|
|
4585
4579
|
emits: ["applyDiscount"],
|
|
4586
4580
|
setup(e, { emit: t }) {
|
|
4587
|
-
let n = e, r = t, i = T(), a =
|
|
4581
|
+
let n = e, r = t, i = T(), a = or(), o = D(() => a.isEditable.value ? a.hasInvalidRows.value && a.isDirty.value ? {
|
|
4588
4582
|
isBlocking: !0,
|
|
4589
4583
|
text: i.t("wise_invoicing.invoice.detail.line_items.save_blocked")
|
|
4590
4584
|
} : a.saveState.value === "error" ? {
|
|
@@ -4614,12 +4608,12 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4614
4608
|
class: "shrink-0 text-sm font-semibold text-primary"
|
|
4615
4609
|
}, null, 8, ["text"]), o.value === null ? k("", !0) : (F(), O(R(B), {
|
|
4616
4610
|
key: 0,
|
|
4617
|
-
class:
|
|
4611
|
+
class: $e([o.value.isBlocking ? "text-error-primary" : "text-tertiary", "min-w-0 gap-xs"]),
|
|
4618
4612
|
align: "center",
|
|
4619
4613
|
"aria-live": "polite",
|
|
4620
4614
|
"data-test-id": "billing-document-line-items-save-status"
|
|
4621
4615
|
}, {
|
|
4622
|
-
default: z(() => [o.value.isBlocking ? (F(), O(R(
|
|
4616
|
+
default: z(() => [o.value.isBlocking ? (F(), O(R(se), {
|
|
4623
4617
|
key: 0,
|
|
4624
4618
|
class: "size-4 shrink-0"
|
|
4625
4619
|
})) : k("", !0), M(R(V), {
|
|
@@ -4630,10 +4624,10 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4630
4624
|
}, 8, ["class"]))]),
|
|
4631
4625
|
_: 1
|
|
4632
4626
|
}), M(R(B), { class: "shrink-0 gap-sm" }, {
|
|
4633
|
-
default: z(() => [n.showApplyDiscount ? (F(), O(R(
|
|
4627
|
+
default: z(() => [n.showApplyDiscount ? (F(), O(R(Ot), {
|
|
4634
4628
|
key: 0,
|
|
4635
4629
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.global_discount"),
|
|
4636
|
-
"icon-left": R(
|
|
4630
|
+
"icon-left": R(we),
|
|
4637
4631
|
"is-disabled": !R(a).isEditable.value,
|
|
4638
4632
|
variant: "secondary",
|
|
4639
4633
|
onClick: s
|
|
@@ -4641,7 +4635,7 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4641
4635
|
"label",
|
|
4642
4636
|
"icon-left",
|
|
4643
4637
|
"is-disabled"
|
|
4644
|
-
])) : k("", !0), M(R(
|
|
4638
|
+
])) : k("", !0), M(R(Ot), {
|
|
4645
4639
|
label: R(i).t("wise_invoicing.invoice.detail.line_items.add_item"),
|
|
4646
4640
|
"icon-left": R(C),
|
|
4647
4641
|
"is-disabled": !R(a).isEditable.value,
|
|
@@ -4658,17 +4652,17 @@ var _s = { class: "relative" }, vs = { class: "border-b border-secondary bg-seco
|
|
|
4658
4652
|
}
|
|
4659
4653
|
}), Ns = {}, Ps = { class: "relative w-full rounded-lg border border-secondary bg-primary shadow-sm" };
|
|
4660
4654
|
function Fs(e, t) {
|
|
4661
|
-
return F(), A("section", Ps, [
|
|
4655
|
+
return F(), A("section", Ps, [ct(e.$slots, "default")]);
|
|
4662
4656
|
}
|
|
4663
|
-
var Is = /*#__PURE__*/
|
|
4657
|
+
var Is = /*#__PURE__*/ Fe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
4664
4658
|
__name: "BillingDocumentLineItemsTotals",
|
|
4665
4659
|
props: { billingDocument: {} },
|
|
4666
4660
|
setup(e) {
|
|
4667
4661
|
let t = e, n = T(), r = _();
|
|
4668
4662
|
function i(e) {
|
|
4669
|
-
return r.formatMonetary(
|
|
4663
|
+
return r.formatMonetary(yr.getDisplayMonetary(t.billingDocument.type, e));
|
|
4670
4664
|
}
|
|
4671
|
-
let a = D(() => [...
|
|
4665
|
+
let a = D(() => [...Le.sortByVatRate(t.billingDocument.vatSummaries).map((e) => ({
|
|
4672
4666
|
key: `vat-total-${e.vatRate}`,
|
|
4673
4667
|
label: `${e.vatRate}%`,
|
|
4674
4668
|
net: i(e.netAmount),
|
|
@@ -4700,13 +4694,13 @@ var Is = /*#__PURE__*/ Pe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
|
4700
4694
|
align: "end"
|
|
4701
4695
|
}, {
|
|
4702
4696
|
default: z(() => [
|
|
4703
|
-
M(R(
|
|
4697
|
+
M(R(jt), {
|
|
4704
4698
|
gap: "xs",
|
|
4705
4699
|
align: "end",
|
|
4706
4700
|
justify: "center",
|
|
4707
4701
|
class: "w-14 shrink-0 text-xs font-medium text-secondary"
|
|
4708
4702
|
}, {
|
|
4709
|
-
default: z(() => [(F(!0), A(E, null,
|
|
4703
|
+
default: z(() => [(F(!0), A(E, null, st(a.value, (e) => (F(), O(R(V), {
|
|
4710
4704
|
key: e.key,
|
|
4711
4705
|
text: e.label,
|
|
4712
4706
|
as: "div",
|
|
@@ -4715,7 +4709,7 @@ var Is = /*#__PURE__*/ Pe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
|
4715
4709
|
}, null, 8, ["text"]))), 128))]),
|
|
4716
4710
|
_: 1
|
|
4717
4711
|
}),
|
|
4718
|
-
M(R(
|
|
4712
|
+
M(R(jt), {
|
|
4719
4713
|
gap: "xs",
|
|
4720
4714
|
align: "end"
|
|
4721
4715
|
}, {
|
|
@@ -4724,7 +4718,7 @@ var Is = /*#__PURE__*/ Pe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
|
4724
4718
|
as: "div",
|
|
4725
4719
|
class: "text-xs font-medium text-secondary",
|
|
4726
4720
|
"disable-tooltip": ""
|
|
4727
|
-
}, null, 8, ["text"]), (F(!0), A(E, null,
|
|
4721
|
+
}, null, 8, ["text"]), (F(!0), A(E, null, st(a.value, (e) => (F(), O(R(V), {
|
|
4728
4722
|
key: `${e.key}-net`,
|
|
4729
4723
|
text: e.net,
|
|
4730
4724
|
as: "div",
|
|
@@ -4733,7 +4727,7 @@ var Is = /*#__PURE__*/ Pe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
|
4733
4727
|
}, null, 8, ["text"]))), 128))]),
|
|
4734
4728
|
_: 1
|
|
4735
4729
|
}),
|
|
4736
|
-
M(R(
|
|
4730
|
+
M(R(jt), {
|
|
4737
4731
|
gap: "xs",
|
|
4738
4732
|
align: "end"
|
|
4739
4733
|
}, {
|
|
@@ -4742,20 +4736,20 @@ var Is = /*#__PURE__*/ Pe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
|
4742
4736
|
as: "div",
|
|
4743
4737
|
class: "text-xs font-medium text-secondary",
|
|
4744
4738
|
"disable-tooltip": ""
|
|
4745
|
-
}, null, 8, ["text"]), (F(!0), A(E, null,
|
|
4739
|
+
}, null, 8, ["text"]), (F(!0), A(E, null, st(a.value, (e) => (F(), O(R(B), {
|
|
4746
4740
|
key: `${e.key}-vat`,
|
|
4747
4741
|
align: "center",
|
|
4748
4742
|
justify: "end",
|
|
4749
4743
|
gap: "xs",
|
|
4750
4744
|
class: "w-full whitespace-nowrap"
|
|
4751
4745
|
}, {
|
|
4752
|
-
default: z(() => [e.key === "vat-total-overall" ? (F(), O(R(
|
|
4746
|
+
default: z(() => [e.key === "vat-total-overall" ? (F(), O(R(Et), {
|
|
4753
4747
|
key: 0,
|
|
4754
4748
|
label: l.value
|
|
4755
4749
|
}, {
|
|
4756
|
-
default: z(() => [M(R(
|
|
4750
|
+
default: z(() => [M(R(Xt), {
|
|
4757
4751
|
label: R(n).t("wise_invoicing.invoice.detail.totals.info"),
|
|
4758
|
-
icon: R(
|
|
4752
|
+
icon: R(fe),
|
|
4759
4753
|
class: "rounded-full!",
|
|
4760
4754
|
variant: "tertiary"
|
|
4761
4755
|
}, null, 8, ["label", "icon"])]),
|
|
@@ -4773,11 +4767,11 @@ var Is = /*#__PURE__*/ Pe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
|
4773
4767
|
]),
|
|
4774
4768
|
_: 1
|
|
4775
4769
|
}),
|
|
4776
|
-
M(R(
|
|
4770
|
+
M(R(tn), {
|
|
4777
4771
|
orientation: "vertical",
|
|
4778
4772
|
class: "h-24 bg-tertiary"
|
|
4779
4773
|
}),
|
|
4780
|
-
M(R(
|
|
4774
|
+
M(R(jt), {
|
|
4781
4775
|
gap: "sm",
|
|
4782
4776
|
class: "w-auto"
|
|
4783
4777
|
}, {
|
|
@@ -4802,7 +4796,7 @@ var Is = /*#__PURE__*/ Pe(Ns, [["render", Fs]]), Ls = /* @__PURE__ */ N({
|
|
|
4802
4796
|
}, null, 8, ["text"])]),
|
|
4803
4797
|
_: 1
|
|
4804
4798
|
})) : k("", !0),
|
|
4805
|
-
M(R(
|
|
4799
|
+
M(R(tn), {
|
|
4806
4800
|
orientation: "horizontal",
|
|
4807
4801
|
class: "bg-tertiary"
|
|
4808
4802
|
}),
|
|
@@ -4857,8 +4851,8 @@ function Rs(e) {
|
|
|
4857
4851
|
let e = H.buildBillingDocumentLineItemsPayload(u.value, s.value);
|
|
4858
4852
|
return l(e);
|
|
4859
4853
|
}
|
|
4860
|
-
let g =
|
|
4861
|
-
return
|
|
4854
|
+
let g = bt(c, 500);
|
|
4855
|
+
return ht(g, async () => {
|
|
4862
4856
|
!i.value || t.value || !r.value || await m();
|
|
4863
4857
|
}), {
|
|
4864
4858
|
isSaving: a,
|
|
@@ -4872,7 +4866,7 @@ function zs(e, t) {
|
|
|
4872
4866
|
return Number.isFinite(e) ? e : t;
|
|
4873
4867
|
}
|
|
4874
4868
|
function Bs(e) {
|
|
4875
|
-
return e === null || e === 0 ? null : new
|
|
4869
|
+
return e === null || e === 0 ? null : new ee(e);
|
|
4876
4870
|
}
|
|
4877
4871
|
function Vs(e) {
|
|
4878
4872
|
let { hasSaveError: t, isEditable: n, baselineRowsKey: r, billingDocument: i, rows: a, selection: o, meta: s } = e;
|
|
@@ -4954,10 +4948,10 @@ function Vs(e) {
|
|
|
4954
4948
|
function te(e) {
|
|
4955
4949
|
o.selectedIds.value.length !== 0 && (a.value = H.setVatRateForSelectedRows(a.value, new Set(o.selectedIds.value), e));
|
|
4956
4950
|
}
|
|
4957
|
-
function
|
|
4951
|
+
function ne(e) {
|
|
4958
4952
|
o.selectedIds.value.length !== 0 && (a.value = H.setUnitForSelectedRows(a.value, new Set(o.selectedIds.value), e));
|
|
4959
4953
|
}
|
|
4960
|
-
function
|
|
4954
|
+
function S(e, t, n = null) {
|
|
4961
4955
|
if (e === t) return;
|
|
4962
4956
|
let r = a.value.slice(), i = r[e];
|
|
4963
4957
|
if (i === void 0) return;
|
|
@@ -4984,10 +4978,10 @@ function Vs(e) {
|
|
|
4984
4978
|
duplicateLine: v,
|
|
4985
4979
|
duplicateSelectedLines: x,
|
|
4986
4980
|
groupSelectedLines: b,
|
|
4987
|
-
moveLineByIndex:
|
|
4981
|
+
moveLineByIndex: S,
|
|
4988
4982
|
moveSelectedLinesToGroup: ee,
|
|
4989
4983
|
resetToServer: l,
|
|
4990
|
-
setUnitForSelectedLines:
|
|
4984
|
+
setUnitForSelectedLines: ne,
|
|
4991
4985
|
setVatRateForSelectedLines: te,
|
|
4992
4986
|
updateAllFields: f,
|
|
4993
4987
|
updateGroup: d
|
|
@@ -5042,7 +5036,7 @@ function Hs(e) {
|
|
|
5042
5036
|
//#endregion
|
|
5043
5037
|
//#region src/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.ts
|
|
5044
5038
|
function Us(e) {
|
|
5045
|
-
let t = I([]), n = I(""), r = I(!1), i = D(() => e.customFieldDefinitions?.() ?? []), a = D(() =>
|
|
5039
|
+
let t = I([]), n = I(""), r = I(!1), i = D(() => e.customFieldDefinitions?.() ?? []), a = D(() => je.filterByEntityType(i.value, f.INVOICE_LINE)), o = D(() => je.filterByEntityType(i.value, f.INVOICE_LINE_GROUP)), s = D(() => H.createBillingDocumentLineItemsMeta(e.billingDocument())), l = D(() => e.canEdit === void 0 ? e.billingDocument().status === c.DRAFT || e.billingDocument().status === c.READY : e.canEdit.value), u = D(() => H.createBillingDocumentLineItemRowsKey(t.value)), d = D(() => u.value !== n.value), p = D(() => t.value.some((e) => !H.isTransientEmptyLineRow(e) && !H.isBillingDocumentLineItemRowValid(e))), m = D(() => H.createBillingDocumentLineItemsServerSnapshot(e.billingDocument())), h = Hs({ rows: () => t.value }), g = D(() => t.value.map((e) => {
|
|
5046
5040
|
if (H.isGroupRow(e)) return {
|
|
5047
5041
|
discount: null,
|
|
5048
5042
|
gross: null,
|
|
@@ -5078,7 +5072,7 @@ function Us(e) {
|
|
|
5078
5072
|
updateLines: e.updateLines,
|
|
5079
5073
|
meta: s
|
|
5080
5074
|
});
|
|
5081
|
-
return
|
|
5075
|
+
return ht(m, () => _.applyServerRows(), { immediate: !0 }), {
|
|
5082
5076
|
hasInvalidRows: p,
|
|
5083
5077
|
hasSaveError: r,
|
|
5084
5078
|
isDirty: d,
|
|
@@ -5106,7 +5100,7 @@ var Ws = /* @__PURE__ */ N({
|
|
|
5106
5100
|
},
|
|
5107
5101
|
setup(e) {
|
|
5108
5102
|
let t = e;
|
|
5109
|
-
return (e, n) => (F(), O(R(
|
|
5103
|
+
return (e, n) => (F(), O(R(Nt), {
|
|
5110
5104
|
breadcrumbs: t.breadcrumbs,
|
|
5111
5105
|
title: t.title,
|
|
5112
5106
|
"detail-pane": {
|
|
@@ -5117,17 +5111,17 @@ var Ws = /* @__PURE__ */ N({
|
|
|
5117
5111
|
variant: "bordered-inline"
|
|
5118
5112
|
}
|
|
5119
5113
|
}, {
|
|
5120
|
-
default: z(() => [M(R(
|
|
5114
|
+
default: z(() => [M(R(Pt), {
|
|
5121
5115
|
"is-full-width": !0,
|
|
5122
5116
|
"has-vertical-padding": !0
|
|
5123
5117
|
}, {
|
|
5124
|
-
default: z(() => [M(R(
|
|
5125
|
-
default: z(() => [
|
|
5118
|
+
default: z(() => [M(R(jt), { gap: "lg" }, {
|
|
5119
|
+
default: z(() => [ct(e.$slots, "header"), ct(e.$slots, "default")]),
|
|
5126
5120
|
_: 3
|
|
5127
5121
|
})]),
|
|
5128
5122
|
_: 3
|
|
5129
5123
|
})]),
|
|
5130
|
-
"detail-pane": z(() => [
|
|
5124
|
+
"detail-pane": z(() => [ct(e.$slots, "sidebar")]),
|
|
5131
5125
|
_: 3
|
|
5132
5126
|
}, 8, ["breadcrumbs", "title"]));
|
|
5133
5127
|
}
|
|
@@ -5140,13 +5134,13 @@ var Ws = /* @__PURE__ */ N({
|
|
|
5140
5134
|
},
|
|
5141
5135
|
setup(e) {
|
|
5142
5136
|
let t = e, n = h();
|
|
5143
|
-
return
|
|
5137
|
+
return Be(D(() => [])), n.set(() => t.billingDocument.subject ?? t.billingDocument.sequence ?? t.title), (e, n) => (F(), O(Ws, {
|
|
5144
5138
|
breadcrumbs: t.breadcrumbs,
|
|
5145
5139
|
title: t.title
|
|
5146
5140
|
}, {
|
|
5147
|
-
header: z(() => [
|
|
5148
|
-
default: z(() => [
|
|
5149
|
-
sidebar: z(() => [
|
|
5141
|
+
header: z(() => [ct(e.$slots, "header")]),
|
|
5142
|
+
default: z(() => [ct(e.$slots, "default")]),
|
|
5143
|
+
sidebar: z(() => [ct(e.$slots, "sidebar")]),
|
|
5150
5144
|
_: 3
|
|
5151
5145
|
}, 8, ["breadcrumbs", "title"]));
|
|
5152
5146
|
}
|
|
@@ -5168,9 +5162,9 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5168
5162
|
__name: "BillingDocumentPdfViewer",
|
|
5169
5163
|
props: { billingDocument: {} },
|
|
5170
5164
|
setup(e) {
|
|
5171
|
-
let t = e, n = T(), r =
|
|
5172
|
-
let e = t.billingDocument.externalRemarks !== null && t.billingDocument.externalRemarks.trim() !== "", n =
|
|
5173
|
-
return
|
|
5165
|
+
let t = e, n = T(), r = He(), i = I(75), a = I(1), o = I(null), c = D(() => {
|
|
5166
|
+
let e = t.billingDocument.externalRemarks !== null && t.billingDocument.externalRemarks.trim() !== "", n = Re.buildRows(t.billingDocument, { isCreditNote: t.billingDocument.type === s.CREDIT_NOTE });
|
|
5167
|
+
return Re.paginateRows(n, { hasRemarks: e }).length;
|
|
5174
5168
|
}), l = D(() => t.billingDocument.type === s.CREDIT_NOTE ? n.t("wise_invoicing.common.credit_note_pdf") : n.t("wise_invoicing.common.invoice_pdf"));
|
|
5175
5169
|
function u() {
|
|
5176
5170
|
i.value = Math.min(Zs, i.value + Qs);
|
|
@@ -5216,11 +5210,11 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5216
5210
|
for (let t of e) _.observe(t);
|
|
5217
5211
|
}
|
|
5218
5212
|
}
|
|
5219
|
-
return
|
|
5213
|
+
return rt(() => {
|
|
5220
5214
|
v();
|
|
5221
|
-
}),
|
|
5215
|
+
}), it(() => {
|
|
5222
5216
|
_?.disconnect();
|
|
5223
|
-
}), (e, r) => (F(), O(R(
|
|
5217
|
+
}), (e, r) => (F(), O(R(jt), {
|
|
5224
5218
|
gap: "none",
|
|
5225
5219
|
class: "flex-1 overflow-hidden rounded-xl border border-secondary"
|
|
5226
5220
|
}, {
|
|
@@ -5229,8 +5223,8 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5229
5223
|
justify: "between",
|
|
5230
5224
|
class: "w-full border-b border-secondary bg-primary px-lg py-md"
|
|
5231
5225
|
}, {
|
|
5232
|
-
default: z(() => [j("p", qs, L(l.value), 1), M(R(
|
|
5233
|
-
icon: R(
|
|
5226
|
+
default: z(() => [j("p", qs, L(l.value), 1), M(R(Xt), {
|
|
5227
|
+
icon: R(be),
|
|
5234
5228
|
label: R(n).t("wise_invoicing.common.pdf_viewer.expand"),
|
|
5235
5229
|
variant: "tertiary",
|
|
5236
5230
|
onClick: g
|
|
@@ -5242,18 +5236,18 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5242
5236
|
ref: o,
|
|
5243
5237
|
class: "flex min-h-0 w-full flex-1 flex-col overflow-y-auto bg-tertiary py-lg"
|
|
5244
5238
|
}, [j("div", {
|
|
5245
|
-
style:
|
|
5239
|
+
style: tt({ zoom: i.value / 100 }),
|
|
5246
5240
|
class: "p-2xl"
|
|
5247
|
-
}, [M(
|
|
5241
|
+
}, [M(ze, { "billing-document": t.billingDocument }, null, 8, ["billing-document"])], 4)], 512),
|
|
5248
5242
|
M(R(B), {
|
|
5249
5243
|
justify: "between",
|
|
5250
5244
|
class: "w-full border-t border-secondary bg-primary p-md"
|
|
5251
5245
|
}, {
|
|
5252
5246
|
default: z(() => [M(R(B), { gap: "xs" }, {
|
|
5253
5247
|
default: z(() => [
|
|
5254
|
-
M(R(
|
|
5248
|
+
M(R(Xt), {
|
|
5255
5249
|
disabled: a.value <= 1,
|
|
5256
|
-
icon: R(
|
|
5250
|
+
icon: R(Se),
|
|
5257
5251
|
label: R(n).t("wise_invoicing.common.pdf_viewer.previous_page"),
|
|
5258
5252
|
variant: "tertiary",
|
|
5259
5253
|
onClick: m
|
|
@@ -5262,9 +5256,9 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5262
5256
|
"icon",
|
|
5263
5257
|
"label"
|
|
5264
5258
|
]),
|
|
5265
|
-
M(R(
|
|
5259
|
+
M(R(Xt), {
|
|
5266
5260
|
disabled: a.value >= c.value,
|
|
5267
|
-
icon: R(
|
|
5261
|
+
icon: R(pe),
|
|
5268
5262
|
label: R(n).t("wise_invoicing.common.pdf_viewer.next_page"),
|
|
5269
5263
|
size: "sm",
|
|
5270
5264
|
variant: "tertiary",
|
|
@@ -5280,9 +5274,9 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5280
5274
|
}), M(R(B), { gap: "xs" }, {
|
|
5281
5275
|
default: z(() => [
|
|
5282
5276
|
j("p", Ys, L(i.value) + "% ", 1),
|
|
5283
|
-
M(R(
|
|
5277
|
+
M(R(Xt), {
|
|
5284
5278
|
"is-disabled": i.value >= Zs,
|
|
5285
|
-
icon: R(
|
|
5279
|
+
icon: R(re),
|
|
5286
5280
|
label: R(n).t("wise_invoicing.common.pdf_viewer.zoom_in"),
|
|
5287
5281
|
size: "sm",
|
|
5288
5282
|
variant: "tertiary",
|
|
@@ -5292,9 +5286,9 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5292
5286
|
"icon",
|
|
5293
5287
|
"label"
|
|
5294
5288
|
]),
|
|
5295
|
-
M(R(
|
|
5289
|
+
M(R(Xt), {
|
|
5296
5290
|
"is-disabled": i.value <= Xs,
|
|
5297
|
-
icon: R(
|
|
5291
|
+
icon: R(oe),
|
|
5298
5292
|
label: R(n).t("wise_invoicing.common.pdf_viewer.zoom_out"),
|
|
5299
5293
|
variant: "tertiary",
|
|
5300
5294
|
onClick: d
|
|
@@ -5321,18 +5315,18 @@ var qs = { class: "text-sm font-semibold text-primary" }, Js = { class: "w-10 te
|
|
|
5321
5315
|
},
|
|
5322
5316
|
setup(e) {
|
|
5323
5317
|
let t = e;
|
|
5324
|
-
return (e, n) => (F(), O(
|
|
5318
|
+
return (e, n) => (F(), O(Ne, { queries: {
|
|
5325
5319
|
billingDocument: t.query,
|
|
5326
5320
|
customFieldDefinitions: t.customFieldDefinitionsQuery
|
|
5327
5321
|
} }, {
|
|
5328
|
-
default: z(({ data: t }) => [
|
|
5322
|
+
default: z(({ data: t }) => [ct(e.$slots, "default", et(qe({
|
|
5329
5323
|
billingDocument: t.billingDocument,
|
|
5330
5324
|
customFieldDefinitions: t.customFieldDefinitions
|
|
5331
5325
|
})))]),
|
|
5332
|
-
loading: z(() => [M(R(
|
|
5326
|
+
loading: z(() => [M(R(Ie).PageLoadingState, { breadcrumbs: t.loadingBreadcrumbs }, null, 8, ["breadcrumbs"])]),
|
|
5333
5327
|
_: 3
|
|
5334
5328
|
}, 8, ["queries"]));
|
|
5335
5329
|
}
|
|
5336
5330
|
});
|
|
5337
5331
|
//#endregion
|
|
5338
|
-
export {
|
|
5332
|
+
export { Sn as C, wn as S, jn as _, Ls as a, Dn as b, js as c, ar as d, rr as f, Mn as g, Rn as h, Us as i, Xr as l, zn as m, $s as n, Is as o, Bn as p, Gs as r, Ms as s, ec as t, vr as u, An as v, xn as w, En as x, On as y };
|