fix: incorrect amount of serial_nos fetched
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index c4a0497..b131125 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -104,7 +104,7 @@
serial_nos = last_entry.get("serial_no")
if (serial_nos and
- len(get_serial_nos_data(serial_nos)) < last_entry.qty_after_transaction):
+ len(get_serial_nos_data(serial_nos)) <= last_entry.qty_after_transaction):
serial_nos = get_serial_nos_data_after_transactions(args)
return ((last_entry.qty_after_transaction, last_entry.valuation_rate, serial_nos)
@@ -121,6 +121,7 @@
WHERE
item_code = %(item_code)s and warehouse = %(warehouse)s
and timestamp(posting_date, posting_time) < timestamp(%(posting_date)s, %(posting_time)s)
+ and is_cancelled = 0
order by posting_date, posting_time asc """, args, as_dict=1)
for d in data: