@wisemen/wise-invoicing-web 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApprovalReminderSettingsViewDataProvider-IuReavOR.js → ApprovalReminderSettingsViewDataProvider-r9DcFi76.js} +4 -4
- package/dist/{BillingDocumentDetailViewDataProvider-B3I6UIKY.js → BillingDocumentDetailViewDataProvider-CsqBeAiA.js} +1496 -1418
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-rFqmLUPy.js → BillingDocumentPdf-thrvzGfh.js} +266 -205
- package/dist/{CreditNoteDetailViewDataProvider-CQRnG2Fz.js → CreditNoteDetailViewDataProvider-D6IMBwLn.js} +242 -242
- package/dist/{CreditNotePdfViewDataProvider-RytwPWH5.js → CreditNotePdfViewDataProvider-C4z1NE3Q.js} +2 -2
- package/dist/{CustomFieldValueText-DA0aPKwC.js → CustomFieldValueText-BRpCwCqJ.js} +37 -22
- package/dist/{DunningCaseDetailViewDataProvider-BRYbYgTw.js → DunningCaseDetailViewDataProvider-DTotyRX8.js} +5 -5
- package/dist/{DunningCaseOverviewView-D0vScVF1.js → DunningCaseOverviewView-kDq7UY5e.js} +5 -5
- package/dist/{DunningCaseReminderPdfViewDataProvider-I_ZQiAuK.js → DunningCaseReminderPdfViewDataProvider-DgKA-7lX.js} +1 -1
- package/dist/{DunningCaseSendDialog-CV66_tMv.js → DunningCaseSendDialog-DVfBVtgr.js} +12 -12
- package/dist/{InvoiceApprovalOutOfSyncIndicator-AJOQe8j8.js → InvoiceApprovalOutOfSyncIndicator-DPlrqqOs.js} +1 -1
- package/dist/{InvoiceApprovalOverviewView-CcMqr2jH.js → InvoiceApprovalOverviewView-B6naRElx.js} +8 -8
- package/dist/{InvoiceApprovalStatusBadge-BJ3Q18bf.js → InvoiceApprovalStatusBadge-CDc_Pwsm.js} +3 -3
- package/dist/{InvoiceApproveDialogDataProvider-DaCEHgs0.js → InvoiceApproveDialogDataProvider-CK6ij8X1.js} +7 -7
- package/dist/{InvoiceDetailViewDataProvider-B5uZY8Qy.js → InvoiceDetailViewDataProvider-BKurQPAV.js} +369 -369
- package/dist/{InvoiceOverviewViewDataProvider-BrgmweRE.js → InvoiceOverviewViewDataProvider-ChoyCi5L.js} +368 -368
- package/dist/{InvoicePdfView-CPEX7E9W.js → InvoicePdfView-DLEKQ29O.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-T4-8A2OD.js → InvoicePdfViewDataProvider-C-b7iXiH.js} +3 -3
- package/dist/{InvoicePublicPdfViewDataProvider-BkHZoPSZ.js → InvoicePublicPdfViewDataProvider-DZ4WQsvi.js} +3 -3
- package/dist/{InvoicePublicProFormaPdfViewDataProvider-CfkArXbC.js → InvoicePublicProFormaPdfViewDataProvider-CsF8fPlp.js} +3 -3
- package/dist/{InvoicingFileUploadProvider-BLBjPKqx.js → InvoicingFileUploadProvider-t64Qiyn6.js} +2 -2
- package/dist/{IssuerSettingsViewDataProvider-BStn0jFI.js → IssuerSettingsViewDataProvider-Cc8R6ekd.js} +51 -46
- package/dist/PeppolSettingsViewDataProvider-DpVIfFVG.js +276 -0
- package/dist/{ReminderSettingsViewDataProvider-CjX7afDs.js → ReminderSettingsViewDataProvider-QOh3LpMX.js} +63 -63
- package/dist/{api.util-D6m6OY3_.js → api.util-Do9BEwG4.js} +735 -641
- package/dist/{billingDocumentDetail.transformer-Da-Nt4bI.js → billingDocumentDetail.transformer-BAOQ3Zrg.js} +3 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/sdk.gen.d.ts +4 -1
- package/dist/client/types.gen.d.ts +218 -40
- package/dist/client/zod.gen.d.ts +2575 -72
- package/dist/{creditNoteDetail.query-Yb8TdZNm.js → creditNoteDetail.query-C1rr54m1.js} +15 -15
- package/dist/{dist-BpDuRYDT.js → dist-CZAOPudv.js} +1 -1
- package/dist/{documentTitle.composable-CRJjS6p-.js → documentTitle.composable-C3k1m0Nz.js} +28 -26
- package/dist/{i18n.lib-CKs3ExEl.js → i18n.lib-Bkz_R954.js} +56 -2
- package/dist/index.d.ts +55 -0
- package/dist/index.js +161 -156
- package/dist/{invoice.service-DWDl9XRh.js → invoice.service-DrI2ULIR.js} +39 -38
- package/dist/{invoiceApproval.service-Fwlxgd9o.js → invoiceApproval.service-Dpxiru7l.js} +7 -7
- package/dist/{invoiceApprovalStatus.util-q-zHLdFV.js → invoiceApprovalStatus.util-CdOAcPzv.js} +2 -2
- package/dist/{invoiceCustomer.service-DOexR54S.js → invoiceCustomer.service-RRFosiYR.js} +6 -6
- package/dist/{invoiceDetail.query-B5w0Vlsy.js → invoiceDetail.query-BmtHdfj0.js} +1 -1
- package/dist/{invoiceIndexCache.util-CUlp4R7R.js → invoiceIndexCache.util-DKtJorc_.js} +3 -3
- package/dist/{invoicingConfig.composable-DjFexycc.js → invoicingConfig.composable-CMTYHHS9.js} +2 -2
- package/dist/{issuerSettings.query-BHuLjV9P.js → issuerSettings.query-CKDhoStt.js} +2 -2
- package/dist/libs/i18n.lib.d.ts +54 -0
- package/dist/locales/en-US.json.d.ts +28 -1
- package/dist/locales/nl-BE.json.d.ts +28 -1
- package/dist/models/billing-document/billingDocumentAdvancePayment.util.d.ts +9 -0
- package/dist/models/billing-document/billingDocumentAdvancePayment.util.spec.d.ts +1 -0
- package/dist/models/billing-document/billingDocumentDetail.model.d.ts +1 -0
- package/dist/modules/custom-field/components/customFieldList.spec.d.ts +1 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldDefinition.model.d.ts +6 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldDefinition.transformer.spec.d.ts +1 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldDefinition.util.d.ts +6 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldViewKey.model.d.ts +9 -0
- package/dist/modules/custom-field/test/builders/customFieldDefinition.builder.d.ts +2 -1
- package/dist/modules/invoice/models/invoice/pdf/invoicePdfDetail.model.d.ts +1 -0
- package/dist/modules/invoice-delivery/api/mutations/peppolConnectionUpdate.mutation.d.ts +6 -0
- package/dist/modules/invoice-delivery/api/queries/peppolConnection.query.d.ts +1 -0
- package/dist/modules/invoice-delivery/api/query-keys/invoiceDelivery.queryKeys.d.ts +6 -0
- package/dist/modules/invoice-delivery/api/services/peppolConnection.service.d.ts +8 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormApiKeyField.vue.d.ts +8 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormCompanyField.vue.d.ts +11 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormEnabledField.vue.d.ts +7 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormProviderField.vue.d.ts +9 -0
- package/dist/modules/invoice-delivery/index.d.ts +1 -0
- package/dist/modules/invoice-delivery/models/deliveryReason.util.d.ts +6 -0
- package/dist/modules/invoice-delivery/models/peppolConnection.model.d.ts +18 -0
- package/dist/modules/invoice-delivery/models/peppolConnection.transformer.d.ts +9 -0
- package/dist/modules/invoice-delivery/models/peppolConnectionForm.model.d.ts +9 -0
- package/dist/modules/invoice-delivery/use-cases/settings/views/PeppolSettingsView.vue.d.ts +7 -0
- package/dist/modules/invoice-delivery/use-cases/settings/views/PeppolSettingsViewDataProvider.vue.d.ts +3 -0
- package/dist/modules/settings/routes/settings.routes.d.ts +7 -0
- package/dist/{reminderConfig.query-C4J6m4ER.js → reminderConfig.query-yImUS5qt.js} +22 -22
- package/dist/style.css +1 -1
- package/dist/types/queryKey.type.d.ts +2 -1
- package/dist/ui/billing-document/table/BillingDocumentLineItemsTableGroupRow.vue.d.ts +4 -0
- package/dist/ui/billing-document/table/BillingDocumentLineItemsTreeIndent.vue.d.ts +4 -2
- package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +0 -18
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +0 -3
- package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableField.vue.d.ts +3 -0
- package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableTextField.vue.d.ts +1 -0
- package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import "./api.util-
|
|
2
|
-
import { b as e, x as t } from "./documentTitle.composable-
|
|
3
|
-
import { n } from "./
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import "./api.util-Do9BEwG4.js";
|
|
2
|
+
import { b as e, x as t } from "./documentTitle.composable-C3k1m0Nz.js";
|
|
3
|
+
import { n, t as r } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
4
|
+
import { n as i } from "./invoicingConfig.composable-CMTYHHS9.js";
|
|
5
|
+
import { n as a } from "./address.transformer-jGddczLV.js";
|
|
6
|
+
import { dt as o } from "./dist-DCbLgB6Y.js";
|
|
7
|
+
import { i as s } from "./billingDocumentDetail.transformer-BAOQ3Zrg.js";
|
|
8
|
+
import { useI18n as c } from "vue-i18n";
|
|
9
|
+
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, normalizeClass as v, normalizeStyle as y, openBlock as b, renderList as x, renderSlot as S, toDisplayString as C, unref as w, withCtx as T } from "vue";
|
|
10
|
+
import { UIColumnLayout as E, UIRowLayout as D, UISeparator as O, UIText as k } from "@wisemen/vue-core-design-system";
|
|
10
11
|
//#region src/modules/invoice/use-cases/pdf/utils/invoicePdf.util.ts
|
|
11
|
-
var
|
|
12
|
+
var A = "-", j = 32, ee = 512, te = 640, M = 576, N = 704, P = 52, ne = 34, F = 16, I = 14, L = /\r?\n/u, R = class {
|
|
12
13
|
static appendRows(e, t, n, r, i) {
|
|
13
|
-
let
|
|
14
|
+
let a = [...t.map((e) => ({
|
|
14
15
|
kind: "line",
|
|
15
16
|
line: e,
|
|
16
17
|
position: e.position
|
|
@@ -19,7 +20,7 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
19
20
|
kind: "group",
|
|
20
21
|
position: e.position
|
|
21
22
|
}))].toSorted((e, t) => e.position - t.position);
|
|
22
|
-
for (let t of
|
|
23
|
+
for (let t of a) {
|
|
23
24
|
if (t.kind === "line") {
|
|
24
25
|
e.push({
|
|
25
26
|
depth: r,
|
|
@@ -33,7 +34,7 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
33
34
|
name: t.group.name,
|
|
34
35
|
depth: r,
|
|
35
36
|
description: t.group.description,
|
|
36
|
-
total: this.getGroupTotal(
|
|
37
|
+
total: this.getGroupTotal(s.flattenLines([t.group]), i),
|
|
37
38
|
type: "group"
|
|
38
39
|
}), this.appendRows(e, t.group.lines, t.group.groups, r + 1, i);
|
|
39
40
|
}
|
|
@@ -60,11 +61,11 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
60
61
|
}
|
|
61
62
|
static estimateGroupRowHeight(e) {
|
|
62
63
|
let t = [e.name, e.description].filter((e) => e !== null && e.trim() !== "").reduce((e, t) => e + this.getWrappedTextLineCount(t), 0);
|
|
63
|
-
return Math.max(
|
|
64
|
+
return Math.max(j, F + t * I);
|
|
64
65
|
}
|
|
65
66
|
static estimateLineHeight(e) {
|
|
66
67
|
let t = this.getWrappedItemLineCount(e);
|
|
67
|
-
return Math.max(
|
|
68
|
+
return Math.max(j, F + t * I);
|
|
68
69
|
}
|
|
69
70
|
static estimateRowHeight(e) {
|
|
70
71
|
return e.type === "group" ? this.estimateGroupRowHeight(e) : this.estimateLineHeight(e.line);
|
|
@@ -85,7 +86,7 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
85
86
|
return `${this.formatNumber(e, t)}%`;
|
|
86
87
|
}
|
|
87
88
|
static formatPlainDate(e, t) {
|
|
88
|
-
return e === null ?
|
|
89
|
+
return e === null ? A : new Intl.DateTimeFormat(t, {
|
|
89
90
|
day: "2-digit",
|
|
90
91
|
month: "2-digit",
|
|
91
92
|
timeZone: "UTC",
|
|
@@ -93,7 +94,7 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
93
94
|
}).format(Date.UTC(e.year, e.month - 1, e.day));
|
|
94
95
|
}
|
|
95
96
|
static getAddressLines(e) {
|
|
96
|
-
return
|
|
97
|
+
return a.formatLines(e);
|
|
97
98
|
}
|
|
98
99
|
static getDisplayLineGrossAmount(e, t) {
|
|
99
100
|
let n = t.isCreditNote === t.isDiscount ? 1 : -1;
|
|
@@ -114,8 +115,8 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
static getLastPageRowBudget(e) {
|
|
117
|
-
let t = e.headerType === "first" ?
|
|
118
|
-
return e.hasRemarks ? t -
|
|
118
|
+
let t = e.headerType === "first" ? ee : M;
|
|
119
|
+
return e.hasRemarks ? t - P : t;
|
|
119
120
|
}
|
|
120
121
|
static getTotalRowsHeight(e) {
|
|
121
122
|
return e.reduce((e, t) => e + this.estimateRowHeight(t), 0);
|
|
@@ -125,13 +126,13 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
125
126
|
}
|
|
126
127
|
static getWrappedTextLineCount(e) {
|
|
127
128
|
let t = e.trim();
|
|
128
|
-
return t === "" ? 1 : t.split(L).reduce((e, t) => e + Math.max(1, Math.ceil(t.length /
|
|
129
|
+
return t === "" ? 1 : t.split(L).reduce((e, t) => e + Math.max(1, Math.ceil(t.length / ne)), 0);
|
|
129
130
|
}
|
|
130
131
|
static paginatePrefixRows(e) {
|
|
131
132
|
if (e.length === 0) return [];
|
|
132
|
-
let t = [], n = e, r = this.takeRowsForBudget(n,
|
|
133
|
+
let t = [], n = e, r = this.takeRowsForBudget(n, te);
|
|
133
134
|
for (t.push(r), n = n.slice(r.length); n.length > 0;) {
|
|
134
|
-
let e = this.takeRowsForBudget(n,
|
|
135
|
+
let e = this.takeRowsForBudget(n, N);
|
|
135
136
|
t.push(e), n = n.slice(e.length);
|
|
136
137
|
}
|
|
137
138
|
return t;
|
|
@@ -178,17 +179,17 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
178
179
|
}
|
|
179
180
|
return n;
|
|
180
181
|
}
|
|
181
|
-
}, z = /* @__PURE__ */
|
|
182
|
+
}, z = /* @__PURE__ */ _({
|
|
182
183
|
__name: "InvoicePdfFooterSection",
|
|
183
184
|
props: { invoice: {} },
|
|
184
185
|
setup(e) {
|
|
185
|
-
let t = e, n =
|
|
186
|
+
let t = e, n = c(), r = u(() => [{
|
|
186
187
|
label: n.t("wise_invoicing.invoice.pdf.footer.email"),
|
|
187
188
|
value: t.invoice.issuer.email ?? ""
|
|
188
189
|
}, {
|
|
189
190
|
label: n.t("wise_invoicing.invoice.pdf.footer.phone"),
|
|
190
191
|
value: t.invoice.issuer.phoneNumber ?? ""
|
|
191
|
-
}].filter((e) => e.value !== "")), i =
|
|
192
|
+
}].filter((e) => e.value !== "")), i = u(() => [
|
|
192
193
|
{
|
|
193
194
|
label: n.t("wise_invoicing.invoice.pdf.footer.address"),
|
|
194
195
|
value: R.getAddressLines(t.invoice.issuer.address).join(", ")
|
|
@@ -202,38 +203,38 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
202
203
|
value: t.invoice.issuer.bankAccountNumber ?? t.invoice.issuer.alternativeBankAccountNumber ?? ""
|
|
203
204
|
}
|
|
204
205
|
].filter((e) => e.value !== ""));
|
|
205
|
-
return (e, a) => (
|
|
206
|
+
return (e, a) => (b(), d(w(E), {
|
|
206
207
|
as: "footer",
|
|
207
208
|
align: "center",
|
|
208
209
|
justify: "center",
|
|
209
210
|
gap: "none",
|
|
210
211
|
class: "mt-auto w-full break-inside-avoid [page-break-inside:avoid]"
|
|
211
212
|
}, {
|
|
212
|
-
default:
|
|
213
|
-
|
|
213
|
+
default: T(() => [
|
|
214
|
+
g(w(D), {
|
|
214
215
|
align: "center",
|
|
215
216
|
gap: "md"
|
|
216
217
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
a[0] ||=
|
|
219
|
-
|
|
220
|
-
text: t.invoice.issuer.name ??
|
|
218
|
+
default: T(() => [
|
|
219
|
+
a[0] ||= m("span", { class: "flex-1 border-t border-secondary" }, null, -1),
|
|
220
|
+
g(w(k), {
|
|
221
|
+
text: t.invoice.issuer.name ?? w(n).t("wise_invoicing.common.not_available"),
|
|
221
222
|
truncate: !1,
|
|
222
223
|
as: "p",
|
|
223
224
|
class: "text-xs font-semibold text-primary"
|
|
224
225
|
}, null, 8, ["text"]),
|
|
225
|
-
a[1] ||=
|
|
226
|
+
a[1] ||= m("span", { class: "flex-1 border-t border-secondary" }, null, -1)
|
|
226
227
|
]),
|
|
227
228
|
_: 1
|
|
228
229
|
}),
|
|
229
|
-
r.value.length > 0 ? (
|
|
230
|
+
r.value.length > 0 ? (b(), d(w(D), {
|
|
230
231
|
key: 0,
|
|
231
232
|
justify: "center",
|
|
232
233
|
gap: "xs",
|
|
233
234
|
class: "mt-xxs",
|
|
234
235
|
wrap: ""
|
|
235
236
|
}, {
|
|
236
|
-
default:
|
|
237
|
+
default: T(() => [(b(!0), p(l, null, x(r.value, (e) => (b(), d(w(k), {
|
|
237
238
|
key: e.label,
|
|
238
239
|
text: `${e.label}: ${e.value}`,
|
|
239
240
|
truncate: !1,
|
|
@@ -241,15 +242,15 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
241
242
|
class: "text-xxs text-primary"
|
|
242
243
|
}, null, 8, ["text"]))), 128))]),
|
|
243
244
|
_: 1
|
|
244
|
-
})) :
|
|
245
|
-
i.value.length > 0 ? (
|
|
245
|
+
})) : f("", !0),
|
|
246
|
+
i.value.length > 0 ? (b(), d(w(D), {
|
|
246
247
|
key: 1,
|
|
247
248
|
justify: "center",
|
|
248
249
|
gap: "xs",
|
|
249
250
|
class: "mt-xxs",
|
|
250
251
|
wrap: ""
|
|
251
252
|
}, {
|
|
252
|
-
default:
|
|
253
|
+
default: T(() => [(b(!0), p(l, null, x(i.value, (e) => (b(), d(w(k), {
|
|
253
254
|
key: e.label,
|
|
254
255
|
text: `${e.label}: ${e.value}`,
|
|
255
256
|
truncate: !1,
|
|
@@ -257,83 +258,83 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
257
258
|
class: "text-xxs text-primary"
|
|
258
259
|
}, null, 8, ["text"]))), 128))]),
|
|
259
260
|
_: 1
|
|
260
|
-
})) :
|
|
261
|
+
})) : f("", !0)
|
|
261
262
|
]),
|
|
262
263
|
_: 1
|
|
263
264
|
}));
|
|
264
265
|
}
|
|
265
|
-
}), B = /* @__PURE__ */
|
|
266
|
+
}), B = /* @__PURE__ */ _({
|
|
266
267
|
__name: "InvoicePdfHeaderSection",
|
|
267
268
|
props: {
|
|
268
269
|
invoice: {},
|
|
269
270
|
pageType: {}
|
|
270
271
|
},
|
|
271
272
|
setup(e) {
|
|
272
|
-
let
|
|
273
|
-
let e =
|
|
274
|
-
return !
|
|
275
|
-
}),
|
|
276
|
-
let e =
|
|
277
|
-
return e ? `${
|
|
278
|
-
}),
|
|
273
|
+
let n = e, r = c(), a = i(), s = u(() => r.locale.value || "en-US"), m = u(() => n.invoice.type === t.CREDIT_NOTE), h = u(() => m.value ? n.invoice.sequence === null ? r.t("wise_invoicing.credit_note.detail.fallback_title") : `${r.t("wise_invoicing.invoice.type.credit_note")} ${n.invoice.sequence}` : n.invoice.sequence ?? r.t("wise_invoicing.invoice.detail.fallback_title")), _ = u(() => {
|
|
274
|
+
let e = n.invoice.originalInvoice?.sequence;
|
|
275
|
+
return !m.value || n.pageType !== "first" || e === null ? null : `${r.t("wise_invoicing.invoice.type.standard")} ${e}`;
|
|
276
|
+
}), v = u(() => (n.invoice.issuer.name ?? r.t("wise_invoicing.common.not_available")).split(" ").filter((e) => e !== "").slice(0, 2).map((e) => e.toUpperCase())), y = u(() => R.getAddressLines(n.invoice.customer.address)), S = u(() => {
|
|
277
|
+
let e = n.invoice.customer.vatNumber;
|
|
278
|
+
return e ? `${r.t("wise_invoicing.invoice.pdf.footer.vat_number")}: ${e}` : null;
|
|
279
|
+
}), C = u(() => n.invoice.customer.name !== null || y.value.length > 0 || n.invoice.customer.email !== null || S.value !== null), O = u(() => {
|
|
279
280
|
let e = [{
|
|
280
|
-
label:
|
|
281
|
-
value: A(
|
|
281
|
+
label: r.t("wise_invoicing.invoice.detail.header.invoice_date"),
|
|
282
|
+
value: A(n.invoice.issueOn)
|
|
282
283
|
}, {
|
|
283
|
-
label:
|
|
284
|
-
value: A(
|
|
284
|
+
label: r.t("wise_invoicing.invoice.detail.header.due_date"),
|
|
285
|
+
value: A(n.invoice.dueOn)
|
|
285
286
|
}];
|
|
286
|
-
return
|
|
287
|
-
label:
|
|
288
|
-
value: A(
|
|
287
|
+
return n.pageType === "first" && a.isDeliveryDateVisible.value && e.push({
|
|
288
|
+
label: r.t("wise_invoicing.invoice.detail.header.delivery_date"),
|
|
289
|
+
value: A(n.invoice.deliveredOn)
|
|
289
290
|
}), e;
|
|
290
291
|
});
|
|
291
292
|
function A(e) {
|
|
292
|
-
return R.formatPlainDate(e,
|
|
293
|
+
return R.formatPlainDate(e, s.value);
|
|
293
294
|
}
|
|
294
|
-
return (e, t) => (
|
|
295
|
+
return (e, t) => (b(), d(w(E), {
|
|
295
296
|
as: "header",
|
|
296
297
|
gap: "none",
|
|
297
298
|
class: "w-full break-inside-avoid [page-break-inside:avoid]"
|
|
298
299
|
}, {
|
|
299
|
-
default:
|
|
300
|
-
"aria-label":
|
|
300
|
+
default: T(() => [g(w(E), {
|
|
301
|
+
"aria-label": n.invoice.issuer.name ?? w(r).t("wise_invoicing.common.not_available"),
|
|
301
302
|
align: "center",
|
|
302
303
|
gap: "none",
|
|
303
304
|
class: "w-full leading-none font-bold text-primary"
|
|
304
305
|
}, {
|
|
305
|
-
default:
|
|
306
|
+
default: T(() => [(b(!0), p(l, null, x(v.value, (e) => (b(), d(w(k), {
|
|
306
307
|
key: e,
|
|
307
308
|
text: e,
|
|
308
309
|
truncate: !1,
|
|
309
310
|
as: "span"
|
|
310
311
|
}, null, 8, ["text"]))), 128))]),
|
|
311
312
|
_: 1
|
|
312
|
-
}, 8, ["aria-label"]),
|
|
313
|
-
gap:
|
|
313
|
+
}, 8, ["aria-label"]), g(w(E), {
|
|
314
|
+
gap: n.pageType === "first" ? "2xl" : "xl",
|
|
314
315
|
class: "w-full"
|
|
315
316
|
}, {
|
|
316
|
-
default:
|
|
317
|
+
default: T(() => [g(w(D), {
|
|
317
318
|
justify: "between",
|
|
318
319
|
align: "start",
|
|
319
320
|
gap: "2xl",
|
|
320
321
|
class: "w-full"
|
|
321
322
|
}, {
|
|
322
|
-
default:
|
|
323
|
+
default: T(() => [g(w(E), {
|
|
323
324
|
gap: "none",
|
|
324
325
|
class: "min-w-px"
|
|
325
326
|
}, {
|
|
326
|
-
default:
|
|
327
|
-
_.value === null ?
|
|
327
|
+
default: T(() => [
|
|
328
|
+
_.value === null ? f("", !0) : (b(), d(w(D), {
|
|
328
329
|
key: 0,
|
|
329
330
|
align: "center",
|
|
330
331
|
gap: "xxs",
|
|
331
332
|
class: "text-xs text-secondary"
|
|
332
333
|
}, {
|
|
333
|
-
default:
|
|
334
|
+
default: T(() => [g(w(o), {
|
|
334
335
|
"aria-hidden": "true",
|
|
335
336
|
class: "size-3 shrink-0 text-secondary"
|
|
336
|
-
}),
|
|
337
|
+
}), g(w(k), {
|
|
337
338
|
text: _.value,
|
|
338
339
|
truncate: !1,
|
|
339
340
|
as: "p",
|
|
@@ -341,39 +342,39 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
341
342
|
}, null, 8, ["text"])]),
|
|
342
343
|
_: 1
|
|
343
344
|
})),
|
|
344
|
-
|
|
345
|
-
text:
|
|
345
|
+
g(w(k), {
|
|
346
|
+
text: h.value,
|
|
346
347
|
truncate: !1,
|
|
347
348
|
as: "h1",
|
|
348
349
|
class: "text-lg font-semibold text-primary"
|
|
349
350
|
}, null, 8, ["text"]),
|
|
350
|
-
|
|
351
|
+
n.invoice.subject ? (b(), d(w(k), {
|
|
351
352
|
key: 1,
|
|
352
|
-
text:
|
|
353
|
+
text: n.invoice.subject,
|
|
353
354
|
truncate: !1,
|
|
354
355
|
as: "p",
|
|
355
356
|
class: "max-w-100! text-xs wrap-break-word text-secondary"
|
|
356
|
-
}, null, 8, ["text"])) :
|
|
357
|
+
}, null, 8, ["text"])) : f("", !0)
|
|
357
358
|
]),
|
|
358
359
|
_: 1
|
|
359
|
-
}),
|
|
360
|
+
}), g(w(E), {
|
|
360
361
|
as: "dl",
|
|
361
362
|
gap: "none",
|
|
362
363
|
class: "w-48 text-xs text-primary"
|
|
363
364
|
}, {
|
|
364
|
-
default:
|
|
365
|
+
default: T(() => [(b(!0), p(l, null, x(O.value, (e) => (b(), d(w(D), {
|
|
365
366
|
key: e.label,
|
|
366
367
|
justify: "between",
|
|
367
368
|
align: "start",
|
|
368
369
|
gap: "xl",
|
|
369
370
|
class: "w-full"
|
|
370
371
|
}, {
|
|
371
|
-
default:
|
|
372
|
+
default: T(() => [g(w(k), {
|
|
372
373
|
text: e.label,
|
|
373
374
|
truncate: !1,
|
|
374
375
|
as: "dt",
|
|
375
376
|
class: "font-medium text-primary"
|
|
376
|
-
}, null, 8, ["text"]),
|
|
377
|
+
}, null, 8, ["text"]), g(w(k), {
|
|
377
378
|
text: e.value,
|
|
378
379
|
truncate: !1,
|
|
379
380
|
as: "dd",
|
|
@@ -384,66 +385,66 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
384
385
|
_: 1
|
|
385
386
|
})]),
|
|
386
387
|
_: 1
|
|
387
|
-
}),
|
|
388
|
+
}), n.pageType === "first" && C.value ? (b(), d(w(E), {
|
|
388
389
|
key: 0,
|
|
389
390
|
as: "section",
|
|
390
391
|
gap: "xxs",
|
|
391
392
|
class: "break-inside-avoid [page-break-inside:avoid]"
|
|
392
393
|
}, {
|
|
393
|
-
default:
|
|
394
|
-
|
|
395
|
-
text:
|
|
394
|
+
default: T(() => [
|
|
395
|
+
g(w(k), {
|
|
396
|
+
text: w(r).t("wise_invoicing.invoice.pdf.client"),
|
|
396
397
|
truncate: !1,
|
|
397
398
|
as: "h2",
|
|
398
399
|
class: "text-xs font-semibold text-primary"
|
|
399
400
|
}, null, 8, ["text"]),
|
|
400
|
-
|
|
401
|
-
text:
|
|
401
|
+
g(w(k), {
|
|
402
|
+
text: n.invoice.customer.name ?? "-",
|
|
402
403
|
truncate: !1,
|
|
403
404
|
as: "p",
|
|
404
405
|
class: "text-xs text-secondary"
|
|
405
406
|
}, null, 8, ["text"]),
|
|
406
|
-
(
|
|
407
|
+
(b(!0), p(l, null, x(y.value, (e) => (b(), d(w(k), {
|
|
407
408
|
key: e,
|
|
408
409
|
text: e,
|
|
409
410
|
truncate: !1,
|
|
410
411
|
as: "p",
|
|
411
412
|
class: "text-xs text-secondary"
|
|
412
413
|
}, null, 8, ["text"]))), 128)),
|
|
413
|
-
|
|
414
|
-
text:
|
|
414
|
+
g(w(k), {
|
|
415
|
+
text: n.invoice.customer.email ?? "-",
|
|
415
416
|
truncate: !1,
|
|
416
417
|
as: "p",
|
|
417
418
|
class: "text-xs text-secondary"
|
|
418
419
|
}, null, 8, ["text"]),
|
|
419
|
-
|
|
420
|
+
S.value === null ? f("", !0) : (b(), d(w(k), {
|
|
420
421
|
key: 0,
|
|
421
|
-
text:
|
|
422
|
+
text: S.value,
|
|
422
423
|
truncate: !1,
|
|
423
424
|
as: "p",
|
|
424
425
|
class: "text-xs text-secondary"
|
|
425
426
|
}, null, 8, ["text"]))
|
|
426
427
|
]),
|
|
427
428
|
_: 1
|
|
428
|
-
})) :
|
|
429
|
+
})) : f("", !0)]),
|
|
429
430
|
_: 1
|
|
430
431
|
}, 8, ["gap"])]),
|
|
431
432
|
_: 1
|
|
432
433
|
}));
|
|
433
434
|
}
|
|
434
|
-
}), V = /* @__PURE__ */
|
|
435
|
+
}), V = /* @__PURE__ */ _({
|
|
435
436
|
__name: "InvoicePdfTableCell",
|
|
436
437
|
props: { bold: { type: Boolean } },
|
|
437
438
|
setup(e) {
|
|
438
439
|
let t = e;
|
|
439
|
-
return (e, n) => (
|
|
440
|
+
return (e, n) => (b(), p("td", { class: v([t.bold && "font-semibold", "px-lg py-sm text-right align-middle text-xxs whitespace-nowrap text-primary"]) }, [S(e.$slots, "default")], 2));
|
|
440
441
|
}
|
|
441
|
-
}), H = { class: "border-b border-secondary bg-secondary px-lg py-xs text-right text-xxs font-semibold text-primary" }, U = /* @__PURE__ */
|
|
442
|
+
}), H = { class: "border-b border-secondary bg-secondary px-lg py-xs text-right text-xxs font-semibold text-primary" }, U = /* @__PURE__ */ _({
|
|
442
443
|
__name: "InvoicePdfTableHeaderCell",
|
|
443
444
|
props: { label: {} },
|
|
444
445
|
setup(e) {
|
|
445
446
|
let t = e;
|
|
446
|
-
return (e, n) => (
|
|
447
|
+
return (e, n) => (b(), p("th", H, C(t.label), 1));
|
|
447
448
|
}
|
|
448
449
|
}), W = { class: "mt-2xl w-full" }, G = { class: "w-full table-fixed border-separate border-spacing-0 overflow-hidden rounded-xs border border-secondary" }, K = { class: "table-header-group" }, q = {
|
|
449
450
|
key: 0,
|
|
@@ -454,177 +455,191 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
454
455
|
}, X = {
|
|
455
456
|
key: 0,
|
|
456
457
|
class: "mt-xxs whitespace-pre-line text-tertiary"
|
|
457
|
-
},
|
|
458
|
+
}, re = { key: 0 }, ie = {
|
|
458
459
|
colspan: "7",
|
|
459
460
|
class: "px-lg py-sm text-center text-xxs text-secondary"
|
|
460
|
-
},
|
|
461
|
+
}, ae = /* @__PURE__ */ _({
|
|
461
462
|
__name: "InvoicePdfLinesTable",
|
|
462
463
|
props: {
|
|
463
464
|
isCreditNote: { type: Boolean },
|
|
464
465
|
rows: {}
|
|
465
466
|
},
|
|
466
467
|
setup(e) {
|
|
467
|
-
let t = e, n =
|
|
468
|
+
let t = e, n = c(), r = n.locale;
|
|
468
469
|
function i(e) {
|
|
469
470
|
return R.formatMonetary(e, r.value);
|
|
470
471
|
}
|
|
471
472
|
function a(e) {
|
|
472
473
|
return e === null ? "" : R.formatMonetary(e, r.value);
|
|
473
474
|
}
|
|
474
|
-
function
|
|
475
|
+
function o(e) {
|
|
475
476
|
let n = t.isCreditNote ? {
|
|
476
477
|
...e,
|
|
477
478
|
amount: -e.amount
|
|
478
479
|
} : e;
|
|
479
480
|
return R.formatMonetary(n, r.value);
|
|
480
481
|
}
|
|
481
|
-
function
|
|
482
|
+
function s(e) {
|
|
482
483
|
return R.formatMonetary(R.getDisplayLineGrossAmount(e.grossAmount, {
|
|
483
484
|
isCreditNote: t.isCreditNote,
|
|
484
485
|
isDiscount: e.isDiscount
|
|
485
486
|
}), r.value);
|
|
486
487
|
}
|
|
487
|
-
function
|
|
488
|
+
function u(e) {
|
|
488
489
|
return R.formatNumber(t.isCreditNote ? -e : e, r.value);
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
+
function d(e) {
|
|
491
492
|
return e.toString(r.value);
|
|
492
493
|
}
|
|
493
|
-
function
|
|
494
|
+
function _(e) {
|
|
494
495
|
return { paddingLeft: `calc(var(--spacing-lg) + ${e} * var(--spacing-md))` };
|
|
495
496
|
}
|
|
496
|
-
return (e, r) => (
|
|
497
|
-
r[0] ||=
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
497
|
+
return (e, r) => (b(), p("div", W, [m("table", G, [
|
|
498
|
+
r[0] ||= m("colgroup", null, [
|
|
499
|
+
m("col", { class: "w-auto" }),
|
|
500
|
+
m("col", { class: "w-[8%]" }),
|
|
501
|
+
m("col", { class: "w-[8%]" }),
|
|
502
|
+
m("col", { class: "w-[14%]" }),
|
|
503
|
+
m("col", { class: "w-[16%]" }),
|
|
504
|
+
m("col", { class: "w-[4%]" }),
|
|
505
|
+
m("col", { class: "w-[12%]" })
|
|
505
506
|
], -1),
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
label:
|
|
507
|
+
m("thead", K, [m("tr", null, [
|
|
508
|
+
g(U, {
|
|
509
|
+
label: w(n).t("wise_invoicing.invoice.detail.line_items.item"),
|
|
509
510
|
class: "text-left!"
|
|
510
511
|
}, null, 8, ["label"]),
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
512
|
+
g(U, { label: w(n).t("wise_invoicing.invoice.detail.line_items.unit") }, null, 8, ["label"]),
|
|
513
|
+
g(U, { label: w(n).t("wise_invoicing.invoice.detail.line_items.qty") }, null, 8, ["label"]),
|
|
514
|
+
g(U, { label: w(n).t("wise_invoicing.invoice.detail.line_items.unit_price") }, null, 8, ["label"]),
|
|
515
|
+
g(U, { label: w(n).t("wise_invoicing.invoice.detail.line_items.price_excl_vat") }, null, 8, ["label"]),
|
|
516
|
+
g(U, { label: w(n).t("wise_invoicing.invoice.detail.line_items.vat") }, null, 8, ["label"]),
|
|
517
|
+
g(U, { label: w(n).t("wise_invoicing.invoice.detail.line_items.total") }, null, 8, ["label"])
|
|
517
518
|
])]),
|
|
518
|
-
|
|
519
|
-
style: _(
|
|
519
|
+
m("tbody", null, [(b(!0), p(l, null, x(t.rows, (e, t) => (b(), p(l, { key: e.type === "group" ? e.uuid : e.line.uuid }, [e.type === "group" ? (b(), p("tr", q, [m("td", {
|
|
520
|
+
style: y(_(e.depth)),
|
|
520
521
|
colspan: "6",
|
|
521
522
|
class: "border-y border-secondary py-sm pr-lg align-middle text-xxs wrap-break-word text-primary"
|
|
522
|
-
}, [
|
|
523
|
+
}, [m("span", J, C(e.name), 1), e.description !== null && e.description !== "" ? (b(), p("span", Y, C(e.description), 1)) : f("", !0)], 4), m("td", { class: v([e.depth === 0 ? "font-semibold text-primary" : "\n font-medium text-secondary\n ", "border-y border-secondary px-lg py-sm text-right align-middle text-xxs whitespace-nowrap"]) }, C(a(e.total)), 3)])) : (b(), p("tr", {
|
|
523
524
|
key: 1,
|
|
524
|
-
class:
|
|
525
|
+
class: v([t % 2 == 1 ? "bg-secondary" : "bg-primary", "break-inside-avoid [page-break-inside:avoid]"])
|
|
525
526
|
}, [
|
|
526
|
-
|
|
527
|
-
style: _(
|
|
527
|
+
m("td", {
|
|
528
|
+
style: y(_(e.depth)),
|
|
528
529
|
class: "py-sm pr-lg align-middle text-xxs font-medium wrap-break-word text-primary"
|
|
529
|
-
}, [
|
|
530
|
-
|
|
531
|
-
default:
|
|
530
|
+
}, [m("div", null, C(e.line.name), 1), e.line.description !== null && e.line.description !== "" ? (b(), p("div", X, C(e.line.description), 1)) : f("", !0)], 4),
|
|
531
|
+
g(V, null, {
|
|
532
|
+
default: T(() => [h(C(e.line.unit), 1)]),
|
|
532
533
|
_: 2
|
|
533
534
|
}, 1024),
|
|
534
|
-
|
|
535
|
-
default:
|
|
535
|
+
g(V, null, {
|
|
536
|
+
default: T(() => [h(C(u(e.line.quantity)), 1)]),
|
|
536
537
|
_: 2
|
|
537
538
|
}, 1024),
|
|
538
|
-
|
|
539
|
-
default:
|
|
539
|
+
g(V, null, {
|
|
540
|
+
default: T(() => [h(C(i(e.line.unitPrice)), 1)]),
|
|
540
541
|
_: 2
|
|
541
542
|
}, 1024),
|
|
542
|
-
|
|
543
|
-
default:
|
|
543
|
+
g(V, null, {
|
|
544
|
+
default: T(() => [h(C(o(e.line.netAmount)), 1)]),
|
|
544
545
|
_: 2
|
|
545
546
|
}, 1024),
|
|
546
|
-
|
|
547
|
-
default:
|
|
547
|
+
g(V, null, {
|
|
548
|
+
default: T(() => [h(C(d(e.line.vatRatePercentage)), 1)]),
|
|
548
549
|
_: 2
|
|
549
550
|
}, 1024),
|
|
550
|
-
|
|
551
|
-
default:
|
|
551
|
+
g(V, { bold: !0 }, {
|
|
552
|
+
default: T(() => [h(C(s(e.line)), 1)]),
|
|
552
553
|
_: 2
|
|
553
554
|
}, 1024)
|
|
554
|
-
], 2))], 64))), 128)), t.rows.length === 0 ? (
|
|
555
|
+
], 2))], 64))), 128)), t.rows.length === 0 ? (b(), p("tr", re, [m("td", ie, C(w(n).t("wise_invoicing.invoice.detail.line_items.empty")), 1)])) : f("", !0)])
|
|
555
556
|
])]));
|
|
556
557
|
}
|
|
557
|
-
}),
|
|
558
|
+
}), Z = class {
|
|
559
|
+
static getAmountAfterAdvance(e, t) {
|
|
560
|
+
let i = n(r(t.amount, t.precision), e.precision);
|
|
561
|
+
return {
|
|
562
|
+
...e,
|
|
563
|
+
amount: e.amount - i
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
}, Q = class {
|
|
558
567
|
static sortByVatRate(e) {
|
|
559
568
|
return e.toSorted((e, t) => Number(e.vatRate) - Number(t.vatRate));
|
|
560
569
|
}
|
|
561
|
-
},
|
|
570
|
+
}, oe = { class: "grid grid-cols-[auto_1px_auto] items-end gap-x-2xl align-bottom" }, $ = { class: "grid h-min grid-cols-[auto_auto_auto] gap-x-lg gap-y-sm text-xs" }, se = {
|
|
562
571
|
key: 0,
|
|
563
572
|
class: "mt-4xl text-xs text-primary"
|
|
564
|
-
},
|
|
573
|
+
}, ce = /* @__PURE__ */ _({
|
|
565
574
|
__name: "InvoicePdfSummarySection",
|
|
566
575
|
props: {
|
|
567
576
|
hasLines: { type: Boolean },
|
|
568
577
|
invoice: {}
|
|
569
578
|
},
|
|
570
579
|
setup(e) {
|
|
571
|
-
let n = e, r =
|
|
572
|
-
function
|
|
580
|
+
let n = e, r = c(), i = u(() => r.locale.value || "en-US"), a = u(() => n.invoice.type === t.CREDIT_NOTE);
|
|
581
|
+
function o(e) {
|
|
573
582
|
return {
|
|
574
583
|
...e,
|
|
575
584
|
amount: -e.amount
|
|
576
585
|
};
|
|
577
586
|
}
|
|
578
|
-
function
|
|
579
|
-
return R.formatMonetary(a.value ?
|
|
587
|
+
function s(e) {
|
|
588
|
+
return R.formatMonetary(a.value ? o(e) : e, i.value);
|
|
580
589
|
}
|
|
581
|
-
let
|
|
582
|
-
let e =
|
|
590
|
+
let d = u(() => {
|
|
591
|
+
let e = Q.sortByVatRate(n.invoice.vatSummaries).map((e) => ({
|
|
583
592
|
key: `${e.vatRate}`,
|
|
584
|
-
label:
|
|
585
|
-
netValue:
|
|
586
|
-
vatValue:
|
|
593
|
+
label: y(e.vatRate),
|
|
594
|
+
netValue: s(e.netAmount),
|
|
595
|
+
vatValue: s(e.vatAmount)
|
|
587
596
|
}));
|
|
588
597
|
return e.push({
|
|
589
598
|
key: "subtotal",
|
|
590
599
|
label: r.t("wise_invoicing.invoice.pdf.summary.subtotal"),
|
|
591
|
-
netValue:
|
|
592
|
-
vatValue:
|
|
600
|
+
netValue: s(n.invoice.effectiveNet),
|
|
601
|
+
vatValue: s(n.invoice.vatAmount)
|
|
593
602
|
}), e;
|
|
594
|
-
}),
|
|
595
|
-
|
|
603
|
+
}), h = u(() => n.invoice.totalDiscountAmount === null ? "-" : `-${R.formatMonetary(n.invoice.totalDiscountAmount, i.value)}`), _ = u(() => {
|
|
604
|
+
let { advancePaymentAmount: e, grossAmount: t } = n.invoice;
|
|
605
|
+
return e === null ? null : {
|
|
606
|
+
advancePayment: `-${s(e)}`,
|
|
607
|
+
amountDue: s(Z.getAmountAfterAdvance(t, e))
|
|
608
|
+
};
|
|
609
|
+
});
|
|
610
|
+
function y(e) {
|
|
596
611
|
let t = n.invoice.lines.find((t) => t.vatRate === e);
|
|
597
612
|
return t === void 0 ? r.t("wise_invoicing.invoice.detail.totals.vat") : t.vatRatePercentage.toString(i.value);
|
|
598
613
|
}
|
|
599
|
-
return (e, t) => (
|
|
600
|
-
|
|
601
|
-
t[0] ||=
|
|
602
|
-
|
|
603
|
-
text:
|
|
614
|
+
return (e, t) => (b(), p("div", { class: v([n.hasLines ? "mt-xl" : "mt-4xl", "break-inside-avoid [page-break-inside:avoid]"]) }, [m("div", oe, [
|
|
615
|
+
m("div", $, [
|
|
616
|
+
t[0] ||= m("span", { class: "min-w-12" }, null, -1),
|
|
617
|
+
g(w(k), {
|
|
618
|
+
text: w(r).t("wise_invoicing.invoice.detail.totals.excl_vat"),
|
|
604
619
|
truncate: !1,
|
|
605
620
|
as: "span",
|
|
606
621
|
class: "text-right font-medium text-secondary"
|
|
607
622
|
}, null, 8, ["text"]),
|
|
608
|
-
|
|
609
|
-
text:
|
|
623
|
+
g(w(k), {
|
|
624
|
+
text: w(r).t("wise_invoicing.invoice.detail.totals.vat"),
|
|
610
625
|
truncate: !1,
|
|
611
626
|
as: "span",
|
|
612
627
|
class: "text-right font-medium text-secondary"
|
|
613
628
|
}, null, 8, ["text"]),
|
|
614
|
-
(
|
|
615
|
-
|
|
629
|
+
(b(!0), p(l, null, x(d.value, (e) => (b(), p(l, { key: e.key }, [
|
|
630
|
+
g(w(k), {
|
|
616
631
|
text: e.label,
|
|
617
632
|
truncate: !1,
|
|
618
633
|
as: "span",
|
|
619
634
|
class: "font-medium text-secondary"
|
|
620
635
|
}, null, 8, ["text"]),
|
|
621
|
-
|
|
636
|
+
g(w(k), {
|
|
622
637
|
text: e.netValue,
|
|
623
638
|
truncate: !1,
|
|
624
639
|
as: "span",
|
|
625
640
|
class: "text-right font-medium whitespace-nowrap text-primary"
|
|
626
641
|
}, null, 8, ["text"]),
|
|
627
|
-
|
|
642
|
+
g(w(k), {
|
|
628
643
|
text: e.vatValue,
|
|
629
644
|
truncate: !1,
|
|
630
645
|
as: "span",
|
|
@@ -632,76 +647,122 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
632
647
|
}, null, 8, ["text"])
|
|
633
648
|
], 64))), 128))
|
|
634
649
|
]),
|
|
635
|
-
t[
|
|
636
|
-
|
|
637
|
-
default:
|
|
638
|
-
|
|
650
|
+
t[1] ||= m("span", { class: "h-24 w-px bg-tertiary" }, null, -1),
|
|
651
|
+
g(w(E), { class: "w-full" }, {
|
|
652
|
+
default: T(() => [
|
|
653
|
+
g(w(D), {
|
|
639
654
|
justify: "between",
|
|
640
655
|
class: "w-full text-xs"
|
|
641
656
|
}, {
|
|
642
|
-
default:
|
|
643
|
-
text:
|
|
657
|
+
default: T(() => [g(w(k), {
|
|
658
|
+
text: w(r).t("wise_invoicing.invoice.pdf.summary.total_discount"),
|
|
644
659
|
truncate: !1,
|
|
645
660
|
as: "span",
|
|
646
661
|
class: "font-medium text-secondary"
|
|
647
|
-
}, null, 8, ["text"]),
|
|
648
|
-
text:
|
|
662
|
+
}, null, 8, ["text"]), g(w(k), {
|
|
663
|
+
text: h.value,
|
|
649
664
|
truncate: !1,
|
|
650
665
|
as: "span",
|
|
651
666
|
class: "text-right font-medium whitespace-nowrap text-primary"
|
|
652
667
|
}, null, 8, ["text"])]),
|
|
653
668
|
_: 1
|
|
654
669
|
}),
|
|
655
|
-
|
|
656
|
-
|
|
670
|
+
g(w(O), {
|
|
671
|
+
orientation: "horizontal",
|
|
672
|
+
class: "bg-tertiary"
|
|
673
|
+
}),
|
|
674
|
+
g(w(D), {
|
|
657
675
|
class: "w-full",
|
|
658
676
|
justify: "between"
|
|
659
677
|
}, {
|
|
660
|
-
default:
|
|
661
|
-
text:
|
|
678
|
+
default: T(() => [g(w(k), {
|
|
679
|
+
text: w(r).t("wise_invoicing.invoice.detail.totals.total_incl_vat"),
|
|
662
680
|
truncate: !1,
|
|
663
681
|
as: "span",
|
|
664
682
|
class: "text-xs font-medium text-secondary"
|
|
665
|
-
}, null, 8, ["text"]),
|
|
666
|
-
text:
|
|
683
|
+
}, null, 8, ["text"]), g(w(k), {
|
|
684
|
+
text: s(n.invoice.grossAmount),
|
|
667
685
|
truncate: !1,
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
686
|
+
class: v([{
|
|
687
|
+
"text-sm font-semibold": _.value === null,
|
|
688
|
+
"text-xs font-medium": _.value !== null
|
|
689
|
+
}, "whitespace-nowrap text-primary"]),
|
|
690
|
+
as: "span"
|
|
691
|
+
}, null, 8, ["text", "class"])]),
|
|
671
692
|
_: 1
|
|
672
|
-
})
|
|
693
|
+
}),
|
|
694
|
+
_.value === null ? f("", !0) : (b(), p(l, { key: 0 }, [
|
|
695
|
+
g(w(D), {
|
|
696
|
+
justify: "between",
|
|
697
|
+
class: "w-full text-xs"
|
|
698
|
+
}, {
|
|
699
|
+
default: T(() => [g(w(k), {
|
|
700
|
+
text: w(r).t("wise_invoicing.invoice.detail.totals.advance_payment"),
|
|
701
|
+
truncate: !1,
|
|
702
|
+
as: "span",
|
|
703
|
+
class: "font-medium text-secondary"
|
|
704
|
+
}, null, 8, ["text"]), g(w(k), {
|
|
705
|
+
text: _.value.advancePayment,
|
|
706
|
+
truncate: !1,
|
|
707
|
+
as: "span",
|
|
708
|
+
class: "text-right font-medium whitespace-nowrap text-primary"
|
|
709
|
+
}, null, 8, ["text"])]),
|
|
710
|
+
_: 1
|
|
711
|
+
}),
|
|
712
|
+
g(w(O), {
|
|
713
|
+
orientation: "horizontal",
|
|
714
|
+
class: "bg-tertiary"
|
|
715
|
+
}),
|
|
716
|
+
g(w(D), {
|
|
717
|
+
class: "w-full",
|
|
718
|
+
justify: "between"
|
|
719
|
+
}, {
|
|
720
|
+
default: T(() => [g(w(k), {
|
|
721
|
+
text: w(r).t("wise_invoicing.invoice.detail.totals.amount_due"),
|
|
722
|
+
truncate: !1,
|
|
723
|
+
as: "span",
|
|
724
|
+
class: "text-xs font-medium text-secondary"
|
|
725
|
+
}, null, 8, ["text"]), g(w(k), {
|
|
726
|
+
text: _.value.amountDue,
|
|
727
|
+
truncate: !1,
|
|
728
|
+
as: "span",
|
|
729
|
+
class: "text-sm font-semibold whitespace-nowrap text-primary"
|
|
730
|
+
}, null, 8, ["text"])]),
|
|
731
|
+
_: 1
|
|
732
|
+
})
|
|
733
|
+
], 64))
|
|
673
734
|
]),
|
|
674
735
|
_: 1
|
|
675
736
|
})
|
|
676
|
-
]), n.invoice.externalRemarks ? (
|
|
677
|
-
text:
|
|
737
|
+
]), n.invoice.externalRemarks ? (b(), p("section", se, [g(w(k), {
|
|
738
|
+
text: w(r).t("wise_invoicing.invoice.pdf.summary.remarks"),
|
|
678
739
|
truncate: !1,
|
|
679
740
|
as: "h2",
|
|
680
741
|
class: "font-medium"
|
|
681
|
-
}, null, 8, ["text"]),
|
|
742
|
+
}, null, 8, ["text"]), g(w(k), {
|
|
682
743
|
text: n.invoice.externalRemarks,
|
|
683
744
|
truncate: !1,
|
|
684
745
|
as: "p"
|
|
685
|
-
}, null, 8, ["text"])])) :
|
|
746
|
+
}, null, 8, ["text"])])) : f("", !0)], 2));
|
|
686
747
|
}
|
|
687
|
-
}),
|
|
748
|
+
}), le = {
|
|
688
749
|
"aria-hidden": "true",
|
|
689
750
|
class: "pointer-events-none absolute inset-0 flex transform-[rotate(-34deg)] items-center justify-center text-[42mm] leading-none font-bold whitespace-nowrap text-primary uppercase opacity-[0.05] select-none"
|
|
690
|
-
},
|
|
751
|
+
}, ue = /* @__PURE__ */ _({
|
|
691
752
|
__name: "InvoicePdfWatermark",
|
|
692
753
|
props: { label: {} },
|
|
693
754
|
setup(e) {
|
|
694
|
-
let t = e, n =
|
|
695
|
-
return (e, r) => (
|
|
755
|
+
let t = e, n = c();
|
|
756
|
+
return (e, r) => (b(), p("div", le, C(t.label ?? w(n).t("wise_invoicing.invoice.status.draft")), 1));
|
|
696
757
|
}
|
|
697
|
-
}),
|
|
758
|
+
}), de = { class: "absolute right-9 bottom-9 text-xs leading-none font-medium text-tertiary" }, fe = /* @__PURE__ */ _({
|
|
698
759
|
__name: "BillingDocumentPdf",
|
|
699
760
|
props: {
|
|
700
761
|
billingDocument: {},
|
|
701
762
|
watermark: {}
|
|
702
763
|
},
|
|
703
764
|
setup(n) {
|
|
704
|
-
let r = n, i =
|
|
765
|
+
let r = n, i = u(() => r.billingDocument.status === e.DRAFT || r.billingDocument.status === e.READY), a = u(() => r.billingDocument.type === t.CREDIT_NOTE), o = u(() => R.buildRows(r.billingDocument, { isCreditNote: a.value })), s = u(() => {
|
|
705
766
|
let e = R.paginateRows(o.value, { hasRemarks: r.billingDocument.externalRemarks !== null && r.billingDocument.externalRemarks.trim() !== "" });
|
|
706
767
|
return e.map((t, n) => ({
|
|
707
768
|
isLastPage: n === e.length - 1,
|
|
@@ -709,32 +770,32 @@ var D = "-", O = 32, k = 512, A = 640, j = 576, M = 704, N = 52, P = 34, F = 16,
|
|
|
709
770
|
rows: t
|
|
710
771
|
}));
|
|
711
772
|
});
|
|
712
|
-
return (e, t) => (
|
|
773
|
+
return (e, t) => (b(!0), p(l, null, x(s.value, (e, t) => (b(), p("article", {
|
|
713
774
|
key: `invoice-pdf-page-${t}`,
|
|
714
|
-
class:
|
|
775
|
+
class: v([t > 0 ? "\n mt-4xl\n print:mt-0\n " : "", "relative mx-auto box-border flex h-[297mm] w-[210mm] break-after-page flex-col overflow-hidden bg-primary px-5xl pt-5xl pb-2xl text-primary shadow-card [-webkit-print-color-adjust:exact] [page-break-after:always] [print-color-adjust:exact] last:break-after-auto last:[page-break-after:auto] print:mx-none print:min-h-auto print:w-auto print:shadow-none"])
|
|
715
776
|
}, [
|
|
716
|
-
i.value ? (
|
|
777
|
+
i.value ? (b(), d(ue, {
|
|
717
778
|
key: 0,
|
|
718
779
|
label: r.watermark
|
|
719
|
-
}, null, 8, ["label"])) :
|
|
720
|
-
|
|
780
|
+
}, null, 8, ["label"])) : f("", !0),
|
|
781
|
+
g(B, {
|
|
721
782
|
invoice: r.billingDocument,
|
|
722
783
|
"page-type": e.headerType
|
|
723
784
|
}, null, 8, ["invoice", "page-type"]),
|
|
724
|
-
e.rows.length > 0 || r.billingDocument.lines.length === 0 ? (
|
|
785
|
+
e.rows.length > 0 || r.billingDocument.lines.length === 0 ? (b(), d(ae, {
|
|
725
786
|
key: 1,
|
|
726
787
|
"is-credit-note": a.value,
|
|
727
788
|
rows: e.rows
|
|
728
|
-
}, null, 8, ["is-credit-note", "rows"])) :
|
|
729
|
-
e.isLastPage ? (
|
|
789
|
+
}, null, 8, ["is-credit-note", "rows"])) : f("", !0),
|
|
790
|
+
e.isLastPage ? (b(), d(ce, {
|
|
730
791
|
key: 2,
|
|
731
792
|
"has-lines": e.rows.length > 0 || r.billingDocument.lines.length === 0,
|
|
732
793
|
invoice: r.billingDocument
|
|
733
|
-
}, null, 8, ["has-lines", "invoice"])) :
|
|
734
|
-
|
|
735
|
-
|
|
794
|
+
}, null, 8, ["has-lines", "invoice"])) : f("", !0),
|
|
795
|
+
g(z, { invoice: r.billingDocument }, null, 8, ["invoice"]),
|
|
796
|
+
m("span", de, C(t + 1) + "/" + C(s.value.length), 1)
|
|
736
797
|
], 2))), 128));
|
|
737
798
|
}
|
|
738
799
|
});
|
|
739
800
|
//#endregion
|
|
740
|
-
export {
|
|
801
|
+
export { R as i, Q as n, Z as r, fe as t };
|