IO-1151 IO-1159 Calculated Repair & Label Updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { DatePicker, Form, Tooltip } from "antd";
|
||||
import { DatePicker, Form, Statistic, Tooltip } from "antd";
|
||||
import React, { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -23,6 +23,10 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
||||
);
|
||||
}, [job.status, bodyshop.md_ro_statuses.post_production_statuses]);
|
||||
|
||||
const calcRepairDays =
|
||||
job.joblines.reduce((acc, val) => acc + val.mod_lb_hrs, 0) /
|
||||
(bodyshop.target_touchtime === 0 ? 1 : bodyshop.target_touchtime);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<FormRow header={t("jobs.forms.estdates")}>
|
||||
@@ -52,6 +56,17 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
||||
<Form.Item label={t("jobs.fields.actual_in")} name="actual_in">
|
||||
<DateTimePicker disabled={jobRO} />
|
||||
</Form.Item>
|
||||
<Tooltip
|
||||
title={t("jobs.labels.calc_repair_days_tt", {
|
||||
target_touchtime: bodyshop.target_touchtime,
|
||||
})}
|
||||
>
|
||||
<Statistic
|
||||
value={calcRepairDays}
|
||||
precision={1}
|
||||
title={t("jobs.labels.calc_repair_days")}
|
||||
/>
|
||||
</Tooltip>
|
||||
</FormRow>
|
||||
<FormRow header={t("jobs.forms.repairdates")}>
|
||||
<Form.Item
|
||||
|
||||
@@ -39,7 +39,7 @@ function VehicleDetailFormContainer({ vehicle, refetch }) {
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title={t("menus.header.owners")}
|
||||
title={t("menus.header.vehicles")}
|
||||
extra={
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
Reference in New Issue
Block a user