IO-1652 Add production filtered by technician
This commit is contained in:
@@ -38175,6 +38175,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>production_by_technician_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>
|
<concept_node>
|
||||||
<name>purchases_by_cost_center_detail</name>
|
<name>purchases_by_cost_center_detail</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -4,9 +4,24 @@ import { TemplateList } from "../../utils/TemplateConstants";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
|
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
const ProdTemplates = TemplateList("production");
|
const ProdTemplates = TemplateList("production");
|
||||||
|
const ProductionByTech = TemplateList("special").production_by_technician_one;
|
||||||
|
|
||||||
export default function ProductionListPrint() {
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ProductionListPrint);
|
||||||
|
|
||||||
|
export function ProductionListPrint({ bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
return (
|
return (
|
||||||
@@ -33,6 +48,29 @@ export default function ProductionListPrint() {
|
|||||||
{ProdTemplates[key].title}
|
{ProdTemplates[key].title}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
|
<Menu.SubMenu
|
||||||
|
title={t("reportcenter.templates.production_by_technician_one")}
|
||||||
|
>
|
||||||
|
{bodyshop.employees.map((e) => (
|
||||||
|
<Menu.Item
|
||||||
|
key={e.id}
|
||||||
|
onClick={async () => {
|
||||||
|
setLoading(true);
|
||||||
|
await GenerateDocument(
|
||||||
|
{
|
||||||
|
name: ProductionByTech.key,
|
||||||
|
variables: { id: e.id },
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
"p"
|
||||||
|
);
|
||||||
|
setLoading(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{e.first_name} {e.last_name}
|
||||||
|
</Menu.Item>
|
||||||
|
))}
|
||||||
|
</Menu.SubMenu>
|
||||||
</Menu>
|
</Menu>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -2268,6 +2268,7 @@
|
|||||||
"production_by_ro": "Production by RO",
|
"production_by_ro": "Production by RO",
|
||||||
"production_by_target_date": "Production by Target Date",
|
"production_by_target_date": "Production by Target Date",
|
||||||
"production_by_technician": "Production by Technician",
|
"production_by_technician": "Production by Technician",
|
||||||
|
"production_by_technician_one": "Production filtered by Technician",
|
||||||
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
|
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
|
||||||
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
|
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
|
||||||
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
||||||
|
|||||||
@@ -2268,6 +2268,7 @@
|
|||||||
"production_by_ro": "",
|
"production_by_ro": "",
|
||||||
"production_by_target_date": "",
|
"production_by_target_date": "",
|
||||||
"production_by_technician": "",
|
"production_by_technician": "",
|
||||||
|
"production_by_technician_one": "",
|
||||||
"purchases_by_cost_center_detail": "",
|
"purchases_by_cost_center_detail": "",
|
||||||
"purchases_by_cost_center_summary": "",
|
"purchases_by_cost_center_summary": "",
|
||||||
"purchases_by_date_range_detail": "",
|
"purchases_by_date_range_detail": "",
|
||||||
|
|||||||
@@ -2268,6 +2268,7 @@
|
|||||||
"production_by_ro": "",
|
"production_by_ro": "",
|
||||||
"production_by_target_date": "",
|
"production_by_target_date": "",
|
||||||
"production_by_technician": "",
|
"production_by_technician": "",
|
||||||
|
"production_by_technician_one": "",
|
||||||
"purchases_by_cost_center_detail": "",
|
"purchases_by_cost_center_detail": "",
|
||||||
"purchases_by_cost_center_summary": "",
|
"purchases_by_cost_center_summary": "",
|
||||||
"purchases_by_date_range_detail": "",
|
"purchases_by_date_range_detail": "",
|
||||||
|
|||||||
@@ -1590,26 +1590,6 @@ export const TemplateList = (type, context) => {
|
|||||||
//idtype: "vendor",
|
//idtype: "vendor",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
production_by_technician: {
|
|
||||||
title: i18n.t("reportcenter.templates.production_by_technician"),
|
|
||||||
description: "",
|
|
||||||
subject: i18n.t("reportcenter.templates.production_by_technician"),
|
|
||||||
key: "production_by_technician",
|
|
||||||
//idtype: "vendor",
|
|
||||||
disabled: false,
|
|
||||||
},
|
|
||||||
production_by_technician_one: {
|
|
||||||
title: i18n.t(
|
|
||||||
"reportcenter.templates.production_by_technician_one"
|
|
||||||
),
|
|
||||||
description: "",
|
|
||||||
subject: i18n.t(
|
|
||||||
"reportcenter.templates.production_by_technician_one"
|
|
||||||
),
|
|
||||||
key: "production_by_technician_one",
|
|
||||||
//idtype: "vendor",
|
|
||||||
disabled: false,
|
|
||||||
},
|
|
||||||
production_by_category: {
|
production_by_category: {
|
||||||
title: i18n.t("reportcenter.templates.production_by_category"),
|
title: i18n.t("reportcenter.templates.production_by_category"),
|
||||||
description: "",
|
description: "",
|
||||||
@@ -1618,6 +1598,14 @@ export const TemplateList = (type, context) => {
|
|||||||
//idtype: "vendor",
|
//idtype: "vendor",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
production_by_technician: {
|
||||||
|
title: i18n.t("reportcenter.templates.production_by_technician"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("reportcenter.templates.production_by_technician"),
|
||||||
|
key: "production_by_technician",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
...(!type || type === "special"
|
...(!type || type === "special"
|
||||||
@@ -1629,6 +1617,18 @@ export const TemplateList = (type, context) => {
|
|||||||
key: "ca_bc_etf_table",
|
key: "ca_bc_etf_table",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
production_by_technician_one: {
|
||||||
|
title: i18n.t(
|
||||||
|
"reportcenter.templates.production_by_technician_one"
|
||||||
|
),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t(
|
||||||
|
"reportcenter.templates.production_by_technician_one"
|
||||||
|
),
|
||||||
|
key: "production_by_technician_one",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user