forked from elmau/empresa-libre
Configurar valores predeterminados para CFDI de pagos
This commit is contained in:
parent
b202827ee0
commit
118fa41d9b
|
@ -509,7 +509,7 @@ class AppDocumentos(object):
|
||||||
session = req.env['beaker.session']
|
session = req.env['beaker.session']
|
||||||
req.context['result'], file_name, content_type = \
|
req.context['result'], file_name, content_type = \
|
||||||
self._db.get_doc(type_doc, id_doc, session['rfc'])
|
self._db.get_doc(type_doc, id_doc, session['rfc'])
|
||||||
if not type_doc in ('pdf', 'pre', 'tpdf'):
|
if not type_doc in ('pdf', 'pre', 'tpdf', 'pdfpago'):
|
||||||
resp.append_header('Content-Disposition',
|
resp.append_header('Content-Disposition',
|
||||||
'attachment; filename={}'.format(file_name))
|
'attachment; filename={}'.format(file_name))
|
||||||
resp.content_type = content_type
|
resp.content_type = content_type
|
||||||
|
|
|
@ -35,7 +35,7 @@ from settings import log, DEBUG, VERSION, PATH_CP, COMPANIES, PRE, CURRENT_CFDI,
|
||||||
INIT_VALUES, DEFAULT_PASSWORD, DECIMALES, IMPUESTOS, DEFAULT_SAT_PRODUCTO, \
|
INIT_VALUES, DEFAULT_PASSWORD, DECIMALES, IMPUESTOS, DEFAULT_SAT_PRODUCTO, \
|
||||||
CANCEL_SIGNATURE, PUBLIC, DEFAULT_SERIE_TICKET, CURRENT_CFDI_NOMINA, \
|
CANCEL_SIGNATURE, PUBLIC, DEFAULT_SERIE_TICKET, CURRENT_CFDI_NOMINA, \
|
||||||
DEFAULT_SAT_NOMINA, DECIMALES_TAX, TITLE_APP, MV, DECIMALES_PRECIOS, \
|
DEFAULT_SAT_NOMINA, DECIMALES_TAX, TITLE_APP, MV, DECIMALES_PRECIOS, \
|
||||||
DEFAULT_SERIE_CFDIPAY, DEFAULT_TYPE_CFDIPAY
|
DEFAULT_CFDIPAY
|
||||||
|
|
||||||
|
|
||||||
FORMAT = '{0:.2f}'
|
FORMAT = '{0:.2f}'
|
||||||
|
@ -5256,7 +5256,7 @@ class CfdiPagos(BaseModel):
|
||||||
folio = IntegerField(default=0)
|
folio = IntegerField(default=0)
|
||||||
fecha = DateTimeField(default=util.now, formats=['%Y-%m-%d %H:%M:%S'])
|
fecha = DateTimeField(default=util.now, formats=['%Y-%m-%d %H:%M:%S'])
|
||||||
fecha_timbrado = DateTimeField(null=True)
|
fecha_timbrado = DateTimeField(null=True)
|
||||||
tipo_comprobante = TextField(default=DEFAULT_TYPE_CFDIPAY)
|
tipo_comprobante = TextField(default=DEFAULT_CFDIPAY['TYPE'])
|
||||||
lugar_expedicion = TextField(default='')
|
lugar_expedicion = TextField(default='')
|
||||||
regimen_fiscal = TextField(default='')
|
regimen_fiscal = TextField(default='')
|
||||||
tipo_relacion = TextField(default='')
|
tipo_relacion = TextField(default='')
|
||||||
|
@ -5317,7 +5317,7 @@ class CfdiPagos(BaseModel):
|
||||||
|
|
||||||
filters = (
|
filters = (
|
||||||
(CfdiPagos.movimiento==id_mov) &
|
(CfdiPagos.movimiento==id_mov) &
|
||||||
(CfdiPagos.cancelado==False)
|
(CfdiPagos.cancelada==False)
|
||||||
)
|
)
|
||||||
previous = CfdiPagos.select().where(filters)
|
previous = CfdiPagos.select().where(filters)
|
||||||
if previous:
|
if previous:
|
||||||
|
@ -5331,7 +5331,7 @@ class CfdiPagos(BaseModel):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
emisor = Emisor.select()[0]
|
emisor = Emisor.select()[0]
|
||||||
serie = Configuracion.get_('txt_config_cfdipay_serie') or DEFAULT_SERIE_CFDIPAY
|
serie = Configuracion.get_('txt_config_cfdipay_serie') or DEFAULT_CFDIPAY['SERIE']
|
||||||
fields = {}
|
fields = {}
|
||||||
fields['movimiento'] = id_mov
|
fields['movimiento'] = id_mov
|
||||||
fields['socio'] = partner
|
fields['socio'] = partner
|
||||||
|
@ -5379,7 +5379,7 @@ class CfdiPagos(BaseModel):
|
||||||
r['Folio'] = str(r['Folio'])
|
r['Folio'] = str(r['Folio'])
|
||||||
r['NumParcialidad'] = str(r['NumParcialidad'])
|
r['NumParcialidad'] = str(r['NumParcialidad'])
|
||||||
# ~ r['TipoCambioDR'] = FORMAT.format(r['TipoCambioDR'])
|
# ~ r['TipoCambioDR'] = FORMAT.format(r['TipoCambioDR'])
|
||||||
r['MetodoDePagoDR'] = 'PDD'
|
r['MetodoDePagoDR'] = DEFAULT_CFDIPAY['WAYPAY']
|
||||||
r['ImpSaldoAnt'] = FORMAT.format(r['ImpSaldoAnt'])
|
r['ImpSaldoAnt'] = FORMAT.format(r['ImpSaldoAnt'])
|
||||||
r['ImpPagado'] = FORMAT.format(r['ImpPagado'])
|
r['ImpPagado'] = FORMAT.format(r['ImpPagado'])
|
||||||
r['ImpSaldoInsoluto'] = FORMAT.format(r['ImpSaldoInsoluto'])
|
r['ImpSaldoInsoluto'] = FORMAT.format(r['ImpSaldoInsoluto'])
|
||||||
|
@ -5398,7 +5398,7 @@ class CfdiPagos(BaseModel):
|
||||||
cfdi['NoCertificado'] = cert.serie
|
cfdi['NoCertificado'] = cert.serie
|
||||||
cfdi['Certificado'] = cert.cer_txt
|
cfdi['Certificado'] = cert.cer_txt
|
||||||
cfdi['SubTotal'] = '0'
|
cfdi['SubTotal'] = '0'
|
||||||
cfdi['Moneda'] = 'XXX'
|
cfdi['Moneda'] = DEFAULT_CFDIPAY['CURRENCY']
|
||||||
cfdi['Total'] = '0'
|
cfdi['Total'] = '0'
|
||||||
cfdi['TipoDeComprobante'] = invoice.tipo_comprobante
|
cfdi['TipoDeComprobante'] = invoice.tipo_comprobante
|
||||||
cfdi['LugarExpedicion'] = invoice.lugar_expedicion
|
cfdi['LugarExpedicion'] = invoice.lugar_expedicion
|
||||||
|
@ -5418,7 +5418,7 @@ class CfdiPagos(BaseModel):
|
||||||
receptor = {
|
receptor = {
|
||||||
'Rfc': invoice.socio.rfc,
|
'Rfc': invoice.socio.rfc,
|
||||||
'Nombre': invoice.socio.nombre,
|
'Nombre': invoice.socio.nombre,
|
||||||
'UsoCFDI': 'P01',
|
'UsoCFDI': DEFAULT_CFDIPAY['USED'],
|
||||||
}
|
}
|
||||||
if invoice.socio.tipo_persona == 4:
|
if invoice.socio.tipo_persona == 4:
|
||||||
if invoice.socio.pais:
|
if invoice.socio.pais:
|
||||||
|
@ -5427,10 +5427,10 @@ class CfdiPagos(BaseModel):
|
||||||
receptor['NumRegIdTrib'] = invoice.socio.id_fiscal
|
receptor['NumRegIdTrib'] = invoice.socio.id_fiscal
|
||||||
|
|
||||||
conceptos = ({
|
conceptos = ({
|
||||||
'ClaveProdServ': '84111506',
|
'ClaveProdServ': DEFAULT_CFDIPAY['KEYSAT'],
|
||||||
'Cantidad': '1',
|
'Cantidad': '1',
|
||||||
'ClaveUnidad': 'ACT',
|
'ClaveUnidad': DEFAULT_CFDIPAY['UNITKEY'],
|
||||||
'Descripcion': 'Pago',
|
'Descripcion': DEFAULT_CFDIPAY['DESCRIPTION'],
|
||||||
'ValorUnitario': '0',
|
'ValorUnitario': '0',
|
||||||
'Importe': '0',
|
'Importe': '0',
|
||||||
},)
|
},)
|
||||||
|
|
|
@ -155,8 +155,16 @@ IMPUESTOS = {
|
||||||
}
|
}
|
||||||
DEFAULT_SAT_PRODUCTO = '01010101'
|
DEFAULT_SAT_PRODUCTO = '01010101'
|
||||||
DEFAULT_SERIE_TICKET = 'T'
|
DEFAULT_SERIE_TICKET = 'T'
|
||||||
DEFAULT_SERIE_CFDIPAY = 'FP'
|
DEFAULT_CFDIPAY = {
|
||||||
DEFAULT_TYPE_CFDIPAY = 'P'
|
'SERIE': 'FP',
|
||||||
|
'TYPE': 'P',
|
||||||
|
'WAYPAY': 'PPD',
|
||||||
|
'CURRENCY': 'XXX',
|
||||||
|
'USED': 'P01',
|
||||||
|
'KEYSAT': '84111506',
|
||||||
|
'UNITKEY': 'ACT',
|
||||||
|
'DESCRIPTION': 'Pago',
|
||||||
|
}
|
||||||
DIR_FACTURAS = 'facturas'
|
DIR_FACTURAS = 'facturas'
|
||||||
USAR_TOKEN = False
|
USAR_TOKEN = False
|
||||||
CANCEL_SIGNATURE = False
|
CANCEL_SIGNATURE = False
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue