@tesouro/embedded-components-react 0.3.45 → 0.3.47
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.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +42 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +40 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +56 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +5 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +72 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +47 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +91 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +33 -160
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +163 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +75 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +23 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +198 -202
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +197 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +105 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +47 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +26 -182
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +187 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +32 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +102 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +16 -301
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +322 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +4 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +31 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +77 -159
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +167 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +46 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +14 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +59 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -128
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +125 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +8 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +41 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +20 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +27 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +83 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +47 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +240 -101
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +107 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +211 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +6 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +28 -27
- 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
|
@@ -1,18 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { calculateTotal as e, displayLineAmount as t, parseMoneyToMinorUnits as n } from "./index39.js";
|
|
6
|
+
import { emptyLineItem as r, mapPayableToBillForm as i } from "./index42.js";
|
|
7
|
+
import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
1
8
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
9
|
+
function l(e, r, i) {
|
|
10
|
+
return n(r) === null ? i : t(e, r);
|
|
11
|
+
}
|
|
12
|
+
function u({ payable: t, lineItems: n } = {}) {
|
|
13
|
+
let u = s(() => i({
|
|
14
|
+
payable: t ?? {},
|
|
15
|
+
lineItems: n ?? []
|
|
16
|
+
}), [t, n]), [d, f] = c(u.values), [p, m] = c(u.lineItems), [h, g] = c(u.discount), [_, v] = c(u.tax), [y, b] = c(u.total || void 0), [x, S] = c(), [C, w] = c(), [T, E] = c(!1), [D, O] = c(!1), [k, A] = c(!1);
|
|
17
|
+
o(() => {
|
|
18
|
+
T || f(u.values);
|
|
19
|
+
}, [u]), o(() => {
|
|
20
|
+
D || m(u.lineItems);
|
|
21
|
+
}, [u]), o(() => {
|
|
22
|
+
k || (g(u.discount), v(u.tax), b(u.total || void 0));
|
|
23
|
+
}, [u]);
|
|
24
|
+
let j = a((e) => {
|
|
25
|
+
f((t) => ({
|
|
26
|
+
...t,
|
|
27
|
+
...e
|
|
28
|
+
})), E(!0);
|
|
29
|
+
}, []), M = a((e) => {
|
|
30
|
+
w((t) => {
|
|
31
|
+
if (!t?.[e]) return t;
|
|
32
|
+
let n = { ...t };
|
|
33
|
+
return delete n[e], Object.keys(n).length ? n : void 0;
|
|
34
|
+
});
|
|
35
|
+
}, []), N = a((e, t) => {
|
|
36
|
+
M(e), m((n) => n.map((n) => {
|
|
37
|
+
if (n.id !== e) return n;
|
|
38
|
+
let r = {
|
|
39
|
+
...n,
|
|
40
|
+
...t
|
|
41
|
+
};
|
|
42
|
+
return "amount" in t ? r : {
|
|
43
|
+
...r,
|
|
44
|
+
amount: l(r.quantity, r.price, r.amount)
|
|
45
|
+
};
|
|
46
|
+
})), O(!0), b(void 0);
|
|
47
|
+
}, [M]), P = a((e, t) => {
|
|
48
|
+
M(e), m((n) => n.map((n) => {
|
|
49
|
+
if (n.id !== e) return n;
|
|
50
|
+
let r = Number.parseFloat(n.quantity), i = String(Math.max(1, (Number.isFinite(r) ? r : 1) + t));
|
|
51
|
+
return {
|
|
52
|
+
...n,
|
|
53
|
+
quantity: i,
|
|
54
|
+
amount: l(i, n.price, n.amount)
|
|
55
|
+
};
|
|
56
|
+
})), O(!0), b(void 0);
|
|
57
|
+
}, [M]), F = a((e) => {
|
|
58
|
+
M(e), m((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), O(!0), b(void 0);
|
|
59
|
+
}, [M]), I = a(() => {
|
|
60
|
+
m((e) => [...e, r()]), O(!0), b(void 0);
|
|
61
|
+
}, []), L = a((e) => {
|
|
62
|
+
g(e), A(!0), b(void 0);
|
|
63
|
+
}, []), R = a((e) => {
|
|
64
|
+
v(e), A(!0), b(void 0);
|
|
65
|
+
}, []), z = a((e) => {
|
|
66
|
+
b(e), A(!0);
|
|
67
|
+
}, []), B = s(() => p.map((e) => ({
|
|
68
|
+
...e,
|
|
69
|
+
onChange: (t) => N(e.id, t),
|
|
70
|
+
onQuantityStep: (t) => P(e.id, t),
|
|
71
|
+
onRemove: () => F(e.id)
|
|
72
|
+
})), [
|
|
73
|
+
p,
|
|
74
|
+
N,
|
|
75
|
+
F,
|
|
76
|
+
P
|
|
77
|
+
]), V = s(() => e(p, _, h), [
|
|
78
|
+
p,
|
|
79
|
+
_,
|
|
80
|
+
h
|
|
81
|
+
]);
|
|
82
|
+
return {
|
|
83
|
+
values: d,
|
|
84
|
+
errors: x,
|
|
85
|
+
setErrors: S,
|
|
86
|
+
lineItemErrors: C,
|
|
87
|
+
setLineItemErrors: w,
|
|
88
|
+
onChange: j,
|
|
89
|
+
lineItems: p,
|
|
90
|
+
lineItemRows: B,
|
|
91
|
+
discount: h,
|
|
92
|
+
onDiscountChange: L,
|
|
93
|
+
tax: _,
|
|
94
|
+
onTaxChange: R,
|
|
95
|
+
total: y ?? V,
|
|
96
|
+
totalOverride: y,
|
|
97
|
+
onTotalChange: z,
|
|
98
|
+
onAddLineItem: I,
|
|
99
|
+
isTotalsDirty: k,
|
|
100
|
+
isDirty: T || D || k
|
|
101
|
+
};
|
|
102
|
+
}
|
|
17
103
|
//#endregion
|
|
18
|
-
export {
|
|
104
|
+
export { u as useBillForm };
|
|
@@ -1,303 +1,18 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
-
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
-
import { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
|
|
8
|
-
import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
9
|
-
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
11
|
-
import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
12
|
-
import "../../../shared/feature/dist/index.js";
|
|
13
|
-
import { resolveAmountDueMinorUnits as ie } from "./index6.js";
|
|
14
|
-
import { resolveVendor as ae } from "./index7.js";
|
|
15
|
-
import { BillCreateScreen as oe } from "../../ui/dist/index44.js";
|
|
16
|
-
import { BillDecisionDialog as n } from "../../ui/dist/index50.js";
|
|
17
|
-
import { BillDuplicateNotice as se } from "../../ui/dist/index60.js";
|
|
18
|
-
import { ExtractionNotice as ce } from "../../ui/dist/index77.js";
|
|
19
|
-
import { MarkAsPaidDialog as le } from "../../ui/dist/index86.js";
|
|
20
|
-
import { UnsavedBillDialog as ue } from "../../ui/dist/index96.js";
|
|
21
|
-
import "../../ui/dist/index.js";
|
|
22
|
-
import { usePayableHistoryQuery as de } from "../../data-access/dist/index7.js";
|
|
23
|
-
import { useAllPayableLineItemsQuery as fe } from "../../data-access/dist/index8.js";
|
|
24
|
-
import { usePayableQuery as pe } from "../../data-access/dist/index14.js";
|
|
25
|
-
import "../../data-access/dist/index.js";
|
|
26
|
-
import { PayBillFlow as me } from "./index13.js";
|
|
27
|
-
import "./index14.js";
|
|
28
|
-
import { useMarkAsPaidFlow as he } from "./index4.js";
|
|
29
|
-
import "./index5.js";
|
|
30
|
-
import { mergeBillCreateScreenCopy as ge } from "./index31.js";
|
|
31
|
-
import { useBillCreateController as _e } from "./index40.js";
|
|
32
|
-
import { useBillForm as ve } from "./index42.js";
|
|
33
|
-
import { useApprovalPolicyCardView as ye } from "./index19.js";
|
|
34
|
-
import { useCurrentApprovalRequestId as be } from "./index20.js";
|
|
35
|
-
import { usePayableDetailActions as xe } from "./index22.js";
|
|
36
|
-
import { useScheduledPayment as Se } from "./index23.js";
|
|
37
|
-
import { useDraftDelete as Ce } from "./index24.js";
|
|
38
|
-
import { buildBillDetailView as we } from "./index27.js";
|
|
39
|
-
import { buildBillHistory as Te } from "./index28.js";
|
|
40
|
-
import { SourceDocumentContainer as Ee } from "./index32.js";
|
|
41
|
-
import { useVendorSectionProps as De } from "./index35.js";
|
|
42
|
-
import { usePaymentInstructionsForm as Oe } from "./index36.js";
|
|
43
|
-
import { billCreateTestIds as r } from "./index43.js";
|
|
44
|
-
import { useCallback as i, useEffect as ke, useMemo as a, useRef as Ae, useState as o } from "react";
|
|
45
|
-
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
46
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
counterpartId: p ? void 0 : g,
|
|
63
|
-
payableCounterpartId: M,
|
|
64
|
-
onCounterpartChange: Be,
|
|
65
|
-
requiredError: j.errors?.vendor,
|
|
66
|
-
payableCounterpartBankAccountId: A?.counterpart_bank_account_id ?? void 0,
|
|
67
|
-
extractedVendor: A?.counterpart_raw_data ?? void 0
|
|
68
|
-
}), P = _e({
|
|
69
|
-
payableId: f,
|
|
70
|
-
form: j,
|
|
71
|
-
counterpartId: g,
|
|
72
|
-
clearCounterpart: !!(C && v) && !g,
|
|
73
|
-
prepareVendorForSave: N.savePaymentInstructions,
|
|
74
|
-
onPayableCreated: S,
|
|
75
|
-
onSaved: S,
|
|
76
|
-
onDraftSaved: () => d(!1),
|
|
77
|
-
onFinalized: () => d(!1)
|
|
78
|
-
}), F = !!(P.isSavingDraft || P.isFinalizing), I = p ? C : void 0, L = be({
|
|
79
|
-
payableId: I,
|
|
80
|
-
status: A?.status
|
|
81
|
-
}), R = Ae(null), z = Se({
|
|
82
|
-
payableId: C,
|
|
83
|
-
scheduledPaymentDate: A?.scheduled_payment_date,
|
|
84
|
-
enabled: p
|
|
85
|
-
}), B = ae(A), V = Oe({
|
|
86
|
-
payableId: I,
|
|
87
|
-
counterpartId: p ? M : void 0,
|
|
88
|
-
saveErrorMessage: h.detail.paymentInstructionsSaveError,
|
|
89
|
-
linkErrorMessage: h.detail.paymentInstructionsLinkError
|
|
90
|
-
}), H = e(E?.scopes, [t.CounterpartWriteOrg]) && e(E?.scopes, [t.PayableWriteOrg]), U = he({
|
|
91
|
-
payableId: I,
|
|
92
|
-
amountDueMinorUnits: ie(A) ?? 0,
|
|
93
|
-
amountToPayMinorUnits: A?.amount_to_pay ?? void 0,
|
|
94
|
-
currencyCode: A?.currency ?? void 0,
|
|
95
|
-
dueDate: A?.due_date,
|
|
96
|
-
hasScheduledPayment: z.hasScheduledPayment,
|
|
97
|
-
labels: h.markAsPaid
|
|
98
|
-
}), W = ye({
|
|
99
|
-
payableId: I,
|
|
100
|
-
approvalPolicyId: A?.approval_policy_id,
|
|
101
|
-
enabled: p,
|
|
102
|
-
copy: h.approvalPolicyCopy
|
|
103
|
-
}), { actions: Ve, decisionDialog: He } = xe({
|
|
104
|
-
payableId: I,
|
|
105
|
-
status: A?.status,
|
|
106
|
-
currentApprovalRequestId: L.id,
|
|
107
|
-
isPolicyApprover: L.isPolicyApprover,
|
|
108
|
-
hasWaitingRequest: L.hasWaitingRequest,
|
|
109
|
-
hasScheduledPayment: z.hasScheduledPayment,
|
|
110
|
-
scheduledPaymentIntentId: z.scheduledPaymentIntentId,
|
|
111
|
-
isScheduledPaymentUnknown: z.isResolving,
|
|
112
|
-
pendingApprovers: W.pendingApprovers,
|
|
113
|
-
labels: h.actions,
|
|
114
|
-
isMarkAsPaidPending: U.isPending,
|
|
115
|
-
onMarkAsPaidSelect: U.open,
|
|
116
|
-
onPayBillSelect: () => je(B) || !H ? R.current?.open() : V.open()
|
|
117
|
-
}), G = Ce({
|
|
118
|
-
payableId: C,
|
|
119
|
-
status: A?.status,
|
|
120
|
-
enabled: !p,
|
|
121
|
-
labels: h.deleteDraft,
|
|
122
|
-
onDeleted: () => d(!1)
|
|
123
|
-
}), K = a(() => (k.data?.data ?? []).map((e) => ({
|
|
124
|
-
value: e.id,
|
|
125
|
-
label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
|
|
126
|
-
})), [k.data]), q;
|
|
127
|
-
D && (O ? k.isError ? q = h.lineItemsGlCodeUnavailable.loadError : !k.isResolving && K.length === 0 && (q = h.lineItemsGlCodeUnavailable.empty) : q = h.lineItemsGlCodeUnavailable.noAccess);
|
|
128
|
-
let Ue = !D || !!q || k.isResolving, J = O && !k.isResolving && !k.isError, Y = de(I), We = e(E?.scopes, [t.UserReadOrg]), X = te({ enabled: p && We }), Ge = a(() => Te(Y.data?.data ?? [], X.data?.data ?? [], h.history), [
|
|
129
|
-
Y.data,
|
|
130
|
-
X.data,
|
|
131
|
-
h.history
|
|
132
|
-
]), Ke = a(() => p && A ? we({
|
|
133
|
-
payable: A,
|
|
134
|
-
lineItems: T.lineItems,
|
|
135
|
-
glCodeOptions: K,
|
|
136
|
-
glCodeRosterAvailable: J,
|
|
137
|
-
history: Ge,
|
|
138
|
-
approvalPolicy: W.view,
|
|
139
|
-
labels: h.detail,
|
|
140
|
-
hasScheduledPayment: z.hasScheduledPayment
|
|
141
|
-
}) : void 0, [
|
|
142
|
-
z.hasScheduledPayment,
|
|
143
|
-
W.view,
|
|
144
|
-
h.detail,
|
|
145
|
-
K,
|
|
146
|
-
J,
|
|
147
|
-
Ge,
|
|
148
|
-
T.lineItems,
|
|
149
|
-
A,
|
|
150
|
-
p
|
|
151
|
-
]), qe = A?.source_of_payable_data === "ocr", Z = B?.name, Je = p ? Z ? h.viewTitle(Z) : h.readOnlyTitle : qe && Z ? h.extractedTitle(Z) : h.newTitle, Ye = p && A?.created_at ? h.addedOn(ne(A.created_at.slice(0, 10))) : void 0, Q = i(() => {
|
|
152
|
-
let e = j.isDirty || N.hasUnsavedVendorChanges || !!P.stagedFile || P.isFileDeletionPending;
|
|
153
|
-
if (!p && e) {
|
|
154
|
-
x(!0);
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
d(!1);
|
|
158
|
-
}, [
|
|
159
|
-
P.isFileDeletionPending,
|
|
160
|
-
P.stagedFile,
|
|
161
|
-
j.isDirty,
|
|
162
|
-
d,
|
|
163
|
-
p,
|
|
164
|
-
N.hasUnsavedVendorChanges
|
|
165
|
-
]), Xe = i(() => {
|
|
166
|
-
x(!1), d(!1);
|
|
167
|
-
}, [d]), $ = T.isResolving || N.mode === "creating", Ze = i(async () => {
|
|
168
|
-
if ($) return;
|
|
169
|
-
let e = await P.saveDraft();
|
|
170
|
-
x(!1), e && d(!1);
|
|
171
|
-
}, [
|
|
172
|
-
P,
|
|
173
|
-
$,
|
|
174
|
-
d
|
|
175
|
-
]), Qe = i((e) => {
|
|
176
|
-
if (!F) return e ? d(!0) : Q();
|
|
177
|
-
}, [
|
|
178
|
-
Q,
|
|
179
|
-
F,
|
|
180
|
-
d
|
|
181
|
-
]), $e = !!Pe && !Le, et = !p && qe && !Fe, tt = $e || et ? /* @__PURE__ */ l(s, { children: [$e ? /* @__PURE__ */ c(se, {
|
|
182
|
-
onNotADuplicate: p ? void 0 : () => b(!0),
|
|
183
|
-
onRemoveBill: p ? void 0 : () => b(!0),
|
|
184
|
-
testId: r.duplicateNotice
|
|
185
|
-
}) : null, et ? /* @__PURE__ */ c(ce, { onDismiss: () => Ie(!0) }) : null] }) : void 0;
|
|
186
|
-
return /* @__PURE__ */ l(s, { children: [
|
|
187
|
-
/* @__PURE__ */ c(oe, {
|
|
188
|
-
open: u,
|
|
189
|
-
onOpenChange: Qe,
|
|
190
|
-
title: Je,
|
|
191
|
-
subtitle: Ye,
|
|
192
|
-
notice: tt,
|
|
193
|
-
vendor: {
|
|
194
|
-
...N,
|
|
195
|
-
testId: r.vendorSection
|
|
196
|
-
},
|
|
197
|
-
values: j.values,
|
|
198
|
-
errors: j.errors,
|
|
199
|
-
onChange: j.onChange,
|
|
200
|
-
lineItems: {
|
|
201
|
-
items: j.lineItemRows,
|
|
202
|
-
glCodeOptions: K,
|
|
203
|
-
glCodeDisabled: Ue,
|
|
204
|
-
glCodeUnavailableMessage: q,
|
|
205
|
-
discount: j.discount,
|
|
206
|
-
onDiscountChange: j.onDiscountChange,
|
|
207
|
-
tax: j.tax,
|
|
208
|
-
onTaxChange: j.onTaxChange,
|
|
209
|
-
total: j.total,
|
|
210
|
-
onTotalChange: j.onTotalChange,
|
|
211
|
-
onAddLineItem: j.onAddLineItem,
|
|
212
|
-
errors: j.lineItemErrors,
|
|
213
|
-
testId: r.lineItems
|
|
214
|
-
},
|
|
215
|
-
documentPanel: /* @__PURE__ */ c(Ee, {
|
|
216
|
-
payableId: C,
|
|
217
|
-
readOnly: p,
|
|
218
|
-
isDocumentPending: !!C && !A?.file && (w.isLoading || A?.ocr_status === "processing"),
|
|
219
|
-
file: A?.file ? {
|
|
220
|
-
id: A.file.id,
|
|
221
|
-
name: A.file.name,
|
|
222
|
-
url: A.file.url,
|
|
223
|
-
mimetype: A.file.mimetype
|
|
224
|
-
} : void 0,
|
|
225
|
-
staging: {
|
|
226
|
-
stagedFile: P.stagedFile,
|
|
227
|
-
onFileStaged: P.stageFile,
|
|
228
|
-
onClearStagedFile: P.clearStagedFile,
|
|
229
|
-
isSaving: F
|
|
230
|
-
},
|
|
231
|
-
deletion: {
|
|
232
|
-
isPending: P.isFileDeletionPending,
|
|
233
|
-
onRequest: P.requestFileDeletion,
|
|
234
|
-
onDetachNow: P.detachFileNow,
|
|
235
|
-
isDeleting: P.isDeletingFile,
|
|
236
|
-
hasFailed: P.hasFileDeletionFailed
|
|
237
|
-
}
|
|
238
|
-
}),
|
|
239
|
-
menuItems: G.menuItems,
|
|
240
|
-
readOnly: p,
|
|
241
|
-
detail: p ? {
|
|
242
|
-
view: Ke,
|
|
243
|
-
actions: Ve,
|
|
244
|
-
scheduledSummary: z.hasScheduledPayment && z.scheduledDateLabel ? h.scheduledSummary(z.scheduledDateLabel) : void 0,
|
|
245
|
-
paymentInstructionsForm: M && H ? {
|
|
246
|
-
isOpen: V.isOpen,
|
|
247
|
-
values: V.values,
|
|
248
|
-
errors: V.errors,
|
|
249
|
-
isSaving: V.isSaving,
|
|
250
|
-
onOpen: V.open,
|
|
251
|
-
onCancel: V.close,
|
|
252
|
-
onChange: V.onChange,
|
|
253
|
-
onSave: V.save
|
|
254
|
-
} : void 0,
|
|
255
|
-
isLoading: w.isLoading || T.isResolving || k.isResolving,
|
|
256
|
-
isError: w.isError || T.isError || k.isError
|
|
257
|
-
} : void 0,
|
|
258
|
-
isLineItemsLoading: T.isResolving,
|
|
259
|
-
isSaving: F,
|
|
260
|
-
isSavingDraft: P.isSavingDraft,
|
|
261
|
-
isFinalizing: P.isFinalizing,
|
|
262
|
-
onCancel: Q,
|
|
263
|
-
onCollapse: p ? Me : void 0,
|
|
264
|
-
onSaveDraft: P.saveDraft,
|
|
265
|
-
onFinalize: P.finalize,
|
|
266
|
-
testId: r.dialog
|
|
267
|
-
}),
|
|
268
|
-
/* @__PURE__ */ c(ue, {
|
|
269
|
-
open: Re,
|
|
270
|
-
onSaveDraft: Ze,
|
|
271
|
-
onDiscard: Xe,
|
|
272
|
-
onCancel: () => x(!1),
|
|
273
|
-
isSaving: P.isSavingDraft,
|
|
274
|
-
isSaveDraftDisabled: $,
|
|
275
|
-
labels: h.unsavedChanges,
|
|
276
|
-
testId: r.unsavedDialog,
|
|
277
|
-
saveDraftTestId: r.unsavedSaveDraft,
|
|
278
|
-
discardTestId: r.unsavedDiscard
|
|
279
|
-
}),
|
|
280
|
-
/* @__PURE__ */ c(n, {
|
|
281
|
-
...He,
|
|
282
|
-
labels: { cancelButton: h.actions.decisionDialog.cancelButton },
|
|
283
|
-
testId: r.decisionDialog,
|
|
284
|
-
confirmTestId: r.decisionConfirm,
|
|
285
|
-
reasonTestId: r.decisionReason
|
|
286
|
-
}),
|
|
287
|
-
/* @__PURE__ */ c(n, {
|
|
288
|
-
...G.dialog,
|
|
289
|
-
labels: { cancelButton: h.actions.decisionDialog.cancelButton },
|
|
290
|
-
testId: r.deleteDraftDialog,
|
|
291
|
-
confirmTestId: r.deleteDraftConfirm
|
|
292
|
-
}),
|
|
293
|
-
/* @__PURE__ */ c(le, { ...U.dialogProps }),
|
|
294
|
-
p && A ? /* @__PURE__ */ c(me, {
|
|
295
|
-
ref: R,
|
|
296
|
-
payable: A,
|
|
297
|
-
poweredByBankName: Ne,
|
|
298
|
-
labels: h.payBill
|
|
299
|
-
}) : null
|
|
300
|
-
] });
|
|
301
|
-
}
|
|
2
|
+
var e = {
|
|
3
|
+
dialog: "bill-pay-bill-create-dialog",
|
|
4
|
+
vendorSection: "bill-pay-bill-create-vendor",
|
|
5
|
+
lineItems: "bill-pay-bill-create-line-items",
|
|
6
|
+
documentPanel: "bill-pay-bill-create-document",
|
|
7
|
+
duplicateNotice: "bill-pay-bill-create-duplicate-notice",
|
|
8
|
+
decisionDialog: "bill-pay-bill-decision-dialog",
|
|
9
|
+
decisionConfirm: "bill-pay-bill-decision-confirm",
|
|
10
|
+
decisionReason: "bill-pay-bill-decision-reason",
|
|
11
|
+
deleteDraftDialog: "bill-pay-bill-delete-draft-dialog",
|
|
12
|
+
deleteDraftConfirm: "bill-pay-bill-delete-draft-confirm",
|
|
13
|
+
unsavedDialog: "bill-pay-bill-unsaved-dialog",
|
|
14
|
+
unsavedSaveDraft: "bill-pay-bill-unsaved-save-draft",
|
|
15
|
+
unsavedDiscard: "bill-pay-bill-unsaved-discard"
|
|
16
|
+
};
|
|
302
17
|
//#endregion
|
|
303
|
-
export {
|
|
18
|
+
export { e as billCreateTestIds };
|