Merged in feature/2021-07-09 (pull request #129)
IO-1239 Resolve extra lines on glass claim export
This commit is contained in:
@@ -0,0 +1,57 @@
|
|||||||
|
import { DownCircleFilled } from "@ant-design/icons";
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Dropdown, Menu, notification } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { UPDATE_JOB_STATUS } from "../../graphql/jobs.queries";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JobsAdminStatus);
|
||||||
|
|
||||||
|
export function JobsAdminStatus({ bodyshop, job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const [mutationUpdateJobstatus] = useMutation(UPDATE_JOB_STATUS);
|
||||||
|
const updateJobStatus = (status) => {
|
||||||
|
mutationUpdateJobstatus({
|
||||||
|
variables: { jobId: job.id, status: status },
|
||||||
|
})
|
||||||
|
.then((r) => {
|
||||||
|
notification["success"]({ message: t("jobs.successes.save") });
|
||||||
|
// refetch();
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
notification["error"]({ message: t("jobs.errors.saving") });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusmenu = (
|
||||||
|
<Menu
|
||||||
|
onClick={(e) => {
|
||||||
|
updateJobStatus(e.key);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{bodyshop.md_ro_statuses.statuses.map((item) => (
|
||||||
|
<Menu.Item key={item}>{item}</Menu.Item>
|
||||||
|
))}
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dropdown overlay={statusmenu} trigger={["click"]} key="changestatus">
|
||||||
|
<Button shape="round">
|
||||||
|
<span>{job.status}</span>
|
||||||
|
|
||||||
|
<DownCircleFilled />
|
||||||
|
</Button>
|
||||||
|
</Dropdown>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -15,6 +15,8 @@ import JobAdminOwnerReassociate from "../../components/jobs-admin-owner-reassoci
|
|||||||
import JobsAdminUnvoid from "../../components/jobs-admin-unvoid/jobs-admin-unvoid.component";
|
import JobsAdminUnvoid from "../../components/jobs-admin-unvoid/jobs-admin-unvoid.component";
|
||||||
import JobAdminVehicleReassociate from "../../components/jobs-admin-vehicle-reassociate/jobs-admin-vehicle-reassociate.component";
|
import JobAdminVehicleReassociate from "../../components/jobs-admin-vehicle-reassociate/jobs-admin-vehicle-reassociate.component";
|
||||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||||
|
import JobsAdminStatus from "../../components/jobs-admin-change-status/jobs-admin-change.status.component";
|
||||||
|
|
||||||
import NotFound from "../../components/not-found/not-found.component";
|
import NotFound from "../../components/not-found/not-found.component";
|
||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import { GET_JOB_BY_PK } from "../../graphql/jobs.queries";
|
import { GET_JOB_BY_PK } from "../../graphql/jobs.queries";
|
||||||
@@ -96,6 +98,7 @@ export function JobsCloseContainer({ setBreadcrumbs, setSelectedHeader }) {
|
|||||||
<JobsAdminDeleteIntake job={data ? data.jobs_by_pk : {}} />
|
<JobsAdminDeleteIntake job={data ? data.jobs_by_pk : {}} />
|
||||||
<JobsAdminMarkReexport job={data ? data.jobs_by_pk : {}} />
|
<JobsAdminMarkReexport job={data ? data.jobs_by_pk : {}} />
|
||||||
<JobsAdminUnvoid job={data ? data.jobs_by_pk : {}} />
|
<JobsAdminUnvoid job={data ? data.jobs_by_pk : {}} />
|
||||||
|
<JobsAdminStatus job={data ? data.jobs_by_pk : {}} />
|
||||||
</Space>
|
</Space>
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ const generateInvoiceQbxml = (
|
|||||||
});
|
});
|
||||||
// console.log("Done creating hash", JSON.stringify(invoiceLineHash));
|
// console.log("Done creating hash", JSON.stringify(invoiceLineHash));
|
||||||
|
|
||||||
if (!hasMapaLine) {
|
if (!hasMapaLine && jobs_by_pk.job_totals.rates.mapa.total.amount > 0) {
|
||||||
console.log("Adding MAPA Line Manually.");
|
console.log("Adding MAPA Line Manually.");
|
||||||
const mapaAccountName = responsibilityCenters.defaults.profits.MAPA;
|
const mapaAccountName = responsibilityCenters.defaults.profits.MAPA;
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ const generateInvoiceQbxml = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasMashLine) {
|
if (!hasMashLine && jobs_by_pk.job_totals.rates.mash.total.amount > 0) {
|
||||||
console.log("Adding MASH Line Manually.");
|
console.log("Adding MASH Line Manually.");
|
||||||
|
|
||||||
const mashAccountName = responsibilityCenters.defaults.profits.MASH;
|
const mashAccountName = responsibilityCenters.defaults.profits.MASH;
|
||||||
|
|||||||
Reference in New Issue
Block a user