@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.
- package/dist/ApprovalReminderSettingsViewDataProvider-D-qXZrPT.js +151 -0
- package/dist/{BillingDocumentDetailViewDataProvider-BemnzVNY.js → BillingDocumentDetailViewDataProvider-DDdtlW-2.js} +1417 -1459
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-5vi2pgRM.js → BillingDocumentPdf-ehdFB6mr.js} +4 -4
- package/dist/{CreditNoteDetailViewDataProvider-BuY9ELoK.js → CreditNoteDetailViewDataProvider-11a-JO3H.js} +201 -201
- package/dist/{CreditNotePdfViewDataProvider-DI4eQkpM.js → CreditNotePdfViewDataProvider-bfeaya3P.js} +3 -3
- package/dist/{CustomFieldValueText-BGbQwhON.js → CustomFieldValueText-CZQXGE5F.js} +81 -81
- package/dist/DataProvider-C3uEds9v.js +75 -0
- package/dist/{DunningCaseDetailViewDataProvider-DKuuysqS.js → DunningCaseDetailViewDataProvider-DC-ziMoO.js} +35 -35
- package/dist/{DunningCaseOverviewView-aWttPLrC.js → DunningCaseOverviewView-y_bCmi5j.js} +180 -180
- package/dist/{DunningCaseReminderPdfViewDataProvider-I0I_WQQB.js → DunningCaseReminderPdfViewDataProvider-DNODfED_.js} +22 -23
- package/dist/{DunningCaseSendDialog-DyvA5R1p.js → DunningCaseSendDialog-BPXcqit5.js} +82 -82
- package/dist/InvoiceApprovalOverviewView-DZ14mi4L.js +870 -0
- package/dist/InvoiceApprovalStatusBadge-U-dW2hR4.js +161 -0
- package/dist/InvoiceApproveDialog-2LXneG2r.js +308 -0
- package/dist/InvoiceDetailViewDataProvider-BYeaaQzL.js +2156 -0
- package/dist/InvoiceOverviewBulkSendApprovalDialog-99dfuN4i.js +318 -0
- package/dist/InvoiceOverviewViewDataProvider-CZIQeftL.js +1620 -0
- package/dist/{InvoicePdfView-C-7m2g3b.js → InvoicePdfView-BJRTg_TH.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-BPiK110e.js → InvoicePdfViewDataProvider-CwI_uGm3.js} +4 -4
- package/dist/InvoicePublicPdfViewDataProvider-uZUfsr5K.js +45 -0
- package/dist/InvoicingFileUploadProvider-D9Xk4rQM.js +94 -0
- package/dist/{IssuerSettingsViewDataProvider-COqHGUE6.js → IssuerSettingsViewDataProvider-CGRa8F-2.js} +4 -4
- package/dist/{ReminderSettingsViewDataProvider-Dys4bUU7.js → ReminderSettingsViewDataProvider-1ucp3z2T.js} +58 -58
- package/dist/{api.util-BCSgCfpS.js → api.util-C_kMGlJN.js} +1456 -846
- package/dist/{billingDocumentDetail.transformer-BBn9R_cx.js → billingDocumentDetail.transformer-Da6_-Hv9.js} +58 -59
- package/dist/client/index.d.ts +2 -2
- package/dist/client/sdk.gen.d.ts +18 -1
- package/dist/client/types.gen.d.ts +1059 -106
- package/dist/client/zod.gen.d.ts +32759 -16136
- package/dist/{creditNoteDetail.query-BcPsB96h.js → creditNoteDetail.query-DLR7L0Ep.js} +30 -30
- package/dist/{dist-BBjpqvUl.js → dist-CoztMdYH.js} +614 -614
- package/dist/{dist-D9lp7NDv.js → dist-Cxdm09Lp.js} +210 -98
- package/dist/{documentTitle.composable-4ApFl9TZ.js → documentTitle.composable-DsBbzhXN.js} +23 -15
- package/dist/{customFieldValue.util-BwsX8exl.js → download.util-B5Q7KUC9.js} +6 -6
- package/dist/{i18n.lib-C6eb-F-e.js → i18n.lib-Cvr8pcDw.js} +272 -8
- package/dist/index.d.ts +297 -31
- package/dist/index.js +344 -324
- package/dist/invoice.service-DEEA9mal.js +745 -0
- package/dist/invoiceApproval.service-DvL3LliM.js +72 -0
- package/dist/invoiceApprovalStatus.util-3Zh10Pj8.js +79 -0
- package/dist/invoiceDeliveryStatus.util-nCsqDypY.js +211 -0
- package/dist/{invoiceDetail.query-Cek8nyaw.js → invoiceDetail.query-CRoH_SgM.js} +1 -1
- package/dist/{invoicingConfig.composable-DTmad1fe.js → invoicingConfig.composable-rxjGK882.js} +2 -2
- package/dist/{issuerSettings.query-Bvz-Oj5D.js → issuerSettings.query-Dc5gsaEm.js} +5 -5
- package/dist/libs/i18n.lib.d.ts +270 -6
- package/dist/locales/en-US.json.d.ts +136 -4
- package/dist/locales/nl-BE.json.d.ts +136 -4
- package/dist/modules/dunning-case/models/dunningCase.transformer.d.ts +0 -1
- package/dist/modules/invoice/api/mutations/invoiceApproveApproval.mutation.d.ts +16 -0
- package/dist/modules/invoice/api/mutations/invoiceArchiveApproval.mutation.d.ts +6 -0
- package/dist/modules/invoice/api/mutations/invoiceBulkSendApproval.mutation.d.ts +5 -0
- package/dist/modules/invoice/api/mutations/invoiceMarkAsPriorApprovalRequired.mutation.d.ts +4 -0
- package/dist/modules/invoice/api/mutations/invoiceRejectApproval.mutation.d.ts +9 -0
- package/dist/modules/invoice/api/mutations/invoiceRestoreFromProForma.mutation.d.ts +4 -0
- package/dist/modules/invoice/api/mutations/invoiceSendApproval.mutation.d.ts +5 -0
- package/dist/modules/invoice/api/mutations/invoiceUnmarkAsPriorApprovalRequired.mutation.d.ts +4 -0
- package/dist/modules/invoice/api/services/invoice.service.d.ts +14 -1
- package/dist/modules/invoice/components/InvoiceApprovalOutOfSyncIndicator.vue.d.ts +3 -0
- package/dist/{ui/DisplayState.vue.d.ts → modules/invoice/components/InvoiceApprovalStatusBadge.vue.d.ts} +7 -10
- package/dist/modules/invoice/components/InvoiceApprovalStatusChip.vue.d.ts +16 -0
- package/dist/modules/invoice/models/invoice/approval/invoiceApprovalTransformers.spec.d.ts +1 -0
- package/dist/modules/invoice/models/invoice/approval/invoiceApprovalUuid.model.d.ts +3 -0
- package/dist/modules/invoice/models/invoice/approval/invoiceApprove.transformer.d.ts +5 -0
- package/dist/modules/invoice/models/invoice/approval/invoiceApproveForm.model.d.ts +13 -0
- package/dist/modules/invoice/models/invoice/approval/invoiceReject.transformer.d.ts +5 -0
- package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.d.ts +7 -0
- package/dist/modules/invoice/models/invoice/approval/invoiceRejectForm.model.spec.d.ts +1 -0
- package/dist/modules/invoice/models/invoice/detail/invoiceDetail.model.d.ts +13 -1
- package/dist/modules/invoice/models/invoice/detail/invoiceDetail.transformer.d.ts +1 -0
- package/dist/modules/invoice/models/invoice/index/invoiceIndex.model.d.ts +4 -0
- package/dist/modules/invoice/models/invoice/index/invoiceIndexQueryParams.model.d.ts +3 -0
- package/dist/modules/invoice/models/invoice/invoiceApproval.transformer.d.ts +7 -0
- package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.model.d.ts +34 -0
- package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.util.d.ts +10 -0
- package/dist/modules/invoice/models/invoice/invoiceApprovalStatus.util.spec.d.ts +1 -0
- package/dist/modules/invoice/use-cases/detail/components/InvoiceApprovalBanner.vue.d.ts +19 -0
- package/dist/modules/invoice/use-cases/detail/components/InvoiceDetailHeaderSection.vue.d.ts +4 -0
- package/dist/modules/invoice/use-cases/detail/composables/invoiceDetailHeaderActions.composable.d.ts +5 -0
- package/dist/modules/invoice/use-cases/detail/composables/invoiceDetailPaymentsTableColumns.composable.d.ts +1 -1
- package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalArchiveDialog.vue.d.ts +13 -0
- package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalRevertDialog.vue.d.ts +15 -0
- package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceApproveDialog.vue.d.ts +13 -0
- package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceFinalizeOutOfSyncDialog.vue.d.ts +21 -0
- package/dist/modules/invoice/use-cases/detail/dialogs/InvoiceRejectDialog.vue.d.ts +13 -0
- package/dist/modules/invoice/use-cases/overview/components/InvoiceOverviewBulkActionBar.vue.d.ts +3 -0
- package/dist/modules/invoice/use-cases/overview/components/InvoiceOverviewTableApprovalCell.vue.d.ts +9 -0
- package/dist/modules/invoice/use-cases/overview/composables/invoiceOverviewDataTableFilters.composable.d.ts +3 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkActionDialog.vue.d.ts +1 -0
- package/dist/modules/invoice/use-cases/overview/dialogs/InvoiceOverviewBulkSendApprovalDialog.vue.d.ts +12 -0
- package/dist/modules/invoice/use-cases/overview/utils/invoiceOverviewBulkActionFeedback.util.d.ts +2 -0
- package/dist/modules/invoice/use-cases/overview/views/InvoiceOverviewView.vue.d.ts +0 -5
- package/dist/modules/invoice-approval/actions/invoiceApproval.actions.d.ts +5 -0
- package/dist/modules/invoice-approval/actions/invoiceApprovalArchive.action.d.ts +1 -0
- package/dist/modules/invoice-approval/actions/invoiceApprovalMarkAsApproved.action.d.ts +1 -0
- package/dist/modules/invoice-approval/actions/invoiceApprovalReject.action.d.ts +1 -0
- package/dist/modules/invoice-approval/actions/invoiceApprovalSendRequest.action.d.ts +1 -0
- package/dist/modules/invoice-approval/actions/invoiceApprovalUnmarkAsNeedsApproval.action.d.ts +1 -0
- package/dist/modules/invoice-approval/api/mutations/approvalReminderConfigUpdate.mutation.d.ts +8 -0
- package/dist/modules/invoice-approval/api/queries/approvalReminderConfig.query.d.ts +1 -0
- package/dist/modules/invoice-approval/api/queries/invoiceApprovalIndex.query.d.ts +3 -0
- package/dist/modules/invoice-approval/api/query-keys/invoiceApproval.queryKeys.d.ts +15 -0
- package/dist/modules/invoice-approval/api/services/invoiceApproval.service.d.ts +10 -0
- package/dist/modules/invoice-approval/components/InvoiceApprovalReminderLevelIndicator.vue.d.ts +7 -0
- package/dist/modules/invoice-approval/models/approvalReminderConfig.transformer.d.ts +6 -0
- package/dist/modules/invoice-approval/models/approvalReminderConfigForm.model.d.ts +11 -0
- package/dist/modules/invoice-approval/models/approvalReminderConfigForm.spec.d.ts +1 -0
- package/dist/modules/invoice-approval/models/invoiceApprovalIndex.model.d.ts +21 -0
- package/dist/modules/invoice-approval/models/invoiceApprovalIndex.transformer.d.ts +5 -0
- package/dist/modules/invoice-approval/models/invoiceApprovalIndexQueryParams.model.d.ts +9 -0
- package/dist/modules/invoice-approval/models/invoiceApprovalIndexQueryParams.transformer.d.ts +6 -0
- package/dist/modules/invoice-approval/routes/invoiceApproval.routes.d.ts +24 -0
- package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewActionsCell.vue.d.ts +7 -0
- package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewAmountCell.vue.d.ts +7 -0
- package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewInvoiceCell.vue.d.ts +7 -0
- package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewMetrics.vue.d.ts +18 -0
- package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewNextReminderCell.vue.d.ts +7 -0
- package/dist/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewStatusCell.vue.d.ts +7 -0
- package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverview.composable.d.ts +42 -0
- package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewFilters.composable.d.ts +10 -0
- package/dist/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewTableColumns.composable.d.ts +3 -0
- package/dist/modules/invoice-approval/use-cases/overview/views/InvoiceApprovalOverviewView.vue.d.ts +3 -0
- package/dist/modules/invoice-approval/use-cases/settings/views/ApprovalReminderSettingsView.vue.d.ts +7 -0
- package/dist/modules/invoice-approval/use-cases/settings/views/ApprovalReminderSettingsViewDataProvider.vue.d.ts +3 -0
- package/dist/modules/settings/routes/settings.routes.d.ts +7 -0
- package/dist/{plainDate.transformer-BxvJpJOv.js → plainDate.transformer-Bhiz9jW7.js} +17 -4
- package/dist/reminderConfig.query-snaHQmrY.js +309 -0
- package/dist/routes/invoicingRoutes.composable.d.ts +14 -6
- package/dist/search.composable-CU9OpyUB.js +52 -0
- package/dist/{src-BFgnUugN.js → src-DUSgQTKr.js} +45 -45
- package/dist/style.css +1 -1
- package/dist/types/queryKey.type.d.ts +3 -2
- package/dist/ui/billing-document/table/utils/billingDocumentLineItemsEditor.util.d.ts +15 -0
- package/dist/utils/html.util.d.ts +4 -0
- package/package.json +2 -1
- package/dist/AddOpenBoundaryIcon-9SqBHfoz.js +0 -25
- package/dist/AirlineIcon-Z6sH_StM.js +0 -26
- package/dist/AirplaneIcon-C-nSkD1w.js +0 -19
- package/dist/AirportIcon-m4itDKCV.js +0 -16
- package/dist/AlertTriangleIcon-DtYLCC-Y.js +0 -23
- package/dist/AllocationsIcon-hcg93Sll.js +0 -16
- package/dist/ArrowNarrowRightIcon-2-Sml68f.js +0 -23
- package/dist/AssetIcon-qOYs6Wna.js +0 -16
- package/dist/BarChartIcon-DDyzpV_3.js +0 -22
- package/dist/BellIcon-DF1OBFta.js +0 -21
- package/dist/BuildingIcon-CC5PMNeP.js +0 -22
- package/dist/ChargerIcon-aM_endLr.js +0 -16
- package/dist/ChevronDownIcon-4QiK-Z6-.js +0 -23
- package/dist/ChevronUpIcon-qBsjZ5Dz.js +0 -23
- package/dist/ClockIcon-BNiPCaiB.js +0 -23
- package/dist/ClockSnoozeIcon-BxGfwJB6.js +0 -23
- package/dist/CopyIcon-DH5ly0dZ.js +0 -19
- package/dist/DataProvider-Dj34ljUX.js +0 -75
- package/dist/DownloadCloudIcon-Cf8ftklG.js +0 -22
- package/dist/EditIcon-Dr7OHBBR.js +0 -21
- package/dist/EraserIcon-B1VJSvdI.js +0 -23
- package/dist/FileIcon-ssmQI5Yl.js +0 -23
- package/dist/FilterLinesIcon-C7YdyPBk.js +0 -23
- package/dist/GlobeIcon-BfRM6Ike.js +0 -22
- package/dist/HelpIcon-BrJ49P5y.js +0 -22
- package/dist/HourGlassIcon-D9rfU1Is.js +0 -22
- package/dist/InfoCircleIcon-Ee0SyiMc.js +0 -23
- package/dist/InvoiceDetailViewDataProvider-D6E7YVV1.js +0 -1670
- package/dist/InvoiceOverviewViewDataProvider-i8tXATJE.js +0 -1677
- package/dist/InvoicePublicPdfViewDataProvider-BJe-8hC5.js +0 -45
- package/dist/KeyboardIcon-T3o_g-1c.js +0 -22
- package/dist/LinkExternalIcon-BkHS4fCx.js +0 -22
- package/dist/LinkIcon-DuPwae98.js +0 -22
- package/dist/MarkerIcon-B1Jqenjb.js +0 -28
- package/dist/MobileBatteryIcon-GZ1SMRDV.js +0 -16
- package/dist/MonitorIcon-pbK22reU.js +0 -22
- package/dist/NotificationIcon-Ctv8vyWt.js +0 -19
- package/dist/ParkingIcon-DnUPW3pB.js +0 -24
- package/dist/PlanningIcon-CXvrskgj.js +0 -16
- package/dist/PreferenceIcon-BHS8uDyi.js +0 -22
- package/dist/ReceiptCheckIcon-QTestqCJ.js +0 -23
- package/dist/RefreshIcon-DShY-aoS.js +0 -22
- package/dist/RemoveOpenBoundaryIcon-CN8YWs6o.js +0 -28
- package/dist/RewindIcon-GWg2AQax.js +0 -22
- package/dist/SettingsIcon-CBLJ6B5u.js +0 -25
- package/dist/ShieldIcon-CVnrOcxl.js +0 -19
- package/dist/ShieldOffIcon-B9l0dDVb.js +0 -23
- package/dist/SignOutIcon-CmDkjJ5F.js +0 -21
- package/dist/SlashCircleIcon-jY5FBko5.js +0 -22
- package/dist/StandIcon-CoYnBLMn.js +0 -23
- package/dist/StarsIcon-D7ZlqOW7.js +0 -22
- package/dist/StopwatchIcon-BK0vh1lg.js +0 -22
- package/dist/TargetIcon-HMWj77-Q.js +0 -22
- package/dist/ThreeDotsIcon-BtFruOKz.js +0 -32
- package/dist/ToolIcon-DRfDb7fE.js +0 -22
- package/dist/TrashIcon-BwxBjHv5.js +0 -19
- package/dist/TurnaroundIcon-b1X61TwZ.js +0 -27
- package/dist/UploadCloudIcon-BF0equKg.js +0 -22
- package/dist/UserIcon-B0rCC6KE.js +0 -22
- package/dist/UsersIcon-cK5l_zKG.js +0 -22
- package/dist/VerifiedIcon-CELYlqcv.js +0 -22
- package/dist/WifiIcon--JPvMNEF.js +0 -23
- package/dist/WifiOffIcon-BS2KftcP.js +0 -23
- package/dist/ZapIcon-BHwcIQc0.js +0 -23
- package/dist/ZoomInIcon-Cu6r915V.js +0 -23
- package/dist/ZoomOutIcon-DwB4FRj-.js +0 -23
- package/dist/_plugin-vue_export-helper-B3ysoDQm.js +0 -8
- package/dist/instant.transformer-KmBsH3E9.js +0 -18
- package/dist/invoice.service-Bb8VqQvc.js +0 -635
- package/dist/invoiceDeliveryStatus.util-BPkGCQM6.js +0 -331
- package/dist/reminderConfig.query-DsJNqqi7.js +0 -331
- package/dist/search.composable-BCtYqudV.js +0 -52
|
@@ -0,0 +1,870 @@
|
|
|
1
|
+
import "./api.util-C_kMGlJN.js";
|
|
2
|
+
import { a as e, g as t, t as n } from "./documentTitle.composable-DsBbzhXN.js";
|
|
3
|
+
import { r } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
4
|
+
import { t as i } from "./search.composable-CU9OpyUB.js";
|
|
5
|
+
import { t as a } from "./invoice.service-DEEA9mal.js";
|
|
6
|
+
import { A as o, B as s, D as c, I as l, M as u, N as d, Q as f, R as p, c as ee, ct as te, g as ne, i as m, j as h, ot as re } from "./dist-Cxdm09Lp.js";
|
|
7
|
+
import { n as g } from "./dist-boJIIxnT.js";
|
|
8
|
+
import { f as ie, i as ae, n as oe, o as se, r as _, s as ce } from "./dist-CoztMdYH.js";
|
|
9
|
+
import { n as v, t as y } from "./invoiceApprovalStatus.util-3Zh10Pj8.js";
|
|
10
|
+
import { t as b } from "./InvoiceApprovalStatusBadge-U-dW2hR4.js";
|
|
11
|
+
import { a as x, i as le, t as ue } from "./InvoiceOverviewBulkSendApprovalDialog-99dfuN4i.js";
|
|
12
|
+
import { a as S, i as C, n as de, r as fe, t as w } from "./InvoiceApproveDialog-2LXneG2r.js";
|
|
13
|
+
import { t as pe } from "./invoiceApproval.service-DvL3LliM.js";
|
|
14
|
+
import { useI18n as T } from "vue-i18n";
|
|
15
|
+
import { Fragment as E, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createVNode as M, defineComponent as N, isRef as me, nextTick as P, normalizeClass as F, normalizeStyle as I, openBlock as L, ref as R, renderList as z, resolveDynamicComponent as B, unref as V, watch as he, withCtx as H } from "vue";
|
|
16
|
+
import { useOffsetInfiniteQuery as ge } from "@wisemen/vue-core-api-utils";
|
|
17
|
+
import { Temporal as _e } from "temporal-polyfill";
|
|
18
|
+
import { UIActionTrigger as ve, UIBadge as U, UIButton as W, UIClickableElement as ye, UIColumnLayout as G, UIDashboardPage as be, UIEmptyState as xe, UILink as Se, UIRowLayout as K, UITable as Ce, UITableCell as q, UITableCellInteractiveElement as we, UITabs as Te, UITabsItem as Ee, UITabsList as De, UIText as J, createComponent as Y, defineTableColumns as Oe, useOverlay as X, useToast as ke } from "@wisemen/vue-core-design-system";
|
|
19
|
+
import { createAction as Z } from "@wisemen/vue-core-actions";
|
|
20
|
+
import { useRouteQuery as Ae } from "@vueuse/router";
|
|
21
|
+
//#region src/modules/invoice-approval/actions/invoiceApprovalArchive.action.ts
|
|
22
|
+
function je() {
|
|
23
|
+
let e = T(), n = X().create(S);
|
|
24
|
+
return Z({
|
|
25
|
+
id: "invoice-approval-archive",
|
|
26
|
+
isApplicable: (e) => {
|
|
27
|
+
if (!e.hasTargetedModelsOfType("InvoiceApproval")) return !1;
|
|
28
|
+
let n = e.targetedModelOfTypeOrThrow("InvoiceApproval");
|
|
29
|
+
return n.approval.status === t.REQUESTED || n.approval.status === t.EXPIRED;
|
|
30
|
+
},
|
|
31
|
+
name: () => e.t("wise_invoicing.invoice.detail.actions.archive_approval"),
|
|
32
|
+
execute: async (e) => {
|
|
33
|
+
let t = e.targetedModelOfTypeOrThrow("InvoiceApproval");
|
|
34
|
+
await n.open({
|
|
35
|
+
approvalUuid: t.uuid,
|
|
36
|
+
invoiceUuid: t.invoiceUuid
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
icon: () => d
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/modules/invoice-approval/actions/invoiceApprovalReject.action.ts
|
|
44
|
+
function Me() {
|
|
45
|
+
let e = T(), n = X().create(C);
|
|
46
|
+
return Z({
|
|
47
|
+
id: "invoice-approval-reject",
|
|
48
|
+
isApplicable: (e) => e.hasTargetedModelsOfType("InvoiceApproval") ? e.targetedModelOfTypeOrThrow("InvoiceApproval").approval.status !== t.REJECTED : !1,
|
|
49
|
+
name: () => e.t("wise_invoicing.invoice.detail.actions.reject_approval"),
|
|
50
|
+
execute: async (e) => {
|
|
51
|
+
let t = e.targetedModelOfTypeOrThrow("InvoiceApproval");
|
|
52
|
+
await n.open({
|
|
53
|
+
approvalUuid: t.uuid,
|
|
54
|
+
invoiceUuid: t.invoiceUuid
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
icon: () => l
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/modules/invoice-approval/actions/invoiceApprovalSendRequest.action.ts
|
|
62
|
+
function Ne() {
|
|
63
|
+
let e = T(), t = fe();
|
|
64
|
+
return Z({
|
|
65
|
+
id: "invoice-approval-send-request",
|
|
66
|
+
isApplicable: (e) => e.hasTargetedModelsOfType("InvoiceApproval"),
|
|
67
|
+
name: () => e.t("wise_invoicing.invoice.detail.actions.send_approval_request"),
|
|
68
|
+
execute: async (e) => {
|
|
69
|
+
let n = e.targetedModelOfTypeOrThrow("InvoiceApproval");
|
|
70
|
+
await t.execute({ params: {
|
|
71
|
+
invoiceUuid: n.invoiceUuid,
|
|
72
|
+
hasActiveApproval: !0
|
|
73
|
+
} });
|
|
74
|
+
},
|
|
75
|
+
icon: () => te
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/modules/invoice-approval/actions/invoiceApprovalUnmarkAsNeedsApproval.action.ts
|
|
80
|
+
function Pe() {
|
|
81
|
+
let e = T(), n = de();
|
|
82
|
+
return Z({
|
|
83
|
+
id: "invoice-approval-unmark-as-needs-approval",
|
|
84
|
+
isApplicable: (e) => e.hasTargetedModelsOfType("InvoiceApproval") ? e.targetedModelOfTypeOrThrow("InvoiceApproval").approval.status === t.REQUESTED : !1,
|
|
85
|
+
name: () => e.t("wise_invoicing.invoice.detail.actions.unmark_as_needs_approval"),
|
|
86
|
+
execute: async (e) => {
|
|
87
|
+
let t = e.targetedModelOfTypeOrThrow("InvoiceApproval");
|
|
88
|
+
await n.execute({ params: { invoiceUuid: t.invoiceUuid } });
|
|
89
|
+
},
|
|
90
|
+
icon: () => h
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewMetrics.vue?vue&type=script&setup=true&lang.ts
|
|
95
|
+
var Fe = { class: "grid min-w-0 grid-cols-1 gap-xl lg:grid-cols-2" }, Ie = { class: "mt-xl flex h-1.5 w-full overflow-hidden rounded-full bg-secondary" }, Le = { class: "mt-xl grid grid-cols-1 gap-md sm:grid-cols-2" }, Re = ["onClick"], ze = /* @__PURE__ */ N({
|
|
96
|
+
__name: "InvoiceApprovalOverviewMetrics",
|
|
97
|
+
props: {
|
|
98
|
+
hasCountError: { type: Boolean },
|
|
99
|
+
needsAttentionTotal: {},
|
|
100
|
+
outOfSyncCount: {},
|
|
101
|
+
rejectedCount: {},
|
|
102
|
+
reminderCountTotal: {},
|
|
103
|
+
reminderOneCount: {},
|
|
104
|
+
reminderTwoCount: {}
|
|
105
|
+
},
|
|
106
|
+
emits: ["showOutOfSync", "showRejected"],
|
|
107
|
+
setup(e, { emit: t }) {
|
|
108
|
+
let n = e, r = t, i = T(), a = D(() => n.hasCountError ? i.t("wise_invoicing.invoice_approval.overview.metrics.unavailable") : i.t("wise_invoicing.invoice_approval.overview.metrics.active_reminders")), o = D(() => [{
|
|
109
|
+
count: n.reminderOneCount,
|
|
110
|
+
key: "reminder-1",
|
|
111
|
+
label: i.t("wise_invoicing.invoice.approval_status.r1")
|
|
112
|
+
}, {
|
|
113
|
+
count: n.reminderTwoCount,
|
|
114
|
+
key: "reminder-2",
|
|
115
|
+
label: i.t("wise_invoicing.invoice.approval_status.r2")
|
|
116
|
+
}]), l = D(() => [{
|
|
117
|
+
count: n.rejectedCount,
|
|
118
|
+
countClass: "text-error-primary",
|
|
119
|
+
description: i.t("wise_invoicing.invoice_approval.overview.metrics.rejected_description"),
|
|
120
|
+
icon: s,
|
|
121
|
+
iconClass: "bg-error-secondary text-error-primary",
|
|
122
|
+
key: "rejected",
|
|
123
|
+
label: i.t("wise_invoicing.invoice.approval_status.rejected")
|
|
124
|
+
}, {
|
|
125
|
+
count: n.outOfSyncCount,
|
|
126
|
+
countClass: "text-warning-primary",
|
|
127
|
+
description: i.t("wise_invoicing.invoice_approval.overview.metrics.out_of_sync_description"),
|
|
128
|
+
icon: f,
|
|
129
|
+
iconClass: "bg-brand-secondary text-brand-secondary",
|
|
130
|
+
key: "out-of-sync",
|
|
131
|
+
label: i.t("wise_invoicing.invoice_approval.overview.tabs.out_of_sync")
|
|
132
|
+
}]);
|
|
133
|
+
function u(e) {
|
|
134
|
+
if (e === "rejected") {
|
|
135
|
+
r("showRejected");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
r("showOutOfSync");
|
|
139
|
+
}
|
|
140
|
+
return (e, t) => (L(), A("div", Fe, [M(V(G), {
|
|
141
|
+
"aria-label": V(i).t("wise_invoicing.invoice_approval.overview.metrics.reminders"),
|
|
142
|
+
as: "section",
|
|
143
|
+
gap: "none",
|
|
144
|
+
class: "min-w-0 rounded-lg border border-secondary bg-primary p-2xl shadow-sm"
|
|
145
|
+
}, {
|
|
146
|
+
default: H(() => [
|
|
147
|
+
M(V(K), {
|
|
148
|
+
align: "start",
|
|
149
|
+
justify: "between",
|
|
150
|
+
gap: "md"
|
|
151
|
+
}, {
|
|
152
|
+
default: H(() => [M(V(J), {
|
|
153
|
+
text: V(i).t("wise_invoicing.invoice_approval.overview.metrics.reminders"),
|
|
154
|
+
class: "text-xs font-semibold text-secondary uppercase"
|
|
155
|
+
}, null, 8, ["text"]), M(V(Se), {
|
|
156
|
+
label: V(i).t("wise_invoicing.invoice_approval.overview.metrics.approval_ladder"),
|
|
157
|
+
to: { name: "invoice-approval-settings-module" },
|
|
158
|
+
size: "sm",
|
|
159
|
+
variant: "tertiary"
|
|
160
|
+
}, null, 8, ["label"])]),
|
|
161
|
+
_: 1
|
|
162
|
+
}),
|
|
163
|
+
M(V(J), {
|
|
164
|
+
text: String(n.reminderCountTotal ?? "—"),
|
|
165
|
+
class: "mt-xl font-mono text-4xl font-semibold text-primary"
|
|
166
|
+
}, null, 8, ["text"]),
|
|
167
|
+
M(V(J), {
|
|
168
|
+
text: a.value,
|
|
169
|
+
class: "mt-xs text-sm text-secondary"
|
|
170
|
+
}, null, 8, ["text"]),
|
|
171
|
+
j("div", Ie, [(L(!0), A(E, null, z(o.value, (e) => (L(), A("span", {
|
|
172
|
+
key: e.key,
|
|
173
|
+
class: F(e.key === "reminder-1" ? "bg-warning-solid" : "\n bg-error-solid\n "),
|
|
174
|
+
style: I({ flexGrow: e.count ?? 0 })
|
|
175
|
+
}, null, 6))), 128))]),
|
|
176
|
+
j("div", Le, [(L(!0), A(E, null, z(o.value, (e) => (L(), O(V(K), {
|
|
177
|
+
key: e.key,
|
|
178
|
+
align: "center",
|
|
179
|
+
justify: "between",
|
|
180
|
+
gap: "xl"
|
|
181
|
+
}, {
|
|
182
|
+
default: H(() => [M(V(K), {
|
|
183
|
+
align: "center",
|
|
184
|
+
gap: "sm",
|
|
185
|
+
class: "min-w-0"
|
|
186
|
+
}, {
|
|
187
|
+
default: H(() => [j("span", { class: F([e.key === "reminder-1" ? "bg-warning-solid" : "\n bg-error-solid\n ", "size-2 shrink-0 rounded-full"]) }, null, 2), M(V(J), {
|
|
188
|
+
text: e.label,
|
|
189
|
+
class: "text-sm text-secondary"
|
|
190
|
+
}, null, 8, ["text"])]),
|
|
191
|
+
_: 2
|
|
192
|
+
}, 1024), M(V(J), {
|
|
193
|
+
text: e.count === null ? "—" : V(i).t("wise_invoicing.invoice_approval.overview.metrics.invoice_count", { count: e.count }),
|
|
194
|
+
class: "shrink-0 font-mono text-sm font-semibold text-primary tabular-nums"
|
|
195
|
+
}, null, 8, ["text"])]),
|
|
196
|
+
_: 2
|
|
197
|
+
}, 1024))), 128))])
|
|
198
|
+
]),
|
|
199
|
+
_: 1
|
|
200
|
+
}, 8, ["aria-label"]), M(V(G), {
|
|
201
|
+
"aria-label": V(i).t("wise_invoicing.invoice_approval.overview.metrics.needs_attention"),
|
|
202
|
+
as: "section",
|
|
203
|
+
gap: "none",
|
|
204
|
+
class: "min-w-0 rounded-lg border border-secondary bg-primary p-2xl shadow-sm"
|
|
205
|
+
}, {
|
|
206
|
+
default: H(() => [M(V(K), {
|
|
207
|
+
align: "start",
|
|
208
|
+
justify: "between",
|
|
209
|
+
gap: "md"
|
|
210
|
+
}, {
|
|
211
|
+
default: H(() => [M(V(J), {
|
|
212
|
+
text: V(i).t("wise_invoicing.invoice_approval.overview.metrics.needs_attention"),
|
|
213
|
+
class: "text-xs font-semibold text-secondary uppercase"
|
|
214
|
+
}, null, 8, ["text"]), n.needsAttentionTotal === null ? k("", !0) : (L(), O(V(U), {
|
|
215
|
+
key: 0,
|
|
216
|
+
label: V(i).t("wise_invoicing.invoice_approval.overview.metrics.invoice_count", { count: n.needsAttentionTotal }),
|
|
217
|
+
color: "warning",
|
|
218
|
+
size: "sm",
|
|
219
|
+
variant: "translucent"
|
|
220
|
+
}, null, 8, ["label"]))]),
|
|
221
|
+
_: 1
|
|
222
|
+
}), M(V(G), {
|
|
223
|
+
gap: "md",
|
|
224
|
+
class: "mt-xl"
|
|
225
|
+
}, {
|
|
226
|
+
default: H(() => [(L(!0), A(E, null, z(l.value, (e) => (L(), O(V(ye), { key: e.key }, {
|
|
227
|
+
default: H(() => [j("button", {
|
|
228
|
+
class: "flex w-full items-center gap-lg rounded-lg border border-secondary p-lg text-left hover:bg-secondary",
|
|
229
|
+
type: "button",
|
|
230
|
+
onClick: (t) => u(e.key)
|
|
231
|
+
}, [
|
|
232
|
+
j("span", { class: F([e.iconClass, "flex size-8 shrink-0 items-center justify-center rounded-full"]) }, [(L(), O(B(e.icon), { class: "size-(--spacing-xl)" }))], 2),
|
|
233
|
+
M(V(G), {
|
|
234
|
+
gap: "none",
|
|
235
|
+
class: "min-w-0 flex-1"
|
|
236
|
+
}, {
|
|
237
|
+
default: H(() => [M(V(J), {
|
|
238
|
+
text: e.label,
|
|
239
|
+
class: "text-sm font-medium text-primary"
|
|
240
|
+
}, null, 8, ["text"]), M(V(J), {
|
|
241
|
+
text: e.description,
|
|
242
|
+
class: "text-xs text-secondary"
|
|
243
|
+
}, null, 8, ["text"])]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, 1024),
|
|
246
|
+
M(V(J), {
|
|
247
|
+
text: String(e.count ?? "—"),
|
|
248
|
+
class: F([e.countClass, "shrink-0 font-mono text-xl font-semibold tabular-nums"])
|
|
249
|
+
}, null, 8, ["text", "class"]),
|
|
250
|
+
M(V(c), { class: "size-(--spacing-xl) shrink-0 text-tertiary" })
|
|
251
|
+
], 8, Re)]),
|
|
252
|
+
_: 2
|
|
253
|
+
}, 1024))), 128))]),
|
|
254
|
+
_: 1
|
|
255
|
+
})]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 8, ["aria-label"])]));
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/modules/invoice-approval/api/queries/invoiceApprovalIndex.query.ts
|
|
262
|
+
function Be(e) {
|
|
263
|
+
let t = D(() => ({ filters: e.params.filters?.value }));
|
|
264
|
+
return ge("invoiceApprovalIndex", {
|
|
265
|
+
params: { queryParams: t },
|
|
266
|
+
queryFn: (e) => pe.getAll({
|
|
267
|
+
...t.value,
|
|
268
|
+
pagination: e
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverview.composable.ts
|
|
274
|
+
var Q = {
|
|
275
|
+
all: {},
|
|
276
|
+
awaiting: { approvalStatus: v.AWAITING_APPROVAL },
|
|
277
|
+
"out-of-sync": { hasChangesSinceApprovalSent: !0 },
|
|
278
|
+
rejected: { approvalStatus: v.REJECTED },
|
|
279
|
+
"reminder-1": { approvalStatus: v.R1 },
|
|
280
|
+
"reminder-2": { approvalStatus: v.R2 }
|
|
281
|
+
};
|
|
282
|
+
function Ve(e) {
|
|
283
|
+
function t(t) {
|
|
284
|
+
return {
|
|
285
|
+
...t,
|
|
286
|
+
customerUuid: e.customerUuid.value ?? null
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
let { isFetchingNextPage: n, isLoading: r, fetchNextPage: i, refetch: a, result: o } = Be({ params: { filters: D(() => t(Q[e.activeTab.value])) } }), s = D(() => o.value.isOk() ? o.value.getValue().data : []), c = D(() => o.value.isErr() ? o.value.getError() : null);
|
|
290
|
+
function l(e) {
|
|
291
|
+
return Be({ params: { filters: D(() => t(e)) } });
|
|
292
|
+
}
|
|
293
|
+
let u = {
|
|
294
|
+
all: l(Q.all),
|
|
295
|
+
awaiting: l(Q.awaiting),
|
|
296
|
+
outOfSync: l(Q["out-of-sync"]),
|
|
297
|
+
rejected: l(Q.rejected),
|
|
298
|
+
reminderOne: l(Q["reminder-1"]),
|
|
299
|
+
reminderTwo: l(Q["reminder-2"])
|
|
300
|
+
};
|
|
301
|
+
function d(e) {
|
|
302
|
+
return e.result.value.isOk() ? e.result.value.getValue().meta.total : null;
|
|
303
|
+
}
|
|
304
|
+
let f = D(() => ({
|
|
305
|
+
all: d(u.all),
|
|
306
|
+
awaiting: d(u.awaiting),
|
|
307
|
+
outOfSync: d(u.outOfSync),
|
|
308
|
+
rejected: d(u.rejected),
|
|
309
|
+
reminderOne: d(u.reminderOne),
|
|
310
|
+
reminderTwo: d(u.reminderTwo)
|
|
311
|
+
})), p = D(() => Object.values(u).some((e) => e.result.value.isErr())), ee = D(() => {
|
|
312
|
+
let { reminderOne: e, reminderTwo: t } = f.value;
|
|
313
|
+
return e === null || t === null ? null : e + t;
|
|
314
|
+
});
|
|
315
|
+
return {
|
|
316
|
+
hasCountError: p,
|
|
317
|
+
isFetchingNextPage: n,
|
|
318
|
+
isLoading: r,
|
|
319
|
+
counts: f,
|
|
320
|
+
data: s,
|
|
321
|
+
error: c,
|
|
322
|
+
fetchNextPage: i,
|
|
323
|
+
needsAttentionTotal: D(() => {
|
|
324
|
+
let { outOfSync: e, rejected: t } = f.value;
|
|
325
|
+
return e === null || t === null ? null : e + t;
|
|
326
|
+
}),
|
|
327
|
+
refetch: a,
|
|
328
|
+
reminderCountTotal: ee,
|
|
329
|
+
tabCounts: D(() => ({
|
|
330
|
+
all: f.value.all,
|
|
331
|
+
awaiting: f.value.awaiting,
|
|
332
|
+
"out-of-sync": f.value.outOfSync,
|
|
333
|
+
rejected: f.value.rejected,
|
|
334
|
+
"reminder-1": f.value.reminderOne,
|
|
335
|
+
"reminder-2": f.value.reminderTwo
|
|
336
|
+
}))
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region src/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewFilters.composable.ts
|
|
341
|
+
function He() {
|
|
342
|
+
let e = T(), t = i({ debounceMs: 250 }), n = x({ params: { search: t.debouncedSearch } }), r = D(() => n.result.value.isOk() ? n.result.value.getValue().data : []), a = ae({
|
|
343
|
+
actionGroup: { name: "invoice-approvals" },
|
|
344
|
+
filters: [ie({
|
|
345
|
+
defaultValue: {
|
|
346
|
+
operator: _.INCLUDES,
|
|
347
|
+
value: []
|
|
348
|
+
},
|
|
349
|
+
disableOperators: !0,
|
|
350
|
+
displayFn: (e) => r.value.find((t) => t.uuid === e)?.name ?? e,
|
|
351
|
+
key: "customerUuids",
|
|
352
|
+
label: e.t("wise_invoicing.invoice_approval.overview.filters.customer"),
|
|
353
|
+
options: async (e) => a.values.value.customerUuids.value.length > 0 ? [] : (t.updateSearch(e), await P(), r.value.map((e) => e.uuid))
|
|
354
|
+
})]
|
|
355
|
+
});
|
|
356
|
+
return he(() => a.values.value.customerUuids, (e) => {
|
|
357
|
+
(e.operator !== _.INCLUDES || e.value.length > 1) && (a.values.value.customerUuids = {
|
|
358
|
+
operator: _.INCLUDES,
|
|
359
|
+
value: e.value.slice(-1)
|
|
360
|
+
});
|
|
361
|
+
}, {
|
|
362
|
+
deep: !0,
|
|
363
|
+
immediate: !0
|
|
364
|
+
}), {
|
|
365
|
+
customerUuid: D(() => a.values.value.customerUuids.value[0]),
|
|
366
|
+
filters: a
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/modules/invoice-approval/actions/invoiceApprovalMarkAsApproved.action.ts
|
|
371
|
+
function Ue() {
|
|
372
|
+
let e = T(), n = X().create(w);
|
|
373
|
+
return Z({
|
|
374
|
+
id: "invoice-approval-mark-as-approved",
|
|
375
|
+
isApplicable: (e) => e.hasTargetedModelsOfType("InvoiceApproval") ? e.targetedModelOfTypeOrThrow("InvoiceApproval").approval.status !== t.APPROVED : !1,
|
|
376
|
+
name: () => e.t("wise_invoicing.invoice.detail.actions.mark_as_approved"),
|
|
377
|
+
execute: async (e) => {
|
|
378
|
+
let t = e.targetedModelOfTypeOrThrow("InvoiceApproval");
|
|
379
|
+
await n.open({
|
|
380
|
+
approvalUuid: t.uuid,
|
|
381
|
+
invoiceUuid: t.invoiceUuid
|
|
382
|
+
});
|
|
383
|
+
},
|
|
384
|
+
icon: () => m
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/modules/invoice-approval/use-cases/overview/components/InvoiceApprovalOverviewActionsCell.vue
|
|
389
|
+
var We = /* @__PURE__ */ N({
|
|
390
|
+
__name: "InvoiceApprovalOverviewActionsCell",
|
|
391
|
+
props: { item: {} },
|
|
392
|
+
setup(e) {
|
|
393
|
+
let t = e, n = Ue(), r = D(() => [{
|
|
394
|
+
...t.item,
|
|
395
|
+
key: t.item.uuid,
|
|
396
|
+
modelName: "InvoiceApproval"
|
|
397
|
+
}]);
|
|
398
|
+
return (e, t) => (L(), O(V(q), null, {
|
|
399
|
+
default: H(() => [M(V(we), { class: "w-full" }, {
|
|
400
|
+
default: H(() => [M(V(K), {
|
|
401
|
+
align: "center",
|
|
402
|
+
justify: "end",
|
|
403
|
+
gap: "xs",
|
|
404
|
+
class: "w-full"
|
|
405
|
+
}, {
|
|
406
|
+
default: H(() => [M(V(ve), {
|
|
407
|
+
action: V(n),
|
|
408
|
+
models: r.value,
|
|
409
|
+
"is-current-context-only": !0
|
|
410
|
+
}, {
|
|
411
|
+
default: H(({ canExecute: e, icon: t, label: n }) => [e ? (L(), O(V(W), {
|
|
412
|
+
key: 0,
|
|
413
|
+
"icon-right": t,
|
|
414
|
+
label: n,
|
|
415
|
+
size: "sm",
|
|
416
|
+
variant: "secondary"
|
|
417
|
+
}, null, 8, ["icon-right", "label"])) : k("", !0)]),
|
|
418
|
+
_: 1
|
|
419
|
+
}, 8, ["action", "models"])]),
|
|
420
|
+
_: 1
|
|
421
|
+
})]),
|
|
422
|
+
_: 1
|
|
423
|
+
})]),
|
|
424
|
+
_: 1
|
|
425
|
+
}));
|
|
426
|
+
}
|
|
427
|
+
}), Ge = /* @__PURE__ */ N({
|
|
428
|
+
__name: "InvoiceApprovalOverviewAmountCell",
|
|
429
|
+
props: { item: {} },
|
|
430
|
+
setup(e) {
|
|
431
|
+
let t = e, n = r(), i = T(), a = D(() => n.formatMonetary(t.item.netAmount)), o = D(() => i.t("wise_invoicing.invoice_approval.overview.gross_total", { amount: n.formatMonetary(t.item.grossAmount) }));
|
|
432
|
+
return (e, t) => (L(), O(V(q), null, {
|
|
433
|
+
default: H(() => [M(V(G), {
|
|
434
|
+
gap: "none",
|
|
435
|
+
class: "w-full"
|
|
436
|
+
}, {
|
|
437
|
+
default: H(() => [M(V(J), {
|
|
438
|
+
text: a.value,
|
|
439
|
+
class: "w-full text-right text-sm font-medium text-secondary tabular-nums"
|
|
440
|
+
}, null, 8, ["text"]), M(V(J), {
|
|
441
|
+
text: o.value,
|
|
442
|
+
class: "w-full text-right text-xs text-tertiary tabular-nums"
|
|
443
|
+
}, null, 8, ["text"])]),
|
|
444
|
+
_: 1
|
|
445
|
+
})]),
|
|
446
|
+
_: 1
|
|
447
|
+
}));
|
|
448
|
+
}
|
|
449
|
+
}), Ke = /* @__PURE__ */ N({
|
|
450
|
+
__name: "InvoiceApprovalOverviewInvoiceCell",
|
|
451
|
+
props: { item: {} },
|
|
452
|
+
setup(e) {
|
|
453
|
+
let t = e, n = T();
|
|
454
|
+
return (e, r) => (L(), O(V(q), null, {
|
|
455
|
+
default: H(() => [M(V(G), {
|
|
456
|
+
gap: "none",
|
|
457
|
+
class: "min-w-0"
|
|
458
|
+
}, {
|
|
459
|
+
default: H(() => [M(V(J), {
|
|
460
|
+
text: t.item.invoiceSubject ?? V(n).t("wise_invoicing.invoice.detail.fallback_title"),
|
|
461
|
+
class: "text-sm font-medium text-primary"
|
|
462
|
+
}, null, 8, ["text"]), M(V(J), {
|
|
463
|
+
text: t.item.customerName ?? "-",
|
|
464
|
+
class: "text-xs text-secondary"
|
|
465
|
+
}, null, 8, ["text"])]),
|
|
466
|
+
_: 1
|
|
467
|
+
})]),
|
|
468
|
+
_: 1
|
|
469
|
+
}));
|
|
470
|
+
}
|
|
471
|
+
}), qe = { class: "flex min-w-0 flex-col items-start gap-xxs" }, Je = /* @__PURE__ */ N({
|
|
472
|
+
__name: "InvoiceApprovalOverviewNextReminderCell",
|
|
473
|
+
props: { item: {} },
|
|
474
|
+
setup(e) {
|
|
475
|
+
let t = e, n = T(), r = g(), i = D(() => t.item.hasChangesSinceApprovalSent), a = D(() => {
|
|
476
|
+
let e = t.item.nextReminderOn;
|
|
477
|
+
return e === null ? null : _e.Now.plainDateISO().until(e, { largestUnit: "days" }).days;
|
|
478
|
+
}), o = D(() => {
|
|
479
|
+
let e = a.value;
|
|
480
|
+
return e === null ? null : e <= 0 ? n.t("wise_invoicing.invoice_approval.overview.due_today") : n.t("wise_invoicing.invoice_approval.overview.due_in_days", { count: e });
|
|
481
|
+
}), c = D(() => {
|
|
482
|
+
let e = t.item.approval, i = e.reminderSentAt;
|
|
483
|
+
return i === null || e.level === null ? n.t("wise_invoicing.invoice_approval.overview.not_sent_yet") : n.t("wise_invoicing.invoice_approval.overview.last_reminder", {
|
|
484
|
+
level: n.t(y.getReminderLevelTranslationKey(e.level)),
|
|
485
|
+
time: r.toRelativeTime(i)
|
|
486
|
+
});
|
|
487
|
+
}), l = {
|
|
488
|
+
icon: s,
|
|
489
|
+
type: "icon"
|
|
490
|
+
};
|
|
491
|
+
return (e, t) => (L(), O(V(q), null, {
|
|
492
|
+
default: H(() => [j("div", qe, [i.value ? (L(), O(V(U), {
|
|
493
|
+
key: 0,
|
|
494
|
+
label: V(n).t("wise_invoicing.invoice_approval.overview.reminder_blocked"),
|
|
495
|
+
left: l,
|
|
496
|
+
color: "error",
|
|
497
|
+
size: "sm",
|
|
498
|
+
variant: "translucent"
|
|
499
|
+
}, null, 8, ["label"])) : o.value === null ? k("", !0) : (L(), O(V(U), {
|
|
500
|
+
key: 1,
|
|
501
|
+
color: (a.value ?? 0) <= 0 ? "warning" : "success",
|
|
502
|
+
label: o.value,
|
|
503
|
+
size: "sm",
|
|
504
|
+
variant: "translucent"
|
|
505
|
+
}, null, 8, ["color", "label"])), M(V(J), {
|
|
506
|
+
text: c.value,
|
|
507
|
+
class: "text-xs text-secondary"
|
|
508
|
+
}, null, 8, ["text"])])]),
|
|
509
|
+
_: 1
|
|
510
|
+
}));
|
|
511
|
+
}
|
|
512
|
+
}), Ye = {
|
|
513
|
+
class: "flex shrink-0 gap-xxs",
|
|
514
|
+
"aria-hidden": "true"
|
|
515
|
+
}, $ = 2, Xe = /* @__PURE__ */ N({
|
|
516
|
+
__name: "InvoiceApprovalReminderLevelIndicator",
|
|
517
|
+
props: { level: {} },
|
|
518
|
+
setup(t) {
|
|
519
|
+
let n = t, r = D(() => Math.min($, n.level)), i = D(() => n.level === e._2);
|
|
520
|
+
return (e, t) => (L(), A("span", Ye, [(L(), A(E, null, z($, (e) => j("span", {
|
|
521
|
+
key: e,
|
|
522
|
+
class: F([e <= r.value ? i.value ? "border-error bg-error-solid" : "\n border-warning-500 bg-warning-solid\n " : "border-secondary bg-primary", "h-(--spacing-sm) w-(--spacing-md) rounded-full border"])
|
|
523
|
+
}, null, 2)), 64))]));
|
|
524
|
+
}
|
|
525
|
+
}), Ze = /* @__PURE__ */ N({
|
|
526
|
+
__name: "InvoiceApprovalOverviewStatusCell",
|
|
527
|
+
props: { item: {} },
|
|
528
|
+
setup(e) {
|
|
529
|
+
let n = e, r = T(), i = D(() => n.item.approval.status === t.REQUESTED ? n.item.approval.level : null), a = D(() => i.value === 2 ? r.t("wise_invoicing.invoice.approval_status.r2") : r.t("wise_invoicing.invoice.approval_status.r1"));
|
|
530
|
+
return (e, t) => (L(), O(V(q), null, {
|
|
531
|
+
default: H(() => [M(V(K), {
|
|
532
|
+
align: "center",
|
|
533
|
+
gap: "xs"
|
|
534
|
+
}, {
|
|
535
|
+
default: H(() => [i.value === null ? (L(), O(b, {
|
|
536
|
+
key: 1,
|
|
537
|
+
approval: n.item.approval,
|
|
538
|
+
rejection: n.item.rejectionReason === null ? null : {
|
|
539
|
+
reason: n.item.rejectionReason,
|
|
540
|
+
remark: null
|
|
541
|
+
},
|
|
542
|
+
"requires-prior-approval": !0
|
|
543
|
+
}, null, 8, ["approval", "rejection"])) : (L(), O(V(K), {
|
|
544
|
+
key: 0,
|
|
545
|
+
align: "center",
|
|
546
|
+
gap: "sm",
|
|
547
|
+
class: "min-w-0 rounded-md border border-secondary py-xxs pr-sm pl-xs"
|
|
548
|
+
}, {
|
|
549
|
+
default: H(() => [M(Xe, { level: i.value }, null, 8, ["level"]), M(V(J), {
|
|
550
|
+
text: a.value,
|
|
551
|
+
class: "text-xs text-primary"
|
|
552
|
+
}, null, 8, ["text"])]),
|
|
553
|
+
_: 1
|
|
554
|
+
})), n.item.hasChangesSinceApprovalSent ? (L(), O(le, { key: 2 })) : k("", !0)]),
|
|
555
|
+
_: 1
|
|
556
|
+
})]),
|
|
557
|
+
_: 1
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/modules/invoice-approval/use-cases/overview/composables/invoiceApprovalOverviewTableColumns.composable.ts
|
|
563
|
+
function Qe() {
|
|
564
|
+
let e = T();
|
|
565
|
+
return D(() => Oe()([
|
|
566
|
+
{
|
|
567
|
+
headerLabel: e.t("wise_invoicing.invoice_approval.overview.columns.invoice"),
|
|
568
|
+
key: "invoice",
|
|
569
|
+
size: {
|
|
570
|
+
max: "24rem",
|
|
571
|
+
min: "14rem"
|
|
572
|
+
},
|
|
573
|
+
component: (e) => Y(Ke, { item: e })
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
headerLabel: e.t("wise_invoicing.invoice_approval.overview.columns.status"),
|
|
577
|
+
key: "status",
|
|
578
|
+
size: {
|
|
579
|
+
max: "14rem",
|
|
580
|
+
min: "10rem"
|
|
581
|
+
},
|
|
582
|
+
component: (e) => Y(Ze, { item: e })
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
headerLabel: e.t("wise_invoicing.invoice_approval.overview.columns.next_reminder"),
|
|
586
|
+
key: "nextReminder",
|
|
587
|
+
size: {
|
|
588
|
+
max: "14rem",
|
|
589
|
+
min: "10rem"
|
|
590
|
+
},
|
|
591
|
+
component: (e) => Y(Je, { item: e })
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
headerLabel: e.t("wise_invoicing.invoice_approval.overview.columns.amount"),
|
|
595
|
+
key: "amount",
|
|
596
|
+
size: {
|
|
597
|
+
max: "12rem",
|
|
598
|
+
min: "9rem"
|
|
599
|
+
},
|
|
600
|
+
component: (e) => Y(Ge, { item: e })
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
headerLabel: e.t("wise_invoicing.invoice_approval.overview.columns.actions"),
|
|
604
|
+
key: "actions",
|
|
605
|
+
size: {
|
|
606
|
+
max: "16rem",
|
|
607
|
+
min: "14rem"
|
|
608
|
+
},
|
|
609
|
+
component: (e) => Y(We, { item: e })
|
|
610
|
+
}
|
|
611
|
+
]));
|
|
612
|
+
}
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region src/modules/invoice-approval/use-cases/overview/views/InvoiceApprovalOverviewView.vue?vue&type=script&setup=true&lang.ts
|
|
615
|
+
var $e = 100, et = /* @__PURE__ */ N({
|
|
616
|
+
__name: "InvoiceApprovalOverviewView",
|
|
617
|
+
setup(e) {
|
|
618
|
+
let t = T(), r = X(), i = ke(), s = n(), c = Ae("tab", "all"), d = R(!0), m = R(!1), { customerUuid: h, filters: g } = He();
|
|
619
|
+
oe(g);
|
|
620
|
+
let { hasCountError: ie, isFetchingNextPage: ae, isLoading: _, counts: y, data: b, error: x, fetchNextPage: le, needsAttentionTotal: S, refetch: C, reminderCountTotal: de, tabCounts: fe } = Ve({
|
|
621
|
+
customerUuid: h,
|
|
622
|
+
activeTab: D(() => c.value)
|
|
623
|
+
}), w = D(() => g.activeFilters.value.length), pe = D(() => [
|
|
624
|
+
{
|
|
625
|
+
icon: p,
|
|
626
|
+
key: "all",
|
|
627
|
+
label: t.t("wise_invoicing.invoice_approval.overview.tabs.all")
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
icon: ne,
|
|
631
|
+
key: "awaiting",
|
|
632
|
+
label: t.t("wise_invoicing.invoice.approval_status.awaiting_approval")
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
icon: ee,
|
|
636
|
+
key: "reminder-1",
|
|
637
|
+
label: t.t("wise_invoicing.invoice.approval_status.r1")
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
icon: o,
|
|
641
|
+
key: "reminder-2",
|
|
642
|
+
label: t.t("wise_invoicing.invoice.approval_status.r2")
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
icon: l,
|
|
646
|
+
key: "rejected",
|
|
647
|
+
label: t.t("wise_invoicing.invoice.approval_status.rejected")
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
icon: f,
|
|
651
|
+
key: "out-of-sync",
|
|
652
|
+
label: t.t("wise_invoicing.invoice_approval.overview.tabs.out_of_sync")
|
|
653
|
+
}
|
|
654
|
+
]);
|
|
655
|
+
s.set(() => t.t("wise_invoicing.invoice_approval.title"));
|
|
656
|
+
let j = Ne(), N = Me(), P = Pe(), F = je(), I = D(() => [
|
|
657
|
+
j,
|
|
658
|
+
N,
|
|
659
|
+
P,
|
|
660
|
+
F
|
|
661
|
+
]), B = D(() => !_.value && x.value === null && b.value.length === 0 && w.value === 0), he = Qe();
|
|
662
|
+
function ge(e) {
|
|
663
|
+
let t = fe.value[e];
|
|
664
|
+
return t === null ? null : {
|
|
665
|
+
type: "count",
|
|
666
|
+
value: t
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
function _e(e) {
|
|
670
|
+
return {
|
|
671
|
+
name: "invoicing-invoice-detail",
|
|
672
|
+
params: { invoiceUuid: e.invoiceUuid }
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
async function ve() {
|
|
676
|
+
let e = [], t = 0;
|
|
677
|
+
do {
|
|
678
|
+
let n = await a.getAll({
|
|
679
|
+
filters: {
|
|
680
|
+
approvalStatus: v.AWAITING_APPROVAL,
|
|
681
|
+
customerUuids: h.value === void 0 ? null : [h.value]
|
|
682
|
+
},
|
|
683
|
+
pagination: {
|
|
684
|
+
limit: $e,
|
|
685
|
+
offset: e.length
|
|
686
|
+
},
|
|
687
|
+
sort: []
|
|
688
|
+
});
|
|
689
|
+
if (n.isErr()) return i.apiError(n.error), null;
|
|
690
|
+
if (n.value.data.length === 0) break;
|
|
691
|
+
e.push(...n.value.data), t = n.value.meta.total;
|
|
692
|
+
} while (e.length < t);
|
|
693
|
+
return e;
|
|
694
|
+
}
|
|
695
|
+
async function U() {
|
|
696
|
+
if (m.value) return;
|
|
697
|
+
m.value = !0;
|
|
698
|
+
let e = await ve();
|
|
699
|
+
m.value = !1, e !== null && r.create(ue, { props: {
|
|
700
|
+
invoices: e,
|
|
701
|
+
onSent: () => {
|
|
702
|
+
C();
|
|
703
|
+
}
|
|
704
|
+
} }).open();
|
|
705
|
+
}
|
|
706
|
+
return (e, n) => (L(), O(V(be), {
|
|
707
|
+
title: V(t).t("wise_invoicing.invoice_approval.title"),
|
|
708
|
+
"is-title-hidden": !0
|
|
709
|
+
}, {
|
|
710
|
+
default: H(() => [M(V(G), {
|
|
711
|
+
align: "stretch",
|
|
712
|
+
gap: "xl",
|
|
713
|
+
class: "min-h-0 flex-1 px-3xl py-xl"
|
|
714
|
+
}, {
|
|
715
|
+
default: H(() => [
|
|
716
|
+
M(V(K), {
|
|
717
|
+
align: "center",
|
|
718
|
+
justify: "between",
|
|
719
|
+
gap: "lg",
|
|
720
|
+
class: "shrink-0"
|
|
721
|
+
}, {
|
|
722
|
+
default: H(() => [M(V(G), { gap: "none" }, {
|
|
723
|
+
default: H(() => [M(V(J), {
|
|
724
|
+
text: V(t).t("wise_invoicing.invoice_approval.title"),
|
|
725
|
+
as: "h2",
|
|
726
|
+
class: "text-lg font-semibold text-primary"
|
|
727
|
+
}, null, 8, ["text"]), M(V(J), {
|
|
728
|
+
text: V(t).t("wise_invoicing.invoice_approval.overview.description"),
|
|
729
|
+
class: "mt-xs text-sm text-secondary"
|
|
730
|
+
}, null, 8, ["text"])]),
|
|
731
|
+
_: 1
|
|
732
|
+
}), M(V(W), {
|
|
733
|
+
"icon-left": d.value ? V(re) : V(u),
|
|
734
|
+
label: V(t).t(d.value ? "wise_invoicing.invoice_approval.overview.hide_metrics" : "wise_invoicing.invoice_approval.overview.show_metrics"),
|
|
735
|
+
variant: "secondary",
|
|
736
|
+
onClick: n[0] ||= (e) => d.value = !d.value
|
|
737
|
+
}, null, 8, ["icon-left", "label"])]),
|
|
738
|
+
_: 1
|
|
739
|
+
}),
|
|
740
|
+
d.value ? (L(), O(ze, {
|
|
741
|
+
key: 0,
|
|
742
|
+
"has-count-error": V(ie),
|
|
743
|
+
"needs-attention-total": V(S),
|
|
744
|
+
"out-of-sync-count": V(y).outOfSync,
|
|
745
|
+
"rejected-count": V(y).rejected,
|
|
746
|
+
"reminder-count-total": V(de),
|
|
747
|
+
"reminder-one-count": V(y).reminderOne,
|
|
748
|
+
"reminder-two-count": V(y).reminderTwo,
|
|
749
|
+
onShowOutOfSync: n[1] ||= (e) => c.value = "out-of-sync",
|
|
750
|
+
onShowRejected: n[2] ||= (e) => c.value = "rejected"
|
|
751
|
+
}, null, 8, [
|
|
752
|
+
"has-count-error",
|
|
753
|
+
"needs-attention-total",
|
|
754
|
+
"out-of-sync-count",
|
|
755
|
+
"rejected-count",
|
|
756
|
+
"reminder-count-total",
|
|
757
|
+
"reminder-one-count",
|
|
758
|
+
"reminder-two-count"
|
|
759
|
+
])) : k("", !0),
|
|
760
|
+
M(V(G), {
|
|
761
|
+
align: "stretch",
|
|
762
|
+
gap: "none",
|
|
763
|
+
class: "min-h-0 flex-1 overflow-hidden rounded-lg border border-secondary bg-primary shadow-sm"
|
|
764
|
+
}, {
|
|
765
|
+
default: H(() => [
|
|
766
|
+
M(V(K), {
|
|
767
|
+
align: "center",
|
|
768
|
+
justify: "between",
|
|
769
|
+
gap: "md",
|
|
770
|
+
class: "border-b border-secondary p-sm"
|
|
771
|
+
}, {
|
|
772
|
+
default: H(() => [M(V(Te), {
|
|
773
|
+
modelValue: V(c),
|
|
774
|
+
"onUpdate:modelValue": n[3] ||= (e) => me(c) ? c.value = e : null,
|
|
775
|
+
variant: "button-border"
|
|
776
|
+
}, {
|
|
777
|
+
default: H(() => [M(V(De), null, {
|
|
778
|
+
default: H(() => [(L(!0), A(E, null, z(pe.value, (e) => (L(), O(V(Ee), {
|
|
779
|
+
key: e.key,
|
|
780
|
+
config: {
|
|
781
|
+
indicator: ge(e.key),
|
|
782
|
+
left: {
|
|
783
|
+
icon: e.icon,
|
|
784
|
+
type: "icon"
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
label: e.label,
|
|
788
|
+
value: e.key
|
|
789
|
+
}, null, 8, [
|
|
790
|
+
"config",
|
|
791
|
+
"label",
|
|
792
|
+
"value"
|
|
793
|
+
]))), 128))]),
|
|
794
|
+
_: 1
|
|
795
|
+
})]),
|
|
796
|
+
_: 1
|
|
797
|
+
}, 8, ["modelValue"]), M(V(W), {
|
|
798
|
+
"icon-right": V(te),
|
|
799
|
+
"is-loading": m.value,
|
|
800
|
+
label: V(t).t("wise_invoicing.invoice_approval.overview.send_all"),
|
|
801
|
+
size: "sm",
|
|
802
|
+
onClick: U
|
|
803
|
+
}, null, 8, [
|
|
804
|
+
"icon-right",
|
|
805
|
+
"is-loading",
|
|
806
|
+
"label"
|
|
807
|
+
])]),
|
|
808
|
+
_: 1
|
|
809
|
+
}),
|
|
810
|
+
M(V(K), {
|
|
811
|
+
align: "center",
|
|
812
|
+
justify: "between",
|
|
813
|
+
gap: "md",
|
|
814
|
+
class: "border-b border-secondary p-sm"
|
|
815
|
+
}, {
|
|
816
|
+
default: H(() => [w.value === 0 ? (L(), O(V(J), {
|
|
817
|
+
key: 0,
|
|
818
|
+
text: V(t).t("wise_invoicing.common.no_active_filters"),
|
|
819
|
+
class: "px-sm text-xs text-secondary"
|
|
820
|
+
}, null, 8, ["text"])) : (L(), O(V(se), { key: 1 })), M(V(ce))]),
|
|
821
|
+
_: 1
|
|
822
|
+
}),
|
|
823
|
+
B.value ? (L(), O(V(xe), {
|
|
824
|
+
key: 0,
|
|
825
|
+
title: V(t).t("wise_invoicing.invoice_approval.overview.empty_state.title"),
|
|
826
|
+
description: V(t).t("wise_invoicing.invoice_approval.overview.empty_state.description"),
|
|
827
|
+
illustration: "documents",
|
|
828
|
+
class: "py-7xl"
|
|
829
|
+
}, null, 8, ["title", "description"])) : (L(), O(V(Ce), {
|
|
830
|
+
key: 1,
|
|
831
|
+
"active-filter-count": w.value,
|
|
832
|
+
actions: I.value,
|
|
833
|
+
columns: V(he),
|
|
834
|
+
data: V(b),
|
|
835
|
+
error: V(x),
|
|
836
|
+
"get-action-model": (e) => ({
|
|
837
|
+
...e,
|
|
838
|
+
key: e.uuid,
|
|
839
|
+
modelName: "InvoiceApproval"
|
|
840
|
+
}),
|
|
841
|
+
"get-key": (e) => e.uuid,
|
|
842
|
+
"get-link": _e,
|
|
843
|
+
"is-fetching-next-page": V(ae),
|
|
844
|
+
"is-loading": V(_),
|
|
845
|
+
onClearFilters: n[4] ||= (e) => V(g).clearAll(),
|
|
846
|
+
onNextPage: V(le)
|
|
847
|
+
}, null, 8, [
|
|
848
|
+
"active-filter-count",
|
|
849
|
+
"actions",
|
|
850
|
+
"columns",
|
|
851
|
+
"data",
|
|
852
|
+
"error",
|
|
853
|
+
"get-action-model",
|
|
854
|
+
"get-key",
|
|
855
|
+
"is-fetching-next-page",
|
|
856
|
+
"is-loading",
|
|
857
|
+
"onNextPage"
|
|
858
|
+
]))
|
|
859
|
+
]),
|
|
860
|
+
_: 1
|
|
861
|
+
})
|
|
862
|
+
]),
|
|
863
|
+
_: 1
|
|
864
|
+
})]),
|
|
865
|
+
_: 1
|
|
866
|
+
}, 8, ["title"]));
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
//#endregion
|
|
870
|
+
export { et as default };
|