wilian 2016-12-13 18:10:08 +00:00
parent e6c0197490
commit 065528649b
12 changed files with 135 additions and 20 deletions

View File

@ -17,13 +17,16 @@ 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.Comboitem;
import org.zkoss.zul.Radio;
import org.zkoss.zul.Row;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
import com.rjconsultores.ventaboletos.service.FormaPagoService;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
@ -52,7 +55,9 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
private Radio rd4;
private static Logger log = Logger.getLogger(EditarFormaPagoController.class);
private Row rowEquivalencia;
private MyComboboxEstandar cmbTipoFormapago;
public FormaPago getFormaPago() {
return formaPago;
}
@ -63,10 +68,12 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
busquedaFormaPagoController = (BusquedaFormaPagoController) Executions.getCurrent().getArg().get("busquedaFormaPagoController");
formaPago = (FormaPago) Executions.getCurrent().getArg().get("formaPago");
formaPagoList = (MyListbox) Executions.getCurrent().getArg().get("formaPagoList");
popularCombobox();
if (formaPago.getFormapagoId() == null) {
btnApagar.setVisible(Boolean.FALSE);
@ -98,17 +105,34 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
rowEquivalencia.setVisible(Boolean.FALSE);
}
if(formaPago.getTipoFormapago() != null) {
cmbTipoFormapago.setValue(formaPago.getTipoFormapago().toString());
}
txtNome.focus();
}
private void popularCombobox() {
for (TipoFormapago tipoFormapago : TipoFormapago.values()) {
Comboitem comboItem = new Comboitem(tipoFormapago.toString());
comboItem.setValue(tipoFormapago);
comboItem.setParent(cmbTipoFormapago);
}
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
txtNome.getValue();
txtCvePago.getValue();
cmbTipoFormapago.getValue();
try {
formaPago.setActivo(Boolean.TRUE);
formaPago.setFecmodif(Calendar.getInstance().getTime());
formaPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
if(cmbTipoFormapago.getSelectedItem() != null) {
formaPago.setTipoFormapago((TipoFormapago) cmbTipoFormapago.getSelectedItem().getValue());
}
if (rd4.isChecked()) {
formaPago.setIndoperacion(null);
@ -181,4 +205,13 @@ public class EditarFormaPagoController extends MyGenericForwardComposer {
log.error(ex);
}
}
public MyComboboxEstandar getCmbTipoFormapago() {
return cmbTipoFormapago;
}
public void setCmbTipoFormapago(MyComboboxEstandar cmbTipoFormapago) {
this.cmbTipoFormapago = cmbTipoFormapago;
}
}

View File

@ -102,7 +102,7 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
private MyListbox tarifaPacoteList;
private MyListbox pacoteList;
private MyListbox pacoteDescontoBilheteList;
private boolean blockTab;
@Override
@ -173,7 +173,10 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
@Override
public void onEvent(Event event) throws Exception {
removerTarifaSelecionado();
if(tarifaPacoteList.getSelected() != null) {
PacoteTarifa pacoteTarifa = (PacoteTarifa) tarifaPacoteList.getSelected();
editarTarifaSelecionado(pacoteTarifa, pacoteTarifa.getTipoTarifaPacote());
}
}
});
@ -208,7 +211,6 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void onClick$btnSelectTarifa(Event ev) throws InterruptedException {
Comboitem cbtarifa = cmbTipoTarifaPacote.getSelectedItem();
@ -232,13 +234,7 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
return;
}
Map args = new HashMap();
args.put("pacote", pacote);
args.put("tipoTarifaPacote", tarifa);
args.put("tarifaPacoteList", tarifaPacoteList);
openWindow("/gui/configuraciones_comerciales/editarPacoteTarifa.zul",
Labels.getLabel("editarConfiguracionPacoteController.window.title"), args, MODAL);
editarTarifaSelecionado(null, tarifa);
}
public void onClick$btnRemoverItemSelecionado(Event ev) throws InterruptedException {
@ -417,6 +413,7 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
}
return retorno;
}
public Combobox getCmbRuta() {
return cmbRuta;
}
@ -508,4 +505,20 @@ public class EditarConfiguracionPacoteController extends MyGenericForwardCompose
public void setTxtPercdesconto(MyTextboxDecimal txtPercdesconto) {
this.txtPercdesconto = txtPercdesconto;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
private void editarTarifaSelecionado(PacoteTarifa pacoteTarifa, TipoTarifaPacote tipoTarifaPacote) {
Map args = new HashMap();
if(pacoteTarifa != null) {
args.put("pacoteTarifa", pacoteTarifa);
}
args.put("pacote", pacote);
args.put("tipoTarifaPacote", tipoTarifaPacote);
args.put("tarifaPacoteList", tarifaPacoteList);
openWindow("/gui/configuraciones_comerciales/editarPacoteTarifa.zul",
Labels.getLabel("editarConfiguracionPacoteController.window.title"), args, MODAL);
}
}

View File

@ -9,12 +9,15 @@ import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Messagebox;
import com.rjconsultores.ventaboletos.entidad.Pacote;
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
import com.rjconsultores.ventaboletos.service.PacoteTarifaService;
import com.rjconsultores.ventaboletos.utilerias.BigDecimalUtil;
import com.rjconsultores.ventaboletos.utilerias.LocaleUtil;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
@ -35,11 +38,16 @@ public class EditarPacoteTarifaController extends MyGenericForwardComposer {
private MyListbox tarifaPacoteList;
private MyTextbox txtDescTarifa;
private MyTextboxDecimal tarifa;
private Checkbox chkIndvendaweb;
PacoteTarifa pacoteTarifa;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
pacoteTarifa = (PacoteTarifa) Executions.getCurrent().getArg().get("pacoteTarifa");
pacote = (Pacote) Executions.getCurrent().getArg().get("pacote");
tipoTarifaPacote = (TipoTarifaPacote) Executions.getCurrent().getArg().get("tipoTarifaPacote");
tarifaPacoteList = (MyListbox) Executions.getCurrent().getArg().get("tarifaPacoteList");
@ -47,15 +55,22 @@ public class EditarPacoteTarifaController extends MyGenericForwardComposer {
if (tipoTarifaPacote != null) {
txtDescTarifa.setValue(tipoTarifaPacote.getDesctipotarifa());
}
if(pacoteTarifa != null) {
tarifa.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(pacoteTarifa.getTarifa(), LocaleUtil.getLocale()));
chkIndvendaweb.setChecked(pacoteTarifa.getIndvendaweb() != null ? pacoteTarifa.getIndvendaweb() : false);
}
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
chkIndvendaweb.getValue();
try {
tipoTarifaPacote.setDesctipotarifa(txtDescTarifa.getValue());
PacoteTarifa pacoteTarifa = pacoteTarifaService.vincularPacoteTarifa(null, pacote, tipoTarifaPacote,
tarifa.getValueDecimal());
tarifaPacoteList.addItemNovo(pacoteTarifa);
pacoteTarifa = pacoteTarifaService.vincularPacoteTarifa(pacoteTarifa, pacote, tipoTarifaPacote,
tarifa.getValueDecimal(), chkIndvendaweb.isChecked());
tarifaPacoteList.updateItem(pacoteTarifa);
closeWindow();

View File

@ -5,9 +5,6 @@ import java.util.Map;
import javax.sql.DataSource;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.util.JRLoader;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
@ -30,6 +27,9 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.util.JRLoader;
@Controller("editarManutencaoPacoteController")
@Scope("prototype")
public class EditarManutencaoPacoteController extends MyGenericForwardComposer {

View File

@ -27,6 +27,9 @@ public class RenderFormaPago implements ListitemRenderer {
lc = new Listcell(formaPago.getCvePago());
lc.setParent(lstm);
lc = new Listcell(formaPago.getTipoFormapago() != null ? formaPago.getTipoFormapago().getDescricao() : "");
lc.setParent(lstm);
if (ApplicationProperties.getInstance().mostrarEquivalencia()) {
lc = new Listcell(formaPago.getEquivalenciaId());

View File

@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.web.utilerias.render;
import java.text.DecimalFormat;
import org.zkoss.util.resource.Labels;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
@ -28,6 +29,9 @@ public class RenderTarifaPacote implements ListitemRenderer {
lc = new Listcell(fmt.format(pacoteTarifa.getTarifa()) != null ? fmt.format(pacoteTarifa.getTarifa()) : "");
lc.setParent(lstm);
lc = new Listcell(pacoteTarifa.getIndvendaweb() != null && pacoteTarifa.getIndvendaweb() ? Labels.getLabel("MSG.SI") : Labels.getLabel("MSG.NO"));
lc.setParent(lstm);
lstm.setAttribute("data", pacoteTarifa);
}

View File

@ -648,6 +648,19 @@ editarFormaPagoController.MSG.borrarPergunta = Desea eliminar forma de pago?
editarFormaPagoController.MSG.borrarOK = Forma de pago se eliminó exitosamente
editarFormaPagoController.MSG.existe.registro= Ya existe un registro con estos datos
editarFormaPagoController.lbIndconferenciafisicacomissao.value = Exigir Conferencia Fisíca Comisión
editarFormaPagoController.lblDinheiro.label = Dinero
editarFormaPagoController.lblDebito.label = Débito
editarFormaPagoController.lblCredito.label = Crédito
editarFormaPagoController.lblNotaCredito.label = Nota Crédito
editarFormaPagoController.lblTrocaPassagem.label = Cambio Pasaje
editarFormaPagoController.lblImpressaoPassagem.label = Impresión Pasaje
editarFormaPagoController.lblOrdemServico.label = Orden Servicio
editarFormaPagoController.lblBoletoAberto.label = Boleto Abierto
editarFormaPagoController.lblPacote.label = Pacote
editarFormaPagoController.lblReserva.label = Reserva
editarFormaPagoController.lblTipoFormapago.label = Tipo
editarFormaPagoController.lblCheque.label = Cheque
editarFormaPagoController.lblDeposito.label = Deposito
# Muestra o tipo de Búsqueda Punto de venta
busquedaTipoPuntoVentaController.window.title = Canal de venta
@ -1331,6 +1344,7 @@ editarConfiguracionPacoteController.lhPacote.label = Nombre Paquete
editarConfiguracionPacoteController.lhItem.label = Descripción Artículo
editarConfiguracionPacoteController.lhTipoTarifa.label = Descripción Tarifa
editarConfiguracionPacoteController.lhTarifa.label = Tarifa
editarConfiguracionPacoteController.lhVendaWeb.label = Permite Venda Web
editarConfiguracionPacoteController.MSG.error.cmbRuta = Debe de seleccionar una ruta.
editarConfiguracionPacoteController.MSG.error.descPacote = Has alcanzado el límite máximo de caracteres de la descripción del paquete.
editarConfiguracionPacoteController.MSG.error.cmbTipoTarifaPacote = Debe de seleccionar una tarifa.

View File

@ -688,6 +688,19 @@ editarFormaPagoController.MSG.borrarPergunta = Deseja Eliminar Forma de Pagament
editarFormaPagoController.MSG.borrarOK = Forma de Pagamento Excluida com Sucesso.
editarFormaPagoController.MSG.existe.registro= Já existe um registro com estes dados.
editarFormaPagoController.lbIndconferenciafisicacomissao.value = Exigir Conferência Fisíca Comissão
editarFormaPagoController.lblDinheiro.label = Dinheiro
editarFormaPagoController.lblDebito.label = Débito
editarFormaPagoController.lblCredito.label = Crédito
editarFormaPagoController.lblNotaCredito.label = Nota Crédito
editarFormaPagoController.lblTrocaPassagem.label = Troca Passagem
editarFormaPagoController.lblImpressaoPassagem.label = Impressão Passagem
editarFormaPagoController.lblOrdemServico.label = Ordem Serviço
editarFormaPagoController.lblBoletoAberto.label = Boleto Aberto
editarFormaPagoController.lblPacote.label = Pacote
editarFormaPagoController.lblReserva.label = Reserva
editarFormaPagoController.lblTipoFormapago.label = Tipo
editarFormaPagoController.lblCheque.label = Cheque
editarFormaPagoController.lblDeposito.label = Deposito
# Muestra o tipo de Pesquisa Ponto Venda
busquedaTipoPuntoVentaController.window.title = Canal de Venda
@ -1382,6 +1395,7 @@ editarConfiguracionPacoteController.lhPacote.label = Nome Pacote
editarConfiguracionPacoteController.lhItem.label = Descrição Item
editarConfiguracionPacoteController.lhTipoTarifa.label = Descrição Tarifa
editarConfiguracionPacoteController.lhTarifa.label = Tarifa
editarConfiguracionPacoteController.lhVendaWeb.label = Permite Venda Web
editarConfiguracionPacoteController.MSG.error.cmbRuta = Deve ser selecionado uma linha.
editarConfiguracionPacoteController.MSG.error.cmbEmpresa = Deve ser selecionada a empresa.
editarConfiguracionPacoteController.MSG.error.descPacote = Você ultrapassou o limite maximo de caracteres da descrição de pacote.

View File

@ -63,6 +63,9 @@
<listheader id="lhCvePago" image="/gui/img/create_doc.gif"
label="${c:l('busquedaFormaPagoController.lhCve.label')}"
sort="auto(cvePago)" />
<listheader id="headerTipoFormapago"
image="/gui/img/create_doc.gif" label="${c:l('editarFormaPagoController.lblTipoFormapago.label')}"
sort="auto(tipoFormapago)" />
<listheader id="headerEquivalencia"
image="/gui/img/create_doc.gif" label="${c:l('lb.Equivalencia')}"
sort="auto(equivalenciaId)" />

View File

@ -71,6 +71,14 @@
</vbox>
</radiogroup>
</row>
<row>
<label
value="${c:l('editarFormaPagoController.lblTipoFormapago.label')}" />
<combobox id="cmbTipoFormapago"
width="70%"
mold="rounded"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" />
</row>
</rows>
</grid>

View File

@ -168,7 +168,7 @@
<paging id="pagingTarifaPacote" pageSize="20" />
<listbox id="tarifaPacoteList"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
multiple="false" height="420px">
multiple="false" height="325px">
<listhead sizable="true">
<listheader width="20%"
image="/gui/img/builder.gif"
@ -182,6 +182,9 @@
<listheader width="20%"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhTarifa.label')}" />
<listheader width="20%"
image="/gui/img/builder.gif"
label="${c:l('editarConfiguracionPacoteController.lhVendaWeb.label')}" />
</listhead>
</listbox>

View File

@ -8,7 +8,7 @@
<window id="winEditarPacoteTarifa"
title="${c:l('editarConfiguracionPacoteController.window.title')}"
apply="${editarPacoteTarifaController}"
contentStyle="overflow:auto" height="121px" width="500px"
contentStyle="overflow:auto" height="160px" width="500px"
border="normal">
<toolbar>
@ -41,6 +41,11 @@
<textbox id="tarifa" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal"
precision="7" scale="2" maxlength="9" constraint="no empty" />
</row>
<row>
<label value="${c:l('editarConfiguracionPacoteController.lhVendaWeb.label')}"/>
<checkbox id="chkIndvendaweb"/>
</row>
</rows>
</grid>