@tesouro/embedded-components-react 0.3.20 → 0.3.22
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/index.css +9 -0
- package/dist/lib/monite-sdk.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index422.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +16 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index480.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index481.js +19 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index482.js +98 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index483.js +43 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index484.js +30 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index485.js +1 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index486.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index487.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index488.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index489.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index490.js +18 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index491.js +8 -105
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index492.js +102 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index493.js +36 -45
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index494.js +44 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +72 -100
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index496.js +99 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index497.js +35 -178
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index498.js +171 -125
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index499.js +134 -123
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index500.js +125 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index501.js +63 -232
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index502.js +248 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index504.js +5 -456
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index505.js +455 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +17 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +13 -49
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index508.js +51 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +46 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index510.js +13 -41
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index511.js +39 -144
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index512.js +143 -112
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index513.js +114 -39
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index514.js +33 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index515.js +32 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index516.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index517.js +19 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index518.js +20 -72
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index519.js +73 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index520.js +18 -172
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index521.js +149 -116
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index522.js +136 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +31 -115
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index524.js +116 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index525.js +10 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index526.js +46 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index527.js +13 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index528.js +21 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index529.js +26 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index530.js +36 -77
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index531.js +77 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index532.js +50 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index533.js +34 -89
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index534.js +86 -48
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index535.js +54 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index536.js +1 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index537.js +40 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index538.js +0 -135
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index539.js +129 -102
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index540.js +105 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index541.js +48 -779
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index542.js +780 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index543.js +84 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index544.js +105 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index545.js +6 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index546.js +23 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index548.js +2 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index549.js +25 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index550.js +14 -171
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index551.js +163 -200
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +204 -78
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +82 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +17 -158
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +146 -85
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +95 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +46 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +4 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +13 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +27 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +0 -186
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +186 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +0 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +41 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +5 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +20 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +74 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +16 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +19 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +11 -131
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +129 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +8 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +4 -221
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +219 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +12 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +32 -181
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +168 -189
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +192 -88
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +97 -61
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +63 -54
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +46 -83
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +91 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +39 -75
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +63 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +85 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +12 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +25 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +4 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +1 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +24 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +9 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index602.js +6 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index603.js +17 -68
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index604.js +66 -113
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index605.js +104 -64
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index606.js +72 -138
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index607.js +144 -28
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index608.js +28 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js +14 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js +91 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js +3 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js +22 -67
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js +71 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js +0 -65
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +66 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js +2 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +33 -15
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index619.js +14 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index620.js +29 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index621.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index622.js +2 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index623.js +97 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Scope as e } from "../../shared/data-access/dist/lib/scopes.js";
|
|
2
|
+
import "../../shared/data-access/dist/index.js";
|
|
3
|
+
import { useMoniteContext as t } from "./index47.js";
|
|
4
|
+
import { Button as n } from "./index56.js";
|
|
5
|
+
import { getDraftInvoiceValidationSchema as r, getInvoiceValidationSchema as i } from "./index98.js";
|
|
6
|
+
import { useUserPermissions as a } from "./index116.js";
|
|
7
|
+
import { useMeasureUnitsMapping as o } from "./index165.js";
|
|
8
|
+
import { useGetRecurrenceById as s } from "./index168.js";
|
|
9
|
+
import { willRecurrenceIssue as c } from "./index190.js";
|
|
10
|
+
import { buildEditInvoiceFormValues as l } from "./index197.js";
|
|
11
|
+
import "./index202.js";
|
|
12
|
+
import { LoadingPage as u } from "./index260.js";
|
|
13
|
+
import "./index261.js";
|
|
14
|
+
import { useGetMeasureUnits as d } from "./index458.js";
|
|
15
|
+
import { useReceivableSubmit as f } from "./index459.js";
|
|
16
|
+
import { ReceivableFormLayout as p } from "./index512.js";
|
|
17
|
+
import { useCallback as m, useEffect as h, useMemo as g, useRef as _ } from "react";
|
|
18
|
+
import { Fragment as v, jsx as y, jsxs as b } from "@emotion/react/jsx-runtime";
|
|
19
|
+
import { useLingui as x } from "@lingui/react";
|
|
20
|
+
import { useForm as S } from "react-hook-form";
|
|
21
|
+
import { zodResolver as C } from "@hookform/resolvers/zod";
|
|
3
22
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index524.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
variant: "body2",
|
|
10
|
-
color: "muted",
|
|
11
|
-
className: "ttw:w-40 ttw:shrink-0",
|
|
12
|
-
children: r
|
|
13
|
-
}), /* @__PURE__ */ t(e, {
|
|
14
|
-
component: "span",
|
|
15
|
-
variant: "body2",
|
|
16
|
-
className: "ttw:whitespace-pre-line",
|
|
17
|
-
children: i
|
|
18
|
-
})]
|
|
23
|
+
var w = (e) => {
|
|
24
|
+
let { data: t, isLoading: n } = s(e.invoice.recurrence_id);
|
|
25
|
+
return e.invoice.recurrence_id && n ? /* @__PURE__ */ y(u, {}) : /* @__PURE__ */ y(T, {
|
|
26
|
+
...e,
|
|
27
|
+
recurrence: t
|
|
19
28
|
});
|
|
20
|
-
}
|
|
29
|
+
}, T = ({ invoice: s, onCancel: u, onUpdated: w, isOpen: T, recurrence: E, issueIntent: D, embeddedBankName: O }) => {
|
|
30
|
+
let { i18n: k } = x(), { componentSettings: A } = t(), j = a().has(e.CounterpartWriteOrg), M = !!A?.receivables?.enableEntityBankAccount, N = _("draft"), { data: P } = d(), F = s.currency, I = g(() => l(s, E), [s, E]), L = g(() => E?.iterations?.filter((e) => e.issued_invoice_id).length ?? 0, [E?.iterations]), R = g(() => C(r(k, j, L)), [
|
|
31
|
+
k,
|
|
32
|
+
j,
|
|
33
|
+
L
|
|
34
|
+
]), z = g(() => C(i(k, M, j, L)), [
|
|
35
|
+
k,
|
|
36
|
+
M,
|
|
37
|
+
j,
|
|
38
|
+
L
|
|
39
|
+
]), B = m((e, t, n) => (N.current === "issue" || c(e) && L === 0 ? z : R)(e, t, n), [
|
|
40
|
+
z,
|
|
41
|
+
R,
|
|
42
|
+
L
|
|
43
|
+
]), V = S({
|
|
44
|
+
mode: "onBlur",
|
|
45
|
+
resolver: B,
|
|
46
|
+
defaultValues: I
|
|
47
|
+
}), { getValues: H, reset: U } = V;
|
|
48
|
+
o(P, H, U);
|
|
49
|
+
let W = !!E?.iterations?.some((e) => e.issued_invoice_id), G = f({
|
|
50
|
+
mode: "edit",
|
|
51
|
+
methods: V,
|
|
52
|
+
currency: F,
|
|
53
|
+
invoice: s,
|
|
54
|
+
submitModeRef: N,
|
|
55
|
+
existingRecurrence: E ? {
|
|
56
|
+
id: E.id,
|
|
57
|
+
scheduleLocked: W
|
|
58
|
+
} : void 0,
|
|
59
|
+
hasStartedRecurrence: L > 0,
|
|
60
|
+
onComplete: (e) => w(e.receivable, {
|
|
61
|
+
inlineLineItems: e.inlineLineItems,
|
|
62
|
+
activatedRecurrence: e.mode === "recurrence",
|
|
63
|
+
issued: e.mode === "issue",
|
|
64
|
+
counterpartId: e.counterpartId,
|
|
65
|
+
hasCustomerEmail: e.hasCustomerEmail
|
|
66
|
+
}),
|
|
67
|
+
onClose: u
|
|
68
|
+
});
|
|
69
|
+
return h(() => {
|
|
70
|
+
D && G.highlightForIssue();
|
|
71
|
+
}, []), /* @__PURE__ */ y(p, {
|
|
72
|
+
open: T,
|
|
73
|
+
onRequestClose: G.requestClose,
|
|
74
|
+
methods: V,
|
|
75
|
+
title: k._("Edit invoice"),
|
|
76
|
+
currency: F,
|
|
77
|
+
embeddedBankName: O,
|
|
78
|
+
showPurchaseOrder: !1,
|
|
79
|
+
lockRecurrenceSchedule: W,
|
|
80
|
+
formName: G.formName,
|
|
81
|
+
onSubmit: G.onSubmit,
|
|
82
|
+
formScrollRef: G.formScrollRef,
|
|
83
|
+
registerLineItemCleanupFn: G.registerLineItemCleanupFn,
|
|
84
|
+
onAttachmentsUploadingChange: G.onAttachmentsUploadingChange,
|
|
85
|
+
disabled: G.isLoading,
|
|
86
|
+
closeDisabled: G.isSaving,
|
|
87
|
+
discardModal: G.discardModal,
|
|
88
|
+
footer: /* @__PURE__ */ b(v, { children: [
|
|
89
|
+
/* @__PURE__ */ y(n, {
|
|
90
|
+
variant: "outline",
|
|
91
|
+
className: "ttw:border-border",
|
|
92
|
+
onClick: G.requestClose,
|
|
93
|
+
disabled: G.isSaving || G.attachmentsUploading,
|
|
94
|
+
children: k._("Cancel")
|
|
95
|
+
}),
|
|
96
|
+
!G.isRecurrenceEnabled && /* @__PURE__ */ y(n, {
|
|
97
|
+
variant: "secondary",
|
|
98
|
+
type: "submit",
|
|
99
|
+
form: G.formName,
|
|
100
|
+
disabled: G.isLoading || G.attachmentsUploading,
|
|
101
|
+
onClick: () => {
|
|
102
|
+
G.submitModeRef.current = "draft";
|
|
103
|
+
},
|
|
104
|
+
children: k._("Update draft")
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ y(n, {
|
|
107
|
+
type: "submit",
|
|
108
|
+
form: G.formName,
|
|
109
|
+
disabled: G.isLoading || G.attachmentsUploading || G.isIssuePreflightLoading || !G.isRecurrenceEnabled && G.isCustomerEmailLoading,
|
|
110
|
+
onClick: () => {
|
|
111
|
+
G.submitModeRef.current = G.isRecurrenceEnabled ? "draft" : "issue";
|
|
112
|
+
},
|
|
113
|
+
children: G.isRecurrenceEnabled ? E ? k._("Update recurring billing schedule") : k._("Activate recurring billing schedule") : k._("Issue invoice")
|
|
114
|
+
}, "next")
|
|
115
|
+
] })
|
|
116
|
+
});
|
|
117
|
+
};
|
|
21
118
|
//#endregion
|
|
22
|
-
export {
|
|
119
|
+
export { w as EditInvoiceDetails };
|
|
@@ -1,48 +1,22 @@
|
|
|
1
1
|
import { Typography as e } from "./index62.js";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
|
|
4
3
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index525.js
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
onClick: o,
|
|
10
|
-
"aria-haspopup": "dialog",
|
|
11
|
-
className: `ttw:group ttw:w-full ttw:cursor-pointer ttw:rounded-sm ttw:text-left ttw:outline-none ttw:focus-visible:ring-ring/50 ttw:focus-visible:ring-[3px] ${s}`,
|
|
12
|
-
children: [
|
|
13
|
-
/* @__PURE__ */ n(e, {
|
|
14
|
-
component: "span",
|
|
15
|
-
variant: "body2",
|
|
16
|
-
color: "muted",
|
|
17
|
-
className: "ttw:w-40 ttw:shrink-0",
|
|
18
|
-
children: i
|
|
19
|
-
}),
|
|
20
|
-
/* @__PURE__ */ n(e, {
|
|
21
|
-
component: "span",
|
|
22
|
-
variant: "body2",
|
|
23
|
-
color: "primary",
|
|
24
|
-
className: "ttw:underline-offset-4 ttw:group-hover:underline",
|
|
25
|
-
children: a
|
|
26
|
-
}),
|
|
27
|
-
/* @__PURE__ */ n(t, {
|
|
28
|
-
className: "ttw:ml-auto ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
29
|
-
"aria-hidden": "true"
|
|
30
|
-
})
|
|
31
|
-
]
|
|
32
|
-
}) : /* @__PURE__ */ r("div", {
|
|
33
|
-
className: s,
|
|
34
|
-
children: [/* @__PURE__ */ n(e, {
|
|
4
|
+
function r({ label: r, value: i }) {
|
|
5
|
+
return /* @__PURE__ */ n("div", {
|
|
6
|
+
className: "ttw:flex ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:last:border-b-0",
|
|
7
|
+
children: [/* @__PURE__ */ t(e, {
|
|
35
8
|
component: "span",
|
|
36
9
|
variant: "body2",
|
|
37
10
|
color: "muted",
|
|
38
11
|
className: "ttw:w-40 ttw:shrink-0",
|
|
39
|
-
children:
|
|
40
|
-
}), /* @__PURE__ */
|
|
12
|
+
children: r
|
|
13
|
+
}), /* @__PURE__ */ t(e, {
|
|
41
14
|
component: "span",
|
|
42
15
|
variant: "body2",
|
|
43
|
-
|
|
16
|
+
className: "ttw:whitespace-pre-line",
|
|
17
|
+
children: i
|
|
44
18
|
})]
|
|
45
19
|
});
|
|
46
20
|
}
|
|
47
21
|
//#endregion
|
|
48
|
-
export {
|
|
22
|
+
export { r as InvoiceDetailsInfoRow };
|
|
@@ -1,16 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Typography as e } from "./index62.js";
|
|
2
|
+
import { ChevronRight as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "@emotion/react/jsx-runtime";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index526.js
|
|
5
|
-
|
|
6
|
-
let
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
function i({ label: i, name: a, onOpenCounterpart: o }) {
|
|
6
|
+
let s = "ttw:flex ttw:items-center ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:last:border-b-0";
|
|
7
|
+
return o ? /* @__PURE__ */ r("button", {
|
|
8
|
+
type: "button",
|
|
9
|
+
onClick: o,
|
|
10
|
+
"aria-haspopup": "dialog",
|
|
11
|
+
className: `ttw:group ttw:w-full ttw:cursor-pointer ttw:rounded-sm ttw:text-left ttw:outline-none ttw:focus-visible:ring-ring/50 ttw:focus-visible:ring-[3px] ${s}`,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ n(e, {
|
|
14
|
+
component: "span",
|
|
15
|
+
variant: "body2",
|
|
16
|
+
color: "muted",
|
|
17
|
+
className: "ttw:w-40 ttw:shrink-0",
|
|
18
|
+
children: i
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ n(e, {
|
|
21
|
+
component: "span",
|
|
22
|
+
variant: "body2",
|
|
23
|
+
color: "primary",
|
|
24
|
+
className: "ttw:underline-offset-4 ttw:group-hover:underline",
|
|
25
|
+
children: a
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ n(t, {
|
|
28
|
+
className: "ttw:ml-auto ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
}) : /* @__PURE__ */ r("div", {
|
|
33
|
+
className: s,
|
|
34
|
+
children: [/* @__PURE__ */ n(e, {
|
|
35
|
+
component: "span",
|
|
36
|
+
variant: "body2",
|
|
37
|
+
color: "muted",
|
|
38
|
+
className: "ttw:w-40 ttw:shrink-0",
|
|
39
|
+
children: i
|
|
40
|
+
}), /* @__PURE__ */ n(e, {
|
|
41
|
+
component: "span",
|
|
42
|
+
variant: "body2",
|
|
43
|
+
children: a
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
15
47
|
//#endregion
|
|
16
|
-
export {
|
|
48
|
+
export { i as InvoiceDetailsCustomerRow };
|
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import { useCancelReceivableById as n } from "./index526.js";
|
|
5
|
-
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
6
|
-
import { useLingui as i } from "@lingui/react";
|
|
1
|
+
import { useMoniteContext as e } from "./index47.js";
|
|
2
|
+
import { toast as t } from "react-hot-toast";
|
|
3
|
+
import { useLingui as n } from "@lingui/react";
|
|
7
4
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index527.js
|
|
8
|
-
var
|
|
9
|
-
let { i18n:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
cancelLabel: c._("Close"),
|
|
18
|
-
onClose: s,
|
|
19
|
-
onConfirm: () => {
|
|
20
|
-
d.mutate(void 0, { onSuccess: s });
|
|
21
|
-
},
|
|
22
|
-
isLoading: d.isPending || u
|
|
23
|
-
});
|
|
5
|
+
var r = (r) => {
|
|
6
|
+
let { i18n: i } = n(), { api: a, queryClient: o } = e();
|
|
7
|
+
return a.finops.postReceivablesIdCancel.useMutation({ path: { receivable_id: r } }, { onSuccess: async () => {
|
|
8
|
+
let e = a.finops.getReceivablesId.getQueryData({ path: { receivable_id: r } }, o);
|
|
9
|
+
e?.type === "invoice" && a.finops.getReceivablesId.setQueryData({ path: { receivable_id: r } }, {
|
|
10
|
+
...e,
|
|
11
|
+
status: "canceled"
|
|
12
|
+
}, o), await a.finops.getReceivables.invalidateQueries(o), t.success(i._("This {type} has been canceled", { type: e?.type === "credit_note" ? "credit memo" : e?.type }));
|
|
13
|
+
} });
|
|
24
14
|
};
|
|
25
15
|
//#endregion
|
|
26
|
-
export {
|
|
16
|
+
export { r as useCancelReceivableById };
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import { useComponentSettings as t } from "./index215.js";
|
|
4
|
-
import { ConfirmationModal as n } from "./index59.js";
|
|
1
|
+
import { useGetReceivableById as e } from "./index141.js";
|
|
2
|
+
import { ConfirmationModal as t } from "./index59.js";
|
|
5
3
|
import "./index60.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { toast as o } from "react-hot-toast";
|
|
10
|
-
import { useLingui as s } from "@lingui/react";
|
|
4
|
+
import { useCancelReceivableById as n } from "./index527.js";
|
|
5
|
+
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
6
|
+
import { useLingui as i } from "@lingui/react";
|
|
11
7
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index528.js
|
|
12
|
-
var
|
|
13
|
-
let { i18n:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
isLoading:
|
|
8
|
+
var a = ({ invoiceId: a, open: o, onClose: s }) => {
|
|
9
|
+
let { i18n: c } = i(), { data: l, isLoading: u } = e(a), d = n(a);
|
|
10
|
+
if (!l) return null;
|
|
11
|
+
let f = l.document_id ? c._("Cancel receivable") + ` "${l?.document_id}"?` : c._("Cancel receivable?");
|
|
12
|
+
return /* @__PURE__ */ r(t, {
|
|
13
|
+
open: o && !!a,
|
|
14
|
+
title: f,
|
|
15
|
+
message: c._("This action can't be undone."),
|
|
16
|
+
confirmLabel: c._("Cancel"),
|
|
17
|
+
cancelLabel: c._("Close"),
|
|
18
|
+
onClose: s,
|
|
19
|
+
onConfirm: () => {
|
|
20
|
+
d.mutate(void 0, { onSuccess: s });
|
|
21
|
+
},
|
|
22
|
+
isLoading: d.isPending || u
|
|
27
23
|
});
|
|
28
24
|
};
|
|
29
25
|
//#endregion
|
|
30
|
-
export {
|
|
26
|
+
export { a as InvoiceCancelModal };
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { Scope as e } from "../../shared/data-access/dist/lib/scopes.js";
|
|
2
|
+
import "../../shared/data-access/dist/index.js";
|
|
3
|
+
import { useComponentSettings as t } from "./index215.js";
|
|
4
|
+
import { ConfirmationModal as n } from "./index59.js";
|
|
5
|
+
import "./index60.js";
|
|
6
|
+
import { useUserPermissions as r } from "./index116.js";
|
|
7
|
+
import { useDeleteReceivableById as i } from "./index157.js";
|
|
8
|
+
import { jsx as a } from "@emotion/react/jsx-runtime";
|
|
9
|
+
import { toast as o } from "react-hot-toast";
|
|
10
|
+
import { useLingui as s } from "@lingui/react";
|
|
8
11
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index529.js
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
completed: "ttw:border-green-100 ttw:bg-green-700"
|
|
25
|
-
}
|
|
26
|
-
} }), s = ({ status: a, className: s, showBadgeBackground: c = !0, dotSize: l, ref: u }) => {
|
|
27
|
-
let { i18n: d } = i();
|
|
28
|
-
return /* @__PURE__ */ r(n, {
|
|
29
|
-
ref: u,
|
|
30
|
-
className: e("ttw:inline-flex ttw:items-center ttw:gap-1", o({ variant: a }), s),
|
|
31
|
-
dotClassName: o({ dotVariant: a }),
|
|
32
|
-
showBadgeBackground: c,
|
|
33
|
-
showDotBorder: !c,
|
|
34
|
-
dotSize: l,
|
|
35
|
-
showDot: !0,
|
|
36
|
-
children: t(d, a)
|
|
12
|
+
var c = ({ open: c, onClose: l, invoiceId: u, onDelete: d, documentId: f }) => {
|
|
13
|
+
let { i18n: p } = s(), { receivablesCallbacks: m } = t(), { mutate: h, isPending: g } = i(u), _ = r().has(e.InvoiceWriteOrg), v = () => {
|
|
14
|
+
_ ? h(void 0, { onSuccess: () => {
|
|
15
|
+
m?.onDelete?.(u), d?.(), l();
|
|
16
|
+
} }) : o.error(p._("You don't have permission to delete this document. Please, contact your system administrator for details."));
|
|
17
|
+
}, y = f ? p._("Delete receivable “{documentId}”?", { documentId: f }) : p._("Delete receivable?");
|
|
18
|
+
return /* @__PURE__ */ a(n, {
|
|
19
|
+
open: c,
|
|
20
|
+
title: y,
|
|
21
|
+
message: p._("This action can't be undone."),
|
|
22
|
+
confirmLabel: p._("Delete"),
|
|
23
|
+
cancelLabel: p._("Cancel"),
|
|
24
|
+
onClose: l,
|
|
25
|
+
onConfirm: v,
|
|
26
|
+
isLoading: g
|
|
37
27
|
});
|
|
38
28
|
};
|
|
39
29
|
//#endregion
|
|
40
|
-
export {
|
|
30
|
+
export { c as InvoiceDeleteModal };
|
|
@@ -1,81 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { parseISO as o } from "date-fns";
|
|
9
|
-
import { jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
|
|
10
|
-
import { useLingui as l } from "@lingui/react";
|
|
11
|
-
import { twMerge as u } from "tailwind-merge";
|
|
1
|
+
import { cn as e } from "./index49.js";
|
|
2
|
+
import { getCommonRecurrenceIterationStatusLabel as t } from "./index177.js";
|
|
3
|
+
import "./index202.js";
|
|
4
|
+
import { Badge as n } from "./index223.js";
|
|
5
|
+
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
6
|
+
import { useLingui as i } from "@lingui/react";
|
|
7
|
+
import { cva as a } from "class-variance-authority";
|
|
12
8
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index530.js
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
]
|
|
43
|
-
});
|
|
44
|
-
}, f = ({ invoice: e, recurrence: t, openInvoiceDetails: n }) => {
|
|
45
|
-
let { i18n: r } = l();
|
|
46
|
-
return /* @__PURE__ */ c("table", {
|
|
47
|
-
className: "ttw:w-full",
|
|
48
|
-
children: [/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
49
|
-
/* @__PURE__ */ s("th", {
|
|
50
|
-
className: "ttw:text-left ttw:h-10 ttw:pr-2 ttw:text-sm ttw:font-medium ttw:leading-5",
|
|
51
|
-
children: r._("Issue date")
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ s("th", {
|
|
54
|
-
className: "ttw:text-left ttw:h-10 ttw:px-2 ttw:text-sm ttw:font-medium ttw:leading-5",
|
|
55
|
-
children: r._("Amount")
|
|
56
|
-
}),
|
|
57
|
-
/* @__PURE__ */ s("th", {
|
|
58
|
-
className: "ttw:text-left ttw:h-10 ttw:px-2 ttw:text-sm ttw:font-medium ttw:leading-5",
|
|
59
|
-
children: r._("Status")
|
|
60
|
-
}),
|
|
61
|
-
/* @__PURE__ */ s("th", {
|
|
62
|
-
className: "ttw:text-left ttw:h-10 ttw:px-2 ttw:text-sm ttw:font-medium ttw:leading-5",
|
|
63
|
-
children: r._("Number")
|
|
64
|
-
}),
|
|
65
|
-
/* @__PURE__ */ s("th", {
|
|
66
|
-
className: "ttw:h-10 ttw:w-6 ttw:pl-2",
|
|
67
|
-
"aria-hidden": "true"
|
|
68
|
-
})
|
|
69
|
-
] }) }), /* @__PURE__ */ s("tbody", { children: t?.iterations?.map((t, i) => /* @__PURE__ */ s(d, {
|
|
70
|
-
iteration: t,
|
|
71
|
-
invoice: e,
|
|
72
|
-
i18n: r,
|
|
73
|
-
onRowClick: n
|
|
74
|
-
}, r._("iteration-{iteration}-{index}", {
|
|
75
|
-
iteration: t?.iteration,
|
|
76
|
-
index: i
|
|
77
|
-
}))) })]
|
|
9
|
+
var o = a("", { variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
pending: "ttw:bg-zinc-100 ttw:text-zinc-700",
|
|
12
|
+
skipped: "ttw:bg-yellow-100 ttw:text-yellow-700",
|
|
13
|
+
canceled: "ttw:bg-red-100 ttw:text-red-700",
|
|
14
|
+
issue_failed: "ttw:bg-red-100 ttw:text-red-700",
|
|
15
|
+
send_failed: "ttw:bg-red-100 ttw:text-red-700",
|
|
16
|
+
completed: "ttw:bg-green-100 ttw:text-green-700"
|
|
17
|
+
},
|
|
18
|
+
dotVariant: {
|
|
19
|
+
pending: "ttw:border-zinc-100 ttw:bg-zinc-700",
|
|
20
|
+
skipped: "ttw:border-yellow-100 ttw:bg-yellow-700",
|
|
21
|
+
canceled: "ttw:border-red-100 ttw:bg-red-700",
|
|
22
|
+
issue_failed: "ttw:border-red-100 ttw:bg-red-700",
|
|
23
|
+
send_failed: "ttw:border-red-100 ttw:bg-red-700",
|
|
24
|
+
completed: "ttw:border-green-100 ttw:bg-green-700"
|
|
25
|
+
}
|
|
26
|
+
} }), s = ({ status: a, className: s, showBadgeBackground: c = !0, dotSize: l, ref: u }) => {
|
|
27
|
+
let { i18n: d } = i();
|
|
28
|
+
return /* @__PURE__ */ r(n, {
|
|
29
|
+
ref: u,
|
|
30
|
+
className: e("ttw:inline-flex ttw:items-center ttw:gap-1", o({ variant: a }), s),
|
|
31
|
+
dotClassName: o({ dotVariant: a }),
|
|
32
|
+
showBadgeBackground: c,
|
|
33
|
+
showDotBorder: !c,
|
|
34
|
+
dotSize: l,
|
|
35
|
+
showDot: !0,
|
|
36
|
+
children: t(d, a)
|
|
78
37
|
});
|
|
79
38
|
};
|
|
80
39
|
//#endregion
|
|
81
|
-
export {
|
|
40
|
+
export { s as InvoiceRecurrenceIterationStatusChip };
|