When an item is sold out the remaining. The book value of the item must be recognized as an expense in the period that includes the relevant revenue recognition.
When inventories are sold out. The book value of the products must be recognized as an expense in the period in which the related revenue is recognized.