@@ -27,6 +27,7 @@ import {HasFeatureAccess} from "../feature-wrapper/feature-wrapper.component";
|
||||
import {DateTimeFormatter} from "../../utils/DateFormatter";
|
||||
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
||||
import dayjs from "../../utils/day";
|
||||
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -82,6 +83,14 @@ export function JobsDetailHeaderActions({
|
||||
const [updateJob] = useMutation(UPDATE_JOB);
|
||||
const [voidJob] = useMutation(VOID_JOB);
|
||||
const [cancelAllAppointments] = useMutation(CANCEL_APPOINTMENTS_BY_JOB_ID);
|
||||
|
||||
const {treatments: {ImEXPay}} = useSplitTreatments({
|
||||
attributes: {},
|
||||
names: ["ImEXPay"],
|
||||
splitKey: bodyshop && bodyshop.imexshopid,
|
||||
});
|
||||
|
||||
|
||||
const jobInProduction = useMemo(() => {
|
||||
return bodyshop.md_ro_statuses.production_statuses.includes(job.status);
|
||||
}, [job, bodyshop.md_ro_statuses.production_statuses]);
|
||||
@@ -97,7 +106,7 @@ export function JobsDetailHeaderActions({
|
||||
);
|
||||
}, [job.status, bodyshop.md_ro_statuses.post_production_statuses]);
|
||||
|
||||
const handleDuplicate =() =>
|
||||
const handleDuplicate = () =>
|
||||
DuplicateJob(
|
||||
client,
|
||||
job.id,
|
||||
@@ -694,33 +703,37 @@ export function JobsDetailHeaderActions({
|
||||
context: {jobid: job.id},
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'entercardpayments',
|
||||
disabled: !job.converted,
|
||||
label: t("menus.header.entercardpayment"),
|
||||
onClick: () => {
|
||||
logImEXEvent("job_header_enter_card_payment");
|
||||
}];
|
||||
|
||||
setCardPaymentContext({
|
||||
actions: {},
|
||||
context: {jobid: job.id},
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'cccontract',
|
||||
disabled: jobRO || !job.converted,
|
||||
label: <Link
|
||||
to={{
|
||||
pathname: "/manage/courtesycars/contracts/new",
|
||||
state: {jobId: job.id},
|
||||
}}
|
||||
>
|
||||
{t("menus.jobsactions.newcccontract")}
|
||||
</Link>
|
||||
}
|
||||
];
|
||||
if (ImEXPay.treatment === "on") {
|
||||
menuItems.push({
|
||||
key: 'entercardpayments',
|
||||
disabled: !job.converted,
|
||||
label: t("menus.header.entercardpayment"),
|
||||
onClick: () => {
|
||||
logImEXEvent("job_header_enter_card_payment");
|
||||
|
||||
setCardPaymentContext({
|
||||
actions: {},
|
||||
context: {jobid: job.id},
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
menuItems.push({
|
||||
key: 'cccontract',
|
||||
disabled: jobRO || !job.converted,
|
||||
label: <Link
|
||||
to={{
|
||||
pathname: "/manage/courtesycars/contracts/new",
|
||||
state: {jobId: job.id},
|
||||
}}
|
||||
>
|
||||
{t("menus.jobsactions.newcccontract")}
|
||||
</Link>
|
||||
});
|
||||
|
||||
menuItems.push(
|
||||
job.inproduction ?
|
||||
|
||||
Reference in New Issue
Block a user