After Purchase return the amount is not credited back to account from which amount is debited while purchasing

while purchasing items worth 1000rs amount is debited from buyer account A and credited to seller account B.
After some time buyer want to return some items worth 500rs.
For purchase return i clicked option purchase return from purchase receipt.
after completing the cycle in account ledger amount is not credited to buyer account and not debited from seller account

Do the purchase return against the Invoice too.