Return to Supplier COGS Affected?

Hello everyone,
I wanted to get your thoughts on a behaviour I noticed in ERPNext when handling return to supplier entries. Here is the scenario:

  1. We receive a shipment from supplier, there are many costs associated with this such as local shipping, customs, and freight charges. So, we use Landed Cost voucher to add the costs associated to the item’s valuation.

  2. A few weeks later we notice some defects in some of the products. We reach out to our supplier, and they issue a credit note. However, supplier doesn’t care about our extra cost on the product and only issue a credit for the amount they invoiced. Therefor, the difference between the amount credited and the item valuation (I believe) becomes an expense to the company.

  3. Purchase Invoice (Debit Note) against the supplier for the credit not supplier issued. (Update Stock is checked)

Expected Behaviour:

The amount credited from supplier is transferred from Stock account to supplier accounts payable account.

The difference between the amount credited from supplier and item valuation would be booked as some expense for the company. Possibly “Expenses Included in Valuation”

Observed Behaviour:

The difference between valuation rate and suppliers credit note is booked against “Cost of Goods Sold” I don’t know why; I suspect this is a bug. Why would it book against such an account when the goods haven’t been sold?

I’ve found a similar behaviour in the past doing a different flow:

Does anyone have any experience why the valuation difference books against COGS?

1 Like

Hmm…this is tricky. I’m definitely not an accountant, so I’m not very confident about how this is supposed to work.

I don’t think Expenses Included in Valuation is the right account. That’s used, if I’m not mistaken, to reconcile an increase in stock valuation (due to things like landed cost vouchers) against supplier invoices. Here, you’d want to be treating it as a genuine expense.

I’ve done some further digging.

Interestingly this is the expected outcome based on this test case for purchase invoice:

What is strange is ERPNext uses the “Expenses Included in Valuation” when the exact same is done via Purchase Receipt. See example:

Purchase Receipt:

Purchase Invoice:

So why is Purchase Invoice with “Update Stock” checked making a different transaction than Purchase Receipt is?