From 99f7f7dc6dc1fd294dbd18ff260fe563e5b1d12c Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Mon, 14 Jul 2025 22:08:00 +0800 Subject: [PATCH] fix: incorrect additional seats quantity of mix invoices --- packages/server/src/StripeManager.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/server/src/StripeManager.ts b/packages/server/src/StripeManager.ts index 8fcd646e0..e25d51445 100644 --- a/packages/server/src/StripeManager.ts +++ b/packages/server/src/StripeManager.ts @@ -412,11 +412,7 @@ export class StripeManager { // When there is a paid and unpaid lines in the invoice, we need to remove the unpaid quantity of that invoice if (openAdditionalSeatsInvoices[0].lines.data.length > 1) { openAdditionalSeatsInvoices[0].lines.data.forEach((line) => { - if (line.amount < 0) { - newQuantity += -Math.abs(line.quantity ?? 0) - } else { - newQuantity += line.quantity ?? 0 - } + if (line.amount < 0) newQuantity += line.quantity ?? 0 }) // If there is only one line in the invoice, we need to remove the whole quantity of that invoice } else if (openAdditionalSeatsInvoices[0].lines.data.length === 1) {