@wisemen/wise-invoicing-web 0.11.2 → 0.12.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.
Files changed (79) hide show
  1. package/dist/{ApprovalReminderSettingsViewDataProvider-D0kpogSQ.js → ApprovalReminderSettingsViewDataProvider-BnHeEMZD.js} +6 -10
  2. package/dist/{BillingDocumentDetailViewDataProvider-D_oc3-0D.js → BillingDocumentDetailViewDataProvider-Dm8C5WNN.js} +1311 -1327
  3. package/dist/{BillingDocumentPdf-wlv-k8KE.js → BillingDocumentPdf-57ksqoPW.js} +16 -22
  4. package/dist/{CreditNoteDetailViewDataProvider-DoFm2xgo.js → CreditNoteDetailViewDataProvider-CC4gnwSN.js} +154 -172
  5. package/dist/{CreditNotePdfViewDataProvider-QpzNsVsK.js → CreditNotePdfViewDataProvider-C9vgN3kV.js} +4 -4
  6. package/dist/{CustomFieldValueText-DZzqLZ0K.js → CustomFieldValueText-CvWq0fl_.js} +3 -3
  7. package/dist/{DataProvider-C3uEds9v.js → DataProvider-BtnD-BzI.js} +1 -1
  8. package/dist/{DunningCaseSendDialog-Bol8NF1J.js → DunningCaseSendDialog-CfWSrquA.js} +6 -14
  9. package/dist/{InvoiceApprovalOutOfSyncIndicator-C4ZLDRiv.js → InvoiceApprovalOutOfSyncIndicator-CKLAraIU.js} +1 -1
  10. package/dist/{InvoiceApprovalOverviewView-BAmEOum7.js → InvoiceApprovalOverviewView-DpL-vV8_.js} +10 -18
  11. package/dist/{InvoiceApprovalStatusBadge-C2Wj9b_Z.js → InvoiceApprovalStatusBadge-oVWkCqZY.js} +3 -3
  12. package/dist/{InvoiceApproveDialogDataProvider-S81Mc5oS.js → InvoiceApproveDialogDataProvider-serNDdl9.js} +16 -32
  13. package/dist/{InvoiceDetailViewDataProvider-Dqu6qlky.js → InvoiceDetailViewDataProvider-BaT7fgsi.js} +591 -665
  14. package/dist/{InvoicePdfView-D0G-Pik3.js → InvoicePdfView-MaBnd78V.js} +2 -2
  15. package/dist/{InvoicePdfViewDataProvider-DXXbPe-Z.js → InvoicePdfViewDataProvider-BIHBY608.js} +4 -4
  16. package/dist/{InvoicePublicProFormaPdfViewDataProvider-CdGFZD-G.js → InvoicePublicProFormaPdfViewDataProvider-KY8pN59k.js} +4 -4
  17. package/dist/{InvoicingFileUploadProvider-BsK5eRGE.js → InvoicingFileUploadProvider-CxmF68sz.js} +2 -2
  18. package/dist/IssuerSettingsViewDataProvider-DJzVZS8Q.js +543 -0
  19. package/dist/{PeppolSettingsViewDataProvider-ZdJQGqux.js → PeppolSettingsViewDataProvider-C7lwtu7n.js} +6 -20
  20. package/dist/{api.util-B3JqQVJA.js → api.util-Ct8FnoLB.js} +628 -547
  21. package/dist/{billingDocumentDetail.transformer-CcnSe7Fz.js → billingDocumentDetail.transformer-B3ypgtIv.js} +4 -2
  22. package/dist/client/index.d.ts +1 -1
  23. package/dist/client/types.gen.d.ts +177 -7
  24. package/dist/client/zod.gen.d.ts +406 -6
  25. package/dist/composables/invoicingConfig.composable.d.ts +15 -0
  26. package/dist/{creditNoteDetail.query-BVbXoNt-.js → creditNoteDetail.query-C2BYvPKC.js} +5 -3
  27. package/dist/{dist-DALBiuub.js → dist-BZgvL8_m.js} +19 -30
  28. package/dist/{documentTitle.composable-RvqrZTBa.js → documentTitle.composable-BqZWKGw1.js} +35 -29
  29. package/dist/{i18n.lib-BkdaaKCs.js → i18n.lib-8sQYo5_y.js} +101 -7
  30. package/dist/index.d.ts +96 -2
  31. package/dist/index.js +4517 -228
  32. package/dist/{invoice.service-jakQLnDu.js → invoice.service-CtePUw1R.js} +8 -5
  33. package/dist/{invoiceApproval.service-DR9g1Dek.js → invoiceApproval.service-CQzG8_wX.js} +2 -2
  34. package/dist/{invoiceApprovalStatus.util-Nd4E3qlZ.js → invoiceApprovalStatus.util-C4su45dU.js} +2 -2
  35. package/dist/{invoiceCustomer.service-Bp59E0ZJ.js → invoiceCustomer.service-CzbM3ey1.js} +2 -2
  36. package/dist/{invoiceDetail.query-BBhA0ZAn.js → invoiceDetail.query-NNAoIuWN.js} +1 -1
  37. package/dist/{invoiceIndexCache.util-Ba2MGULh.js → invoiceIndexCache.util-DI0WM-eW.js} +4 -8
  38. package/dist/{invoicingConfig.composable-k8p1Y_eJ.js → invoicingConfig.composable-DXJ71Uq_.js} +20 -18
  39. package/dist/issuerSettings.query-ggEHdk0S.js +204 -0
  40. package/dist/libs/i18n.lib.d.ts +96 -2
  41. package/dist/locales/en-US.json.d.ts +50 -3
  42. package/dist/locales/nl-BE.json.d.ts +51 -4
  43. package/dist/models/billing-document/billingDocumentCreditable.util.d.ts +19 -0
  44. package/dist/models/billing-document/billingDocumentCreditable.util.spec.d.ts +1 -0
  45. package/dist/models/billing-document/billingDocumentDetail.model.d.ts +2 -0
  46. package/dist/models/billing-document/billingDocumentUpdateLines.model.d.ts +2 -0
  47. package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +4 -1
  48. package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.model.d.ts +1 -0
  49. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewFilters.composable.d.ts +1 -1
  50. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewFilters.composable.spec.d.ts +1 -0
  51. package/dist/modules/settings/api/mutations/issuerSettingsUpdate.mutation.d.ts +22 -1
  52. package/dist/modules/settings/models/issuer-settings/invoiceSequenceFormat.util.d.ts +16 -0
  53. package/dist/modules/settings/models/issuer-settings/invoiceSequenceFormat.util.spec.d.ts +1 -0
  54. package/dist/modules/settings/models/issuer-settings/issuerSettings.model.d.ts +7 -2
  55. package/dist/modules/settings/models/issuer-settings/issuerSettings.transformer.d.ts +2 -0
  56. package/dist/modules/settings/models/issuer-settings/issuerSettingsForm.model.d.ts +23 -2
  57. package/dist/modules/settings/use-cases/overview/components/InvoiceSequenceFormatFields.vue.d.ts +11 -0
  58. package/dist/modules/settings/use-cases/overview/components/InvoiceSequenceNumberPreview.vue.d.ts +12 -0
  59. package/dist/modules/settings/use-cases/overview/components/InvoiceSequencePreviewCard.vue.d.ts +13 -0
  60. package/dist/modules/settings/use-cases/overview/components/SharedSequencePreviewCard.vue.d.ts +8 -0
  61. package/dist/modules/settings/use-cases/overview/composables/sequenceFormatFields.composable.d.ts +16 -0
  62. package/dist/{reminderConfig.query-BIfCEIYX.js → reminderConfig.query-C2xT3DJH.js} +2 -2
  63. package/dist/{src-DUSgQTKr.js → src-Vz2dm4sM.js} +1 -3
  64. package/dist/style.css +1 -1
  65. package/dist/types/apiError.type.d.ts +2 -2
  66. package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +24 -0
  67. package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +4 -0
  68. package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +4 -0
  69. package/package.json +2 -2
  70. package/dist/DunningCaseDetailViewDataProvider-uRJFWZtQ.js +0 -439
  71. package/dist/DunningCaseOverviewView-DpQoXamE.js +0 -799
  72. package/dist/DunningCaseReminderPdfViewDataProvider-D-CfDeC8.js +0 -490
  73. package/dist/InvoiceOverviewViewDataProvider-WKzgF7cl.js +0 -1929
  74. package/dist/InvoicePublicPdfViewDataProvider-ndVoAAY3.js +0 -45
  75. package/dist/IssuerSettingsViewDataProvider-Ca7GPCDE.js +0 -193
  76. package/dist/ReminderSettingsViewDataProvider-DTC0Ud5z.js +0 -709
  77. package/dist/issuerSettings.query-BOgWdNmP.js +0 -118
  78. package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
  79. /package/dist/{DunningCaseReminderPdfViewDataProvider.css → index.css} +0 -0
