@wisemen/wise-invoicing-web 0.0.4 → 0.0.6
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-pePmiXWb.js → BillingDocumentDetailViewDataProvider-BGE-p_FL.js} +953 -863
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-Dg5JlQE1.js → BillingDocumentPdf-Ca81NkZq.js} +4 -4
- package/dist/{CreditNoteDetailViewDataProvider-C-A0jyVr.js → CreditNoteDetailViewDataProvider-b5dY_4mH.js} +181 -181
- package/dist/{CreditNotePdfViewDataProvider-DNUvFVDj.js → CreditNotePdfViewDataProvider-C2QqCdQ7.js} +3 -3
- package/dist/{CustomFieldValueText-DDQq-975.js → CustomFieldValueText-ne5yy02J.js} +2 -2
- package/dist/DataProvider-Dj34ljUX.js +75 -0
- package/dist/{DunningCaseDetailViewDataProvider-0WV-7-vg.js → DunningCaseDetailViewDataProvider-jsh-LlGx.js} +68 -59
- package/dist/DunningCaseOverviewView-WbXalMt6.js +747 -0
- package/dist/{DunningCaseReminderPdfViewDataProvider-DcM-7ECg.js → DunningCaseReminderPdfViewDataProvider-B3Y2aYFf.js} +1 -1
- package/dist/DunningCaseSendDialog-D7jAZ8yT.js +349 -0
- package/dist/{InvoiceDetailViewDataProvider-BDL9lAWe.js → InvoiceDetailViewDataProvider-BAVdcJay.js} +589 -498
- package/dist/{InvoiceOverviewViewDataProvider-B_jrcC_8.js → InvoiceOverviewViewDataProvider-BT9cuQXw.js} +546 -482
- package/dist/{InvoicePdfView-Bygb-9z6.js → InvoicePdfView-BpIaYdZX.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-nBk3XNrE.js → InvoicePdfViewDataProvider-DGCnmNE-.js} +3 -3
- package/dist/{InvoicePublicPdfViewDataProvider-DHJP_-7-.js → InvoicePublicPdfViewDataProvider-KV0_hKUI.js} +3 -3
- package/dist/{IssuerSettingsViewDataProvider-Dk_Q6w6f.js → IssuerSettingsViewDataProvider-Bs4rEES2.js} +4 -4
- package/dist/ReminderSettingsViewDataProvider-D4bRLLXx.js +711 -0
- package/dist/{api.util-Dm_TQedZ.js → api.util-BCSgCfpS.js} +528 -509
- package/dist/{billingDocumentDetail.transformer-zMTbka5p.js → billingDocumentDetail.transformer-DIKAl4_L.js} +58 -89
- package/dist/client/index.d.ts +1 -1
- package/dist/client/types.gen.d.ts +28 -5
- package/dist/client/zod.gen.d.ts +869 -623
- package/dist/{creditNoteDetail.query-BZqgZRSu.js → creditNoteDetail.query-DHP69UiB.js} +13 -13
- package/dist/{dist-DP8KNFVD.js → dist-D9lp7NDv.js} +20 -36
- package/dist/{dist-DJ8yJcb9.js → dist-PErDVE6-.js} +621 -671
- package/dist/{documentTitle.composable-CeaFddr1.js → documentTitle.composable-4ApFl9TZ.js} +10 -8
- package/dist/{i18n.lib-DUbAMBRb.js → i18n.lib-BGcQ_OBF.js} +50 -2
- package/dist/index.d.ts +51 -2
- package/dist/index.js +78 -78
- package/dist/{invoice.service-ChHEtXBA.js → invoice.service-DG5eacZC.js} +46 -46
- package/dist/{invoiceDeliveryStatus.util-BsA-MlA3.js → invoiceDeliveryStatus.util-CX-IdqAu.js} +28 -28
- package/dist/{invoiceDetail.query-O_CGvdwg.js → invoiceDetail.query-C_IMGjOX.js} +1 -1
- package/dist/{invoicingConfig.composable-c6w_aMm1.js → invoicingConfig.composable-Kad_HHx_.js} +2 -2
- package/dist/{issuerSettings.query-RqtrZFaB.js → issuerSettings.query-6wnSPphB.js} +2 -2
- package/dist/libs/i18n.lib.d.ts +50 -2
- package/dist/locales/en-US.json.d.ts +25 -1
- package/dist/locales/nl-BE.json.d.ts +25 -1
- package/dist/models/billing-document/billingDocumentLineItemGroupUpdateForm.model.d.ts +9 -3
- package/dist/modules/dunning-case/actions/dunningCase.actions.d.ts +12 -0
- package/dist/modules/dunning-case/actions/dunningCaseNavigateToCustomer.action.d.ts +1 -0
- package/dist/modules/dunning-case/actions/dunningCaseNavigateToDetail.action.d.ts +1 -0
- package/dist/modules/dunning-case/api/mutations/reminderConfigUpdate.mutation.d.ts +2 -0
- package/dist/modules/dunning-case/models/dunningCase.model.d.ts +12 -3
- package/dist/modules/dunning-case/models/reminderConfigForm.model.d.ts +3 -1
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue.d.ts +13 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewCustomerCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewDaysOverdueCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewLastReminderCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewLevelCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewMetrics.vue.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewOutstandingCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewReminderCell.vue.d.ts +7 -0
- package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewActionsCell.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewLastReminderCell.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/overview/components/dunningCaseOverviewReminderCell.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.d.ts +24 -0
- package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.d.ts +8 -0
- package/dist/modules/dunning-case/use-cases/send/dialogs/dunningCaseBulkSendDialog.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +3 -1
- package/dist/modules/dunning-case/use-cases/settings/components/reminderLadderFeeNotice.spec.d.ts +1 -0
- package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +3 -1
- package/dist/modules/invoice/api/invoiceIndexCache.util.d.ts +4 -4
- package/dist/modules/invoice/api/queries/invoiceUserSearch.query.d.ts +3 -0
- package/dist/modules/invoice/api/query-keys/invoice.queryKeys.d.ts +8 -0
- package/dist/modules/invoice/api/services/invoiceUser.service.d.ts +6 -0
- package/dist/modules/invoice/components/form/InvoiceFormPreparedByField.vue.d.ts +16 -0
- package/dist/modules/invoice/models/invoice/update/invoicePreparer.model.d.ts +4 -0
- package/dist/modules/invoice/models/invoice/update/invoicePreparer.transformer.d.ts +5 -0
- package/dist/modules/invoice/models/invoice/update/invoiceUserSearchQueryParams.model.d.ts +3 -0
- package/dist/modules/invoice/models/invoice/update/invoiceUserSearchQueryParams.transformer.d.ts +6 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +1 -0
- package/dist/{plainDate.transformer-BxvJpJOv.js → plainDate.transformer-Dfe5r84P.js} +32 -1
- package/dist/{reminderConfig.query-DzTN2AvU.js → reminderConfig.query-hmDNKreg.js} +105 -91
- package/dist/search.composable-BCtYqudV.js +52 -0
- package/dist/style.css +1 -1
- package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +6 -6
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +1 -1
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsRowMutations.composable.d.ts +2 -2
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsRowMutations.composable.spec.d.ts +1 -0
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsTableDrag.composable.d.ts +3 -1
- package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableField.vue.d.ts +2 -0
- package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableTextField.vue.d.ts +1 -0
- package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +19 -0
- package/dist/ui/data-provider/DataProviderErrorState.vue.d.ts +7 -0
- package/dist/ui/data-provider/dataProviderErrorState.spec.d.ts +1 -0
- package/package.json +6 -1
- package/dist/DataProvider-CfHLB3rH.js +0 -48
- package/dist/DunningCaseOverviewView-CHdzfbhb.js +0 -553
- package/dist/DunningCaseSendDialog-DBtwr2ue.js +0 -350
- package/dist/ReminderSettingsViewDataProvider-CDBjfU7R.js +0 -668
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { t } from "./i18n.lib-BGcQ_OBF.js";
|
|
3
|
+
import "./api.util-BCSgCfpS.js";
|
|
4
|
+
import { a as n, d as r, t as i, y as a } from "./documentTitle.composable-4ApFl9TZ.js";
|
|
5
|
+
import { i as o, n as s, r as c, t as l } from "./reminderConfig.query-hmDNKreg.js";
|
|
6
|
+
import { t as u } from "./DataProvider-Dj34ljUX.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 R, UIDashboardPage as te, UIDashboardPageContent as ne, UIDashboardPageLoadingState as z, UIForm as re, 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(n),
|
|
32
|
+
feePercentage: f.number().min(0).max(100),
|
|
33
|
+
feePrecision: f.number().int().min(0),
|
|
34
|
+
feeType: f.enum(r),
|
|
35
|
+
offsetDays: f.number().int().min(1),
|
|
36
|
+
schedule: f.enum(a),
|
|
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, n) => {
|
|
44
|
+
e.reminders[0]?.schedule !== a.AFTER_DUE_DATE && n.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 r = 0;
|
|
54
|
+
for (let [i, o] of e.reminders.entries()) {
|
|
55
|
+
let e = o.schedule === a.AFTER_DUE_DATE ? o.offsetDays : r + o.offsetDays;
|
|
56
|
+
i > 0 && e <= r && n.addIssue({
|
|
57
|
+
code: "custom",
|
|
58
|
+
message: t.global.t("module.dunning_case.settings.validation.chronological"),
|
|
59
|
+
path: [
|
|
60
|
+
"reminders",
|
|
61
|
+
i,
|
|
62
|
+
"offsetDays"
|
|
63
|
+
]
|
|
64
|
+
}), r = 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
|
+
"updateOffset",
|
|
99
|
+
"updateOffsetFromInput",
|
|
100
|
+
"updateSchedule"
|
|
101
|
+
],
|
|
102
|
+
setup(e, { emit: t }) {
|
|
103
|
+
let n = e, i = t, o = p(), c = h(() => !n.canUpdate || n.level === 1), l = h(() => n.feeTypeField.modelValue.value ?? r.AMOUNT), u = h(() => G([r.AMOUNT, r.PERCENTAGE])), f = {
|
|
104
|
+
maximumFractionDigits: 2,
|
|
105
|
+
minimumFractionDigits: 0
|
|
106
|
+
}, m = { maximumFractionDigits: 2 }, _ = h(() => n.feeCurrency === void 0 ? "" : new Intl.NumberFormat(o.locale.value, {
|
|
107
|
+
currency: n.feeCurrency,
|
|
108
|
+
style: "currency"
|
|
109
|
+
}).formatToParts(0).find((e) => e.type === "currency")?.value ?? n.feeCurrency);
|
|
110
|
+
function b(e) {
|
|
111
|
+
return o.t(e === a.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 === r.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: n.level })), 1), x(s, {
|
|
118
|
+
level: n.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)(n.scheduleField), {
|
|
122
|
+
"aria-label": M(o).t("module.dunning_case.settings.ladder.trigger"),
|
|
123
|
+
"display-fn": b,
|
|
124
|
+
"is-disabled": c.value,
|
|
125
|
+
items: n.scheduleItems,
|
|
126
|
+
label: null,
|
|
127
|
+
"onUpdate:modelValue": t[0] ||= (e) => i("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) => i("commitOffset", e),
|
|
136
|
+
onInputCapture: t[3] ||= (e) => i("updateOffsetFromInput", e)
|
|
137
|
+
}, [x(M(B), w(M(d)(n.offsetField), {
|
|
138
|
+
"aria-label": M(o).t("module.dunning_case.settings.ladder.offset"),
|
|
139
|
+
"is-disabled": !n.canUpdate,
|
|
140
|
+
label: null,
|
|
141
|
+
min: 1,
|
|
142
|
+
"show-controls": !0,
|
|
143
|
+
step: 1,
|
|
144
|
+
class: "w-30",
|
|
145
|
+
size: "sm",
|
|
146
|
+
"onUpdate:modelValue": t[1] ||= (e) => i("updateOffset", e)
|
|
147
|
+
}), null, 16, ["aria-label", "is-disabled"]), y("span", De, j(M(o).t("module.dunning_case.settings.ladder.day_hint", { day: n.absoluteDay })), 1)], 32)]),
|
|
148
|
+
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)(n.feeTypeField), {
|
|
149
|
+
"aria-label": M(o).t("module.dunning_case.settings.ladder.fee_type"),
|
|
150
|
+
"display-fn": S,
|
|
151
|
+
"is-disabled": !n.canUpdate,
|
|
152
|
+
items: u.value,
|
|
153
|
+
label: null
|
|
154
|
+
}), null, 16, [
|
|
155
|
+
"aria-label",
|
|
156
|
+
"is-disabled",
|
|
157
|
+
"items"
|
|
158
|
+
])]), y("div", Me, [l.value === M(r).PERCENTAGE ? (O(), g(M(B), w({ key: 0 }, M(d)(n.feePercentageField), {
|
|
159
|
+
"aria-label": M(o).t("module.dunning_case.settings.ladder.fee"),
|
|
160
|
+
"format-options": m,
|
|
161
|
+
"is-disabled": !n.canUpdate,
|
|
162
|
+
label: null,
|
|
163
|
+
max: 100,
|
|
164
|
+
min: 0,
|
|
165
|
+
step: .01,
|
|
166
|
+
size: "sm"
|
|
167
|
+
}), {
|
|
168
|
+
right: P(() => [...t[4] ||= [y("span", { class: "pr-md text-xs text-secondary" }, " % ", -1)]]),
|
|
169
|
+
_: 1
|
|
170
|
+
}, 16, ["aria-label", "is-disabled"])) : (O(), g(M(B), w({ key: 1 }, M(d)(n.feeField), {
|
|
171
|
+
"aria-label": M(o).t("module.dunning_case.settings.ladder.fee"),
|
|
172
|
+
"format-options": f,
|
|
173
|
+
"is-disabled": !n.canUpdate,
|
|
174
|
+
label: null,
|
|
175
|
+
min: 0,
|
|
176
|
+
step: .01,
|
|
177
|
+
size: "sm"
|
|
178
|
+
}), {
|
|
179
|
+
right: P(() => [y("span", Ne, j(_.value), 1)]),
|
|
180
|
+
_: 1
|
|
181
|
+
}, 16, ["aria-label", "is-disabled"]))])])])
|
|
182
|
+
]));
|
|
183
|
+
}
|
|
184
|
+
}), 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 = [
|
|
185
|
+
"aria-label",
|
|
186
|
+
"aria-valuemax",
|
|
187
|
+
"aria-valuemin",
|
|
188
|
+
"aria-valuenow",
|
|
189
|
+
"disabled",
|
|
190
|
+
"onKeydown",
|
|
191
|
+
"onPointercancel",
|
|
192
|
+
"onPointerdown",
|
|
193
|
+
"onPointerenter",
|
|
194
|
+
"onPointermove",
|
|
195
|
+
"onPointerup"
|
|
196
|
+
], Be = 4, Ve = /* @__PURE__ */ S({
|
|
197
|
+
__name: "ReminderLadderTimeline",
|
|
198
|
+
props: {
|
|
199
|
+
canUpdate: { type: Boolean },
|
|
200
|
+
markers: {},
|
|
201
|
+
timelineDays: {}
|
|
202
|
+
},
|
|
203
|
+
emits: ["moveTo"],
|
|
204
|
+
setup(e, { emit: t }) {
|
|
205
|
+
let n = e, r = t, i = [
|
|
206
|
+
"bg-brand-500",
|
|
207
|
+
"bg-warning-solid",
|
|
208
|
+
"bg-error-solid"
|
|
209
|
+
], 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))));
|
|
210
|
+
function u(e) {
|
|
211
|
+
return Math.min(100, e / n.timelineDays * 100);
|
|
212
|
+
}
|
|
213
|
+
function d(e) {
|
|
214
|
+
return i[e] ?? i[0];
|
|
215
|
+
}
|
|
216
|
+
function f(e, t) {
|
|
217
|
+
r("moveTo", e, (n.markers[e]?.absoluteDay ?? 0) + t);
|
|
218
|
+
}
|
|
219
|
+
function g(e, t) {
|
|
220
|
+
if (o.value === null) return;
|
|
221
|
+
let i = o.value.getBoundingClientRect(), a = Math.min(1, Math.max(0, (t.clientX - i.left) / i.width));
|
|
222
|
+
r("moveTo", e, Math.round(a * n.timelineDays));
|
|
223
|
+
}
|
|
224
|
+
function _(e, t) {
|
|
225
|
+
n.canUpdate && (s.value = e, t.currentTarget.setPointerCapture(t.pointerId), g(e, t));
|
|
226
|
+
}
|
|
227
|
+
function S(e, t) {
|
|
228
|
+
s.value === e && g(e, t);
|
|
229
|
+
}
|
|
230
|
+
function C(e, t) {
|
|
231
|
+
s.value === e && (s.value = null, t.currentTarget.releasePointerCapture(t.pointerId));
|
|
232
|
+
}
|
|
233
|
+
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", {
|
|
234
|
+
ref_key: "timelineTrack",
|
|
235
|
+
ref: o,
|
|
236
|
+
class: "relative mt-lg h-(--spacing-8xl)"
|
|
237
|
+
}, [
|
|
238
|
+
t[2] ||= y("div", { class: "absolute inset-x-0 top-(--spacing-lg) h-(--spacing-md) rounded-full bg-tertiary" }, null, -1),
|
|
239
|
+
y("div", {
|
|
240
|
+
style: D({ width: `${u(n.markers[n.markers.length - 1]?.absoluteDay ?? 0)}%` }),
|
|
241
|
+
class: "absolute top-(--spacing-lg) left-0 h-(--spacing-md) rounded-full bg-brand-100"
|
|
242
|
+
}, null, 4),
|
|
243
|
+
(O(!0), v(m, null, A(l.value, (e) => (O(), v("div", {
|
|
244
|
+
key: e,
|
|
245
|
+
class: E([{
|
|
246
|
+
"-translate-x-1/2": e > 0 && e < n.timelineDays,
|
|
247
|
+
"-translate-x-full": e === n.timelineDays
|
|
248
|
+
}, "absolute top-0"]),
|
|
249
|
+
style: D({ left: `${e / n.timelineDays * 100}%` })
|
|
250
|
+
}, [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)),
|
|
251
|
+
(O(!0), v(m, null, A(n.markers, (e, r) => (O(), v("div", {
|
|
252
|
+
key: e.sequence,
|
|
253
|
+
style: D({ left: `${u(e.absoluteDay)}%` }),
|
|
254
|
+
class: "absolute top-0 z-10 -translate-x-1/2"
|
|
255
|
+
}, [x(M(oe), {
|
|
256
|
+
"is-open": c.value === r || s.value === r,
|
|
257
|
+
"popover-side-offset": 8,
|
|
258
|
+
"popover-align": "center",
|
|
259
|
+
"popover-side": "top",
|
|
260
|
+
"is-close-on-trigger-click-disabled": "",
|
|
261
|
+
"is-hoverable-content-disabled": ""
|
|
262
|
+
}, {
|
|
263
|
+
trigger: P(() => [y("button", {
|
|
264
|
+
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"]),
|
|
265
|
+
"aria-label": M(a).t("module.dunning_case.settings.ladder.marker_label", {
|
|
266
|
+
day: e.absoluteDay,
|
|
267
|
+
level: r + 1
|
|
268
|
+
}),
|
|
269
|
+
"aria-valuemax": n.timelineDays,
|
|
270
|
+
"aria-valuemin": e.minimumDay,
|
|
271
|
+
"aria-valuenow": e.absoluteDay,
|
|
272
|
+
disabled: !n.canUpdate,
|
|
273
|
+
role: "slider",
|
|
274
|
+
type: "button",
|
|
275
|
+
onKeydown: [F(I((e) => f(r, -1), ["prevent"]), ["left"]), F(I((e) => f(r, 1), ["prevent"]), ["right"])],
|
|
276
|
+
onPointercancel: (e) => C(r, e),
|
|
277
|
+
onPointerdown: (e) => _(r, e),
|
|
278
|
+
onPointerenter: (e) => c.value = r,
|
|
279
|
+
onPointerleave: t[0] ||= (e) => c.value = null,
|
|
280
|
+
onPointermove: (e) => S(r, e),
|
|
281
|
+
onPointerup: (e) => C(r, e)
|
|
282
|
+
}, j(e.sequence), 43, ze)]),
|
|
283
|
+
content: P(() => [x(M(se), { class: "rounded-md! bg-primary-solid! px-lg! py-md! text-sm font-semibold! whitespace-nowrap! text-white!" }, {
|
|
284
|
+
default: P(() => [b(j(M(a).t("module.dunning_case.settings.ladder.day", { day: e.absoluteDay })), 1)]),
|
|
285
|
+
_: 2
|
|
286
|
+
}, 1024)]),
|
|
287
|
+
_: 2
|
|
288
|
+
}, 1032, ["is-open"])], 4))), 128))
|
|
289
|
+
], 512)])]));
|
|
290
|
+
}
|
|
291
|
+
}), 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({
|
|
292
|
+
__name: "ReminderLadderPanel",
|
|
293
|
+
props: {
|
|
294
|
+
canUpdate: { type: Boolean },
|
|
295
|
+
fields: {},
|
|
296
|
+
ladder: {},
|
|
297
|
+
scheduleItems: {}
|
|
298
|
+
},
|
|
299
|
+
setup(e) {
|
|
300
|
+
let t = e, n = p();
|
|
301
|
+
return (e, r) => (O(), v("div", He, [
|
|
302
|
+
y("p", Ue, j(M(n).t("module.dunning_case.settings.ladder.description")), 1),
|
|
303
|
+
x(Ve, {
|
|
304
|
+
"can-update": t.canUpdate,
|
|
305
|
+
markers: t.ladder.markers.value,
|
|
306
|
+
"timeline-days": t.ladder.timelineDays.value,
|
|
307
|
+
onMoveTo: t.ladder.setAbsoluteDay
|
|
308
|
+
}, null, 8, [
|
|
309
|
+
"can-update",
|
|
310
|
+
"markers",
|
|
311
|
+
"timeline-days",
|
|
312
|
+
"onMoveTo"
|
|
313
|
+
]),
|
|
314
|
+
y("div", We, [y("div", Ge, [
|
|
315
|
+
y("span", null, j(M(n).t("module.dunning_case.settings.ladder.level")), 1),
|
|
316
|
+
y("span", Ke, j(M(n).t("module.dunning_case.settings.ladder.trigger")), 1),
|
|
317
|
+
y("span", qe, j(M(n).t("module.dunning_case.settings.ladder.offset")), 1),
|
|
318
|
+
y("span", Je, j(M(n).t("module.dunning_case.settings.ladder.fee")), 1)
|
|
319
|
+
]), (O(!0), v(m, null, A(t.fields, (e, n) => (O(), g(Pe, {
|
|
320
|
+
key: n,
|
|
321
|
+
"absolute-day": t.ladder.getAbsoluteDay(n),
|
|
322
|
+
"can-update": t.canUpdate,
|
|
323
|
+
"fee-currency": t.ladder.items.value[n]?.feeCurrency,
|
|
324
|
+
"fee-field": e.feeAmount,
|
|
325
|
+
"fee-percentage-field": e.feePercentage,
|
|
326
|
+
"fee-type-field": e.feeType,
|
|
327
|
+
level: n + 1,
|
|
328
|
+
"offset-field": e.offsetDays,
|
|
329
|
+
"schedule-field": e.schedule,
|
|
330
|
+
"schedule-items": t.scheduleItems,
|
|
331
|
+
onCommitOffset: (e) => t.ladder.commitOffset(n, e),
|
|
332
|
+
onUpdateOffset: (e) => t.ladder.updateOffset(n, e),
|
|
333
|
+
onUpdateOffsetFromInput: (e) => t.ladder.updateOffsetFromInput(n, e),
|
|
334
|
+
onUpdateSchedule: (e) => t.ladder.updateSchedule(n, e)
|
|
335
|
+
}, null, 8, [
|
|
336
|
+
"absolute-day",
|
|
337
|
+
"can-update",
|
|
338
|
+
"fee-currency",
|
|
339
|
+
"fee-field",
|
|
340
|
+
"fee-percentage-field",
|
|
341
|
+
"fee-type-field",
|
|
342
|
+
"level",
|
|
343
|
+
"offset-field",
|
|
344
|
+
"schedule-field",
|
|
345
|
+
"schedule-items",
|
|
346
|
+
"onCommitOffset",
|
|
347
|
+
"onUpdateOffset",
|
|
348
|
+
"onUpdateOffsetFromInput",
|
|
349
|
+
"onUpdateSchedule"
|
|
350
|
+
]))), 128))]),
|
|
351
|
+
x(ye)
|
|
352
|
+
]));
|
|
353
|
+
}
|
|
354
|
+
}), Xe = { class: "flex flex-wrap items-center gap-xl" }, Ze = { class: "text-xs text-secondary" }, Y = /* @__PURE__ */ S({
|
|
355
|
+
__name: "ReminderTemplateTabs",
|
|
356
|
+
props: /*@__PURE__*/ C({
|
|
357
|
+
caption: {},
|
|
358
|
+
items: {}
|
|
359
|
+
}, {
|
|
360
|
+
modelValue: { required: !0 },
|
|
361
|
+
modelModifiers: {}
|
|
362
|
+
}),
|
|
363
|
+
emits: ["update:modelValue"],
|
|
364
|
+
setup(e) {
|
|
365
|
+
let t = e, n = N(e, "modelValue"), r = p();
|
|
366
|
+
function i(e) {
|
|
367
|
+
return e.hasMissingContent ? `${e.label}, ${r.t("module.dunning_case.settings.templates.missing")}` : e.label;
|
|
368
|
+
}
|
|
369
|
+
return (e, r) => (O(), v("div", Xe, [y("p", Ze, j(t.caption), 1), x(M(H), {
|
|
370
|
+
modelValue: n.value,
|
|
371
|
+
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
372
|
+
"aria-label": t.caption,
|
|
373
|
+
variant: "button-brand"
|
|
374
|
+
}, {
|
|
375
|
+
default: P(() => [x(M(W), null, {
|
|
376
|
+
default: P(() => [(O(!0), v(m, null, A(t.items, (e) => (O(), g(M(U), {
|
|
377
|
+
key: e.value,
|
|
378
|
+
"aria-label": i(e),
|
|
379
|
+
config: e.hasMissingContent ? { indicator: {
|
|
380
|
+
type: "dot",
|
|
381
|
+
color: "error"
|
|
382
|
+
} } : null,
|
|
383
|
+
label: e.label,
|
|
384
|
+
value: e.value
|
|
385
|
+
}, null, 8, [
|
|
386
|
+
"aria-label",
|
|
387
|
+
"config",
|
|
388
|
+
"label",
|
|
389
|
+
"value"
|
|
390
|
+
]))), 128))]),
|
|
391
|
+
_: 1
|
|
392
|
+
})]),
|
|
393
|
+
_: 1
|
|
394
|
+
}, 8, ["modelValue", "aria-label"])]));
|
|
395
|
+
}
|
|
396
|
+
}), 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 = {
|
|
397
|
+
key: 0,
|
|
398
|
+
class: "flex flex-col gap-md p-3xl"
|
|
399
|
+
}, it = /* @__PURE__ */ S({
|
|
400
|
+
__name: "ReminderTemplatesPanel",
|
|
401
|
+
props: /*@__PURE__*/ C({
|
|
402
|
+
bodyField: {},
|
|
403
|
+
canUpdate: { type: Boolean },
|
|
404
|
+
cardTitle: {},
|
|
405
|
+
levelItems: {},
|
|
406
|
+
localeItems: {},
|
|
407
|
+
subjectField: {}
|
|
408
|
+
}, {
|
|
409
|
+
activeLevel: { required: !0 },
|
|
410
|
+
activeLevelModifiers: {},
|
|
411
|
+
activeLocale: { required: !0 },
|
|
412
|
+
activeLocaleModifiers: {}
|
|
413
|
+
}),
|
|
414
|
+
emits: ["update:activeLevel", "update:activeLocale"],
|
|
415
|
+
setup(e) {
|
|
416
|
+
let t = e, n = N(e, "activeLevel"), r = N(e, "activeLocale"), i = p();
|
|
417
|
+
return (e, a) => (O(), v("div", Qe, [y("div", $e, [x(Y, {
|
|
418
|
+
modelValue: n.value,
|
|
419
|
+
"onUpdate:modelValue": a[0] ||= (e) => n.value = e,
|
|
420
|
+
caption: M(i).t("module.dunning_case.settings.templates.selector"),
|
|
421
|
+
items: t.levelItems
|
|
422
|
+
}, null, 8, [
|
|
423
|
+
"modelValue",
|
|
424
|
+
"caption",
|
|
425
|
+
"items"
|
|
426
|
+
]), x(Y, {
|
|
427
|
+
modelValue: r.value,
|
|
428
|
+
"onUpdate:modelValue": a[1] ||= (e) => r.value = e,
|
|
429
|
+
caption: M(i).t("module.dunning_case.settings.templates.language"),
|
|
430
|
+
items: t.localeItems
|
|
431
|
+
}, null, 8, [
|
|
432
|
+
"modelValue",
|
|
433
|
+
"caption",
|
|
434
|
+
"items"
|
|
435
|
+
])]), 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), {
|
|
436
|
+
"is-disabled": !t.canUpdate,
|
|
437
|
+
"is-required": !0,
|
|
438
|
+
label: M(i).t("module.dunning_case.settings.templates.subject"),
|
|
439
|
+
size: "sm"
|
|
440
|
+
}), null, 16, ["is-disabled", "label"]), x(M(ae), w(M(d)(t.bodyField), {
|
|
441
|
+
"is-disabled": !t.canUpdate,
|
|
442
|
+
"is-required": !0,
|
|
443
|
+
label: M(i).t("module.dunning_case.settings.templates.content"),
|
|
444
|
+
"min-height": "var(--spacing-11xl)",
|
|
445
|
+
resize: "auto-vertical",
|
|
446
|
+
size: "sm"
|
|
447
|
+
}), null, 16, ["is-disabled", "label"])])) : _("", !0)])]));
|
|
448
|
+
}
|
|
449
|
+
}), X = class {
|
|
450
|
+
static commitReminder(e, t, n) {
|
|
451
|
+
if (t === void 0) return e.slice();
|
|
452
|
+
let r = e.slice();
|
|
453
|
+
return r[n] = { ...t }, r;
|
|
454
|
+
}
|
|
455
|
+
static getAbsoluteDay(e, t) {
|
|
456
|
+
let n = 0;
|
|
457
|
+
for (let r of t.slice(0, e + 1)) r.schedule === a.AFTER_DUE_DATE ? n = r.offsetDays : n += r.offsetDays;
|
|
458
|
+
return n;
|
|
459
|
+
}
|
|
460
|
+
}, at = 60, Z = 15;
|
|
461
|
+
function Q(e) {
|
|
462
|
+
let t = k([]);
|
|
463
|
+
function n(e) {
|
|
464
|
+
return X.getAbsoluteDay(e, t.value);
|
|
465
|
+
}
|
|
466
|
+
let r = h(() => {
|
|
467
|
+
let t = e.items.value.length - 1, r = t < 0 ? 0 : n(t), i = Math.ceil(r / Z) * Z;
|
|
468
|
+
return Math.max(at, i);
|
|
469
|
+
}), i = h(() => e.items.value.map((e, t) => ({
|
|
470
|
+
absoluteDay: n(t),
|
|
471
|
+
minimumDay: t === 0 ? 1 : n(t - 1) + 1,
|
|
472
|
+
sequence: e.sequence
|
|
473
|
+
})));
|
|
474
|
+
function o() {
|
|
475
|
+
t.value = e.items.value.map((e) => ({
|
|
476
|
+
offsetDays: e.offsetDays,
|
|
477
|
+
schedule: e.schedule
|
|
478
|
+
}));
|
|
479
|
+
}
|
|
480
|
+
function s(n, r) {
|
|
481
|
+
let i = e.items.value[n];
|
|
482
|
+
i !== void 0 && (t.value = X.commitReminder(t.value, {
|
|
483
|
+
offsetDays: r ?? i.offsetDays,
|
|
484
|
+
schedule: i.schedule
|
|
485
|
+
}, n));
|
|
486
|
+
}
|
|
487
|
+
function c(t, n) {
|
|
488
|
+
let r = n?.target, i;
|
|
489
|
+
if (r instanceof HTMLInputElement) {
|
|
490
|
+
let n = Number(r.value);
|
|
491
|
+
Number.isFinite(n) && (i = n, e.fields[t]?.offsetDays["onUpdate:modelValue"](n));
|
|
492
|
+
}
|
|
493
|
+
e.fields[t]?.offsetDays.onBlur(), T(() => s(t, i));
|
|
494
|
+
}
|
|
495
|
+
function l(t, n) {
|
|
496
|
+
let r = n.target;
|
|
497
|
+
if (!(r instanceof HTMLInputElement)) return;
|
|
498
|
+
let i = Number(r.value);
|
|
499
|
+
Number.isFinite(i) && e.fields[t]?.offsetDays["onUpdate:modelValue"](i);
|
|
500
|
+
}
|
|
501
|
+
function u(t, n) {
|
|
502
|
+
e.fields[t]?.offsetDays["onUpdate:modelValue"](n), s(t, n ?? void 0);
|
|
503
|
+
}
|
|
504
|
+
function d(t, n) {
|
|
505
|
+
e.fields[t]?.schedule["onUpdate:modelValue"](n), s(t);
|
|
506
|
+
}
|
|
507
|
+
function f(t, i) {
|
|
508
|
+
let o = e.items.value[t], c = e.fields[t]?.offsetDays;
|
|
509
|
+
if (o === void 0 || c === void 0 || !e.canUpdate.value) return;
|
|
510
|
+
let l = t === 0 ? 0 : n(t - 1), u = o.schedule === a.AFTER_DUE_DATE ? 1 : l + 1, d = Math.min(r.value, Math.max(u, i)), f = o.schedule === a.AFTER_DUE_DATE ? d : d - l;
|
|
511
|
+
c.setValue(f), s(t);
|
|
512
|
+
}
|
|
513
|
+
return {
|
|
514
|
+
commitOffset: c,
|
|
515
|
+
getAbsoluteDay: n,
|
|
516
|
+
items: e.items,
|
|
517
|
+
markers: i,
|
|
518
|
+
reset: o,
|
|
519
|
+
setAbsoluteDay: f,
|
|
520
|
+
timelineDays: r,
|
|
521
|
+
updateOffset: u,
|
|
522
|
+
updateOffsetFromInput: l,
|
|
523
|
+
updateSchedule: d
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
//#endregion
|
|
527
|
+
//#region src/modules/dunning-case/use-cases/settings/views/ReminderSettingsView.vue?vue&type=script&setup=true&lang.ts
|
|
528
|
+
var ot = { class: "mx-auto w-full max-w-340" }, st = { class: "flex flex-col gap-lg sm:flex-row sm:items-start sm:justify-between" }, ct = { class: "text-md font-semibold text-primary" }, lt = { class: "mt-xs text-sm text-secondary" }, ut = /* @__PURE__ */ S({
|
|
529
|
+
__name: "ReminderSettingsView",
|
|
530
|
+
props: { reminderConfigs: {} },
|
|
531
|
+
setup(e) {
|
|
532
|
+
let t = e, n = [
|
|
533
|
+
0,
|
|
534
|
+
1,
|
|
535
|
+
2
|
|
536
|
+
], r = [
|
|
537
|
+
"en-US",
|
|
538
|
+
"nl-BE",
|
|
539
|
+
"fr-BE"
|
|
540
|
+
], s = [a.AFTER_DUE_DATE, a.AFTER_LAST_REMINDER], c = p(), l = K(), u = i(), d = le(), f = k("ladder"), m = k(0), v = k("en-US");
|
|
541
|
+
u.set(() => c.t("module.dunning_case.settings.title"));
|
|
542
|
+
let b = ce({
|
|
543
|
+
initialState: h(() => o.reminderConfigsToForm(t.reminderConfigs)),
|
|
544
|
+
schema: de,
|
|
545
|
+
onSubmit: async (e) => {
|
|
546
|
+
let t = await d.execute({ body: e });
|
|
547
|
+
if (t.isErr()) {
|
|
548
|
+
l.apiError(t.error);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
l.show({ message: c.t("module.dunning_case.settings.saved") });
|
|
552
|
+
},
|
|
553
|
+
onSubmitError: () => {
|
|
554
|
+
l.unableToSave();
|
|
555
|
+
}
|
|
556
|
+
}), S = b.registerArray("reminders"), C = n.map((e) => {
|
|
557
|
+
let t = S.register(`${e}`), n = t.register("template");
|
|
558
|
+
return {
|
|
559
|
+
feeAmount: t.register("feeAmount"),
|
|
560
|
+
feePercentage: t.register("feePercentage"),
|
|
561
|
+
feeType: t.register("feeType"),
|
|
562
|
+
locales: {
|
|
563
|
+
"en-US": {
|
|
564
|
+
body: n.register("en-US").register("body"),
|
|
565
|
+
subject: n.register("en-US").register("subject")
|
|
566
|
+
},
|
|
567
|
+
"fr-BE": {
|
|
568
|
+
body: n.register("fr-BE").register("body"),
|
|
569
|
+
subject: n.register("fr-BE").register("subject")
|
|
570
|
+
},
|
|
571
|
+
"nl-BE": {
|
|
572
|
+
body: n.register("nl-BE").register("body"),
|
|
573
|
+
subject: n.register("nl-BE").register("subject")
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
offsetDays: t.register("offsetDays"),
|
|
577
|
+
schedule: t.register("schedule")
|
|
578
|
+
};
|
|
579
|
+
}), w = k(!0), T = h(() => G(s)), E = Q({
|
|
580
|
+
canUpdate: w,
|
|
581
|
+
fields: C,
|
|
582
|
+
items: h(() => (b.state.value.reminders ?? []).map((e, t) => ({
|
|
583
|
+
feeCurrency: e?.feeCurrency,
|
|
584
|
+
offsetDays: e?.offsetDays ?? 0,
|
|
585
|
+
schedule: e?.schedule ?? a.AFTER_DUE_DATE,
|
|
586
|
+
sequence: e?.sequence ?? t + 1
|
|
587
|
+
})))
|
|
588
|
+
}), D = h({
|
|
589
|
+
get: () => String(m.value),
|
|
590
|
+
set: (e) => {
|
|
591
|
+
let t = Number(e);
|
|
592
|
+
Number.isInteger(t) && t >= 0 && t < C.length && (m.value = t);
|
|
593
|
+
}
|
|
594
|
+
}), A = h({
|
|
595
|
+
get: () => v.value,
|
|
596
|
+
set: (e) => {
|
|
597
|
+
let t = r.find((t) => t === e);
|
|
598
|
+
t !== void 0 && (v.value = t);
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
function N(e, t) {
|
|
602
|
+
let n = b.state.value.reminders?.[e]?.template?.[t];
|
|
603
|
+
return n === void 0 || fe(n);
|
|
604
|
+
}
|
|
605
|
+
let F = h(() => C[m.value]?.locales[v.value]), I = h(() => C.map((e, t) => ({
|
|
606
|
+
hasMissingContent: N(t, v.value),
|
|
607
|
+
label: c.t("module.dunning_case.level.reminder", { level: t + 1 }),
|
|
608
|
+
value: String(t)
|
|
609
|
+
}))), L = h(() => r.map((e) => ({
|
|
610
|
+
hasMissingContent: N(m.value, e),
|
|
611
|
+
label: c.t(`module.dunning_case.settings.locale.${e}`),
|
|
612
|
+
value: e
|
|
613
|
+
}))), z = h(() => c.t("module.dunning_case.settings.templates.card_title", {
|
|
614
|
+
language: c.t(`module.dunning_case.settings.locale_name.${v.value}`),
|
|
615
|
+
level: m.value + 1
|
|
616
|
+
}));
|
|
617
|
+
return ee(() => t.reminderConfigs, E.reset, { immediate: !0 }), (e, t) => (O(), g(M(te), {
|
|
618
|
+
title: M(c).t("module.dunning_case.settings.title"),
|
|
619
|
+
subtitle: M(c).t("module.dunning_case.settings.subtitle")
|
|
620
|
+
}, {
|
|
621
|
+
default: P(() => [x(M(ne), null, {
|
|
622
|
+
default: P(() => [x(M(re), {
|
|
623
|
+
form: M(b),
|
|
624
|
+
"prompt-on-unsaved-changes": !0
|
|
625
|
+
}, {
|
|
626
|
+
default: P(() => [y("div", ot, [
|
|
627
|
+
y("div", st, [y("div", null, [y("h2", ct, j(M(c).t("module.dunning_case.settings.title")), 1), y("p", lt, j(M(c).t("module.dunning_case.settings.subtitle")), 1)]), w.value ? (O(), g(M(R), {
|
|
628
|
+
key: 0,
|
|
629
|
+
"is-disabled": !M(b).isDirty.value || !M(b).isValid.value,
|
|
630
|
+
"is-loading": M(b).isSubmitting.value,
|
|
631
|
+
label: M(c).t("shared.save_changes"),
|
|
632
|
+
onClick: M(b).submit
|
|
633
|
+
}, null, 8, [
|
|
634
|
+
"is-disabled",
|
|
635
|
+
"is-loading",
|
|
636
|
+
"label",
|
|
637
|
+
"onClick"
|
|
638
|
+
])) : _("", !0)]),
|
|
639
|
+
x(M(H), {
|
|
640
|
+
modelValue: f.value,
|
|
641
|
+
"onUpdate:modelValue": t[0] ||= (e) => f.value = e,
|
|
642
|
+
"aria-label": M(c).t("module.dunning_case.settings.navigation"),
|
|
643
|
+
class: "mt-xl",
|
|
644
|
+
variant: "button-border"
|
|
645
|
+
}, {
|
|
646
|
+
default: P(() => [x(M(W), null, {
|
|
647
|
+
default: P(() => [x(M(U), {
|
|
648
|
+
label: M(c).t("module.dunning_case.settings.ladder.tab"),
|
|
649
|
+
value: "ladder"
|
|
650
|
+
}, null, 8, ["label"]), x(M(U), {
|
|
651
|
+
label: M(c).t("module.dunning_case.settings.templates.tab"),
|
|
652
|
+
value: "templates"
|
|
653
|
+
}, null, 8, ["label"])]),
|
|
654
|
+
_: 1
|
|
655
|
+
})]),
|
|
656
|
+
_: 1
|
|
657
|
+
}, 8, ["modelValue", "aria-label"]),
|
|
658
|
+
f.value === "ladder" ? (O(), g(Ye, {
|
|
659
|
+
key: 0,
|
|
660
|
+
"can-update": w.value,
|
|
661
|
+
fields: M(C),
|
|
662
|
+
ladder: M(E),
|
|
663
|
+
"schedule-items": T.value
|
|
664
|
+
}, null, 8, [
|
|
665
|
+
"can-update",
|
|
666
|
+
"fields",
|
|
667
|
+
"ladder",
|
|
668
|
+
"schedule-items"
|
|
669
|
+
])) : (O(), g(it, {
|
|
670
|
+
key: 1,
|
|
671
|
+
"active-level": D.value,
|
|
672
|
+
"onUpdate:activeLevel": t[1] ||= (e) => D.value = e,
|
|
673
|
+
"active-locale": A.value,
|
|
674
|
+
"onUpdate:activeLocale": t[2] ||= (e) => A.value = e,
|
|
675
|
+
"body-field": F.value?.body,
|
|
676
|
+
"can-update": w.value,
|
|
677
|
+
"card-title": z.value,
|
|
678
|
+
"level-items": I.value,
|
|
679
|
+
"locale-items": L.value,
|
|
680
|
+
"subject-field": F.value?.subject
|
|
681
|
+
}, null, 8, [
|
|
682
|
+
"active-level",
|
|
683
|
+
"active-locale",
|
|
684
|
+
"body-field",
|
|
685
|
+
"can-update",
|
|
686
|
+
"card-title",
|
|
687
|
+
"level-items",
|
|
688
|
+
"locale-items",
|
|
689
|
+
"subject-field"
|
|
690
|
+
]))
|
|
691
|
+
])]),
|
|
692
|
+
_: 1
|
|
693
|
+
}, 8, ["form"])]),
|
|
694
|
+
_: 1
|
|
695
|
+
})]),
|
|
696
|
+
_: 1
|
|
697
|
+
}, 8, ["title", "subtitle"]));
|
|
698
|
+
}
|
|
699
|
+
}), dt = /*@__PURE__*/ S({
|
|
700
|
+
__name: "ReminderSettingsViewDataProvider",
|
|
701
|
+
setup(e) {
|
|
702
|
+
let t = l();
|
|
703
|
+
return (e, n) => (O(), g(u, { queries: { reminderConfigs: M(t) } }, {
|
|
704
|
+
default: P(({ data: e }) => [x(ut, { "reminder-configs": e.reminderConfigs }, null, 8, ["reminder-configs"])]),
|
|
705
|
+
loading: P(() => [x(M(z), { breadcrumbs: [] })]),
|
|
706
|
+
_: 1
|
|
707
|
+
}, 8, ["queries"]));
|
|
708
|
+
}
|
|
709
|
+
}), ft = /* @__PURE__ */ e({ default: () => $ }), $ = dt;
|
|
710
|
+
//#endregion
|
|
711
|
+
export { ft as n, $ as t };
|