def METHOD_NAME(data, mode_of_payments):
	total = 0
	total_row = {"branch": "<b>Total</b>"}
	for mode in mode_of_payments:
		sum_of_payment = sum([detail[mode] for detail in data if mode in detail.keys()])
		total_row[mode] = sum_of_payment
		total += sum_of_payment
	total_row["total"] = total
	return total_row