@@ -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 { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -10,6 +18,8 @@ import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
||||
import FormItemPhone, {
|
||||
PhoneItemFormatterValidation,
|
||||
} 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 JobsDetailRatesParts from "../jobs-detail-rates/jobs-detail-rates.parts.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 }) {
|
||||
const { t } = useTranslation();
|
||||
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 (
|
||||
<div>
|
||||
<Collapse defaultActiveKey="insurance">
|
||||
@@ -34,26 +53,20 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
||||
forceRender
|
||||
>
|
||||
<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 />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("jobs.fields.policy_no")} name="policy_no">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("jobs.fields.clm_no")} name="clm_no">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.regie_number")}
|
||||
name="regie_number"
|
||||
>
|
||||
<Input />
|
||||
</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">
|
||||
<Select>
|
||||
<Select onChange={handleInsCoChange}>
|
||||
{bodyshop.md_ins_cos.map((s) => (
|
||||
<Select.Option key={s.name} value={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">
|
||||
<Input />
|
||||
</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 />
|
||||
</Form.Item>
|
||||
<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")} />
|
||||
</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">
|
||||
<Input />
|
||||
</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 />
|
||||
</Form.Item>
|
||||
<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 }) {
|
||||
const { getFieldValue } = form;
|
||||
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 (
|
||||
<div>
|
||||
<FormRow header={t("jobs.forms.claiminfo")}>
|
||||
@@ -71,7 +80,7 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
|
||||
</Form.Item>
|
||||
|
||||
<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) => (
|
||||
<Select.Option key={s.name} value={s.name}>
|
||||
{s.name}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import { Button, notification } from "antd";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, notification } from "antd";
|
||||
import React from "react";
|
||||
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 { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
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({
|
||||
currentUser: selectCurrentUser,
|
||||
@@ -46,7 +46,6 @@ const PaymentMarkForExportButton = ({
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const paymentUpdateResponse = await updatePayment({
|
||||
variables: {
|
||||
paymentId: payment.id,
|
||||
@@ -55,16 +54,12 @@ const PaymentMarkForExportButton = ({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!!!paymentUpdateResponse.errors) {
|
||||
notification.open({
|
||||
type: "success",
|
||||
key: "paymentsuccessmarkforexport",
|
||||
message: t("payments.successes.markexported"),
|
||||
});
|
||||
|
||||
if (refetch) refetch();
|
||||
|
||||
setPaymentContext({
|
||||
actions: {
|
||||
refetch,
|
||||
@@ -74,6 +69,12 @@ const PaymentMarkForExportButton = ({
|
||||
exportedat: today,
|
||||
},
|
||||
});
|
||||
|
||||
if (refetch)
|
||||
refetch(
|
||||
paymentUpdateResponse &&
|
||||
paymentUpdateResponse.data.update_payments.returning[0]
|
||||
);
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("payments.errors.exporting", {
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
import { TemplateList } from "../../utils/TemplateConstants";
|
||||
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 PaymentReexportButton from "../payment-reexport-button/payment-reexport-button.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
paymentModal: selectPayment,
|
||||
@@ -194,7 +194,6 @@ function PaymentModalContainer({
|
||||
autoComplete={"off"}
|
||||
form={form}
|
||||
layout="vertical"
|
||||
initialValues={context || {}}
|
||||
disabled={context?.exportedat}
|
||||
>
|
||||
<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 { 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 { UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setPaymentContext: (context) =>
|
||||
@@ -24,16 +24,12 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!!!paymentUpdateResponse.errors) {
|
||||
notification.open({
|
||||
type: "success",
|
||||
key: "paymentsuccessexport",
|
||||
message: t("payments.successes.markreexported"),
|
||||
});
|
||||
|
||||
if (refetch) refetch();
|
||||
|
||||
setPaymentContext({
|
||||
actions: {
|
||||
refetch,
|
||||
@@ -43,6 +39,11 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
|
||||
exportedat: null,
|
||||
},
|
||||
});
|
||||
if (refetch)
|
||||
refetch(
|
||||
paymentUpdateResponse &&
|
||||
paymentUpdateResponse.data.update_payments.returning[0]
|
||||
);
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("payments.errors.exporting", {
|
||||
|
||||
@@ -18,8 +18,8 @@ const sortByParentId = (arr) => {
|
||||
//console.log("sortByParentId -> byParentsIdsList", byParentsIdsList);
|
||||
|
||||
while (byParentsIdsList[parentId]) {
|
||||
sortedList.push(byParentsIdsList[parentId][0]);
|
||||
parentId = byParentsIdsList[parentId][0].id;
|
||||
sortedList.push(...byParentsIdsList[parentId]); //Spread in the whole list in case several items have the same parents.
|
||||
parentId = byParentsIdsList[parentId][byParentsIdsList[parentId].length -1].id; //Grab the ID from the last one.
|
||||
}
|
||||
|
||||
if (byParentsIdsList["null"])
|
||||
|
||||
@@ -39,8 +39,23 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) {
|
||||
form.getFieldValue(["md_ro_statuses", "statuses"]) || []
|
||||
);
|
||||
|
||||
const [productionStatus, setProductionStatus] = useState(
|
||||
(
|
||||
form.getFieldValue(["md_ro_statuses", "production_statuses"]) || []
|
||||
).concat(
|
||||
form.getFieldValue(["md_ro_statuses", "additional_board_statuses"]) || []
|
||||
) || []
|
||||
);
|
||||
|
||||
const handleBlur = () => {
|
||||
setOptions(form.getFieldValue(["md_ro_statuses", "statuses"]));
|
||||
setProductionStatus(
|
||||
form
|
||||
.getFieldValue(["md_ro_statuses", "production_statuses"])
|
||||
.concat(
|
||||
form.getFieldValue(["md_ro_statuses", "additional_board_statuses"])
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -346,7 +361,7 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) {
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{options.map((item, idx) => (
|
||||
{productionStatus.map((item, idx) => (
|
||||
<Select.Option key={idx} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
|
||||
@@ -1573,7 +1573,7 @@
|
||||
"federal_tax_payable": "Federal Tax Payable",
|
||||
"federal_tax_rate": "Federal Tax Rate",
|
||||
"ins_addr1": "Insurance Co. Address",
|
||||
"ins_city": "Insurance City",
|
||||
"ins_city": "Insurance Co. City",
|
||||
"ins_co_id": "Insurance Co. ID",
|
||||
"ins_co_nm": "Insurance Company Name",
|
||||
"ins_co_nm_short": "Ins. Co.",
|
||||
|
||||
@@ -4242,7 +4242,7 @@
|
||||
interval_sec: 10
|
||||
num_retries: 0
|
||||
timeout_sec: 60
|
||||
webhook: https://worktest.home.irony.online
|
||||
webhook_from_env: HASURA_API_URL
|
||||
headers:
|
||||
- name: event-secret
|
||||
value_from_env: EVENT_SECRET
|
||||
@@ -5761,6 +5761,7 @@
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
allow_aggregations: true
|
||||
update_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
|
||||
Reference in New Issue
Block a user