Description of Issue:
When using the option to credit off the invoice or create a credit memo from the invoice, the item code changes to the same item code for all items.

Resolution:
The issue can be caused by incorrect data in the database.
There is a record in the IN_Part table with a Part_ID of 1. This part record is used for certain default values and should never be edited or deleted.
If this record has something other than Item_ID 1 in the Part record you can see this problem on credit memos created from an invoice.
select * from IN_Part where Part_Id =1

If this is the case, you update the Item_ID to one to stop the issue.
update IN_Part set Item_Id =1 where Part_Id =1