Fix computation of done state for purchase and sale

Allow to go to done state when one sub-state is none and nothing was generated
for it.

issue3550
review2221002