Take early payments in consideration when confirming a sale

This will allow a sale to receive an early payment before it is confirmed.

We have to take confirmed payment in consideration too, since some payments
(like card, check, etc) may be unpaid, but that doesn't mean that they're not
valid (e.g. a check that wasn't discounted yet or a card transaction not
processed).

This will be useful for the following use cases:
* Allow a work order to receive an early payment for the service (the main
  porpouse of the patch)
* Work right with online payments (e.g. magento), since it will create the
  payments and they can be paid or not when confirming on Till. That case will
  fall into the "total already paid" case and wont let the user add more
  payments.
* A quote could hold information about payments and they won't have to be
  recreated when confirming the sale

Change-Id: I0c584c7cc1698a3fc19a417825d0244153660fd8