@wisemen/wise-invoicing-web 0.1.0 → 0.2.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 (207) hide show
  1. package/dist/ApprovalReminderSettingsViewDataProvider-D-qXZrPT.js +151 -0
  2. package/dist/{BillingDocumentDetailViewDataProvider-BemnzVNY.js → BillingDocumentDetailViewDataProvider-DDdtlW-2.js} +1417 -1459
  3. package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
  4. package/dist/{BillingDocumentPdf-5vi2pgRM.js → BillingDocumentPdf-ehdFB6mr.js} +4 -4
  5. package/dist/{CreditNoteDetailViewDataProvider-BuY9ELoK.js → CreditNoteDetailViewDataProvider-11a-JO3H.js} +201 -201
  6. package/dist/{CreditNotePdfViewDataProvider-DI4eQkpM.js → CreditNotePdfViewDataProvider-bfeaya3P.js} +3 -3
  7. package/dist/{CustomFieldValueText-BGbQwhON.js → CustomFieldValueText-CZQXGE5F.js} +81 -81
  8. package/dist/DataProvider-C3uEds9v.js +75 -0
  9. package/dist/{DunningCaseDetailViewDataProvider-DKuuysqS.js → DunningCaseDetailViewDataProvider-DC-ziMoO.js} +35 -35
  10. package/dist/{DunningCaseOverviewView-aWttPLrC.js → DunningCaseOverviewView-y_bCmi5j.js} +180 -180
  11. package/dist/{DunningCaseReminderPdfViewDataProvider-I0I_WQQB.js → DunningCaseReminderPdfViewDataProvider-DNODfED_.js} +22 -23
  12. package/dist/{DunningCaseSendDialog-DyvA5R1p.js → DunningCaseSendDialog-BPXcqit5.js} +82 -82
  13. package/dist/InvoiceApprovalOverviewView-DZ14mi4L.js +870 -0
  14. package/dist/InvoiceApprovalStatusBadge-U-dW2hR4.js +161 -0
  15. package/dist/InvoiceApproveDialog-2LXneG2r.js +308 -0
  16. package/dist/InvoiceDetailViewDataProvider-BYeaaQzL.js +2156 -0
  17. package/dist/InvoiceOverviewBulkSendApprovalDialog-99dfuN4i.js +318 -0
  18. package/dist/InvoiceOverviewViewDataProvider-CZIQeftL.js +1620 -0
  19. package/dist/{InvoicePdfView-C-7m2g3b.js → InvoicePdfView-BJRTg_TH.js} +2 -2
  20. package/dist/{InvoicePdfViewDataProvider-BPiK110e.js → InvoicePdfViewDataProvider-CwI_uGm3.js} +4 -4
  21. package/dist/InvoicePublicPdfViewDataProvider-uZUfsr5K.js +45 -0
  22. package/dist/InvoicingFileUploadProvider-D9Xk4rQM.js +94 -0
  23. package/dist/{IssuerSettingsViewDataProvider-COqHGUE6.js → IssuerSettingsViewDataProvider-CGRa8F-2.js} +4 -4
  24. package/dist/{ReminderSettingsViewDataProvider-Dys4bUU7.js → ReminderSettingsViewDataProvider-1ucp3z2T.js} +58 -58
  25. package/dist/{api.util-BCSgCfpS.js → api.util-C_kMGlJN.js} +1456 -846
  26. package/dist/{billingDocumentDetail.transformer-BBn9R_cx.js → billingDocumentDetail.transformer-Da6_-Hv9.js} +58 -59
  27. package/dist/client/index.d.ts +2 -2
  28. package/dist/client/sdk.gen.d.ts +18 -1
  29. package/dist/client/types.gen.d.ts +1059 -106
  30. package/dist/client/zod.gen.d.ts +32759 -16136
  31. package/dist/{creditNoteDetail.query-BcPsB96h.js → creditNoteDetail.query-DLR7L0Ep.js} +30 -30
  32. package/dist/{dist-BBjpqvUl.js → dist-CoztMdYH.js} +614 -614
  33. package/dist/{dist-D9lp7NDv.js → dist-Cxdm09Lp.js} +210 -98
  34. package/dist/{documentTitle.composable-4ApFl9TZ.js → documentTitle.composable-DsBbzhXN.js} +23 -15
  35. package/dist/{customFieldValue.util-BwsX8exl.js → download.util-B5Q7KUC9.js} +6 -6
  36. package/dist/{i18n.lib-C6eb-F-e.js → i18n.lib-Cvr8pcDw.js} +272 -8
  37. package/dist/index.d.ts +297 -31
  38. package/dist/index.js +344 -324
  39. package/dist/invoice.service-DEEA9mal.js +745 -0
  40. package/dist/invoiceApproval.service-DvL3LliM.js +72 -0
  41. package/dist/invoiceApprovalStatus.util-3Zh10Pj8.js +79 -0
  42. package/dist/invoiceDeliveryStatus.util-nCsqDypY.js +211 -0
  43. package/dist/{invoiceDetail.query-Cek8nyaw.js → invoiceDetail.query-CRoH_SgM.js} +1 -1
  44. package/dist/{invoicingConfig.composable-DTmad1fe.js → invoicingConfig.composable-rxjGK882.js} +2 -2
  45. package/dist/{issuerSettings.query-Bvz-Oj5D.js → issuerSettings.query-Dc5gsaEm.js} +5 -5
  46. package/dist/libs/i18n.lib.d.ts +270 -6
  47. package/dist/locales/en-US.json.d.ts +136 -4
  48. package/dist/locales/nl-BE.json.d.ts +136 -4
  49. package/dist/modules/dunning-case/models/dunningCase.transformer.d.ts +0 -1
  50. package/dist/modules/invoice/api/mutations/invoiceApproveApproval.mutation.d.ts +16 -0
  51. package/dist/modules/invoice/api/mutations/invoiceArchiveApproval.mutation.d.ts +6 -0
  52. package/dist/modules/invoice/api/mutations/invoiceBulkSendApproval.mutation.d.ts +5 -0
  53. package/dist/modules/invoice/api/mutations/invoiceMarkAsPriorApprovalRequired.mutation.d.ts +4 -0
  54. package/dist/modules/invoice/api/mutations/invoiceRejectApproval.mutation.d.ts +9 -0
  55. package/dist/modules/invoice/api/mutations/invoiceRestoreFromProForma.mutation.d.ts +4 -0
  56. package/dist/modules/invoice/api/mutations/invoiceSendApproval.mutation.d.ts +5 -0
  57. package/dist/modules/invoice/api/mutations/invoiceUnmarkAsPriorApprovalRequired.mutation.d.ts +4 -0
  58. package/dist/modules/invoice/api/services/invoice.service.d.ts +14 -1
  59. package/dist/modules/invoice/components/InvoiceApprovalOutOfSyncIndicator.vue.d.ts +3 -0
  60. package/dist/{ui/DisplayState.vue.d.ts → modules/invoice/components/InvoiceApprovalStatusBadge.vue.d.ts} +7 -10
  61. package/dist/modules/invoice/components/InvoiceApprovalStatusChip.vue.d.ts +16 -0
  62. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalTransformers.spec.d.ts +1 -0
  63. package/dist/modules/invoice/models/invoice/approval/invoiceApprovalUuid.model.d.ts +3 -0
  64. package/dist/modules/invoice/models/invoice/approval/invoiceApprove.transformer.d.ts +5 -0
  65. package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.d.ts +13 -0
  66. package/dist/modules/invoice/models/invoice/approval/invoiceReject.transformer.d.ts +5 -0
  67. package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.d.ts +7 -0
  68. package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.spec.d.ts +1 -0
  69. package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +13 -1
  70. package/dist/modules/invoice/models/invoice/detail/invoiceDetail.transformer.d.ts +1 -0
  71. package/dist/modules/invoice/models/invoice/index/invoiceIndex.model.d.ts +4 -0
  72. package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.model.d.ts +3 -0
  73. package/dist/modules/invoice/models/invoice/invoiceApproval.transformer.d.ts +7 -0
  74. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.model.d.ts +34 -0
  75. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.util.d.ts +10 -0
  76. package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.util.spec.d.ts +1 -0
  77. package/dist/modules/invoice/use-cases/detail/components/InvoiceApprovalBanner.vue.d.ts +19 -0
  78. package/dist/modules/invoice/use-cases/detail/components/InvoiceDetailHeaderSection.vue.d.ts +4 -0
  79. package/dist/modules/invoice/use-cases/detail/composables/invoiceDetailHeaderActions.composable.d.ts +5 -0
  80. package/dist/modules/invoice/use-cases/detail/composables/invoiceDetailPaymentsTableColumns.composable.d.ts +1 -1
  81. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalArchiveDialog.vue.d.ts +13 -0
  82. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalRevertDialog.vue.d.ts +15 -0
  83. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue.d.ts +13 -0
  84. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceFinalizeOutOfSyncDialog.vue.d.ts +21 -0
  85. package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceRejectDialog.vue.d.ts +13 -0
  86. package/dist/modules/invoice/use-cases/overview/components/InvoiceOverviewBulkActionBar.vue.d.ts +3 -0
  87. package/dist/modules/invoice/use-cases/overview/components/InvoiceOverviewTableApprovalCell.vue.d.ts +9 -0
  88. package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewDataTableFilters.composable.d.ts +3 -0
  89. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +1 -0
  90. package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendApprovalDialog.vue.d.ts +12 -0
  91. package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.d.ts +2 -0
  92. package/dist/modules/invoice/use-cases/overview/views/InvoiceOverviewView.vue.d.ts +0 -5
  93. package/dist/modules/invoice-approval/actions/invoiceApproval.actions.d.ts +5 -0
  94. package/dist/modules/invoice-approval/actions/invoiceApprovalArchive.action.d.ts +1 -0
  95. package/dist/modules/invoice-approval/actions/invoiceApprovalMarkAsApproved.action.d.ts +1 -0
  96. package/dist/modules/invoice-approval/actions/invoiceApprovalReject.action.d.ts +1 -0
  97. package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.action.d.ts +1 -0
  98. package/dist/modules/invoice-approval/actions/invoiceApprovalUnmarkAsNeedsApproval.action.d.ts +1 -0
  99. package/dist/modules/invoice-approval/api/mutations/approvalReminderConfigUpdate.mutation.d.ts +8 -0
  100. package/dist/modules/invoice-approval/api/queries/approvalReminderConfig.query.d.ts +1 -0
  101. package/dist/modules/invoice-approval/api/queries/invoiceApprovalIndex.query.d.ts +3 -0
  102. package/dist/modules/invoice-approval/api/query-keys/invoiceApproval.queryKeys.d.ts +15 -0
  103. package/dist/modules/invoice-approval/api/services/invoiceApproval.service.d.ts +10 -0
  104. package/dist/modules/invoice-approval/components/InvoiceApprovalReminderLevelIndicator.vue.d.ts +7 -0
  105. package/dist/modules/invoice-approval/models/approvalReminderConfig.transformer.d.ts +6 -0
  106. package/dist/modules/invoice-approval/models/approvalReminderConfigForm.model.d.ts +11 -0
  107. package/dist/modules/invoice-approval/models/approvalReminderConfigForm.spec.d.ts +1 -0
  108. package/dist/modules/invoice-approval/models/invoiceApprovalIndex.model.d.ts +21 -0
  109. package/dist/modules/invoice-approval/models/invoiceApprovalIndex.transformer.d.ts +5 -0
  110. package/dist/modules/invoice-approval/models/invoiceApprovalIndexQueryParams.model.d.ts +9 -0
  111. package/dist/modules/invoice-approval/models/invoiceApprovalIndexQueryParams.transformer.d.ts +6 -0
  112. package/dist/modules/invoice-approval/routes/invoiceApproval.routes.d.ts +24 -0
  113. package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewActionsCell.vue.d.ts +7 -0
  114. package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewAmountCell.vue.d.ts +7 -0
  115. package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewInvoiceCell.vue.d.ts +7 -0
  116. package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewMetrics.vue.d.ts +18 -0
  117. package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewNextReminderCell.vue.d.ts +7 -0
  118. package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewStatusCell.vue.d.ts +7 -0
  119. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverview.composable.d.ts +42 -0
  120. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewFilters.composable.d.ts +10 -0
  121. package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewTableColumns.composable.d.ts +3 -0
  122. package/dist/modules/invoice-approval/use-cases/overview/views/InvoiceApprovalOverviewView.vue.d.ts +3 -0
  123. package/dist/modules/invoice-approval/use-cases/settings/views/ApprovalReminderSettingsView.vue.d.ts +7 -0
  124. package/dist/modules/invoice-approval/use-cases/settings/views/ApprovalReminderSettingsViewDataProvider.vue.d.ts +3 -0
  125. package/dist/modules/settings/routes/settings.routes.d.ts +7 -0
  126. package/dist/{plainDate.transformer-BxvJpJOv.js → plainDate.transformer-Bhiz9jW7.js} +17 -4
  127. package/dist/reminderConfig.query-snaHQmrY.js +309 -0
  128. package/dist/routes/invoicingRoutes.composable.d.ts +14 -6
  129. package/dist/search.composable-CU9OpyUB.js +52 -0
  130. package/dist/{src-BFgnUugN.js → src-DUSgQTKr.js} +45 -45
  131. package/dist/style.css +1 -1
  132. package/dist/types/queryKey.type.d.ts +3 -2
  133. package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +15 -0
  134. package/dist/utils/html.util.d.ts +4 -0
  135. package/package.json +2 -1
  136. package/dist/AddOpenBoundaryIcon-9SqBHfoz.js +0 -25
  137. package/dist/AirlineIcon-Z6sH_StM.js +0 -26
  138. package/dist/AirplaneIcon-C-nSkD1w.js +0 -19
  139. package/dist/AirportIcon-m4itDKCV.js +0 -16
  140. package/dist/AlertTriangleIcon-DtYLCC-Y.js +0 -23
  141. package/dist/AllocationsIcon-hcg93Sll.js +0 -16
  142. package/dist/ArrowNarrowRightIcon-2-Sml68f.js +0 -23
  143. package/dist/AssetIcon-qOYs6Wna.js +0 -16
  144. package/dist/BarChartIcon-DDyzpV_3.js +0 -22
  145. package/dist/BellIcon-DF1OBFta.js +0 -21
  146. package/dist/BuildingIcon-CC5PMNeP.js +0 -22
  147. package/dist/ChargerIcon-aM_endLr.js +0 -16
  148. package/dist/ChevronDownIcon-4QiK-Z6-.js +0 -23
  149. package/dist/ChevronUpIcon-qBsjZ5Dz.js +0 -23
  150. package/dist/ClockIcon-BNiPCaiB.js +0 -23
  151. package/dist/ClockSnoozeIcon-BxGfwJB6.js +0 -23
  152. package/dist/CopyIcon-DH5ly0dZ.js +0 -19
  153. package/dist/DataProvider-Dj34ljUX.js +0 -75
  154. package/dist/DownloadCloudIcon-Cf8ftklG.js +0 -22
  155. package/dist/EditIcon-Dr7OHBBR.js +0 -21
  156. package/dist/EraserIcon-B1VJSvdI.js +0 -23
  157. package/dist/FileIcon-ssmQI5Yl.js +0 -23
  158. package/dist/FilterLinesIcon-C7YdyPBk.js +0 -23
  159. package/dist/GlobeIcon-BfRM6Ike.js +0 -22
  160. package/dist/HelpIcon-BrJ49P5y.js +0 -22
  161. package/dist/HourGlassIcon-D9rfU1Is.js +0 -22
  162. package/dist/InfoCircleIcon-Ee0SyiMc.js +0 -23
  163. package/dist/InvoiceDetailViewDataProvider-D6E7YVV1.js +0 -1670
  164. package/dist/InvoiceOverviewViewDataProvider-i8tXATJE.js +0 -1677
  165. package/dist/InvoicePublicPdfViewDataProvider-BJe-8hC5.js +0 -45
  166. package/dist/KeyboardIcon-T3o_g-1c.js +0 -22
  167. package/dist/LinkExternalIcon-BkHS4fCx.js +0 -22
  168. package/dist/LinkIcon-DuPwae98.js +0 -22
  169. package/dist/MarkerIcon-B1Jqenjb.js +0 -28
  170. package/dist/MobileBatteryIcon-GZ1SMRDV.js +0 -16
  171. package/dist/MonitorIcon-pbK22reU.js +0 -22
  172. package/dist/NotificationIcon-Ctv8vyWt.js +0 -19
  173. package/dist/ParkingIcon-DnUPW3pB.js +0 -24
  174. package/dist/PlanningIcon-CXvrskgj.js +0 -16
  175. package/dist/PreferenceIcon-BHS8uDyi.js +0 -22
  176. package/dist/ReceiptCheckIcon-QTestqCJ.js +0 -23
  177. package/dist/RefreshIcon-DShY-aoS.js +0 -22
  178. package/dist/RemoveOpenBoundaryIcon-CN8YWs6o.js +0 -28
  179. package/dist/RewindIcon-GWg2AQax.js +0 -22
  180. package/dist/SettingsIcon-CBLJ6B5u.js +0 -25
  181. package/dist/ShieldIcon-CVnrOcxl.js +0 -19
  182. package/dist/ShieldOffIcon-B9l0dDVb.js +0 -23
  183. package/dist/SignOutIcon-CmDkjJ5F.js +0 -21
  184. package/dist/SlashCircleIcon-jY5FBko5.js +0 -22
  185. package/dist/StandIcon-CoYnBLMn.js +0 -23
  186. package/dist/StarsIcon-D7ZlqOW7.js +0 -22
  187. package/dist/StopwatchIcon-BK0vh1lg.js +0 -22
  188. package/dist/TargetIcon-HMWj77-Q.js +0 -22
  189. package/dist/ThreeDotsIcon-BtFruOKz.js +0 -32
  190. package/dist/ToolIcon-DRfDb7fE.js +0 -22
  191. package/dist/TrashIcon-BwxBjHv5.js +0 -19
  192. package/dist/TurnaroundIcon-b1X61TwZ.js +0 -27
  193. package/dist/UploadCloudIcon-BF0equKg.js +0 -22
  194. package/dist/UserIcon-B0rCC6KE.js +0 -22
  195. package/dist/UsersIcon-cK5l_zKG.js +0 -22
  196. package/dist/VerifiedIcon-CELYlqcv.js +0 -22
  197. package/dist/WifiIcon--JPvMNEF.js +0 -23
  198. package/dist/WifiOffIcon-BS2KftcP.js +0 -23
  199. package/dist/ZapIcon-BHwcIQc0.js +0 -23
  200. package/dist/ZoomInIcon-Cu6r915V.js +0 -23
  201. package/dist/ZoomOutIcon-DwB4FRj-.js +0 -23
  202. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +0 -8
  203. package/dist/instant.transformer-KmBsH3E9.js +0 -18
  204. package/dist/invoice.service-Bb8VqQvc.js +0 -635
  205. package/dist/invoiceDeliveryStatus.util-BPkGCQM6.js +0 -331
  206. package/dist/reminderConfig.query-DsJNqqi7.js +0 -331
  207. package/dist/search.composable-BCtYqudV.js +0 -52
