diff --git a/frappe/public/js/frappe/views/reports/report_view.js b/frappe/public/js/frappe/views/reports/report_view.js index 2efe2314f5..c7fd865795 100644 --- a/frappe/public/js/frappe/views/reports/report_view.js +++ b/frappe/public/js/frappe/views/reports/report_view.js @@ -1345,15 +1345,81 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView { get_filters_html_for_print() { const filters = this.filter_area.get(); - return filters - .map((f) => { - const [doctype, fieldname, condition, value] = f; - if (condition !== "=") return ""; - const label = frappe.meta.get_label(doctype, fieldname); - const docfield = frappe.meta.get_docfield(doctype, fieldname); - return `
${__(label)}: ${frappe.format(value, docfield)}
`; - }) - .join(""); + return ( + `
${__("Filters:")}
` + + filters + .map((f) => { + const [doctype, fieldname, condition, value] = f; + const docfield = frappe.meta.get_docfield(doctype, fieldname); + const label = `${__(frappe.meta.get_label(doctype, fieldname))}`; + switch (condition) { + case "=": + return __("{0} is equal to {1}", [ + label, + frappe.format(value, docfield), + ]); + case "!=": + return __("{0} is not equal to {1}", [ + __(label), + frappe.format(value, docfield), + ]); + case ">": + return __("{0} is greater than {1}", [ + __(label), + frappe.format(value, docfield), + ]); + case "<": + return __("{0} is less than {1}", [ + __(label), + frappe.format(value, docfield), + ]); + case ">=": + return __("{0} is greater than or equal to {1}", [ + __(label), + frappe.format(value, docfield), + ]); + case "<=": + return __("{0} is less than or equal to {1}", [ + __(label), + frappe.format(value, docfield), + ]); + case "Between": + return __("{0} is between {1} and {2}", [ + __(label), + frappe.format(value[0], docfield), + frappe.format(value[1], docfield), + ]); + case "Timespan": + return __("{0} is within {1}", [__(label), __(value)]); + case "in": + return __("{0} is one of {1}", [ + __(label), + frappe.utils.comma_or( + value.map((v) => frappe.format(v, docfield)) + ), + ]); + case "not in": + return __("{0} is not one of {1}", [ + __(label), + frappe.utils.comma_or( + value.map((v) => frappe.format(v, docfield)) + ), + ]); + case "like": + return __("{0} is like {1}", [__(label), value]); + case "not like": + return __("{0} is not like {1}", [__(label), value]); + case "is": + return value === "set" + ? __("{0} is set", [__(label)]) + : __("{0} is not set", [__(label)]); + default: + return null; + } + }) + .filter(Boolean) + .join("
") + ); } get_columns_totals(data) { diff --git a/frappe/translations/de.csv b/frappe/translations/de.csv index 1c209db604..55ba8c4309 100644 --- a/frappe/translations/de.csv +++ b/frappe/translations/de.csv @@ -4856,3 +4856,18 @@ Minimal,Minimal, This value is fetched from {0}'s {1} field,Dieser Wert ergibt sich aus dem Feld {1} von {0}, This form is not editable due to a Workflow.,Dieses Formular kann in diesem Workflow-Status nicht bearbeitet werden., {0} role does not have permission on any doctype,Die Rolle {0} hat auf keinen DocType Zugriff, +Filters:,Filter:, +{0} is equal to {1},{0} ist gleich {1}, +{0} is not equal to {1},{0} ist ungleich {1}, +{0} is greater than {1},{0} ist größer als {1}, +{0} is less than {1},{0} ist kleiner als {1}, +{0} is greater than or equal to {1},{0} ist größer oder gleich {1}, +{0} is less than or equal to {1},{0} ist kleiner oder gleich {1}, +{0} is between {1} and {2},{0} ist zwischen {1} und {2}, +{0} is within {1},{0} ist innerhalb von {1}, +{0} is one of {1},{0} ist eine von {1}, +{0} is not one of {1},{0} ist keine von {1}, +{0} is like {1},{0} ist wie {1}, +{0} is not like {1},{0} ist nicht wie {1}, +{0} is set,{0} ist eingetragen, +{0} is not set,{0} ist nicht eingetragen,