feat: Invoice number in downloaded pdf document

This commit is contained in:
Ahmed Bouhuolia
2024-10-19 13:16:06 +02:00
parent c4ee143354
commit de50b89e5c
16 changed files with 181 additions and 36 deletions

View File

@@ -471,13 +471,14 @@ export default class PaymentReceivesController extends BaseController {
ACCEPT_TYPE.APPLICATION_PDF,
]);
if (ACCEPT_TYPE.APPLICATION_PDF === acceptType) {
const pdfContent = await this.creditNotePdf.getCreditNotePdf(
const [pdfContent, filename] = await this.creditNotePdf.getCreditNotePdf(
tenantId,
creditNoteId
);
res.set({
'Content-Type': 'application/pdf',
'Content-Length': pdfContent.length,
'Content-Disposition': `attachment; filename="${filename}"`,
});
res.send(pdfContent);
} else {