Purchase Invoice Cost of Goods Sold Account

Hi with reference to below PR,

https://github.com/frappe/erpnext/pull/15374

@rohit_w can you help to explain, why the change was necessary. why should COGS account be offset in Purchase?

Regards,
Sunny.