Merged in release/2023-04-21 (pull request #716)

IO-2235 Exported GSR to Excel

Approved-by: Patrick Fic
This commit is contained in:
Allan Carr
2023-04-20 16:45:28 +00:00
committed by Patrick Fic
5 changed files with 71 additions and 10 deletions

View File

@@ -92,7 +92,7 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
to: values.to, to: values.to,
subject: Templates[values.key]?.subject, subject: Templates[values.key]?.subject,
}, },
values.sendby === "email" ? "e" : "p", values.sendby === "excel" ? "x" : values.sendby === "email" ? "e" : "p",
id id
); );
setLoading(false); setLoading(false);
@@ -250,15 +250,43 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
ranges={DatePIckerRanges} ranges={DatePIckerRanges}
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item style={{ margin: 0, padding: 0 }} dependencies={["key"]}>
label={t("general.labels.sendby")} {() => {
name="sendby" const key = form.getFieldValue("key");
initialValue="print" const currentId = form.getFieldValue("id");
> if (!key) return null;
<Radio.Group> //Kind of Id
<Radio value="email">{t("general.labels.email")}</Radio> const idtype = Templates[key] && Templates[key].idtype;
<Radio value="print">{t("general.labels.print")}</Radio> if (!idtype && currentId) {
</Radio.Group> form.setFieldsValue({ id: null });
return null;
}
if (idtype === "excel")
return (
<Form.Item
label={t("general.labels.sendby")}
name="sendby"
initialValue="print"
>
<Radio.Group>
<Radio value="excel">{t("general.labels.excel")}</Radio>
</Radio.Group>
</Form.Item>
);
if (idtype !== "excel")
return (
<Form.Item
label={t("general.labels.sendby")}
name="sendby"
initialValue="print"
>
<Radio.Group>
<Radio value="email">{t("general.labels.email")}</Radio>
<Radio value="print">{t("general.labels.print")}</Radio>
</Radio.Group>
</Form.Item>
);
}}
</Form.Item> </Form.Item>
<div <div

View File

@@ -1015,6 +1015,7 @@
"created_at": "Created At", "created_at": "Created At",
"email": "Email", "email": "Email",
"errors": "Errors", "errors": "Errors",
"excel": "Excel",
"exceptiontitle": "An error has occurred.", "exceptiontitle": "An error has occurred.",
"friday": "Friday", "friday": "Friday",
"globalsearch": "Global Search", "globalsearch": "Global Search",
@@ -2445,6 +2446,8 @@
"export_payables": "Export Log - Payables", "export_payables": "Export Log - Payables",
"export_payments": "Export Log - Payments", "export_payments": "Export Log - Payments",
"export_receivables": "Export Log - Receivables", "export_receivables": "Export Log - Receivables",
"exported_gsr_by_ro": "Exported Gross Sales - Excel",
"exported_gsr_by_ro_labor": "Exported Gross Sales (Labor) - Excel",
"gsr_by_atp": "", "gsr_by_atp": "",
"gsr_by_ats": "Gross Sales by ATS", "gsr_by_ats": "Gross Sales by ATS",
"gsr_by_category": "Gross Sales by Category", "gsr_by_category": "Gross Sales by Category",

View File

@@ -1015,6 +1015,7 @@
"created_at": "", "created_at": "",
"email": "", "email": "",
"errors": "", "errors": "",
"excel": "",
"exceptiontitle": "", "exceptiontitle": "",
"friday": "", "friday": "",
"globalsearch": "", "globalsearch": "",
@@ -2445,6 +2446,8 @@
"export_payables": "", "export_payables": "",
"export_payments": "", "export_payments": "",
"export_receivables": "", "export_receivables": "",
"exported_gsr_by_ro": "",
"exported_gsr_by_ro_labor": "",
"gsr_by_atp": "", "gsr_by_atp": "",
"gsr_by_ats": "", "gsr_by_ats": "",
"gsr_by_category": "", "gsr_by_category": "",

View File

@@ -1015,6 +1015,7 @@
"created_at": "", "created_at": "",
"email": "", "email": "",
"errors": "", "errors": "",
"excel": "",
"exceptiontitle": "", "exceptiontitle": "",
"friday": "", "friday": "",
"globalsearch": "", "globalsearch": "",
@@ -2445,6 +2446,8 @@
"export_payables": "", "export_payables": "",
"export_payments": "", "export_payments": "",
"export_receivables": "", "export_receivables": "",
"exported_gsr_by_ro": "",
"exported_gsr_by_ro_labor": "",
"gsr_by_atp": "", "gsr_by_atp": "",
"gsr_by_ats": "", "gsr_by_ats": "",
"gsr_by_category": "", "gsr_by_category": "",

View File

@@ -1857,6 +1857,30 @@ export const TemplateList = (type, context) => {
}, },
group: "customers", 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" ...(!type || type === "courtesycarcontract"