@@ -1,4 +1,12 @@
|
|||||||
import { Collapse, Form, Input, InputNumber, Select, Switch } from "antd";
|
import {
|
||||||
|
Collapse,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
InputNumber,
|
||||||
|
Select,
|
||||||
|
Space,
|
||||||
|
Switch,
|
||||||
|
} from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -10,6 +18,8 @@ import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
|||||||
import FormItemPhone, {
|
import FormItemPhone, {
|
||||||
PhoneItemFormatterValidation,
|
PhoneItemFormatterValidation,
|
||||||
} from "../form-items-formatted/phone-form-item.component";
|
} from "../form-items-formatted/phone-form-item.component";
|
||||||
|
import JobsDetailChangeEstimator from "../jobs-detail-change-estimator/jobs-detail-change-estimator.component";
|
||||||
|
import JobsDetailChangeFilehandler from "../jobs-detail-change-filehandler/jobs-detail-change-filehandler.component";
|
||||||
import JobsDetailRatesChangeButton from "../jobs-detail-rates-change-button/jobs-detail-rates-change-button.component";
|
import JobsDetailRatesChangeButton from "../jobs-detail-rates-change-button/jobs-detail-rates-change-button.component";
|
||||||
import JobsDetailRatesParts from "../jobs-detail-rates/jobs-detail-rates.parts.component";
|
import JobsDetailRatesParts from "../jobs-detail-rates/jobs-detail-rates.parts.component";
|
||||||
import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.component";
|
import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.component";
|
||||||
@@ -25,6 +35,15 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { getFieldValue } = form;
|
const { getFieldValue } = form;
|
||||||
|
|
||||||
|
const handleInsCoChange = (value) => {
|
||||||
|
const selectedCompany = bodyshop.md_ins_cos.find((s) => s.name === value);
|
||||||
|
if (selectedCompany) {
|
||||||
|
form.setFieldValue("ins_addr1", selectedCompany.street1);
|
||||||
|
form.setFieldValue("ins_city", selectedCompany.city);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Collapse defaultActiveKey="insurance">
|
<Collapse defaultActiveKey="insurance">
|
||||||
@@ -34,26 +53,20 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
|||||||
forceRender
|
forceRender
|
||||||
>
|
>
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item label={t("jobs.fields.ins_co_id")} name="ins_co_id">
|
<Form.Item label={t("jobs.fields.clm_no")} name="clm_no">
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.policy_no")} name="policy_no">
|
<Form.Item label={t("jobs.fields.policy_no")} name="policy_no">
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.clm_no")} name="clm_no">
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.regie_number")}
|
label={t("jobs.fields.regie_number")}
|
||||||
name="regie_number"
|
name="regie_number"
|
||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.loss_date")} name="loss_date">
|
|
||||||
<FormDatePicker />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm">
|
<Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm">
|
||||||
<Select>
|
<Select onChange={handleInsCoChange}>
|
||||||
{bodyshop.md_ins_cos.map((s) => (
|
{bodyshop.md_ins_cos.map((s) => (
|
||||||
<Select.Option key={s.name} value={s.name}>
|
<Select.Option key={s.name} value={s.name}>
|
||||||
{s.name}
|
{s.name}
|
||||||
@@ -67,7 +80,15 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
|||||||
<Form.Item label={t("jobs.fields.ins_city")} name="ins_city">
|
<Form.Item label={t("jobs.fields.ins_city")} name="ins_city">
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.ins_ct_ln")} name="ins_ct_ln">
|
<Form.Item
|
||||||
|
label={
|
||||||
|
<Space>
|
||||||
|
{t("jobs.fields.ins_ct_ln")}
|
||||||
|
<JobsDetailChangeFilehandler form={form} />
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
name="ins_ct_ln"
|
||||||
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.ins_ct_fn")} name="ins_ct_fn">
|
<Form.Item label={t("jobs.fields.ins_ct_fn")} name="ins_ct_fn">
|
||||||
@@ -95,11 +116,24 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
|||||||
>
|
>
|
||||||
<FormItemEmail email={getFieldValue("ins_ea")} />
|
<FormItemEmail email={getFieldValue("ins_ea")} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.loss_date")} name="loss_date">
|
||||||
|
<FormDatePicker />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("jobs.fields.kmin")} name="kmin">
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.est_co_nm")} name="est_co_nm">
|
<Form.Item label={t("jobs.fields.est_co_nm")} name="est_co_nm">
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.est_ct_fn")} name="est_ct_fn">
|
<Form.Item
|
||||||
|
label={
|
||||||
|
<Space>
|
||||||
|
{t("jobs.fields.est_ct_fn")}
|
||||||
|
<JobsDetailChangeEstimator form={form} />
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
name="est_ct_fn"
|
||||||
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.est_ct_ln")} name="est_ct_ln">
|
<Form.Item label={t("jobs.fields.est_ct_ln")} name="est_ct_ln">
|
||||||
|
|||||||
@@ -37,6 +37,15 @@ const lossColDamage = { sm: { span: 24 }, md: { span: 6 }, lg: { span: 4 } };
|
|||||||
export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
|
export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
|
||||||
const { getFieldValue } = form;
|
const { getFieldValue } = form;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const handleInsCoChange = (value) => {
|
||||||
|
const selectedCompany = bodyshop.md_ins_cos.find((s) => s.name === value);
|
||||||
|
if (selectedCompany) {
|
||||||
|
form.setFieldValue("ins_addr1", selectedCompany.street1);
|
||||||
|
form.setFieldValue("ins_city", selectedCompany.city);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FormRow header={t("jobs.forms.claiminfo")}>
|
<FormRow header={t("jobs.forms.claiminfo")}>
|
||||||
@@ -71,7 +80,7 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm">
|
<Form.Item label={t("jobs.fields.ins_co_nm")} name="ins_co_nm">
|
||||||
<Select disabled={jobRO}>
|
<Select disabled={jobRO} onChange={handleInsCoChange}>
|
||||||
{bodyshop.md_ins_cos.map((s) => (
|
{bodyshop.md_ins_cos.map((s) => (
|
||||||
<Select.Option key={s.name} value={s.name}>
|
<Select.Option key={s.name} value={s.name}>
|
||||||
{s.name}
|
{s.name}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import React from "react";
|
|
||||||
import { Button, notification } from "antd";
|
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, notification } from "antd";
|
||||||
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
|
||||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||||
|
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
||||||
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
|
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -46,7 +46,6 @@ const PaymentMarkForExportButton = ({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const paymentUpdateResponse = await updatePayment({
|
const paymentUpdateResponse = await updatePayment({
|
||||||
variables: {
|
variables: {
|
||||||
paymentId: payment.id,
|
paymentId: payment.id,
|
||||||
@@ -55,16 +54,12 @@ const PaymentMarkForExportButton = ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!!!paymentUpdateResponse.errors) {
|
if (!!!paymentUpdateResponse.errors) {
|
||||||
notification.open({
|
notification.open({
|
||||||
type: "success",
|
type: "success",
|
||||||
key: "paymentsuccessmarkforexport",
|
key: "paymentsuccessmarkforexport",
|
||||||
message: t("payments.successes.markexported"),
|
message: t("payments.successes.markexported"),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (refetch) refetch();
|
|
||||||
|
|
||||||
setPaymentContext({
|
setPaymentContext({
|
||||||
actions: {
|
actions: {
|
||||||
refetch,
|
refetch,
|
||||||
@@ -74,6 +69,12 @@ const PaymentMarkForExportButton = ({
|
|||||||
exportedat: today,
|
exportedat: today,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (refetch)
|
||||||
|
refetch(
|
||||||
|
paymentUpdateResponse &&
|
||||||
|
paymentUpdateResponse.data.update_payments.returning[0]
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("payments.errors.exporting", {
|
message: t("payments.errors.exporting", {
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import {
|
|||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import PaymentForm from "../payment-form/payment-form.component";
|
import PaymentForm from "../payment-form/payment-form.component";
|
||||||
import PaymentReexportButton from "../payment-reexport-button/payment-reexport-button.component";
|
|
||||||
import PaymentMarkForExportButton from "../payment-mark-export-button/payment-mark-export-button-component";
|
import PaymentMarkForExportButton from "../payment-mark-export-button/payment-mark-export-button-component";
|
||||||
|
import PaymentReexportButton from "../payment-reexport-button/payment-reexport-button.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
paymentModal: selectPayment,
|
paymentModal: selectPayment,
|
||||||
@@ -194,7 +194,6 @@ function PaymentModalContainer({
|
|||||||
autoComplete={"off"}
|
autoComplete={"off"}
|
||||||
form={form}
|
form={form}
|
||||||
layout="vertical"
|
layout="vertical"
|
||||||
initialValues={context || {}}
|
|
||||||
disabled={context?.exportedat}
|
disabled={context?.exportedat}
|
||||||
>
|
>
|
||||||
<PaymentForm form={form} />
|
<PaymentForm form={form} />
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from "react";
|
|
||||||
import { Button, notification } from "antd";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { Button, notification } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
||||||
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setPaymentContext: (context) =>
|
setPaymentContext: (context) =>
|
||||||
@@ -24,16 +24,12 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!!!paymentUpdateResponse.errors) {
|
if (!!!paymentUpdateResponse.errors) {
|
||||||
notification.open({
|
notification.open({
|
||||||
type: "success",
|
type: "success",
|
||||||
key: "paymentsuccessexport",
|
key: "paymentsuccessexport",
|
||||||
message: t("payments.successes.markreexported"),
|
message: t("payments.successes.markreexported"),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (refetch) refetch();
|
|
||||||
|
|
||||||
setPaymentContext({
|
setPaymentContext({
|
||||||
actions: {
|
actions: {
|
||||||
refetch,
|
refetch,
|
||||||
@@ -43,6 +39,11 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
|
|||||||
exportedat: null,
|
exportedat: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (refetch)
|
||||||
|
refetch(
|
||||||
|
paymentUpdateResponse &&
|
||||||
|
paymentUpdateResponse.data.update_payments.returning[0]
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("payments.errors.exporting", {
|
message: t("payments.errors.exporting", {
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ const sortByParentId = (arr) => {
|
|||||||
//console.log("sortByParentId -> byParentsIdsList", byParentsIdsList);
|
//console.log("sortByParentId -> byParentsIdsList", byParentsIdsList);
|
||||||
|
|
||||||
while (byParentsIdsList[parentId]) {
|
while (byParentsIdsList[parentId]) {
|
||||||
sortedList.push(byParentsIdsList[parentId][0]);
|
sortedList.push(...byParentsIdsList[parentId]); //Spread in the whole list in case several items have the same parents.
|
||||||
parentId = byParentsIdsList[parentId][0].id;
|
parentId = byParentsIdsList[parentId][byParentsIdsList[parentId].length -1].id; //Grab the ID from the last one.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (byParentsIdsList["null"])
|
if (byParentsIdsList["null"])
|
||||||
|
|||||||
@@ -39,6 +39,14 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) {
|
|||||||
form.getFieldValue(["md_ro_statuses", "statuses"]) || []
|
form.getFieldValue(["md_ro_statuses", "statuses"]) || []
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [productionStatus] = useState(
|
||||||
|
form
|
||||||
|
.getFieldValue(["md_ro_statuses", "production_statuses"])
|
||||||
|
.concat(
|
||||||
|
form.getFieldValue(["md_ro_statuses", "additional_board_statuses"])
|
||||||
|
) || []
|
||||||
|
);
|
||||||
|
|
||||||
const handleBlur = () => {
|
const handleBlur = () => {
|
||||||
setOptions(form.getFieldValue(["md_ro_statuses", "statuses"]));
|
setOptions(form.getFieldValue(["md_ro_statuses", "statuses"]));
|
||||||
};
|
};
|
||||||
@@ -346,7 +354,7 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) {
|
|||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Select>
|
<Select>
|
||||||
{options.map((item, idx) => (
|
{productionStatus.map((item, idx) => (
|
||||||
<Select.Option key={idx} value={item}>
|
<Select.Option key={idx} value={item}>
|
||||||
{item}
|
{item}
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
|
|||||||
@@ -1573,7 +1573,7 @@
|
|||||||
"federal_tax_payable": "Federal Tax Payable",
|
"federal_tax_payable": "Federal Tax Payable",
|
||||||
"federal_tax_rate": "Federal Tax Rate",
|
"federal_tax_rate": "Federal Tax Rate",
|
||||||
"ins_addr1": "Insurance Co. Address",
|
"ins_addr1": "Insurance Co. Address",
|
||||||
"ins_city": "Insurance City",
|
"ins_city": "Insurance Co. City",
|
||||||
"ins_co_id": "Insurance Co. ID",
|
"ins_co_id": "Insurance Co. ID",
|
||||||
"ins_co_nm": "Insurance Company Name",
|
"ins_co_nm": "Insurance Company Name",
|
||||||
"ins_co_nm_short": "Ins. Co.",
|
"ins_co_nm_short": "Ins. Co.",
|
||||||
|
|||||||
Reference in New Issue
Block a user