@wisemen/wise-invoicing-web 0.2.0 → 0.3.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 (117) hide show
  1. package/dist/{ApprovalReminderSettingsViewDataProvider-D-qXZrPT.js → ApprovalReminderSettingsViewDataProvider-DwtfyQpx.js} +4 -4
  2. package/dist/{BillingDocumentDetailViewDataProvider-DDdtlW-2.js → BillingDocumentDetailViewDataProvider-TJUwMhtn.js} +1373 -1217
  3. package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
  4. package/dist/{BillingDocumentPdf-ehdFB6mr.js → BillingDocumentPdf-PU9Ldfhs.js} +20 -13
  5. package/dist/{CreditNoteDetailViewDataProvider-11a-JO3H.js → CreditNoteDetailViewDataProvider-DOPmal5D.js} +89 -89
  6. package/dist/{CreditNotePdfViewDataProvider-bfeaya3P.js → CreditNotePdfViewDataProvider-BH7MaReQ.js} +2 -2
  7. package/dist/{CustomFieldValueText-CZQXGE5F.js → CustomFieldValueText-BjRVovZL.js} +25 -25
  8. package/dist/DunningCaseDetailViewDataProvider-CW8ijY3H.js +439 -0
  9. package/dist/{DunningCaseOverviewView-y_bCmi5j.js → DunningCaseOverviewView-Cfo-4VIw.js} +255 -203
  10. package/dist/{DunningCaseReminderPdfViewDataProvider-DNODfED_.js → DunningCaseReminderPdfViewDataProvider-Dr-CS_VQ.js} +4 -3
  11. package/dist/{DunningCaseSendDialog-BPXcqit5.js → DunningCaseSendDialog-BYFXJYMM.js} +83 -72
  12. package/dist/InvoiceApprovalOutOfSyncIndicator-CP2GLaeh.js +45 -0
  13. package/dist/InvoiceApprovalOverviewView-Cjdu9iZC.js +814 -0
  14. package/dist/InvoiceApprovalStatusBadge-CcX8agTF.js +127 -0
  15. package/dist/InvoiceApproveDialogDataProvider-4wNAetBn.js +377 -0
  16. package/dist/{InvoiceDetailViewDataProvider-BYeaaQzL.js → InvoiceDetailViewDataProvider-C9O3hXGo.js} +750 -692
  17. package/dist/InvoiceOverviewViewDataProvider-DBdw7FvZ.js +1892 -0
  18. package/dist/{InvoicePdfView-BJRTg_TH.js → InvoicePdfView-CvU9bRVd.js} +10 -4
  19. package/dist/{InvoicePdfViewDataProvider-CwI_uGm3.js → InvoicePdfViewDataProvider-CFjHQ58K.js} +3 -3
  20. package/dist/{InvoicePublicPdfViewDataProvider-uZUfsr5K.js → InvoicePublicPdfViewDataProvider-DDv-LdBU.js} +3 -3
  21. package/dist/InvoicePublicProFormaPdfViewDataProvider-BTjJnELb.js +47 -0
  22. package/dist/{InvoicingFileUploadProvider-D9Xk4rQM.js → InvoicingFileUploadProvider-Kcq7kSSt.js} +2 -2
  23. package/dist/{IssuerSettingsViewDataProvider-CGRa8F-2.js → IssuerSettingsViewDataProvider-BuSIVnIl.js} +3 -3
  24. package/dist/{ReminderSettingsViewDataProvider-1ucp3z2T.js → ReminderSettingsViewDataProvider-CH7gSXnj.js} +100 -102
  25. package/dist/{api.util-C_kMGlJN.js → api.util-CkIRZS3h.js} +985 -930
  26. package/dist/{billingDocumentDetail.transformer-Da6_-Hv9.js → billingDocumentDetail.transformer-Bfd8geNo.js} +5 -7
  27. package/dist/client/index.d.ts +2 -2
  28. package/dist/client/sdk.gen.d.ts +2 -1
  29. package/dist/client/types.gen.d.ts +114 -31
  30. package/dist/client/zod.gen.d.ts +343 -78
  31. package/dist/composables/sending-refetch/sendingRefetch.composable.d.ts +7 -0
  32. package/dist/composables/sending-refetch/sendingRefetch.composable.spec.d.ts +1 -0
  33. package/dist/{creditNoteDetail.query-DLR7L0Ep.js → creditNoteDetail.query-tLnfqsEB.js} +27 -27
  34. package/dist/customerUuid.model-ClN4Vi9n.js +18 -0
  35. package/dist/{dist-Cxdm09Lp.js → dist-BD7Allff.js} +143 -95
  36. package/dist/{dist-CoztMdYH.js → dist-D5agTXFI.js} +61 -61
  37. package/dist/{documentTitle.composable-DsBbzhXN.js → documentTitle.composable-CRJjS6p-.js} +19 -17
  38. package/dist/{i18n.lib-Cvr8pcDw.js → i18n.lib--mzprLMR.js} +88 -54
  39. package/dist/index.d.ts +56 -22
  40. package/dist/index.js +193 -201
  41. package/dist/{invoice.service-DEEA9mal.js → invoice.service-B1w16_Md.js} +184 -172
  42. package/dist/{invoiceApproval.service-DvL3LliM.js → invoiceApproval.service-BHAJmFkU.js} +8 -8
  43. package/dist/{invoiceApprovalStatus.util-3Zh10Pj8.js → invoiceApprovalStatus.util-DohOKR4q.js} +42 -38
  44. package/dist/invoiceCustomer.service-DpVfpQUD.js +39 -0
  45. package/dist/{invoiceDetail.query-CRoH_SgM.js → invoiceDetail.query-CfyNSXLS.js} +1 -1
  46. package/dist/{invoiceDeliveryStatus.util-nCsqDypY.js → invoiceIndexCache.util-jHsrFwcA.js} +128 -51
  47. package/dist/{invoicingConfig.composable-rxjGK882.js → invoicingConfig.composable-COn1rKRf.js} +2 -2
  48. package/dist/{issuerSettings.query-Dc5gsaEm.js → issuerSettings.query-CDFk2GiP.js} +3 -2
  49. package/dist/libs/i18n.lib.d.ts +56 -22
  50. package/dist/locales/en-US.json.d.ts +44 -27
  51. package/dist/locales/nl-BE.json.d.ts +44 -27
  52. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.model.d.ts +8 -1
  53. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.util.d.ts +12 -0
  54. package/dist/models/billing-document/activity-log/billingDocumentActivityLog.util.spec.d.ts +1 -0
  55. package/dist/models/billing-document/billingDocumentDetail.model.d.ts +2 -6
  56. package/dist/modules/dunning-case/api/mutations/dunningCaseReminderRetry.mutation.d.ts +4 -0
  57. package/dist/modules/dunning-case/api/services/dunningCase.service.d.ts +2 -1
  58. package/dist/modules/dunning-case/models/dunningCase.model.d.ts +5 -0
  59. package/dist/modules/dunning-case/models/dunningCaseReminderPdf.model.d.ts +0 -4
  60. package/dist/modules/dunning-case/models/dunningCaseReminderPdf.transformer.d.ts +0 -1
  61. package/dist/modules/dunning-case/test/builders/dunningCaseReminderPdfDto.builder.d.ts +1 -0
  62. package/dist/modules/dunning-case/use-cases/overview/components/DunningCaseOverviewActionsCell.vue.d.ts +2 -0
  63. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.d.ts +2 -2
  64. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverview.composable.spec.d.ts +1 -0
  65. package/dist/modules/dunning-case/use-cases/overview/composables/dunningCaseOverviewTableColumns.composable.d.ts +1 -0
  66. package/dist/modules/dunning-case/use-cases/pdf/components/DunningCaseReminderPdfTable.vue.d.ts +0 -4
  67. package/dist/modules/dunning-case/use-cases/send/dialogs/DunningCaseBulkSendDialog.vue.d.ts +2 -1
  68. package/dist/modules/dunning-case/use-cases/settings/components/ReminderLadderRow.vue.d.ts +4 -4
  69. package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.d.ts +2 -2
  70. package/dist/modules/dunning-case/use-cases/settings/composables/reminderLadder.composable.spec.d.ts +1 -0
  71. package/dist/modules/invoice/api/mutations/invoiceRejectApproval.mutation.d.ts +8 -0
  72. package/dist/modules/invoice/api/queries/invoicePublicProFormaDetail.query.d.ts +2 -0
  73. package/dist/modules/invoice/api/query-keys/invoice.queryKeys.d.ts +6 -0
  74. package/dist/modules/invoice/api/services/invoice.service.d.ts +1 -0
  75. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.d.ts +4 -2
  76. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.spec.d.ts +1 -0
  77. package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.d.ts +8 -0
  78. package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +1 -0
  79. package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.model.d.ts +2 -3
  80. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.model.d.ts +2 -9
  81. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.util.d.ts +4 -2
  82. package/dist/modules/invoice/models/invoice/payment/invoicePaymentCreate.transformer.spec.d.ts +1 -0
  83. package/dist/modules/invoice/models/invoice/pdf/invoicePdfDetail.transformer.d.ts +2 -1
  84. package/dist/modules/invoice/routes/invoice.routes.d.ts +4 -0
  85. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue.d.ts +1 -0
  86. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialogDataProvider.vue.d.ts +13 -0
  87. package/dist/modules/invoice/use-cases/detail/dialogs/InvoicePaymentDeleteDialog.vue.d.ts +13 -0
  88. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewDataTableFilters.composable.d.ts +2 -3
  89. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewSelection.composable.d.ts +11 -9
  90. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +2 -2
  91. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendApprovalDialog.vue.d.ts +3 -1
  92. package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.d.ts +7 -4
  93. package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.spec.d.ts +1 -0
  94. package/dist/modules/invoice/use-cases/pdf/components/BillingDocumentPdf.vue.d.ts +1 -0
  95. package/dist/modules/invoice/use-cases/pdf/components/InvoicePdfWatermark.vue.d.ts +4 -1
  96. package/dist/modules/invoice/use-cases/pdf/views/InvoicePdfView.vue.d.ts +1 -0
  97. package/dist/modules/invoice/use-cases/pdf/views/InvoicePublicProFormaPdfViewDataProvider.vue.d.ts +3 -0
  98. package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.action.d.ts +2 -0
  99. package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.spec.d.ts +1 -0
  100. package/dist/modules/invoice-approval/models/invoiceApprovalIndex.transformer.spec.d.ts +1 -0
  101. package/dist/modules/invoice-approval/models/invoiceApprovalIndexQueryParams.transformer.spec.d.ts +1 -0
  102. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverview.composable.d.ts +5 -6
  103. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewFilters.composable.d.ts +0 -5
  104. package/dist/modules/settings/models/issuer-settings/issuerSettings.model.d.ts +1 -0
  105. package/dist/{reminderConfig.query-snaHQmrY.js → reminderConfig.query-DSO0ekC_.js} +112 -105
  106. package/dist/routes/invoicingPublicRoutes.composable.d.ts +4 -0
  107. package/dist/style.css +1 -1
  108. package/dist/ui/billing-document/sidebar/BillingDocumentDetailSidebarActivityApprovalDetails.vue.d.ts +7 -0
  109. package/package.json +2 -2
  110. package/dist/DunningCaseDetailViewDataProvider-DC-ziMoO.js +0 -409
  111. package/dist/InvoiceApprovalOverviewView-DZ14mi4L.js +0 -870
  112. package/dist/InvoiceApprovalStatusBadge-U-dW2hR4.js +0 -161
  113. package/dist/InvoiceApproveDialog-2LXneG2r.js +0 -308
  114. package/dist/InvoiceOverviewBulkSendApprovalDialog-99dfuN4i.js +0 -318
  115. package/dist/InvoiceOverviewViewDataProvider-CZIQeftL.js +0 -1620
  116. package/dist/customerUuid.model-GUFYq3O2.js +0 -5
  117. package/dist/modules/invoice-approval/actions/invoiceApprovalUnmarkAsNeedsApproval.action.d.ts +0 -1
