There could be scenarios where companies needs to accept payment from one customer against invoice for another customer's invoice.
To achieve this, post a journal entry by crediting the actual customer A(on which invoice is created) and debiting the other customer B( from which payment needs to be received).
Next create a customer deposit on the name of customer B.
Go to Transactions > Customers > Accept Payments Page. For customer A, Select the journal and Invoice and click on save. For customer B on accept payment page, select Deposit and journal and click on save.