From ef08e750bba9703bdaa1e0b7d39efb580e69a540 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Mon, 1 Jan 2018 21:23:32 -0600 Subject: [PATCH] Reportes de Tickets --- source/app/controllers/util.py | 3 +++ source/app/models/main.py | 1 + source/static/js/controller/tickets.js | 9 +++++++-- source/static/js/ui/tickets.js | 8 ++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py index 56dcd6f..51455ef 100644 --- a/source/app/controllers/util.py +++ b/source/app/controllers/util.py @@ -1552,6 +1552,9 @@ def _backup_and_sync(rfc, data): @run_in_thread def _backup_companies(): + if DEBUG: + return + _, filename = os.path.split(COMPANIES) if SEAFILE_SERVER: msg = '\tSincronizando backup RFCs...' diff --git a/source/app/models/main.py b/source/app/models/main.py index 386b752..c10b5fe 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -4069,6 +4069,7 @@ class Tickets(BaseModel): row = { 'id': obj.id, + 'serie': obj.serie, 'folio': obj.folio, 'fecha': obj.fecha, 'estatus': obj.estatus, diff --git a/source/static/js/controller/tickets.js b/source/static/js/controller/tickets.js index 7bf62ea..7176aef 100644 --- a/source/static/js/controller/tickets.js +++ b/source/static/js/controller/tickets.js @@ -701,7 +701,6 @@ function grid_tickets_click(id, e, node){ print_ticket(id.row) return } - } @@ -709,6 +708,8 @@ function cmd_ticket_report_pdf_click(){ webix.toPDF($$('grid_tickets'), { ignore: {'pdf': true, 'print': true}, filename: 'Reporte_Tickets', + width: 612, + height: 792, columns:{ index: true, serie: {width: 50}, @@ -722,5 +723,9 @@ function cmd_ticket_report_pdf_click(){ function cmd_ticket_report_xls_click(){ - + webix.toExcel($$('grid_tickets'), { + filename: 'Reporte_Tickets', + name: 'Tickets', + ignore: {'pdf': true, 'print': true}, + }) } \ No newline at end of file diff --git a/source/static/js/ui/tickets.js b/source/static/js/ui/tickets.js index 336d800..7537c24 100644 --- a/source/static/js/ui/tickets.js +++ b/source/static/js/ui/tickets.js @@ -6,10 +6,10 @@ var toolbar_tickets = [ {view: 'button', id: 'cmd_ticket_to_invoice', label: 'Facturar', type: 'iconButton', autowidth: true, icon: 'file-code-o'}, {}, - {view: 'button', id: 'cmd_ticket_report_pdf', label: 'Reporte [PDF]', - type: 'iconButton', autowidth: true, icon: 'bars'}, - {view: 'button', id: 'cmd_ticket_report_xls', label: 'Reporte [XLS]', - type: 'iconButton', autowidth: true, icon: 'bars'}, + {view: 'button', id: 'cmd_ticket_report_pdf', label: 'Reporte', + type: 'iconButton', autowidth: true, icon: 'file-pdf-o'}, + {view: 'button', id: 'cmd_ticket_report_xls', label: 'Reporte', + type: 'iconButton', autowidth: true, icon: 'table'}, {}, {view: 'button', id: 'cmd_cancelar_ticket', label: 'Cancelar', type: 'iconButton', autowidth: true, icon: 'ban'},