fix: Share ledger showing cancelled docs (#35993)
diff --git a/erpnext/accounts/report/share_ledger/share_ledger.py b/erpnext/accounts/report/share_ledger/share_ledger.py
index d6c3bd0..629528e 100644
--- a/erpnext/accounts/report/share_ledger/share_ledger.py
+++ b/erpnext/accounts/report/share_ledger/share_ledger.py
@@ -67,8 +67,9 @@
# condition = 'AND company = %(company)s '
return frappe.db.sql(
"""SELECT * FROM `tabShare Transfer`
- WHERE (DATE(date) <= %(date)s AND from_shareholder = %(shareholder)s {condition})
- OR (DATE(date) <= %(date)s AND to_shareholder = %(shareholder)s {condition})
+ WHERE ((DATE(date) <= %(date)s AND from_shareholder = %(shareholder)s {condition})
+ OR (DATE(date) <= %(date)s AND to_shareholder = %(shareholder)s {condition}))
+ AND docstatus = 1
ORDER BY date""".format(
condition=condition
),