Skip to content

Commit

Permalink
Merge pull request frappe#27001 from frappe/revert-26893-query-report…
Browse files Browse the repository at this point in the history
…-filters

Revert "fix: query report filters"
  • Loading branch information
sagarvora authored Jul 5, 2024
2 parents 55904c3 + 2d69466 commit f737867
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions frappe/public/js/frappe/views/reports/query_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1330,14 +1330,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
raise && this.toggle_message(false);

return this.filters
.filter((f) => {
const filter_value = f.get_value();
if (typeof filter_value === "object") {
return filter_value.length > 0;
} else {
return filter_value;
}
})
.filter((f) => f.get_value())
.map((f) => {
var v = f.get_value();
// hidden fields dont have $input
Expand Down Expand Up @@ -1480,23 +1473,16 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {

get_filters_html_for_print() {
const applied_filters = this.get_filter_values();
const filter_html = Object.keys(applied_filters)
return Object.keys(applied_filters)
.map((fieldname) => {
const docfield = frappe.query_report.get_filter(fieldname).df;
const value = applied_filters[fieldname];
return `<div class="filter-row">
<b>${__(docfield.label, null, docfield.parent)}:</b> ${frappe.format(value, docfield)}
</div>`;
return `<h6>${__(docfield.label, null, docfield.parent)}: ${frappe.format(
value,
docfield
)}</h6>`;
})
.join("");

return `<div>${filter_html}</div>
<style>
.filter-row div {
/* prevent newline + right alignment of number fields */
display: inline-block;
}
</style>`;
}

export_report() {
Expand Down

0 comments on commit f737867

Please sign in to comment.