BOD-72 Refactored calculations to use Dinero library.
This commit is contained in:
@@ -1,12 +1,28 @@
|
|||||||
import { Col, Descriptions, Row, Statistic, Result } from "antd";
|
import { Col, Descriptions, Row, Statistic } from "antd";
|
||||||
import React from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
|
import { CalculateJob } from "./job-totals.utility";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
|
||||||
export default function JobsTotalsTableComponent({ totals }) {
|
export function JobsTotalsTableComponent({ bodyshop, job }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
if (!!!totals)
|
const [totals, setTotals] = useState(null);
|
||||||
return <Result status='warning' title={t("jobs.errors.nofinancial")} />;
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setTotals(CalculateJob(job, bodyshop.shoprates));
|
||||||
|
}, [bodyshop, job]);
|
||||||
|
|
||||||
|
if (!!!totals) {
|
||||||
|
console.log("Totals was falsey.");
|
||||||
|
return <LoadingSkeleton />;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Row>
|
<Row>
|
||||||
@@ -17,161 +33,161 @@ export default function JobsTotalsTableComponent({ totals }) {
|
|||||||
title={t("jobs.labels.rates")}>
|
title={t("jobs.labels.rates")}>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_laa")}>
|
<Descriptions.Item label={t("jobs.fields.rate_laa")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_laa.total}
|
value={totals.rates.rate_laa.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_laa.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_laa.hours.toFixed(
|
||||||
totals.rates.rate_laa.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_laa.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_lab")}>
|
<Descriptions.Item label={t("jobs.fields.rate_lab")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_lab.total}
|
value={totals.rates.rate_lab.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_lab.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_lab.hours.toFixed(
|
||||||
totals.rates.rate_lab.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_lab.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_lad")}>
|
<Descriptions.Item label={t("jobs.fields.rate_lad")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_lad.total}
|
value={totals.rates.rate_lad.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_lad.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_lad.hours.toFixed(
|
||||||
totals.rates.rate_lad.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_lad.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_lae")}>
|
<Descriptions.Item label={t("jobs.fields.rate_lae")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_lae.total}
|
value={totals.rates.rate_lae.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_lae.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_lae.hours.toFixed(
|
||||||
totals.rates.rate_lae.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_lae.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_laf")}>
|
<Descriptions.Item label={t("jobs.fields.rate_laf")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_laf.total}
|
value={totals.rates.rate_laf.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_laf.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_laf.hours.toFixed(
|
||||||
totals.rates.rate_laf.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_laf.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_lag")}>
|
<Descriptions.Item label={t("jobs.fields.rate_lag")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_lag.total}
|
value={totals.rates.rate_lag.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_lag.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_lag.hours.toFixed(
|
||||||
totals.rates.rate_lag.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_lag.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_lam")}>
|
<Descriptions.Item label={t("jobs.fields.rate_lam")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_lam.total}
|
value={totals.rates.rate_lam.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_lam.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_lam.hours.toFixed(
|
||||||
totals.rates.rate_lam.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_lam.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_lar")}>
|
<Descriptions.Item label={t("jobs.fields.rate_lar")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_lar.total}
|
value={totals.rates.rate_lar.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_lar.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_lar.hours.toFixed(
|
||||||
totals.rates.rate_lar.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_lar.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_las")}>
|
<Descriptions.Item label={t("jobs.fields.rate_las")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_las.total}
|
value={totals.rates.rate_las.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_las.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_las.hours.toFixed(
|
||||||
totals.rates.rate_las.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_las.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_lau")}>
|
<Descriptions.Item label={t("jobs.fields.rate_lau")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_lau.total}
|
value={totals.rates.rate_lau.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_lau.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_lau.hours.toFixed(
|
||||||
totals.rates.rate_lau.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_lau.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_la1")}>
|
<Descriptions.Item label={t("jobs.fields.rate_la1")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_la1.total}
|
value={totals.rates.rate_la1.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_la1.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_la1.hours.toFixed(
|
||||||
totals.rates.rate_la1.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_la1.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_la2")}>
|
<Descriptions.Item label={t("jobs.fields.rate_la2")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_la2.total}
|
value={totals.rates.rate_la2.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_la2.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_la2.hours.toFixed(
|
||||||
totals.rates.rate_la2.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_la2.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_la3")}>
|
<Descriptions.Item label={t("jobs.fields.rate_la3")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_la3.total}
|
value={totals.rates.rate_la3.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_la3.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_la3.hours.toFixed(
|
||||||
totals.rates.rate_la3.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_la3.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_la4")}>
|
<Descriptions.Item label={t("jobs.fields.rate_la4")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_la4.total}
|
value={totals.rates.rate_la4.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_la4.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_la4.hours.toFixed(
|
||||||
totals.rates.rate_la4.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_la4.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.fields.rate_atp")}>
|
<Descriptions.Item label={t("jobs.fields.rate_atp")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.rate_atp.total}
|
value={totals.rates.rate_atp.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.rate_atp.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.rate_atp.hours.toFixed(
|
||||||
totals.rates.rate_atp.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.rate_atp.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.labels.paint_mat")}>
|
<Descriptions.Item label={t("jobs.labels.paint_mat")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.paint_mat.total}
|
value={totals.rates.paint_mat.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.paint_mat.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.paint_mat.hours.toFixed(
|
||||||
totals.rates.paint_mat.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.paint_mat.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.labels.shop_mat")}>
|
<Descriptions.Item label={t("jobs.labels.shop_mat")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.rates.shop_mat.total}
|
value={totals.rates.shop_mat.total.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
suffix={`(${totals.rates.shop_mat.hours.toFixed(2)} @ ${
|
suffix={`(${totals.rates.shop_mat.hours.toFixed(
|
||||||
totals.rates.shop_mat.rate
|
2
|
||||||
})`}
|
)} @ ${totals.rates.shop_mat.rate})`}
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item
|
<Descriptions.Item
|
||||||
style={{ color: "red" }}
|
style={{ color: "red" }}
|
||||||
label={t("jobs.labels.rates_subtotal")}>
|
label={t("jobs.labels.rates_subtotal")}>
|
||||||
<Statistic value={totals.rates.subtotal} precision={2} />
|
<Statistic value={totals.rates.subtotal.toFormat()} />
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
</Row>
|
</Row>
|
||||||
@@ -184,16 +200,14 @@ export default function JobsTotalsTableComponent({ totals }) {
|
|||||||
title={t("jobs.labels.partssubletstotal")}>
|
title={t("jobs.labels.partssubletstotal")}>
|
||||||
<Descriptions.Item label={t("jobs.labels.partstotal")}>
|
<Descriptions.Item label={t("jobs.labels.partstotal")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.parts.parts.total}
|
value={totals.parts.parts.total.toFormat()}
|
||||||
precision={2}
|
suffix={`(${totals.parts.parts.subtotal.toFormat()} ± ${totals.parts.parts.adjustments.toFormat()})`}
|
||||||
suffix={`(${totals.parts.parts.subtotal} ± ${totals.parts.parts.adjustments})`}
|
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.labels.subletstotal")}>
|
<Descriptions.Item label={t("jobs.labels.subletstotal")}>
|
||||||
<Statistic
|
<Statistic
|
||||||
value={totals.parts.sublets.total}
|
value={totals.parts.sublets.total.toFormat()}
|
||||||
precision={2}
|
suffix={`(${totals.parts.sublets.subtotal.toFormat()} ± ${totals.parts.sublets.adjustments.toFormat()})`}
|
||||||
suffix={`(${totals.parts.sublets.subtotal} ± ${totals.parts.sublets.adjustments})`}
|
|
||||||
/>
|
/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
@@ -206,32 +220,31 @@ export default function JobsTotalsTableComponent({ totals }) {
|
|||||||
column={1}
|
column={1}
|
||||||
title={t("jobs.labels.totals")}>
|
title={t("jobs.labels.totals")}>
|
||||||
<Descriptions.Item label={t("jobs.labels.subtotal")}>
|
<Descriptions.Item label={t("jobs.labels.subtotal")}>
|
||||||
<Statistic value={totals.totals.subtotal} precision={2} />
|
<Statistic value={totals.totals.subtotal.toFormat()} />
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.labels.federal_tax_amt")}>
|
<Descriptions.Item label={t("jobs.labels.federal_tax_amt")}>
|
||||||
<Statistic value={totals.totals.federal_tax} precision={2} />
|
<Statistic value={totals.totals.federal_tax.toFormat()} />
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.labels.state_tax_amt")}>
|
<Descriptions.Item label={t("jobs.labels.state_tax_amt")}>
|
||||||
<Statistic value={totals.totals.state_tax} precision={2} />
|
<Statistic value={totals.totals.state_tax.toFormat()} />
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={t("jobs.labels.local_tax_amt")}>
|
<Descriptions.Item label={t("jobs.labels.local_tax_amt")}>
|
||||||
<Statistic value={totals.totals.local_tax_amt} precision={2} />
|
<Statistic value={totals.totals.local_tax.toFormat()} />
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("jobs.labels.total_repairs")}
|
title={t("jobs.labels.total_repairs")}
|
||||||
value={totals.totals.total_repairs}
|
value={totals.totals.total_repairs.toFormat()}
|
||||||
precision={2}
|
|
||||||
/>
|
/>
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("jobs.labels.net_repairs")}
|
title={t("jobs.labels.net_repairs")}
|
||||||
value={totals.totals.net_repairs}
|
value={totals.totals.net_repairs.toFormat()}
|
||||||
precision={2}
|
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
export default connect(mapStateToProps, null)(JobsTotalsTableComponent);
|
||||||
|
|||||||
@@ -6,68 +6,70 @@ export function CalculateJob(job, shoprates) {
|
|||||||
rates: CalculateRatesTotals(job, shoprates),
|
rates: CalculateRatesTotals(job, shoprates),
|
||||||
custPayable: CalculateCustPayable(job),
|
custPayable: CalculateCustPayable(job),
|
||||||
};
|
};
|
||||||
|
|
||||||
ret.totals = CalculateTaxesTotals(job, ret);
|
ret.totals = CalculateTaxesTotals(job, ret);
|
||||||
|
console.log("CalculateJob -> Final", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function CalculateTaxesTotals(job, otherTotals) {
|
function CalculateTaxesTotals(job, otherTotals) {
|
||||||
const subtotal =
|
const subtotal = otherTotals.parts.parts.subtotal
|
||||||
otherTotals.parts.parts.subtotal +
|
.add(otherTotals.parts.sublets.subtotal)
|
||||||
otherTotals.parts.sublets.subtotal +
|
.add(otherTotals.rates.subtotal)
|
||||||
otherTotals.rates.subtotal +
|
.add(Dinero({ amount: (job.towing_payable || 0) * 100 }))
|
||||||
(job.towing_payable || 0) +
|
.add(Dinero({ amount: (job.storage_payable || 0) * 100 }));
|
||||||
(job.storage_payable || 0); //Levies should be included??
|
//TODO Levies should be included??
|
||||||
|
|
||||||
const statePartsTax = job.joblines.reduce((acc, val) => {
|
const statePartsTax = job.joblines.reduce((acc, val) => {
|
||||||
if (!!!val.tax_part) return acc;
|
if (!!!val.tax_part) return acc;
|
||||||
if (!!job.parts_tax_rates[val.part_type]) {
|
if (!!job.parts_tax_rates[val.part_type]) {
|
||||||
return (
|
return acc.add(
|
||||||
acc +
|
Dinero({ amount: val.act_price * 100 })
|
||||||
val.act_price *
|
.multiply(val.part_qty)
|
||||||
val.part_qty *
|
.percentage(
|
||||||
(job.parts_tax_rates[val.part_type].prt_tax_rt || 0)
|
(job.parts_tax_rates[val.part_type].prt_tax_rt || 0) * 100
|
||||||
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
}, 0);
|
}, Dinero({ amount: 0 }));
|
||||||
|
|
||||||
// console.log("otherTotals", otherTotals);
|
|
||||||
// console.log("job", job);
|
|
||||||
// console.log("parts pst", statePartsTax);
|
|
||||||
// console.log(
|
|
||||||
// "pst on labor",
|
|
||||||
// otherTotals.rates.rates_subtotal * (job.tax_lbr_rt || 0)
|
|
||||||
// );
|
|
||||||
// console.log(
|
|
||||||
// "pst on mat",
|
|
||||||
// (otherTotals.rates.paint_mat.total + otherTotals.rates.shop_mat.total) *
|
|
||||||
// (job.tax_paint_mat_rt || 0)
|
|
||||||
// );
|
|
||||||
|
|
||||||
let ret = {
|
let ret = {
|
||||||
subtotal: subtotal,
|
subtotal: subtotal,
|
||||||
federal_tax: subtotal * (job.federal_tax_rate || 0),
|
federal_tax: subtotal.percentage((job.federal_tax_rate || 0) * 100),
|
||||||
statePartsTax,
|
statePartsTax,
|
||||||
state_tax:
|
state_tax: statePartsTax
|
||||||
statePartsTax +
|
.add(
|
||||||
otherTotals.rates.rates_subtotal * (job.tax_lbr_rt || 0) +
|
otherTotals.rates.rates_subtotal.percentage((job.tax_lbr_rt || 0) * 100)
|
||||||
((job.towing_payable || 0) * job.tax_tow_rt || 0) +
|
)
|
||||||
((job.storage_payable || 0) * job.tax_str_rt || 0) +
|
.add(
|
||||||
(otherTotals.rates.paint_mat.total + otherTotals.rates.shop_mat.total) *
|
Dinero({ amount: (job.towing_payable || 0) * 100 }).percentage(
|
||||||
(job.tax_paint_mat_rt || 0),
|
(job.tax_tow_rt || 0) * 100
|
||||||
local_tax: subtotal * (job.local_tax_rate || 0),
|
)
|
||||||
|
)
|
||||||
|
.add(
|
||||||
|
Dinero({ amount: (job.storage_payable || 0) * 100 }).percentage(
|
||||||
|
(job.tax_str_rt || 0) * 100
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.add(
|
||||||
|
otherTotals.rates.paint_mat.total
|
||||||
|
.add(otherTotals.rates.shop_mat.total)
|
||||||
|
.percentage((job.tax_paint_mat_rt || 0) * 100)
|
||||||
|
),
|
||||||
|
local_tax: subtotal.percentage((job.local_tax_rate || 0) * 100),
|
||||||
};
|
};
|
||||||
|
ret.total_repairs = ret.subtotal
|
||||||
ret.total_repairs =
|
.add(ret.federal_tax)
|
||||||
ret.subtotal + ret.federal_tax + ret.state_tax + ret.local_tax;
|
.add(ret.state_tax)
|
||||||
ret.net_repairs = ret.total_repairs - otherTotals.custPayable.total;
|
.add(ret.local_tax);
|
||||||
|
ret.net_repairs = ret.total_repairs.subtract(otherTotals.custPayable.total);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Rates are multipled by 10 to reduce the errors of rounding.
|
||||||
|
//Adjusted for when adding to total by dividing by 10.
|
||||||
function CalculateRatesTotals(ratesList, shoprates) {
|
function CalculateRatesTotals(ratesList, shoprates) {
|
||||||
const jobLines = ratesList.joblines;
|
const jobLines = ratesList.joblines;
|
||||||
|
|
||||||
@@ -75,86 +77,86 @@ function CalculateRatesTotals(ratesList, shoprates) {
|
|||||||
rate_la1: {
|
rate_la1: {
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LA1")
|
.filter((item) => item.mod_lbr_ty === "LA1")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
rate: ratesList.rate_la1 || 0,
|
rate: ratesList.rate_la1 || 0,
|
||||||
},
|
},
|
||||||
rate_la2: {
|
rate_la2: {
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LA2")
|
.filter((item) => item.mod_lbr_ty === "LA2")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
rate: ratesList.rate_la2 || 0,
|
rate: ratesList.rate_la2 || 0,
|
||||||
},
|
},
|
||||||
rate_la3: {
|
rate_la3: {
|
||||||
rate: ratesList.rate_la3 || 0,
|
rate: ratesList.rate_la3 || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LA3")
|
.filter((item) => item.mod_lbr_ty === "LA3")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_la4: {
|
rate_la4: {
|
||||||
rate: ratesList.rate_la4 || 0,
|
rate: ratesList.rate_la4 || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LA4")
|
.filter((item) => item.mod_lbr_ty === "LA4")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_laa: {
|
rate_laa: {
|
||||||
rate: ratesList.rate_laa || 0,
|
rate: ratesList.rate_laa || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAA")
|
.filter((item) => item.mod_lbr_ty === "LAA")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_lab: {
|
rate_lab: {
|
||||||
rate: ratesList.rate_lab || 0,
|
rate: ratesList.rate_lab || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAB")
|
.filter((item) => item.mod_lbr_ty === "LAB")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_lad: {
|
rate_lad: {
|
||||||
rate: ratesList.rate_lad || 0,
|
rate: ratesList.rate_lad || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAD")
|
.filter((item) => item.mod_lbr_ty === "LAD")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_lae: {
|
rate_lae: {
|
||||||
rate: ratesList.rate_lae || 0,
|
rate: ratesList.rate_lae || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAE")
|
.filter((item) => item.mod_lbr_ty === "LAE")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_laf: {
|
rate_laf: {
|
||||||
rate: ratesList.rate_laf || 0,
|
rate: ratesList.rate_laf || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAF")
|
.filter((item) => item.mod_lbr_ty === "LAF")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_lag: {
|
rate_lag: {
|
||||||
rate: ratesList.rate_lag || 0,
|
rate: ratesList.rate_lag || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAG")
|
.filter((item) => item.mod_lbr_ty === "LAG")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_lam: {
|
rate_lam: {
|
||||||
rate: ratesList.rate_lam || 0,
|
rate: ratesList.rate_lam || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAM")
|
.filter((item) => item.mod_lbr_ty === "LAM")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_lar: {
|
rate_lar: {
|
||||||
rate: ratesList.rate_lar || 0,
|
rate: ratesList.rate_lar || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAR")
|
.filter((item) => item.mod_lbr_ty === "LAR")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_las: {
|
rate_las: {
|
||||||
rate: ratesList.rate_las || 0,
|
rate: ratesList.rate_las || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAS")
|
.filter((item) => item.mod_lbr_ty === "LAS")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_lau: {
|
rate_lau: {
|
||||||
rate: ratesList.rate_lau || 0,
|
rate: ratesList.rate_lau || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAU")
|
.filter((item) => item.mod_lbr_ty === "LAU")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
rate_atp: {
|
rate_atp: {
|
||||||
rate: shoprates.rate_atp || 0,
|
rate: shoprates.rate_atp || 0,
|
||||||
@@ -173,38 +175,40 @@ function CalculateRatesTotals(ratesList, shoprates) {
|
|||||||
item.mod_lbr_ty !== "LAS" &&
|
item.mod_lbr_ty !== "LAS" &&
|
||||||
item.mod_lbr_ty !== "LAA"
|
item.mod_lbr_ty !== "LAA"
|
||||||
)
|
)
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0)
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0)
|
||||||
: 0,
|
: 0,
|
||||||
},
|
},
|
||||||
paint_mat: {
|
paint_mat: {
|
||||||
rate: ratesList.rate_mapa || 0,
|
rate: ratesList.rate_mapa || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty === "LAR")
|
.filter((item) => item.mod_lbr_ty === "LAR")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
shop_mat: {
|
shop_mat: {
|
||||||
rate: ratesList.rate_mash || 0,
|
rate: ratesList.rate_mash || 0,
|
||||||
hours: jobLines
|
hours: jobLines
|
||||||
.filter((item) => item.mod_lbr_ty !== "LAR")
|
.filter((item) => item.mod_lbr_ty !== "LAR")
|
||||||
.reduce((acc, value) => acc + value.mod_lb_hrs, 0),
|
.reduce((acc, value) => acc + value.mod_lb_hrs * 10, 0),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let subtotal = 0;
|
let subtotal = Dinero({ amount: 0 });
|
||||||
let rates_subtotal = 0;
|
let rates_subtotal = Dinero({ amount: 0 });
|
||||||
for (const property in ret) {
|
for (const property in ret) {
|
||||||
ret[property].total = ret[property].hours * ret[property].rate;
|
ret[property].total = Dinero({ amount: ret[property].rate * 100 })
|
||||||
subtotal = subtotal + ret[property].hours * ret[property].rate;
|
.multiply(ret[property].hours)
|
||||||
|
.divide(10);
|
||||||
|
subtotal = subtotal.add(ret[property].total);
|
||||||
if (
|
if (
|
||||||
property !== "paint_mat" &&
|
property !== "paint_mat" &&
|
||||||
property !== "shop_mat"
|
property !== "shop_mat"
|
||||||
//&& property !== "rate_atp"
|
//&& property !== "rate_atp"
|
||||||
)
|
)
|
||||||
rates_subtotal =
|
rates_subtotal = rates_subtotal.add(ret[property].total);
|
||||||
rates_subtotal + ret[property].hours * ret[property].rate;
|
|
||||||
}
|
}
|
||||||
ret.subtotal = subtotal;
|
ret.subtotal = subtotal;
|
||||||
ret.rates_subtotal = rates_subtotal;
|
ret.rates_subtotal = rates_subtotal;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +229,11 @@ function CalculatePartsTotals(jobLines) {
|
|||||||
...acc,
|
...acc,
|
||||||
parts: {
|
parts: {
|
||||||
...acc.parts,
|
...acc.parts,
|
||||||
subtotal: acc.parts.subtotal + value.act_price * value.part_qty,
|
subtotal: acc.parts.subtotal.add(
|
||||||
|
Dinero({ amount: value.act_price * 100 }).multiply(
|
||||||
|
value.part_qty
|
||||||
|
)
|
||||||
|
),
|
||||||
//TODO Add Adjustments in
|
//TODO Add Adjustments in
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -235,7 +243,9 @@ function CalculatePartsTotals(jobLines) {
|
|||||||
...acc,
|
...acc,
|
||||||
sublets: {
|
sublets: {
|
||||||
...acc.sublets,
|
...acc.sublets,
|
||||||
subtotal: acc.sublets.subtotal + value.act_price,
|
subtotal: acc.sublets.subtotal.add(
|
||||||
|
Dinero({ amount: value.act_price * 100 })
|
||||||
|
),
|
||||||
//TODO Add Adjustments in
|
//TODO Add Adjustments in
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -244,31 +254,46 @@ function CalculatePartsTotals(jobLines) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
parts: { subtotal: 0, adjustments: 0, total: 0 },
|
parts: {
|
||||||
sublets: { subtotal: 0, adjustments: 0, total: 0 },
|
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 }),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
parts: { ...ret.parts, total: ret.parts.subtotal + ret.parts.adjustments },
|
parts: {
|
||||||
|
...ret.parts,
|
||||||
|
total: ret.parts.subtotal, //+ ret.parts.adjustments
|
||||||
|
},
|
||||||
sublets: {
|
sublets: {
|
||||||
...ret.sublets,
|
...ret.sublets,
|
||||||
total: ret.sublets.subtotal + ret.sublets.adjustments,
|
total: ret.sublets.subtotal, // + ret.sublets.adjustments,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function CalculateCustPayable(job) {
|
function CalculateCustPayable(job) {
|
||||||
return {
|
let ret = {
|
||||||
deductible: job.ded_amt || 0,
|
deductible: Dinero({ amount: (job.ded_amt || 0) * 100 }) || 0,
|
||||||
federal_tax: job.federal_tax_payable || 0, //TODO Should this be renamed to make it more clear this is customer GST?
|
federal_tax: Dinero({ amount: (job.federal_tax_payable || 0) * 100 }), //TODO Should this be renamed to make it more clear this is customer GST?
|
||||||
other_customer_amount: job.other_amount_payable || 0,
|
other_customer_amount: Dinero({
|
||||||
dep_taxes: job.depreciation_taxes || 0,
|
amount: (job.other_amount_payable || 0) * 100,
|
||||||
total:
|
}),
|
||||||
job.ded_amt ||
|
dep_taxes: Dinero({ amount: job.depreciation_taxes || 0 }),
|
||||||
0 + job.federal_tax_payable ||
|
|
||||||
0 + job.other_amount_payable ||
|
|
||||||
0 + job.depreciation_taxes ||
|
|
||||||
0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ret.total = ret.deductible
|
||||||
|
.add(ret.federal_tax)
|
||||||
|
.add(ret.federal_tax)
|
||||||
|
.add(ret.other_customer_amount)
|
||||||
|
.add(ret.dep_taxes);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,12 +66,11 @@ export function JobsAvailableContainer({
|
|||||||
|
|
||||||
const newJob = {
|
const newJob = {
|
||||||
...estData.data.available_jobs_by_pk.est_data,
|
...estData.data.available_jobs_by_pk.est_data,
|
||||||
clm_total: newTotals.totals.total_repairs,
|
clm_total: newTotals.totals.total_repairs.toFormat("0.00"),
|
||||||
owner_owing: newTotals.custPayable.total,
|
owner_owing: newTotals.custPayable.total.toFormat("0.00"),
|
||||||
job_totals: newTotals,
|
job_totals: JSON.stringify(newTotals),
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("newTotals", newTotals);
|
|
||||||
insertNewJob({
|
insertNewJob({
|
||||||
variables: {
|
variables: {
|
||||||
job: selectedOwner
|
job: selectedOwner
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ export function JobsAvailableSupplementContainer({
|
|||||||
jobId: selectedJob,
|
jobId: selectedJob,
|
||||||
job: {
|
job: {
|
||||||
...supp,
|
...supp,
|
||||||
clm_total: newTotals.totals.total_repairs,
|
clm_total: newTotals.totals.total_repairs.toFormat("0.00"),
|
||||||
owner_owing: newTotals.custPayable.total,
|
owner_owing: newTotals.custPayable.total.toFormat("0.00"),
|
||||||
job_totals: newTotals,
|
job_totals: JSON.stringify(newTotals),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { Divider, Form, Input, InputNumber, Row, Col } from "antd";
|
import { Col, Divider, Form, Input, InputNumber, Row } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import JobTotalsTable from "../job-totals-table/job-totals-table.component";
|
import JobTotalsTable from "../job-totals-table/job-totals-table.component";
|
||||||
|
|
||||||
export default function JobsDetailFinancials({ job }) {
|
export default function JobsDetailFinancials({ job }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -125,8 +124,9 @@ export default function JobsDetailFinancials({ job }) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col offset={1} span={15}>
|
<Col offset={1} span={15}>
|
||||||
<JobTotalsTable totals={job.job_totals} />
|
<JobTotalsTable job={job} />
|
||||||
{JSON.stringify(job.cieca_ttl, null, "\t")}
|
<p>Mitchell: {JSON.stringify(job.cieca_ttl, null, "\t")}</p>
|
||||||
|
<p>Mine:{JSON.stringify(job.job_totals, null, "\t")}</p>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ export function JobsDetailPage({
|
|||||||
jobId: job.id,
|
jobId: job.id,
|
||||||
job: {
|
job: {
|
||||||
...values,
|
...values,
|
||||||
clm_total: newTotals.totals.total_repairs,
|
clm_total: newTotals.totals.total_repairs.toFormat("0.00"),
|
||||||
owner_owing: newTotals.custPayable.total,
|
owner_owing: newTotals.custPayable.total.toFormat("0.00"),
|
||||||
job_totals: newTotals,
|
job_totals: JSON.stringify(newTotals),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
@@ -124,15 +124,21 @@ export function JobsDetailPage({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={<LoadingSpinner message={t("general.labels.loadingapp")} />}
|
fallback={<LoadingSpinner message={t("general.labels.loadingapp")} />}>
|
||||||
>
|
|
||||||
<ScheduleJobModalContainer />
|
<ScheduleJobModalContainer />
|
||||||
<JobLineUpsertModalContainer />
|
<JobLineUpsertModalContainer />
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
let r = CalculateJob(job, bodyshop.shoprates);
|
||||||
|
console.log("r", r);
|
||||||
|
}}>
|
||||||
|
Calculate
|
||||||
|
</button>
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
//onFieldsChange={(a, b) => console.log("a,b", a, b)}
|
//onFieldsChange={(a, b) => console.log("a,b", a, b)}
|
||||||
name="JobDetailForm"
|
name='JobDetailForm'
|
||||||
onFinish={handleFinish}
|
onFinish={handleFinish}
|
||||||
{...formItemLayout}
|
{...formItemLayout}
|
||||||
autoComplete={"off"}
|
autoComplete={"off"}
|
||||||
@@ -163,8 +169,7 @@ export function JobsDetailPage({
|
|||||||
date_invoiced: job.date_invoiced ? moment(job.date_invoiced) : null,
|
date_invoiced: job.date_invoiced ? moment(job.date_invoiced) : null,
|
||||||
date_closed: job.date_closed ? moment(job.date_closed) : null,
|
date_closed: job.date_closed ? moment(job.date_closed) : null,
|
||||||
date_exported: job.date_exported ? moment(job.date_exported) : null,
|
date_exported: job.date_exported ? moment(job.date_exported) : null,
|
||||||
}}
|
}}>
|
||||||
>
|
|
||||||
<JobsDetailHeader
|
<JobsDetailHeader
|
||||||
job={job}
|
job={job}
|
||||||
mutationConvertJob={mutationConvertJob}
|
mutationConvertJob={mutationConvertJob}
|
||||||
@@ -174,8 +179,7 @@ export function JobsDetailPage({
|
|||||||
/>
|
/>
|
||||||
<Tabs
|
<Tabs
|
||||||
defaultActiveKey={search.tab}
|
defaultActiveKey={search.tab}
|
||||||
onChange={(key) => history.push({ search: `?tab=${key}` })}
|
onChange={(key) => history.push({ search: `?tab=${key}` })}>
|
||||||
>
|
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
tab={
|
tab={
|
||||||
<span>
|
<span>
|
||||||
@@ -183,8 +187,7 @@ export function JobsDetailPage({
|
|||||||
{t("menus.jobsdetail.claimdetail")}
|
{t("menus.jobsdetail.claimdetail")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="claimdetail"
|
key='claimdetail'>
|
||||||
>
|
|
||||||
<JobsDetailClaims job={job} />
|
<JobsDetailClaims job={job} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -194,8 +197,7 @@ export function JobsDetailPage({
|
|||||||
{t("menus.jobsdetail.insurance")}
|
{t("menus.jobsdetail.insurance")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="insurance"
|
key='insurance'>
|
||||||
>
|
|
||||||
<JobsDetailInsurance job={job} form={form} />
|
<JobsDetailInsurance job={job} form={form} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -205,8 +207,7 @@ export function JobsDetailPage({
|
|||||||
{t("menus.jobsdetail.repairdata")}
|
{t("menus.jobsdetail.repairdata")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="repairdata"
|
key='repairdata'>
|
||||||
>
|
|
||||||
<JobsLinesContainer jobId={job.id} />
|
<JobsLinesContainer jobId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -216,8 +217,7 @@ export function JobsDetailPage({
|
|||||||
{t("menus.jobsdetail.financials")}
|
{t("menus.jobsdetail.financials")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="financials"
|
key='financials'>
|
||||||
>
|
|
||||||
<JobsDetailFinancials job={job} />
|
<JobsDetailFinancials job={job} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -227,8 +227,7 @@ export function JobsDetailPage({
|
|||||||
{t("menus.jobsdetail.partssublet")}
|
{t("menus.jobsdetail.partssublet")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="partssublet"
|
key='partssublet'>
|
||||||
>
|
|
||||||
<JobsDetailPliContainer job={job} />
|
<JobsDetailPliContainer job={job} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -238,8 +237,7 @@ export function JobsDetailPage({
|
|||||||
{t("menus.jobsdetail.labor")}
|
{t("menus.jobsdetail.labor")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="labor"
|
key='labor'>
|
||||||
>
|
|
||||||
<JobsDetailLaborContainer jobId={job.id} />
|
<JobsDetailLaborContainer jobId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -249,8 +247,7 @@ export function JobsDetailPage({
|
|||||||
{t("menus.jobsdetail.dates")}
|
{t("menus.jobsdetail.dates")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="dates"
|
key='dates'>
|
||||||
>
|
|
||||||
<JobsDetailDatesComponent job={job} />}
|
<JobsDetailDatesComponent job={job} />}
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -260,8 +257,7 @@ export function JobsDetailPage({
|
|||||||
{t("jobs.labels.documents")}
|
{t("jobs.labels.documents")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="documents"
|
key='documents'>
|
||||||
>
|
|
||||||
<JobsDocumentsGalleryContainer jobId={job.id} />
|
<JobsDocumentsGalleryContainer jobId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
@@ -271,8 +267,7 @@ export function JobsDetailPage({
|
|||||||
{t("jobs.labels.notes")}
|
{t("jobs.labels.notes")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="notes"
|
key='notes'>
|
||||||
>
|
|
||||||
<JobNotesContainer jobId={job.id} />
|
<JobNotesContainer jobId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
|
|
||||||
@@ -283,8 +278,7 @@ export function JobsDetailPage({
|
|||||||
{t("jobs.labels.audit")}
|
{t("jobs.labels.audit")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="audit"
|
key='audit'>
|
||||||
>
|
|
||||||
<JobsDetailAuditContainer recordId={job.id} />
|
<JobsDetailAuditContainer recordId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
Reference in New Issue
Block a user