Merge pull request 'Se ajusta cálculo de valor de la cotización al actualizar trayectos. Fixes bug#AL-4550' (!792) from AL-4550 into master
Reviewed-on: adm/VentaBoletosAdm#792 Reviewed-by: Wilian Domingues <wilian@rjconsultores.com.br>master 1.159.1
commit
849bfd559d
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ventaboletosadm</artifactId>
|
<artifactId>ventaboletosadm</artifactId>
|
||||||
<version>1.159.0</version>
|
<version>1.159.1</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.expressos;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.expressos;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -11,6 +13,7 @@ import org.zkoss.zul.Window;
|
||||||
import com.rjconsultores.ventaboletos.entidad.SolicitudExpreso;
|
import com.rjconsultores.ventaboletos.entidad.SolicitudExpreso;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TrayectosExpresos;
|
import com.rjconsultores.ventaboletos.entidad.TrayectosExpresos;
|
||||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.SolicitudExpresosService;
|
||||||
import com.rjconsultores.ventaboletos.service.TrayectosExpresosService;
|
import com.rjconsultores.ventaboletos.service.TrayectosExpresosService;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
||||||
|
@ -21,6 +24,9 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SolicitudExpresosService solicitudExpresosService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
TrayectosExpresosService trayectosExpresosService;
|
TrayectosExpresosService trayectosExpresosService;
|
||||||
|
|
||||||
|
@ -30,6 +36,8 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer
|
||||||
TrayectosExpresos trayecto;
|
TrayectosExpresos trayecto;
|
||||||
TrayectosExpresos trayectoClone;
|
TrayectosExpresos trayectoClone;
|
||||||
|
|
||||||
|
SolicitudExpreso expreso;
|
||||||
|
|
||||||
private Window winCotizarExpresso;
|
private Window winCotizarExpresso;
|
||||||
|
|
||||||
private MyTextbox txtRuta;
|
private MyTextbox txtRuta;
|
||||||
|
@ -40,11 +48,11 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
trayecto = (TrayectosExpresos) Executions.getCurrent().getArg().get("trayecto");
|
trayecto = (TrayectosExpresos) Executions.getCurrent().getArg().get("trayecto");
|
||||||
|
expreso = (SolicitudExpreso) Executions.getCurrent().getArg().get("expreso");
|
||||||
|
|
||||||
trayecto.clonar();
|
trayecto.clonar();
|
||||||
trayectoClone = trayecto.getCloneObject();
|
trayectoClone = trayecto.getCloneObject();
|
||||||
|
|
||||||
|
|
||||||
winCotizarExpresso = (Window) Executions.getCurrent().getArg().get("winCotizarExpresso");
|
winCotizarExpresso = (Window) Executions.getCurrent().getArg().get("winCotizarExpresso");
|
||||||
|
|
||||||
txtRuta.setValue(trayecto.getDescTrayecto());
|
txtRuta.setValue(trayecto.getDescTrayecto());
|
||||||
|
@ -66,6 +74,7 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer
|
||||||
|
|
||||||
Integer cantVechiculos = Integer.valueOf(txtCantidadVehiculos.getValue().toString());
|
Integer cantVechiculos = Integer.valueOf(txtCantidadVehiculos.getValue().toString());
|
||||||
Integer valorTrayecto = Integer.valueOf(txtValorTrayecto.getValue().toString());
|
Integer valorTrayecto = Integer.valueOf(txtValorTrayecto.getValue().toString());
|
||||||
|
Integer valorExpreso = 0;
|
||||||
|
|
||||||
trayecto.setCantVehiculos(cantVechiculos);
|
trayecto.setCantVehiculos(cantVechiculos);
|
||||||
trayecto.setValorTrayecto(valorTrayecto);
|
trayecto.setValorTrayecto(valorTrayecto);
|
||||||
|
@ -74,6 +83,18 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer
|
||||||
|
|
||||||
logAuditoriaService.auditar(trayectoClone, trayecto, null);
|
logAuditoriaService.auditar(trayectoClone, trayecto, null);
|
||||||
|
|
||||||
|
List<TrayectosExpresos> trayectos = trayectosExpresosService.obtenerTrayectosPorServicioId(trayecto.getSolicitudExpresoId());
|
||||||
|
|
||||||
|
for(TrayectosExpresos trayecto : trayectos) {
|
||||||
|
if(trayecto.getValorTrayecto() != null) {
|
||||||
|
valorExpreso += trayecto.getValorTrayecto();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
expreso.setValorCotizacion(valorExpreso);
|
||||||
|
|
||||||
|
solicitudExpresosService.actualizacion(expreso);
|
||||||
|
|
||||||
winCotizarExpresso.focus();
|
winCotizarExpresso.focus();
|
||||||
|
|
||||||
this.closeWindow();
|
this.closeWindow();
|
||||||
|
|
Loading…
Reference in New Issue