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

@@ -82,9 +82,7 @@ export class SaleInvoicesController {
status: 200,
description: 'Sale invoices deleted successfully',
})
bulkDeleteSaleInvoices(
@Body() bulkDeleteDto: BulkDeleteDto,
): Promise<void> {
bulkDeleteSaleInvoices(@Body() bulkDeleteDto: BulkDeleteDto): Promise<void> {
return this.saleInvoiceApplication.bulkDeleteSaleInvoices(
bulkDeleteDto.ids,
{ skipUndeletable: bulkDeleteDto.skipUndeletable ?? false },
@@ -212,7 +210,8 @@ export class SaleInvoicesController {
@Res({ passthrough: true }) res: Response,
) {
if (acceptHeader.includes(AcceptType.ApplicationPdf)) {
const pdfContent = await this.saleInvoiceApplication.saleInvoicePdf(id);
const [pdfContent, filename] =
await this.saleInvoiceApplication.saleInvoicePdf(id);
res.set({
'Content-Type': 'application/pdf',