From 15c7b841fe087c3cdd45390f55046b4b479f70fd Mon Sep 17 00:00:00 2001 From: Mahyargdz Date: Sun, 25 May 2025 09:23:29 +0330 Subject: [PATCH] fix: the discount code bug in apply for invoice --- src/modules/invoices/providers/invoices.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/invoices/providers/invoices.service.ts b/src/modules/invoices/providers/invoices.service.ts index 250073e..e5d1ea0 100755 --- a/src/modules/invoices/providers/invoices.service.ts +++ b/src/modules/invoices/providers/invoices.service.ts @@ -725,7 +725,7 @@ export class InvoicesService { if (discount?.user?.id && discount?.user?.id !== userId) throw new BadRequestException(InvoiceMessage.DISCOUNT_NOT_FOR_THIS_USER); - if (discount?.isActive) throw new BadRequestException(InvoiceMessage.DISCOUNT_IS_NOT_ACTIVE); + if (!discount?.isActive) throw new BadRequestException(InvoiceMessage.DISCOUNT_IS_NOT_ACTIVE); if (discount.endDate && dayjs(discount.endDate).isBefore(dayjs())) throw new BadRequestException(InvoiceMessage.DISCOUNT_EXPIRED);