Using same filter for Sales Person from Accounts Receivable

Added Customer/Supplier Ledger Summary in Accounts Module page
This commit is contained in:
Saif Ur Rehman 2018-12-12 15:46:50 +05:00
parent b07d108bee
commit b53231595d
2 changed files with 38 additions and 21 deletions

View File

@ -194,9 +194,14 @@ class PartyLedgerSummaryReport(object):
lft, rgt = frappe.db.get_value("Sales Person",
self.filters.get("sales_person"), ["lft", "rgt"])
conditions.append("""party in (select parent from `tabSales Team`
where parenttype = 'Customer' and exists(select name from `tabSales Person`
where lft >= {0} and rgt <= {1} and name=`tabSales Team`.sales_person))""".format(lft, rgt))
conditions.append("""exists(select name from `tabSales Team` steam where
steam.sales_person in (select name from `tabSales Person` where lft >= {0} and rgt <= {1})
and ((steam.parent = voucher_no and steam.parenttype = voucher_type)
or (steam.parent = against_voucher and steam.parenttype = against_voucher_type)
or (steam.parent = party and steam.parenttype = 'Customer')))""".format(lft, rgt))
#conditions.append("""party in (select parent from `tabSales Team`
# where parenttype = 'Customer' and exists(select name from `tabSales Person`
# where lft >= {0} and rgt <= {1} and name=`tabSales Team`.sales_person))""".format(lft, rgt))
if self.filters.party_type == "Supplier":
if self.filters.get("supplier_group"):

View File

@ -351,6 +351,36 @@ def get_data():
"is_query_report": True,
"doctype": "Sales Invoice"
},
{
"type": "report",
"name": "Item-wise Sales Register",
"is_query_report": True,
"doctype": "Sales Invoice"
},
{
"type": "report",
"name": "Item-wise Purchase Register",
"is_query_report": True,
"doctype": "Purchase Invoice"
},
{
"type": "report",
"name": "Profitability Analysis",
"doctype": "GL Entry",
"is_query_report": True,
},
{
"type": "report",
"name": "Customer Ledger Summary",
"doctype": "Sales Invoice",
"is_query_report": True,
},
{
"type": "report",
"name": "Supplier Ledger Summary",
"doctype": "Sales Invoice",
"is_query_report": True,
}
]
},
{
@ -363,12 +393,6 @@ def get_data():
"doctype": "GL Entry",
"is_query_report": True,
},
{
"type": "report",
"name": "Profitability Analysis",
"doctype": "GL Entry",
"is_query_report": True,
},
{
"type": "report",
"name": "Payment Period Based On Invoice Date",
@ -381,18 +405,6 @@ def get_data():
"is_query_report": True,
"doctype": "Sales Invoice"
},
{
"type": "report",
"name": "Item-wise Sales Register",
"is_query_report": True,
"doctype": "Sales Invoice"
},
{
"type": "report",
"name": "Item-wise Purchase Register",
"is_query_report": True,
"doctype": "Purchase Invoice"
},
{
"type": "report",
"name": "Accounts Receivable Summary",