|
|
@@ -76,7 +76,7 @@
|
|
|
</div>
|
|
|
<input type='hidden' name='filter' id='filter' value='<%= @filter %>' >
|
|
|
<input type='hidden' name='current_page' id='current_page' value='<%= @current_page %>' >
|
|
|
- <table class="table table-striped table-bordered table-hover tableadvancedprintable" id="reserved_sales_table">
|
|
|
+ <table class="table table-striped table-bordered table-hover" id="reserved_sales_table">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>#</th>
|
|
|
@@ -163,6 +163,18 @@
|
|
|
<!-- END CONTENT -->
|
|
|
</div>
|
|
|
<script>
|
|
|
+ var closePrintView = function(e) {
|
|
|
+ if(e.which == 27) {
|
|
|
+ printViewClosed();
|
|
|
+ $('.hide_c').removeClass("hidden");
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ function printViewClosed() {
|
|
|
+ $("#reserved_sales_table").dataTable().fnSetColumnVis('.hide_c', true);
|
|
|
+ $(window).unbind('keyup', closePrintView);
|
|
|
+ }
|
|
|
+
|
|
|
$(document).on("page:change", function() {
|
|
|
App.init();
|
|
|
$('#start').datetimepicker({
|
|
|
@@ -182,6 +194,83 @@
|
|
|
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";
|
|
|
+
|
|
|
+ $.extend(true, $.fn.DataTable.TableTools.classes, {
|
|
|
+ "container": " pull-right margin-bottom-10",
|
|
|
+ "buttons": {
|
|
|
+ "normal": "btn btn-primary margin-right-10",
|
|
|
+ "disabled": "disabled"
|
|
|
+ },
|
|
|
+ "collection": {
|
|
|
+ "container": "DTTT_dropdown dropdown-menu tabletools-dropdown-menu "
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var table = $('#reserved_sales_table').dataTable({
|
|
|
+ // T = tabletools; l = length changing; f = filtering input; t = table; i = table info; p = pagination
|
|
|
+ "dom": "<'row' <'col-md-12'T>><'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f><'col-md-6 col-sm-12'>r><'table-scrollable't><'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'p>>",
|
|
|
+ "tableTools": {
|
|
|
+ "aButtons": [{ // 1
|
|
|
+ "sExtends": "collection",
|
|
|
+ "sButtonText": "Acciones",
|
|
|
+ "aButtons": [ // 2
|
|
|
+ { "sExtends": "print",
|
|
|
+ // "columnDefs": [{
|
|
|
+ // "targets": 'hide_c',
|
|
|
+ // "visible": false
|
|
|
+ // }],
|
|
|
+ "sButtonText": "Imprimir",
|
|
|
+ "sInfo": 'Presiona "CTR+P" para imprmir o "ESC" para salir',
|
|
|
+ "sMessage": function() {
|
|
|
+ return "<h2>Lista de ventas desde el " + $("#start").val() + " al " + $("#end").val() + "</h2>";
|
|
|
+ },
|
|
|
+ "fnClick": function(nButton, oConfig) {
|
|
|
+ table.fnSetColumnVis('.hide_c', false);
|
|
|
+ $(window).keyup(closePrintView);
|
|
|
+ this.fnPrint(true, oConfig);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // { "sExtends": "pdf",
|
|
|
+ // "sPdfOrientation": "landscape",
|
|
|
+ // "columnDefs": [{
|
|
|
+ // "targets": 'hide_c',
|
|
|
+ // "visible": false
|
|
|
+ // }],
|
|
|
+ // "sButtonText": "PDF"
|
|
|
+ // }
|
|
|
+ ] // 2
|
|
|
+ }] // 1
|
|
|
+ },
|
|
|
+ "fixedHeader": true,
|
|
|
+ "language": {
|
|
|
+ "aria": {
|
|
|
+ "sortAscending": ": activate to sort column ascending",
|
|
|
+ "sortDescending": ": activate to sort column descending"
|
|
|
+ },
|
|
|
+ "emptyTable": "No hay informacion en la tabla",
|
|
|
+ "info": "Mostrando del _START_ al _END_ de _TOTAL_ registros",
|
|
|
+ "infoEmpty": "No se encontraron coincidencias",
|
|
|
+ "infoFiltered": "(filtrado un total de _MAX_ registros)",
|
|
|
+ "lengthMenu": "Mostrar _MENU_ registros",
|
|
|
+ "search": "Buscar:",
|
|
|
+ "zeroRecords": "No se encontraron coincidencias",
|
|
|
+ "paginate": {
|
|
|
+ "sPrevious": "Ant",
|
|
|
+ "sNext": "Sig"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "order": [
|
|
|
+ // [0, 'asc']
|
|
|
+ ],
|
|
|
+ "lengthMenu": [
|
|
|
+ [20, 50, 75, 100, -1],
|
|
|
+ [20, 50, 75, 100, "Todos"] // change per page values here
|
|
|
+ ],
|
|
|
+ "pageLength": 20,
|
|
|
+ "bServerSide": false
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
function salesByDate() {
|