@wisemen/wise-invoicing-web 0.20.0 → 1.0.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 (102) hide show
  1. package/dist/ApprovalReminderSettingsViewDataProvider-DyrHExKn.js +962 -0
  2. package/dist/{BillingDocumentDetailViewDataProvider-jpp-QwPi.js → BillingDocumentDetailViewDataProvider-kFzqhrxW.js} +1563 -1550
  3. package/dist/{BillingDocumentPdf-Zw3GXZVE.js → BillingDocumentPdf-Dp6HSypy.js} +5 -5
  4. package/dist/{DunningCaseSendDialog-CA-nzjzV.js → DunningCaseSendDialog-1S6OD9wd.js} +36 -36
  5. package/dist/{InvoiceApprovalOutOfSyncIndicator-Dnw03isr.js → InvoiceApprovalOutOfSyncIndicator-DaM5hQVT.js} +16 -13
  6. package/dist/{InvoiceApprovalOverviewView-CoJXggOy.js → InvoiceApprovalOverviewView-DM_LiO19.js} +210 -210
  7. package/dist/{InvoiceApprovalStatusBadge-BWx3Fhuy.js → InvoiceApprovalStatusBadge-mbYHYU3x.js} +6 -6
  8. package/dist/{InvoicePdfView-Bv5aMLh6.js → InvoicePdfView-YbDJpTIA.js} +2 -2
  9. package/dist/{InvoicePublicProFormaPdfViewDataProvider-Ca7-AmAH.js → InvoicePublicProFormaPdfViewDataProvider-BgAhcvB6.js} +3 -3
  10. package/dist/InvoiceRejectDialogDataProvider-yegAlkDB.js +410 -0
  11. package/dist/{InvoiceStatusBadge-uXAh9ypU.js → InvoiceStatusBadge-Bo5PDjEy.js} +3 -3
  12. package/dist/{InvoicingFileUploadProvider-C3cyIUhL.js → InvoicingFileUploadProvider-DVh22OUB.js} +2 -2
  13. package/dist/{IssuerSettingsViewDataProvider-C-CRF9sK.js → IssuerSettingsViewDataProvider-BgSFemZr.js} +4 -4
  14. package/dist/{PeppolSettingsViewDataProvider-COQEInsh.js → PeppolSettingsViewDataProvider-_Bx0xx9e.js} +3 -3
  15. package/dist/ReminderTemplatesPanel-DxmfU2xK.js +103 -0
  16. package/dist/{api.util-DSerLsgA.js → api.util-lGbimoKL.js} +575 -446
  17. package/dist/{billingDocumentDetail.transformer-ClWwi8h4.js → billingDocumentDetail.transformer-C5-zjIhL.js} +13 -4
  18. package/dist/client/index.d.ts +2 -2
  19. package/dist/client/sdk.gen.d.ts +8 -3
  20. package/dist/client/types.gen.d.ts +316 -49
  21. package/dist/client/zod.gen.d.ts +1465 -71
  22. package/dist/{creditNoteDetail.query-q1b6nzu0.js → creditNoteDetail.query-CqJeWeRV.js} +23 -23
  23. package/dist/{customFieldDefinitionIndex.query-DQxer9Je.js → customFieldDefinitionIndex.query-Co7hoMow.js} +65 -56
  24. package/dist/{deliveryReason.util-BlxvUaz0.js → deliveryReason.util-ny1rA7Sm.js} +6 -6
  25. package/dist/{dist-47-1LAzT.js → dist-CrNFh-CR.js} +59 -59
  26. package/dist/{dist-B33lNwLw.js → dist-DmVrfBOT.js} +149 -79
  27. package/dist/{documentTitle.composable-D5uPh3uG.js → documentTitle.composable-aTEYXgaZ.js} +1 -1
  28. package/dist/html.util-vG4ow95N.js +52 -0
  29. package/dist/{i18n.lib-DB15VQsH.js → i18n.lib-B1H9r0km.js} +196 -26
  30. package/dist/index.d.ts +182 -12
  31. package/dist/index.js +1638 -1479
  32. package/dist/{invoice.service-BKgP2p8z.js → invoice.service-D9ubyWPb.js} +245 -203
  33. package/dist/invoiceApproval.service-BtDIOHIo.js +182 -0
  34. package/dist/{invoiceApprovalStatus.util-D17DWEh1.js → invoiceApprovalStatus.util-Bqq_bILG.js} +2 -2
  35. package/dist/{invoiceCustomer.service-CLYUR6vc.js → invoiceCustomer.service-D0AtVrLg.js} +6 -6
  36. package/dist/{invoiceDetail.query-CzyZqT82.js → invoiceDetail.query-BNL6MkvC.js} +1 -1
  37. package/dist/{invoicingConfig.composable-CzgTMtog.js → invoicingConfig.composable-DEF0lzNP.js} +2 -2
  38. package/dist/{issuerSettings.query-D8T34N7f.js → issuerSettings.query-Cu-I6OAg.js} +5 -5
  39. package/dist/libs/i18n.lib.d.ts +182 -12
  40. package/dist/locales/en-US.json.d.ts +98 -13
  41. package/dist/locales/nl-BE.json.d.ts +98 -13
  42. package/dist/models/billing-document/billingDocumentDetail.model.d.ts +2 -2
  43. package/dist/models/file-reference/fileReference.transformer.d.ts +3 -0
  44. package/dist/modules/invoice/api/mutations/invoiceApprovalUpdate.mutation.d.ts +16 -0
  45. package/dist/modules/invoice/api/mutations/invoiceApproveApproval.mutation.d.ts +2 -2
  46. package/dist/modules/invoice/api/mutations/invoiceRejectApproval.mutation.d.ts +2 -2
  47. package/dist/modules/invoice/api/mutations/invoiceSetApprovalMode.mutation.d.ts +7 -0
  48. package/dist/modules/invoice/api/services/invoice.service.d.ts +4 -2
  49. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalMode.model.d.ts +3 -0
  50. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalMode.transformer.d.ts +6 -0
  51. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalModeForm.model.d.ts +7 -0
  52. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalNote.model.d.ts +2 -0
  53. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalUpdate.transformer.d.ts +7 -0
  54. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalUpdateForm.model.d.ts +13 -0
  55. package/dist/modules/invoice/models/invoice/approval/invoiceApprove.transformer.d.ts +3 -0
  56. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.d.ts +2 -2
  57. package/dist/modules/invoice/models/invoice/approval/invoiceReject.transformer.d.ts +3 -0
  58. package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.d.ts +2 -2
  59. package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +5 -0
  60. package/dist/modules/invoice/models/invoice/invoiceStatus.util.d.ts +1 -0
  61. package/dist/modules/invoice/use-cases/detail/components/InvoiceApprovalBanner.vue.d.ts +13 -0
  62. package/dist/modules/invoice/use-cases/detail/composables/invoiceDetailHeaderActions.composable.d.ts +2 -0
  63. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalModeDialog.vue.d.ts +13 -0
  64. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalUpdateDialog.vue.d.ts +16 -0
  65. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue.d.ts +4 -0
  66. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceRejectDialog.vue.d.ts +4 -0
  67. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceRejectDialogDataProvider.vue.d.ts +13 -0
  68. package/dist/modules/invoice-approval/api/mutations/approvalFollowUpPauseCreate.mutation.d.ts +7 -0
  69. package/dist/modules/invoice-approval/api/mutations/approvalFollowUpPauseDelete.mutation.d.ts +4 -0
  70. package/dist/modules/invoice-approval/api/mutations/approvalFollowUpPauseUpdate.mutation.d.ts +10 -0
  71. package/dist/modules/invoice-approval/api/mutations/approvalMailTemplateUpdate.mutation.d.ts +14 -0
  72. package/dist/modules/invoice-approval/api/mutations/approvalReminderConfigUpdate.mutation.d.ts +14 -1
  73. package/dist/modules/invoice-approval/api/queries/approvalFollowUpPauseIndex.query.d.ts +2 -0
  74. package/dist/modules/invoice-approval/api/queries/approvalReminderConfig.query.d.ts +1 -1
  75. package/dist/modules/invoice-approval/api/query-keys/invoiceApproval.queryKeys.d.ts +9 -2
  76. package/dist/modules/invoice-approval/api/services/invoiceApproval.service.d.ts +10 -2
  77. package/dist/modules/invoice-approval/models/approvalFollowUpPause.model.d.ts +11 -0
  78. package/dist/modules/invoice-approval/models/approvalFollowUpPause.transformer.d.ts +11 -0
  79. package/dist/modules/invoice-approval/models/approvalFollowUpPauseForm.model.d.ts +11 -0
  80. package/dist/modules/invoice-approval/models/approvalMailTemplate.transformer.d.ts +6 -0
  81. package/dist/modules/invoice-approval/models/approvalMailTemplate.transformer.spec.d.ts +1 -0
  82. package/dist/modules/invoice-approval/models/approvalMailTemplateForm.model.d.ts +18 -0
  83. package/dist/modules/invoice-approval/models/approvalReminderConfigForm.model.d.ts +15 -2
  84. package/dist/modules/invoice-approval/models/approvalSettingsForm.model.d.ts +39 -0
  85. package/dist/modules/invoice-approval/models/approvalSettingsForm.spec.d.ts +1 -0
  86. package/dist/modules/invoice-approval/use-cases/settings/components/ApprovalFollowUpPauseList.vue.d.ts +20 -0
  87. package/dist/modules/invoice-approval/use-cases/settings/components/ApprovalFollowUpPauseRow.vue.d.ts +20 -0
  88. package/dist/modules/invoice-approval/use-cases/settings/components/ApprovalFollowUpPausesPanel.vue.d.ts +7 -0
  89. package/dist/modules/invoice-approval/use-cases/settings/composables/approvalFollowUpPauseDialogs.composable.d.ts +8 -0
  90. package/dist/modules/invoice-approval/use-cases/settings/dialogs/ApprovalFollowUpPauseDeleteDialog.vue.d.ts +11 -0
  91. package/dist/modules/invoice-approval/use-cases/settings/dialogs/ApprovalFollowUpPauseFormDialog.vue.d.ts +14 -0
  92. package/dist/modules/invoice-approval/use-cases/settings/views/ApprovalReminderSettingsView.vue.d.ts +2 -1
  93. package/dist/modules/invoice-approval/utils/approvalFollowUpPausePeriod.util.d.ts +41 -0
  94. package/dist/modules/invoice-approval/utils/approvalFollowUpPausePeriod.util.spec.d.ts +1 -0
  95. package/dist/{reminderConfig.query-CFmCWWlO.js → reminderConfig.query-DHMHVOeX.js} +62 -109
  96. package/dist/style.css +1 -1
  97. package/package.json +1 -1
  98. package/dist/ApprovalReminderSettingsViewDataProvider-DMWLX53_.js +0 -147
  99. package/dist/InvoiceRejectDialog-Ca-4nz4U.js +0 -361
  100. package/dist/invoiceApproval.service-oT1fvhsW.js +0 -73
  101. package/dist/modules/invoice/api/mutations/invoiceMarkAsPriorApprovalRequired.mutation.d.ts +0 -4
  102. package/dist/modules/invoice/api/mutations/invoiceUnmarkAsPriorApprovalRequired.mutation.d.ts +0 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wisemen/wise-invoicing-web",
