fix: printing sale receipts

This commit is contained in:
Ahmed Bouhuolia
2025-11-25 23:46:41 +02:00
parent 234b1804b3
commit cd4816aa3b
6 changed files with 48 additions and 23 deletions

View File

@@ -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({

View File

@@ -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];
}
/**