refactor: filter to toggle employee advance scenario in AP

This commit is contained in:
ruthra kumar
2024-09-05 16:12:52 +05:30
parent eedf22b07a
commit 257e13c299
2 changed files with 10 additions and 1 deletions

View File

@@ -162,6 +162,11 @@ frappe.query_reports["Accounts Payable"] = {
label: __("Group by Voucher"),
fieldtype: "Check",
},
{
fieldname: "handle_employee_advances",
label: __("Handle Employee Advances"),
fieldtype: "Check",
},
],
formatter: function (value, row, column, data, default_formatter) {

View File

@@ -214,7 +214,11 @@ class ReceivablePayableReport:
# Build and use a separate row for Employee Advances.
# This allows Payments or Journals made against Emp Advance to be processed.
if not row and ple.against_voucher_type == "Employee Advance":
if (
not row
and ple.against_voucher_type == "Employee Advance"
and self.filters.handle_employee_advances
):
_d = self.build_voucher_dict(ple)
_d.voucher_type = ple.against_voucher_type
_d.voucher_no = ple.against_voucher_no