NOTE: Try this only in Test Order it may delete your order number from sales > order Grid
in app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php this file
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if ($this->_useIncrementId && !$object->getIncrementId()) {
/* @var $entityType Mage_Eav_Model_Entity_Type */
$entityType = Mage::getModel('eav/entity_type')->loadByCode($this->_entityTypeForIncrementId);
$object->setIncrementId($entityType->fetchNewIncrementId($object->getStoreId()));
}
parent::_beforeSave($object);
return $this;
}
from above code. Put below two lines outside IF condition and then try to generate credit memo it will works.
$entityType = Mage::getModel('eav/entity_type')->loadByCode($this->_entityTypeForIncrementId);
$object->setIncrementId($entityType->fetchNewIncrementId($object->getStoreId()));
then reward changes.
Keep in Mind this is needed only for one record; Next onward it will start working