Cancel purchase invoice

I have done a purchase invoice with advance cash payment and
sales invoice with advance cash received.
both transactions are cancelled.
how do I record the entries for all involved a/c’s (cash, sales, cost of sales, a/c receivable and payable?

The answer depends on what really happened:

  1. If you entered these transactions only in anticipation of what you thought would happen or as test cases, but nothing actually happened, delete them all. You will have to delete the cash transactions first so Manager will let you delete the purchase and sales invoices. But do this only if nothing was sent to any customer and the monetary transactions did not really occur.

  2. If things actually happened, use debit and credit notes to reverse them. Spend or Receive Money from the cash accounts according to what you do to set things right.

In either case, Accounts receivable and Accounts payable will be taken care of automatically.