Skip to content
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
9 changes: 9 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6700,6 +6700,9 @@ const CONST = {
EXPORTED_TO: {column: this.TABLE_COLUMNS.EXPORTED_TO, search: true, reportView: false},
ACTION: {column: this.TABLE_COLUMNS.ACTION, search: true, reportView: false},
WITHDRAWAL_ID: {column: this.TABLE_COLUMNS.WITHDRAWAL_ID, search: true, reportView: true},
SUBMITTER_USER_ID: {column: this.TABLE_COLUMNS.SUBMITTER_USER_ID, search: true, reportView: true},
SUBMITTER_PAYROLL_ID: {column: this.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID, search: true, reportView: true},
ORDER_DEAL_NUMBERS: {column: this.TABLE_COLUMNS.ORDER_DEAL_NUMBERS, search: true, reportView: true},
};
},
get TYPE_CUSTOM_COLUMNS() {
Expand All @@ -6726,6 +6729,9 @@ const CONST = {
REPORT_ID: this.TABLE_COLUMNS.REPORT_ID,
BASE_62_REPORT_ID: this.TABLE_COLUMNS.BASE_62_REPORT_ID,
AMOUNT: this.TABLE_COLUMNS.TOTAL,
SUBMITTER_USER_ID: this.TABLE_COLUMNS.SUBMITTER_USER_ID,
SUBMITTER_PAYROLL_ID: this.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID,
ORDER_DEAL_NUMBERS: this.TABLE_COLUMNS.ORDER_DEAL_NUMBERS,
EXPORTED_ICON: this.TABLE_COLUMNS.EXPORTED_TO,
ACTION: this.TABLE_COLUMNS.ACTION,
},
Expand Down Expand Up @@ -6933,6 +6939,9 @@ const CONST = {
TAX_CODE: 'taxCode',
CATEGORY_GL_CODE: 'categoryGLCode',
WITHDRAWAL_ID: 'withdrawalID',
SUBMITTER_USER_ID: 'submitterUserID',
SUBMITTER_PAYROLL_ID: 'submitterPayrollID',
ORDER_DEAL_NUMBERS: 'orderDealNumbers',
AVATAR: 'avatar',
STATUS: 'status',
EXPENSES: 'expenses',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ function MoneyRequestReportTransactionList({
return getColumnsToShow({
currentAccountID: currentUserDetails?.accountID,
data: transactions,
report,
visibleColumns: (isExpenseReportViewFromIOUReport ? [] : (reportDetailsColumns ?? [])) as SearchCustomColumnIds[],
isExpenseReportView: true,
isExpenseReportViewFromIOUReport,
Expand All @@ -417,7 +418,7 @@ function MoneyRequestReportTransactionList({
shouldShowBillableColumn,
shouldShowCommentsColumn,
reportDetailsColumns,
report?.currency,
report,
isTaxEnabled,
policyCategories,
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function ExpenseReportListItemRowWide({

const currency = item.currency ?? CONST.CURRENCY.USD;
const {totalDisplaySpend = 0, nonReimbursableSpend = 0, reimbursableSpend = 0, isAllScanning: isScanning = false} = item;
const submitterUserID = item.submitterUserID;
const submitterPayrollID = item.submitterPayrollID;
const orderDealNumbers = item.orderDealNumbers;

const columnComponents = {
[CONST.SEARCH.TABLE_COLUMNS.AVATAR]: (
Expand Down Expand Up @@ -175,6 +178,21 @@ function ExpenseReportListItemRowWide({
/>
</View>
),
[CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID]: (
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID)]}>
<TextCell text={submitterUserID} />
</View>
),
[CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID]: (
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID)]}>
<TextCell text={submitterPayrollID} />
</View>
),
[CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS]: (
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS)]}>
<TextCell text={orderDealNumbers} />
</View>
),
[CONST.SEARCH.TABLE_COLUMNS.REPORT_ID]: (
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.REPORT_ID)]}>
<TextCell text={item.reportID === CONST.REPORT.UNREPORTED_REPORT_ID ? '' : item.reportID} />
Expand Down
24 changes: 24 additions & 0 deletions src/components/Search/SearchTableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ const getExpenseHeaders = (groupBy?: SearchGroupBy): SearchColumnConfig[] => [
columnName: CONST.SEARCH.TABLE_COLUMNS.WITHDRAWAL_ID,
translationKey: 'common.withdrawalID',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID,
translationKey: 'workspace.common.customField1',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID,
translationKey: 'workspace.common.customField2',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS,
translationKey: 'common.internationalReimbursementIDs',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT,
translationKey: groupBy ? 'common.total' : 'iou.amount',
Expand Down Expand Up @@ -272,6 +284,18 @@ const getExpenseReportHeaders = (profileIcon?: IconAsset): SearchColumnConfig[]
columnName: CONST.SEARCH.TABLE_COLUMNS.TOTAL,
translationKey: 'common.total',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID,
translationKey: 'workspace.common.customField1',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID,
translationKey: 'workspace.common.customField2',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS,
translationKey: 'common.internationalReimbursementIDs',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.BASE_62_REPORT_ID,
translationKey: 'common.reportID',
Expand Down
31 changes: 31 additions & 0 deletions src/components/TransactionItemRow/TransactionItemRowWide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ function TransactionItemRowWide({
const isExportedColumnWide = exportedColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE;
const isAmountColumnWide = amountColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE;
const isTaxAmountColumnWide = taxAmountColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE;
const reportForCustomColumns = transactionItem.report ?? report;
const submitterUserID = reportForCustomColumns?.submitterUserID;
const submitterPayrollID = reportForCustomColumns?.submitterPayrollID;
const orderDealNumbers = reportForCustomColumns?.orderDealNumbers;

const renderColumn = (column: SearchColumnType): React.ReactNode => {
switch (column) {
Expand Down Expand Up @@ -598,6 +602,33 @@ function TransactionItemRowWide({
<TextCell text={transactionItem.withdrawalID} />
</View>
);
case CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID:
return (
<View
key={column}
style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID)]}
>
<TextCell text={submitterUserID} />
</View>
);
case CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID:
return (
<View
key={column}
style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID)]}
>
<TextCell text={submitterPayrollID} />
</View>
);
case CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS:
return (
<View
key={column}
style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS)]}
>
<TextCell text={orderDealNumbers} />
</View>
);
default:
return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: 'Berichts-ID',
longReportID: 'Langer Bericht-ID',
withdrawalID: 'Auszahlungs-ID',
internationalReimbursementIDs: 'Internationale Erstattungs-IDs',
withdrawalStatus: 'Auszahlungsstatus',
bankAccounts: 'Bankkonten',
chooseFile: 'Datei auswählen',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ const translations = {
reportID: 'Report ID',
longReportID: 'Long Report ID',
withdrawalID: 'Withdrawal ID',
internationalReimbursementIDs: 'International reimbursement IDs',
withdrawalStatus: 'Withdrawal status',
bankAccounts: 'Bank accounts',
chooseFile: 'Choose file',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ const translations: TranslationDeepObject<typeof en> = {
exchangeRate: 'Tipo de cambio',
reimbursableTotal: 'Total reembolsable',
nonReimbursableTotal: 'Total no reembolsable',
internationalReimbursementIDs: 'IDs de reembolso internacional',
opensInNewTab: 'Se abre en una nueva pestaña',
locked: 'Bloqueado',
month: 'Monat',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: 'ID de note de frais',
longReportID: 'ID de note de frais longue',
withdrawalID: 'ID de retrait',
internationalReimbursementIDs: 'ID de remboursement international',
withdrawalStatus: 'Statut de retrait',
bankAccounts: 'Comptes bancaires',
chooseFile: 'Choisir un fichier',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: 'ID report',
longReportID: 'ID report dettagliato',
withdrawalID: 'ID prelievo',
internationalReimbursementIDs: 'ID di rimborso internazionale',
withdrawalStatus: 'Stato del prelievo',
bankAccounts: 'Conti bancari',
chooseFile: 'Scegli file',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: 'レポートID',
longReportID: '長いレポートID',
withdrawalID: '出金ID',
internationalReimbursementIDs: '国際払い戻しID',
withdrawalStatus: '出金ステータス',
bankAccounts: '銀行口座',
chooseFile: 'ファイルを選択',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: 'Rapport-ID',
longReportID: 'Lang rapport-ID',
withdrawalID: 'Opname-ID',
internationalReimbursementIDs: 'Internationale terugbetalings-ID’s',
withdrawalStatus: 'Opnamestatus',
bankAccounts: 'Bankrekeningen',
chooseFile: 'Bestand kiezen',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: 'ID raportu',
longReportID: 'Długi identyfikator raportu',
withdrawalID: 'Identyfikator wypłaty',
internationalReimbursementIDs: 'Identyfikatory zwrotów międzynarodowych',
withdrawalStatus: 'Status wypłaty',
bankAccounts: 'Konta bankowe',
chooseFile: 'Wybierz plik',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: 'ID do relatório',
longReportID: 'ID de relatório longo',
withdrawalID: 'ID do saque',
internationalReimbursementIDs: 'IDs de reembolso internacional',
withdrawalStatus: 'Status do saque',
bankAccounts: 'Contas bancárias',
chooseFile: 'Escolher arquivo',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ const translations: TranslationDeepObject<typeof en> = {
reportID: '报销单编号',
longReportID: '长报表 ID',
withdrawalID: '提现编号',
internationalReimbursementIDs: '国际报销 ID',
withdrawalStatus: '提现状态',
bankAccounts: '银行账户',
chooseFile: '选择文件',
Expand Down
6 changes: 6 additions & 0 deletions src/libs/DebugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ function validateReportDraftProperty(key: keyof Report | keyof ReportNameValuePa
case 'welcomeMessage':
case 'origin':
case 'originalID':
case 'submitterUserID':
case 'submitterPayrollID':
case 'orderDealNumbers':
return validateString(value);
case 'hasOutstandingChildRequest':
case 'hasOutstandingChildTask':
Expand Down Expand Up @@ -579,6 +582,9 @@ function validateReportDraftProperty(key: keyof Report | keyof ReportNameValuePa
type: CONST.RED_BRICK_ROAD_PENDING_ACTION,
policyID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
reportID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
submitterUserID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
submitterPayrollID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
orderDealNumbers: CONST.RED_BRICK_ROAD_PENDING_ACTION,
avatarUrl: CONST.RED_BRICK_ROAD_PENDING_ACTION,
chatType: CONST.RED_BRICK_ROAD_PENDING_ACTION,
hasOutstandingChildRequest: CONST.RED_BRICK_ROAD_PENDING_ACTION,
Expand Down
30 changes: 29 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as defaultGroupAvatars from '@components/Icon/GroupDefaultAvatars';
import * as defaultWorkspaceAvatars from '@components/Icon/WorkspaceDefaultAvatars';
import type {LocaleContextProps, LocalizedTranslate} from '@components/LocaleContextProvider';
import type {MoneyRequestAmountInputProps} from '@components/MoneyRequestAmountInput';
import type {SearchColumnType} from '@components/Search/types';
import type {TransactionWithOptionalSearchFields} from '@components/TransactionItemRow/types';
import type PolicyData from '@hooks/usePolicyData/types';
import type {PolicyTagList} from '@pages/workspace/tags/types';
Expand Down Expand Up @@ -13061,10 +13062,26 @@ const sortableColumnNames = [
CONST.SEARCH.TABLE_COLUMNS.TAX_RATE,
CONST.SEARCH.TABLE_COLUMNS.CARD,
CONST.SEARCH.TABLE_COLUMNS.WITHDRAWAL_ID,
CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID,
CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID,
CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS,
] as const;

type SortableColumnName = TupleToUnion<typeof sortableColumnNames>;

function getReportCustomColumnValue(key: SearchColumnType, report: OnyxEntry<Report>): string | undefined {
switch (key) {
case CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID:
return report?.submitterUserID;
case CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID:
return report?.submitterPayrollID;
case CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS:
return report?.orderDealNumbers;
default:
return undefined;
}
}

/**
* Type guard to check if a column name is sortable
*/
Expand All @@ -13076,7 +13093,13 @@ function isSortableColumnName(key: unknown): key is SortableColumnName {
* Get the sortable value for a transaction based on the column type.
* Used for sorting transactions in MoneyRequestReportTransactionList.
*/
function getTransactionSortValue(transaction: Transaction, key: SortableColumnName, report: Report, policy: OnyxEntry<Policy>, policyCategories?: PolicyCategories): string | number {
function getTransactionSortValue(
transaction: Transaction,
key: SortableColumnName,
report: Report,
policy: OnyxEntry<Policy>,
policyCategories?: PolicyCategories,
): string | number | undefined {
switch (key) {
case CONST.SEARCH.TABLE_COLUMNS.DATE:
return getTransactionCreated(transaction);
Expand Down Expand Up @@ -13115,6 +13138,10 @@ function getTransactionSortValue(transaction: Transaction, key: SortableColumnNa
return transaction.cardID ?? CONST.DEFAULT_NUMBER_ID;
case CONST.SEARCH.TABLE_COLUMNS.WITHDRAWAL_ID:
return transaction.withdrawalID ? transaction.withdrawalID : '';
case CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_USER_ID:
case CONST.SEARCH.TABLE_COLUMNS.SUBMITTER_PAYROLL_ID:
case CONST.SEARCH.TABLE_COLUMNS.ORDER_DEAL_NUMBERS:
return getReportCustomColumnValue(key, report);
default:
return '';
}
Expand Down Expand Up @@ -13516,6 +13543,7 @@ export {
isReportOpenOrUnsubmitted,
getIconsForExpenseReport,
shouldBlockSubmitDueToPreventSelfApproval,
getReportCustomColumnValue,
getTransactionSortValue,
isSortableColumnName,
getLinkedIOUTransaction,
Expand Down
Loading
Loading