@@ -0,0 +1,127 @@
1
+ import "./api.util-CkIRZS3h.js";
2
+ import { a as e, o as t } from "./documentTitle.composable-CRJjS6p-.js";
3
+ import { V as n, v as r } from "./dist-BD7Allff.js";
4
+ import { n as i } from "./dist-boJIIxnT.js";
5
+ import { t as a } from "./invoiceApprovalStatus.util-DohOKR4q.js";
6
+ import { useI18n as o } from "vue-i18n";
7
+ import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, openBlock as g, renderList as _, unref as v, withCtx as y } from "vue";
8
+ import { UIBadge as b, UIText as x, UITooltip as S, UITooltipContent as C } from "@wisemen/vue-core-design-system";
9
+ //#region src/modules/invoice/components/InvoiceApprovalStatusChip.vue?vue&type=script&setup=true&lang.ts
10
+ var w = {
11
+ key: 0,
12
+ class: "flex min-w-0 items-center gap-xs rounded-sm border border-secondary bg-primary px-sm py-xxs"
13
+ }, T = {
14
+ class: "flex shrink-0 gap-xxs",
15
+ "aria-hidden": "true"
16
+ }, E = 2, D = /* @__PURE__ */ m({
17
+ __name: "InvoiceApprovalStatusChip",
18
+ props: {
19
+ icon: {},
20
+ label: {},
21
+ level: {},
22
+ size: {},
23
+ tone: {}
24
+ },
25
+ setup(e) {
26
+ let n = e, r = c(() => n.level === t._2);
27
+ return (e, t) => n.level === null ? (g(), l(v(b), {
28
+ key: 1,
29
+ label: n.label,
30
+ color: n.tone,
31
+ left: n.icon,
32
+ size: n.size,
33
+ variant: "translucent"
34
+ }, null, 8, [
35
+ "label",
36
+ "color",
37
+ "left",
38
+ "size"
39
+ ])) : (g(), d("span", w, [f("span", T, [(g(), d(s, null, _(E, (e) => f("span", {
40
+ key: e,
41
+ class: h([[e <= n.level ? {
42
+ "border-error bg-error-solid": r.value,
43
+ "border-warning-500 bg-warning-solid": !r.value
44
+ } : {
45
+ "border-error": r.value,
46
+ "border-warning-500": !r.value
47
+ }], "h-(--spacing-sm) w-(--spacing-md) rounded-full border"])
48
+ }, null, 2)), 64))]), p(v(x), {
49
+ text: n.label,
50
+ class: "text-xs text-primary"
51
+ }, null, 8, ["text"])]));
52
+ }
53
+ }), O = /* @__PURE__ */ m({
54
+ __name: "InvoiceApprovalStatusBadge",
55
+ props: {
56
+ approval: {},
57
+ rejection: { default: null },
58
+ requiresPriorApproval: { type: Boolean },
59
+ size: { default: "sm" }
60
+ },
61
+ setup(t) {
62
+ let f = t, m = o(), h = i(), _ = c(() => a.getDisplayStatus({
63
+ approval: f.approval,
64
+ requiresPriorApproval: f.requiresPriorApproval
65
+ })), b = c(() => _.value === null ? null : a.getMetadata(_.value)), w = c(() => b.value === null ? "" : m.t(b.value.translationKey)), T = c(() => _.value === e.REMINDER_1 || _.value === e.REMINDER_2 ? f.approval?.level ?? null : null), E = {
66
+ [e.AWAITING_APPROVAL]: r,
67
+ [e.REJECTED]: n
68
+ }, O = c(() => {
69
+ let e = _.value === null ? void 0 : E[_.value];
70
+ return e === void 0 ? void 0 : {
71
+ icon: e,
72
+ type: "icon"
73
+ };
74
+ }), k = c(() => {
75
+ if (_.value === e.REJECTED && f.rejection !== null) {
76
+ let e = m.t(a.getRejectionReasonTranslationKey(f.rejection.reason));
77
+ return f.rejection.remark === null ? e : `${e} — ${f.rejection.remark}`;
78
+ }
79
+ if (T.value === null) return null;
80
+ let t = f.approval?.reminderSentAt ?? f.approval?.sentAt ?? null;
81
+ return t === null ? null : m.t("wise_invoicing.invoice.approval_status.last_request_sent_on", { date: h.toDate(t) });
82
+ });
83
+ return (e, t) => b.value === null ? u("", !0) : (g(), d(s, { key: 0 }, [k.value === null ? (g(), l(D, {
84
+ key: 1,
85
+ icon: O.value,
86
+ label: w.value,
87
+ level: T.value,
88
+ size: f.size,
89
+ tone: b.value.tone
90
+ }, null, 8, [
91
+ "icon",
92
+ "label",
93
+ "level",
94
+ "size",
95
+ "tone"
96
+ ])) : (g(), l(v(S), {
97
+ key: 0,
98
+ "popover-side-offset": 8,
99
+ "popover-align": "center",
100
+ "popover-side": "bottom"
101
+ }, {
102
+ trigger: y(() => [p(D, {
103
+ icon: O.value,
104
+ label: w.value,
105
+ level: T.value,
106
+ size: f.size,
107
+ tone: b.value.tone
108
+ }, null, 8, [
109
+ "icon",
110
+ "label",
111
+ "level",
112
+ "size",
113
+ "tone"
114
+ ])]),
115
+ content: y(() => [p(v(C), null, {
116
+ default: y(() => [p(v(x), {
117
+ text: k.value,
118
+ class: "text-sm text-primary"
119
+ }, null, 8, ["text"])]),
120
+ _: 1
121
+ })]),
122
+ _: 1
123
+ }))], 64));
124
+ }
125
+ });
126
+ //#endregion
127
+ export { D as n, O as t };
@@ -0,0 +1,377 @@
1
+ import { t as e } from "./i18n.lib--mzprLMR.js";
2
+ import "./api.util-CkIRZS3h.js";
3
+ import { g as t } from "./documentTitle.composable-CRJjS6p-.js";
4
+ import { t as n } from "./invoice.service-B1w16_Md.js";
5
+ import { F as r, ct as i, et as a } from "./dist-BD7Allff.js";
6
+ import { t as o } from "./DataProvider-C3uEds9v.js";
7
+ import { t as s } from "./formango.util-D5c2ql--.js";
8
+ import { t as c } from "./invoiceApprovalStatus.util-DohOKR4q.js";
9
+ import { t as l } from "./issuerSettings.query-CDFk2GiP.js";
10
+ import { n as u, r as d, t as f } from "./InvoicingFileUploadProvider-Kcq7kSSt.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/invoiceArchiveApproval.mutation.ts
18
+ function R() {
19
+ return C({
20
+ queryFn: (e) => n.archiveApproval(e.params.approvalUuid),
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/use-cases/detail/dialogs/InvoiceApprovalArchiveDialog.vue
31
+ var z = /* @__PURE__ */ v({
32
+ __name: "InvoiceApprovalArchiveDialog",
33
+ props: {
34
+ approvalUuid: {},
35
+ invoiceUuid: {}
36
+ },
37
+ emits: ["close"],
38
+ setup(e, { emit: t }) {
39
+ let n = e, i = t, a = m(), o = I(), s = R(), c = L({
40
+ initialState: {},
41
+ schema: p.object({}),
42
+ onSubmit: async () => {
43
+ let e = await s.execute({ params: {
44
+ approvalUuid: n.approvalUuid,
45
+ invoiceUuid: n.invoiceUuid
46
+ } });
47
+ if (e.isErr()) {
48
+ o.apiError(e.error);
49
+ return;
50
+ }
51
+ o.show({ message: a.t("wise_invoicing.invoice.approval_archive.success") }), i("close");
52
+ },
53
+ onSubmitError: () => {
54
+ o.unableToSave();
55
+ }
56
+ });
57
+ return (e, t) => (b(), g(x(k), {
58
+ form: x(c),
59
+ size: "sm",
60
+ onClose: t[0] ||= (e) => i("close")
61
+ }, {
62
+ default: S(() => [_(x(O), {
63
+ title: x(a).t("wise_invoicing.invoice.approval_archive.title"),
64
+ description: x(a).t("wise_invoicing.invoice.approval_archive.description"),
65
+ icon: x(r),
66
+ "icon-variant": "error"
67
+ }, null, 8, [
68
+ "title",
69
+ "description",
70
+ "icon"
71
+ ]), _(x(T), null, {
72
+ default: S(() => [_(x(E)), _(x(D), { label: x(a).t("wise_invoicing.invoice.approval_archive.submit") }, null, 8, ["label"])]),
73
+ _: 1
74
+ })]),
75
+ _: 1
76
+ }, 8, ["form"]));
77
+ }
78
+ });
79
+ //#endregion
80
+ //#region src/modules/invoice/api/mutations/invoiceRejectApproval.mutation.ts
81
+ function B() {
82
+ return C({
83
+ queryFn: (e) => n.rejectApproval(e.params.approvalUuid, e.body),
84
+ queryKeysToInvalidate: {
85
+ invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
86
+ invoiceApprovalIndex: {},
87
+ invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
88
+ invoiceIndex: {}
89
+ }
90
+ });
91
+ }
92
+ var V = p.object({
93
+ attachments: u.array(),
94
+ reason: p.enum(t).nullable(),
95
+ remarks: p.string().trim().max(500).nullable()
96
+ }).superRefine((n, r) => {
97
+ if (n.reason === null) {
98
+ r.addIssue({
99
+ code: "custom",
100
+ message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
101
+ path: ["reason"]
102
+ });
103
+ return;
104
+ }
105
+ n.reason === t.OTHER && (n.remarks ?? "") === "" && r.addIssue({
106
+ code: "custom",
107
+ message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
108
+ path: ["remarks"]
109
+ });
110
+ }), H = 10485760, U = /* @__PURE__ */ v({
111
+ __name: "InvoiceRejectDialog",
112
+ props: {
113
+ approvalUuid: {},
114
+ invoiceUuid: {}
115
+ },
116
+ emits: ["close"],
117
+ setup(e, { emit: n }) {
118
+ let r = e, i = n, o = m(), l = I(), u = B(), p = L({
119
+ initialState: {
120
+ attachments: [],
121
+ reason: null,
122
+ remarks: null
123
+ },
124
+ schema: V,
125
+ onSubmit: async (e) => {
126
+ let t = await u.execute({
127
+ body: e,
128
+ params: {
129
+ approvalUuid: r.approvalUuid,
130
+ invoiceUuid: r.invoiceUuid
131
+ }
132
+ });
133
+ if (t.isErr()) {
134
+ l.apiError(t.error);
135
+ return;
136
+ }
137
+ l.show({ message: o.t("wise_invoicing.invoice.reject.success") }), i("close");
138
+ },
139
+ onSubmitError: () => {
140
+ l.unableToSave();
141
+ }
142
+ }), 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]));
143
+ function z(e) {
144
+ return o.t(c.getRejectionReasonTranslationKey(e));
145
+ }
146
+ let U = h(() => C.modelValue.value === t.OTHER);
147
+ function W(e) {
148
+ return e.size > H ? o.t("wise_invoicing.invoice.reject.attachment_too_large") : !0;
149
+ }
150
+ return (e, t) => (b(), g(x(k), {
151
+ form: x(p),
152
+ size: "sm",
153
+ onClose: t[0] ||= (e) => i("close")
154
+ }, {
155
+ default: S(() => [
156
+ _(x(O), {
157
+ title: x(o).t("wise_invoicing.invoice.reject.title"),
158
+ description: x(o).t("wise_invoicing.invoice.reject.description"),
159
+ icon: x(a),
160
+ "icon-variant": "warning"
161
+ }, null, 8, [
162
+ "title",
163
+ "description",
164
+ "icon"
165
+ ]),
166
+ _(x(w), null, {
167
+ default: S(() => [_(x(A), null, {
168
+ default: S(() => [
169
+ _(x(N), y(x(s)(x(C)), {
170
+ "display-fn": z,
171
+ "is-required": !0,
172
+ items: R.value,
173
+ label: x(o).t("wise_invoicing.invoice.reject.fields.reason")
174
+ }), null, 16, ["items", "label"]),
175
+ _(x(P), y(x(s)(x(D)), {
176
+ "is-required": U.value,
177
+ label: x(o).t("wise_invoicing.invoice.reject.fields.remark"),
178
+ placeholder: x(o).t("wise_invoicing.invoice.reject.fields.remark_placeholder")
179
+ }), null, 16, [
180
+ "is-required",
181
+ "label",
182
+ "placeholder"
183
+ ]),
184
+ _(f, null, {
185
+ default: S(() => [_(x(j), y(x(s)(x(v)), {
186
+ accept: [
187
+ "application/pdf",
188
+ "image/png",
189
+ "image/jpeg"
190
+ ],
191
+ description: x(o).t("wise_invoicing.invoice.reject.fields.attachment_description"),
192
+ hint: x(o).t("wise_invoicing.invoice.reject.fields.attachment_hint"),
193
+ "is-valid-file": W,
194
+ preprocess: x(d).preprocess,
195
+ class: "w-full"
196
+ }), null, 16, [
197
+ "description",
198
+ "hint",
199
+ "preprocess"
200
+ ])]),
201
+ _: 1
202
+ })
203
+ ]),
204
+ _: 1
205
+ })]),
206
+ _: 1
207
+ }),
208
+ _(x(T), null, {
209
+ default: S(() => [_(x(E)), _(x(M), { label: x(o).t("wise_invoicing.invoice.reject.submit") }, null, 8, ["label"])]),
210
+ _: 1
211
+ })
212
+ ]),
213
+ _: 1
214
+ }, 8, ["form"]));
215
+ }
216
+ });
217
+ //#endregion
218
+ //#region src/modules/invoice/api/mutations/invoiceSendApproval.mutation.ts
219
+ function W() {
220
+ return C({
221
+ queryFn: (e) => e.params.hasActiveApproval ? n.restartApproval(e.params.invoiceUuid) : n.sendApproval(e.params.invoiceUuid),
222
+ queryKeysToInvalidate: {
223
+ invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
224
+ invoiceApprovalIndex: {},
225
+ invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
226
+ invoiceIndex: {}
227
+ }
228
+ });
229
+ }
230
+ //#endregion
231
+ //#region src/modules/invoice/api/mutations/invoiceApproveApproval.mutation.ts
232
+ function G() {
233
+ return C({
234
+ queryFn: (e) => n.approveApproval(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
+ //#endregion
244
+ //#region src/modules/invoice/models/invoice/approval/invoiceApproveForm.model.ts
245
+ var K = p.object({
246
+ proofOfApproval: u.array(),
247
+ remarks: p.string().trim().nullable()
248
+ });
249
+ function q(t) {
250
+ return K.superRefine((n, r) => {
251
+ t && n.proofOfApproval.length === 0 && r.addIssue({
252
+ code: "custom",
253
+ message: e.global.t("wise_invoicing.invoice.approve.proof_required"),
254
+ path: ["proofOfApproval"]
255
+ });
256
+ });
257
+ }
258
+ //#endregion
259
+ //#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue?vue&type=script&setup=true&lang.ts
260
+ var J = 26214400, Y = /* @__PURE__ */ v({
261
+ __name: "InvoiceApproveDialog",
262
+ props: {
263
+ approvalUuid: {},
264
+ invoiceUuid: {},
265
+ isProofOfApprovalRequired: { type: Boolean }
266
+ },
267
+ emits: ["close"],
268
+ setup(e, { emit: t }) {
269
+ let n = e, r = t, a = /* @__PURE__ */ new Set([
270
+ "application/pdf",
271
+ "image/png",
272
+ "image/jpeg"
273
+ ]), o = m(), c = I(), l = G(), u = L({
274
+ initialState: {
275
+ proofOfApproval: [],
276
+ remarks: null
277
+ },
278
+ schema: q(n.isProofOfApprovalRequired),
279
+ onSubmit: async (e) => {
280
+ let t = await l.execute({
281
+ body: e,
282
+ params: {
283
+ approvalUuid: n.approvalUuid,
284
+ invoiceUuid: n.invoiceUuid
285
+ }
286
+ });
287
+ if (t.isErr()) {
288
+ c.apiError(t.error);
289
+ return;
290
+ }
291
+ c.show({ message: o.t("wise_invoicing.invoice.approve.success") }), r("close");
292
+ },
293
+ onSubmitError: () => {
294
+ c.unableToSave();
295
+ }
296
+ }), p = u.register("proofOfApproval"), h = u.register("remarks");
297
+ function v(e) {
298
+ return a.has(e.type) ? e.size > J ? o.t("wise_invoicing.invoice.approve.proof_too_large") : !0 : o.t("wise_invoicing.invoice.approve.proof_invalid_type");
299
+ }
300
+ return (e, t) => (b(), g(x(k), {
301
+ form: x(u),
302
+ size: "sm",
303
+ onClose: t[0] ||= (e) => r("close")
304
+ }, {
305
+ default: S(() => [
306
+ _(x(O), {
307
+ title: x(o).t("wise_invoicing.invoice.approve.title"),
308
+ description: x(o).t("wise_invoicing.invoice.approve.description"),
309
+ icon: x(i),
310
+ "icon-variant": "success"
311
+ }, null, 8, [
312
+ "title",
313
+ "description",
314
+ "icon"
315
+ ]),
316
+ _(x(w), null, {
317
+ default: S(() => [_(x(A), null, {
318
+ default: S(() => [_(f, null, {
319
+ default: S(() => [_(x(j), y(x(s)(x(p)), {
320
+ accept: Array.from(x(a)),
321
+ description: x(o).t("wise_invoicing.invoice.approve.fields.proof_description"),
322
+ hint: x(o).t("wise_invoicing.invoice.approve.fields.proof_hint"),
323
+ "is-required": n.isProofOfApprovalRequired,
324
+ "is-valid-file": v,
325
+ preprocess: x(d).preprocess,
326
+ class: "w-full"
327
+ }), null, 16, [
328
+ "accept",
329
+ "description",
330
+ "hint",
331
+ "is-required",
332
+ "preprocess"
333
+ ])]),
334
+ _: 1
335
+ }), _(x(P), y(x(s)(x(h)), {
336
+ label: x(o).t("wise_invoicing.invoice.approve.fields.note"),
337
+ placeholder: x(o).t("wise_invoicing.invoice.approve.fields.note_placeholder")
338
+ }), null, 16, ["label", "placeholder"])]),
339
+ _: 1
340
+ })]),
341
+ _: 1
342
+ }),
343
+ _(x(T), null, {
344
+ default: S(() => [_(x(E)), _(x(M), { label: x(o).t("wise_invoicing.invoice.approve.submit") }, null, 8, ["label"])]),
345
+ _: 1
346
+ })
347
+ ]),
348
+ _: 1
349
+ }, 8, ["form"]));
350
+ }
351
+ }), X = /* @__PURE__ */ v({
352
+ inheritAttrs: !1,
353
+ __name: "InvoiceApproveDialogDataProvider",
354
+ props: {
355
+ approvalUuid: {},
356
+ invoiceUuid: {}
357
+ },
358
+ emits: ["close"],
359
+ setup(e, { emit: t }) {
360
+ let n = e, r = t, i = l();
361
+ return (e, t) => (b(), g(o, { queries: { issuerSettings: x(i) } }, {
362
+ default: S(({ data: i }) => [_(Y, y(e.$attrs, {
363
+ "approval-uuid": n.approvalUuid,
364
+ "invoice-uuid": n.invoiceUuid,
365
+ "is-proof-of-approval-required": i.issuerSettings.requiresInvoiceApprovalFile,
366
+ onClose: t[0] ||= (e) => r("close")
367
+ }), null, 16, [
368
+ "approval-uuid",
369
+ "invoice-uuid",
370
+ "is-proof-of-approval-required"
371
+ ])]),
372
+ _: 1
373
+ }, 8, ["queries"]));
374
+ }
375
+ });
376
+ //#endregion
377
+ export { z as i, W as n, U as r, X as t };