Merged in release/2023-04-21 (pull request #716)
IO-2235 Exported GSR to Excel Approved-by: Patrick Fic
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
</Form.Item>
|
||||
<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 style={{ margin: 0, padding: 0 }} dependencies={["key"]}>
|
||||
{() => {
|
||||
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 (
|
||||
<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>
|
||||
|
||||
<div
|
||||
|
||||
@@ -1015,6 +1015,7 @@
|
||||
"created_at": "Created At",
|
||||
"email": "Email",
|
||||
"errors": "Errors",
|
||||
"excel": "Excel",
|
||||
"exceptiontitle": "An error has occurred.",
|
||||
"friday": "Friday",
|
||||
"globalsearch": "Global Search",
|
||||
@@ -2445,6 +2446,8 @@
|
||||
"export_payables": "Export Log - Payables",
|
||||
"export_payments": "Export Log - Payments",
|
||||
"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_ats": "Gross Sales by ATS",
|
||||
"gsr_by_category": "Gross Sales by Category",
|
||||
|
||||
@@ -1015,6 +1015,7 @@
|
||||
"created_at": "",
|
||||
"email": "",
|
||||
"errors": "",
|
||||
"excel": "",
|
||||
"exceptiontitle": "",
|
||||
"friday": "",
|
||||
"globalsearch": "",
|
||||
@@ -2445,6 +2446,8 @@
|
||||
"export_payables": "",
|
||||
"export_payments": "",
|
||||
"export_receivables": "",
|
||||
"exported_gsr_by_ro": "",
|
||||
"exported_gsr_by_ro_labor": "",
|
||||
"gsr_by_atp": "",
|
||||
"gsr_by_ats": "",
|
||||
"gsr_by_category": "",
|
||||
|
||||
@@ -1015,6 +1015,7 @@
|
||||
"created_at": "",
|
||||
"email": "",
|
||||
"errors": "",
|
||||
"excel": "",
|
||||
"exceptiontitle": "",
|
||||
"friday": "",
|
||||
"globalsearch": "",
|
||||
@@ -2445,6 +2446,8 @@
|
||||
"export_payables": "",
|
||||
"export_payments": "",
|
||||
"export_receivables": "",
|
||||
"exported_gsr_by_ro": "",
|
||||
"exported_gsr_by_ro_labor": "",
|
||||
"gsr_by_atp": "",
|
||||
"gsr_by_ats": "",
|
||||
"gsr_by_category": "",
|
||||
|
||||
@@ -1857,6 +1857,30 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user