COSG entries populated by Credit Notes

COSG entries populated by Credit Notes

Hello! I've come across an issue in COGS amounts based on Credit Notes (CNs) for retail business.

From the communication from Zoho support I learnt that COGS amounts are generated based on FIFO, while CN amounts are derived from the latest bill. To the best of my understanding CN amounts should also be generated using FIFO. Otherwise, this will lead to misstatements.

Let me make an example to what it leads in accounting:
Say we purchased 100 items for $5. And we sold them all to our customer. So we record COGS as 5*100=$500 (Dr).
Then we purchased more of these items, but this time the purchase price was $7.
In several days our customer decided to return all the items he bought from us. So we need to create a CN. 
Based on the current work flow, COGS will be credited for the amount 7*100=$700 (using the rate of $7 from the latest bill).
So, we will have positive financial result (Cr balance of COGS=$200), however all our sales were returned (we actually sold nothing). We made no sales and we have profits in our Financial Statement (PL), which is not true. The Balance Sheet will be misstated as well.

I would suggest developers challenge such approach. What do you think?