Skip to content

Commit

Permalink
Merge pull request #56066 from Expensify/alberto-billablePerdiem
Browse files Browse the repository at this point in the history
Use Billable parameter for Per Diem transactions
  • Loading branch information
johnmlee101 authored Feb 6, 2025
2 parents 9f8c7bd + 4459bb5 commit 6442df9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/libs/API/parameters/CreatePerDiemRequestParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type CreatePerDiemRequestParams = {
reportPreviewReportActionID: string;
transactionThreadReportID: string;
createdReportActionIDForThread: string | undefined;
billable?: boolean;
};

export default CreatePerDiemRequestParams;
8 changes: 7 additions & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ type MoneyRequestInformation = {
transactionThreadReportID: string;
createdReportActionIDForThread: string | undefined;
onyxData: OnyxData;
billable?: boolean;
};

type TrackExpenseInformation = {
Expand Down Expand Up @@ -338,6 +339,7 @@ type PerDiemExpenseTransactionParams = {
tag?: string;
created: string;
customUnit: TransactionCustomUnit;
billable?: boolean;
};

type RequestMoneyPolicyParams = {
Expand Down Expand Up @@ -2822,7 +2824,7 @@ function getPerDiemExpenseInformation(perDiemExpenseInformation: PerDiemExpenseI
const {parentChatReport, transactionParams, participantParams, policyParams = {}, moneyRequestReportID = ''} = perDiemExpenseInformation;
const {payeeAccountID = userAccountID, payeeEmail = currentUserEmail, participant} = participantParams;
const {policy, policyCategories, policyTagList} = policyParams;
const {comment = '', currency, created, category, tag, customUnit} = transactionParams;
const {comment = '', currency, created, category, tag, customUnit, billable} = transactionParams;

const amount = computePerDiemExpenseAmount(customUnit);
const merchant = computePerDiemExpenseMerchant(customUnit, policy);
Expand Down Expand Up @@ -2897,6 +2899,7 @@ function getPerDiemExpenseInformation(perDiemExpenseInformation: PerDiemExpenseI
merchant,
tag,
customUnit,
billable,
pendingFields: {subRates: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD},
},
});
Expand Down Expand Up @@ -3016,6 +3019,7 @@ function getPerDiemExpenseInformation(perDiemExpenseInformation: PerDiemExpenseI
successData,
failureData,
},
billable,
};
}

Expand Down Expand Up @@ -4575,6 +4579,7 @@ function submitPerDiemExpense(submitPerDiemExpenseInformation: PerDiemExpenseInf
transactionThreadReportID,
createdReportActionIDForThread,
onyxData,
billable,
} = getPerDiemExpenseInformation({
parentChatReport: currentChatReport,
participantParams,
Expand Down Expand Up @@ -4605,6 +4610,7 @@ function submitPerDiemExpense(submitPerDiemExpenseInformation: PerDiemExpenseInf
tag,
transactionThreadReportID,
createdReportActionIDForThread,
billable,
};

API.write(WRITE_COMMANDS.CREATE_PER_DIEM_REQUEST, parameters, onyxData);
Expand Down
1 change: 1 addition & 0 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ function IOURequestStepConfirmation({
category: transaction.category,
tag: transaction.tag,
customUnit: transaction.comment?.customUnit,
billable: transaction.billable,
},
});
},
Expand Down

0 comments on commit 6442df9

Please sign in to comment.