Improved logic for payment state on canceled orders. 

#5106

add more logic to outstancing balance and order updater to set the correct payment_state on the order when the order is canceled.

Do not merge yet. Need some more edge cases to make sure we have all the bases covered.
I don't think checking the last payments state is sufficient here.  With split payment capturing in cases where users capture payment for each shipment this could be incorrect.  It may be sufficient to simply do:
self.payments.any? { |p| p.competed? } or self.payments.completed.size > 0

Not sure which would be more efficient, but probably the size call.