wilian 2016-12-19 17:46:35 +00:00
parent c777240bef
commit b418ad790a
5 changed files with 58 additions and 9 deletions

View File

@ -22,6 +22,7 @@ import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Messagebox; import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Radio; import org.zkoss.zul.Radio;
import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.ClaseServicio; import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.ItemAdicional; import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
@ -31,6 +32,7 @@ import com.rjconsultores.ventaboletos.entidad.PacoteItem;
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa; import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
import com.rjconsultores.ventaboletos.entidad.Ruta; import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote; import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.ClaseServicioService; import com.rjconsultores.ventaboletos.service.ClaseServicioService;
import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.ItemAdicionalService; import com.rjconsultores.ventaboletos.service.ItemAdicionalService;
@ -104,7 +106,7 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
private MyListbox pacoteDescontoBilheteList; private MyListbox pacoteDescontoBilheteList;
private boolean blockTab; private boolean blockTab;
@Override @Override
public void doAfterCompose(Component comp) throws Exception { public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp); super.doAfterCompose(comp);

View File

@ -1,5 +1,7 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales;
import java.util.List;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
@ -10,11 +12,14 @@ import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Checkbox; import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Messagebox; import org.zkoss.zul.Messagebox;
import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.Pacote; import com.rjconsultores.ventaboletos.entidad.Pacote;
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa; import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote; import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.PacoteTarifaService; import com.rjconsultores.ventaboletos.service.PacoteTarifaService;
import com.rjconsultores.ventaboletos.utilerias.BigDecimalUtil; import com.rjconsultores.ventaboletos.utilerias.BigDecimalUtil;
import com.rjconsultores.ventaboletos.utilerias.LocaleUtil; import com.rjconsultores.ventaboletos.utilerias.LocaleUtil;
@ -32,6 +37,12 @@ public class EditarPacoteTarifaController extends MyGenericForwardComposer {
@Autowired @Autowired
private PacoteTarifaService pacoteTarifaService; private PacoteTarifaService pacoteTarifaService;
@Autowired
private CategoriaService categoriaService;
private List<Categoria> lsCategorias;
private Combobox cmbCategoria;
private Pacote pacote; private Pacote pacote;
private TipoTarifaPacote tipoTarifaPacote; private TipoTarifaPacote tipoTarifaPacote;
@ -47,6 +58,7 @@ public class EditarPacoteTarifaController extends MyGenericForwardComposer {
public void doAfterCompose(Component comp) throws Exception { public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp); super.doAfterCompose(comp);
lsCategorias = categoriaService.obtenerTodos();
pacoteTarifa = (PacoteTarifa) Executions.getCurrent().getArg().get("pacoteTarifa"); pacoteTarifa = (PacoteTarifa) Executions.getCurrent().getArg().get("pacoteTarifa");
pacote = (Pacote) Executions.getCurrent().getArg().get("pacote"); pacote = (Pacote) Executions.getCurrent().getArg().get("pacote");
tipoTarifaPacote = (TipoTarifaPacote) Executions.getCurrent().getArg().get("tipoTarifaPacote"); tipoTarifaPacote = (TipoTarifaPacote) Executions.getCurrent().getArg().get("tipoTarifaPacote");
@ -59,6 +71,10 @@ public class EditarPacoteTarifaController extends MyGenericForwardComposer {
if(pacoteTarifa != null) { if(pacoteTarifa != null) {
tarifa.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(pacoteTarifa.getTarifa(), LocaleUtil.getLocale())); tarifa.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(pacoteTarifa.getTarifa(), LocaleUtil.getLocale()));
chkIndvendaweb.setChecked(pacoteTarifa.getIndvendaweb() != null ? pacoteTarifa.getIndvendaweb() : false); chkIndvendaweb.setChecked(pacoteTarifa.getIndvendaweb() != null ? pacoteTarifa.getIndvendaweb() : false);
if(pacoteTarifa.getCategoria() != null) {
cmbCategoria.setValue(pacoteTarifa.getCategoria().getDesccategoria());
}
} }
} }
@ -68,8 +84,15 @@ public class EditarPacoteTarifaController extends MyGenericForwardComposer {
try { try {
tipoTarifaPacote.setDesctipotarifa(txtDescTarifa.getValue()); tipoTarifaPacote.setDesctipotarifa(txtDescTarifa.getValue());
Categoria categoria = null;
if(cmbCategoria.getSelectedItem() != null) {
categoria = (Categoria) cmbCategoria.getSelectedItem().getValue();
}
pacoteTarifa = pacoteTarifaService.vincularPacoteTarifa(pacoteTarifa, pacote, tipoTarifaPacote, pacoteTarifa = pacoteTarifaService.vincularPacoteTarifa(pacoteTarifa, pacote, tipoTarifaPacote,
tarifa.getValueDecimal(), chkIndvendaweb.isChecked()); tarifa.getValueDecimal(), chkIndvendaweb.isChecked(), categoria);
tarifaPacoteList.updateItem(pacoteTarifa); tarifaPacoteList.updateItem(pacoteTarifa);
closeWindow(); closeWindow();
@ -83,4 +106,12 @@ public class EditarPacoteTarifaController extends MyGenericForwardComposer {
Messagebox.OK, Messagebox.ERROR); Messagebox.OK, Messagebox.ERROR);
} }
} }
public List<Categoria> getLsCategorias() {
return lsCategorias;
}
public void setLsCategorias(List<Categoria> lsCategorias) {
this.lsCategorias = lsCategorias;
}
} }

