mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
Merge pull request #618 from bigcapitalhq/display-details-bank-account
fix: Some bank account details hidden
This commit is contained in:
@@ -164,6 +164,10 @@ export class Transformer {
|
|||||||
return date ? moment(date).format(this.dateFormat) : '';
|
return date ? moment(date).format(this.dateFormat) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected formatDateFromNow(date){
|
||||||
|
return date ? moment(date).fromNow(true) : '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param number
|
* @param number
|
||||||
|
|||||||
@@ -8,7 +8,12 @@ export class CashflowAccountTransformer extends Transformer {
|
|||||||
* @returns {string[]}
|
* @returns {string[]}
|
||||||
*/
|
*/
|
||||||
public includeAttributes = (): string[] => {
|
public includeAttributes = (): string[] => {
|
||||||
return ['formattedAmount'];
|
return [
|
||||||
|
'formattedAmount',
|
||||||
|
'lastFeedsUpdatedAt',
|
||||||
|
'lastFeedsUpdatedAtFormatted',
|
||||||
|
'lastFeedsUpdatedFromNow',
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +34,7 @@ export class CashflowAccountTransformer extends Transformer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve formatted account amount.
|
* Retrieve formatted account amount.
|
||||||
* @param {IAccount} invoice
|
* @param {IAccount} invoice
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
protected formattedAmount = (account: IAccount): string => {
|
protected formattedAmount = (account: IAccount): string => {
|
||||||
@@ -37,4 +42,22 @@ export class CashflowAccountTransformer extends Transformer {
|
|||||||
currencyCode: account.currencyCode,
|
currencyCode: account.currencyCode,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the last feeds update at formatted date.
|
||||||
|
* @param {IAccount} account
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
protected lastFeedsUpdatedAtFormatted(account: IAccount): string {
|
||||||
|
return this.formatDate(account.lastFeedsUpdatedAt);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the last feeds updated from now.
|
||||||
|
* @param {IAccount} account
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
protected lastFeedsUpdatedFromNow(account: IAccount): string {
|
||||||
|
return this.formatDateFromNow(account.lastFeedsUpdatedAt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export function BankAccount({
|
|||||||
balance,
|
balance,
|
||||||
loading = false,
|
loading = false,
|
||||||
updatedBeforeText,
|
updatedBeforeText,
|
||||||
|
uncategorizedTransactionsCount,
|
||||||
...restProps
|
...restProps
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
@@ -77,17 +78,19 @@ export function BankAccount({
|
|||||||
</BankAccountHeader>
|
</BankAccountHeader>
|
||||||
|
|
||||||
<BankAccountMeta>
|
<BankAccountMeta>
|
||||||
{false && (
|
{uncategorizedTransactionsCount > 0 && (
|
||||||
<BankAccountMetaLine
|
<BankAccountMetaLine
|
||||||
title={intl.get('cash_flow.transactions_for_review')}
|
title={intl.get('cash_flow.transactions_for_review')}
|
||||||
value={'0'}
|
value={uncategorizedTransactionsCount}
|
||||||
|
className={clsx({ [Classes.SKELETON]: loading })}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{updatedBeforeText && (
|
||||||
|
<BankAccountMetaLine
|
||||||
|
title={updatedBeforeText}
|
||||||
className={clsx({ [Classes.SKELETON]: loading })}
|
className={clsx({ [Classes.SKELETON]: loading })}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<BankAccountMetaLine
|
|
||||||
title={updatedBeforeText}
|
|
||||||
className={clsx({ [Classes.SKELETON]: loading })}
|
|
||||||
/>
|
|
||||||
</BankAccountMeta>
|
</BankAccountMeta>
|
||||||
|
|
||||||
<BankAccountBalance amount={balance} loading={loading} />
|
<BankAccountBalance amount={balance} loading={loading} />
|
||||||
|
|||||||
@@ -37,12 +37,13 @@ export function useExcludedTransactionsColumns() {
|
|||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
Header: 'Date',
|
Header: 'Date',
|
||||||
accessor: 'formatted_date',
|
accessor: 'formatted_date',
|
||||||
width: 110,
|
width: 110,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Description',
|
Header: 'Description',
|
||||||
accessor: descriptionAccessor,
|
accessor: descriptionAccessor,
|
||||||
|
textOverview: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Payee',
|
Header: 'Payee',
|
||||||
|
|||||||
@@ -123,7 +123,12 @@ function CashflowBankAccount({
|
|||||||
code={account.code}
|
code={account.code}
|
||||||
balance={!isNull(account.amount) ? account.formatted_amount : '-'}
|
balance={!isNull(account.amount) ? account.formatted_amount : '-'}
|
||||||
type={account.account_type}
|
type={account.account_type}
|
||||||
updatedBeforeText={getUpdatedBeforeText(account.createdAt)}
|
updatedBeforeText={
|
||||||
|
account.last_feeds_updated_from_now
|
||||||
|
? `Updated ${account.last_feeds_updated_from_now} ago`
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
uncategorizedTransactionsCount={account.uncategorized_transactions}
|
||||||
/>
|
/>
|
||||||
</CashflowAccountAnchor>
|
</CashflowAccountAnchor>
|
||||||
</ContextMenu2>
|
</ContextMenu2>
|
||||||
|
|||||||
Reference in New Issue
Block a user