forked from elmau/empresa-libre
Mejoras en Carta Porte
This commit is contained in:
commit
64ef75fbf5
|
@ -1,3 +1,9 @@
|
||||||
|
v 1.46.1 [29-Ene-2022]
|
||||||
|
----------------------
|
||||||
|
- Error: Issue #49
|
||||||
|
- Mejora: Agregar validación para distancia en origen de Carta Porte.
|
||||||
|
|
||||||
|
|
||||||
v 1.46.0 [27-Ene-2022]
|
v 1.46.0 [27-Ene-2022]
|
||||||
----------------------
|
----------------------
|
||||||
- Mejora: Issue #45
|
- Mejora: Issue #45
|
||||||
|
|
|
@ -4685,7 +4685,9 @@ class Facturas(BaseModel):
|
||||||
for n in node:
|
for n in node:
|
||||||
d = util.get_dict(n.attrib)
|
d = util.get_dict(n.attrib)
|
||||||
name = VALUES_PDF['TAX'].get(d['impuesto'])
|
name = VALUES_PDF['TAX'].get(d['impuesto'])
|
||||||
tasa = f"{float(d['tasaocuota']):.2f}"
|
tasa = ''
|
||||||
|
if 'tasaocuota' in d:
|
||||||
|
tasa = f"{float(d['tasaocuota']):.2f}"
|
||||||
title = f"{type_tax} {name} {tasa}"
|
title = f"{type_tax} {name} {tasa}"
|
||||||
importe = util.format_currency(d['importe'], currency)
|
importe = util.format_currency(d['importe'], currency)
|
||||||
data['totales'].append((title, importe))
|
data['totales'].append((title, importe))
|
||||||
|
@ -5366,10 +5368,14 @@ class Facturas(BaseModel):
|
||||||
|
|
||||||
ubicaciones = values['ubicaciones']
|
ubicaciones = values['ubicaciones']
|
||||||
for ubicacion in ubicaciones:
|
for ubicacion in ubicaciones:
|
||||||
if 'DistanciaRecorrida' in ubicacion and ubicacion['DistanciaRecorrida']:
|
if 'DistanciaRecorrida' in ubicacion:
|
||||||
total_distance += float(ubicacion['DistanciaRecorrida'])
|
if ubicacion['TipoUbicacion'] == 'Origen':
|
||||||
if isinstance(ubicacion['DistanciaRecorrida'], (int, float)):
|
del ubicacion['DistanciaRecorrida']
|
||||||
ubicacion['DistanciaRecorrida'] = f"{ubicacion['DistanciaRecorrida']:.2f}"
|
elif ubicacion['DistanciaRecorrida']:
|
||||||
|
total_distance += float(ubicacion['DistanciaRecorrida'])
|
||||||
|
if isinstance(ubicacion['DistanciaRecorrida'], (int, float)):
|
||||||
|
ubicacion['DistanciaRecorrida'] = f"{ubicacion['DistanciaRecorrida']:.2f}"
|
||||||
|
|
||||||
municipio = ubicacion.pop('Municipio')
|
municipio = ubicacion.pop('Municipio')
|
||||||
estado = ubicacion.pop('Estado')
|
estado = ubicacion.pop('Estado')
|
||||||
pais = ubicacion.pop('Pais')
|
pais = ubicacion.pop('Pais')
|
||||||
|
|
|
@ -42,7 +42,7 @@ except ImportError:
|
||||||
|
|
||||||
|
|
||||||
DEBUG = DEBUG
|
DEBUG = DEBUG
|
||||||
VERSION = '1.46.0'
|
VERSION = '1.46.1'
|
||||||
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
||||||
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
||||||
|
|
||||||
|
|
|
@ -1122,12 +1122,21 @@ function grid_details_before_edit_start(id){
|
||||||
|
|
||||||
|
|
||||||
function grid_carta_ubicaciones_before_edit_stop(state, editor){
|
function grid_carta_ubicaciones_before_edit_stop(state, editor){
|
||||||
|
var g = $$('grid_carta_ubicaciones')
|
||||||
|
var row = g.getItem(editor.row)
|
||||||
|
|
||||||
if(editor.column != 'CodigoPostal'){
|
if(editor.column != 'CodigoPostal'){
|
||||||
|
if(editor.column == 'DistanciaRecorrida' && row['TipoUbicacion'] == 'Origen'){
|
||||||
|
msg = 'En el Origen, la distancia recorrida debe estar vacía'
|
||||||
|
msg_error(msg)
|
||||||
|
g.blockEvent()
|
||||||
|
state.value = ''
|
||||||
|
g.editCancel()
|
||||||
|
g.unblockEvent()
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
var g = $$('grid_carta_ubicaciones')
|
|
||||||
var row = g.getItem(editor.row)
|
|
||||||
var cp = state.value.trim()
|
var cp = state.value.trim()
|
||||||
|
|
||||||
if(!cp){
|
if(!cp){
|
||||||
|
|
Loading…
Reference in New Issue