Skip to content
Open
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
8 changes: 8 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7053,6 +7053,8 @@ const CONST = {
BANK_ACCOUNT: this.TABLE_COLUMNS.GROUP_BANK_ACCOUNT,
WITHDRAWAL_ID: this.TABLE_COLUMNS.GROUP_WITHDRAWAL_ID,
EXPENSES: this.TABLE_COLUMNS.GROUP_EXPENSES,
AMOUNT_DEBITED: this.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED,
AMOUNT_REIMBURSED: this.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED,
TOTAL: this.TABLE_COLUMNS.GROUP_TOTAL,
},
CATEGORY: {
Expand Down Expand Up @@ -7131,6 +7133,8 @@ const CONST = {
this.TABLE_COLUMNS.GROUP_BANK_ACCOUNT,
this.TABLE_COLUMNS.GROUP_WITHDRAWAL_ID,
this.TABLE_COLUMNS.GROUP_EXPENSES,
this.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED,
this.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED,
this.TABLE_COLUMNS.GROUP_TOTAL,
],
CATEGORY: [this.TABLE_COLUMNS.GROUP_CATEGORY, this.TABLE_COLUMNS.GROUP_EXPENSES, this.TABLE_COLUMNS.GROUP_TOTAL],
Expand Down Expand Up @@ -7251,6 +7255,8 @@ const CONST = {
GROUP_YEAR: 'groupyear',
GROUP_QUARTER: 'groupquarter',
GROUP_WITHDRAWAL_STATUS: 'groupWithdrawalStatus',
GROUP_AMOUNT_DEBITED: 'groupAmountDebited',
GROUP_AMOUNT_REIMBURSED: 'groupAmountReimbursed',
},
SYNTAX_OPERATORS: {
AND: 'and',
Expand Down Expand Up @@ -7470,6 +7476,8 @@ const CONST = {
[this.TABLE_COLUMNS.GROUP_YEAR]: 'group-year',
[this.TABLE_COLUMNS.GROUP_QUARTER]: 'group-quarter',
[this.TABLE_COLUMNS.GROUP_WITHDRAWAL_STATUS]: 'group-withdrawal-status',
[this.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED]: 'group-amount-debited',
[this.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED]: 'group-amount-reimbursed',
};
},
NOT_PREFIX: '-',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/FilterDropdowns/SortByPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function SortByPopup({searchResults, queryJSON, groupBy, onSort, onSortOrderPres
const searchDataType = shouldUseLiveData ? CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT : searchResults?.search?.type;
const currentColumns = !searchResults?.data
? []
: getColumnsToShow({currentAccountID: accountID, data: searchResults.data, visibleColumns, type: searchDataType, groupBy: groupBy?.value});
: getColumnsToShow({currentAccountID: accountID, data: searchResults.data, visibleColumns, type: searchDataType, groupBy: groupBy?.value, sortBy: queryJSON.sortBy});
const sortableColumns = getSortByOptions(currentColumns, translate);
const sortOrder = queryJSON.sortOrder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function WithdrawalIDListItemHeaderImpl({
withdrawalIDItem.debitPosted,
DateUtils.doesDateBelongToAPastYear(withdrawalIDItem.debitPosted) ? CONST.DATE.MONTH_DAY_YEAR_ABBR_FORMAT : CONST.DATE.MONTH_DAY_ABBR_FORMAT,
);
const {debitedAmount, debitedCurrency, creditedAmount, creditedCurrency} = withdrawalIDItem;

const badgeProps = getSettlementStatusBadgeProps(withdrawalIDItem.state, translate, theme);
const settlementStatus = getSettlementStatus(withdrawalIDItem.state);
const statusBadge = !!badgeProps && (
Expand Down Expand Up @@ -177,6 +179,33 @@ function WithdrawalIDListItemHeaderImpl({
<TextCell text={String(withdrawalIDItem.count)} />
</View>
),
// A settlement that did not convert currencies reports neither amount, and an amount says nothing without the currency it moved in.
[CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED]: (
<View
key={CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED}
style={StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED)}
>
{!!debitedAmount && !!debitedCurrency && (
<TotalCell
total={debitedAmount}
currency={debitedCurrency}
/>
)}
</View>
),
[CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED]: (
<View
key={CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED}
style={StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED)}
>
{!!creditedAmount && !!creditedCurrency && (
<TotalCell
total={creditedAmount}
currency={creditedCurrency}
/>
)}
</View>
),
[CONST.SEARCH.TABLE_COLUMNS.GROUP_TOTAL]: (
<View
key={CONST.SEARCH.TABLE_COLUMNS.TOTAL}
Expand Down
36 changes: 23 additions & 13 deletions src/components/Search/SearchTableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,17 @@ const getExpenseReportHeaders = (profileIcon?: IconAsset): SearchColumnConfig[]
];

const getTransactionGroupHeaders = (groupBy: SearchGroupBy, icons: SearchHeaderIcons): SearchColumnConfig[] => {
const commonGroupHeaders: SearchColumnConfig[] = [
{
columnName: CONST.SEARCH.TABLE_COLUMNS.GROUP_EXPENSES,
translationKey: 'common.expenses' as TranslationPaths,
isColumnSortable: true,
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.GROUP_TOTAL,
translationKey: 'common.total' as TranslationPaths,
isColumnSortable: true,
},
];
const groupExpensesHeader: SearchColumnConfig = {
columnName: CONST.SEARCH.TABLE_COLUMNS.GROUP_EXPENSES,
translationKey: 'common.expenses' as TranslationPaths,
isColumnSortable: true,
};
const groupTotalHeader: SearchColumnConfig = {
columnName: CONST.SEARCH.TABLE_COLUMNS.GROUP_TOTAL,
translationKey: 'common.total' as TranslationPaths,
isColumnSortable: true,
};
const commonGroupHeaders: SearchColumnConfig[] = [groupExpensesHeader, groupTotalHeader];
switch (groupBy) {
case CONST.SEARCH.GROUP_BY.FROM:
return [
Expand Down Expand Up @@ -405,7 +404,18 @@ const getTransactionGroupHeaders = (groupBy: SearchGroupBy, icons: SearchHeaderI
columnName: CONST.SEARCH.TABLE_COLUMNS.GROUP_WITHDRAWAL_ID,
translationKey: 'common.withdrawalID',
},
...commonGroupHeaders,
groupExpensesHeader,
{
columnName: CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED,
translationKey: 'common.amountDebited',
isColumnSortable: true,
},
Comment thread
ishpaul777 marked this conversation as resolved.
{
columnName: CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED,
translationKey: 'common.amountReimbursed',
isColumnSortable: true,
},
groupTotalHeader,
];
case CONST.SEARCH.GROUP_BY.CATEGORY:
return [
Expand Down
3 changes: 2 additions & 1 deletion src/components/Search/SortableTableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ function SortableTableHeader({
const sortByColumnName = sortColumnName ?? columnName;
const isActive = sortBy === sortByColumnName;
const isReimbursableOrBillableColumn = columnName === CONST.SEARCH.TABLE_COLUMNS.REIMBURSABLE || columnName === CONST.SEARCH.TABLE_COLUMNS.BILLABLE;
const isConversionAmountColumn = columnName === CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_DEBITED || columnName === CONST.SEARCH.TABLE_COLUMNS.GROUP_AMOUNT_REIMBURSED;
const textStyle = [
columnName === CONST.SEARCH.TABLE_COLUMNS.RECEIPT ? StyleUtils.getTextOverflowStyle('clip') : null,
isReimbursableOrBillableColumn ? styles.flexShrink1 : null,
isReimbursableOrBillableColumn || isConversionAmountColumn ? styles.flexShrink1 : null,
];

return (
Expand Down
1 change: 1 addition & 0 deletions src/components/Search/hooks/useSearchSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ function useSearchSnapshot({queryJSON, searchResults, newSearchResultKeys, trans
groupBy: validGroupBy,
shouldUseStrictDefaultExpenseColumns: currentSearchKey === CONST.SEARCH.SEARCH_KEYS.EXPENSES && isDefaultExpensesQuery(queryJSON),
fallbackPolicyID: policyForMovingExpensesID,
sortBy: queryJSON.sortBy,
});
})();

Expand Down
1 change: 1 addition & 0 deletions src/hooks/useSearchOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function useSearchOverlay({
groupBy: validGroupBy,
shouldUseStrictDefaultExpenseColumns,
fallbackPolicyID: policyForMovingExpensesID,
sortBy: queryJSON.sortBy,
});
})();

Expand Down
2 changes: 2 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: 'Langer Bericht-ID',
withdrawalID: 'Auszahlungs-ID',
internationalReimbursementIDs: 'Internationale Erstattungs-IDs',
amountDebited: 'Belasteter Betrag',
amountReimbursed: 'Erstatteter Betrag',
withdrawalStatus: 'Auszahlungsstatus',
paidStatus: 'Status: Bezahlt',
bankAccounts: 'Bankkonten',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ const translations = {
longReportID: 'Long Report ID',
withdrawalID: 'Withdrawal ID',
internationalReimbursementIDs: 'International reimbursement IDs',
amountDebited: 'Amount debited',
amountReimbursed: 'Amount reimbursed',
withdrawalStatus: 'Withdrawal status',
paidStatus: 'Paid status',
bankAccounts: 'Bank accounts',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ const translations: TranslationDeepObject<typeof en> = {
reimbursableTotal: 'Total reembolsable',
nonReimbursableTotal: 'Total no reembolsable',
internationalReimbursementIDs: 'IDs de reembolso internacional',
amountDebited: 'Importe debitado',
amountReimbursed: 'Importe reembolsado',
opensInNewTab: 'Se abre en una nueva pestaña',
locked: 'Bloqueado',
month: 'Monat',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: 'ID de note de frais longue',
withdrawalID: 'ID de retrait',
internationalReimbursementIDs: 'ID de remboursement international',
amountDebited: 'Montant débité',
amountReimbursed: 'Montant remboursé',
withdrawalStatus: 'Statut de retrait',
paidStatus: 'Statut payé',
bankAccounts: 'Comptes bancaires',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: 'ID report dettagliato',
withdrawalID: 'ID prelievo',
internationalReimbursementIDs: 'ID di rimborso internazionale',
amountDebited: 'Importo addebitato',
amountReimbursed: 'Importo rimborsato',
withdrawalStatus: 'Stato del prelievo',
paidStatus: 'Stato di pagamento',
bankAccounts: 'Conti bancari',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: '長いレポートID',
withdrawalID: '出金ID',
internationalReimbursementIDs: '国際払い戻しID',
amountDebited: '引き落とし金額',
amountReimbursed: '払い戻し金額',
withdrawalStatus: '出金ステータス',
paidStatus: '支払済みステータス',
bankAccounts: '銀行口座',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: 'Lang rapport-ID',
withdrawalID: 'Opname-ID',
internationalReimbursementIDs: 'Internationale terugbetalings-ID’s',
amountDebited: 'Afgeschreven bedrag',
amountReimbursed: 'Terugbetaald bedrag',
withdrawalStatus: 'Opnamestatus',
paidStatus: 'Betaald-status',
bankAccounts: 'Bankrekeningen',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: 'Długi identyfikator raportu',
withdrawalID: 'Identyfikator wypłaty',
internationalReimbursementIDs: 'Identyfikatory zwrotów międzynarodowych',
amountDebited: 'Kwota obciążenia',
amountReimbursed: 'Kwota zwrotu',
withdrawalStatus: 'Status wypłaty',
paidStatus: 'Status: opłacono',
bankAccounts: 'Konta bankowe',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: 'ID de relatório longo',
withdrawalID: 'ID do saque',
internationalReimbursementIDs: 'IDs de reembolso internacional',
amountDebited: 'Valor debitado',
amountReimbursed: 'Valor reembolsado',
withdrawalStatus: 'Status do saque',
paidStatus: 'Status pago',
bankAccounts: 'Contas bancárias',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ const translations: TranslationDeepObject<typeof en> = {
longReportID: '长报表 ID',
withdrawalID: '提现编号',
internationalReimbursementIDs: '国际报销 ID',
amountDebited: '扣款金额',
amountReimbursed: '报销金额',
withdrawalStatus: '提现状态',
paidStatus: '已付款状态',
bankAccounts: '银行账户',
Expand Down
Loading
Loading