COGS on P&L after Creating Sales Receipt

COGS on P&L after Creating Sales Receipt

After I create a sales receipt, I want to have associated COGS (I specified the unit cost when I created the items) to be reflected on the P&L. Is there a way to do this? I understand this only works when we create invoice, not sales receipt