mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: printing sale receipts
This commit is contained in:
@@ -318,7 +318,7 @@ export class SaleEstimatesController {
|
||||
@Res({ passthrough: true }) res: Response,
|
||||
) {
|
||||
if (acceptHeader.includes(AcceptType.ApplicationPdf)) {
|
||||
const pdfContent =
|
||||
const [pdfContent] =
|
||||
await this.saleEstimatesApplication.getSaleEstimatePdf(estimateId);
|
||||
|
||||
res.set({
|
||||
|
||||
@@ -26,7 +26,7 @@ export class GetSaleEstimatePdf {
|
||||
|
||||
@Inject(SaleEstimate.name)
|
||||
private readonly saleEstimateModel: TenantModelProxy<typeof SaleEstimate>,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Retrieve sale estimate html content.
|
||||
@@ -50,9 +50,9 @@ export class GetSaleEstimatePdf {
|
||||
|
||||
// Retrieves the sale estimate html.
|
||||
const htmlContent = await this.saleEstimateHtml(saleEstimateId);
|
||||
|
||||
const content =
|
||||
const buffer =
|
||||
await this.chromiumlyTenancy.convertHtmlContent(htmlContent);
|
||||
|
||||
const eventPayload = { saleEstimateId };
|
||||
|
||||
// Triggers the `onSaleEstimatePdfViewed` event.
|
||||
@@ -60,7 +60,7 @@ export class GetSaleEstimatePdf {
|
||||
events.saleEstimate.onPdfViewed,
|
||||
eventPayload,
|
||||
);
|
||||
return [content, filename];
|
||||
return [buffer, filename];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user