diff --git a/pom.xml b/pom.xml index 7173d9628..d0821d483 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.159.0 + 1.159.1 war diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/ModificarTrayectoExpresoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/ModificarTrayectoExpresoController.java index b50aeca69..534f75539 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/ModificarTrayectoExpresoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/expressos/ModificarTrayectoExpresoController.java @@ -1,5 +1,7 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.expressos; +import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; 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.TrayectosExpresos; import com.rjconsultores.ventaboletos.service.LogAuditoriaService; +import com.rjconsultores.ventaboletos.service.SolicitudExpresosService; import com.rjconsultores.ventaboletos.service.TrayectosExpresosService; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; @@ -21,6 +24,9 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer private static final long serialVersionUID = 1L; + @Autowired + SolicitudExpresosService solicitudExpresosService; + @Autowired TrayectosExpresosService trayectosExpresosService; @@ -30,6 +36,8 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer TrayectosExpresos trayecto; TrayectosExpresos trayectoClone; + SolicitudExpreso expreso; + private Window winCotizarExpresso; private MyTextbox txtRuta; @@ -40,11 +48,11 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); trayecto = (TrayectosExpresos) Executions.getCurrent().getArg().get("trayecto"); + expreso = (SolicitudExpreso) Executions.getCurrent().getArg().get("expreso"); trayecto.clonar(); trayectoClone = trayecto.getCloneObject(); - winCotizarExpresso = (Window) Executions.getCurrent().getArg().get("winCotizarExpresso"); txtRuta.setValue(trayecto.getDescTrayecto()); @@ -66,6 +74,7 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer Integer cantVechiculos = Integer.valueOf(txtCantidadVehiculos.getValue().toString()); Integer valorTrayecto = Integer.valueOf(txtValorTrayecto.getValue().toString()); + Integer valorExpreso = 0; trayecto.setCantVehiculos(cantVechiculos); trayecto.setValorTrayecto(valorTrayecto); @@ -74,6 +83,18 @@ public class ModificarTrayectoExpresoController extends MyGenericForwardComposer logAuditoriaService.auditar(trayectoClone, trayecto, null); + List trayectos = trayectosExpresosService.obtenerTrayectosPorServicioId(trayecto.getSolicitudExpresoId()); + + for(TrayectosExpresos trayecto : trayectos) { + if(trayecto.getValorTrayecto() != null) { + valorExpreso += trayecto.getValorTrayecto(); + } + } + + expreso.setValorCotizacion(valorExpreso); + + solicitudExpresosService.actualizacion(expreso); + winCotizarExpresso.focus(); this.closeWindow();