Skip to content

Commit

Permalink
fix: don't update bin's actual_qty
Browse files Browse the repository at this point in the history
1. it's already updated by repost_current_voucher
2. update if future sle exists
  • Loading branch information
ankush committed Dec 20, 2021
1 parent eec617e commit 1edab32
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions erpnext/stock/doctype/bin/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def update_qty(bin_name, args):
from erpnext.controllers.stock_controller import future_sle_exists

bin_details = get_bin_details(bin_name)
actual_qty = bin_details.actual_qty

if future_sle_exists(args):
actual_qty = frappe.db.get_value("Stock Ledger Entry",
Expand All @@ -153,10 +154,6 @@ def update_qty(bin_name, args):
fieldname="qty_after_transaction",
order_by="posting_date desc, posting_time desc, creation desc",
) or 0.0
elif args.get("voucher_type")=="Stock Reconciliation":
actual_qty = args.get('qty_after_transaction')
else:
actual_qty = bin_details.actual_qty + flt(args.get("actual_qty"))

ordered_qty = flt(bin_details.ordered_qty) + flt(args.get("ordered_qty"))
reserved_qty = flt(bin_details.reserved_qty) + flt(args.get("reserved_qty"))
Expand Down

0 comments on commit 1edab32

Please sign in to comment.