Remove adjustments from totals calculations BOD-390.
This commit is contained in:
@@ -202,8 +202,6 @@ export function JobsTotalsTableComponent({ bodyshop, job }) {
|
||||
</td>
|
||||
<td>{`(${Dinero(
|
||||
job.job_totals.parts.parts.subtotal
|
||||
).toFormat()} ± ${Dinero(
|
||||
job.job_totals.parts.parts.adjustments
|
||||
).toFormat()})`}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -213,8 +211,6 @@ export function JobsTotalsTableComponent({ bodyshop, job }) {
|
||||
</td>
|
||||
<td>{`(${Dinero(
|
||||
job.job_totals.parts.sublets.subtotal
|
||||
).toFormat()} ± ${Dinero(
|
||||
job.job_totals.parts.sublets.adjustments
|
||||
).toFormat()})`}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -296,7 +292,10 @@ export function JobsTotalsTableComponent({ bodyshop, job }) {
|
||||
</div>
|
||||
<JobCalculateTotals job={job} />
|
||||
<Editor
|
||||
value={{ CIECA: job.cieca_ttl.data, ImEXCalc: job.job_totals }}
|
||||
value={{
|
||||
CIECA: job.cieca_ttl && job.cieca_ttl.data,
|
||||
ImEXCalc: job.job_totals,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
@@ -19,8 +19,6 @@ export default function JobsCloseTotals({ jobTotals }) {
|
||||
value={Dinero(jobTotals.parts.parts.total).toFormat()}
|
||||
suffix={`(${Dinero(
|
||||
jobTotals.parts.parts.subtotal
|
||||
).toFormat()} ± ${Dinero(
|
||||
jobTotals.parts.parts.adjustments
|
||||
).toFormat()})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
@@ -29,8 +27,6 @@ export default function JobsCloseTotals({ jobTotals }) {
|
||||
value={Dinero(jobTotals.parts.sublets.total).toFormat()}
|
||||
suffix={`(${Dinero(
|
||||
jobTotals.parts.sublets.subtotal
|
||||
).toFormat()} ± ${Dinero(
|
||||
jobTotals.parts.sublets.adjustments
|
||||
).toFormat()})`}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Form, Select } from "antd";
|
||||
import { Form, InputNumber, Select } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||
@@ -119,6 +119,24 @@ export default function JobsDetailRates({ job, form }) {
|
||||
<Form.Item label={t("jobs.fields.rate_matd")} name="rate_matd">
|
||||
<CurrencyInput />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.federal_tax_rate")}
|
||||
name="federal_tax_rate"
|
||||
>
|
||||
<InputNumber min={0} max={1} precision={2} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.state_tax_rate")}
|
||||
name="state_tax_rate"
|
||||
>
|
||||
<InputNumber min={0} max={1} precision={2} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.local_tax_rate")}
|
||||
name="local_tax_rate"
|
||||
>
|
||||
<InputNumber min={0} max={1} precision={2} />
|
||||
</Form.Item>
|
||||
</FormRow>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -437,6 +437,9 @@ export const GET_JOB_BY_PK = gql`
|
||||
rate_mash
|
||||
rate_matd
|
||||
actual_in
|
||||
federal_tax_rate
|
||||
local_tax_rate
|
||||
state_tax_rate
|
||||
scheduled_completion
|
||||
scheduled_in
|
||||
actual_completion
|
||||
|
||||
@@ -62,7 +62,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
||||
const statePartsTax = job.joblines
|
||||
.filter((jl) => !jl.removed)
|
||||
.reduce((acc, val) => {
|
||||
if (!!!val.tax_part) return acc;
|
||||
if (!!!val.tax_part || !!!val.part_type) return acc;
|
||||
// if (!!job.parts_tax_rates[val.part_type]) {
|
||||
// console.log("val.line_desc", val.line_desc);
|
||||
|
||||
@@ -259,7 +259,6 @@ function CalculatePartsTotals(jobLines) {
|
||||
subtotal: acc.sublets.subtotal.add(
|
||||
Dinero({ amount: Math.round(value.act_price * 100) })
|
||||
),
|
||||
//TODO Add Adjustments in
|
||||
},
|
||||
};
|
||||
|
||||
@@ -292,7 +291,6 @@ function CalculatePartsTotals(jobLines) {
|
||||
amount: Math.round(value.act_price * 100),
|
||||
}).multiply(value.part_qty)
|
||||
),
|
||||
//TODO Add Adjustments in
|
||||
},
|
||||
};
|
||||
// default:
|
||||
@@ -303,12 +301,10 @@ function CalculatePartsTotals(jobLines) {
|
||||
parts: {
|
||||
list: {},
|
||||
subtotal: Dinero({ amount: 0 }),
|
||||
adjustments: Dinero({ amount: 0 }),
|
||||
total: Dinero({ amount: 0 }),
|
||||
},
|
||||
sublets: {
|
||||
subtotal: Dinero({ amount: 0 }),
|
||||
adjustments: Dinero({ amount: 0 }),
|
||||
total: Dinero({ amount: 0 }),
|
||||
},
|
||||
}
|
||||
@@ -317,11 +313,11 @@ function CalculatePartsTotals(jobLines) {
|
||||
return {
|
||||
parts: {
|
||||
...ret.parts,
|
||||
total: ret.parts.subtotal, //+ ret.parts.adjustments
|
||||
total: ret.parts.subtotal,
|
||||
},
|
||||
sublets: {
|
||||
...ret.sublets,
|
||||
total: ret.sublets.subtotal, // + ret.sublets.adjustments,
|
||||
total: ret.sublets.subtotal,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user