mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 05:39:12 +00:00
Allow cost center in entry of balance sheet accounts (#14972)
* Allow Cost Center In Entry of Balance Sheet Account * Add parent cost center in get payment entry * Add Tests for Allow Cost Center In Entry of Balance Sheet Account * Add tests for cost center wise account and party balance * set parent cost center in taxes * 1. Remove copy parent cost_center to child 2. Improve update party and account balance functionality on cost_center change 3. Add cost_center filter to get_outstanding_documents * fix Codacy and Travis issue
This commit is contained in:
@@ -154,6 +154,11 @@ def get_conditions(filters):
|
||||
conditions.append("""account in (select name from tabAccount
|
||||
where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
|
||||
|
||||
if filters.get("cost_center"):
|
||||
lft, rgt = frappe.db.get_value("Cost Center", filters["cost_center"], ["lft", "rgt"])
|
||||
conditions.append("""cost_center in (select name from `tabCost Center`
|
||||
where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
|
||||
|
||||
if filters.get("voucher_no"):
|
||||
conditions.append("voucher_no=%(voucher_no)s")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user