diff --git a/CHANGELOG.md b/CHANGELOG.md
index b2889a1..25b30fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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.
diff --git a/VERSION b/VERSION
index feaae22..850e742 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.13.0
+1.14.0
diff --git a/source/app/controllers/util.py b/source/app/controllers/util.py
index a706cbd..f34aa51 100644
--- a/source/app/controllers/util.py
+++ b/source/app/controllers/util.py
@@ -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 .
-
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()
diff --git a/source/app/models/db.py b/source/app/models/db.py
index c9e7671..139d571 100644
--- a/source/app/models/db.py
+++ b/source/app/models/db.py
@@ -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 .
+
from . import main
diff --git a/source/app/models/main.py b/source/app/models/main.py
index d9357c7..9bac9e3 100644
--- a/source/app/models/main.py
+++ b/source/app/models/main.py
@@ -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', '')
diff --git a/source/app/settings.py b/source/app/settings.py
index dbd9b26..e212adc 100644
--- a/source/app/settings.py
+++ b/source/app/settings.py
@@ -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)
diff --git a/source/static/js/controller/admin.js b/source/static/js/controller/admin.js
index 70839f9..7a6697c 100644
--- a/source/static/js/controller/admin.js
+++ b/source/static/js/controller/admin.js
@@ -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',
diff --git a/source/static/js/ui/admin.js b/source/static/js/ui/admin.js
index accd424..f173bf1 100644
--- a/source/static/js/ui/admin.js
+++ b/source/static/js/ui/admin.js
@@ -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',