mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-26 00:30:51 +00:00
Fix currency rendering in order tables (#7066)
* Add "currency" to CompanyBriefSerializer * Fix nav.js bug - potential illegal chars in panel name * Update CUI tables * Update PUI tables * Bump API version
This commit is contained in:
src
backend
InvenTree
InvenTree
company
templates
js
frontend
src
tables
@ -4,6 +4,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
||||
import { Thumbnail } from '../../components/images/Thumbnail';
|
||||
import { formatCurrency } from '../../defaults/formatters';
|
||||
import { ApiEndpoints } from '../../enums/ApiEndpoints';
|
||||
import { ModelType } from '../../enums/ModelType';
|
||||
import { UserRoles } from '../../enums/Roles';
|
||||
@ -21,8 +22,7 @@ import {
|
||||
ReferenceColumn,
|
||||
ResponsibleColumn,
|
||||
StatusColumn,
|
||||
TargetDateColumn,
|
||||
TotalPriceColumn
|
||||
TargetDateColumn
|
||||
} from '../ColumnRenderers';
|
||||
import {
|
||||
AssignedToMeFilter,
|
||||
@ -92,7 +92,16 @@ export function PurchaseOrderTable({
|
||||
ProjectCodeColumn(),
|
||||
CreationDateColumn(),
|
||||
TargetDateColumn(),
|
||||
TotalPriceColumn(),
|
||||
{
|
||||
accessor: 'total_price',
|
||||
title: t`Total Price`,
|
||||
sortable: true,
|
||||
render: (record: any) => {
|
||||
return formatCurrency(record.total_price, {
|
||||
currency: record.order_currency ?? record.supplier_detail?.currency
|
||||
});
|
||||
}
|
||||
},
|
||||
ResponsibleColumn()
|
||||
];
|
||||
}, []);
|
||||
|
@ -3,6 +3,7 @@ import { useCallback, useMemo } from 'react';
|
||||
|
||||
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
||||
import { Thumbnail } from '../../components/images/Thumbnail';
|
||||
import { formatCurrency } from '../../defaults/formatters';
|
||||
import { ApiEndpoints } from '../../enums/ApiEndpoints';
|
||||
import { ModelType } from '../../enums/ModelType';
|
||||
import { UserRoles } from '../../enums/Roles';
|
||||
@ -18,8 +19,7 @@ import {
|
||||
ReferenceColumn,
|
||||
ResponsibleColumn,
|
||||
StatusColumn,
|
||||
TargetDateColumn,
|
||||
TotalPriceColumn
|
||||
TargetDateColumn
|
||||
} from '../ColumnRenderers';
|
||||
import {
|
||||
AssignedToMeFilter,
|
||||
@ -81,7 +81,16 @@ export function ReturnOrderTable({ params }: { params?: any }) {
|
||||
CreationDateColumn(),
|
||||
TargetDateColumn(),
|
||||
ResponsibleColumn(),
|
||||
TotalPriceColumn()
|
||||
{
|
||||
accessor: 'total_price',
|
||||
title: t`Total Price`,
|
||||
sortable: true,
|
||||
render: (record: any) => {
|
||||
return formatCurrency(record.total_price, {
|
||||
currency: record.order_currency ?? record.customer_detail?.currency
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
|
@ -4,6 +4,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import { AddItemButton } from '../../components/buttons/AddItemButton';
|
||||
import { Thumbnail } from '../../components/images/Thumbnail';
|
||||
import { formatCurrency } from '../../defaults/formatters';
|
||||
import { ApiEndpoints } from '../../enums/ApiEndpoints';
|
||||
import { ModelType } from '../../enums/ModelType';
|
||||
import { UserRoles } from '../../enums/Roles';
|
||||
@ -21,8 +22,7 @@ import {
|
||||
ReferenceColumn,
|
||||
ShipmentDateColumn,
|
||||
StatusColumn,
|
||||
TargetDateColumn,
|
||||
TotalPriceColumn
|
||||
TargetDateColumn
|
||||
} from '../ColumnRenderers';
|
||||
import {
|
||||
AssignedToMeFilter,
|
||||
@ -117,7 +117,16 @@ export function SalesOrderTable({
|
||||
CreationDateColumn(),
|
||||
TargetDateColumn(),
|
||||
ShipmentDateColumn(),
|
||||
TotalPriceColumn()
|
||||
{
|
||||
accessor: 'total_price',
|
||||
title: t`Total Price`,
|
||||
sortable: true,
|
||||
render: (record: any) => {
|
||||
return formatCurrency(record.total_price, {
|
||||
currency: record.order_currency ?? record.customer_detail?.currency
|
||||
});
|
||||
}
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
|
Reference in New Issue
Block a user