invoice: Refine new InvoiceConfig#isUsageZeroAmountDisabled to also check on quantity being zero
@@ -95,7 +95,8 @@ public class InvoiceWithMetadata {
@Override
public boolean apply(final InvoiceItem invoiceItem) {
return invoiceItem.getInvoiceItemType() != InvoiceItemType.USAGE ||
- invoiceItem.getAmount().compareTo(BigDecimal.ZERO) != 0;
+ invoiceItem.getAmount().compareTo(BigDecimal.ZERO) != 0 ||
+ (invoiceItem.getQuantity() != null && invoiceItem.getQuantity() > 0);
}
});
final ImmutableList<InvoiceItem> filteredItems = ImmutableList.copyOf(resultingItems);
