@wisemen/wise-invoicing-web 0.17.0 → 0.19.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 (55) hide show
  1. package/dist/{ApprovalReminderSettingsViewDataProvider-CSvHKx35.js → ApprovalReminderSettingsViewDataProvider-C1cI6KQq.js} +11 -11
  2. package/dist/{BillingDocumentDetailViewDataProvider-BSZiFFDZ.js → BillingDocumentDetailViewDataProvider-BZCFhsjA.js} +1338 -1317
  3. package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
  4. package/dist/{BillingDocumentPdf-DQWebrh4.js → BillingDocumentPdf-DMTwOlzG.js} +79 -79
  5. package/dist/{DunningCaseSendDialog-MJ8KSI2s.js → DunningCaseSendDialog-DfMYo2LV.js} +23 -23
  6. package/dist/{InvoiceApprovalOutOfSyncIndicator-BNlaBokg.js → InvoiceApprovalOutOfSyncIndicator-BjlBhzNg.js} +1 -1
  7. package/dist/{InvoiceApprovalOverviewView-2zmnNJJM.js → InvoiceApprovalOverviewView-BH5rJgk6.js} +22 -22
  8. package/dist/{InvoiceApprovalStatusBadge-C7-CrTtD.js → InvoiceApprovalStatusBadge-CaVSCtI0.js} +4 -4
  9. package/dist/{InvoicePdfView-DA34o3C4.js → InvoicePdfView-DRqX3P-X.js} +2 -2
  10. package/dist/{InvoicePublicProFormaPdfViewDataProvider-DljBWIFb.js → InvoicePublicProFormaPdfViewDataProvider-Dz2jGWVg.js} +3 -3
  11. package/dist/{InvoiceApproveDialogDataProvider-CclSNBDj.js → InvoiceRejectDialog-_5i8eFuk.js} +178 -178
  12. package/dist/{invoiceDeliveryStatus.util-CJGCDiFf.js → InvoiceStatusBadge-BI41yxpr.js} +72 -72
  13. package/dist/{InvoicingFileUploadProvider-B3ZzLMR8.js → InvoicingFileUploadProvider-rU9APFrt.js} +2 -2
  14. package/dist/IssuerSettingsViewDataProvider-nNg0lR7Y.js +544 -0
  15. package/dist/{PeppolSettingsViewDataProvider-BD2CGw2K.js → PeppolSettingsViewDataProvider-CFelH70Q.js} +32 -32
  16. package/dist/{api.util-BMza-ojm.js → api.util-sW4gNny-.js} +1 -0
  17. package/dist/{billingDocumentDetail.transformer-D8lwLPds.js → billingDocumentDetail.transformer-Ifa6tWtE.js} +14 -13
  18. package/dist/client/types.gen.d.ts +1 -0
  19. package/dist/client/zod.gen.d.ts +35 -0
  20. package/dist/{creditNoteDetail.query-8g2bZ21Y.js → creditNoteDetail.query-C4DvgGFR.js} +5 -3
  21. package/dist/{InvoiceDeliverySendDialog-BjFaLTOg.js → customFieldDefinitionIndex.query-BBqxMfvT.js} +272 -203
  22. package/dist/{deliveryReason.util-B9ZPSt7J.js → deliveryReason.util-KBh3q_-P.js} +2 -2
  23. package/dist/{dist-Ck8ZEByl.js → dist-47-1LAzT.js} +8 -8
  24. package/dist/{dist-ByzJNujV.js → dist-CyUNvdkD.js} +1 -1
  25. package/dist/{documentTitle.composable-QdSLs6eT.js → documentTitle.composable-Dl8Cm3v3.js} +1 -1
  26. package/dist/{i18n.lib-Bs40rct-.js → i18n.lib-DckceEsg.js} +4 -0
  27. package/dist/index.d.ts +8 -0
  28. package/dist/index.js +5974 -3081
  29. package/dist/{invoice.service-Dqj-rXA5.js → invoice.service-v9uIoFgR.js} +115 -113
  30. package/dist/{invoiceApproval.service-C4ZxwGB8.js → invoiceApproval.service-DXIKgCI_.js} +2 -2
  31. package/dist/{invoiceApprovalStatus.util-B6IhZXLq.js → invoiceApprovalStatus.util-CB5pi_hm.js} +2 -2
  32. package/dist/{invoiceCustomer.service-BNekA43U.js → invoiceCustomer.service-Bl4vN_U5.js} +2 -2
  33. package/dist/{invoiceDetail.query-xl08jVB3.js → invoiceDetail.query-MElhxTMM.js} +1 -1
  34. package/dist/{invoicingConfig.composable-B0Kj9ini.js → invoicingConfig.composable-D-hxnEnh.js} +2 -2
  35. package/dist/{issuerSettings.query-Cmt5oUiJ.js → issuerSettings.query-CR7EtvNm.js} +2 -2
  36. package/dist/libs/i18n.lib.d.ts +4 -0
  37. package/dist/locales/en-US.json.d.ts +2 -0
  38. package/dist/locales/nl-BE.json.d.ts +2 -0
  39. package/dist/models/billing-document/billingDocumentDetail.model.d.ts +1 -0
  40. package/dist/modules/credit-note/api/mutations/creditNoteUpdate.mutation.d.ts +1 -0
  41. package/dist/modules/credit-note/models/update/creditNoteUpdateForm.model.d.ts +1 -0
  42. package/dist/modules/invoice/api/mutations/invoiceUpdate.mutation.d.ts +1 -0
  43. package/dist/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.d.ts +1 -1
  44. package/dist/modules/invoice/models/invoice/update/invoiceUpdateForm.model.d.ts +1 -0
  45. package/dist/modules/invoice/use-cases/overview/components/InvoiceOverviewBulkActionBar.vue.d.ts +2 -2
  46. package/dist/{reminderConfig.query-DDLxE3no.js → reminderConfig.query-DJmhJp6W.js} +2 -2
  47. package/dist/style.css +1 -1
  48. package/dist/ui/billing-document/table/field/BillingDocumentLineItemsTableField.vue.d.ts +1 -1
  49. package/package.json +4 -4
  50. package/dist/CreditNoteDetailViewDataProvider-Bs8kadYX.js +0 -799
  51. package/dist/CreditNotePdfViewDataProvider-DxojGCdS.js +0 -22
  52. package/dist/InvoiceDetailViewDataProvider-DK5Tandr.js +0 -2167
  53. package/dist/InvoicePdfViewDataProvider-Bl7a578G.js +0 -22
  54. package/dist/IssuerSettingsViewDataProvider-BgpoLQZL.js +0 -544
  55. package/dist/download.util-LyRpGWKA.js +0 -25
