Paying loan with another loan

SUGGESTED

We received money from company X to pay a loan of company Y. 

I received money in Sage from company X and it went under liabilities. In General Journal I credited company X and debited company Y. 

Now in balance sheet I don't see company Y anymore, which means loan was paid off, but I see more money owing to company X. 

How do I deal with that? how to pay it off properly? 

Thanks