To Setoff Customer Invoices with the vendor costs you need to create a journal entry.
In the Accounting tab, click on Settings -> Journal Entry .
Click on the Add New button in the journal entry list view.
In the Debits Side, Select Accounts payable and the vendor whom you need to debit the amount from.
In the Credits Side, Select Account Receivable and the customer whom you need to credit it to.
Once Amount is entered, there would be two new sub tabs which would be enabled called invoices and costings.
In the invoices tab you can close all of the invoices associated with the customer.
In the costing tab, you can close all of the costs associated with the vendor.