How to balance and Opening entry against an Invoice

when starting the books in ERPNext there was a customer who had overpaid a little before day 0.
So I created an opening entry (journal entry of Type ‘opening’) which reflect the credit this particular customer has (USD 100).

This shows up correctly in the accounts receivable report, so I believe the Journal entry is logically correct.

Now with one of the next payment my customer will pay USD 100 less which balances out the existing credit and actually creates a nice 0 on the accounts receivable.
The problem I am facing though is that still 2 entries show up in the accounts receivable

#   Voucher Type    Invoiced Amount   Paid Amount  Credit Note  Outstanding
1.  Journal Entry            0.--        100.-           0.-       -100.- 
2.  Sales Invoice          500.--        400.-           0.-        100.-
                           500.-         500.-           0.-          0.-

so, I should have a complete empty Accounts receivable for this customer and therefore need to find a way to link the payment of 400 with the opening entry credit of 100,-, so both of them actually balance each other out.

I tried to add the Journal entry in the Payment Entry REFERENCE list, but the system did not allow this.

Can someone kindly point me into the right direction here?

In the awesome bar search, type in “Opening Invoice Creation Tool” and let the tool guide you.:grinning:

nope, not what I need. I have the opening balance already as I said.

As the “Opening Invoice creation Tool” only allows transactions in the default currency (which part of my Customers and most of my Suppliers do not use) I have created those with a Journal Entry as described though.

my question is how to balance those Opening Balance against payments/Invoices made later.

thus far it seems as if my approach of using journal entries for creating opening balance is not working. As the “Opening Invoice Creation Tool” is not multi-currency ready unfortunately it seems the only workable hack is to create Sales/Purchase Invoices with an item named “Opening Balance”.

In case a Customer has a credit of the time of the account opening the Sales invoice needs to be a credit note/return.

That way it is possible to reference to such an Invoice against a ‘real’ payment entry or other invoice and likewise balance them out against each other.