Why is the final invoice total not calculating correctly?