Przeglądaj źródła

FIX ADD Informes Dental

Sebas 6 lat temu
rodzic
commit
50722c5880
1 zmienionych plików z 10 dodań i 1 usunięć
  1. 10 1
      static/src/js/reports/report_vouchers.js

+ 10 - 1
static/src/js/reports/report_vouchers.js

@@ -232,6 +232,15 @@ function report_vouchers (reporting){
                     out_amount:amount_out
                 });
             });
+            data.sort(function (a, b) {
+                 if (a.date > b.date) {
+                     return -1;
+                 }
+                 if (a.date < b.date) {
+                     return 1;
+                 }
+                 return 0;
+             });
             self.content = data;
             this.loadTable(data);
         },
@@ -266,7 +275,7 @@ function report_vouchers (reporting){
                     return moment(inv.date).format('YYYY-MM') == last_month;
                 });
             }
-            
+
             if ($('#Z').is(":checked")){
                 $('#datepicker').css('display','block');
                 if (desde.length > 0){