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

@@ -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>
}
>