@tesouro/embedded-components-react 0.2.337 → 0.2.339
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 +4 -0
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +103 -58
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +74 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +25 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +64 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +40 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +51 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -71
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +71 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +46 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +78 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +33 -117
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +138 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -200
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +194 -184
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +180 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +64 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +46 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +26 -158
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +159 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +32 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +102 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +13 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +243 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +4 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +27 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +76 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +137 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +2 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +45 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +14 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +59 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +3 -110
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +107 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +8 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +40 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +6 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +91 -171
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +179 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +5 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +6 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +14 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +26 -26
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +11 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +94 -74
- 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/index7.js +1 -1
- package/package.json +1 -1
|
@@ -7,95 +7,111 @@ import "../../../shared/ui/dist/index.js";
|
|
|
7
7
|
import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
8
8
|
import "../../../shared/feature/dist/index.js";
|
|
9
9
|
import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index5.js";
|
|
10
|
-
import { useCancelPayableMutation as i,
|
|
10
|
+
import { useCancelPayableMutation as i, useCancelPaymentRecordMutation as a, useForceApprovePayableMutation as o, useForceRejectPayableMutation as s, useMarkPayableAsPaidMutation as c, useReopenPayableMutation as l } from "../../data-access/dist/index10.js";
|
|
11
11
|
import "../../data-access/dist/index.js";
|
|
12
|
-
import { getBillDetailActions as
|
|
13
|
-
import { useState as
|
|
12
|
+
import { getBillDetailActions as u } from "./index17.js";
|
|
13
|
+
import { useState as d } from "react";
|
|
14
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js
|
|
15
|
-
function
|
|
16
|
-
let { initResponse:
|
|
17
|
-
status:
|
|
18
|
-
scopes:
|
|
19
|
-
canDecideApprovalRequest: !!
|
|
20
|
-
isPolicyApprover:
|
|
21
|
-
hasWaitingRequest:
|
|
22
|
-
hasScheduledPayment:
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
function f({ payableId: f, status: p, currentApprovalRequestId: h, isPolicyApprover: g, hasWaitingRequest: _, hasScheduledPayment: v, scheduledPaymentRecordId: y, isScheduledPaymentUnknown: b, labels: x, onPayBillSelect: S }) {
|
|
16
|
+
let { initResponse: C } = t(), w = c(), T = r(), E = n(), D = i(), O = a(), k = l(), A = o(), j = s(), M = w.isPending || T.isPending || E.isPending || D.isPending || O.isPending || k.isPending || A.isPending || j.isPending, [N, P] = d(), F = N && (N.id !== "cancelScheduledPayment" || N.scheduledPaymentRecordId === y) ? N : void 0, I = f && p ? u({
|
|
17
|
+
status: p,
|
|
18
|
+
scopes: C?.scopes,
|
|
19
|
+
canDecideApprovalRequest: !!h,
|
|
20
|
+
isPolicyApprover: g,
|
|
21
|
+
hasWaitingRequest: _,
|
|
22
|
+
hasScheduledPayment: v || b,
|
|
23
|
+
scheduledPaymentRecordId: y,
|
|
24
|
+
labels: x
|
|
25
|
+
}) : [], L = { onError: () => e.error(x.actionError) }, R = {
|
|
25
26
|
markAsPaid: {
|
|
26
|
-
isPending:
|
|
27
|
-
run: () =>
|
|
27
|
+
isPending: w.isPending,
|
|
28
|
+
run: () => f && w.mutate({ path: { payable_id: f } }, L)
|
|
28
29
|
},
|
|
29
30
|
reject: {
|
|
30
|
-
isPending:
|
|
31
|
-
run: (e) =>
|
|
32
|
-
path: { approval_request_id:
|
|
31
|
+
isPending: T.isPending,
|
|
32
|
+
run: (e) => h && T.mutate({
|
|
33
|
+
path: { approval_request_id: h },
|
|
33
34
|
body: e ? { reject_reason: e } : void 0
|
|
34
|
-
},
|
|
35
|
+
}, L)
|
|
35
36
|
},
|
|
36
37
|
approve: {
|
|
37
|
-
isPending:
|
|
38
|
-
run: () =>
|
|
38
|
+
isPending: E.isPending,
|
|
39
|
+
run: () => h && E.mutate({ path: { approval_request_id: h } }, L)
|
|
39
40
|
},
|
|
40
41
|
cancel: {
|
|
41
|
-
isPending:
|
|
42
|
-
run: () =>
|
|
42
|
+
isPending: D.isPending,
|
|
43
|
+
run: () => f && D.mutate({ path: { payable_id: f } }, L)
|
|
44
|
+
},
|
|
45
|
+
cancelScheduledPayment: {
|
|
46
|
+
isPending: O.isPending,
|
|
47
|
+
run: () => {
|
|
48
|
+
let e = F?.scheduledPaymentRecordId;
|
|
49
|
+
!f || !e || O.mutate({
|
|
50
|
+
path: { payment_record_id: e },
|
|
51
|
+
payableId: f
|
|
52
|
+
}, L);
|
|
53
|
+
}
|
|
43
54
|
},
|
|
44
55
|
reopen: {
|
|
45
|
-
isPending:
|
|
46
|
-
run: () =>
|
|
56
|
+
isPending: k.isPending,
|
|
57
|
+
run: () => f && k.mutate({ path: { payable_id: f } }, L)
|
|
47
58
|
},
|
|
48
59
|
forceApprove: {
|
|
49
|
-
isPending:
|
|
50
|
-
run: () =>
|
|
60
|
+
isPending: A.isPending,
|
|
61
|
+
run: () => f && A.mutate({ path: { payable_id: f } }, L)
|
|
51
62
|
},
|
|
52
63
|
forceReject: {
|
|
53
|
-
isPending:
|
|
54
|
-
run: () =>
|
|
64
|
+
isPending: j.isPending,
|
|
65
|
+
run: () => f && j.mutate({ path: { payable_id: f } }, L)
|
|
55
66
|
}
|
|
56
|
-
},
|
|
67
|
+
}, z = I.map((e) => ({
|
|
57
68
|
...e,
|
|
58
|
-
disabled:
|
|
59
|
-
loading:
|
|
69
|
+
disabled: M,
|
|
70
|
+
loading: R[e.id]?.isPending ?? !1,
|
|
60
71
|
onSelect: () => {
|
|
61
|
-
if (!(
|
|
72
|
+
if (!(M || !f)) {
|
|
62
73
|
if (e.id === "payBill") {
|
|
63
|
-
|
|
74
|
+
S();
|
|
64
75
|
return;
|
|
65
76
|
}
|
|
66
|
-
if (
|
|
67
|
-
|
|
77
|
+
if (m(e.id)) {
|
|
78
|
+
P({
|
|
79
|
+
id: e.id,
|
|
80
|
+
scheduledPaymentRecordId: y
|
|
81
|
+
});
|
|
68
82
|
return;
|
|
69
83
|
}
|
|
70
|
-
|
|
84
|
+
R[e.id]?.run();
|
|
71
85
|
}
|
|
72
86
|
}
|
|
73
87
|
}));
|
|
74
88
|
return {
|
|
75
89
|
actions: {
|
|
76
|
-
row:
|
|
77
|
-
menu:
|
|
90
|
+
row: z.filter((e) => e.surface === "row"),
|
|
91
|
+
menu: z.filter((e) => e.surface === "menu")
|
|
78
92
|
},
|
|
79
93
|
decisionDialog: {
|
|
80
|
-
open: !!
|
|
81
|
-
copy:
|
|
82
|
-
isPending:
|
|
94
|
+
open: !!F,
|
|
95
|
+
copy: F ? x.decisionDialog[F.id] : void 0,
|
|
96
|
+
isPending: F ? R[F.id]?.isPending ?? !1 : !1,
|
|
83
97
|
onCancel: () => {
|
|
84
|
-
|
|
98
|
+
M || P(void 0);
|
|
85
99
|
},
|
|
86
100
|
onConfirm: (e) => {
|
|
87
|
-
!
|
|
101
|
+
!F || M || (R[F.id]?.run(e), P(void 0));
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
};
|
|
91
105
|
}
|
|
92
|
-
var
|
|
106
|
+
var p = [
|
|
93
107
|
"reject",
|
|
108
|
+
"cancel",
|
|
109
|
+
"cancelScheduledPayment",
|
|
94
110
|
"forceApprove",
|
|
95
111
|
"forceReject"
|
|
96
112
|
];
|
|
97
|
-
function
|
|
98
|
-
return
|
|
113
|
+
function m(e) {
|
|
114
|
+
return p.includes(e);
|
|
99
115
|
}
|
|
100
116
|
//#endregion
|
|
101
|
-
export {
|
|
117
|
+
export { f as usePayableDetailActions };
|
|
@@ -12,11 +12,12 @@ import { usePayablePaymentRecordsQuery as i } from "../../data-access/dist/index
|
|
|
12
12
|
import "../../data-access/dist/index.js";
|
|
13
13
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js
|
|
14
14
|
function a({ payableId: a, scheduledPaymentDate: o, enabled: s = !0 }) {
|
|
15
|
-
let { initResponse: c } = r(), l = e(c?.scopes, [t.PaymentRecordReadOrg]), u = i(s ? a : void 0, { enabled: s && l }), d = u.paymentRecords.find((e) => e.status === "created" || e.status === "processing"), f = d?.planned_payment_date ?? o;
|
|
15
|
+
let { initResponse: c } = r(), l = e(c?.scopes, [t.PaymentRecordReadOrg]), u = i(s ? a : void 0, { enabled: s && l }), d = u.paymentRecords.find((e) => e.status === "created" || e.status === "processing"), f = !!d || !!o, p = d?.planned_payment_date ?? (f ? o : void 0);
|
|
16
16
|
return {
|
|
17
|
-
hasScheduledPayment:
|
|
17
|
+
hasScheduledPayment: f,
|
|
18
18
|
isResolving: u.isResolving,
|
|
19
|
-
scheduledDateLabel:
|
|
19
|
+
scheduledDateLabel: p ? n(p) : void 0,
|
|
20
|
+
scheduledPaymentRecordId: d?.id
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
//#endregion
|
|
@@ -1,54 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import "../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import "../../../shared/feature/dist/index.js";
|
|
12
|
+
import { useDeletePayableMutation as i } from "../../data-access/dist/index10.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useState as a } from "react";
|
|
1
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
|
|
17
|
+
let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
|
|
18
|
+
id: "deleteDraft",
|
|
19
|
+
label: l.menuItem,
|
|
20
|
+
destructive: !0,
|
|
21
|
+
onSelect: () => m(!0)
|
|
22
|
+
}] : [], v = p && g;
|
|
23
|
+
return {
|
|
24
|
+
menuItems: _,
|
|
25
|
+
dialog: {
|
|
26
|
+
open: v,
|
|
27
|
+
copy: v ? l.dialog : void 0,
|
|
28
|
+
isPending: f.isPending,
|
|
29
|
+
onCancel: () => {
|
|
30
|
+
f.isPending || m(!1);
|
|
31
|
+
},
|
|
32
|
+
onConfirm: () => {
|
|
33
|
+
!g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
|
|
34
|
+
onError: () => e.error(l.error),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
m(!1), u();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
20
41
|
};
|
|
21
|
-
switch (n) {
|
|
22
|
-
case "draft": return {
|
|
23
|
-
status: "draft",
|
|
24
|
-
tone: "neutral"
|
|
25
|
-
};
|
|
26
|
-
case "new":
|
|
27
|
-
case "approve_in_progress": return {
|
|
28
|
-
status: "pending_approval",
|
|
29
|
-
tone: "warning"
|
|
30
|
-
};
|
|
31
|
-
case "waiting_to_be_paid": return {
|
|
32
|
-
status: "ready_to_pay",
|
|
33
|
-
tone: "info"
|
|
34
|
-
};
|
|
35
|
-
case "partially_paid": return {
|
|
36
|
-
status: "partially_paid",
|
|
37
|
-
tone: "success"
|
|
38
|
-
};
|
|
39
|
-
case "paid": return {
|
|
40
|
-
status: "paid",
|
|
41
|
-
tone: "success"
|
|
42
|
-
};
|
|
43
|
-
case "canceled": return {
|
|
44
|
-
status: "canceled",
|
|
45
|
-
tone: "muted"
|
|
46
|
-
};
|
|
47
|
-
case "rejected": return {
|
|
48
|
-
status: "rejected",
|
|
49
|
-
tone: "danger"
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
42
|
}
|
|
53
43
|
//#endregion
|
|
54
|
-
export {
|
|
44
|
+
export { o as useDraftDelete };
|
|
@@ -1,8 +1,54 @@
|
|
|
1
|
-
import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
2
|
-
import "../../data-access/dist/index.js";
|
|
3
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js
|
|
4
|
-
|
|
5
|
-
|
|
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;
|
|
11
|
+
}
|
|
12
|
+
function n({ apiStatus: n, dueDate: r, scheduledPaymentDate: i, hasScheduledPayment: a = !!i, now: o = /* @__PURE__ */ new Date() }) {
|
|
13
|
+
if (e.has(n) && a) return {
|
|
14
|
+
status: "scheduled",
|
|
15
|
+
tone: "accent"
|
|
16
|
+
};
|
|
17
|
+
if (e.has(n) && r && t(r, o)) return {
|
|
18
|
+
status: "overdue",
|
|
19
|
+
tone: "danger"
|
|
20
|
+
};
|
|
21
|
+
switch (n) {
|
|
22
|
+
case "draft": return {
|
|
23
|
+
status: "draft",
|
|
24
|
+
tone: "neutral"
|
|
25
|
+
};
|
|
26
|
+
case "new":
|
|
27
|
+
case "approve_in_progress": return {
|
|
28
|
+
status: "pending_approval",
|
|
29
|
+
tone: "warning"
|
|
30
|
+
};
|
|
31
|
+
case "waiting_to_be_paid": return {
|
|
32
|
+
status: "ready_to_pay",
|
|
33
|
+
tone: "info"
|
|
34
|
+
};
|
|
35
|
+
case "partially_paid": return {
|
|
36
|
+
status: "partially_paid",
|
|
37
|
+
tone: "success"
|
|
38
|
+
};
|
|
39
|
+
case "paid": return {
|
|
40
|
+
status: "paid",
|
|
41
|
+
tone: "success"
|
|
42
|
+
};
|
|
43
|
+
case "canceled": return {
|
|
44
|
+
status: "canceled",
|
|
45
|
+
tone: "muted"
|
|
46
|
+
};
|
|
47
|
+
case "rejected": return {
|
|
48
|
+
status: "rejected",
|
|
49
|
+
tone: "danger"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
6
52
|
}
|
|
7
53
|
//#endregion
|
|
8
|
-
export {
|
|
54
|
+
export { n as derivePayableStatus };
|
|
@@ -1,74 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { resolveVendor as n } from "./index3.js";
|
|
4
|
-
import { derivePayableStatus as r } from "./index20.js";
|
|
5
|
-
import { formatBillMoney as i } from "./index21.js";
|
|
1
|
+
import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
2
|
+
import "../../data-access/dist/index.js";
|
|
6
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
apiStatus: a.status,
|
|
10
|
-
dueDate: a.due_date,
|
|
11
|
-
scheduledPaymentDate: a.scheduled_payment_date
|
|
12
|
-
}), p = n(a), m = p?.bank_account?.account_number, h = e(a.issued_at) || u.notProvided, g = e(a.due_date) || u.notProvided, _ = new Map(s.map((e) => [e.value, e.label])), v = [
|
|
13
|
-
{
|
|
14
|
-
label: u.subtotalRow,
|
|
15
|
-
minorUnits: a.subtotal
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
label: u.discountRow,
|
|
19
|
-
minorUnits: a.discount
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label: u.taxRow,
|
|
23
|
-
minorUnits: a.tax_amount
|
|
24
|
-
}
|
|
25
|
-
].map((e) => ({
|
|
26
|
-
label: e.label,
|
|
27
|
-
value: i(e.minorUnits, d)
|
|
28
|
-
})).filter((e) => !!e.value), y = i(a.total_amount, d);
|
|
29
|
-
return y && v.push({
|
|
30
|
-
label: u.totalRow,
|
|
31
|
-
value: y,
|
|
32
|
-
emphasis: !0
|
|
33
|
-
}), {
|
|
34
|
-
amountDue: i(t(a), d) ?? "",
|
|
35
|
-
invoiceDateLabel: h,
|
|
36
|
-
dueDateLabel: g,
|
|
37
|
-
status: f.status,
|
|
38
|
-
statusTone: f.tone,
|
|
39
|
-
payTo: {
|
|
40
|
-
name: p?.name || u.notProvided,
|
|
41
|
-
email: p?.email ?? void 0,
|
|
42
|
-
paymentInstructionsLabel: m ? u.paymentInstructionsValue(m.slice(-4)) : void 0
|
|
43
|
-
},
|
|
44
|
-
invoiceFields: [
|
|
45
|
-
{
|
|
46
|
-
label: u.invoiceDateRow,
|
|
47
|
-
value: h
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: u.dueDateRow,
|
|
51
|
-
value: g
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: u.invoiceNumberRow,
|
|
55
|
-
value: a.document_id || u.notProvided
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
lineItems: o.map((e) => {
|
|
59
|
-
let t = i(e.unit_price, d);
|
|
60
|
-
return {
|
|
61
|
-
id: e.id,
|
|
62
|
-
description: e.name ?? e.description ?? "",
|
|
63
|
-
glCodeLabel: (e.ledger_account_id ? _.get(e.ledger_account_id) : void 0) || u.glCodeMissing,
|
|
64
|
-
qtyPriceLabel: e.quantity != null && t ? u.qtyPriceValue(String(e.quantity), t) : "",
|
|
65
|
-
amount: i(e.subtotal, d) ?? ""
|
|
66
|
-
};
|
|
67
|
-
}),
|
|
68
|
-
amountRows: v,
|
|
69
|
-
approvalPolicy: l,
|
|
70
|
-
history: c
|
|
71
|
-
};
|
|
4
|
+
function t(t, n) {
|
|
5
|
+
if (typeof t == "number") return e(t / 100, { currencyCode: n ?? "USD" });
|
|
72
6
|
}
|
|
73
7
|
//#endregion
|
|
74
|
-
export {
|
|
8
|
+
export { t as formatBillMoney };
|
|
@@ -1,52 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { resolveAmountDueMinorUnits as t } from "./index2.js";
|
|
3
|
+
import { resolveVendor as n } from "./index3.js";
|
|
4
|
+
import { derivePayableStatus as r } from "./index21.js";
|
|
5
|
+
import { formatBillMoney as i } from "./index22.js";
|
|
4
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
function a({ payable: a, lineItems: o, glCodeOptions: s, history: c, approvalPolicy: l, labels: u, hasScheduledPayment: d }) {
|
|
8
|
+
let f = a.currency, p = r({
|
|
9
|
+
apiStatus: a.status,
|
|
10
|
+
dueDate: a.due_date,
|
|
11
|
+
scheduledPaymentDate: a.scheduled_payment_date,
|
|
12
|
+
hasScheduledPayment: d
|
|
13
|
+
}), m = n(a), h = m?.bank_account?.account_number, g = e(a.issued_at) || u.notProvided, _ = e(a.due_date) || u.notProvided, v = new Map(s.map((e) => [e.value, e.label])), y = [
|
|
14
|
+
{
|
|
15
|
+
label: u.subtotalRow,
|
|
16
|
+
minorUnits: a.subtotal
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: u.discountRow,
|
|
20
|
+
minorUnits: a.discount
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: u.taxRow,
|
|
24
|
+
minorUnits: a.tax_amount
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
26
|
+
].map((e) => ({
|
|
27
|
+
label: e.label,
|
|
28
|
+
value: i(e.minorUnits, f)
|
|
29
|
+
})).filter((e) => !!e.value), b = i(a.total_amount, f);
|
|
30
|
+
return b && y.push({
|
|
31
|
+
label: u.totalRow,
|
|
32
|
+
value: b,
|
|
33
|
+
emphasis: !0
|
|
34
|
+
}), {
|
|
35
|
+
amountDue: i(t(a), f) ?? "",
|
|
36
|
+
invoiceDateLabel: g,
|
|
37
|
+
dueDateLabel: _,
|
|
38
|
+
status: p.status,
|
|
39
|
+
statusTone: p.tone,
|
|
40
|
+
payTo: {
|
|
41
|
+
name: m?.name || u.notProvided,
|
|
42
|
+
email: m?.email ?? void 0,
|
|
43
|
+
paymentInstructionsLabel: h ? u.paymentInstructionsValue(h.slice(-4)) : void 0
|
|
44
|
+
},
|
|
45
|
+
invoiceFields: [
|
|
46
|
+
{
|
|
47
|
+
label: u.invoiceDateRow,
|
|
48
|
+
value: g
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: u.dueDateRow,
|
|
52
|
+
value: _
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: u.invoiceNumberRow,
|
|
56
|
+
value: a.document_id || u.notProvided
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
lineItems: o.map((e) => {
|
|
60
|
+
let t = i(e.unit_price, f);
|
|
61
|
+
return {
|
|
62
|
+
id: e.id,
|
|
63
|
+
description: e.name ?? e.description ?? "",
|
|
64
|
+
glCodeLabel: (e.ledger_account_id ? v.get(e.ledger_account_id) : void 0) || u.glCodeMissing,
|
|
65
|
+
qtyPriceLabel: e.quantity != null && t ? u.qtyPriceValue(String(e.quantity), t) : "",
|
|
66
|
+
amount: i(e.subtotal, f) ?? ""
|
|
67
|
+
};
|
|
68
|
+
}),
|
|
69
|
+
amountRows: y,
|
|
70
|
+
approvalPolicy: l,
|
|
71
|
+
history: c
|
|
72
|
+
};
|
|
50
73
|
}
|
|
51
74
|
//#endregion
|
|
52
|
-
export {
|
|
75
|
+
export { a as buildBillDetailView };
|