@@ -1,15 +1,15 @@
1
- import "./api.util-BMza-ojm.js";
2
- import { a as e, o as t, t as n, y as r } from "./documentTitle.composable-QdSLs6eT.js";
1
+ import "./api.util-sW4gNny-.js";
2
+ import { a as e, o as t, t as n, y as r } from "./documentTitle.composable-Dl8Cm3v3.js";
3
3
  import { r as i } from "./useCurrencyFormat.composable-MtZaqKnO.js";
4
4
  import { t as a } from "./search.composable-CU9OpyUB.js";
5
5
  import { Ct as o, G as s, H as c, Q as l, R as u, S as d, Tt as f, W as p, Y as m, et as h, ft as ee, i as g, l as te } from "./dist-B33lNwLw.js";
6
- import { r as _ } from "./dist-ByzJNujV.js";
7
- import { f as v, i as y, n as ne, o as re, r as b, s as ie } from "./dist-Ck8ZEByl.js";
8
- import { t as x } from "./invoiceApprovalStatus.util-B6IhZXLq.js";
9
- import { n as ae, t as S } from "./InvoiceApprovalOutOfSyncIndicator-BNlaBokg.js";
10
- import { t as C } from "./InvoiceApprovalStatusBadge-C7-CrTtD.js";
11
- import { i as w, n as T, r as E, t as D } from "./InvoiceApproveDialogDataProvider-CclSNBDj.js";
12
- import { t as O } from "./invoiceApproval.service-C4ZxwGB8.js";
6
+ import { r as _ } from "./dist-CyUNvdkD.js";
7
+ import { t as v } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
8
+ import { t as y } from "./InvoiceApprovalStatusBadge-CaVSCtI0.js";
9
+ import { f as b, i as x, n as ne, o as re, r as ie, s as ae } from "./dist-47-1LAzT.js";
10
+ import { i as S, n as C, r as w, t as T } from "./InvoiceRejectDialog-_5i8eFuk.js";
11
+ import { n as E, t as D } from "./InvoiceApprovalOutOfSyncIndicator-BjlBhzNg.js";
12
+ import { t as O } from "./invoiceApproval.service-DXIKgCI_.js";
13
13
  import { useI18n as k } from "vue-i18n";
