How to pay a JV invoiced from a opening balance

When I try to do a payment entry of a JV, the advance does not show up that I have entered as an opening balance. Kindly guide how to apply the opening balance. If I pay the JV-invoice the outstanding balance gets back to the opening balance