BOD-74 Added basic display for job totals.

This commit is contained in:
Patrick Fic
2020-04-27 16:23:19 -07:00
parent c3d618e239
commit 0e12ae35c9
6 changed files with 542 additions and 82 deletions

View File

@@ -8677,6 +8677,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>federal_tax_amt</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>
<name>hrs_claimed</name>
<definition_loaded>false</definition_loaded>
@@ -8803,6 +8824,48 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>local_tax_amt</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>
<name>net_repairs</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>
<name>notes</name>
<definition_loaded>false</definition_loaded>
@@ -8845,6 +8908,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>paint_mat</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>
<name>parts</name>
<definition_loaded>false</definition_loaded>
@@ -8866,6 +8950,48 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>partssubletstotal</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>
<name>partstotal</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>
<name>rates</name>
<definition_loaded>false</definition_loaded>
@@ -8887,32 +9013,153 @@
</translation>
</translations>
</concept_node>
<folder_node>
<name>ratetotals</name>
<children>
<concept_node>
<name>lab</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>
</children>
</folder_node>
<concept_node>
<name>rates_subtotal</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>
<name>shop_mat</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>
<name>state_tax_amt</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>
<name>subletstotal</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>
<name>subtotal</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>
<name>total_repairs</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>
<name>totals</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>
<name>vehicle_info</name>
<definition_loaded>false</definition_loaded>

View File

@@ -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>
);
}

View File

@@ -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>

View File

@@ -555,19 +555,29 @@
"documents": "Documents",
"duplicateconfirm": "Are you sure you want to duplicate this job? Some elements of this job will not be duplicated.",
"existing_jobs": "Existing Jobs",
"federal_tax_amt": "Federal Taxes",
"hrs_claimed": "Hours Claimed",
"hrs_total": "Hours Total",
"inproduction": "In Production",
"job": "Job Details",
"laborallocations": "Labor Allocations",
"lines": "Estimate Lines",
"local_tax_amt": "Local Taxes",
"net_repairs": "Net Repairs",
"notes": "Notes",
"override_header": "Override estimate header on import?",
"paint_mat": "Paint Materials",
"parts": "Parts",
"partssubletstotal": "Parts & Sublets Total",
"partstotal": "Parts Total",
"rates": "Rates",
"ratetotals": {
"lab": "Body Total"
},
"rates_subtotal": "Rates Subtotal",
"shop_mat": "Shop Materials",
"state_tax_amt": "State/Provincial Taxes",
"subletstotal": "Sublets Total",
"subtotal": "Subtotal",
"total_repairs": "Total Repairs",
"totals": "Totals",
"vehicle_info": "Vehicle"
},
"successes": {

View File

@@ -555,19 +555,29 @@
"documents": "documentos",
"duplicateconfirm": "",
"existing_jobs": "Empleos existentes",
"federal_tax_amt": "",
"hrs_claimed": "",
"hrs_total": "",
"inproduction": "",
"job": "",
"laborallocations": "",
"lines": "Líneas estimadas",
"local_tax_amt": "",
"net_repairs": "",
"notes": "Notas",
"override_header": "¿Anular encabezado estimado al importar?",
"paint_mat": "",
"parts": "Partes",
"partssubletstotal": "",
"partstotal": "",
"rates": "Tarifas",
"ratetotals": {
"lab": ""
},
"rates_subtotal": "",
"shop_mat": "",
"state_tax_amt": "",
"subletstotal": "",
"subtotal": "",
"total_repairs": "",
"totals": "",
"vehicle_info": "Vehículo"
},
"successes": {

View File

@@ -555,19 +555,29 @@
"documents": "Les documents",
"duplicateconfirm": "",
"existing_jobs": "Emplois existants",
"federal_tax_amt": "",
"hrs_claimed": "",
"hrs_total": "",
"inproduction": "",
"job": "",
"laborallocations": "",
"lines": "Estimer les lignes",
"local_tax_amt": "",
"net_repairs": "",
"notes": "Remarques",
"override_header": "Remplacer l'en-tête d'estimation à l'importation?",
"paint_mat": "",
"parts": "les pièces",
"partssubletstotal": "",
"partstotal": "",
"rates": "Les taux",
"ratetotals": {
"lab": ""
},
"rates_subtotal": "",
"shop_mat": "",
"state_tax_amt": "",
"subletstotal": "",
"subtotal": "",
"total_repairs": "",
"totals": "",
"vehicle_info": "Véhicule"
},
"successes": {