feat: Against voucher filter in General Ledger (#39100)
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
index 4cb443c..79b5e4d 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -53,6 +53,11 @@
}
},
{
+ "fieldname":"against_voucher_no",
+ "label": __("Against Voucher No"),
+ "fieldtype": "Data",
+ },
+ {
"fieldtype": "Break",
},
{
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index 4054dca..6636b8e 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -238,6 +238,9 @@
if filters.get("voucher_no"):
conditions.append("voucher_no=%(voucher_no)s")
+ if filters.get("against_voucher_no"):
+ conditions.append("against_voucher=%(against_voucher_no)s")
+
if filters.get("voucher_no_not_in"):
conditions.append("voucher_no not in %(voucher_no_not_in)s")
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 13df9d5..de7a7f9 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -933,6 +933,12 @@
}
)
+ if not args.get("against_voucher_type") and self.get("against_voucher_type"):
+ gl_dict.update({"against_voucher_type": self.get("against_voucher_type")})
+
+ if not args.get("against_voucher") and self.get("against_voucher"):
+ gl_dict.update({"against_voucher": self.get("against_voucher")})
+
return gl_dict
def get_voucher_subtype(self):