Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
82a0f8c
set skip confirmation flag
Gonals Mar 26, 2024
a376116
add new params to handle skip
Gonals Mar 26, 2024
b08993e
changing branch
Gonals Mar 26, 2024
90f96da
Correctly set flag
Gonals Mar 26, 2024
d24012d
handle split
Gonals Mar 27, 2024
bd1f325
correctly set flag
Gonals Mar 27, 2024
33cba71
handle money request
Gonals Mar 27, 2024
63414c1
cleanup params
Gonals Mar 27, 2024
e964369
change branches
Gonals Mar 27, 2024
4d557c3
Merge branch 'main' into alberto-qabSkip
Gonals Mar 27, 2024
a3845e4
display correct button for send
Gonals Mar 27, 2024
39e4599
pass back payment method
Gonals Mar 27, 2024
cd8ee1d
wrap up send money
Gonals Mar 27, 2024
ca6d0ed
fix split
Gonals Mar 27, 2024
c5bafb2
changing branches
Gonals Mar 28, 2024
a8e58eb
Merge branch 'main' into alberto-qabSkip
Gonals Mar 28, 2024
dc656e0
Merge branch 'main' into alberto-qabSkip
Gonals Mar 29, 2024
2415362
conflicts
Gonals Apr 1, 2024
fea5996
remove console
Gonals Apr 1, 2024
2320f0a
handle distance requests
Gonals Apr 1, 2024
0ca3854
make distance work
Gonals Apr 1, 2024
5c7728b
handle splits
Gonals Apr 1, 2024
d0bd498
add params for receipt
Gonals Apr 2, 2024
c4465bc
more receipt handling
Gonals Apr 2, 2024
89ecee3
conflicts
Gonals Apr 3, 2024
e9d7d84
more fixes after merge main
Gonals Apr 3, 2024
0345b7d
set flag for task
Gonals Apr 3, 2024
3b7111c
wrap up task
Gonals Apr 3, 2024
6b9981f
add scan native
Gonals Apr 3, 2024
95bbf68
more scn native
Gonals Apr 3, 2024
80d0507
cleanup
Gonals Apr 3, 2024
7a23b4b
prettier
Gonals Apr 3, 2024
4350aaa
do not skip for manual workspace requests
Gonals Apr 3, 2024
53bde59
dont skip when categories are requires
Gonals Apr 3, 2024
b969e75
typescript
Gonals Apr 3, 2024
dc2216c
more typescript
Gonals Apr 3, 2024
98a4bad
lint
Gonals Apr 3, 2024
efe05a3
conflicts
Gonals Apr 4, 2024
724c833
more typescript
Gonals Apr 4, 2024
2575c8b
still typescript
Gonals Apr 4, 2024
f884c75
more typescript
Gonals Apr 4, 2024
43d5472
undo changes
Gonals Apr 4, 2024
6eb6b5b
use new onyx key
Gonals Apr 4, 2024
4200aaa
apply change to distance
Gonals Apr 4, 2024
2b6391e
apply changes to scan
Gonals Apr 4, 2024
d3496ee
prettier
Gonals Apr 4, 2024
86fb2c3
typing fixes
Gonals Apr 4, 2024
126a2d9
conflicts
Gonals Apr 4, 2024
c34e016
lint
Gonals Apr 4, 2024
9fa5802
remove extra param
Gonals Apr 4, 2024
af50329
Assign tax button update
Gonals Apr 4, 2024
0b5acd9
prettier
Gonals Apr 4, 2024
782f274
Display correct button if report is missing
Gonals Apr 4, 2024
a694117
go to user serlection if report is missing or archived
Gonals Apr 4, 2024
e9381e3
conflicts
Gonals Apr 8, 2024
3df8757
button style
Gonals Apr 8, 2024
07d22e3
pass payment method
Gonals Apr 8, 2024
356a8d5
remove extra param
Gonals Apr 8, 2024
c24fafc
prettier
Gonals Apr 8, 2024
a205dfb
conflicts
Gonals Apr 9, 2024
d573e25
typescript
Gonals Apr 9, 2024
fab20c2
lint
Gonals Apr 9, 2024
2a7b093
lint
Gonals Apr 9, 2024
b9b50ec
conflicts
Gonals Apr 10, 2024
fd74ff7
Merge branch 'main' into alberto-qabSkip
Gonals Apr 10, 2024
9adfcc3
Merge branch 'main' into alberto-qabSkip
Gonals Apr 11, 2024
b66a6b1
merge tons of conflicts
Gonals Apr 11, 2024
b12e867
better props
Gonals Apr 11, 2024
eca86e5
more props fixes
Gonals Apr 11, 2024
5e7ee15
typescript
Gonals Apr 11, 2024
4d090e7
prettier
Gonals Apr 11, 2024
af7c219
more typescript
Gonals Apr 11, 2024
0d451cc
types and bools
Gonals Apr 11, 2024
0c55b21
still fighting Typescript
Gonals Apr 11, 2024
0cb3f1f
add receipt type
Gonals Apr 11, 2024
699e93b
fix split flow
Gonals Apr 11, 2024
2df54af
typo
Gonals Apr 11, 2024
06b604f
add policy to props
Gonals Apr 11, 2024
10d7e3e
more onyx props fixes
Gonals Apr 11, 2024
76f0050
hopefully last one
Gonals Apr 11, 2024
d743b8f
lint
Gonals Apr 11, 2024
dcf1f68
import fixes
Gonals Apr 11, 2024
aeb636f
typoo
Gonals Apr 11, 2024
b0f5119
Merge branch 'main' into alberto-qabSkip
Gonals Apr 12, 2024
80961f4
Fix split
Gonals Apr 12, 2024
4ee284b
prettier
Gonals Apr 12, 2024
7c4897f
shorthand
Gonals Apr 12, 2024
4137caa
MORE conflicts
Gonals Apr 15, 2024
e355f28
first typescript cleanup round
Gonals Apr 15, 2024
860600c
prettier
Gonals Apr 15, 2024
d6e4090
lint
Gonals Apr 15, 2024
4b29f37
hopefully final cleanup
Gonals Apr 15, 2024
566b057
fix skip distance
Gonals Apr 15, 2024
e0d4bda
more conflicts
Gonals Apr 16, 2024
aaf715f
Merge branch 'main' into alberto-qabSkip
Gonals Apr 16, 2024
cf99ea3
do not skip for track expenses (for now)
Gonals Apr 16, 2024
3eb8e34
remove uneeded param
Gonals Apr 16, 2024
84f8974
remove lint exceptions
Gonals Apr 16, 2024
d4905aa
readd them
Gonals Apr 16, 2024
d8f364a
add param type
Gonals Apr 16, 2024
575cdf7
removing last change
Gonals Apr 16, 2024
8bd923b
conflicts
Gonals Apr 16, 2024
d21fee6
conflicts
Gonals Apr 18, 2024
35798b9
Add label
Gonals Apr 18, 2024
af29274
fix conflict issue
Gonals Apr 18, 2024
d89c34c
undo last change. I was wrong
Gonals Apr 18, 2024
68b1ede
Update button copy
Gonals Apr 18, 2024
4ae3c5d
better buttons
Gonals Apr 18, 2024
6379702
lint
Gonals Apr 18, 2024
aa3a0cd
dependencies
Gonals Apr 18, 2024
1da8fd1
conflicts
Gonals Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle money request
  • Loading branch information
