IO-1819 Allow private estimate lines to be modified.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<babeledit_project version="1.2" be_version="2.7.1">
|
||||
<babeledit_project be_version="2.7.1" version="1.2">
|
||||
<!--
|
||||
|
||||
BabelEdit project file
|
||||
@@ -4753,6 +4753,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>private</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>state</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -41,9 +41,10 @@ import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.con
|
||||
import _ from "lodash";
|
||||
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
||||
import JobLinesExpander from "./job-lines-expander.component";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
jobRO: selectJobReadOnly,
|
||||
technician: selectTechnician,
|
||||
});
|
||||
@@ -56,6 +57,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
|
||||
export function JobLinesComponent({
|
||||
bodyshop,
|
||||
jobRO,
|
||||
technician,
|
||||
setPartsOrderContext,
|
||||
@@ -75,6 +77,14 @@ export function JobLinesComponent({
|
||||
filteredInfo: {},
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
const jobIsPrivate = bodyshop.md_ins_cos.find(
|
||||
(c) => c.name === job.ins_co_nm
|
||||
)?.private;
|
||||
|
||||
console.log(
|
||||
"🚀 ~ file: job-lines.component.jsx ~ line 81 ~ jobIsPrivate",
|
||||
jobIsPrivate
|
||||
);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@@ -286,7 +296,7 @@ export function JobLinesComponent({
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{record.manual_line && (
|
||||
{(record.manual_line || jobIsPrivate) && (
|
||||
<Space>
|
||||
<Button
|
||||
disabled={jobRO}
|
||||
|
||||
@@ -216,6 +216,7 @@ export function JobLinesUpsertModalComponent({
|
||||
rules={[
|
||||
({ getFieldValue }) => ({
|
||||
validator(rule, value) {
|
||||
console.log(value);
|
||||
if (!value || getFieldValue("part_type") !== "PAE") {
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -226,7 +227,10 @@ export function JobLinesUpsertModalComponent({
|
||||
}),
|
||||
({ getFieldValue }) => ({
|
||||
validator(rule, value) {
|
||||
if (!!getFieldValue("part_type") === !!value) {
|
||||
console.log(value, !!value);
|
||||
if (
|
||||
!!getFieldValue("part_type") === (!!value || value === 0)
|
||||
) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject(
|
||||
|
||||
@@ -811,14 +811,23 @@ export default function ShopInfoGeneral({ form }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Space>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.md_ins_co.zip")}
|
||||
key={`${index}zip`}
|
||||
name={[field.name, "zip"]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.md_ins_co.zip")}
|
||||
key={`${index}zip`}
|
||||
name={[field.name, "zip"]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.md_ins_co.private")}
|
||||
key={`${index}private`}
|
||||
name={[field.name, "private"]}
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
|
||||
<Space wrap>
|
||||
<DeleteFilled
|
||||
onClick={() => {
|
||||
remove(field.name);
|
||||
|
||||
@@ -295,6 +295,7 @@
|
||||
"md_ins_co": {
|
||||
"city": "City",
|
||||
"name": "Insurance Company Name",
|
||||
"private": "Private",
|
||||
"state": "Province/State",
|
||||
"street1": "Street 1",
|
||||
"street2": "Street 2",
|
||||
|
||||
@@ -295,6 +295,7 @@
|
||||
"md_ins_co": {
|
||||
"city": "",
|
||||
"name": "",
|
||||
"private": "",
|
||||
"state": "",
|
||||
"street1": "",
|
||||
"street2": "",
|
||||
|
||||
@@ -295,6 +295,7 @@
|
||||
"md_ins_co": {
|
||||
"city": "",
|
||||
"name": "",
|
||||
"private": "",
|
||||
"state": "",
|
||||
"street1": "",
|
||||
"street2": "",
|
||||
|
||||
Reference in New Issue
Block a user