Set correct company on invoices when working on multicompany environment

In the last commit we used a new cursor for this problem, but in this
time we make a browse for each contract like Pedro Baeza proposed