Further updates to job totals table.

This commit is contained in:
Patrick Fic
2020-12-07 09:45:08 -08:00
parent 65a22922eb
commit 4e9dea31fd
5 changed files with 140 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
import { Col, Result, Row, Statistic, Typography } from "antd";
import { Col, Result, Row, Typography } from "antd";
import Dinero from "dinero.js";
import { JsonEditor as Editor } from "jsoneditor-react";
import "jsoneditor-react/es/editor.min.css";
@@ -238,6 +238,14 @@ export function JobsTotalsTableComponent({ bodyshop, jobRO, job }) {
</strong>
</td>
</tr>
</tbody>
</table>
<Typography.Title level={4}>
{t("jobs.labels.othertotal")}
</Typography.Title>
<table>
<tbody>
<tr>
<td>{t("jobs.labels.subletstotal")}</td>
<td className="currency">
@@ -253,99 +261,89 @@ export function JobsTotalsTableComponent({ bodyshop, jobRO, job }) {
</tr>
</tbody>
</table>
<div
className="job-totals-stats"
onClick={(e) => {
if (e.detail === 3) {
try {
console.log("Job", job);
} catch {
console.log("Unable to show job.");
}
}
}}
>
<Statistic
title={t("jobs.labels.federal_tax_amt")}
value={Dinero(job.job_totals.totals.federal_tax).toFormat()}
/>
<Statistic
title={t("jobs.labels.state_tax_amt")}
value={Dinero(job.job_totals.totals.state_tax).toFormat()}
/>
<Statistic
title={t("jobs.labels.local_tax_amt")}
value={Dinero(job.job_totals.totals.local_tax).toFormat()}
/>
</div>
<div
className="job-totals-stats"
onClick={(e) => {
if (e.detail === 3) {
try {
console.log("Job", job);
} catch {
console.log("Unable to show job.");
}
}
}}
>
<Statistic
title={t("jobs.fields.ded_amt")}
value={Dinero(
job.job_totals.totals.custPayable.deductible
).toFormat()}
/>
<Statistic
title={t("jobs.fields.federal_tax_payable")}
value={Dinero(
job.job_totals.totals.custPayable.federal_tax
).toFormat()}
/>
<Statistic
title={t("jobs.fields.other_amount_payable")}
value={Dinero(
job.job_totals.totals.custPayable.other_customer_amount
).toFormat()}
/>
<Statistic
title={t("jobs.fields.depreciation_taxes")}
value={Dinero(
job.job_totals.totals.custPayable.dep_taxes
).toFormat()}
/>
<Statistic
title={t("jobs.labels.total_cust_payable")}
value={Dinero(
job.job_totals.totals.custPayable.total
).toFormat()}
/>
</div>
<div
className="job-totals-stats"
onClick={(e) => {
if (e.detail === 3) {
try {
console.log("Job", job);
} catch {
console.log("Unable to show job.");
}
}
}}
>
<Statistic
title={t("jobs.labels.subtotal")}
value={Dinero(job.job_totals.totals.subtotal).toFormat()}
/>
<Statistic
title={t("jobs.labels.total_repairs")}
value={Dinero(job.job_totals.totals.total_repairs).toFormat()}
/>
<Statistic
title={t("jobs.labels.net_repairs")}
value={Dinero(job.job_totals.totals.net_repairs).toFormat()}
/>
</div>
<Typography.Title level={4}>
{t("jobs.labels.jobtotals")}
</Typography.Title>
<table>
<tbody>
<tr>
<td>{t("jobs.labels.local_tax_amt")}</td>
<td className="currency">
{Dinero(job.job_totals.totals.local_tax).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.labels.state_tax_amt")}</td>
<td className="currency">
{Dinero(job.job_totals.totals.state_tax).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.labels.federal_tax_amt")}</td>
<td className="currency">
{Dinero(job.job_totals.totals.federal_tax).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.fields.ded_amt")}</td>
<td className="currency">
{Dinero(
job.job_totals.totals.custPayable.deductible
).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.fields.federal_tax_payable")}</td>
<td className="currency">
{Dinero(
job.job_totals.totals.custPayable.federal_tax
).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.fields.other_amount_payable")}</td>
<td className="currency">
{Dinero(
job.job_totals.totals.custPayable.other_customer_amount
).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.fields.depreciation_taxes")}</td>
<td className="currency">
{Dinero(
job.job_totals.totals.custPayable.dep_taxes
).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.labels.total_cust_payable")}</td>
<td className="currency">
{Dinero(job.job_totals.totals.custPayable.total).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.labels.subtotal")}</td>
<td className="currency">
{Dinero(job.job_totals.totals.subtotal).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.labels.total_repairs")}</td>
<td className="currency">
{Dinero(job.job_totals.totals.total_repairs).toFormat()}
</td>
</tr>
<tr>
<td>{t("jobs.labels.net_repairs")}</td>
<td className="currency">
{Dinero(job.job_totals.totals.net_repairs).toFormat()}
</td>
</tr>
</tbody>
</table>
<JobCalculateTotals job={job} disabled={jobRO} />
<Editor
value={{