@wisemen/wise-invoicing-web 0.5.0 → 0.7.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-CD0Seawd.js → ApprovalReminderSettingsViewDataProvider-Dsp3ee3c.js} +4 -4
- package/dist/{BillingDocumentDetailViewDataProvider-BgVYrLu8.js → BillingDocumentDetailViewDataProvider-TX-tovKU.js} +1708 -1576
- package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
- package/dist/{BillingDocumentPdf-LYvPMzYT.js → BillingDocumentPdf-c-7N80u4.js} +266 -205
- package/dist/{CreditNoteDetailViewDataProvider-CpSIbMM2.js → CreditNoteDetailViewDataProvider-BNT0h67Q.js} +196 -189
- package/dist/{CreditNotePdfViewDataProvider-Dtnu9gS3.js → CreditNotePdfViewDataProvider-qgOuhUf_.js} +2 -2
- package/dist/{CustomFieldValueText-DA0aPKwC.js → CustomFieldValueText-BP4bKQh7.js} +68 -38
- package/dist/{DunningCaseDetailViewDataProvider-DutSCkco.js → DunningCaseDetailViewDataProvider-BNByfQTc.js} +13 -13
- package/dist/{DunningCaseOverviewView-D8o4VMQD.js → DunningCaseOverviewView-Dvwaw597.js} +23 -23
- package/dist/{DunningCaseReminderPdfViewDataProvider-I_ZQiAuK.js → DunningCaseReminderPdfViewDataProvider-D1avIVyK.js} +1 -1
- package/dist/{DunningCaseSendDialog-DGg7bXeZ.js → DunningCaseSendDialog-DwB_jFum.js} +17 -17
- package/dist/{InvoiceApprovalOutOfSyncIndicator-AJOQe8j8.js → InvoiceApprovalOutOfSyncIndicator-B_9HLzpt.js} +2 -2
- package/dist/{InvoiceApprovalOverviewView-C4MI4IqD.js → InvoiceApprovalOverviewView-jawT-M1t.js} +213 -213
- package/dist/{InvoiceApprovalStatusBadge-BJ3Q18bf.js → InvoiceApprovalStatusBadge-D6Sr6JmN.js} +4 -4
- package/dist/{InvoiceApproveDialogDataProvider-CMZ0zDZo.js → InvoiceApproveDialogDataProvider-Bwb8bP1e.js} +16 -16
- package/dist/{InvoiceDetailViewDataProvider-k1yIeHYP.js → InvoiceDetailViewDataProvider-B8mMYTQf.js} +648 -642
- package/dist/{InvoiceOverviewViewDataProvider-BrgmweRE.js → InvoiceOverviewViewDataProvider-CLgV-Jcv.js} +501 -501
- package/dist/{InvoicePdfView-CB8gx8TE.js → InvoicePdfView-C518PlHp.js} +2 -2
- package/dist/{InvoicePdfViewDataProvider-Cs4Gqa0h.js → InvoicePdfViewDataProvider-ClfBkHUZ.js} +3 -3
- package/dist/{InvoicePublicPdfViewDataProvider-BaSvVJ8W.js → InvoicePublicPdfViewDataProvider-CoXBj3Je.js} +3 -3
- package/dist/{InvoicePublicProFormaPdfViewDataProvider-S3N9E91M.js → InvoicePublicProFormaPdfViewDataProvider-WlVD7sw1.js} +3 -3
- package/dist/{InvoicingFileUploadProvider-BLBjPKqx.js → InvoicingFileUploadProvider-Dl1LvCPm.js} +2 -2
- package/dist/{IssuerSettingsViewDataProvider-BStn0jFI.js → IssuerSettingsViewDataProvider-CXyyCvoZ.js} +51 -46
- package/dist/PeppolSettingsViewDataProvider-Cptga29B.js +276 -0
- package/dist/{ReminderSettingsViewDataProvider-BotrOSmS.js → ReminderSettingsViewDataProvider-BZgzQIxM.js} +63 -63
- package/dist/{api.util-D6m6OY3_.js → api.util-CR2xLnNj.js} +785 -670
- package/dist/{billingDocumentDetail.transformer-Da-Nt4bI.js → billingDocumentDetail.transformer-D1f6Nv-U.js} +9 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/sdk.gen.d.ts +4 -1
- package/dist/client/types.gen.d.ts +240 -56
- package/dist/client/zod.gen.d.ts +4206 -1343
- package/dist/composables/invoicingConfig.composable.d.ts +12 -0
- package/dist/{creditNoteDetail.query-Yb8TdZNm.js → creditNoteDetail.query-DGeG9_sO.js} +15 -15
- package/dist/{dist-DCbLgB6Y.js → dist-BMzyJZTx.js} +258 -114
- package/dist/{dist-BpDuRYDT.js → dist-DALBiuub.js} +134 -134
- package/dist/{documentTitle.composable-CRJjS6p-.js → documentTitle.composable-RvqrZTBa.js} +28 -26
- package/dist/{download.util-B5Q7KUC9.js → download.util-LyRpGWKA.js} +9 -0
- package/dist/{i18n.lib-DBxdqkbJ.js → i18n.lib-MOiHLIGc.js} +58 -2
- package/dist/index.d.ts +59 -2
- package/dist/index.js +232 -212
- package/dist/{invoice.service-DWDl9XRh.js → invoice.service-Fv4F4aZq.js} +39 -38
- package/dist/{invoiceApproval.service-Fwlxgd9o.js → invoiceApproval.service-DJvXagC7.js} +7 -7
- package/dist/{invoiceApprovalStatus.util-q-zHLdFV.js → invoiceApprovalStatus.util-B98WeAf0.js} +2 -2
- package/dist/{invoiceCustomer.service-DOexR54S.js → invoiceCustomer.service-CDyrtcwH.js} +6 -6
- package/dist/{invoiceDetail.query-B5w0Vlsy.js → invoiceDetail.query-UHE0NCLh.js} +1 -1
- package/dist/{invoiceIndexCache.util-CUlp4R7R.js → invoiceIndexCache.util-CLM7FO6z.js} +3 -3
- package/dist/{invoicingConfig.composable-CaWQMTP1.js → invoicingConfig.composable-UC7tGtBj.js} +14 -10
- package/dist/{issuerSettings.query-BHuLjV9P.js → issuerSettings.query-CoiXblSm.js} +2 -2
- package/dist/libs/i18n.lib.d.ts +56 -0
- package/dist/locales/en-US.json.d.ts +29 -1
- package/dist/locales/nl-BE.json.d.ts +29 -1
- package/dist/models/billing-document/billingDocumentAdvancePayment.util.d.ts +9 -0
- package/dist/models/billing-document/billingDocumentAdvancePayment.util.spec.d.ts +1 -0
- package/dist/models/billing-document/billingDocumentDetail.model.d.ts +1 -0
- package/dist/modules/custom-field/components/CustomFieldList.vue.d.ts +0 -1
- package/dist/modules/custom-field/components/customFieldList.spec.d.ts +1 -0
- package/dist/modules/custom-field/components/customFieldTypeIcon.d.ts +16 -0
- package/dist/modules/custom-field/components/customFieldValueText.spec.d.ts +1 -0
- package/dist/modules/custom-field/composables/customFieldReferenceLinks.composable.d.ts +16 -0
- package/dist/modules/custom-field/composables/customFieldReferenceLinks.composable.spec.d.ts +1 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldDefinition.model.d.ts +6 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldDefinition.transformer.spec.d.ts +1 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldDefinition.util.d.ts +6 -0
- package/dist/modules/custom-field/models/custom-field-definition/customFieldViewKey.model.d.ts +9 -0
- package/dist/modules/custom-field/models/custom-field-value/customFieldValue.model.d.ts +1 -1
- package/dist/modules/custom-field/models/custom-field-value/customFieldValue.util.d.ts +10 -0
- package/dist/modules/custom-field/test/builders/customFieldDefinition.builder.d.ts +3 -1
- package/dist/modules/invoice/models/invoice/pdf/invoicePdfDetail.model.d.ts +1 -0
- package/dist/modules/invoice/use-cases/detail/composables/invoiceDetailPaymentsTableColumns.composable.d.ts +1 -1
- package/dist/modules/invoice-delivery/api/mutations/peppolConnectionUpdate.mutation.d.ts +6 -0
- package/dist/modules/invoice-delivery/api/queries/peppolConnection.query.d.ts +1 -0
- package/dist/modules/invoice-delivery/api/query-keys/invoiceDelivery.queryKeys.d.ts +6 -0
- package/dist/modules/invoice-delivery/api/services/peppolConnection.service.d.ts +8 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormApiKeyField.vue.d.ts +8 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormCompanyField.vue.d.ts +11 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormEnabledField.vue.d.ts +7 -0
- package/dist/modules/invoice-delivery/components/form/PeppolConnectionFormProviderField.vue.d.ts +9 -0
- package/dist/modules/invoice-delivery/index.d.ts +1 -0
- package/dist/modules/invoice-delivery/models/deliveryReason.util.d.ts +6 -0
- package/dist/modules/invoice-delivery/models/peppolConnection.model.d.ts +18 -0
- package/dist/modules/invoice-delivery/models/peppolConnection.transformer.d.ts +9 -0
- package/dist/modules/invoice-delivery/models/peppolConnectionForm.model.d.ts +9 -0
- package/dist/modules/invoice-delivery/use-cases/settings/views/PeppolSettingsView.vue.d.ts +7 -0
- package/dist/modules/invoice-delivery/use-cases/settings/views/PeppolSettingsViewDataProvider.vue.d.ts +3 -0
- package/dist/modules/settings/routes/settings.routes.d.ts +7 -0
- package/dist/{reminderConfig.query-C4J6m4ER.js → reminderConfig.query-aRFzY6uZ.js} +22 -22
- package/dist/style.css +1 -1
- package/dist/types/queryKey.type.d.ts +2 -1
- package/dist/ui/billing-document/table/billingDocumentLineItemsTable.context.d.ts +114 -0
- package/dist/ui/billing-document/table/composables/useBillingDocumentLineItemsEditor.composable.d.ts +57 -36
- package/dist/ui/customer-invoice-list/composables/customerInvoiceTableColumns.composable.d.ts +6 -1
- package/dist/ui/customer-invoice-list/composables/customerInvoiceTableColumns.composable.spec.d.ts +1 -0
- package/package.json +1 -1
package/dist/{InvoiceDetailViewDataProvider-k1yIeHYP.js → InvoiceDetailViewDataProvider-B8mMYTQf.js}
RENAMED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { t as e } from "./i18n.lib-
|
|
2
|
-
import { t,
|
|
3
|
-
import { C as r, _ as i, a, b as o, c as s, f as c, l, r as u, v as d, y as f } from "./documentTitle.composable-
|
|
1
|
+
import { t as e } from "./i18n.lib-MOiHLIGc.js";
|
|
2
|
+
import { pt as t, t as n } from "./api.util-CR2xLnNj.js";
|
|
3
|
+
import { C as r, _ as i, a, b as o, c as s, f as c, l, r as u, v as d, y as f } from "./documentTitle.composable-RvqrZTBa.js";
|
|
4
4
|
import { r as p, t as m } from "./useCurrencyFormat.composable-MtZaqKnO.js";
|
|
5
|
-
import { n as h } from "./invoicingConfig.composable-
|
|
5
|
+
import { n as h } from "./invoicingConfig.composable-UC7tGtBj.js";
|
|
6
6
|
import { t as g } from "./search.composable-CU9OpyUB.js";
|
|
7
|
-
import { a as _, i as ee, n as v, o as te, t as y } from "./invoice.service-
|
|
7
|
+
import { a as _, i as ee, n as v, o as te, t as y } from "./invoice.service-Fv4F4aZq.js";
|
|
8
8
|
import { n as ne } from "./address.transformer-jGddczLV.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { a as
|
|
17
|
-
import { n as
|
|
18
|
-
import { t as
|
|
19
|
-
import { C as
|
|
20
|
-
import { r as
|
|
21
|
-
import { i as
|
|
22
|
-
import { t as
|
|
23
|
-
import
|
|
24
|
-
import { useI18n as
|
|
25
|
-
import { Fragment as
|
|
26
|
-
import { ApiErrorUtil as
|
|
27
|
-
import { RouterLink as
|
|
28
|
-
import { Temporal as
|
|
29
|
-
import { UIAutocomplete as
|
|
9
|
+
import { a as re, i as ie, n as b, r as ae, t as oe } from "./CustomFieldValueText-BP4bKQh7.js";
|
|
10
|
+
import { n as se, t as ce } from "./download.util-LyRpGWKA.js";
|
|
11
|
+
import { $ as le, A as ue, G as de, I as fe, L as pe, S as me, T as he, Tt as x, U as ge, V as _e, X as ve, Y as ye, _ as be, b as xe, i as Se, nt as Ce, ot as S, pt as C, q as we, t as Te, u as Ee, ut as De, xt as Oe, yt as w } from "./dist-BMzyJZTx.js";
|
|
12
|
+
import { n as T, t as E } from "./dist-Cdbpkd3Y.js";
|
|
13
|
+
import { t as D } from "./formango.util-D5c2ql--.js";
|
|
14
|
+
import { t as ke } from "./invoiceApprovalStatus.util-B98WeAf0.js";
|
|
15
|
+
import { t as Ae } from "./invoiceCustomer.service-CDyrtcwH.js";
|
|
16
|
+
import { a as je, i as Me, n as Ne, r as Pe, t as Fe } from "./invoiceIndexCache.util-CLM7FO6z.js";
|
|
17
|
+
import { n as Ie, t as Le } from "./InvoiceApprovalStatusBadge-D6Sr6JmN.js";
|
|
18
|
+
import { t as Re } from "./issuerSettings.query-CoiXblSm.js";
|
|
19
|
+
import { C as ze, S as Be, _ as Ve, a as He, b as Ue, c as We, d as Ge, f as Ke, g as qe, h as Je, i as Ye, l as Xe, m as Ze, n as Qe, o as $e, p as et, r as tt, s as nt, t as rt, u as it, v as at, x as ot, y as st } from "./BillingDocumentDetailViewDataProvider-TX-tovKU.js";
|
|
20
|
+
import { r as ct } from "./InvoicingFileUploadProvider-Dl1LvCPm.js";
|
|
21
|
+
import { i as lt, n as ut, r as dt, t as ft } from "./InvoiceApproveDialogDataProvider-Bwb8bP1e.js";
|
|
22
|
+
import { t as pt } from "./invoiceDetail.query-UHE0NCLh.js";
|
|
23
|
+
import mt, { z as O } from "zod";
|
|
24
|
+
import { useI18n as k } from "vue-i18n";
|
|
25
|
+
import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createSlots as ht, createTextVNode as gt, createVNode as I, defineComponent as L, mergeModels as _t, mergeProps as R, normalizeClass as vt, openBlock as z, ref as yt, renderList as bt, resolveDynamicComponent as xt, toDisplayString as B, unref as V, useModel as St, watch as Ct, withCtx as H } from "vue";
|
|
26
|
+
import { ApiErrorUtil as wt, useKeysetInfiniteQuery as Tt, useMutation as U, useOffsetInfiniteQuery as Et, useQuery as Dt } from "@wisemen/vue-core-api-utils";
|
|
27
|
+
import { RouterLink as Ot, useRouter as kt } from "vue-router";
|
|
28
|
+
import { Temporal as At } from "temporal-polyfill";
|
|
29
|
+
import { UIAutocomplete as jt, UIBadge as Mt, UIBadgeLabel as Nt, UIBadgeSeparator as Pt, UIButton as Ft, UICheckbox as It, UIClickableElement as Lt, UIColumnLayout as Rt, UIDateField as zt, UIDetailList as Bt, UIDetailListGroup as Vt, UIDetailListGroupItem as W, UIDetailListGroupItemLabel as G, UIDetailListGroupItemValueText as K, UIDetailListGroupSeparator as Ht, UIDialog as Ut, UIDialogBody as Wt, UIDialogFooter as q, UIDialogFooterCancel as J, UIDialogFooterSubmit as Gt, UIDialogHeader as Y, UIForm as Kt, UIFormDialog as X, UIFormFieldGrid as qt, UIFormFieldGroup as Jt, UIFormSubmitButton as Yt, UIIconButton as Xt, UINumberField as Zt, UIRowLayout as Qt, UISelect as $t, UITable as en, UITableCell as tn, UITableCellInteractiveElement as nn, UIText as Z, UITextField as rn, UITooltip as an, UITooltipContent as on, createAutocompleteOptions as sn, createComponent as cn, createSelectOptions as ln, defineTableColumns as un, useOverlay as dn, useToast as Q } from "@wisemen/vue-core-design-system";
|
|
30
30
|
import { useForm as $ } from "formango";
|
|
31
31
|
//#region src/modules/invoice/use-cases/detail/components/InvoiceApprovalBanner.vue?vue&type=script&setup=true&lang.ts
|
|
32
|
-
var
|
|
32
|
+
var fn = { class: "flex min-w-0 flex-1 flex-col gap-lg" }, pn = { class: "flex flex-col gap-xs pr-4xl" }, mn = {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "text-xs text-tertiary"
|
|
35
|
-
},
|
|
35
|
+
}, hn = {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "flex flex-wrap items-center gap-lg"
|
|
38
|
-
},
|
|
38
|
+
}, gn = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "absolute top-(--spacing-sm) right-(--spacing-sm) flex items-center gap-xxs rounded-full bg-error-solid px-sm py-xxs"
|
|
41
|
-
},
|
|
41
|
+
}, _n = /* @__PURE__ */ L({
|
|
42
42
|
__name: "InvoiceApprovalBanner",
|
|
43
43
|
props: {
|
|
44
44
|
isOutOfSync: { type: Boolean },
|
|
@@ -52,97 +52,97 @@ var un = { class: "flex min-w-0 flex-1 flex-col gap-lg" }, dn = { class: "flex f
|
|
|
52
52
|
"viewProForma"
|
|
53
53
|
],
|
|
54
54
|
setup(e, { emit: t }) {
|
|
55
|
-
let n = e, r = t, a =
|
|
55
|
+
let n = e, r = t, a = k(), o = T(), s = j(() => n.approval?.sentAt ?? null), c = j(() => s.value !== null), l = j(() => n.approval?.status === i.REJECTED), u = j(() => s.value === null ? "" : o.toDate(s.value)), d = j(() => l.value ? "error" : n.isOutOfSync ? "warning" : "info"), f = j(() => n.isOutOfSync ? a.t("wise_invoicing.invoice.approval_banner.out_of_sync", { date: u.value }) : a.t("wise_invoicing.invoice.approval_banner.sent", { date: u.value })), p = j(() => {
|
|
56
56
|
if (n.isOutOfSync) return a.t("wise_invoicing.invoice.approval_banner.out_of_sync_supporting");
|
|
57
57
|
if (n.rejection === null || n.approval?.status === i.APPROVED) return null;
|
|
58
|
-
let e = a.t(
|
|
58
|
+
let e = a.t(ke.getRejectionReasonTranslationKey(n.rejection.reason));
|
|
59
59
|
return a.t(l.value ? "wise_invoicing.invoice.approval_banner.rejected_reason" : "wise_invoicing.invoice.approval_banner.previously_rejected_reason", { reason: n.rejection.remark === null ? e : `${e} — ${n.rejection.remark}` });
|
|
60
|
-
}), m =
|
|
60
|
+
}), m = j(() => l.value || n.approval?.status !== i.REQUESTED ? null : n.approval.level), h = j(() => {
|
|
61
61
|
let e = m.value;
|
|
62
|
-
return e === null ? "" : a.t(
|
|
63
|
-
}), g =
|
|
62
|
+
return e === null ? "" : a.t(ke.getReminderLevelTranslationKey(e));
|
|
63
|
+
}), g = j(() => {
|
|
64
64
|
let e = n.approval?.reminderSentAt ?? null;
|
|
65
65
|
return m.value === null || e === null ? null : a.t("wise_invoicing.invoice.approval_banner.last_reminder_sent", { time: o.toRelativeTime(e) });
|
|
66
|
-
}), _ =
|
|
66
|
+
}), _ = j(() => ({
|
|
67
67
|
error: "border-error-subtle bg-error-primary",
|
|
68
68
|
info: "border-primary bg-primary-alt",
|
|
69
69
|
warning: "border-warning-300 bg-warning-primary"
|
|
70
|
-
})[d.value]), ee =
|
|
70
|
+
})[d.value]), ee = j(() => ({
|
|
71
71
|
error: "rounded-full bg-error-secondary",
|
|
72
72
|
info: "rounded-lg border border-primary bg-primary shadow-xs",
|
|
73
73
|
warning: "rounded-full bg-warning-secondary"
|
|
74
|
-
})[d.value]), v =
|
|
74
|
+
})[d.value]), v = j(() => ({
|
|
75
75
|
error: "text-error-primary",
|
|
76
76
|
info: "text-tertiary",
|
|
77
77
|
warning: "text-warning-primary"
|
|
78
|
-
})[d.value]), te =
|
|
78
|
+
})[d.value]), te = j(() => d.value === "info" ? x : Ce), y = j(() => ({
|
|
79
79
|
error: "text-error-primary",
|
|
80
80
|
info: "text-brand-secondary",
|
|
81
81
|
warning: "text-tertiary"
|
|
82
82
|
})[d.value]);
|
|
83
|
-
return (e, t) => c.value ? (
|
|
83
|
+
return (e, t) => c.value ? (z(), P("div", {
|
|
84
84
|
key: 0,
|
|
85
|
-
class:
|
|
85
|
+
class: vt([_.value, "relative flex items-start gap-xl rounded-xl border p-xl shadow-xs"])
|
|
86
86
|
}, [
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
F("span", { class: vt([ee.value, "flex size-(--spacing-4xl) shrink-0 items-center justify-center"]) }, [(z(), M(xt(te.value), { class: vt([v.value, "size-(--spacing-xl)"]) }, null, 8, ["class"]))], 2),
|
|
88
|
+
F("div", fn, [F("div", pn, [I(V(Z), {
|
|
89
89
|
text: f.value,
|
|
90
90
|
class: "text-xs font-semibold text-secondary"
|
|
91
|
-
}, null, 8, ["text"]), p.value === null ?
|
|
92
|
-
default:
|
|
93
|
-
class:
|
|
91
|
+
}, null, 8, ["text"]), p.value === null ? N("", !0) : (z(), P("p", mn, [gt(B(p.value) + " ", 1), n.proFormaFile !== null && n.isOutOfSync ? (z(), M(V(Lt), { key: 0 }, {
|
|
92
|
+
default: H(() => [F("button", {
|
|
93
|
+
class: vt([y.value, "underline-offset-2 hover:underline"]),
|
|
94
94
|
type: "button",
|
|
95
95
|
onClick: t[0] ||= (e) => r("viewProForma")
|
|
96
|
-
},
|
|
96
|
+
}, B(V(a).t("wise_invoicing.invoice.approval_banner.view_pro_forma")), 3)]),
|
|
97
97
|
_: 1
|
|
98
|
-
})) :
|
|
99
|
-
default:
|
|
98
|
+
})) : N("", !0)]))]), n.isOutOfSync || n.proFormaFile !== null ? (z(), P("div", hn, [n.isOutOfSync ? (z(), P(A, { key: 0 }, [I(V(Lt), null, {
|
|
99
|
+
default: H(() => [F("button", {
|
|
100
100
|
class: "text-xs font-semibold text-tertiary underline-offset-2 hover:underline",
|
|
101
101
|
type: "button",
|
|
102
102
|
onClick: t[1] ||= (e) => r("revertChanges")
|
|
103
|
-
},
|
|
103
|
+
}, B(V(a).t("wise_invoicing.invoice.approval_banner.revert_changes")), 1)]),
|
|
104
104
|
_: 1
|
|
105
|
-
}),
|
|
106
|
-
default:
|
|
105
|
+
}), I(V(Lt), null, {
|
|
106
|
+
default: H(() => [F("button", {
|
|
107
107
|
class: "text-xs font-semibold text-warning-primary underline-offset-2 hover:underline",
|
|
108
108
|
type: "button",
|
|
109
109
|
onClick: t[2] ||= (e) => r("sendNewRequest")
|
|
110
|
-
},
|
|
110
|
+
}, B(V(a).t("wise_invoicing.invoice.approval_banner.send_new_request")), 1)]),
|
|
111
111
|
_: 1
|
|
112
|
-
})], 64)) : (
|
|
113
|
-
default:
|
|
114
|
-
class:
|
|
112
|
+
})], 64)) : (z(), P(A, { key: 1 }, [n.proFormaFile === null ? N("", !0) : (z(), M(V(Lt), { key: 0 }, {
|
|
113
|
+
default: H(() => [F("button", {
|
|
114
|
+
class: vt([y.value, "text-xs font-semibold underline-offset-2 hover:underline"]),
|
|
115
115
|
type: "button",
|
|
116
116
|
onClick: t[3] ||= (e) => r("viewProForma")
|
|
117
|
-
},
|
|
117
|
+
}, B(V(a).t("wise_invoicing.invoice.approval_banner.view_pro_forma")), 3)]),
|
|
118
118
|
_: 1
|
|
119
|
-
}))], 64))])) :
|
|
120
|
-
l.value ? (
|
|
121
|
-
text:
|
|
119
|
+
}))], 64))])) : N("", !0)]),
|
|
120
|
+
l.value ? (z(), P("span", gn, [I(V(le), { class: "size-(--spacing-lg) shrink-0 text-white" }), I(V(Z), {
|
|
121
|
+
text: V(a).t("wise_invoicing.invoice.approval_status.rejected"),
|
|
122
122
|
class: "text-xs text-white"
|
|
123
|
-
}, null, 8, ["text"])])) : m.value !== null && g.value !== null ? (
|
|
123
|
+
}, null, 8, ["text"])])) : m.value !== null && g.value !== null ? (z(), M(V(an), {
|
|
124
124
|
key: 1,
|
|
125
125
|
"popover-side-offset": 8,
|
|
126
126
|
class: "absolute top-(--spacing-sm) right-(--spacing-sm)",
|
|
127
127
|
"popover-align": "center",
|
|
128
128
|
"popover-side": "bottom"
|
|
129
129
|
}, {
|
|
130
|
-
trigger:
|
|
130
|
+
trigger: H(() => [I(Ie, {
|
|
131
131
|
icon: void 0,
|
|
132
132
|
label: h.value,
|
|
133
133
|
level: m.value,
|
|
134
134
|
size: "sm",
|
|
135
135
|
tone: "warning"
|
|
136
136
|
}, null, 8, ["label", "level"])]),
|
|
137
|
-
content:
|
|
138
|
-
default:
|
|
137
|
+
content: H(() => [I(V(on), null, {
|
|
138
|
+
default: H(() => [I(V(Z), {
|
|
139
139
|
text: g.value,
|
|
140
140
|
class: "text-sm text-primary"
|
|
141
141
|
}, null, 8, ["text"])]),
|
|
142
142
|
_: 1
|
|
143
143
|
})]),
|
|
144
144
|
_: 1
|
|
145
|
-
})) : m.value === null ?
|
|
145
|
+
})) : m.value === null ? N("", !0) : (z(), M(Ie, {
|
|
146
146
|
key: 2,
|
|
147
147
|
icon: void 0,
|
|
148
148
|
label: h.value,
|
|
@@ -151,13 +151,13 @@ var un = { class: "flex min-w-0 flex-1 flex-col gap-lg" }, dn = { class: "flex f
|
|
|
151
151
|
size: "sm",
|
|
152
152
|
tone: "warning"
|
|
153
153
|
}, null, 8, ["label", "level"]))
|
|
154
|
-
], 2)) :
|
|
154
|
+
], 2)) : N("", !0);
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/modules/invoice/api/mutations/invoiceUpdate.mutation.ts
|
|
159
|
-
function
|
|
160
|
-
return
|
|
159
|
+
function vn() {
|
|
160
|
+
return U({
|
|
161
161
|
queryFn: (e) => y.update(e.params.invoiceUuid, e.body),
|
|
162
162
|
queryKeysToInvalidate: {
|
|
163
163
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -167,15 +167,15 @@ function gn() {
|
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/modules/invoice/components/InvoiceDeliveryStatusBadge.vue
|
|
170
|
-
var
|
|
170
|
+
var yn = /* @__PURE__ */ L({
|
|
171
171
|
__name: "InvoiceDeliveryStatusBadge",
|
|
172
172
|
props: {
|
|
173
173
|
deliveryStatus: {},
|
|
174
174
|
size: { default: "sm" }
|
|
175
175
|
},
|
|
176
176
|
setup(e) {
|
|
177
|
-
let t = e, n =
|
|
178
|
-
return (e, n) => (
|
|
177
|
+
let t = e, n = k(), r = j(() => Ne.getMetadata(t.deliveryStatus)), i = j(() => n.t(r.value.translationKey));
|
|
178
|
+
return (e, n) => (z(), M(V(Mt), {
|
|
179
179
|
label: i.value,
|
|
180
180
|
color: r.value.tone,
|
|
181
181
|
size: t.size,
|
|
@@ -186,7 +186,7 @@ var _n = /* @__PURE__ */ I({
|
|
|
186
186
|
"size"
|
|
187
187
|
]));
|
|
188
188
|
}
|
|
189
|
-
}),
|
|
189
|
+
}), bn = O.string().nullable(), xn = O.object({ subject: bn }), Sn = /* @__PURE__ */ L({
|
|
190
190
|
__name: "InvoiceDetailHeaderSection",
|
|
191
191
|
props: {
|
|
192
192
|
isDisputed: { type: Boolean },
|
|
@@ -197,9 +197,9 @@ var _n = /* @__PURE__ */ I({
|
|
|
197
197
|
},
|
|
198
198
|
emits: ["togglePdfView"],
|
|
199
199
|
setup(e, { emit: t }) {
|
|
200
|
-
let n = e, r = t, i =
|
|
200
|
+
let n = e, r = t, i = k(), a = Q(), o = vn(), s = j(() => new Be(n.invoice.status)), c = j(() => s.value.color), l = j(() => i.t(s.value.translationKey)), u = j(() => n.invoice.deliveryStatus !== d.UNSENT), f = j(() => Ne.isSent(n.invoice.deliveryStatus)), p = j(() => !b.isEditable(n.invoice.status)), m = $({
|
|
201
201
|
initialState: { subject: n.invoice.subject },
|
|
202
|
-
schema:
|
|
202
|
+
schema: xn,
|
|
203
203
|
onSubmit: async (e) => {
|
|
204
204
|
let t = await o.execute({
|
|
205
205
|
body: {
|
|
@@ -211,21 +211,21 @@ var _n = /* @__PURE__ */ I({
|
|
|
211
211
|
t.isErr() && a.apiError(t.error);
|
|
212
212
|
}
|
|
213
213
|
}), h = m.register("subject");
|
|
214
|
-
return
|
|
215
|
-
form:
|
|
214
|
+
return ze({ form: m }), (e, t) => (z(), M(V(Kt), {
|
|
215
|
+
form: V(m),
|
|
216
216
|
"prompt-on-unsaved-changes": !1
|
|
217
217
|
}, {
|
|
218
|
-
default:
|
|
219
|
-
"fallback-title":
|
|
218
|
+
default: H(() => [I(at, {
|
|
219
|
+
"fallback-title": V(i).t("wise_invoicing.invoice.detail.fallback_title"),
|
|
220
220
|
"is-disabled": p.value,
|
|
221
221
|
sequence: n.invoice.sequence,
|
|
222
222
|
"status-color": c.value,
|
|
223
223
|
"status-label": l.value,
|
|
224
|
-
icon:
|
|
225
|
-
"subject-field":
|
|
226
|
-
"subject-placeholder":
|
|
224
|
+
icon: V(Ce),
|
|
225
|
+
"subject-field": V(h),
|
|
226
|
+
"subject-placeholder": V(i).t("wise_invoicing.invoice.detail.header.subject_placeholder")
|
|
227
227
|
}, {
|
|
228
|
-
actions:
|
|
228
|
+
actions: H(() => [I(Ve, {
|
|
229
229
|
"is-pdf-view-active": n.isPdfViewActive,
|
|
230
230
|
"menu-groups": n.menuGroups,
|
|
231
231
|
"primary-buttons": n.primaryButtons,
|
|
@@ -235,13 +235,13 @@ var _n = /* @__PURE__ */ I({
|
|
|
235
235
|
"menu-groups",
|
|
236
236
|
"primary-buttons"
|
|
237
237
|
])]),
|
|
238
|
-
status:
|
|
238
|
+
status: H(() => [I(V(Qt), {
|
|
239
239
|
gap: "xs",
|
|
240
240
|
class: "flex-wrap items-start"
|
|
241
241
|
}, {
|
|
242
|
-
default:
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
default: H(() => [
|
|
243
|
+
I(Me, { "lifecycle-status": n.invoice.lifecycleStatus }, null, 8, ["lifecycle-status"]),
|
|
244
|
+
I(Pe, {
|
|
245
245
|
"is-sent": f.value,
|
|
246
246
|
"balance-due-amount": n.invoice.balanceDueAmount,
|
|
247
247
|
"gross-amount": n.invoice.grossAmount,
|
|
@@ -256,13 +256,13 @@ var _n = /* @__PURE__ */ I({
|
|
|
256
256
|
"settlement-status",
|
|
257
257
|
"total-credited-amount"
|
|
258
258
|
]),
|
|
259
|
-
n.invoice.isOverdue ? (
|
|
260
|
-
n.isDisputed ? (
|
|
261
|
-
u.value ? (
|
|
259
|
+
n.invoice.isOverdue ? (z(), M(st, { key: 0 })) : N("", !0),
|
|
260
|
+
n.isDisputed ? (z(), M(je, { key: 1 })) : N("", !0),
|
|
261
|
+
u.value ? (z(), M(yn, {
|
|
262
262
|
key: 2,
|
|
263
263
|
"delivery-status": n.invoice.deliveryStatus
|
|
264
|
-
}, null, 8, ["delivery-status"])) :
|
|
265
|
-
|
|
264
|
+
}, null, 8, ["delivery-status"])) : N("", !0),
|
|
265
|
+
I(Le, {
|
|
266
266
|
approval: n.invoice.approval,
|
|
267
267
|
rejection: n.invoice.rejection,
|
|
268
268
|
"requires-prior-approval": n.invoice.requiresPriorApproval
|
|
@@ -288,12 +288,12 @@ var _n = /* @__PURE__ */ I({
|
|
|
288
288
|
_: 1
|
|
289
289
|
}, 8, ["form"]));
|
|
290
290
|
}
|
|
291
|
-
}),
|
|
291
|
+
}), Cn = { class: "grid w-full grid-cols-1 gap-md lg:grid-cols-3" }, wn = /* @__PURE__ */ L({
|
|
292
292
|
__name: "InvoiceDetailLinkedCreditNotesSection",
|
|
293
293
|
props: { invoice: {} },
|
|
294
294
|
setup(e) {
|
|
295
|
-
let t = e, n =
|
|
296
|
-
let t = new
|
|
295
|
+
let t = e, n = k(), r = p(), i = j(() => t.invoice.creditNotes.map((e) => {
|
|
296
|
+
let t = new Be(e.status);
|
|
297
297
|
return {
|
|
298
298
|
uuid: e.uuid,
|
|
299
299
|
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 }),
|
|
@@ -308,17 +308,17 @@ var _n = /* @__PURE__ */ I({
|
|
|
308
308
|
amount: e.grossAmount.amount > 0 ? -e.grossAmount.amount : e.grossAmount.amount
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
return (e, t) => i.value.length > 0 ? (
|
|
311
|
+
return (e, t) => i.value.length > 0 ? (z(), M(V(Rt), {
|
|
312
312
|
key: 0,
|
|
313
313
|
as: "section",
|
|
314
314
|
gap: "md",
|
|
315
315
|
class: "w-full"
|
|
316
316
|
}, {
|
|
317
|
-
default:
|
|
318
|
-
text:
|
|
317
|
+
default: H(() => [I(V(Z), {
|
|
318
|
+
text: V(n).t("wise_invoicing.invoice.detail.credit_notes.title"),
|
|
319
319
|
as: "h2",
|
|
320
320
|
class: "text-sm font-semibold text-primary"
|
|
321
|
-
}, null, 8, ["text"]),
|
|
321
|
+
}, null, 8, ["text"]), F("div", Cn, [(z(!0), P(A, null, bt(i.value, (e) => (z(), M(V(Ot), {
|
|
322
322
|
key: e.uuid,
|
|
323
323
|
to: {
|
|
324
324
|
name: "invoicing-credit-note-detail",
|
|
@@ -326,23 +326,23 @@ var _n = /* @__PURE__ */ I({
|
|
|
326
326
|
},
|
|
327
327
|
class: "min-w-0 rounded-lg border border-secondary bg-primary p-lg transition-colors hover:bg-secondary"
|
|
328
328
|
}, {
|
|
329
|
-
default:
|
|
329
|
+
default: H(() => [I(V(Qt), {
|
|
330
330
|
align: "center",
|
|
331
331
|
gap: "md",
|
|
332
332
|
class: "min-w-0"
|
|
333
333
|
}, {
|
|
334
|
-
default:
|
|
335
|
-
|
|
334
|
+
default: H(() => [
|
|
335
|
+
I(V(Z), {
|
|
336
336
|
text: e.title,
|
|
337
337
|
class: "min-w-0 flex-1 truncate text-xs font-semibold text-primary"
|
|
338
338
|
}, null, 8, ["text"]),
|
|
339
|
-
|
|
339
|
+
I(V(Mt), {
|
|
340
340
|
label: e.statusLabel,
|
|
341
341
|
color: e.statusColor,
|
|
342
342
|
size: "sm",
|
|
343
343
|
variant: "translucent"
|
|
344
344
|
}, null, 8, ["label", "color"]),
|
|
345
|
-
|
|
345
|
+
I(V(Mt), {
|
|
346
346
|
label: e.amountLabel,
|
|
347
347
|
variant: "translucent",
|
|
348
348
|
size: "sm"
|
|
@@ -353,33 +353,33 @@ var _n = /* @__PURE__ */ I({
|
|
|
353
353
|
_: 2
|
|
354
354
|
}, 1032, ["to"]))), 128))])]),
|
|
355
355
|
_: 1
|
|
356
|
-
})) :
|
|
356
|
+
})) : N("", !0);
|
|
357
357
|
}
|
|
358
|
-
}),
|
|
359
|
-
deliveredOn:
|
|
360
|
-
dueOn:
|
|
361
|
-
issuedOn:
|
|
362
|
-
customFields:
|
|
363
|
-
externalRemarks:
|
|
364
|
-
poNumber:
|
|
365
|
-
preparedBy:
|
|
366
|
-
uuid:
|
|
367
|
-
name:
|
|
358
|
+
}), Tn = O.object({
|
|
359
|
+
deliveredOn: E.nullable(),
|
|
360
|
+
dueOn: E,
|
|
361
|
+
issuedOn: E,
|
|
362
|
+
customFields: O.array(O.custom()),
|
|
363
|
+
externalRemarks: O.string().nullable(),
|
|
364
|
+
poNumber: O.string().nullable(),
|
|
365
|
+
preparedBy: O.object({
|
|
366
|
+
uuid: O.uuid(),
|
|
367
|
+
name: O.string()
|
|
368
368
|
}),
|
|
369
|
-
subject:
|
|
369
|
+
subject: O.string().nullable()
|
|
370
370
|
}).superRefine((t, n) => {
|
|
371
371
|
Temporal.PlainDate.compare(t.dueOn, t.issuedOn) < 0 && n.addIssue({
|
|
372
372
|
code: "custom",
|
|
373
373
|
message: e.global.t("invoicing.invoice.validation.due_date_after_issue_date"),
|
|
374
374
|
path: ["dueOn"]
|
|
375
375
|
});
|
|
376
|
-
}),
|
|
376
|
+
}), En = /* @__PURE__ */ L({
|
|
377
377
|
__name: "InvoiceDetailRemarksSection",
|
|
378
378
|
props: { invoice: {} },
|
|
379
379
|
setup(e) {
|
|
380
|
-
let t = e, n =
|
|
381
|
-
initialState:
|
|
382
|
-
schema:
|
|
380
|
+
let t = e, n = k(), r = Q(), i = vn(), a = $({
|
|
381
|
+
initialState: j(() => v.toForm(t.invoice)),
|
|
382
|
+
schema: Tn,
|
|
383
383
|
onSubmit: async (e) => {
|
|
384
384
|
let n = await i.execute({
|
|
385
385
|
body: e,
|
|
@@ -387,16 +387,16 @@ var _n = /* @__PURE__ */ I({
|
|
|
387
387
|
});
|
|
388
388
|
n.isErr() && r.apiError(n.error);
|
|
389
389
|
}
|
|
390
|
-
}), o = a.register("externalRemarks"), s =
|
|
391
|
-
return
|
|
392
|
-
form:
|
|
390
|
+
}), o = a.register("externalRemarks"), s = j(() => !b.isEditable(t.invoice.status));
|
|
391
|
+
return ze({ form: a }), (e, t) => (z(), M(V(Kt), {
|
|
392
|
+
form: V(a),
|
|
393
393
|
"prompt-on-unsaved-changes": !1
|
|
394
394
|
}, {
|
|
395
|
-
default:
|
|
395
|
+
default: H(() => [I(qe, {
|
|
396
396
|
"is-disabled": s.value,
|
|
397
|
-
placeholder:
|
|
398
|
-
"remarks-field":
|
|
399
|
-
title:
|
|
397
|
+
placeholder: V(n).t("wise_invoicing.invoice.detail.remarks.placeholder"),
|
|
398
|
+
"remarks-field": V(o),
|
|
399
|
+
title: V(n).t("wise_invoicing.invoice.detail.remarks.title")
|
|
400
400
|
}, null, 8, [
|
|
401
401
|
"is-disabled",
|
|
402
402
|
"placeholder",
|
|
@@ -409,33 +409,33 @@ var _n = /* @__PURE__ */ I({
|
|
|
409
409
|
});
|
|
410
410
|
//#endregion
|
|
411
411
|
//#region src/modules/invoice/api/queries/invoiceActivityLogIndex.query.ts
|
|
412
|
-
function
|
|
413
|
-
return
|
|
412
|
+
function Dn(e) {
|
|
413
|
+
return Tt("invoiceActivityLogIndex", {
|
|
414
414
|
params: { invoiceUuid: e },
|
|
415
415
|
queryFn: (t) => y.getActivityLogs(e.value, { pagination: t })
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
//#endregion
|
|
419
419
|
//#region src/modules/invoice/use-cases/detail/components/sidebar/InvoiceDetailSidebarActivityTab.vue
|
|
420
|
-
var
|
|
420
|
+
var On = /* @__PURE__ */ L({
|
|
421
421
|
__name: "InvoiceDetailSidebarActivityTab",
|
|
422
422
|
props: { invoice: {} },
|
|
423
423
|
setup(e) {
|
|
424
|
-
let t = e, n =
|
|
424
|
+
let t = e, n = k(), { hasNextPage: r, isFetchingNextPage: i, isLoading: a, fetchNextPage: o, result: s } = Dn(j(() => t.invoice.uuid)), c = j(() => s.value.unwrapOr({
|
|
425
425
|
data: [],
|
|
426
426
|
meta: { next: null }
|
|
427
427
|
}).data);
|
|
428
|
-
return (e, s) => (
|
|
428
|
+
return (e, s) => (z(), M(Je, {
|
|
429
429
|
"current-billing-document": {
|
|
430
|
-
role:
|
|
430
|
+
role: V(u).INVOICE,
|
|
431
431
|
uuid: t.invoice.uuid
|
|
432
432
|
},
|
|
433
|
-
"empty-message":
|
|
433
|
+
"empty-message": V(n).t("wise_invoicing.invoice.detail.sidebar.activity_empty"),
|
|
434
434
|
entries: c.value,
|
|
435
|
-
"fetch-next-page":
|
|
436
|
-
"has-next-page":
|
|
437
|
-
"is-fetching-next-page":
|
|
438
|
-
"is-loading":
|
|
435
|
+
"fetch-next-page": V(o),
|
|
436
|
+
"has-next-page": V(r),
|
|
437
|
+
"is-fetching-next-page": V(i),
|
|
438
|
+
"is-loading": V(a)
|
|
439
439
|
}, null, 8, [
|
|
440
440
|
"current-billing-document",
|
|
441
441
|
"empty-message",
|
|
@@ -446,9 +446,9 @@ var En = /* @__PURE__ */ I({
|
|
|
446
446
|
"is-loading"
|
|
447
447
|
]));
|
|
448
448
|
}
|
|
449
|
-
}),
|
|
449
|
+
}), kn = /* @__PURE__ */ L({
|
|
450
450
|
__name: "CustomFieldFieldset",
|
|
451
|
-
props: /*@__PURE__*/
|
|
451
|
+
props: /*@__PURE__*/ _t({
|
|
452
452
|
isDisabled: { type: Boolean },
|
|
453
453
|
currency: {},
|
|
454
454
|
definitions: {},
|
|
@@ -460,19 +460,19 @@ var En = /* @__PURE__ */ I({
|
|
|
460
460
|
}),
|
|
461
461
|
emits: ["update:modelValue"],
|
|
462
462
|
setup(e) {
|
|
463
|
-
let t = e, n =
|
|
463
|
+
let t = e, n = St(e, "modelValue");
|
|
464
464
|
function r(e) {
|
|
465
|
-
return
|
|
465
|
+
return se.findByDefinition(n.value, e);
|
|
466
466
|
}
|
|
467
467
|
function i(e, t) {
|
|
468
|
-
n.value =
|
|
468
|
+
n.value = se.upsert(n.value, e, t);
|
|
469
469
|
}
|
|
470
|
-
return (e, n) => t.definitions.length > 0 ? (
|
|
470
|
+
return (e, n) => t.definitions.length > 0 ? (z(), M(V(Rt), {
|
|
471
471
|
key: 0,
|
|
472
472
|
gap: t.size === "sm" ? "xs" : "md",
|
|
473
473
|
align: "stretch"
|
|
474
474
|
}, {
|
|
475
|
-
default:
|
|
475
|
+
default: H(() => [(z(!0), P(A, null, bt(t.definitions, (e) => (z(), M(Xe, {
|
|
476
476
|
key: e.uuid,
|
|
477
477
|
currency: t.currency,
|
|
478
478
|
definition: e,
|
|
@@ -491,20 +491,20 @@ var En = /* @__PURE__ */ I({
|
|
|
491
491
|
"onUpdate:modelValue"
|
|
492
492
|
]))), 128))]),
|
|
493
493
|
_: 1
|
|
494
|
-
}, 8, ["gap"])) :
|
|
494
|
+
}, 8, ["gap"])) : N("", !0);
|
|
495
495
|
}
|
|
496
496
|
});
|
|
497
497
|
//#endregion
|
|
498
498
|
//#region src/modules/invoice/api/queries/invoiceCustomerDetail.query.ts
|
|
499
|
-
function
|
|
500
|
-
return
|
|
499
|
+
function An(e) {
|
|
500
|
+
return Dt("invoiceCustomerDetail", {
|
|
501
501
|
params: { customerUuid: e },
|
|
502
|
-
queryFn: () =>
|
|
502
|
+
queryFn: () => Ae.getByUuid(e.value)
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
505
|
//#endregion
|
|
506
506
|
//#region src/modules/invoice/models/invoice/update/invoicePreparer.transformer.ts
|
|
507
|
-
var
|
|
507
|
+
var jn = class {
|
|
508
508
|
static fromDto(e) {
|
|
509
509
|
let t = `${e.firstName ?? ""} ${e.lastName ?? ""}`.trim();
|
|
510
510
|
return {
|
|
@@ -512,28 +512,28 @@ var kn = class {
|
|
|
512
512
|
name: t === "" ? e.email ?? e.uuid : t
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
},
|
|
515
|
+
}, Mn = class {
|
|
516
516
|
static toDto(e) {
|
|
517
517
|
return {
|
|
518
518
|
pagination: e.pagination,
|
|
519
519
|
search: te.toDto(e.search)
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
},
|
|
522
|
+
}, Nn = class {
|
|
523
523
|
static async getAll(e) {
|
|
524
|
-
return (await
|
|
525
|
-
data: e.data.items.map(
|
|
524
|
+
return (await n.fromPromise(t({ query: Mn.toDto(e) }))).map((e) => ({
|
|
525
|
+
data: e.data.items.map(jn.fromDto),
|
|
526
526
|
meta: e.data.meta
|
|
527
527
|
}));
|
|
528
528
|
}
|
|
529
529
|
};
|
|
530
530
|
//#endregion
|
|
531
531
|
//#region src/modules/invoice/api/queries/invoiceUserSearch.query.ts
|
|
532
|
-
function
|
|
533
|
-
let t =
|
|
534
|
-
return
|
|
532
|
+
function Pn(e) {
|
|
533
|
+
let t = j(() => ({ search: e.params.search?.value }));
|
|
534
|
+
return Et("invoiceUserSearch", {
|
|
535
535
|
params: { queryParams: t },
|
|
536
|
-
queryFn: (t) =>
|
|
536
|
+
queryFn: (t) => Nn.getAll({
|
|
537
537
|
pagination: t,
|
|
538
538
|
search: e.params.search?.value ?? ""
|
|
539
539
|
})
|
|
@@ -541,7 +541,7 @@ function Mn(e) {
|
|
|
541
541
|
}
|
|
542
542
|
//#endregion
|
|
543
543
|
//#region src/modules/invoice/components/form/InvoiceFormPreparedByField.vue
|
|
544
|
-
var
|
|
544
|
+
var Fn = /* @__PURE__ */ L({
|
|
545
545
|
__name: "InvoiceFormPreparedByField",
|
|
546
546
|
props: {
|
|
547
547
|
isLoading: { type: Boolean },
|
|
@@ -550,20 +550,20 @@ var Nn = /* @__PURE__ */ I({
|
|
|
550
550
|
},
|
|
551
551
|
emits: ["nextPage", "updateSearch"],
|
|
552
552
|
setup(e, { emit: t }) {
|
|
553
|
-
let n = e, r = t, i =
|
|
553
|
+
let n = e, r = t, i = k(), a = j(() => sn(n.users));
|
|
554
554
|
function o(e) {
|
|
555
555
|
return e.name;
|
|
556
556
|
}
|
|
557
557
|
function s(e) {
|
|
558
558
|
e !== null && (n.field.setValue(e), r("updateSearch", ""));
|
|
559
559
|
}
|
|
560
|
-
return (e, t) => (
|
|
560
|
+
return (e, t) => (z(), M(V(jt), R(V(D)(n.field), {
|
|
561
561
|
"display-fn": o,
|
|
562
562
|
"is-loading": n.isLoading,
|
|
563
563
|
"is-required": !0,
|
|
564
564
|
items: a.value,
|
|
565
|
-
label:
|
|
566
|
-
placeholder:
|
|
565
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.created_by"),
|
|
566
|
+
placeholder: V(i).t("component.autocomplete.search_placeholder"),
|
|
567
567
|
"search-mode": "remote",
|
|
568
568
|
onNextPage: t[0] ||= (e) => r("nextPage"),
|
|
569
569
|
"onUpdate:modelValue": s,
|
|
@@ -575,7 +575,7 @@ var Nn = /* @__PURE__ */ I({
|
|
|
575
575
|
"placeholder"
|
|
576
576
|
]));
|
|
577
577
|
}
|
|
578
|
-
}),
|
|
578
|
+
}), In = /* @__PURE__ */ L({
|
|
579
579
|
__name: "InvoiceUpdateDialog",
|
|
580
580
|
props: {
|
|
581
581
|
customFieldDefinitions: {},
|
|
@@ -583,18 +583,18 @@ var Nn = /* @__PURE__ */ I({
|
|
|
583
583
|
},
|
|
584
584
|
emits: ["close"],
|
|
585
585
|
setup(e, { emit: t }) {
|
|
586
|
-
let n = e, r = t, i =
|
|
586
|
+
let n = e, r = t, i = k(), a = Q(), o = vn(), s = Re(), c = h(), l = g({ debounceMs: 250 }), u = Pn({ params: { search: l.debouncedSearch } }), d = j(() => u.result.value.match({
|
|
587
587
|
err: () => [],
|
|
588
588
|
loading: () => [],
|
|
589
589
|
ok: (e) => e.data
|
|
590
|
-
})), f =
|
|
590
|
+
})), f = An(j(() => n.invoice.customer.uuid)), p = j(() => {
|
|
591
591
|
let e = f.result.value;
|
|
592
592
|
if (e.isOk()) return e.getValue().defaultPaymentTermDays;
|
|
593
593
|
let t = s.result.value;
|
|
594
594
|
return t.isOk() ? t.getValue().defaultPaymentTermDays ?? 0 : 0;
|
|
595
595
|
}), m = $({
|
|
596
|
-
initialState:
|
|
597
|
-
schema:
|
|
596
|
+
initialState: j(() => v.toForm(n.invoice)),
|
|
597
|
+
schema: Tn,
|
|
598
598
|
onSubmit: async (e) => {
|
|
599
599
|
let t = await o.execute({
|
|
600
600
|
body: e,
|
|
@@ -609,70 +609,70 @@ var Nn = /* @__PURE__ */ I({
|
|
|
609
609
|
onSubmitError: () => {
|
|
610
610
|
a.unableToSave();
|
|
611
611
|
}
|
|
612
|
-
}), _ = m.register("issuedOn"), ee = m.register("dueOn"), te = m.register("deliveredOn"), y = m.register("poNumber"), ne = m.register("preparedBy"), re = m.register("subject"), ie = m.register("customFields"),
|
|
612
|
+
}), _ = m.register("issuedOn"), ee = m.register("dueOn"), te = m.register("deliveredOn"), y = m.register("poNumber"), ne = m.register("preparedBy"), re = m.register("subject"), ie = m.register("customFields"), b = j({
|
|
613
613
|
get: () => ie.modelValue.value ?? [],
|
|
614
614
|
set: (e) => {
|
|
615
615
|
ie.setValue(e);
|
|
616
616
|
}
|
|
617
617
|
});
|
|
618
|
-
function
|
|
618
|
+
function ae(e) {
|
|
619
619
|
e !== null && ee.setValue(e.add({ days: p.value }));
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function oe(e) {
|
|
622
622
|
l.updateSearch(e);
|
|
623
623
|
}
|
|
624
|
-
return (e, t) => (
|
|
625
|
-
form:
|
|
624
|
+
return (e, t) => (z(), M(V(X), {
|
|
625
|
+
form: V(m),
|
|
626
626
|
size: "sm",
|
|
627
627
|
onClose: t[1] ||= (e) => r("close")
|
|
628
628
|
}, {
|
|
629
|
-
default:
|
|
630
|
-
|
|
631
|
-
icon:
|
|
629
|
+
default: H(() => [
|
|
630
|
+
I(V(Y), {
|
|
631
|
+
icon: V(w),
|
|
632
632
|
"is-description-hidden": !0,
|
|
633
|
-
title:
|
|
633
|
+
title: V(i).t("wise_invoicing.invoice.detail.header.edit_info"),
|
|
634
634
|
description: ""
|
|
635
635
|
}, null, 8, ["icon", "title"]),
|
|
636
|
-
|
|
637
|
-
default:
|
|
638
|
-
default:
|
|
636
|
+
I(V(Wt), null, {
|
|
637
|
+
default: H(() => [I(V(Jt), null, {
|
|
638
|
+
default: H(() => [I(V(qt), {
|
|
639
639
|
lg: 2,
|
|
640
640
|
sm: 1
|
|
641
641
|
}, {
|
|
642
|
-
default:
|
|
643
|
-
|
|
644
|
-
label:
|
|
642
|
+
default: H(() => [
|
|
643
|
+
I(V(zt), R(V(D)(V(_)), {
|
|
644
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.invoice_date"),
|
|
645
645
|
"is-required": !0,
|
|
646
|
-
"onUpdate:modelValue":
|
|
646
|
+
"onUpdate:modelValue": ae
|
|
647
647
|
}), null, 16, ["label"]),
|
|
648
|
-
|
|
649
|
-
label:
|
|
648
|
+
I(V(zt), R(V(D)(V(ee)), {
|
|
649
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.due_date"),
|
|
650
650
|
"is-required": !0,
|
|
651
|
-
"min-date":
|
|
651
|
+
"min-date": V(_).modelValue.value
|
|
652
652
|
}), null, 16, ["label", "min-date"]),
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
field:
|
|
656
|
-
"is-loading":
|
|
653
|
+
V(c).isDeliveryDateVisible.value ? (z(), M(V(zt), R({ key: 0 }, V(D)(V(te)), { label: V(i).t("wise_invoicing.invoice.detail.header.delivery_date") }), null, 16, ["label"])) : N("", !0),
|
|
654
|
+
I(Fn, {
|
|
655
|
+
field: V(ne),
|
|
656
|
+
"is-loading": V(u).isLoading.value,
|
|
657
657
|
users: d.value,
|
|
658
|
-
onNextPage:
|
|
659
|
-
onUpdateSearch:
|
|
658
|
+
onNextPage: V(u).fetchNextPage,
|
|
659
|
+
onUpdateSearch: oe
|
|
660
660
|
}, null, 8, [
|
|
661
661
|
"field",
|
|
662
662
|
"is-loading",
|
|
663
663
|
"users",
|
|
664
664
|
"onNextPage"
|
|
665
665
|
]),
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
label:
|
|
669
|
-
placeholder:
|
|
666
|
+
I(V(rn), R(V(D)(V(y)), { label: V(i).t("wise_invoicing.invoice.detail.header.po_number") }), null, 16, ["label"]),
|
|
667
|
+
I(V(rn), R(V(D)(V(re)), {
|
|
668
|
+
label: V(i).t("wise_invoicing.invoice.detail.header.subject"),
|
|
669
|
+
placeholder: V(i).t("wise_invoicing.invoice.detail.header.subject_placeholder")
|
|
670
670
|
}), null, 16, ["label", "placeholder"])
|
|
671
671
|
]),
|
|
672
672
|
_: 1
|
|
673
|
-
}),
|
|
674
|
-
modelValue:
|
|
675
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
673
|
+
}), I(kn, {
|
|
674
|
+
modelValue: b.value,
|
|
675
|
+
"onUpdate:modelValue": t[0] ||= (e) => b.value = e,
|
|
676
676
|
currency: n.invoice.currency,
|
|
677
677
|
definitions: n.customFieldDefinitions,
|
|
678
678
|
"is-disabled": !0,
|
|
@@ -688,83 +688,83 @@ var Nn = /* @__PURE__ */ I({
|
|
|
688
688
|
})]),
|
|
689
689
|
_: 1
|
|
690
690
|
}),
|
|
691
|
-
|
|
692
|
-
right:
|
|
691
|
+
I(V(q), null, {
|
|
692
|
+
right: H(() => [I(V(J), { label: "cancel" }), I(V(Gt), { label: V(i).t("wise_invoicing.invoice.detail.header.edit_info") }, null, 8, ["label"])]),
|
|
693
693
|
_: 1
|
|
694
694
|
})
|
|
695
695
|
]),
|
|
696
696
|
_: 1
|
|
697
697
|
}, 8, ["form"]));
|
|
698
698
|
}
|
|
699
|
-
}),
|
|
699
|
+
}), Ln = /* @__PURE__ */ L({
|
|
700
700
|
__name: "InvoiceDetailSidebarInfoTab",
|
|
701
701
|
props: {
|
|
702
702
|
customFieldDefinitions: {},
|
|
703
703
|
invoice: {}
|
|
704
704
|
},
|
|
705
705
|
setup(e) {
|
|
706
|
-
let t = e, n =
|
|
706
|
+
let t = e, n = k(), r = T(), i = h(), a = dn().create(In), o = j(() => b.isEditable(t.invoice.status)), s = j(() => ae.filterByEntityType(t.customFieldDefinitions, l.INVOICE)), c = j(() => se.listByDefinitions(t.customFieldDefinitions, t.invoice.customFields)), u = j(() => {
|
|
707
707
|
if (!t.invoice.isOverdue) return null;
|
|
708
|
-
let e = t.invoice.dueOn.toZonedDateTime(
|
|
708
|
+
let e = t.invoice.dueOn.toZonedDateTime(At.Now.timeZoneId()).toInstant();
|
|
709
709
|
return r.toRelativeTime(e);
|
|
710
710
|
});
|
|
711
|
-
async function
|
|
711
|
+
async function d() {
|
|
712
712
|
await a.open({
|
|
713
713
|
customFieldDefinitions: s.value,
|
|
714
714
|
invoice: t.invoice
|
|
715
715
|
});
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function f(e) {
|
|
718
718
|
return e === null ? "-" : r.formatPlainDate(e);
|
|
719
719
|
}
|
|
720
|
-
return (e, r) => (
|
|
721
|
-
default:
|
|
722
|
-
|
|
723
|
-
default:
|
|
724
|
-
|
|
725
|
-
default:
|
|
726
|
-
icon:
|
|
727
|
-
label:
|
|
728
|
-
}, null, 8, ["icon", "label"]),
|
|
720
|
+
return (e, r) => (z(), M(V(Bt), { class: "px-2xl py-xl" }, {
|
|
721
|
+
default: H(() => [
|
|
722
|
+
I(V(Vt), { label: V(n).t("wise_invoicing.invoice.detail.sidebar.general") }, ht({
|
|
723
|
+
default: H(() => [
|
|
724
|
+
I(V(W), null, {
|
|
725
|
+
default: H(() => [I(V(G), {
|
|
726
|
+
icon: V(xe),
|
|
727
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.invoice_id")
|
|
728
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: t.invoice.sequence ?? "-" }, null, 8, ["text"])]),
|
|
729
729
|
_: 1
|
|
730
730
|
}),
|
|
731
|
-
|
|
732
|
-
default:
|
|
733
|
-
icon:
|
|
734
|
-
label:
|
|
735
|
-
}, null, 8, ["icon", "label"]),
|
|
731
|
+
I(V(W), null, {
|
|
732
|
+
default: H(() => [I(V(G), {
|
|
733
|
+
icon: V(we),
|
|
734
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.po_number")
|
|
735
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: t.invoice.poNumber ?? "-" }, null, 8, ["text"])]),
|
|
736
736
|
_: 1
|
|
737
737
|
}),
|
|
738
|
-
|
|
739
|
-
default:
|
|
740
|
-
icon:
|
|
741
|
-
label:
|
|
742
|
-
}, null, 8, ["icon", "label"]),
|
|
738
|
+
I(V(W), null, {
|
|
739
|
+
default: H(() => [I(V(G), {
|
|
740
|
+
icon: V(Ee),
|
|
741
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.issuer")
|
|
742
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: t.invoice.issuer.name ?? "-" }, null, 8, ["text"])]),
|
|
743
743
|
_: 1
|
|
744
744
|
}),
|
|
745
|
-
|
|
746
|
-
default:
|
|
747
|
-
icon:
|
|
748
|
-
label:
|
|
749
|
-
}, null, 8, ["icon", "label"]),
|
|
745
|
+
I(V(W), null, {
|
|
746
|
+
default: H(() => [I(V(G), {
|
|
747
|
+
icon: V(Ce),
|
|
748
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.invoice_date")
|
|
749
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: f(t.invoice.issueOn) }, null, 8, ["text"])]),
|
|
750
750
|
_: 1
|
|
751
751
|
}),
|
|
752
|
-
|
|
753
|
-
default:
|
|
754
|
-
icon:
|
|
755
|
-
label:
|
|
752
|
+
I(V(W), null, {
|
|
753
|
+
default: H(() => [I(V(G), {
|
|
754
|
+
icon: V(De),
|
|
755
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.due_date"),
|
|
756
756
|
variant: t.invoice.isOverdue ? "error" : "default"
|
|
757
757
|
}, null, 8, [
|
|
758
758
|
"icon",
|
|
759
759
|
"label",
|
|
760
760
|
"variant"
|
|
761
|
-
]),
|
|
762
|
-
default:
|
|
763
|
-
text:
|
|
761
|
+
]), I(V(Qt), { gap: "xs" }, {
|
|
762
|
+
default: H(() => [I(V(K), {
|
|
763
|
+
text: f(t.invoice.dueOn),
|
|
764
764
|
variant: t.invoice.isOverdue ? "error" : "default"
|
|
765
|
-
}, null, 8, ["text", "variant"]),
|
|
765
|
+
}, null, 8, ["text", "variant"]), u.value === null ? N("", !0) : (z(), M(V(Mt), {
|
|
766
766
|
key: 0,
|
|
767
|
-
label:
|
|
767
|
+
label: u.value,
|
|
768
768
|
color: "error",
|
|
769
769
|
size: "sm",
|
|
770
770
|
variant: "translucent"
|
|
@@ -773,69 +773,75 @@ var Nn = /* @__PURE__ */ I({
|
|
|
773
773
|
})]),
|
|
774
774
|
_: 1
|
|
775
775
|
}),
|
|
776
|
-
|
|
777
|
-
default:
|
|
778
|
-
icon:
|
|
779
|
-
label:
|
|
780
|
-
}, null, 8, ["icon", "label"]),
|
|
776
|
+
V(i).isDeliveryDateVisible.value ? (z(), M(V(W), { key: 0 }, {
|
|
777
|
+
default: H(() => [I(V(G), {
|
|
778
|
+
icon: V(x),
|
|
779
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.delivery_date")
|
|
780
|
+
}, null, 8, ["icon", "label"]), I(V(K), { text: f(t.invoice.deliveredOn) }, null, 8, ["text"])]),
|
|
781
781
|
_: 1
|
|
782
|
-
})) :
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
782
|
+
})) : N("", !0),
|
|
783
|
+
(z(!0), P(A, null, bt(c.value, (e) => (z(), M(V(W), { key: e.definition.uuid }, {
|
|
784
|
+
default: H(() => [I(V(G), {
|
|
785
|
+
icon: V(Ze)[e.definition.type],
|
|
786
|
+
label: V(ae).getLabel(e.definition, V(n).locale.value)
|
|
787
|
+
}, null, 8, ["icon", "label"]), I(oe, {
|
|
788
|
+
definition: e.definition,
|
|
789
|
+
value: e.value
|
|
790
|
+
}, null, 8, ["definition", "value"])]),
|
|
791
|
+
_: 2
|
|
792
|
+
}, 1024))), 128))
|
|
787
793
|
]),
|
|
788
794
|
_: 2
|
|
789
795
|
}, [o.value ? {
|
|
790
796
|
name: "actions",
|
|
791
|
-
fn:
|
|
792
|
-
icon:
|
|
793
|
-
label:
|
|
797
|
+
fn: H(() => [I(V(Xt), {
|
|
798
|
+
icon: V(ue),
|
|
799
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.edit_info"),
|
|
794
800
|
variant: "tertiary",
|
|
795
|
-
onClick:
|
|
801
|
+
onClick: d
|
|
796
802
|
}, null, 8, ["icon", "label"])]),
|
|
797
803
|
key: "0"
|
|
798
804
|
} : void 0]), 1032, ["label"]),
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
label:
|
|
805
|
+
I(et, { "original-invoice": t.invoice.originalInvoice }, null, 8, ["original-invoice"]),
|
|
806
|
+
I(V(Ht)),
|
|
807
|
+
I(V(Vt), {
|
|
808
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.bill_to"),
|
|
803
809
|
"collapse-options": {
|
|
804
810
|
isCollapsible: !0,
|
|
805
811
|
isOpenByDefault: !0,
|
|
806
812
|
badge: { label: t.invoice.customer.name ?? "-" }
|
|
807
813
|
}
|
|
808
814
|
}, {
|
|
809
|
-
default:
|
|
810
|
-
default:
|
|
815
|
+
default: H(() => [I(V(W), { orientation: "vertical" }, {
|
|
816
|
+
default: H(() => [I(V(Z), {
|
|
811
817
|
text: t.invoice.customer.name ?? "-",
|
|
812
|
-
class: "text-xs font-medium"
|
|
813
|
-
}, null, 8, ["text"]), t.invoice.customer.address ? (
|
|
814
|
-
text:
|
|
815
|
-
class: "text-xs"
|
|
816
|
-
}, null, 8, ["text"]), t.invoice.customer.address ? (
|
|
818
|
+
class: "text-xs font-medium text-primary"
|
|
819
|
+
}, null, 8, ["text"]), t.invoice.customer.address ? (z(), P(A, { key: 0 }, [I(V(Z), {
|
|
820
|
+
text: V(ne).formatLines(t.invoice.customer.address)[0] ?? "",
|
|
821
|
+
class: "text-xs text-primary"
|
|
822
|
+
}, null, 8, ["text"]), t.invoice.customer.address ? (z(), M(V(Z), {
|
|
817
823
|
key: 0,
|
|
818
|
-
text:
|
|
819
|
-
class: "text-xs"
|
|
820
|
-
}, null, 8, ["text"])) :
|
|
824
|
+
text: V(ne).formatLines(t.invoice.customer.address)[1] ?? "",
|
|
825
|
+
class: "text-xs text-primary"
|
|
826
|
+
}, null, 8, ["text"])) : N("", !0)], 64)) : N("", !0)]),
|
|
821
827
|
_: 1
|
|
822
828
|
})]),
|
|
823
829
|
_: 1
|
|
824
830
|
}, 8, ["label", "collapse-options"]),
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
label:
|
|
831
|
+
I(V(Ht)),
|
|
832
|
+
I(V(Vt), {
|
|
833
|
+
label: V(n).t("wise_invoicing.invoice.detail.header.bill_from"),
|
|
828
834
|
"collapse-options": {
|
|
829
835
|
isCollapsible: !0,
|
|
830
836
|
isOpenByDefault: !1,
|
|
831
837
|
badge: { label: t.invoice.issuer.email ?? "-" }
|
|
832
838
|
}
|
|
833
839
|
}, {
|
|
834
|
-
default:
|
|
835
|
-
default:
|
|
840
|
+
default: H(() => [I(V(W), { orientation: "vertical" }, {
|
|
841
|
+
default: H(() => [I(V(G), { label: t.invoice.issuer.email ?? "-" }, null, 8, ["label"]), t.invoice.issuer.address ? (z(), M(V(K), {
|
|
836
842
|
key: 0,
|
|
837
|
-
text:
|
|
838
|
-
}, null, 8, ["text"])) :
|
|
843
|
+
text: V(ne).format(t.invoice.issuer.address)
|
|
844
|
+
}, null, 8, ["text"])) : N("", !0)]),
|
|
839
845
|
_: 1
|
|
840
846
|
})]),
|
|
841
847
|
_: 1
|
|
@@ -844,20 +850,20 @@ var Nn = /* @__PURE__ */ I({
|
|
|
844
850
|
_: 1
|
|
845
851
|
}));
|
|
846
852
|
}
|
|
847
|
-
}),
|
|
853
|
+
}), Rn = /* @__PURE__ */ L({
|
|
848
854
|
__name: "InvoiceDetailSidebar",
|
|
849
855
|
props: {
|
|
850
856
|
customFieldDefinitions: {},
|
|
851
857
|
invoice: {}
|
|
852
858
|
},
|
|
853
859
|
setup(e) {
|
|
854
|
-
let t = e, n =
|
|
855
|
-
return (e, n) => (
|
|
860
|
+
let t = e, n = k(), r = T(), i = j(() => n.t("wise_invoicing.invoice.detail.sidebar.updated_on", { date: r.toDateTime(t.invoice.updatedAt) }));
|
|
861
|
+
return (e, n) => (z(), M(Ke, {
|
|
856
862
|
"billing-document": t.invoice,
|
|
857
863
|
"updated-footer": i.value
|
|
858
864
|
}, {
|
|
859
|
-
activity:
|
|
860
|
-
info:
|
|
865
|
+
activity: H(() => [I(On, { invoice: t.invoice }, null, 8, ["invoice"])]),
|
|
866
|
+
info: H(() => [I(Ln, {
|
|
861
867
|
"custom-field-definitions": t.customFieldDefinitions,
|
|
862
868
|
invoice: t.invoice
|
|
863
869
|
}, null, 8, ["custom-field-definitions", "invoice"])]),
|
|
@@ -867,57 +873,57 @@ var Nn = /* @__PURE__ */ I({
|
|
|
867
873
|
});
|
|
868
874
|
//#endregion
|
|
869
875
|
//#region src/modules/invoice/api/queries/invoicePaymentIndex.query.ts
|
|
870
|
-
function
|
|
871
|
-
return
|
|
876
|
+
function zn(e) {
|
|
877
|
+
return Dt("invoicePaymentIndex", {
|
|
872
878
|
params: { invoiceUuid: e },
|
|
873
879
|
queryFn: () => y.getPayments(e.value)
|
|
874
880
|
});
|
|
875
881
|
}
|
|
876
882
|
//#endregion
|
|
877
883
|
//#region src/modules/invoice/use-cases/detail/components/table/InvoiceDetailPaymentActionsCell.vue
|
|
878
|
-
var
|
|
884
|
+
var Bn = /* @__PURE__ */ L({
|
|
879
885
|
__name: "InvoiceDetailPaymentActionsCell",
|
|
880
886
|
props: {
|
|
881
887
|
payment: {},
|
|
882
888
|
onDelete: { type: Function }
|
|
883
889
|
},
|
|
884
890
|
setup(e) {
|
|
885
|
-
let t = e, n =
|
|
886
|
-
return (e, i) => (
|
|
887
|
-
default:
|
|
888
|
-
default:
|
|
891
|
+
let t = e, n = k();
|
|
892
|
+
return (e, i) => (z(), M(V(tn), null, {
|
|
893
|
+
default: H(() => [I(V(nn), null, {
|
|
894
|
+
default: H(() => [t.payment.source === V(r).MANUAL ? (z(), M(V(Xt), {
|
|
889
895
|
key: 0,
|
|
890
|
-
label:
|
|
891
|
-
icon:
|
|
896
|
+
label: V(n).t("wise_invoicing.invoice.detail.payments.delete.title"),
|
|
897
|
+
icon: V(_e),
|
|
892
898
|
size: "sm",
|
|
893
899
|
variant: "tertiary",
|
|
894
900
|
onClick: i[0] ||= (e) => t.onDelete(t.payment)
|
|
895
|
-
}, null, 8, ["label", "icon"])) :
|
|
901
|
+
}, null, 8, ["label", "icon"])) : N("", !0)]),
|
|
896
902
|
_: 1
|
|
897
903
|
})]),
|
|
898
904
|
_: 1
|
|
899
905
|
}));
|
|
900
906
|
}
|
|
901
|
-
}),
|
|
907
|
+
}), Vn = /* @__PURE__ */ L({
|
|
902
908
|
__name: "InvoiceDetailPaymentManualCell",
|
|
903
909
|
props: { payment: {} },
|
|
904
910
|
setup(e) {
|
|
905
911
|
let t = e;
|
|
906
|
-
return (e, n) => (
|
|
907
|
-
default:
|
|
912
|
+
return (e, n) => (z(), M(V(tn), null, {
|
|
913
|
+
default: H(() => [t.payment.source === V(r).MANUAL ? (z(), M(V(Se), {
|
|
908
914
|
key: 0,
|
|
909
915
|
class: "size-4 text-brand-600"
|
|
910
|
-
})) :
|
|
916
|
+
})) : N("", !0)]),
|
|
911
917
|
_: 1
|
|
912
918
|
}));
|
|
913
919
|
}
|
|
914
|
-
}),
|
|
920
|
+
}), Hn = /* @__PURE__ */ L({
|
|
915
921
|
__name: "InvoiceDetailPaymentsTableTextCell",
|
|
916
922
|
props: { text: {} },
|
|
917
923
|
setup(e) {
|
|
918
924
|
let t = e;
|
|
919
|
-
return (e, n) => (
|
|
920
|
-
default:
|
|
925
|
+
return (e, n) => (z(), M(V(tn), null, {
|
|
926
|
+
default: H(() => [I(V(Z), {
|
|
921
927
|
text: t.text ?? "-",
|
|
922
928
|
class: "text-sm/5 text-primary"
|
|
923
929
|
}, null, 8, ["text"])]),
|
|
@@ -927,9 +933,9 @@ var Rn = /* @__PURE__ */ I({
|
|
|
927
933
|
});
|
|
928
934
|
//#endregion
|
|
929
935
|
//#region src/modules/invoice/use-cases/detail/composables/invoiceDetailPaymentsTableColumns.composable.ts
|
|
930
|
-
function
|
|
931
|
-
let t =
|
|
932
|
-
return
|
|
936
|
+
function Un(e) {
|
|
937
|
+
let t = k(), n = T(), r = p();
|
|
938
|
+
return j(() => un()([
|
|
933
939
|
{
|
|
934
940
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.date"),
|
|
935
941
|
key: "date",
|
|
@@ -937,7 +943,7 @@ function Vn(e) {
|
|
|
937
943
|
max: "12rem",
|
|
938
944
|
min: "12rem"
|
|
939
945
|
},
|
|
940
|
-
component: (e) =>
|
|
946
|
+
component: (e) => cn(Hn, { text: n.formatPlainDate(e.date) })
|
|
941
947
|
},
|
|
942
948
|
{
|
|
943
949
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.reference"),
|
|
@@ -946,7 +952,7 @@ function Vn(e) {
|
|
|
946
952
|
max: "14rem",
|
|
947
953
|
min: "12rem"
|
|
948
954
|
},
|
|
949
|
-
component: (e) =>
|
|
955
|
+
component: (e) => cn(Hn, { text: e.paymentReference ?? "—" })
|
|
950
956
|
},
|
|
951
957
|
{
|
|
952
958
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.remark"),
|
|
@@ -955,7 +961,7 @@ function Vn(e) {
|
|
|
955
961
|
max: "1fr",
|
|
956
962
|
min: "12rem"
|
|
957
963
|
},
|
|
958
|
-
component: (e) =>
|
|
964
|
+
component: (e) => cn(Hn, { text: e.remarks ?? "—" })
|
|
959
965
|
},
|
|
960
966
|
{
|
|
961
967
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.manual"),
|
|
@@ -964,7 +970,7 @@ function Vn(e) {
|
|
|
964
970
|
max: "6rem",
|
|
965
971
|
min: "6rem"
|
|
966
972
|
},
|
|
967
|
-
component: (e) =>
|
|
973
|
+
component: (e) => cn(Vn, { payment: e })
|
|
968
974
|
},
|
|
969
975
|
{
|
|
970
976
|
headerLabel: t.t("wise_invoicing.invoice.detail.payments.columns.amount"),
|
|
@@ -973,7 +979,7 @@ function Vn(e) {
|
|
|
973
979
|
max: "10rem",
|
|
974
980
|
min: "10rem"
|
|
975
981
|
},
|
|
976
|
-
component: (e) =>
|
|
982
|
+
component: (e) => cn(Hn, { text: r.formatMonetary(e.amount) })
|
|
977
983
|
},
|
|
978
984
|
{
|
|
979
985
|
headerLabel: "",
|
|
@@ -982,7 +988,7 @@ function Vn(e) {
|
|
|
982
988
|
max: "5rem",
|
|
983
989
|
min: "5rem"
|
|
984
990
|
},
|
|
985
|
-
component: (t) =>
|
|
991
|
+
component: (t) => cn(Bn, {
|
|
986
992
|
payment: t,
|
|
987
993
|
onDelete: e.onDelete
|
|
988
994
|
})
|
|
@@ -991,8 +997,8 @@ function Vn(e) {
|
|
|
991
997
|
}
|
|
992
998
|
//#endregion
|
|
993
999
|
//#region src/modules/invoice/api/mutations/invoicePaymentCreate.mutation.ts
|
|
994
|
-
function
|
|
995
|
-
return
|
|
1000
|
+
function Wn() {
|
|
1001
|
+
return U({
|
|
996
1002
|
queryFn: (e) => y.createPayment(e.params.invoiceUuid, e.body),
|
|
997
1003
|
queryKeysToInvalidate: {
|
|
998
1004
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1004,19 +1010,19 @@ function Hn() {
|
|
|
1004
1010
|
}
|
|
1005
1011
|
//#endregion
|
|
1006
1012
|
//#region src/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.ts
|
|
1007
|
-
var
|
|
1008
|
-
amount:
|
|
1009
|
-
currency:
|
|
1013
|
+
var Gn = O.object({
|
|
1014
|
+
amount: O.number().positive(),
|
|
1015
|
+
currency: O.enum(s),
|
|
1010
1016
|
date: ee,
|
|
1011
|
-
paymentReference:
|
|
1012
|
-
precision:
|
|
1013
|
-
remarks:
|
|
1014
|
-
}),
|
|
1017
|
+
paymentReference: O.string().nullable(),
|
|
1018
|
+
precision: O.number().int().nonnegative(),
|
|
1019
|
+
remarks: O.string().nullable()
|
|
1020
|
+
}), Kn = { class: "pr-md text-xs text-secondary" }, qn = /* @__PURE__ */ L({
|
|
1015
1021
|
__name: "InvoicePaymentCreateDialog",
|
|
1016
1022
|
props: { invoice: {} },
|
|
1017
1023
|
emits: ["close"],
|
|
1018
1024
|
setup(e, { emit: t }) {
|
|
1019
|
-
let n = e, r = t, i =
|
|
1025
|
+
let n = e, r = t, i = k(), a = Q(), o = p(), s = Wn(), c = j(() => o.getSymbol(n.invoice.grossAmount.currency)), l = j(() => m(1, n.invoice.grossAmount.precision)), u = $({
|
|
1020
1026
|
initialState: {
|
|
1021
1027
|
amount: null,
|
|
1022
1028
|
currency: n.invoice.grossAmount.currency,
|
|
@@ -1025,7 +1031,7 @@ var Un = D.object({
|
|
|
1025
1031
|
precision: n.invoice.grossAmount.precision,
|
|
1026
1032
|
remarks: null
|
|
1027
1033
|
},
|
|
1028
|
-
schema:
|
|
1034
|
+
schema: Gn,
|
|
1029
1035
|
onSubmit: async (e) => {
|
|
1030
1036
|
let t = await s.execute({
|
|
1031
1037
|
body: e,
|
|
@@ -1041,47 +1047,47 @@ var Un = D.object({
|
|
|
1041
1047
|
a.unableToSave();
|
|
1042
1048
|
}
|
|
1043
1049
|
}), d = u.register("amount"), f = u.register("date"), h = u.register("paymentReference"), g = u.register("remarks");
|
|
1044
|
-
return (e, t) => (
|
|
1045
|
-
form:
|
|
1050
|
+
return (e, t) => (z(), M(V(X), {
|
|
1051
|
+
form: V(u),
|
|
1046
1052
|
size: "sm",
|
|
1047
1053
|
onClose: t[0] ||= (e) => r("close")
|
|
1048
1054
|
}, {
|
|
1049
|
-
default:
|
|
1050
|
-
|
|
1051
|
-
title:
|
|
1052
|
-
description:
|
|
1053
|
-
icon:
|
|
1055
|
+
default: H(() => [
|
|
1056
|
+
I(V(Y), {
|
|
1057
|
+
title: V(i).t("wise_invoicing.invoice.detail.payments.create.title"),
|
|
1058
|
+
description: V(i).t("wise_invoicing.invoice.detail.payments.create.description"),
|
|
1059
|
+
icon: V(fe)
|
|
1054
1060
|
}, null, 8, [
|
|
1055
1061
|
"title",
|
|
1056
1062
|
"description",
|
|
1057
1063
|
"icon"
|
|
1058
1064
|
]),
|
|
1059
|
-
|
|
1060
|
-
default:
|
|
1061
|
-
default:
|
|
1065
|
+
I(V(Wt), null, {
|
|
1066
|
+
default: H(() => [I(V(Jt), null, {
|
|
1067
|
+
default: H(() => [I(V(qt), {
|
|
1062
1068
|
lg: 2,
|
|
1063
1069
|
sm: 1
|
|
1064
1070
|
}, {
|
|
1065
|
-
default:
|
|
1066
|
-
|
|
1071
|
+
default: H(() => [
|
|
1072
|
+
I(V(Zt), R(V(D)(V(d)), {
|
|
1067
1073
|
"is-required": !0,
|
|
1068
|
-
label:
|
|
1074
|
+
label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.amount"),
|
|
1069
1075
|
min: l.value,
|
|
1070
1076
|
step: l.value
|
|
1071
1077
|
}), {
|
|
1072
|
-
right:
|
|
1078
|
+
right: H(() => [F("span", Kn, B(c.value.symbol), 1)]),
|
|
1073
1079
|
_: 1
|
|
1074
1080
|
}, 16, [
|
|
1075
1081
|
"label",
|
|
1076
1082
|
"min",
|
|
1077
1083
|
"step"
|
|
1078
1084
|
]),
|
|
1079
|
-
|
|
1085
|
+
I(V(zt), R(V(D)(V(f)), {
|
|
1080
1086
|
"is-required": !0,
|
|
1081
|
-
label:
|
|
1087
|
+
label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.date")
|
|
1082
1088
|
}), null, 16, ["label"]),
|
|
1083
|
-
|
|
1084
|
-
|
|
1089
|
+
I(V(rn), R(V(D)(V(h)), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.reference") }), null, 16, ["label"]),
|
|
1090
|
+
I(V(rn), R(V(D)(V(g)), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.fields.remarks") }), null, 16, ["label"])
|
|
1085
1091
|
]),
|
|
1086
1092
|
_: 1
|
|
1087
1093
|
})]),
|
|
@@ -1089,8 +1095,8 @@ var Un = D.object({
|
|
|
1089
1095
|
})]),
|
|
1090
1096
|
_: 1
|
|
1091
1097
|
}),
|
|
1092
|
-
|
|
1093
|
-
right:
|
|
1098
|
+
I(V(q), null, {
|
|
1099
|
+
right: H(() => [I(V(J)), I(V(Yt), { label: V(i).t("wise_invoicing.invoice.detail.payments.create.submit") }, null, 8, ["label"])]),
|
|
1094
1100
|
_: 1
|
|
1095
1101
|
})
|
|
1096
1102
|
]),
|
|
@@ -1100,8 +1106,8 @@ var Un = D.object({
|
|
|
1100
1106
|
});
|
|
1101
1107
|
//#endregion
|
|
1102
1108
|
//#region src/modules/invoice/api/mutations/invoicePaymentDelete.mutation.ts
|
|
1103
|
-
function
|
|
1104
|
-
return
|
|
1109
|
+
function Jn() {
|
|
1110
|
+
return U({
|
|
1105
1111
|
queryFn: (e) => y.deletePayment(e.params.invoiceUuid, e.params.paymentUuid),
|
|
1106
1112
|
queryKeysToInvalidate: {
|
|
1107
1113
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1113,7 +1119,7 @@ function Kn() {
|
|
|
1113
1119
|
}
|
|
1114
1120
|
//#endregion
|
|
1115
1121
|
//#region src/modules/invoice/use-cases/detail/dialogs/InvoicePaymentDeleteDialog.vue
|
|
1116
|
-
var
|
|
1122
|
+
var Yn = /* @__PURE__ */ L({
|
|
1117
1123
|
__name: "InvoicePaymentDeleteDialog",
|
|
1118
1124
|
props: {
|
|
1119
1125
|
invoiceUuid: {},
|
|
@@ -1121,8 +1127,8 @@ var qn = /* @__PURE__ */ I({
|
|
|
1121
1127
|
},
|
|
1122
1128
|
emits: ["close"],
|
|
1123
1129
|
setup(e, { emit: t }) {
|
|
1124
|
-
let n = e, r = t, i =
|
|
1125
|
-
schema:
|
|
1130
|
+
let n = e, r = t, i = k(), a = Q(), o = p(), s = Jn(), c = j(() => o.formatMonetary(n.payment.amount)), l = $({
|
|
1131
|
+
schema: mt.object({}),
|
|
1126
1132
|
onSubmit: async () => {
|
|
1127
1133
|
let e = await s.execute({ params: {
|
|
1128
1134
|
invoiceUuid: n.invoiceUuid,
|
|
@@ -1135,37 +1141,37 @@ var qn = /* @__PURE__ */ I({
|
|
|
1135
1141
|
a.show({ message: i.t("wise_invoicing.invoice.detail.payments.delete.success", { amount: c.value }) }), r("close");
|
|
1136
1142
|
}
|
|
1137
1143
|
});
|
|
1138
|
-
return (e, t) => (
|
|
1139
|
-
form:
|
|
1144
|
+
return (e, t) => (z(), M(V(X), {
|
|
1145
|
+
form: V(l),
|
|
1140
1146
|
size: "xs",
|
|
1141
1147
|
onClose: t[0] ||= (e) => r("close")
|
|
1142
1148
|
}, {
|
|
1143
|
-
default:
|
|
1144
|
-
title:
|
|
1145
|
-
description:
|
|
1146
|
-
}, null, 8, ["title", "description"]),
|
|
1147
|
-
right:
|
|
1149
|
+
default: H(() => [I(V(Y), {
|
|
1150
|
+
title: V(i).t("wise_invoicing.invoice.detail.payments.delete.title"),
|
|
1151
|
+
description: V(i).t("wise_invoicing.invoice.detail.payments.delete.description", { amount: c.value })
|
|
1152
|
+
}, null, 8, ["title", "description"]), I(V(q), null, {
|
|
1153
|
+
right: H(() => [I(V(J)), I(V(Gt), {
|
|
1148
1154
|
"is-destructive": !0,
|
|
1149
|
-
label:
|
|
1155
|
+
label: V(i).t("wise_invoicing.invoice.detail.payments.delete.submit")
|
|
1150
1156
|
}, null, 8, ["label"])]),
|
|
1151
1157
|
_: 1
|
|
1152
1158
|
})]),
|
|
1153
1159
|
_: 1
|
|
1154
1160
|
}, 8, ["form"]));
|
|
1155
1161
|
}
|
|
1156
|
-
}),
|
|
1162
|
+
}), Xn = /* @__PURE__ */ L({
|
|
1157
1163
|
__name: "InvoiceDetailPaymentsSection",
|
|
1158
1164
|
props: { invoice: {} },
|
|
1159
1165
|
setup(e) {
|
|
1160
|
-
let t = e, n =
|
|
1166
|
+
let t = e, n = k(), r = p(), i = j(() => t.invoice.uuid), a = j(() => t.invoice.balanceDueAmount === null ? null : r.formatMonetary(t.invoice.balanceDueAmount)), { isLoading: o, result: s } = zn(i), c = dn(), l = c.create(qn), u = c.create(Yn), d = j(() => s.value.match({
|
|
1161
1167
|
err: () => [],
|
|
1162
1168
|
loading: () => [],
|
|
1163
1169
|
ok: (e) => e
|
|
1164
|
-
})), f =
|
|
1170
|
+
})), f = j(() => s.value.match({
|
|
1165
1171
|
err: (e) => e,
|
|
1166
1172
|
loading: () => null,
|
|
1167
1173
|
ok: () => null
|
|
1168
|
-
})), m =
|
|
1174
|
+
})), m = j(() => !b.getMetadata(t.invoice.status).isTerminal);
|
|
1169
1175
|
function h() {
|
|
1170
1176
|
l.open({ invoice: t.invoice });
|
|
1171
1177
|
}
|
|
@@ -1175,49 +1181,49 @@ var qn = /* @__PURE__ */ I({
|
|
|
1175
1181
|
payment: e
|
|
1176
1182
|
});
|
|
1177
1183
|
}
|
|
1178
|
-
let _ =
|
|
1179
|
-
return (e, t) => (
|
|
1180
|
-
default:
|
|
1184
|
+
let _ = Un({ onDelete: g });
|
|
1185
|
+
return (e, t) => (z(), M($e, null, {
|
|
1186
|
+
default: H(() => [I(V(Qt), {
|
|
1181
1187
|
justify: "between",
|
|
1182
1188
|
class: "w-full gap-lg border-b border-secondary px-lg py-md"
|
|
1183
1189
|
}, {
|
|
1184
|
-
default:
|
|
1185
|
-
default:
|
|
1186
|
-
text:
|
|
1190
|
+
default: H(() => [I(V(Qt), { gap: "sm" }, {
|
|
1191
|
+
default: H(() => [I(V(Z), {
|
|
1192
|
+
text: V(n).t("wise_invoicing.invoice.detail.payments.title"),
|
|
1187
1193
|
as: "h2",
|
|
1188
1194
|
class: "text-sm font-semibold text-primary"
|
|
1189
|
-
}, null, 8, ["text"]), a.value === null ?
|
|
1195
|
+
}, null, 8, ["text"]), a.value === null ? N("", !0) : (z(), M(V(Mt), {
|
|
1190
1196
|
key: 0,
|
|
1191
1197
|
color: "gray",
|
|
1192
1198
|
size: "sm",
|
|
1193
1199
|
variant: "outline"
|
|
1194
1200
|
}, {
|
|
1195
|
-
default:
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1201
|
+
default: H(() => [
|
|
1202
|
+
I(V(Nt), { label: V(n).t("wise_invoicing.invoice.detail.payments.balance_due") }, null, 8, ["label"]),
|
|
1203
|
+
I(V(Pt)),
|
|
1204
|
+
I(V(Nt), { label: a.value }, null, 8, ["label"])
|
|
1199
1205
|
]),
|
|
1200
1206
|
_: 1
|
|
1201
1207
|
}))]),
|
|
1202
1208
|
_: 1
|
|
1203
|
-
}), m.value ? (
|
|
1209
|
+
}), m.value ? (z(), M(V(Ft), {
|
|
1204
1210
|
key: 0,
|
|
1205
|
-
label:
|
|
1206
|
-
"icon-left":
|
|
1211
|
+
label: V(n).t("wise_invoicing.invoice.detail.payments.add"),
|
|
1212
|
+
"icon-left": V(S),
|
|
1207
1213
|
size: "sm",
|
|
1208
1214
|
onClick: h
|
|
1209
|
-
}, null, 8, ["label", "icon-left"])) :
|
|
1215
|
+
}, null, 8, ["label", "icon-left"])) : N("", !0)]),
|
|
1210
1216
|
_: 1
|
|
1211
|
-
}),
|
|
1217
|
+
}), I(V(en), {
|
|
1212
1218
|
"active-filter-count": 0,
|
|
1213
|
-
columns:
|
|
1219
|
+
columns: V(_),
|
|
1214
1220
|
data: d.value,
|
|
1215
1221
|
error: f.value,
|
|
1216
1222
|
"get-key": (e) => e.uuid,
|
|
1217
1223
|
"has-active-search": !1,
|
|
1218
1224
|
"header-actions": [],
|
|
1219
1225
|
"is-fetching-next-page": !1,
|
|
1220
|
-
"is-loading":
|
|
1226
|
+
"is-loading": V(o)
|
|
1221
1227
|
}, null, 8, [
|
|
1222
1228
|
"columns",
|
|
1223
1229
|
"data",
|
|
@@ -1231,40 +1237,40 @@ var qn = /* @__PURE__ */ I({
|
|
|
1231
1237
|
});
|
|
1232
1238
|
//#endregion
|
|
1233
1239
|
//#region src/modules/invoice/api/mutations/invoiceUpdateLines.mutation.ts
|
|
1234
|
-
function
|
|
1235
|
-
return
|
|
1240
|
+
function Zn() {
|
|
1241
|
+
return U({
|
|
1236
1242
|
queryFn: (e) => y.updateLines(e.params.invoiceUuid, e.body),
|
|
1237
1243
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
1238
1244
|
});
|
|
1239
1245
|
}
|
|
1240
1246
|
//#endregion
|
|
1241
1247
|
//#region src/modules/invoice/api/mutations/invoiceApplyDiscount.mutation.ts
|
|
1242
|
-
function
|
|
1243
|
-
return
|
|
1248
|
+
function Qn() {
|
|
1249
|
+
return U({
|
|
1244
1250
|
queryFn: (e) => y.applyDiscount(e.params.invoiceUuid, e.body),
|
|
1245
1251
|
queryKeysToInvalidate: { invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid } }
|
|
1246
1252
|
});
|
|
1247
1253
|
}
|
|
1248
1254
|
//#endregion
|
|
1249
1255
|
//#region src/modules/invoice/models/invoice/update/invoiceApplyDiscountForm.model.ts
|
|
1250
|
-
var
|
|
1251
|
-
currency:
|
|
1252
|
-
precision:
|
|
1253
|
-
type:
|
|
1254
|
-
value:
|
|
1255
|
-
}).refine((e) => e.type !== c.PERCENTAGE || e.value <= 100, { path: ["value"] }),
|
|
1256
|
+
var $n = O.object({
|
|
1257
|
+
currency: O.enum(s),
|
|
1258
|
+
precision: O.number().int().nonnegative(),
|
|
1259
|
+
type: O.enum(c),
|
|
1260
|
+
value: O.number()
|
|
1261
|
+
}).refine((e) => e.type !== c.PERCENTAGE || e.value <= 100, { path: ["value"] }), er = { class: "pr-md text-xs text-secondary" }, tr = /* @__PURE__ */ L({
|
|
1256
1262
|
__name: "InvoiceApplyDiscountDialog",
|
|
1257
1263
|
props: { invoice: {} },
|
|
1258
1264
|
emits: ["close"],
|
|
1259
1265
|
setup(e, { emit: t }) {
|
|
1260
|
-
let n = e, r = t, i =
|
|
1266
|
+
let n = e, r = t, i = k(), a = Q(), o = p(), s = Qn(), l = j(() => ln([c.PERCENTAGE, c.AMOUNT])), u = $({
|
|
1261
1267
|
initialState: {
|
|
1262
1268
|
currency: n.invoice.grossAmount.currency,
|
|
1263
1269
|
precision: n.invoice.grossAmount.precision,
|
|
1264
1270
|
type: c.PERCENTAGE,
|
|
1265
1271
|
value: null
|
|
1266
1272
|
},
|
|
1267
|
-
schema:
|
|
1273
|
+
schema: $n,
|
|
1268
1274
|
onSubmit: async (e) => {
|
|
1269
1275
|
let t = await s.execute({
|
|
1270
1276
|
body: e,
|
|
@@ -1279,58 +1285,58 @@ var Zn = D.object({
|
|
|
1279
1285
|
onSubmitError: () => {
|
|
1280
1286
|
a.unableToSave();
|
|
1281
1287
|
}
|
|
1282
|
-
}), d = u.register("value"), f = u.register("type"), m =
|
|
1288
|
+
}), d = u.register("value"), f = u.register("type"), m = j(() => f.modelValue.value === c.PERCENTAGE), h = j(() => f.modelValue.value === c.AMOUNT), g = j(() => o.getSymbol(n.invoice.grossAmount.currency));
|
|
1283
1289
|
function _(e) {
|
|
1284
1290
|
return i.t(`wise_invoicing.invoice.detail.global_discount.type.${e}`);
|
|
1285
1291
|
}
|
|
1286
|
-
return (e, t) => (
|
|
1287
|
-
form:
|
|
1292
|
+
return (e, t) => (z(), M(V(X), {
|
|
1293
|
+
form: V(u),
|
|
1288
1294
|
size: "sm",
|
|
1289
1295
|
onClose: t[0] ||= (e) => r("close")
|
|
1290
1296
|
}, {
|
|
1291
|
-
default:
|
|
1292
|
-
|
|
1293
|
-
title:
|
|
1294
|
-
description:
|
|
1295
|
-
icon:
|
|
1297
|
+
default: H(() => [
|
|
1298
|
+
I(V(Y), {
|
|
1299
|
+
title: V(i).t("wise_invoicing.invoice.detail.line_items.global_discount"),
|
|
1300
|
+
description: V(i).t("wise_invoicing.invoice.detail.global_discount.description"),
|
|
1301
|
+
icon: V(Te)
|
|
1296
1302
|
}, null, 8, [
|
|
1297
1303
|
"title",
|
|
1298
1304
|
"description",
|
|
1299
1305
|
"icon"
|
|
1300
1306
|
]),
|
|
1301
|
-
|
|
1302
|
-
default:
|
|
1303
|
-
default:
|
|
1307
|
+
I(V(Wt), null, {
|
|
1308
|
+
default: H(() => [I(V(Jt), null, {
|
|
1309
|
+
default: H(() => [I(V(qt), {
|
|
1304
1310
|
lg: 2,
|
|
1305
1311
|
sm: 1
|
|
1306
1312
|
}, {
|
|
1307
|
-
default:
|
|
1308
|
-
|
|
1313
|
+
default: H(() => [
|
|
1314
|
+
I(V($t), R(V(D)(V(f)), {
|
|
1309
1315
|
"display-fn": _,
|
|
1310
1316
|
"is-required": !0,
|
|
1311
1317
|
items: l.value,
|
|
1312
|
-
label:
|
|
1318
|
+
label: V(i).t("wise_invoicing.invoice.detail.global_discount.type.label")
|
|
1313
1319
|
}), null, 16, ["items", "label"]),
|
|
1314
|
-
m.value ? (
|
|
1315
|
-
hint:
|
|
1320
|
+
m.value ? (z(), M(V(Zt), R({ key: 0 }, V(D)(V(d)), {
|
|
1321
|
+
hint: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.hint"),
|
|
1316
1322
|
"is-required": !0,
|
|
1317
|
-
label:
|
|
1323
|
+
label: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
|
|
1318
1324
|
max: 100,
|
|
1319
1325
|
min: 0,
|
|
1320
1326
|
step: .01
|
|
1321
1327
|
}), {
|
|
1322
|
-
right:
|
|
1328
|
+
right: H(() => [...t[1] ||= [F("span", { class: "pr-md text-xs text-secondary" }, " % ", -1)]]),
|
|
1323
1329
|
_: 1
|
|
1324
|
-
}, 16, ["hint", "label"])) :
|
|
1325
|
-
h.value ? (
|
|
1330
|
+
}, 16, ["hint", "label"])) : N("", !0),
|
|
1331
|
+
h.value ? (z(), M(V(Zt), R({ key: 1 }, V(D)(V(d)), {
|
|
1326
1332
|
"is-required": !0,
|
|
1327
|
-
label:
|
|
1333
|
+
label: V(i).t("wise_invoicing.invoice.detail.global_discount.amount.label"),
|
|
1328
1334
|
min: .01,
|
|
1329
1335
|
step: .01
|
|
1330
1336
|
}), {
|
|
1331
|
-
right:
|
|
1337
|
+
right: H(() => [F("span", er, B(g.value.symbol), 1)]),
|
|
1332
1338
|
_: 1
|
|
1333
|
-
}, 16, ["label"])) :
|
|
1339
|
+
}, 16, ["label"])) : N("", !0)
|
|
1334
1340
|
]),
|
|
1335
1341
|
_: 1
|
|
1336
1342
|
})]),
|
|
@@ -1338,23 +1344,23 @@ var Zn = D.object({
|
|
|
1338
1344
|
})]),
|
|
1339
1345
|
_: 1
|
|
1340
1346
|
}),
|
|
1341
|
-
|
|
1342
|
-
right:
|
|
1347
|
+
I(V(q), null, {
|
|
1348
|
+
right: H(() => [I(V(J)), I(V(Gt), { label: V(i).t("wise_invoicing.invoice.detail.global_discount.confirm") }, null, 8, ["label"])]),
|
|
1343
1349
|
_: 1
|
|
1344
1350
|
})
|
|
1345
1351
|
]),
|
|
1346
1352
|
_: 1
|
|
1347
1353
|
}, 8, ["form"]));
|
|
1348
1354
|
}
|
|
1349
|
-
}),
|
|
1355
|
+
}), nr = /* @__PURE__ */ L({
|
|
1350
1356
|
__name: "InvoiceLineItemsTableSection",
|
|
1351
1357
|
props: {
|
|
1352
1358
|
customFieldDefinitions: {},
|
|
1353
1359
|
invoice: {}
|
|
1354
1360
|
},
|
|
1355
1361
|
setup(e) {
|
|
1356
|
-
let t = e, n =
|
|
1357
|
-
isSaving:
|
|
1362
|
+
let t = e, n = j(() => t.invoice), r = h(), i = Zn(), a = j(() => b.isEditable(t.invoice.status)), o = Ye({
|
|
1363
|
+
isSaving: j(() => i.isLoading.value),
|
|
1358
1364
|
billingDocument: () => n.value,
|
|
1359
1365
|
canEdit: a,
|
|
1360
1366
|
customFieldDefinitions: () => t.customFieldDefinitions,
|
|
@@ -1362,19 +1368,19 @@ var Zn = D.object({
|
|
|
1362
1368
|
body: e,
|
|
1363
1369
|
params: { invoiceUuid: t.invoice.uuid }
|
|
1364
1370
|
})
|
|
1365
|
-
}), s =
|
|
1371
|
+
}), s = dn().create(tr);
|
|
1366
1372
|
function c() {
|
|
1367
1373
|
s.open({ invoice: t.invoice });
|
|
1368
1374
|
}
|
|
1369
|
-
return
|
|
1370
|
-
default:
|
|
1371
|
-
|
|
1372
|
-
"show-apply-discount":
|
|
1375
|
+
return Ge(o), (e, n) => (z(), M($e, null, {
|
|
1376
|
+
default: H(() => [
|
|
1377
|
+
I(nt, {
|
|
1378
|
+
"show-apply-discount": V(r).isGlobalDiscountEnabled.value,
|
|
1373
1379
|
onApplyDiscount: c
|
|
1374
1380
|
}, null, 8, ["show-apply-discount"]),
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1381
|
+
I(We),
|
|
1382
|
+
I(He, { "billing-document": t.invoice }, null, 8, ["billing-document"]),
|
|
1383
|
+
I(it)
|
|
1378
1384
|
]),
|
|
1379
1385
|
_: 1
|
|
1380
1386
|
}));
|
|
@@ -1382,8 +1388,8 @@ var Zn = D.object({
|
|
|
1382
1388
|
});
|
|
1383
1389
|
//#endregion
|
|
1384
1390
|
//#region src/modules/invoice/api/mutations/invoiceCreateCreditNote.mutation.ts
|
|
1385
|
-
function
|
|
1386
|
-
return
|
|
1391
|
+
function rr() {
|
|
1392
|
+
return U({
|
|
1387
1393
|
queryFn: (e) => y.createCreditNote(e.params.invoiceUuid),
|
|
1388
1394
|
queryKeysToInvalidate: {
|
|
1389
1395
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1393,16 +1399,16 @@ function tr() {
|
|
|
1393
1399
|
}
|
|
1394
1400
|
//#endregion
|
|
1395
1401
|
//#region src/modules/invoice/api/mutations/invoiceDuplicate.mutation.ts
|
|
1396
|
-
function
|
|
1397
|
-
return
|
|
1402
|
+
function ir() {
|
|
1403
|
+
return U({
|
|
1398
1404
|
queryFn: (e) => y.duplicate(e.params.invoiceUuid),
|
|
1399
1405
|
queryKeysToInvalidate: { invoiceIndex: {} }
|
|
1400
1406
|
});
|
|
1401
1407
|
}
|
|
1402
1408
|
//#endregion
|
|
1403
1409
|
//#region src/modules/invoice/api/mutations/invoiceFinalize.mutation.ts
|
|
1404
|
-
function
|
|
1405
|
-
return
|
|
1410
|
+
function ar() {
|
|
1411
|
+
return U({
|
|
1406
1412
|
queryFn: (e) => y.finalize(e.params.invoiceUuid),
|
|
1407
1413
|
queryKeysToInvalidate: {
|
|
1408
1414
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1412,8 +1418,8 @@ function rr() {
|
|
|
1412
1418
|
}
|
|
1413
1419
|
//#endregion
|
|
1414
1420
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsDraft.mutation.ts
|
|
1415
|
-
function
|
|
1416
|
-
return
|
|
1421
|
+
function or() {
|
|
1422
|
+
return U({
|
|
1417
1423
|
queryFn: (e) => y.markAsDraft(e.params.invoiceUuid),
|
|
1418
1424
|
queryKeysToInvalidate: {
|
|
1419
1425
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1423,8 +1429,8 @@ function ir() {
|
|
|
1423
1429
|
}
|
|
1424
1430
|
//#endregion
|
|
1425
1431
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsPaid.mutation.ts
|
|
1426
|
-
function
|
|
1427
|
-
return
|
|
1432
|
+
function sr() {
|
|
1433
|
+
return U({
|
|
1428
1434
|
queryFn: (e) => y.markAsPaid(e.params.invoiceUuid),
|
|
1429
1435
|
queryKeysToInvalidate: {
|
|
1430
1436
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1434,8 +1440,8 @@ function ar() {
|
|
|
1434
1440
|
}
|
|
1435
1441
|
//#endregion
|
|
1436
1442
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsPriorApprovalRequired.mutation.ts
|
|
1437
|
-
function
|
|
1438
|
-
return
|
|
1443
|
+
function cr() {
|
|
1444
|
+
return U({
|
|
1439
1445
|
queryFn: (e) => y.markAsPriorApprovalRequired(e.params.invoiceUuid),
|
|
1440
1446
|
queryKeysToInvalidate: {
|
|
1441
1447
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1447,8 +1453,8 @@ function or() {
|
|
|
1447
1453
|
}
|
|
1448
1454
|
//#endregion
|
|
1449
1455
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsProtested.mutation.ts
|
|
1450
|
-
function
|
|
1451
|
-
return
|
|
1456
|
+
function lr() {
|
|
1457
|
+
return U({
|
|
1452
1458
|
queryFn: (e) => y.markAsProtested(e.params.invoiceUuid),
|
|
1453
1459
|
queryKeysToInvalidate: {
|
|
1454
1460
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1458,8 +1464,8 @@ function sr() {
|
|
|
1458
1464
|
}
|
|
1459
1465
|
//#endregion
|
|
1460
1466
|
//#region src/modules/invoice/api/mutations/invoiceMarkAsReady.mutation.ts
|
|
1461
|
-
function
|
|
1462
|
-
return
|
|
1467
|
+
function ur() {
|
|
1468
|
+
return U({
|
|
1463
1469
|
queryFn: (e) => y.markAsReady(e.params.invoiceUuid),
|
|
1464
1470
|
queryKeysToInvalidate: {
|
|
1465
1471
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1469,8 +1475,8 @@ function cr() {
|
|
|
1469
1475
|
}
|
|
1470
1476
|
//#endregion
|
|
1471
1477
|
//#region src/modules/invoice/api/mutations/invoiceSend.mutation.ts
|
|
1472
|
-
function
|
|
1473
|
-
return
|
|
1478
|
+
function dr() {
|
|
1479
|
+
return U({
|
|
1474
1480
|
queryFn: (e) => y.send(e.params.invoiceUuid),
|
|
1475
1481
|
queryKeysToInvalidate: {
|
|
1476
1482
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1480,8 +1486,8 @@ function lr() {
|
|
|
1480
1486
|
}
|
|
1481
1487
|
//#endregion
|
|
1482
1488
|
//#region src/modules/invoice/api/mutations/invoiceUnmarkAsPriorApprovalRequired.mutation.ts
|
|
1483
|
-
function
|
|
1484
|
-
return
|
|
1489
|
+
function fr() {
|
|
1490
|
+
return U({
|
|
1485
1491
|
queryFn: (e) => y.unmarkAsPriorApprovalRequired(e.params.invoiceUuid),
|
|
1486
1492
|
queryKeysToInvalidate: {
|
|
1487
1493
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1493,8 +1499,8 @@ function ur() {
|
|
|
1493
1499
|
}
|
|
1494
1500
|
//#endregion
|
|
1495
1501
|
//#region src/modules/invoice/api/mutations/invoiceWithdrawProtest.mutation.ts
|
|
1496
|
-
function
|
|
1497
|
-
return
|
|
1502
|
+
function pr() {
|
|
1503
|
+
return U({
|
|
1498
1504
|
queryFn: (e) => y.withdrawProtest(e.params.invoiceUuid),
|
|
1499
1505
|
queryKeysToInvalidate: {
|
|
1500
1506
|
invoiceDetail: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1504,8 +1510,8 @@ function dr() {
|
|
|
1504
1510
|
}
|
|
1505
1511
|
//#endregion
|
|
1506
1512
|
//#region src/modules/invoice/api/mutations/invoiceRestoreFromProForma.mutation.ts
|
|
1507
|
-
function
|
|
1508
|
-
return
|
|
1513
|
+
function mr() {
|
|
1514
|
+
return U({
|
|
1509
1515
|
queryFn: (e) => y.restoreFromProForma(e.params.invoiceUuid),
|
|
1510
1516
|
queryKeysToInvalidate: {
|
|
1511
1517
|
invoiceActivityLogIndex: { invoiceUuid: (e) => e.invoiceUuid },
|
|
@@ -1517,7 +1523,7 @@ function fr() {
|
|
|
1517
1523
|
}
|
|
1518
1524
|
//#endregion
|
|
1519
1525
|
//#region src/modules/invoice/use-cases/detail/dialogs/InvoiceApprovalRevertDialog.vue
|
|
1520
|
-
var
|
|
1526
|
+
var hr = /* @__PURE__ */ L({
|
|
1521
1527
|
__name: "InvoiceApprovalRevertDialog",
|
|
1522
1528
|
props: {
|
|
1523
1529
|
invoiceUuid: {},
|
|
@@ -1525,9 +1531,9 @@ var pr = /* @__PURE__ */ I({
|
|
|
1525
1531
|
},
|
|
1526
1532
|
emits: ["close", "reverted"],
|
|
1527
1533
|
setup(e, { emit: t }) {
|
|
1528
|
-
let n = e, r = t, i =
|
|
1534
|
+
let n = e, r = t, i = k(), a = Q(), o = T(), s = mr(), c = j(() => n.sentAt === null ? "" : o.toDate(n.sentAt)), l = $({
|
|
1529
1535
|
initialState: {},
|
|
1530
|
-
schema:
|
|
1536
|
+
schema: O.object({}),
|
|
1531
1537
|
onSubmit: async () => {
|
|
1532
1538
|
let e = await s.execute({ params: { invoiceUuid: n.invoiceUuid } });
|
|
1533
1539
|
if (e.isErr()) {
|
|
@@ -1540,22 +1546,22 @@ var pr = /* @__PURE__ */ I({
|
|
|
1540
1546
|
a.unableToSave();
|
|
1541
1547
|
}
|
|
1542
1548
|
});
|
|
1543
|
-
return (e, t) => (
|
|
1544
|
-
form:
|
|
1549
|
+
return (e, t) => (z(), M(V(X), {
|
|
1550
|
+
form: V(l),
|
|
1545
1551
|
size: "sm",
|
|
1546
1552
|
onClose: t[0] ||= (e) => r("close")
|
|
1547
1553
|
}, {
|
|
1548
|
-
default:
|
|
1549
|
-
title:
|
|
1550
|
-
description:
|
|
1551
|
-
icon:
|
|
1554
|
+
default: H(() => [I(V(Y), {
|
|
1555
|
+
title: V(i).t("wise_invoicing.invoice.approval_revert.title"),
|
|
1556
|
+
description: V(i).t("wise_invoicing.invoice.approval_revert.description", { date: c.value }),
|
|
1557
|
+
icon: V(ge),
|
|
1552
1558
|
"icon-variant": "warning"
|
|
1553
1559
|
}, null, 8, [
|
|
1554
1560
|
"title",
|
|
1555
1561
|
"description",
|
|
1556
1562
|
"icon"
|
|
1557
|
-
]),
|
|
1558
|
-
default:
|
|
1563
|
+
]), I(V(q), null, {
|
|
1564
|
+
default: H(() => [I(V(J)), I(V(Gt), { label: V(i).t("wise_invoicing.invoice.approval_revert.submit") }, null, 8, ["label"])]),
|
|
1559
1565
|
_: 1
|
|
1560
1566
|
})]),
|
|
1561
1567
|
_: 1
|
|
@@ -1564,21 +1570,21 @@ var pr = /* @__PURE__ */ I({
|
|
|
1564
1570
|
});
|
|
1565
1571
|
//#endregion
|
|
1566
1572
|
//#region src/modules/invoice/api/mutations/invoiceDelete.mutation.ts
|
|
1567
|
-
function
|
|
1568
|
-
return
|
|
1573
|
+
function gr() {
|
|
1574
|
+
return U({
|
|
1569
1575
|
queryFn: (e) => y.delete(e.params.invoiceUuid),
|
|
1570
1576
|
queryKeysToInvalidate: { invoiceIndex: {} }
|
|
1571
1577
|
});
|
|
1572
1578
|
}
|
|
1573
1579
|
//#endregion
|
|
1574
1580
|
//#region src/modules/invoice/use-cases/detail/dialogs/InvoiceDeleteDialog.vue
|
|
1575
|
-
var
|
|
1581
|
+
var _r = /* @__PURE__ */ L({
|
|
1576
1582
|
__name: "InvoiceDeleteDialog",
|
|
1577
1583
|
props: { invoice: {} },
|
|
1578
1584
|
emits: ["close", "deleted"],
|
|
1579
1585
|
setup(e, { emit: t }) {
|
|
1580
|
-
let n = e, r = t, i =
|
|
1581
|
-
schema:
|
|
1586
|
+
let n = e, r = t, i = k(), a = kt(), o = Q(), s = gr(), c = $({
|
|
1587
|
+
schema: mt.object({}),
|
|
1582
1588
|
onSubmit: async () => {
|
|
1583
1589
|
let e = await s.execute({ params: { invoiceUuid: n.invoice.uuid } });
|
|
1584
1590
|
if (e.isErr()) {
|
|
@@ -1588,25 +1594,25 @@ var hr = /* @__PURE__ */ I({
|
|
|
1588
1594
|
o.show({ message: i.t("wise_invoicing.invoice.delete.success_toast") }), r("deleted"), r("close"), await a.push({ name: "invoicing-invoice-overview" });
|
|
1589
1595
|
}
|
|
1590
1596
|
});
|
|
1591
|
-
return (e, t) => (
|
|
1592
|
-
form:
|
|
1597
|
+
return (e, t) => (z(), M(V(X), {
|
|
1598
|
+
form: V(c),
|
|
1593
1599
|
size: "xs",
|
|
1594
1600
|
onClose: t[0] ||= (e) => r("close")
|
|
1595
1601
|
}, {
|
|
1596
|
-
default:
|
|
1597
|
-
title:
|
|
1598
|
-
description:
|
|
1599
|
-
}, null, 8, ["title", "description"]),
|
|
1600
|
-
right:
|
|
1602
|
+
default: H(() => [I(V(Y), {
|
|
1603
|
+
title: V(i).t("wise_invoicing.invoice.delete.title"),
|
|
1604
|
+
description: V(i).t("wise_invoicing.invoice.delete.description")
|
|
1605
|
+
}, null, 8, ["title", "description"]), I(V(q), null, {
|
|
1606
|
+
right: H(() => [I(V(J), { label: "cancel" }), I(V(Gt), {
|
|
1601
1607
|
"is-destructive": !0,
|
|
1602
|
-
label:
|
|
1608
|
+
label: V(i).t("wise_invoicing.invoice.delete.submit_button")
|
|
1603
1609
|
}, null, 8, ["label"])]),
|
|
1604
1610
|
_: 1
|
|
1605
1611
|
})]),
|
|
1606
1612
|
_: 1
|
|
1607
1613
|
}, 8, ["form"]));
|
|
1608
1614
|
}
|
|
1609
|
-
}),
|
|
1615
|
+
}), vr = { class: "flex flex-col gap-lg px-2xl" }, yr = /* @__PURE__ */ L({
|
|
1610
1616
|
__name: "InvoiceFinalizeOutOfSyncDialog",
|
|
1611
1617
|
props: {
|
|
1612
1618
|
sentAt: {},
|
|
@@ -1620,7 +1626,7 @@ var hr = /* @__PURE__ */ I({
|
|
|
1620
1626
|
"viewProForma"
|
|
1621
1627
|
],
|
|
1622
1628
|
setup(e, { emit: t }) {
|
|
1623
|
-
let n = e, r = t, i =
|
|
1629
|
+
let n = e, r = t, i = k(), a = T(), o = yt(!1), s = j(() => n.sentAt === null ? "" : a.toDate(n.sentAt));
|
|
1624
1630
|
function c() {
|
|
1625
1631
|
r("finalizeAnyway"), r("close");
|
|
1626
1632
|
}
|
|
@@ -1630,52 +1636,52 @@ var hr = /* @__PURE__ */ I({
|
|
|
1630
1636
|
function u() {
|
|
1631
1637
|
r("sendNewRequest"), r("close");
|
|
1632
1638
|
}
|
|
1633
|
-
return (e, t) => (
|
|
1639
|
+
return (e, t) => (z(), M(V(Ut), {
|
|
1634
1640
|
size: "sm",
|
|
1635
1641
|
onClose: t[2] ||= (e) => r("close")
|
|
1636
1642
|
}, {
|
|
1637
|
-
default:
|
|
1638
|
-
|
|
1639
|
-
title:
|
|
1640
|
-
description:
|
|
1641
|
-
icon:
|
|
1643
|
+
default: H(() => [
|
|
1644
|
+
I(V(Y), {
|
|
1645
|
+
title: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.title"),
|
|
1646
|
+
description: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.description", { date: s.value }),
|
|
1647
|
+
icon: V(C),
|
|
1642
1648
|
"icon-variant": "warning"
|
|
1643
1649
|
}, null, 8, [
|
|
1644
1650
|
"title",
|
|
1645
1651
|
"description",
|
|
1646
1652
|
"icon"
|
|
1647
1653
|
]),
|
|
1648
|
-
|
|
1654
|
+
F("div", vr, [n.proFormaFile === null ? N("", !0) : (z(), M(V(Lt), {
|
|
1649
1655
|
key: 0,
|
|
1650
1656
|
class: "self-start"
|
|
1651
1657
|
}, {
|
|
1652
|
-
default:
|
|
1658
|
+
default: H(() => [F("button", {
|
|
1653
1659
|
class: "text-sm font-semibold text-brand-secondary underline-offset-2 hover:underline",
|
|
1654
1660
|
type: "button",
|
|
1655
1661
|
onClick: t[0] ||= (e) => r("viewProForma")
|
|
1656
|
-
},
|
|
1662
|
+
}, B(V(i).t("wise_invoicing.invoice.approval_banner.view_pro_forma")), 1)]),
|
|
1657
1663
|
_: 1
|
|
1658
|
-
})),
|
|
1664
|
+
})), I(V(It), {
|
|
1659
1665
|
modelValue: o.value,
|
|
1660
1666
|
"onUpdate:modelValue": t[1] ||= (e) => o.value = e,
|
|
1661
|
-
label:
|
|
1667
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.acknowledge")
|
|
1662
1668
|
}, null, 8, ["modelValue", "label"])]),
|
|
1663
|
-
|
|
1664
|
-
left:
|
|
1665
|
-
"icon-right":
|
|
1666
|
-
label:
|
|
1669
|
+
I(V(q), null, {
|
|
1670
|
+
left: H(() => [I(V(Ft), {
|
|
1671
|
+
"icon-right": V(x),
|
|
1672
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.send_new_request"),
|
|
1667
1673
|
variant: "tertiary",
|
|
1668
1674
|
onClick: u
|
|
1669
1675
|
}, null, 8, ["icon-right", "label"])]),
|
|
1670
|
-
right:
|
|
1671
|
-
label:
|
|
1676
|
+
right: H(() => [I(V(Ft), {
|
|
1677
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.revert_changes"),
|
|
1672
1678
|
variant: "secondary",
|
|
1673
1679
|
onClick: l
|
|
1674
|
-
}, null, 8, ["label"]),
|
|
1675
|
-
"disabled-reason": o.value ? null :
|
|
1680
|
+
}, null, 8, ["label"]), I(V(Ft), {
|
|
1681
|
+
"disabled-reason": o.value ? null : V(i).t("wise_invoicing.invoice.finalize_out_of_sync.acknowledge_required"),
|
|
1676
1682
|
"is-destructive": !0,
|
|
1677
1683
|
"is-disabled": !o.value,
|
|
1678
|
-
label:
|
|
1684
|
+
label: V(i).t("wise_invoicing.invoice.finalize_out_of_sync.finalize_anyway"),
|
|
1679
1685
|
variant: "primary",
|
|
1680
1686
|
onClick: c
|
|
1681
1687
|
}, null, 8, [
|
|
@@ -1689,36 +1695,36 @@ var hr = /* @__PURE__ */ I({
|
|
|
1689
1695
|
_: 1
|
|
1690
1696
|
}));
|
|
1691
1697
|
}
|
|
1692
|
-
}),
|
|
1698
|
+
}), br = "customer_has_no_approval_email", xr = /* @__PURE__ */ new Set([
|
|
1693
1699
|
a.AWAITING_APPROVAL,
|
|
1694
1700
|
a.EXPIRED,
|
|
1695
1701
|
a.REMINDER_1,
|
|
1696
1702
|
a.REMINDER_2
|
|
1697
1703
|
]);
|
|
1698
|
-
async function
|
|
1704
|
+
async function Sr(e) {
|
|
1699
1705
|
if (e === null) return;
|
|
1700
|
-
let t = await
|
|
1706
|
+
let t = await ct.getDownloadUrl(e.uuid);
|
|
1701
1707
|
t !== null && window.open(t, "_blank", "noopener");
|
|
1702
1708
|
}
|
|
1703
|
-
function
|
|
1704
|
-
let t =
|
|
1705
|
-
function
|
|
1706
|
-
return
|
|
1709
|
+
function Cr(e) {
|
|
1710
|
+
let t = k(), n = Q(), r = kt(), s = h(), c = dn(), l = c.create(_r), u = c.create(ft), p = c.create(dt), m = c.create(hr), g = c.create(lt), _ = c.create(yr), ee = c.create(Ue), v = dr(), te = rr(), ne = ir(), re = ar(), ie = or(), ae = sr(), oe = cr(), se = lr(), le = ur(), ue = ut(), fe = fr(), xe = pr(), { shouldSkipConfirmation: Ce } = ot(), S = yt(null), C = j(() => b.getMetadata(e.value.status)), we = j(() => S.value ?? e.value.isDisputed), Te = j(() => e.value.status !== o.DRAFT && e.value.status !== o.READY), Ee = j(() => e.value.lifecycleStatus === f.FINALIZED);
|
|
1711
|
+
function w(e) {
|
|
1712
|
+
return C.value.actions.includes(e);
|
|
1707
1713
|
}
|
|
1708
|
-
let
|
|
1714
|
+
let T = j(() => ke.getDisplayStatus({
|
|
1709
1715
|
approval: e.value.approval,
|
|
1710
1716
|
requiresPriorApproval: e.value.requiresPriorApproval
|
|
1711
|
-
})),
|
|
1712
|
-
let e =
|
|
1717
|
+
})), E = j(() => {
|
|
1718
|
+
let e = T.value;
|
|
1713
1719
|
return e === null || e === a.APPROVED ? null : e;
|
|
1714
|
-
}),
|
|
1715
|
-
async function
|
|
1720
|
+
}), D = j(() => E.value === null ? null : t.t("wise_invoicing.invoice.finalize.blocked_by_approval", { status: t.t(ke.getMetadata(E.value).translationKey) })), Ae = j(() => C.value.isEditable && !e.value.requiresPriorApproval), je = j(() => C.value.isEditable && e.value.requiresPriorApproval && !e.value.hasApprovalHistory), Me = j(() => C.value.isEditable && e.value.requiresPriorApproval && (T.value !== a.APPROVED || e.value.hasChangesSinceApprovalSent)), Ne = j(() => Me.value && w("finalize") && !e.value.hasApprovalHistory), Pe = j(() => C.value.isEditable && e.value.approval !== null && ke.canMarkAsApproved(e.value.approval.status)), Ie = j(() => C.value.isEditable && e.value.approvalUuid !== null && xr.has(T.value)), Le = j(() => T.value === a.APPROVED && e.value.hasChangesSinceApprovalSent), Re = j(() => C.value.isEditable && e.value.approval?.status === i.REQUESTED);
|
|
1721
|
+
async function ze() {
|
|
1716
1722
|
e.value.approvalUuid !== null && await g.open({
|
|
1717
1723
|
approvalUuid: e.value.approvalUuid,
|
|
1718
1724
|
invoiceUuid: e.value.uuid
|
|
1719
1725
|
});
|
|
1720
1726
|
}
|
|
1721
|
-
async function
|
|
1727
|
+
async function Be(t) {
|
|
1722
1728
|
await m.open({
|
|
1723
1729
|
invoiceUuid: e.value.uuid,
|
|
1724
1730
|
sentAt: e.value.approval?.sentAt ?? null,
|
|
@@ -1727,29 +1733,29 @@ function xr(e) {
|
|
|
1727
1733
|
}
|
|
1728
1734
|
});
|
|
1729
1735
|
}
|
|
1730
|
-
async function
|
|
1731
|
-
await
|
|
1736
|
+
async function Ve() {
|
|
1737
|
+
await Sr(e.value.approvalProFormaFile);
|
|
1732
1738
|
}
|
|
1733
|
-
async function
|
|
1739
|
+
async function He() {
|
|
1734
1740
|
e.value.approvalUuid !== null && await u.open({
|
|
1735
1741
|
approvalUuid: e.value.approvalUuid,
|
|
1736
1742
|
invoiceUuid: e.value.uuid
|
|
1737
1743
|
});
|
|
1738
1744
|
}
|
|
1739
|
-
async function
|
|
1745
|
+
async function We() {
|
|
1740
1746
|
e.value.approvalUuid !== null && await p.open({
|
|
1741
1747
|
approvalUuid: e.value.approvalUuid,
|
|
1742
1748
|
invoiceUuid: e.value.uuid
|
|
1743
1749
|
});
|
|
1744
1750
|
}
|
|
1745
|
-
async function
|
|
1746
|
-
let r = await
|
|
1751
|
+
async function Ge() {
|
|
1752
|
+
let r = await ue.execute({ params: {
|
|
1747
1753
|
invoiceUuid: e.value.uuid,
|
|
1748
1754
|
hasActiveApproval: e.value.approval !== null
|
|
1749
1755
|
} });
|
|
1750
1756
|
if (r.isErr()) {
|
|
1751
1757
|
let i = s.getCustomerDetailRoute(e.value.customer.uuid);
|
|
1752
|
-
if (
|
|
1758
|
+
if (wt.isExpectedApiError(r.error) && wt.getApiErrorCode(r.error) === br) {
|
|
1753
1759
|
n.show({
|
|
1754
1760
|
link: i === null ? void 0 : {
|
|
1755
1761
|
label: t.t("wise_invoicing.invoice.send_approval.view_customer_action"),
|
|
@@ -1768,114 +1774,114 @@ function xr(e) {
|
|
|
1768
1774
|
reference: e.value.sequence ?? e.value.subject ?? t.t("wise_invoicing.invoice.detail.fallback_title")
|
|
1769
1775
|
}) });
|
|
1770
1776
|
}
|
|
1771
|
-
async function
|
|
1772
|
-
let r = await
|
|
1777
|
+
async function Ke() {
|
|
1778
|
+
let r = await oe.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1773
1779
|
if (r.isErr()) {
|
|
1774
1780
|
n.apiError(r.error);
|
|
1775
1781
|
return;
|
|
1776
1782
|
}
|
|
1777
1783
|
n.show({ message: t.t("wise_invoicing.invoice.mark_as_needs_approval.success") });
|
|
1778
1784
|
}
|
|
1779
|
-
async function
|
|
1780
|
-
let r = await
|
|
1785
|
+
async function qe() {
|
|
1786
|
+
let r = await fe.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1781
1787
|
if (r.isErr()) {
|
|
1782
1788
|
n.apiError(r.error);
|
|
1783
1789
|
return;
|
|
1784
1790
|
}
|
|
1785
1791
|
n.show({ message: t.t("wise_invoicing.invoice.unmark_as_needs_approval.success") });
|
|
1786
1792
|
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1793
|
+
Ct(() => e.value.isDisputed, (e) => {
|
|
1794
|
+
S.value === e && (S.value = null);
|
|
1789
1795
|
});
|
|
1790
|
-
async function
|
|
1796
|
+
async function Je() {
|
|
1791
1797
|
let r = await re.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1792
1798
|
return r.isErr() ? (n.apiError(r.error), !1) : (n.show({ message: t.t("wise_invoicing.invoice.finalize.success") }), !0);
|
|
1793
1799
|
}
|
|
1794
|
-
async function
|
|
1795
|
-
if (
|
|
1800
|
+
async function Ye() {
|
|
1801
|
+
if (Le.value) {
|
|
1796
1802
|
await _.open({
|
|
1797
1803
|
sentAt: e.value.approval?.sentAt ?? null,
|
|
1798
1804
|
proFormaFile: e.value.approvalProFormaFile,
|
|
1799
1805
|
onFinalizeAnyway: () => {
|
|
1800
|
-
|
|
1806
|
+
Je();
|
|
1801
1807
|
},
|
|
1802
1808
|
onRevertChanges: () => {
|
|
1803
|
-
|
|
1804
|
-
|
|
1809
|
+
Be({ onReverted: () => {
|
|
1810
|
+
Je();
|
|
1805
1811
|
} });
|
|
1806
1812
|
},
|
|
1807
1813
|
onSendNewRequest: () => {
|
|
1808
|
-
|
|
1814
|
+
Ge();
|
|
1809
1815
|
},
|
|
1810
1816
|
onViewProForma: () => {
|
|
1811
|
-
|
|
1817
|
+
Ve();
|
|
1812
1818
|
}
|
|
1813
1819
|
});
|
|
1814
1820
|
return;
|
|
1815
1821
|
}
|
|
1816
|
-
if (
|
|
1817
|
-
await
|
|
1822
|
+
if (Ce.value) {
|
|
1823
|
+
await Je();
|
|
1818
1824
|
return;
|
|
1819
1825
|
}
|
|
1820
1826
|
await ee.open({
|
|
1821
1827
|
billingDocumentType: "invoice",
|
|
1822
|
-
onConfirm:
|
|
1828
|
+
onConfirm: Je
|
|
1823
1829
|
});
|
|
1824
1830
|
}
|
|
1825
|
-
async function
|
|
1826
|
-
let r = await
|
|
1831
|
+
async function Xe() {
|
|
1832
|
+
let r = await le.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1827
1833
|
if (r.isErr()) {
|
|
1828
1834
|
n.apiError(r.error);
|
|
1829
1835
|
return;
|
|
1830
1836
|
}
|
|
1831
1837
|
n.show({ message: t.t("wise_invoicing.invoice.mark_as_ready.success") });
|
|
1832
1838
|
}
|
|
1833
|
-
async function
|
|
1834
|
-
let r = await
|
|
1839
|
+
async function Ze() {
|
|
1840
|
+
let r = await ie.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1835
1841
|
if (r.isErr()) {
|
|
1836
1842
|
n.apiError(r.error);
|
|
1837
1843
|
return;
|
|
1838
1844
|
}
|
|
1839
1845
|
n.show({ message: t.t("wise_invoicing.invoice.mark_as_draft.success") });
|
|
1840
1846
|
}
|
|
1841
|
-
async function
|
|
1842
|
-
let r = await
|
|
1847
|
+
async function Qe() {
|
|
1848
|
+
let r = await ae.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1843
1849
|
if (r.isErr()) {
|
|
1844
1850
|
n.apiError(r.error);
|
|
1845
1851
|
return;
|
|
1846
1852
|
}
|
|
1847
1853
|
n.show({ message: t.t("wise_invoicing.invoice.mark_as_paid.success") });
|
|
1848
1854
|
}
|
|
1849
|
-
async function
|
|
1850
|
-
|
|
1851
|
-
let r = await
|
|
1855
|
+
async function $e() {
|
|
1856
|
+
S.value = !0;
|
|
1857
|
+
let r = await se.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1852
1858
|
if (r.isErr()) {
|
|
1853
|
-
|
|
1859
|
+
S.value = null, n.apiError(r.error);
|
|
1854
1860
|
return;
|
|
1855
1861
|
}
|
|
1856
1862
|
n.show({ message: t.t("wise_invoicing.invoice.mark_as_disputed.success") });
|
|
1857
1863
|
}
|
|
1858
|
-
async function
|
|
1859
|
-
|
|
1864
|
+
async function et() {
|
|
1865
|
+
S.value = !1;
|
|
1860
1866
|
let r = await xe.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1861
1867
|
if (r.isErr()) {
|
|
1862
|
-
|
|
1868
|
+
S.value = null, n.apiError(r.error);
|
|
1863
1869
|
return;
|
|
1864
1870
|
}
|
|
1865
1871
|
n.show({ message: t.t("wise_invoicing.invoice.withdraw_dispute.success") });
|
|
1866
1872
|
}
|
|
1867
|
-
async function
|
|
1873
|
+
async function tt() {
|
|
1868
1874
|
let r = await v.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1869
1875
|
if (r.isErr()) {
|
|
1870
1876
|
n.apiError(r.error);
|
|
1871
1877
|
return;
|
|
1872
1878
|
}
|
|
1873
|
-
|
|
1879
|
+
Fe.reflectBulkAction([e.value.uuid], { deliveryStatus: d.SENT }), n.show({ message: t.t("wise_invoicing.invoice.send.success") });
|
|
1874
1880
|
}
|
|
1875
|
-
async function
|
|
1881
|
+
async function nt() {
|
|
1876
1882
|
await l.open({ invoice: e.value });
|
|
1877
1883
|
}
|
|
1878
|
-
async function
|
|
1884
|
+
async function rt() {
|
|
1879
1885
|
let r = await y.getByUuid(e.value.uuid);
|
|
1880
1886
|
if (r.isErr()) {
|
|
1881
1887
|
n.apiError(r.error);
|
|
@@ -1886,10 +1892,10 @@ function xr(e) {
|
|
|
1886
1892
|
n.show({ message: t.t("wise_invoicing.invoice.download_pdf.generation_in_progress") });
|
|
1887
1893
|
return;
|
|
1888
1894
|
}
|
|
1889
|
-
let a = await
|
|
1890
|
-
a !== null &&
|
|
1895
|
+
let a = await ct.getDownloadUrl(i.uuid);
|
|
1896
|
+
a !== null && ce.downloadUrl(a, i.name);
|
|
1891
1897
|
}
|
|
1892
|
-
async function
|
|
1898
|
+
async function it() {
|
|
1893
1899
|
let i = await ne.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1894
1900
|
if (i.isErr()) {
|
|
1895
1901
|
n.apiError(i.error);
|
|
@@ -1908,7 +1914,7 @@ function xr(e) {
|
|
|
1908
1914
|
message: t.t("wise_invoicing.invoice.duplicate.success")
|
|
1909
1915
|
});
|
|
1910
1916
|
}
|
|
1911
|
-
async function
|
|
1917
|
+
async function at() {
|
|
1912
1918
|
let i = await te.execute({ params: { invoiceUuid: e.value.uuid } });
|
|
1913
1919
|
if (i.isErr()) {
|
|
1914
1920
|
n.apiError(i.error);
|
|
@@ -1927,74 +1933,74 @@ function xr(e) {
|
|
|
1927
1933
|
message: t.t("wise_invoicing.credit_note.create.success")
|
|
1928
1934
|
});
|
|
1929
1935
|
}
|
|
1930
|
-
let
|
|
1936
|
+
let st = j(() => [
|
|
1931
1937
|
{
|
|
1932
1938
|
isLoading: v.isLoading.value,
|
|
1933
|
-
iconLeft:
|
|
1939
|
+
iconLeft: x,
|
|
1934
1940
|
key: "send",
|
|
1935
1941
|
label: t.t("wise_invoicing.invoice.detail.actions.send"),
|
|
1936
1942
|
variant: "primary",
|
|
1937
1943
|
visible: e.value.status === o.FINALIZED,
|
|
1938
|
-
onClick:
|
|
1944
|
+
onClick: tt
|
|
1939
1945
|
},
|
|
1940
1946
|
{
|
|
1941
|
-
isLoading:
|
|
1942
|
-
iconRight:
|
|
1947
|
+
isLoading: le.isLoading.value,
|
|
1948
|
+
iconRight: Se,
|
|
1943
1949
|
key: "markAsReady",
|
|
1944
1950
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_ready"),
|
|
1945
|
-
visible:
|
|
1946
|
-
onClick:
|
|
1951
|
+
visible: w("markAsReady"),
|
|
1952
|
+
onClick: Xe
|
|
1947
1953
|
},
|
|
1948
1954
|
{
|
|
1949
1955
|
isLoading: !1,
|
|
1950
|
-
iconLeft:
|
|
1956
|
+
iconLeft: Oe,
|
|
1951
1957
|
key: "markAsApproved",
|
|
1952
1958
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_approved"),
|
|
1953
|
-
visible:
|
|
1954
|
-
onClick:
|
|
1959
|
+
visible: Pe.value,
|
|
1960
|
+
onClick: He
|
|
1955
1961
|
},
|
|
1956
1962
|
{
|
|
1957
|
-
isLoading:
|
|
1958
|
-
iconLeft:
|
|
1963
|
+
isLoading: ue.isLoading.value,
|
|
1964
|
+
iconLeft: x,
|
|
1959
1965
|
key: "sendApprovalRequest",
|
|
1960
1966
|
label: t.t("wise_invoicing.invoice.detail.actions.send_approval_request"),
|
|
1961
1967
|
variant: "primary",
|
|
1962
|
-
visible:
|
|
1963
|
-
onClick:
|
|
1968
|
+
visible: Ne.value,
|
|
1969
|
+
onClick: Ge
|
|
1964
1970
|
},
|
|
1965
1971
|
{
|
|
1966
|
-
isDisabled:
|
|
1972
|
+
isDisabled: E.value !== null,
|
|
1967
1973
|
isLoading: re.isLoading.value,
|
|
1968
|
-
disabledReason:
|
|
1969
|
-
iconLeft:
|
|
1974
|
+
disabledReason: D.value,
|
|
1975
|
+
iconLeft: pe,
|
|
1970
1976
|
key: "finalize",
|
|
1971
1977
|
label: t.t("wise_invoicing.invoice.detail.actions.finalize"),
|
|
1972
|
-
variant:
|
|
1973
|
-
visible:
|
|
1974
|
-
onClick:
|
|
1978
|
+
variant: E.value === null ? "primary" : "secondary",
|
|
1979
|
+
visible: w("finalize") && !Ne.value,
|
|
1980
|
+
onClick: Ye
|
|
1975
1981
|
}
|
|
1976
|
-
].filter((e) => e.visible)),
|
|
1982
|
+
].filter((e) => e.visible)), pt = j(() => {
|
|
1977
1983
|
let n = [
|
|
1978
1984
|
{
|
|
1979
|
-
icon:
|
|
1985
|
+
icon: De,
|
|
1980
1986
|
key: "markAsProtested",
|
|
1981
1987
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_disputed"),
|
|
1982
|
-
visible:
|
|
1983
|
-
onSelect:
|
|
1988
|
+
visible: Ee.value && !we.value,
|
|
1989
|
+
onSelect: $e
|
|
1984
1990
|
},
|
|
1985
1991
|
{
|
|
1986
|
-
icon:
|
|
1992
|
+
icon: Oe,
|
|
1987
1993
|
key: "markAsPaid",
|
|
1988
1994
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_paid"),
|
|
1989
|
-
visible:
|
|
1990
|
-
onSelect:
|
|
1995
|
+
visible: w("markAsPaid"),
|
|
1996
|
+
onSelect: Qe
|
|
1991
1997
|
},
|
|
1992
1998
|
{
|
|
1993
|
-
icon:
|
|
1999
|
+
icon: Se,
|
|
1994
2000
|
key: "withdrawProtest",
|
|
1995
2001
|
label: t.t("wise_invoicing.invoice.detail.actions.withdraw_dispute"),
|
|
1996
|
-
visible:
|
|
1997
|
-
onSelect:
|
|
2002
|
+
visible: Ee.value && we.value,
|
|
2003
|
+
onSelect: et
|
|
1998
2004
|
}
|
|
1999
2005
|
], r = [
|
|
2000
2006
|
o.FINALIZED,
|
|
@@ -2004,75 +2010,75 @@ function xr(e) {
|
|
|
2004
2010
|
o.PROTESTED
|
|
2005
2011
|
].includes(e.value.status), i = [
|
|
2006
2012
|
{
|
|
2007
|
-
icon:
|
|
2013
|
+
icon: he,
|
|
2008
2014
|
key: "downloadPdf",
|
|
2009
2015
|
label: t.t("wise_invoicing.common.download_pdf"),
|
|
2010
|
-
visible:
|
|
2011
|
-
onSelect:
|
|
2016
|
+
visible: Te.value,
|
|
2017
|
+
onSelect: rt
|
|
2012
2018
|
},
|
|
2013
2019
|
{
|
|
2014
|
-
icon:
|
|
2020
|
+
icon: ge,
|
|
2015
2021
|
key: "backToDraft",
|
|
2016
2022
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_draft"),
|
|
2017
|
-
visible:
|
|
2018
|
-
onSelect:
|
|
2023
|
+
visible: w("markAsDraft"),
|
|
2024
|
+
onSelect: Ze
|
|
2019
2025
|
},
|
|
2020
2026
|
{
|
|
2021
2027
|
icon: be,
|
|
2022
2028
|
key: "duplicate",
|
|
2023
2029
|
label: t.t("wise_invoicing.invoice.detail.actions.duplicate"),
|
|
2024
2030
|
visible: !0,
|
|
2025
|
-
onSelect:
|
|
2031
|
+
onSelect: it
|
|
2026
2032
|
},
|
|
2027
2033
|
{
|
|
2028
|
-
icon:
|
|
2034
|
+
icon: ye,
|
|
2029
2035
|
key: "rejectApproval",
|
|
2030
2036
|
label: t.t("wise_invoicing.invoice.detail.actions.reject_approval"),
|
|
2031
|
-
visible:
|
|
2032
|
-
onSelect:
|
|
2037
|
+
visible: Re.value,
|
|
2038
|
+
onSelect: We
|
|
2033
2039
|
},
|
|
2034
2040
|
{
|
|
2035
|
-
icon:
|
|
2041
|
+
icon: x,
|
|
2036
2042
|
key: "sendApprovalRequest",
|
|
2037
2043
|
label: t.t("wise_invoicing.invoice.detail.actions.send_approval_request"),
|
|
2038
|
-
visible:
|
|
2039
|
-
onSelect:
|
|
2044
|
+
visible: Me.value && !Ne.value,
|
|
2045
|
+
onSelect: Ge
|
|
2040
2046
|
},
|
|
2041
2047
|
{
|
|
2042
|
-
icon:
|
|
2048
|
+
icon: me,
|
|
2043
2049
|
key: "markAsNeedsApproval",
|
|
2044
2050
|
label: t.t("wise_invoicing.invoice.detail.actions.mark_as_needs_approval"),
|
|
2045
|
-
visible:
|
|
2046
|
-
onSelect:
|
|
2051
|
+
visible: Ae.value,
|
|
2052
|
+
onSelect: Ke
|
|
2047
2053
|
},
|
|
2048
2054
|
{
|
|
2049
|
-
icon:
|
|
2055
|
+
icon: ge,
|
|
2050
2056
|
key: "unmarkAsNeedsApproval",
|
|
2051
2057
|
label: t.t("wise_invoicing.invoice.detail.actions.unmark_as_needs_approval"),
|
|
2052
|
-
visible:
|
|
2053
|
-
onSelect:
|
|
2058
|
+
visible: je.value,
|
|
2059
|
+
onSelect: qe
|
|
2054
2060
|
}
|
|
2055
2061
|
], a = [
|
|
2056
2062
|
{
|
|
2057
|
-
icon:
|
|
2063
|
+
icon: de,
|
|
2058
2064
|
key: "archiveApproval",
|
|
2059
2065
|
label: t.t("wise_invoicing.invoice.detail.actions.archive_approval"),
|
|
2060
|
-
visible:
|
|
2061
|
-
onSelect:
|
|
2066
|
+
visible: Ie.value,
|
|
2067
|
+
onSelect: ze
|
|
2062
2068
|
},
|
|
2063
2069
|
{
|
|
2064
|
-
icon:
|
|
2070
|
+
icon: ve,
|
|
2065
2071
|
key: "createCreditNote",
|
|
2066
2072
|
label: t.t("wise_invoicing.invoice.detail.header.cancel_with_credit_note"),
|
|
2067
2073
|
visible: r,
|
|
2068
|
-
onSelect:
|
|
2074
|
+
onSelect: at
|
|
2069
2075
|
},
|
|
2070
2076
|
{
|
|
2071
|
-
icon:
|
|
2077
|
+
icon: _e,
|
|
2072
2078
|
key: "delete",
|
|
2073
2079
|
label: t.t("wise_invoicing.invoice.detail.actions.delete"),
|
|
2074
|
-
visible:
|
|
2075
|
-
onSelect:
|
|
2080
|
+
visible: C.value.isEditable,
|
|
2081
|
+
onSelect: nt
|
|
2076
2082
|
}
|
|
2077
2083
|
];
|
|
2078
2084
|
return [
|
|
@@ -2091,41 +2097,41 @@ function xr(e) {
|
|
|
2091
2097
|
].filter((e) => e.items.length > 0);
|
|
2092
2098
|
});
|
|
2093
2099
|
return {
|
|
2094
|
-
isActionMenuVisible:
|
|
2095
|
-
isDisputed:
|
|
2096
|
-
menuGroups:
|
|
2097
|
-
primaryButtons:
|
|
2098
|
-
onRevertApprovalChanges:
|
|
2099
|
-
onSendApprovalRequest:
|
|
2100
|
-
onViewProForma:
|
|
2100
|
+
isActionMenuVisible: j(() => pt.value.length > 0),
|
|
2101
|
+
isDisputed: we,
|
|
2102
|
+
menuGroups: pt,
|
|
2103
|
+
primaryButtons: st,
|
|
2104
|
+
onRevertApprovalChanges: Be,
|
|
2105
|
+
onSendApprovalRequest: Ge,
|
|
2106
|
+
onViewProForma: Ve
|
|
2101
2107
|
};
|
|
2102
2108
|
}
|
|
2103
2109
|
//#endregion
|
|
2104
2110
|
//#region src/modules/invoice/use-cases/detail/views/InvoiceDetailView.vue
|
|
2105
|
-
var
|
|
2111
|
+
var wr = /* @__PURE__ */ L({
|
|
2106
2112
|
__name: "InvoiceDetailView",
|
|
2107
2113
|
props: {
|
|
2108
2114
|
customFieldDefinitions: {},
|
|
2109
2115
|
invoice: {}
|
|
2110
2116
|
},
|
|
2111
2117
|
setup(e) {
|
|
2112
|
-
let t = e, n =
|
|
2118
|
+
let t = e, n = k(), r = yt(!1), i = j(() => ae.filterByView(t.customFieldDefinitions, re.INVOICE_DETAIL)), { isDisputed: a, menuGroups: o, primaryButtons: s, onRevertApprovalChanges: c, onSendApprovalRequest: l, onViewProForma: u } = Cr(j(() => t.invoice)), d = j(() => [{
|
|
2113
2119
|
label: n.t("wise_invoicing.invoice.overview.title"),
|
|
2114
2120
|
to: { name: "invoicing-invoice-overview" }
|
|
2115
2121
|
}, { label: t.invoice.sequence ?? t.invoice.subject ?? n.t("wise_invoicing.invoice.detail.fallback_title") }]);
|
|
2116
|
-
return (e,
|
|
2122
|
+
return (e, f) => (z(), M(tt, {
|
|
2117
2123
|
"billing-document": t.invoice,
|
|
2118
|
-
breadcrumbs:
|
|
2119
|
-
title:
|
|
2124
|
+
breadcrumbs: d.value,
|
|
2125
|
+
title: V(n).t("wise_invoicing.invoice.detail.fallback_title")
|
|
2120
2126
|
}, {
|
|
2121
|
-
header:
|
|
2127
|
+
header: H(() => [I(Sn, {
|
|
2122
2128
|
invoice: t.invoice,
|
|
2123
|
-
"is-disputed":
|
|
2124
|
-
"menu-groups":
|
|
2125
|
-
"primary-buttons":
|
|
2129
|
+
"is-disputed": V(a),
|
|
2130
|
+
"menu-groups": V(o),
|
|
2131
|
+
"primary-buttons": V(s),
|
|
2126
2132
|
"is-pdf-view-active": r.value,
|
|
2127
2133
|
class: "w-full",
|
|
2128
|
-
onTogglePdfView:
|
|
2134
|
+
onTogglePdfView: f[0] ||= (e) => r.value = !r.value
|
|
2129
2135
|
}, null, 8, [
|
|
2130
2136
|
"invoice",
|
|
2131
2137
|
"is-disputed",
|
|
@@ -2133,16 +2139,16 @@ var Sr = /* @__PURE__ */ I({
|
|
|
2133
2139
|
"primary-buttons",
|
|
2134
2140
|
"is-pdf-view-active"
|
|
2135
2141
|
])]),
|
|
2136
|
-
default:
|
|
2142
|
+
default: H(() => [V(b).isEditable(t.invoice.status) ? (z(), M(_n, {
|
|
2137
2143
|
key: 0,
|
|
2138
2144
|
approval: t.invoice.approval,
|
|
2139
2145
|
"is-out-of-sync": t.invoice.hasChangesSinceApprovalSent,
|
|
2140
2146
|
"pro-forma-file": t.invoice.approvalProFormaFile,
|
|
2141
2147
|
rejection: t.invoice.rejection,
|
|
2142
2148
|
class: "w-full",
|
|
2143
|
-
onRevertChanges:
|
|
2144
|
-
onSendNewRequest:
|
|
2145
|
-
onViewProForma:
|
|
2149
|
+
onRevertChanges: V(c),
|
|
2150
|
+
onSendNewRequest: V(l),
|
|
2151
|
+
onViewProForma: V(u)
|
|
2146
2152
|
}, null, 8, [
|
|
2147
2153
|
"approval",
|
|
2148
2154
|
"is-out-of-sync",
|
|
@@ -2151,31 +2157,31 @@ var Sr = /* @__PURE__ */ I({
|
|
|
2151
2157
|
"onRevertChanges",
|
|
2152
2158
|
"onSendNewRequest",
|
|
2153
2159
|
"onViewProForma"
|
|
2154
|
-
])) :
|
|
2160
|
+
])) : N("", !0), r.value ? (z(), M(Qe, {
|
|
2155
2161
|
key: 1,
|
|
2156
2162
|
"billing-document": t.invoice,
|
|
2157
2163
|
class: "w-full"
|
|
2158
|
-
}, null, 8, ["billing-document"])) : (
|
|
2159
|
-
|
|
2160
|
-
"custom-field-definitions":
|
|
2164
|
+
}, null, 8, ["billing-document"])) : (z(), P(A, { key: 2 }, [
|
|
2165
|
+
I(nr, {
|
|
2166
|
+
"custom-field-definitions": i.value,
|
|
2161
2167
|
invoice: t.invoice
|
|
2162
2168
|
}, null, 8, ["custom-field-definitions", "invoice"]),
|
|
2163
|
-
|
|
2169
|
+
V(b).isEditable(t.invoice.status) ? N("", !0) : (z(), M(Xn, {
|
|
2164
2170
|
key: 0,
|
|
2165
2171
|
invoice: t.invoice,
|
|
2166
2172
|
class: "w-full"
|
|
2167
2173
|
}, null, 8, ["invoice"])),
|
|
2168
|
-
|
|
2174
|
+
I(wn, {
|
|
2169
2175
|
invoice: t.invoice,
|
|
2170
2176
|
class: "w-full"
|
|
2171
2177
|
}, null, 8, ["invoice"]),
|
|
2172
|
-
|
|
2178
|
+
I(En, {
|
|
2173
2179
|
invoice: t.invoice,
|
|
2174
2180
|
class: "w-full"
|
|
2175
2181
|
}, null, 8, ["invoice"])
|
|
2176
2182
|
], 64))]),
|
|
2177
|
-
sidebar:
|
|
2178
|
-
"custom-field-definitions":
|
|
2183
|
+
sidebar: H(() => [I(Rn, {
|
|
2184
|
+
"custom-field-definitions": i.value,
|
|
2179
2185
|
invoice: t.invoice
|
|
2180
2186
|
}, null, 8, ["custom-field-definitions", "invoice"])]),
|
|
2181
2187
|
_: 1
|
|
@@ -2185,20 +2191,20 @@ var Sr = /* @__PURE__ */ I({
|
|
|
2185
2191
|
"title"
|
|
2186
2192
|
]));
|
|
2187
2193
|
}
|
|
2188
|
-
}),
|
|
2194
|
+
}), Tr = /* @__PURE__ */ L({
|
|
2189
2195
|
__name: "InvoiceDetailViewDataProvider",
|
|
2190
2196
|
props: { invoiceUuid: {} },
|
|
2191
2197
|
setup(e) {
|
|
2192
|
-
let t = e, n =
|
|
2198
|
+
let t = e, n = k(), r = j(() => [{
|
|
2193
2199
|
label: n.t("wise_invoicing.invoice.overview.title"),
|
|
2194
2200
|
to: { name: "invoicing-invoice-overview" }
|
|
2195
|
-
}]), i =
|
|
2196
|
-
return (e, t) => (
|
|
2197
|
-
"custom-field-definitions-query":
|
|
2198
|
-
query:
|
|
2201
|
+
}]), i = pt(j(() => t.invoiceUuid)), a = ie();
|
|
2202
|
+
return (e, t) => (z(), M(rt, {
|
|
2203
|
+
"custom-field-definitions-query": V(a),
|
|
2204
|
+
query: V(i),
|
|
2199
2205
|
"loading-breadcrumbs": r.value
|
|
2200
2206
|
}, {
|
|
2201
|
-
default:
|
|
2207
|
+
default: H(({ billingDocument: e, customFieldDefinitions: t }) => [I(wr, {
|
|
2202
2208
|
"custom-field-definitions": t,
|
|
2203
2209
|
invoice: e
|
|
2204
2210
|
}, null, 8, ["custom-field-definitions", "invoice"])]),
|
|
@@ -2211,4 +2217,4 @@ var Sr = /* @__PURE__ */ I({
|
|
|
2211
2217
|
}
|
|
2212
2218
|
});
|
|
2213
2219
|
//#endregion
|
|
2214
|
-
export {
|
|
2220
|
+
export { Tr as default };
|