@tesouro/embedded-components-react 0.3.49 → 0.3.51
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 +8 -2
- package/dist/index.js +2 -2
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/LinkedAccountsWidget.js +1 -1
- package/dist/libs/shared/util-validation/dist/{index22.js → index23.js} +1 -1
- package/dist/libs/shared/util-validation/dist/index7.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +39 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +26 -311
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +325 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +13 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +20 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +75 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +36 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +80 -68
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +86 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +77 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +18 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +50 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +22 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +82 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +15 -159
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +23 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +66 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +2 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +5 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +31 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +23 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +37 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +161 -61
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +29 -130
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +1 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +47 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +4 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +12 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +26 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +62 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +133 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +20 -163
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +4 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +39 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +5 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +70 -211
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +47 -103
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +92 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +34 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +59 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +163 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +67 -181
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +20 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +203 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +214 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +98 -312
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +16 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +49 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +29 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +183 -156
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +38 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +102 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +18 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +343 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +30 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +79 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +179 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +2 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +6 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +92 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +123 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +7 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +45 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +69 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +21 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +27 -208
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +86 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +47 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +244 -106
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +201 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +115 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +44 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +6 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +119 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +24 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +89 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +5 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +5 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -104
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +105 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +15 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +125 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +7 -167
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +170 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +11 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +108 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +8 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +47 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js +95 -94
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index10.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index7.js +18 -55
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index8.js +46 -265
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +273 -34
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApproverOptions.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +87 -71
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
|
@@ -1,108 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import "../../../shared/ui/dist/index.js";
|
|
7
|
-
import { useUpdatePayableMutation as t } from "../../data-access/dist/index11.js";
|
|
8
|
-
import "../../data-access/dist/index.js";
|
|
9
|
-
import { counterpartFormBankAccountToCreatePayload as n, counterpartFormBankAccountToUpdatePayload as r, getAchInstructions as i, resolveCounterpartBankAccountWrite as a, validateAchFormValues as o } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
10
|
-
import { useCounterpartBankAccountsQuery as s, useCreateCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
11
|
-
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
12
|
-
import { useCallback as u, useEffect as d, useRef as f, useState as p } from "react";
|
|
1
|
+
import { derivePayableStatus as e } from "./index4.js";
|
|
2
|
+
import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../ui/dist/index18.js";
|
|
3
|
+
import "../../ui/dist/index.js";
|
|
13
4
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
d(() => {
|
|
33
|
-
if (!y || j.current || T.isFetching) return;
|
|
34
|
-
j.current = !0;
|
|
35
|
-
let e = i(E);
|
|
36
|
-
e && (S((t) => t.accountHolderName === "" && t.routingNumber === "" && t.accountNumber === "" ? {
|
|
37
|
-
accountHolderName: e.account_holder_name ?? "",
|
|
38
|
-
routingNumber: e.routing_number ?? "",
|
|
39
|
-
accountNumber: e.account_number ?? ""
|
|
40
|
-
} : t), A.current = e.id);
|
|
41
|
-
}, [
|
|
42
|
-
y,
|
|
43
|
-
T.isFetching,
|
|
44
|
-
E
|
|
45
|
-
]);
|
|
46
|
-
let N = u(() => {
|
|
47
|
-
b(!1);
|
|
48
|
-
}, []), P = u((e) => {
|
|
49
|
-
S((t) => ({
|
|
50
|
-
...t,
|
|
51
|
-
...e
|
|
52
|
-
}));
|
|
53
|
-
}, []), F = u(async () => {
|
|
54
|
-
if (!h || !g) return !1;
|
|
55
|
-
let t = o(x);
|
|
56
|
-
if (Object.keys(t).length > 0) return w(t), !1;
|
|
57
|
-
if (w(void 0), T.isFetching || T.isError) return e.error(_), !1;
|
|
58
|
-
let s = A.current;
|
|
59
|
-
try {
|
|
60
|
-
let e = a(E, s ?? i(E)?.id);
|
|
61
|
-
e.kind === "update" ? (await O.mutateAsync({
|
|
62
|
-
path: {
|
|
63
|
-
counterpart_id: g,
|
|
64
|
-
bank_account_id: e.bankAccountId
|
|
65
|
-
},
|
|
66
|
-
body: r(x, { includeAchDefaults: e.includeAchDefaults })
|
|
67
|
-
}), s = e.bankAccountId) : s = (await D.mutateAsync({
|
|
68
|
-
path: { counterpart_id: g },
|
|
69
|
-
body: n(x, { isDefaultForCurrency: e.isDefaultForCurrency })
|
|
70
|
-
}))?.id, A.current = s;
|
|
71
|
-
} catch {
|
|
72
|
-
return e.error(_), !1;
|
|
5
|
+
var n = /* @__PURE__ */ new Set([
|
|
6
|
+
"credit_note_linked",
|
|
7
|
+
"credit_note_unlinked",
|
|
8
|
+
"line_item_added",
|
|
9
|
+
"line_item_updated",
|
|
10
|
+
"line_item_removed",
|
|
11
|
+
"deleted"
|
|
12
|
+
]);
|
|
13
|
+
function r(n, r, i) {
|
|
14
|
+
switch (n) {
|
|
15
|
+
case "payable_created": return r?.source_of_payable_data === "ocr" ? i.billUploaded : i.billAdded;
|
|
16
|
+
case "payable_updated": return i.billUpdated;
|
|
17
|
+
case "file_attached": return i.attachmentAdded;
|
|
18
|
+
case "submitted_for_approval": return i.submittedForApproval;
|
|
19
|
+
case "approval_requested": return i.approvalRequested;
|
|
20
|
+
case "approval_action": {
|
|
21
|
+
let e = r?.action, t = r?.reject_reason;
|
|
22
|
+
return e === "approve" ? i.approved : e === "reject" ? typeof t == "string" && t ? i.rejectedWithReason(t) : i.rejected : void 0;
|
|
73
23
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
24
|
+
case "auto_approved": return i.autoApproved;
|
|
25
|
+
case "reopened": return i.reopened;
|
|
26
|
+
case "marked_as_paid": return i.markedAsPaid;
|
|
27
|
+
case "marked_as_partially_paid": return i.markedAsPartiallyPaid;
|
|
28
|
+
case "payment_reverted": return i.paymentReverted;
|
|
29
|
+
case "status_changed": {
|
|
30
|
+
let n = r?.new_status;
|
|
31
|
+
if (typeof n != "string") return;
|
|
32
|
+
let a = e({ apiStatus: n }).status;
|
|
33
|
+
return i.statusChanged(t[a] ?? t.unknown);
|
|
81
34
|
}
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
isOpen: y,
|
|
98
|
-
values: x,
|
|
99
|
-
errors: C,
|
|
100
|
-
isSaving: D.isPending || O.isPending || k.isPending,
|
|
101
|
-
open: M,
|
|
102
|
-
close: N,
|
|
103
|
-
onChange: P,
|
|
104
|
-
save: F
|
|
105
|
-
};
|
|
35
|
+
default: return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function i(e, t, i) {
|
|
39
|
+
let a = new Map(t.map((e) => [e.id, e.name]));
|
|
40
|
+
return e.filter((e) => !n.has(e.event_type)).map((e) => {
|
|
41
|
+
let t = r(e.event_type, e.event_data, i);
|
|
42
|
+
if (!t) return;
|
|
43
|
+
let n = e.entity_user_id ? a.get(e.entity_user_id) : void 0;
|
|
44
|
+
return {
|
|
45
|
+
id: e.id,
|
|
46
|
+
dateLabel: i.dateLabel(e.timestamp),
|
|
47
|
+
description: n ? i.byActor(t, n) : t
|
|
48
|
+
};
|
|
49
|
+
}).filter((e) => !!e);
|
|
106
50
|
}
|
|
107
51
|
//#endregion
|
|
108
|
-
export {
|
|
52
|
+
export { i as buildBillHistory };
|
|
@@ -1,16 +1,96 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var e = {
|
|
3
|
+
payBill: "Pay bill",
|
|
4
|
+
markAsPaid: "Mark as paid",
|
|
5
|
+
reject: "Reject",
|
|
6
|
+
approve: "Approve",
|
|
7
|
+
cancel: "Cancel bill",
|
|
8
|
+
cancelScheduledPayment: "Cancel scheduled payment",
|
|
9
|
+
reopen: "Reopen bill",
|
|
10
|
+
forceApprove: "Approve",
|
|
11
|
+
forceReject: "Reject",
|
|
12
|
+
policyOverridesHeading: "Policy overrides",
|
|
13
|
+
decisionDialog: {
|
|
14
|
+
reject: {
|
|
15
|
+
title: "Reject this bill?",
|
|
16
|
+
description: "The bill goes back as rejected and nobody else is asked to approve it.",
|
|
17
|
+
confirmButton: "Reject bill",
|
|
18
|
+
reason: {
|
|
19
|
+
label: "Reason",
|
|
20
|
+
placeholder: "Tell the submitter what needs to change",
|
|
21
|
+
optionalHint: "Optional"
|
|
10
22
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
},
|
|
24
|
+
cancel: {
|
|
25
|
+
title: "Cancel this bill?",
|
|
26
|
+
description: "Cancelling is permanent. The bill can't be reopened, edited, or paid afterwards.",
|
|
27
|
+
confirmButton: "Cancel bill"
|
|
28
|
+
},
|
|
29
|
+
cancelScheduledPayment: {
|
|
30
|
+
title: "Cancel this scheduled payment?",
|
|
31
|
+
description: "The payment will not be sent. The bill stays ready to pay, so you can schedule it again for another date.",
|
|
32
|
+
confirmButton: "Cancel payment"
|
|
33
|
+
},
|
|
34
|
+
forceApprove: {
|
|
35
|
+
title: "Override approval policy?",
|
|
36
|
+
description: "The below people haven't approved this bill yet. Approving now will bypass their required review. This will be recorded in the audit history and can't be undone.",
|
|
37
|
+
confirmButton: "Override and approve"
|
|
38
|
+
},
|
|
39
|
+
forceReject: {
|
|
40
|
+
title: "Override approval policy?",
|
|
41
|
+
description: "The below people haven't approved this bill yet. Rejecting now will bypass their required review. This will be recorded in the audit history and can't be undone.",
|
|
42
|
+
confirmButton: "Override and reject"
|
|
43
|
+
},
|
|
44
|
+
cancelButton: "Cancel"
|
|
45
|
+
},
|
|
46
|
+
actionError: "Couldn't update this bill. Try again.",
|
|
47
|
+
actionSuccess: {
|
|
48
|
+
approve: "Bill approved.",
|
|
49
|
+
reject: "Bill rejected.",
|
|
50
|
+
markAsPaid: "Bill marked as paid.",
|
|
51
|
+
cancel: "Bill canceled.",
|
|
52
|
+
cancelScheduledPayment: "Scheduled payment canceled.",
|
|
53
|
+
reopen: "Bill reopened.",
|
|
54
|
+
forceApprove: "Bill approved, overriding the approval policy.",
|
|
55
|
+
forceReject: "Bill rejected, overriding the approval policy."
|
|
56
|
+
}
|
|
57
|
+
}, t = (e) => `Payment scheduled for ${e}`, n = [
|
|
58
|
+
"reject",
|
|
59
|
+
"cancel",
|
|
60
|
+
"cancelScheduledPayment",
|
|
61
|
+
"forceApprove",
|
|
62
|
+
"forceReject"
|
|
63
|
+
];
|
|
64
|
+
function r(e, t) {
|
|
65
|
+
let n = e.reason ? {
|
|
66
|
+
...e.reason,
|
|
67
|
+
...t?.reason
|
|
68
|
+
} : void 0, r = {
|
|
69
|
+
...e,
|
|
70
|
+
...t,
|
|
71
|
+
reason: n
|
|
72
|
+
};
|
|
73
|
+
return n || delete r.reason, r;
|
|
74
|
+
}
|
|
75
|
+
function i(e, t) {
|
|
76
|
+
let i = {
|
|
77
|
+
...e,
|
|
78
|
+
...t
|
|
79
|
+
};
|
|
80
|
+
for (let a of n) i[a] = r(e[a], t?.[a]);
|
|
81
|
+
return i;
|
|
82
|
+
}
|
|
83
|
+
function a(t) {
|
|
84
|
+
let n = e;
|
|
85
|
+
return {
|
|
86
|
+
...n,
|
|
87
|
+
...t,
|
|
88
|
+
decisionDialog: i(n.decisionDialog, t?.decisionDialog),
|
|
89
|
+
actionSuccess: {
|
|
90
|
+
...n.actionSuccess,
|
|
91
|
+
...t?.actionSuccess
|
|
92
|
+
}
|
|
93
|
+
};
|
|
14
94
|
}
|
|
15
95
|
//#endregion
|
|
16
|
-
export { e as
|
|
96
|
+
export { e as BILL_DETAIL_ACTIONS_LABELS_EN, t as SCHEDULED_SUMMARY_LABEL_EN, a as mergeBillDetailActionsLabels, i as mergeDecisionDialogCopy };
|
|
@@ -1,51 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../data-access/dist/index.js";
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
2
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
function r(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
quantity: i,
|
|
37
|
-
unit_price: a,
|
|
38
|
-
tax: 0,
|
|
39
|
-
...t !== null && t !== o ? { subtotal: t } : {},
|
|
40
|
-
...e.glCode ? { ledger_account_id: e.glCode } : {}
|
|
41
|
-
};
|
|
3
|
+
var n = {
|
|
4
|
+
previewUnavailable: "Preview not available for this file type.",
|
|
5
|
+
openFile: "Open file"
|
|
6
|
+
};
|
|
7
|
+
function r(r, i = {}) {
|
|
8
|
+
if (r.mimetype === "application/pdf") return /* @__PURE__ */ e("iframe", {
|
|
9
|
+
src: `${r.url}#toolbar=0&navpanes=0`,
|
|
10
|
+
title: r.name,
|
|
11
|
+
referrerPolicy: "no-referrer",
|
|
12
|
+
className: "ttw:h-full ttw:w-full ttw:border-0"
|
|
13
|
+
});
|
|
14
|
+
if (r.mimetype.startsWith("image/")) return /* @__PURE__ */ e("img", {
|
|
15
|
+
src: r.url,
|
|
16
|
+
alt: r.name,
|
|
17
|
+
className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
|
|
18
|
+
});
|
|
19
|
+
let a = {
|
|
20
|
+
...n,
|
|
21
|
+
...i
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ t("div", {
|
|
24
|
+
className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:p-4 ttw:text-center",
|
|
25
|
+
children: [/* @__PURE__ */ e("p", {
|
|
26
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
27
|
+
children: a.previewUnavailable
|
|
28
|
+
}), /* @__PURE__ */ e("a", {
|
|
29
|
+
href: r.url,
|
|
30
|
+
target: "_blank",
|
|
31
|
+
rel: "noreferrer",
|
|
32
|
+
className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
|
|
33
|
+
children: a.openFile
|
|
34
|
+
})]
|
|
42
35
|
});
|
|
43
|
-
}
|
|
44
|
-
function u(e, t) {
|
|
45
|
-
return s(Math.round(o(e) * a(t)));
|
|
46
|
-
}
|
|
47
|
-
function d(e, t, n) {
|
|
48
|
-
return s(e.reduce((e, t) => e + a(t.amount), 0) + a(t) - a(n));
|
|
49
36
|
}
|
|
50
37
|
//#endregion
|
|
51
|
-
export {
|
|
38
|
+
export { n as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, r as createSourceDocumentPreview };
|
|
@@ -1,66 +1,63 @@
|
|
|
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 "../../../shared/ui/dist/index.js";
|
|
7
|
-
import { formatCalendarDate as t } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
8
|
-
import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
9
|
-
import { extractApiErrorMessage as r } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
10
|
-
import { dateToCalendarKey as i, getDefaultPaymentDate as a, isTodayInEastern as o } from "./index3.js";
|
|
11
|
-
import { useMarkPayableAsPaidMutation as s } from "../../data-access/dist/index11.js";
|
|
12
|
-
import "../../data-access/dist/index.js";
|
|
13
|
-
import { mergeMarkAsPaidFlowLabels as c } from "./index2.js";
|
|
14
|
-
import { useEffect as l, useState as u } from "react";
|
|
15
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
paymentAmount: k,
|
|
32
|
-
selectedDate: C,
|
|
33
|
-
selectedDateLabel: A,
|
|
34
|
-
isToday: C ? o(C) : !1,
|
|
35
|
-
comment: T,
|
|
36
|
-
isSubmitting: b.isPending,
|
|
37
|
-
onDateChange: w,
|
|
38
|
-
onCommentChange: E,
|
|
39
|
-
onConfirm: () => {
|
|
40
|
-
!d || !C || b.isPending || g || b.mutate({
|
|
41
|
-
path: { payable_id: d },
|
|
42
|
-
body: {
|
|
43
|
-
paid_at: `${i(C)}T12:00:00.000Z`,
|
|
44
|
-
is_external: !0,
|
|
45
|
-
...T.trim() ? { comment: T.trim() } : {}
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
|
-
onSuccess: () => {
|
|
49
|
-
e.success(y.paidToast), M();
|
|
50
|
-
},
|
|
51
|
-
onError: (t) => {
|
|
52
|
-
e.error(r(t) ?? y.submitError);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
onCancel: () => {
|
|
57
|
-
b.isPending || M();
|
|
58
|
-
},
|
|
59
|
-
testId: _ ? `${_}-mark-as-paid-dialog` : void 0,
|
|
60
|
-
confirmTestId: _ ? `${_}-mark-as-paid-confirm` : void 0,
|
|
61
|
-
labels: y.dialog
|
|
62
|
-
}
|
|
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
|
+
isOverdue: !1
|
|
63
17
|
};
|
|
18
|
+
let s = !!(e.has(n) && r && t(r, o));
|
|
19
|
+
switch (n) {
|
|
20
|
+
case "draft": return {
|
|
21
|
+
status: "draft",
|
|
22
|
+
tone: "neutral",
|
|
23
|
+
isOverdue: s
|
|
24
|
+
};
|
|
25
|
+
case "new": return {
|
|
26
|
+
status: "finalized",
|
|
27
|
+
tone: "warning",
|
|
28
|
+
isOverdue: s
|
|
29
|
+
};
|
|
30
|
+
case "approve_in_progress": return {
|
|
31
|
+
status: "pending_approval",
|
|
32
|
+
tone: "warning",
|
|
33
|
+
isOverdue: s
|
|
34
|
+
};
|
|
35
|
+
case "waiting_to_be_paid": return {
|
|
36
|
+
status: "ready_to_pay",
|
|
37
|
+
tone: "info",
|
|
38
|
+
isOverdue: s
|
|
39
|
+
};
|
|
40
|
+
case "partially_paid": return {
|
|
41
|
+
status: "partially_paid",
|
|
42
|
+
tone: "success",
|
|
43
|
+
isOverdue: s
|
|
44
|
+
};
|
|
45
|
+
case "paid": return {
|
|
46
|
+
status: "paid",
|
|
47
|
+
tone: "success",
|
|
48
|
+
isOverdue: s
|
|
49
|
+
};
|
|
50
|
+
case "canceled": return {
|
|
51
|
+
status: "canceled",
|
|
52
|
+
tone: "muted",
|
|
53
|
+
isOverdue: s
|
|
54
|
+
};
|
|
55
|
+
case "rejected": return {
|
|
56
|
+
status: "rejected",
|
|
57
|
+
tone: "danger",
|
|
58
|
+
isOverdue: s
|
|
59
|
+
};
|
|
60
|
+
}
|
|
64
61
|
}
|
|
65
62
|
//#endregion
|
|
66
|
-
export {
|
|
63
|
+
export { n as derivePayableStatus };
|