fix: Usability fixes in accounting dimensions

This commit is contained in:
deepeshgarg007
2019-07-14 18:15:19 +05:30
parent 5ea542b08b
commit a85db66146
9 changed files with 744 additions and 2380 deletions

View File

@@ -33,3 +33,14 @@ frappe.query_reports["Customer Credit Balance"] = {
},
]
}
erpnext.dimension_filters.then((dimensions) => {
dimensions.forEach((dimension) => {
frappe.query_reports["Customer Credit Balance"].filters.push({
"fieldname": dimension["fieldname"],
"label": __(dimension["label"]),
"fieldtype": "Link",
"options": dimension["document_type"]
});
});
});

View File

@@ -6,6 +6,7 @@ import frappe
from frappe import _
from frappe.utils import flt
from erpnext.selling.doctype.customer.customer import get_customer_outstanding, get_credit_limit
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
def execute(filters=None):
if not filters: filters = {}
@@ -13,6 +14,12 @@ def execute(filters=None):
customer_naming_type = frappe.db.get_value("Selling Settings", None, "cust_master_name")
columns = get_columns(customer_naming_type)
accounting_dimensions = get_accounting_dimensions()
if accounting_dimensions:
for dimension in accounting_dimensions:
additional_conditions += """ and {0} in (%({0})s) """.format(dimension)
data = []
customer_list = get_details(filters)