14
14
  import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createVNode as I, defineComponent as L, isRef as oe, nextTick as R, normalizeClass as z, normalizeStyle as se, openBlock as B, ref as ce, renderList as V, resolveDynamicComponent as le, unref as H, withCtx as U } from "vue";
15
15
  import { useOffsetInfiniteQuery as ue } from "@wisemen/vue-core-api-utils";
@@ -41,7 +41,7 @@ function Te() {
41
41
  //#endregion
42
42
  //#region src/modules/invoice-approval/actions/invoiceApprovalReject.action.ts
43
43
  function Ee() {
44
- let e = k(), t = Z().create(E);
44
+ let e = k(), t = Z().create(T);
45
45
  return Q({
46
46
  id: "invoice-approval-reject",
47
47
  isApplicable: (e) => e.hasTargetedModelsOfType("InvoiceApproval") ? e.targetedModelOfTypeOrThrow("InvoiceApproval").approval.status === r.REQUESTED : !1,
@@ -62,7 +62,7 @@ function De(e) {
62
62
  return e.approval.status === r.REJECTED || e.approval.status === r.EXPIRED || e.hasChangesSinceApprovalSent;
63
63
  }
64
64
  function Oe() {
65
- let e = k(), t = Ce(), n = T();
65
+ let e = k(), t = Ce(), n = S();
66
66
  return Q({
67
67
  id: "invoice-approval-send-request",
68
68
  isApplicable: (e) => e.hasTargetedModelsOfType("InvoiceApproval") ? De(e.targetedModelOfTypeOrThrow("InvoiceApproval")) : !1,
@@ -321,11 +321,11 @@ function Fe(e) {
321
321
  //#endregion
322
322
  //#region src/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewFilters.composable.ts
323
323
  function Ie() {
324
- let e = k(), t = a({ debounceMs: 250 }), n = ae({ params: { search: t.debouncedSearch } }), r = j(() => n.result.value.isOk() ? n.result.value.getValue().data : []), i = y({
324
+ let e = k(), t = a({ debounceMs: 250 }), n = E({ params: { search: t.debouncedSearch } }), r = j(() => n.result.value.isOk() ? n.result.value.getValue().data : []), i = x({
325
325
  actionGroup: { name: "invoice-approvals" },
326
- filters: [v({
326
+ filters: [b({
327
327
  defaultValue: {
328
- operator: b.INCLUDES,
328
+ operator: ie.INCLUDES,
329
329
  value: []
330
330
  },
331
331
  disableOperators: !0,
@@ -343,13 +343,13 @@ function Ie() {
343
343
  //#endregion
344
344
  //#region src/modules/invoice-approval/actions/invoiceApprovalMarkAsApproved.action.ts
345
345
  function Le() {
346
- let e = k(), t = Z().create(D);
346
+ let e = k(), t = Z().create(C);
347
347
  return Q({
348
348
  id: "invoice-approval-mark-as-approved",
349
349
  isApplicable: (e) => {
350
350
  if (!e.hasTargetedModelsOfType("InvoiceApproval")) return !1;
351
351
  let t = e.targetedModelOfTypeOrThrow("InvoiceApproval");
352
- return x.canMarkAsApproved(t.approval.status);
352
+ return v.canMarkAsApproved(t.approval.status);
353
353
  },
354
354
  name: () => e.t("wise_invoicing.invoice.detail.actions.mark_as_approved"),
355
355
  execute: async (e) => {
@@ -459,7 +459,7 @@ var Re = /* @__PURE__ */ L({
459
459
  }), s = j(() => {
460
460
  let e = t.item.approval, i = e.reminderSentAt;
461
461
  return i !== null && e.level !== null ? n.t("wise_invoicing.invoice_approval.overview.last_reminder", {
462
- level: n.t(x.getReminderLevelTranslationKey(e.level)),
462
+ level: n.t(v.getReminderLevelTranslationKey(e.level)),
463
463
  time: r.toRelativeTime(i)
464
464
  }) : e.sentAt === null ? n.t("wise_invoicing.invoice_approval.overview.not_sent_yet") : n.t("wise_invoicing.invoice_approval.overview.request_sent", { time: r.toRelativeTime(e.sentAt) });
465
465
  }), c = {
@@ -510,7 +510,7 @@ var Re = /* @__PURE__ */ L({
510
510
  align: "center",
511
511
  gap: "xs"
512
512
  }, {
513
- default: U(() => [i.value === null ? (B(), M(C, {
513
+ default: U(() => [i.value === null ? (B(), M(y, {
514
514
  key: 1,
515
515
  approval: t.item.approval,
516
516
  rejection: t.item.rejectionReason === null ? null : {
@@ -529,7 +529,7 @@ var Re = /* @__PURE__ */ L({
529
529
  class: "text-xs text-primary"
530
530
  }, null, 8, ["text"])]),
531
531
  _: 1
532
- })), t.item.hasChangesSinceApprovalSent ? (B(), M(S, { key: 2 })) : N("", !0)]),
532
+ })), t.item.hasChangesSinceApprovalSent ? (B(), M(D, { key: 2 })) : N("", !0)]),
533
533
  _: 1
534
534
  })]),
535
535
  _: 1
@@ -595,7 +595,7 @@ var Je = /* @__PURE__ */ L({
595
595
  setup(e) {
596
596
  let t = k(), r = n(), i = we("tab", "awaiting"), a = ce(!0), { customerUuid: s, filters: u } = Ie();
597
597
  ne(u);
598
- let { hasCountError: f, isFetchingNextPage: h, isLoading: g, counts: _, data: v, error: y, fetchNextPage: b, needsAttentionTotal: x, reminderCountTotal: ae, tabCounts: S } = Fe({
598
+ let { hasCountError: f, isFetchingNextPage: h, isLoading: g, counts: _, data: v, error: y, fetchNextPage: b, needsAttentionTotal: x, reminderCountTotal: ie, tabCounts: S } = Fe({
599
599
  customerUuid: s,
600
600
  activeTab: j(() => i.value)
601
601
  }), C = j(() => u.activeFilters.value.length), w = j(() => [
@@ -689,7 +689,7 @@ var Je = /* @__PURE__ */ L({
689
689
  "needs-attention-total": H(x),
690
690
  "out-of-sync-count": H(_).outOfSync,
691
691
  "rejected-count": H(_).rejected,
692
- "reminder-count-total": H(ae),
692
+ "reminder-count-total": H(ie),
693
693
  "reminder-one-count": H(_).reminderOne,
694
694
  "reminder-two-count": H(_).reminderTwo,
695
695
  onShowOutOfSync: n[1] ||= (e) => i.value = "out-of-sync",
@@ -753,7 +753,7 @@ var Je = /* @__PURE__ */ L({
753
753
  key: 0,
754
754
  text: H(t).t("wise_invoicing.common.no_active_filters"),
755
755
  class: "px-sm text-xs text-secondary"
756
- }, null, 8, ["text"])) : (B(), M(H(re), { key: 1 })), I(H(ie))]),
756
+ }, null, 8, ["text"])) : (B(), M(H(re), { key: 1 })), I(H(ae))]),
757
757
  _: 1
758
758
  }),
759
759
  F.value ? (B(), M(H(he), {
@@ -1,8 +1,8 @@
1
- import "./api.util-BMza-ojm.js";
2
- import { a as e, o as t } from "./documentTitle.composable-QdSLs6eT.js";
1
+ import "./api.util-sW4gNny-.js";
2
+ import { a as e, o as t } from "./documentTitle.composable-Dl8Cm3v3.js";
3
3
  import { $ as n, S as r } from "./dist-B33lNwLw.js";
4
- import { r as i } from "./dist-ByzJNujV.js";
5
- import { t as a } from "./invoiceApprovalStatus.util-B6IhZXLq.js";
4
+ import { r as i } from "./dist-CyUNvdkD.js";
5
+ import { t as a } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
6
6
  import { useI18n as o } from "vue-i18n";
7
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
8
  import { UIBadge as b, UIText as x, UITooltip as S, UITooltipContent as C } from "@wisemen/vue-core-design-system";
@@ -1,5 +1,5 @@
1
- import { t as e } from "./documentTitle.composable-QdSLs6eT.js";
2
- import { t } from "./BillingDocumentPdf-DQWebrh4.js";
1
+ import { t as e } from "./documentTitle.composable-Dl8Cm3v3.js";
2
+ import { t } from "./BillingDocumentPdf-DMTwOlzG.js";
3
3
  import { useI18n as n } from "vue-i18n";
4
4
  import { computed as r, createElementBlock as i, createVNode as a, defineComponent as o, openBlock as s } from "vue";
5
5
  //#region src/modules/invoice/use-cases/pdf/views/InvoicePdfView.vue?vue&type=script&setup=true&lang.ts
@@ -1,7 +1,7 @@
1
- import { n as e } from "./invoicingConfig.composable-B0Kj9ini.js";
2
- import { t } from "./invoice.service-Dqj-rXA5.js";
1
+ import { n as e } from "./invoicingConfig.composable-D-hxnEnh.js";
2
+ import { t } from "./invoice.service-v9uIoFgR.js";
3
3
  import { t as n } from "./DataProvider-BtnD-BzI.js";
4
- import { t as r } from "./InvoicePdfView-DA34o3C4.js";
4
+ import { t as r } from "./InvoicePdfView-DRqX3P-X.js";
5
5
  import { useI18n as i } from "vue-i18n";
6
6
  import { computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, openBlock as d, resolveDynamicComponent as f, unref as p, watch as m, withCtx as h } from "vue";
7
7
  import { useQuery as g } from "@wisemen/vue-core-api-utils";
@@ -1,21 +1,34 @@
1
- import { t as e } from "./i18n.lib-Bs40rct-.js";
2
- import "./api.util-BMza-ojm.js";
3
- import { v as t } from "./documentTitle.composable-QdSLs6eT.js";
4
- import { t as n } from "./invoice.service-Dqj-rXA5.js";
1
+ import { t as e } from "./i18n.lib-DckceEsg.js";
2
+ import "./api.util-sW4gNny-.js";
3
+ import { v as t } from "./documentTitle.composable-Dl8Cm3v3.js";
4
+ import { t as n } from "./invoice.service-v9uIoFgR.js";
5
5
  import { G as r, ft as i, xt as a } from "./dist-B33lNwLw.js";
6
- import { t as o } from "./DataProvider-BtnD-BzI.js";
7
- import { t as s } from "./formango.util-D5c2ql--.js";
8
- import { t as c } from "./invoiceApprovalStatus.util-B6IhZXLq.js";
9
- import { t as l } from "./issuerSettings.query-Cmt5oUiJ.js";
10
- import { n as u, r as d, t as f } from "./InvoicingFileUploadProvider-B3ZzLMR8.js";
6
+ import { n as o, r as s, t as c } from "./InvoicingFileUploadProvider-rU9APFrt.js";
7
+ import { t as l } from "./formango.util-D5c2ql--.js";
8
+ import { t as u } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
9
+ import { t as d } from "./DataProvider-BtnD-BzI.js";
10
+ import { t as f } from "./issuerSettings.query-CR7EtvNm.js";
11
11
  import { z as p } from "zod";
12
12
  import { useI18n as m } from "vue-i18n";
13
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
14
  import { useMutation as C } from "@wisemen/vue-core-api-utils";
15
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
16
  import { useForm as L } from "formango";
17
- //#region src/modules/invoice/api/mutations/invoiceArchiveApproval.mutation.ts
17
+ //#region src/modules/invoice/api/mutations/invoiceSendApproval.mutation.ts
18
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() {
19
32
  return C({
20
33
  queryFn: (e) => n.archiveApproval(e.params.approvalUuid),
21
34
  queryKeysToInvalidate: {
@@ -28,7 +41,7 @@ function R() {
28
41
  }
29
42
  //#endregion
30
43
  //#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalArchiveDialog.vue
31
- var z = /* @__PURE__ */ v({
44
+ var B = /* @__PURE__ */ v({
32
45
  __name: "InvoiceApprovalArchiveDialog",
33
46
  props: {
34
47
  approvalUuid: {},
@@ -36,7 +49,7 @@ var z = /* @__PURE__ */ v({
36
49
  },
37
50
  emits: ["close"],
38
51
  setup(e, { emit: t }) {
39
- let n = e, i = t, a = m(), o = I(), s = R(), c = L({
52
+ let n = e, i = t, a = m(), o = I(), s = z(), c = L({
40
53
  initialState: {},
41
54
  schema: p.object({}),
42
55
  onSubmit: async () => {
@@ -73,151 +86,8 @@ var z = /* @__PURE__ */ v({
73
86
  }
74
87
  });
75
88
  //#endregion
76
- //#region src/modules/invoice/api/mutations/invoiceRejectApproval.mutation.ts
77
- function B() {
78
- return C({
79
- queryFn: (e) => n.rejectApproval(e.params.approvalUuid, e.body),
80
- queryKeysToInvalidate: {
81
- invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
82
- invoiceApprovalIndex: {},
83
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
84
- invoiceIndex: {}
85
- }
86
- });
87
- }
88
- var V = p.object({
89
- attachments: u.array(),
90
- reason: p.enum(t).nullable(),
91
- remarks: p.string().trim().max(500).nullable()
92
- }).superRefine((n, r) => {
93
- n.reason === null ? r.addIssue({
94
- code: "custom",
95
- message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
96
- path: ["reason"]
97
- }) : n.reason === t.OTHER && (n.remarks ?? "") === "" && r.addIssue({
98
- code: "custom",
99
- message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
100
- path: ["remarks"]
101
- });
102
- }), H = 10485760, U = /* @__PURE__ */ v({
103
- __name: "InvoiceRejectDialog",
104
- props: {
105
- approvalUuid: {},
106
- invoiceUuid: {}
107
- },
108
- emits: ["close"],
109
- setup(e, { emit: n }) {
110
- let r = e, a = n, o = m(), l = I(), u = B(), p = L({
111
- initialState: {
112
- attachments: [],
113
- reason: null,
114
- remarks: null
115
- },
116
- schema: V,
117
- onSubmit: async (e) => {
118
- let t = await u.execute({
119
- body: e,
120
- params: {
121
- approvalUuid: r.approvalUuid,
122
- invoiceUuid: r.invoiceUuid
123
- }
124
- });
125
- t.isErr() ? l.apiError(t.error) : (l.show({ message: o.t("wise_invoicing.invoice.reject.success") }), a("close"));
126
- },
127
- onSubmitError: () => {
128
- l.unableToSave();
129
- }
130
- }), 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]));
131
- function z(e) {
132
- return o.t(c.getRejectionReasonTranslationKey(e));
133
- }
134
- let U = h(() => C.modelValue.value === t.OTHER);
135
- function W(e) {
136
- return e.size > H ? o.t("wise_invoicing.invoice.reject.attachment_too_large") : !0;
137
- }
138
- return (e, t) => (b(), g(x(k), {
139
- form: x(p),
140
- size: "sm",
141
- onClose: t[0] ||= (e) => a("close")
142
- }, {
143
- default: S(() => [
144
- _(x(O), {
145
- title: x(o).t("wise_invoicing.invoice.reject.title"),
146
- description: x(o).t("wise_invoicing.invoice.reject.description"),
147
- icon: x(i),
148
- "icon-variant": "warning"
149
- }, null, 8, [
150
- "title",
151
- "description",
152
- "icon"
153
- ]),
154
- _(x(w), null, {
155
- default: S(() => [_(x(A), null, {
156
- default: S(() => [
157
- _(x(N), y(x(s)(x(C)), {
158
- "display-fn": z,
159
- "is-required": !0,
160
- items: R.value,
161
- label: x(o).t("wise_invoicing.invoice.reject.fields.reason")
162
- }), null, 16, ["items", "label"]),
163
- _(x(P), y(x(s)(x(D)), {
164
- "is-required": U.value,
165
- label: x(o).t("wise_invoicing.invoice.reject.fields.remark"),
166
- placeholder: x(o).t("wise_invoicing.invoice.reject.fields.remark_placeholder")
167
- }), null, 16, [
168
- "is-required",
169
- "label",
170
- "placeholder"
171
- ]),
172
- _(f, null, {
173
- default: S(() => [_(x(j), y(x(s)(x(v)), {
174
- accept: [
175
- "application/pdf",
176
- "image/png",
177
- "image/jpeg"
178
- ],
179
- description: x(o).t("wise_invoicing.invoice.reject.fields.attachment_description"),
180
- hint: x(o).t("wise_invoicing.invoice.reject.fields.attachment_hint"),
181
- "is-valid-file": W,
182
- preprocess: x(d).preprocess,
183
- class: "w-full"
184
- }), null, 16, [
185
- "description",
186
- "hint",
187
- "preprocess"
188
- ])]),
189
- _: 1
190
- })
191
- ]),
192
- _: 1
193
- })]),
194
- _: 1
195
- }),
196
- _(x(T), null, {
197
- default: S(() => [_(x(E)), _(x(M), { label: x(o).t("wise_invoicing.invoice.reject.submit") }, null, 8, ["label"])]),
198
- _: 1
199
- })
200
- ]),
201
- _: 1
202
- }, 8, ["form"]));
203
- }
204
- });
205
- //#endregion
206
- //#region src/modules/invoice/api/mutations/invoiceSendApproval.mutation.ts
207
- function W() {
208
- return C({
209
- queryFn: (e) => e.params.hasActiveApproval ? n.restartApproval(e.params.invoiceUuid) : n.sendApproval(e.params.invoiceUuid),
210
- queryKeysToInvalidate: {
211
- invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
212
- invoiceApprovalIndex: {},
213
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
214
- invoiceIndex: {}
215
- }
216
- });
217
- }
218
- //#endregion
219
89
  //#region src/modules/invoice/api/mutations/invoiceApproveApproval.mutation.ts
220
- function G() {
90
+ function V() {
221
91
  return C({
222
92
  queryFn: (e) => n.approveApproval(e.params.approvalUuid, e.body),
223
93
  queryKeysToInvalidate: {
@@ -230,12 +100,12 @@ function G() {
230
100
  }
231
101
  //#endregion
232
102
  //#region src/modules/invoice/models/invoice/approval/invoiceApproveForm.model.ts
233
- var K = p.object({
234
- proofOfApproval: u.array(),
103
+ var H = p.object({
104
+ proofOfApproval: o.array(),
235
105
  remarks: p.string().trim().nullable()
236
106
  });
237
- function q(t) {
238
- return K.superRefine((n, r) => {
107
+ function U(t) {
108
+ return H.superRefine((n, r) => {
239
109
  t && n.proofOfApproval.length === 0 && r.addIssue({
240
110
  code: "custom",
241
111
  message: e.global.t("wise_invoicing.invoice.approve.proof_required"),
@@ -245,7 +115,7 @@ function q(t) {
245
115
  }
246
116
  //#endregion
247
117
  //#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue?vue&type=script&setup=true&lang.ts
248
- var J = 26214400, Y = /* @__PURE__ */ v({
118
+ var W = 26214400, G = /* @__PURE__ */ v({
249
119
  __name: "InvoiceApproveDialog",
250
120
  props: {
251
121
  approvalUuid: {},
@@ -258,31 +128,31 @@ var J = 26214400, Y = /* @__PURE__ */ v({
258
128
  "application/pdf",
259
129
  "image/png",
260
130
  "image/jpeg"
261
- ]), o = m(), c = I(), l = G(), u = L({
131
+ ]), o = m(), u = I(), d = V(), f = L({
262
132
  initialState: {
263
133
  proofOfApproval: [],
264
134
  remarks: null
265
135
  },
266
- schema: q(n.isProofOfApprovalRequired),
136
+ schema: U(n.isProofOfApprovalRequired),
267
137
  onSubmit: async (e) => {
268
- let t = await l.execute({
138
+ let t = await d.execute({
269
139
  body: e,
270
140
  params: {
271
141
  approvalUuid: n.approvalUuid,
272
142
  invoiceUuid: n.invoiceUuid
273
143
  }
274
144
  });
275
- t.isErr() ? c.apiError(t.error) : (c.show({ message: o.t("wise_invoicing.invoice.approve.success") }), r("close"));
145
+ t.isErr() ? u.apiError(t.error) : (u.show({ message: o.t("wise_invoicing.invoice.approve.success") }), r("close"));
276
146
  },
277
147
  onSubmitError: () => {
278
- c.unableToSave();
148
+ u.unableToSave();
279
149
  }
280
- }), p = u.register("proofOfApproval"), h = u.register("remarks");
150
+ }), p = f.register("proofOfApproval"), h = f.register("remarks");
281
151
  function v(e) {
282
- return i.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");
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");
283
153
  }
284
154
  return (e, t) => (b(), g(x(k), {
285
- form: x(u),
155
+ form: x(f),
286
156
  size: "sm",
287
157
  onClose: t[0] ||= (e) => r("close")
288
158
  }, {
@@ -299,14 +169,14 @@ var J = 26214400, Y = /* @__PURE__ */ v({
299
169
  ]),
300
170
  _(x(w), null, {
301
171
  default: S(() => [_(x(A), null, {
302
- default: S(() => [_(f, null, {
303
- default: S(() => [_(x(j), y(x(s)(x(p)), {
172
+ default: S(() => [_(c, null, {
173
+ default: S(() => [_(x(j), y(x(l)(x(p)), {
304
174
  accept: Array.from(x(i)),
305
175
  description: x(o).t("wise_invoicing.invoice.approve.fields.proof_description"),
306
176
  hint: x(o).t("wise_invoicing.invoice.approve.fields.proof_hint"),
307
177
  "is-required": n.isProofOfApprovalRequired,
308
178
  "is-valid-file": v,
309
- preprocess: x(d).preprocess,
179
+ preprocess: x(s).preprocess,
310
180
  class: "w-full"
311
181
  }), null, 16, [
312
182
  "accept",
@@ -316,7 +186,7 @@ var J = 26214400, Y = /* @__PURE__ */ v({
316
186
  "preprocess"
317
187
  ])]),
318
188
  _: 1
319
- }), _(x(P), y(x(s)(x(h)), {
189
+ }), _(x(P), y(x(l)(x(h)), {
320
190
  label: x(o).t("wise_invoicing.invoice.approve.fields.note"),
321
191
  placeholder: x(o).t("wise_invoicing.invoice.approve.fields.note_placeholder")
322
192
  }), null, 16, ["label", "placeholder"])]),
@@ -332,7 +202,7 @@ var J = 26214400, Y = /* @__PURE__ */ v({
332
202
  _: 1
333
203
  }, 8, ["form"]));
334
204
  }
335
- }), X = /* @__PURE__ */ v({
205
+ }), K = /* @__PURE__ */ v({
336
206
  inheritAttrs: !1,
337
207
  __name: "InvoiceApproveDialogDataProvider",
338
208
  props: {
@@ -341,9 +211,9 @@ var J = 26214400, Y = /* @__PURE__ */ v({
341
211
  },
342
212
  emits: ["close"],
343
213
  setup(e, { emit: t }) {
344
- let n = e, r = t, i = l();
345
- return (e, t) => (b(), g(o, { queries: { issuerSettings: x(i) } }, {
346
- default: S(({ data: i }) => [_(Y, y(e.$attrs, {
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, {
347
217
  "approval-uuid": n.approvalUuid,
348
218
  "invoice-uuid": n.invoiceUuid,
349
219
  "is-proof-of-approval-required": i.issuerSettings.requiresInvoiceApprovalFile,
@@ -358,4 +228,134 @@ var J = 26214400, Y = /* @__PURE__ */ v({
358
228
  }
359
229
  });
360
230
  //#endregion
361
- export { z as i, W as n, U as r, X as t };
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 };