forked from elmau/empresa-libre
Opción para abrir el PDF al timbrar
This commit is contained in:
parent
5ab7df2fd8
commit
e39e4c5585
|
@ -391,7 +391,7 @@ class AppDocumentos(object):
|
|||
session = req.env['beaker.session']
|
||||
req.context['result'], file_name, content_type = \
|
||||
self._db.get_doc(type_doc, id_doc, session['rfc'])
|
||||
resp.append_header('Content-Disposition',
|
||||
'attachment; filename={}'.format(file_name))
|
||||
# ~ resp.append_header('Content-Disposition',
|
||||
# ~ 'attachment; filename={}'.format(file_name))
|
||||
resp.content_type = content_type
|
||||
resp.status = falcon.HTTP_200
|
||||
|
|
|
@ -129,15 +129,13 @@ def config_timbrar():
|
|||
except IndexError:
|
||||
return {'cfdi_donativo': False}
|
||||
|
||||
mp = not util.get_bool(Configuracion.get_('chk_config_ocultar_metodo_pago'))
|
||||
cp = not util.get_bool(
|
||||
Configuracion.get_('chk_config_ocultar_condiciones_pago'))
|
||||
conf = {
|
||||
'cfdi_donativo': obj.es_ong,
|
||||
'cfdi_anticipo': Configuracion.get_('chk_config_anticipo'),
|
||||
'cfdi_ine': Configuracion.get_('chk_config_ine'),
|
||||
'cfdi_metodo_pago': mp,
|
||||
'cfdi_condicion_pago': cp,
|
||||
'cfdi_ine': Configuracion.get_bool('chk_config_ine'),
|
||||
'cfdi_metodo_pago': Configuracion.get_bool('chk_config_ocultar_metodo_pago'),
|
||||
'cfdi_condicion_pago': Configuracion.get_bool('chk_config_ocultar_condiciones_pago'),
|
||||
'cfdi_open_pdf': Configuracion.get_bool('chk_config_open_pdf'),
|
||||
}
|
||||
|
||||
return conf
|
||||
|
@ -217,6 +215,7 @@ class Configuracion(BaseModel):
|
|||
'chk_config_ocultar_metodo_pago',
|
||||
'chk_config_ocultar_condiciones_pago',
|
||||
'chk_config_send_zip',
|
||||
'chk_config_open_pdf',
|
||||
'chk_config_anticipo',
|
||||
'chk_config_cuenta_predial',
|
||||
'chk_config_codigo_barras',
|
||||
|
@ -234,6 +233,7 @@ class Configuracion(BaseModel):
|
|||
'chk_config_ocultar_condiciones_pago',
|
||||
'chk_config_anticipo',
|
||||
'chk_config_ine',
|
||||
'chk_config_open_pdf',
|
||||
)
|
||||
data = (Configuracion
|
||||
.select()
|
||||
|
|
|
@ -53,6 +53,7 @@ var controllers = {
|
|||
$$('chk_config_ocultar_metodo_pago').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_config_ocultar_condiciones_pago').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_config_send_zip').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_config_open_pdf').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_config_ine').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_config_cuenta_predial').attachEvent('onItemClick', chk_config_item_click)
|
||||
|
|
|
@ -5,6 +5,7 @@ var result = false
|
|||
var tipo_relacion = ''
|
||||
var anticipo = false
|
||||
var donativo = false
|
||||
var cfg_invoice = new Object()
|
||||
|
||||
|
||||
var invoices_controllers = {
|
||||
|
@ -122,11 +123,12 @@ function default_config(){
|
|||
show('chk_cfdi_donativo', values.cfdi_donativo)
|
||||
show('lst_metodo_pago', values.cfdi_metodo_pago)
|
||||
show('txt_condicion_pago', values.cfdi_condicion_pago)
|
||||
if(!values.cfdi_ine || values.cfdi_ine == '0'){
|
||||
if(!values.cfdi_ine){
|
||||
$$('tv_invoice').getTabbar().hideOption('INE')
|
||||
}else{
|
||||
$$('tv_invoice').getTabbar().showOption('INE')
|
||||
}
|
||||
cfg_invoice['open_pdf'] = values.cfdi_open_pdf
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -393,6 +395,9 @@ function send_timbrar(id){
|
|||
//~ generar_anticipo_egreso(id)
|
||||
//~ show('Generar egreso de anticipo')
|
||||
}
|
||||
if(cfg_invoice.open_pdf){
|
||||
get_pdf(id)
|
||||
}
|
||||
}else{
|
||||
webix.alert({
|
||||
title: 'Error al Timbrar',
|
||||
|
@ -1037,13 +1042,19 @@ function enviar_correo(row){
|
|||
}
|
||||
|
||||
|
||||
function get_pdf(id){
|
||||
//~ location = '/doc/pdf/' + id
|
||||
window.open('/doc/pdf/' + id, '_blank')
|
||||
}
|
||||
|
||||
|
||||
function grid_invoices_click(id, e, node){
|
||||
var row = this.getItem(id)
|
||||
|
||||
if(id.column == 'xml'){
|
||||
location = '/doc/xml/' + row.id
|
||||
}else if(id.column == 'pdf'){
|
||||
location = '/doc/pdf/' + row.id
|
||||
get_pdf(row.id)
|
||||
}else if(id.column == 'zip'){
|
||||
location = '/doc/zip/' + row.id
|
||||
}else if(id.column == 'email'){
|
||||
|
|
|
@ -499,6 +499,8 @@ var options_admin_otros = [
|
|||
labelRight: 'Ocultar condiciones de pago'},
|
||||
{view: 'checkbox', id: 'chk_config_send_zip', labelWidth: 0,
|
||||
labelRight: 'Enviar factura en ZIP'},
|
||||
{view: 'checkbox', id: 'chk_config_open_pdf', labelWidth: 0,
|
||||
labelRight: 'Abrir PDF al timbrar'},
|
||||
]},
|
||||
{maxHeight: 20},
|
||||
{template: 'Ayudas varias', type: 'section'},
|
||||
|
|
Loading…
Reference in New Issue