fix: incorrect additional seats quantity of mix invoices

This commit is contained in:
chungyau97 2025-07-14 22:08:00 +08:00
parent 784b98a818
commit 99f7f7dc6d
1 changed files with 1 additions and 5 deletions

View File

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