@@ -0,0 +1,161 @@
1
+ import { X as e, Y as t, t as n } from "./api.util-C_kMGlJN.js";
2
+ import { a as r } from "./documentTitle.composable-DsBbzhXN.js";
3
+ import { o as i } from "./invoice.service-DEEA9mal.js";
4
+ import { g as a, z as o } from "./dist-Cxdm09Lp.js";
5
+ import { n as s } from "./dist-boJIIxnT.js";
6
+ import { n as c, t as l } from "./invoiceApprovalStatus.util-3Zh10Pj8.js";
7
+ import { useI18n as u } from "vue-i18n";
8
+ import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createVNode as _, defineComponent as v, normalizeClass as y, openBlock as b, renderList as x, unref as S, withCtx as C } from "vue";
9
+ import { UIBadge as w, UIText as T, UITooltip as E, UITooltipContent as D } from "@wisemen/vue-core-design-system";
10
+ //#region src/models/customer/customerDetail.transformer.ts
11
+ var O = class {
12
+ static fromDto(e) {
13
+ return {
14
+ uuid: e.uuid,
15
+ defaultPaymentTermDays: e.defaultPaymentTerm.value
16
+ };
17
+ }
18
+ }, k = class {
19
+ static fromDto(e) {
20
+ return {
21
+ uuid: e.uuid,
22
+ name: e.name,
23
+ type: e.type
24
+ };
25
+ }
26
+ }, A = class {
27
+ static toDto(e) {
28
+ return {
29
+ filter: { isDeactivated: !1 },
30
+ pagination: e.pagination,
31
+ search: i.toDto(e.search)
32
+ };
33
+ }
34
+ }, j = class {
35
+ static async getAll(t) {
36
+ return (await n.fromPromise(e({ query: A.toDto(t) }))).map((e) => ({
37
+ data: e.data.items.map(k.fromDto),
38
+ meta: e.data.meta
39
+ }));
40
+ }
41
+ static async getByUuid(e) {
42
+ return (await n.fromPromise(t({ path: { uuid: e } }))).map((e) => O.fromDto(e.data));
43
+ }
44
+ }, M = {
45
+ key: 0,
46
+ class: "flex min-w-0 items-center gap-xs rounded-sm border border-secondary bg-primary px-sm py-xxs"
47
+ }, N = {
48
+ class: "flex shrink-0 gap-xxs",
49
+ "aria-hidden": "true"
50
+ }, P = 2, F = /* @__PURE__ */ v({
51
+ __name: "InvoiceApprovalStatusChip",
52
+ props: {
53
+ icon: {},
54
+ label: {},
55
+ level: {},
56
+ size: {},
57
+ tone: {}
58
+ },
59
+ setup(e) {
60
+ let t = e, n = f(() => t.level === r._2);
61
+ return (e, r) => t.level === null ? (b(), p(S(w), {
62
+ key: 1,
63
+ label: t.label,
64
+ color: t.tone,
65
+ left: t.icon,
66
+ size: t.size,
67
+ variant: "translucent"
68
+ }, null, 8, [
69
+ "label",
70
+ "color",
71
+ "left",
72
+ "size"
73
+ ])) : (b(), h("span", M, [g("span", N, [(b(), h(d, null, x(P, (e) => g("span", {
74
+ key: e,
75
+ class: y([[e <= t.level ? {
76
+ "border-error bg-error-solid": n.value,
77
+ "border-warning-500 bg-warning-solid": !n.value
78
+ } : {
79
+ "border-error": n.value,
80
+ "border-warning-500": !n.value
81
+ }], "h-(--spacing-sm) w-(--spacing-md) rounded-full border"])
82
+ }, null, 2)), 64))]), _(S(T), {
83
+ text: t.label,
84
+ class: "text-xs text-primary"
85
+ }, null, 8, ["text"])]));
86
+ }
87
+ }), I = /* @__PURE__ */ v({
88
+ __name: "InvoiceApprovalStatusBadge",
89
+ props: {
90
+ approval: {},
91
+ rejection: { default: null },
92
+ requiresPriorApproval: { type: Boolean },
93
+ size: { default: "sm" }
94
+ },
95
+ setup(e) {
96
+ let t = e, n = u(), r = s(), i = f(() => l.getDisplayStatus({
97
+ approval: t.approval,
98
+ requiresPriorApproval: t.requiresPriorApproval
99
+ })), g = f(() => i.value === null ? null : l.getMetadata(i.value)), v = f(() => g.value === null ? "" : n.t(g.value.translationKey)), y = f(() => i.value === c.R1 || i.value === c.R2 ? t.approval?.level ?? null : null), x = {
100
+ [c.AWAITING_APPROVAL]: a,
101
+ [c.REJECTED]: o
102
+ }, w = f(() => {
103
+ let e = i.value === null ? void 0 : x[i.value];
104
+ return e === void 0 ? void 0 : {
105
+ icon: e,
106
+ type: "icon"
107
+ };
108
+ }), O = f(() => {
109
+ if (i.value === c.REJECTED && t.rejection !== null) {
110
+ let e = n.t(l.getRejectionReasonTranslationKey(t.rejection.reason));
111
+ return t.rejection.remark === null ? e : `${e} — ${t.rejection.remark}`;
112
+ }
113
+ if (y.value === null) return null;
114
+ let e = t.approval?.reminderSentAt ?? t.approval?.sentAt ?? null;
115
+ return e === null ? null : n.t("wise_invoicing.invoice.approval_status.last_request_sent_on", { date: r.toDate(e) });
116
+ });
117
+ return (e, n) => g.value === null ? m("", !0) : (b(), h(d, { key: 0 }, [O.value === null ? (b(), p(F, {
118
+ key: 1,
119
+ icon: w.value,
120
+ label: v.value,
121
+ level: y.value,
122
+ size: t.size,
123
+ tone: g.value.tone
124
+ }, null, 8, [
125
+ "icon",
126
+ "label",
127
+ "level",
128
+ "size",
129
+ "tone"
130
+ ])) : (b(), p(S(E), {
131
+ key: 0,
132
+ "popover-side-offset": 8,
133
+ "popover-align": "center",
134
+ "popover-side": "bottom"
135
+ }, {
136
+ trigger: C(() => [_(F, {
137
+ icon: w.value,
138
+ label: v.value,
139
+ level: y.value,
140
+ size: t.size,
141
+ tone: g.value.tone
142
+ }, null, 8, [
143
+ "icon",
144
+ "label",
145
+ "level",
146
+ "size",
147
+ "tone"
148
+ ])]),
149
+ content: C(() => [_(S(D), null, {
150
+ default: C(() => [_(S(T), {
151
+ text: O.value,
152
+ class: "text-sm text-primary"
153
+ }, null, 8, ["text"])]),
154
+ _: 1
155
+ })]),
156
+ _: 1
157
+ }))], 64));
158
+ }
159
+ });
160
+ //#endregion
161
+ export { F as n, j as r, I as t };
@@ -0,0 +1,308 @@
1
+ import { t as e } from "./i18n.lib-Cvr8pcDw.js";
2
+ import "./api.util-C_kMGlJN.js";
3
+ import { h as t } from "./documentTitle.composable-DsBbzhXN.js";
4
+ import { t as n } from "./invoice.service-DEEA9mal.js";
5
+ import { N as r, Q as i, at as a } from "./dist-Cxdm09Lp.js";
6
+ import { t as o } from "./formango.util-D5c2ql--.js";
7
+ import { t as s } from "./invoiceApprovalStatus.util-3Zh10Pj8.js";
8
+ import { n as c, r as l, t as u } from "./InvoicingFileUploadProvider-D9Xk4rQM.js";
9
+ import { z as d } from "zod";
10
+ import { useI18n as f } from "vue-i18n";
11
+ import { computed as p, createBlock as m, createVNode as h, defineComponent as g, mergeProps as _, openBlock as v, unref as y, withCtx as b } from "vue";
12
+ import { useMutation as x } from "@wisemen/vue-core-api-utils";
13
+ import { UIDialogBody as S, UIDialogFooter as C, UIDialogFooterCancel as w, UIDialogFooterSubmit as T, UIDialogHeader as E, UIFormDialog as D, UIFormFieldGroup as O, UIFormFileUpload as k, UIFormSubmitButton as A, UISelect as j, UITextareaField as M, createSelectOptions as N, useToast as P } from "@wisemen/vue-core-design-system";
14
+ import { useForm as F } from "formango";
15
+ //#region src/modules/invoice/api/mutations/invoiceArchiveApproval.mutation.ts
16
+ function I() {
17
+ return x({
18
+ queryFn: (e) => n.archiveApproval(e.params.approvalUuid),
19
+ queryKeysToInvalidate: {
20
+ invoiceApprovalIndex: {},
21
+ invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
22
+ invoiceIndex: {}
23
+ }
24
+ });
25
+ }
26
+ //#endregion
27
+ //#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalArchiveDialog.vue
28
+ var L = /* @__PURE__ */ g({
29
+ __name: "InvoiceApprovalArchiveDialog",
30
+ props: {
31
+ approvalUuid: {},
32
+ invoiceUuid: {}
33
+ },
34
+ emits: ["close"],
35
+ setup(e, { emit: t }) {
36
+ let n = e, i = t, a = f(), o = P(), s = I(), c = F({
37
+ initialState: {},
38
+ schema: d.object({}),
39
+ onSubmit: async () => {
40
+ let e = await s.execute({ params: {
41
+ approvalUuid: n.approvalUuid,
42
+ invoiceUuid: n.invoiceUuid
43
+ } });
44
+ if (e.isErr()) {
45
+ o.apiError(e.error);
46
+ return;
47
+ }
48
+ o.show({ message: a.t("wise_invoicing.invoice.approval_archive.success") }), i("close");
49
+ },
50
+ onSubmitError: () => {
51
+ o.unableToSave();
52
+ }
53
+ });
54
+ return (e, t) => (v(), m(y(D), {
55
+ form: y(c),
56
+ size: "sm",
57
+ onClose: t[0] ||= (e) => i("close")
58
+ }, {
59
+ default: b(() => [h(y(E), {
60
+ title: y(a).t("wise_invoicing.invoice.approval_archive.title"),
61
+ description: y(a).t("wise_invoicing.invoice.approval_archive.description"),
62
+ icon: y(r),
63
+ "icon-variant": "error"
64
+ }, null, 8, [
65
+ "title",
66
+ "description",
67
+ "icon"
68
+ ]), h(y(C), null, {
69
+ default: b(() => [h(y(w)), h(y(T), { label: y(a).t("wise_invoicing.invoice.approval_archive.submit") }, null, 8, ["label"])]),
70
+ _: 1
71
+ })]),
72
+ _: 1
73
+ }, 8, ["form"]));
74
+ }
75
+ });
76
+ //#endregion
77
+ //#region src/modules/invoice/api/mutations/invoiceRejectApproval.mutation.ts
78
+ function R() {
79
+ return x({
80
+ queryFn: (e) => n.rejectApproval(e.params.approvalUuid, e.body),
81
+ queryKeysToInvalidate: {
82
+ invoiceApprovalIndex: {},
83
+ invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
84
+ invoiceIndex: {}
85
+ }
86
+ });
87
+ }
88
+ var z = d.object({
89
+ reason: d.enum(t).nullable(),
90
+ remarks: d.string().trim().max(500).nullable()
91
+ }).superRefine((n, r) => {
92
+ if (n.reason === null) {
93
+ r.addIssue({
94
+ code: "custom",
95
+ message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
96
+ path: ["reason"]
97
+ });
98
+ return;
99
+ }
100
+ n.reason === t.OTHER && (n.remarks ?? "") === "" && r.addIssue({
101
+ code: "custom",
102
+ message: e.global.t("wise_invoicing.invoice.approval.validation.required"),
103
+ path: ["remarks"]
104
+ });
105
+ }), B = /* @__PURE__ */ g({
106
+ __name: "InvoiceRejectDialog",
107
+ props: {
108
+ approvalUuid: {},
109
+ invoiceUuid: {}
110
+ },
111
+ emits: ["close"],
112
+ setup(e, { emit: n }) {
113
+ let r = e, a = n, c = f(), l = P(), u = R(), d = F({
114
+ initialState: {
115
+ reason: null,
116
+ remarks: null
117
+ },
118
+ schema: z,
119
+ onSubmit: async (e) => {
120
+ let t = await u.execute({
121
+ body: e,
122
+ params: {
123
+ approvalUuid: r.approvalUuid,
124
+ invoiceUuid: r.invoiceUuid
125
+ }
126
+ });
127
+ if (t.isErr()) {
128
+ l.apiError(t.error);
129
+ return;
130
+ }
131
+ l.show({ message: c.t("wise_invoicing.invoice.reject.success") }), a("close");
132
+ },
133
+ onSubmitError: () => {
134
+ l.unableToSave();
135
+ }
136
+ }), g = d.register("reason"), x = d.register("remarks"), T = p(() => N([...Object.values(t).filter((e) => e !== t.OTHER), t.OTHER]));
137
+ function k(e) {
138
+ return c.t(s.getRejectionReasonTranslationKey(e));
139
+ }
140
+ let I = p(() => g.modelValue.value === t.OTHER);
141
+ return (e, t) => (v(), m(y(D), {
142
+ form: y(d),
143
+ size: "sm",
144
+ onClose: t[0] ||= (e) => a("close")
145
+ }, {
146
+ default: b(() => [
147
+ h(y(E), {
148
+ title: y(c).t("wise_invoicing.invoice.reject.title"),
149
+ description: y(c).t("wise_invoicing.invoice.reject.description"),
150
+ icon: y(i),
151
+ "icon-variant": "warning"
152
+ }, null, 8, [
153
+ "title",
154
+ "description",
155
+ "icon"
156
+ ]),
157
+ h(y(S), null, {
158
+ default: b(() => [h(y(O), null, {
159
+ default: b(() => [h(y(j), _(y(o)(y(g)), {
160
+ "display-fn": k,
161
+ "is-required": !0,
162
+ items: T.value,
163
+ label: y(c).t("wise_invoicing.invoice.reject.fields.reason")
164
+ }), null, 16, ["items", "label"]), h(y(M), _(y(o)(y(x)), {
165
+ "is-required": I.value,
166
+ label: y(c).t("wise_invoicing.invoice.reject.fields.remark"),
167
+ placeholder: y(c).t("wise_invoicing.invoice.reject.fields.remark_placeholder")
168
+ }), null, 16, [
169
+ "is-required",
170
+ "label",
171
+ "placeholder"
172
+ ])]),
173
+ _: 1
174
+ })]),
175
+ _: 1
176
+ }),
177
+ h(y(C), null, {
178
+ default: b(() => [h(y(w)), h(y(A), { label: y(c).t("wise_invoicing.invoice.reject.submit") }, null, 8, ["label"])]),
179
+ _: 1
180
+ })
181
+ ]),
182
+ _: 1
183
+ }, 8, ["form"]));
184
+ }
185
+ });
186
+ //#endregion
187
+ //#region src/modules/invoice/api/mutations/invoiceSendApproval.mutation.ts
188
+ function V() {
189
+ return x({
190
+ queryFn: (e) => e.params.hasActiveApproval ? n.restartApproval(e.params.invoiceUuid) : n.sendApproval(e.params.invoiceUuid),
191
+ queryKeysToInvalidate: {
192
+ invoiceApprovalIndex: {},
193
+ invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
194
+ invoiceIndex: {}
195
+ }
196
+ });
197
+ }
198
+ //#endregion
199
+ //#region src/modules/invoice/api/mutations/invoiceUnmarkAsPriorApprovalRequired.mutation.ts
200
+ function H() {
201
+ return x({
202
+ queryFn: (e) => n.unmarkAsPriorApprovalRequired(e.params.invoiceUuid),
203
+ queryKeysToInvalidate: {
204
+ invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
205
+ invoiceIndex: {}
206
+ }
207
+ });
208
+ }
209
+ //#endregion
210
+ //#region src/modules/invoice/api/mutations/invoiceApproveApproval.mutation.ts
211
+ function U() {
212
+ return x({
213
+ queryFn: (e) => n.approveApproval(e.params.approvalUuid, e.body),
214
+ queryKeysToInvalidate: {
215
+ invoiceApprovalIndex: {},
216
+ invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
217
+ invoiceIndex: {}
218
+ }
219
+ });
220
+ }
221
+ var W = d.object({
222
+ proofOfApproval: c.array().max(1),
223
+ remarks: d.string().trim().max(500).nullable()
224
+ }), G = 10485760, K = /* @__PURE__ */ g({
225
+ __name: "InvoiceApproveDialog",
226
+ props: {
227
+ approvalUuid: {},
228
+ invoiceUuid: {}
229
+ },
230
+ emits: ["close"],
231
+ setup(e, { emit: t }) {
232
+ let n = e, r = t, i = f(), s = P(), c = U(), d = F({
233
+ initialState: {
234
+ proofOfApproval: [],
235
+ remarks: null
236
+ },
237
+ schema: W,
238
+ onSubmit: async (e) => {
239
+ let t = await c.execute({
240
+ body: e,
241
+ params: {
242
+ approvalUuid: n.approvalUuid,
243
+ invoiceUuid: n.invoiceUuid
244
+ }
245
+ });
246
+ if (t.isErr()) {
247
+ s.apiError(t.error);
248
+ return;
249
+ }
250
+ s.show({ message: i.t("wise_invoicing.invoice.approve.success") }), r("close");
251
+ },
252
+ onSubmitError: () => {
253
+ s.unableToSave();
254
+ }
255
+ }), p = d.register("proofOfApproval"), g = d.register("remarks");
256
+ function x(e) {
257
+ return e.size > G ? i.t("wise_invoicing.invoice.approve.proof_too_large") : !0;
258
+ }
259
+ return (e, t) => (v(), m(y(D), {
260
+ form: y(d),
261
+ size: "sm",
262
+ onClose: t[0] ||= (e) => r("close")
263
+ }, {
264
+ default: b(() => [
265
+ h(y(E), {
266
+ title: y(i).t("wise_invoicing.invoice.approve.title"),
267
+ description: y(i).t("wise_invoicing.invoice.approve.description"),
268
+ icon: y(a),
269
+ "icon-variant": "success"
270
+ }, null, 8, [
271
+ "title",
272
+ "description",
273
+ "icon"
274
+ ]),
275
+ h(y(S), null, {
276
+ default: b(() => [h(y(O), null, {
277
+ default: b(() => [h(u, null, {
278
+ default: b(() => [h(y(k), _(y(o)(y(p)), {
279
+ accept: [
280
+ "application/pdf",
281
+ "image/png",
282
+ "image/jpeg"
283
+ ],
284
+ "is-valid-file": x,
285
+ max: 1,
286
+ preprocess: y(l).preprocess,
287
+ class: "w-full"
288
+ }), null, 16, ["preprocess"])]),
289
+ _: 1
290
+ }), h(y(M), _(y(o)(y(g)), {
291
+ label: y(i).t("wise_invoicing.invoice.approve.fields.note"),
292
+ placeholder: y(i).t("wise_invoicing.invoice.approve.fields.note_placeholder")
293
+ }), null, 16, ["label", "placeholder"])]),
294
+ _: 1
295
+ })]),
296
+ _: 1
297
+ }),
298
+ h(y(C), null, {
299
+ default: b(() => [h(y(w)), h(y(A), { label: y(i).t("wise_invoicing.invoice.approve.submit") }, null, 8, ["label"])]),
300
+ _: 1
301
+ })
302
+ ]),
303
+ _: 1
304
+ }, 8, ["form"]));
305
+ }
306
+ });
307
+ //#endregion
308
+ export { L as a, B as i, H as n, V as r, K as t };