-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Payment due @dmkt9] Allow manual reimbursement workspaces to set and use a preferred payer #92787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 44 commits
9334d49
566eff9
6bac69b
fac689b
fffb187
6b41645
3768f72
1d62b2b
0ccd17d
ce42d33
b6e6a59
19ef76b
873a043
b7ad25c
33f2078
4b13609
5a13f44
501bafb
8276218
174d67d
d4f2217
f49c2f6
df3e3bc
5ad0416
e3939ac
974e0ad
be66c82
10b5f53
e3962b8
00427e8
1c5028f
704dcda
7066ee9
9032164
72a1d99
42c1c09
e8e82af
b2b692c
75a56c7
f29826f
d4b6fda
08a601f
9009b95
81030ed
101150d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ function resetUSDBankAccount( | |
| policyID: string | undefined, | ||
| achAccount: ACHAccount | undefined, | ||
| lastUsedPaymentMethod?: OnyxTypes.LastPaymentMethodType, | ||
| policyOwner?: string, | ||
| ) { | ||
| if (!bankAccountID) { | ||
| throw new Error('Missing bankAccountID when attempting to reset free plan bank account'); | ||
|
|
@@ -28,6 +29,7 @@ function resetUSDBankAccount( | |
|
|
||
| const isLastUsedPaymentMethodBBA = lastUsedPaymentMethod?.expense?.name === CONST.IOU.PAYMENT_TYPE.VBBA; | ||
| const isPreviousLastUsedPaymentMethodBBA = lastUsedPaymentMethod?.lastUsed?.name === CONST.IOU.PAYMENT_TYPE.VBBA; | ||
| const reimburserEmail = achAccount?.reimburser ?? policyOwner; | ||
|
|
||
| const onyxData: OnyxData< | ||
| | typeof ONYXKEYS.REIMBURSEMENT_ACCOUNT | ||
|
|
@@ -55,7 +57,16 @@ function resetUSDBankAccount( | |
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, | ||
| value: { | ||
| achAccount: null, | ||
| achAccount: reimburserEmail | ||
| ? { | ||
| reimburser: reimburserEmail, | ||
| bankAccountID: null, | ||
| accountNumber: null, | ||
| addressName: null, | ||
| bankName: null, | ||
| state: null, | ||
|
Comment on lines
+63
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because this update is applied with Useful? React with 👍 / 👎. |
||
| } | ||
| : null, | ||
| }, | ||
| }, | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.