[IMP] sale,purchase: allow invoicing

(closes #500)

(cherry picked from commit 84c0595aef3a417702c81b5226ae1f61817a2bf8)