@tesouro/embedded-components-react 0.2.281 → 0.2.283
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 +17 -6
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +42 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +69 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +21 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +46 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +81 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +46 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +5 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +43 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +1 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +11 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +127 -76
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +7 -112
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +85 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +16 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +50 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +25 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +86 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +89 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +31 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +80 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +20 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +228 -6
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +13 -15
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +53 -11
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +3445 -3413
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -743,6 +743,9 @@
|
|
|
743
743
|
.ttw\:h-28 {
|
|
744
744
|
height: calc(var(--ttw-spacing) * 28);
|
|
745
745
|
}
|
|
746
|
+
.ttw\:h-32 {
|
|
747
|
+
height: calc(var(--ttw-spacing) * 32);
|
|
748
|
+
}
|
|
746
749
|
.ttw\:h-36\.5 {
|
|
747
750
|
height: calc(var(--ttw-spacing) * 36.5);
|
|
748
751
|
}
|
|
@@ -1127,9 +1130,6 @@
|
|
|
1127
1130
|
.ttw\:w-120 {
|
|
1128
1131
|
width: calc(var(--ttw-spacing) * 120);
|
|
1129
1132
|
}
|
|
1130
|
-
.ttw\:w-140 {
|
|
1131
|
-
width: calc(var(--ttw-spacing) * 140);
|
|
1132
|
-
}
|
|
1133
1133
|
.ttw\:w-150 {
|
|
1134
1134
|
width: calc(var(--ttw-spacing) * 150);
|
|
1135
1135
|
}
|
|
@@ -1834,6 +1834,9 @@
|
|
|
1834
1834
|
.ttw\:gap-y-0\.5 {
|
|
1835
1835
|
row-gap: calc(var(--ttw-spacing) * 0.5);
|
|
1836
1836
|
}
|
|
1837
|
+
.ttw\:gap-y-1 {
|
|
1838
|
+
row-gap: var(--ttw-spacing);
|
|
1839
|
+
}
|
|
1837
1840
|
.ttw\:gap-y-2 {
|
|
1838
1841
|
row-gap: calc(var(--ttw-spacing) * 2);
|
|
1839
1842
|
}
|
|
@@ -3855,6 +3858,9 @@
|
|
|
3855
3858
|
width: calc(var(--ttw-spacing) * 3);
|
|
3856
3859
|
height: calc(var(--ttw-spacing) * 3);
|
|
3857
3860
|
}
|
|
3861
|
+
.ttw\:group-data-\[state\=closed\]\:-rotate-90:is(:where(.ttw\:group)[data-state="closed"] *) {
|
|
3862
|
+
rotate: calc(90deg * -1);
|
|
3863
|
+
}
|
|
3858
3864
|
.ttw\:group-data-\[state\=open\]\:rotate-180:is(:where(.ttw\:group)[data-state="open"] *) {
|
|
3859
3865
|
rotate: 180deg;
|
|
3860
3866
|
}
|
|
@@ -4467,6 +4473,14 @@
|
|
|
4467
4473
|
.ttw\:focus-visible\:ring-offset-background:focus-visible {
|
|
4468
4474
|
--tw-ring-offset-color: var(--ttw-background);
|
|
4469
4475
|
}
|
|
4476
|
+
.ttw\:focus-visible\:outline-hidden:focus-visible {
|
|
4477
|
+
--tw-outline-style: none;
|
|
4478
|
+
outline-style: none;
|
|
4479
|
+
@media (forced-colors: active) {
|
|
4480
|
+
outline: 2px solid transparent;
|
|
4481
|
+
outline-offset: 2px;
|
|
4482
|
+
}
|
|
4483
|
+
}
|
|
4470
4484
|
.ttw\:focus-visible\:outline-1:focus-visible {
|
|
4471
4485
|
outline-style: var(--tw-outline-style);
|
|
4472
4486
|
outline-width: 1px;
|
|
@@ -5314,9 +5328,6 @@
|
|
|
5314
5328
|
.ttw\:sm\:max-w-2xl {
|
|
5315
5329
|
max-width: var(--ttw-container-2xl);
|
|
5316
5330
|
}
|
|
5317
|
-
.ttw\:sm\:max-w-140 {
|
|
5318
|
-
max-width: calc(var(--ttw-spacing) * 140);
|
|
5319
|
-
}
|
|
5320
5331
|
.ttw\:sm\:max-w-150 {
|
|
5321
5332
|
max-width: calc(var(--ttw-spacing) * 150);
|
|
5322
5333
|
}
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import "./lib/AcceptDisclosuresWidget.js";
|
|
|
16
16
|
import { BankAccountsWidget as C } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
|
|
17
17
|
import "./lib/BankAccountsWidget.js";
|
|
18
18
|
import { CounterpartsWidget as w } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
|
|
19
|
-
import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
19
|
+
import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js";
|
|
20
20
|
import "./lib/BillPayWidget.js";
|
|
21
21
|
import { CardDetailsWidget as E } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
|
|
22
22
|
import { CardFormatValue as D } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
1
|
+
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
|
|
3
3
|
export { e as BillPayWidget };
|
|
@@ -3,14 +3,18 @@ import "./index8.js";
|
|
|
3
3
|
import "./index10.js";
|
|
4
4
|
import "./index12.js";
|
|
5
5
|
import "./index13.js";
|
|
6
|
+
import "./index14.js";
|
|
7
|
+
import "./index15.js";
|
|
8
|
+
import "./index16.js";
|
|
6
9
|
import "./index17.js";
|
|
7
|
-
import "./
|
|
8
|
-
import "./index20.js";
|
|
9
|
-
import "./index21.js";
|
|
10
|
-
import "./index22.js";
|
|
10
|
+
import "./index18.js";
|
|
11
11
|
import "./index23.js";
|
|
12
12
|
import "./index24.js";
|
|
13
13
|
import "./index25.js";
|
|
14
14
|
import "./index26.js";
|
|
15
|
-
import
|
|
15
|
+
import "./index27.js";
|
|
16
|
+
import "./index28.js";
|
|
17
|
+
import "./index29.js";
|
|
18
|
+
import "./index30.js";
|
|
19
|
+
import { BillPayWidget as e } from "./index34.js";
|
|
16
20
|
export { e as BillPayWidget };
|
|
@@ -2,66 +2,69 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { calculateTotal as e, displayLineAmount as t } from "./index6.js";
|
|
6
|
-
import { emptyLineItem as
|
|
7
|
-
import { useCallback as
|
|
5
|
+
import { calculateTotal as e, displayLineAmount as t, parseMoneyToMinorUnits as n } from "./index6.js";
|
|
6
|
+
import { emptyLineItem as r, mapPayableToBillForm as i } from "./index9.js";
|
|
7
|
+
import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
function l(e, r, i) {
|
|
10
|
+
return n(r) === null ? i : t(e, r);
|
|
11
|
+
}
|
|
12
|
+
function u({ payable: t, lineItems: n } = {}) {
|
|
13
|
+
let u = s(() => i({
|
|
14
|
+
payable: t ?? {},
|
|
15
|
+
lineItems: n ?? []
|
|
16
|
+
}), [t, n]), [d, f] = c(u.values), [p, m] = c(u.lineItems), [h, g] = c(u.discount), [_, v] = c(u.tax), [y, b] = c(u.total || void 0), [x, S] = c(), [C, w] = c(), [T, E] = c(!1), [D, O] = c(!1), [k, A] = c(!1);
|
|
17
|
+
o(() => {
|
|
15
18
|
T || f(u.values);
|
|
16
|
-
}, [u]),
|
|
19
|
+
}, [u]), o(() => {
|
|
17
20
|
D || m(u.lineItems);
|
|
18
|
-
}, [u]),
|
|
19
|
-
k || (g(u.discount), v(u.tax));
|
|
21
|
+
}, [u]), o(() => {
|
|
22
|
+
k || (g(u.discount), v(u.tax), b(u.total || void 0));
|
|
20
23
|
}, [u]);
|
|
21
|
-
let j =
|
|
24
|
+
let j = a((e) => {
|
|
22
25
|
f((t) => ({
|
|
23
26
|
...t,
|
|
24
27
|
...e
|
|
25
28
|
})), E(!0);
|
|
26
|
-
}, []), M =
|
|
29
|
+
}, []), M = a((e) => {
|
|
27
30
|
w((t) => {
|
|
28
31
|
if (!t?.[e]) return t;
|
|
29
32
|
let n = { ...t };
|
|
30
33
|
return delete n[e], Object.keys(n).length ? n : void 0;
|
|
31
34
|
});
|
|
32
|
-
}, []), N =
|
|
33
|
-
M(e), m((
|
|
34
|
-
if (
|
|
35
|
-
let
|
|
36
|
-
...
|
|
37
|
-
...
|
|
35
|
+
}, []), N = a((e, t) => {
|
|
36
|
+
M(e), m((n) => n.map((n) => {
|
|
37
|
+
if (n.id !== e) return n;
|
|
38
|
+
let r = {
|
|
39
|
+
...n,
|
|
40
|
+
...t
|
|
38
41
|
};
|
|
39
|
-
return "amount" in
|
|
40
|
-
...
|
|
41
|
-
amount:
|
|
42
|
+
return "amount" in t ? r : {
|
|
43
|
+
...r,
|
|
44
|
+
amount: l(r.quantity, r.price, r.amount)
|
|
42
45
|
};
|
|
43
46
|
})), O(!0), b(void 0);
|
|
44
|
-
}, [M]), P =
|
|
45
|
-
M(e), m((
|
|
46
|
-
if (
|
|
47
|
-
let
|
|
47
|
+
}, [M]), P = a((e, t) => {
|
|
48
|
+
M(e), m((n) => n.map((n) => {
|
|
49
|
+
if (n.id !== e) return n;
|
|
50
|
+
let r = Number.parseFloat(n.quantity), i = String(Math.max(1, (Number.isFinite(r) ? r : 1) + t));
|
|
48
51
|
return {
|
|
49
|
-
...
|
|
50
|
-
quantity:
|
|
51
|
-
amount:
|
|
52
|
+
...n,
|
|
53
|
+
quantity: i,
|
|
54
|
+
amount: l(i, n.price, n.amount)
|
|
52
55
|
};
|
|
53
56
|
})), O(!0), b(void 0);
|
|
54
|
-
}, [M]), F =
|
|
57
|
+
}, [M]), F = a((e) => {
|
|
55
58
|
M(e), m((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), O(!0), b(void 0);
|
|
56
|
-
}, [M]), I =
|
|
57
|
-
m((e) => [...e,
|
|
58
|
-
}, []), L =
|
|
59
|
+
}, [M]), I = a(() => {
|
|
60
|
+
m((e) => [...e, r()]), O(!0), b(void 0);
|
|
61
|
+
}, []), L = a((e) => {
|
|
59
62
|
g(e), A(!0), b(void 0);
|
|
60
|
-
}, []), R =
|
|
63
|
+
}, []), R = a((e) => {
|
|
61
64
|
v(e), A(!0), b(void 0);
|
|
62
|
-
}, []), z =
|
|
65
|
+
}, []), z = a((e) => {
|
|
63
66
|
b(e), A(!0);
|
|
64
|
-
}, []), B =
|
|
67
|
+
}, []), B = s(() => p.map((e) => ({
|
|
65
68
|
...e,
|
|
66
69
|
onChange: (t) => N(e.id, t),
|
|
67
70
|
onQuantityStep: (t) => P(e.id, t),
|
|
@@ -71,7 +74,7 @@ function c({ payable: c, lineItems: l } = {}) {
|
|
|
71
74
|
N,
|
|
72
75
|
F,
|
|
73
76
|
P
|
|
74
|
-
]), V =
|
|
77
|
+
]), V = s(() => e(p, _, h), [
|
|
75
78
|
p,
|
|
76
79
|
_,
|
|
77
80
|
h
|
|
@@ -98,4 +101,4 @@ function c({ payable: c, lineItems: l } = {}) {
|
|
|
98
101
|
};
|
|
99
102
|
}
|
|
100
103
|
//#endregion
|
|
101
|
-
export {
|
|
104
|
+
export { u as useBillForm };
|
|
@@ -19,79 +19,94 @@ import { billCreateTestIds as u } from "./index11.js";
|
|
|
19
19
|
import { useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
|
|
20
20
|
import { jsx as h } from "react/jsx-runtime";
|
|
21
21
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js
|
|
22
|
-
function g({ open: g, onOpenChange: _, payableId: v,
|
|
23
|
-
let
|
|
22
|
+
function g({ open: g, onOpenChange: _, payableId: v, readOnly: y, copy: b }) {
|
|
23
|
+
let x = {
|
|
24
24
|
...t,
|
|
25
|
-
...
|
|
26
|
-
}, [
|
|
27
|
-
payable:
|
|
28
|
-
lineItems:
|
|
29
|
-
}),
|
|
25
|
+
...b
|
|
26
|
+
}, [S, C] = m(), [w, T] = m(!1), [E, D] = m(!1), [O, k] = m(), A = v ?? O, j = r(A, { pollWhileOcrProcessing: !0 }), M = n(A), N = e(), P = j.data, F = a({
|
|
27
|
+
payable: P,
|
|
28
|
+
lineItems: M.lineItems
|
|
29
|
+
}), I = P?.counterpart_id;
|
|
30
30
|
f(() => {
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
}, []),
|
|
31
|
+
w || I && (C(I), T(!0));
|
|
32
|
+
}, [w, I]);
|
|
33
|
+
let L = d((e) => {
|
|
34
|
+
T(!0), C(e);
|
|
35
|
+
}, []), R = i({
|
|
36
36
|
payableId: v,
|
|
37
|
-
form:
|
|
38
|
-
counterpartId:
|
|
39
|
-
onPayableCreated:
|
|
40
|
-
onSaved:
|
|
37
|
+
form: F,
|
|
38
|
+
counterpartId: S,
|
|
39
|
+
onPayableCreated: k,
|
|
40
|
+
onSaved: k,
|
|
41
41
|
onDraftSaved: () => _(!1),
|
|
42
42
|
onFinalized: () => _(!1)
|
|
43
|
-
}), R = p(() => (
|
|
43
|
+
}), z = !!(R.isSavingDraft || R.isFinalizing), B = p(() => (N.data?.data ?? []).map((e) => ({
|
|
44
44
|
value: e.id,
|
|
45
45
|
label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
|
|
46
|
-
})), [
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
})), [N.data]), V = P?.source_of_payable_data === "ocr", H = P?.counterpart_raw_data?.name, U = d(() => {
|
|
47
|
+
!y && F.isDirty && !window.confirm(x.discardConfirm) || _(!1);
|
|
48
|
+
}, [
|
|
49
|
+
x.discardConfirm,
|
|
50
|
+
F.isDirty,
|
|
51
|
+
_,
|
|
52
|
+
y
|
|
53
|
+
]), W = d((e) => {
|
|
54
|
+
if (!z) return e ? _(!0) : U();
|
|
55
|
+
}, [
|
|
56
|
+
U,
|
|
57
|
+
z,
|
|
58
|
+
_
|
|
59
|
+
]), G = l({
|
|
60
|
+
payableId: A,
|
|
61
|
+
counterpartId: S,
|
|
62
|
+
payableCounterpartId: I,
|
|
63
|
+
onCounterpartChange: L,
|
|
64
|
+
requiredError: F.errors?.vendor
|
|
53
65
|
});
|
|
54
66
|
return /* @__PURE__ */ h(o, {
|
|
55
67
|
open: g,
|
|
56
|
-
onOpenChange:
|
|
57
|
-
title:
|
|
58
|
-
notice:
|
|
68
|
+
onOpenChange: W,
|
|
69
|
+
title: y ? x.readOnlyTitle : V && H ? x.extractedTitle(H) : x.newTitle,
|
|
70
|
+
notice: V && !E ? /* @__PURE__ */ h(s, { onDismiss: () => D(!0) }) : void 0,
|
|
59
71
|
vendor: {
|
|
60
|
-
...
|
|
72
|
+
...G,
|
|
61
73
|
testId: u.vendorSection
|
|
62
74
|
},
|
|
63
|
-
values:
|
|
64
|
-
errors:
|
|
65
|
-
onChange:
|
|
75
|
+
values: F.values,
|
|
76
|
+
errors: F.errors,
|
|
77
|
+
onChange: F.onChange,
|
|
66
78
|
lineItems: {
|
|
67
|
-
items:
|
|
68
|
-
glCodeOptions:
|
|
69
|
-
discount:
|
|
70
|
-
onDiscountChange:
|
|
71
|
-
tax:
|
|
72
|
-
onTaxChange:
|
|
73
|
-
total:
|
|
74
|
-
onTotalChange:
|
|
75
|
-
onAddLineItem:
|
|
76
|
-
errors:
|
|
79
|
+
items: F.lineItemRows,
|
|
80
|
+
glCodeOptions: B,
|
|
81
|
+
discount: F.discount,
|
|
82
|
+
onDiscountChange: F.onDiscountChange,
|
|
83
|
+
tax: F.tax,
|
|
84
|
+
onTaxChange: F.onTaxChange,
|
|
85
|
+
total: F.total,
|
|
86
|
+
onTotalChange: F.onTotalChange,
|
|
87
|
+
onAddLineItem: F.onAddLineItem,
|
|
88
|
+
errors: F.lineItemErrors,
|
|
77
89
|
testId: u.lineItems
|
|
78
90
|
},
|
|
79
91
|
documentPanel: /* @__PURE__ */ h(c, {
|
|
80
|
-
payableId:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
payableId: A,
|
|
93
|
+
readOnly: y,
|
|
94
|
+
isDocumentPending: !!A && !P?.file && (j.isLoading || P?.ocr_status === "processing"),
|
|
95
|
+
file: P?.file ? {
|
|
96
|
+
id: P.file.id,
|
|
97
|
+
name: P.file.name,
|
|
98
|
+
url: P.file.url,
|
|
99
|
+
mimetype: P.file.mimetype
|
|
87
100
|
} : void 0
|
|
88
101
|
}),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
readOnly: y,
|
|
103
|
+
isLineItemsLoading: M.isResolving,
|
|
104
|
+
isSaving: z,
|
|
105
|
+
isSavingDraft: R.isSavingDraft,
|
|
106
|
+
isFinalizing: R.isFinalizing,
|
|
107
|
+
onCancel: U,
|
|
108
|
+
onSaveDraft: R.saveDraft,
|
|
109
|
+
onFinalize: R.finalize,
|
|
95
110
|
testId: u.dialog
|
|
96
111
|
});
|
|
97
112
|
}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
+
import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index36.js";
|
|
2
|
+
import "../../ui/dist/index.js";
|
|
1
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js
|
|
2
|
-
var
|
|
4
|
+
var t = {
|
|
5
|
+
subtitle: "Accounts payable",
|
|
6
|
+
vendorRow: "Vendor",
|
|
7
|
+
bankAccountRow: "ACH bank account",
|
|
8
|
+
bankAccountValue: (e) => `Account ending in ${e}`,
|
|
9
|
+
invoiceNumberRow: "Number",
|
|
10
|
+
issueDateRow: "Issue date",
|
|
11
|
+
dueDateRow: "Due date",
|
|
12
|
+
poNumberRow: "PO number",
|
|
13
|
+
notProvided: "Not provided",
|
|
14
|
+
glCodeMissing: "GL code not specified",
|
|
15
|
+
quantityValue: (e, t) => `${e} x ${t}`,
|
|
16
|
+
subtotalRow: "Subtotal",
|
|
17
|
+
discountsRow: "Discounts",
|
|
18
|
+
taxRow: "Tax",
|
|
19
|
+
totalRow: "Total",
|
|
20
|
+
sheet: e
|
|
21
|
+
};
|
|
3
22
|
//#endregion
|
|
4
|
-
export {
|
|
23
|
+
export { t as BILL_DETAILS_LABELS_EN };
|
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
6
|
-
import "../../../shared/feature/dist/index.js";
|
|
7
|
-
import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index14.js";
|
|
8
|
-
import { Payables as r } from "../../../monite-sdk/dist/index431.js";
|
|
9
|
-
import "../../../monite-sdk/dist/index.js";
|
|
10
|
-
import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
|
|
11
|
-
import "../../../shared/monite-wrapper/feature/dist/index.js";
|
|
12
|
-
import { useEffect as a } from "react";
|
|
13
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
14
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
var e = /* @__PURE__ */ new Set([
|
|
3
|
+
"new",
|
|
4
|
+
"approve_in_progress",
|
|
5
|
+
"waiting_to_be_paid",
|
|
6
|
+
"partially_paid"
|
|
7
|
+
]);
|
|
8
|
+
function t(e, t) {
|
|
9
|
+
let n = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`), r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
|
|
10
|
+
return n.getTime() < r;
|
|
21
11
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
12
|
+
function n(n, r, i = /* @__PURE__ */ new Date()) {
|
|
13
|
+
if (e.has(n) && r && t(r, i)) return {
|
|
14
|
+
status: "overdue",
|
|
15
|
+
tone: "danger"
|
|
16
|
+
};
|
|
17
|
+
switch (n) {
|
|
18
|
+
case "draft": return {
|
|
19
|
+
status: "draft",
|
|
20
|
+
tone: "neutral"
|
|
21
|
+
};
|
|
22
|
+
case "new":
|
|
23
|
+
case "approve_in_progress": return {
|
|
24
|
+
status: "pending_approval",
|
|
25
|
+
tone: "warning"
|
|
26
|
+
};
|
|
27
|
+
case "waiting_to_be_paid": return {
|
|
28
|
+
status: "ready_to_pay",
|
|
29
|
+
tone: "info"
|
|
30
|
+
};
|
|
31
|
+
case "partially_paid": return {
|
|
32
|
+
status: "partially_paid",
|
|
33
|
+
tone: "success"
|
|
34
|
+
};
|
|
35
|
+
case "paid": return {
|
|
36
|
+
status: "paid",
|
|
37
|
+
tone: "success"
|
|
38
|
+
};
|
|
39
|
+
case "canceled": return {
|
|
40
|
+
status: "canceled",
|
|
41
|
+
tone: "neutral"
|
|
42
|
+
};
|
|
43
|
+
case "rejected": return {
|
|
44
|
+
status: "rejected",
|
|
45
|
+
tone: "danger"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
49
|
//#endregion
|
|
45
|
-
export {
|
|
50
|
+
export { n as derivePayableStatus };
|
|
@@ -1 +1,81 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
3
|
+
import "../../data-access/dist/index.js";
|
|
4
|
+
import { derivePayableStatus as n } from "./index15.js";
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js
|
|
6
|
+
function r(e, n) {
|
|
7
|
+
if (typeof e == "number") return t(e / 100, { currencyCode: n });
|
|
8
|
+
}
|
|
9
|
+
function i({ payable: t, lineItems: i, ledgerAccounts: a, labels: o }) {
|
|
10
|
+
let s = t.currency ?? "USD", c = n(t.status, t.due_date), l = t.counterpart ?? t.counterpart_raw_data, u = l?.name ?? "", d = e(t.issued_at) || o.notProvided, f = e(t.due_date) || o.notProvided, p = [{
|
|
11
|
+
label: o.vendorRow,
|
|
12
|
+
value: u || o.notProvided,
|
|
13
|
+
secondaryValue: l?.email ?? void 0
|
|
14
|
+
}], m = l?.bank_account?.account_number;
|
|
15
|
+
m && p.push({
|
|
16
|
+
label: o.bankAccountRow,
|
|
17
|
+
value: o.bankAccountValue(m.slice(-4))
|
|
18
|
+
});
|
|
19
|
+
let h = [
|
|
20
|
+
{
|
|
21
|
+
label: o.invoiceNumberRow,
|
|
22
|
+
value: t.document_id || o.notProvided
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: o.issueDateRow,
|
|
26
|
+
value: d
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: o.dueDateRow,
|
|
30
|
+
value: f
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: o.poNumberRow,
|
|
34
|
+
value: o.notProvided
|
|
35
|
+
}
|
|
36
|
+
], g = new Map(a.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), _ = i.map((e) => {
|
|
37
|
+
let t = r(e.unit_price, s);
|
|
38
|
+
return {
|
|
39
|
+
id: e.id,
|
|
40
|
+
description: e.name ?? e.description ?? "",
|
|
41
|
+
glCodeLabel: (e.ledger_account_id ? g.get(e.ledger_account_id) : void 0) || o.glCodeMissing,
|
|
42
|
+
quantityLabel: e.quantity != null && t ? o.quantityValue(String(e.quantity), t) : "",
|
|
43
|
+
amountLabel: r(e.subtotal, s) ?? ""
|
|
44
|
+
};
|
|
45
|
+
}), v = [
|
|
46
|
+
{
|
|
47
|
+
label: o.subtotalRow,
|
|
48
|
+
value: t.subtotal
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: o.discountsRow,
|
|
52
|
+
value: t.discount
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: o.taxRow,
|
|
56
|
+
value: t.tax_amount
|
|
57
|
+
}
|
|
58
|
+
].map(({ label: e, value: t }) => ({
|
|
59
|
+
label: e,
|
|
60
|
+
value: r(t, s)
|
|
61
|
+
})).filter((e) => !!e.value), y = r(t.total_amount, s);
|
|
62
|
+
return y && v.push({
|
|
63
|
+
label: o.totalRow,
|
|
64
|
+
value: y,
|
|
65
|
+
emphasis: !0
|
|
66
|
+
}), {
|
|
67
|
+
title: u,
|
|
68
|
+
subtitle: o.subtitle,
|
|
69
|
+
status: c.status,
|
|
70
|
+
statusTone: c.tone,
|
|
71
|
+
amountDueLabel: r(t.amount_due, s) ?? r(t.total_amount, s) ?? "",
|
|
72
|
+
invoiceDateLabel: d,
|
|
73
|
+
dueDateLabel: f,
|
|
74
|
+
payToItems: p,
|
|
75
|
+
invoiceItems: h,
|
|
76
|
+
lineItems: _,
|
|
77
|
+
totals: v
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { i as mapPayableToBillDetails };
|