mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
fix: correct query of fetching budget records
This commit is contained in:
@@ -58,8 +58,7 @@ def fetch_budget_accounts(filters):
|
|||||||
b.company = %s
|
b.company = %s
|
||||||
AND b.docstatus = 1
|
AND b.docstatus = 1
|
||||||
AND b.budget_against = %s
|
AND b.budget_against = %s
|
||||||
AND %s BETWEEN b.from_fiscal_year AND b.to_fiscal_year
|
AND (%s BETWEEN b.from_fiscal_year AND b.to_fiscal_year OR %s BETWEEN b.from_fiscal_year AND b.to_fiscal_year)
|
||||||
AND %s BETWEEN b.from_fiscal_year AND b.to_fiscal_year
|
|
||||||
""",
|
""",
|
||||||
(filters.company, filters.budget_against, filters.from_fiscal_year, filters.to_fiscal_year),
|
(filters.company, filters.budget_against, filters.from_fiscal_year, filters.to_fiscal_year),
|
||||||
as_dict=True,
|
as_dict=True,
|
||||||
@@ -86,7 +85,6 @@ def build_budget_map(budget_records, filters):
|
|||||||
"actual": 0,
|
"actual": 0,
|
||||||
}
|
}
|
||||||
for ad in actual_amt.get(budget.account, []):
|
for ad in actual_amt.get(budget.account, []):
|
||||||
print("AD RECORD", ad, "\n\n\n")
|
|
||||||
if ad.month_name == month and ad.fiscal_year == fiscal_year:
|
if ad.month_name == month and ad.fiscal_year == fiscal_year:
|
||||||
budget_map[budget.dimension][budget.account][fiscal_year][month]["actual"] += flt(
|
budget_map[budget.dimension][budget.account][fiscal_year][month]["actual"] += flt(
|
||||||
ad.debit
|
ad.debit
|
||||||
|
|||||||
Reference in New Issue
Block a user