diff --git a/client/src/components/report-center-modal/report-center-modal.component.jsx b/client/src/components/report-center-modal/report-center-modal.component.jsx index e0db4f516..255273419 100644 --- a/client/src/components/report-center-modal/report-center-modal.component.jsx +++ b/client/src/components/report-center-modal/report-center-modal.component.jsx @@ -92,7 +92,7 @@ export function ReportCenterModalComponent({ reportCenterModal }) { to: values.to, subject: Templates[values.key]?.subject, }, - values.sendby === "email" ? "e" : "p", + values.sendby === "excel" ? "x" : values.sendby === "email" ? "e" : "p", id ); setLoading(false); @@ -250,15 +250,43 @@ export function ReportCenterModalComponent({ reportCenterModal }) { ranges={DatePIckerRanges} /> - - - {t("general.labels.email")} - {t("general.labels.print")} - + + {() => { + const key = form.getFieldValue("key"); + const currentId = form.getFieldValue("id"); + if (!key) return null; + //Kind of Id + const idtype = Templates[key] && Templates[key].idtype; + if (!idtype && currentId) { + form.setFieldsValue({ id: null }); + return null; + } + if (idtype === "excel") + return ( + + + {t("general.labels.excel")} + + + ); + if (idtype !== "excel") + return ( + + + {t("general.labels.email")} + {t("general.labels.print")} + + + ); + }}
{ }, group: "customers", }, + exported_gsr_by_ro: { + title: i18n.t("reportcenter.templates.exported_gsr_by_ro"), + subject: i18n.t("reportcenter.templates.exported_gsr_by_ro"), + key: "exported_gsr_by_ro", + idtype: "excel", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_exported"), + }, + group: "sales", + }, + exported_gsr_by_ro_labor: { + title: i18n.t("reportcenter.templates.exported_gsr_by_ro_labor"), + subject: i18n.t("reportcenter.templates.exported_gsr_by_ro_labor"), + key: "exported_gsr_by_ro_labor", + idtype: "excel", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_exported"), + }, + group: "sales", + }, } : {}), ...(!type || type === "courtesycarcontract"