Przeglądaj źródła

If sort by field is missing, don't add it to order by

version-14
Anand Doshi 10 lat temu
rodzic
commit
09f687223b
1 zmienionych plików z 9 dodań i 5 usunięć
  1. +9
    -5
      frappe/public/js/frappe/views/reports/reportview.js

+ 9
- 5
frappe/public/js/frappe/views/reports/reportview.js Wyświetl plik

@@ -187,17 +187,21 @@ frappe.views.ReportView = frappe.ui.Listing.extend({
},

get_order_by: function() {
var order_by = [];

// first
var order_by = this.get_selected_table_and_column(this.sort_by_select)
+ ' ' + this.sort_order_select.val();
var sort_by_select = this.get_selected_table_and_column(this.sort_by_select);
if (sort_by_select) {
order_by.push(sort_by_select + " " + this.sort_order_select.val());
}

// second
if(this.sort_by_next_select.val()) {
order_by += ', ' + this.get_selected_table_and_column(this.sort_by_next_select)
+ ' ' + this.sort_order_next_select.val();
order_by.push(this.get_selected_table_and_column(this.sort_by_next_select)
+ ' ' + this.sort_order_next_select.val());
}

return order_by;
return order_by.join(", ");
},

get_selected_table_and_column: function(select) {


Ładowanie…
Anuluj
Zapisz