Merge remote-tracking branch 'origin/test-AIO' into feature/IO-2677-Tasks
This commit is contained in:
@@ -57,6 +57,7 @@ const PaymentMarkForExportButton = ({ bodyshop, payment, refetch, setPaymentCont
|
|||||||
},
|
},
|
||||||
context: {
|
context: {
|
||||||
...payment,
|
...payment,
|
||||||
|
smartRefetch: true,
|
||||||
exportedat: today
|
exportedat: today
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,32 +1,30 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import {useMutation} from "@apollo/client";
|
||||||
import { Button, Form, Modal, notification, Space } from "antd";
|
import {Button, Form, Modal, notification, Space} from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, {useEffect, useState} from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import {connect} from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import {createStructuredSelector} from "reselect";
|
||||||
import { INSERT_NEW_PAYMENT, UPDATE_PAYMENT } from "../../graphql/payments.queries";
|
import {INSERT_NEW_PAYMENT, UPDATE_PAYMENT} from "../../graphql/payments.queries";
|
||||||
import { setEmailOptions } from "../../redux/email/email.actions";
|
import {toggleModalVisible} from "../../redux/modals/modals.actions";
|
||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import {selectPayment} from "../../redux/modals/modals.selectors";
|
||||||
import { selectPayment } from "../../redux/modals/modals.selectors";
|
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
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 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";
|
import PaymentReexportButton from "../payment-reexport-button/payment-reexport-button.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
paymentModal: selectPayment,
|
paymentModal: selectPayment,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
currentUser: selectCurrentUser
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
|
|
||||||
toggleModalVisible: () => dispatch(toggleModalVisible("payment"))
|
toggleModalVisible: () => dispatch(toggleModalVisible("payment"))
|
||||||
});
|
});
|
||||||
|
|
||||||
function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, currentUser, setEmailOptions }) {
|
function PaymentModalContainer({paymentModal, toggleModalVisible, bodyshop }) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [enterAgain, setEnterAgain] = useState(false);
|
const [enterAgain, setEnterAgain] = useState(false);
|
||||||
const [insertPayment] = useMutation(INSERT_NEW_PAYMENT);
|
const [insertPayment] = useMutation(INSERT_NEW_PAYMENT);
|
||||||
@@ -34,7 +32,7 @@ function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, cur
|
|||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { context, actions, open } = paymentModal;
|
const { context, actions, open } = paymentModal;
|
||||||
|
const smartRefetch = context?.smartRefetch || false;
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
@@ -90,7 +88,10 @@ function PaymentModalContainer({ paymentModal, toggleModalVisible, bodyshop, cur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actions.refetch) actions.refetch();
|
if (actions.refetch) {
|
||||||
|
const updatedData = smartRefetch && updatedPayment ? updatedPayment.data.update_payments.returning[0] : undefined;
|
||||||
|
actions.refetch(updatedData);
|
||||||
|
}
|
||||||
|
|
||||||
if (enterAgain) {
|
if (enterAgain) {
|
||||||
const prev = form.getFieldsValue(["date"]);
|
const prev = form.getFieldsValue(["date"]);
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
|
|||||||
refetch
|
refetch
|
||||||
},
|
},
|
||||||
context: {
|
context: {
|
||||||
|
smartRefetch: true,
|
||||||
...payment,
|
...payment,
|
||||||
exportedat: null
|
exportedat: null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export function PaymentsListPaginated({
|
|||||||
}
|
}
|
||||||
: refetch
|
: refetch
|
||||||
},
|
},
|
||||||
context: apolloResults ? apolloResults : record
|
context: apolloResults ? { smartRefetch: true, ...apolloResults} : {smartRefetch: true, ...record}
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
import { Button, Card, Form, InputNumber, notification, Popover, Radio } from "antd";
|
import {
|
||||||
|
Button,
|
||||||
|
Card,
|
||||||
|
Form,
|
||||||
|
InputNumber,
|
||||||
|
notification,
|
||||||
|
Popover,
|
||||||
|
Radio,
|
||||||
|
Space,
|
||||||
|
} from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -95,10 +104,16 @@ export function PrintCenterJobsLabels({ bodyshop, jobId }) {
|
|||||||
>
|
>
|
||||||
<InputNumber min={1} precision={0} max={99} />
|
<InputNumber min={1} precision={0} max={99} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Button type="primary" loading={loading} onClick={handleOk}>
|
<div style={{ display: "flex", justifyContent: "flex-end" }}>
|
||||||
{t("general.actions.print")}
|
<Space>
|
||||||
</Button>
|
<Button type="primary" loading={loading} onClick={handleOk}>
|
||||||
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
|
{t("general.actions.print")}
|
||||||
|
</Button>
|
||||||
|
<Button onClick={handleCancel}>
|
||||||
|
{t("general.actions.cancel")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -219,6 +219,12 @@ export const UPDATE_JOB_LINE = gql`
|
|||||||
id
|
id
|
||||||
notes
|
notes
|
||||||
mod_lbr_ty
|
mod_lbr_ty
|
||||||
|
mod_lb_hrs
|
||||||
|
part_type
|
||||||
|
op_code_desc
|
||||||
|
prt_dsmk_m
|
||||||
|
prt_dsmk_p
|
||||||
|
tax_part
|
||||||
part_qty
|
part_qty
|
||||||
db_price
|
db_price
|
||||||
act_price
|
act_price
|
||||||
|
|||||||
Reference in New Issue
Block a user