3
3
  "type": "module",
4
- "version": "0.20.0",
4
+ "version": "1.0.0",
5
5
  "private": false,
6
6
  "description": "Invoicing frontend package with Vue 3 components, composables and types",
7
7
  "author": "Wisemen",
@@ -1,147 +0,0 @@
1
- import { t as e } from "./i18n.lib-DB15VQsH.js";
2
- import "./api.util-DSerLsgA.js";
3
- import { c as t, t as n } from "./documentTitle.composable-D5uPh3uG.js";
4
- import { t as r } from "./formango.util-D5c2ql--.js";
5
- import { t as i } from "./DataProvider-BtnD-BzI.js";
6
- import { n as a, t as o } from "./invoiceApproval.service-oT1fvhsW.js";
7
- import { z as s } from "zod";
8
- import { useI18n as c } from "vue-i18n";
9
- import { Fragment as l, computed as u, createBlock as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, mergeProps as g, openBlock as _, renderList as v, unref as y, withCtx as b } from "vue";
10
- import { useMutation as x, useQuery as S } from "@wisemen/vue-core-api-utils";
11
- import { UIDashboardPage as C, UIDashboardPageContent as w, UIDashboardPageLoadingState as T, UIForm as E, UIFormSubmitButton as D, UINumberField as O, UISelect as k, UIText as A, createSelectOptions as j, useToast as M } from "@wisemen/vue-core-design-system";
12
- import { useForm as N } from "formango";
13
- //#region src/modules/invoice-approval/api/queries/approvalReminderConfig.query.ts
14
- function P() {
15
- return S("approvalReminderConfig", {
16
- params: {},
17
- queryFn: () => o.getReminderConfigs()
18
- });
19
- }
20
- //#endregion
21
- //#region src/modules/invoice-approval/api/mutations/approvalReminderConfigUpdate.mutation.ts
22
- function F() {
23
- return x({
24
- queryFn: (e) => o.updateReminderConfigs(e.body),
25
- queryKeysToInvalidate: { approvalReminderConfig: {} }
26
- });
27
- }
28
- //#endregion
29
- //#region src/modules/invoice-approval/models/approvalReminderConfigForm.model.ts
30
- var I = 2, L = s.object({
31
- offsetDays: s.number().int().min(1).max(365),
32
- schedule: s.enum(t),
33
- sequence: s.number().int().min(1).max(I),
34
- template: s.custom()
35
- }), R = s.object({ reminders: s.array(L).length(I) }).superRefine((n, r) => {
36
- n.reminders[0]?.schedule !== t.AFTER_APPROVAL_REQUEST && r.addIssue({
37
- code: "custom",
38
- message: e.global.t("wise_invoicing.invoice_approval.settings.validation.level_one_after_request"),
39
- path: [
40
- "reminders",
41
- 0,
42
- "schedule"
43
- ]
44
- }), n.reminders[1]?.schedule !== t.AFTER_LAST_REMINDER && r.addIssue({
45
- code: "custom",
46
- message: e.global.t("wise_invoicing.invoice_approval.settings.validation.level_two_after_reminder"),
47
- path: [
48
- "reminders",
49
- 1,
50
- "schedule"
51
- ]
52
- });
53
- let i = 0;
54
- for (let [a, o] of n.reminders.entries()) {
55
- let n = o.schedule === t.AFTER_APPROVAL_REQUEST ? o.offsetDays : i + o.offsetDays;
56
- a > 0 && n <= i && r.addIssue({
57
- code: "custom",
58
- message: e.global.t("wise_invoicing.invoice_approval.settings.validation.chronological"),
59
- path: [
60
- "reminders",
61
- a,
62
- "offsetDays"
63
- ]
64
- }), i = n;
65
- }
66
- }), z = { class: "flex max-w-200 flex-col gap-2xl" }, B = { class: "grid grid-cols-1 gap-lg md:grid-cols-2" }, V = { class: "flex justify-end" }, H = /* @__PURE__ */ h({
67
- __name: "ApprovalReminderSettingsView",
68
- props: { reminderConfigs: {} },
69
- setup(e) {
70
- let i = e, o = [{
71
- index: 0,
72
- labelKey: "wise_invoicing.invoice.approval_status.r1"
73
- }, {
74
- index: 1,
75
- labelKey: "wise_invoicing.invoice.approval_status.r2"
76
- }], s = {
77
- [t.AFTER_APPROVAL_REQUEST]: "wise_invoicing.invoice_approval.settings.schedule.after_approval_request",
78
- [t.AFTER_LAST_REMINDER]: "wise_invoicing.invoice_approval.settings.schedule.after_last_reminder"
79
- }, h = c(), x = M(), S = n(), T = F();
80
- S.set(() => h.t("wise_invoicing.invoice_approval.settings.title"));
81
- let P = N({
82
- initialState: u(() => a.toForm(i.reminderConfigs)),
83
- schema: R,
84
- onSubmit: async (e) => {
85
- let t = await T.execute({ body: e });
86
- t.isErr() ? x.apiError(t.error) : x.show({ message: h.t("wise_invoicing.invoice_approval.settings.success") });
87
- },
88
- onSubmitError: () => {
89
- x.unableToSave();
90
- }
91
- }), I = P.registerArray("reminders"), L = o.map((e) => {
92
- let t = I.register(`${e.index}`);
93
- return {
94
- offsetDays: t.register("offsetDays"),
95
- schedule: t.register("schedule")
96
- };
97
- });
98
- function H(e) {
99
- return j([e === 0 ? t.AFTER_APPROVAL_REQUEST : t.AFTER_LAST_REMINDER]);
100
- }
101
- function U(e) {
102
- return h.t(s[e]);
103
- }
104
- return (e, t) => (_(), d(y(C), {
105
- description: y(h).t("wise_invoicing.invoice_approval.settings.description"),
106
- title: y(h).t("wise_invoicing.invoice_approval.settings.title")
107
- }, {
108
- default: b(() => [m(y(E), { form: y(P) }, {
109
- default: b(() => [m(y(w), null, {
110
- default: b(() => [p("div", z, [(_(), f(l, null, v(o, (e) => p("div", {
111
- key: e.index,
112
- class: "flex flex-col gap-md"
113
- }, [m(y(A), {
114
- text: y(h).t(e.labelKey),
115
- class: "text-sm font-medium text-primary"
116
- }, null, 8, ["text"]), p("div", B, [m(y(O), g({ ref_for: !0 }, y(r)(y(L)[e.index].offsetDays), {
117
- "is-required": !0,
118
- label: y(h).t("wise_invoicing.invoice_approval.settings.offset_days"),
119
- max: 365,
120
- min: 1,
121
- step: 1
122
- }), null, 16, ["label"]), m(y(k), g({ ref_for: !0 }, y(r)(y(L)[e.index].schedule), {
123
- "display-fn": U,
124
- "is-required": !0,
125
- items: H(e.index),
126
- label: y(h).t("wise_invoicing.invoice_approval.settings.schedule_label")
127
- }), null, 16, ["items", "label"])])])), 64)), p("div", V, [m(y(D), { label: y(h).t("shared.save_changes") }, null, 8, ["label"])])])]),
128
- _: 1
129
- })]),
130
- _: 1
131
- }, 8, ["form"])]),
132
- _: 1
133
- }, 8, ["description", "title"]));
134
- }
135
- }), U = /* @__PURE__ */ h({
136
- __name: "ApprovalReminderSettingsViewDataProvider",
137
- setup(e) {
138
- let t = P();
139
- return (e, n) => (_(), d(i, { queries: { reminderConfigs: y(t) } }, {
140
- default: b(({ data: e }) => [m(H, { "reminder-configs": e.reminderConfigs }, null, 8, ["reminder-configs"])]),
141
- loading: b(() => [m(y(T), { breadcrumbs: [] })]),
142
- _: 1
143
- }, 8, ["queries"]));
144
- }
145
- });
146
- //#endregion
147
- export { U as default };
@@ -1,361 +0,0 @@
1
- import { t as e } from "./i18n.lib-DB15VQsH.js";
2
- import "./api.util-DSerLsgA.js";
3
- import { y as t } from "./documentTitle.composable-D5uPh3uG.js";
4
- import { t as n } from "./invoice.service-BKgP2p8z.js";
5
- import { G as r, ft as i, xt as a } from "./dist-B33lNwLw.js";
6
- import { n as o, r as s, t as c } from "./InvoicingFileUploadProvider-C3cyIUhL.js";
7
- import { t as l } from "./formango.util-D5c2ql--.js";
8
- import { t as u } from "./invoiceApprovalStatus.util-D17DWEh1.js";
9
- import { t as d } from "./DataProvider-BtnD-BzI.js";
10
- import { t as f } from "./issuerSettings.query-D8T34N7f.js";
11
- import { z as p } from "zod";
12
- import { useI18n as m } from "vue-i18n";
13
- import { computed as h, createBlock as g, createVNode as _, defineComponent as v, mergeProps as y, openBlock as b, unref as x, withCtx as S } from "vue";
14
- import { useMutation as C } from "@wisemen/vue-core-api-utils";
15
- import { UIDialogBody as w, UIDialogFooter as T, UIDialogFooterCancel as E, UIDialogFooterSubmit as D, UIDialogHeader as O, UIFormDialog as k, UIFormFieldGroup as A, UIFormFileUpload as j, UIFormSubmitButton as M, UISelect as N, UITextareaField as P, createSelectOptions as F, useToast as I } from "@wisemen/vue-core-design-system";
16
- import { useForm as L } from "formango";
17
- //#region src/modules/invoice/api/mutations/invoiceSendApproval.mutation.ts
18
- function R() {
19
- return C({
20
- queryFn: (e) => e.params.hasActiveApproval ? n.restartApproval(e.params.invoiceUuid) : n.sendApproval(e.params.invoiceUuid),
21
- queryKeysToInvalidate: {
22
- invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
23
- invoiceApprovalIndex: {},
24
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
25
- invoiceIndex: {}
26
- }
27
- });
28
- }
29
- //#endregion
30
- //#region src/modules/invoice/api/mutations/invoiceArchiveApproval.mutation.ts
31
- function z() {
32
- return C({
33
- queryFn: (e) => n.archiveApproval(e.params.approvalUuid),
34
- queryKeysToInvalidate: {
35
- invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
36
- invoiceApprovalIndex: {},
37
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
38
- invoiceIndex: {}
39
- }
40
- });
41
- }
42
- //#endregion
43
- //#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalArchiveDialog.vue
44
- var B = /* @__PURE__ */ v({
45
- __name: "InvoiceApprovalArchiveDialog",
46
- props: {
47
- approvalUuid: {},
48
- invoiceUuid: {}
49
- },
50
- emits: ["close"],
51
- setup(e, { emit: t }) {
52
- let n = e, i = t, a = m(), o = I(), s = z(), c = L({
53
- initialState: {},
54
- schema: p.object({}),
55
- onSubmit: async () => {
56
- let e = await s.execute({ params: {
57
- approvalUuid: n.approvalUuid,
58
- invoiceUuid: n.invoiceUuid
59
- } });
60
- e.isErr() ? o.apiError(e.error) : (o.show({ message: a.t("wise_invoicing.invoice.approval_archive.success") }), i("close"));
61
- },
62
- onSubmitError: () => {
63
- o.unableToSave();
64
- }
65
- });
66
- return (e, t) => (b(), g(x(k), {
67
- form: x(c),
68
- size: "sm",
69
- onClose: t[0] ||= (e) => i("close")
70
- }, {
71
- default: S(() => [_(x(O), {
72
- title: x(a).t("wise_invoicing.invoice.approval_archive.title"),
73
- description: x(a).t("wise_invoicing.invoice.approval_archive.description"),
74
- icon: x(r),
75
- "icon-variant": "error"
76
- }, null, 8, [
77
- "title",
78
- "description",
79
- "icon"
80
- ]), _(x(T), null, {
81
- default: S(() => [_(x(E)), _(x(D), { label: x(a).t("wise_invoicing.invoice.approval_archive.submit") }, null, 8, ["label"])]),
82
- _: 1
83
- })]),
84
- _: 1
85
- }, 8, ["form"]));
86
- }
87
- });
88
- //#endregion
89
- //#region src/modules/invoice/api/mutations/invoiceApproveApproval.mutation.ts
90
- function V() {
91
- return C({
92
- queryFn: (e) => n.approveApproval(e.params.approvalUuid, e.body),
93
- queryKeysToInvalidate: {
94
- invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
95
- invoiceApprovalIndex: {},
96
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
97
- invoiceIndex: {}
98
- }
99
- });
100
- }
101
- //#endregion
102
- //#region src/modules/invoice/models/invoice/approval/invoiceApproveForm.model.ts
103
- var H = p.object({
104
- proofOfApproval: o.array(),
105
- remarks: p.string().trim().nullable()
106
- });
107
- function U(t) {
108
- return H.superRefine((n, r) => {
109
- t && n.proofOfApproval.length === 0 && r.addIssue({
110
- code: "custom",
111
- message: e.global.t("wise_invoicing.invoice.approve.proof_required"),
112
- path: ["proofOfApproval"]
113
- });
114
- });
115
- }
116
- //#endregion
117
- //#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue?vue&type=script&setup=true&lang.ts
118
- var W = 26214400, G = /* @__PURE__ */ v({
119
- __name: "InvoiceApproveDialog",
120
- props: {
121
- approvalUuid: {},
122
- invoiceUuid: {},
123
- isProofOfApprovalRequired: { type: Boolean }
124
- },
125
- emits: ["close"],
126
- setup(e, { emit: t }) {
127
- let n = e, r = t, i = /* @__PURE__ */ new Set([
128
- "application/pdf",
129
- "image/png",
130
- "image/jpeg"
131
- ]), o = m(), u = I(), d = V(), f = L({
132
- initialState: {
133
- proofOfApproval: [],
134
- remarks: null
135
- },
136
- schema: U(n.isProofOfApprovalRequired),
137
- onSubmit: async (e) => {
138
- let t = await d.execute({
139
- body: e,
140
- params: {
141
- approvalUuid: n.approvalUuid,
142
- invoiceUuid: n.invoiceUuid
143
- }
144
- });
145
- t.isErr() ? u.apiError(t.error) : (u.show({ message: o.t("wise_invoicing.invoice.approve.success") }), r("close"));
146
- },
147
- onSubmitError: () => {
148
- u.unableToSave();
149
- }
150
- }), p = f.register("proofOfApproval"), h = f.register("remarks");
151
- function v(e) {
152
- return i.has(e.type) ? e.size > W ? o.t("wise_invoicing.invoice.approve.proof_too_large") : !0 : o.t("wise_invoicing.invoice.approve.proof_invalid_type");
153
- }
154
- return (e, t) => (b(), g(x(k), {
155
- form: x(f),
156
- size: "sm",
157
- onClose: t[0] ||= (e) => r("close")
158
- }, {
159
- default: S(() => [
160
- _(x(O), {
161
- title: x(o).t("wise_invoicing.invoice.approve.title"),
162
- description: x(o).t("wise_invoicing.invoice.approve.description"),
163
- icon: x(a),
164
- "icon-variant": "success"
165
- }, null, 8, [
166
- "title",
167
- "description",
168
- "icon"
169
- ]),
170
- _(x(w), null, {
171
- default: S(() => [_(x(A), null, {
172
- default: S(() => [_(c, null, {
173
- default: S(() => [_(x(j), y(x(l)(x(p)), {
174
- accept: Array.from(x(i)),
175
- description: x(o).t("wise_invoicing.invoice.approve.fields.proof_description"),
176
- hint: x(o).t("wise_invoicing.invoice.approve.fields.proof_hint"),
177
- "is-required": n.isProofOfApprovalRequired,
178
- "is-valid-file": v,
179
- preprocess: x(s).preprocess,
180
- class: "w-full"
181
- }), null, 16, [
182
- "accept",
183
- "description",
184
- "hint",
185
- "is-required",
186
- "preprocess"
187
- ])]),
188
- _: 1
189
- }), _(x(P), y(x(l)(x(h)), {
190
- label: x(o).t("wise_invoicing.invoice.approve.fields.note"),
191
- placeholder: x(o).t("wise_invoicing.invoice.approve.fields.note_placeholder")
192
- }), null, 16, ["label", "placeholder"])]),
193
- _: 1
194
- })]),
195
- _: 1
196
- }),
197
- _(x(T), null, {
198
- default: S(() => [_(x(E)), _(x(M), { label: x(o).t("wise_invoicing.invoice.approve.submit") }, null, 8, ["label"])]),
199
- _: 1
200
- })
201
- ]),
202
- _: 1
203
- }, 8, ["form"]));
204
- }
205
- }), K = /* @__PURE__ */ v({
206
- inheritAttrs: !1,
207
- __name: "InvoiceApproveDialogDataProvider",
208
- props: {
209
- approvalUuid: {},
210
- invoiceUuid: {}
211
- },
212
- emits: ["close"],
213
- setup(e, { emit: t }) {
214
- let n = e, r = t, i = f();
215
- return (e, t) => (b(), g(d, { queries: { issuerSettings: x(i) } }, {
216
- default: S(({ data: i }) => [_(G, y(e.$attrs, {
217
- "approval-uuid": n.approvalUuid,
218
- "invoice-uuid": n.invoiceUuid,
219
- "is-proof-of-approval-required": i.issuerSettings.requiresInvoiceApprovalFile,
220
- onClose: t[0] ||= (e) => r("close")
221
- }), null, 16, [
222
- "approval-uuid",
223
- "invoice-uuid",
224
- "is-proof-of-approval-required"
225
- ])]),
226
- _: 1
227
- }, 8, ["queries"]));
228
- }
229
- });
230
- //#endregion
231
- //#region src/modules/invoice/api/mutations/invoiceRejectApproval.mutation.ts
232
- function q() {
233
- return C({
234
- queryFn: (e) => n.rejectApproval(e.params.approvalUuid, e.body),
235
- queryKeysToInvalidate: {
236
- invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
237
- invoiceApprovalIndex: {},
238
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
239
- invoiceIndex: {}
240
- }
241
- });
242
- }
243
- var J = p.object({
244
- attachments: o.array(),
245
- reason: p.enum(t).nullable(),
246
- remarks: p.string().trim().max(500).nullable()
247
- }).superRefine((n, r) => {
248
- n.reason === null ? r.addIssue({
249
- code: "custom",
250
- message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
251
- path: ["reason"]
252
- }) : n.reason === t.OTHER && (n.remarks ?? "") === "" && r.addIssue({
253
- code: "custom",
254
- message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
255
- path: ["remarks"]
256
- });
257
- }), Y = 10485760, X = /* @__PURE__ */ v({
258
- __name: "InvoiceRejectDialog",
259
- props: {
260
- approvalUuid: {},
261
- invoiceUuid: {}
262
- },
263
- emits: ["close"],
264
- setup(e, { emit: n }) {
265
- let r = e, a = n, o = m(), d = I(), f = q(), p = L({
266
- initialState: {
267
- attachments: [],
268
- reason: null,
269
- remarks: null
270
- },
271
- schema: J,
272
- onSubmit: async (e) => {
273
- let t = await f.execute({
274
- body: e,
275
- params: {
276
- approvalUuid: r.approvalUuid,
277
- invoiceUuid: r.invoiceUuid
278
- }
279
- });
280
- t.isErr() ? d.apiError(t.error) : (d.show({ message: o.t("wise_invoicing.invoice.reject.success") }), a("close"));
281
- },
282
- onSubmitError: () => {
283
- d.unableToSave();
284
- }
285
- }), v = p.register("attachments"), C = p.register("reason"), D = p.register("remarks"), R = h(() => F([...Object.values(t).filter((e) => e !== t.OTHER), t.OTHER]));
286
- function z(e) {
287
- return o.t(u.getRejectionReasonTranslationKey(e));
288
- }
289
- let B = h(() => C.modelValue.value === t.OTHER);
290
- function V(e) {
291
- return e.size > Y ? o.t("wise_invoicing.invoice.reject.attachment_too_large") : !0;
292
- }
293
- return (e, t) => (b(), g(x(k), {
294
- form: x(p),
295
- size: "sm",
296
- onClose: t[0] ||= (e) => a("close")
297
- }, {
298
- default: S(() => [
299
- _(x(O), {
300
- title: x(o).t("wise_invoicing.invoice.reject.title"),
301
- description: x(o).t("wise_invoicing.invoice.reject.description"),
302
- icon: x(i),
303
- "icon-variant": "warning"
304
- }, null, 8, [
305
- "title",
306
- "description",
307
- "icon"
308
- ]),
309
- _(x(w), null, {
310
- default: S(() => [_(x(A), null, {
311
- default: S(() => [
312
- _(x(N), y(x(l)(x(C)), {
313
- "display-fn": z,
314
- "is-required": !0,
315
- items: R.value,
316
- label: x(o).t("wise_invoicing.invoice.reject.fields.reason")
317
- }), null, 16, ["items", "label"]),
318
- _(x(P), y(x(l)(x(D)), {
319
- "is-required": B.value,
320
- label: x(o).t("wise_invoicing.invoice.reject.fields.remark"),
321
- placeholder: x(o).t("wise_invoicing.invoice.reject.fields.remark_placeholder")
322
- }), null, 16, [
323
- "is-required",
324
- "label",
325
- "placeholder"
326
- ]),
327
- _(c, null, {
328
- default: S(() => [_(x(j), y(x(l)(x(v)), {
329
- accept: [
330
- "application/pdf",
331
- "image/png",
332
- "image/jpeg"
333
- ],
334
- description: x(o).t("wise_invoicing.invoice.reject.fields.attachment_description"),
335
- hint: x(o).t("wise_invoicing.invoice.reject.fields.attachment_hint"),
336
- "is-valid-file": V,
337
- preprocess: x(s).preprocess,
338
- class: "w-full"
339
- }), null, 16, [
340
- "description",
341
- "hint",
342
- "preprocess"
343
- ])]),
344
- _: 1
345
- })
346
- ]),
347
- _: 1
348
- })]),
349
- _: 1
350
- }),
351
- _(x(T), null, {
352
- default: S(() => [_(x(E)), _(x(M), { label: x(o).t("wise_invoicing.invoice.reject.submit") }, null, 8, ["label"])]),
353
- _: 1
354
- })
355
- ]),
356
- _: 1
357
- }, 8, ["form"]));
358
- }
359
- });
360
- //#endregion
361
- export { R as i, K as n, B as r, X as t };
@@ -1,73 +0,0 @@
1
- import { W as e, et as t, st as n, t as r } from "./api.util-DSerLsgA.js";
2
- import { n as i, r as a, t as o } from "./plainDate.transformer-Bhiz9jW7.js";
3
- import { t as s } from "./invoiceApprovalStatus.util-D17DWEh1.js";
4
- //#region src/modules/invoice-approval/models/approvalReminderConfig.transformer.ts
5
- var c = class {
6
- static toDto(e) {
7
- return { reminders: e.reminders.map((e) => ({
8
- offsetDays: e.offsetDays,
9
- schedule: e.schedule,
10
- sequence: e.sequence,
11
- template: e.template
12
- })) };
13
- }
14
- static toForm(e) {
15
- return { reminders: e.toSorted((e, t) => e.sequence - t.sequence).map((e) => ({
16
- offsetDays: e.offsetDays,
17
- schedule: e.schedule,
18
- sequence: e.sequence,
19
- template: e.template
20
- })) };
21
- }
22
- }, l = class {
23
- static fromDto(e) {
24
- return {
25
- uuid: e.uuid,
26
- customerUuid: e.customer.uuid,
27
- invoiceUuid: e.invoice.uuid,
28
- nextReminderOn: o.fromNullableDto(e.nextReminderOn),
29
- hasChangesSinceApprovalSent: e.invoice.hasChangesSinceApprovalSent,
30
- approval: {
31
- reminderSentAt: a.fromNullableDto(e.lastReminderSentAt),
32
- sentAt: a.fromNullableDto(e.sentAt),
33
- level: e.level,
34
- status: e.status
35
- },
36
- customerName: e.customer.name,
37
- grossAmount: i.fromDto(e.grossAmount),
38
- invoiceSubject: e.invoice.subject,
39
- mode: e.mode,
40
- netAmount: i.fromDto(e.netAmount),
41
- recipientEmail: e.recipient.email,
42
- rejectionReason: e.rejectionReason
43
- };
44
- }
45
- }, u = class {
46
- static toDto(e) {
47
- let t = {};
48
- if (e.filters?.approvalStatus) {
49
- let n = s.toIndexFilter(e.filters.approvalStatus);
50
- t.status = n.approvalStatus, t.level = n.level;
51
- }
52
- return e.filters?.hasChangesSinceApprovalSent !== null && e.filters?.hasChangesSinceApprovalSent !== void 0 && (t.hasChangesSinceApprovalSent = e.filters.hasChangesSinceApprovalSent), e.filters?.customerUuid && (t.customerUuid = e.filters.customerUuid), {
53
- filter: t,
54
- pagination: e.pagination
55
- };
56
- }
57
- }, d = class {
58
- static async getAll(e) {
59
- return (await r.fromPromise(n({ query: u.toDto(e) }))).map((e) => ({
60
- data: e.data.items.map(l.fromDto),
61
- meta: e.data.meta
62
- }));
63
- }
64
- static async getReminderConfigs() {
65
- return (await r.fromPromise(t())).map((e) => e.data.items);
66
- }
67
- static async updateReminderConfigs(t) {
68
- let n = await r.fromPromise(e({ body: c.toDto(t) }));
69
- return r.void(n);
70
- }
71
- };
72
- //#endregion
73
- export { c as n, d as t };
@@ -1,4 +0,0 @@
1
- import { InvoiceUuid } from '../../models/invoiceUuid.model.ts';
2
- export declare function useInvoiceMarkAsPriorApprovalRequiredMutation(): import('@wisemen/vue-core-api-utils').UseMutationReturnType<void, void, {
3
- invoiceUuid: InvoiceUuid;
4
- }, string>;
@@ -1,4 +0,0 @@
1
- import { InvoiceUuid } from '../../models/invoiceUuid.model.ts';
2
- export declare function useInvoiceUnmarkAsPriorApprovalRequiredMutation(): import('@wisemen/vue-core-api-utils').UseMutationReturnType<void, void, {
3
- invoiceUuid: InvoiceUuid;
4
- }, string>;