mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 10:45:29 +00:00
fix: retain date filter when redirecting in Profit and Loss report
(cherry picked from commit bb29fc4c3d)
This commit is contained in:
@@ -114,16 +114,17 @@ erpnext.financial_statements = {
|
|||||||
onload: function (report) {
|
onload: function (report) {
|
||||||
// dropdown for links to other financial statements
|
// dropdown for links to other financial statements
|
||||||
erpnext.financial_statements.filters = get_filters();
|
erpnext.financial_statements.filters = get_filters();
|
||||||
|
var filters = report.get_values();
|
||||||
|
|
||||||
let fiscal_year = erpnext.utils.get_fiscal_year(frappe.datetime.get_today());
|
if (!filters.period_start_date || !filters.period_end_date) {
|
||||||
|
frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
|
||||||
frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) {
|
var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
|
||||||
var fy = frappe.model.get_doc("Fiscal Year", fiscal_year);
|
frappe.query_report.set_filter_value({
|
||||||
frappe.query_report.set_filter_value({
|
period_start_date: fy.year_start_date,
|
||||||
period_start_date: fy.year_start_date,
|
period_end_date: fy.year_end_date,
|
||||||
period_end_date: fy.year_end_date,
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
if (report.page) {
|
if (report.page) {
|
||||||
const views_menu = report.page.add_custom_button_group(__("Financial Statements"));
|
const views_menu = report.page.add_custom_button_group(__("Financial Statements"));
|
||||||
|
|||||||
Reference in New Issue
Block a user