Skip to content

Commit

Permalink
Merge pull request #28628 from rezkiy37/feature/28593-viewing-categor…
Browse files Browse the repository at this point in the history
…y-split-bill

Allow Viewing a category to a Split Bill
  • Loading branch information
puneetlath authored Oct 9, 2023
2 parents a13d73c + d8a985b commit 2bae957
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ function MoneyRequestConfirmationList(props) {
const shouldCalculateDistanceAmount = props.isDistanceRequest && props.iouAmount === 0;

// A flag for showing the categories field
const shouldShowCategories = props.isPolicyExpenseChat && Permissions.canUseCategories(props.betas) && OptionsListUtils.hasEnabledOptions(_.values(props.policyCategories));
const shouldShowCategories =
props.isPolicyExpenseChat && Permissions.canUseCategories(props.betas) && (props.iouCategory || OptionsListUtils.hasEnabledOptions(_.values(props.policyCategories)));

// Fetches the first tag list of the policy
const policyTag = PolicyUtils.getTag(props.policyTags);
Expand Down
5 changes: 4 additions & 1 deletion src/pages/iou/SplitBillDetailsPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import _ from 'underscore';
import lodashGet from 'lodash/get';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
Expand Down Expand Up @@ -69,7 +70,7 @@ function SplitBillDetailsPage(props) {
}
const payeePersonalDetails = props.personalDetails[reportAction.actorAccountID];
const participantsExcludingPayee = _.filter(participants, (participant) => participant.accountID !== reportAction.actorAccountID);
const {amount: splitAmount, currency: splitCurrency, comment: splitComment} = ReportUtils.getTransactionDetails(transaction);
const {amount: splitAmount, currency: splitCurrency, comment: splitComment, category: splitCategory} = ReportUtils.getTransactionDetails(transaction);

return (
<ScreenWrapper testID={SplitBillDetailsPage.displayName}>
Expand All @@ -87,9 +88,11 @@ function SplitBillDetailsPage(props) {
iouAmount={splitAmount}
iouComment={splitComment}
iouCurrencyCode={splitCurrency}
iouCategory={splitCategory}
iouType={CONST.IOU.MONEY_REQUEST_TYPE.SPLIT}
isReadOnly
shouldShowFooter={false}
reportID={lodashGet(props.report, 'reportID', '')}
/>
)}
</View>
Expand Down

0 comments on commit 2bae957

Please sign in to comment.