浏览代码

bugfix, title when printing datatable

jose miguel 7 年之前
父节点
当前提交
07d2d7e8c4
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 4 2
      app/views/reports/min_max.html.erb
  2. 1 1
      app/views/sales/index.html.erb

+ 4 - 2
app/views/reports/min_max.html.erb

@@ -59,7 +59,7 @@
             </div>
             <div class="portlet-body ">
               <div id="error_explanation"></div>
-              <%= hidden_field_tag 'title_for_print', "Reporte de mínimos y máximos por punto de venta" %>
+              <%= hidden_field_tag 'title_for_print' %>
               <!-- lista de productos -->
               <table class="table table-hover table-bordered table-striped tableadvancedprintable" id="minmax_table">
                 <thead>
@@ -106,10 +106,12 @@
 </div>
 
 <script type="text/javascript">
-  $(document).ready(function(){
+  $(document).on("page:change", function() {
     $('#total_prods').html(accounting.formatMoney($("#total").val()) + ' MXN');
+    $('#title_for_print').val('Reporte de mínimos y máximos por punto de venta');
   });
 
+
   function applyFilter() {
     $("#minmax_form").submit();
   }

+ 1 - 1
app/views/sales/index.html.erb

@@ -175,6 +175,7 @@
     var startDate = moment($("#start").data("date"), "DD-MM-YYYY").format('DD/MM/YYYY');
     var endDate = moment($("#end").data("date"), "DD-MM-YYYY").format('DD/MM/YYYY');
     $('#title_for_print').val('Ventas del ' + startDate + ' al ' + endDate);
+  });
 
 
     $.fn.dataTableExt.oStdClasses.sFilterInput = "form-control input-medium input-inline";
@@ -253,7 +254,6 @@
         "pageLength": 20,
         "bServerSide": false
     });
-  });
 
   function salesByDate() {
     if ($("#start").val() && $("#end").val()) {