Cost of Goods Sold (COGS) account is sometimes posted on an Item Fulfillment, sometimes it is being posted on the Invoice.
COGS is recognized on the Item Fulfillment once created from Sales Orders. This is true because upon fulfillment, the inventory item is now delivered where the value of said items will be reduced at the same time; hence the credit entry against Inventory Asset. Note that since the actual delivery of goods happened on the Item Fulfillment, no COGS will be recorded once the same Sales Order is Invoiced.
However, COGS will be recognized on Invoices if a standalone Invoice is created, meaning the Invoice is created directly instead of coming from a Sales Order. This is based on the fact that a standalone invoice acts like a Cash Sale - where the fulfillment of the item and recognition of sales occur at the same time.