@wisemen/wise-invoicing-web 0.0.3 → 0.0.4
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-CwonTh2r.js → BillingDocumentDetailViewDataProvider-pePmiXWb.js} +332 -332
- package/dist/{BillingDocumentPdf-GWCCjE6F.js → BillingDocumentPdf-Dg5JlQE1.js} +8 -8
- package/dist/{CreditNoteDetailViewDataProvider-CaucKK9o.js → CreditNoteDetailViewDataProvider-C-A0jyVr.js} +5 -5
- package/dist/{CreditNotePdfViewDataProvider-CDkvm-3m.js → CreditNotePdfViewDataProvider-DNUvFVDj.js} +2 -2
- package/dist/{CustomFieldValueText-CC9spLWf.js → CustomFieldValueText-DDQq-975.js} +1 -1
- package/dist/{DunningCaseDetailViewDataProvider-1Ui9yqUb.js → DunningCaseDetailViewDataProvider-0WV-7-vg.js} +110 -113
- package/dist/DunningCaseOverviewView-CHdzfbhb.js +553 -0
- package/dist/{DunningCaseReminderPdfViewDataProvider-CVnr9ge6.js → DunningCaseReminderPdfViewDataProvider-DcM-7ECg.js} +4 -1
- package/dist/DunningCaseSendDialog-DBtwr2ue.js +350 -0
- package/dist/{InvoiceDetailViewDataProvider-DfRDFCEb.js → InvoiceDetailViewDataProvider-BDL9lAWe.js} +175 -174
- package/dist/{InvoiceOverviewViewDataProvider-CNK7H5r2.js → InvoiceOverviewViewDataProvider-B_jrcC_8.js} +54 -54
- package/dist/{InvoicePdfView-CrWU8Xa-.js → InvoicePdfView-Bygb-9z6.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-nHZoeRxn.js → InvoicePdfViewDataProvider-nBk3XNrE.js} +2 -2
- package/dist/{InvoicePublicPdfViewDataProvider-CXWSg2pq.js → InvoicePublicPdfViewDataProvider-DHJP_-7-.js} +2 -2
- package/dist/{IssuerSettingsViewDataProvider-DcA6rgOJ.js → IssuerSettingsViewDataProvider-Dk_Q6w6f.js} +2 -2
- package/dist/ReminderSettingsViewDataProvider-CDBjfU7R.js +668 -0
- package/dist/{billingDocumentDetail.transformer-tmy9Tf_b.js → billingDocumentDetail.transformer-zMTbka5p.js} +1 -1
- package/dist/composables/invoicingConfig.composable.d.ts +0 -2
- package/dist/{creditNoteDetail.query-BM2saU0n.js → creditNoteDetail.query-BZqgZRSu.js} +2 -2
- package/dist/{documentTitle.composable-D7XA-8iJ.js → documentTitle.composable-CeaFddr1.js} +28 -30
- package/dist/{invoicingConfig.composable-AjojW4qE.js → i18n.lib-DUbAMBRb.js} +8 -66
- package/dist/index.js +156 -157
- package/dist/{invoice.service-PsmVGGTR.js → invoice.service-ChHEtXBA.js} +13 -13
- package/dist/{invoiceDeliveryStatus.util-CL8K78pD.js → invoiceDeliveryStatus.util-BsA-MlA3.js} +27 -27
- package/dist/{invoiceDetail.query-D2eFdE0j.js → invoiceDetail.query-O_CGvdwg.js} +1 -1
- package/dist/invoicingConfig.composable-c6w_aMm1.js +60 -0
- package/dist/{issuerSettings.query-d5i7Wd7j.js → issuerSettings.query-RqtrZFaB.js} +1 -1
- package/dist/modules/dunning-case/api/queries/dunningCaseIndex.query.d.ts +0 -1
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseBulkSendStat.vue.d.ts +9 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseBulkSendSummary.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendFeeRow.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendInvoiceRow.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendInvoiceSummary.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/components/DunningCaseSendRecipientAlert.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/send/composables/dunningCaseReminderSubject.composable.d.ts +6 -0
- package/dist/modules/dunning-case/use-cases/send/composables/dunningCaseSendRecipient.composable.d.ts +16 -0
- package/dist/modules/dunning-case/use-cases/send/utils/dunningCaseSend.util.d.ts +13 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderFeeNotice.vue.d.ts +3 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderPanel.vue.d.ts +12 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +26 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderTimeline.vue.d.ts +13 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderTemplateTabs.vue.d.ts +20 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderTemplatesPanel.vue.d.ts +24 -0
- package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +41 -0
- package/dist/{reminderConfig.query-C7I3M2pu.js → reminderConfig.query-DzTN2AvU.js} +87 -100
- package/package.json +1 -1
- package/dist/DunningCaseOverviewView-Bvwaj4_y.js +0 -507
- package/dist/PermissionGuard-DDw-lDGL.js +0 -301
- package/dist/ReminderSettingsViewDataProvider-C4qz2Rli.js +0 -502
- package/dist/composables/permission-guard/permissionGuard.composable.d.ts +0 -4
- package/dist/modules/dunning-case/api/queries/dunningCaseIndex.query.spec.d.ts +0 -1
- package/dist/ui/permission-guard/PermissionGuard.vue.d.ts +0 -22
package/dist/{InvoiceDetailViewDataProvider-DfRDFCEb.js → InvoiceDetailViewDataProvider-BDL9lAWe.js}
RENAMED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "./i18n.lib-DUbAMBRb.js";
|
|
2
2
|
import "./api.util-Dm_TQedZ.js";
|
|
3
|
-
import { _ as
|
|
4
|
-
import { r as
|
|
5
|
-
import { a as
|
|
6
|
-
import { t as
|
|
3
|
+
import { _ as t, a as n, f as r, l as i, m as a, o, p as s, r as c } from "./documentTitle.composable-CeaFddr1.js";
|
|
4
|
+
import { r as l } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
5
|
+
import { a as u, i as d, n as f, t as p } from "./invoice.service-ChHEtXBA.js";
|
|
6
|
+
import { t as m } from "./download.util-PjaUQR6r.js";
|
|
7
|
+
import { n as h } from "./invoicingConfig.composable-c6w_aMm1.js";
|
|
7
8
|
import { r as g } from "./address.transformer-B8C0pwT1.js";
|
|
8
9
|
import { $ as _, D as v, G as y, L as b, M as ee, N as te, O as ne, Z as re, f as ie, g as ae, h as oe, i as se, l as x, nt as ce, t as le, v as S, w as ue } from "./dist-DP8KNFVD.js";
|
|
9
10
|
import { n as C, t as w } from "./dist-YTXTCfo1.js";
|
|
10
|
-
import { i as T, n as E, r as de } from "./CustomFieldValueText-
|
|
11
|
+
import { i as T, n as E, r as de } from "./CustomFieldValueText-DDQq-975.js";
|
|
11
12
|
import { t as D } from "./formango.util-D5c2ql--.js";
|
|
12
|
-
import { a as fe, c as pe, i as me, n as he, o as ge, r as _e, s as ve, t as ye, u as be } from "./invoiceDeliveryStatus.util-
|
|
13
|
-
import { t as xe } from "./issuerSettings.query-
|
|
14
|
-
import { C as Se, S as Ce, T as we, _ as Te, a as Ee, b as De, c as Oe, d as ke, f as Ae, g as je, h as Me, i as Ne, l as Pe, m as Fe, n as Ie, o as Le, p as Re, r as ze, s as Be, t as Ve, u as He, v as Ue, w as We, x as Ge, y as Ke } from "./BillingDocumentDetailViewDataProvider-
|
|
15
|
-
import { t as qe } from "./invoiceDetail.query-
|
|
13
|
+
import { a as fe, c as pe, i as me, n as he, o as ge, r as _e, s as ve, t as ye, u as be } from "./invoiceDeliveryStatus.util-BsA-MlA3.js";
|
|
14
|
+
import { t as xe } from "./issuerSettings.query-RqtrZFaB.js";
|
|
15
|
+
import { C as Se, S as Ce, T as we, _ as Te, a as Ee, b as De, c as Oe, d as ke, f as Ae, g as je, h as Me, i as Ne, l as Pe, m as Fe, n as Ie, o as Le, p as Re, r as ze, s as Be, t as Ve, u as He, v as Ue, w as We, x as Ge, y as Ke } from "./BillingDocumentDetailViewDataProvider-pePmiXWb.js";
|
|
16
|
+
import { t as qe } from "./invoiceDetail.query-O_CGvdwg.js";
|
|
16
17
|
import { RouterLink as Je, useRouter as Ye } from "vue-router";
|
|
17
18
|
import Xe, { z as O } from "zod";
|
|
18
19
|
import { useI18n as k } from "vue-i18n";
|
|
@@ -24,7 +25,7 @@ import { useForm as Q } from "formango";
|
|
|
24
25
|
//#region src/modules/invoice/api/mutations/invoiceUpdate.mutation.ts
|
|
25
26
|
function Ft() {
|
|
26
27
|
return H({
|
|
27
|
-
queryFn: (e) =>
|
|
28
|
+
queryFn: (e) => p.update(e.params.invoiceUuid, e.body),
|
|
28
29
|
queryKeysToInvalidate: {
|
|
29
30
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
30
31
|
invoiceIndex: {}
|
|
@@ -57,7 +58,7 @@ var It = /* @__PURE__ */ L({
|
|
|
57
58
|
//#region src/modules/invoice/api/mutations/invoiceCreateCreditNote.mutation.ts
|
|
58
59
|
function zt() {
|
|
59
60
|
return H({
|
|
60
|
-
queryFn: (e) =>
|
|
61
|
+
queryFn: (e) => p.createCreditNote(e.params.invoiceUuid),
|
|
61
62
|
queryKeysToInvalidate: {
|
|
62
63
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
63
64
|
invoiceIndex: {}
|
|
@@ -68,7 +69,7 @@ function zt() {
|
|
|
68
69
|
//#region src/modules/invoice/api/mutations/invoiceDuplicate.mutation.ts
|
|
69
70
|
function Bt() {
|
|
70
71
|
return H({
|
|
71
|
-
queryFn: (e) =>
|
|
72
|
+
queryFn: (e) => p.duplicate(e.params.invoiceUuid),
|
|
72
73
|
queryKeysToInvalidate: { invoiceIndex: {} }
|
|
73
74
|
});
|
|
74
75
|
}
|
|
@@ -76,7 +77,7 @@ function Bt() {
|
|
|
76
77
|
//#region src/modules/invoice/api/mutations/invoiceFinalize.mutation.ts
|
|
77
78
|
function Vt() {
|
|
78
79
|
return H({
|
|
79
|
-
queryFn: (e) =>
|
|
80
|
+
queryFn: (e) => p.finalize(e.params.invoiceUuid),
|
|
80
81
|
queryKeysToInvalidate: {
|
|
81
82
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
82
83
|
invoiceIndex: {}
|
|
@@ -87,7 +88,7 @@ function Vt() {
|
|
|
87
88
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsDraft.mutation.ts
|
|
88
89
|
function Ht() {
|
|
89
90
|
return H({
|
|
90
|
-
queryFn: (e) =>
|
|
91
|
+
queryFn: (e) => p.markAsDraft(e.params.invoiceUuid),
|
|
91
92
|
queryKeysToInvalidate: {
|
|
92
93
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
93
94
|
invoiceIndex: {}
|
|
@@ -98,7 +99,7 @@ function Ht() {
|
|
|
98
99
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsPaid.mutation.ts
|
|
99
100
|
function Ut() {
|
|
100
101
|
return H({
|
|
101
|
-
queryFn: (e) =>
|
|
102
|
+
queryFn: (e) => p.markAsPaid(e.params.invoiceUuid),
|
|
102
103
|
queryKeysToInvalidate: {
|
|
103
104
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
104
105
|
invoiceIndex: {}
|
|
@@ -109,7 +110,7 @@ function Ut() {
|
|
|
109
110
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsProtested.mutation.ts
|
|
110
111
|
function Wt() {
|
|
111
112
|
return H({
|
|
112
|
-
queryFn: (e) =>
|
|
113
|
+
queryFn: (e) => p.markAsProtested(e.params.invoiceUuid),
|
|
113
114
|
queryKeysToInvalidate: {
|
|
114
115
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
115
116
|
invoiceIndex: {}
|
|
@@ -120,7 +121,7 @@ function Wt() {
|
|
|
120
121
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsReady.mutation.ts
|
|
121
122
|
function Gt() {
|
|
122
123
|
return H({
|
|
123
|
-
queryFn: (e) =>
|
|
124
|
+
queryFn: (e) => p.markAsReady(e.params.invoiceUuid),
|
|
124
125
|
queryKeysToInvalidate: {
|
|
125
126
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
126
127
|
invoiceIndex: {}
|
|
@@ -131,7 +132,7 @@ function Gt() {
|
|
|
131
132
|
//#region src/modules/invoice/api/mutations/invoiceSend.mutation.ts
|
|
132
133
|
function Kt() {
|
|
133
134
|
return H({
|
|
134
|
-
queryFn: (e) =>
|
|
135
|
+
queryFn: (e) => p.send(e.params.invoiceUuid),
|
|
135
136
|
queryKeysToInvalidate: {
|
|
136
137
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
137
138
|
invoiceIndex: {}
|
|
@@ -142,7 +143,7 @@ function Kt() {
|
|
|
142
143
|
//#region src/modules/invoice/api/mutations/invoiceWithdrawProtest.mutation.ts
|
|
143
144
|
function qt() {
|
|
144
145
|
return H({
|
|
145
|
-
queryFn: (e) =>
|
|
146
|
+
queryFn: (e) => p.withdrawProtest(e.params.invoiceUuid),
|
|
146
147
|
queryKeysToInvalidate: {
|
|
147
148
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
148
149
|
invoiceIndex: {}
|
|
@@ -153,7 +154,7 @@ function qt() {
|
|
|
153
154
|
//#region src/modules/invoice/api/mutations/invoiceDelete.mutation.ts
|
|
154
155
|
function Jt() {
|
|
155
156
|
return H({
|
|
156
|
-
queryFn: (e) =>
|
|
157
|
+
queryFn: (e) => p.delete(e.params.invoiceUuid),
|
|
157
158
|
queryKeysToInvalidate: { invoiceIndex: {} }
|
|
158
159
|
});
|
|
159
160
|
}
|
|
@@ -198,7 +199,7 @@ var Yt = /* @__PURE__ */ L({
|
|
|
198
199
|
//#endregion
|
|
199
200
|
//#region src/modules/invoice/use-cases/detail/composables/invoiceDetailHeaderActions.composable.ts
|
|
200
201
|
function Xt(e) {
|
|
201
|
-
let t = k(), n = Z(), r = Ye(), i = Pt(),
|
|
202
|
+
let t = k(), n = Z(), r = Ye(), i = Pt(), o = i.create(Yt), c = i.create(Ge), l = Kt(), u = zt(), d = Bt(), f = Vt(), h = Ht(), g = Ut(), b = Wt(), ee = Gt(), re = qt(), { shouldSkipConfirmation: oe } = Ce(), x = $e(null), le = j(() => T.getMetadata(e.value.status)), S = j(() => x.value ?? e.value.isDisputed), C = j(() => e.value.status !== a.DRAFT && e.value.status !== a.READY), w = j(() => e.value.lifecycleStatus === s.FINALIZED);
|
|
202
203
|
function E(e) {
|
|
203
204
|
return le.value.actions.includes(e);
|
|
204
205
|
}
|
|
@@ -214,7 +215,7 @@ function Xt(e) {
|
|
|
214
215
|
await de();
|
|
215
216
|
return;
|
|
216
217
|
}
|
|
217
|
-
await
|
|
218
|
+
await c.open({
|
|
218
219
|
billingDocumentType: "invoice",
|
|
219
220
|
onConfirm: de
|
|
220
221
|
});
|
|
@@ -228,7 +229,7 @@ function Xt(e) {
|
|
|
228
229
|
n.show({ message: t.t("wise_invoicing.invoice.mark_as_ready.success") });
|
|
229
230
|
}
|
|
230
231
|
async function pe() {
|
|
231
|
-
let r = await
|
|
232
|
+
let r = await h.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
232
233
|
if (r.isErr()) {
|
|
233
234
|
n.apiError(r.error);
|
|
234
235
|
return;
|
|
@@ -270,10 +271,10 @@ function Xt(e) {
|
|
|
270
271
|
n.show({ message: t.t("wise_invoicing.invoice.send.success") });
|
|
271
272
|
}
|
|
272
273
|
async function ve() {
|
|
273
|
-
await
|
|
274
|
+
await o.open({ invoice: e.value });
|
|
274
275
|
}
|
|
275
276
|
async function ye() {
|
|
276
|
-
let r = await
|
|
277
|
+
let r = await p.getByUuid(e.value.uuid);
|
|
277
278
|
if (r.isErr()) {
|
|
278
279
|
n.apiError(r.error);
|
|
279
280
|
return;
|
|
@@ -284,7 +285,7 @@ function Xt(e) {
|
|
|
284
285
|
return;
|
|
285
286
|
}
|
|
286
287
|
let a = await Se.getDownloadUrl(i.uuid);
|
|
287
|
-
a !== null &&
|
|
288
|
+
a !== null && m.downloadUrl(a, i.name);
|
|
288
289
|
}
|
|
289
290
|
async function be() {
|
|
290
291
|
let i = await d.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
@@ -331,7 +332,7 @@ function Xt(e) {
|
|
|
331
332
|
key: "send",
|
|
332
333
|
label: t.t("wise_invoicing.invoice.detail.actions.send"),
|
|
333
334
|
variant: "primary",
|
|
334
|
-
visible: e.value.status ===
|
|
335
|
+
visible: e.value.status === a.FINALIZED,
|
|
335
336
|
onClick: _e
|
|
336
337
|
},
|
|
337
338
|
{
|
|
@@ -374,11 +375,11 @@ function Xt(e) {
|
|
|
374
375
|
onSelect: ge
|
|
375
376
|
}
|
|
376
377
|
], r = [
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
378
|
+
a.FINALIZED,
|
|
379
|
+
a.PAID,
|
|
380
|
+
a.SENT,
|
|
381
|
+
a.OVERDUE,
|
|
382
|
+
a.PROTESTED
|
|
382
383
|
].includes(e.value.status), i = [
|
|
383
384
|
{
|
|
384
385
|
icon: ae,
|
|
@@ -401,7 +402,7 @@ function Xt(e) {
|
|
|
401
402
|
visible: !0,
|
|
402
403
|
onSelect: be
|
|
403
404
|
}
|
|
404
|
-
],
|
|
405
|
+
], o = [{
|
|
405
406
|
icon: te,
|
|
406
407
|
key: "createCreditNote",
|
|
407
408
|
label: t.t("wise_invoicing.invoice.detail.header.cancel_with_credit_note"),
|
|
@@ -424,7 +425,7 @@ function Xt(e) {
|
|
|
424
425
|
key: "secondary"
|
|
425
426
|
},
|
|
426
427
|
{
|
|
427
|
-
items:
|
|
428
|
+
items: o.filter((e) => e.visible),
|
|
428
429
|
key: "destructive"
|
|
429
430
|
}
|
|
430
431
|
].filter((e) => e.items.length > 0);
|
|
@@ -446,13 +447,13 @@ var Zt = /* @__PURE__ */ L({
|
|
|
446
447
|
},
|
|
447
448
|
emits: ["togglePdfView"],
|
|
448
449
|
setup(e, { emit: t }) {
|
|
449
|
-
let n = e,
|
|
450
|
+
let n = e, i = t, a = k(), o = Z(), { isDisputed: s, menuGroups: c, primaryButtons: l } = Xt(j(() => n.invoice)), u = Ft(), d = j(() => new We(n.invoice.status)), p = j(() => d.value.color), m = j(() => a.t(d.value.translationKey)), h = j(() => n.invoice.deliveryStatus !== r.UNSENT), g = j(() => ye.isSent(n.invoice.deliveryStatus)), _ = j(() => !T.isEditable(n.invoice.status)), v = Q({
|
|
450
451
|
initialState: { subject: n.invoice.subject },
|
|
451
452
|
schema: Rt,
|
|
452
453
|
onSubmit: async (e) => {
|
|
453
454
|
let t = await u.execute({
|
|
454
455
|
body: {
|
|
455
|
-
...
|
|
456
|
+
...f.toForm(n.invoice),
|
|
456
457
|
subject: e.subject
|
|
457
458
|
},
|
|
458
459
|
params: { invoiceUuid: n.invoice.uuid }
|
|
@@ -468,7 +469,7 @@ var Zt = /* @__PURE__ */ L({
|
|
|
468
469
|
"fallback-title": B(a).t("wise_invoicing.invoice.detail.fallback_title"),
|
|
469
470
|
"is-disabled": _.value,
|
|
470
471
|
sequence: n.invoice.sequence,
|
|
471
|
-
"status-color":
|
|
472
|
+
"status-color": p.value,
|
|
472
473
|
"status-label": m.value,
|
|
473
474
|
icon: B(b),
|
|
474
475
|
"subject-field": B(y),
|
|
@@ -478,7 +479,7 @@ var Zt = /* @__PURE__ */ L({
|
|
|
478
479
|
"is-pdf-view-active": n.isPdfViewActive,
|
|
479
480
|
"menu-groups": B(c),
|
|
480
481
|
"primary-buttons": B(l),
|
|
481
|
-
onTogglePdfView: t[0] ||= (e) =>
|
|
482
|
+
onTogglePdfView: t[0] ||= (e) => i("togglePdfView")
|
|
482
483
|
}, null, 8, [
|
|
483
484
|
"is-pdf-view-active",
|
|
484
485
|
"menu-groups",
|
|
@@ -532,7 +533,7 @@ var Zt = /* @__PURE__ */ L({
|
|
|
532
533
|
__name: "InvoiceDetailLinkedCreditNotesSection",
|
|
533
534
|
props: { invoice: {} },
|
|
534
535
|
setup(e) {
|
|
535
|
-
let t = e, n = k(), r =
|
|
536
|
+
let t = e, n = k(), r = l(), i = j(() => t.invoice.creditNotes.map((e) => {
|
|
536
537
|
let t = new We(e.status);
|
|
537
538
|
return {
|
|
538
539
|
uuid: e.uuid,
|
|
@@ -607,10 +608,10 @@ var Zt = /* @__PURE__ */ L({
|
|
|
607
608
|
name: O.string()
|
|
608
609
|
}),
|
|
609
610
|
subject: O.string().nullable()
|
|
610
|
-
}).superRefine((
|
|
611
|
-
Temporal.PlainDate.compare(
|
|
611
|
+
}).superRefine((t, n) => {
|
|
612
|
+
Temporal.PlainDate.compare(t.dueOn, t.issuedOn) < 0 && n.addIssue({
|
|
612
613
|
code: "custom",
|
|
613
|
-
message:
|
|
614
|
+
message: e.global.t("invoicing.invoice.validation.due_date_after_issue_date"),
|
|
614
615
|
path: ["dueOn"]
|
|
615
616
|
});
|
|
616
617
|
}), tn = /* @__PURE__ */ L({
|
|
@@ -618,7 +619,7 @@ var Zt = /* @__PURE__ */ L({
|
|
|
618
619
|
props: { invoice: {} },
|
|
619
620
|
setup(e) {
|
|
620
621
|
let t = e, n = k(), r = Z(), i = Ft(), a = Q({
|
|
621
|
-
initialState: j(() =>
|
|
622
|
+
initialState: j(() => f.toForm(t.invoice)),
|
|
622
623
|
schema: en,
|
|
623
624
|
onSubmit: async (e) => {
|
|
624
625
|
let n = await i.execute({
|
|
@@ -652,7 +653,7 @@ var Zt = /* @__PURE__ */ L({
|
|
|
652
653
|
function nn(e) {
|
|
653
654
|
return it("invoiceActivityLogIndex", {
|
|
654
655
|
params: { invoiceUuid: e },
|
|
655
|
-
queryFn: (t) =>
|
|
656
|
+
queryFn: (t) => p.getActivityLogs(e.value, { pagination: t })
|
|
656
657
|
});
|
|
657
658
|
}
|
|
658
659
|
//#endregion
|
|
@@ -661,17 +662,17 @@ var rn = /* @__PURE__ */ L({
|
|
|
661
662
|
__name: "InvoiceDetailSidebarActivityTab",
|
|
662
663
|
props: { invoice: {} },
|
|
663
664
|
setup(e) {
|
|
664
|
-
let t = e, n = k(), { hasNextPage: r, isFetchingNextPage: i, isLoading: a, fetchNextPage: o, result: s } = nn(j(() => t.invoice.uuid)),
|
|
665
|
+
let t = e, n = k(), { hasNextPage: r, isFetchingNextPage: i, isLoading: a, fetchNextPage: o, result: s } = nn(j(() => t.invoice.uuid)), l = j(() => s.value.unwrapOr({
|
|
665
666
|
data: [],
|
|
666
667
|
meta: { next: null }
|
|
667
668
|
}).data);
|
|
668
669
|
return (e, s) => (z(), M(je, {
|
|
669
670
|
"current-billing-document": {
|
|
670
|
-
role: B(
|
|
671
|
+
role: B(c).INVOICE,
|
|
671
672
|
uuid: t.invoice.uuid
|
|
672
673
|
},
|
|
673
674
|
"empty-message": B(n).t("wise_invoicing.invoice.detail.sidebar.activity_empty"),
|
|
674
|
-
entries:
|
|
675
|
+
entries: l.value,
|
|
675
676
|
"fetch-next-page": B(o),
|
|
676
677
|
"has-next-page": B(r),
|
|
677
678
|
"is-fetching-next-page": B(i),
|
|
@@ -751,48 +752,48 @@ var sn = /* @__PURE__ */ L({
|
|
|
751
752
|
invoice: {}
|
|
752
753
|
},
|
|
753
754
|
emits: ["close"],
|
|
754
|
-
setup(
|
|
755
|
-
let
|
|
756
|
-
let e =
|
|
755
|
+
setup(e, { emit: t }) {
|
|
756
|
+
let n = e, r = t, i = k(), a = Z(), o = Ft(), s = xe(), c = h(), l = on(j(() => n.invoice.customer.uuid)), u = j(() => {
|
|
757
|
+
let e = l.result.value;
|
|
757
758
|
if (e.isOk()) return e.getValue().defaultPaymentTermDays;
|
|
758
|
-
let t =
|
|
759
|
+
let t = s.result.value;
|
|
759
760
|
return t.isOk() ? t.getValue().defaultPaymentTermDays ?? 0 : 0;
|
|
760
|
-
}),
|
|
761
|
-
initialState: j(() =>
|
|
761
|
+
}), d = Q({
|
|
762
|
+
initialState: j(() => f.toForm(n.invoice)),
|
|
762
763
|
schema: en,
|
|
763
764
|
onSubmit: async (e) => {
|
|
764
|
-
let t = await
|
|
765
|
+
let t = await o.execute({
|
|
765
766
|
body: e,
|
|
766
|
-
params: { invoiceUuid:
|
|
767
|
+
params: { invoiceUuid: n.invoice.uuid }
|
|
767
768
|
});
|
|
768
769
|
if (t.isErr()) {
|
|
769
|
-
|
|
770
|
+
a.apiError(t.error);
|
|
770
771
|
return;
|
|
771
772
|
}
|
|
772
|
-
|
|
773
|
+
r("close");
|
|
773
774
|
},
|
|
774
775
|
onSubmitError: () => {
|
|
775
|
-
|
|
776
|
+
a.unableToSave();
|
|
776
777
|
}
|
|
777
|
-
}),
|
|
778
|
+
}), p = d.register("issuedOn"), m = d.register("dueOn"), g = d.register("deliveredOn"), _ = d.register("poNumber"), v = d.register("subject"), y = d.register("customFields"), b = j({
|
|
778
779
|
get: () => y.modelValue.value ?? [],
|
|
779
780
|
set: (e) => {
|
|
780
781
|
y.setValue(e);
|
|
781
782
|
}
|
|
782
783
|
});
|
|
783
784
|
function ee(e) {
|
|
784
|
-
e !== null &&
|
|
785
|
+
e !== null && m.setValue(e.add({ days: u.value }));
|
|
785
786
|
}
|
|
786
787
|
return (e, t) => (z(), M(B(q), {
|
|
787
|
-
form: B(
|
|
788
|
+
form: B(d),
|
|
788
789
|
size: "sm",
|
|
789
|
-
onClose: t[1] ||= (e) =>
|
|
790
|
+
onClose: t[1] ||= (e) => r("close")
|
|
790
791
|
}, {
|
|
791
792
|
default: V(() => [
|
|
792
793
|
I(B(bt), {
|
|
793
794
|
icon: B(re),
|
|
794
795
|
"is-description-visible": !1,
|
|
795
|
-
title: B(
|
|
796
|
+
title: B(i).t("wise_invoicing.invoice.detail.header.edit_info"),
|
|
796
797
|
description: ""
|
|
797
798
|
}, null, 8, ["icon", "title"]),
|
|
798
799
|
I(B(gt), null, {
|
|
@@ -802,31 +803,31 @@ var sn = /* @__PURE__ */ L({
|
|
|
802
803
|
sm: 1
|
|
803
804
|
}, {
|
|
804
805
|
default: V(() => [
|
|
805
|
-
I(B(ft), R(B(D)(B(
|
|
806
|
-
label: B(
|
|
806
|
+
I(B(ft), R(B(D)(B(p)), {
|
|
807
|
+
label: B(i).t("wise_invoicing.invoice.detail.header.invoice_date"),
|
|
807
808
|
"is-required": !0,
|
|
808
809
|
"onUpdate:modelValue": ee
|
|
809
810
|
}), null, 16, ["label"]),
|
|
810
|
-
I(B(ft), R(B(D)(B(
|
|
811
|
-
label: B(
|
|
811
|
+
I(B(ft), R(B(D)(B(m)), {
|
|
812
|
+
label: B(i).t("wise_invoicing.invoice.detail.header.due_date"),
|
|
812
813
|
"is-required": !0,
|
|
813
|
-
"min-date": B(
|
|
814
|
+
"min-date": B(p).modelValue.value
|
|
814
815
|
}), null, 16, ["label", "min-date"]),
|
|
815
|
-
B(
|
|
816
|
-
I(B(jt), R(B(D)(B(_)), { label: B(
|
|
816
|
+
B(c).isDeliveryDateVisible.value ? (z(), M(B(ft), R({ key: 0 }, B(D)(B(g)), { label: B(i).t("wise_invoicing.invoice.detail.header.delivery_date") }), null, 16, ["label"])) : N("", !0),
|
|
817
|
+
I(B(jt), R(B(D)(B(_)), { label: B(i).t("wise_invoicing.invoice.detail.header.po_number") }), null, 16, ["label"]),
|
|
817
818
|
I(B(jt), R(B(D)(B(v)), {
|
|
818
|
-
label: B(
|
|
819
|
-
placeholder: B(
|
|
819
|
+
label: B(i).t("wise_invoicing.invoice.detail.header.subject"),
|
|
820
|
+
placeholder: B(i).t("wise_invoicing.invoice.detail.header.subject_placeholder")
|
|
820
821
|
}), null, 16, ["label", "placeholder"])
|
|
821
822
|
]),
|
|
822
823
|
_: 1
|
|
823
824
|
}), I(an, {
|
|
824
825
|
modelValue: b.value,
|
|
825
826
|
"onUpdate:modelValue": t[0] ||= (e) => b.value = e,
|
|
826
|
-
currency:
|
|
827
|
-
definitions:
|
|
827
|
+
currency: n.invoice.currency,
|
|
828
|
+
definitions: n.customFieldDefinitions,
|
|
828
829
|
"is-disabled": !0,
|
|
829
|
-
precision:
|
|
830
|
+
precision: n.invoice.grossAmount.precision,
|
|
830
831
|
class: "w-full"
|
|
831
832
|
}, null, 8, [
|
|
832
833
|
"modelValue",
|
|
@@ -839,7 +840,7 @@ var sn = /* @__PURE__ */ L({
|
|
|
839
840
|
_: 1
|
|
840
841
|
}),
|
|
841
842
|
I(B(_t), null, {
|
|
842
|
-
right: V(() => [I(B(vt), { label: "cancel" }), I(B(yt), { label: B(
|
|
843
|
+
right: V(() => [I(B(vt), { label: "cancel" }), I(B(yt), { label: B(i).t("wise_invoicing.invoice.detail.header.edit_info") }, null, 8, ["label"])]),
|
|
843
844
|
_: 1
|
|
844
845
|
})
|
|
845
846
|
]),
|
|
@@ -852,69 +853,69 @@ var sn = /* @__PURE__ */ L({
|
|
|
852
853
|
customFieldDefinitions: {},
|
|
853
854
|
invoice: {}
|
|
854
855
|
},
|
|
855
|
-
setup(
|
|
856
|
-
let
|
|
857
|
-
if (!
|
|
858
|
-
let e =
|
|
859
|
-
return
|
|
856
|
+
setup(e) {
|
|
857
|
+
let t = e, n = k(), r = C(), i = h(), a = Pt().create(sn), s = j(() => T.isEditable(t.invoice.status)), c = j(() => E.filterByEntityType(t.customFieldDefinitions, o.INVOICE)), l = j(() => {
|
|
858
|
+
if (!t.invoice.isOverdue) return null;
|
|
859
|
+
let e = t.invoice.dueOn.toZonedDateTime(ot.Now.timeZoneId()).toInstant();
|
|
860
|
+
return r.toRelativeTime(e);
|
|
860
861
|
});
|
|
861
|
-
async function
|
|
862
|
-
await
|
|
863
|
-
customFieldDefinitions:
|
|
864
|
-
invoice:
|
|
862
|
+
async function u() {
|
|
863
|
+
await a.open({
|
|
864
|
+
customFieldDefinitions: c.value,
|
|
865
|
+
invoice: t.invoice
|
|
865
866
|
});
|
|
866
867
|
}
|
|
867
|
-
function
|
|
868
|
-
return e === null ? "-" :
|
|
868
|
+
function d(e) {
|
|
869
|
+
return e === null ? "-" : r.formatPlainDate(e);
|
|
869
870
|
}
|
|
870
|
-
return (e,
|
|
871
|
+
return (e, r) => (z(), M(B(pt), { class: "px-2xl py-xl" }, {
|
|
871
872
|
default: V(() => [
|
|
872
|
-
I(B(mt), { label: B(
|
|
873
|
+
I(B(mt), { label: B(n).t("wise_invoicing.invoice.detail.sidebar.general") }, Ze({
|
|
873
874
|
default: V(() => [
|
|
874
875
|
I(B(W), null, {
|
|
875
876
|
default: V(() => [I(B(G), {
|
|
876
877
|
icon: B(oe),
|
|
877
|
-
label: B(
|
|
878
|
-
}, null, 8, ["icon", "label"]), I(B(K), { text:
|
|
878
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.invoice_id")
|
|
879
|
+
}, null, 8, ["icon", "label"]), I(B(K), { text: t.invoice.sequence ?? "-" }, null, 8, ["text"])]),
|
|
879
880
|
_: 1
|
|
880
881
|
}),
|
|
881
882
|
I(B(W), null, {
|
|
882
883
|
default: V(() => [I(B(G), {
|
|
883
884
|
icon: B(ee),
|
|
884
|
-
label: B(
|
|
885
|
-
}, null, 8, ["icon", "label"]), I(B(K), { text:
|
|
885
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.po_number")
|
|
886
|
+
}, null, 8, ["icon", "label"]), I(B(K), { text: t.invoice.poNumber ?? "-" }, null, 8, ["text"])]),
|
|
886
887
|
_: 1
|
|
887
888
|
}),
|
|
888
889
|
I(B(W), null, {
|
|
889
890
|
default: V(() => [I(B(G), {
|
|
890
891
|
icon: B(x),
|
|
891
|
-
label: B(
|
|
892
|
-
}, null, 8, ["icon", "label"]), I(B(K), { text:
|
|
892
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.issuer")
|
|
893
|
+
}, null, 8, ["icon", "label"]), I(B(K), { text: t.invoice.issuer.name ?? "-" }, null, 8, ["text"])]),
|
|
893
894
|
_: 1
|
|
894
895
|
}),
|
|
895
896
|
I(B(W), null, {
|
|
896
897
|
default: V(() => [I(B(G), {
|
|
897
898
|
icon: B(b),
|
|
898
|
-
label: B(
|
|
899
|
-
}, null, 8, ["icon", "label"]), I(B(K), { text:
|
|
899
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.invoice_date")
|
|
900
|
+
}, null, 8, ["icon", "label"]), I(B(K), { text: d(t.invoice.issueOn) }, null, 8, ["text"])]),
|
|
900
901
|
_: 1
|
|
901
902
|
}),
|
|
902
903
|
I(B(W), null, {
|
|
903
904
|
default: V(() => [I(B(G), {
|
|
904
905
|
icon: B(y),
|
|
905
|
-
label: B(
|
|
906
|
-
variant:
|
|
906
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.due_date"),
|
|
907
|
+
variant: t.invoice.isOverdue ? "error" : "default"
|
|
907
908
|
}, null, 8, [
|
|
908
909
|
"icon",
|
|
909
910
|
"label",
|
|
910
911
|
"variant"
|
|
911
912
|
]), I(B(J), { gap: "xs" }, {
|
|
912
913
|
default: V(() => [I(B(K), {
|
|
913
|
-
text:
|
|
914
|
-
variant:
|
|
915
|
-
}, null, 8, ["text", "variant"]),
|
|
914
|
+
text: d(t.invoice.dueOn),
|
|
915
|
+
variant: t.invoice.isOverdue ? "error" : "default"
|
|
916
|
+
}, null, 8, ["text", "variant"]), l.value === null ? N("", !0) : (z(), M(B(U), {
|
|
916
917
|
key: 0,
|
|
917
|
-
label:
|
|
918
|
+
label: l.value,
|
|
918
919
|
color: "error",
|
|
919
920
|
size: "sm",
|
|
920
921
|
variant: "translucent"
|
|
@@ -923,49 +924,49 @@ var sn = /* @__PURE__ */ L({
|
|
|
923
924
|
})]),
|
|
924
925
|
_: 1
|
|
925
926
|
}),
|
|
926
|
-
B(
|
|
927
|
+
B(i).isDeliveryDateVisible.value ? (z(), M(B(W), { key: 0 }, {
|
|
927
928
|
default: V(() => [I(B(G), {
|
|
928
929
|
icon: B(ce),
|
|
929
|
-
label: B(
|
|
930
|
-
}, null, 8, ["icon", "label"]), I(B(K), { text:
|
|
930
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.delivery_date")
|
|
931
|
+
}, null, 8, ["icon", "label"]), I(B(K), { text: d(t.invoice.deliveredOn) }, null, 8, ["text"])]),
|
|
931
932
|
_: 1
|
|
932
933
|
})) : N("", !0),
|
|
933
934
|
I(Me, {
|
|
934
|
-
definitions:
|
|
935
|
-
values:
|
|
935
|
+
definitions: t.customFieldDefinitions,
|
|
936
|
+
values: t.invoice.customFields
|
|
936
937
|
}, null, 8, ["definitions", "values"])
|
|
937
938
|
]),
|
|
938
939
|
_: 2
|
|
939
|
-
}, [
|
|
940
|
+
}, [s.value ? {
|
|
940
941
|
name: "actions",
|
|
941
942
|
fn: V(() => [I(B(Tt), {
|
|
942
943
|
icon: B(S),
|
|
943
|
-
label: B(
|
|
944
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.edit_info"),
|
|
944
945
|
variant: "tertiary",
|
|
945
|
-
onClick:
|
|
946
|
+
onClick: u
|
|
946
947
|
}, null, 8, ["icon", "label"])]),
|
|
947
948
|
key: "0"
|
|
948
949
|
} : void 0]), 1032, ["label"]),
|
|
949
|
-
I(Fe, { "original-invoice":
|
|
950
|
+
I(Fe, { "original-invoice": t.invoice.originalInvoice }, null, 8, ["original-invoice"]),
|
|
950
951
|
I(B(ht)),
|
|
951
952
|
I(B(mt), {
|
|
952
|
-
label: B(
|
|
953
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.bill_to"),
|
|
953
954
|
"collapse-options": {
|
|
954
955
|
isCollapsible: !0,
|
|
955
956
|
isOpenByDefault: !0,
|
|
956
|
-
badge: { label:
|
|
957
|
+
badge: { label: t.invoice.customer.name ?? "-" }
|
|
957
958
|
}
|
|
958
959
|
}, {
|
|
959
960
|
default: V(() => [I(B(W), { orientation: "vertical" }, {
|
|
960
961
|
default: V(() => [I(B(Y), {
|
|
961
|
-
text:
|
|
962
|
+
text: t.invoice.customer.name ?? "-",
|
|
962
963
|
class: "text-xs font-medium"
|
|
963
|
-
}, null, 8, ["text"]),
|
|
964
|
-
text: B(g).formatLines(
|
|
964
|
+
}, null, 8, ["text"]), t.invoice.customer.address ? (z(), P(A, { key: 0 }, [I(B(Y), {
|
|
965
|
+
text: B(g).formatLines(t.invoice.customer.address)[0] ?? "",
|
|
965
966
|
class: "text-xs"
|
|
966
|
-
}, null, 8, ["text"]),
|
|
967
|
+
}, null, 8, ["text"]), t.invoice.customer.address ? (z(), M(B(Y), {
|
|
967
968
|
key: 0,
|
|
968
|
-
text: B(g).formatLines(
|
|
969
|
+
text: B(g).formatLines(t.invoice.customer.address)[1] ?? "",
|
|
969
970
|
class: "text-xs"
|
|
970
971
|
}, null, 8, ["text"])) : N("", !0)], 64)) : N("", !0)]),
|
|
971
972
|
_: 1
|
|
@@ -974,17 +975,17 @@ var sn = /* @__PURE__ */ L({
|
|
|
974
975
|
}, 8, ["label", "collapse-options"]),
|
|
975
976
|
I(B(ht)),
|
|
976
977
|
I(B(mt), {
|
|
977
|
-
label: B(
|
|
978
|
+
label: B(n).t("wise_invoicing.invoice.detail.header.bill_from"),
|
|
978
979
|
"collapse-options": {
|
|
979
980
|
isCollapsible: !0,
|
|
980
981
|
isOpenByDefault: !1,
|
|
981
|
-
badge: { label:
|
|
982
|
+
badge: { label: t.invoice.issuer.email ?? "-" }
|
|
982
983
|
}
|
|
983
984
|
}, {
|
|
984
985
|
default: V(() => [I(B(W), { orientation: "vertical" }, {
|
|
985
|
-
default: V(() => [I(B(G), { label:
|
|
986
|
+
default: V(() => [I(B(G), { label: t.invoice.issuer.email ?? "-" }, null, 8, ["label"]), t.invoice.issuer.address ? (z(), M(B(K), {
|
|
986
987
|
key: 0,
|
|
987
|
-
text: B(g).format(
|
|
988
|
+
text: B(g).format(t.invoice.issuer.address)
|
|
988
989
|
}, null, 8, ["text"])) : N("", !0)]),
|
|
989
990
|
_: 1
|
|
990
991
|
})]),
|
|
@@ -1019,7 +1020,7 @@ var sn = /* @__PURE__ */ L({
|
|
|
1019
1020
|
//#region src/modules/invoice/api/mutations/invoicePaymentDelete.mutation.ts
|
|
1020
1021
|
function un() {
|
|
1021
1022
|
return H({
|
|
1022
|
-
queryFn: (e) =>
|
|
1023
|
+
queryFn: (e) => p.deletePayment(e.params.invoiceUuid, e.params.paymentUuid),
|
|
1023
1024
|
queryKeysToInvalidate: {
|
|
1024
1025
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
1025
1026
|
invoicePaymentIndex: { invoiceUuid: (e) => e.invoiceUuid }
|
|
@@ -1031,7 +1032,7 @@ function un() {
|
|
|
1031
1032
|
function dn(e) {
|
|
1032
1033
|
return at("invoicePaymentIndex", {
|
|
1033
1034
|
params: { invoiceUuid: e },
|
|
1034
|
-
queryFn: () =>
|
|
1035
|
+
queryFn: () => p.getPayments(e.value)
|
|
1035
1036
|
});
|
|
1036
1037
|
}
|
|
1037
1038
|
//#endregion
|
|
@@ -1043,16 +1044,16 @@ var fn = /* @__PURE__ */ L({
|
|
|
1043
1044
|
onDelete: { type: Function }
|
|
1044
1045
|
},
|
|
1045
1046
|
setup(e) {
|
|
1046
|
-
let
|
|
1047
|
+
let n = e, r = k();
|
|
1047
1048
|
return (e, i) => (z(), M(B(kt), null, {
|
|
1048
1049
|
default: V(() => [I(B(At), null, {
|
|
1049
|
-
default: V(() => [
|
|
1050
|
+
default: V(() => [n.payment.source === B(t).MANUAL ? (z(), M(B(Tt), {
|
|
1050
1051
|
key: 0,
|
|
1051
1052
|
label: B(r).t("wise_invoicing.invoice.detail.payments.delete.title"),
|
|
1052
1053
|
icon: B(_e),
|
|
1053
1054
|
size: "sm",
|
|
1054
1055
|
variant: "tertiary",
|
|
1055
|
-
onClick: i[0] ||= (e) =>
|
|
1056
|
+
onClick: i[0] ||= (e) => n.onDelete(n.payment)
|
|
1056
1057
|
}, null, 8, ["label", "icon"])) : N("", !0)]),
|
|
1057
1058
|
_: 1
|
|
1058
1059
|
})]),
|
|
@@ -1063,9 +1064,9 @@ var fn = /* @__PURE__ */ L({
|
|
|
1063
1064
|
__name: "InvoiceDetailPaymentManualCell",
|
|
1064
1065
|
props: { payment: {} },
|
|
1065
1066
|
setup(e) {
|
|
1066
|
-
let
|
|
1067
|
+
let n = e;
|
|
1067
1068
|
return (e, r) => (z(), M(B(kt), null, {
|
|
1068
|
-
default: V(() => [
|
|
1069
|
+
default: V(() => [n.payment.source === B(t).MANUAL ? (z(), M(B(ge), {
|
|
1069
1070
|
key: 0,
|
|
1070
1071
|
class: "size-4 text-brand-600"
|
|
1071
1072
|
})) : N("", !0)]),
|
|
@@ -1089,7 +1090,7 @@ var fn = /* @__PURE__ */ L({
|
|
|
1089
1090
|
//#endregion
|
|
1090
1091
|
//#region src/modules/invoice/use-cases/detail/composables/invoiceDetailPaymentsTableColumns.composable.ts
|
|
1091
1092
|
function mn(e) {
|
|
1092
|
-
let t = k(), n = C(), r =
|
|
1093
|
+
let t = k(), n = C(), r = l();
|
|
1093
1094
|
return j(() => Nt()([
|
|
1094
1095
|
{
|
|
1095
1096
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.date"),
|
|
@@ -1154,7 +1155,7 @@ function mn(e) {
|
|
|
1154
1155
|
//#region src/modules/invoice/api/mutations/invoicePaymentCreate.mutation.ts
|
|
1155
1156
|
function hn() {
|
|
1156
1157
|
return H({
|
|
1157
|
-
queryFn: (e) =>
|
|
1158
|
+
queryFn: (e) => p.createPayment(e.params.invoiceUuid, e.body),
|
|
1158
1159
|
queryKeysToInvalidate: {
|
|
1159
1160
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
1160
1161
|
invoicePaymentIndex: { invoiceUuid: (e) => e.invoiceUuid }
|
|
@@ -1165,8 +1166,8 @@ function hn() {
|
|
|
1165
1166
|
//#region src/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.ts
|
|
1166
1167
|
var gn = O.object({
|
|
1167
1168
|
amount: O.number().positive(),
|
|
1168
|
-
currency: O.enum(
|
|
1169
|
-
date:
|
|
1169
|
+
currency: O.enum(n),
|
|
1170
|
+
date: d,
|
|
1170
1171
|
paymentReference: O.string().nullable(),
|
|
1171
1172
|
precision: O.number().int().nonnegative(),
|
|
1172
1173
|
remarks: O.string().nullable()
|
|
@@ -1175,11 +1176,11 @@ var gn = O.object({
|
|
|
1175
1176
|
props: { invoice: {} },
|
|
1176
1177
|
emits: ["close"],
|
|
1177
1178
|
setup(e, { emit: t }) {
|
|
1178
|
-
let n = e, r = t, i = k(), a = Z(), o =
|
|
1179
|
+
let n = e, r = t, i = k(), a = Z(), o = l(), s = hn(), c = j(() => o.getSymbol(n.invoice.grossAmount.currency)), d = Q({
|
|
1179
1180
|
initialState: {
|
|
1180
1181
|
amount: null,
|
|
1181
1182
|
currency: n.invoice.grossAmount.currency,
|
|
1182
|
-
date:
|
|
1183
|
+
date: u.getToday(),
|
|
1183
1184
|
paymentReference: null,
|
|
1184
1185
|
precision: n.invoice.grossAmount.precision,
|
|
1185
1186
|
remarks: null
|
|
@@ -1199,9 +1200,9 @@ var gn = O.object({
|
|
|
1199
1200
|
onSubmitError: () => {
|
|
1200
1201
|
a.unableToSave();
|
|
1201
1202
|
}
|
|
1202
|
-
}), f =
|
|
1203
|
+
}), f = d.register("amount"), p = d.register("date"), m = d.register("paymentReference"), h = d.register("remarks");
|
|
1203
1204
|
return (e, t) => (z(), M(B(q), {
|
|
1204
|
-
form: B(
|
|
1205
|
+
form: B(d),
|
|
1205
1206
|
size: "sm",
|
|
1206
1207
|
onClose: t[0] ||= (e) => r("close")
|
|
1207
1208
|
}, {
|
|
@@ -1257,7 +1258,7 @@ var gn = O.object({
|
|
|
1257
1258
|
__name: "InvoiceDetailPaymentsSection",
|
|
1258
1259
|
props: { invoice: {} },
|
|
1259
1260
|
setup(e) {
|
|
1260
|
-
let t = e, n = k(), r =
|
|
1261
|
+
let t = e, n = k(), r = l(), i = j(() => t.invoice.uuid), a = j(() => t.invoice.balanceDueAmount === null ? null : r.formatMonetary(t.invoice.balanceDueAmount)), { isLoading: o, result: s } = dn(i), c = Pt(), u = Z(), d = c.create(vn), f = c.create(dt), p = un(), m = j(() => s.value.match({
|
|
1261
1262
|
err: () => [],
|
|
1262
1263
|
loading: () => [],
|
|
1263
1264
|
ok: (e) => e
|
|
@@ -1281,10 +1282,10 @@ var gn = O.object({
|
|
|
1281
1282
|
paymentUuid: e.uuid
|
|
1282
1283
|
} });
|
|
1283
1284
|
if (r.isErr()) {
|
|
1284
|
-
|
|
1285
|
+
u.apiError(r.error);
|
|
1285
1286
|
return;
|
|
1286
1287
|
}
|
|
1287
|
-
|
|
1288
|
+
u.show({ message: n.t("wise_invoicing.invoice.detail.payments.delete.success") }), f.close();
|
|
1288
1289
|
}
|
|
1289
1290
|
});
|
|
1290
1291
|
}
|
|
@@ -1346,7 +1347,7 @@ var gn = O.object({
|
|
|
1346
1347
|
//#region src/modules/invoice/api/mutations/invoiceUpdateLines.mutation.ts
|
|
1347
1348
|
function bn() {
|
|
1348
1349
|
return H({
|
|
1349
|
-
queryFn: (e) =>
|
|
1350
|
+
queryFn: (e) => p.updateLines(e.params.invoiceUuid, e.body),
|
|
1350
1351
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
1351
1352
|
});
|
|
1352
1353
|
}
|
|
@@ -1354,27 +1355,27 @@ function bn() {
|
|
|
1354
1355
|
//#region src/modules/invoice/api/mutations/invoiceApplyDiscount.mutation.ts
|
|
1355
1356
|
function xn() {
|
|
1356
1357
|
return H({
|
|
1357
|
-
queryFn: (e) =>
|
|
1358
|
+
queryFn: (e) => p.applyDiscount(e.params.invoiceUuid, e.body),
|
|
1358
1359
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
1359
1360
|
});
|
|
1360
1361
|
}
|
|
1361
1362
|
//#endregion
|
|
1362
1363
|
//#region src/modules/invoice/models/invoice/update/invoiceApplyDiscountForm.model.ts
|
|
1363
1364
|
var Sn = O.object({
|
|
1364
|
-
currency: O.enum(
|
|
1365
|
+
currency: O.enum(n),
|
|
1365
1366
|
precision: O.number().int().nonnegative(),
|
|
1366
|
-
type: O.enum(
|
|
1367
|
+
type: O.enum(i),
|
|
1367
1368
|
value: O.number()
|
|
1368
|
-
}).refine((e) => e.type !==
|
|
1369
|
+
}).refine((e) => e.type !== i.PERCENTAGE || e.value <= 100, { path: ["value"] }), Cn = { class: "pr-md text-xs text-secondary" }, wn = /* @__PURE__ */ L({
|
|
1369
1370
|
__name: "InvoiceApplyDiscountDialog",
|
|
1370
1371
|
props: { invoice: {} },
|
|
1371
1372
|
emits: ["close"],
|
|
1372
1373
|
setup(e, { emit: t }) {
|
|
1373
|
-
let n = e, r = t,
|
|
1374
|
+
let n = e, r = t, a = k(), o = Z(), s = l(), c = xn(), u = j(() => Mt([i.PERCENTAGE, i.AMOUNT])), d = Q({
|
|
1374
1375
|
initialState: {
|
|
1375
1376
|
currency: n.invoice.grossAmount.currency,
|
|
1376
1377
|
precision: n.invoice.grossAmount.precision,
|
|
1377
|
-
type:
|
|
1378
|
+
type: i.PERCENTAGE,
|
|
1378
1379
|
value: null
|
|
1379
1380
|
},
|
|
1380
1381
|
schema: Sn,
|
|
@@ -1392,9 +1393,9 @@ var Sn = O.object({
|
|
|
1392
1393
|
onSubmitError: () => {
|
|
1393
1394
|
o.unableToSave();
|
|
1394
1395
|
}
|
|
1395
|
-
}), f = d.register("value"), p = d.register("type"), m = j(() => p.modelValue.value ===
|
|
1396
|
+
}), f = d.register("value"), p = d.register("type"), m = j(() => p.modelValue.value === i.PERCENTAGE), h = j(() => p.modelValue.value === i.AMOUNT), g = j(() => s.getSymbol(n.invoice.grossAmount.currency));
|
|
1396
1397
|
function _(e) {
|
|
1397
|
-
return
|
|
1398
|
+
return a.t(`wise_invoicing.invoice.detail.global_discount.type.${e}`);
|
|
1398
1399
|
}
|
|
1399
1400
|
return (e, t) => (z(), M(B(q), {
|
|
1400
1401
|
form: B(d),
|
|
@@ -1403,8 +1404,8 @@ var Sn = O.object({
|
|
|
1403
1404
|
}, {
|
|
1404
1405
|
default: V(() => [
|
|
1405
1406
|
I(B(bt), {
|
|
1406
|
-
title: B(
|
|
1407
|
-
description: B(
|
|
1407
|
+
title: B(a).t("wise_invoicing.invoice.detail.line_items.global_discount"),
|
|
1408
|
+
description: B(a).t("wise_invoicing.invoice.detail.global_discount.description"),
|
|
1408
1409
|
icon: B(le),
|
|
1409
1410
|
"is-description-visible": !0
|
|
1410
1411
|
}, null, 8, [
|
|
@@ -1422,13 +1423,13 @@ var Sn = O.object({
|
|
|
1422
1423
|
I(B(Dt), R(B(D)(B(p)), {
|
|
1423
1424
|
"display-fn": _,
|
|
1424
1425
|
"is-required": !0,
|
|
1425
|
-
items:
|
|
1426
|
-
label: B(
|
|
1426
|
+
items: u.value,
|
|
1427
|
+
label: B(a).t("wise_invoicing.invoice.detail.global_discount.type.label")
|
|
1427
1428
|
}), null, 16, ["items", "label"]),
|
|
1428
1429
|
m.value ? (z(), M(B(Et), R({ key: 0 }, B(D)(B(f)), {
|
|
1429
|
-
hint: B(
|
|
1430
|
+
hint: B(a).t("wise_invoicing.invoice.detail.global_discount.amount.hint"),
|
|
1430
1431
|
"is-required": !0,
|
|
1431
|
-
label: B(
|
|
1432
|
+
label: B(a).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
|
|
1432
1433
|
max: 100,
|
|
1433
1434
|
min: 0,
|
|
1434
1435
|
step: .01
|
|
@@ -1438,7 +1439,7 @@ var Sn = O.object({
|
|
|
1438
1439
|
}, 16, ["hint", "label"])) : N("", !0),
|
|
1439
1440
|
h.value ? (z(), M(B(Et), R({ key: 1 }, B(D)(B(f)), {
|
|
1440
1441
|
"is-required": !0,
|
|
1441
|
-
label: B(
|
|
1442
|
+
label: B(a).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
|
|
1442
1443
|
min: .01,
|
|
1443
1444
|
step: .01
|
|
1444
1445
|
}), {
|
|
@@ -1453,7 +1454,7 @@ var Sn = O.object({
|
|
|
1453
1454
|
_: 1
|
|
1454
1455
|
}),
|
|
1455
1456
|
I(B(_t), null, {
|
|
1456
|
-
right: V(() => [I(B(vt), { label: "cancel" }), I(B(yt), { label: B(
|
|
1457
|
+
right: V(() => [I(B(vt), { label: "cancel" }), I(B(yt), { label: B(a).t("wise_invoicing.invoice.detail.global_discount.confirm") }, null, 8, ["label"])]),
|
|
1457
1458
|
_: 1
|
|
1458
1459
|
})
|
|
1459
1460
|
]),
|
|
@@ -1466,28 +1467,28 @@ var Sn = O.object({
|
|
|
1466
1467
|
customFieldDefinitions: {},
|
|
1467
1468
|
invoice: {}
|
|
1468
1469
|
},
|
|
1469
|
-
setup(
|
|
1470
|
-
let
|
|
1471
|
-
isSaving: j(() =>
|
|
1472
|
-
billingDocument: () =>
|
|
1473
|
-
canEdit:
|
|
1474
|
-
customFieldDefinitions: () =>
|
|
1475
|
-
updateLines: (e) =>
|
|
1470
|
+
setup(e) {
|
|
1471
|
+
let t = e, n = j(() => t.invoice), r = h(), i = bn(), a = j(() => T.isEditable(t.invoice.status)), o = Ne({
|
|
1472
|
+
isSaving: j(() => i.isLoading.value),
|
|
1473
|
+
billingDocument: () => n.value,
|
|
1474
|
+
canEdit: a,
|
|
1475
|
+
customFieldDefinitions: () => t.customFieldDefinitions,
|
|
1476
|
+
updateLines: (e) => i.execute({
|
|
1476
1477
|
body: e,
|
|
1477
|
-
params: { invoiceUuid:
|
|
1478
|
+
params: { invoiceUuid: t.invoice.uuid }
|
|
1478
1479
|
})
|
|
1479
|
-
}),
|
|
1480
|
-
function
|
|
1481
|
-
|
|
1480
|
+
}), s = Pt().create(wn);
|
|
1481
|
+
function c() {
|
|
1482
|
+
s.open({ invoice: t.invoice });
|
|
1482
1483
|
}
|
|
1483
|
-
return Ae(
|
|
1484
|
+
return Ae(o), (e, n) => (z(), M(Le, null, {
|
|
1484
1485
|
default: V(() => [
|
|
1485
1486
|
I(Be, {
|
|
1486
|
-
"show-apply-discount": B(
|
|
1487
|
-
onApplyDiscount:
|
|
1487
|
+
"show-apply-discount": B(r).isGlobalDiscountEnabled.value,
|
|
1488
|
+
onApplyDiscount: c
|
|
1488
1489
|
}, null, 8, ["show-apply-discount"]),
|
|
1489
1490
|
I(Oe),
|
|
1490
|
-
I(Ee, { "billing-document":
|
|
1491
|
+
I(Ee, { "billing-document": t.invoice }, null, 8, ["billing-document"]),
|
|
1491
1492
|
I(ke)
|
|
1492
1493
|
]),
|
|
1493
1494
|
_: 1
|