--CRM-16188, added function to check the total amount and sum of line total