@sunilmanjunath, I’ve moved your post to a new topic, because it had nothing to do with the topic where you posted it. The other person’s question was totally unrelated.
Your issue is definitely explained by timing of invoices versus receipts. You have issued additional invoices before you entered payments of prior invoices made by the customer. You don’t say how you allocated those payments. But, like @brucanna, I conclude you did it without specifying which invoices the receipts covered. Break your receipts into multiple line items for the invoices covered and all should be well. Overall, your
Accounts receivable balance for this customer is correct.