View File

@ -28,6 +28,9 @@ public class RenderTarifaPacote implements ListitemRenderer {
lc = new Listcell(fmt.format(pacoteTarifa.getTarifa()) != null ? fmt.format(pacoteTarifa.getTarifa()) : ""); lc = new Listcell(fmt.format(pacoteTarifa.getTarifa()) != null ? fmt.format(pacoteTarifa.getTarifa()) : "");
lc.setParent(lstm); lc.setParent(lstm);
lc = new Listcell(pacoteTarifa.getCategoria() != null ? pacoteTarifa.getCategoria().getDesccategoria() : "");
lc.setParent(lstm);
lc = new Listcell(pacoteTarifa.getIndvendaweb() != null && pacoteTarifa.getIndvendaweb() ? Labels.getLabel("MSG.SI") : Labels.getLabel("MSG.NO")); lc = new Listcell(pacoteTarifa.getIndvendaweb() != null && pacoteTarifa.getIndvendaweb() ? Labels.getLabel("MSG.SI") : Labels.getLabel("MSG.NO"));
lc.setParent(lstm); lc.setParent(lstm);

View File

@ -8,7 +8,7 @@
<window id="winEditarConfiguracionPacote" <window id="winEditarConfiguracionPacote"
title="${c:l('editarConfiguracionPacoteController.window.title')}" title="${c:l('editarConfiguracionPacoteController.window.title')}"
apply="${editarConfiguracionPacoteController}" apply="${editarConfiguracionPacoteController}"
contentStyle="overflow:auto" height="577px" width="850px" contentStyle="overflow:auto" height="590px" width="860px"
border="normal"> border="normal">
<toolbar> <toolbar>
@ -53,7 +53,7 @@
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
constraint="no empty" mold="rounded" buttonVisible="true" constraint="no empty" mold="rounded" buttonVisible="true"
width="70%" model="@{winEditarConfiguracionPacote$composer.lsEmpresas}" /> width="70%" model="@{winEditarConfiguracionPacote$composer.lsEmpresas}" />
</row> </row>
<row> <row>
<label <label
@ -170,18 +170,21 @@
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
multiple="false" height="325px"> multiple="false" height="325px">
<listhead sizable="true"> <listhead sizable="true">
<listheader width="20%" <listheader width="5%"
image="/gui/img/builder.gif" image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhId.label')}" /> label="${c:l('editarConfiguracionPacoteController.lhId.label')}" />
<listheader width="25%" <listheader width="25%"
image="/gui/img/builder.gif" image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhPacote.label')}" /> label="${c:l('editarConfiguracionPacoteController.lhPacote.label')}" />
<listheader width="35%"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhTipoTarifa.label')}" />
<listheader width="20%" <listheader width="20%"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhTipoTarifa.label')}" />
<listheader width="10%"
image="/gui/img/builder.gif" image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhTarifa.label')}" /> label="${c:l('editarConfiguracionPacoteController.lhTarifa.label')}" />
<listheader width="20%"
image="/gui/img/builder.gif"
label="${c:l('indexController.mniCategoria.label')}" />
<listheader width="20%" <listheader width="20%"
image="/gui/img/builder.gif" image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhVendaWeb.label')}" /> label="${c:l('editarConfiguracionPacoteController.lhVendaWeb.label')}" />

View File

@ -8,7 +8,7 @@
<window id="winEditarPacoteTarifa" <window id="winEditarPacoteTarifa"
title="${c:l('editarConfiguracionPacoteController.window.title')}" title="${c:l('editarConfiguracionPacoteController.window.title')}"
apply="${editarPacoteTarifaController}" apply="${editarPacoteTarifaController}"
contentStyle="overflow:auto" height="160px" width="500px" contentStyle="overflow:auto" height="195px" width="500px"
border="normal"> border="normal">
<toolbar> <toolbar>
@ -41,6 +41,16 @@
<textbox id="tarifa" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal" <textbox id="tarifa" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal"
precision="7" scale="2" maxlength="9" constraint="no empty" /> precision="7" scale="2" maxlength="9" constraint="no empty" />
</row> </row>
<row>
<label
value="${c:l('indexController.mniCategoria.label')}" />
<combobox id="cmbCategoria"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
mold="rounded"
width="70%"
model="@{winEditarPacoteTarifa$composer.lsCategorias}" />
</row>
<row> <row>
<label value="${c:l('editarConfiguracionPacoteController.lhVendaWeb.label')}"/> <label value="${c:l('editarConfiguracionPacoteController.lhVendaWeb.label')}"/>