IO-1706 Payroll Table

This commit is contained in:
Patrick Fic
2022-02-16 14:22:39 -08:00
parent 8031f2b2ed
commit 0958ea5ba6
8 changed files with 91 additions and 8 deletions

View File

@@ -17,7 +17,8 @@ const Templates = TemplateList();
export default async function RenderTemplate(
templateObject,
bodyshop,
renderAsHtml = false
renderAsHtml = false,
renderAsExcel = false
) {
//Query assets that match the template name. Must be in format <<templateName>>.query
let { contextData, useShopSpecificTemplate } = await fetchContextData(
@@ -29,7 +30,8 @@ export default async function RenderTemplate(
name: useShopSpecificTemplate
? `/${bodyshop.imexshopid}/${templateObject.name}`
: `/${templateObject.name}`,
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
// ...(renderAsHtml && !renderAsExcel ? {} : { recipe: "chrome-pdf" }),
...(renderAsExcel ? { recipe: "html-to-xlsx" } : {}),
},
data: {
...contextData,
@@ -182,6 +184,9 @@ export const GenerateDocument = async (
template,
})
);
} else if (sendType === "x") {
console.log("excel")
await RenderTemplate(template, bodyshop, false, true);
} else {
await RenderTemplate(template, bodyshop);
}

View File

@@ -1635,6 +1635,13 @@ export const TemplateList = (type, context) => {
key: "ca_bc_etf_table",
disabled: false,
},
exported_payroll: {
title: i18n.t("printcenter.payments.exported_payroll"),
description: "Est Detail",
subject: i18n.t("printcenter.payments.exported_payroll"),
key: "exported_payroll",
disabled: false,
},
production_by_technician_one: {
title: i18n.t(
"reportcenter.templates.production_by_technician_one"