feat: add specific cashflow account transactions.

This commit is contained in:
elforjani13
2021-10-27 19:29:32 +02:00
parent f378275673
commit b0f1584b04
3 changed files with 16 additions and 21 deletions

View File

@@ -12,7 +12,7 @@ import {
const AccountTransactionsContext = React.createContext();
function flattenInfinityPages(data) {
return flatten(map(data.pages, (page) => page.cashflow_transactions));
return flatten(map(data.pages, (page) => page.transactions));
}
/**
@@ -30,9 +30,10 @@ function AccountTransactionsProvider({ query, ...props }) {
isSuccess: isCashflowTransactionsSuccess,
fetchNextPage: fetchNextTransactionsPage,
isFetchingNextPage,
hasNextPage
hasNextPage,
} = useAccountTransactionsInfinity(accountId, {
page_size: 50,
account_id: accountId,
});
// Memorized the cashflow account transactions.

View File

@@ -49,7 +49,7 @@ export function useAccountTransactionsColumns() {
{
id: 'type',
Header: intl.get('type'),
accessor: 'reference_type_formatted',
accessor: 'formatted_transaction_type',
className: 'type',
width: 140,
textOverview: true,
@@ -89,12 +89,21 @@ export function useAccountTransactionsColumns() {
{
id: 'running_balance',
Header: intl.get('cash_flow.label.running_balance'),
accessor: 'running_balance',
accessor: 'formatted_running_balance',
className: 'running_balance',
width: 150,
textOverview: true,
align: 'right',
},
{
id: 'balance',
Header: intl.get('balance'),
accessor: 'formatted_balance',
className: 'balance',
width: 150,
textOverview: true,
align: 'right',
},
],
[],
);