@tesouro/embedded-components-react 0.5.303 → 0.5.305
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/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +7 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +8 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -157
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +20 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +13 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +153 -89
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +17 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +23 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +42 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +93 -107
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +77 -185
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +3 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +55 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +111 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +184 -463
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +78 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +61 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +115 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +449 -216
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +116 -42
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +11 -249
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +85 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +80 -648
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +240 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +44 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +38 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +242 -240
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +25 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +538 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +3 -66
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +239 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +67 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +227 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +82 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +45 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +4 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index29.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidgetNative/BillsTab.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,540 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.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 "../../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as te } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import { useOrganizationUserNames as ne } from "../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
|
|
12
|
+
import "../../../../shared/feature/dist/index.js";
|
|
13
|
+
import { hasUnpaidBalance as re } from "../../../util/dist/lib/derivePayableStatus.js";
|
|
14
|
+
import { isEditablePayableStatus as ie } from "../../../util/dist/lib/isEditablePayableStatus.js";
|
|
15
|
+
import { resolveVendor as ae } from "../../../util/dist/lib/resolveVendor.js";
|
|
16
|
+
import { formatGlCodeLabel as oe, resolveGlCodeAvailability as se } from "./index13.js";
|
|
17
|
+
import { BillDecisionDialog as r } from "../../../ui/dist/index4.js";
|
|
18
|
+
import "../../../ui/dist/index.js";
|
|
19
|
+
import { BillDialogScreen as ce } from "../../ui/dist/index31.js";
|
|
20
|
+
import { BillDuplicateNotice as le } from "../../ui/dist/index37.js";
|
|
21
|
+
import { BillRejectedBanner as ue } from "../../ui/dist/index40.js";
|
|
22
|
+
import { DiscardChangesDialog as de } from "../../ui/dist/index43.js";
|
|
23
|
+
import { ExtractionNotice as fe } from "../../ui/dist/index46.js";
|
|
24
|
+
import { UnsavedBillDialog as pe } from "../../ui/dist/index52.js";
|
|
25
|
+
import "../../ui/dist/index.js";
|
|
26
|
+
import { BILL_CREATE_MESSAGE_LABELS_EN as me, mergeBillDialogCopy as he } from "./index29.js";
|
|
27
|
+
import { useAllPayableLineItemsQuery as ge } from "../../data-access/dist/index4.js";
|
|
28
|
+
import { usePayableQuery as _e } from "../../data-access/dist/index21.js";
|
|
29
|
+
import "../../data-access/dist/index.js";
|
|
30
|
+
import { useBillCreateController as ve } from "./index38.js";
|
|
31
|
+
import { useBillForm as ye } from "./index40.js";
|
|
32
|
+
import { buildPaymentHistory as be } from "./index2.js";
|
|
33
|
+
import { usePayableDuplicateReview as xe } from "./index5.js";
|
|
34
|
+
import { canOverrideApprovalPolicy as Se, canReadCounterpartBankAccounts as Ce } from "./index6.js";
|
|
35
|
+
import { useApprovalPolicyCardView as we } from "./index12.js";
|
|
36
|
+
import { resolveApprovalNotices as Te } from "./index14.js";
|
|
37
|
+
import { resolvePaymentInstructionsGestures as Ee } from "./index15.js";
|
|
38
|
+
import { useBillRejectionNotice as De } from "./index17.js";
|
|
39
|
+
import { useCurrentApprovalRequestId as Oe } from "./index18.js";
|
|
40
|
+
import { usePayableAuditHistory as ke } from "./index19.js";
|
|
41
|
+
import { usePayableDetailActions as Ae } from "./index20.js";
|
|
42
|
+
import { useScheduledDateLabel as je } from "./index21.js";
|
|
43
|
+
import { useScheduledPayment as Me } from "./index22.js";
|
|
44
|
+
import { useDraftDelete as Ne } from "./index23.js";
|
|
45
|
+
import { buildBillDetailView as Pe } from "./index25.js";
|
|
46
|
+
import { resolveEditorDismissal as Fe } from "./index26.js";
|
|
47
|
+
import { SourceDocumentContainer as Ie } from "./index30.js";
|
|
48
|
+
import { usePayableAchInstructions as Le } from "../../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
|
|
49
|
+
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
50
|
+
import { useVendorSectionProps as Re } from "./index33.js";
|
|
51
|
+
import { usePayToSave as ze } from "./index34.js";
|
|
52
|
+
import { billDialogTestIds as i } from "./index41.js";
|
|
53
|
+
import { useCallback as a, useEffect as Be, useMemo as o, useRef as Ve, useState as s } from "react";
|
|
54
|
+
import { Fragment as He, jsx as c, jsxs as Ue } from "react/jsx-runtime";
|
|
55
|
+
import { Trash2Icon as We } from "lucide-react";
|
|
2
56
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js
|
|
3
|
-
|
|
57
|
+
function l({ open: l, onOpenChange: u, payableId: d, initialCounterpartId: Ge, readOnly: f = !1, copy: p, onCollapse: m, onEdit: Ke, onOpenBill: h, renderPaymentFlows: qe }) {
|
|
58
|
+
let g = o(() => he(p), [p]), _ = p?.messages, v = o(() => ({
|
|
59
|
+
...me,
|
|
60
|
+
..._
|
|
61
|
+
}), [_]), Je = d ? void 0 : Ge, [Ye, Xe] = s(Je), [y, Ze] = s(!!Je), [Qe, $e] = s(!1), [b, x] = s(!1), [et, tt] = s(), S = a((e) => {
|
|
62
|
+
tt(() => e);
|
|
63
|
+
}, []), [nt, rt] = s(), C = d ?? nt, w = _e(C, { pollWhileOcrProcessing: !0 }), T = ge(C), { initResponse: E } = te(), it = !!E, at = t(E?.scopes, [n.AccountingConfigReadOrg]), D = ee({ enabled: at }), O = w.data, k = !C || !!O, A = !f && k && !!C && O?.status !== "draft", ot = !f && !!O && !ie(O?.status), j = f || ot, M = ye({
|
|
64
|
+
payable: O,
|
|
65
|
+
lineItems: T.lineItems,
|
|
66
|
+
labels: v
|
|
67
|
+
}), N = O?.counterpart_id ?? void 0;
|
|
68
|
+
Be(() => {
|
|
69
|
+
y || N && (Xe(N), Ze(!0));
|
|
70
|
+
}, [y, N]);
|
|
71
|
+
let st = a((e) => {
|
|
72
|
+
Ze(!0), Xe(e);
|
|
73
|
+
}, []), P = Me({
|
|
74
|
+
payableId: C,
|
|
75
|
+
scheduledPaymentDate: O?.scheduled_payment_date,
|
|
76
|
+
enabled: f || A
|
|
77
|
+
}), F = je({
|
|
78
|
+
hasScheduledPayment: P.hasScheduledPayment,
|
|
79
|
+
scheduledDate: P.scheduledDate,
|
|
80
|
+
labels: g.scheduledRelativeDay
|
|
81
|
+
}), I = Ce(E?.scopes), ct = t(E?.scopes, [n.PayableWriteOrg]), lt = t(E?.scopes, [n.CounterpartWriteOrg]) && ct, L = lt && re(O?.status) && !P.hasScheduledPayment && !P.isResolving, ut = L && I, dt = L || lt && O?.status === "rejected", ft = !f && k && (!C || O?.status === "draft") && !P.hasScheduledPayment && !P.isResolving, R = Re({
|
|
82
|
+
payableId: C,
|
|
83
|
+
counterpartId: f ? N : Ye,
|
|
84
|
+
payableCounterpartId: N,
|
|
85
|
+
isVendorKnown: f ? !!O : k,
|
|
86
|
+
onCounterpartChange: st,
|
|
87
|
+
requiredError: M.errors?.vendor,
|
|
88
|
+
payableCounterpartBankAccountId: O?.counterpart_bank_account_id ?? void 0,
|
|
89
|
+
extractedVendor: O?.counterpart_raw_data ?? void 0,
|
|
90
|
+
readOnly: f,
|
|
91
|
+
canEditVendor: !f || ut,
|
|
92
|
+
canEditPaymentInstructions: !f || L,
|
|
93
|
+
canAddPaymentInstructions: !f || dt,
|
|
94
|
+
confirmDiscard: S,
|
|
95
|
+
labels: p?.vendorSection
|
|
96
|
+
}), pt = R.activePayToOperation === "missingInstructions" ? ft || dt : R.activePayToOperation === "existingInstructions" ? ft || L : R.activePayToOperation === "vendor" && f ? ut : !1, mt = !!(C && y) && !Ye, z = w.refetch, ht = a(async () => {
|
|
97
|
+
let { data: e } = await z();
|
|
98
|
+
return e?.status ?? void 0;
|
|
99
|
+
}, [z]), { vendorWithInlineSave: B, isSavingPayToEdits: gt } = ze({
|
|
100
|
+
vendor: R,
|
|
101
|
+
payableId: C,
|
|
102
|
+
linkedCounterpartId: O?.counterpart_id,
|
|
103
|
+
linkedBankAccountId: O?.counterpart_bank_account_id,
|
|
104
|
+
canSavePayToEdits: pt,
|
|
105
|
+
readOnly: f,
|
|
106
|
+
refreshPayable: z,
|
|
107
|
+
labels: g.detail
|
|
108
|
+
}), _t = o(() => A ? {
|
|
109
|
+
..._,
|
|
110
|
+
draftSaved: v.submittedSaved
|
|
111
|
+
} : _, [
|
|
112
|
+
A,
|
|
113
|
+
_,
|
|
114
|
+
v.submittedSaved
|
|
115
|
+
]), V = ve({
|
|
116
|
+
payableId: d,
|
|
117
|
+
form: M,
|
|
118
|
+
labels: _t,
|
|
119
|
+
counterpartId: Ye,
|
|
120
|
+
isVendorPending: R.mode === "creating" || R.isPendingVendor,
|
|
121
|
+
onVendorIncomplete: R.revealIncompleteVendor,
|
|
122
|
+
clearCounterpart: mt,
|
|
123
|
+
prepareVendorForSave: R.prepareVendorForSave,
|
|
124
|
+
onPayableCreated: rt,
|
|
125
|
+
onSaved: rt,
|
|
126
|
+
onDraftSaved: () => u(!1),
|
|
127
|
+
onFinalized: () => u(!1),
|
|
128
|
+
readSavedStatus: A ? ht : void 0
|
|
129
|
+
}), vt = !!(V.isSavingDraft || V.isFinalizing || R.isVendorSavePending), H = f ? C : void 0, U = Oe({
|
|
130
|
+
payableId: H,
|
|
131
|
+
status: O?.status
|
|
132
|
+
}), W = Ve(null), [yt, bt] = s(!1), xt = ae(O), G = Le({
|
|
133
|
+
counterpartId: f ? N : void 0,
|
|
134
|
+
currency: O?.currency,
|
|
135
|
+
currentBankAccountId: f ? O?.counterpart_bank_account_id ?? void 0 : void 0,
|
|
136
|
+
enabled: I && f
|
|
137
|
+
}), K = we({
|
|
138
|
+
payableId: H,
|
|
139
|
+
approvalPolicyId: O?.approval_policy_id,
|
|
140
|
+
enabled: f,
|
|
141
|
+
copy: g.approvalPolicyCopy
|
|
142
|
+
}), St = Se({
|
|
143
|
+
status: O?.status,
|
|
144
|
+
scopes: E?.scopes,
|
|
145
|
+
arePendingApproversUnknown: K.isLoading,
|
|
146
|
+
hasApprovalPolicy: !!O?.approval_policy_id,
|
|
147
|
+
hasWaitingRequest: U.hasWaitingRequest
|
|
148
|
+
}), Ct = Te({
|
|
149
|
+
isCapabilityUnknown: U.isLoading || K.isLoading,
|
|
150
|
+
canApproveNow: !!U.id,
|
|
151
|
+
canOverridePolicy: St,
|
|
152
|
+
status: O?.status,
|
|
153
|
+
hasApprovalPolicy: !!O?.approval_policy_id,
|
|
154
|
+
pendingApproverNames: K.pendingApprovers.flatMap((e) => e.names),
|
|
155
|
+
labels: g
|
|
156
|
+
}), wt = f || A ? C : void 0, Tt = f ? Ke : void 0, q = a((e) => {
|
|
157
|
+
let t = () => {
|
|
158
|
+
R.discardPayToEdits(), e?.();
|
|
159
|
+
};
|
|
160
|
+
R.hasUnsavedVendorChanges ? S(t) : t();
|
|
161
|
+
}, [S, R]), { actions: Et, decisionDialog: Dt, isActionPending: Ot } = Ae({
|
|
162
|
+
payableId: wt,
|
|
163
|
+
status: O?.status,
|
|
164
|
+
currentApprovalRequestId: U.id,
|
|
165
|
+
arePendingApproversUnknown: K.isLoading,
|
|
166
|
+
hasScheduledPayment: P.hasScheduledPayment,
|
|
167
|
+
scheduledPaymentIntentId: P.scheduledPaymentIntentId,
|
|
168
|
+
isScheduledPaymentUnknown: P.isResolving,
|
|
169
|
+
isPayabilityUnknown: G.isLoading,
|
|
170
|
+
hasApprovalPolicy: !!O?.approval_policy_id,
|
|
171
|
+
hasWaitingRequest: U.hasWaitingRequest,
|
|
172
|
+
pendingApprovers: K.pendingApprovers,
|
|
173
|
+
labels: g.actions,
|
|
174
|
+
isMarkAsPaidPending: yt,
|
|
175
|
+
onMarkAsPaidSelect: () => W.current?.openMarkAsPaid(),
|
|
176
|
+
onPayBillSelect: () => q(() => W.current?.openPayBill()),
|
|
177
|
+
onEditSelect: Tt,
|
|
178
|
+
onActionSucceeded: (e) => {
|
|
179
|
+
if (e === "reopen") {
|
|
180
|
+
Tt?.();
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
A && u(!1);
|
|
184
|
+
}
|
|
185
|
+
}), kt = Ne({
|
|
186
|
+
payableId: C,
|
|
187
|
+
status: O?.status,
|
|
188
|
+
enabled: !f,
|
|
189
|
+
labels: g.deleteDraft,
|
|
190
|
+
onDeleted: () => u(!1)
|
|
191
|
+
}), At = vt || Ot, jt = O?.ocr_status === "processing", Mt = w.isLoading || T.isResolving || jt, Nt = w.isLoading || T.isResolving || D.isResolving || G.isLoading, Pt = w.isError || T.isError || D.isError, Ft = o(() => [...kt.menuItems, ...A || f && !Nt && !Pt ? Et.menu.map((e) => ({
|
|
192
|
+
id: e.id,
|
|
193
|
+
label: e.label,
|
|
194
|
+
onSelect: e.onSelect,
|
|
195
|
+
disabled: e.disabled,
|
|
196
|
+
icon: e.icon,
|
|
197
|
+
sectionHeading: e.sectionHeading
|
|
198
|
+
})) : []], [
|
|
199
|
+
Et.menu,
|
|
200
|
+
kt.menuItems,
|
|
201
|
+
A,
|
|
202
|
+
f,
|
|
203
|
+
Nt,
|
|
204
|
+
Pt
|
|
205
|
+
]), J = o(() => (D.data?.data ?? []).map((e) => ({
|
|
206
|
+
value: e.id,
|
|
207
|
+
label: oe(e)
|
|
208
|
+
})), [D.data]), { unavailableMessage: It, disabled: Lt, rosterAvailable: Rt } = se({
|
|
209
|
+
isInitResolved: it,
|
|
210
|
+
canReadGlCodes: at,
|
|
211
|
+
isResolving: D.isResolving,
|
|
212
|
+
isError: D.isError,
|
|
213
|
+
optionCount: J.length,
|
|
214
|
+
labels: g.lineItemsGlCodeUnavailable
|
|
215
|
+
}), zt = O?.status === "rejected" || !f && A, Bt = t(E?.scopes, [n.ApprovalRequestReadOrg]), Vt = zt && Bt, Ht = t(E?.scopes, [n.UserReadOrg]), { userNames: Ut, isError: Wt, isResolving: Gt } = ne({ enabled: (f || zt) && Ht }), { historyQuery: Y, rows: Kt, namesError: qt } = ke({
|
|
216
|
+
payableId: H,
|
|
217
|
+
userNames: Ut,
|
|
218
|
+
isRosterError: Ht && Wt,
|
|
219
|
+
labels: g.history
|
|
220
|
+
}), X = De({
|
|
221
|
+
payableId: C,
|
|
222
|
+
payableStatus: O?.status,
|
|
223
|
+
payableUpdatedAt: O?.updated_at,
|
|
224
|
+
enabled: Vt,
|
|
225
|
+
userNames: Ut,
|
|
226
|
+
labels: g.detail
|
|
227
|
+
}), Jt = o(() => be({
|
|
228
|
+
records: P.paymentRecords,
|
|
229
|
+
events: Y.data?.data ?? [],
|
|
230
|
+
currencyCode: O?.currency,
|
|
231
|
+
labels: g.detail
|
|
232
|
+
}), [
|
|
233
|
+
P.paymentRecords,
|
|
234
|
+
Y.data,
|
|
235
|
+
O?.currency,
|
|
236
|
+
g.detail
|
|
237
|
+
]), Yt = o(() => {
|
|
238
|
+
if (!f || !O) return;
|
|
239
|
+
let e = Pe({
|
|
240
|
+
payable: O,
|
|
241
|
+
lineItems: T.lineItems,
|
|
242
|
+
glCodeOptions: J,
|
|
243
|
+
glCodeRosterAvailable: Rt,
|
|
244
|
+
history: Kt,
|
|
245
|
+
paymentHistory: Jt,
|
|
246
|
+
approvalPolicy: K.view,
|
|
247
|
+
labels: g.detail,
|
|
248
|
+
hasScheduledPayment: P.hasScheduledPayment,
|
|
249
|
+
rejection: X,
|
|
250
|
+
payableAchInstructions: G.achInstructions,
|
|
251
|
+
payableAchInstructionsReadable: I && !G.isError
|
|
252
|
+
});
|
|
253
|
+
return R.mode === "resolved" && R.summary ? {
|
|
254
|
+
...e,
|
|
255
|
+
payTo: R.summary
|
|
256
|
+
} : e;
|
|
257
|
+
}, [
|
|
258
|
+
P.hasScheduledPayment,
|
|
259
|
+
K.view,
|
|
260
|
+
I,
|
|
261
|
+
g.detail,
|
|
262
|
+
J,
|
|
263
|
+
Rt,
|
|
264
|
+
Kt,
|
|
265
|
+
T.lineItems,
|
|
266
|
+
O,
|
|
267
|
+
G.achInstructions,
|
|
268
|
+
G.isError,
|
|
269
|
+
Jt,
|
|
270
|
+
f,
|
|
271
|
+
X,
|
|
272
|
+
R.mode,
|
|
273
|
+
R.summary
|
|
274
|
+
]), Xt = O?.source_of_payable_data === "ocr", Z = xt?.name, Zt = f ? Z ? g.viewTitle(Z) : g.readOnlyTitle : Z && (Xt || A) ? g.extractedTitle(Z) : g.newTitle, Qt = f && O?.created_at ? g.addedOn(e(O.created_at.slice(0, 10))) : void 0, Q = M.isDirty || R.hasUnsavedVendorChanges || !!V.stagedFile || V.isFileDeletionPending, $t = a(() => {
|
|
275
|
+
if (f && R.isEditingPayTo) {
|
|
276
|
+
q(() => u(!1));
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
switch (Fe({
|
|
280
|
+
isUnsavedPromptOpen: b,
|
|
281
|
+
isLocked: j,
|
|
282
|
+
isDirty: Q
|
|
283
|
+
})) {
|
|
284
|
+
case "dismiss-prompt":
|
|
285
|
+
x(!1);
|
|
286
|
+
return;
|
|
287
|
+
case "prompt":
|
|
288
|
+
x(!0);
|
|
289
|
+
return;
|
|
290
|
+
default: u(!1);
|
|
291
|
+
}
|
|
292
|
+
}, [
|
|
293
|
+
Q,
|
|
294
|
+
j,
|
|
295
|
+
b,
|
|
296
|
+
q,
|
|
297
|
+
u,
|
|
298
|
+
f,
|
|
299
|
+
R.isEditingPayTo
|
|
300
|
+
]), en = a((e, t) => {
|
|
301
|
+
if (!h) return;
|
|
302
|
+
let n = () => h(e, t);
|
|
303
|
+
if (f && R.isEditingPayTo) {
|
|
304
|
+
q(n);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
!j && Q ? S(n) : n();
|
|
308
|
+
}, [
|
|
309
|
+
S,
|
|
310
|
+
Q,
|
|
311
|
+
j,
|
|
312
|
+
q,
|
|
313
|
+
h,
|
|
314
|
+
f,
|
|
315
|
+
R.isEditingPayTo
|
|
316
|
+
]), tn = a(() => {
|
|
317
|
+
if (R.isEditingPayTo) {
|
|
318
|
+
q(m);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
m?.();
|
|
322
|
+
}, [
|
|
323
|
+
q,
|
|
324
|
+
m,
|
|
325
|
+
R.isEditingPayTo
|
|
326
|
+
]), nn = a(() => {
|
|
327
|
+
x(!1), u(!1);
|
|
328
|
+
}, [u]), rn = Mt || R.mode === "creating", an = a(async () => {
|
|
329
|
+
if (rn) return;
|
|
330
|
+
let e = await V.saveDraft();
|
|
331
|
+
x(!1), e && u(!1);
|
|
332
|
+
}, [
|
|
333
|
+
V,
|
|
334
|
+
rn,
|
|
335
|
+
u
|
|
336
|
+
]), $ = xe({
|
|
337
|
+
payable: O,
|
|
338
|
+
onOpenPayable: h ? en : void 0,
|
|
339
|
+
onRemoved: () => u(!1),
|
|
340
|
+
canManage: ct
|
|
341
|
+
}), on = a((e) => {
|
|
342
|
+
if (!(At || $.isBusy)) return e ? u(!0) : $t();
|
|
343
|
+
}, [
|
|
344
|
+
$.isBusy,
|
|
345
|
+
At,
|
|
346
|
+
$t,
|
|
347
|
+
u
|
|
348
|
+
]), sn = $.isPossibleDuplicate, cn = !f && Xt && !Qe, ln = !f && !!X, un = ln || sn || cn ? /* @__PURE__ */ Ue(He, { children: [
|
|
349
|
+
ln && X ? /* @__PURE__ */ c(ue, {
|
|
350
|
+
...X,
|
|
351
|
+
labels: g.rejectedBanner
|
|
352
|
+
}) : null,
|
|
353
|
+
sn ? /* @__PURE__ */ c(le, {
|
|
354
|
+
onNotADuplicate: $.onNotADuplicate,
|
|
355
|
+
onRemoveBill: $.onRemoveBill,
|
|
356
|
+
isActionDisabled: $.isBusy,
|
|
357
|
+
rows: $.rows,
|
|
358
|
+
collapsedRowCount: $.collapsedRowCount,
|
|
359
|
+
showMoreLabel: $.showMoreLabel,
|
|
360
|
+
labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
|
|
361
|
+
testId: i.duplicateNotice
|
|
362
|
+
}) : null,
|
|
363
|
+
cn ? /* @__PURE__ */ c(fe, {
|
|
364
|
+
onDismiss: () => $e(!0),
|
|
365
|
+
labels: p?.extractionNotice
|
|
366
|
+
}) : null
|
|
367
|
+
] }) : void 0;
|
|
368
|
+
return /* @__PURE__ */ Ue(He, { children: [
|
|
369
|
+
/* @__PURE__ */ c(ce, {
|
|
370
|
+
open: l,
|
|
371
|
+
onOpenChange: on,
|
|
372
|
+
title: Zt,
|
|
373
|
+
subtitle: Qt,
|
|
374
|
+
notice: un,
|
|
375
|
+
vendor: {
|
|
376
|
+
...B,
|
|
377
|
+
testId: i.vendorSection
|
|
378
|
+
},
|
|
379
|
+
values: M.values,
|
|
380
|
+
errors: M.errors,
|
|
381
|
+
onChange: M.onChange,
|
|
382
|
+
lineItems: {
|
|
383
|
+
items: M.lineItemRows,
|
|
384
|
+
glCodeOptions: J,
|
|
385
|
+
glCodeDisabled: Lt,
|
|
386
|
+
glCodeUnavailableMessage: It,
|
|
387
|
+
discount: M.discount,
|
|
388
|
+
onDiscountChange: M.onDiscountChange,
|
|
389
|
+
onDiscountBlur: M.onDiscountBlur,
|
|
390
|
+
tax: M.tax,
|
|
391
|
+
onTaxChange: M.onTaxChange,
|
|
392
|
+
onTaxBlur: M.onTaxBlur,
|
|
393
|
+
total: M.total,
|
|
394
|
+
onTotalChange: M.onTotalChange,
|
|
395
|
+
onTotalBlur: M.onTotalBlur,
|
|
396
|
+
onAddLineItem: M.onAddLineItem,
|
|
397
|
+
errors: M.lineItemErrors,
|
|
398
|
+
totalsErrors: M.totalsErrors,
|
|
399
|
+
testId: i.lineItems
|
|
400
|
+
},
|
|
401
|
+
documentPanel: /* @__PURE__ */ c(Ie, {
|
|
402
|
+
payableId: C,
|
|
403
|
+
readOnly: j,
|
|
404
|
+
isDocumentPending: !!C && !O?.file && (w.isLoading || O?.ocr_status === "processing"),
|
|
405
|
+
file: O?.file ? {
|
|
406
|
+
id: O.file.id,
|
|
407
|
+
name: O.file.name,
|
|
408
|
+
url: O.file.url,
|
|
409
|
+
mimetype: O.file.mimetype
|
|
410
|
+
} : void 0,
|
|
411
|
+
staging: {
|
|
412
|
+
stagedFile: V.stagedFile,
|
|
413
|
+
onFileStaged: V.stageFile,
|
|
414
|
+
onClearStagedFile: V.clearStagedFile,
|
|
415
|
+
isSaving: vt
|
|
416
|
+
},
|
|
417
|
+
deletion: {
|
|
418
|
+
isPending: V.isFileDeletionPending,
|
|
419
|
+
onRequest: V.requestFileDeletion,
|
|
420
|
+
onDetachNow: V.detachFileNow,
|
|
421
|
+
isDeleting: V.isDeletingFile,
|
|
422
|
+
hasFailed: V.hasFileDeletionFailed
|
|
423
|
+
},
|
|
424
|
+
labels: p?.sourceDocument
|
|
425
|
+
}),
|
|
426
|
+
menuItems: Ft,
|
|
427
|
+
readOnly: j,
|
|
428
|
+
detail: f ? {
|
|
429
|
+
view: Yt,
|
|
430
|
+
actions: Et,
|
|
431
|
+
scheduledSummary: F ? g.scheduledSummary(F.label) : void 0,
|
|
432
|
+
scheduledSummaryDate: F?.absoluteLabel,
|
|
433
|
+
scheduledStatusLabel: F ? g.scheduledStatusBadge(F.label) : void 0,
|
|
434
|
+
...Ct,
|
|
435
|
+
payTo: {
|
|
436
|
+
onEdit: B.mode === "resolved" ? B.onEdit : void 0,
|
|
437
|
+
paymentInstructions: O?.status === "paid" || O?.status === "canceled" ? void 0 : Ee(B.paymentInstructionsEditor, !!Yt?.payTo.hasPaymentInstructions),
|
|
438
|
+
detailsWarning: B.detailsWarning,
|
|
439
|
+
editForm: B.mode === "creating" ? B.newVendorForm : void 0
|
|
440
|
+
},
|
|
441
|
+
isLoading: Nt,
|
|
442
|
+
isError: Pt,
|
|
443
|
+
paymentHistoryError: P.isError || Y.isError,
|
|
444
|
+
paymentHistoryLoading: P.isResolving || Y.isLoading,
|
|
445
|
+
historyError: Y.isError,
|
|
446
|
+
historyLoading: Y.isLoading || Gt,
|
|
447
|
+
historyNamesError: qt
|
|
448
|
+
} : void 0,
|
|
449
|
+
isLineItemsLoading: Mt,
|
|
450
|
+
isSaving: At || gt,
|
|
451
|
+
isSavingDraft: V.isSavingDraft,
|
|
452
|
+
isSubmitting: V.isFinalizing,
|
|
453
|
+
onCancel: $t,
|
|
454
|
+
onCollapse: f ? tn : void 0,
|
|
455
|
+
onSaveDraft: V.saveDraft,
|
|
456
|
+
onFinalize: V.finalize,
|
|
457
|
+
scrollToErrorToken: V.scrollToErrorToken,
|
|
458
|
+
showSubmit: !j && k,
|
|
459
|
+
testId: i.dialog,
|
|
460
|
+
labels: p?.screen
|
|
461
|
+
}),
|
|
462
|
+
/* @__PURE__ */ c(pe, {
|
|
463
|
+
open: b,
|
|
464
|
+
onSaveDraft: an,
|
|
465
|
+
onDiscard: nn,
|
|
466
|
+
onCancel: () => x(!1),
|
|
467
|
+
isSaving: V.isSavingDraft,
|
|
468
|
+
isSaveDraftDisabled: rn,
|
|
469
|
+
labels: g.unsavedChanges,
|
|
470
|
+
testId: i.unsavedDialog,
|
|
471
|
+
saveDraftTestId: i.unsavedSaveDraft,
|
|
472
|
+
discardTestId: i.unsavedDiscard,
|
|
473
|
+
closeTestId: i.unsavedClose
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ c(de, {
|
|
476
|
+
open: !!et,
|
|
477
|
+
onDiscard: () => {
|
|
478
|
+
let e = et;
|
|
479
|
+
tt(void 0), e?.();
|
|
480
|
+
},
|
|
481
|
+
onKeepEditing: () => tt(void 0),
|
|
482
|
+
labels: g.discardChanges,
|
|
483
|
+
testId: i.discardDialog,
|
|
484
|
+
discardTestId: i.discardConfirm
|
|
485
|
+
}),
|
|
486
|
+
/* @__PURE__ */ c(r, {
|
|
487
|
+
...Dt,
|
|
488
|
+
labels: { cancelButton: g.actions.decisionDialog.cancelButton },
|
|
489
|
+
testId: i.decisionDialog,
|
|
490
|
+
confirmTestId: i.decisionConfirm,
|
|
491
|
+
reasonTestId: i.decisionReason
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ c(r, {
|
|
494
|
+
...kt.dialog,
|
|
495
|
+
labels: { cancelButton: g.actions.decisionDialog.cancelButton },
|
|
496
|
+
testId: i.deleteDraftDialog,
|
|
497
|
+
confirmTestId: i.deleteDraftConfirm
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ c(r, {
|
|
500
|
+
open: $.removeConfirmation.open,
|
|
501
|
+
copy: $.removeConfirmation.copy,
|
|
502
|
+
onConfirm: $.removeConfirmation.onConfirm,
|
|
503
|
+
onCancel: $.removeConfirmation.onCancel,
|
|
504
|
+
isPending: $.removeConfirmation.isPending,
|
|
505
|
+
confirmIcon: /* @__PURE__ */ c(We, {}),
|
|
506
|
+
labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
|
|
507
|
+
testId: i.duplicateRemoveDialog,
|
|
508
|
+
confirmTestId: i.duplicateRemoveConfirm
|
|
509
|
+
}),
|
|
510
|
+
/* @__PURE__ */ c(r, {
|
|
511
|
+
open: $.cancelRowConfirmation.open,
|
|
512
|
+
copy: $.cancelRowConfirmation.copy,
|
|
513
|
+
onConfirm: $.cancelRowConfirmation.onConfirm,
|
|
514
|
+
onCancel: $.cancelRowConfirmation.onCancel,
|
|
515
|
+
isPending: $.cancelRowConfirmation.isPending,
|
|
516
|
+
labels: { cancelButton: $.cancelRowConfirmation.cancelButtonLabel },
|
|
517
|
+
testId: i.duplicateCancelRowDialog,
|
|
518
|
+
confirmTestId: i.duplicateCancelRowConfirm
|
|
519
|
+
}),
|
|
520
|
+
/* @__PURE__ */ c(r, {
|
|
521
|
+
open: $.keepRowConfirmation.open,
|
|
522
|
+
copy: $.keepRowConfirmation.copy,
|
|
523
|
+
onConfirm: $.keepRowConfirmation.onConfirm,
|
|
524
|
+
onCancel: $.keepRowConfirmation.onCancel,
|
|
525
|
+
isPending: $.keepRowConfirmation.isPending,
|
|
526
|
+
labels: { cancelButton: $.keepRowConfirmation.cancelButtonLabel }
|
|
527
|
+
}),
|
|
528
|
+
qe?.({
|
|
529
|
+
ref: W,
|
|
530
|
+
payable: O,
|
|
531
|
+
payableId: H,
|
|
532
|
+
isPayBillEnabled: f,
|
|
533
|
+
hasScheduledPayment: P.hasScheduledPayment,
|
|
534
|
+
onMissingAchInstructions: lt ? R.openPaymentInstructions : void 0,
|
|
535
|
+
onMarkAsPaidPendingChange: bt
|
|
536
|
+
})
|
|
537
|
+
] });
|
|
538
|
+
}
|
|
4
539
|
//#endregion
|
|
5
|
-
export {
|
|
540
|
+
export { l as BillDialog, l as default };
|
|
@@ -1,67 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { useAnalyticsTrack as e } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
6
|
-
import { WidgetProvider as t } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
7
|
-
import "../../../../shared/feature/dist/index.js";
|
|
8
|
-
import { BillCreateDialog as n } from "./index37.js";
|
|
1
|
+
import "./index29.js";
|
|
9
2
|
import "./index38.js";
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import { BillDetailWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index42.js";
|
|
13
|
-
import { useEffect as o } from "react";
|
|
14
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
15
|
-
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js
|
|
16
|
-
function c() {
|
|
17
|
-
let t = e();
|
|
18
|
-
o(() => {
|
|
19
|
-
t(i.Mounted);
|
|
20
|
-
}, [t]);
|
|
21
|
-
}
|
|
22
|
-
function l(e) {
|
|
23
|
-
return c(), /* @__PURE__ */ s(n, { ...e });
|
|
24
|
-
}
|
|
25
|
-
function u(e) {
|
|
26
|
-
return c(), /* @__PURE__ */ s(r, { ...e });
|
|
27
|
-
}
|
|
28
|
-
function d({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: c, implementation: u, uiFramework: d, errorFallback: f, onError: p, analytics: m, disclosuresAcceptance: h, providerLabels: g, ..._ }) {
|
|
29
|
-
return /* @__PURE__ */ s(t, {
|
|
30
|
-
widgetName: a,
|
|
31
|
-
baseUrl: e,
|
|
32
|
-
widgetToken: n,
|
|
33
|
-
organizationId: r,
|
|
34
|
-
configClient: i,
|
|
35
|
-
gatewayRouting: o,
|
|
36
|
-
linkComponent: c,
|
|
37
|
-
implementation: u,
|
|
38
|
-
uiFramework: d,
|
|
39
|
-
errorFallback: f,
|
|
40
|
-
onError: p,
|
|
41
|
-
analytics: m,
|
|
42
|
-
disclosuresAcceptance: h,
|
|
43
|
-
providerLabels: g,
|
|
44
|
-
children: /* @__PURE__ */ s(l, { ..._ })
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function f({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: c, implementation: l, uiFramework: d, errorFallback: f, onError: p, analytics: m, disclosuresAcceptance: h, providerLabels: g, ..._ }) {
|
|
48
|
-
return /* @__PURE__ */ s(t, {
|
|
49
|
-
widgetName: a,
|
|
50
|
-
baseUrl: e,
|
|
51
|
-
widgetToken: n,
|
|
52
|
-
organizationId: r,
|
|
53
|
-
configClient: i,
|
|
54
|
-
gatewayRouting: o,
|
|
55
|
-
linkComponent: c,
|
|
56
|
-
implementation: l,
|
|
57
|
-
uiFramework: d,
|
|
58
|
-
errorFallback: f,
|
|
59
|
-
onError: p,
|
|
60
|
-
analytics: m,
|
|
61
|
-
disclosuresAcceptance: h,
|
|
62
|
-
providerLabels: g,
|
|
63
|
-
children: /* @__PURE__ */ s(u, { ..._ })
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { d as BillCreateWidget, f as BillDetailsWidget };
|
|
3
|
+
import "./index40.js";
|
|
4
|
+
import "./index42.js";
|
|
@@ -1 +1,42 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o } from "../../../util/dist/lib/billDetailLabels.js";
|
|
2
|
+
import { APPROVAL_POLICY_RULE_COPY_EN as s } from "./index7.js";
|
|
3
|
+
import { PAYABLE_AUDIT_HISTORY_LABELS_EN as c } from "./index27.js";
|
|
4
|
+
import { BILL_DETAILS_SHEET_LABELS_EN as l } from "../../ui/dist/index33.js";
|
|
5
|
+
import "../../ui/dist/index.js";
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js
|
|
7
|
+
var u = {
|
|
8
|
+
subtitle: "Accounts payable",
|
|
9
|
+
vendorRow: "Vendor",
|
|
10
|
+
bankAccountRow: "ACH bank account",
|
|
11
|
+
bankAccountValue: (e) => `Account ending in ${e}`,
|
|
12
|
+
...r,
|
|
13
|
+
invoiceNumberRow: "Number",
|
|
14
|
+
issueDateRow: "Issue date",
|
|
15
|
+
dueDateRow: "Due date",
|
|
16
|
+
poNumberRow: "PO number",
|
|
17
|
+
notProvided: "Not provided",
|
|
18
|
+
glCodeMissing: "GL code not specified",
|
|
19
|
+
quantityValue: (e, t) => `${e} x ${t}`,
|
|
20
|
+
quantityOnlyValue: (e) => e,
|
|
21
|
+
subtotalRow: "Subtotal",
|
|
22
|
+
discountsRow: "Discounts",
|
|
23
|
+
taxRow: "Tax",
|
|
24
|
+
totalRow: "Total",
|
|
25
|
+
actionError: n.actionError,
|
|
26
|
+
actionSuccess: n.actionSuccess,
|
|
27
|
+
scheduledRelativeDay: i,
|
|
28
|
+
scheduledSummary: o,
|
|
29
|
+
scheduledStatusBadge: a,
|
|
30
|
+
awaitingApprovalNotice: e,
|
|
31
|
+
awaitingApprovalUnknownNotice: t,
|
|
32
|
+
paidOnLabel: (e) => `Paid on ${e}`,
|
|
33
|
+
rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
|
|
34
|
+
rejectedOn: (e) => `Rejected on ${e}`,
|
|
35
|
+
rejectionMessage: (e) => `"${e}"`,
|
|
36
|
+
sheet: l,
|
|
37
|
+
history: c,
|
|
38
|
+
decisionDialog: n.decisionDialog,
|
|
39
|
+
approvalPolicyCopy: s
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { u as BILL_DETAILS_LABELS_EN };
|