Accounting treatment for inter-company transactions in erpNext

I have a company called XXX and other two companies called YYY and ZZZ, all of this are separate entities but have the same owner. Now company XXX is performing better than YYY and ZZZ such that payments against YYY and ZZZ are made by XXX. How best can I implement a proper financial trail or rather a virtualised payment system where XXX caters for the payments of the other companies as erpNext treats each company separately. There should be a link for all the companies to assist in consolidation of the accounts

Presently as far as i know there is not feature for inter-company transaction in ERPNEXT. But you can handle that manually by creating the following accounts
IN COMPANY XX (VIABLE COMPANY)
1.Due from ZZ as account receivable.Any time XX pay for any transaction on behalf of ZZ,credit bank/cash and debit this Due from ZZ rather than debiting the expense account because the expense does not belong to XX
IN COMPANY ZZ
create an account:
1.Due to XX
as account payable.
Any time XX pay for any transaction for ZZ,in the book of ZZ,debit the expense and credit the Due to XX
Thanks