Gonals committed Mar 27, 2024
commit 33cba717b2f9a2a92f18992cc004b97697c76074
39 changes: 37 additions & 2 deletions src/pages/iou/request/step/IOURequestStepAmount.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import {
withCurrentUserPersonalDetailsDefaultProps,
withCurrentUserPersonalDetailsPropTypes
} from "@components/withCurrentUserPersonalDetails";
import tagPropTypes from "@components/tagPropTypes";
import categoryPropTypes from "@components/categoryPropTypes";

const propTypes = {
/** Navigation route context info provided by react navigation */
Expand Down Expand Up @@ -56,13 +58,19 @@ const propTypes = {
taxRates: taxPropTypes,
}),

policyTags: tagPropTypes,

policyCategories: PropTypes.objectOf(categoryPropTypes),

...withCurrentUserPersonalDetailsPropTypes,
};

const defaultProps = {
report: {},
transaction: {},
policy: {},
policyCategories: {},
policyTags: {},
...withCurrentUserPersonalDetailsDefaultProps,
};

Expand All @@ -79,6 +87,8 @@ function IOURequestStepAmount({
transaction,
transaction: {currency},
policy,
policyCategories,
policyTags,
currentUserPersonalDetails,
}) {
const {translate} = useLocalize();
Expand Down Expand Up @@ -153,6 +163,7 @@ function IOURequestStepAmount({
// to the confirm step.
if (report.reportID) {
const selectedParticipants = IOU.setMoneyRequestParticipantsFromReport(transactionID, report);
const comment = lodashGet(transaction, 'comment.comment', '');

if (transaction.skipConfirmation) {
if (iouType === CONST.IOU.TYPE.SPLIT) {
Expand All @@ -161,15 +172,33 @@ function IOURequestStepAmount({
currentUserPersonalDetails.login,
currentUserPersonalDetails.accountID,
transaction.amount,
lodashGet(transaction, 'comment', '').trim(),
comment.trim(),
transaction.currency,
transaction.category,
transaction.tag,
transaction.merchant,
);
return;
} else {
IOU.requestMoney(
report,
transaction.amount,
transaction.currency,
transaction.created,
transaction.merchant,
currentUserPersonalDetails.login,
currentUserPersonalDetails.accountID,
selectedParticipants[0],
comment.trim(),
null,
transaction.category,
transaction.tag,
transaction.billable,
policy,
policyTags,
policyCategories,
);
}

} else {
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(iouType, transactionID, reportID));
}
Expand Down Expand Up @@ -215,5 +244,11 @@ export default compose(
policy: {
key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '0'}`,
},
policyCategories: {
key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report ? report.policyID : '0'}`,
},
policyTags: {
key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_TAGS}${report ? report.policyID : '0'}`,
},
}),
)(IOURequestStepAmount);
2 changes: 0 additions & 2 deletions src/pages/iou/steps/NewRequestAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ function NewRequestAmountPage({route, iou, report, selectedTab}) {
Navigation.goBack(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iouType, reportID));
return;
}

if ()
IOU.navigateToNextPage(iou, iouType, report);
};

Expand Down