From bd490a47fd14bcd3356960cdf4d782d35634e1bd Mon Sep 17 00:00:00 2001 From: julio Date: Tue, 3 Dec 2013 20:54:05 +0000 Subject: [PATCH] merge com uruguay git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@32395 d1611594-4594-4d17-8e1d-87c2c4800839 --- .settings/org.zkoss.eclipse.preferences.prefs | 2 +- .../EditarTipoServicioController.java | 232 ++++++------ .../BusquedaCorridaController.java | 3 - .../EditarCatalogoDeRutaController.java | 5 +- .../pricing/EditarPricingController.java | 118 +++++- .../EditarPricingFormapagoController.java | 121 ++++++ .../EditarPricingOcupaAntecipaController.java | 61 ++-- .../EditarPricingTipoServicioController.java | 241 ++++++------ .../seguridad/EditarEstacionController.java | 12 +- .../BusquedaTaxaEmbLevanteController.java | 240 ++++++++++++ .../BusquedaTaxaEmbarqueKmController.java | 191 +++++----- .../EditarTaxaEmbLevanteController.java | 300 +++++++++++++++ .../EditarTaxaEmbLevanteParadaController.java | 138 +++++++ .../web/utilerias/MyComboboxParada.java | 211 ++++++----- .../utilerias/MyGenericForwardComposer.java | 16 +- .../ItemMenuTarifasTaxaEmbLevante.java | 25 ++ .../paginacion/PagedListWrapper.java | 344 +++++++++--------- .../render/RenderPricingFormaPago.java | 34 ++ .../render/RenderTaxaEmbLevante.java | 26 ++ .../render/RenderTaxaEmbLevanteCtrl.java | 30 ++ src/java/spring-config.xml | 13 + src/java/versionADM.info | 3 +- web/WEB-INF/i3-label_es_MX.label | 53 +-- web/WEB-INF/i3-label_pt_BR.label | 19 +- .../atualizarCorridaFecHusoFecVerano.zul | 5 +- web/gui/pricing/editarPricing.zul | 43 ++- web/gui/pricing/editarPricingFormapago.zul | 54 +++ web/gui/seguridad/editarEstacion.zul | 2 +- web/gui/tarifas/busquedaTaxaEmbLevante.zul | 92 +++++ web/gui/tarifas/editarTaxaEmbLevante.zul | 89 +++++ .../tarifas/editarTaxaEmbLevanteParada.zul | 52 +++ 31 files changed, 2091 insertions(+), 684 deletions(-) create mode 100644 src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingFormapagoController.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbLevanteController.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteController.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteParadaController.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifasOficial/ItemMenuTarifasTaxaEmbLevante.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingFormaPago.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevante.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevanteCtrl.java create mode 100644 web/gui/pricing/editarPricingFormapago.zul create mode 100644 web/gui/tarifas/busquedaTaxaEmbLevante.zul create mode 100644 web/gui/tarifas/editarTaxaEmbLevante.zul create mode 100644 web/gui/tarifas/editarTaxaEmbLevanteParada.zul diff --git a/.settings/org.zkoss.eclipse.preferences.prefs b/.settings/org.zkoss.eclipse.preferences.prefs index 5f4285287..ded932ff2 100644 --- a/.settings/org.zkoss.eclipse.preferences.prefs +++ b/.settings/org.zkoss.eclipse.preferences.prefs @@ -1,5 +1,5 @@ eclipse.preferences.version=1 setting.zk_facet_install_history=\n\n visualeditor.custom_web_content_path=/ventaboletosadm/web -visualeditor.custom_zk_package=zkee-bin-eval-6.0.0 +visualeditor.custom_zk_package=zkee-bin-eval-6.5.2 visualeditor.is_use_zks_lib=true diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoServicioController.java index d1f9fd0a8..3064e087e 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoServicioController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoServicioController.java @@ -4,158 +4,162 @@ */ package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; + import com.rjconsultores.ventaboletos.entidad.TipoServicio; import com.rjconsultores.ventaboletos.service.TipoServicioService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; -import org.apache.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Controller; -import java.util.Calendar; -import java.util.List; -import org.zkoss.util.resource.Labels; -import org.zkoss.zk.ui.Component; -import org.zkoss.zk.ui.Executions; -import org.zkoss.zk.ui.event.Event; -import org.zkoss.zul.Button; -import org.zkoss.zul.Messagebox; -import org.zkoss.zul.Textbox; /** - * + * * @author Rafius */ @Controller("editarTipoServicioController") @Scope("prototype") public class EditarTipoServicioController extends MyGenericForwardComposer { - @Autowired - private TipoServicioService tipoServicioService; - private TipoServicio tipoServicio; - private MyListbox tipoServicioList; - private static Logger log = Logger.getLogger(EditarTipoServicioController.class); - private MyTextbox txtNome; - private Button btnApagar; + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(EditarTipoServicioController.class); - public Button getBtnApagar() { - return btnApagar; - } + @Autowired + private TipoServicioService tipoServicioService; - public void setBtnApagar(Button btnApagar) { - this.btnApagar = btnApagar; - } + private TipoServicio tipoServicio; + private MyListbox tipoServicioList; + private MyTextbox txtNome; + private Button btnApagar; - public MyTextbox getTxtNome() { - return txtNome; - } + public Button getBtnApagar() { + return btnApagar; + } - public void setTxtNome(MyTextbox txtNome) { - this.txtNome = txtNome; - } + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } - @Override - public void doAfterCompose(Component comp) throws Exception { - super.doAfterCompose(comp); + public MyTextbox getTxtNome() { + return txtNome; + } - tipoServicio = (TipoServicio) Executions.getCurrent().getArg().get("tipoServicio"); - tipoServicioList = (MyListbox) Executions.getCurrent().getArg().get("tipoServicioList"); + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } - if (tipoServicio.getTiposervicioId() == null) { - btnApagar.setVisible(Boolean.FALSE); - } + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); - txtNome.focus(); - } + tipoServicio = (TipoServicio) Executions.getCurrent().getArg().get("tipoServicio"); + tipoServicioList = (MyListbox) Executions.getCurrent().getArg().get("tipoServicioList"); - public void onClick$btnSalvar(Event ev) throws InterruptedException { - txtNome.getValue(); - try { + if (tipoServicio.getTiposervicioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } - tipoServicio.setActivo(Boolean.TRUE); - tipoServicio.setFecmodif(Calendar.getInstance().getTime()); - tipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + txtNome.focus(); + } - List lsTipoServicio = tipoServicioService.buscar(tipoServicio.getDescservicio()); + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { - if (!lsTipoServicio.isEmpty() && tipoServicio.getTiposervicioId() == null) { - Messagebox.show( - Labels.getLabel("MSG.Registro.Existe"), - Labels.getLabel("editarTipoServicioController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } else { - if (tipoServicio.getTiposervicioId() == null) { - tipoServicioService.suscribir(tipoServicio); - tipoServicioList.addItem(tipoServicio); - } else { - tipoServicioService.actualizacion(tipoServicio); - tipoServicioList.updateItem(tipoServicio); - } + tipoServicio.setActivo(Boolean.TRUE); + tipoServicio.setFecmodif(Calendar.getInstance().getTime()); + tipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - Messagebox.show( - Labels.getLabel("editarTipoServicioController.MSG.suscribirOK"), - Labels.getLabel("editarTipoServicioController.window.title"), - Messagebox.OK, Messagebox.INFORMATION); + List lsTipoServicio = tipoServicioService.buscar(tipoServicio.getDescservicio()); - closeWindow(); - } - } catch (Exception ex) { - log.error("Exception ao suscribir TipoServicio: " + ex); - Messagebox.show( - Labels.getLabel("MSG.Error"), - Labels.getLabel("editarTipoServicioController.window.title"), - Messagebox.OK, Messagebox.ERROR); - } - } + if (!lsTipoServicio.isEmpty() && tipoServicio.getTiposervicioId() == null) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoServicio.getTiposervicioId() == null) { + tipoServicioService.suscribir(tipoServicio); + tipoServicioList.addItem(tipoServicio); + } else { + tipoServicioService.actualizacion(tipoServicio); + tipoServicioList.updateItem(tipoServicio); + } - public void onClick$btnApagar(Event ev) { - try { - int resp = Messagebox.show( - Labels.getLabel("editarTipoServicioController.MSG.borrarPergunta"), - Labels.getLabel("editarTipoServicioController.window.title"), - Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + Messagebox.show( + Labels.getLabel("editarTipoServicioController.MSG.suscribirOK"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); - if (resp == Messagebox.YES) { + closeWindow(); + } + } catch (Exception ex) { + log.error("Exception ao suscribir TipoServicio: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } - tipoServicioService.borrar(tipoServicio); + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoServicioController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); - Messagebox.show( - Labels.getLabel("editarTipoServicioController.MSG.borrarOK"), - Labels.getLabel("editarTipoServicioController.window.title"), - Messagebox.OK, Messagebox.INFORMATION); + if (resp == Messagebox.YES) { - tipoServicioList.removeItem(tipoServicio); + tipoServicioService.borrar(tipoServicio); - closeWindow(); - } - } catch (Exception ex) { - log.error(ex); - } - } + Messagebox.show( + Labels.getLabel("editarTipoServicioController.MSG.borrarOK"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); - public TipoServicio getTipoServicio() { - return tipoServicio; - } + tipoServicioList.removeItem(tipoServicio); - public void setTipoServicio(TipoServicio tipoServicio) { - this.tipoServicio = tipoServicio; - } + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } - public MyListbox getTipoServicioList() { - return tipoServicioList; - } + public TipoServicio getTipoServicio() { + return tipoServicio; + } - public void setTipoServicioList(MyListbox tipoServicioList) { - this.tipoServicioList = tipoServicioList; - } + public void setTipoServicio(TipoServicio tipoServicio) { + this.tipoServicio = tipoServicio; + } - public TipoServicioService getTipoServicioService() { - return tipoServicioService; - } + public MyListbox getTipoServicioList() { + return tipoServicioList; + } - public void setTipoServicioService(TipoServicioService tipoServicioService) { - this.tipoServicioService = tipoServicioService; - } + public void setTipoServicioList(MyListbox tipoServicioList) { + this.tipoServicioList = tipoServicioList; + } + + public TipoServicioService getTipoServicioService() { + return tipoServicioService; + } + + public void setTipoServicioService(TipoServicioService tipoServicioService) { + this.tipoServicioService = tipoServicioService; + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaController.java index 99554fe72..15cd3f65b 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaController.java @@ -286,9 +286,6 @@ public class BusquedaCorridaController extends MyGenericForwardComposer { marca = (Marca) cbiMarca.getValue(); busquedaCorrita.addFilterEqual("marca", marca); } -// else { -// busquedaCorrita.addFilterIn("marca", lsMarca); -// } Comboitem cbiRuta = cmbRuta.getSelectedItem(); Ruta ruta = null; diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeRutaController.java index cd3e1f36f..9c1d80fc1 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeRutaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeRutaController.java @@ -515,8 +515,11 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer if (!achou) { RutaEmpresa rutaEmpresa = new RutaEmpresa(); - rutaEmpresa.setActivo(Boolean.TRUE); rutaEmpresa.setEmpresa(empresa); + rutaEmpresa.setRutaEmpresaId(empresa.getEmpresaId()); + rutaEmpresa.setRuta(ruta); + rutaEmpresa.setEmpresa(empresa); + rutaEmpresa.setActivo(Boolean.TRUE); rutaEmpresa.setFecmodif(Calendar.getInstance().getTime()); rutaEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java index 48c82054a..28329b6a1 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java @@ -42,6 +42,7 @@ import com.rjconsultores.ventaboletos.entidad.PricingCategoria; import com.rjconsultores.ventaboletos.entidad.PricingClase; import com.rjconsultores.ventaboletos.entidad.PricingCorrida; import com.rjconsultores.ventaboletos.entidad.PricingDia; +import com.rjconsultores.ventaboletos.entidad.PricingFormapago; import com.rjconsultores.ventaboletos.entidad.PricingImporte; import com.rjconsultores.ventaboletos.entidad.PricingMarca; import com.rjconsultores.ventaboletos.entidad.PricingMercado; @@ -61,6 +62,7 @@ import com.rjconsultores.ventaboletos.service.MarcaService; import com.rjconsultores.ventaboletos.service.ParadaService; import com.rjconsultores.ventaboletos.service.PricingCategoriaService; import com.rjconsultores.ventaboletos.service.PricingClaseService; +import com.rjconsultores.ventaboletos.service.PricingFormapagoService; import com.rjconsultores.ventaboletos.service.PricingImporteService; import com.rjconsultores.ventaboletos.service.PricingMarcaService; import com.rjconsultores.ventaboletos.service.PricingMercadoService; @@ -80,6 +82,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingCategori import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingClase; import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingCorrida; import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingDia; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingFormaPago; import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingImporte; import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingMarca; import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingMercado; @@ -99,6 +102,8 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingVigencia public class EditarPricingController extends MyGenericForwardComposer { private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(EditarPricingController.class); + @Autowired private PricingService pricingService; @Autowired @@ -118,6 +123,8 @@ public class EditarPricingController extends MyGenericForwardComposer { @Autowired private PricingImporteService pricingImporteService; @Autowired + private PricingFormapagoService pricingFormapagoService; + @Autowired private EmpresaService empresaService; @Autowired private MarcaService marcaService; @@ -133,6 +140,7 @@ public class EditarPricingController extends MyGenericForwardComposer { private CategoriaService categoriaService; @Autowired private ParadaService paradaService; + private Pricing pricing; private MyListbox pricingList; private MyListbox pricingVigenciaList; @@ -149,6 +157,7 @@ public class EditarPricingController extends MyGenericForwardComposer { private MyListbox pricingAsientoList; private MyListbox pricingTipoServicioList; private MyListbox pricingOcupaAntecipaList; + private MyListbox pricingFormapagoList; private List lsEmpresa; private List lsPricingVigencia; private List lsPricingImporte; @@ -164,7 +173,7 @@ public class EditarPricingController extends MyGenericForwardComposer { private List lsPricingOcupaAntecipa; private List lsPricingRuta; private List lsPricingTipoServicio; - private static Logger log = Logger.getLogger(EditarPricingController.class); + private List lsPricingFormapago; private Combobox cmbEmpresa; private Radio rdTransSi; private Radio rdTransNo; @@ -218,6 +227,9 @@ public class EditarPricingController extends MyGenericForwardComposer { private Button btnNovoTipoServicio; private Button btnApagarTipoServicio; private Button btnModificarTipoServicio; + private Button btnNovoFormapago; + private Button btnApagarFormapago; + private Button btnModificarFormapago; private boolean salvo = false; private Boolean gravarNovo = Boolean.TRUE; private Textbox nombrePricing; @@ -419,6 +431,18 @@ public class EditarPricingController extends MyGenericForwardComposer { } }); + // FormaPago + pricingFormapagoList.setItemRenderer(new RenderPricingFormaPago()); + lsPricingFormapago = new ArrayList(); + pricingFormapagoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingFormapago pFormapago = (PricingFormapago) pricingFormapagoList.getSelected(); + verPricingFormapago(pFormapago); + } + }); + if (pricing.getPricingId() != null) { pricing = pricingService.obtenerID(pricing.getPricingId()); @@ -458,6 +482,12 @@ public class EditarPricingController extends MyGenericForwardComposer { pricingTipoServicioList.setSelectedIndex(0); } + lsPricingFormapago = pricing.getPricingFormapagoList(); + pricingFormapagoList.setData(lsPricingFormapago); + if (lsPricingFormapago.size() > 0) { + pricingFormapagoList.setSelectedIndex(0); + } + lsPricingPuntoVenta = pricing.getPricingPuntoventaList(); pricingPuntoVentaList.setData(lsPricingPuntoVenta); if (lsPricingPuntoVenta.size() > 0) { @@ -500,6 +530,9 @@ public class EditarPricingController extends MyGenericForwardComposer { lsPricingTipoServicio = pricing.getPricingTipoServicioList(); pricingTipoServicioList.setData(lsPricingTipoServicio); + lsPricingFormapago = pricing.getPricingFormapagoList(); + pricingFormapagoList.setData(lsPricingFormapago); + if (pricing.getIndtransferible() == Boolean.FALSE) { rdTransNo.setChecked(true); } @@ -1929,13 +1962,87 @@ public class EditarPricingController extends MyGenericForwardComposer { verPricingTipoServicio(pTipoServicio); } else { try { - Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + log.error(ex.getMessage()); + } + } + } + + public void onClick$btnApagarFormaPago(Event ev) throws Exception { + PricingFormapago pFormapago = (PricingFormapago) pricingFormapagoList.getSelected(); + + if (pFormapago != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaFormaPago"), + Labels.getLabel("editarPricingController.windowFormaPago.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsPricingFormapago.remove(pFormapago); + + pFormapago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pFormapago.setFecmodif(Calendar.getInstance().getTime()); + pFormapago.setActivo(Pricing.EXCLUIDO); + + lsPricingFormapago.add(pFormapago); + pricingFormapagoList.removeItem(pFormapago); + + pricingFormapagoList.clearSelection(); + + pricing.setPricingFormapagoList(lsPricingFormapago); + pricingService.actualizacion(pricing); + + lsPricingFormapago = pricing.getPricingFormapagoList(); + pricingFormapagoList.setData(lsPricingFormapago); + + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoFormaPago(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + + PricingFormapago pFormapago = new PricingFormapago(); + pFormapago.setPricing(pricing); + verPricingFormapago(pFormapago); + } + + public void onClick$btnModificarFormaPago(Event ev) { + PricingFormapago pFormapago = (PricingFormapago) pricingFormapagoList.getSelected(); + + if (pFormapago != null) { + verPricingFormapago(pFormapago); + + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); } catch (InterruptedException ex) { java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); } } } + @SuppressWarnings({ "rawtypes", "unchecked" }) + private void verPricingFormapago(PricingFormapago pFormapago) { + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingFormapago", pFormapago); + args.put("pricingFormapagoList", pricingFormapagoList); + + openWindow("/gui/pricing/editarPricingFormapago.zul", + Labels.getLabel("editarPricingController.windowFormaPago.title"), args, MODAL); + } + public void onClick$btnInativar(Event ev) throws InterruptedException { try { int resp = Messagebox.show( @@ -2005,6 +2112,7 @@ public class EditarPricingController extends MyGenericForwardComposer { pricingAsientoList.setDisabled(desativar); pricingOcupaAntecipaList.setDisabled(desativar); pricingTipoServicioList.setDisabled(desativar); + pricingFormapagoList.setDisabled(desativar); btnNovoVigencia.setDisabled(desativar); btnApagarVigencia.setDisabled(desativar); btnModificarVigencia.setDisabled(desativar); @@ -2042,7 +2150,10 @@ public class EditarPricingController extends MyGenericForwardComposer { btnNovoTipoServicio.setDisabled(desativar); btnApagarTipoServicio.setDisabled(desativar); btnModificarTipoServicio.setDisabled(desativar); - + btnNovoFormapago.setDisabled(desativar); + btnApagarFormapago.setDisabled(desativar); + btnModificarFormapago.setDisabled(desativar); + btnCopiar.setDisabled(desativar); btnSalvar.setDisabled(desativar); } @@ -2286,4 +2397,5 @@ public class EditarPricingController extends MyGenericForwardComposer { public void setRadioPor(Radio radioPor) { this.radioPor = radioPor; } + } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingFormapagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingFormapagoController.java new file mode 100644 index 000000000..c615119ce --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingFormapagoController.java @@ -0,0 +1,121 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Radio; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingFormapago; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.service.PricingFormapagoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; + +@Controller("editarPricingFormapagoController") +@Scope("prototype") +public class EditarPricingFormapagoController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(EditarPricingFormapagoController.class); + + @Autowired + private FormaPagoService formaPagoService; + + @Autowired + private PricingFormapagoService pricingFormapagoService; + + private List lsFormaPago; + private PricingFormapago pricingFormapago; + private MyListbox pricingFormapagoList; + + private Radio si; + private Radio no; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + this.setPricingFormapago((PricingFormapago) Executions.getCurrent().getArg().get("pricingFormapago")); + this.setPricingFormapagoList((MyListbox) Executions.getCurrent().getArg().get("pricingFormapagoList")); + this.setLsFormaPago(formaPagoService.obtenerTodos()); + + super.doAfterCompose(comp); + + if (pricingFormapago.getPricingformapagoId() != null) { + if (pricingFormapago.getIndexcepcion()) { + si.setChecked(true); + } else { + no.setChecked(true); + } + } else { + no.setChecked(true); + } + } + + public void onClick$btnAdicionarFormaPago(Event ev) throws InterruptedException { + try { + if (pricingFormapago.getFormaPago() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowFormaPago.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + if (no.isChecked()) { + pricingFormapago.setIndexcepcion(Boolean.FALSE); + } else if (si.isChecked()) { + pricingFormapago.setIndexcepcion(Boolean.TRUE); + } + + if (pricingFormapago.getPricingformapagoId() != null) { + pricingFormapagoService.actualizacion(pricingFormapago); + pricingFormapagoList.updateItem(pricingFormapago); + + pricingFormapagoList.setData(pricingFormapago.getPricing().getPricingFormapagoList()); + + } else { + pricingFormapagoService.suscribir(pricingFormapago); + pricingFormapagoList.addItem(pricingFormapago); + } + closeWindow(); + + } + } catch (Exception ex) { + log.error(ex); + } + } + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + public PricingFormapago getPricingFormapago() { + return pricingFormapago; + } + + public void setPricingFormapago(PricingFormapago pricingFormapago) { + this.pricingFormapago = pricingFormapago; + } + + public MyListbox getPricingFormapagoList() { + return pricingFormapagoList; + } + + public void setPricingFormapagoList(MyListbox pricingFormapagoList) { + this.pricingFormapagoList = pricingFormapagoList; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java index 8cc6ffb34..b7ff44868 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java @@ -15,7 +15,6 @@ import org.zkoss.zul.Intbox; import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingOcupaAntecipa; -import com.rjconsultores.ventaboletos.exception.BusinessException; import com.rjconsultores.ventaboletos.service.PricingOcupaAntecipaService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagem; @@ -54,16 +53,16 @@ public class EditarPricingOcupaAntecipaController extends MyGenericForwardCompos } public void onClick$btnAdicionarOcupaAntecipa(Event ev) throws Exception { - + if ((cantasientosmin.getValue() != null || cantasientosmax.getValue() != null) - && (ocupacioninicial.getValue() != null || ocupacionfinal.getValue() != null)){ + && (ocupacioninicial.getValue() != null || ocupacionfinal.getValue() != null)) { Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.centoPorCant"), Labels.getLabel("editarPricingController.windowOcupacion.title"), Messagebox.OK, Messagebox.EXCLAMATION); return; } - + if ((cantasientosmin.getValue() == null && cantasientosmax.getValue() == null) && (cantasientosmin.getValue() == null && cantasientosmax.getValue() == null) && (ocupacioninicial.getValue() == null && ocupacionfinal.getValue() == null) @@ -73,16 +72,16 @@ public class EditarPricingOcupaAntecipaController extends MyGenericForwardCompos Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.ocAnt"), Labels.getLabel("editarPricingController.windowOcupacion.title"), Messagebox.OK, Messagebox.EXCLAMATION); - + return; } - + if ((cantasientosmin.getValue() == null && cantasientosmax.getValue() != null) - || (cantasientosmin.getValue() != null && cantasientosmax.getValue() == null) - || (ocupacioninicial.getValue() == null && ocupacionfinal.getValue() != null) - || (ocupacioninicial.getValue() != null && ocupacionfinal.getValue() == null) - || (cantdiasmin.getValue() == null && cantdiasmax.getValue() != null) - || (cantdiasmin.getValue() != null && cantdiasmax.getValue() == null)) { + || (cantasientosmin.getValue() != null && cantasientosmax.getValue() == null) + || (ocupacioninicial.getValue() == null && ocupacionfinal.getValue() != null) + || (ocupacioninicial.getValue() != null && ocupacionfinal.getValue() == null) + || (cantdiasmin.getValue() == null && cantdiasmax.getValue() != null) + || (cantdiasmin.getValue() != null && cantdiasmax.getValue() == null)) { Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.MinMax"), Labels.getLabel("editarPricingController.windowOcupacion.title"), Messagebox.OK, Messagebox.EXCLAMATION); @@ -90,34 +89,34 @@ public class EditarPricingOcupaAntecipaController extends MyGenericForwardCompos return; } - if (porcentaje.getValueDecimal() != null && importe.getValueDecimal() != null) { - + if (porcentaje.getValueDecimal() != null && importe.getValueDecimal() != null) { + + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.centoDin"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (porcentaje.getValueDecimal() == null && importe.getValueDecimal() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.centoDin"), Labels.getLabel("editarPricingController.windowOcupacion.title"), Messagebox.OK, Messagebox.EXCLAMATION); } else { - if (porcentaje.getValueDecimal() == null && importe.getValueDecimal() == null) { - - Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.centoDin"), + try { + if (pricingOcupaAntecipa.getPricingocupaantecipaId() != null) { + pricingOcupaAntecipaService.actualizacion(pricingOcupaAntecipa); + pricingOcupaAntecipaList.updateItem(pricingOcupaAntecipa); + } else { + pricingOcupaAntecipaService.suscribir(pricingOcupaAntecipa); + pricingOcupaAntecipaList.addItemNovo(pricingOcupaAntecipa); + } + closeWindow(); + } catch (Exception e) { + Messagebox.show(e.getLocalizedMessage(), Labels.getLabel("editarPricingController.windowOcupacion.title"), Messagebox.OK, Messagebox.EXCLAMATION); - } else { - try { - if (pricingOcupaAntecipa.getPricingocupaantecipaId() != null) { - pricingOcupaAntecipaService.actualizacion(pricingOcupaAntecipa); - pricingOcupaAntecipaList.updateItem(pricingOcupaAntecipa); - } else { - pricingOcupaAntecipaService.suscribir(pricingOcupaAntecipa); - pricingOcupaAntecipaList.addItemNovo(pricingOcupaAntecipa); - } - closeWindow(); - } catch (BusinessException e) { - Messagebox.show(e.getLocalizedMessage(), - Labels.getLabel("editarPricingController.windowOcupacion.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } } } + } } public void onClick$btnRemoverOcupaAntecipa(Event ev) { diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoServicioController.java index f439d03d1..a6d89ea1b 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoServicioController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoServicioController.java @@ -4,20 +4,13 @@ */ package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; -import com.rjconsultores.ventaboletos.entidad.Pricing; -import com.rjconsultores.ventaboletos.entidad.TipoServicio; -import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; -import com.rjconsultores.ventaboletos.service.TipoServicioService; -import com.rjconsultores.ventaboletos.service.PricingTipoServicioService; -import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; -import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; -import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import java.util.Calendar; +import java.util.List; + import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; -import java.util.List; import org.zkoss.util.resource.Labels; import org.zkoss.zhtml.Messagebox; import org.zkoss.zk.ui.Component; @@ -25,147 +18,157 @@ import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zul.Combobox; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.service.PricingTipoServicioService; +import com.rjconsultores.ventaboletos.service.TipoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; + /** - * + * * @author Rafius */ @Controller("editarPricingTipoServicioController") @Scope("prototype") public class EditarPricingTipoServicioController extends MyGenericForwardComposer { - @Autowired - private PricingTipoServicioService pricingTipoServicioService; - @Autowired - private TipoServicioService tipoServicioService; - private List lsTipoServicio; - private PricingTipoServicio pricingTipoServicio; - private MyListbox pricingTipoServicioList; - private Combobox cmbTipoServicio; - private static Logger log = Logger.getLogger(EditarPricingTipoServicioController.class); + private static final long serialVersionUID = 1L; - @Override - public void doAfterCompose(Component comp) throws Exception { + @Autowired + private PricingTipoServicioService pricingTipoServicioService; + @Autowired + private TipoServicioService tipoServicioService; + private List lsTipoServicio; + private PricingTipoServicio pricingTipoServicio; + private MyListbox pricingTipoServicioList; + private Combobox cmbTipoServicio; + private static Logger log = Logger.getLogger(EditarPricingTipoServicioController.class); - lsTipoServicio = tipoServicioService.obtenerTodos(); + @Override + public void doAfterCompose(Component comp) throws Exception { - pricingTipoServicio = (PricingTipoServicio) Executions.getCurrent().getArg().get("pricingTipoServicio"); - pricingTipoServicioList = (MyListbox) Executions.getCurrent().getArg().get("pricingTipoServicioList"); + lsTipoServicio = tipoServicioService.obtenerTodos(); - super.doAfterCompose(comp); + pricingTipoServicio = (PricingTipoServicio) Executions.getCurrent().getArg().get("pricingTipoServicio"); + pricingTipoServicioList = (MyListbox) Executions.getCurrent().getArg().get("pricingTipoServicioList"); + super.doAfterCompose(comp); - cmbTipoServicio.focus(); - } + cmbTipoServicio.focus(); + } - public void onClick$btnAdicionarTipoServicio(Event ev) throws Exception { - cmbTipoServicio.getValue(); + public void onClick$btnAdicionarTipoServicio(Event ev) throws Exception { + cmbTipoServicio.getValue(); - try { + try { - if (pricingTipoServicio.getTipoServicio() == null) { - Messagebox.show( - Labels.getLabel("MSG.Error.combobox"), - Labels.getLabel("editarPricingController.windowTipoServicio.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } else { + if (pricingTipoServicio.getTipoServicio() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { - Boolean existe = pricingTipoServicioService.obtenerPricingTipoServicio(pricingTipoServicio.getPricing(), (TipoServicio) cmbTipoServicio.getSelectedItem().getValue()); - if (existe) { - Messagebox.show( - Labels.getLabel("MSG.Registro.Existe"), - Labels.getLabel("editarPricingController.windowTipoServicio.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } else { - if (pricingTipoServicio.getPricingtiposervicioId() != null) { - pricingTipoServicioService.actualizacion(pricingTipoServicio); - pricingTipoServicioList.updateItem(pricingTipoServicio); - } else { - pricingTipoServicioService.suscribir(pricingTipoServicio); - pricingTipoServicioList.addItem(pricingTipoServicio); - } - closeWindow(); - } - } - } catch (Exception ex) { - log.error(ex); - } - } + Boolean existe = pricingTipoServicioService.obtenerPricingTipoServicio(pricingTipoServicio.getPricing(), (TipoServicio) cmbTipoServicio.getSelectedItem().getValue()); + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingTipoServicio.getPricingtiposervicioId() != null) { + pricingTipoServicioService.actualizacion(pricingTipoServicio); + pricingTipoServicioList.updateItem(pricingTipoServicio); + } else { + pricingTipoServicioService.suscribir(pricingTipoServicio); + pricingTipoServicioList.addItem(pricingTipoServicio); + } + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + } + } - public void onClick$btnRemoverTipoServicio(Event ev) { - try { - PricingTipoServicio pTipoServicio = (PricingTipoServicio) pricingTipoServicioList.getSelected(); - if (pTipoServicio != null) { - int resp = Messagebox.show( - Labels.getLabel("editarPricingController.MSG.borrarPerguntaTipoServicio"), - Labels.getLabel("editarPricingController.windowTipoServicio.title"), - Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + public void onClick$btnRemoverTipoServicio(Event ev) { + try { + PricingTipoServicio pTipoServicio = (PricingTipoServicio) pricingTipoServicioList.getSelected(); + if (pTipoServicio != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaTipoServicio"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); - if (resp == Messagebox.YES) { - pricingTipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - pricingTipoServicio.setFecmodif(Calendar.getInstance().getTime()); - pricingTipoServicio.setActivo(Pricing.EXCLUIDO); + if (resp == Messagebox.YES) { + pricingTipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingTipoServicio.setFecmodif(Calendar.getInstance().getTime()); + pricingTipoServicio.setActivo(Pricing.EXCLUIDO); - pricingTipoServicioList.removeItem(pricingTipoServicio); - pricingTipoServicioService.borrar(pricingTipoServicio); - closeWindow(); - } - } else { - Messagebox.show( - Labels.getLabel("editarPricingController.MSG.selectItem"), - Labels.getLabel("editarPricingController.windowTipoServicio.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } - } catch (Exception ex) { - log.error(ex); - } + pricingTipoServicioList.removeItem(pricingTipoServicio); + pricingTipoServicioService.borrar(pricingTipoServicio); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } - } + } - public PricingTipoServicio getPricingTipoServicio() { - return pricingTipoServicio; - } + public PricingTipoServicio getPricingTipoServicio() { + return pricingTipoServicio; + } - public void setPricingTipoServicio(PricingTipoServicio pricingTipoServicio) { - this.pricingTipoServicio = pricingTipoServicio; - } + public void setPricingTipoServicio(PricingTipoServicio pricingTipoServicio) { + this.pricingTipoServicio = pricingTipoServicio; + } - public MyListbox getPricingTipoServicioList() { - return pricingTipoServicioList; - } + public MyListbox getPricingTipoServicioList() { + return pricingTipoServicioList; + } - public void setPricingTipoServicioList(MyListbox pricingTipoServicioList) { - this.pricingTipoServicioList = pricingTipoServicioList; - } + public void setPricingTipoServicioList(MyListbox pricingTipoServicioList) { + this.pricingTipoServicioList = pricingTipoServicioList; + } - public PricingTipoServicioService getPricingTipoServicioService() { - return pricingTipoServicioService; - } + public PricingTipoServicioService getPricingTipoServicioService() { + return pricingTipoServicioService; + } - public void setPricingTipoServicioService(PricingTipoServicioService pricingTipoServicioService) { - this.pricingTipoServicioService = pricingTipoServicioService; - } + public void setPricingTipoServicioService(PricingTipoServicioService pricingTipoServicioService) { + this.pricingTipoServicioService = pricingTipoServicioService; + } - public TipoServicioService getTipoServicioService() { - return tipoServicioService; - } + public TipoServicioService getTipoServicioService() { + return tipoServicioService; + } - public void setTipoServicioService(TipoServicioService tipoServicioService) { - this.tipoServicioService = tipoServicioService; - } + public void setTipoServicioService(TipoServicioService tipoServicioService) { + this.tipoServicioService = tipoServicioService; + } - public static Logger getLog() { - return log; - } + public static Logger getLog() { + return log; + } - public static void setLog(Logger log) { - EditarPricingTipoServicioController.log = log; - } + public static void setLog(Logger log) { + EditarPricingTipoServicioController.log = log; + } - public List getLsTipoServicio() { - return lsTipoServicio; - } + public List getLsTipoServicio() { + return lsTipoServicio; + } - public void setLsTipoServicio(List lsTipoServicio) { - this.lsTipoServicio = lsTipoServicio; - } + public void setLsTipoServicio(List lsTipoServicio) { + this.lsTipoServicio = lsTipoServicio; + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarEstacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarEstacionController.java index 08fe19a35..b4130305a 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarEstacionController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarEstacionController.java @@ -48,8 +48,10 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEstacionImpreso public class EditarEstacionController extends MyGenericForwardComposer { private static final long serialVersionUID = 1L; + @Autowired private EstacionService estacionService; + private MyListbox estacionList; private MyListbox estacionSitefList; private MyListbox estacionImpresoraList; @@ -145,16 +147,17 @@ public class EditarEstacionController extends MyGenericForwardComposer { estacion.setLsEstacionImpresora(estacionImpresoraList.getListData()); estacionService.suscribirActualizar(estacion); + Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"), - Labels.getLabel("editarEstacionController.window.title"), - Messagebox.OK, Messagebox.INFORMATION); + Labels.getLabel("editarEstacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); estacionList.updateItem(estacion); closeWindow(); } catch (BusinessException e) { Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); + Messagebox.OK, Messagebox.EXCLAMATION); } } @@ -280,6 +283,7 @@ public class EditarEstacionController extends MyGenericForwardComposer { estacionImpresora.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); estacionImpresoraList.addItemNovo(estacionImpresora); + } } @@ -293,6 +297,7 @@ public class EditarEstacionController extends MyGenericForwardComposer { estacionImpresoraList.removeSelectedItem(); if (ei.getEstacionImpresoraId() != null) { + ei.setFecmodif(Calendar.getInstance().getTime()); ei.setActivo(Boolean.FALSE); ei.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); @@ -300,4 +305,5 @@ public class EditarEstacionController extends MyGenericForwardComposer { estacionImpresoraList.addItemNovo(ei); } } + } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbLevanteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbLevanteController.java new file mode 100644 index 000000000..80582abcc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbLevanteController.java @@ -0,0 +1,240 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.TaxaEmbLevanteCtrl; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TaxaEmbLevanteCtrlService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTaxaEmbLevanteCtrl; + +@Controller("busquedaTaxaEmbLevanteController") +@Scope("prototype") +public class BusquedaTaxaEmbLevanteController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(BusquedaTaxaEmbLevanteController.class); + + @Autowired + private TaxaEmbLevanteCtrlService taxaEmbLevanteCtrlService; + + @Autowired + private RutaService rutaService; + + @Autowired + private transient PagedListWrapper plwTaxaEmbLevanteCtrl; + + private MyListbox taxaEmbLevanteCtrlList; + private TaxaEmbLevanteCtrl taxaEmbLevanteCtrl; + + private Paging pagingTaxaEmbLevanteCtrl; + + private List lsRuta; + private Combobox cmbRuta; + + private Combobox cmbParadaOrigem; + private List lsParadaOrigem; + private Combobox cmbParadaDestino; + private List lsParadaDestino; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsRuta = rutaService.obtenerTodos(); + lsParadaOrigem = new ArrayList(); + lsParadaDestino = new ArrayList(); + + super.doAfterCompose(comp); + + taxaEmbLevanteCtrlList.setItemRenderer(new RenderTaxaEmbLevanteCtrl()); + taxaEmbLevanteCtrlList.addEventListener("onClick", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + taxaEmbLevanteCtrl = (TaxaEmbLevanteCtrl) taxaEmbLevanteCtrlList.getSelected(); + } + }); + + taxaEmbLevanteCtrlList.addEventListener("onDoubleClick", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + taxaEmbLevanteCtrl = (TaxaEmbLevanteCtrl) taxaEmbLevanteCtrlList.getSelected(); + itemSelecionado(taxaEmbLevanteCtrl); + } + }); + + refreshLista(); + } + + public void onSelect$cmbRuta(Event ev) { + Ruta ruta = (Ruta) cmbRuta.getSelectedItem().getValue(); + ruta = rutaService.obtenerID(ruta.getRutaId()); + + for (RutaSecuencia rutaSecuencia : ruta.getRutaSecuenciaList()) { + lsParadaOrigem.add(rutaSecuencia.getTramo().getOrigem()); + lsParadaDestino.add(rutaSecuencia.getTramo().getDestino()); + } + + BindingListModel listModelParadaOrigem = new BindingListModelList(lsParadaOrigem, true); + cmbParadaOrigem.setModel(listModelParadaOrigem); + + BindingListModel listModelParadaDestino = new BindingListModelList(lsParadaDestino, true); + cmbParadaDestino.setModel(listModelParadaDestino); + } + + public void onClick$btnNovo(Event ev) { + itemSelecionado(new TaxaEmbLevanteCtrl()); + } + + public void itemSelecionado(TaxaEmbLevanteCtrl taxa) { + Map args = new HashMap(); + args.put("taxaEmbLevanteCtrl", taxa); + args.put("taxaEmbLevanteCtrlList", taxaEmbLevanteCtrlList); + + openWindow("/gui/tarifas/editarTaxaEmbLevante.zul", + Labels.getLabel("busquedaTaxaEmbLevanteController.editar.window.title"), args, MODAL); + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show( + Labels.getLabel("busquedaTaxaEmbLevanteController.MSG.borrarPergunta"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + taxaEmbLevanteCtrlService.borrar(taxaEmbLevanteCtrl); + Messagebox.show( + Labels.getLabel("busquedaTaxaEmbLevanteController.MSG.borrarOK"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + taxaEmbLevanteCtrlList.removeItem(taxaEmbLevanteCtrl); + + } + } catch (Exception ex) { + log.error("Erro apagar pricing : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void refreshLista() { + HibernateSearchObject busquedaTaxaEmbLevanteCtrl = + new HibernateSearchObject(TaxaEmbLevanteCtrl.class, + pagingTaxaEmbLevanteCtrl.getPageSize()); + Comboitem rutaItem = cmbRuta.getSelectedItem(); + if (rutaItem != null){ + Ruta ruta = (Ruta) rutaItem.getValue(); + busquedaTaxaEmbLevanteCtrl.addFilterEqual("ruta", ruta); + } + + Comboitem origenItem = cmbParadaOrigem.getSelectedItem(); + if (origenItem != null){ + Parada origen = (Parada) origenItem.getValue(); + busquedaTaxaEmbLevanteCtrl.addFilterEqual("origem", origen); + } + + Comboitem destinoItem = cmbParadaDestino.getSelectedItem(); + if (origenItem != null){ + Parada destino = (Parada) destinoItem.getValue(); + busquedaTaxaEmbLevanteCtrl.addFilterEqual("destino", destino); + } + + busquedaTaxaEmbLevanteCtrl.addFilterEqual("activo", Boolean.TRUE); + busquedaTaxaEmbLevanteCtrl.addSortAsc("ruta.descruta"); + + plwTaxaEmbLevanteCtrl.init(busquedaTaxaEmbLevanteCtrl, taxaEmbLevanteCtrlList, pagingTaxaEmbLevanteCtrl); + + if (taxaEmbLevanteCtrlList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public MyListbox getTaxaEmbLevanteCtrlList() { + return taxaEmbLevanteCtrlList; + } + + public void setTaxaEmbLevanteCtrlList(MyListbox taxaEmbLevanteCtrlList) { + this.taxaEmbLevanteCtrlList = taxaEmbLevanteCtrlList; + } + + public Paging getPagingTaxaEmbLevanteCtrl() { + return pagingTaxaEmbLevanteCtrl; + } + + public void setPagingTaxaEmbLevanteCtrl(Paging pagingTaxaEmbLevanteCtrl) { + this.pagingTaxaEmbLevanteCtrl = pagingTaxaEmbLevanteCtrl; + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public List getLsParadaOrigem() { + return lsParadaOrigem; + } + + public void setLsParadaOrigem(List lsParadaOrigem) { + this.lsParadaOrigem = lsParadaOrigem; + } + + public List getLsParadaDestino() { + return lsParadaDestino; + } + + public void setLsParadaDestino(List lsParadaDestino) { + this.lsParadaDestino = lsParadaDestino; + } + + public PagedListWrapper getPlwTaxaEmbLevanteCtrl() { + return plwTaxaEmbLevanteCtrl; + } + + public void setPlwTaxaEmbLevanteCtrl(PagedListWrapper plwTaxaEmbLevanteCtrl) { + this.plwTaxaEmbLevanteCtrl = plwTaxaEmbLevanteCtrl; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbarqueKmController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbarqueKmController.java index da0562628..0c303c07a 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbarqueKmController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTaxaEmbarqueKmController.java @@ -4,15 +4,9 @@ */ package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; -import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente; -import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm; -import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; -import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; -import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; -import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; -import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTaxaEmbarqueOrgao; import java.util.HashMap; import java.util.Map; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -24,125 +18,134 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zul.Paging; import org.zkoss.zul.Textbox; +import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente; +import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTaxaEmbarqueOrgao; + /** - * + * * @author Administrador */ @Controller("busquedaTaxaEmbarqueKmController") @Scope("prototype") public class BusquedaTaxaEmbarqueKmController extends MyGenericForwardComposer { - @Autowired - private transient PagedListWrapper plwOrgao; - private MyListbox taxaEmbarqueKmList; - private Paging pagingTaxaEmbarqueKm; - private Textbox txtOrgao; + private static final long serialVersionUID = 1L; + @Autowired + private transient PagedListWrapper plwOrgao; + private MyListbox taxaEmbarqueKmList; + private Paging pagingTaxaEmbarqueKm; + private Textbox txtOrgao; - public Paging getPagingTaxaEmbarqueKm() { - return pagingTaxaEmbarqueKm; - } + public Paging getPagingTaxaEmbarqueKm() { + return pagingTaxaEmbarqueKm; + } - public void setPagingTaxaEmbarqueKm(Paging pagingTaxaEmbarqueKm) { - this.pagingTaxaEmbarqueKm = pagingTaxaEmbarqueKm; - } + public void setPagingTaxaEmbarqueKm(Paging pagingTaxaEmbarqueKm) { + this.pagingTaxaEmbarqueKm = pagingTaxaEmbarqueKm; + } - public PagedListWrapper getPlwOrgao() { - return plwOrgao; - } + public PagedListWrapper getPlwOrgao() { + return plwOrgao; + } - public void setPlwOrgao(PagedListWrapper plwOrgao) { - this.plwOrgao = plwOrgao; - } + public void setPlwOrgao(PagedListWrapper plwOrgao) { + this.plwOrgao = plwOrgao; + } - public MyListbox getTaxaEmbarqueKmList() { - return taxaEmbarqueKmList; - } + public MyListbox getTaxaEmbarqueKmList() { + return taxaEmbarqueKmList; + } - public void setTaxaEmbarqueKmList(MyListbox taxaEmbarqueKmList) { - this.taxaEmbarqueKmList = taxaEmbarqueKmList; - } + public void setTaxaEmbarqueKmList(MyListbox taxaEmbarqueKmList) { + this.taxaEmbarqueKmList = taxaEmbarqueKmList; + } - @Override - public void doAfterCompose(Component comp) throws Exception { - super.doAfterCompose(comp); + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); - taxaEmbarqueKmList.setItemRenderer(new RenderTaxaEmbarqueOrgao()); - taxaEmbarqueKmList.addEventListener("onDoubleClick", new EventListener() { + taxaEmbarqueKmList.setItemRenderer(new RenderTaxaEmbarqueOrgao()); + taxaEmbarqueKmList.addEventListener("onDoubleClick", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - OrgaoConcedente c = (OrgaoConcedente) taxaEmbarqueKmList.getSelected(); - verTaxaEmbarqueKm(c); - } - }); + @Override + public void onEvent(Event event) throws Exception { + OrgaoConcedente c = (OrgaoConcedente) taxaEmbarqueKmList.getSelected(); + verTaxaEmbarqueKm(c); + } + }); - refreshLista(); + refreshLista(); - txtOrgao.focus(); - } + txtOrgao.focus(); + } - private void verTaxaEmbarqueKm(OrgaoConcedente o) { - if (o == null) { - return; - } + private void verTaxaEmbarqueKm(OrgaoConcedente o) { + if (o == null) { + return; + } - Map args = new HashMap(); - args.put("orgao", o); - args.put("taxaEmbarqueKmList", taxaEmbarqueKmList); + Map args = new HashMap(); + args.put("orgao", o); + args.put("taxaEmbarqueKmList", taxaEmbarqueKmList); - openWindow("/gui/tarifas/editarTaxaEmbarqueKm.zul", - Labels.getLabel("busquedaTaxaEmbarqueKmController.window.title"), - args, MODAL); - } + openWindow("/gui/tarifas/editarTaxaEmbarqueKm.zul", + Labels.getLabel("busquedaTaxaEmbarqueKmController.window.title"), + args, MODAL); + } - private void refreshLista() { + private void refreshLista() { - HibernateSearchObject taxaEmbarqueKmBusqueda =new HibernateSearchObject(OrgaoConcedente.class,pagingTaxaEmbarqueKm.getPageSize()); + HibernateSearchObject taxaEmbarqueKmBusqueda = new HibernateSearchObject(OrgaoConcedente.class, pagingTaxaEmbarqueKm.getPageSize()); - taxaEmbarqueKmBusqueda.addFilterEqual("activo", Boolean.TRUE); + taxaEmbarqueKmBusqueda.addFilterEqual("activo", Boolean.TRUE); - if (!txtOrgao.getValue().equals("")) { - taxaEmbarqueKmBusqueda.addFilterLike("descOrgao","%" + txtOrgao.getText().trim().concat("%")); - } + if (!txtOrgao.getValue().equals("")) { + taxaEmbarqueKmBusqueda.addFilterLike("descOrgao", "%" + txtOrgao.getText().trim().concat("%")); + } - taxaEmbarqueKmBusqueda.addSortAsc("descOrgao"); + taxaEmbarqueKmBusqueda.addSortAsc("descOrgao"); - plwOrgao.init(taxaEmbarqueKmBusqueda, taxaEmbarqueKmList, pagingTaxaEmbarqueKm); + plwOrgao.init(taxaEmbarqueKmBusqueda, taxaEmbarqueKmList, pagingTaxaEmbarqueKm); - if (taxaEmbarqueKmList.getData().length == 0) { - try { - Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), - Labels.getLabel("busquedaTaxaEmbarqueKmController.window.title"), - Messagebox.OK, Messagebox.INFORMATION); - } catch (InterruptedException ex) { - } - } - } + if (taxaEmbarqueKmList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTaxaEmbarqueKmController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } - public void onClick$btnPesquisa(Event ev) { - refreshLista(); - } + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } - public void onClick$btnRefresh(Event ev) { - refreshLista(); - } + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } - public void onClick$btnNovo(Event ev) { - verTaxaEmbarqueKm(new TaxaEmbarqueKm()); - } + public void onClick$btnNovo(Event ev) { + verTaxaEmbarqueKm(new TaxaEmbarqueKm()); + } - private void verTaxaEmbarqueKm(TaxaEmbarqueKm tx) { - if (tx == null) { - return; - } + private void verTaxaEmbarqueKm(TaxaEmbarqueKm tx) { + if (tx == null) { + return; + } - Map args = new HashMap(); - args.put("orgao", null); - args.put("taxaEmbarqueKm", tx); - args.put("taxaEmbarqueKmList", taxaEmbarqueKmList); + Map args = new HashMap(); + args.put("orgao", null); + args.put("taxaEmbarqueKm", tx); + args.put("taxaEmbarqueKmList", taxaEmbarqueKmList); - openWindow("/gui/tarifas/editarTaxaEmbarqueKm.zul", - Labels.getLabel("busquedaTaxaEmbarqueKmController.window.title"), - args, MODAL); - } + openWindow("/gui/tarifas/editarTaxaEmbarqueKm.zul", + Labels.getLabel("busquedaTaxaEmbarqueKmController.window.title"), + args, MODAL); + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteController.java new file mode 100644 index 000000000..9874c0064 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteController.java @@ -0,0 +1,300 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.TaxaEmbLevante; +import com.rjconsultores.ventaboletos.entidad.TaxaEmbLevanteCtrl; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TaxaEmbLevanteCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTaxaEmbLevante; + +@Controller("editarTaxaEmbLevanteController") +@Scope("prototype") +public class EditarTaxaEmbLevanteController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(EditarTaxaEmbLevanteController.class); + + @Autowired + private TaxaEmbLevanteCtrlService taxaEmbLevanteCtrlService; + + @Autowired + private RutaService rutaService; + @Autowired + private ParadaService paradaService; + + private TaxaEmbLevante taxaEmbLevante; + private TaxaEmbLevanteCtrl taxaEmbLevanteCtrl; + private MyListbox taxaEmbLevanteCtrlList; + + private MyListbox taxaEmbLevanteList; + + private List lsRuta; + private Combobox cmbRuta; + + private Combobox cmbParadaOrigem; + private List lsParadaOrigem; + private Combobox cmbParadaDestino; + private List lsParadaDestino; + + private List listTaxaLevante; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + taxaEmbLevanteCtrl = (TaxaEmbLevanteCtrl) Executions.getCurrent().getArg().get("taxaEmbLevanteCtrl"); + taxaEmbLevanteCtrlList = (MyListbox) Executions.getCurrent().getArg().get("taxaEmbLevanteCtrlList"); + + if (taxaEmbLevanteCtrl.getTaxaEmbLevanteCtrlId() != null) + taxaEmbLevanteCtrl = taxaEmbLevanteCtrlService.obtenerID(taxaEmbLevanteCtrl.getTaxaEmbLevanteCtrlId()); + + listTaxaLevante = taxaEmbLevanteCtrl.getTaxaEmbLevanteList(); + + super.doAfterCompose(comp); + + taxaEmbLevanteList.setItemRenderer(new RenderTaxaEmbLevante()); + taxaEmbLevanteList.addEventListener("onClick", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + taxaEmbLevante = (TaxaEmbLevante) taxaEmbLevanteList.getSelected(); + } + }); + + taxaEmbLevanteList.addEventListener("onDoubleClick", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + taxaEmbLevante = (TaxaEmbLevante) taxaEmbLevanteList.getSelected(); + itemSelecionado(taxaEmbLevante); + } + }); + + lsRuta = rutaService.obtenerTodos(); + lsParadaOrigem = new ArrayList(); + lsParadaDestino = new ArrayList(); + + if (taxaEmbLevanteCtrl.getTaxaEmbLevanteCtrlId() != null) { + + Comboitem ci = new Comboitem(taxaEmbLevanteCtrl.getRuta().toString()); + ci.setAttribute("value", taxaEmbLevanteCtrl.getRuta()); + ci.setValue(taxaEmbLevanteCtrl.getRuta()); + ci.setParent(cmbRuta); + cmbRuta.setSelectedItem(ci); + + this.selectRuta(); + + ci = new Comboitem(taxaEmbLevanteCtrl.getOrigem().getDescparada()); + ci.setAttribute("value", taxaEmbLevanteCtrl.getOrigem()); + ci.setValue(taxaEmbLevanteCtrl.getOrigem()); + ci.setParent(cmbParadaOrigem); + cmbParadaOrigem.setSelectedItem(ci); + + ci = new Comboitem(taxaEmbLevanteCtrl.getDestino().getDescparada()); + ci.setAttribute("value", taxaEmbLevanteCtrl.getDestino()); + ci.setValue(taxaEmbLevanteCtrl.getDestino()); + ci.setParent(cmbParadaDestino); + cmbParadaDestino.setSelectedItem(ci); + + taxaEmbLevanteCtrl = taxaEmbLevanteCtrlService.obtenerID(taxaEmbLevanteCtrl.getTaxaEmbLevanteCtrlId()); + List list = taxaEmbLevanteCtrl.getTaxaEmbLevanteList(); + taxaEmbLevanteList.setData(list); + + } else { + taxaEmbLevanteList.setData(new ArrayList()); + } + } + + public void itemSelecionado(TaxaEmbLevante taxa) { + Map args = new HashMap(); + args.put("taxaEmbLevante", taxa); + args.put("taxaEmbLevanteList", taxaEmbLevanteList); + args.put("taxaEmbLevanteCtrl", taxaEmbLevanteCtrl); + args.put("listTaxaLevante", listTaxaLevante); + + openWindow("/gui/tarifas/editarTaxaEmbLevanteParada.zul", + Labels.getLabel("busquedaTaxaEmbLevanteController.editar.window.title"), args, MODAL); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + if (cmbRuta.getSelectedItem().getValue() != null) { + taxaEmbLevanteCtrl.setRuta((Ruta) cmbRuta.getSelectedItem().getValue()); + } else { + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + if (cmbParadaOrigem.getSelectedItem().getValue() != null) { + taxaEmbLevanteCtrl.setOrigem((Parada) cmbParadaOrigem.getSelectedItem().getValue()); + } else { + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + if (cmbParadaDestino.getSelectedItem().getValue() != null) { + taxaEmbLevanteCtrl.setDestino((Parada) cmbParadaDestino.getSelectedItem().getValue()); + } else { + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + taxaEmbLevanteCtrl.setTaxaEmbLevanteList(listTaxaLevante); + + if (taxaEmbLevanteCtrl.getTaxaEmbLevanteCtrlId() != null) { + + taxaEmbLevanteCtrlList.removeItem(taxaEmbLevanteCtrl); + taxaEmbLevanteCtrlService.actualizacion(taxaEmbLevanteCtrl); + taxaEmbLevanteCtrlList.updateItem(taxaEmbLevanteCtrl); + + Messagebox.show( + Labels.getLabel("busquedaTaxaEmbLevanteControllerMSG.suscribirOK"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } else { + taxaEmbLevanteCtrlService.suscribir(taxaEmbLevanteCtrl); + taxaEmbLevanteCtrlList.addItemNovo(taxaEmbLevanteCtrl); + + Messagebox.show( + Labels.getLabel("busquedaTaxaEmbLevanteControllerMSG.suscribirOK"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show( + Labels.getLabel("busquedaTaxaEmbLevanteController.MSG.borrarPergunta"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + taxaEmbLevante.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + taxaEmbLevante.setFecmodif(Calendar.getInstance().getTime()); + taxaEmbLevante.setActivo(Boolean.FALSE); + + int index = listTaxaLevante.indexOf(taxaEmbLevante); + listTaxaLevante.set(index, taxaEmbLevante); + + taxaEmbLevanteList.removeItem(taxaEmbLevante); + + } + } catch (Exception ex) { + log.error("Erro apagar pricing : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovo(Event ev) { + this.itemSelecionado(new TaxaEmbLevante()); + } + + public void onSelect$cmbRuta(Event ev) { + this.selectRuta(); + } + + public void selectRuta() { + + Ruta ruta = (Ruta) cmbRuta.getSelectedItem().getValue(); + ruta = rutaService.obtenerID(ruta.getRutaId()); + + for (RutaSecuencia rutaSecuencia : ruta.getRutaSecuenciaList()) { + lsParadaOrigem.add(rutaSecuencia.getTramo().getOrigem()); + lsParadaDestino.add(rutaSecuencia.getTramo().getDestino()); + } + lsParadaDestino.add(paradaService.obtenerID(Parada.ID_PARADA_TODOS)); + + BindingListModel listModelParadaOrigem = new BindingListModelList(lsParadaOrigem, true); + cmbParadaOrigem.setModel(listModelParadaOrigem); + + BindingListModel listModelParadaDestino = new BindingListModelList(lsParadaDestino, true); + cmbParadaDestino.setModel(listModelParadaDestino); + + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public List getLsParadaOrigem() { + return lsParadaOrigem; + } + + public void setLsParadaOrigem(List lsParadaOrigem) { + this.lsParadaOrigem = lsParadaOrigem; + } + + public List getLsParadaDestino() { + return lsParadaDestino; + } + + public void setLsParadaDestino(List lsParadaDestino) { + this.lsParadaDestino = lsParadaDestino; + } + + public TaxaEmbLevanteCtrl getTaxaEmbLevanteCtrl() { + return taxaEmbLevanteCtrl; + } + + public void setTaxaEmbLevanteCtrl(TaxaEmbLevanteCtrl taxaEmbLevanteCtrl) { + this.taxaEmbLevanteCtrl = taxaEmbLevanteCtrl; + } + + public MyListbox getTaxaEmbLevanteCtrlList() { + return taxaEmbLevanteCtrlList; + } + + public void setTaxaEmbLevanteCtrlList(MyListbox taxaEmbLevanteCtrlList) { + this.taxaEmbLevanteCtrlList = taxaEmbLevanteCtrlList; + } + + public TaxaEmbLevante getTaxaEmbLevante() { + return taxaEmbLevante; + } + + public void setTaxaEmbLevante(TaxaEmbLevante taxaEmbLevante) { + this.taxaEmbLevante = taxaEmbLevante; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteParadaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteParadaController.java new file mode 100644 index 000000000..fe3ab0c7c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTaxaEmbLevanteParadaController.java @@ -0,0 +1,138 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import java.util.Calendar; +import java.util.List; + +import org.apache.commons.lang.math.NumberUtils; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Comboitem; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TaxaEmbLevante; +import com.rjconsultores.ventaboletos.entidad.TaxaEmbLevanteCtrl; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; + +@Controller("editarTaxaEmbLevanteParadaController") +@Scope("prototype") +public class EditarTaxaEmbLevanteParadaController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + + private MyComboboxParada cmbParada; + private MyTextboxDecimal txImporte; + + private TaxaEmbLevanteCtrl taxaEmbLevanteCtrl; + private TaxaEmbLevante taxaEmbLevante; + private MyListbox taxaEmbLevanteList; + + private List listTaxaLevante; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + taxaEmbLevanteCtrl = (TaxaEmbLevanteCtrl) Executions.getCurrent().getArg().get("taxaEmbLevanteCtrl"); + taxaEmbLevante = (TaxaEmbLevante) Executions.getCurrent().getArg().get("taxaEmbLevante"); + taxaEmbLevanteList = (MyListbox) Executions.getCurrent().getArg().get("taxaEmbLevanteList"); + listTaxaLevante = ((List) Executions.getCurrent().getArg().get("listTaxaLevante")); + + super.doAfterCompose(comp); + + if (taxaEmbLevante.getTaxaEmbLevanteId() != null) { + Comboitem ci = new Comboitem(taxaEmbLevante.getParada().toString()); + ci.setAttribute("value", taxaEmbLevante.getParada()); + ci.setValue(taxaEmbLevante.getParada()); + ci.setParent(cmbParada); + cmbParada.setSelectedItem(ci); + + txImporte.setValue(taxaEmbLevante.getImporte().toString()); + } else { + txImporte.setValue("0"); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + if (cmbParada.getSelectedItem().getValue() != null) { + taxaEmbLevante.setParada((Parada) cmbParada.getSelectedItem().getValue()); + } else { + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + if (txImporte.getValue() != null) { + taxaEmbLevante.setImporte(NumberUtils.createBigDecimal(txImporte.getValue().replace(",", "."))); + } else { + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + taxaEmbLevante.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + taxaEmbLevante.setFecmodif(Calendar.getInstance().getTime()); + taxaEmbLevante.setActivo(Boolean.TRUE); + + if (taxaEmbLevante.getTaxaEmbLevanteId() != null) { + taxaEmbLevanteList.removeItem(taxaEmbLevante); + + int index = listTaxaLevante.indexOf(taxaEmbLevante); + listTaxaLevante.set(index, taxaEmbLevante); + taxaEmbLevanteList.updateItem(taxaEmbLevante); + + } else { + boolean existeParada = false; + for (TaxaEmbLevante taxa : listTaxaLevante) { + if (taxa.getParada().equals(taxaEmbLevante.getParada())) + existeParada = true; + } + if (!existeParada) { + taxaEmbLevante.setTaxaEmbLevanteCtrl(taxaEmbLevanteCtrl); + listTaxaLevante.add(taxaEmbLevante); + taxaEmbLevanteList.addItemNovo(taxaEmbLevante); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + closeWindow(); + + } + + public TaxaEmbLevante getTaxaEmbLevante() { + return taxaEmbLevante; + } + + public void setTaxaEmbLevante(TaxaEmbLevante taxaEmbLevante) { + this.taxaEmbLevante = taxaEmbLevante; + } + + public MyListbox getTaxaEmbLevanteList() { + return taxaEmbLevanteList; + } + + public void setTaxaEmbLevanteList(MyListbox taxaEmbLevanteList) { + this.taxaEmbLevanteList = taxaEmbLevanteList; + } + + public TaxaEmbLevanteCtrl getTaxaEmbLevanteCtrl() { + return taxaEmbLevanteCtrl; + } + + public void setTaxaEmbLevanteCtrl(TaxaEmbLevanteCtrl taxaEmbLevanteCtrl) { + this.taxaEmbLevanteCtrl = taxaEmbLevanteCtrl; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java index 0dae96c5b..824d73a0a 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java @@ -4,10 +4,9 @@ */ package com.rjconsultores.ventaboletos.web.utilerias; -import com.rjconsultores.ventaboletos.entidad.Parada; -import com.rjconsultores.ventaboletos.service.ParadaService; import java.util.ArrayList; import java.util.List; + import org.apache.log4j.Logger; import org.zkoss.util.resource.Labels; import org.zkoss.zk.ui.WrongValueException; @@ -19,126 +18,138 @@ import org.zkoss.zkplus.databind.BindingListModelList; import org.zkoss.zkplus.spring.SpringUtil; import org.zkoss.zul.Combobox; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ParadaService; + /** - * + * * @author Administrador */ public class MyComboboxParada extends Combobox { - private static Logger log = Logger.getLogger(MyComboboxParada.class); - public final static int minLength = 2; - private ParadaService paradaService; - private List lsParadas; - private Parada initialValue; - private Integer indiceSelected = null; - private boolean sinTodos = false; - private Integer ID_TODOS = -1; + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(MyComboboxParada.class); + public final static int minLength = 2; + private ParadaService paradaService; + private List lsParadas; + private Parada initialValue; + private Integer indiceSelected = null; + private boolean sinTodos = false; + private Integer ID_TODOS = -1; - public MyComboboxParada() { - super(); - - paradaService = (ParadaService) SpringUtil.getBean("paradaService"); - lsParadas = new ArrayList(); + public MyComboboxParada() { + super(); - this.setAutodrop(false); - this.setAutocomplete(false); + paradaService = (ParadaService) SpringUtil.getBean("paradaService"); + lsParadas = new ArrayList(); - this.addEventListener("onOK", new EventListener() { + this.setAutodrop(false); + this.setAutocomplete(false); - @Override - public void onEvent(Event event) throws Exception { - String strParada = MyComboboxParada.this.getText().toUpperCase(); - if (strParada.length() < MyComboboxParada.minLength) { - return; - } - if (!strParada.isEmpty()) { - lsParadas = paradaService.buscaLike(strParada); + this.addEventListener("onOK", new EventListener() { - if (sinTodos) { - log.debug("Sin todos"); - Parada p = paradaService.obtenerID(ID_TODOS); - lsParadas.remove(p); - } + @Override + public void onEvent(Event event) throws Exception { + String strParada = MyComboboxParada.this.getText().toUpperCase(); + if (strParada.length() < MyComboboxParada.minLength) { + return; + } + if (!strParada.isEmpty()) { + lsParadas = paradaService.buscaLike(strParada); - BindingListModel listModelParada = new BindingListModelList(lsParadas, true); - MyComboboxParada.this.setModel(listModelParada); - indiceSelected = null; - if (!lsParadas.isEmpty()) { - indiceSelected = 0; - } + if (sinTodos) { + log.debug("Sin todos"); + Parada p = paradaService.obtenerID(ID_TODOS); + lsParadas.remove(p); + } - MyComboboxParada.this.open(); - } else { - lsParadas.clear(); + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParada.this.setModel(listModelParada); + setIndiceSelected(null); + if (!lsParadas.isEmpty()) { + setIndiceSelected(0); + } - BindingListModel listModelParada = new BindingListModelList(lsParadas, true); - MyComboboxParada.this.setModel(listModelParada); - } - } - }); + MyComboboxParada.this.open(); + } else { + lsParadas.clear(); - this.addEventListener("onChanging", new EventListener() { + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParada.this.setModel(listModelParada); + } + } + }); - @Override - public void onEvent(Event event) throws Exception { - InputEvent ev = (InputEvent) event; - String strParada = ev.getValue(); - if (strParada.length() < 2) { - lsParadas.clear(); + this.addEventListener("onChanging", new EventListener() { - BindingListModel listModelParada = new BindingListModelList(lsParadas, true); - MyComboboxParada.this.setModel(listModelParada); + @Override + public void onEvent(Event event) throws Exception { + InputEvent ev = (InputEvent) event; + String strParada = ev.getValue(); + if (strParada.length() < 2) { + lsParadas.clear(); - MyComboboxParada.this.close(); - } - } - }); - } + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParada.this.setModel(listModelParada); - public Parada getInitialValue() { - return initialValue; - } + MyComboboxParada.this.close(); + } + } + }); + } - public void setInitialValue(Parada initialValue) { - if (initialValue == null) { - return; - } - List ls = new ArrayList(); - ls.add(initialValue); + public Parada getInitialValue() { + return initialValue; + } - this.setModel(new BindingListModelList(ls, false)); - this.setText(initialValue.getDescparada()); - } + public void setInitialValue(Parada initialValue) { + if (initialValue == null) { + return; + } + List ls = new ArrayList(); + ls.add(initialValue); - /** - * - * @param checaBusqueda - * @throws WrongValueException - */ - public String getValue(boolean checaBusqueda) throws WrongValueException { - if (checaBusqueda) { - if (this.getSelectedItem() == null) { - throw new WrongValueException(this, Labels.getLabel("MSG.Error.combobox.hacerBusqueda")); - } - } - - return super.getValue(); - } + this.setModel(new BindingListModelList(ls, false)); + this.setText(initialValue.getDescparada()); + } - public boolean isSinTodos() { - return sinTodos; - } + /** + * + * @param checaBusqueda + * @throws WrongValueException + */ + public String getValue(boolean checaBusqueda) throws WrongValueException { + if (checaBusqueda) { + if (this.getSelectedItem() == null) { + throw new WrongValueException(this, Labels.getLabel("MSG.Error.combobox.hacerBusqueda")); + } + } - public void setSinTodos(boolean sinTodos) { - this.sinTodos = sinTodos; - } - - public void setComboItemByParada(Parada parada) { - - List ls = new ArrayList(); - ls.add(parada); + return super.getValue(); + } - this.setModel(new BindingListModelList(ls, false)); - this.setText(parada.getDescparada()); - } + public boolean isSinTodos() { + return sinTodos; + } + + public void setSinTodos(boolean sinTodos) { + this.sinTodos = sinTodos; + } + + public void setComboItemByParada(Parada parada) { + + List ls = new ArrayList(); + ls.add(parada); + + this.setModel(new BindingListModelList(ls, false)); + this.setText(parada.getDescparada()); + } + + public Integer getIndiceSelected() { + return indiceSelected; + } + + public void setIndiceSelected(Integer indiceSelected) { + this.indiceSelected = indiceSelected; + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyGenericForwardComposer.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyGenericForwardComposer.java index 2043ebe6c..d4b756690 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyGenericForwardComposer.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyGenericForwardComposer.java @@ -5,11 +5,9 @@ package com.rjconsultores.ventaboletos.web.utilerias; import java.util.Map; + import org.apache.log4j.Logger; import org.zkoss.util.resource.Labels; -import org.zkoss.zk.ui.Component; -import org.zkoss.zk.ui.Path; -import org.zkoss.zk.ui.UiException; import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.util.GenericForwardComposer; import org.zkoss.zul.Window; @@ -20,6 +18,7 @@ import org.zkoss.zul.Window; */ public class MyGenericForwardComposer extends GenericForwardComposer { + private static final long serialVersionUID = 1L; public static int OVERLAPPED = PantallaUtileria.OVERLAPPED; public static int MODAL = PantallaUtileria.MODAL; private static Logger log = Logger.getLogger(MyGenericForwardComposer.class); @@ -52,17 +51,18 @@ public class MyGenericForwardComposer extends GenericForwardComposer { @Override public boolean doCatch(Throwable ex) throws Exception { - - if (ex instanceof WrongValueException){ - throw (WrongValueException)ex; + + if (ex instanceof WrongValueException) { + throw (WrongValueException) ex; } - + log.error("Erro ao abrir a janela", ex); - + alert(Labels.getLabel("MSG.Error.Open.Windows")); this.closeWindow(); return true; } + } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifasOficial/ItemMenuTarifasTaxaEmbLevante.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifasOficial/ItemMenuTarifasTaxaEmbLevante.java new file mode 100644 index 000000000..b1793f7d9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifasOficial/ItemMenuTarifasTaxaEmbLevante.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTarifasTaxaEmbLevante extends DefaultItemMenuSistema { + + public ItemMenuTarifasTaxaEmbLevante() { + super("busquedaTaxaEmbLevanteController.window.title"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.TAXAEMBLEVANTE"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/busquedaTaxaEmbLevante.zul", + Labels.getLabel("busquedaTaxaEmbLevanteController.window.title"), null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListWrapper.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListWrapper.java index 690fc296d..92fb3f9af 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListWrapper.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListWrapper.java @@ -27,17 +27,17 @@ import org.zkoss.zul.event.PagingEvent; * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Helper class for getting a paged record list that can be sorted by DB.
*
- * + * * All not used Listheaders must me declared as:
* listheader.setSortAscending("");
* listheader.setSortDescending("");
- * + * *
* zkoss 3.6.0 or greater (by using FieldComparator)
* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- * + * * @changes 07/24/2009: sge changes for clustering.
- * + * * @author bbruhns * @author sgerth */ @@ -45,212 +45,200 @@ import org.zkoss.zul.event.PagingEvent; @Scope("prototype") public class PagedListWrapper implements Serializable { - private static final long serialVersionUID = -7399762307122148637L; - static final Logger logger = Logger.getLogger(PagedListWrapper.class); - // Service that calls the DAO methods - @Autowired - private PagedListService pagedListService; - // param. The listboxes paging component - private Paging paging; - // param. The SearchObject - private HibernateSearchObject hibernateSearchObject; - // not used yet. so it's init to 'true'. - private final boolean supportPaging = true; - private MyListbox listBox; + private static final long serialVersionUID = -7399762307122148637L; + static final Logger logger = Logger.getLogger(PagedListWrapper.class); + // Service that calls the DAO methods + @Autowired + private PagedListService pagedListService; + // param. The listboxes paging component + private Paging paging; + // param. The SearchObject + private HibernateSearchObject hibernateSearchObject; + // not used yet. so it's init to 'true'. + private final boolean supportPaging = true; + private MyListbox listBox; - /** - * default constructor.
- */ - public PagedListWrapper() { - super(); - } + /** + * default constructor.
+ */ + public PagedListWrapper() { + super(); + } - public void init(HibernateSearchObject hibernateSearchObject1, MyListbox listBox, Paging paging1) { - this.listBox = listBox; - setPaging(paging1); - setListeners(); + public void init(HibernateSearchObject hibernateSearchObject1, MyListbox listBox, Paging paging1) { + this.listBox = listBox; + setPaging(paging1); + setListeners(); - setSearchObject(hibernateSearchObject1); - } + setSearchObject(hibernateSearchObject1); + } - private void initModel() { - getSearchObject().setFirstResult(0); - getSearchObject().setMaxResults(getPageSize()); + private void initModel() { + getSearchObject().setFirstResult(0); + getSearchObject().setMaxResults(getPageSize()); + SearchResult searchResult = getPagedListService().getSRBySearchObject(getSearchObject()); + getPaging().setTotalSize(searchResult.getTotalCount()); + listBox.setData(searchResult.getResult()); + } + /** + * Refreshes the list by calling the DAO methode with the modified search object.
+ * + * @param so + * SearchObject, holds the entity and properties to search.
+ * @param start + * Row to start.
+ * @param pageSize + * Count rows to fetch.
+ */ + void refreshModel(int start) { + getSearchObject().setFirstResult(start); + getSearchObject().setMaxResults(getPageSize()); - SearchResult searchResult = getPagedListService().getSRBySearchObject(getSearchObject()); - getPaging().setTotalSize(searchResult.getTotalCount()); - listBox.setData(searchResult.getResult()); - } + listBox.setData(getPagedListService().getBySearchObject(getSearchObject())); + } - /** - * Refreshes the list by calling the DAO methode with the modified search - * object.
- * - * @param so - * SearchObject, holds the entity and properties to search.
- * @param start - * Row to start.
- * @param pageSize - * Count rows to fetch.
- */ - void refreshModel(int start) { - getSearchObject().setFirstResult(start); - getSearchObject().setMaxResults(getPageSize()); + boolean isSupportPagging() { + return supportPaging; + } + public void clearFilters() { + getSearchObject().clearFilters(); + initModel(); + } - listBox.setData(getPagedListService().getBySearchObject(getSearchObject())); - } + /** + * Sets the listeners.
+ *
+ * 1. "onPaging" for the paging component.
+ * 2. "onSort" for all listheaders that have a sortDirection declared.
+ * All not used Listheaders must me declared as: listheader.setSortAscending(""); listheader.setSortDescending("");
+ */ + private void setListeners() { - boolean isSupportPagging() { - return supportPaging; - } + // Add 'onPaging' listener to the paging component + getPaging().addEventListener("onPaging", new OnPagingEventListener()); - public void clearFilters() { - getSearchObject().clearFilters(); - initModel(); - } + Listhead listhead = listBox.getListhead(); + List list = listhead.getChildren(); - /** - * Sets the listeners.
- *
- * 1. "onPaging" for the paging component.
- * 2. "onSort" for all listheaders that have a sortDirection declared.
- * All not used Listheaders must me declared as: - * listheader.setSortAscending(""); listheader.setSortDescending("");
- */ - private void setListeners() { + OnSortEventListener onSortEventListener = new OnSortEventListener(); + for (Object object : list) { + if (object instanceof Listheader) { + Listheader lheader = (Listheader) object; - // Add 'onPaging' listener to the paging component - getPaging().addEventListener("onPaging", new OnPagingEventListener()); + if (lheader.getSortAscending() != null || lheader.getSortDescending() != null) { + lheader.addEventListener("onSort", onSortEventListener); + } + } + } + } - Listhead listhead = listBox.getListhead(); - List list = listhead.getChildren(); + /** + * "onPaging" eventlistener for the paging component.
+ *
+ * Calculates the next page by currentPage and pageSize values.
+ * Calls the methode for refreshing the data with the new rowStart and pageSize.
+ */ + public final class OnPagingEventListener implements EventListener { - OnSortEventListener onSortEventListener = new OnSortEventListener(); - for (Object object : list) { - if (object instanceof Listheader) { - Listheader lheader = (Listheader) object; + @Override + public void onEvent(Event event) throws Exception { - if (lheader.getSortAscending() != null || lheader.getSortDescending() != null) { + PagingEvent pe = (PagingEvent) event; + int pageNo = pe.getActivePage(); + int start = pageNo * getPageSize(); -// if (logger.isDebugEnabled()) { -// logger.debug("--> : " + lheader.getId()); -// } - lheader.addEventListener("onSort", onSortEventListener); - } - } - } - } + // if (logger.isDebugEnabled()) { + // logger.debug("--> : " + start + "/" + getPageSize()); + // } - /** - * "onPaging" eventlistener for the paging component.
- *
- * Calculates the next page by currentPage and pageSize values.
- * Calls the methode for refreshing the data with the new rowStart and - * pageSize.
- */ - public final class OnPagingEventListener implements EventListener { + // refresh the list + refreshModel(start); + } + } - @Override - public void onEvent(Event event) throws Exception { + /** + * "onSort" eventlistener for the listheader components.
+ *
+ * Checks wich listheader is clicked and checks which orderDirection must be set.
+ * + * Calls the methode for refreshing the data with the new ordering. and the remembered rowStart and pageSize.
+ */ + public final class OnSortEventListener implements EventListener, Serializable { - PagingEvent pe = (PagingEvent) event; - int pageNo = pe.getActivePage(); - int start = pageNo * getPageSize(); + private static final long serialVersionUID = 1L; -// if (logger.isDebugEnabled()) { -// logger.debug("--> : " + start + "/" + getPageSize()); -// } + @Override + public void onEvent(Event event) throws Exception { + final Listheader lh = (Listheader) event.getTarget(); + final String sortDirection = lh.getSortDirection(); - // refresh the list - refreshModel(start); - } - } + if ("ascending".equals(sortDirection)) { + final Comparator cmpr = lh.getSortDescending(); + if (cmpr instanceof FieldComparator) { + String orderBy = ((FieldComparator) cmpr).getOrderBy(); + orderBy = StringUtils.substringBefore(orderBy, "DESC").trim(); - /** - * "onSort" eventlistener for the listheader components.
- *
- * Checks wich listheader is clicked and checks which orderDirection must be - * set.
- * - * Calls the methode for refreshing the data with the new ordering. and the - * remembered rowStart and pageSize.
- */ - public final class OnSortEventListener implements EventListener, Serializable { + // update SearchObject with orderBy + getSearchObject().clearSorts(); + getSearchObject().addSort(orderBy, true); + } + } else if ("descending".equals(sortDirection) || "natural".equals(sortDirection) || Strings.isBlank(sortDirection)) { + final Comparator cmpr = lh.getSortAscending(); + if (cmpr instanceof FieldComparator) { + String orderBy = ((FieldComparator) cmpr).getOrderBy(); + orderBy = StringUtils.substringBefore(orderBy, "ASC").trim(); - private static final long serialVersionUID = 1L; + // update SearchObject with orderBy + getSearchObject().clearSorts(); + getSearchObject().addSort(orderBy, false); + } + } - @Override - public void onEvent(Event event) throws Exception { - final Listheader lh = (Listheader) event.getTarget(); - final String sortDirection = lh.getSortDirection(); + // if (logger.isDebugEnabled()) { + // logger.debug("--> : " + lh.getId() + "/" + sortDirection); + // logger.debug("--> added getSorts() : " + getSearchObject().getSorts().toString()); + // } - if ("ascending".equals(sortDirection)) { - final Comparator cmpr = lh.getSortDescending(); - if (cmpr instanceof FieldComparator) { - String orderBy = ((FieldComparator) cmpr).getOrderBy(); - orderBy = StringUtils.substringBefore(orderBy, "DESC").trim(); + if (isSupportPagging()) { + // refresh the list + getPaging().setActivePage(0); + refreshModel(0); + } + } + } - // update SearchObject with orderBy - getSearchObject().clearSorts(); - getSearchObject().addSort(orderBy, true); - } - } else if ("descending".equals(sortDirection) || "natural".equals(sortDirection) || Strings.isBlank(sortDirection)) { - final Comparator cmpr = lh.getSortAscending(); - if (cmpr instanceof FieldComparator) { - String orderBy = ((FieldComparator) cmpr).getOrderBy(); - orderBy = StringUtils.substringBefore(orderBy, "ASC").trim(); + public PagedListService getPagedListService() { + return pagedListService; + } - // update SearchObject with orderBy - getSearchObject().clearSorts(); - getSearchObject().addSort(orderBy, false); - } - } + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++// + // ++++++++++++++++++ getter / setter +++++++++++++++++++// + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++// + HibernateSearchObject getSearchObject() { + return hibernateSearchObject; + } -// if (logger.isDebugEnabled()) { -// logger.debug("--> : " + lh.getId() + "/" + sortDirection); -// logger.debug("--> added getSorts() : " + getSearchObject().getSorts().toString()); -// } + public int getPageSize() { + return getPaging().getPageSize(); + } - if (isSupportPagging()) { - // refresh the list - getPaging().setActivePage(0); - refreshModel(0); - } - } - } + Paging getPaging() { + return paging; + } - public PagedListService getPagedListService() { - return pagedListService; - } + public void setPagedListService(PagedListService pagedListService) { + this.pagedListService = pagedListService; + } - // ++++++++++++++++++++++++++++++++++++++++++++++++++++++// - // ++++++++++++++++++ getter / setter +++++++++++++++++++// - // ++++++++++++++++++++++++++++++++++++++++++++++++++++++// - HibernateSearchObject getSearchObject() { - return hibernateSearchObject; - } + private void setPaging(Paging paging) { + this.paging = paging; + } - public int getPageSize() { - return getPaging().getPageSize(); - } - - Paging getPaging() { - return paging; - } - - public void setPagedListService(PagedListService pagedListService) { - this.pagedListService = pagedListService; - } - - private void setPaging(Paging paging) { - this.paging = paging; - } - - public void setSearchObject(HibernateSearchObject hibernateSearchObject1) { - this.hibernateSearchObject = hibernateSearchObject1; - initModel(); - } + public void setSearchObject(HibernateSearchObject hibernateSearchObject1) { + this.hibernateSearchObject = hibernateSearchObject1; + initModel(); + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingFormaPago.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingFormaPago.java new file mode 100644 index 000000000..a8c8aedf4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingFormaPago.java @@ -0,0 +1,34 @@ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.PricingFormapago; + +public class RenderPricingFormaPago implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + PricingFormapago ppg = (PricingFormapago) o; + + Listcell lc = new Listcell(); + lc = new Listcell(ppg.getFormaPago().getDescpago()); + lc.setParent(lstm); + + Checkbox ckbIndexcepcion = new Checkbox(); + if (ppg.getIndexcepcion()) { + ckbIndexcepcion.setChecked(true); + } else { + ckbIndexcepcion.setChecked(false); + } + ckbIndexcepcion.setDisabled(true); + lc = new Listcell(); + ckbIndexcepcion.setParent(lc); + lc.setParent(lstm); + + lstm.setAttribute("data", ppg); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevante.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevante.java new file mode 100644 index 000000000..75afb4d45 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevante.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import java.text.DecimalFormat; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.TaxaEmbLevante; + +public class RenderTaxaEmbLevante implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TaxaEmbLevante t = (TaxaEmbLevante) o; + + Listcell lc = new Listcell(t.getParada().getDescparada()); + lc.setParent(lstm); + + DecimalFormat fmt = new DecimalFormat("#,##00.00"); + + lc = new Listcell(fmt.format(t.getImporte()) != null ? fmt.format(t.getImporte()) : ""); + lc.setParent(lstm); + + lstm.setAttribute("data", t); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevanteCtrl.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevanteCtrl.java new file mode 100644 index 000000000..5e451fa2e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTaxaEmbLevanteCtrl.java @@ -0,0 +1,30 @@ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.TaxaEmbLevanteCtrl; + +public class RenderTaxaEmbLevanteCtrl implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + + TaxaEmbLevanteCtrl t = (TaxaEmbLevanteCtrl) o; + + Listcell lc = new Listcell(t.getTaxaEmbLevanteCtrlId().toString()); + lc.setParent(lstm); + + lc = new Listcell(t.getRuta().getDescruta()); + lc.setParent(lstm); + + lc = new Listcell(t.getOrigem().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(t.getDestino().getDescparada()); + lc.setParent(lstm); + + lstm.setAttribute("data", t); + } + +} diff --git a/src/java/spring-config.xml b/src/java/spring-config.xml index e13c65a62..6b1114773 100644 --- a/src/java/spring-config.xml +++ b/src/java/spring-config.xml @@ -22,6 +22,14 @@ + com.rjconsultores.ventaboletos.entidad.AbastoBoleto + com.rjconsultores.ventaboletos.entidad.Clasificacion + com.rjconsultores.ventaboletos.entidad.DetAbastoBoleto + + com.rjconsultores.ventaboletos.entidad.FolioPreimpreso + + com.rjconsultores.ventaboletos.entidad.RequisicionBoleto + com.rjconsultores.ventaboletos.entidad.ClienteFidelidad com.rjconsultores.ventaboletos.entidad.EstacionImpresora @@ -164,6 +172,8 @@ com.rjconsultores.ventaboletos.entidad.Plaza com.rjconsultores.ventaboletos.entidad.Pricing + com.rjconsultores.ventaboletos.entidad.PricingFormapago + com.rjconsultores.ventaboletos.entidad.PricingImporte com.rjconsultores.ventaboletos.entidad.PricingVigencia @@ -244,6 +254,9 @@ com.rjconsultores.ventaboletos.entidad.SeguroTarifa com.rjconsultores.ventaboletos.entidad.Sistema com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm + com.rjconsultores.ventaboletos.entidad.TaxaEmbLevante + com.rjconsultores.ventaboletos.entidad.TaxaEmbLevanteCtrl + com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueParada com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad diff --git a/src/java/versionADM.info b/src/java/versionADM.info index 4a343c3b8..d30e5fea5 100644 --- a/src/java/versionADM.info +++ b/src/java/versionADM.info @@ -1 +1,2 @@ -ADM_20131202_1RC269 \ No newline at end of file +ADM_20131030_1RC260 +ADM_20131202_1RC274 diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 91a5f029b..31b83d80d 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -1,4 +1,4 @@ -# V. 1.4 +]# V. 1.4 # Para alterar esta planilha, seleccione Ferramentas | Planilhas # E abrir a planilha no editor. @@ -203,7 +203,7 @@ indexController.mniPtovtaEmpresa.label = Punto de venta empresa indexController.mniConfRestricaoCanalVenta.label = Bloqueo de tramos por canal de venta indexController.mniSelecionarServicosGerar.label = Seleccionar corridas a generar indexController.mniOrgaoConcedente.label = Instituición concedente -indexController.mniCoeficienteTarifa.label = Índice tarifario +indexController.mniCoeficienteTarifa.label = ?ndice tarifario indexController.mniGenerarTarifaOrgao.label= Generar/Actualizar tarifa oficial indexController.mniCopiarTarifaOficial.label= Copiar tarifa oficial indexController.mniConfigLayoutImpressaoBoleto.label = Config layout impresión pasaje @@ -1397,11 +1397,11 @@ editarTramosController.btnApagarExcepcioneKm.tooltiptext = Eliminar editarTramosController.btnSalvarExceptioneKm.tooltiptext = Guardar tramo Km editarTramosController.MSG.selecioneTramoKm = Seleccione una excepción de Km editarTramosController.MSG.borrarTramoKm = Elimina excepción de Km? -editarTramosController.labelCoeficiente1.value = Índice 1 +editarTramosController.labelCoeficiente1.value = ?ndice 1 editarTramosController.labelKMCoeficiente1.value = KM 1 -editarTramosController.labelCoeficiente2.value = Índice 2 +editarTramosController.labelCoeficiente2.value = ?ndice 2 editarTramosController.labelKMCoeficiente2.value = KM 2 -editarTramosController.labelCoeficiente3.value = Índice 3 +editarTramosController.labelCoeficiente3.value = ?ndice 3 editarTramosController.labelKMCoeficiente3.value = KM 3 editarTramosController.labelOrgaoConcedente.value = Instituición concedente editarTramosController.labelClase.value = Clase de servicio @@ -1509,6 +1509,7 @@ editarConfiguracionCorridaController.MSG.Clase = Necesitas informar un tipo de c editarConfiguracionCorridaController.MSG.Clase2 = Necesitas informar un tipo de clase para piso extra editarConfiguracionCorridaController.MSG.Marca = Necesitas informar una marca editarConfiguracionCorridaController.MSG.Ruta = Necesitas informar una linea +editarConfiguracionCorridaController.cmbId.value = Id editarConfiguracionCorridaController.MSG.Empresa = Necesitas informar una empresa servicio editarConfiguracionCorridaController.MSG.Empresa1 = Necesitas informar una empresa ingresso editarConfiguracionCorridaController.MSG.Rol = Necesitas informar un rol operativo @@ -1952,6 +1953,7 @@ editarPricingController.windowImporte.title = Valor editarPricingController.windowMarca.title = Marca editarPricingController.windowClase.title = Tipo clase editarPricingController.windowTipoServicio.title = Tipo clase +editarPricingController.windowFormaPago.title = Forma de Pago editarPricingController.windowPuntoVenta.title = Punto de venta editarPricingController.windowTipoPtoVta.title = Canal venta editarPricingController.windowCategoria.title = Tipo pasajero @@ -1981,7 +1983,7 @@ editarPricingController.tabCor.label = Corridas editarPricingController.tabAsi.label = Asientos editarPricingController.tabOcu.label = Ocupación editarPricingController.tabAnti.label = Anticipación -editarPricingController.tabTipo.label = Tipo Servicio +editarPricingController.tabTipo.label = Tipo Servicio/Forma de Pago editarPricingController.lhEmpresa.label = Empresa editarPricingController.lhNome.label = Nombre Pricing editarPricingController.lhCantidad.label = Cantidad asientos por servicio @@ -2055,6 +2057,7 @@ editarPricingController.MSG.borrarPerguntaOcupacion = Deseas eliminar la ocupaci editarPricingController.MSG.borrarPerguntaAsiento = Deseas eliminar el asiento? editarPricingController.MSG.borrarPerguntaAnticipacion = Deseas eliminar anticipación? editarPricingController.MSG.borrarPerguntaTipoServicio = Deseas eliminar tipo servicio? +editarPricingController.MSG.borrarPerguntaFormaPago = Deseas eliminar forma de pago? editarPricingController.MSG.categoriaExiste = Registro duplicado editarPricingController.MSG.rutaExiste = Registro duplicado editarPricingController.MSG.mercadoExiste = Registro duplicado @@ -2135,8 +2138,10 @@ editarPricingController.MSG.traslapa = Hora informada se traslapa con otra ya ex editarPricingController.anticipacionMin.value = Cantidad dias mínimo editarPricingController.anticipacionMax.value = Cantidad dias máximo editarPricingController.tipoServicio.value = Tipo Servicio +editarPricingController.formaPago.value = Forma de Pago editarPricingController.cmbIndGeneraFeriadoFechaVenta.value = Aplica feriado fecha venta editarPricingController.cmbIndGeneraFeriadoFechaViaje.value = Aplica feriado fecha viaje +editarPricingFormapagoController.lblIndexcepcion = Se Excluye # Búsqueda Sistema busquedaSistemaController.window.title = Sistema @@ -3688,8 +3693,8 @@ gridRutaSecuencia.paradaExisteException.msg=la parada {0} ya existe gridRutaSecuencia.msg.eliminarPaso=Eliminar parada gridRutaSecuencia.msg.agregarDespues=Incluir después gridRutaSecuencia.columnNumLinha.label = Nº linea -gridRutaSecuencia.columnCoeficiente1.label = Índice 1 -gridRutaSecuencia.columnCoeficiente2.label = Índice 2 +gridRutaSecuencia.columnCoeficiente1.label = ?ndice 1 +gridRutaSecuencia.columnCoeficiente2.label = ?ndice 2 gridRutaSecuencia.columnKmCoeficiente2.label = Km 2 gridRutaSecuencia.columnKmCoeficiente1.label = Km 1 #TramoRutaServiceImpl @@ -3983,30 +3988,26 @@ editarOrgaoConcedenteController.MSG.borrarPergunta = Deseas eliminar instituici editarOrgaoConcedenteController.MSG.borrarOK = Instituición concedente se eliminó existosamente -# Busqueda Índice Tarifa -busquedaCoeficienteTarifaController.window.title = Índice tarifario +# Busqueda ?ndice Tarifa +busquedaCoeficienteTarifaController.window.title = ?ndice tarifario busquedaCoeficienteTarifaController.btnRefresh.tooltiptext = Actualizar busquedaCoeficienteTarifaController.btnNovo.tooltiptext = Nuevo busquedaCoeficienteTarifaController.btnCerrar.tooltiptext = Cerrar busquedaCoeficienteTarifaController.nome.label = Nombre busquedaCoeficienteTarifaController.btnPesquisa.label = Buscar -busquedaCoeficienteTarifaController.coeficien.label = Índice +busquedaCoeficienteTarifaController.coeficien.label = ?ndice -<<<<<<< .mine -# Editar Ã�ndice Tarifa -editarCoeficienteTarifaController.window.title = Índice tarifario -======= -# Editar Índice Tarifa -editarCoeficienteTarifaController.window.title = Índice tarifario ->>>>>>> .r31878 + +# Editar ?ndice Tarifa +editarCoeficienteTarifaController.window.title = ?ndice tarifario editarCoeficienteTarifaController.btnApagar.tooltiptext = Eliminar -editarCoeficienteTarifaController.coeficiente.value = Índice +editarCoeficienteTarifaController.coeficiente.value = ?ndice editarCoeficienteTarifaController.btnSalvar.tooltiptext = Guardar editarCoeficienteTarifaController.btnFechar.tooltiptext = Cerrar editarCoeficienteTarifaController.lbNome.value = Nombre -editarCoeficienteTarifaController.MSG.suscribirOK = Índice tarifario se registró existosamente +editarCoeficienteTarifaController.MSG.suscribirOK = ?ndice tarifario se registró existosamente editarCoeficienteTarifaController.MSG.borrarPergunta = Deseas elminar índice tarifario? -editarCoeficienteTarifaController.MSG.borrarOK = Índice tarifario se eliminó existosamente +editarCoeficienteTarifaController.MSG.borrarOK = ?ndice tarifario se eliminó existosamente #Generar Tarifa generarTarifaOrgaoController.MSG.suscribirOK=Operación se realizó existosamente @@ -4035,6 +4036,16 @@ busquedaTaxaEmbarqueKmController.btnCerrar.tooltiptext = Cerrar busquedaTaxaEmbarqueKmController.DescTaxaEmbarqueKm.label = Descripción busquedaTaxaEmbarqueKmController.orgao = Instituición +# Búsqueda TaxaEmbLevante +busquedaTaxaEmbLevanteController.window.title = Tasa por levante de embarque +busquedaTaxaEmbLevanteController.labelParada.value = Levante de embarque +busquedaTaxaEmbLevanteController.labelImporte.value = Importe +busquedaTaxaEmbLevanteController.editar.window.title = Editar Tasa por levante de embarque +busquedaTaxaEmbLevanteController.btnNovo.tooltiptext = Incluir nuevo levante de embarque +busquedaTaxaEmbLevanteControllerMSG.suscribirOK = Configurao de Taxa Por Local de Embarque Registrada com Sucesso. +busquedaTaxaEmbLevanteController.MSG.borrarPergunta = Deseja Eliminar configurao de Taxa de Local de Embarque? +busquedaTaxaEmbLevanteController.MSG.borrarOK = Configurao de Taxa Por Local de Embarque Excluida com Sucesso. + # Editar TaxaEmbarqueKm editarTaxaEmbarqueKmController.window.title = Tasa de embarque por KM editarTaxaEmbarqueKmController.btnApagar.tooltiptext = Eliminar diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 39896d14b..a7691ed15 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -1508,6 +1508,7 @@ editarConfiguracionCorridaController.cmbClase2.value = Tipo classe Doble Piso editarConfiguracionCorridaController.doblePiso.value = Doble Piso editarConfiguracionCorridaController.cmbMarca.value = Marca editarConfiguracionCorridaController.cmbRuta.value = Linha +editarConfiguracionCorridaController.cmbId.value = Id editarConfiguracionCorridaController.cmbEmpresaCorrida.value = Empresa Serviço editarConfiguracionCorridaController.cmbEmpresaIngresso.value = Empresa Ingresso editarConfiguracionCorridaController.cmbEmpresaRolOperativo.value = Rol Operativo @@ -1984,6 +1985,7 @@ editarPricingController.windowImporte.title = Valor editarPricingController.windowMarca.title = Marca editarPricingController.windowClase.title = Tipo Classe editarPricingController.windowTipoServicio.title = Tipo Classe +editarPricingController.windowFormaPago.title = Forma de Pagamento editarPricingController.windowPuntoVenta.title = Ponto Venda editarPricingController.windowTipoPtoVta.title = Canal Venda editarPricingController.windowCategoria.title = Tipo passageiro @@ -2014,7 +2016,7 @@ editarPricingController.tabCor.label = Serviços editarPricingController.tabAsi.label = Poltronas editarPricingController.tabOcu.label = Ocupação/Antecipação editarPricingController.tabAnti.label = Antecipação -editarPricingController.tabTipo.label = Tipo Corrida +editarPricingController.tabTipo.label = Tipo Corrida/Forma de Pagamento editarPricingController.lhEmpresa.label = Empresa editarPricingController.lhNome.label = Nome Pricing editarPricingController.lhCantidad.label = Quantidade poltronas por serviço @@ -2092,6 +2094,7 @@ editarPricingController.MSG.borrarPerguntaOcupacion = Deseja Eliminar a Ocupaç editarPricingController.MSG.borrarPerguntaAsiento = Deseja Eliminar a Poltrona? editarPricingController.MSG.borrarPerguntaAnticipacion = Deseja Eliminar Antecipação? editarPricingController.MSG.borrarPerguntaTipoServicio = Deseja Eliminar Tipo corrida? +editarPricingController.MSG.borrarPerguntaFormaPago = Deseja Eliminar Forma de Pagamento? editarPricingController.MSG.categoriaExiste = Registro Duplicado. editarPricingController.MSG.rutaExiste = Registro Duplicado. editarPricingController.MSG.mercadoExiste = Registro Duplicado. @@ -2182,8 +2185,10 @@ editarPricingController.MSG.traslapa = Hora informada se sobrepõe com outra já editarPricingController.anticipacionMin.value = Qtd. dias mínimo editarPricingController.anticipacionMax.value = Qtd. dias máximo editarPricingController.tipoServicio.value = Tipo Corrida +editarPricingController.formaPago.value = Forma de Pagamento editarPricingController.cmbIndGeneraFeriadoFechaVenta.value = Aplica Feriado Data Venda editarPricingController.cmbIndGeneraFeriadoFechaViaje.value = Aplica Feriado Data Viagem +editarPricingFormapagoController.lblIndexcepcion = Se Remove # Pesquisa Sistema busquedaSistemaController.window.title = Sistema @@ -3520,7 +3525,7 @@ editarConfiguracionCategoriaDatosCategoriaController.title=Editar dados Tipo de #Editar pricing dia EditarPricingDiaController.MSG.obligatorioDia=Deve de seleccionar um dia da semana -EditarPricingDiaController.MSG.obligatorioData=Deve de seleccionar um dos filtros de datas, data de venda ou data de viagem +EditarPricingDiaController.MSG.obligatorioData=Deve de seleccionar um dos filtros de datas, data de venda ou data de viagem #Editar Estado editarEstadoController.lbl.difHoras=Diferença em Horas do Fuso Horário @@ -4077,6 +4082,16 @@ busquedaTaxaEmbarqueKmController.btnCerrar.tooltiptext = Fechar busquedaTaxaEmbarqueKmController.DescTaxaEmbarqueKm.label = Descrição busquedaTaxaEmbarqueKmController.orgao = Orgão +# Pesquisa TaxaEmbLevante +busquedaTaxaEmbLevanteController.window.title = Taxa Por Local de Embarque +busquedaTaxaEmbLevanteController.labelParada.value = Local de Embarque +busquedaTaxaEmbLevanteController.labelImporte.value = Valor +busquedaTaxaEmbLevanteController.editar.window.title = Editar Taxa Por Local de Embarque +busquedaTaxaEmbLevanteController.btnNovo.tooltiptext = Incluir Novo Local de Embarque +busquedaTaxaEmbLevanteControllerMSG.suscribirOK = Configuração de Taxa Por Local de Embarque Registrada com Sucesso. +busquedaTaxaEmbLevanteController.MSG.borrarPergunta = Deseja Eliminar configuração de Taxa de Local de Embarque? +busquedaTaxaEmbLevanteController.MSG.borrarOK = Configuração de Taxa Por Local de Embarque Excluida com Sucesso. + # Editar TaxaEmbarqueKm editarTaxaEmbarqueKmController.window.title = Taxa de Embarque Km editarTaxaEmbarqueKmController.btnApagar.tooltiptext = Eliminar diff --git a/web/gui/esquema_operacional/atualizarCorridaFecHusoFecVerano.zul b/web/gui/esquema_operacional/atualizarCorridaFecHusoFecVerano.zul index f874eba64..b385a942e 100644 --- a/web/gui/esquema_operacional/atualizarCorridaFecHusoFecVerano.zul +++ b/web/gui/esquema_operacional/atualizarCorridaFecHusoFecVerano.zul @@ -20,7 +20,7 @@ - @@ -40,7 +40,8 @@ model="@{winAtualizaCorridaHusoVerano$composer.lsEstados}" /> - diff --git a/web/gui/pricing/editarPricing.zul b/web/gui/pricing/editarPricing.zul index a8f5adf68..d844e0a5f 100644 --- a/web/gui/pricing/editarPricing.zul +++ b/web/gui/pricing/editarPricing.zul @@ -752,7 +752,7 @@ - + @@ -782,7 +782,7 @@ + multiple="false" height="170px"> + + + + + + + + +