Merge branch 'develop'

Personalizar plantilla para factura de pago
This commit is contained in:
Mauricio Baeza 2018-09-10 23:08:38 -05:00
commit b0de7655cc
8 changed files with 98 additions and 10 deletions

View File

@ -1,3 +1,10 @@
v 1.14.0 [10-sep-2018]
----------------------
- Personalizar plantilla para factura de pago
- Fix - Mostrar serie y folio capturado para factura de pago
- Fix - Agregar nueva cuenta de banco
v 1.13.0 [10-sep-2018]
----------------------
- Cancelar factura de pago
@ -14,6 +21,7 @@ python main.py -bk
python main.py -m
```
v 1.12.0 [31-ago-2018]
----------------------
- Soporte para facturas (complemento) de pago.

View File

@ -1 +1 @@
1.13.0
1.14.0

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# ~ Empresa Libre
# ~ Copyright (C) 2018 Mauricio Baeza Servin (web@correolibre.net)
# ~ Copyright (C) 2016-2018 Mauricio Baeza Servin (web@correolibre.net)
# ~
# ~ This program is free software: you can redistribute it and/or modify
# ~ it under the terms of the GNU General Public License as published by
@ -16,7 +16,6 @@
# ~ You should have received a copy of the GNU General Public License
# ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
import getpass
import hashlib
@ -1551,7 +1550,8 @@ def to_pdf(data, emisor_rfc, ods=False):
pagos = ''
if data.get('pagos', False):
pagos = '_pagos_'
version = '1.0'
pagos = 'pagos_'
if APP_LIBO:
app = LIBO()
@ -2141,6 +2141,15 @@ def upload_file(rfc, opt, file_obj):
name = '{}_1.2_3.3.ods'.format(rfc.lower())
path = _join(PATH_MEDIA, 'templates', name)
elif opt == 'txt_plantilla_pagos10':
tmp = file_obj.filename.split('.')
ext = tmp[-1].lower()
if ext != 'ods':
msg = 'Extensión de archivo incorrecta, selecciona un archivo ODS'
return {'status': 'server', 'name': msg, 'ok': False}
name = '{}_pagos_1.0.ods'.format(rfc.lower())
path = _join(PATH_MEDIA, 'templates', name)
elif opt == 'bdfl':
tmp = file_obj.filename.split('.')
ext = tmp[-1].lower()

View File

@ -1,5 +1,21 @@
#!/usr/bin/env python
# ~ Empresa Libre
# ~ Copyright (C) 2016-2018 Mauricio Baeza Servin (web@correolibre.net)
# ~
# ~ This program is free software: you can redistribute it and/or modify
# ~ it under the terms of the GNU General Public License as published by
# ~ the Free Software Foundation, either version 3 of the License, or
# ~ (at your option) any later version.
# ~
# ~ This program is distributed in the hope that it will be useful,
# ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
# ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# ~ GNU General Public License for more details.
# ~
# ~ You should have received a copy of the GNU General Public License
# ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import main

View File

@ -386,8 +386,10 @@ class Configuracion(BaseModel):
'txt_ticket_printer',
'txt_config_nomina_serie',
'txt_config_nomina_folio',
'txt_config_cfdipay_serie',
'txt_config_cfdipay_folio',
)
tp = 'txt_ticket_printer'
# ~ tp = 'txt_ticket_printer'
for f in fields:
values[f] = Configuracion.get_(f)
return values
@ -412,6 +414,8 @@ class Configuracion(BaseModel):
'txt_plantilla_factura_32',
'txt_plantilla_factura_33',
'txt_plantilla_factura_33j',
'txt_plantilla_nomina1233',
'txt_plantilla_pagos10',
'txt_plantilla_ticket',
'txt_plantilla_donataria',
)
@ -865,9 +869,17 @@ class Emisor(BaseModel):
fields['web'] = fields.pop('emisor_web', '')
fields['es_escuela'] = bool(fields['es_escuela'].replace('0', ''))
fields['es_ong'] = bool(fields['es_ong'].replace('0', ''))
fields['autorizacion'] = fields.pop('ong_autorizacion', '')
fields['fecha_autorizacion'] = fields.pop('ong_fecha', None)
fields['fecha_dof'] = fields.pop('ong_fecha_dof', None)
if fields['es_ong']:
fields['autorizacion'] = fields.pop('ong_autorizacion', '')
fields['fecha_autorizacion'] = fields.pop('ong_fecha', None)
fields['fecha_dof'] = fields.pop('ong_fecha_dof', None)
else:
fields.pop('ong_autorizacion')
fields.pop('ong_fecha')
fields.pop('ong_fecha_dof')
fields['autorizacion'] = ''
fields['fecha_autorizacion'] = None
fields['fecha_dof'] = None
fields['correo_timbrado'] = fields.pop('correo_timbrado', '')
fields['token_timbrado'] = fields.pop('token_timbrado', '')
fields['token_soporte'] = fields.pop('token_soporte', '')

View File

@ -47,7 +47,7 @@ except ImportError:
DEBUG = DEBUG
VERSION = '1.13.0'
VERSION = '1.14.0'
EMAIL_SUPPORT = ('soporte@empresalibre.net',)
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)

View File

@ -73,6 +73,7 @@ var controllers = {
$$('txt_plantilla_ticket').attachEvent('onItemClick', txt_plantilla_ticket_click)
$$('txt_plantilla_donataria').attachEvent('onItemClick', txt_plantilla_donataria_click)
$$('txt_plantilla_nomina1233').attachEvent('onItemClick', txt_plantilla_nomina1233_click)
$$('txt_plantilla_pagos10').attachEvent('onItemClick', txt_plantilla_pagos10_click)
$$('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)
@ -191,7 +192,6 @@ function cmd_save_emisor_click(){
}
}
values['regimenes'] = ids
webix.ajax().post('/emisor', values, {
error:function(text, data, XmlHttpRequest){
@ -1083,6 +1083,44 @@ function txt_plantilla_nomina1233_click(e){
}
function txt_plantilla_pagos10_click(e){
var body_elements = [
{cols: [{width: 100}, {view: 'uploader', id: 'up_template',
autosend: true, link: 'lst_files', value: 'Seleccionar archivo',
upload: '/files/txt_plantilla_pagos10', width: 200}, {width: 100}]},
{view: 'list', id: 'lst_files', type: 'uploader', autoheight:true,
borderless: true},
{},
{cols: [{}, {view: 'button', label: 'Cerrar', autowidth: true,
click:("$$('win_template').close();")}, {}]}
]
var w = webix.ui({
view: 'window',
id: 'win_template',
modal: true,
position: 'center',
head: 'Subir Plantilla Factura de Pago',
body: {
view: 'form',
elements: body_elements,
}
})
w.show()
$$('up_template').attachEvent('onUploadComplete', function(response){
if(response.ok){
$$('txt_plantilla_pagos10').setValue(response.name)
msg_ok('Plantilla cargada correctamente')
}else{
msg_error(response.name)
}
})
}
function tab_options_change(nv, ov){
var cv = {
tab_admin_templates: 'templates',

View File

@ -600,6 +600,11 @@ var options_templates = [
label: 'Plantilla Nomina v1.2 - Cfdi 3.3 (ODS): ', labelPosition: 'top',
icon: 'file'}, {}]},
{maxHeight: 20},
{cols: [{maxWidth: 15},
{view: 'search', id: 'txt_plantilla_pagos10', name: 'plantilla_pagos10',
label: 'Plantilla Factura de Pagos v1.0 - Cfdi 3.3 (ODS): ',
labelPosition: 'top', icon: 'file'}, {}]},
{maxHeight: 20},
{cols: [{maxWidth: 15},
{view: 'search', id: 'txt_plantilla_ticket', name: 'plantilla_ticket',
label: 'Plantilla para Tickets (ODS): ', labelPosition: 'top',