Fix issue #98 and #107

This commit is contained in:
El Mau 2023-12-20 18:55:18 -06:00
commit 957160755a
7 changed files with 31 additions and 6 deletions

1
.gitignore vendored
View File

@ -34,4 +34,5 @@ credenciales.conf
*.orig
rfc.db
Dockerfile
chuletas/

View File

@ -1,3 +1,7 @@
v 2.0.9 [20-Dic-2023]
- Fix: Issue 98 y 107
v 2.0.8 [30-Oct-2023]
---------------------
- Fix: Permitir generar CFDI de egreso para facturas globales sin datos globales.

View File

@ -1 +1 @@
2.0.8
2.0.9

View File

@ -549,7 +549,7 @@ class AppDocumentos(object):
if not type_doc in ('pdf', 'pre', 'tpdf', 'pdfpago', 'html', 'nompdf'):
resp.append_header('Content-Disposition',
'attachment; filename={}'.format(file_name))
if type_doc in ('pdf', 'nompdf'):
if type_doc in ('pdf', 'nompdf', 'pdfpago'):
resp.append_header('Content-Disposition',
'inline; filename={}'.format(file_name))
resp.content_type = content_type

View File

@ -9505,6 +9505,18 @@ class CfdiNomina(BaseModel):
if msg:
return {}, msg
if isinstance(row['fecha_pago'], str):
msg = f"La Fecha de Pago debe ser una fecha: {row['fecha_pago']}"
return {}, msg
if isinstance(row['fecha_inicial_pago'], str):
msg = f"La Fecha Inicial de Pago debe ser una fecha: {row['fecha_inicial_pago']}"
return {}, msg
if isinstance(row['fecha_final_pago'], str):
msg = f"La Fecha Final de Pago debe ser una fecha: {row['fecha_final_pago']}"
return {}, msg
data['serie'] = self._get_serie(self)
data['folio'] = self._get_folio(self, data['serie'])
data['forma_pago'] = DEFAULT_SAT_NOMINA['FORMA_PAGO']

View File

@ -39,7 +39,7 @@ except ImportError:
DEBUG = DEBUG
VERSION = '2.0.8'
VERSION = '2.0.9'
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)

View File

@ -434,6 +434,14 @@ function validate_invoice(values){
return false
}
var metodo_pago = $$('lst_metodo_pago').getValue()
if(metodo_pago=='PPD' && forma_pago!='99'){
webix.UIManager.setFocus('lst_forma_pago')
msg = 'La Forma de pago debe ser: [99] Por definir'
msg_error(msg)
return false
}
var tipo_cambio = $$('txt_tipo_cambio').getValue()
if(tipo_cambio.trim() == ""){
webix.UIManager.setFocus('txt_tipo_cambio')
@ -466,8 +474,8 @@ function validate_invoice(values){
anticipo = $$('chk_cfdi_anticipo').getValue()
if(anticipo){
var mp = $$('lst_metodo_pago').getValue()
if(mp != 'PUE'){
//~ var mp = $$('lst_metodo_pago').getValue()
if(metodo_pago != 'PUE'){
msg = 'En anticipos, el método de pago debe ser: Pago en una sola exhibición'
msg_error(msg)
return false
@ -548,7 +556,7 @@ function validate_invoice(values){
if(is_global){
var key_sat = rows[i]['clave_sat']
if(key_sat!=KEY_SAT_01){
var msg = 'Clave SAT inválida para Facturar Global en la línea: ' + (i + 1)
var msg = 'Clave SAT inválida para Factura Global en la línea: ' + (i + 1)
msg_error(msg)
return false
}