From 0e12ae35c9e489cd268c04e9b25405f6d446fade Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Apr 2020 16:23:19 -0700 Subject: [PATCH] BOD-74 Added basic display for job totals. --- bodyshop_translations.babel | 299 ++++++++++++++++-- .../job-totals-table.component.jsx | 273 +++++++++++++--- .../jobs-detail-financial.component.jsx | 4 +- client/src/translations/en_us/common.json | 16 +- client/src/translations/es/common.json | 16 +- client/src/translations/fr/common.json | 16 +- 6 files changed, 542 insertions(+), 82 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 77be72128..8e8fc91e1 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -8677,6 +8677,27 @@ + + federal_tax_amt + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + hrs_claimed false @@ -8803,6 +8824,48 @@ + + local_tax_amt + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + net_repairs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + notes false @@ -8845,6 +8908,27 @@ + + paint_mat + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + parts false @@ -8866,6 +8950,48 @@ + + partssubletstotal + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + partstotal + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + rates false @@ -8887,32 +9013,153 @@ - - ratetotals - - - lab - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - - - + + rates_subtotal + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + shop_mat + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + state_tax_amt + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + subletstotal + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + subtotal + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + total_repairs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + totals + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + vehicle_info false diff --git a/client/src/components/job-totals-table/job-totals-table.component.jsx b/client/src/components/job-totals-table/job-totals-table.component.jsx index 17e189d6f..1c7177a3c 100644 --- a/client/src/components/job-totals-table/job-totals-table.component.jsx +++ b/client/src/components/job-totals-table/job-totals-table.component.jsx @@ -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 ( - - - Rates - - {`rate_laa - ${totals.rates.rate_laa.total} (${totals.rates.rate_laa.hours} @ ${totals.rates.rate_laa.rate})`} - {`LAB - ${totals.rates.rate_lab.total} (${totals.rates.rate_lab.hours} @ ${totals.rates.rate_lab.rate})`} - {`rate_lad - ${totals.rates.rate_lad.total} (${totals.rates.rate_lad.hours} @ ${totals.rates.rate_lad.rate})`} - {`rate_lae - ${totals.rates.rate_lae.total} (${totals.rates.rate_lae.hours} @ ${totals.rates.rate_lae.rate})`} - {`rate_laf - ${totals.rates.rate_laf.total} (${totals.rates.rate_laf.hours} @ ${totals.rates.rate_laf.rate})`} - {`rate_lag - ${totals.rates.rate_lag.total} (${totals.rates.rate_lag.hours} @ ${totals.rates.rate_lag.rate})`} - {`rate_lam - ${totals.rates.rate_lam.total} (${totals.rates.rate_lam.hours} @ ${totals.rates.rate_lam.rate})`} - {`rate_lar - ${totals.rates.rate_lar.total} (${totals.rates.rate_lar.hours} @ ${totals.rates.rate_lar.rate})`} - {`rate_las - ${totals.rates.rate_las.total} (${totals.rates.rate_las.hours} @ ${totals.rates.rate_las.rate})`} - {`rate_lau - ${totals.rates.rate_lau.total} (${totals.rates.rate_lau.hours} @ ${totals.rates.rate_lau.rate})`} - {`LA1 - ${totals.rates.rate_la1.total} (${totals.rates.rate_la1.hours} @ ${totals.rates.rate_la1.rate})`} - {`LA2 - ${totals.rates.rate_la2.total} (${totals.rates.rate_la2.hours} @ ${totals.rates.rate_la2.rate})`} - {`LA3 - ${totals.rates.rate_la3.total} (${totals.rates.rate_la3.hours} @ ${totals.rates.rate_la3.rate})`} - {`rate_la4 - ${totals.rates.rate_la4.total} (${totals.rates.rate_la4.hours} @ ${totals.rates.rate_la4.rate})`} - {`paint_mat - ${totals.rates.paint_mat.total} (${totals.rates.paint_mat.hours} @ ${totals.rates.paint_mat.rate})`} - {`shop_mat - ${totals.rates.shop_mat.total} (${totals.rates.shop_mat.hours} @ ${totals.rates.shop_mat.rate})`} - {`rate_atp - ${totals.rates.rate_atp.total} (${totals.rates.rate_atp.hours} @ ${totals.rates.rate_atp.rate})`} - - {`Subtotal: ${totals.rates.subtotal}`} - - - Parts & Sublet - - {`Parts - ${totals.parts.parts.total} (${totals.parts.parts.subtotal} +- ${totals.parts.parts.adjustments})`} - {`Sublet - ${totals.parts.sublets.total} (${totals.parts.sublets.subtotal} +- ${totals.parts.sublets.adjustments})`} - - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - Totals - - {`Subtotal - ${totals.totals.subtotal}`} - {`GST - ${totals.totals.federal_tax}`} - {`PST - ${totals.totals.state_tax}`} - {`Local - ${totals.totals.local_tax}`} - {`Total Payable - ${totals.totals.total_repairs}`} - {`Net Repairs - ${totals.totals.net_repairs}`} - - - + + + + + + + + + + + + + + + + + + + + + +
); } diff --git a/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx b/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx index 8b5a820cd..5534db165 100644 --- a/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx +++ b/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx @@ -8,7 +8,7 @@ export default function JobsDetailFinancials({ job }) { return ( - + @@ -131,7 +131,7 @@ export default function JobsDetailFinancials({ job }) { - + diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index b69542675..9a8bc618a 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -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": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 12a92e53e..233ceb192 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -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": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index da725daef..0fb48b177 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -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": {