BOD-74 Added basic display for job totals.
This commit is contained in:
@@ -1,53 +1,236 @@
|
||||
import { Col, List, Row } from "antd";
|
||||
import { Col, Descriptions, Row, Statistic } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobsTotalsTableComponent({ totals }) {
|
||||
//const { t } = useTranslation();
|
||||
const { t } = useTranslation();
|
||||
if (!!!totals) return null;
|
||||
|
||||
return (
|
||||
<Row>
|
||||
<Col span={8}>
|
||||
<strong>Rates</strong>
|
||||
<List size='small'>
|
||||
<List.Item>{`rate_laa - ${totals.rates.rate_laa.total} (${totals.rates.rate_laa.hours} @ ${totals.rates.rate_laa.rate})`}</List.Item>
|
||||
<List.Item>{`LAB - ${totals.rates.rate_lab.total} (${totals.rates.rate_lab.hours} @ ${totals.rates.rate_lab.rate})`}</List.Item>
|
||||
<List.Item>{`rate_lad - ${totals.rates.rate_lad.total} (${totals.rates.rate_lad.hours} @ ${totals.rates.rate_lad.rate})`}</List.Item>
|
||||
<List.Item>{`rate_lae - ${totals.rates.rate_lae.total} (${totals.rates.rate_lae.hours} @ ${totals.rates.rate_lae.rate})`}</List.Item>
|
||||
<List.Item>{`rate_laf - ${totals.rates.rate_laf.total} (${totals.rates.rate_laf.hours} @ ${totals.rates.rate_laf.rate})`}</List.Item>
|
||||
<List.Item>{`rate_lag - ${totals.rates.rate_lag.total} (${totals.rates.rate_lag.hours} @ ${totals.rates.rate_lag.rate})`}</List.Item>
|
||||
<List.Item>{`rate_lam - ${totals.rates.rate_lam.total} (${totals.rates.rate_lam.hours} @ ${totals.rates.rate_lam.rate})`}</List.Item>
|
||||
<List.Item>{`rate_lar - ${totals.rates.rate_lar.total} (${totals.rates.rate_lar.hours} @ ${totals.rates.rate_lar.rate})`}</List.Item>
|
||||
<List.Item>{`rate_las - ${totals.rates.rate_las.total} (${totals.rates.rate_las.hours} @ ${totals.rates.rate_las.rate})`}</List.Item>
|
||||
<List.Item>{`rate_lau - ${totals.rates.rate_lau.total} (${totals.rates.rate_lau.hours} @ ${totals.rates.rate_lau.rate})`}</List.Item>
|
||||
<List.Item>{`LA1 - ${totals.rates.rate_la1.total} (${totals.rates.rate_la1.hours} @ ${totals.rates.rate_la1.rate})`}</List.Item>
|
||||
<List.Item>{`LA2 - ${totals.rates.rate_la2.total} (${totals.rates.rate_la2.hours} @ ${totals.rates.rate_la2.rate})`}</List.Item>
|
||||
<List.Item>{`LA3 - ${totals.rates.rate_la3.total} (${totals.rates.rate_la3.hours} @ ${totals.rates.rate_la3.rate})`}</List.Item>
|
||||
<List.Item>{`rate_la4 - ${totals.rates.rate_la4.total} (${totals.rates.rate_la4.hours} @ ${totals.rates.rate_la4.rate})`}</List.Item>
|
||||
<List.Item>{`paint_mat - ${totals.rates.paint_mat.total} (${totals.rates.paint_mat.hours} @ ${totals.rates.paint_mat.rate})`}</List.Item>
|
||||
<List.Item>{`shop_mat - ${totals.rates.shop_mat.total} (${totals.rates.shop_mat.hours} @ ${totals.rates.shop_mat.rate})`}</List.Item>
|
||||
<List.Item>{`rate_atp - ${totals.rates.rate_atp.total} (${totals.rates.rate_atp.hours} @ ${totals.rates.rate_atp.rate})`}</List.Item>
|
||||
</List>
|
||||
{`Subtotal: ${totals.rates.subtotal}`}
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<strong>Parts & Sublet</strong>
|
||||
<List size='small'>
|
||||
<List.Item>{`Parts - ${totals.parts.parts.total} (${totals.parts.parts.subtotal} +- ${totals.parts.parts.adjustments})`}</List.Item>
|
||||
<List.Item>{`Sublet - ${totals.parts.sublets.total} (${totals.parts.sublets.subtotal} +- ${totals.parts.sublets.adjustments})`}</List.Item>
|
||||
</List>
|
||||
</Col>
|
||||
<div>
|
||||
<Row>
|
||||
<Descriptions
|
||||
bordered
|
||||
size='small'
|
||||
column={3}
|
||||
title={t("jobs.labels.rates")}>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_laa")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_laa.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_laa.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_laa.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_lab")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_lab.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_lab.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_lab.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_lad")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_lad.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_lad.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_lad.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_lae")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_lae.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_lae.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_lae.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_laf")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_laf.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_laf.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_laf.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_lag")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_lag.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_lag.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_lag.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_lam")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_lam.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_lam.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_lam.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_lar")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_lar.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_lar.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_lar.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_las")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_las.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_las.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_las.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_lau")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_lau.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_lau.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_lau.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_la1")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_la1.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_la1.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_la1.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_la2")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_la2.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_la2.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_la2.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_la3")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_la3.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_la3.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_la3.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_la4")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_la4.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_la4.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_la4.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.rate_atp")}>
|
||||
<Statistic
|
||||
value={totals.rates.rate_atp.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.rate_atp.hours.toFixed(2)} @ ${
|
||||
totals.rates.rate_atp.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.paint_mat")}>
|
||||
<Statistic
|
||||
value={totals.rates.paint_mat.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.paint_mat.hours.toFixed(2)} @ ${
|
||||
totals.rates.paint_mat.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.shop_mat")}>
|
||||
<Statistic
|
||||
value={totals.rates.shop_mat.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.rates.shop_mat.hours.toFixed(2)} @ ${
|
||||
totals.rates.shop_mat.rate
|
||||
})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
style={{ color: "red" }}
|
||||
label={t("jobs.labels.rates_subtotal")}>
|
||||
<Statistic value={totals.rates.subtotal} precision={2} />
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={8}>
|
||||
<Descriptions
|
||||
bordered
|
||||
size='small'
|
||||
column={1}
|
||||
title={t("jobs.labels.partssubletstotal")}>
|
||||
<Descriptions.Item label={t("jobs.labels.partstotal")}>
|
||||
<Statistic
|
||||
value={totals.parts.parts.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.parts.parts.subtotal} ± ${totals.parts.parts.adjustments})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.subletstotal")}>
|
||||
<Statistic
|
||||
value={totals.parts.sublets.total}
|
||||
precision={2}
|
||||
suffix={`(${totals.parts.sublets.subtotal} ± ${totals.parts.sublets.adjustments})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<strong>Totals</strong>
|
||||
<List size='small'>
|
||||
<List.Item>{`Subtotal - ${totals.totals.subtotal}`}</List.Item>
|
||||
<List.Item>{`GST - ${totals.totals.federal_tax}`}</List.Item>
|
||||
<List.Item>{`PST - ${totals.totals.state_tax}`}</List.Item>
|
||||
<List.Item>{`Local - ${totals.totals.local_tax}`}</List.Item>
|
||||
<List.Item>{`Total Payable - ${totals.totals.total_repairs}`}</List.Item>
|
||||
<List.Item>{`Net Repairs - ${totals.totals.net_repairs}`}</List.Item>
|
||||
</List>
|
||||
</Col>
|
||||
</Row>
|
||||
<Col span={8}>
|
||||
<Descriptions
|
||||
bordered
|
||||
size='small'
|
||||
column={1}
|
||||
title={t("jobs.labels.totals")}>
|
||||
<Descriptions.Item label={t("jobs.labels.subtotal")}>
|
||||
<Statistic value={totals.totals.subtotal} precision={2} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.federal_tax_amt")}>
|
||||
<Statistic value={totals.totals.federal_tax} precision={2} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.state_tax_amt")}>
|
||||
<Statistic value={totals.totals.state_tax} precision={2} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.labels.local_tax_amt")}>
|
||||
<Statistic value={totals.totals.local_tax_amt} precision={2} />
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Statistic
|
||||
title={t("jobs.labels.total_repairs")}
|
||||
value={totals.totals.total_repairs}
|
||||
precision={2}
|
||||
/>
|
||||
<Statistic
|
||||
title={t("jobs.labels.net_repairs")}
|
||||
value={totals.totals.net_repairs}
|
||||
precision={2}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function JobsDetailFinancials({ job }) {
|
||||
|
||||
return (
|
||||
<Row>
|
||||
<Col offset={1} span={10}>
|
||||
<Col offset={1} span={7}>
|
||||
<Form.Item label={t("jobs.fields.ded_amt")} name="ded_amt">
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
@@ -131,7 +131,7 @@ export default function JobsDetailFinancials({ job }) {
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col offset={1} span={12}>
|
||||
<Col offset={1} span={15}>
|
||||
<JobTotalsTable totals={job.job_totals} />
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
Reference in New Issue
Block a user