IO-813 Calculation updates to include adjustments

This commit is contained in:
Patrick Fic
2021-03-31 11:02:11 -07:00
parent 3c1ecd9638
commit e85be1c173
4 changed files with 67 additions and 36 deletions

View File

@@ -46,13 +46,13 @@ export function JobsTotalsTableComponent({ jobRO, job }) {
</Card>
</Col>
<Col {...colSpan}>
<Row gutter={[0, 32]}>
<Col span={24}>
<Row gutter={[16, 16]}>
<Col sm={24} md={12}>
<Card title={t("jobs.labels.partstotal")}>
<JobTotalsTableParts job={job} />
</Card>
</Col>
<Col span={24}>
<Col sm={24} md={12}>
<Card title={t("jobs.labels.othertotal")}>
<JobTotalsTableOther job={job} />
</Card>

View File

@@ -17,9 +17,29 @@ export default function JobTotalsTableOther({ job }) {
key: t("jobs.labels.subletstotal"),
total: job.job_totals.parts.sublets.total,
},
...((job.job_totals.additional.additionalCostItems &&
job.job_totals.additional.additionalCostItems.map((i) => {
return {
key: i.key,
total: i.total,
};
})) ||
[]),
{
key: t("jobs.labels.additionaltotal"),
total: job.job_totals.additional,
key: t("jobs.fields.adjustment_bottom_line"),
total: job.job_totals.additional.adjustments,
},
{
key: t("jobs.fields.towing"),
total: job.job_totals.additional.towing,
},
{
key: t("jobs.fields.storage"),
total: job.job_totals.additional.storage,
},
{
key: t("jobs.fields.pvrt"),
total: job.job_totals.additional.pvrt,
},
];
}, [job.job_totals, t]);
@@ -67,7 +87,7 @@ export default function JobTotalsTableOther({ job }) {
<Table.Summary.Cell>
<strong>
{Dinero(job.job_totals.parts.parts.total).toFormat()}
{Dinero(job.job_totals.additional.total).toFormat()}
</strong>
</Table.Summary.Cell>
</Table.Summary.Row>