Incorrect Invoice Journal Entry

Incorrect Invoice Journal Entry

The Journal entry in the purchase is not considering the COGS from the bill, the items in the bill and invoices match. It's picking the Sales amount in the inventory and COGS accounts.