You can do a journal entry that hits the necessary...
# accounting
m
You can do a journal entry that hits the necessary accounts, removing the funds from subsidiary B and entering into subsidiary B - on the journal, there is column for 'customer' and you can put the customer's name when you enter it as a payment for Sub A's bank account, it will appear as a payment from that customer that can be applied to the invoice