Fixed bugs on parts allocations + added totals BOD-131
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import { Descriptions, Statistic } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
export default function JobsCloseTotals({
|
||||
jobTotals,
|
||||
labMatTotal,
|
||||
partsTotal,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<Descriptions
|
||||
bordered
|
||||
size="small"
|
||||
//column={1}
|
||||
title={t("jobs.labels.totals")}
|
||||
>
|
||||
<Descriptions.Item label={t("jobs.labels.partstotal")}>
|
||||
<Statistic
|
||||
value={jobTotals.parts.parts.total.toFormat()}
|
||||
suffix={`(${jobTotals.parts.parts.subtotal.toFormat()} ± ${jobTotals.parts.parts.adjustments.toFormat()})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.subletstotal")}>
|
||||
<Statistic
|
||||
value={jobTotals.parts.sublets.total.toFormat()}
|
||||
suffix={`(${jobTotals.parts.sublets.subtotal.toFormat()} ± ${jobTotals.parts.sublets.adjustments.toFormat()})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.subtotal")}>
|
||||
<Statistic value={jobTotals.totals.subtotal.toFormat()} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.federal_tax_amt")}>
|
||||
<Statistic value={jobTotals.totals.federal_tax.toFormat()} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.state_tax_amt")}>
|
||||
<Statistic value={jobTotals.totals.state_tax.toFormat()} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.local_tax_amt")}>
|
||||
<Statistic value={jobTotals.totals.local_tax.toFormat()} />
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Statistic
|
||||
title={t("jobs.labels.total_repairs")}
|
||||
value={jobTotals.totals.total_repairs.toFormat()}
|
||||
/>
|
||||
<Statistic
|
||||
title={t("jobs.labels.net_repairs")}
|
||||
value={jobTotals.totals.net_repairs.toFormat()}
|
||||
/>
|
||||
<Statistic
|
||||
title={t("jobs.labels.suspense")}
|
||||
value={jobTotals.totals.subtotal
|
||||
.subtract(labMatTotal)
|
||||
.subtract(partsTotal)
|
||||
.toFormat()}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user