IO-1669 Add print production by filtered category

This commit is contained in:
Patrick Fic
2022-01-27 14:34:06 -08:00
parent b147d4c2ed
commit 65d93b8f9b
6 changed files with 60 additions and 2 deletions

View File

@@ -38091,6 +38091,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>production_by_category_one</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>production_by_csr</name>
<definition_loaded>false</definition_loaded>

View File

@@ -8,7 +8,8 @@ import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
const ProdTemplates = TemplateList("production");
const ProductionByTech = TemplateList("special").production_by_technician_one;
const { production_by_technician_one, production_by_category_one } =
TemplateList("special");
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -58,7 +59,7 @@ export function ProductionListPrint({ bodyshop }) {
setLoading(true);
await GenerateDocument(
{
name: ProductionByTech.key,
name: production_by_technician_one.key,
variables: { id: e.id },
},
{},
@@ -71,6 +72,29 @@ export function ProductionListPrint({ bodyshop }) {
</Menu.Item>
))}
</Menu.SubMenu>
<Menu.SubMenu
title={t("reportcenter.templates.production_by_category_one")}
>
{bodyshop.md_categories.map((e) => (
<Menu.Item
key={e}
onClick={async () => {
setLoading(true);
await GenerateDocument(
{
name: production_by_category_one.key,
variables: { category: e },
},
{},
"p"
);
setLoading(false);
}}
>
{e}
</Menu.Item>
))}
</Menu.SubMenu>
</Menu>
}
>

View File

@@ -2264,6 +2264,7 @@
"payments_by_date": "Payments by Date",
"payments_by_date_type": "Payments by Date and Type",
"production_by_category": "Production by Category",
"production_by_category_one": "Production filtered by Category",
"production_by_csr": "Production by CSR",
"production_by_last_name": "Production by Last Name",
"production_by_repair_status": "Production by Status",

View File

@@ -2264,6 +2264,7 @@
"payments_by_date": "",
"payments_by_date_type": "",
"production_by_category": "",
"production_by_category_one": "",
"production_by_csr": "",
"production_by_last_name": "",
"production_by_repair_status": "",

View File

@@ -2264,6 +2264,7 @@
"payments_by_date": "",
"payments_by_date_type": "",
"production_by_category": "",
"production_by_category_one": "",
"production_by_csr": "",
"production_by_last_name": "",
"production_by_repair_status": "",

View File

@@ -1647,6 +1647,16 @@ export const TemplateList = (type, context) => {
//idtype: "vendor",
disabled: false,
},
production_by_category_one: {
title: i18n.t("reportcenter.templates.production_by_category_one"),
description: "",
subject: i18n.t(
"reportcenter.templates.production_by_category_one"
),
key: "production_by_category_one",
//idtype: "vendor",
disabled: false,
},
}
: {}),
};