1. On the General Ledger distribution tab of the Invoice record, ensure that there is a class selected in the class column.
2. Save and Close the Invoice

OR

1. Create a column for Class in the import file
2. Import the invoices/credit memos