Merge pull request #33191 from ruthra-kumar/key_error_in_profit_loss_report
fix: key error while filtering on date range and reporting on foreign currency
This commit is contained in:
commit
c1a82dc9e5
@ -160,5 +160,6 @@ def auto_create_fiscal_year():
|
||||
|
||||
|
||||
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)
|
||||
|
@ -28,7 +28,7 @@ def get_currency(filters):
|
||||
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"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user