Hi
Paying an invoice and creating an invoice are two separate things. I thought that OP is talking about creating invoice. Paying invoice is normal process and it happens. Even if customer has returned material without paying invoice what would be the issue in raising credit note. It will reduce the AR and there will be no payment involved. Just an accounting entry and its reversal.
Thank$