Earlier, the total amount was not calculated correctly when invoices contained a negative discount.This has now been fixed.