This commit is contained in:
Mauricio Baeza 2018-10-04 23:25:52 -05:00
parent 3cc85e2644
commit d70c35b4de
3 changed files with 13 additions and 13 deletions

View File

@ -41,6 +41,7 @@ from settings import log, DEBUG, VERSION, PATH_CP, COMPANIES, PRE, CURRENT_CFDI,
FORMAT = '{0:.2f}'
FORMAT3 = '{0:.3f}'
FORMAT4 = '{0:.4f}'
FORMAT6 = '{0:.6f}'
FORMAT_TAX = FORMAT4
FORMAT_PRECIO = FORMAT4
RFC_PUBLICO = 'XAXX010101000'
@ -5349,7 +5350,7 @@ class FacturasPagos(BaseModel):
fac = Facturas.get(Facturas.id==int(i))
this_pay = values['this_pay']
importe = values['importe']
type_change = values['type_change']
type_change = round(this_pay / importe, 6)
mov_ant, numero = cls._movimiento_anterior(cls, mov, fac)
nuevo = {
'movimiento': mov,
@ -5368,7 +5369,7 @@ class FacturasPagos(BaseModel):
else:
nuevo['importe'] = this_pay
nuevo['saldo'] = nuevo['saldo_anterior'] - this_pay
print('\n\n', nuevo)
FacturasPagos.create(**nuevo)
fac.saldo = nuevo['saldo']
@ -5627,7 +5628,7 @@ class CfdiPagos(BaseModel):
r['IdDocumento'] = str(r['IdDocumento'])
r['Folio'] = str(r['Folio'])
r['NumParcialidad'] = str(r['NumParcialidad'])
r['TipoCambioDR'] = FORMAT4.format(r['TipoCambioDR'])
r['TipoCambioDR'] = FORMAT6.format(r['TipoCambioDR'])
r['MetodoDePagoDR'] = DEFAULT_CFDIPAY['WAYPAY']
r['ImpSaldoAnt'] = FORMAT.format(r['ImpSaldoAnt'])
r['ImpPagado'] = FORMAT.format(r['ImpPagado'])
@ -5639,7 +5640,6 @@ class CfdiPagos(BaseModel):
del r['TipoCambioDR']
if not r['Serie']:
del r['Serie']
print(r)
return related

View File

@ -432,9 +432,9 @@ function actualizar_deposito(grid){
}
suma += obj.importe.to_float()
if(obj.type_change == undefined){
if(obj.currency==CURRENCY_MN || obj.currency==current_currency){
obj.type_change = 1.00
}
//~ if(obj.currency==CURRENCY_MN || obj.currency==current_currency){
obj.type_change = 1.00
//~ }
}
})
@ -620,11 +620,11 @@ function validate_deposito(values){
if(obj.currency!=CURRENCY_MN && obj.currency!=current_currency){
if(obj.type_change==undefined){
msg_tc = 'Captura el Tipo de Cambio'
//~ }else{
//~ var tc = obj.type_change
//~ if(tc <= 1.0){
//~ msg_tc = 'El Tipo de Cambio debe ser mayor a 1.00'
//~ }
}else{
var tc = obj.type_change
if(tc <= 1.0){
msg_tc = 'El Tipo de Cambio debe ser mayor a 1.00'
}
}
}
})

View File

@ -125,7 +125,7 @@ var grid_cfdi_este_deposito_cols = [
{id: 'importe', header: ['Este pago'], width: 125, sort: 'int',
format: webix.i18n.priceFormat, css: 'right', editor: 'text'},
{id: 'type_change', header: ['T.C.'], width: 75, hidden: true,
format: format_currency4, css: 'right', editor: 'text'},
format: format_currency4, css: 'right'},
]