Validate payment term when the user creates it.

Validate that the payment term has at least a line and ensure that the last
line's type is remainder.

issue3205
review854002
merge