Record payment to vendor on behalf of another vendor
I have a business partner/vendor (A) where we purchase from another vendor (B) together.
I'm trying to match a payment to B shown in the transaction interface ultimately to a vendor credit on the ledger for A.
The way I want to do this is categorize the payment as an expense with the category "Accounts Payable" with Vendor A selected. I would then do a journal entry to move the vendor credit from Vendor A to Vendor B when Vendor B receives the product from Vendor A.
I can't seem to get the first part working. While I can categorize the transaction with the A/P category and it correctly posts to Vendor A, it records it as an expense which increases my vendor balance, not decrease it. However, the underlying journal entry correctly records it as a debit to A/P and a credit to my bank account. So at least my A/P is correct, however the vendor screen shows that I have 0 open balance (correct) and an overdue balance with Vendor A corresponding to my journal entry to move credits between Vendors (incorrect).
Is there a better way of doing this so I can keep track of payments made on behalf of one vendor to another vendor?