fix: incorrect additional seats quantity of mix invoices
This commit is contained in:
parent
784b98a818
commit
99f7f7dc6d
|
|
@ -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
|
// 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) {
|
if (openAdditionalSeatsInvoices[0].lines.data.length > 1) {
|
||||||
openAdditionalSeatsInvoices[0].lines.data.forEach((line) => {
|
openAdditionalSeatsInvoices[0].lines.data.forEach((line) => {
|
||||||
if (line.amount < 0) {
|
if (line.amount < 0) newQuantity += line.quantity ?? 0
|
||||||
newQuantity += -Math.abs(line.quantity ?? 0)
|
|
||||||
} else {
|
|
||||||
newQuantity += line.quantity ?? 0
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
// If there is only one line in the invoice, we need to remove the whole quantity of that invoice
|
// 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) {
|
} else if (openAdditionalSeatsInvoices[0].lines.data.length === 1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue