fixes bug #6529
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@46504 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
9bf42700f2
commit
465a42dc5b
|
@ -21,15 +21,19 @@ import org.zkoss.zul.Comboitem;
|
|||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Radio;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteDescontoBilhete;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteItem;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.ItemAdicionalService;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteDescontoBilheteService;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteItemService;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteService;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteTarifaService;
|
||||
|
@ -39,6 +43,8 @@ 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 com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPacoteDescontoBilhete;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPacoteItem;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifaPacote;
|
||||
|
||||
|
@ -63,6 +69,10 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
|
|||
private TipoTarifaPacoteService tipoTarifaPacoteService;
|
||||
@Autowired
|
||||
private PacoteTarifaService pacoteTarifaService;
|
||||
@Autowired
|
||||
private ClaseServicioService claseServicioService;
|
||||
@Autowired
|
||||
private PacoteDescontoBilheteService pacoteDescontoBilheteService;
|
||||
|
||||
private List<Empresa> lsEmpresas;
|
||||
|
||||
|
@ -83,9 +93,14 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
|
|||
private Radio radIndLatente;
|
||||
private Combobox cmbEmpresa;
|
||||
|
||||
private Combobox cmbClaseServicio;
|
||||
private List<ClaseServicio> lsClaseServicio;
|
||||
private MyTextboxDecimal txtPercdesconto;
|
||||
|
||||
private MyListbox pacoteItemList;
|
||||
private MyListbox tarifaPacoteList;
|
||||
private MyListbox pacoteList;
|
||||
private MyListbox pacoteDescontoBilheteList;
|
||||
|
||||
private boolean blockTab;
|
||||
|
||||
|
@ -97,6 +112,7 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
|
|||
lsRuta = rutaService.obtenerTodos();
|
||||
lsItemAdicional = itemAdicionalService.obtenerTodos();
|
||||
lsTipoTarifaPacote = tipoTarifaPacoteService.obtenerTodos();
|
||||
lsClaseServicio = claseServicioService.buscarTodosExceto(-1);
|
||||
|
||||
pacoteList = (MyListbox) Executions.getCurrent().getArg().get("pacoteList");
|
||||
pacote = (Pacote) Executions.getCurrent().getArg().get("pacote");
|
||||
|
@ -133,6 +149,7 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
|
|||
|
||||
pacoteItemList.setData(pacoteItemService.buscaItensPacote(pacote));
|
||||
tarifaPacoteList.setData(pacoteTarifaService.buscaTarifasPacote(pacote));
|
||||
pacoteDescontoBilheteList.setData(pacoteDescontoBilheteService.obtenerTodos(pacote.getPacoteId()));
|
||||
|
||||
blockTab = false;
|
||||
}
|
||||
|
@ -155,6 +172,8 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
|
|||
}
|
||||
});
|
||||
|
||||
pacoteDescontoBilheteList.setItemRenderer(new RenderPacoteDescontoBilhete());
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnSelectItem(Event ev) throws InterruptedException {
|
||||
|
@ -344,6 +363,58 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
|
|||
|
||||
}
|
||||
|
||||
public void onClick$btnAdicionarDescontoBilhete(Event ev) throws InterruptedException {
|
||||
txtPercdesconto.getValue();
|
||||
try {
|
||||
if(validarPacoteDescontoBilhete()) {
|
||||
PacoteDescontoBilhete pacoteDescontoBilhete = new PacoteDescontoBilhete();
|
||||
pacoteDescontoBilhete.setPercdesconto(txtPercdesconto.getValueDecimal());
|
||||
pacoteDescontoBilhete.setPacote(this.pacote);
|
||||
pacoteDescontoBilhete.setClaseServicio((ClaseServicio)cmbClaseServicio.getSelectedItem().getValue());
|
||||
pacoteDescontoBilheteService.suscribir(pacoteDescontoBilhete);
|
||||
pacoteDescontoBilheteList.addItemNovo(pacoteDescontoBilhete);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
Messagebox.show(Labels.getLabel("MSG.Error").concat(" - ").concat(ex.toString()),
|
||||
Labels.getLabel("editarConfiguracionPacoteController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnRemoverDescontoBilheteSelecionado(Event ev) throws InterruptedException {
|
||||
try {
|
||||
PacoteDescontoBilhete pacoteDescontoBilhete = (PacoteDescontoBilhete) pacoteDescontoBilheteList.getSelected();
|
||||
if(pacoteDescontoBilhete != null) {
|
||||
pacoteDescontoBilheteService.borrar(pacoteDescontoBilhete);
|
||||
pacoteDescontoBilheteList.removeItem(pacoteDescontoBilhete);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
Messagebox.show(Labels.getLabel("MSG.Error").concat(" - ").concat(ex.toString()),
|
||||
Labels.getLabel("editarConfiguracionPacoteController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validarPacoteDescontoBilhete() throws InterruptedException {
|
||||
boolean retorno = true;
|
||||
if(cmbClaseServicio.getSelectedItem() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfiguracionPacoteController.MSG.error.cmbClaseServicio"),
|
||||
Labels.getLabel("editarConfiguracionPacoteController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
retorno = false;
|
||||
}
|
||||
if(txtPercdesconto.getValueDecimal() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfiguracionPacoteController.MSG.error.txtPercdesconto"),
|
||||
Labels.getLabel("editarConfiguracionPacoteController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
retorno = false;
|
||||
}
|
||||
return retorno;
|
||||
}
|
||||
public Combobox getCmbRuta() {
|
||||
return cmbRuta;
|
||||
}
|
||||
|
@ -411,4 +482,28 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
|
|||
public void setCmbEmpresa(Combobox cmbEmpresa) {
|
||||
this.cmbEmpresa = cmbEmpresa;
|
||||
}
|
||||
|
||||
public Combobox getCmbClaseServicio() {
|
||||
return cmbClaseServicio;
|
||||
}
|
||||
|
||||
public void setCmbClaseServicio(Combobox cmbClaseServicio) {
|
||||
this.cmbClaseServicio = cmbClaseServicio;
|
||||
}
|
||||
|
||||
public List<ClaseServicio> getLsClaseServicio() {
|
||||
return lsClaseServicio;
|
||||
}
|
||||
|
||||
public void setLsClaseServicio(List<ClaseServicio> lsClaseServicio) {
|
||||
this.lsClaseServicio = lsClaseServicio;
|
||||
}
|
||||
|
||||
public MyTextboxDecimal getTxtPercdesconto() {
|
||||
return txtPercdesconto;
|
||||
}
|
||||
|
||||
public void setTxtPercdesconto(MyTextboxDecimal txtPercdesconto) {
|
||||
this.txtPercdesconto = txtPercdesconto;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
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.PacoteDescontoBilhete;
|
||||
|
||||
public class RenderPacoteDescontoBilhete implements ListitemRenderer {
|
||||
|
||||
private static final DecimalFormat DF = new DecimalFormat("#,##00.00");
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
|
||||
PacoteDescontoBilhete pacoteDescontoBilhete = (PacoteDescontoBilhete) o;
|
||||
|
||||
Listcell lc = new Listcell(pacoteDescontoBilhete.getPacotedescontobilheteId().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(pacoteDescontoBilhete.getClaseServicio().getDescclase());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(DF.format(pacoteDescontoBilhete.getPercdesconto()) != null ? DF.format(pacoteDescontoBilhete.getPercdesconto()) : "");
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", pacoteDescontoBilhete);
|
||||
}
|
||||
|
||||
}
|
|
@ -380,6 +380,7 @@
|
|||
<value>com.rjconsultores.ventaboletos.entidad.ClientePacote</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.TarifaVendaPacote</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.PacoteFormapago</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.PacoteDescontoBilhete</value>
|
||||
|
||||
<value>com.rjconsultores.ventaboletos.entidad.FiscalTotnaofiscalEmpresa</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.FiscalFormapagoEmpresa</value>
|
||||
|
|
|
@ -1044,6 +1044,7 @@ editarConfiguracionPacoteController.indVendaAgencia.value = Venta Punto Venta
|
|||
editarConfiguracionPacoteController.tabPacote.value = Paquete
|
||||
editarConfiguracionPacoteController.tabItensAdicionais.value = Itens Adicionais
|
||||
editarConfiguracionPacoteController.tabTipoTarifa.value = Tipo Tarifa
|
||||
editarConfiguracionPacoteController.tabDescontoBilhete.value = Desconto Bilhete
|
||||
editarConfiguracionPacoteController.txtDescItemAdicional.label = Nombre Item Adicional
|
||||
editarConfiguracionPacoteController.lhId.label = ID
|
||||
editarConfiguracionPacoteController.lhDesc.label = Descripción
|
||||
|
@ -1078,6 +1079,11 @@ editarConfiguracionPacoteController.MSG.error.cmbTipoTarifaPacote = Se debe sele
|
|||
editarConfiguracionPacoteController.MSG.error.tipoTarifaPacote = Usted tarifa se ha unido en este paquete.
|
||||
editarConfiguracionPacoteController.MSG.error.cmbItemAdicional = Deve ser selecionado um artículo.
|
||||
editarConfiguracionPacoteController.MSG.error.itemAdicional = Usted artículo se ha unido en este paquete.
|
||||
editarConfiguracionPacoteController.lbClaseServicio.label = Clase Servicio
|
||||
editarConfiguracionPacoteController.lbPercdesconto.label = % Descuento
|
||||
editarConfiguracionPacoteController.btnAdicionar.tooltiptext = Adicionar
|
||||
editarConfiguracionPacoteController.MSG.error.cmbClaseServicio = Informar Clase Servicio
|
||||
editarConfiguracionPacoteController.MSG.error.txtPercdesconto = Informar % Descuento
|
||||
|
||||
# Busca Configuracion Itens Adicionais De Pacote
|
||||
busquedaConfiguracionItemPacoteController.window.title = Configuración de Artículo de Paquete
|
||||
|
|
|
@ -1082,6 +1082,7 @@ editarConfiguracionPacoteController.indVendaAgencia.value = Venda para Agência
|
|||
editarConfiguracionPacoteController.tabPacote.value = Pacote
|
||||
editarConfiguracionPacoteController.tabItensAdicionais.value = Itens Adicionais
|
||||
editarConfiguracionPacoteController.tabTipoTarifa.value = Tipo Tarifa
|
||||
editarConfiguracionPacoteController.tabDescontoBilhete.value = Desconto Bilhete
|
||||
editarConfiguracionPacoteController.txtDescItemAdicional.label = Nombre Item Adicional
|
||||
editarConfiguracionPacoteController.lhId.label = ID
|
||||
editarConfiguracionPacoteController.lhDesc.label = Descrição
|
||||
|
@ -1117,6 +1118,11 @@ editarConfiguracionPacoteController.MSG.error.cmbTipoTarifaPacote = Deve ser sel
|
|||
editarConfiguracionPacoteController.MSG.error.tipoTarifaPacote = Está tarifa já possui cadastro neste pacote.
|
||||
editarConfiguracionPacoteController.MSG.error.cmbItemAdicional = Deve ser selecionado um item adicional.
|
||||
editarConfiguracionPacoteController.MSG.error.itemAdicional = Este item adicional já possui cadastro neste pacote.
|
||||
editarConfiguracionPacoteController.lbClaseServicio.label = Classe Serviço
|
||||
editarConfiguracionPacoteController.lbPercdesconto.label = % Desconto
|
||||
editarConfiguracionPacoteController.btnAdicionar.tooltiptext = Adicionar
|
||||
editarConfiguracionPacoteController.MSG.error.cmbClaseServicio = Informar Classe Serviço
|
||||
editarConfiguracionPacoteController.MSG.error.txtPercdesconto = Informar % Descuento
|
||||
|
||||
# Busca Configuracion Itens Adicionais De Pacote
|
||||
busquedaConfiguracionItemPacoteController.window.title = Configuração de Itens Adicionais de Pacote
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
label="${c:l('editarConfiguracionPacoteController.tabItensAdicionais.value')}" />
|
||||
<tab id="C" disabled="@{winEditarConfiguracionPacote$composer.isBlockTab}"
|
||||
label="${c:l('editarConfiguracionPacoteController.tabTipoTarifa.value')}" />
|
||||
<tab id="D" disabled="@{winEditarConfiguracionPacote$composer.isBlockTab}"
|
||||
label="${c:l('editarConfiguracionPacoteController.tabDescontoBilhete.value')}" />
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
|
||||
|
@ -166,7 +168,7 @@
|
|||
<paging id="pagingTarifaPacote" pageSize="20" />
|
||||
<listbox id="tarifaPacoteList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false" height="325px">
|
||||
multiple="false" height="420px">
|
||||
<listhead sizable="true">
|
||||
<listheader width="20%"
|
||||
image="/gui/img/builder.gif"
|
||||
|
@ -208,6 +210,56 @@
|
|||
|
||||
</tabpanel>
|
||||
|
||||
<!-- DESCONTO BILHETE -->
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
<column width="80%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<!-- Clase Servicio -->
|
||||
<label value="${c:l('editarConfiguracionPacoteController.lbClaseServicio.label')}"/>
|
||||
<combobox id="cmbClaseServicio" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="70%"
|
||||
model="@{winEditarConfiguracionPacote$composer.lsClaseServicio}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('editarConfiguracionPacoteController.lbPercdesconto.label')}"/>
|
||||
<textbox id="txtPercdesconto" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal"
|
||||
precision="5" scale="2" maxlength="7" constraint="no empty" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnAdicionarDescontoBilhete"
|
||||
height="30px" width="35px" image="/gui/img/add.png"
|
||||
tooltiptext="${c:l('editarConfiguracionPacoteController.btnAdicionar.tooltiptext')}" />
|
||||
<button id="btnRemoverDescontoBilheteSelecionado"
|
||||
height="30px" width="35px" image="/gui/img/remove.png"
|
||||
tooltiptext="${c:l('editarConfiguracionPacoteController.btnRemoverItem.tooltiptext')}" />
|
||||
</toolbar>
|
||||
|
||||
<paging id="pagingPacoteDescontoBilhete" pageSize="20" />
|
||||
<listbox id="pacoteDescontoBilheteList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false" height="250px">
|
||||
<listhead sizable="true">
|
||||
<listheader width="20%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConfiguracionPacoteController.lhId.label')}" />
|
||||
<listheader width="40%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConfiguracionPacoteController.lbClaseServicio.label')}" />
|
||||
<listheader width="40%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConfiguracionPacoteController.lbPercdesconto.label')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
|
|
Loading…
Reference in New Issue