Skip to content
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

Use Billable parameter for Per Diem transactions #56066

Merged
merged 5 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@ -2793,7 +2795,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 @@ -2868,6 +2870,7 @@ function getPerDiemExpenseInformation(perDiemExpenseInformation: PerDiemExpenseI
merchant,
tag,
customUnit,
billable,
pendingFields: {subRates: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD},
},
});
Expand Down Expand Up @@ -2987,6 +2990,7 @@ function getPerDiemExpenseInformation(perDiemExpenseInformation: PerDiemExpenseI
successData,
failureData,
},
billable,
};
}

Expand Down Expand Up @@ -4546,6 +4550,7 @@ function submitPerDiemExpense(submitPerDiemExpenseInformation: PerDiemExpenseInf
transactionThreadReportID,
createdReportActionIDForThread,
onyxData,
billable,
} = getPerDiemExpenseInformation({
parentChatReport: currentChatReport,
participantParams,
Expand Down Expand Up @@ -4576,6 +4581,7 @@ function submitPerDiemExpense(submitPerDiemExpenseInformation: PerDiemExpenseInf
tag,
transactionThreadReportID,
createdReportActionIDForThread,
billable,
};

API.write(WRITE_COMMANDS.CREATE_PER_DIEM_REQUEST, parameters, onyxData);
Expand Down
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