Merge pull request #33192 from deepeshgarg007/bundle_item_rates
fix: Bundle item rates
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
index 69cfe31..3207e41 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
@@ -160,5 +160,6 @@
def get_from_and_to_date(fiscal_year):
- fields = ["year_start_date as from_date", "year_end_date as to_date"]
- return frappe.get_cached_value("Fiscal Year", fiscal_year, fields, as_dict=1)
+ fields = ["year_start_date", "year_end_date"]
+ cached_results = frappe.get_cached_value("Fiscal Year", fiscal_year, fields, as_dict=1)
+ return dict(from_date=cached_results.year_start_date, to_date=cached_results.year_end_date)
diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py
index eed5836..d3cd290 100644
--- a/erpnext/accounts/report/utils.py
+++ b/erpnext/accounts/report/utils.py
@@ -28,7 +28,7 @@
filters["presentation_currency"] if filters.get("presentation_currency") else company_currency
)
- report_date = filters.get("to_date")
+ report_date = filters.get("to_date") or filters.get("period_end_date")
if not report_date:
fiscal_year_to_date = get_from_and_to_date(filters.get("to_fiscal_year"))["to_date"]