@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.
- package/dist/{ApprovalReminderSettingsViewDataProvider-D0kpogSQ.js → ApprovalReminderSettingsViewDataProvider-BnHeEMZD.js} +6 -10
- package/dist/{BillingDocumentDetailViewDataProvider-D_oc3-0D.js → BillingDocumentDetailViewDataProvider-Dm8C5WNN.js} +1311 -1327
- package/dist/{BillingDocumentPdf-wlv-k8KE.js → BillingDocumentPdf-57ksqoPW.js} +16 -22
- package/dist/{CreditNoteDetailViewDataProvider-DoFm2xgo.js → CreditNoteDetailViewDataProvider-CC4gnwSN.js} +154 -172
- package/dist/{CreditNotePdfViewDataProvider-QpzNsVsK.js → CreditNotePdfViewDataProvider-C9vgN3kV.js} +4 -4
- package/dist/{CustomFieldValueText-DZzqLZ0K.js → CustomFieldValueText-CvWq0fl_.js} +3 -3
- package/dist/{DataProvider-C3uEds9v.js → DataProvider-BtnD-BzI.js} +1 -1
- package/dist/{DunningCaseSendDialog-Bol8NF1J.js → DunningCaseSendDialog-CfWSrquA.js} +6 -14
- package/dist/{InvoiceApprovalOutOfSyncIndicator-C4ZLDRiv.js → InvoiceApprovalOutOfSyncIndicator-CKLAraIU.js} +1 -1
- package/dist/{InvoiceApprovalOverviewView-BAmEOum7.js → InvoiceApprovalOverviewView-DpL-vV8_.js} +10 -18
- package/dist/{InvoiceApprovalStatusBadge-C2Wj9b_Z.js → InvoiceApprovalStatusBadge-oVWkCqZY.js} +3 -3
- package/dist/{InvoiceApproveDialogDataProvider-S81Mc5oS.js → InvoiceApproveDialogDataProvider-serNDdl9.js} +16 -32
- package/dist/{InvoiceDetailViewDataProvider-Dqu6qlky.js → InvoiceDetailViewDataProvider-BaT7fgsi.js} +591 -665
- package/dist/{InvoicePdfView-D0G-Pik3.js → InvoicePdfView-MaBnd78V.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-DXXbPe-Z.js → InvoicePdfViewDataProvider-BIHBY608.js} +4 -4
- package/dist/{InvoicePublicProFormaPdfViewDataProvider-CdGFZD-G.js → InvoicePublicProFormaPdfViewDataProvider-KY8pN59k.js} +4 -4
- package/dist/{InvoicingFileUploadProvider-BsK5eRGE.js → InvoicingFileUploadProvider-CxmF68sz.js} +2 -2
- package/dist/IssuerSettingsViewDataProvider-DJzVZS8Q.js +543 -0
- package/dist/{PeppolSettingsViewDataProvider-ZdJQGqux.js → PeppolSettingsViewDataProvider-C7lwtu7n.js} +6 -20
- package/dist/{api.util-B3JqQVJA.js → api.util-Ct8FnoLB.js} +628 -547
- package/dist/{billingDocumentDetail.transformer-CcnSe7Fz.js → billingDocumentDetail.transformer-B3ypgtIv.js} +4 -2
- package/dist/client/index.d.ts +1 -1
- package/dist/client/types.gen.d.ts +177 -7
- package/dist/client/zod.gen.d.ts +406 -6
- package/dist/composables/invoicingConfig.composable.d.ts +15 -0
- package/dist/{creditNoteDetail.query-BVbXoNt-.js → creditNoteDetail.query-C2BYvPKC.js} +5 -3
- package/dist/{dist-DALBiuub.js → dist-BZgvL8_m.js} +19 -30
- package/dist/{documentTitle.composable-RvqrZTBa.js → documentTitle.composable-BqZWKGw1.js} +35 -29
- package/dist/{i18n.lib-BkdaaKCs.js → i18n.lib-8sQYo5_y.js} +101 -7
- package/dist/index.d.ts +96 -2
- package/dist/index.js +4517 -228
- package/dist/{invoice.service-jakQLnDu.js → invoice.service-CtePUw1R.js} +8 -5
- package/dist/{invoiceApproval.service-DR9g1Dek.js → invoiceApproval.service-CQzG8_wX.js} +2 -2
- package/dist/{invoiceApprovalStatus.util-Nd4E3qlZ.js → invoiceApprovalStatus.util-C4su45dU.js} +2 -2
- package/dist/{invoiceCustomer.service-Bp59E0ZJ.js → invoiceCustomer.service-CzbM3ey1.js} +2 -2
- package/dist/{invoiceDetail.query-BBhA0ZAn.js → invoiceDetail.query-NNAoIuWN.js} +1 -1
- package/dist/{invoiceIndexCache.util-Ba2MGULh.js → invoiceIndexCache.util-DI0WM-eW.js} +4 -8
- package/dist/{invoicingConfig.composable-k8p1Y_eJ.js → invoicingConfig.composable-DXJ71Uq_.js} +20 -18
- package/dist/issuerSettings.query-ggEHdk0S.js +204 -0
- package/dist/libs/i18n.lib.d.ts +96 -2
- package/dist/locales/en-US.json.d.ts +50 -3
- package/dist/locales/nl-BE.json.d.ts +51 -4
- package/dist/models/billing-document/billingDocumentCreditable.util.d.ts +19 -0
- package/dist/models/billing-document/billingDocumentCreditable.util.spec.d.ts +1 -0
- package/dist/models/billing-document/billingDocumentDetail.model.d.ts +2 -0
- package/dist/models/billing-document/billingDocumentUpdateLines.model.d.ts +2 -0
- package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +4 -1
- package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.model.d.ts +1 -0
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewFilters.composable.d.ts +1 -1
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewFilters.composable.spec.d.ts +1 -0
- package/dist/modules/settings/api/mutations/issuerSettingsUpdate.mutation.d.ts +22 -1
- package/dist/modules/settings/models/issuer-settings/invoiceSequenceFormat.util.d.ts +16 -0
- package/dist/modules/settings/models/issuer-settings/invoiceSequenceFormat.util.spec.d.ts +1 -0
- package/dist/modules/settings/models/issuer-settings/issuerSettings.model.d.ts +7 -2
- package/dist/modules/settings/models/issuer-settings/issuerSettings.transformer.d.ts +2 -0
- package/dist/modules/settings/models/issuer-settings/issuerSettingsForm.model.d.ts +23 -2
- package/dist/modules/settings/use-cases/overview/components/InvoiceSequenceFormatFields.vue.d.ts +11 -0
- package/dist/modules/settings/use-cases/overview/components/InvoiceSequenceNumberPreview.vue.d.ts +12 -0
- package/dist/modules/settings/use-cases/overview/components/InvoiceSequencePreviewCard.vue.d.ts +13 -0
- package/dist/modules/settings/use-cases/overview/components/SharedSequencePreviewCard.vue.d.ts +8 -0
- package/dist/modules/settings/use-cases/overview/composables/sequenceFormatFields.composable.d.ts +16 -0
- package/dist/{reminderConfig.query-BIfCEIYX.js → reminderConfig.query-C2xT3DJH.js} +2 -2
- package/dist/{src-DUSgQTKr.js → src-Vz2dm4sM.js} +1 -3
- package/dist/style.css +1 -1
- package/dist/types/apiError.type.d.ts +2 -2
- package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +24 -0
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +4 -0
- package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +4 -0
- package/package.json +2 -2
- package/dist/DunningCaseDetailViewDataProvider-uRJFWZtQ.js +0 -439
- package/dist/DunningCaseOverviewView-DpQoXamE.js +0 -799
- package/dist/DunningCaseReminderPdfViewDataProvider-D-CfDeC8.js +0 -490
- package/dist/InvoiceOverviewViewDataProvider-WKzgF7cl.js +0 -1929
- package/dist/InvoicePublicPdfViewDataProvider-ndVoAAY3.js +0 -45
- package/dist/IssuerSettingsViewDataProvider-Ca7GPCDE.js +0 -193
- package/dist/ReminderSettingsViewDataProvider-DTC0Ud5z.js +0 -709
- package/dist/issuerSettings.query-BOgWdNmP.js +0 -118
- package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
- /package/dist/{DunningCaseReminderPdfViewDataProvider.css → index.css} +0 -0
|
@@ -1,709 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { t } from "./i18n.lib-BkdaaKCs.js";
|
|
3
|
-
import "./api.util-B3JqQVJA.js";
|
|
4
|
-
import { T as n, c as r, m as i, t as a } from "./documentTitle.composable-RvqrZTBa.js";
|
|
5
|
-
import { i as o, n as s, r as c, t as l } from "./reminderConfig.query-BIfCEIYX.js";
|
|
6
|
-
import { t as u } from "./DataProvider-C3uEds9v.js";
|
|
7
|
-
import { t as d } from "./formango.util-D5c2ql--.js";
|
|
8
|
-
import { z as f } from "zod";
|
|
9
|
-
import { useI18n as p } from "vue-i18n";
|
|
10
|
-
import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createTextVNode as b, createVNode as x, defineComponent as S, mergeModels as C, mergeProps as w, nextTick as T, normalizeClass as E, normalizeStyle as D, openBlock as O, ref as k, renderList as A, toDisplayString as j, unref as M, useModel as N, watch as ee, withCtx as P, withKeys as F, withModifiers as I } from "vue";
|
|
11
|
-
import { useMutation as L } from "@wisemen/vue-core-api-utils";
|
|
12
|
-
import { UIButton as te, UIDashboardPage as ne, UIDashboardPageContent as re, UIDashboardPageLoadingState as R, UIForm as z, UINumberField as B, UISelect as V, UITabs as H, UITabsItem as U, UITabsList as W, UITextField as ie, UITextareaField as ae, UITooltip as oe, UITooltipContent as se, createSelectOptions as G, useToast as K } from "@wisemen/vue-core-design-system";
|
|
13
|
-
import { useForm as ce } from "formango";
|
|
14
|
-
//#region src/modules/dunning-case/api/mutations/reminderConfigUpdate.mutation.ts
|
|
15
|
-
function le() {
|
|
16
|
-
return L({
|
|
17
|
-
queryFn: (e) => c.updateReminderConfigs(e.body),
|
|
18
|
-
queryKeysToInvalidate: { reminderConfig: {} }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/modules/dunning-case/models/reminderConfigForm.model.ts
|
|
23
|
-
function q(e) {
|
|
24
|
-
return e.trim().length > 0;
|
|
25
|
-
}
|
|
26
|
-
var J = f.object({
|
|
27
|
-
body: f.string().refine(q, t.global.t("module.dunning_case.settings.validation.required")),
|
|
28
|
-
subject: f.string().refine(q, t.global.t("module.dunning_case.settings.validation.required"))
|
|
29
|
-
}), ue = f.object({
|
|
30
|
-
feeAmount: f.number().min(0),
|
|
31
|
-
feeCurrency: f.enum(r),
|
|
32
|
-
feePercentage: f.number().min(0).max(100),
|
|
33
|
-
feePrecision: f.number().int().min(0),
|
|
34
|
-
feeType: f.enum(i),
|
|
35
|
-
offsetDays: f.number().int().min(1),
|
|
36
|
-
schedule: f.enum(n),
|
|
37
|
-
sequence: f.number().int().min(1).max(3),
|
|
38
|
-
template: f.object({
|
|
39
|
-
"en-US": J,
|
|
40
|
-
"fr-BE": J,
|
|
41
|
-
"nl-BE": J
|
|
42
|
-
})
|
|
43
|
-
}), de = f.object({ reminders: f.array(ue).length(3) }).superRefine((e, r) => {
|
|
44
|
-
e.reminders[0]?.schedule !== n.AFTER_DUE_DATE && r.addIssue({
|
|
45
|
-
code: "custom",
|
|
46
|
-
message: t.global.t("module.dunning_case.settings.validation.level_one_due_date"),
|
|
47
|
-
path: [
|
|
48
|
-
"reminders",
|
|
49
|
-
0,
|
|
50
|
-
"schedule"
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
let i = 0;
|
|
54
|
-
for (let [a, o] of e.reminders.entries()) {
|
|
55
|
-
let e = o.schedule === n.AFTER_DUE_DATE ? o.offsetDays : i + o.offsetDays;
|
|
56
|
-
a > 0 && e <= i && r.addIssue({
|
|
57
|
-
code: "custom",
|
|
58
|
-
message: t.global.t("module.dunning_case.settings.validation.chronological"),
|
|
59
|
-
path: [
|
|
60
|
-
"reminders",
|
|
61
|
-
a,
|
|
62
|
-
"offsetDays"
|
|
63
|
-
]
|
|
64
|
-
}), i = e;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
function fe(e) {
|
|
68
|
-
return !q(e.subject ?? "") || !q(e.body ?? "");
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/modules/dunning-case/use-cases/settings/components/ReminderLadderFeeNotice.vue?vue&type=script&setup=true&lang.ts
|
|
72
|
-
var pe = { class: "mt-3xl flex max-w-260 flex-col gap-md" }, me = { class: "rounded-md border border-secondary bg-primary px-lg py-md" }, he = { class: "cursor-pointer text-sm font-medium text-primary" }, ge = { class: "mt-md text-sm text-secondary" }, _e = { class: "font-semibold text-primary" }, ve = { class: "mt-md text-sm text-secondary" }, ye = /* @__PURE__ */ S({
|
|
73
|
-
__name: "ReminderLadderFeeNotice",
|
|
74
|
-
setup(e) {
|
|
75
|
-
let t = p();
|
|
76
|
-
return (e, n) => (O(), v("div", pe, [y("details", me, [
|
|
77
|
-
y("summary", he, j(M(t).t("module.dunning_case.settings.ladder.fee_law_title")), 1),
|
|
78
|
-
y("p", ge, [y("strong", _e, j(M(t).t("module.dunning_case.settings.ladder.fee_notice_title")), 1), b(" " + j(M(t).t("module.dunning_case.settings.ladder.fee_notice")), 1)]),
|
|
79
|
-
y("p", ve, j(M(t).t("module.dunning_case.settings.ladder.fee_law_description")), 1)
|
|
80
|
-
])]));
|
|
81
|
-
}
|
|
82
|
-
}), be = { class: "grid grid-cols-[7.5rem_minmax(0,1fr)] items-start gap-x-lg gap-y-xl border-b border-secondary py-2xl last:border-b-0 sm:grid-cols-[7.5rem_13.5rem_11.25rem_minmax(0,1fr)] sm:gap-3xl sm:py-3xl" }, xe = { class: "flex flex-col items-start gap-xs" }, Se = { class: "text-xs text-primary" }, Ce = { class: "col-start-2 flex flex-col gap-xs sm:col-auto" }, we = { class: "text-xs font-medium text-secondary sm:hidden" }, Te = { class: "col-start-2 flex flex-col items-start gap-xs sm:col-auto" }, Ee = { class: "text-xs font-medium text-secondary sm:hidden" }, De = { class: "text-xs whitespace-nowrap text-secondary" }, Oe = { class: "col-start-2 flex flex-col gap-xs sm:col-auto" }, ke = { class: "text-xs font-medium text-secondary sm:hidden" }, Ae = { class: "flex items-start gap-sm sm:max-w-80" }, je = { class: "min-w-0 flex-1" }, Me = { class: "w-28 shrink-0 [&_input]:min-w-0!" }, Ne = { class: "pr-md text-xs text-secondary" }, Pe = /* @__PURE__ */ S({
|
|
83
|
-
__name: "ReminderLadderRow",
|
|
84
|
-
props: {
|
|
85
|
-
absoluteDay: {},
|
|
86
|
-
canUpdate: { type: Boolean },
|
|
87
|
-
feeCurrency: {},
|
|
88
|
-
feeField: {},
|
|
89
|
-
feePercentageField: {},
|
|
90
|
-
feeTypeField: {},
|
|
91
|
-
level: {},
|
|
92
|
-
offsetField: {},
|
|
93
|
-
scheduleField: {},
|
|
94
|
-
scheduleItems: {}
|
|
95
|
-
},
|
|
96
|
-
emits: [
|
|
97
|
-
"commitOffset",
|
|
98
|
-
"typeOffset",
|
|
99
|
-
"updateOffset",
|
|
100
|
-
"updateSchedule"
|
|
101
|
-
],
|
|
102
|
-
setup(e, { emit: t }) {
|
|
103
|
-
let r = e, a = t, o = p(), c = h(() => !r.canUpdate || r.level === 1), l = h(() => r.feeTypeField.modelValue.value ?? i.AMOUNT), u = h(() => G([i.AMOUNT, i.PERCENTAGE])), f = {
|
|
104
|
-
maximumFractionDigits: 2,
|
|
105
|
-
minimumFractionDigits: 0
|
|
106
|
-
}, m = { maximumFractionDigits: 2 }, _ = h(() => r.feeCurrency === void 0 ? "" : new Intl.NumberFormat(o.locale.value, {
|
|
107
|
-
currency: r.feeCurrency,
|
|
108
|
-
style: "currency"
|
|
109
|
-
}).formatToParts(0).find((e) => e.type === "currency")?.value ?? r.feeCurrency);
|
|
110
|
-
function b(e) {
|
|
111
|
-
return o.t(e === n.AFTER_DUE_DATE ? "module.dunning_case.settings.ladder.after_due_date" : "module.dunning_case.settings.ladder.after_previous");
|
|
112
|
-
}
|
|
113
|
-
function S(e) {
|
|
114
|
-
return o.t(e === i.PERCENTAGE ? "module.dunning_case.settings.ladder.fee_type_percentage" : "module.dunning_case.settings.ladder.fee_type_amount");
|
|
115
|
-
}
|
|
116
|
-
return (e, t) => (O(), v("div", be, [
|
|
117
|
-
y("div", xe, [y("span", Se, j(M(o).t("module.dunning_case.level.reminder", { level: r.level })), 1), x(s, {
|
|
118
|
-
level: r.level,
|
|
119
|
-
size: "md"
|
|
120
|
-
}, null, 8, ["level"])]),
|
|
121
|
-
y("div", Ce, [y("span", we, j(M(o).t("module.dunning_case.settings.ladder.trigger")), 1), x(M(V), w(M(d)(r.scheduleField), {
|
|
122
|
-
"aria-label": M(o).t("module.dunning_case.settings.ladder.trigger"),
|
|
123
|
-
"display-fn": b,
|
|
124
|
-
"is-disabled": c.value,
|
|
125
|
-
items: r.scheduleItems,
|
|
126
|
-
label: null,
|
|
127
|
-
"onUpdate:modelValue": t[0] ||= (e) => a("updateSchedule", e)
|
|
128
|
-
}), null, 16, [
|
|
129
|
-
"aria-label",
|
|
130
|
-
"is-disabled",
|
|
131
|
-
"items"
|
|
132
|
-
])]),
|
|
133
|
-
y("div", Te, [y("span", Ee, j(M(o).t("module.dunning_case.settings.ladder.offset")), 1), y("div", {
|
|
134
|
-
class: "flex flex-col items-start gap-xs sm:flex-row sm:items-center",
|
|
135
|
-
onFocusoutCapture: t[2] ||= (e) => a("commitOffset"),
|
|
136
|
-
onInputCapture: t[3] ||= (e) => a("typeOffset", !0),
|
|
137
|
-
onInput: t[4] ||= (e) => a("typeOffset", !1)
|
|
138
|
-
}, [x(M(B), w(M(d)(r.offsetField), {
|
|
139
|
-
"aria-label": M(o).t("module.dunning_case.settings.ladder.offset"),
|
|
140
|
-
"is-disabled": !r.canUpdate,
|
|
141
|
-
label: null,
|
|
142
|
-
min: 1,
|
|
143
|
-
"show-controls": !0,
|
|
144
|
-
step: 1,
|
|
145
|
-
class: "w-30",
|
|
146
|
-
size: "sm",
|
|
147
|
-
"onUpdate:modelValue": t[1] ||= (e) => a("updateOffset", e)
|
|
148
|
-
}), null, 16, ["aria-label", "is-disabled"]), y("span", De, j(M(o).t("module.dunning_case.settings.ladder.day_hint", { day: r.absoluteDay })), 1)], 32)]),
|
|
149
|
-
y("div", Oe, [y("span", ke, j(M(o).t("module.dunning_case.settings.ladder.fee")), 1), y("div", Ae, [y("div", je, [x(M(V), w(M(d)(r.feeTypeField), {
|
|
150
|
-
"aria-label": M(o).t("module.dunning_case.settings.ladder.fee_type"),
|
|
151
|
-
"display-fn": S,
|
|
152
|
-
"is-disabled": !r.canUpdate,
|
|
153
|
-
items: u.value,
|
|
154
|
-
label: null
|
|
155
|
-
}), null, 16, [
|
|
156
|
-
"aria-label",
|
|
157
|
-
"is-disabled",
|
|
158
|
-
"items"
|
|
159
|
-
])]), y("div", Me, [l.value === M(i).PERCENTAGE ? (O(), g(M(B), w({ key: 0 }, M(d)(r.feePercentageField), {
|
|
160
|
-
"aria-label": M(o).t("module.dunning_case.settings.ladder.fee"),
|
|
161
|
-
"format-options": m,
|
|
162
|
-
"is-disabled": !r.canUpdate,
|
|
163
|
-
label: null,
|
|
164
|
-
max: 100,
|
|
165
|
-
min: 0,
|
|
166
|
-
step: .01,
|
|
167
|
-
size: "sm"
|
|
168
|
-
}), {
|
|
169
|
-
right: P(() => [...t[5] ||= [y("span", { class: "pr-md text-xs text-secondary" }, " % ", -1)]]),
|
|
170
|
-
_: 1
|
|
171
|
-
}, 16, ["aria-label", "is-disabled"])) : (O(), g(M(B), w({ key: 1 }, M(d)(r.feeField), {
|
|
172
|
-
"aria-label": M(o).t("module.dunning_case.settings.ladder.fee"),
|
|
173
|
-
"format-options": f,
|
|
174
|
-
"is-disabled": !r.canUpdate,
|
|
175
|
-
label: null,
|
|
176
|
-
min: 0,
|
|
177
|
-
step: .01,
|
|
178
|
-
size: "sm"
|
|
179
|
-
}), {
|
|
180
|
-
right: P(() => [y("span", Ne, j(_.value), 1)]),
|
|
181
|
-
_: 1
|
|
182
|
-
}, 16, ["aria-label", "is-disabled"]))])])])
|
|
183
|
-
]));
|
|
184
|
-
}
|
|
185
|
-
}), Fe = { class: "relative mt-2xl pb-lg" }, Ie = { class: "w-full" }, Le = { class: "flex justify-between text-xs font-medium text-secondary" }, Re = { class: "mt-md block font-mono text-xs text-secondary tabular-nums" }, ze = [
|
|
186
|
-
"aria-label",
|
|
187
|
-
"aria-valuemax",
|
|
188
|
-
"aria-valuemin",
|
|
189
|
-
"aria-valuenow",
|
|
190
|
-
"disabled",
|
|
191
|
-
"onKeydown",
|
|
192
|
-
"onPointercancel",
|
|
193
|
-
"onPointerdown",
|
|
194
|
-
"onPointerenter",
|
|
195
|
-
"onPointermove",
|
|
196
|
-
"onPointerup"
|
|
197
|
-
], Be = 4, Ve = /* @__PURE__ */ S({
|
|
198
|
-
__name: "ReminderLadderTimeline",
|
|
199
|
-
props: {
|
|
200
|
-
canUpdate: { type: Boolean },
|
|
201
|
-
markers: {},
|
|
202
|
-
timelineDays: {}
|
|
203
|
-
},
|
|
204
|
-
emits: ["moveTo"],
|
|
205
|
-
setup(e, { emit: t }) {
|
|
206
|
-
let n = e, r = t, i = [
|
|
207
|
-
"bg-brand-500",
|
|
208
|
-
"bg-warning-solid",
|
|
209
|
-
"bg-error-solid"
|
|
210
|
-
], a = p(), o = k(null), s = k(null), c = k(null), l = h(() => Array.from({ length: 5 }, (e, t) => Math.round(t * (n.timelineDays / Be))));
|
|
211
|
-
function u(e) {
|
|
212
|
-
return Math.min(100, e / n.timelineDays * 100);
|
|
213
|
-
}
|
|
214
|
-
function d(e) {
|
|
215
|
-
return i[e] ?? i[0];
|
|
216
|
-
}
|
|
217
|
-
function f(e, t) {
|
|
218
|
-
r("moveTo", e, (n.markers[e]?.absoluteDay ?? 0) + t);
|
|
219
|
-
}
|
|
220
|
-
function g(e, t) {
|
|
221
|
-
if (o.value === null) return;
|
|
222
|
-
let i = o.value.getBoundingClientRect(), a = Math.min(1, Math.max(0, (t.clientX - i.left) / i.width));
|
|
223
|
-
r("moveTo", e, Math.round(a * n.timelineDays));
|
|
224
|
-
}
|
|
225
|
-
function _(e, t) {
|
|
226
|
-
n.canUpdate && (s.value = e, t.currentTarget.setPointerCapture(t.pointerId), g(e, t));
|
|
227
|
-
}
|
|
228
|
-
function S(e, t) {
|
|
229
|
-
s.value === e && g(e, t);
|
|
230
|
-
}
|
|
231
|
-
function C(e, t) {
|
|
232
|
-
s.value === e && (s.value = null, t.currentTarget.releasePointerCapture(t.pointerId));
|
|
233
|
-
}
|
|
234
|
-
return (e, t) => (O(), v("div", Fe, [y("div", Ie, [y("div", Le, [y("span", null, j(M(a).t("module.dunning_case.settings.ladder.due_date")), 1), y("span", null, j(M(a).t("module.dunning_case.settings.ladder.timeline_end", { days: n.timelineDays })), 1)]), y("div", {
|
|
235
|
-
ref_key: "timelineTrack",
|
|
236
|
-
ref: o,
|
|
237
|
-
class: "relative mt-lg h-(--spacing-8xl)"
|
|
238
|
-
}, [
|
|
239
|
-
t[2] ||= y("div", { class: "absolute inset-x-0 top-(--spacing-lg) h-(--spacing-md) rounded-full bg-tertiary" }, null, -1),
|
|
240
|
-
y("div", {
|
|
241
|
-
style: D({ width: `${u(n.markers[n.markers.length - 1]?.absoluteDay ?? 0)}%` }),
|
|
242
|
-
class: "absolute top-(--spacing-lg) left-0 h-(--spacing-md) rounded-full bg-brand-100"
|
|
243
|
-
}, null, 4),
|
|
244
|
-
(O(!0), v(m, null, A(l.value, (e) => (O(), v("div", {
|
|
245
|
-
key: e,
|
|
246
|
-
class: E([{
|
|
247
|
-
"-translate-x-1/2": e > 0 && e < n.timelineDays,
|
|
248
|
-
"-translate-x-full": e === n.timelineDays
|
|
249
|
-
}, "absolute top-0"]),
|
|
250
|
-
style: D({ left: `${e / n.timelineDays * 100}%` })
|
|
251
|
-
}, [t[1] ||= y("span", { class: "block h-(--spacing-4xl) w-px bg-secondary" }, null, -1), y("span", Re, j(M(a).t("module.dunning_case.settings.ladder.day_short", { day: e })), 1)], 6))), 128)),
|
|
252
|
-
(O(!0), v(m, null, A(n.markers, (e, r) => (O(), v("div", {
|
|
253
|
-
key: e.sequence,
|
|
254
|
-
style: D({ left: `${u(e.absoluteDay)}%` }),
|
|
255
|
-
class: "absolute top-0 z-10 -translate-x-1/2"
|
|
256
|
-
}, [x(M(oe), {
|
|
257
|
-
"is-open": c.value === r || s.value === r,
|
|
258
|
-
"popover-side-offset": 8,
|
|
259
|
-
"popover-align": "center",
|
|
260
|
-
"popover-side": "top",
|
|
261
|
-
"is-close-on-trigger-click-disabled": "",
|
|
262
|
-
"is-hoverable-content-disabled": ""
|
|
263
|
-
}, {
|
|
264
|
-
trigger: P(() => [y("button", {
|
|
265
|
-
class: E([d(r), "flex size-(--spacing-4xl) touch-none items-center justify-center rounded-full border-2 border-primary text-sm font-semibold text-white shadow-sm enabled:cursor-ew-resize"]),
|
|
266
|
-
"aria-label": M(a).t("module.dunning_case.settings.ladder.marker_label", {
|
|
267
|
-
day: e.absoluteDay,
|
|
268
|
-
level: r + 1
|
|
269
|
-
}),
|
|
270
|
-
"aria-valuemax": n.timelineDays,
|
|
271
|
-
"aria-valuemin": e.minimumDay,
|
|
272
|
-
"aria-valuenow": e.absoluteDay,
|
|
273
|
-
disabled: !n.canUpdate,
|
|
274
|
-
role: "slider",
|
|
275
|
-
type: "button",
|
|
276
|
-
onKeydown: [F(I((e) => f(r, -1), ["prevent"]), ["left"]), F(I((e) => f(r, 1), ["prevent"]), ["right"])],
|
|
277
|
-
onPointercancel: (e) => C(r, e),
|
|
278
|
-
onPointerdown: (e) => _(r, e),
|
|
279
|
-
onPointerenter: (e) => c.value = r,
|
|
280
|
-
onPointerleave: t[0] ||= (e) => c.value = null,
|
|
281
|
-
onPointermove: (e) => S(r, e),
|
|
282
|
-
onPointerup: (e) => C(r, e)
|
|
283
|
-
}, j(e.sequence), 43, ze)]),
|
|
284
|
-
content: P(() => [x(M(se), { class: "rounded-md! bg-primary-solid! px-lg! py-md! text-sm font-semibold! whitespace-nowrap! text-white!" }, {
|
|
285
|
-
default: P(() => [b(j(M(a).t("module.dunning_case.settings.ladder.day", { day: e.absoluteDay })), 1)]),
|
|
286
|
-
_: 2
|
|
287
|
-
}, 1024)]),
|
|
288
|
-
_: 2
|
|
289
|
-
}, 1032, ["is-open"])], 4))), 128))
|
|
290
|
-
], 512)])]));
|
|
291
|
-
}
|
|
292
|
-
}), He = { class: "mt-3xl" }, Ue = { class: "text-sm text-secondary" }, We = { class: "mt-3xl max-w-260" }, Ge = { class: "grid grid-cols-[7.5rem_minmax(0,1fr)] gap-lg text-xs font-medium text-secondary sm:grid-cols-[7.5rem_13.5rem_11.25rem_7.5rem] sm:gap-3xl" }, Ke = { class: "hidden sm:inline" }, qe = { class: "hidden sm:inline" }, Je = { class: "hidden sm:inline" }, Ye = /* @__PURE__ */ S({
|
|
293
|
-
__name: "ReminderLadderPanel",
|
|
294
|
-
props: {
|
|
295
|
-
canUpdate: { type: Boolean },
|
|
296
|
-
fields: {},
|
|
297
|
-
ladder: {},
|
|
298
|
-
scheduleItems: {}
|
|
299
|
-
},
|
|
300
|
-
setup(e) {
|
|
301
|
-
let t = e, n = p();
|
|
302
|
-
return (e, r) => (O(), v("div", He, [
|
|
303
|
-
y("p", Ue, j(M(n).t("module.dunning_case.settings.ladder.description")), 1),
|
|
304
|
-
x(Ve, {
|
|
305
|
-
"can-update": t.canUpdate,
|
|
306
|
-
markers: t.ladder.markers.value,
|
|
307
|
-
"timeline-days": t.ladder.timelineDays.value,
|
|
308
|
-
onMoveTo: t.ladder.setAbsoluteDay
|
|
309
|
-
}, null, 8, [
|
|
310
|
-
"can-update",
|
|
311
|
-
"markers",
|
|
312
|
-
"timeline-days",
|
|
313
|
-
"onMoveTo"
|
|
314
|
-
]),
|
|
315
|
-
y("div", We, [y("div", Ge, [
|
|
316
|
-
y("span", null, j(M(n).t("module.dunning_case.settings.ladder.level")), 1),
|
|
317
|
-
y("span", Ke, j(M(n).t("module.dunning_case.settings.ladder.trigger")), 1),
|
|
318
|
-
y("span", qe, j(M(n).t("module.dunning_case.settings.ladder.offset")), 1),
|
|
319
|
-
y("span", Je, j(M(n).t("module.dunning_case.settings.ladder.fee")), 1)
|
|
320
|
-
]), (O(!0), v(m, null, A(t.fields, (e, n) => (O(), g(Pe, {
|
|
321
|
-
key: n,
|
|
322
|
-
"absolute-day": t.ladder.getAbsoluteDay(n),
|
|
323
|
-
"can-update": t.canUpdate,
|
|
324
|
-
"fee-currency": t.ladder.items.value[n]?.feeCurrency,
|
|
325
|
-
"fee-field": e.feeAmount,
|
|
326
|
-
"fee-percentage-field": e.feePercentage,
|
|
327
|
-
"fee-type-field": e.feeType,
|
|
328
|
-
level: n + 1,
|
|
329
|
-
"offset-field": e.offsetDays,
|
|
330
|
-
"schedule-field": e.schedule,
|
|
331
|
-
"schedule-items": t.scheduleItems,
|
|
332
|
-
onCommitOffset: (e) => t.ladder.commitOffset(n),
|
|
333
|
-
onTypeOffset: t.ladder.setTypingOffset,
|
|
334
|
-
onUpdateOffset: (e) => t.ladder.updateOffset(n, e),
|
|
335
|
-
onUpdateSchedule: (e) => t.ladder.updateSchedule(n, e)
|
|
336
|
-
}, null, 8, [
|
|
337
|
-
"absolute-day",
|
|
338
|
-
"can-update",
|
|
339
|
-
"fee-currency",
|
|
340
|
-
"fee-field",
|
|
341
|
-
"fee-percentage-field",
|
|
342
|
-
"fee-type-field",
|
|
343
|
-
"level",
|
|
344
|
-
"offset-field",
|
|
345
|
-
"schedule-field",
|
|
346
|
-
"schedule-items",
|
|
347
|
-
"onCommitOffset",
|
|
348
|
-
"onTypeOffset",
|
|
349
|
-
"onUpdateOffset",
|
|
350
|
-
"onUpdateSchedule"
|
|
351
|
-
]))), 128))]),
|
|
352
|
-
x(ye)
|
|
353
|
-
]));
|
|
354
|
-
}
|
|
355
|
-
}), Xe = { class: "flex flex-wrap items-center gap-xl" }, Ze = { class: "text-xs text-secondary" }, Y = /* @__PURE__ */ S({
|
|
356
|
-
__name: "ReminderTemplateTabs",
|
|
357
|
-
props: /*@__PURE__*/ C({
|
|
358
|
-
caption: {},
|
|
359
|
-
items: {}
|
|
360
|
-
}, {
|
|
361
|
-
modelValue: { required: !0 },
|
|
362
|
-
modelModifiers: {}
|
|
363
|
-
}),
|
|
364
|
-
emits: ["update:modelValue"],
|
|
365
|
-
setup(e) {
|
|
366
|
-
let t = e, n = N(e, "modelValue"), r = p();
|
|
367
|
-
function i(e) {
|
|
368
|
-
return e.hasMissingContent ? `${e.label}, ${r.t("module.dunning_case.settings.templates.missing")}` : e.label;
|
|
369
|
-
}
|
|
370
|
-
return (e, r) => (O(), v("div", Xe, [y("p", Ze, j(t.caption), 1), x(M(H), {
|
|
371
|
-
modelValue: n.value,
|
|
372
|
-
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
373
|
-
"aria-label": t.caption,
|
|
374
|
-
variant: "button-brand"
|
|
375
|
-
}, {
|
|
376
|
-
default: P(() => [x(M(W), null, {
|
|
377
|
-
default: P(() => [(O(!0), v(m, null, A(t.items, (e) => (O(), g(M(U), {
|
|
378
|
-
key: e.value,
|
|
379
|
-
"aria-label": i(e),
|
|
380
|
-
config: e.hasMissingContent ? { indicator: {
|
|
381
|
-
type: "dot",
|
|
382
|
-
color: "error"
|
|
383
|
-
} } : null,
|
|
384
|
-
label: e.label,
|
|
385
|
-
value: e.value
|
|
386
|
-
}, null, 8, [
|
|
387
|
-
"aria-label",
|
|
388
|
-
"config",
|
|
389
|
-
"label",
|
|
390
|
-
"value"
|
|
391
|
-
]))), 128))]),
|
|
392
|
-
_: 1
|
|
393
|
-
})]),
|
|
394
|
-
_: 1
|
|
395
|
-
}, 8, ["modelValue", "aria-label"])]));
|
|
396
|
-
}
|
|
397
|
-
}), Qe = { class: "mt-5xl" }, $e = { class: "flex flex-col gap-xl sm:flex-row sm:items-center sm:justify-between" }, et = { class: "mt-xl overflow-hidden rounded-md border border-secondary bg-primary" }, tt = { class: "border-b border-secondary px-3xl py-lg" }, nt = { class: "text-sm font-medium text-primary" }, rt = {
|
|
398
|
-
key: 0,
|
|
399
|
-
class: "flex flex-col gap-md p-3xl"
|
|
400
|
-
}, it = /* @__PURE__ */ S({
|
|
401
|
-
__name: "ReminderTemplatesPanel",
|
|
402
|
-
props: /*@__PURE__*/ C({
|
|
403
|
-
bodyField: {},
|
|
404
|
-
canUpdate: { type: Boolean },
|
|
405
|
-
cardTitle: {},
|
|
406
|
-
levelItems: {},
|
|
407
|
-
localeItems: {},
|
|
408
|
-
subjectField: {}
|
|
409
|
-
}, {
|
|
410
|
-
activeLevel: { required: !0 },
|
|
411
|
-
activeLevelModifiers: {},
|
|
412
|
-
activeLocale: { required: !0 },
|
|
413
|
-
activeLocaleModifiers: {}
|
|
414
|
-
}),
|
|
415
|
-
emits: ["update:activeLevel", "update:activeLocale"],
|
|
416
|
-
setup(e) {
|
|
417
|
-
let t = e, n = N(e, "activeLevel"), r = N(e, "activeLocale"), i = p();
|
|
418
|
-
return (e, a) => (O(), v("div", Qe, [y("div", $e, [x(Y, {
|
|
419
|
-
modelValue: n.value,
|
|
420
|
-
"onUpdate:modelValue": a[0] ||= (e) => n.value = e,
|
|
421
|
-
caption: M(i).t("module.dunning_case.settings.templates.selector"),
|
|
422
|
-
items: t.levelItems
|
|
423
|
-
}, null, 8, [
|
|
424
|
-
"modelValue",
|
|
425
|
-
"caption",
|
|
426
|
-
"items"
|
|
427
|
-
]), x(Y, {
|
|
428
|
-
modelValue: r.value,
|
|
429
|
-
"onUpdate:modelValue": a[1] ||= (e) => r.value = e,
|
|
430
|
-
caption: M(i).t("module.dunning_case.settings.templates.language"),
|
|
431
|
-
items: t.localeItems
|
|
432
|
-
}, null, 8, [
|
|
433
|
-
"modelValue",
|
|
434
|
-
"caption",
|
|
435
|
-
"items"
|
|
436
|
-
])]), y("div", et, [y("div", tt, [y("h2", nt, j(t.cardTitle), 1)]), t.subjectField !== void 0 && t.bodyField !== void 0 ? (O(), v("div", rt, [x(M(ie), w(M(d)(t.subjectField), {
|
|
437
|
-
"is-disabled": !t.canUpdate,
|
|
438
|
-
"is-required": !0,
|
|
439
|
-
label: M(i).t("module.dunning_case.settings.templates.subject"),
|
|
440
|
-
size: "sm"
|
|
441
|
-
}), null, 16, ["is-disabled", "label"]), x(M(ae), w(M(d)(t.bodyField), {
|
|
442
|
-
"is-disabled": !t.canUpdate,
|
|
443
|
-
"is-required": !0,
|
|
444
|
-
label: M(i).t("module.dunning_case.settings.templates.content"),
|
|
445
|
-
"min-height": "var(--spacing-11xl)",
|
|
446
|
-
resize: "auto-vertical",
|
|
447
|
-
size: "sm"
|
|
448
|
-
}), null, 16, ["is-disabled", "label"])])) : _("", !0)])]));
|
|
449
|
-
}
|
|
450
|
-
}), X = class {
|
|
451
|
-
static commitReminder(e, t, n) {
|
|
452
|
-
if (t === void 0) return e.slice();
|
|
453
|
-
let r = e.slice();
|
|
454
|
-
return r[n] = { ...t }, r;
|
|
455
|
-
}
|
|
456
|
-
static getAbsoluteDay(e, t) {
|
|
457
|
-
let r = 0;
|
|
458
|
-
for (let i of t.slice(0, e + 1)) i.schedule === n.AFTER_DUE_DATE ? r = i.offsetDays : r += i.offsetDays;
|
|
459
|
-
return r;
|
|
460
|
-
}
|
|
461
|
-
}, at = 60, ot = 1, Z = 15;
|
|
462
|
-
function st(e) {
|
|
463
|
-
return e != null && Number.isInteger(e) && e >= ot;
|
|
464
|
-
}
|
|
465
|
-
function ct(e) {
|
|
466
|
-
let t = k([]), r = !1;
|
|
467
|
-
function i(e) {
|
|
468
|
-
return X.getAbsoluteDay(e, t.value);
|
|
469
|
-
}
|
|
470
|
-
let a = h(() => {
|
|
471
|
-
let t = e.items.value.length - 1, n = t < 0 ? 0 : i(t), r = Math.ceil(n / Z) * Z;
|
|
472
|
-
return Math.max(at, r);
|
|
473
|
-
}), o = h(() => e.items.value.map((e, t) => ({
|
|
474
|
-
absoluteDay: i(t),
|
|
475
|
-
minimumDay: t === 0 ? 1 : i(t - 1) + 1,
|
|
476
|
-
sequence: e.sequence
|
|
477
|
-
})));
|
|
478
|
-
function s() {
|
|
479
|
-
t.value = e.items.value.map((e) => ({
|
|
480
|
-
offsetDays: e.offsetDays,
|
|
481
|
-
schedule: e.schedule
|
|
482
|
-
}));
|
|
483
|
-
}
|
|
484
|
-
function c(n, r) {
|
|
485
|
-
let i = e.items.value[n];
|
|
486
|
-
if (i === void 0) return;
|
|
487
|
-
let a = r ?? i.offsetDays;
|
|
488
|
-
st(a) && (t.value = X.commitReminder(t.value, {
|
|
489
|
-
offsetDays: a,
|
|
490
|
-
schedule: i.schedule
|
|
491
|
-
}, n));
|
|
492
|
-
}
|
|
493
|
-
function l(t) {
|
|
494
|
-
e.fields[t]?.offsetDays.onBlur(), T(() => c(t));
|
|
495
|
-
}
|
|
496
|
-
function u(e) {
|
|
497
|
-
r = e;
|
|
498
|
-
}
|
|
499
|
-
function d(t, n) {
|
|
500
|
-
e.fields[t]?.offsetDays["onUpdate:modelValue"](n), r || c(t, n);
|
|
501
|
-
}
|
|
502
|
-
function f(t, n) {
|
|
503
|
-
e.fields[t]?.schedule["onUpdate:modelValue"](n), c(t);
|
|
504
|
-
}
|
|
505
|
-
function p(t, r) {
|
|
506
|
-
let o = e.items.value[t], s = e.fields[t]?.offsetDays;
|
|
507
|
-
if (o === void 0 || s === void 0 || !e.canUpdate.value) return;
|
|
508
|
-
let l = t === 0 ? 0 : i(t - 1), u = o.schedule === n.AFTER_DUE_DATE ? 1 : l + 1, d = Math.min(a.value, Math.max(u, r)), f = o.schedule === n.AFTER_DUE_DATE ? d : d - l;
|
|
509
|
-
s.setValue(f), c(t);
|
|
510
|
-
}
|
|
511
|
-
return {
|
|
512
|
-
commitOffset: l,
|
|
513
|
-
getAbsoluteDay: i,
|
|
514
|
-
items: e.items,
|
|
515
|
-
markers: o,
|
|
516
|
-
reset: s,
|
|
517
|
-
setAbsoluteDay: p,
|
|
518
|
-
setTypingOffset: u,
|
|
519
|
-
timelineDays: a,
|
|
520
|
-
updateOffset: d,
|
|
521
|
-
updateSchedule: f
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
|
-
//#endregion
|
|
525
|
-
//#region src/modules/dunning-case/use-cases/settings/views/ReminderSettingsView.vue?vue&type=script&setup=true&lang.ts
|
|
526
|
-
var Q = { class: "mx-auto w-full max-w-340" }, lt = { class: "flex flex-col gap-lg sm:flex-row sm:items-start sm:justify-between" }, ut = { class: "text-md font-semibold text-primary" }, dt = { class: "mt-xs text-sm text-secondary" }, ft = /* @__PURE__ */ S({
|
|
527
|
-
__name: "ReminderSettingsView",
|
|
528
|
-
props: { reminderConfigs: {} },
|
|
529
|
-
setup(e) {
|
|
530
|
-
let t = e, r = [
|
|
531
|
-
0,
|
|
532
|
-
1,
|
|
533
|
-
2
|
|
534
|
-
], i = [
|
|
535
|
-
"en-US",
|
|
536
|
-
"nl-BE",
|
|
537
|
-
"fr-BE"
|
|
538
|
-
], s = [n.AFTER_DUE_DATE, n.AFTER_LAST_REMINDER], c = p(), l = K(), u = a(), d = le(), f = k("ladder"), m = k(0), v = k("en-US");
|
|
539
|
-
u.set(() => c.t("module.dunning_case.settings.title"));
|
|
540
|
-
let b = ce({
|
|
541
|
-
initialState: h(() => o.reminderConfigsToForm(t.reminderConfigs)),
|
|
542
|
-
schema: de,
|
|
543
|
-
onSubmit: async (e) => {
|
|
544
|
-
let t = await d.execute({ body: e });
|
|
545
|
-
if (t.isErr()) {
|
|
546
|
-
l.apiError(t.error);
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
l.show({ message: c.t("module.dunning_case.settings.saved") });
|
|
550
|
-
},
|
|
551
|
-
onSubmitError: () => {
|
|
552
|
-
l.unableToSave();
|
|
553
|
-
}
|
|
554
|
-
}), S = b.registerArray("reminders"), C = r.map((e) => {
|
|
555
|
-
let t = S.register(`${e}`), n = t.register("template");
|
|
556
|
-
return {
|
|
557
|
-
feeAmount: t.register("feeAmount"),
|
|
558
|
-
feePercentage: t.register("feePercentage"),
|
|
559
|
-
feeType: t.register("feeType"),
|
|
560
|
-
locales: {
|
|
561
|
-
"en-US": {
|
|
562
|
-
body: n.register("en-US").register("body"),
|
|
563
|
-
subject: n.register("en-US").register("subject")
|
|
564
|
-
},
|
|
565
|
-
"fr-BE": {
|
|
566
|
-
body: n.register("fr-BE").register("body"),
|
|
567
|
-
subject: n.register("fr-BE").register("subject")
|
|
568
|
-
},
|
|
569
|
-
"nl-BE": {
|
|
570
|
-
body: n.register("nl-BE").register("body"),
|
|
571
|
-
subject: n.register("nl-BE").register("subject")
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
offsetDays: t.register("offsetDays"),
|
|
575
|
-
schedule: t.register("schedule")
|
|
576
|
-
};
|
|
577
|
-
}), w = k(!0), T = h(() => G(s)), E = ct({
|
|
578
|
-
canUpdate: w,
|
|
579
|
-
fields: C,
|
|
580
|
-
items: h(() => (b.state.value.reminders ?? []).map((e, t) => ({
|
|
581
|
-
feeCurrency: e?.feeCurrency,
|
|
582
|
-
offsetDays: e?.offsetDays ?? 0,
|
|
583
|
-
schedule: e?.schedule ?? n.AFTER_DUE_DATE,
|
|
584
|
-
sequence: e?.sequence ?? t + 1
|
|
585
|
-
})))
|
|
586
|
-
}), D = h({
|
|
587
|
-
get: () => String(m.value),
|
|
588
|
-
set: (e) => {
|
|
589
|
-
let t = Number(e);
|
|
590
|
-
Number.isInteger(t) && t >= 0 && t < C.length && (m.value = t);
|
|
591
|
-
}
|
|
592
|
-
}), A = h({
|
|
593
|
-
get: () => v.value,
|
|
594
|
-
set: (e) => {
|
|
595
|
-
let t = i.find((t) => t === e);
|
|
596
|
-
t !== void 0 && (v.value = t);
|
|
597
|
-
}
|
|
598
|
-
});
|
|
599
|
-
function N(e, t) {
|
|
600
|
-
let n = b.state.value.reminders?.[e]?.template?.[t];
|
|
601
|
-
return n === void 0 || fe(n);
|
|
602
|
-
}
|
|
603
|
-
let F = h(() => C[m.value]?.locales[v.value]), I = h(() => C.map((e, t) => ({
|
|
604
|
-
hasMissingContent: N(t, v.value),
|
|
605
|
-
label: c.t("module.dunning_case.level.reminder", { level: t + 1 }),
|
|
606
|
-
value: String(t)
|
|
607
|
-
}))), L = h(() => i.map((e) => ({
|
|
608
|
-
hasMissingContent: N(m.value, e),
|
|
609
|
-
label: c.t(`module.dunning_case.settings.locale.${e}`),
|
|
610
|
-
value: e
|
|
611
|
-
}))), R = h(() => c.t("module.dunning_case.settings.templates.card_title", {
|
|
612
|
-
language: c.t(`module.dunning_case.settings.locale_name.${v.value}`),
|
|
613
|
-
level: m.value + 1
|
|
614
|
-
}));
|
|
615
|
-
return ee(() => t.reminderConfigs, E.reset, { immediate: !0 }), (e, t) => (O(), g(M(ne), {
|
|
616
|
-
title: M(c).t("module.dunning_case.settings.title"),
|
|
617
|
-
subtitle: M(c).t("module.dunning_case.settings.subtitle")
|
|
618
|
-
}, {
|
|
619
|
-
default: P(() => [x(M(re), null, {
|
|
620
|
-
default: P(() => [x(M(z), {
|
|
621
|
-
form: M(b),
|
|
622
|
-
"prompt-on-unsaved-changes": !0
|
|
623
|
-
}, {
|
|
624
|
-
default: P(() => [y("div", Q, [
|
|
625
|
-
y("div", lt, [y("div", null, [y("h2", ut, j(M(c).t("module.dunning_case.settings.title")), 1), y("p", dt, j(M(c).t("module.dunning_case.settings.subtitle")), 1)]), w.value ? (O(), g(M(te), {
|
|
626
|
-
key: 0,
|
|
627
|
-
"is-disabled": !M(b).isDirty.value || !M(b).isValid.value,
|
|
628
|
-
"is-loading": M(b).isSubmitting.value,
|
|
629
|
-
label: M(c).t("shared.save_changes"),
|
|
630
|
-
onClick: M(b).submit
|
|
631
|
-
}, null, 8, [
|
|
632
|
-
"is-disabled",
|
|
633
|
-
"is-loading",
|
|
634
|
-
"label",
|
|
635
|
-
"onClick"
|
|
636
|
-
])) : _("", !0)]),
|
|
637
|
-
x(M(H), {
|
|
638
|
-
modelValue: f.value,
|
|
639
|
-
"onUpdate:modelValue": t[0] ||= (e) => f.value = e,
|
|
640
|
-
"aria-label": M(c).t("module.dunning_case.settings.navigation"),
|
|
641
|
-
class: "mt-xl",
|
|
642
|
-
variant: "button-border"
|
|
643
|
-
}, {
|
|
644
|
-
default: P(() => [x(M(W), null, {
|
|
645
|
-
default: P(() => [x(M(U), {
|
|
646
|
-
label: M(c).t("module.dunning_case.settings.ladder.tab"),
|
|
647
|
-
value: "ladder"
|
|
648
|
-
}, null, 8, ["label"]), x(M(U), {
|
|
649
|
-
label: M(c).t("module.dunning_case.settings.templates.tab"),
|
|
650
|
-
value: "templates"
|
|
651
|
-
}, null, 8, ["label"])]),
|
|
652
|
-
_: 1
|
|
653
|
-
})]),
|
|
654
|
-
_: 1
|
|
655
|
-
}, 8, ["modelValue", "aria-label"]),
|
|
656
|
-
f.value === "ladder" ? (O(), g(Ye, {
|
|
657
|
-
key: 0,
|
|
658
|
-
"can-update": w.value,
|
|
659
|
-
fields: M(C),
|
|
660
|
-
ladder: M(E),
|
|
661
|
-
"schedule-items": T.value
|
|
662
|
-
}, null, 8, [
|
|
663
|
-
"can-update",
|
|
664
|
-
"fields",
|
|
665
|
-
"ladder",
|
|
666
|
-
"schedule-items"
|
|
667
|
-
])) : (O(), g(it, {
|
|
668
|
-
key: 1,
|
|
669
|
-
"active-level": D.value,
|
|
670
|
-
"onUpdate:activeLevel": t[1] ||= (e) => D.value = e,
|
|
671
|
-
"active-locale": A.value,
|
|
672
|
-
"onUpdate:activeLocale": t[2] ||= (e) => A.value = e,
|
|
673
|
-
"body-field": F.value?.body,
|
|
674
|
-
"can-update": w.value,
|
|
675
|
-
"card-title": R.value,
|
|
676
|
-
"level-items": I.value,
|
|
677
|
-
"locale-items": L.value,
|
|
678
|
-
"subject-field": F.value?.subject
|
|
679
|
-
}, null, 8, [
|
|
680
|
-
"active-level",
|
|
681
|
-
"active-locale",
|
|
682
|
-
"body-field",
|
|
683
|
-
"can-update",
|
|
684
|
-
"card-title",
|
|
685
|
-
"level-items",
|
|
686
|
-
"locale-items",
|
|
687
|
-
"subject-field"
|
|
688
|
-
]))
|
|
689
|
-
])]),
|
|
690
|
-
_: 1
|
|
691
|
-
}, 8, ["form"])]),
|
|
692
|
-
_: 1
|
|
693
|
-
})]),
|
|
694
|
-
_: 1
|
|
695
|
-
}, 8, ["title", "subtitle"]));
|
|
696
|
-
}
|
|
697
|
-
}), pt = /*@__PURE__*/ S({
|
|
698
|
-
__name: "ReminderSettingsViewDataProvider",
|
|
699
|
-
setup(e) {
|
|
700
|
-
let t = l();
|
|
701
|
-
return (e, n) => (O(), g(u, { queries: { reminderConfigs: M(t) } }, {
|
|
702
|
-
default: P(({ data: e }) => [x(ft, { "reminder-configs": e.reminderConfigs }, null, 8, ["reminder-configs"])]),
|
|
703
|
-
loading: P(() => [x(M(R), { breadcrumbs: [] })]),
|
|
704
|
-
_: 1
|
|
705
|
-
}, 8, ["queries"]));
|
|
706
|
-
}
|
|
707
|
-
}), mt = /* @__PURE__ */ e({ default: () => $ }), $ = pt;
|
|
708
|
-
//#endregion
|
|
709
|
-
export { mt as n, $ as t };
|