mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
feat: add style to SSR invoice paper template
This commit is contained in:
@@ -450,15 +450,15 @@ export default class SaleInvoicesController extends BaseController {
|
||||
ACCEPT_TYPE.APPLICATION_JSON,
|
||||
ACCEPT_TYPE.APPLICATION_PDF,
|
||||
]);
|
||||
// Retrieves invoice in pdf format.
|
||||
if (true) {
|
||||
// Retrieves invoice in PDF format.
|
||||
if (ACCEPT_TYPE.APPLICATION_PDF === acceptType) {
|
||||
const [pdfContent, filename] =
|
||||
await this.saleInvoiceApplication.saleInvoicePdf(
|
||||
tenantId,
|
||||
saleInvoiceId
|
||||
);
|
||||
res.set({
|
||||
'Content-Type': 'text/html',
|
||||
'Content-Type': 'application/pdf',
|
||||
'Content-Length': pdfContent.length,
|
||||
'Content-Disposition': `attachment; filename="${filename}"`,
|
||||
});
|
||||
|
||||
@@ -47,16 +47,9 @@ export class SaleInvoicePdf {
|
||||
tenantId,
|
||||
invoiceId
|
||||
);
|
||||
// const htmlContent = await this.templateInjectable.render(
|
||||
// tenantId,
|
||||
// 'modules/invoice-standard',
|
||||
// brandingAttributes
|
||||
// );
|
||||
|
||||
const htmlContent = renderInvoicePaperTemplateHtml({});
|
||||
|
||||
console.log(htmlContent);
|
||||
|
||||
const htmlContent = renderInvoicePaperTemplateHtml({
|
||||
...brandingAttributes,
|
||||
});
|
||||
// Converts the given html content to pdf document.
|
||||
const buffer = await this.chromiumlyTenancy.convertHtmlContent(
|
||||
tenantId,
|
||||
@@ -69,7 +62,7 @@ export class SaleInvoicePdf {
|
||||
events.saleInvoice.onPdfViewed,
|
||||
eventPayload
|
||||
);
|
||||
return [htmlContent, filename];
|
||||
return [buffer, filename];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user