@@ -1,5 +1,5 @@
1
- import { t as e } from "./documentTitle.composable-RvqrZTBa.js";
2
- import { t } from "./BillingDocumentPdf-wlv-k8KE.js";
1
+ import { t as e } from "./documentTitle.composable-BqZWKGw1.js";
2
+ import { t } from "./BillingDocumentPdf-57ksqoPW.js";
3
3
  import { useI18n as n } from "vue-i18n";
4
4
  import { computed as r, createElementBlock as i, createVNode as a, defineComponent as o, openBlock as s } from "vue";
5
5
  //#region src/modules/invoice/use-cases/pdf/views/InvoicePdfView.vue?vue&type=script&setup=true&lang.ts
@@ -1,7 +1,7 @@
1
- import { n as e } from "./invoicingConfig.composable-k8p1Y_eJ.js";
2
- import { t } from "./DataProvider-C3uEds9v.js";
3
- import { t as n } from "./InvoicePdfView-D0G-Pik3.js";
4
- import { t as r } from "./invoiceDetail.query-BBhA0ZAn.js";
1
+ import { n as e } from "./invoicingConfig.composable-DXJ71Uq_.js";
2
+ import { t } from "./DataProvider-BtnD-BzI.js";
3
+ import { t as n } from "./InvoicePdfView-MaBnd78V.js";
4
+ import { t as r } from "./invoiceDetail.query-NNAoIuWN.js";
5
5
  import { useI18n as i } from "vue-i18n";
6
6
  import { computed as a, createBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, openBlock as u, resolveDynamicComponent as d, unref as f, withCtx as p } from "vue";
7
7
  import { UIText as m } from "@wisemen/vue-core-design-system";
@@ -1,7 +1,7 @@
1
- import { n as e } from "./invoicingConfig.composable-k8p1Y_eJ.js";
2
- import { t } from "./invoice.service-jakQLnDu.js";
3
- import { t as n } from "./DataProvider-C3uEds9v.js";
4
- import { t as r } from "./InvoicePdfView-D0G-Pik3.js";
1
+ import { n as e } from "./invoicingConfig.composable-DXJ71Uq_.js";
2
+ import { t } from "./invoice.service-CtePUw1R.js";
3
+ import { t as n } from "./DataProvider-BtnD-BzI.js";
4
+ import { t as r } from "./InvoicePdfView-MaBnd78V.js";
5
5
  import { useI18n as i } from "vue-i18n";
