Refactored some Job Calculation Logic. IO-439
This commit is contained in:
@@ -170,55 +170,12 @@ export function JobsTotalsTableComponent({ bodyshop, jobRO, job }) {
|
||||
job.job_totals.rates.la4.rate
|
||||
})`}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{t("jobs.labels.rates_subtotal")}</td>
|
||||
<td>{Dinero(job.job_totals.rates.subtotal).toFormat()}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</Col>
|
||||
<Col {...colSpan}>
|
||||
<div className="job-totals-half">
|
||||
<table>
|
||||
<tbody>
|
||||
{Object.keys(job.job_totals.parts.parts.list).map(
|
||||
(key, idx) => (
|
||||
<tr key={idx}>
|
||||
<td>{t(`jobs.fields.${key.toLowerCase()}`)}</td>
|
||||
<td className="currency">
|
||||
{Dinero(
|
||||
job.job_totals.parts.parts.list[key].total
|
||||
).toFormat()}
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
<tr>
|
||||
<td>{t("jobs.labels.partstotal")}</td>
|
||||
<td>{t("jobs.labels.labor_rates_subtotal")}</td>
|
||||
<td className="currency">
|
||||
{Dinero(job.job_totals.parts.parts.total).toFormat()}
|
||||
</td>
|
||||
<td>{`(${Dinero(
|
||||
job.job_totals.parts.parts.subtotal
|
||||
).toFormat()})`}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t("jobs.labels.subletstotal")}</td>
|
||||
<td className="currency">
|
||||
{Dinero(job.job_totals.parts.sublets.total).toFormat()}
|
||||
</td>
|
||||
<td>{`(${Dinero(
|
||||
job.job_totals.parts.sublets.subtotal
|
||||
).toFormat()})`}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t("jobs.labels.additionaltotal")}</td>
|
||||
<td className="currency">
|
||||
{Dinero(job.job_totals.additional).toFormat()}
|
||||
<strong>
|
||||
{Dinero(job.job_totals.rates.rates_subtotal).toFormat()}
|
||||
</strong>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@@ -240,6 +197,60 @@ export function JobsTotalsTableComponent({ bodyshop, jobRO, job }) {
|
||||
job.job_totals.rates.mash.rate
|
||||
})`}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t("jobs.labels.rates_subtotal")}</td>
|
||||
|
||||
<td className="currency">
|
||||
<strong>
|
||||
{Dinero(job.job_totals.rates.subtotal).toFormat()}
|
||||
</strong>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</Col>
|
||||
<Col {...colSpan}>
|
||||
<div className="job-totals-half">
|
||||
<Typography.Title level={4}>
|
||||
{t("jobs.labels.partstotal")}
|
||||
</Typography.Title>
|
||||
<table>
|
||||
<tbody>
|
||||
{Object.keys(job.job_totals.parts.parts.list).map(
|
||||
(key, idx) => (
|
||||
<tr key={idx}>
|
||||
<td>{t(`jobs.fields.${key.toLowerCase()}`)}</td>
|
||||
<td className="currency">
|
||||
{Dinero(
|
||||
job.job_totals.parts.parts.list[key].total
|
||||
).toFormat()}
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
<tr>
|
||||
<td>{t("jobs.labels.partstotal")}</td>
|
||||
<td className="currency">
|
||||
<strong>
|
||||
{Dinero(job.job_totals.parts.parts.total).toFormat()}
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{t("jobs.labels.subletstotal")}</td>
|
||||
<td className="currency">
|
||||
{Dinero(job.job_totals.parts.sublets.total).toFormat()}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{t("jobs.labels.additionaltotal")}</td>
|
||||
<td className="currency">
|
||||
{Dinero(job.job_totals.additional).toFormat()}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div
|
||||
@@ -254,6 +265,10 @@ export function JobsTotalsTableComponent({ bodyshop, jobRO, 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()}
|
||||
@@ -262,10 +277,6 @@ export function JobsTotalsTableComponent({ bodyshop, jobRO, job }) {
|
||||
title={t("jobs.labels.local_tax_amt")}
|
||||
value={Dinero(job.job_totals.totals.local_tax).toFormat()}
|
||||
/>
|
||||
<Statistic
|
||||
title={t("jobs.labels.federal_tax_amt")}
|
||||
value={Dinero(job.job_totals.totals.federal_tax).toFormat()}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="job-totals-stats"
|
||||
|
||||
@@ -491,6 +491,7 @@ export const GET_JOB_BY_PK = gql`
|
||||
notes
|
||||
location
|
||||
tax_part
|
||||
db_ref
|
||||
parts_order_lines {
|
||||
id
|
||||
parts_order {
|
||||
|
||||
@@ -752,6 +752,7 @@
|
||||
"PAL": "LKQ",
|
||||
"PAM": "Remanufactured",
|
||||
"PAN": "New/OEM",
|
||||
"PAO": "Other",
|
||||
"PAR": "Recored",
|
||||
"PAS": "Sublet",
|
||||
"PASL": "Sublet"
|
||||
@@ -1035,6 +1036,7 @@
|
||||
"inproduction": "In Production",
|
||||
"job": "Job Details",
|
||||
"jobcosting": "Job Costing",
|
||||
"labor_rates_subtotal": "Labor Rates Subtotal",
|
||||
"laborallocations": "Labor Allocations",
|
||||
"labortotals": "Labor Totals",
|
||||
"lines": "Estimate Lines",
|
||||
@@ -1049,7 +1051,7 @@
|
||||
"partssubletstotal": "Parts & Sublets Total",
|
||||
"partstotal": "Parts Total",
|
||||
"rates": "Rates",
|
||||
"rates_subtotal": "Rates Subtotal",
|
||||
"rates_subtotal": "All Rates Subtotal",
|
||||
"reconciliation": {
|
||||
"billlinestotal": "Bill Lines Total",
|
||||
"byassoc": "By Line Association",
|
||||
|
||||
@@ -752,6 +752,7 @@
|
||||
"PAL": "",
|
||||
"PAM": "",
|
||||
"PAN": "",
|
||||
"PAO": "",
|
||||
"PAR": "",
|
||||
"PAS": "",
|
||||
"PASL": ""
|
||||
@@ -1035,6 +1036,7 @@
|
||||
"inproduction": "",
|
||||
"job": "",
|
||||
"jobcosting": "",
|
||||
"labor_rates_subtotal": "",
|
||||
"laborallocations": "",
|
||||
"labortotals": "",
|
||||
"lines": "Líneas estimadas",
|
||||
|
||||
@@ -752,6 +752,7 @@
|
||||
"PAL": "",
|
||||
"PAM": "",
|
||||
"PAN": "",
|
||||
"PAO": "",
|
||||
"PAR": "",
|
||||
"PAS": "",
|
||||
"PASL": ""
|
||||
@@ -1035,6 +1036,7 @@
|
||||
"inproduction": "",
|
||||
"job": "",
|
||||
"jobcosting": "",
|
||||
"labor_rates_subtotal": "",
|
||||
"laborallocations": "",
|
||||
"labortotals": "",
|
||||
"lines": "Estimer les lignes",
|
||||
|
||||
Reference in New Issue
Block a user