UNlinked Sales Return does not increase the stock Value

Direct Sales Return without linking to an existing invoice does not increase the stock balance resulting in Wrong Valuation rate after return .
.

As of v11 , there are 2 ways to make sales return

  1. Go to a corresponding sales invoice , make return - and submit the sales return .
    Here the sales return is linked to a sales invoice , and all the items are returned , increasing the stock Qty as well as the Stock Balance , here in the stock ledger Incoming rate is there which is the rate(valuation) at which the goods were sold.

The stock balance increases and the valuation is proper after the return .

  1. Direct sales invoice Return - Just go to sales invoice → new → click on is_return and make the return items with qty in negative.
    Here there is no sales invoice linked to the return as the return can be from multiple sales invoices,
    When the return Happens the qty is returned , but there is no incoming value i.e it is 0 .
    Meaning the Stock Balance does not change ,


What this does is , is decrease the valuation rate from the actual valuation rate - Because valuation is total value/ Total stock ,
The stock increased but not the value ,Resulting in wrong valuation rate.

Question:

  1. Is this a Bug or intended ?
    2.How can we solve this to let the incoming rate be the current valuation rate for that warehouse .

Possible Solutions if not a bug

  1. We directly take the current valuation rate of the item in that warehouse and set it as incoming rate for that sales return when the ledgers are passed like the linked invoice.
  2. We Take return Valuation based on LIFO , i.e Customer X brought Item A 3 different times with different rate(COGS at that time) each time buying 5 items ,

Total items purchase by customer in 3 Invoice = 15 .
Then customer comes in and returns 11 pieces , what valuation rate should be considered ?
Based on LIFO , we take first 5 pieces with a rate of invoice 3 , next 5 with rate of invoice 2 and last piece with rate of invoice 1 – the average of those will be the incoming rate , increasing the balance value exactly as per returns , hence after return valuation coming properly.

Currently on V11 .

Please Advice

No one replied to this ,
I was wondering if it was a bug or not,
Looks like it was a bug !!
It was patched with the latest update on v12 .
https://github.com/frappe/erpnext/pull/24618

Did @rohit_w notice my struggles from his clairvoyant powers or some divine force made him notice an issue existing since the time standalone si was introduced ?
we might never know …

anyways it gives me the Fix, Thank you so much .

you may close this post.

1 Like