diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 8de0a69f7..38857c3ad 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -38175,6 +38175,27 @@ + + production_by_technician_one + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + purchases_by_cost_center_detail false diff --git a/client/src/components/production-list-table/production-list-print.component.jsx b/client/src/components/production-list-table/production-list-print.component.jsx index bd26d2313..aad4287aa 100644 --- a/client/src/components/production-list-table/production-list-print.component.jsx +++ b/client/src/components/production-list-table/production-list-print.component.jsx @@ -4,9 +4,24 @@ import { TemplateList } from "../../utils/TemplateConstants"; import { useTranslation } from "react-i18next"; 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 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 [loading, setLoading] = useState(false); return ( @@ -33,6 +48,29 @@ export default function ProductionListPrint() { {ProdTemplates[key].title} ))} + + {bodyshop.employees.map((e) => ( + { + setLoading(true); + await GenerateDocument( + { + name: ProductionByTech.key, + variables: { id: e.id }, + }, + {}, + "p" + ); + setLoading(false); + }} + > + {e.first_name} {e.last_name} + + ))} + } > diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 4b885d167..2ec4ddfb9 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -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": "Production filtered by Technician", "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 - Detail", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index ee0b10b4d..59983bd51 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2268,6 +2268,7 @@ "production_by_ro": "", "production_by_target_date": "", "production_by_technician": "", + "production_by_technician_one": "", "purchases_by_cost_center_detail": "", "purchases_by_cost_center_summary": "", "purchases_by_date_range_detail": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 9d50e5f37..f20e02e42 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2268,6 +2268,7 @@ "production_by_ro": "", "production_by_target_date": "", "production_by_technician": "", + "production_by_technician_one": "", "purchases_by_cost_center_detail": "", "purchases_by_cost_center_summary": "", "purchases_by_date_range_detail": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index c42a14b50..1c7fe6558 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -1590,26 +1590,6 @@ export const TemplateList = (type, context) => { //idtype: "vendor", 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: { title: i18n.t("reportcenter.templates.production_by_category"), description: "", @@ -1618,6 +1598,14 @@ export const TemplateList = (type, context) => { //idtype: "vendor", 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" @@ -1629,6 +1617,18 @@ export const TemplateList = (type, context) => { key: "ca_bc_etf_table", 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, + }, } : {}), };