@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
@@ -1,1670 +0,0 @@
1
- import { t as e } from "./i18n.lib-C6eb-F-e.js";
2
- import { Y as t, t as n } from "./api.util-BCSgCfpS.js";
3
- import { a as r, h as i, l as a, m as o, o as s, p as c, r as l, v as u } from "./documentTitle.composable-4ApFl9TZ.js";
4
- import { r as d } from "./useCurrencyFormat.composable-MtZaqKnO.js";
5
- import { t as f } from "./search.composable-BCtYqudV.js";
6
- import { a as p, i as m, n as h, o as g, t as _ } from "./invoice.service-Bb8VqQvc.js";
7
- import { n as v, t as y } from "./customFieldValue.util-BwsX8exl.js";
8
- import { n as b } from "./invoicingConfig.composable-DTmad1fe.js";
9
- import { n as x } from "./address.transformer-jGddczLV.js";
10
- import { D as ee, I as S, M as te, O as ne, Q as re, W as ie, X as C, f as ae, g as oe, h as se, i as ce, j as le, l as w, t as ue, tt as de, v as fe, w as pe } from "./dist-D9lp7NDv.js";
11
- import { n as T, t as E } from "./dist-boJIIxnT.js";
12
- import { i as D, n as me, r as he } from "./CustomFieldValueText-BGbQwhON.js";
13
- import { t as O } from "./formango.util-D5c2ql--.js";
14
- import { a as ge, c as _e, i as ve, n as ye, o as be, r as xe, s as Se, t as Ce, u as we } from "./invoiceDeliveryStatus.util-BPkGCQM6.js";
15
- import { t as Te } from "./issuerSettings.query-Bvz-Oj5D.js";
16
- import { C as Ee, S as De, _ as Oe, a as ke, b as Ae, c as je, d as Me, f as Ne, g as Pe, h as Fe, i as Ie, l as Le, m as Re, n as ze, o as Be, p as Ve, r as He, s as Ue, t as We, u as Ge, v as Ke, w as qe, x as Je, y as Ye } from "./BillingDocumentDetailViewDataProvider-BemnzVNY.js";
17
- import { t as Xe } from "./invoiceDetail.query-Cek8nyaw.js";
18
- import { RouterLink as Ze, useRouter as Qe } from "vue-router";
19
- import $e, { z as k } from "zod";
20
- import { useI18n as A } from "vue-i18n";
21
- import { Fragment as j, computed as M, createBlock as N, createCommentVNode as P, createElementBlock as F, createElementVNode as I, createSlots as et, createVNode as L, defineComponent as R, mergeModels as tt, mergeProps as z, openBlock as B, ref as nt, renderList as rt, toDisplayString as it, unref as V, useModel as at, watch as ot, withCtx as H } from "vue";
22
- import { useKeysetInfiniteQuery as st, useMutation as U, useOffsetInfiniteQuery as ct, useQuery as lt } from "@wisemen/vue-core-api-utils";
23
- import { Temporal as ut } from "temporal-polyfill";
24
- import { UIAutocomplete as dt, UIBadge as W, UIBadgeLabel as ft, UIBadgeSeparator as pt, UIButton as mt, UIColumnLayout as ht, UIConfirmDialog as gt, UIDateField as G, UIDetailList as _t, UIDetailListGroup as vt, UIDetailListGroupItem as K, UIDetailListGroupItemLabel as q, UIDetailListGroupItemValueText as J, UIDetailListGroupSeparator as yt, UIDialogBody as bt, UIDialogFooter as xt, UIDialogFooterCancel as St, UIDialogFooterSubmit as Ct, UIDialogHeader as wt, UIForm as Tt, UIFormDialog as Et, UIFormFieldGrid as Dt, UIFormFieldGroup as Ot, UIFormSubmitButton as kt, UIIconButton as At, UINumberField as jt, UIRowLayout as Y, UISelect as Mt, UITable as Nt, UITableCell as Pt, UITableCellInteractiveElement as Ft, UIText as X, UITextField as It, createAutocompleteOptions as Lt, createComponent as Z, createSelectOptions as Rt, defineTableColumns as zt, useOverlay as Bt, useToast as Q } from "@wisemen/vue-core-design-system";
25
- import { useForm as $ } from "formango";
26
- //#region src/modules/invoice/api/mutations/invoiceUpdate.mutation.ts
27
- function Vt() {
28
- return U({
29
- queryFn: (e) => _.update(e.params.invoiceUuid, e.body),
30
- queryKeysToInvalidate: {
31
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
32
- invoiceIndex: {}
33
- }
34
- });
35
- }
36
- //#endregion
37
- //#region src/modules/invoice/components/InvoiceDeliveryStatusBadge.vue
38
- var Ht = /* @__PURE__ */ R({
39
- __name: "InvoiceDeliveryStatusBadge",
40
- props: {
41
- deliveryStatus: {},
42
- size: { default: "sm" }
43
- },
44
- setup(e) {
45
- let t = e, n = A(), r = M(() => Ce.getMetadata(t.deliveryStatus)), i = M(() => n.t(r.value.translationKey));
46
- return (e, n) => (B(), N(V(W), {
47
- label: i.value,
48
- color: r.value.tone,
49
- size: t.size,
50
- variant: "translucent"
51
- }, null, 8, [
52
- "label",
53
- "color",
54
- "size"
55
- ]));
56
- }
57
- }), Ut = k.string().nullable(), Wt = k.object({ subject: Ut });
58
- //#endregion
59
- //#region src/modules/invoice/api/mutations/invoiceCreateCreditNote.mutation.ts
60
- function Gt() {
61
- return U({
62
- queryFn: (e) => _.createCreditNote(e.params.invoiceUuid),
63
- queryKeysToInvalidate: {
64
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
65
- invoiceIndex: {}
66
- }
67
- });
68
- }
69
- //#endregion
70
- //#region src/modules/invoice/api/mutations/invoiceDuplicate.mutation.ts
71
- function Kt() {
72
- return U({
73
- queryFn: (e) => _.duplicate(e.params.invoiceUuid),
74
- queryKeysToInvalidate: { invoiceIndex: {} }
75
- });
76
- }
77
- //#endregion
78
- //#region src/modules/invoice/api/mutations/invoiceFinalize.mutation.ts
79
- function qt() {
80
- return U({
81
- queryFn: (e) => _.finalize(e.params.invoiceUuid),
82
- queryKeysToInvalidate: {
83
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
84
- invoiceIndex: {}
85
- }
86
- });
87
- }
88
- //#endregion
89
- //#region src/modules/invoice/api/mutations/invoiceMarkAsDraft.mutation.ts
90
- function Jt() {
91
- return U({
92
- queryFn: (e) => _.markAsDraft(e.params.invoiceUuid),
93
- queryKeysToInvalidate: {
94
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
95
- invoiceIndex: {}
96
- }
97
- });
98
- }
99
- //#endregion
100
- //#region src/modules/invoice/api/mutations/invoiceMarkAsPaid.mutation.ts
101
- function Yt() {
102
- return U({
103
- queryFn: (e) => _.markAsPaid(e.params.invoiceUuid),
104
- queryKeysToInvalidate: {
105
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
106
- invoiceIndex: {}
107
- }
108
- });
109
- }
110
- //#endregion
111
- //#region src/modules/invoice/api/mutations/invoiceMarkAsProtested.mutation.ts
112
- function Xt() {
113
- return U({
114
- queryFn: (e) => _.markAsProtested(e.params.invoiceUuid),
115
- queryKeysToInvalidate: {
116
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
117
- invoiceIndex: {}
118
- }
119
- });
120
- }
121
- //#endregion
122
- //#region src/modules/invoice/api/mutations/invoiceMarkAsReady.mutation.ts
123
- function Zt() {
124
- return U({
125
- queryFn: (e) => _.markAsReady(e.params.invoiceUuid),
126
- queryKeysToInvalidate: {
127
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
128
- invoiceIndex: {}
129
- }
130
- });
131
- }
132
- //#endregion
133
- //#region src/modules/invoice/api/mutations/invoiceSend.mutation.ts
134
- function Qt() {
135
- return U({
136
- queryFn: (e) => _.send(e.params.invoiceUuid),
137
- queryKeysToInvalidate: {
138
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
139
- invoiceIndex: {}
140
- }
141
- });
142
- }
143
- //#endregion
144
- //#region src/modules/invoice/api/mutations/invoiceWithdrawProtest.mutation.ts
145
- function $t() {
146
- return U({
147
- queryFn: (e) => _.withdrawProtest(e.params.invoiceUuid),
148
- queryKeysToInvalidate: {
149
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
150
- invoiceIndex: {}
151
- }
152
- });
153
- }
154
- //#endregion
155
- //#region src/modules/invoice/api/mutations/invoiceDelete.mutation.ts
156
- function en() {
157
- return U({
158
- queryFn: (e) => _.delete(e.params.invoiceUuid),
159
- queryKeysToInvalidate: { invoiceIndex: {} }
160
- });
161
- }
162
- //#endregion
163
- //#region src/modules/invoice/use-cases/detail/dialogs/InvoiceDeleteDialog.vue
164
- var tn = /* @__PURE__ */ R({
165
- __name: "InvoiceDeleteDialog",
166
- props: { invoice: {} },
167
- emits: ["close", "deleted"],
168
- setup(e, { emit: t }) {
169
- let n = e, r = t, i = A(), a = Qe(), o = Q(), s = en(), c = $({
170
- schema: $e.object({}),
171
- onSubmit: async () => {
172
- let e = await s.execute({ params: { invoiceUuid: n.invoice.uuid } });
173
- if (e.isErr()) {
174
- o.apiError(e.error);
175
- return;
176
- }
177
- o.show({ message: i.t("wise_invoicing.invoice.delete.success_toast") }), r("deleted"), r("close"), await a.push({ name: "invoicing-invoice-overview" });
178
- }
179
- });
180
- return (e, t) => (B(), N(V(Et), {
181
- form: V(c),
182
- size: "xs",
183
- onClose: t[0] ||= (e) => r("close")
184
- }, {
185
- default: H(() => [L(V(wt), {
186
- title: V(i).t("wise_invoicing.invoice.delete.title"),
187
- description: V(i).t("wise_invoicing.invoice.delete.description"),
188
- "is-description-visible": !0
189
- }, null, 8, ["title", "description"]), L(V(xt), null, {
190
- right: H(() => [L(V(St), { label: "cancel" }), L(V(Ct), {
191
- "is-destructive": !0,
192
- label: V(i).t("wise_invoicing.invoice.delete.submit_button")
193
- }, null, 8, ["label"])]),
194
- _: 1
195
- })]),
196
- _: 1
197
- }, 8, ["form"]));
198
- }
199
- });
200
- //#endregion
201
- //#region src/modules/invoice/use-cases/detail/composables/invoiceDetailHeaderActions.composable.ts
202
- function nn(e) {
203
- let t = A(), n = Q(), r = Qe(), a = Bt(), s = a.create(tn), c = a.create(Ae), l = Qt(), u = Gt(), d = Kt(), f = qt(), p = Jt(), m = Yt(), h = Xt(), g = Zt(), y = $t(), { shouldSkipConfirmation: b } = Je(), x = nt(null), S = M(() => D.getMetadata(e.value.status)), C = M(() => x.value ?? e.value.isDisputed), se = M(() => e.value.status !== i.DRAFT && e.value.status !== i.READY), le = M(() => e.value.lifecycleStatus === o.FINALIZED);
204
- function w(e) {
205
- return S.value.actions.includes(e);
206
- }
207
- ot(() => e.value.isDisputed, (e) => {
208
- x.value === e && (x.value = null);
209
- });
210
- async function ue() {
211
- let r = await f.execute({ params: { invoiceUuid: e.value.uuid } });
212
- return r.isErr() ? (n.apiError(r.error), !1) : (n.show({ message: t.t("wise_invoicing.invoice.finalize.success") }), !0);
213
- }
214
- async function fe() {
215
- if (b.value) {
216
- await ue();
217
- return;
218
- }
219
- await c.open({
220
- billingDocumentType: "invoice",
221
- onConfirm: ue
222
- });
223
- }
224
- async function T() {
225
- let r = await g.execute({ params: { invoiceUuid: e.value.uuid } });
226
- if (r.isErr()) {
227
- n.apiError(r.error);
228
- return;
229
- }
230
- n.show({ message: t.t("wise_invoicing.invoice.mark_as_ready.success") });
231
- }
232
- async function E() {
233
- let r = await p.execute({ params: { invoiceUuid: e.value.uuid } });
234
- if (r.isErr()) {
235
- n.apiError(r.error);
236
- return;
237
- }
238
- n.show({ message: t.t("wise_invoicing.invoice.mark_as_draft.success") });
239
- }
240
- async function me() {
241
- let r = await m.execute({ params: { invoiceUuid: e.value.uuid } });
242
- if (r.isErr()) {
243
- n.apiError(r.error);
244
- return;
245
- }
246
- n.show({ message: t.t("wise_invoicing.invoice.mark_as_paid.success") });
247
- }
248
- async function he() {
249
- x.value = !0;
250
- let r = await h.execute({ params: { invoiceUuid: e.value.uuid } });
251
- if (r.isErr()) {
252
- x.value = null, n.apiError(r.error);
253
- return;
254
- }
255
- n.show({ message: t.t("wise_invoicing.invoice.mark_as_disputed.success") });
256
- }
257
- async function O() {
258
- x.value = !1;
259
- let r = await y.execute({ params: { invoiceUuid: e.value.uuid } });
260
- if (r.isErr()) {
261
- x.value = null, n.apiError(r.error);
262
- return;
263
- }
264
- n.show({ message: t.t("wise_invoicing.invoice.withdraw_dispute.success") });
265
- }
266
- async function ge() {
267
- let r = await l.execute({ params: { invoiceUuid: e.value.uuid } });
268
- if (r.isErr()) {
269
- n.apiError(r.error);
270
- return;
271
- }
272
- n.show({ message: t.t("wise_invoicing.invoice.send.success") });
273
- }
274
- async function _e() {
275
- await s.open({ invoice: e.value });
276
- }
277
- async function ve() {
278
- let r = await _.getByUuid(e.value.uuid);
279
- if (r.isErr()) {
280
- n.apiError(r.error);
281
- return;
282
- }
283
- let i = r.value.file;
284
- if (i === null) {
285
- n.show({ message: t.t("wise_invoicing.invoice.download_pdf.generation_in_progress") });
286
- return;
287
- }
288
- let a = await De.getDownloadUrl(i.uuid);
289
- a !== null && v.downloadUrl(a, i.name);
290
- }
291
- async function ye() {
292
- let i = await d.execute({ params: { invoiceUuid: e.value.uuid } });
293
- if (i.isErr()) {
294
- n.apiError(i.error);
295
- return;
296
- }
297
- n.show({
298
- button: {
299
- label: t.t("wise_invoicing.invoice.duplicate.view_action"),
300
- onClick: () => {
301
- r.push({
302
- name: "invoicing-invoice-detail",
303
- params: { invoiceUuid: i.value }
304
- });
305
- }
306
- },
307
- message: t.t("wise_invoicing.invoice.duplicate.success")
308
- });
309
- }
310
- async function be() {
311
- let i = await u.execute({ params: { invoiceUuid: e.value.uuid } });
312
- if (i.isErr()) {
313
- n.apiError(i.error);
314
- return;
315
- }
316
- n.show({
317
- button: {
318
- label: t.t("wise_invoicing.credit_note.create.view_action"),
319
- onClick: () => {
320
- r.push({
321
- name: "invoicing-credit-note-detail",
322
- params: { creditNoteUuid: i.value }
323
- });
324
- }
325
- },
326
- message: t.t("wise_invoicing.credit_note.create.success")
327
- });
328
- }
329
- let xe = M(() => [
330
- {
331
- isLoading: l.isLoading.value,
332
- iconLeft: de,
333
- key: "send",
334
- label: t.t("wise_invoicing.invoice.detail.actions.send"),
335
- variant: "primary",
336
- visible: e.value.status === i.FINALIZED,
337
- onClick: ge
338
- },
339
- {
340
- isLoading: g.isLoading.value,
341
- iconRight: ce,
342
- key: "markAsReady",
343
- label: t.t("wise_invoicing.invoice.detail.actions.mark_as_ready"),
344
- visible: w("markAsReady"),
345
- onClick: T
346
- },
347
- {
348
- isLoading: f.isLoading.value,
349
- iconLeft: pe,
350
- key: "finalize",
351
- label: t.t("wise_invoicing.invoice.detail.actions.finalize"),
352
- visible: w("finalize"),
353
- onClick: fe
354
- }
355
- ].filter((e) => e.visible)), Se = M(() => {
356
- let n = [
357
- {
358
- icon: ie,
359
- key: "markAsProtested",
360
- label: t.t("wise_invoicing.invoice.detail.actions.mark_as_disputed"),
361
- visible: le.value && !C.value,
362
- onSelect: he
363
- },
364
- {
365
- icon: re,
366
- key: "markAsPaid",
367
- label: t.t("wise_invoicing.invoice.detail.actions.mark_as_paid"),
368
- visible: w("markAsPaid"),
369
- onSelect: me
370
- },
371
- {
372
- icon: ce,
373
- key: "withdrawProtest",
374
- label: t.t("wise_invoicing.invoice.detail.actions.withdraw_dispute"),
375
- visible: le.value && C.value,
376
- onSelect: O
377
- }
378
- ], r = [
379
- i.FINALIZED,
380
- i.PAID,
381
- i.SENT,
382
- i.OVERDUE,
383
- i.PROTESTED
384
- ].includes(e.value.status), a = [
385
- {
386
- icon: oe,
387
- key: "downloadPdf",
388
- label: t.t("wise_invoicing.common.download_pdf"),
389
- visible: se.value,
390
- onSelect: ve
391
- },
392
- {
393
- icon: ne,
394
- key: "backToDraft",
395
- label: t.t("wise_invoicing.invoice.detail.actions.mark_as_draft"),
396
- visible: w("markAsDraft"),
397
- onSelect: E
398
- },
399
- {
400
- icon: ae,
401
- key: "duplicate",
402
- label: t.t("wise_invoicing.invoice.detail.actions.duplicate"),
403
- visible: !0,
404
- onSelect: ye
405
- }
406
- ], o = [{
407
- icon: te,
408
- key: "createCreditNote",
409
- label: t.t("wise_invoicing.invoice.detail.header.cancel_with_credit_note"),
410
- visible: r,
411
- onSelect: be
412
- }, {
413
- icon: ee,
414
- key: "delete",
415
- label: t.t("wise_invoicing.invoice.detail.actions.delete"),
416
- visible: S.value.isEditable,
417
- onSelect: _e
418
- }];
419
- return [
420
- {
421
- items: n.filter((e) => e.visible),
422
- key: "lifecycle"
423
- },
424
- {
425
- items: a.filter((e) => e.visible),
426
- key: "secondary"
427
- },
428
- {
429
- items: o.filter((e) => e.visible),
430
- key: "destructive"
431
- }
432
- ].filter((e) => e.items.length > 0);
433
- });
434
- return {
435
- isActionMenuVisible: M(() => Se.value.length > 0),
436
- isDisputed: C,
437
- menuGroups: Se,
438
- primaryButtons: xe
439
- };
440
- }
441
- //#endregion
442
- //#region src/modules/invoice/use-cases/detail/components/InvoiceDetailHeaderSection.vue
443
- var rn = /* @__PURE__ */ R({
444
- __name: "InvoiceDetailHeaderSection",
445
- props: {
446
- isPdfViewActive: { type: Boolean },
447
- invoice: {}
448
- },
449
- emits: ["togglePdfView"],
450
- setup(e, { emit: t }) {
451
- let n = e, r = t, i = A(), a = Q(), { isDisputed: o, menuGroups: s, primaryButtons: l } = nn(M(() => n.invoice)), u = Vt(), d = M(() => new Ee(n.invoice.status)), f = M(() => d.value.color), p = M(() => i.t(d.value.translationKey)), m = M(() => n.invoice.deliveryStatus !== c.UNSENT), g = M(() => Ce.isSent(n.invoice.deliveryStatus)), _ = M(() => !D.isEditable(n.invoice.status)), v = $({
452
- initialState: { subject: n.invoice.subject },
453
- schema: Wt,
454
- onSubmit: async (e) => {
455
- let t = await u.execute({
456
- body: {
457
- ...h.toForm(n.invoice),
458
- subject: e.subject
459
- },
460
- params: { invoiceUuid: n.invoice.uuid }
461
- });
462
- t.isErr() && a.apiError(t.error);
463
- }
464
- }), y = v.register("subject");
465
- return qe({ form: v }), (e, t) => (B(), N(V(Tt), {
466
- form: V(v),
467
- "prompt-on-unsaved-changes": !1
468
- }, {
469
- default: H(() => [L(Ke, {
470
- "fallback-title": V(i).t("wise_invoicing.invoice.detail.fallback_title"),
471
- "is-disabled": _.value,
472
- sequence: n.invoice.sequence,
473
- "status-color": f.value,
474
- "status-label": p.value,
475
- icon: V(S),
476
- "subject-field": V(y),
477
- "subject-placeholder": V(i).t("wise_invoicing.invoice.detail.header.subject_placeholder")
478
- }, {
479
- actions: H(() => [L(Oe, {
480
- "is-pdf-view-active": n.isPdfViewActive,
481
- "menu-groups": V(s),
482
- "primary-buttons": V(l),
483
- onTogglePdfView: t[0] ||= (e) => r("togglePdfView")
484
- }, null, 8, [
485
- "is-pdf-view-active",
486
- "menu-groups",
487
- "primary-buttons"
488
- ])]),
489
- status: H(() => [L(V(Y), {
490
- gap: "xs",
491
- class: "flex-wrap items-start"
492
- }, {
493
- default: H(() => [
494
- L(Se, { "lifecycle-status": n.invoice.lifecycleStatus }, null, 8, ["lifecycle-status"]),
495
- L(ye, {
496
- "is-sent": g.value,
497
- "balance-due-amount": n.invoice.balanceDueAmount,
498
- "gross-amount": n.invoice.grossAmount,
499
- "paid-amount": n.invoice.paidAmount,
500
- "settlement-status": n.invoice.settlementStatus,
501
- "total-credited-amount": n.invoice.totalCreditedAmount
502
- }, null, 8, [
503
- "is-sent",
504
- "balance-due-amount",
505
- "gross-amount",
506
- "paid-amount",
507
- "settlement-status",
508
- "total-credited-amount"
509
- ]),
510
- n.invoice.isOverdue ? (B(), N(Ye, { key: 0 })) : P("", !0),
511
- V(o) ? (B(), N(_e, { key: 1 })) : P("", !0),
512
- m.value ? (B(), N(Ht, {
513
- key: 2,
514
- "delivery-status": n.invoice.deliveryStatus
515
- }, null, 8, ["delivery-status"])) : P("", !0)
516
- ]),
517
- _: 1
518
- })]),
519
- _: 1
520
- }, 8, [
521
- "fallback-title",
522
- "is-disabled",
523
- "sequence",
524
- "status-color",
525
- "status-label",
526
- "icon",
527
- "subject-field",
528
- "subject-placeholder"
529
- ])]),
530
- _: 1
531
- }, 8, ["form"]));
532
- }
533
- }), an = { class: "grid w-full grid-cols-1 gap-md lg:grid-cols-3" }, on = /* @__PURE__ */ R({
534
- __name: "InvoiceDetailLinkedCreditNotesSection",
535
- props: { invoice: {} },
536
- setup(e) {
537
- let t = e, n = A(), r = d(), i = M(() => t.invoice.creditNotes.map((e) => {
538
- let t = new Ee(e.status);
539
- return {
540
- uuid: e.uuid,
541
- title: e.sequence === null ? n.t("wise_invoicing.invoice.detail.credit_notes.untitled") : n.t("wise_invoicing.invoice.detail.credit_notes.card_title", { sequence: e.sequence }),
542
- amountLabel: r.formatMonetary(a(e)),
543
- statusColor: t.color,
544
- statusLabel: n.t(t.translationKey)
545
- };
546
- }));
547
- function a(e) {
548
- return {
549
- ...e.grossAmount,
550
- amount: e.grossAmount.amount > 0 ? -e.grossAmount.amount : e.grossAmount.amount
551
- };
552
- }
553
- return (e, t) => i.value.length > 0 ? (B(), N(V(ht), {
554
- key: 0,
555
- as: "section",
556
- gap: "md",
557
- class: "w-full"
558
- }, {
559
- default: H(() => [L(V(X), {
560
- text: V(n).t("wise_invoicing.invoice.detail.credit_notes.title"),
561
- as: "h2",
562
- class: "text-sm font-semibold text-primary"
563
- }, null, 8, ["text"]), I("div", an, [(B(!0), F(j, null, rt(i.value, (e) => (B(), N(V(Ze), {
564
- key: e.uuid,
565
- to: {
566
- name: "invoicing-credit-note-detail",
567
- params: { creditNoteUuid: e.uuid }
568
- },
569
- class: "min-w-0 rounded-lg border border-secondary bg-primary p-lg transition-colors hover:bg-secondary"
570
- }, {
571
- default: H(() => [L(V(Y), {
572
- align: "center",
573
- gap: "md",
574
- class: "min-w-0"
575
- }, {
576
- default: H(() => [
577
- L(V(X), {
578
- text: e.title,
579
- class: "min-w-0 flex-1 truncate text-xs font-semibold text-primary"
580
- }, null, 8, ["text"]),
581
- L(V(W), {
582
- label: e.statusLabel,
583
- color: e.statusColor,
584
- size: "sm",
585
- variant: "translucent"
586
- }, null, 8, ["label", "color"]),
587
- L(V(W), {
588
- label: e.amountLabel,
589
- variant: "translucent",
590
- size: "sm"
591
- }, null, 8, ["label"])
592
- ]),
593
- _: 2
594
- }, 1024)]),
595
- _: 2
596
- }, 1032, ["to"]))), 128))])]),
597
- _: 1
598
- })) : P("", !0);
599
- }
600
- }), sn = k.object({
601
- deliveredOn: E.nullable(),
602
- dueOn: E,
603
- issuedOn: E,
604
- customFields: k.array(k.custom()),
605
- externalRemarks: k.string().nullable(),
606
- poNumber: k.string().nullable(),
607
- preparedBy: k.object({
608
- uuid: k.uuid(),
609
- name: k.string()
610
- }),
611
- subject: k.string().nullable()
612
- }).superRefine((t, n) => {
613
- Temporal.PlainDate.compare(t.dueOn, t.issuedOn) < 0 && n.addIssue({
614
- code: "custom",
615
- message: e.global.t("invoicing.invoice.validation.due_date_after_issue_date"),
616
- path: ["dueOn"]
617
- });
618
- }), cn = /* @__PURE__ */ R({
619
- __name: "InvoiceDetailRemarksSection",
620
- props: { invoice: {} },
621
- setup(e) {
622
- let t = e, n = A(), r = Q(), i = Vt(), a = $({
623
- initialState: M(() => h.toForm(t.invoice)),
624
- schema: sn,
625
- onSubmit: async (e) => {
626
- let n = await i.execute({
627
- body: e,
628
- params: { invoiceUuid: t.invoice.uuid }
629
- });
630
- n.isErr() && r.apiError(n.error);
631
- }
632
- }), o = a.register("externalRemarks"), s = M(() => !D.isEditable(t.invoice.status));
633
- return qe({ form: a }), (e, t) => (B(), N(V(Tt), {
634
- form: V(a),
635
- "prompt-on-unsaved-changes": !1
636
- }, {
637
- default: H(() => [L(Pe, {
638
- "is-disabled": s.value,
639
- placeholder: V(n).t("wise_invoicing.invoice.detail.remarks.placeholder"),
640
- "remarks-field": V(o),
641
- title: V(n).t("wise_invoicing.invoice.detail.remarks.title")
642
- }, null, 8, [
643
- "is-disabled",
644
- "placeholder",
645
- "remarks-field",
646
- "title"
647
- ])]),
648
- _: 1
649
- }, 8, ["form"]));
650
- }
651
- });
652
- //#endregion
653
- //#region src/modules/invoice/api/queries/invoiceActivityLogIndex.query.ts
654
- function ln(e) {
655
- return st("invoiceActivityLogIndex", {
656
- params: { invoiceUuid: e },
657
- queryFn: (t) => _.getActivityLogs(e.value, { pagination: t })
658
- });
659
- }
660
- //#endregion
661
- //#region src/modules/invoice/use-cases/detail/components/sidebar/InvoiceDetailSidebarActivityTab.vue
662
- var un = /* @__PURE__ */ R({
663
- __name: "InvoiceDetailSidebarActivityTab",
664
- props: { invoice: {} },
665
- setup(e) {
666
- let t = e, n = A(), { hasNextPage: r, isFetchingNextPage: i, isLoading: a, fetchNextPage: o, result: s } = ln(M(() => t.invoice.uuid)), c = M(() => s.value.unwrapOr({
667
- data: [],
668
- meta: { next: null }
669
- }).data);
670
- return (e, s) => (B(), N(Fe, {
671
- "current-billing-document": {
672
- role: V(l).INVOICE,
673
- uuid: t.invoice.uuid
674
- },
675
- "empty-message": V(n).t("wise_invoicing.invoice.detail.sidebar.activity_empty"),
676
- entries: c.value,
677
- "fetch-next-page": V(o),
678
- "has-next-page": V(r),
679
- "is-fetching-next-page": V(i),
680
- "is-loading": V(a)
681
- }, null, 8, [
682
- "current-billing-document",
683
- "empty-message",
684
- "entries",
685
- "fetch-next-page",
686
- "has-next-page",
687
- "is-fetching-next-page",
688
- "is-loading"
689
- ]));
690
- }
691
- }), dn = /* @__PURE__ */ R({
692
- __name: "CustomFieldFieldset",
693
- props: /*@__PURE__*/ tt({
694
- isDisabled: { type: Boolean },
695
- currency: {},
696
- definitions: {},
697
- precision: {},
698
- size: {}
699
- }, {
700
- modelValue: { required: !0 },
701
- modelModifiers: {}
702
- }),
703
- emits: ["update:modelValue"],
704
- setup(e) {
705
- let t = e, n = at(e, "modelValue");
706
- function r(e) {
707
- return y.findByDefinition(n.value, e);
708
- }
709
- function i(e, t) {
710
- n.value = y.upsert(n.value, e, t);
711
- }
712
- return (e, n) => t.definitions.length > 0 ? (B(), N(V(ht), {
713
- key: 0,
714
- gap: t.size === "sm" ? "xs" : "md",
715
- align: "stretch"
716
- }, {
717
- default: H(() => [(B(!0), F(j, null, rt(t.definitions, (e) => (B(), N(Le, {
718
- key: e.uuid,
719
- currency: t.currency,
720
- definition: e,
721
- "is-disabled": t.isDisabled,
722
- "model-value": r(e.uuid),
723
- precision: t.precision,
724
- size: t.size,
725
- "onUpdate:modelValue": (t) => i(e.uuid, t)
726
- }, null, 8, [
727
- "currency",
728
- "definition",
729
- "is-disabled",
730
- "model-value",
731
- "precision",
732
- "size",
733
- "onUpdate:modelValue"
734
- ]))), 128))]),
735
- _: 1
736
- }, 8, ["gap"])) : P("", !0);
737
- }
738
- });
739
- //#endregion
740
- //#region src/modules/invoice/api/queries/invoiceCustomerDetail.query.ts
741
- function fn(e) {
742
- return lt("invoiceCustomerDetail", {
743
- params: { customerUuid: e },
744
- queryFn: () => we.getByUuid(e.value)
745
- });
746
- }
747
- //#endregion
748
- //#region src/modules/invoice/models/invoice/update/invoicePreparer.transformer.ts
749
- var pn = class {
750
- static fromDto(e) {
751
- let t = `${e.firstName ?? ""} ${e.lastName ?? ""}`.trim();
752
- return {
753
- uuid: e.uuid,
754
- name: t === "" ? e.email ?? e.uuid : t
755
- };
756
- }
757
- }, mn = class {
758
- static toDto(e) {
759
- return {
760
- pagination: e.pagination,
761
- search: g.toDto(e.search)
762
- };
763
- }
764
- }, hn = class {
765
- static async getAll(e) {
766
- return (await n.fromPromise(t({ query: mn.toDto(e) }))).map((e) => ({
767
- data: e.data.items.map(pn.fromDto),
768
- meta: e.data.meta
769
- }));
770
- }
771
- };
772
- //#endregion
773
- //#region src/modules/invoice/api/queries/invoiceUserSearch.query.ts
774
- function gn(e) {
775
- let t = M(() => ({ search: e.params.search?.value }));
776
- return ct("invoiceUserSearch", {
777
- params: { queryParams: t },
778
- queryFn: (t) => hn.getAll({
779
- pagination: t,
780
- search: e.params.search?.value ?? ""
781
- })
782
- });
783
- }
784
- //#endregion
785
- //#region src/modules/invoice/components/form/InvoiceFormPreparedByField.vue
786
- var _n = /* @__PURE__ */ R({
787
- __name: "InvoiceFormPreparedByField",
788
- props: {
789
- isLoading: { type: Boolean },
790
- field: {},
791
- users: {}
792
- },
793
- emits: ["nextPage", "updateSearch"],
794
- setup(e, { emit: t }) {
795
- let n = e, r = t, i = A(), a = M(() => Lt(n.users));
796
- function o(e) {
797
- return e.name;
798
- }
799
- function s(e) {
800
- e !== null && (n.field.setValue(e), r("updateSearch", ""));
801
- }
802
- return (e, t) => (B(), N(V(dt), z(V(O)(n.field), {
803
- "display-fn": o,
804
- "is-loading": n.isLoading,
805
- "is-required": !0,
806
- items: a.value,
807
- label: V(i).t("wise_invoicing.invoice.detail.header.created_by"),
808
- placeholder: V(i).t("component.autocomplete.search_placeholder"),
809
- "search-mode": "remote",
810
- onNextPage: t[0] ||= (e) => r("nextPage"),
811
- "onUpdate:modelValue": s,
812
- "onUpdate:search": t[1] ||= (e) => r("updateSearch", e)
813
- }), null, 16, [
814
- "is-loading",
815
- "items",
816
- "label",
817
- "placeholder"
818
- ]));
819
- }
820
- }), vn = /* @__PURE__ */ R({
821
- __name: "InvoiceUpdateDialog",
822
- props: {
823
- customFieldDefinitions: {},
824
- invoice: {}
825
- },
826
- emits: ["close"],
827
- setup(e, { emit: t }) {
828
- let n = e, r = t, i = A(), a = Q(), o = Vt(), s = Te(), c = b(), l = f({ debounceMs: 250 }), u = gn({ params: { search: l.debouncedSearch } }), d = M(() => u.result.value.match({
829
- err: () => [],
830
- loading: () => [],
831
- ok: (e) => e.data
832
- })), p = fn(M(() => n.invoice.customer.uuid)), m = M(() => {
833
- let e = p.result.value;
834
- if (e.isOk()) return e.getValue().defaultPaymentTermDays;
835
- let t = s.result.value;
836
- return t.isOk() ? t.getValue().defaultPaymentTermDays ?? 0 : 0;
837
- }), g = $({
838
- initialState: M(() => h.toForm(n.invoice)),
839
- schema: sn,
840
- onSubmit: async (e) => {
841
- let t = await o.execute({
842
- body: e,
843
- params: { invoiceUuid: n.invoice.uuid }
844
- });
845
- if (t.isErr()) {
846
- a.apiError(t.error);
847
- return;
848
- }
849
- r("close");
850
- },
851
- onSubmitError: () => {
852
- a.unableToSave();
853
- }
854
- }), _ = g.register("issuedOn"), v = g.register("dueOn"), y = g.register("deliveredOn"), x = g.register("poNumber"), ee = g.register("preparedBy"), S = g.register("subject"), te = g.register("customFields"), ne = M({
855
- get: () => te.modelValue.value ?? [],
856
- set: (e) => {
857
- te.setValue(e);
858
- }
859
- });
860
- function re(e) {
861
- e !== null && v.setValue(e.add({ days: m.value }));
862
- }
863
- function ie(e) {
864
- l.updateSearch(e);
865
- }
866
- return (e, t) => (B(), N(V(Et), {
867
- form: V(g),
868
- size: "sm",
869
- onClose: t[1] ||= (e) => r("close")
870
- }, {
871
- default: H(() => [
872
- L(V(wt), {
873
- icon: V(C),
874
- "is-description-visible": !1,
875
- title: V(i).t("wise_invoicing.invoice.detail.header.edit_info"),
876
- description: ""
877
- }, null, 8, ["icon", "title"]),
878
- L(V(bt), null, {
879
- default: H(() => [L(V(Ot), null, {
880
- default: H(() => [L(V(Dt), {
881
- lg: 2,
882
- sm: 1
883
- }, {
884
- default: H(() => [
885
- L(V(G), z(V(O)(V(_)), {
886
- label: V(i).t("wise_invoicing.invoice.detail.header.invoice_date"),
887
- "is-required": !0,
888
- "onUpdate:modelValue": re
889
- }), null, 16, ["label"]),
890
- L(V(G), z(V(O)(V(v)), {
891
- label: V(i).t("wise_invoicing.invoice.detail.header.due_date"),
892
- "is-required": !0,
893
- "min-date": V(_).modelValue.value
894
- }), null, 16, ["label", "min-date"]),
895
- V(c).isDeliveryDateVisible.value ? (B(), N(V(G), z({ key: 0 }, V(O)(V(y)), { label: V(i).t("wise_invoicing.invoice.detail.header.delivery_date") }), null, 16, ["label"])) : P("", !0),
896
- L(_n, {
897
- field: V(ee),
898
- "is-loading": V(u).isLoading.value,
899
- users: d.value,
900
- onNextPage: V(u).fetchNextPage,
901
- onUpdateSearch: ie
902
- }, null, 8, [
903
- "field",
904
- "is-loading",
905
- "users",
906
- "onNextPage"
907
- ]),
908
- L(V(It), z(V(O)(V(x)), { label: V(i).t("wise_invoicing.invoice.detail.header.po_number") }), null, 16, ["label"]),
909
- L(V(It), z(V(O)(V(S)), {
910
- label: V(i).t("wise_invoicing.invoice.detail.header.subject"),
911
- placeholder: V(i).t("wise_invoicing.invoice.detail.header.subject_placeholder")
912
- }), null, 16, ["label", "placeholder"])
913
- ]),
914
- _: 1
915
- }), L(dn, {
916
- modelValue: ne.value,
917
- "onUpdate:modelValue": t[0] ||= (e) => ne.value = e,
918
- currency: n.invoice.currency,
919
- definitions: n.customFieldDefinitions,
920
- "is-disabled": !0,
921
- precision: n.invoice.grossAmount.precision,
922
- class: "w-full"
923
- }, null, 8, [
924
- "modelValue",
925
- "currency",
926
- "definitions",
927
- "precision"
928
- ])]),
929
- _: 1
930
- })]),
931
- _: 1
932
- }),
933
- L(V(xt), null, {
934
- right: H(() => [L(V(St), { label: "cancel" }), L(V(Ct), { label: V(i).t("wise_invoicing.invoice.detail.header.edit_info") }, null, 8, ["label"])]),
935
- _: 1
936
- })
937
- ]),
938
- _: 1
939
- }, 8, ["form"]));
940
- }
941
- }), yn = /* @__PURE__ */ R({
942
- __name: "InvoiceDetailSidebarInfoTab",
943
- props: {
944
- customFieldDefinitions: {},
945
- invoice: {}
946
- },
947
- setup(e) {
948
- let t = e, n = A(), r = T(), i = b(), a = Bt().create(vn), o = M(() => D.isEditable(t.invoice.status)), c = M(() => me.filterByEntityType(t.customFieldDefinitions, s.INVOICE)), l = M(() => {
949
- if (!t.invoice.isOverdue) return null;
950
- let e = t.invoice.dueOn.toZonedDateTime(ut.Now.timeZoneId()).toInstant();
951
- return r.toRelativeTime(e);
952
- });
953
- async function u() {
954
- await a.open({
955
- customFieldDefinitions: c.value,
956
- invoice: t.invoice
957
- });
958
- }
959
- function d(e) {
960
- return e === null ? "-" : r.formatPlainDate(e);
961
- }
962
- return (e, r) => (B(), N(V(_t), { class: "px-2xl py-xl" }, {
963
- default: H(() => [
964
- L(V(vt), { label: V(n).t("wise_invoicing.invoice.detail.sidebar.general") }, et({
965
- default: H(() => [
966
- L(V(K), null, {
967
- default: H(() => [L(V(q), {
968
- icon: V(se),
969
- label: V(n).t("wise_invoicing.invoice.detail.header.invoice_id")
970
- }, null, 8, ["icon", "label"]), L(V(J), { text: t.invoice.sequence ?? "-" }, null, 8, ["text"])]),
971
- _: 1
972
- }),
973
- L(V(K), null, {
974
- default: H(() => [L(V(q), {
975
- icon: V(le),
976
- label: V(n).t("wise_invoicing.invoice.detail.header.po_number")
977
- }, null, 8, ["icon", "label"]), L(V(J), { text: t.invoice.poNumber ?? "-" }, null, 8, ["text"])]),
978
- _: 1
979
- }),
980
- L(V(K), null, {
981
- default: H(() => [L(V(q), {
982
- icon: V(w),
983
- label: V(n).t("wise_invoicing.invoice.detail.header.issuer")
984
- }, null, 8, ["icon", "label"]), L(V(J), { text: t.invoice.issuer.name ?? "-" }, null, 8, ["text"])]),
985
- _: 1
986
- }),
987
- L(V(K), null, {
988
- default: H(() => [L(V(q), {
989
- icon: V(S),
990
- label: V(n).t("wise_invoicing.invoice.detail.header.invoice_date")
991
- }, null, 8, ["icon", "label"]), L(V(J), { text: d(t.invoice.issueOn) }, null, 8, ["text"])]),
992
- _: 1
993
- }),
994
- L(V(K), null, {
995
- default: H(() => [L(V(q), {
996
- icon: V(ie),
997
- label: V(n).t("wise_invoicing.invoice.detail.header.due_date"),
998
- variant: t.invoice.isOverdue ? "error" : "default"
999
- }, null, 8, [
1000
- "icon",
1001
- "label",
1002
- "variant"
1003
- ]), L(V(Y), { gap: "xs" }, {
1004
- default: H(() => [L(V(J), {
1005
- text: d(t.invoice.dueOn),
1006
- variant: t.invoice.isOverdue ? "error" : "default"
1007
- }, null, 8, ["text", "variant"]), l.value === null ? P("", !0) : (B(), N(V(W), {
1008
- key: 0,
1009
- label: l.value,
1010
- color: "error",
1011
- size: "sm",
1012
- variant: "translucent"
1013
- }, null, 8, ["label"]))]),
1014
- _: 1
1015
- })]),
1016
- _: 1
1017
- }),
1018
- V(i).isDeliveryDateVisible.value ? (B(), N(V(K), { key: 0 }, {
1019
- default: H(() => [L(V(q), {
1020
- icon: V(de),
1021
- label: V(n).t("wise_invoicing.invoice.detail.header.delivery_date")
1022
- }, null, 8, ["icon", "label"]), L(V(J), { text: d(t.invoice.deliveredOn) }, null, 8, ["text"])]),
1023
- _: 1
1024
- })) : P("", !0),
1025
- L(Re, {
1026
- definitions: t.customFieldDefinitions,
1027
- values: t.invoice.customFields
1028
- }, null, 8, ["definitions", "values"])
1029
- ]),
1030
- _: 2
1031
- }, [o.value ? {
1032
- name: "actions",
1033
- fn: H(() => [L(V(At), {
1034
- icon: V(fe),
1035
- label: V(n).t("wise_invoicing.invoice.detail.header.edit_info"),
1036
- variant: "tertiary",
1037
- onClick: u
1038
- }, null, 8, ["icon", "label"])]),
1039
- key: "0"
1040
- } : void 0]), 1032, ["label"]),
1041
- L(Ve, { "original-invoice": t.invoice.originalInvoice }, null, 8, ["original-invoice"]),
1042
- L(V(yt)),
1043
- L(V(vt), {
1044
- label: V(n).t("wise_invoicing.invoice.detail.header.bill_to"),
1045
- "collapse-options": {
1046
- isCollapsible: !0,
1047
- isOpenByDefault: !0,
1048
- badge: { label: t.invoice.customer.name ?? "-" }
1049
- }
1050
- }, {
1051
- default: H(() => [L(V(K), { orientation: "vertical" }, {
1052
- default: H(() => [L(V(X), {
1053
- text: t.invoice.customer.name ?? "-",
1054
- class: "text-xs font-medium"
1055
- }, null, 8, ["text"]), t.invoice.customer.address ? (B(), F(j, { key: 0 }, [L(V(X), {
1056
- text: V(x).formatLines(t.invoice.customer.address)[0] ?? "",
1057
- class: "text-xs"
1058
- }, null, 8, ["text"]), t.invoice.customer.address ? (B(), N(V(X), {
1059
- key: 0,
1060
- text: V(x).formatLines(t.invoice.customer.address)[1] ?? "",
1061
- class: "text-xs"
1062
- }, null, 8, ["text"])) : P("", !0)], 64)) : P("", !0)]),
1063
- _: 1
1064
- })]),
1065
- _: 1
1066
- }, 8, ["label", "collapse-options"]),
1067
- L(V(yt)),
1068
- L(V(vt), {
1069
- label: V(n).t("wise_invoicing.invoice.detail.header.bill_from"),
1070
- "collapse-options": {
1071
- isCollapsible: !0,
1072
- isOpenByDefault: !1,
1073
- badge: { label: t.invoice.issuer.email ?? "-" }
1074
- }
1075
- }, {
1076
- default: H(() => [L(V(K), { orientation: "vertical" }, {
1077
- default: H(() => [L(V(q), { label: t.invoice.issuer.email ?? "-" }, null, 8, ["label"]), t.invoice.issuer.address ? (B(), N(V(J), {
1078
- key: 0,
1079
- text: V(x).format(t.invoice.issuer.address)
1080
- }, null, 8, ["text"])) : P("", !0)]),
1081
- _: 1
1082
- })]),
1083
- _: 1
1084
- }, 8, ["label", "collapse-options"])
1085
- ]),
1086
- _: 1
1087
- }));
1088
- }
1089
- }), bn = /* @__PURE__ */ R({
1090
- __name: "InvoiceDetailSidebar",
1091
- props: {
1092
- customFieldDefinitions: {},
1093
- invoice: {}
1094
- },
1095
- setup(e) {
1096
- let t = e, n = A(), r = T(), i = M(() => n.t("wise_invoicing.invoice.detail.sidebar.updated_on", { date: r.toDateTime(t.invoice.updatedAt) }));
1097
- return (e, n) => (B(), N(Ne, {
1098
- "billing-document": t.invoice,
1099
- "updated-footer": i.value
1100
- }, {
1101
- activity: H(() => [L(un, { invoice: t.invoice }, null, 8, ["invoice"])]),
1102
- info: H(() => [L(yn, {
1103
- "custom-field-definitions": t.customFieldDefinitions,
1104
- invoice: t.invoice
1105
- }, null, 8, ["custom-field-definitions", "invoice"])]),
1106
- _: 1
1107
- }, 8, ["billing-document", "updated-footer"]));
1108
- }
1109
- });
1110
- //#endregion
1111
- //#region src/modules/invoice/api/mutations/invoicePaymentDelete.mutation.ts
1112
- function xn() {
1113
- return U({
1114
- queryFn: (e) => _.deletePayment(e.params.invoiceUuid, e.params.paymentUuid),
1115
- queryKeysToInvalidate: {
1116
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
1117
- invoicePaymentIndex: { invoiceUuid: (e) => e.invoiceUuid }
1118
- }
1119
- });
1120
- }
1121
- //#endregion
1122
- //#region src/modules/invoice/api/queries/invoicePaymentIndex.query.ts
1123
- function Sn(e) {
1124
- return lt("invoicePaymentIndex", {
1125
- params: { invoiceUuid: e },
1126
- queryFn: () => _.getPayments(e.value)
1127
- });
1128
- }
1129
- //#endregion
1130
- //#region src/modules/invoice/use-cases/detail/components/table/InvoiceDetailPaymentActionsCell.vue
1131
- var Cn = /* @__PURE__ */ R({
1132
- __name: "InvoiceDetailPaymentActionsCell",
1133
- props: {
1134
- payment: {},
1135
- onDelete: { type: Function }
1136
- },
1137
- setup(e) {
1138
- let t = e, n = A();
1139
- return (e, r) => (B(), N(V(Pt), null, {
1140
- default: H(() => [L(V(Ft), null, {
1141
- default: H(() => [t.payment.source === V(u).MANUAL ? (B(), N(V(At), {
1142
- key: 0,
1143
- label: V(n).t("wise_invoicing.invoice.detail.payments.delete.title"),
1144
- icon: V(xe),
1145
- size: "sm",
1146
- variant: "tertiary",
1147
- onClick: r[0] ||= (e) => t.onDelete(t.payment)
1148
- }, null, 8, ["label", "icon"])) : P("", !0)]),
1149
- _: 1
1150
- })]),
1151
- _: 1
1152
- }));
1153
- }
1154
- }), wn = /* @__PURE__ */ R({
1155
- __name: "InvoiceDetailPaymentManualCell",
1156
- props: { payment: {} },
1157
- setup(e) {
1158
- let t = e;
1159
- return (e, n) => (B(), N(V(Pt), null, {
1160
- default: H(() => [t.payment.source === V(u).MANUAL ? (B(), N(V(be), {
1161
- key: 0,
1162
- class: "size-4 text-brand-600"
1163
- })) : P("", !0)]),
1164
- _: 1
1165
- }));
1166
- }
1167
- }), Tn = /* @__PURE__ */ R({
1168
- __name: "InvoiceDetailPaymentsTableTextCell",
1169
- props: { text: {} },
1170
- setup(e) {
1171
- let t = e;
1172
- return (e, n) => (B(), N(V(Pt), null, {
1173
- default: H(() => [L(V(X), {
1174
- text: t.text ?? "-",
1175
- class: "text-sm/5 text-primary"
1176
- }, null, 8, ["text"])]),
1177
- _: 1
1178
- }));
1179
- }
1180
- });
1181
- //#endregion
1182
- //#region src/modules/invoice/use-cases/detail/composables/invoiceDetailPaymentsTableColumns.composable.ts
1183
- function En(e) {
1184
- let t = A(), n = T(), r = d();
1185
- return M(() => zt()([
1186
- {
1187
- headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.date"),
1188
- key: "date",
1189
- size: {
1190
- max: "12rem",
1191
- min: "12rem"
1192
- },
1193
- component: (e) => Z(Tn, { text: n.formatPlainDate(e.date) })
1194
- },
1195
- {
1196
- headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.reference"),
1197
- key: "reference",
1198
- size: {
1199
- max: "14rem",
1200
- min: "12rem"
1201
- },
1202
- component: (e) => Z(Tn, { text: e.paymentReference ?? "—" })
1203
- },
1204
- {
1205
- headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.remark"),
1206
- key: "remark",
1207
- size: {
1208
- max: "1fr",
1209
- min: "12rem"
1210
- },
1211
- component: (e) => Z(Tn, { text: e.remarks ?? "—" })
1212
- },
1213
- {
1214
- headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.manual"),
1215
- key: "manual",
1216
- size: {
1217
- max: "6rem",
1218
- min: "6rem"
1219
- },
1220
- component: (e) => Z(wn, { payment: e })
1221
- },
1222
- {
1223
- headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.amount"),
1224
- key: "amount",
1225
- size: {
1226
- max: "10rem",
1227
- min: "10rem"
1228
- },
1229
- component: (e) => Z(Tn, { text: r.formatMonetary(e.amount) })
1230
- },
1231
- {
1232
- headerLabel: "",
1233
- key: "actions",
1234
- size: {
1235
- max: "5rem",
1236
- min: "5rem"
1237
- },
1238
- component: (t) => Z(Cn, {
1239
- payment: t,
1240
- onDelete: e.onDelete
1241
- })
1242
- }
1243
- ]));
1244
- }
1245
- //#endregion
1246
- //#region src/modules/invoice/api/mutations/invoicePaymentCreate.mutation.ts
1247
- function Dn() {
1248
- return U({
1249
- queryFn: (e) => _.createPayment(e.params.invoiceUuid, e.body),
1250
- queryKeysToInvalidate: {
1251
- invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
1252
- invoicePaymentIndex: { invoiceUuid: (e) => e.invoiceUuid }
1253
- }
1254
- });
1255
- }
1256
- //#endregion
1257
- //#region src/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.ts
1258
- var On = k.object({
1259
- amount: k.number().positive(),
1260
- currency: k.enum(r),
1261
- date: m,
1262
- paymentReference: k.string().nullable(),
1263
- precision: k.number().int().nonnegative(),
1264
- remarks: k.string().nullable()
1265
- }), kn = { class: "pr-md text-xs text-secondary" }, An = /* @__PURE__ */ R({
1266
- __name: "InvoicePaymentCreateDialog",
1267
- props: { invoice: {} },
1268
- emits: ["close"],
1269
- setup(e, { emit: t }) {
1270
- let n = e, r = t, i = A(), a = Q(), o = d(), s = Dn(), c = M(() => o.getSymbol(n.invoice.grossAmount.currency)), l = $({
1271
- initialState: {
1272
- amount: null,
1273
- currency: n.invoice.grossAmount.currency,
1274
- date: p.getToday(),
1275
- paymentReference: null,
1276
- precision: n.invoice.grossAmount.precision,
1277
- remarks: null
1278
- },
1279
- schema: On,
1280
- onSubmit: async (e) => {
1281
- let t = await s.execute({
1282
- body: e,
1283
- params: { invoiceUuid: n.invoice.uuid }
1284
- });
1285
- if (t.isErr()) {
1286
- a.apiError(t.error);
1287
- return;
1288
- }
1289
- a.show({ message: i.t("wise_invoicing.invoice.detail.payments.create.success") }), r("close");
1290
- },
1291
- onSubmitError: () => {
1292
- a.unableToSave();
1293
- }
1294
- }), u = l.register("amount"), f = l.register("date"), m = l.register("paymentReference"), h = l.register("remarks");
1295
- return (e, t) => (B(), N(V(Et), {
1296
- form: V(l),
1297
- size: "sm",
1298
- onClose: t[0] ||= (e) => r("close")
1299
- }, {
1300
- default: H(() => [
1301
- L(V(wt), {
1302
- title: V(i).t("wise_invoicing.invoice.detail.payments.create.title"),
1303
- description: V(i).t("wise_invoicing.invoice.detail.payments.create.description"),
1304
- icon: V(ge),
1305
- "is-description-visible": !0
1306
- }, null, 8, [
1307
- "title",
1308
- "description",
1309
- "icon"
1310
- ]),
1311
- L(V(bt), null, {
1312
- default: H(() => [L(V(Ot), null, {
1313
- default: H(() => [L(V(Dt), {
1314
- lg: 2,
1315
- sm: 1
1316
- }, {
1317
- default: H(() => [
1318
- L(V(jt), z(V(O)(V(u)), {
1319
- "is-required": !0,
1320
- label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.amount"),
1321
- min: .01,
1322
- step: .01
1323
- }), {
1324
- right: H(() => [I("span", kn, it(c.value.symbol), 1)]),
1325
- _: 1
1326
- }, 16, ["label"]),
1327
- L(V(G), z(V(O)(V(f)), {
1328
- "is-required": !0,
1329
- label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.date")
1330
- }), null, 16, ["label"]),
1331
- L(V(It), z(V(O)(V(m)), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.reference") }), null, 16, ["label"]),
1332
- L(V(It), z(V(O)(V(h)), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.remarks") }), null, 16, ["label"])
1333
- ]),
1334
- _: 1
1335
- })]),
1336
- _: 1
1337
- })]),
1338
- _: 1
1339
- }),
1340
- L(V(xt), null, {
1341
- right: H(() => [L(V(St), { label: "cancel" }), L(V(kt), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.submit") }, null, 8, ["label"])]),
1342
- _: 1
1343
- })
1344
- ]),
1345
- _: 1
1346
- }, 8, ["form"]));
1347
- }
1348
- }), jn = /* @__PURE__ */ R({
1349
- __name: "InvoiceDetailPaymentsSection",
1350
- props: { invoice: {} },
1351
- setup(e) {
1352
- let t = e, n = A(), r = d(), i = M(() => t.invoice.uuid), a = M(() => t.invoice.balanceDueAmount === null ? null : r.formatMonetary(t.invoice.balanceDueAmount)), { isLoading: o, result: s } = Sn(i), c = Bt(), l = Q(), u = c.create(An), f = c.create(gt), p = xn(), m = M(() => s.value.match({
1353
- err: () => [],
1354
- loading: () => [],
1355
- ok: (e) => e
1356
- })), h = M(() => s.value.match({
1357
- err: (e) => e,
1358
- loading: () => null,
1359
- ok: () => null
1360
- })), g = M(() => !D.getMetadata(t.invoice.status).isTerminal);
1361
- function _() {
1362
- u.open({ invoice: t.invoice });
1363
- }
1364
- function v(e) {
1365
- f.open({
1366
- title: n.t("wise_invoicing.invoice.detail.payments.delete.title"),
1367
- isDestructive: !0,
1368
- confirmLabel: n.t("wise_invoicing.invoice.detail.payments.delete.submit"),
1369
- description: n.t("wise_invoicing.invoice.detail.payments.delete.description"),
1370
- onConfirm: async () => {
1371
- let r = await p.execute({ params: {
1372
- invoiceUuid: t.invoice.uuid,
1373
- paymentUuid: e.uuid
1374
- } });
1375
- if (r.isErr()) {
1376
- l.apiError(r.error);
1377
- return;
1378
- }
1379
- l.show({ message: n.t("wise_invoicing.invoice.detail.payments.delete.success") }), f.close();
1380
- }
1381
- });
1382
- }
1383
- let y = En({ onDelete: v });
1384
- return (e, t) => (B(), N(Be, null, {
1385
- default: H(() => [L(V(Y), {
1386
- justify: "between",
1387
- class: "w-full gap-lg border-b border-secondary px-lg py-md"
1388
- }, {
1389
- default: H(() => [L(V(Y), { gap: "sm" }, {
1390
- default: H(() => [L(V(X), {
1391
- text: V(n).t("wise_invoicing.invoice.detail.payments.title"),
1392
- as: "h2",
1393
- class: "text-sm font-semibold text-primary"
1394
- }, null, 8, ["text"]), a.value === null ? P("", !0) : (B(), N(V(W), {
1395
- key: 0,
1396
- color: "gray",
1397
- size: "sm",
1398
- variant: "outline"
1399
- }, {
1400
- default: H(() => [
1401
- L(V(ft), { label: V(n).t("wise_invoicing.invoice.detail.payments.balance_due") }, null, 8, ["label"]),
1402
- L(V(pt)),
1403
- L(V(ft), { label: a.value }, null, 8, ["label"])
1404
- ]),
1405
- _: 1
1406
- }))]),
1407
- _: 1
1408
- }), g.value ? (B(), N(V(mt), {
1409
- key: 0,
1410
- label: V(n).t("wise_invoicing.invoice.detail.payments.add"),
1411
- "icon-left": V(ve),
1412
- size: "sm",
1413
- onClick: _
1414
- }, null, 8, ["label", "icon-left"])) : P("", !0)]),
1415
- _: 1
1416
- }), L(V(Nt), {
1417
- "active-filter-count": 0,
1418
- columns: V(y),
1419
- data: m.value,
1420
- error: h.value,
1421
- "get-key": (e) => e.uuid,
1422
- "has-active-search": !1,
1423
- "header-actions": [],
1424
- "is-fetching-next-page": !1,
1425
- "is-loading": V(o)
1426
- }, null, 8, [
1427
- "columns",
1428
- "data",
1429
- "error",
1430
- "get-key",
1431
- "is-loading"
1432
- ])]),
1433
- _: 1
1434
- }));
1435
- }
1436
- });
1437
- //#endregion
1438
- //#region src/modules/invoice/api/mutations/invoiceUpdateLines.mutation.ts
1439
- function Mn() {
1440
- return U({
1441
- queryFn: (e) => _.updateLines(e.params.invoiceUuid, e.body),
1442
- queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
1443
- });
1444
- }
1445
- //#endregion
1446
- //#region src/modules/invoice/api/mutations/invoiceApplyDiscount.mutation.ts
1447
- function Nn() {
1448
- return U({
1449
- queryFn: (e) => _.applyDiscount(e.params.invoiceUuid, e.body),
1450
- queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
1451
- });
1452
- }
1453
- //#endregion
1454
- //#region src/modules/invoice/models/invoice/update/invoiceApplyDiscountForm.model.ts
1455
- var Pn = k.object({
1456
- currency: k.enum(r),
1457
- precision: k.number().int().nonnegative(),
1458
- type: k.enum(a),
1459
- value: k.number()
1460
- }).refine((e) => e.type !== a.PERCENTAGE || e.value <= 100, { path: ["value"] }), Fn = { class: "pr-md text-xs text-secondary" }, In = /* @__PURE__ */ R({
1461
- __name: "InvoiceApplyDiscountDialog",
1462
- props: { invoice: {} },
1463
- emits: ["close"],
1464
- setup(e, { emit: t }) {
1465
- let n = e, r = t, i = A(), o = Q(), s = d(), c = Nn(), l = M(() => Rt([a.PERCENTAGE, a.AMOUNT])), u = $({
1466
- initialState: {
1467
- currency: n.invoice.grossAmount.currency,
1468
- precision: n.invoice.grossAmount.precision,
1469
- type: a.PERCENTAGE,
1470
- value: null
1471
- },
1472
- schema: Pn,
1473
- onSubmit: async (e) => {
1474
- let t = await c.execute({
1475
- body: e,
1476
- params: { invoiceUuid: n.invoice.uuid }
1477
- });
1478
- if (t.isErr()) {
1479
- o.apiError(t.error);
1480
- return;
1481
- }
1482
- r("close");
1483
- },
1484
- onSubmitError: () => {
1485
- o.unableToSave();
1486
- }
1487
- }), f = u.register("value"), p = u.register("type"), m = M(() => p.modelValue.value === a.PERCENTAGE), h = M(() => p.modelValue.value === a.AMOUNT), g = M(() => s.getSymbol(n.invoice.grossAmount.currency));
1488
- function _(e) {
1489
- return i.t(`wise_invoicing.invoice.detail.global_discount.type.${e}`);
1490
- }
1491
- return (e, t) => (B(), N(V(Et), {
1492
- form: V(u),
1493
- size: "sm",
1494
- onClose: t[0] ||= (e) => r("close")
1495
- }, {
1496
- default: H(() => [
1497
- L(V(wt), {
1498
- title: V(i).t("wise_invoicing.invoice.detail.line_items.global_discount"),
1499
- description: V(i).t("wise_invoicing.invoice.detail.global_discount.description"),
1500
- icon: V(ue),
1501
- "is-description-visible": !0
1502
- }, null, 8, [
1503
- "title",
1504
- "description",
1505
- "icon"
1506
- ]),
1507
- L(V(bt), null, {
1508
- default: H(() => [L(V(Ot), null, {
1509
- default: H(() => [L(V(Dt), {
1510
- lg: 2,
1511
- sm: 1
1512
- }, {
1513
- default: H(() => [
1514
- L(V(Mt), z(V(O)(V(p)), {
1515
- "display-fn": _,
1516
- "is-required": !0,
1517
- items: l.value,
1518
- label: V(i).t("wise_invoicing.invoice.detail.global_discount.type.label")
1519
- }), null, 16, ["items", "label"]),
1520
- m.value ? (B(), N(V(jt), z({ key: 0 }, V(O)(V(f)), {
1521
- hint: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.hint"),
1522
- "is-required": !0,
1523
- label: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
1524
- max: 100,
1525
- min: 0,
1526
- step: .01
1527
- }), {
1528
- right: H(() => [...t[1] ||= [I("span", { class: "pr-md text-xs text-secondary" }, " % ", -1)]]),
1529
- _: 1
1530
- }, 16, ["hint", "label"])) : P("", !0),
1531
- h.value ? (B(), N(V(jt), z({ key: 1 }, V(O)(V(f)), {
1532
- "is-required": !0,
1533
- label: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
1534
- min: .01,
1535
- step: .01
1536
- }), {
1537
- right: H(() => [I("span", Fn, it(g.value.symbol), 1)]),
1538
- _: 1
1539
- }, 16, ["label"])) : P("", !0)
1540
- ]),
1541
- _: 1
1542
- })]),
1543
- _: 1
1544
- })]),
1545
- _: 1
1546
- }),
1547
- L(V(xt), null, {
1548
- right: H(() => [L(V(St), { label: "cancel" }), L(V(Ct), { label: V(i).t("wise_invoicing.invoice.detail.global_discount.confirm") }, null, 8, ["label"])]),
1549
- _: 1
1550
- })
1551
- ]),
1552
- _: 1
1553
- }, 8, ["form"]));
1554
- }
1555
- }), Ln = /* @__PURE__ */ R({
1556
- __name: "InvoiceLineItemsTableSection",
1557
- props: {
1558
- customFieldDefinitions: {},
1559
- invoice: {}
1560
- },
1561
- setup(e) {
1562
- let t = e, n = M(() => t.invoice), r = b(), i = Mn(), a = M(() => D.isEditable(t.invoice.status)), o = Ie({
1563
- isSaving: M(() => i.isLoading.value),
1564
- billingDocument: () => n.value,
1565
- canEdit: a,
1566
- customFieldDefinitions: () => t.customFieldDefinitions,
1567
- updateLines: (e) => i.execute({
1568
- body: e,
1569
- params: { invoiceUuid: t.invoice.uuid }
1570
- })
1571
- }), s = Bt().create(In);
1572
- function c() {
1573
- s.open({ invoice: t.invoice });
1574
- }
1575
- return Me(o), (e, n) => (B(), N(Be, null, {
1576
- default: H(() => [
1577
- L(Ue, {
1578
- "show-apply-discount": V(r).isGlobalDiscountEnabled.value,
1579
- onApplyDiscount: c
1580
- }, null, 8, ["show-apply-discount"]),
1581
- L(je),
1582
- L(ke, { "billing-document": t.invoice }, null, 8, ["billing-document"]),
1583
- L(Ge)
1584
- ]),
1585
- _: 1
1586
- }));
1587
- }
1588
- }), Rn = /* @__PURE__ */ R({
1589
- __name: "InvoiceDetailView",
1590
- props: {
1591
- customFieldDefinitions: {},
1592
- invoice: {}
1593
- },
1594
- setup(e) {
1595
- let t = e, n = A(), r = nt(!1), i = M(() => [{
1596
- label: n.t("wise_invoicing.invoice.overview.title"),
1597
- to: { name: "invoicing-invoice-overview" }
1598
- }, { label: t.invoice.sequence ?? t.invoice.subject ?? n.t("wise_invoicing.invoice.detail.fallback_title") }]);
1599
- return (e, a) => (B(), N(He, {
1600
- "billing-document": t.invoice,
1601
- breadcrumbs: i.value,
1602
- title: V(n).t("wise_invoicing.invoice.detail.fallback_title")
1603
- }, {
1604
- header: H(() => [L(rn, {
1605
- invoice: t.invoice,
1606
- "is-pdf-view-active": r.value,
1607
- class: "w-full",
1608
- onTogglePdfView: a[0] ||= (e) => r.value = !r.value
1609
- }, null, 8, ["invoice", "is-pdf-view-active"])]),
1610
- default: H(() => [r.value ? (B(), N(ze, {
1611
- key: 0,
1612
- "billing-document": t.invoice,
1613
- class: "w-full"
1614
- }, null, 8, ["billing-document"])) : (B(), F(j, { key: 1 }, [
1615
- L(Ln, {
1616
- "custom-field-definitions": t.customFieldDefinitions,
1617
- invoice: t.invoice
1618
- }, null, 8, ["custom-field-definitions", "invoice"]),
1619
- V(D).isEditable(t.invoice.status) ? P("", !0) : (B(), N(jn, {
1620
- key: 0,
1621
- invoice: t.invoice,
1622
- class: "w-full"
1623
- }, null, 8, ["invoice"])),
1624
- L(on, {
1625
- invoice: t.invoice,
1626
- class: "w-full"
1627
- }, null, 8, ["invoice"]),
1628
- L(cn, {
1629
- invoice: t.invoice,
1630
- class: "w-full"
1631
- }, null, 8, ["invoice"])
1632
- ], 64))]),
1633
- sidebar: H(() => [L(bn, {
1634
- "custom-field-definitions": t.customFieldDefinitions,
1635
- invoice: t.invoice
1636
- }, null, 8, ["custom-field-definitions", "invoice"])]),
1637
- _: 1
1638
- }, 8, [
1639
- "billing-document",
1640
- "breadcrumbs",
1641
- "title"
1642
- ]));
1643
- }
1644
- }), zn = /* @__PURE__ */ R({
1645
- __name: "InvoiceDetailViewDataProvider",
1646
- props: { invoiceUuid: {} },
1647
- setup(e) {
1648
- let t = e, n = A(), r = M(() => [{
1649
- label: n.t("wise_invoicing.invoice.overview.title"),
1650
- to: { name: "invoicing-invoice-overview" }
1651
- }]), i = Xe(M(() => t.invoiceUuid)), a = he();
1652
- return (e, t) => (B(), N(We, {
1653
- "custom-field-definitions-query": V(a),
1654
- query: V(i),
1655
- "loading-breadcrumbs": r.value
1656
- }, {
1657
- default: H(({ billingDocument: e, customFieldDefinitions: t }) => [L(Rn, {
1658
- "custom-field-definitions": t,
1659
- invoice: e
1660
- }, null, 8, ["custom-field-definitions", "invoice"])]),
1661
- _: 1
1662
- }, 8, [
1663
- "custom-field-definitions-query",
1664
- "query",
1665
- "loading-breadcrumbs"
1666
- ]));
1667
- }
1668
- });
1669
- //#endregion
1670
- export { zn as default };