Landed Cost Voucher - NegativeStockError validation

Is it a good idea to allow_negative_stock=True in L127 here?

My naive assumption is that Landed Cost Voucher is not making any any changes to the stock qty, so it might be okay to skip the validation here.

https://github.com/frappe/erpnext/blob/926150bccbf1d93bacebcf36dc33a3d116173138/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py#L119-L128

Can anyone look into this ?
@rohit_w @nabinhait

Please advice. It will be helpful for us.

Created an issue with a solution. Hope ERPnext Team can look into it.
https://github.com/frappe/erpnext/issues/19551

Thanks.

@nabinhait firstly apologies for tagging you directly. But I believe that you need to know of this issue.

Currently ERPNEXT validates availability of the stock while making LCV. The reality is that many times stock is received and sold before user is able to make LCV or has got transportation and other invoice to make LCV.

We usually do what @sunhowwhas stated above to make LCV after stock has already been sold. But issue comes up when we want to update the system to latest version. We have to first fix it an then update the server. Frankly it doesn’t serve any purpose of available stock validation and is not inline with actual business practice.

2nd issue is that no journal entry is shown after making LCV. At backend we know that Expenses included in stock valuation is credited. But where does the DR happen? When LCV related invoice is to be paid we DR Expenses included in stock valuation and credit bank/cash account.

These are two main factors to get correct valuation rate and to make financial entries to close the loop.

The commenting out LCV field can be done quickly and added to next week release. The JV part can also be looked at and maybe updated for very near future release. FYI in live environment the commenting of the validation field is working absolutely well in multiple installation. Hence our suggestions are based on practical usage.

Thank you for your support.

1 Like

The issue has already been fixed via fix: while submitting landed cost voucher user getting negative stock… by rohitwaghchaure · Pull Request #19269 · frappe/erpnext · GitHub

https://erpnext.com/docs/user/manual/en/stock/landed-cost-voucher#32-what-happens-on-submission

In the latest release, on submission of LCV, system debits ‘Stock Account’ and credit selected expense account (e.g. Transport charges) in LCV. Basically, it adds extra cost to linked Purchase Receipt and reposts GL for that Purchase Receipt. And then the system reposts all future stock transactions linked to related items.

When transporter (or any other supplier) sends bill, we book Purchase Invoice for that and payment entry will be created against the invoice.

1 Like

Hi,
In the same context, could you look into this point and confirm whether it is a bug or not?

Thx

Thank you @nabinhait. I guess all this is in V12. We have the latest V11 and it doesn’t show up there.

Yes, I tried it in V12.

Created a PR with the same changes for v11

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