Please go to the alter>>Voucher type>>Credit note>>Voucher numbering>>Automatic>>Automatic( manual override)>>Prevent duplicate >>Yes.