fixed bug #9091 - Criação de campos para cobrança da taxa de conveniencia na venda.
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@69955 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
54e4951096
commit
f5ab4011fd
|
@ -6,12 +6,10 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
|||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
|
@ -136,7 +134,7 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|||
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.FechamentoParamptovtaListItemRenderer;
|
||||
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.PuntoVendaHistoricoBloqueioListItemRenderer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintNoEmpty;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagem;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagemAllowNull;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
|
@ -265,7 +263,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private List<PtovtaEstoque> lsEstoque;
|
||||
private List<PtovtaComissao> lsPtovtaComissao;
|
||||
private List<String> lsLogFiles;
|
||||
private List<HistoricoPuntoVenta> lsHistoricoPuntoVenda;
|
||||
private Radio radDatosTarjetaSi;
|
||||
private Radio radDatosTarjetaNo;
|
||||
private Radio radAprobacionAutorizado;
|
||||
|
@ -283,8 +280,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private Radio radTotvsNo;
|
||||
private Radio radTotvsErro;
|
||||
private Radio radTipoPagamentoBoleto;
|
||||
private Radio radTipoPagamentoDeposito;
|
||||
|
||||
private Button btnAdicionarEmpresaComissao;
|
||||
private MyComboboxPuntoVenta cmbPuntoVentaPadre;
|
||||
private Combobox cmbFormaPago;
|
||||
|
@ -381,7 +376,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private Checkbox ckIsento;
|
||||
private Checkbox checkSimulaIntegracion;
|
||||
private Checkbox checkTodosPuntosVenta;
|
||||
private Checkbox checkTodosPuntosVentaAG;
|
||||
private Checkbox checkDinheiro;
|
||||
private Checkbox checkCredito;
|
||||
private Checkbox checkDebito;
|
||||
|
@ -395,7 +389,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private Datebox fecIntegracion;
|
||||
private Datebox fecInicioAG;
|
||||
private Datebox fecFimAG;
|
||||
private Textbox logResult;
|
||||
private boolean integracionTotvs;
|
||||
private boolean integracionAG;
|
||||
private Timebox txtTempoParaImpressao;
|
||||
|
@ -413,7 +406,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private String statusAprobacionInicial = "";
|
||||
private Decimalbox txtTaxaConvenienciaPorc;
|
||||
private Doublebox txtMaximoTaxaConveniencia;
|
||||
private ConstraintPorcentagem ct;
|
||||
private ConstraintPorcentagemAllowNull ct;
|
||||
|
||||
private static final String EMAIL_PATTERN =
|
||||
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
|
||||
|
@ -456,7 +449,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
setCt(new ConstraintPorcentagem());
|
||||
setCt(new ConstraintPorcentagemAllowNull());
|
||||
lsCategoriaBloquear = categoriaService.obtenerTodasCategoriasVisibles();
|
||||
lsEmpresasBloquear = empresaService.obtenerTodos();
|
||||
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||
|
@ -479,6 +472,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
|
||||
getTxtTaxaConvenienciaPorc().setConstraint(getCt());
|
||||
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener() {
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
cmbBanco.setSelectedIndex(lsBanco.indexOf(puntoVenta.getAgenciaId().getInstiFinanceiraId()));
|
||||
}
|
||||
|
@ -872,24 +866,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
downloadLogIntegracao(cmbLogFilesAG);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private String readFile(String fileName) throws IOException {
|
||||
BufferedReader br = new BufferedReader(new FileReader(fileName));
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line = br.readLine();
|
||||
|
||||
while (line != null) {
|
||||
sb.append(line);
|
||||
sb.append("\n");
|
||||
line = br.readLine();
|
||||
}
|
||||
return sb.toString();
|
||||
} finally {
|
||||
br.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean validaFuncionTipoBoletoBloqueado() {
|
||||
List<String> listClavesPermisos = new ArrayList<String>();
|
||||
|
@ -1392,10 +1368,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
txtAntecipRetem.getValue();
|
||||
txtAntecipPercentual.getValue();
|
||||
getTxtTaxaConvenienciaPorc().getValue();
|
||||
if(getTxtTaxaConvenienciaPorc().getValue().compareTo(BigDecimal.ZERO) == 1){
|
||||
if (getTxtTaxaConvenienciaPorc().getValue() != null &&
|
||||
getTxtTaxaConvenienciaPorc().getValue().compareTo(BigDecimal.ZERO) == 1) {
|
||||
txtMaximoTaxaConveniencia.setConstraint("no empty");
|
||||
}
|
||||
txtMaximoTaxaConveniencia.getValue();
|
||||
}
|
||||
|
||||
cmbEmpresa.getValue();
|
||||
cmbParada.getValue();
|
||||
|
@ -3476,14 +3453,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
/**
|
||||
* @return the ct
|
||||
*/
|
||||
public ConstraintPorcentagem getCt() {
|
||||
public ConstraintPorcentagemAllowNull getCt() {
|
||||
return ct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ct the ct to set
|
||||
*/
|
||||
public void setCt(ConstraintPorcentagem ct) {
|
||||
public void setCt(ConstraintPorcentagemAllowNull ct) {
|
||||
this.ct = ct;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zul.Constraint;
|
||||
|
||||
/**
|
||||
* @author Thiago
|
||||
*
|
||||
*/
|
||||
public class ConstraintPorcentagemAllowNull implements Constraint {
|
||||
|
||||
@Override
|
||||
public void validate(Component comp, Object value) throws WrongValueException {
|
||||
if (value != null) {
|
||||
if (((BigDecimal) value).doubleValue() > 100) {
|
||||
throw new WrongValueException(comp,
|
||||
Labels.getLabel("MSG.CONSTRAINT.PORCENTAGEM"));
|
||||
} else if (((BigDecimal) value).doubleValue() < 0) {
|
||||
throw new WrongValueException(comp,
|
||||
Labels.getLabel("MSG.CONSTRAINT.PORCENTAGEM"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue