From 9b2b090ef7567af5a2d47d67762285be302e8147 Mon Sep 17 00:00:00 2001 From: thiago Date: Tue, 20 Mar 2018 22:17:02 +0000 Subject: [PATCH] fixed bug #10663 dev:Wilian qas:Wallysson git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@80069 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../catalogos/EditarFormaPagoController.java | 162 +++++++++++++++++- web/WEB-INF/i3-label_es_MX.label | 3 + web/WEB-INF/i3-label_pt_BR.label | 3 + web/gui/catalogos/editarFormaPago.zul | 15 ++ 4 files changed, 174 insertions(+), 9 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarFormaPagoController.java index e1574d37a..697f565a0 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarFormaPagoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarFormaPagoController.java @@ -18,11 +18,13 @@ 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.Checkbox; 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.IndRestricaoFormaPago; import com.rjconsultores.ventaboletos.enums.TipoFormapago; import com.rjconsultores.ventaboletos.service.FormaPagoService; import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; @@ -33,7 +35,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; /** - * + * * @author Administrador */ @Controller("editarFormaPagoController") @@ -50,15 +52,22 @@ public class EditarFormaPagoController extends MyGenericForwardComposer { private Button btnApagar; private BusquedaFormaPagoController busquedaFormaPagoController; private Button btnSalvar; + private Checkbox chkIndRestricaoFormaPago; + private Checkbox chkCompoeTarifaETaxa; + private Checkbox chkCompoeTarifa; private Radio rd1; private Radio rd2; private Radio rd3; private Radio rd4; private static Logger log = Logger.getLogger(EditarFormaPagoController.class); private Row rowEquivalencia; - + private Row rowRestricaoFormaPago; + private Row rowTarifaTaxa; + private Row rowSomenteTarifa; + private boolean exibeTipoRestricaoFormaPago; + private MyComboboxEstandar cmbTipoFormapago; - + public FormaPago getFormaPago() { return formaPago; } @@ -69,13 +78,36 @@ 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(); - + /* + * Somente exibe se vai ter restrição de forma de pagamento na hora da venda se não houver cvesistema. + * Pode ser alterado para respeitar somente as formas de pagamento especiais. + * + */ + if (formaPago.getCveSistema() != null) { + rowRestricaoFormaPago.setVisible(false); + rowTarifaTaxa.setVisible(false); + rowSomenteTarifa.setVisible(false); + }else if(formaPago.getIndRestricaoFormaPago() == null || + formaPago.getIndRestricaoFormaPago().equals(IndRestricaoFormaPago.NORMAL.getSigla())){ + rowTarifaTaxa.setVisible(false); + rowSomenteTarifa.setVisible(false); + }else{ + rowTarifaTaxa.setVisible(true); + rowSomenteTarifa.setVisible(true); + chkIndRestricaoFormaPago.setChecked(true); + if(formaPago.getIndRestricaoFormaPago().equals(IndRestricaoFormaPago.TARIFA_E_TAXAS.getSigla())){ + chkCompoeTarifaETaxa.setChecked(true); + }else{ + chkCompoeTarifa.setChecked(true); + } + } + if (formaPago.getFormapagoId() == null) { btnApagar.setVisible(Boolean.FALSE); } else { @@ -93,7 +125,7 @@ public class EditarFormaPagoController extends MyGenericForwardComposer { if (formaPago.getFormapagoId() == 1) { cmbTipoFormapago.setDisabled(Boolean.TRUE); } - + if (formaPago.getFormapagoId() <= 11 || (formaPago.getFormapagoId() >= 92 && formaPago.getFormapagoId() <= 99) || formaPago.getFormapagoId() == 37 || StringUtils.isNotBlank(formaPago.getCveSistema())) { btnApagar.setVisible(Boolean.FALSE); txtNome.setDisabled(Boolean.TRUE); @@ -109,11 +141,11 @@ public class EditarFormaPagoController extends MyGenericForwardComposer { if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { rowEquivalencia.setVisible(Boolean.FALSE); } - + if(formaPago.getTipoFormapago() != null) { cmbTipoFormapago.setValue(formaPago.getTipoFormapago().toString()); } - + txtNome.focus(); } @@ -125,6 +157,21 @@ public class EditarFormaPagoController extends MyGenericForwardComposer { } } + public void onCheck$chkIndRestricaoFormaPago(Event event) { + rowTarifaTaxa.setVisible(getChkIndRestricaoFormaPago().isChecked()); + rowSomenteTarifa.setVisible(getChkIndRestricaoFormaPago().isChecked()); + chkCompoeTarifaETaxa.setChecked(true); + chkCompoeTarifa.setChecked(false); + } + + public void onCheck$chkCompoeTarifaETaxa(Event event) { + chkCompoeTarifa.setChecked(!chkCompoeTarifaETaxa.isChecked()); + } + + public void onCheck$chkCompoeTarifa(Event event) { + chkCompoeTarifaETaxa.setChecked(!chkCompoeTarifa.isChecked()); + } + public void onClick$btnSalvar(Event ev) throws InterruptedException { txtNome.getValue(); txtCvePago.getValue(); @@ -134,7 +181,7 @@ public class EditarFormaPagoController extends MyGenericForwardComposer { formaPago.setActivo(Boolean.TRUE); formaPago.setFecmodif(Calendar.getInstance().getTime()); formaPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - + if(cmbTipoFormapago.getSelectedItem() != null) { formaPago.setTipoFormapago((TipoFormapago) cmbTipoFormapago.getSelectedItem().getValue()); } @@ -149,6 +196,16 @@ public class EditarFormaPagoController extends MyGenericForwardComposer { formaPago.setIndoperacion(new Short("3")); } + if(!chkIndRestricaoFormaPago.isChecked()){ + formaPago.setIndRestricaoFormaPago(IndRestricaoFormaPago.NORMAL.getSigla()); + }else{ + if(chkCompoeTarifaETaxa.isChecked()){ + formaPago.setIndRestricaoFormaPago(IndRestricaoFormaPago.TARIFA_E_TAXAS.getSigla()); + }else if(chkCompoeTarifa.isChecked()){ + formaPago.setIndRestricaoFormaPago(IndRestricaoFormaPago.SOMENTE_TARIFA.getSigla()); + } + } + if (formaPago.getFormapagoId() == null) { List lsFP = formaPagoService.buscarPorDescricao(formaPago.getDescpago()); @@ -219,4 +276,91 @@ public class EditarFormaPagoController extends MyGenericForwardComposer { this.cmbTipoFormapago = cmbTipoFormapago; } + /** + * @return the chkIndRestricaoFormaPago + */ + public Checkbox getChkIndRestricaoFormaPago() { + return chkIndRestricaoFormaPago; + } + + /** + * @return the chkCompoeTarifaETaxa + */ + public Checkbox getChkCompoeTarifaETaxa() { + return chkCompoeTarifaETaxa; + } + + /** + * @return the chkCompoeTarifa + */ + public Checkbox getChkCompoeTarifa() { + return chkCompoeTarifa; + } + + /** + * @param chkIndRestricaoFormaPago + * the chkIndRestricaoFormaPago to set + */ + public void setChkIndRestricaoFormaPago(Checkbox chkIndRestricaoFormaPago) { + this.chkIndRestricaoFormaPago = chkIndRestricaoFormaPago; + } + + /** + * @param chkCompoeTarifaETaxa + * the chkCompoeTarifaETaxa to set + */ + public void setChkCompoeTarifaETaxa(Checkbox chkCompoeTarifaETaxa) { + this.chkCompoeTarifaETaxa = chkCompoeTarifaETaxa; + } + + /** + * @param chkCompoeTarifa + * the chkCompoeTarifa to set + */ + public void setChkCompoeTarifa(Checkbox chkCompoeTarifa) { + this.chkCompoeTarifa = chkCompoeTarifa; + } + + /** + * @return the exibeTipoRestricaoFormaPago + */ + public boolean isExibeTipoRestricaoFormaPago() { + return exibeTipoRestricaoFormaPago; + } + + /** + * @param exibeTipoRestricaoFormaPago the exibeTipoRestricaoFormaPago to set + */ + public void setExibeTipoRestricaoFormaPago(boolean exibeTipoRestricaoFormaPago) { + this.exibeTipoRestricaoFormaPago = exibeTipoRestricaoFormaPago; + } + + /** + * @return the rowTarifaTaxa + */ + public Row getRowTarifaTaxa() { + return rowTarifaTaxa; + } + + /** + * @return the rowSomenteTarifa + */ + public Row getRowSomenteTarifa() { + return rowSomenteTarifa; + } + + /** + * @param rowTarifaTaxa the rowTarifaTaxa to set + */ + public void setRowTarifaTaxa(Row rowTarifaTaxa) { + this.rowTarifaTaxa = rowTarifaTaxa; + } + + /** + * @param rowSomenteTarifa the rowSomenteTarifa to set + */ + public void setRowSomenteTarifa(Row rowSomenteTarifa) { + this.rowSomenteTarifa = rowSomenteTarifa; + } + } diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index a081e1dc4..05af1d86d 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -860,6 +860,9 @@ editarFormaPagoController.lblReserva.label = Reservación editarFormaPagoController.lblTipoFormapago.label = Tipo editarFormaPagoController.lblCheque.label = Cheque editarFormaPagoController.lblDeposito.label = Deposito +editarFormaPagoController.lblRestricaoFormaPago.label=Ativa Restricción de Forma de Pagamiento +editarFormaPagoController.lblTarifaTaxa.label=Compone Tarifa y Taxas +editarFormaPagoController.lblSomenteTarifa.label=Compone Tarifa # Muestra o tipo de Búsqueda Punto de venta busquedaTipoPuntoVentaController.window.title = Canal de venta diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index f0c754eb0..101f7af3e 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -918,6 +918,9 @@ editarFormaPagoController.lblReserva.label = Reserva editarFormaPagoController.lblTipoFormapago.label = Tipo editarFormaPagoController.lblCheque.label = Cheque editarFormaPagoController.lblDeposito.label = Deposito +editarFormaPagoController.lblRestricaoFormaPago.label=Ativa Restrição de Forma de Pagamento +editarFormaPagoController.lblTarifaTaxa.label=Compõe Tarifa e Taxas +editarFormaPagoController.lblSomenteTarifa.label=Compõe Tarifa # Muestra o tipo de Pesquisa Ponto Venda busquedaTipoPuntoVentaController.window.title = Canal de Venda diff --git a/web/gui/catalogos/editarFormaPago.zul b/web/gui/catalogos/editarFormaPago.zul index dda029b8e..4e7929a30 100644 --- a/web/gui/catalogos/editarFormaPago.zul +++ b/web/gui/catalogos/editarFormaPago.zul @@ -79,6 +79,21 @@ mold="rounded" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" /> + + + + + +