feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration / RRScratch2 / Polish
This commit is contained in:
@@ -24,10 +24,11 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsAllocationsSummar
|
||||
* @param bodyshop
|
||||
* @param jobId
|
||||
* @param title
|
||||
* @param minHeight
|
||||
* @returns {JSX.Element}
|
||||
* @constructor
|
||||
*/
|
||||
export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title }) {
|
||||
export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title, minHeight }) {
|
||||
const { t } = useTranslation();
|
||||
const [allocationsSummary, setAllocationsSummary] = useState([]);
|
||||
|
||||
@@ -97,6 +98,8 @@ export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title })
|
||||
|
||||
return (
|
||||
<Card
|
||||
style={minHeight ? { minHeight } : undefined}
|
||||
className="dms-summary-card"
|
||||
title={title}
|
||||
extra={
|
||||
<Button onClick={fetchAllocations} aria-label={t("general.actions.refresh")}>
|
||||
@@ -124,12 +127,14 @@ export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title })
|
||||
{ totalSale: Dinero(), totalCost: Dinero() }
|
||||
) || { totalSale: Dinero(), totalCost: Dinero() };
|
||||
|
||||
const hasNonZeroSaleTotal = totals.totalSale.getAmount() !== 0;
|
||||
|
||||
return (
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell>
|
||||
<Typography.Title level={4}>{t("general.labels.totals")}</Typography.Title>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell>{totals.totalSale.toFormat()}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell>{hasNonZeroSaleTotal ? totals.totalSale.toFormat() : null}</Table.Summary.Cell>
|
||||
<Table.Summary.Cell />
|
||||
<Table.Summary.Cell />
|
||||
<Table.Summary.Cell />
|
||||
|
||||
Reference in New Issue
Block a user