Uh, excuse me but that is totally wrong. Inventory and/or receivables previously written off would be offset against the same contra account used to write them off.
For example, if originally booked as bad debt expense, any subsequent collection would be offset against bad debt expense (or cost of goods sold) and/or the allowance for bad debt balance sheet account.
NEVER BOOKED AS A GAIN when previously written off.