Revert "IO-1567 Resolve refretch on export."
This reverts commit cd191dae70.
This commit is contained in:
@@ -15,6 +15,7 @@ import { logImEXEvent } from "../../firebase/firebase.utils";
|
|||||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||||
import { useHistory } from "react-router-dom";
|
import { useHistory } from "react-router-dom";
|
||||||
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -29,7 +30,7 @@ export function JobsCloseExportButton({
|
|||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateJob] = useMutation(UPDATE_JOB, {});
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
@@ -45,9 +46,13 @@ export function JobsCloseExportButton({
|
|||||||
//Check if it's a QBO Setup.
|
//Check if it's a QBO Setup.
|
||||||
let PartnerResponse;
|
let PartnerResponse;
|
||||||
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
|
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
|
||||||
PartnerResponse = await axios.post(`/qbo/receivables`, {
|
PartnerResponse = await axios.post(
|
||||||
jobIds: [jobId],
|
`/qbo/receivables`,
|
||||||
});
|
{
|
||||||
|
jobIds: [jobId],
|
||||||
|
},
|
||||||
|
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
//Default is QBD
|
//Default is QBD
|
||||||
|
|
||||||
@@ -150,7 +155,6 @@ export function JobsCloseExportButton({
|
|||||||
date_exported: new Date(),
|
date_exported: new Date(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
refetchQueries: ["QUERY_JOBS_FOR_EXPORT "],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!jobUpdateResponse.errors) {
|
if (!jobUpdateResponse.errors) {
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export function JobsExportAllButton({
|
|||||||
completedCallback,
|
completedCallback,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateJob] = useMutation(UPDATE_JOBS, {
|
const [updateJob] = useMutation(UPDATE_JOBS);
|
||||||
refetchQueries: ["QUERY_JOBS_FOR_EXPORT "],
|
|
||||||
});
|
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ export function PayableExportAll({
|
|||||||
completedCallback,
|
completedCallback,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateBill] = useMutation(UPDATE_BILLS, {
|
const [updateBill] = useMutation(UPDATE_BILLS);
|
||||||
refetchQueries: ["QUERY_BILLS_FOR_EXPORT "],
|
|
||||||
});
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export function PayableExportButton({
|
|||||||
setSelectedBills,
|
setSelectedBills,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateBill] = useMutation(UPDATE_BILLS, {
|
const [updateBill] = useMutation(UPDATE_BILLS);
|
||||||
refetchQueries: ["QUERY_BILLS_FOR_EXPORT "],
|
|
||||||
});
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export function PaymentExportButton({
|
|||||||
setSelectedPayments,
|
setSelectedPayments,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updatePayment] = useMutation(UPDATE_PAYMENTS, {
|
const [updatePayment] = useMutation(UPDATE_PAYMENTS);
|
||||||
refetchQueries: ["QUERY_PAYMENTS_FOR_EXPORT "],
|
|
||||||
});
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ export function PaymentsExportAllButton({
|
|||||||
completedCallback,
|
completedCallback,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updatePayments] = useMutation(UPDATE_PAYMENTS, {
|
const [updatePayments] = useMutation(UPDATE_PAYMENTS);
|
||||||
refetchQueries: ["QUERY_PAYMENTS_FOR_EXPORT "],
|
|
||||||
});
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user