A company with two heads is usually a team of people and multiple brands. If Company A borrows money from Company C, and Company B repays Company C's money, then a debt will be formed in Company A's books, and a creditor's right will be formed in Company B's books. A three-party agreement needs to be signed with the borrower, Company C. The agreement stipulates that Company B will repay the money to Company C on behalf of Company A, and all risks will be borne by Company B. When company a borrows money, it debits: bank and credits: other payables - company c. When company a gets the tripartite agreement, it debits: other payables - company c, and credits: other payables - company b; company b When repaying the money, debit: other receivables--company c, credit: bank; when company b gets the tripartite agreement, debit: other receivables--company a, credit: other receivables--c company.
In this way, you have an internal problem. You can solve the problem by directing another amount of funds internally.