Or even,
in the customer master on the general level - control tab, link to the vendor.
in the vendor master on the general level - control tab, link to the customer.
in the customer master on the company code level - payment tab: flag: clear with vendor
in the vendor master on the company code level - payment tab: flag: clear with customer
use customer/vendor clearing transaction