diff --git a/client/src/utils/RenderTemplate.js b/client/src/utils/RenderTemplate.js index 969f0adf1..9511416f8 100644 --- a/client/src/utils/RenderTemplate.js +++ b/client/src/utils/RenderTemplate.js @@ -30,7 +30,7 @@ export default async function RenderTemplate( name: useShopSpecificTemplate ? `/${bodyshop.imexshopid}/${templateObject.name}` : `/${templateObject.name}`, - // ...(renderAsHtml && !renderAsExcel ? {} : { recipe: "chrome-pdf" }), + ...(renderAsHtml ? {} : { recipe: "chrome-pdf" }), ...(renderAsExcel ? { recipe: "html-to-xlsx" } : {}), }, data: { @@ -185,7 +185,7 @@ export const GenerateDocument = async ( }) ); } else if (sendType === "x") { - console.log("excel") + console.log("excel"); await RenderTemplate(template, bodyshop, false, true); } else { await RenderTemplate(template, bodyshop); diff --git a/server/job/job-costing.js b/server/job/job-costing.js index fe630fe58..5ccdeba0d 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -720,8 +720,14 @@ function GenerateCostingData(job) { const cost_sublet = billTotalsByCostCenters.subletCosts[ccVal] || Dinero({ amount: 0 }); - const costs = cost_labor.add(cost_parts).add(cost_additional); - const totalSales = sale_labor.add(sale_parts).add(sale_additional); + const costs = cost_labor + .add(cost_parts) + .add(cost_additional) + .add(cost_sublet); + const totalSales = sale_labor + .add(sale_parts) + .add(sale_additional) + .add(sale_sublet); const gpdollars = totalSales.subtract(costs); const gppercent = ( (gpdollars.getAmount() / totalSales.getAmount()) *