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

@@ -17002,6 +17002,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>jobtotals</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node> <concept_node>
<name>labor_rates_subtotal</name> <name>labor_rates_subtotal</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>
@@ -17191,6 +17212,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>othertotal</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node> <concept_node>
<name>override_header</name> <name>override_header</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>

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

View File

@@ -1036,6 +1036,7 @@
"inproduction": "In Production", "inproduction": "In Production",
"job": "Job Details", "job": "Job Details",
"jobcosting": "Job Costing", "jobcosting": "Job Costing",
"jobtotals": "Job Totals",
"labor_rates_subtotal": "Labor Rates Subtotal", "labor_rates_subtotal": "Labor Rates Subtotal",
"laborallocations": "Labor Allocations", "laborallocations": "Labor Allocations",
"labortotals": "Labor Totals", "labortotals": "Labor Totals",
@@ -1045,6 +1046,7 @@
"mash": "Shop Materials", "mash": "Shop Materials",
"net_repairs": "Net Repairs", "net_repairs": "Net Repairs",
"notes": "Notes", "notes": "Notes",
"othertotal": "Other Totals",
"override_header": "Override estimate header on import?", "override_header": "Override estimate header on import?",
"parts": "Parts", "parts": "Parts",
"partsfilter": "Parts Only", "partsfilter": "Parts Only",

View File

@@ -1036,6 +1036,7 @@
"inproduction": "", "inproduction": "",
"job": "", "job": "",
"jobcosting": "", "jobcosting": "",
"jobtotals": "",
"labor_rates_subtotal": "", "labor_rates_subtotal": "",
"laborallocations": "", "laborallocations": "",
"labortotals": "", "labortotals": "",
@@ -1045,6 +1046,7 @@
"mash": "", "mash": "",
"net_repairs": "", "net_repairs": "",
"notes": "Notas", "notes": "Notas",
"othertotal": "",
"override_header": "¿Anular encabezado estimado al importar?", "override_header": "¿Anular encabezado estimado al importar?",
"parts": "Partes", "parts": "Partes",
"partsfilter": "", "partsfilter": "",

View File

@@ -1036,6 +1036,7 @@
"inproduction": "", "inproduction": "",
"job": "", "job": "",
"jobcosting": "", "jobcosting": "",
"jobtotals": "",
"labor_rates_subtotal": "", "labor_rates_subtotal": "",
"laborallocations": "", "laborallocations": "",
"labortotals": "", "labortotals": "",
@@ -1045,6 +1046,7 @@
"mash": "", "mash": "",
"net_repairs": "", "net_repairs": "",
"notes": "Remarques", "notes": "Remarques",
"othertotal": "",
"override_header": "Remplacer l'en-tête d'estimation à l'importation?", "override_header": "Remplacer l'en-tête d'estimation à l'importation?",
"parts": "les pièces", "parts": "les pièces",
"partsfilter": "", "partsfilter": "",