mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
feat: display expense formatted amount.
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
|||||||
NavbarDivider,
|
NavbarDivider,
|
||||||
Intent,
|
Intent,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
|
||||||
|
|
||||||
import { useBillDrawerContext } from './BillDrawerProvider';
|
import { useBillDrawerContext } from './BillDrawerProvider';
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,7 @@ export default function ExpenseDrawerHeader() {
|
|||||||
<CommercialDocTopHeader>
|
<CommercialDocTopHeader>
|
||||||
<DetailsMenu>
|
<DetailsMenu>
|
||||||
<DetailItem name={'amount'} label={<T id={'full_amount'} />}>
|
<DetailItem name={'amount'} label={<T id={'full_amount'} />}>
|
||||||
<h3 class="big-number">
|
<h3 class="big-number">{expense.formatted_amount}</h3>
|
||||||
<Money
|
|
||||||
amount={expense.total_amount}
|
|
||||||
currency={expense.currency_code}
|
|
||||||
/>
|
|
||||||
</h3>
|
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<StatusDetailItem>
|
<StatusDetailItem>
|
||||||
@@ -52,8 +47,8 @@ export default function ExpenseDrawerHeader() {
|
|||||||
{defaultTo(expense.reference_no, '-')}
|
{defaultTo(expense.reference_no, '-')}
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem label={<T id={'published_at'} />}>
|
<DetailItem label={<T id={'description'} />}>
|
||||||
{moment(expense.published_at).format('YYYY MMM DD')}
|
{defaultTo(expense.description, '—')}
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
</DetailsMenu>
|
</DetailsMenu>
|
||||||
</Col>
|
</Col>
|
||||||
@@ -64,9 +59,10 @@ export default function ExpenseDrawerHeader() {
|
|||||||
direction={'horizantal'}
|
direction={'horizantal'}
|
||||||
minLabelSize={'180px'}
|
minLabelSize={'180px'}
|
||||||
>
|
>
|
||||||
<DetailItem label={<T id={'description'} />}>
|
<DetailItem label={<T id={'published_at'} />}>
|
||||||
{defaultTo(expense.description, '—')}
|
{moment(expense.published_at).format('YYYY MMM DD')}
|
||||||
</DetailItem>
|
</DetailItem>
|
||||||
|
|
||||||
<DetailItem label={<T id={'created_at'} />}>2021 Aug 24</DetailItem>
|
<DetailItem label={<T id={'created_at'} />}>2021 Aug 24</DetailItem>
|
||||||
</DetailsMenu>
|
</DetailsMenu>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ function VendorCreditDetailActionsBar({
|
|||||||
<If condition={!vendorCredit.is_closed && !vendorCredit.is_draft}>
|
<If condition={!vendorCredit.is_closed && !vendorCredit.is_draft}>
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
icon={<Icon icon="arrow-downward" iconSize={18} />}
|
||||||
text={<T id={'refund'} />}
|
text={<T id={'refund'} />}
|
||||||
onClick={handleRefundVendorCredit}
|
onClick={handleRefundVendorCredit}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -12,11 +12,13 @@ import {
|
|||||||
MenuDivider,
|
MenuDivider,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
|
import clsx from 'classnames';
|
||||||
|
|
||||||
|
import { CLASSES } from 'common/classes';
|
||||||
import { ExpenseAction, AbilitySubject } from '../../../common/abilityOption';
|
import { ExpenseAction, AbilitySubject } from '../../../common/abilityOption';
|
||||||
import {
|
import {
|
||||||
FormatDateCell,
|
FormatDateCell,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
Money,
|
|
||||||
Icon,
|
Icon,
|
||||||
If,
|
If,
|
||||||
Can,
|
Can,
|
||||||
@@ -98,13 +100,6 @@ export function ActionsCell(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Total amount accessor.
|
|
||||||
*/
|
|
||||||
export function TotalAmountAccessor(row) {
|
|
||||||
return <Money amount={row.total_amount} currency={row.currency_code} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publish accessor.
|
* Publish accessor.
|
||||||
*/
|
*/
|
||||||
@@ -149,11 +144,12 @@ export function useExpensesTableColumns() {
|
|||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
Header: intl.get('full_amount'),
|
Header: intl.get('full_amount'),
|
||||||
accessor: TotalAmountAccessor,
|
accessor: 'formatted_amount',
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
width: 150,
|
width: 150,
|
||||||
clickable: true,
|
clickable: true,
|
||||||
|
className: clsx(CLASSES.FONT_BOLD),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'payment_account',
|
id: 'payment_account',
|
||||||
|
|||||||
Reference in New Issue
Block a user