frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
17.41k stars 6.65k forks source link

Issue when working with Batch (Stock Ledger not calculating Opening Balance) #41521

Closed ablashek closed 3 weeks ago

ablashek commented 1 month ago
          > You have to see all the transactions in that batch because somewhere in the transaction entries in that batch you have made a wrong entry. So comes this issue. If the opening data is entered, check if it is proper or not, otherwise, check the batch-wise balance history report. You have to view all transactions in the stock ledger, for that batch. The problem is not with the amount but with the quantity, which is showing as negative.

You should check the screenshots attached. Many of the comments you pass has already been checked. When I said amount, I mean amount of units ... should have used the word quantity to be more inline with ERPNext lingo.

If you see the image The item has an opening balance of 172,800 units for that time period. The very next row is a deduction (out quantity) of 28,250 units. This should obviously lead to the a balance of (172,800 - 28,250 =) 144,550 units ... but the stock ledger is bringing up -28,250. It's like the balance is not taking into account the opening balance for that period.

This is a BUG, plain and simple.

And if you see my third screenshot image You will see that I cannot transact the quantity of 144,250 units because i have a negative stock of -28,250. Basically the system understands that for that BATCH, that WAREHOUSE, and that ITEM we should have a stock of 144,250 but when calculating within the year the opening balance which shows up isn't being taken into account.

And finally this forum should avoid closing bugs without first understanding what the problem is. My intention of posting is to help other users now and in the future. I've worked out this problem and it doesn't seem like a configuration issue ... plain and simple looks like to be a bug that wasn't there before.

Originally posted by @ablashek in https://github.com/frappe/erpnext/issues/41507#issuecomment-2117312002

Nihantra-Patel commented 3 weeks ago

Same issue: #41580

Close for now!