6
6
  import { computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, openBlock as d, resolveDynamicComponent as f, unref as p, watch as m, withCtx as h } from "vue";
7
7
  import { useQuery as g } from "@wisemen/vue-core-api-utils";
@@ -1,5 +1,5 @@
1
- import { _ as e, f as t, t as n, u as r } from "./api.util-B3JqQVJA.js";
2
- import { S as i } from "./documentTitle.composable-RvqrZTBa.js";
1
+ import { _ as e, f as t, t as n, u as r } from "./api.util-Ct8FnoLB.js";
2
+ import { S as i } from "./documentTitle.composable-BqZWKGw1.js";
3
3
  import { z as a } from "zod";
4
4
  import { createBlock as o, defineComponent as s, openBlock as c, renderSlot as l, unref as u, withCtx as d } from "vue";
5
5
  import { UIConfigProvider as f, useInjectConfigContext as p } from "@wisemen/vue-core-design-system";
@@ -0,0 +1,543 @@
1
+ import "./api.util-Ct8FnoLB.js";
2
+ import { D as e, E as t, O as n, c as r, t as i } from "./documentTitle.composable-BqZWKGw1.js";
3
+ import { r as a } from "./useCurrencyFormat.composable-MtZaqKnO.js";
4
+ import { t as o } from "./addressForm.model-C853zEtX.js";
5
+ import { t as s } from "./DataProvider-BtnD-BzI.js";
6
+ import { t as c } from "./formango.util-D5c2ql--.js";
7
+ import { t as l } from "./dist-BFx8U4Su.js";
8
+ import { i as u, n as d, r as ee, t as f } from "./issuerSettings.query-ggEHdk0S.js";
9
+ import { t as p } from "./dashboard-BaWGNEek.js";
10
+ import { z as m } from "zod";
11
+ import { useI18n as h } from "vue-i18n";
12
+ import { Fragment as g, Teleport as te, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createVNode as C, defineComponent as w, mergeProps as T, normalizeClass as E, openBlock as D, renderList as O, toDisplayString as ne, unref as k, withCtx as A } from "vue";
13
+ import { useMutation as j } from "@wisemen/vue-core-api-utils";
14
+ import { useRouter as M } from "vue-router";
15
+ import { Temporal as N } from "temporal-polyfill";
16
+ import { UIAddressAutocomplete as re, UIAnimateHeight as P, UIButton as ie, UICheckbox as F, UIColumnLayout as I, UIDashboardPage as L, UIDashboardPageContent as R, UIForm as ae, UIFormFieldGrid as z, UIFormFieldGroup as B, UIFormFieldSet as V, UIFormLayout as oe, UIFormSubmitButton as se, UINumberField as H, UIPhoneNumberField as ce, UISelect as U, UISeparator as W, UIText as G, UITextField as K, createSelectOptions as q, useToast as le } from "@wisemen/vue-core-design-system";
17
+ import { useForm as ue } from "formango";
18
+ //#region src/modules/settings/api/mutations/issuerSettingsUpdate.mutation.ts
19
+ function de() {
20
+ return j({
21
+ queryFn: (e) => d.update(e.body),
22
+ queryKeysToInvalidate: { issuerSettings: {} }
23
+ });
24
+ }
25
+ //#endregion
26
+ //#region src/modules/settings/models/issuer-settings/issuerSettingsForm.model.ts
27
+ var J = m.object({
28
+ dateFormat: m.enum(t),
29
+ minDigits: m.number().int().min(0).max(10),
30
+ prefix: m.string().max(10),
31
+ separator: m.object({
32
+ afterDate: m.boolean(),
33
+ afterPrefix: m.boolean(),
34
+ value: m.enum(n)
35
+ })
36
+ }), fe = m.object({
37
+ name: m.string().min(1),
38
+ address: o.nullable(),
39
+ bankAccountNumber: m.string().min(1),
40
+ bic: m.string(),
41
+ creditNoteSequenceFormat: J,
42
+ currency: m.enum(r),
43
+ defaultPaymentTermDays: m.number().min(1),
44
+ email: m.email().min(1),
45
+ invoiceSequenceFormat: J,
46
+ phoneNumber: m.string().min(1),
47
+ restartsNumberingYearly: m.boolean(),
48
+ shareCreditNoteSequence: m.boolean(),
49
+ vatNumber: m.string().min(1),
50
+ website: m.string()
51
+ }), pe = /* @__PURE__ */ w({
52
+ __name: "InvoiceSequenceFormatFields",
53
+ props: {
54
+ editedFormat: {},
55
+ fields: {},
56
+ prefixLabel: {},
57
+ prefixPlaceholder: {}
58
+ },
59
+ setup(e) {
60
+ let r = e, i = h(), a = v(() => q(Object.values(t))), o = v(() => q(Object.values(n))), s = {
61
+ [t.NONE]: "wise_invoicing.settings.fields.sequence_date_format.options.none",
62
+ [t.YY]: "wise_invoicing.settings.fields.sequence_date_format.options.yy",
63
+ [t.YYMM]: "wise_invoicing.settings.fields.sequence_date_format.options.yymm",
64
+ [t.YYYY]: "wise_invoicing.settings.fields.sequence_date_format.options.yyyy",
65
+ [t.YYYYMM]: "wise_invoicing.settings.fields.sequence_date_format.options.yyyymm",
66
+ [t.YYYYMMDD]: "wise_invoicing.settings.fields.sequence_date_format.options.yyyymmdd"
67
+ }, l = {
68
+ [n.HYPHEN]: "wise_invoicing.settings.fields.sequence_separator.options.hyphen",
69
+ [n.NONE]: "wise_invoicing.settings.fields.sequence_separator.options.none",
70
+ [n.PERIOD]: "wise_invoicing.settings.fields.sequence_separator.options.period",
71
+ [n.SLASH]: "wise_invoicing.settings.fields.sequence_separator.options.slash",
72
+ [n.UNDERSCORE]: "wise_invoicing.settings.fields.sequence_separator.options.underscore"
73
+ }, d = v(() => u.hasSeparatorPlacementChoice(r.editedFormat));
74
+ return (e, t) => (D(), x(g, null, [
75
+ C(k(K), T(k(c)(r.fields.prefix), {
76
+ label: r.prefixLabel,
77
+ placeholder: r.prefixPlaceholder
78
+ }), null, 16, ["label", "placeholder"]),
79
+ C(k(U), T(k(c)(r.fields.dateFormat), {
80
+ "display-fn": (e) => k(i).t(s[e]),
81
+ items: a.value,
82
+ label: k(i).t("wise_invoicing.settings.fields.sequence_date_format.label")
83
+ }), null, 16, [
84
+ "display-fn",
85
+ "items",
86
+ "label"
87
+ ]),
88
+ C(k(P), null, {
89
+ default: A(() => [C(k(I), {
90
+ gap: "md",
91
+ align: "stretch"
92
+ }, {
93
+ default: A(() => [C(k(U), T(k(c)(r.fields.separator), {
94
+ "display-fn": (e) => k(i).t(l[e]),
95
+ items: o.value,
96
+ label: k(i).t("wise_invoicing.settings.fields.sequence_separator.label")
97
+ }), null, 16, [
98
+ "display-fn",
99
+ "items",
100
+ "label"
101
+ ]), C(_, {
102
+ "enter-active-class": "transition-opacity duration-200 ease-out",
103
+ "enter-from-class": "opacity-0",
104
+ "leave-active-class": "transition-opacity duration-150 ease-in",
105
+ "leave-to-class": "opacity-0"
106
+ }, {
107
+ default: A(() => [d.value ? (D(), y(k(I), {
108
+ key: 0,
109
+ gap: "md"
110
+ }, {
111
+ default: A(() => [C(k(F), T(k(c)(r.fields.separatorAfterPrefix), { label: k(i).t("wise_invoicing.settings.fields.sequence_separator_after_prefix.label") }), null, 16, ["label"]), C(k(F), T(k(c)(r.fields.separatorAfterDate), { label: k(i).t("wise_invoicing.settings.fields.sequence_separator_after_date.label") }), null, 16, ["label"])]),
112
+ _: 1
113
+ })) : b("", !0)]),
114
+ _: 1
115
+ })]),
116
+ _: 1
117
+ })]),
118
+ _: 1
119
+ }),
120
+ C(k(H), T(k(c)(r.fields.minDigits), {
121
+ min: 0,
122
+ max: 10,
123
+ label: k(i).t("wise_invoicing.settings.fields.sequence_min_digits.label"),
124
+ hint: k(i).t("wise_invoicing.settings.fields.sequence_min_digits.hint")
125
+ }), null, 16, ["label", "hint"])
126
+ ], 64));
127
+ }
128
+ }), Y = { class: "font-mono whitespace-nowrap" }, X = /* @__PURE__ */ w({
129
+ __name: "InvoiceSequenceNumberPreview",
130
+ props: {
131
+ issuedOn: {},
132
+ format: {},
133
+ sequenceNumber: { default: 1 }
134
+ },
135
+ setup(e) {
136
+ let t = e, n = {
137
+ date: "text-brand-secondary",
138
+ number: "text-primary",
139
+ prefix: "text-secondary",
140
+ separator: "text-tertiary"
141
+ }, r = v(() => u.formatParts(t.format, t.sequenceNumber, t.issuedOn));
142
+ return (e, t) => (D(), x("span", Y, [(D(!0), x(g, null, O(r.value, (e, t) => (D(), x("span", {
143
+ key: t,
144
+ class: E(n[e.type])
145
+ }, ne(e.text), 3))), 128))]));
146
+ }
147
+ }), Z = { class: "grid grid-cols-[auto_1fr] items-baseline gap-x-md gap-y-xs" }, me = /* @__PURE__ */ w({
148
+ __name: "InvoiceSequencePreviewCard",
149
+ props: {
150
+ hasOtherNumberingChanges: { type: Boolean },
151
+ isChangeImmediate: { type: Boolean },
152
+ isRestartingYearly: { type: Boolean },
153
+ documentType: {},
154
+ editedFormat: {},
155
+ savedFormat: {}
156
+ },
157
+ setup(e) {
158
+ let t = e, n = h(), r = {
159
+ credit_note: "wise_invoicing.settings.preview.existing_unchanged_credit_note",
160
+ invoice: "wise_invoicing.settings.preview.existing_unchanged"
161
+ }, i = {
162
+ credit_note: "credit-note-sequence-preview",
163
+ invoice: "invoice-sequence-preview"
164
+ }, a = {
165
+ credit_note: "wise_invoicing.settings.preview.deferred_credit_note",
166
+ invoice: "wise_invoicing.settings.preview.deferred"
167
+ }, o = N.Now.plainDateISO(), s = N.PlainDate.from({
168
+ day: 1,
169
+ month: 1,
170
+ year: o.year + 1
171
+ }), c = v(() => !u.equals(t.editedFormat, t.savedFormat)), l = v(() => (c.value || t.hasOtherNumberingChanges) && !t.isChangeImmediate), d = v(() => l.value ? s : o), ee = v(() => t.isRestartingYearly && !(c.value && l.value)), f = v(() => t.isChangeImmediate ? null : n.t(a[t.documentType], { year: s.year }));
172
+ return (e, a) => (D(), y(k(I), {
173
+ "data-test-id": i[t.documentType],
174
+ gap: "sm",
175
+ class: "col-span-full rounded-xl border border-secondary p-lg"
176
+ }, {
177
+ default: A(() => [
178
+ C(k(G), {
179
+ text: k(n).t("wise_invoicing.settings.preview.label"),
180
+ class: "text-xs font-medium text-secondary"
181
+ }, null, 8, ["text"]),
182
+ S("div", Z, [
183
+ C(k(G), {
184
+ text: k(n).t("wise_invoicing.settings.preview.current"),
185
+ class: "text-xs text-secondary"
186
+ }, null, 8, ["text"]),
187
+ C(X, {
188
+ format: t.savedFormat,
189
+ "issued-on": k(o),
190
+ class: E(c.value ? "text-sm" : "text-sm font-semibold")
191
+ }, null, 8, [
192
+ "format",
193
+ "issued-on",
194
+ "class"
195
+ ]),
196
+ c.value ? (D(), x(g, { key: 0 }, [C(k(G), {
197
+ text: k(n).t("wise_invoicing.settings.preview.new"),
198
+ class: "text-xs text-secondary"
199
+ }, null, 8, ["text"]), C(X, {
200
+ format: t.editedFormat,
201
+ "issued-on": d.value,
202
+ class: "text-sm font-semibold"
203
+ }, null, 8, ["format", "issued-on"])], 64)) : b("", !0),
204
+ ee.value ? (D(), x(g, { key: 1 }, [C(k(G), {
205
+ text: k(n).t("wise_invoicing.settings.preview.restart"),
206
+ class: "text-xs text-secondary"
207
+ }, null, 8, ["text"]), C(X, {
208
+ format: t.editedFormat,
209
+ "issued-on": k(s),
210
+ class: "text-sm"
211
+ }, null, 8, ["format", "issued-on"])], 64)) : b("", !0)
212
+ ]),
213
+ c.value ? (D(), y(k(G), {
214
+ key: 0,
215
+ text: k(n).t(r[t.documentType]),
216
+ truncate: !1,
217
+ class: "text-xs text-tertiary"
218
+ }, null, 8, ["text"])) : b("", !0),
219
+ f.value === null ? b("", !0) : (D(), y(k(G), {
220
+ key: 1,
221
+ text: f.value,
222
+ truncate: !1,
223
+ class: "text-xs text-secondary"
224
+ }, null, 8, ["text"]))
225
+ ]),
226
+ _: 1
227
+ }, 8, ["data-test-id"]));
228
+ }
229
+ }), Q = { class: "grid grid-cols-[auto_1fr] items-baseline gap-x-md gap-y-xs" }, he = /* @__PURE__ */ w({
230
+ __name: "SharedSequencePreviewCard",
231
+ props: {
232
+ isSharingDeferred: { type: Boolean },
233
+ invoiceFormat: {}
234
+ },
235
+ setup(e) {
236
+ let t = e, n = h(), r = N.Now.plainDateISO(), i = r.year + 1, a = [
237
+ {
238
+ labelKey: "wise_invoicing.settings.preview.invoice",
239
+ sequenceNumber: 1
240
+ },
241
+ {
242
+ labelKey: "wise_invoicing.settings.preview.credit_note",
243
+ sequenceNumber: 2
244
+ },
245
+ {
246
+ labelKey: "wise_invoicing.settings.preview.invoice",
247
+ sequenceNumber: 3
248
+ }
249
+ ];
250
+ return (e, o) => (D(), y(k(I), {
251
+ "data-test-id": "shared-sequence-preview",
252
+ gap: "sm",
253
+ class: "col-span-full rounded-xl border border-secondary p-lg"
254
+ }, {
255
+ default: A(() => [
256
+ C(k(G), {
257
+ text: k(n).t("wise_invoicing.settings.preview.label"),
258
+ class: "text-xs font-medium text-secondary"
259
+ }, null, 8, ["text"]),
260
+ S("div", Q, [(D(), x(g, null, O(a, (e) => (D(), x(g, { key: e.sequenceNumber }, [C(k(G), {
261
+ text: k(n).t(e.labelKey),
262
+ class: "text-xs text-secondary"
263
+ }, null, 8, ["text"]), C(X, {
264
+ format: t.invoiceFormat,
265
+ "issued-on": k(r),
266
+ "sequence-number": e.sequenceNumber,
267
+ class: "text-sm"
268
+ }, null, 8, [
269
+ "format",
270
+ "issued-on",
271
+ "sequence-number"
272
+ ])], 64))), 64))]),
273
+ t.isSharingDeferred ? (D(), y(k(G), {
274
+ key: 0,
275
+ text: k(n).t("wise_invoicing.settings.preview.deferred_credit_note", { year: i }),
276
+ truncate: !1,
277
+ class: "text-xs text-secondary"
278
+ }, null, 8, ["text"])) : b("", !0)
279
+ ]),
280
+ _: 1
281
+ }));
282
+ }
283
+ });
284
+ //#endregion
285
+ //#region src/modules/settings/use-cases/overview/composables/sequenceFormatFields.composable.ts
286
+ function ge(e, t, n) {
287
+ let r = {
288
+ separatorAfterDate: e.register(`${t}.separator.afterDate`, !0),
289
+ dateFormat: e.register(`${t}.dateFormat`),
290
+ minDigits: e.register(`${t}.minDigits`),
291
+ prefix: e.register(`${t}.prefix`),
292
+ separator: e.register(`${t}.separator.value`),
293
+ separatorAfterPrefix: e.register(`${t}.separator.afterPrefix`, !0)
294
+ };
295
+ return {
296
+ editedFormat: v(() => {
297
+ let e = n();
298
+ return u.resolveSeparatorPlacement({
299
+ dateFormat: r.dateFormat.modelValue.value ?? e.dateFormat,
300
+ minDigits: r.minDigits.modelValue.value ?? 0,
301
+ prefix: l.trimOrNull(r.prefix.modelValue.value),
302
+ separator: {
303
+ afterDate: r.separatorAfterDate.modelValue.value,
304
+ afterPrefix: r.separatorAfterPrefix.modelValue.value,
305
+ value: r.separator.modelValue.value ?? e.separator.value
306
+ }
307
+ });
308
+ }),
309
+ fields: r
310
+ };
311
+ }
312
+ //#endregion
313
+ //#region src/modules/settings/use-cases/overview/components/IssuerSettingsForm.vue?vue&type=script&setup=true&lang.ts
314
+ var _e = { class: "mx-auto w-full max-w-4xl" }, ve = { class: "pr-md text-xs text-secondary" }, ye = { class: "mx-auto w-full max-w-4xl" }, be = {
315
+ key: 0,
316
+ class: "col-span-full"
317
+ }, xe = { class: "mx-auto w-full max-w-4xl" }, Se = { class: "col-span-full" }, $ = /* @__PURE__ */ w({
318
+ __name: "IssuerSettingsForm",
319
+ props: { issuerSettings: {} },
320
+ setup(t) {
321
+ let n = t, i = h(), o = le(), s = a(), l = de(), d = v(() => q(Object.values(r))), f = ue({
322
+ initialState: v(() => ee.toForm(n.issuerSettings)),
323
+ schema: fe,
324
+ onSubmit: async (e) => {
325
+ let t = await l.execute({ body: e });
326
+ t.isErr() ? o.apiError(t.error) : o.show({ message: i.t("wise_invoicing.settings.saved") });
327
+ },
328
+ onSubmitError: () => {
329
+ o.unableToSave();
330
+ }
331
+ }), p = f.register("name"), m = f.register("email"), w = f.register("phoneNumber"), E = f.register("website"), O = f.register("address"), j = f.register("vatNumber"), M = f.register("bankAccountNumber"), N = f.register("bic"), P = f.register("currency"), ie = f.register("defaultPaymentTermDays"), I = f.register("restartsNumberingYearly", !1), L = f.register("shareCreditNoteSequence", !1), R = ge(f, "invoiceSequenceFormat", () => n.issuerSettings.invoiceSequenceFormat), G = ge(f, "creditNoteSequenceFormat", () => n.issuerSettings.creditNoteSequenceFormat), J = v(() => L.modelValue.value), Y = v(() => J.value !== n.issuerSettings.shareCreditNoteSequence), X = v(() => n.issuerSettings.shareCreditNoteSequence ? n.issuerSettings.invoiceSequenceFormat : n.issuerSettings.creditNoteSequenceFormat), Z = v(() => u.canRestartYearly(R.editedFormat.value, G.editedFormat.value, J.value)), Q = v(() => Z.value && I.modelValue.value), $ = v(() => Q.value !== (n.issuerSettings.sequenceReset === e.YEARLY));
332
+ function Ce(e) {
333
+ return `${e} (${s.getSymbol(e).symbol})`;
334
+ }
335
+ return (e, t) => (D(), y(k(ae), {
336
+ form: k(f),
337
+ "prompt-on-unsaved-changes": !0
338
+ }, {
339
+ default: A(() => [(D(), y(te, {
340
+ to: "#page-actions",
341
+ defer: ""
342
+ }, [C(k(se), {
343
+ "is-disabled": !k(f).isDirty.value,
344
+ label: k(i).t("wise_invoicing.common.save")
345
+ }, null, 8, ["is-disabled", "label"])])), C(k(oe), null, {
346
+ default: A(() => [
347
+ C(k(V), {
348
+ title: k(i).t("wise_invoicing.settings.sections.issuer.title"),
349
+ description: k(i).t("wise_invoicing.settings.sections.issuer.description")
350
+ }, {
351
+ default: A(() => [C(k(B), null, {
352
+ default: A(() => [C(k(z), {
353
+ lg: 2,
354
+ sm: 1
355
+ }, {
356
+ default: A(() => [
357
+ C(k(K), T({ "is-required": !0 }, k(c)(k(p)), { label: k(i).t("wise_invoicing.settings.fields.name.label") }), null, 16, ["label"]),
358
+ C(k(K), T({ "is-required": !0 }, k(c)(k(m)), {
359
+ label: k(i).t("wise_invoicing.settings.fields.email.label"),
360
+ type: "email"
361
+ }), null, 16, ["label"]),
362
+ C(k(ce), T(k(c)(k(w)), { label: k(i).t("wise_invoicing.settings.fields.phone_number.label") }), null, 16, ["label"]),
363
+ C(k(K), T(k(c)(k(E)), { label: k(i).t("wise_invoicing.settings.fields.website.label") }), null, 16, ["label"]),
364
+ C(k(re), T({ "is-required": !0 }, k(c)(k(O)), { label: k(i).t("wise_invoicing.settings.fields.address.label") }), null, 16, ["label"]),
365
+ C(k(K), T(k(c)(k(j)), {
366
+ "is-disabled": !0,
367
+ label: k(i).t("wise_invoicing.settings.fields.vat_number.label")
368
+ }), null, 16, ["label"]),
369
+ C(k(K), T({ "is-required": !0 }, k(c)(k(M)), { label: k(i).t("wise_invoicing.settings.fields.bank_account_number.label") }), null, 16, ["label"]),
370
+ C(k(K), T(k(c)(k(N)), { label: k(i).t("wise_invoicing.settings.fields.bic.label") }), null, 16, ["label"])
371
+ ]),
372
+ _: 1
373
+ })]),
374
+ _: 1
375
+ })]),
376
+ _: 1
377
+ }, 8, ["title", "description"]),
378
+ S("div", _e, [C(k(W))]),
379
+ C(k(V), {
380
+ title: k(i).t("wise_invoicing.settings.sections.payment.title"),
381
+ description: k(i).t("wise_invoicing.settings.sections.payment.description")
382
+ }, {
383
+ default: A(() => [C(k(B), null, {
384
+ default: A(() => [C(k(z), {
385
+ lg: 2,
386
+ sm: 1
387
+ }, {
388
+ default: A(() => [C(k(U), T(k(c)(k(P)), {
389
+ "display-fn": Ce,
390
+ items: d.value,
391
+ label: k(i).t("wise_invoicing.settings.fields.currency.label")
392
+ }), null, 16, ["items", "label"]), C(k(H), T(k(c)(k(ie)), {
393
+ label: k(i).t("wise_invoicing.settings.fields.default_payment_term.label"),
394
+ placeholder: k(i).t("wise_invoicing.settings.fields.default_payment_term.placeholder")
395
+ }), {
396
+ right: A(() => [S("span", ve, ne(k(i).t("wise_invoicing.settings.fields.default_payment_term.suffix")), 1)]),
397
+ _: 1
398
+ }, 16, ["label", "placeholder"])]),
399
+ _: 1
400
+ })]),
401
+ _: 1
402
+ })]),
403
+ _: 1
404
+ }, 8, ["title", "description"]),
405
+ S("div", ye, [C(k(W))]),
406
+ C(k(V), {
407
+ title: k(i).t("wise_invoicing.settings.sections.numbering.title"),
408
+ description: k(i).t("wise_invoicing.settings.sections.numbering.description")
409
+ }, {
410
+ default: A(() => [C(k(B), null, {
411
+ default: A(() => [C(k(z), {
412
+ lg: 2,
413
+ sm: 1
414
+ }, {
415
+ default: A(() => [
416
+ C(pe, {
417
+ "edited-format": k(R).editedFormat.value,
418
+ fields: k(R).fields,
419
+ "prefix-label": k(i).t("wise_invoicing.settings.fields.sequence_prefix.label"),
420
+ "prefix-placeholder": k(i).t("wise_invoicing.settings.fields.sequence_prefix.placeholder")
421
+ }, null, 8, [
422
+ "edited-format",
423
+ "fields",
424
+ "prefix-label",
425
+ "prefix-placeholder"
426
+ ]),
427
+ C(_, {
428
+ "enter-active-class": "transition-opacity duration-200 ease-out",
429
+ "enter-from-class": "opacity-0",
430
+ "leave-active-class": "transition-opacity duration-150 ease-in",
431
+ "leave-to-class": "opacity-0"
432
+ }, {
433
+ default: A(() => [Z.value ? (D(), x("div", be, [C(k(F), T(k(c)(k(I)), {
434
+ label: k(i).t("wise_invoicing.settings.fields.restarts_numbering_yearly.label"),
435
+ hint: k(i).t("wise_invoicing.settings.fields.restarts_numbering_yearly.hint")
436
+ }), null, 16, ["label", "hint"])])) : b("", !0)]),
437
+ _: 1
438
+ }),
439
+ C(me, {
440
+ "edited-format": k(R).editedFormat.value,
441
+ "has-other-numbering-changes": $.value,
442
+ "is-change-immediate": n.issuerSettings.isSequenceFormatChangeImmediate,
443
+ "is-restarting-yearly": Q.value,
444
+ "saved-format": n.issuerSettings.invoiceSequenceFormat,
445
+ "document-type": "invoice"
446
+ }, null, 8, [
447
+ "edited-format",
448
+ "has-other-numbering-changes",
449
+ "is-change-immediate",
450
+ "is-restarting-yearly",
451
+ "saved-format"
452
+ ])
453
+ ]),
454
+ _: 1
455
+ })]),
456
+ _: 1
457
+ })]),
458
+ _: 1
459
+ }, 8, ["title", "description"]),
460
+ S("div", xe, [C(k(W))]),
461
+ C(k(V), {
462
+ title: k(i).t("wise_invoicing.settings.sections.credit_note_numbering.title"),
463
+ description: k(i).t("wise_invoicing.settings.sections.credit_note_numbering.description")
464
+ }, {
465
+ default: A(() => [C(k(B), null, {
466
+ default: A(() => [C(k(z), {
467
+ lg: 2,
468
+ sm: 1
469
+ }, {
470
+ default: A(() => [S("div", Se, [C(k(F), T(k(c)(k(L)), {
471
+ label: k(i).t("wise_invoicing.settings.fields.share_credit_note_sequence.label"),
472
+ hint: k(i).t("wise_invoicing.settings.fields.share_credit_note_sequence.hint")
473
+ }), null, 16, ["label", "hint"])]), J.value ? (D(), y(he, {
474
+ key: 0,
475
+ "invoice-format": k(R).editedFormat.value,
476
+ "is-sharing-deferred": Y.value && !n.issuerSettings.isCreditNoteSequenceChangeImmediate
477
+ }, null, 8, ["invoice-format", "is-sharing-deferred"])) : (D(), x(g, { key: 1 }, [C(pe, {
478
+ "edited-format": k(G).editedFormat.value,
479
+ fields: k(G).fields,
480
+ "prefix-label": k(i).t("wise_invoicing.settings.fields.credit_note_sequence_prefix.label"),
481
+ "prefix-placeholder": k(i).t("wise_invoicing.settings.fields.credit_note_sequence_prefix.placeholder")
482
+ }, null, 8, [
483
+ "edited-format",
484
+ "fields",
485
+ "prefix-label",
486
+ "prefix-placeholder"
487
+ ]), C(me, {
488
+ "edited-format": k(G).editedFormat.value,
489
+ "has-other-numbering-changes": $.value || Y.value,
490
+ "is-change-immediate": n.issuerSettings.isCreditNoteSequenceChangeImmediate,
491
+ "is-restarting-yearly": Q.value,
492
+ "saved-format": X.value,
493
+ "document-type": "credit_note"
494
+ }, null, 8, [
495
+ "edited-format",
496
+ "has-other-numbering-changes",
497
+ "is-change-immediate",
498
+ "is-restarting-yearly",
499
+ "saved-format"
500
+ ])], 64))]),
501
+ _: 1
502
+ })]),
503
+ _: 1
504
+ })]),
505
+ _: 1
506
+ }, 8, ["title", "description"])
507
+ ]),
508
+ _: 1
509
+ })]),
510
+ _: 1
511
+ }, 8, ["form"]));
512
+ }
513
+ }), Ce = /* @__PURE__ */ w({
514
+ __name: "IssuerSettingsView",
515
+ props: { issuerSettings: {} },
516
+ setup(e) {
517
+ let t = e, n = h(), r = M();
518
+ return i().set(() => n.t("wise_invoicing.settings.title")), (e, i) => (D(), y(k(L), { title: k(n).t("wise_invoicing.settings.title") }, {
519
+ "page-actions-right": A(() => [C(k(ie), {
520
+ label: k(n).t("wise_invoicing.delivery.settings.title"),
521
+ variant: "secondary",
522
+ onClick: i[0] ||= (e) => k(r).push({ name: "invoicing-peppol-settings" })
523
+ }, null, 8, ["label"]), i[1] ||= S("div", { id: "page-actions" }, null, -1)]),
524
+ default: A(() => [C(k(R), null, {
525
+ default: A(() => [C($, { "issuer-settings": t.issuerSettings }, null, 8, ["issuer-settings"])]),
526
+ _: 1
527
+ })]),
528
+ _: 1
529
+ }, 8, ["title"]));
530
+ }
531
+ }), we = /* @__PURE__ */ w({
532
+ __name: "IssuerSettingsViewDataProvider",
533
+ setup(e) {
534
+ let t = f();
535
+ return (e, n) => (D(), y(s, { queries: { issuerSettings: k(t) } }, {
536
+ default: A(({ data: e }) => [C(Ce, { "issuer-settings": e.issuerSettings }, null, 8, ["issuer-settings"])]),
537
+ loading: A(() => [C(k(p).PageLoadingState, { breadcrumbs: [] })]),
538
+ _: 1
539
+ }, 8, ["queries"]));
540
+ }
541
+ });
542
+ //#endregion
543
+ export { we as default };
@@ -1,6 +1,6 @@
1
- import { R as e, ct as t, q as n, t as r } from "./api.util-B3JqQVJA.js";
2
- import { t as i, w as a } from "./documentTitle.composable-RvqrZTBa.js";
3
- import { t as o } from "./DataProvider-C3uEds9v.js";
1
+ import { R as e, ct as t, q as n, t as r } from "./api.util-Ct8FnoLB.js";
2
+ import { t as i, w as a } from "./documentTitle.composable-BqZWKGw1.js";
3
+ import { t as o } from "./DataProvider-BtnD-BzI.js";
4
4
  import { t as s } from "./formango.util-D5c2ql--.js";
