@tesouro/embedded-components-react 0.5.27 → 0.5.29
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 +18 -6
- 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/index14.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +52 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +15 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +57 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +68 -207
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +278 -175
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +13 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +47 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +53 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +204 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +32 -202
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +234 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +21 -240
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +532 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -436
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +42 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +230 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -233
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +11 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +127 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -129
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +46 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +122 -241
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +206 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -213
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +113 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -115
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +24 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +39 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +123 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +2 -170
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +7 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +158 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index108.js +11 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index109.js +100 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index111.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index112.js +52 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index113.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +20 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +4 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +103 -146
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +93 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +15 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +43 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +55 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +33 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +2 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +34 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +34 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -201
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +39 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +3 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +187 -350
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +3 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +13 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +356 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +87 -119
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -94
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +125 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +25 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +90 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +26 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +4 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +30 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +9 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +85 -104
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index128.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index186.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +291 -351
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +13 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +30 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +92 -87
- 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/index8.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +0 -28
|
@@ -1,21 +1,534 @@
|
|
|
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 { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
|
|
9
|
+
import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
10
|
+
import "../../../shared/data-access/dist/index.js";
|
|
11
|
+
import "../../../shared/ui/dist/index.js";
|
|
12
|
+
import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
13
|
+
import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
14
|
+
import "../../../shared/feature/dist/index.js";
|
|
15
|
+
import { usePayableApprovalRequestsQuery as ie } from "../../data-access/dist/index8.js";
|
|
16
|
+
import { usePayableHistoryQuery as ae } from "../../data-access/dist/index9.js";
|
|
17
|
+
import { useAllPayableLineItemsQuery as oe } from "../../data-access/dist/index10.js";
|
|
18
|
+
import { useUpdatePayableMutation as se } from "../../data-access/dist/index13.js";
|
|
19
|
+
import { usePayableQuery as ce } from "../../data-access/dist/index17.js";
|
|
20
|
+
import "../../data-access/dist/index.js";
|
|
21
|
+
import { hasUnpaidBalance as le } from "./index7.js";
|
|
22
|
+
import { resolveVendor as ue } from "./index8.js";
|
|
23
|
+
import { BillCreateScreen as de } from "../../ui/dist/index50.js";
|
|
24
|
+
import { BillDecisionDialog as fe } from "../../ui/dist/index56.js";
|
|
25
|
+
import { DiscardChangesDialog as pe } from "../../ui/dist/index67.js";
|
|
26
|
+
import { BillDuplicateNotice as me } from "../../ui/dist/index72.js";
|
|
27
|
+
import { BillRejectedBanner as he } from "../../ui/dist/index75.js";
|
|
28
|
+
import { ExtractionNotice as ge } from "../../ui/dist/index93.js";
|
|
29
|
+
import { MarkAsPaidDialog as _e } from "../../ui/dist/index102.js";
|
|
30
|
+
import { UnsavedBillDialog as ve } from "../../ui/dist/index112.js";
|
|
31
|
+
import "../../ui/dist/index.js";
|
|
32
|
+
import { usePayableDuplicateReview as ye } from "./index13.js";
|
|
33
|
+
import "./index14.js";
|
|
34
|
+
import { isEditablePayableStatus as be } from "./index19.js";
|
|
35
|
+
import { canOverrideApprovalPolicy as xe, canReadCounterpartBankAccounts as Se } from "./index20.js";
|
|
36
|
+
import { resolveAmountDueMinorUnits as Ce } from "./index21.js";
|
|
37
|
+
import { usePayableAchInstructions as we } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
|
|
38
|
+
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
39
|
+
import { PayBillFlow as Te } from "./index27.js";
|
|
40
|
+
import "./index28.js";
|
|
41
|
+
import { useMarkAsPaidFlow as Ee } from "./index17.js";
|
|
42
|
+
import "./index18.js";
|
|
43
|
+
import { BILL_CREATE_MESSAGE_LABELS_EN as De, mergeBillCreateScreenCopy as Oe } from "./index48.js";
|
|
44
|
+
import { useBillCreateController as ke } from "./index56.js";
|
|
45
|
+
import { useBillForm as Ae } from "./index58.js";
|
|
46
|
+
import { buildPaymentHistory as je } from "./index3.js";
|
|
47
|
+
import { currentApprovalRound as Me } from "./index4.js";
|
|
48
|
+
import { usePayableApprovalRoundStart as Ne } from "./index32.js";
|
|
49
|
+
import { useApprovalPolicyCardView as Pe } from "./index33.js";
|
|
50
|
+
import { resolveBillRejectionNotice as Fe } from "./index34.js";
|
|
51
|
+
import { useCurrentApprovalRequestId as Ie } from "./index35.js";
|
|
52
|
+
import { usePayableDetailActions as Le } from "./index36.js";
|
|
53
|
+
import { useScheduledPayment as Re } from "./index37.js";
|
|
54
|
+
import { useDraftDelete as ze } from "./index38.js";
|
|
55
|
+
import { buildBillDetailView as Be } from "./index43.js";
|
|
56
|
+
import { resolveEditorDismissal as Ve } from "./index44.js";
|
|
57
|
+
import { buildBillHistory as He } from "./index45.js";
|
|
58
|
+
import { SourceDocumentContainer as Ue } from "./index49.js";
|
|
59
|
+
import { useVendorSectionProps as We } from "./index52.js";
|
|
60
|
+
import { billCreateTestIds as r } from "./index59.js";
|
|
61
|
+
import { useCallback as i, useEffect as Ge, useMemo as a, useRef as Ke, useState as o } from "react";
|
|
62
|
+
import { Fragment as qe, jsx as s, jsxs as Je } from "react/jsx-runtime";
|
|
63
|
+
import { Trash2Icon as Ye } from "lucide-react";
|
|
1
64
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
65
|
+
function Xe(e) {
|
|
66
|
+
let t = [...new Set(e)];
|
|
67
|
+
return t.length > 0 ? t : void 0;
|
|
68
|
+
}
|
|
69
|
+
function Ze({ open: Ze, onOpenChange: c, payableId: Qe, readOnly: l = !1, copy: $e, onCollapse: u, onEdit: et, poweredByBankName: tt }) {
|
|
70
|
+
let d = a(() => Oe($e), [$e]), [f, nt] = o(), [p, rt] = o(!1), [it, at] = o(!1), [m, h] = o(!1), [ot, g] = o(), st = i((e) => {
|
|
71
|
+
g(() => e);
|
|
72
|
+
}, []), [ct, lt] = o(), _ = Qe ?? ct, v = ce(_, { pollWhileOcrProcessing: !0 }), y = oe(_), { initResponse: b } = re(), ut = !!b, x = t(b?.scopes, [n.AccountingConfigReadOrg]), S = ee({ enabled: x }), C = v.data, dt = !_ || !!C, w = !l && dt && !!_ && C?.status !== "draft", ft = !l && !!C && !be(C?.status), T = l || ft, E = Ae({
|
|
73
|
+
payable: C,
|
|
74
|
+
lineItems: y.lineItems
|
|
75
|
+
}), D = C?.counterpart_id;
|
|
76
|
+
Ge(() => {
|
|
77
|
+
p || D && (nt(D), rt(!0));
|
|
78
|
+
}, [p, D]);
|
|
79
|
+
let pt = i((e) => {
|
|
80
|
+
rt(!0), nt(e);
|
|
81
|
+
}, []), O = Re({
|
|
82
|
+
payableId: _,
|
|
83
|
+
scheduledPaymentDate: C?.scheduled_payment_date,
|
|
84
|
+
enabled: l || w
|
|
85
|
+
}), k = Se(b?.scopes), mt = t(b?.scopes, [n.PayableWriteOrg]), A = t(b?.scopes, [n.CounterpartWriteOrg]) && mt, j = A && le(C?.status) && !O.hasScheduledPayment && !O.isResolving, ht = j && k, gt = j || A && C?.status === "rejected", M = We({
|
|
86
|
+
payableId: _,
|
|
87
|
+
counterpartId: l ? D : f,
|
|
88
|
+
payableCounterpartId: D,
|
|
89
|
+
isVendorKnown: l ? !!C : dt,
|
|
90
|
+
onCounterpartChange: pt,
|
|
91
|
+
requiredError: E.errors?.vendor,
|
|
92
|
+
payableCounterpartBankAccountId: C?.counterpart_bank_account_id ?? void 0,
|
|
93
|
+
extractedVendor: C?.counterpart_raw_data ?? void 0,
|
|
94
|
+
readOnly: l,
|
|
95
|
+
canEditVendor: !l || ht,
|
|
96
|
+
canEditPaymentInstructions: !l || j,
|
|
97
|
+
canAddPaymentInstructions: !l || gt,
|
|
98
|
+
confirmDiscard: st
|
|
99
|
+
}), N = l && (M.activePayToOperation === "missingInstructions" ? gt : M.activePayToOperation === "vendor" ? ht : M.activePayToOperation === "existingInstructions" && j), _t = !!(_ && p) && !f, P = v.refetch, vt = i(async () => {
|
|
100
|
+
let { data: e } = await P();
|
|
101
|
+
return e?.status ?? void 0;
|
|
102
|
+
}, [P]), yt = se(), [bt, xt] = o(!1), St = i(async () => {
|
|
103
|
+
if (!N) {
|
|
104
|
+
M.discardPayToEdits();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
xt(!0);
|
|
108
|
+
try {
|
|
109
|
+
let t;
|
|
110
|
+
try {
|
|
111
|
+
t = await M.prepareVendorForSave();
|
|
112
|
+
} catch {
|
|
113
|
+
e.error(d.detail.paymentInstructionsSaveError);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!t.ok) return;
|
|
117
|
+
let n = t.counterpartBankAccountId;
|
|
118
|
+
if (_ && n && n !== C?.counterpart_bank_account_id) try {
|
|
119
|
+
await yt.mutateAsync({
|
|
120
|
+
path: { payable_id: _ },
|
|
121
|
+
body: { counterpart_bank_account_id: n }
|
|
122
|
+
});
|
|
123
|
+
return;
|
|
124
|
+
} catch {
|
|
125
|
+
e.error(d.detail.paymentInstructionsLinkError);
|
|
126
|
+
}
|
|
127
|
+
await P();
|
|
128
|
+
} finally {
|
|
129
|
+
xt(!1);
|
|
130
|
+
}
|
|
131
|
+
}, [
|
|
132
|
+
N,
|
|
133
|
+
d.detail.paymentInstructionsLinkError,
|
|
134
|
+
d.detail.paymentInstructionsSaveError,
|
|
135
|
+
yt,
|
|
136
|
+
C?.counterpart_bank_account_id,
|
|
137
|
+
_,
|
|
138
|
+
P,
|
|
139
|
+
M
|
|
140
|
+
]);
|
|
141
|
+
Ge(() => {
|
|
142
|
+
l && M.isEditingPayTo && !N && M.discardPayToEdits();
|
|
143
|
+
}, [
|
|
144
|
+
N,
|
|
145
|
+
l,
|
|
146
|
+
M.discardPayToEdits,
|
|
147
|
+
M.isEditingPayTo
|
|
148
|
+
]);
|
|
149
|
+
let Ct = a(() => w ? { draftSaved: De.submittedSaved } : void 0, [w]), F = ke({
|
|
150
|
+
payableId: Qe,
|
|
151
|
+
form: E,
|
|
152
|
+
labels: Ct,
|
|
153
|
+
counterpartId: f,
|
|
154
|
+
isVendorPending: M.mode === "creating",
|
|
155
|
+
clearCounterpart: _t,
|
|
156
|
+
prepareVendorForSave: M.prepareVendorForSave,
|
|
157
|
+
onPayableCreated: lt,
|
|
158
|
+
onSaved: lt,
|
|
159
|
+
onDraftSaved: () => c(!1),
|
|
160
|
+
onFinalized: () => c(!1),
|
|
161
|
+
readSavedStatus: w ? vt : void 0
|
|
162
|
+
}), wt = !!(F.isSavingDraft || F.isFinalizing), I = l ? _ : void 0, L = Ie({
|
|
163
|
+
payableId: I,
|
|
164
|
+
status: C?.status
|
|
165
|
+
}), Tt = Ke(null), Et = ue(C), R = we({
|
|
166
|
+
counterpartId: l ? D : void 0,
|
|
167
|
+
currency: C?.currency,
|
|
168
|
+
currentBankAccountId: l ? C?.counterpart_bank_account_id ?? void 0 : void 0,
|
|
169
|
+
enabled: k && l
|
|
170
|
+
}), z = Ee({
|
|
171
|
+
payableId: I,
|
|
172
|
+
amountDueMinorUnits: Ce(C) ?? 0,
|
|
173
|
+
amountToPayMinorUnits: C?.amount_to_pay ?? void 0,
|
|
174
|
+
currencyCode: C?.currency ?? void 0,
|
|
175
|
+
dueDate: C?.due_date,
|
|
176
|
+
hasScheduledPayment: O.hasScheduledPayment,
|
|
177
|
+
labels: d.markAsPaid
|
|
178
|
+
}), B = Pe({
|
|
179
|
+
payableId: I,
|
|
180
|
+
approvalPolicyId: C?.approval_policy_id,
|
|
181
|
+
enabled: l,
|
|
182
|
+
copy: d.approvalPolicyCopy
|
|
183
|
+
}), Dt = xe({
|
|
184
|
+
status: C?.status,
|
|
185
|
+
scopes: b?.scopes,
|
|
186
|
+
arePendingApproversUnknown: B.isLoading,
|
|
187
|
+
hasApprovalPolicy: !!C?.approval_policy_id,
|
|
188
|
+
hasWaitingRequest: L.hasWaitingRequest
|
|
189
|
+
}), Ot = !!L.id, kt = L.isLoading || B.isLoading, At = a(() => Xe(B.pendingApprovers.flatMap((e) => e.names)), [B.pendingApprovers]), jt = l || w ? _ : void 0, Mt = l ? et : void 0, { actions: V, decisionDialog: Nt, isActionPending: Pt } = Le({
|
|
190
|
+
payableId: jt,
|
|
191
|
+
status: C?.status,
|
|
192
|
+
currentApprovalRequestId: L.id,
|
|
193
|
+
arePendingApproversUnknown: B.isLoading,
|
|
194
|
+
hasScheduledPayment: O.hasScheduledPayment,
|
|
195
|
+
scheduledPaymentIntentId: O.scheduledPaymentIntentId,
|
|
196
|
+
isScheduledPaymentUnknown: O.isResolving,
|
|
197
|
+
isPayabilityUnknown: R.isLoading,
|
|
198
|
+
hasApprovalPolicy: !!C?.approval_policy_id,
|
|
199
|
+
hasWaitingRequest: L.hasWaitingRequest,
|
|
200
|
+
pendingApprovers: B.pendingApprovers,
|
|
201
|
+
labels: d.actions,
|
|
202
|
+
isMarkAsPaidPending: z.isPending,
|
|
203
|
+
onMarkAsPaidSelect: z.open,
|
|
204
|
+
onPayBillSelect: () => Tt.current?.open(),
|
|
205
|
+
onEditSelect: Mt,
|
|
206
|
+
onActionSucceeded: (e) => {
|
|
207
|
+
if (e === "reopen") {
|
|
208
|
+
Mt?.();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
w && c(!1);
|
|
212
|
+
}
|
|
213
|
+
}), H = ze({
|
|
214
|
+
payableId: _,
|
|
215
|
+
status: C?.status,
|
|
216
|
+
enabled: !l,
|
|
217
|
+
labels: d.deleteDraft,
|
|
218
|
+
onDeleted: () => c(!1)
|
|
219
|
+
}), U = wt || Pt, W = v.isLoading || y.isResolving || S.isResolving || R.isLoading, G = v.isError || y.isError || S.isError, Ft = a(() => [...H.menuItems, ...w || l && !W && !G ? V.menu.map((e) => ({
|
|
220
|
+
id: e.id,
|
|
221
|
+
label: e.label,
|
|
222
|
+
onSelect: e.onSelect,
|
|
223
|
+
disabled: e.disabled,
|
|
224
|
+
icon: e.icon,
|
|
225
|
+
sectionHeading: e.sectionHeading
|
|
226
|
+
})) : []], [
|
|
227
|
+
V.menu,
|
|
228
|
+
H.menuItems,
|
|
229
|
+
w,
|
|
230
|
+
l,
|
|
231
|
+
W,
|
|
232
|
+
G
|
|
233
|
+
]), K = a(() => (S.data?.data ?? []).map((e) => ({
|
|
234
|
+
value: e.id,
|
|
235
|
+
label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
|
|
236
|
+
})), [S.data]), q;
|
|
237
|
+
ut && (x ? S.isError ? q = d.lineItemsGlCodeUnavailable.loadError : !S.isResolving && K.length === 0 && (q = d.lineItemsGlCodeUnavailable.empty) : q = d.lineItemsGlCodeUnavailable.noAccess);
|
|
238
|
+
let It = !ut || !!q || S.isResolving, Lt = x && !S.isResolving && !S.isError, J = ae(I), Rt = C?.status === "rejected" || !l && w, zt = t(b?.scopes, [n.ApprovalRequestReadOrg]), Bt = Rt && zt, Vt = t(b?.scopes, [n.UserReadOrg]), Y = te({ enabled: (l || Rt) && Vt }), Ht = a(() => He(J.data?.data ?? [], Y.data?.data ?? [], d.history), [
|
|
239
|
+
J.data,
|
|
240
|
+
Y.data,
|
|
241
|
+
d.history
|
|
242
|
+
]), Ut = Ne({
|
|
243
|
+
payableId: _,
|
|
244
|
+
enabled: Bt
|
|
245
|
+
}), Wt = ie(_, { enabled: Bt }), Gt = a(() => Me(Wt.data?.data, Ut.roundStartedAt), [Wt.data, Ut.roundStartedAt]), X = a(() => Fe({
|
|
246
|
+
payableStatus: C?.status,
|
|
247
|
+
approvalRequests: Gt,
|
|
248
|
+
users: Y.data?.data ?? [],
|
|
249
|
+
payableUpdatedAt: C?.updated_at,
|
|
250
|
+
labels: d.detail
|
|
251
|
+
}), [
|
|
252
|
+
C?.status,
|
|
253
|
+
C?.updated_at,
|
|
254
|
+
Gt,
|
|
255
|
+
Y.data,
|
|
256
|
+
d.detail
|
|
257
|
+
]), Kt = a(() => je({
|
|
258
|
+
records: O.paymentRecords,
|
|
259
|
+
events: J.data?.data ?? [],
|
|
260
|
+
currencyCode: C?.currency,
|
|
261
|
+
labels: d.detail
|
|
262
|
+
}), [
|
|
263
|
+
O.paymentRecords,
|
|
264
|
+
J.data,
|
|
265
|
+
C?.currency,
|
|
266
|
+
d.detail
|
|
267
|
+
]), qt = a(() => {
|
|
268
|
+
if (!l || !C) return;
|
|
269
|
+
let e = Be({
|
|
270
|
+
payable: C,
|
|
271
|
+
lineItems: y.lineItems,
|
|
272
|
+
glCodeOptions: K,
|
|
273
|
+
glCodeRosterAvailable: Lt,
|
|
274
|
+
history: Ht,
|
|
275
|
+
paymentHistory: Kt,
|
|
276
|
+
approvalPolicy: B.view,
|
|
277
|
+
labels: d.detail,
|
|
278
|
+
hasScheduledPayment: O.hasScheduledPayment,
|
|
279
|
+
rejection: X,
|
|
280
|
+
payableAchInstructions: R.achInstructions,
|
|
281
|
+
payableAchInstructionsReadable: k && !R.isError
|
|
282
|
+
});
|
|
283
|
+
return M.mode === "resolved" && M.summary ? {
|
|
284
|
+
...e,
|
|
285
|
+
payTo: M.summary
|
|
286
|
+
} : e;
|
|
287
|
+
}, [
|
|
288
|
+
O.hasScheduledPayment,
|
|
289
|
+
B.view,
|
|
290
|
+
k,
|
|
291
|
+
d.detail,
|
|
292
|
+
K,
|
|
293
|
+
Lt,
|
|
294
|
+
Ht,
|
|
295
|
+
y.lineItems,
|
|
296
|
+
C,
|
|
297
|
+
R.achInstructions,
|
|
298
|
+
R.isError,
|
|
299
|
+
Kt,
|
|
300
|
+
l,
|
|
301
|
+
X,
|
|
302
|
+
M.mode,
|
|
303
|
+
M.summary
|
|
304
|
+
]), Jt = C?.source_of_payable_data === "ocr", Z = Et?.name, Yt = l ? Z ? d.viewTitle(Z) : d.readOnlyTitle : Z && (Jt || w) ? d.extractedTitle(Z) : d.newTitle, Xt = l && C?.created_at ? d.addedOn(ne(C.created_at.slice(0, 10))) : void 0, Q = i((e) => {
|
|
305
|
+
let t = () => {
|
|
306
|
+
M.discardPayToEdits(), e?.();
|
|
307
|
+
};
|
|
308
|
+
M.hasUnsavedVendorChanges ? st(t) : t();
|
|
309
|
+
}, [st, M]), Zt = i(() => {
|
|
310
|
+
if (l && M.isEditingPayTo) {
|
|
311
|
+
Q(() => c(!1));
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
let e = E.isDirty || M.hasUnsavedVendorChanges || !!F.stagedFile || F.isFileDeletionPending;
|
|
315
|
+
switch (Ve({
|
|
316
|
+
isUnsavedPromptOpen: m,
|
|
317
|
+
isLocked: T,
|
|
318
|
+
isDirty: e
|
|
319
|
+
})) {
|
|
320
|
+
case "dismiss-prompt":
|
|
321
|
+
h(!1);
|
|
322
|
+
return;
|
|
323
|
+
case "prompt":
|
|
324
|
+
h(!0);
|
|
325
|
+
return;
|
|
326
|
+
default: c(!1);
|
|
327
|
+
}
|
|
328
|
+
}, [
|
|
329
|
+
F.isFileDeletionPending,
|
|
330
|
+
F.stagedFile,
|
|
331
|
+
E.isDirty,
|
|
332
|
+
T,
|
|
333
|
+
m,
|
|
334
|
+
Q,
|
|
335
|
+
c,
|
|
336
|
+
l,
|
|
337
|
+
M.hasUnsavedVendorChanges,
|
|
338
|
+
M.isEditingPayTo
|
|
339
|
+
]), Qt = i(() => {
|
|
340
|
+
if (M.isEditingPayTo) {
|
|
341
|
+
Q(u);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
u?.();
|
|
345
|
+
}, [
|
|
346
|
+
Q,
|
|
347
|
+
u,
|
|
348
|
+
M.isEditingPayTo
|
|
349
|
+
]), $t = i(() => {
|
|
350
|
+
h(!1), c(!1);
|
|
351
|
+
}, [c]), en = y.isResolving, tn = i(async () => {
|
|
352
|
+
if (en) return;
|
|
353
|
+
let e = await F.saveDraft();
|
|
354
|
+
h(!1), e && c(!1);
|
|
355
|
+
}, [
|
|
356
|
+
F,
|
|
357
|
+
en,
|
|
358
|
+
c
|
|
359
|
+
]), $ = ye({
|
|
360
|
+
payable: C,
|
|
361
|
+
onRemoved: () => c(!1),
|
|
362
|
+
canManage: mt
|
|
363
|
+
}), nn = i((e) => {
|
|
364
|
+
if (!(U || $.isBusy)) return e ? c(!0) : Zt();
|
|
365
|
+
}, [
|
|
366
|
+
$.isBusy,
|
|
367
|
+
U,
|
|
368
|
+
Zt,
|
|
369
|
+
c
|
|
370
|
+
]), rn = $.isPossibleDuplicate, an = !l && Jt && !it, on = !l && !!X, sn = on || rn || an ? /* @__PURE__ */ Je(qe, { children: [
|
|
371
|
+
on && X ? /* @__PURE__ */ s(he, {
|
|
372
|
+
...X,
|
|
373
|
+
labels: d.rejectedBanner
|
|
374
|
+
}) : null,
|
|
375
|
+
rn ? /* @__PURE__ */ s(me, {
|
|
376
|
+
onNotADuplicate: $.onNotADuplicate,
|
|
377
|
+
onRemoveBill: $.onRemoveBill,
|
|
378
|
+
isActionDisabled: $.isBusy,
|
|
379
|
+
labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
|
|
380
|
+
testId: r.duplicateNotice
|
|
381
|
+
}) : null,
|
|
382
|
+
an ? /* @__PURE__ */ s(ge, { onDismiss: () => at(!0) }) : null
|
|
383
|
+
] }) : void 0;
|
|
384
|
+
return /* @__PURE__ */ Je(qe, { children: [
|
|
385
|
+
/* @__PURE__ */ s(de, {
|
|
386
|
+
open: Ze,
|
|
387
|
+
onOpenChange: nn,
|
|
388
|
+
title: Yt,
|
|
389
|
+
subtitle: Xt,
|
|
390
|
+
notice: sn,
|
|
391
|
+
vendor: {
|
|
392
|
+
...M,
|
|
393
|
+
testId: r.vendorSection
|
|
394
|
+
},
|
|
395
|
+
values: E.values,
|
|
396
|
+
errors: E.errors,
|
|
397
|
+
onChange: E.onChange,
|
|
398
|
+
lineItems: {
|
|
399
|
+
items: E.lineItemRows,
|
|
400
|
+
glCodeOptions: K,
|
|
401
|
+
glCodeDisabled: It,
|
|
402
|
+
glCodeUnavailableMessage: q,
|
|
403
|
+
discount: E.discount,
|
|
404
|
+
onDiscountChange: E.onDiscountChange,
|
|
405
|
+
tax: E.tax,
|
|
406
|
+
onTaxChange: E.onTaxChange,
|
|
407
|
+
total: E.total,
|
|
408
|
+
onTotalChange: E.onTotalChange,
|
|
409
|
+
onAddLineItem: E.onAddLineItem,
|
|
410
|
+
errors: E.lineItemErrors,
|
|
411
|
+
totalsErrors: E.totalsErrors,
|
|
412
|
+
testId: r.lineItems
|
|
413
|
+
},
|
|
414
|
+
documentPanel: /* @__PURE__ */ s(Ue, {
|
|
415
|
+
payableId: _,
|
|
416
|
+
readOnly: T,
|
|
417
|
+
isDocumentPending: !!_ && !C?.file && (v.isLoading || C?.ocr_status === "processing"),
|
|
418
|
+
file: C?.file ? {
|
|
419
|
+
id: C.file.id,
|
|
420
|
+
name: C.file.name,
|
|
421
|
+
url: C.file.url,
|
|
422
|
+
mimetype: C.file.mimetype
|
|
423
|
+
} : void 0,
|
|
424
|
+
staging: {
|
|
425
|
+
stagedFile: F.stagedFile,
|
|
426
|
+
onFileStaged: F.stageFile,
|
|
427
|
+
onClearStagedFile: F.clearStagedFile,
|
|
428
|
+
isSaving: wt
|
|
429
|
+
},
|
|
430
|
+
deletion: {
|
|
431
|
+
isPending: F.isFileDeletionPending,
|
|
432
|
+
onRequest: F.requestFileDeletion,
|
|
433
|
+
onDetachNow: F.detachFileNow,
|
|
434
|
+
isDeleting: F.isDeletingFile,
|
|
435
|
+
hasFailed: F.hasFileDeletionFailed
|
|
436
|
+
}
|
|
437
|
+
}),
|
|
438
|
+
menuItems: Ft,
|
|
439
|
+
readOnly: T,
|
|
440
|
+
detail: l ? {
|
|
441
|
+
view: qt,
|
|
442
|
+
actions: V,
|
|
443
|
+
scheduledSummary: O.hasScheduledPayment && O.scheduledDateLabel ? d.scheduledSummary(O.scheduledDateLabel) : void 0,
|
|
444
|
+
scheduledStatusLabel: O.hasScheduledPayment && O.scheduledDateLabel ? d.scheduledStatusBadge(O.scheduledDateLabel) : void 0,
|
|
445
|
+
showApprovalOverrideNotice: !kt && !Ot && Dt && !!C?.approval_policy_id,
|
|
446
|
+
awaitingApprovalNotice: !kt && !Ot && !Dt && C?.status === "approve_in_progress" && C?.approval_policy_id ? At ? d.awaitingApprovalNotice(At) : d.awaitingApprovalUnknownNotice : void 0,
|
|
447
|
+
payTo: {
|
|
448
|
+
onEdit: M.mode === "resolved" ? M.onEdit : void 0,
|
|
449
|
+
paymentInstructions: M.mode === "resolved" ? M.paymentInstructions : void 0,
|
|
450
|
+
editForm: M.mode === "creating" ? M.newVendorForm : void 0
|
|
451
|
+
},
|
|
452
|
+
hideMissingPaymentInstructions: C?.status === "paid" || C?.status === "canceled",
|
|
453
|
+
isLoading: W,
|
|
454
|
+
isError: G,
|
|
455
|
+
paymentHistoryError: O.isError || J.isError,
|
|
456
|
+
paymentHistoryLoading: O.isResolving || J.isLoading
|
|
457
|
+
} : void 0,
|
|
458
|
+
detailEdit: l && M.isEditingPayTo && N ? {
|
|
459
|
+
onSave: St,
|
|
460
|
+
onCancel: () => Q(),
|
|
461
|
+
isSaving: bt
|
|
462
|
+
} : void 0,
|
|
463
|
+
isLineItemsLoading: y.isResolving,
|
|
464
|
+
isSaving: U || bt,
|
|
465
|
+
isSavingDraft: F.isSavingDraft,
|
|
466
|
+
isSubmitting: F.isFinalizing,
|
|
467
|
+
onCancel: Zt,
|
|
468
|
+
onCollapse: l ? Qt : void 0,
|
|
469
|
+
onSaveDraft: F.saveDraft,
|
|
470
|
+
onFinalize: F.finalize,
|
|
471
|
+
scrollToErrorToken: F.scrollToErrorToken,
|
|
472
|
+
showSubmit: !T && dt,
|
|
473
|
+
testId: r.dialog
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ s(ve, {
|
|
476
|
+
open: m,
|
|
477
|
+
onSaveDraft: tn,
|
|
478
|
+
onDiscard: $t,
|
|
479
|
+
onCancel: () => h(!1),
|
|
480
|
+
isSaving: F.isSavingDraft,
|
|
481
|
+
isSaveDraftDisabled: en,
|
|
482
|
+
labels: d.unsavedChanges,
|
|
483
|
+
testId: r.unsavedDialog,
|
|
484
|
+
saveDraftTestId: r.unsavedSaveDraft,
|
|
485
|
+
discardTestId: r.unsavedDiscard,
|
|
486
|
+
closeTestId: r.unsavedClose
|
|
487
|
+
}),
|
|
488
|
+
/* @__PURE__ */ s(pe, {
|
|
489
|
+
open: !!ot,
|
|
490
|
+
onDiscard: () => {
|
|
491
|
+
let e = ot;
|
|
492
|
+
g(void 0), e?.();
|
|
493
|
+
},
|
|
494
|
+
onKeepEditing: () => g(void 0),
|
|
495
|
+
labels: d.discardChanges,
|
|
496
|
+
testId: r.discardDialog,
|
|
497
|
+
discardTestId: r.discardConfirm
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ s(fe, {
|
|
500
|
+
...Nt,
|
|
501
|
+
labels: { cancelButton: d.actions.decisionDialog.cancelButton },
|
|
502
|
+
testId: r.decisionDialog,
|
|
503
|
+
confirmTestId: r.decisionConfirm,
|
|
504
|
+
reasonTestId: r.decisionReason
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ s(fe, {
|
|
507
|
+
...H.dialog,
|
|
508
|
+
labels: { cancelButton: d.actions.decisionDialog.cancelButton },
|
|
509
|
+
testId: r.deleteDraftDialog,
|
|
510
|
+
confirmTestId: r.deleteDraftConfirm
|
|
511
|
+
}),
|
|
512
|
+
/* @__PURE__ */ s(fe, {
|
|
513
|
+
open: $.removeConfirmation.open,
|
|
514
|
+
copy: $.removeConfirmation.copy,
|
|
515
|
+
onConfirm: $.removeConfirmation.onConfirm,
|
|
516
|
+
onCancel: $.removeConfirmation.onCancel,
|
|
517
|
+
isPending: $.removeConfirmation.isPending,
|
|
518
|
+
confirmIcon: /* @__PURE__ */ s(Ye, {}),
|
|
519
|
+
labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
|
|
520
|
+
testId: r.duplicateRemoveDialog,
|
|
521
|
+
confirmTestId: r.duplicateRemoveConfirm
|
|
522
|
+
}),
|
|
523
|
+
/* @__PURE__ */ s(_e, { ...z.dialogProps }),
|
|
524
|
+
l && C ? /* @__PURE__ */ s(Te, {
|
|
525
|
+
ref: Tt,
|
|
526
|
+
payable: C,
|
|
527
|
+
onMissingAchInstructions: A ? M.openPaymentInstructions : void 0,
|
|
528
|
+
poweredByBankName: tt,
|
|
529
|
+
labels: d.payBill
|
|
530
|
+
}) : null
|
|
531
|
+
] });
|
|
532
|
+
}
|
|
20
533
|
//#endregion
|
|
21
|
-
export {
|
|
534
|
+
export { Ze as BillCreateDialog, Ze as default };
|