Unable to enter manual journal entries in AR/AP.

Unable to enter manual journal entries in AR/AP.

Hi there,
i am facing some problem relating to AR/AP.
I want to make some entries in AR/AP through manual journal.
for example. some time I send cash 500 to Mr. A (Customer) for any purpose and then after 2 or 3 days Mr. A returned back 700 to me and the remaining 200 is my sale (which I want to generate Invoice) to Mr. A
when I open an account of Mr. A in sales section i only can generate 200 Invoice. i can't enter 500 in Mr. A account. I want to make an entry as manual journal  Mr. A  500 Debit  to Cash 500 Credit and then when i received the amount from Mr. A  which manual journal entry will be   Cash 700 Debit  to Mr. A Credit    and 200  show Advance Mr. A Account. when we enter the invoice of 200 the Mr. A account stands 0.

How I can do all these entries in Mr. A (Customer) Account

Kindly help in situation 

Regards