5
5
  import c from "zod";
6
6
  import { useI18n as l } from "vue-i18n";
@@ -170,11 +170,7 @@ var B = /* @__PURE__ */ m({
170
170
  schema: K,
171
171
  onSubmit: async (e) => {
172
172
  let t = await s.execute({ body: e });
173
- if (t.isErr()) {
174
- W(t.error);
175
- return;
176
- }
177
- R(), h.value = null, r.show({ message: n.t("wise_invoicing.delivery.settings.saved") });
173
+ t.isErr() ? W(t.error) : (R(), h.value = null, r.show({ message: n.t("wise_invoicing.delivery.settings.saved") }));
178
174
  },
179
175
  onSubmitError: () => r.unableToSave()
180
176
  }), x = b.register("provider", a.SOLUZ), S = b.register("apiKey", ""), w = b.register("partyId", ""), j = b.register("enabled", !1), M = u(() => JSON.stringify([x.modelValue.value, S.modelValue.value])), N = u(() => h.value === M.value);
@@ -183,11 +179,7 @@ var B = /* @__PURE__ */ m({
183
179
  }
184
180
  function W(e) {
185
181
  let t = G.fromApiError(e);
186
- if (t === null) {
187
- r.apiError(e);
188
- return;
189
- }
190
- r.show({
182
+ t === null ? r.apiError(e) : r.show({
191
183
  message: n.t(t),
192
184
  variant: "error"
193
185
  });
@@ -200,13 +192,7 @@ var B = /* @__PURE__ */ m({
200
192
  enabled: j.modelValue.value,
201
193
  provider: x.modelValue.value
202
194
  });
203
- if (m.value = !1, e === M.value) {
204
- if (t.isErr()) {
205
- W(t.error);
206
- return;
207
- }
208
- c.value = t.value, t.value.some((e) => e.id === w.modelValue.value) || w.setValue(""), h.value = e, r.show({ message: n.t("wise_invoicing.delivery.settings.test_success") });
209
- }
195
+ m.value = !1, e === M.value && (t.isErr() ? W(t.error) : (c.value = t.value, t.value.some((e) => e.id === w.modelValue.value) || w.setValue(""), h.value = e, r.show({ message: n.t("wise_invoicing.delivery.settings.test_success") })));
210
196
  }
211
197
  return (e, r) => (g(), d(v(T), {
212
198
  title: v(n).t("wise_invoicing.delivery.settings.title"),