mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
Merge pull request #612 from Champetaman/fix-manual-journal-date-expense-drawer
Fix: Correctly display Date, Published At, and Created At in ExpenseDrawerHeader
This commit is contained in:
@@ -16,6 +16,7 @@ export class ExpenseTransfromer extends Transformer {
|
||||
'formattedAllocatedCostAmount',
|
||||
'formattedDate',
|
||||
'formattedCreatedAt',
|
||||
'formattedPublishedAt',
|
||||
'categories',
|
||||
'attachments',
|
||||
];
|
||||
@@ -91,4 +92,13 @@ export class ExpenseTransfromer extends Transformer {
|
||||
protected attachments = (expense: IExpense) => {
|
||||
return this.item(expense.attachments, new AttachmentTransformer());
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve formatted published at date.
|
||||
* @param {IExpense} expense
|
||||
* @returns {string}
|
||||
*/
|
||||
protected formattedPublishedAt = (expense: IExpense): string => {
|
||||
return this.formatDate(expense.publishedAt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
Col,
|
||||
DetailItem,
|
||||
DetailsMenu,
|
||||
FormatDate,
|
||||
ExchangeRateDetailItem,
|
||||
FormattedMessage as T,
|
||||
} from '@/components';
|
||||
@@ -41,7 +40,7 @@ export default function ExpenseDrawerHeader() {
|
||||
<Col xs={6}>
|
||||
<DetailsMenu direction={'horizantal'} minLabelSize={'180px'}>
|
||||
<DetailItem name={'date'} label={<T id={'date'} />}>
|
||||
{expense.formatted_payment_date}
|
||||
{expense.formatted_date}
|
||||
</DetailItem>
|
||||
|
||||
<DetailItem name={'reference'} label={<T id={'reference_no'} />}>
|
||||
@@ -65,11 +64,11 @@ export default function ExpenseDrawerHeader() {
|
||||
minLabelSize={'180px'}
|
||||
>
|
||||
<DetailItem label={<T id={'published_at'} />}>
|
||||
{expense.formatted_date}
|
||||
{expense.formatted_published_at || '—'}
|
||||
</DetailItem>
|
||||
|
||||
<DetailItem label={<T id={'created_at'} />}>
|
||||
{expense.formatted_created_at}
|
||||
{expense.formatted_created_at}
|
||||
</DetailItem>
|
||||
</DetailsMenu>
|
||||
</Col>
|
||||
|
||||
Reference in New Issue
Block a user