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.BufferedInputStream;
|
||||||
import java.io.BufferedOutputStream;
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.FileReader;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Connection;
|
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.FechamentoParamptovtaListItemRenderer;
|
||||||
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.PuntoVendaHistoricoBloqueioListItemRenderer;
|
import com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.PuntoVendaHistoricoBloqueioListItemRenderer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintNoEmpty;
|
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.MyComboboxEstandar;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
@ -166,7 +164,7 @@ import com.rjconsultores.wsag.GeradorTitulosAG;
|
||||||
import com.rjconsultores.wsag.WSAGLog;
|
import com.rjconsultores.wsag.WSAGLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
*/
|
*/
|
||||||
@Controller("editarPuntoVentaController")
|
@Controller("editarPuntoVentaController")
|
||||||
|
@ -175,7 +173,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger(EditarPuntoVentaController.class);
|
private static Logger log = Logger.getLogger(EditarPuntoVentaController.class);
|
||||||
|
|
||||||
public static final String FUNCION_TIPO_BOLETO_BLOQUEADO = "COM.RJCONSULTORES.ADMINISTRACION.PUNTOVENTA.TIPOBOLETOBLOQUEADO";
|
public static final String FUNCION_TIPO_BOLETO_BLOQUEADO = "COM.RJCONSULTORES.ADMINISTRACION.PUNTOVENTA.TIPOBOLETOBLOQUEADO";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -220,7 +218,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private FechamentoParamptovtaService fechamentoParamptovtaService;
|
private FechamentoParamptovtaService fechamentoParamptovtaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CategoriaBloqueioImpPosteriorService categoriaBloqueioImpPosteriorService;
|
private CategoriaBloqueioImpPosteriorService categoriaBloqueioImpPosteriorService;
|
||||||
|
|
||||||
private PuntoVenta puntoVenta;
|
private PuntoVenta puntoVenta;
|
||||||
private Textbox txtCP;
|
private Textbox txtCP;
|
||||||
private MyListbox puntoVentaList;
|
private MyListbox puntoVentaList;
|
||||||
|
@ -241,7 +239,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private MyListbox ptovtaHistoricoList;
|
private MyListbox ptovtaHistoricoList;
|
||||||
private MyListbox categoriasBloqImpPosteriorList;
|
private MyListbox categoriasBloqImpPosteriorList;
|
||||||
private MyListbox empresaContaBancariaList;
|
private MyListbox empresaContaBancariaList;
|
||||||
|
|
||||||
private List<Categoria> lsCategoriaBloquear;
|
private List<Categoria> lsCategoriaBloquear;
|
||||||
|
|
||||||
private List<Empresa> lsEmpresasBloquear;
|
private List<Empresa> lsEmpresasBloquear;
|
||||||
|
@ -265,7 +263,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private List<PtovtaEstoque> lsEstoque;
|
private List<PtovtaEstoque> lsEstoque;
|
||||||
private List<PtovtaComissao> lsPtovtaComissao;
|
private List<PtovtaComissao> lsPtovtaComissao;
|
||||||
private List<String> lsLogFiles;
|
private List<String> lsLogFiles;
|
||||||
private List<HistoricoPuntoVenta> lsHistoricoPuntoVenda;
|
|
||||||
private Radio radDatosTarjetaSi;
|
private Radio radDatosTarjetaSi;
|
||||||
private Radio radDatosTarjetaNo;
|
private Radio radDatosTarjetaNo;
|
||||||
private Radio radAprobacionAutorizado;
|
private Radio radAprobacionAutorizado;
|
||||||
|
@ -283,8 +280,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private Radio radTotvsNo;
|
private Radio radTotvsNo;
|
||||||
private Radio radTotvsErro;
|
private Radio radTotvsErro;
|
||||||
private Radio radTipoPagamentoBoleto;
|
private Radio radTipoPagamentoBoleto;
|
||||||
private Radio radTipoPagamentoDeposito;
|
|
||||||
|
|
||||||
private Button btnAdicionarEmpresaComissao;
|
private Button btnAdicionarEmpresaComissao;
|
||||||
private MyComboboxPuntoVenta cmbPuntoVentaPadre;
|
private MyComboboxPuntoVenta cmbPuntoVentaPadre;
|
||||||
private Combobox cmbFormaPago;
|
private Combobox cmbFormaPago;
|
||||||
|
@ -381,7 +376,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private Checkbox ckIsento;
|
private Checkbox ckIsento;
|
||||||
private Checkbox checkSimulaIntegracion;
|
private Checkbox checkSimulaIntegracion;
|
||||||
private Checkbox checkTodosPuntosVenta;
|
private Checkbox checkTodosPuntosVenta;
|
||||||
private Checkbox checkTodosPuntosVentaAG;
|
|
||||||
private Checkbox checkDinheiro;
|
private Checkbox checkDinheiro;
|
||||||
private Checkbox checkCredito;
|
private Checkbox checkCredito;
|
||||||
private Checkbox checkDebito;
|
private Checkbox checkDebito;
|
||||||
|
@ -395,7 +389,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private Datebox fecIntegracion;
|
private Datebox fecIntegracion;
|
||||||
private Datebox fecInicioAG;
|
private Datebox fecInicioAG;
|
||||||
private Datebox fecFimAG;
|
private Datebox fecFimAG;
|
||||||
private Textbox logResult;
|
|
||||||
private boolean integracionTotvs;
|
private boolean integracionTotvs;
|
||||||
private boolean integracionAG;
|
private boolean integracionAG;
|
||||||
private Timebox txtTempoParaImpressao;
|
private Timebox txtTempoParaImpressao;
|
||||||
|
@ -413,16 +406,16 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private String statusAprobacionInicial = "";
|
private String statusAprobacionInicial = "";
|
||||||
private Decimalbox txtTaxaConvenienciaPorc;
|
private Decimalbox txtTaxaConvenienciaPorc;
|
||||||
private Doublebox txtMaximoTaxaConveniencia;
|
private Doublebox txtMaximoTaxaConveniencia;
|
||||||
private ConstraintPorcentagem ct;
|
private ConstraintPorcentagemAllowNull ct;
|
||||||
|
|
||||||
private static final String EMAIL_PATTERN =
|
private static final String EMAIL_PATTERN =
|
||||||
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
|
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
|
||||||
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
|
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
|
||||||
|
|
||||||
private static final Pattern pattern = Pattern.compile(EMAIL_PATTERN, Pattern.CASE_INSENSITIVE);
|
private static final Pattern pattern = Pattern.compile(EMAIL_PATTERN, Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
private static final int TAMANHO_BUFFER = 4096; // 4kb
|
private static final int TAMANHO_BUFFER = 4096; // 4kb
|
||||||
|
|
||||||
PtovtaEmpresa ptovtaEmpresa;
|
PtovtaEmpresa ptovtaEmpresa;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -456,7 +449,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
setCt(new ConstraintPorcentagem());
|
setCt(new ConstraintPorcentagemAllowNull());
|
||||||
lsCategoriaBloquear = categoriaService.obtenerTodasCategoriasVisibles();
|
lsCategoriaBloquear = categoriaService.obtenerTodasCategoriasVisibles();
|
||||||
lsEmpresasBloquear = empresaService.obtenerTodos();
|
lsEmpresasBloquear = empresaService.obtenerTodos();
|
||||||
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
@ -474,11 +467,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
lsUsuarioBancario = usuarioBancarioService.obtenerTodos();
|
lsUsuarioBancario = usuarioBancarioService.obtenerTodos();
|
||||||
lsLogFiles = getLogFiles();
|
lsLogFiles = getLogFiles();
|
||||||
puntoVenta = (PuntoVenta) Executions.getCurrent().getArg().get("puntoVenta");
|
puntoVenta = (PuntoVenta) Executions.getCurrent().getArg().get("puntoVenta");
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
getTxtTaxaConvenienciaPorc().setConstraint(getCt());
|
getTxtTaxaConvenienciaPorc().setConstraint(getCt());
|
||||||
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener() {
|
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener() {
|
||||||
|
@Override
|
||||||
public void onEvent(Event event) throws Exception {
|
public void onEvent(Event event) throws Exception {
|
||||||
cmbBanco.setSelectedIndex(lsBanco.indexOf(puntoVenta.getAgenciaId().getInstiFinanceiraId()));
|
cmbBanco.setSelectedIndex(lsBanco.indexOf(puntoVenta.getAgenciaId().getInstiFinanceiraId()));
|
||||||
}
|
}
|
||||||
|
@ -494,7 +488,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
ptovtaCatIndList.setItemRenderer(new RenderPtovtaCatInd());
|
ptovtaCatIndList.setItemRenderer(new RenderPtovtaCatInd());
|
||||||
ptovtaHistoricoList.setItemRenderer(new PuntoVendaHistoricoBloqueioListItemRenderer());
|
ptovtaHistoricoList.setItemRenderer(new PuntoVendaHistoricoBloqueioListItemRenderer());
|
||||||
categoriasBloqImpPosteriorList.setItemRenderer(new RenderCategoriaBloqueioVendaImpPosterior());
|
categoriasBloqImpPosteriorList.setItemRenderer(new RenderCategoriaBloqueioVendaImpPosterior());
|
||||||
|
|
||||||
ptovtaComissaoList.setItemRenderer(new RenderPtovtaComissao());
|
ptovtaComissaoList.setItemRenderer(new RenderPtovtaComissao());
|
||||||
ptovtaComissaoList.addEventListener("onDoubleClick", new EventListener() {
|
ptovtaComissaoList.addEventListener("onDoubleClick", new EventListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -567,7 +561,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
statusAprobacionInicial = radAprobacionAutorizado.isChecked() ? "A" : "L";
|
statusAprobacionInicial = radAprobacionAutorizado.isChecked() ? "A" : "L";
|
||||||
|
|
||||||
if (puntoVenta.getPuntoventaId() != null) {
|
if (puntoVenta.getPuntoventaId() != null) {
|
||||||
if (puntoVenta.getAgenciaId() != null) {
|
if (puntoVenta.getAgenciaId() != null) {
|
||||||
|
|
||||||
|
@ -781,8 +775,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
if (puntoVenta.getLsPtovtaUsuarioBancario() == null) {
|
if (puntoVenta.getLsPtovtaUsuarioBancario() == null) {
|
||||||
puntoVenta.setLsPtovtaUsuarioBancario(new ArrayList<PtoVtaUsuarioBancario>());
|
puntoVenta.setLsPtovtaUsuarioBancario(new ArrayList<PtoVtaUsuarioBancario>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lsPtovtaUsuarioBancario = puntoVenta.getLsPtovtaUsuarioBancario();
|
lsPtovtaUsuarioBancario = puntoVenta.getLsPtovtaUsuarioBancario();
|
||||||
ptovtaUsuarioBancarioList.setData(lsPtovtaUsuarioBancario);
|
ptovtaUsuarioBancarioList.setData(lsPtovtaUsuarioBancario);
|
||||||
|
@ -794,7 +788,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
cmbParada.setText(puntoVenta.getParada().getDescparada());
|
cmbParada.setText(puntoVenta.getParada().getDescparada());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
empresaContaBancariaList.setMultiple(true);
|
empresaContaBancariaList.setMultiple(true);
|
||||||
empresaContaBancariaList.setData(new ArrayList<EmpresaContaBancaria>(0));
|
empresaContaBancariaList.setData(new ArrayList<EmpresaContaBancaria>(0));
|
||||||
|
|
||||||
|
@ -833,63 +827,45 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnAddCategoriaBloqueioImpPosterior(Event event) {
|
public void onClick$btnAddCategoriaBloqueioImpPosterior(Event event) {
|
||||||
CategoriaBloqueioImpPosterior cat = new CategoriaBloqueioImpPosterior();
|
CategoriaBloqueioImpPosterior cat = new CategoriaBloqueioImpPosterior();
|
||||||
cat.setCategoria((Categoria)cmbBloqVendaImpPosterior.getSelectedItem().getValue());
|
cat.setCategoria((Categoria)cmbBloqVendaImpPosterior.getSelectedItem().getValue());
|
||||||
cat.setPuntoventa(puntoVenta);
|
cat.setPuntoventa(puntoVenta);
|
||||||
|
|
||||||
puntoVenta.addCategoriaBloqImpPosterior(cat);
|
puntoVenta.addCategoriaBloqImpPosterior(cat);
|
||||||
|
|
||||||
categoriasBloqImpPosteriorList.setData(puntoVenta.getCategoriaBloqImpPosteriorList());
|
categoriasBloqImpPosteriorList.setData(puntoVenta.getCategoriaBloqImpPosteriorList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnRemoveCategoriaBloqueioImpPosterior(Event event) {
|
public void onClick$btnRemoveCategoriaBloqueioImpPosterior(Event event) {
|
||||||
try{
|
try{
|
||||||
int resp = Messagebox.show(
|
int resp = Messagebox.show(
|
||||||
Labels.getLabel("editarPuntoVentaController.MSG.borrarCategoriaBloqueioImpPosterior"),
|
Labels.getLabel("editarPuntoVentaController.MSG.borrarCategoriaBloqueioImpPosterior"),
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||||
|
|
||||||
if (resp == Messagebox.YES) {
|
if (resp == Messagebox.YES) {
|
||||||
CategoriaBloqueioImpPosterior cat = (CategoriaBloqueioImpPosterior)categoriasBloqImpPosteriorList.getSelected();
|
CategoriaBloqueioImpPosterior cat = (CategoriaBloqueioImpPosterior)categoriasBloqImpPosteriorList.getSelected();
|
||||||
|
|
||||||
puntoVenta.removeCategoriaBloqImpPosterior(cat);
|
puntoVenta.removeCategoriaBloqImpPosterior(cat);
|
||||||
categoriaBloqueioImpPosteriorService.borrar(cat);
|
categoriaBloqueioImpPosteriorService.borrar(cat);
|
||||||
|
|
||||||
categoriasBloqImpPosteriorList.setData(puntoVenta.getCategoriaBloqImpPosteriorList());
|
categoriasBloqImpPosteriorList.setData(puntoVenta.getCategoriaBloqImpPosteriorList());
|
||||||
}
|
}
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
log.error("", e);
|
log.error("", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnDownload(Event event) {
|
public void onClick$btnDownload(Event event) {
|
||||||
downloadLogIntegracao(cmbLogFiles);
|
downloadLogIntegracao(cmbLogFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnDownloadAG(Event event) {
|
public void onClick$btnDownloadAG(Event event) {
|
||||||
downloadLogIntegracao(cmbLogFilesAG);
|
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
|
@Transactional
|
||||||
public boolean validaFuncionTipoBoletoBloqueado() {
|
public boolean validaFuncionTipoBoletoBloqueado() {
|
||||||
List<String> listClavesPermisos = new ArrayList<String>();
|
List<String> listClavesPermisos = new ArrayList<String>();
|
||||||
|
@ -990,7 +966,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
lsEmpresaContaBancarias = ptovtaBancoService.buscarContasBancariasPorIdEmpresa(empresa.getEmpresaId());
|
lsEmpresaContaBancarias = ptovtaBancoService.buscarContasBancariasPorIdEmpresa(empresa.getEmpresaId());
|
||||||
|
|
||||||
empresaContaBancariaList.setData(new ArrayList<EmpresaContaBancaria>(0));
|
empresaContaBancariaList.setData(new ArrayList<EmpresaContaBancaria>(0));
|
||||||
|
|
||||||
if (lsEmpresaContaBancarias != null && !lsEmpresaContaBancarias.isEmpty()) {
|
if (lsEmpresaContaBancarias != null && !lsEmpresaContaBancarias.isEmpty()) {
|
||||||
empresaContaBancariaList.setData(lsEmpresaContaBancarias);
|
empresaContaBancariaList.setData(lsEmpresaContaBancarias);
|
||||||
// cmbEmpresasContaBancarias.setModel(new BindingListModelList(lsEmpresaContaBancarias, true));
|
// cmbEmpresasContaBancarias.setModel(new BindingListModelList(lsEmpresaContaBancarias, true));
|
||||||
|
@ -1127,23 +1103,23 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnEnviaAG(Event ev) throws InterruptedException {
|
public void onClick$btnEnviaAG(Event ev) throws InterruptedException {
|
||||||
Connection myConn = null;
|
Connection myConn = null;
|
||||||
Observer wsevents = new Observer() {
|
Observer wsevents = new Observer() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Observable o, Object arg) {
|
public void update(Observable o, Object arg) {
|
||||||
logResultAG.setText(((WSAGLog)o).toString());
|
logResultAG.setText(((WSAGLog)o).toString());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
WSAGLog wslog = WSAGLog.getInstance();
|
WSAGLog wslog = WSAGLog.getInstance();
|
||||||
wslog.clear();
|
wslog.clear();
|
||||||
wslog.addObserver(wsevents);
|
wslog.addObserver(wsevents);
|
||||||
|
|
||||||
myConn = dataSource.getConnection();
|
myConn = dataSource.getConnection();
|
||||||
Date dateInicio = fecInicioAG.getValue();
|
Date dateInicio = fecInicioAG.getValue();
|
||||||
|
|
||||||
|
@ -1154,9 +1130,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
|
log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
|
||||||
|
|
||||||
gerador.send(checkAdiantamentoAG.isChecked(), checkBoletoAG.isChecked(), checkCartaoAG.isChecked(), checkDepositoAG.isChecked());
|
gerador.send(checkAdiantamentoAG.isChecked(), checkBoletoAG.isChecked(), checkCartaoAG.isChecked(), checkDepositoAG.isChecked());
|
||||||
|
|
||||||
gerador.mostraResultado();
|
gerador.mostraResultado();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Erro ao integrar", e);
|
log.error("Erro ao integrar", e);
|
||||||
|
|
||||||
|
@ -1182,9 +1158,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnGeraTitulosAG(Event ev) throws InterruptedException {
|
public void onClick$btnGeraTitulosAG(Event ev) throws InterruptedException {
|
||||||
Connection myConn = null;
|
Connection myConn = null;
|
||||||
try {
|
try {
|
||||||
myConn = dataSource.getConnection();
|
myConn = dataSource.getConnection();
|
||||||
Date dateInicio = fecInicioAG.getValue();
|
Date dateInicio = fecInicioAG.getValue();
|
||||||
|
@ -1196,7 +1172,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
|
log.info("puntoVentaId=" + puntoVenta.getPuntoventaId() + ";fecInicio=" + dateInicio + ";fecFin=" + dateFim);
|
||||||
|
|
||||||
gerador.execute(puntoVenta.getPuntoventaId(), checkAdiantamentoAG.isChecked(), checkBoletoAG.isChecked(), checkCartaoAG.isChecked(), checkDepositoAG.isChecked());
|
gerador.execute(puntoVenta.getPuntoventaId(), checkAdiantamentoAG.isChecked(), checkBoletoAG.isChecked(), checkCartaoAG.isChecked(), checkDepositoAG.isChecked());
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Erro ao integrar", e);
|
log.error("Erro ao integrar", e);
|
||||||
|
|
||||||
|
@ -1392,10 +1368,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
txtAntecipRetem.getValue();
|
txtAntecipRetem.getValue();
|
||||||
txtAntecipPercentual.getValue();
|
txtAntecipPercentual.getValue();
|
||||||
getTxtTaxaConvenienciaPorc().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.setConstraint("no empty");
|
||||||
|
txtMaximoTaxaConveniencia.getValue();
|
||||||
}
|
}
|
||||||
txtMaximoTaxaConveniencia.getValue();
|
|
||||||
|
|
||||||
cmbEmpresa.getValue();
|
cmbEmpresa.getValue();
|
||||||
cmbParada.getValue();
|
cmbParada.getValue();
|
||||||
|
@ -1409,19 +1386,19 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
cmbBanco.getValue();
|
cmbBanco.getValue();
|
||||||
cmbPessoa.getValue();
|
cmbPessoa.getValue();
|
||||||
cmbTipoConta.getValue();
|
cmbTipoConta.getValue();
|
||||||
|
|
||||||
if(!validarEmail()){
|
if(!validarEmail()){
|
||||||
|
|
||||||
if(descCorreo.getText() == null || descCorreo.getText().trim().isEmpty()){
|
if(descCorreo.getText() == null || descCorreo.getText().trim().isEmpty()){
|
||||||
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.emailObrigatorio"),
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.emailObrigatorio"),
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
}else{
|
}else{
|
||||||
Messagebox.show(Labels.getLabel("editarTipoPuntoVentaController.MSG.emailInvalido"),
|
Messagebox.show(Labels.getLabel("editarTipoPuntoVentaController.MSG.emailInvalido"),
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
descCorreo.focus();
|
descCorreo.focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1461,7 +1438,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
if (cmbPuntoVentaPadre.getValue().isEmpty()) {
|
if (cmbPuntoVentaPadre.getValue().isEmpty()) {
|
||||||
puntoVenta.setPuntoVentaPadre(null);
|
puntoVenta.setPuntoVentaPadre(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PuntoVenta> lsPuntoVenta = puntoVentaService.buscaPuntoVenta(txtNumPtoVta.getValue());
|
List<PuntoVenta> lsPuntoVenta = puntoVentaService.buscaPuntoVenta(txtNumPtoVta.getValue());
|
||||||
|
|
||||||
if (!lsPuntoVenta.isEmpty()) {
|
if (!lsPuntoVenta.isEmpty()) {
|
||||||
|
@ -1487,7 +1464,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.informarTempoMinimo.value"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.informarTempoMinimo.value"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
txtTempoParaImpressao.focus();
|
txtTempoParaImpressao.focus();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1495,22 +1472,22 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
if (puntoVenta.getEmpresa() == null) {
|
if (puntoVenta.getEmpresa() == null) {
|
||||||
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.empresa"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.empresa"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
|
||||||
} else if (puntoVenta.getTipoPuntoVenta() == null) {
|
} else if (puntoVenta.getTipoPuntoVenta() == null) {
|
||||||
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.punto"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.punto"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
|
||||||
} else if (puntoVenta.getMoneda() == null) {
|
} else if (puntoVenta.getMoneda() == null) {
|
||||||
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.moneda"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.moneda"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* } else if (puntoVenta.getNodo() == null) { Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.nodo"), Labels.getLabel("editarPuntoVentaController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
* } else if (puntoVenta.getNodo() == null) { Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.nodo"), Labels.getLabel("editarPuntoVentaController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
*/
|
*/
|
||||||
} else if (lsFormaPagoDet.isEmpty()) {
|
} else if (lsFormaPagoDet.isEmpty()) {
|
||||||
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.formaDePago"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.formaDePago"), Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (cmbConexion.getValue().equals("")) {
|
if (cmbConexion.getValue().equals("")) {
|
||||||
puntoVenta.setConexionBancaria(null);
|
puntoVenta.setConexionBancaria(null);
|
||||||
|
@ -1531,7 +1508,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
// Empresas para Venda
|
// Empresas para Venda
|
||||||
List<PtovtaEmpresaContaBancaria> contasBancariasExcluidas = new ArrayList<PtovtaEmpresaContaBancaria>(0);
|
List<PtovtaEmpresaContaBancaria> contasBancariasExcluidas = new ArrayList<PtovtaEmpresaContaBancaria>(0);
|
||||||
|
|
||||||
for (PtovtaEmpresa emp : lsPtovtaEmpresa) {
|
for (PtovtaEmpresa emp : lsPtovtaEmpresa) {
|
||||||
if (emp.getActivo()) {
|
if (emp.getActivo()) {
|
||||||
// Contas bancarias (Temporária)
|
// Contas bancarias (Temporária)
|
||||||
|
@ -1539,17 +1516,17 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
if (ecc.getEmpresaContaBancariaId() == null) {
|
if (ecc.getEmpresaContaBancariaId() == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verificando os bancos adicionados/atualizados
|
// Verificando os bancos adicionados/atualizados
|
||||||
boolean existe = false;
|
boolean existe = false;
|
||||||
|
|
||||||
for (PtovtaEmpresaContaBancaria pto : emp.getLsPtovtaEmpresaContaBancaria()) {
|
for (PtovtaEmpresaContaBancaria pto : emp.getLsPtovtaEmpresaContaBancaria()) {
|
||||||
if (pto.getEmpresaContaBancaria() != null && pto.getEmpresaContaBancaria().getEmpresaContaBancariaId().equals(ecc.getEmpresaContaBancariaId())) {
|
if (pto.getEmpresaContaBancaria() != null && pto.getEmpresaContaBancaria().getEmpresaContaBancariaId().equals(ecc.getEmpresaContaBancariaId())) {
|
||||||
existe = true;
|
existe = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!existe) {
|
if (!existe) {
|
||||||
PtovtaEmpresaContaBancaria pto = new PtovtaEmpresaContaBancaria();
|
PtovtaEmpresaContaBancaria pto = new PtovtaEmpresaContaBancaria();
|
||||||
pto.setPtovtaEmpresa(emp);
|
pto.setPtovtaEmpresa(emp);
|
||||||
|
@ -1557,35 +1534,35 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
pto.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
pto.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
pto.setFecmodif(new Date());
|
pto.setFecmodif(new Date());
|
||||||
pto.setActivo(true);
|
pto.setActivo(true);
|
||||||
|
|
||||||
emp.getLsPtovtaEmpresaContaBancaria().add(pto);
|
emp.getLsPtovtaEmpresaContaBancaria().add(pto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contas bancárias removidas
|
// Contas bancárias removidas
|
||||||
List<PtovtaEmpresaContaBancaria> excluir = new ArrayList<PtovtaEmpresaContaBancaria>(0);
|
List<PtovtaEmpresaContaBancaria> excluir = new ArrayList<PtovtaEmpresaContaBancaria>(0);
|
||||||
|
|
||||||
for (PtovtaEmpresaContaBancaria pto : emp.getLsPtovtaEmpresaContaBancaria()) {
|
for (PtovtaEmpresaContaBancaria pto : emp.getLsPtovtaEmpresaContaBancaria()) {
|
||||||
boolean existe = false;
|
boolean existe = false;
|
||||||
|
|
||||||
for (EmpresaContaBancaria ecc : emp.getContasBancaria()) {
|
for (EmpresaContaBancaria ecc : emp.getContasBancaria()) {
|
||||||
if (pto.getEmpresaContaBancaria().getEmpresaContaBancariaId().equals(ecc.getEmpresaContaBancariaId())) {
|
if (pto.getEmpresaContaBancaria().getEmpresaContaBancariaId().equals(ecc.getEmpresaContaBancariaId())) {
|
||||||
existe = true;
|
existe = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!existe) {
|
if (!existe) {
|
||||||
excluir.add(pto);
|
excluir.add(pto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emp.getLsPtovtaEmpresaContaBancaria().removeAll(excluir);
|
emp.getLsPtovtaEmpresaContaBancaria().removeAll(excluir);
|
||||||
|
|
||||||
contasBancariasExcluidas.addAll(excluir);
|
contasBancariasExcluidas.addAll(excluir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
puntoVenta.setActivo(Boolean.TRUE);
|
puntoVenta.setActivo(Boolean.TRUE);
|
||||||
puntoVenta.setFecmodif(Calendar.getInstance().getTime());
|
puntoVenta.setFecmodif(Calendar.getInstance().getTime());
|
||||||
puntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
puntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
@ -1600,7 +1577,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
puntoVenta.setTempoMinimoParaImpressao(txtTempoParaImpressao.getValue());
|
puntoVenta.setTempoMinimoParaImpressao(txtTempoParaImpressao.getValue());
|
||||||
puntoVenta.setNodo(nodoService.obtenerId(1));
|
puntoVenta.setNodo(nodoService.obtenerId(1));
|
||||||
puntoVenta.setDateAbertura(dateAbertura.getValue());
|
puntoVenta.setDateAbertura(dateAbertura.getValue());
|
||||||
|
|
||||||
if (dateFechamento.getValue() != null && dateFechamento.getValue().compareTo(dateAbertura.getValue()) < 0) {
|
if (dateFechamento.getValue() != null && dateFechamento.getValue().compareTo(dateAbertura.getValue()) < 0) {
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarPuntoVentaController.DatFechMenorDataAbertura"),
|
Labels.getLabel("editarPuntoVentaController.DatFechMenorDataAbertura"),
|
||||||
|
@ -1608,7 +1585,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
puntoVenta.setDateFechamento(dateFechamento.getValue());
|
puntoVenta.setDateFechamento(dateFechamento.getValue());
|
||||||
String getString = null;
|
String getString = null;
|
||||||
if (!txtNumFax.getValue().equals("")) {
|
if (!txtNumFax.getValue().equals("")) {
|
||||||
|
@ -1668,7 +1645,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
for (PtovtaEmpresaContaBancaria ecc : contasBancariasExcluidas) {
|
for (PtovtaEmpresaContaBancaria ecc : contasBancariasExcluidas) {
|
||||||
ptovtaEmpresaContaBancariaService.borrarFisico(ecc);
|
ptovtaEmpresaContaBancariaService.borrarFisico(ecc);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PtoVtaUsuarioBancario> lsPto2 = new ArrayList<PtoVtaUsuarioBancario>();
|
List<PtoVtaUsuarioBancario> lsPto2 = new ArrayList<PtoVtaUsuarioBancario>();
|
||||||
for (PtoVtaUsuarioBancario pto2 : lsPtovtaUsuarioBancario) {
|
for (PtoVtaUsuarioBancario pto2 : lsPtovtaUsuarioBancario) {
|
||||||
if (!pto2.getActivo()) {
|
if (!pto2.getActivo()) {
|
||||||
|
@ -1678,7 +1655,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
lsPto2.add(pto2);
|
lsPto2.add(pto2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ApplicationProperties.getInstance().validaContaCorrenteEmpesaPtoVta()){
|
if (ApplicationProperties.getInstance().validaContaCorrenteEmpesaPtoVta()){
|
||||||
if (!validaCadastroFechamentoContaCorrente()) {
|
if (!validaCadastroFechamentoContaCorrente()) {
|
||||||
exibeMsgErroFechCtaCorrente();
|
exibeMsgErroFechCtaCorrente();
|
||||||
|
@ -1693,20 +1670,20 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
} else if (radAprobacionLatente.isChecked()) {
|
} else if (radAprobacionLatente.isChecked()) {
|
||||||
puntoVenta.setStatusaprobacion("L");
|
puntoVenta.setStatusaprobacion("L");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!puntoVenta.getStatusaprobacion().equals(statusAprobacionInicial)){
|
if(!puntoVenta.getStatusaprobacion().equals(statusAprobacionInicial)){
|
||||||
HistoricoPuntoVenta h = new HistoricoPuntoVenta();
|
HistoricoPuntoVenta h = new HistoricoPuntoVenta();
|
||||||
h.setPuntoVenta(puntoVenta);
|
h.setPuntoVenta(puntoVenta);
|
||||||
|
|
||||||
h.setIndBloqueio(!puntoVenta.getStatusaprobacion().equals("A"));
|
h.setIndBloqueio(!puntoVenta.getStatusaprobacion().equals("A"));
|
||||||
h.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
h.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
h.setActivo(true);
|
h.setActivo(true);
|
||||||
h.setFecmodif(new Date());
|
h.setFecmodif(new Date());
|
||||||
h.setFecBloqueio(new Date());
|
h.setFecBloqueio(new Date());
|
||||||
|
|
||||||
puntoVenta.getHistoricoPuntoVentaList().add(h);
|
puntoVenta.getHistoricoPuntoVentaList().add(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (puntoVenta.getIndIntegracion() == null) {
|
if (puntoVenta.getIndIntegracion() == null) {
|
||||||
puntoVenta.setIndIntegracion(TipoRetorno.PENDENTE.getValor());
|
puntoVenta.setIndIntegracion(TipoRetorno.PENDENTE.getValor());
|
||||||
}
|
}
|
||||||
|
@ -1718,9 +1695,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
puntoVentaService.actualizacion(puntoVenta);
|
puntoVentaService.actualizacion(puntoVenta);
|
||||||
puntoVentaList.updateItem(puntoVenta);
|
puntoVentaList.updateItem(puntoVenta);
|
||||||
}
|
}
|
||||||
|
|
||||||
gravaFechamentoCtaCorrente();
|
gravaFechamentoCtaCorrente();
|
||||||
|
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarPuntoVentaController.MSG.suscribirOK"),
|
Labels.getLabel("editarPuntoVentaController.MSG.suscribirOK"),
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
|
@ -1732,7 +1709,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
} catch (ValidacionCampoException ve) {
|
} catch (ValidacionCampoException ve) {
|
||||||
log.error("editarPuntoVentaController: ", ve);
|
log.error("editarPuntoVentaController: ", ve);
|
||||||
|
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
ve.getMessage(),
|
ve.getMessage(),
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
|
@ -1740,19 +1717,19 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
} catch (IntegracionException ex) {
|
} catch (IntegracionException ex) {
|
||||||
gravaFechamentoCtaCorrente();
|
gravaFechamentoCtaCorrente();
|
||||||
|
|
||||||
log.error("editarPuntoVentaController: ", ex);
|
log.error("editarPuntoVentaController: ", ex);
|
||||||
|
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
ex.getMessage(),
|
ex.getMessage(),
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.ERROR);
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
|
||||||
closeWindow();
|
closeWindow();
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.error("editarPuntoVentaController: ", ex);
|
log.error("editarPuntoVentaController: ", ex);
|
||||||
|
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("MSG.Error"),
|
Labels.getLabel("MSG.Error"),
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
|
@ -1762,10 +1739,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
|
||||||
private boolean validarEmail() throws InterruptedException {
|
private boolean validarEmail() throws InterruptedException {
|
||||||
|
|
||||||
ConstanteService constanteService = (ConstanteService) AppContext.getApplicationContext().getBean("constanteService");
|
ConstanteService constanteService = (ConstanteService) AppContext.getApplicationContext().getBean("constanteService");
|
||||||
Constante constante = constanteService.buscarPorNomeConstante("TOTALBUS_EMAIL_OPCIONAL_PV");
|
Constante constante = constanteService.buscarPorNomeConstante("TOTALBUS_EMAIL_OPCIONAL_PV");
|
||||||
|
|
||||||
if(constante == null || constante.getValorconstante().equals("0")){
|
if(constante == null || constante.getValorconstante().equals("0")){
|
||||||
if(descCorreo.getText() == null || descCorreo.getText().isEmpty()){
|
if(descCorreo.getText() == null || descCorreo.getText().isEmpty()){
|
||||||
return false;
|
return false;
|
||||||
|
@ -1775,14 +1752,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String email : descCorreo.getText().split(";")){
|
for(String email : descCorreo.getText().split(";")){
|
||||||
Matcher matcher = pattern.matcher(email);
|
Matcher matcher = pattern.matcher(email);
|
||||||
if(!matcher.matches()){
|
if(!matcher.matches()){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1794,9 +1771,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
private void gravarCC(List<FechamentoParamptovta> paramsFechamento) {
|
private void gravarCC(List<FechamentoParamptovta> paramsFechamento) {
|
||||||
boolean encontrouEmpresaComFechamentoConfigurado = false;
|
boolean encontrouEmpresaComFechamentoConfigurado = false;
|
||||||
for (Object object : fechamentoParamptovtaList.getListData()) {
|
for (Object object : fechamentoParamptovtaList.getListData()) {
|
||||||
encontrouEmpresaComFechamentoConfigurado = false;
|
encontrouEmpresaComFechamentoConfigurado = false;
|
||||||
FechamentoParamptovta fechamentoParamptovta = (FechamentoParamptovta) object;
|
FechamentoParamptovta fechamentoParamptovta = (FechamentoParamptovta) object;
|
||||||
//verifica se empresa já está configurada com fechamento de conta corrente
|
//verifica se empresa já está configurada com fechamento de conta corrente
|
||||||
for(FechamentoParamptovta paramFechamento : paramsFechamento){
|
for(FechamentoParamptovta paramFechamento : paramsFechamento){
|
||||||
if(fechamentoParamptovta.getEmpresa().getEmpresaId() == paramFechamento.getEmpresa().getEmpresaId()){
|
if(fechamentoParamptovta.getEmpresa().getEmpresaId() == paramFechamento.getEmpresa().getEmpresaId()){
|
||||||
|
@ -1812,10 +1789,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
if(!encontrouEmpresaComFechamentoConfigurado){
|
if(!encontrouEmpresaComFechamentoConfigurado){
|
||||||
fechamentoParamptovta.setPuntoventa(puntoVenta);
|
fechamentoParamptovta.setPuntoventa(puntoVenta);
|
||||||
fechamentoParamptovtaService.suscribir(fechamentoParamptovta);
|
fechamentoParamptovtaService.suscribir(fechamentoParamptovta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removerCC(List<FechamentoParamptovta> paramsFechamento) {
|
private void removerCC(List<FechamentoParamptovta> paramsFechamento) {
|
||||||
boolean removerEmpresa = true;
|
boolean removerEmpresa = true;
|
||||||
for(FechamentoParamptovta paramFechamento : paramsFechamento){
|
for(FechamentoParamptovta paramFechamento : paramsFechamento){
|
||||||
|
@ -1829,9 +1806,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Remove do banco a empresa que não está na lista
|
//Remove do banco a empresa que não está na lista
|
||||||
if(removerEmpresa){
|
if(removerEmpresa){
|
||||||
fechamentoParamptovtaService.borrar(paramFechamento);
|
fechamentoParamptovtaService.borrar(paramFechamento);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1850,12 +1827,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
//Valida que todas empresas de Fechamento são empresa para venda.
|
//Valida que todas empresas de Fechamento são empresa para venda.
|
||||||
for (int i = 0; i < empresasVenda.size(); i++) {
|
for (int i = 0; i < empresasVenda.size(); i++) {
|
||||||
PtovtaEmpresa empresaVenda = (PtovtaEmpresa) empresasVenda.get(i);
|
PtovtaEmpresa empresaVenda = (PtovtaEmpresa) empresasVenda.get(i);
|
||||||
|
|
||||||
validado = false;
|
validado = false;
|
||||||
|
|
||||||
for (int j = 0; j < empresasFechamento.size(); j++) {
|
for (int j = 0; j < empresasFechamento.size(); j++) {
|
||||||
FechamentoParamptovta fechamentoParamptovta = (FechamentoParamptovta) empresasFechamento.get(j);
|
FechamentoParamptovta fechamentoParamptovta = (FechamentoParamptovta) empresasFechamento.get(j);
|
||||||
|
|
||||||
if (empresaVenda.getEmpresa().getEmpresaId().equals(fechamentoParamptovta.getEmpresa().getEmpresaId())) {
|
if (empresaVenda.getEmpresa().getEmpresaId().equals(fechamentoParamptovta.getEmpresa().getEmpresaId())) {
|
||||||
validado=true;
|
validado=true;
|
||||||
break;
|
break;
|
||||||
|
@ -2263,7 +2240,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
// if (cmbEmpresasContaBancarias.getSelectedItem() != null) {
|
// if (cmbEmpresasContaBancarias.getSelectedItem() != null) {
|
||||||
// ptovtaEmpresa.setEmpresaContaBancaria((EmpresaContaBancaria) cmbEmpresasContaBancarias.getSelectedItem().getValue());
|
// ptovtaEmpresa.setEmpresaContaBancaria((EmpresaContaBancaria) cmbEmpresasContaBancarias.getSelectedItem().getValue());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (empresaContaBancariaList.getSelectedCount() > 0){
|
if (empresaContaBancariaList.getSelectedCount() > 0){
|
||||||
ptovtaEmpresa.getContasBancaria().clear();
|
ptovtaEmpresa.getContasBancaria().clear();
|
||||||
|
|
||||||
|
@ -2272,14 +2249,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
ptovtaEmpresa.getContasBancaria().add(ecb);
|
ptovtaEmpresa.getContasBancaria().add(ecb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptovtaEmpresa.getPtovtaempresaId() == null){
|
if (ptovtaEmpresa.getPtovtaempresaId() == null){
|
||||||
lsPtovtaEmpresa.add(ptovtaEmpresa);
|
lsPtovtaEmpresa.add(ptovtaEmpresa);
|
||||||
ptovtaEmpresaList.addItemNovo(ptovtaEmpresa);
|
ptovtaEmpresaList.addItemNovo(ptovtaEmpresa);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
int index = lsPtovtaEmpresa.indexOf(ptovtaEmpresa);
|
int index = lsPtovtaEmpresa.indexOf(ptovtaEmpresa);
|
||||||
|
|
||||||
if(index >= -1) {
|
if(index >= -1) {
|
||||||
lsPtovtaEmpresa.set(index, ptovtaEmpresa);
|
lsPtovtaEmpresa.set(index, ptovtaEmpresa);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2288,9 +2265,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
ptovtaEmpresaList.updateItem(ptovtaEmpresa);
|
ptovtaEmpresaList.updateItem(ptovtaEmpresa);
|
||||||
}
|
}
|
||||||
|
|
||||||
novoPtovtaEmpresa();
|
novoPtovtaEmpresa();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarPuntoVentaController.MSG.Achou.PtovtaEmpresa"),
|
Labels.getLabel("editarPuntoVentaController.MSG.Achou.PtovtaEmpresa"),
|
||||||
|
@ -2326,11 +2303,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
log.error(ex);
|
log.error(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnNovoPtovtaEmpresa(Event ev) throws InterruptedException {
|
public void onClick$btnNovoPtovtaEmpresa(Event ev) throws InterruptedException {
|
||||||
novoPtovtaEmpresa();
|
novoPtovtaEmpresa();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void novoPtovtaEmpresa() {
|
private void novoPtovtaEmpresa() {
|
||||||
cmbEmpresaPtoVta.setSelectedIndex(-1);
|
cmbEmpresaPtoVta.setSelectedIndex(-1);
|
||||||
// cmbEmpresasContaBancarias.setSelectedIndex(-1);
|
// cmbEmpresasContaBancarias.setSelectedIndex(-1);
|
||||||
|
@ -2346,14 +2323,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
private void editarPtovtaEmpresa(PtovtaEmpresa ptovtaEmpresa) {
|
private void editarPtovtaEmpresa(PtovtaEmpresa ptovtaEmpresa) {
|
||||||
this.ptovtaEmpresa = new PtovtaEmpresa(ptovtaEmpresa.getPtovtaempresaId());
|
this.ptovtaEmpresa = new PtovtaEmpresa(ptovtaEmpresa.getPtovtaempresaId());
|
||||||
this.ptovtaEmpresa.setLsPtovtaEmpresaContaBancaria(ptovtaEmpresa.getLsPtovtaEmpresaContaBancaria());
|
this.ptovtaEmpresa.setLsPtovtaEmpresaContaBancaria(ptovtaEmpresa.getLsPtovtaEmpresaContaBancaria());
|
||||||
|
|
||||||
cmbEmpresaPtoVta.setSelectedIndex(-1);
|
cmbEmpresaPtoVta.setSelectedIndex(-1);
|
||||||
// cmbEmpresasContaBancarias.setSelectedIndex(-1);
|
// cmbEmpresasContaBancarias.setSelectedIndex(-1);
|
||||||
|
|
||||||
if(lsEmpresas != null) {
|
if(lsEmpresas != null) {
|
||||||
cmbEmpresaPtoVta.setSelectedIndex(lsEmpresas.indexOf(ptovtaEmpresa.getEmpresa()));
|
cmbEmpresaPtoVta.setSelectedIndex(lsEmpresas.indexOf(ptovtaEmpresa.getEmpresa()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lsEmpresaContaBancarias != null) {
|
if(lsEmpresaContaBancarias != null) {
|
||||||
// cmbEmpresasContaBancarias.setSelectedIndex(lsEmpresaContaBancarias.indexOf(ptovtaEmpresa.getEmpresaContaBancaria()));
|
// cmbEmpresasContaBancarias.setSelectedIndex(lsEmpresaContaBancarias.indexOf(ptovtaEmpresa.getEmpresaContaBancaria()));
|
||||||
}
|
}
|
||||||
|
@ -2361,14 +2338,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
lsEmpresaContaBancarias = ptovtaBancoService.buscarContasBancariasPorIdEmpresa(ptovtaEmpresa.getEmpresa().getEmpresaId());
|
lsEmpresaContaBancarias = ptovtaBancoService.buscarContasBancariasPorIdEmpresa(ptovtaEmpresa.getEmpresa().getEmpresaId());
|
||||||
|
|
||||||
empresaContaBancariaList.setData(new ArrayList<EmpresaContaBancaria>(0));
|
empresaContaBancariaList.setData(new ArrayList<EmpresaContaBancaria>(0));
|
||||||
|
|
||||||
if (lsEmpresaContaBancarias != null && !lsEmpresaContaBancarias.isEmpty()) {
|
if (lsEmpresaContaBancarias != null && !lsEmpresaContaBancarias.isEmpty()) {
|
||||||
empresaContaBancariaList.setData(lsEmpresaContaBancarias);
|
empresaContaBancariaList.setData(lsEmpresaContaBancarias);
|
||||||
}
|
}
|
||||||
|
|
||||||
empresaContaBancariaList.selectItems(ptovtaEmpresa.getContasBancaria());
|
empresaContaBancariaList.selectItems(ptovtaEmpresa.getContasBancaria());
|
||||||
|
|
||||||
|
|
||||||
checkPtoVtaEmpresaIndTerceirizada.setChecked(ptovtaEmpresa.getIndTerceirizada());
|
checkPtoVtaEmpresaIndTerceirizada.setChecked(ptovtaEmpresa.getIndTerceirizada());
|
||||||
checkPtoVtaEmpresaIndBloqueada.setChecked(ptovtaEmpresa.getIndBloqueada());
|
checkPtoVtaEmpresaIndBloqueada.setChecked(ptovtaEmpresa.getIndBloqueada());
|
||||||
checkPtoVtaEmpresaIndMostrarCaja.setChecked(ptovtaEmpresa.getIndMostrarCaja());
|
checkPtoVtaEmpresaIndMostrarCaja.setChecked(ptovtaEmpresa.getIndMostrarCaja());
|
||||||
|
@ -2807,7 +2784,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* public Combobox getCmbNodo() { return cmbNodo; }
|
* public Combobox getCmbNodo() { return cmbNodo; }
|
||||||
*
|
*
|
||||||
* public void setCmbNodo(Combobox cmbNodo) { this.cmbNodo = cmbNodo; }
|
* public void setCmbNodo(Combobox cmbNodo) { this.cmbNodo = cmbNodo; }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -3176,7 +3153,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
} else if (radIntervalofechamentoDiario.isChecked()) {
|
} else if (radIntervalofechamentoDiario.isChecked()) {
|
||||||
intervalofechamento = Constantes.INTERVALO_FECHAMENTO_DIARIO;
|
intervalofechamento = Constantes.INTERVALO_FECHAMENTO_DIARIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radTipoPagamentoBoleto.isChecked()){
|
if (radTipoPagamentoBoleto.isChecked()){
|
||||||
fechamentoParamptovta.setTipopagamento("B");
|
fechamentoParamptovta.setTipopagamento("B");
|
||||||
} else {
|
} else {
|
||||||
|
@ -3212,7 +3189,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
radIntervalofechamentoMensal.setChecked(false);
|
radIntervalofechamentoMensal.setChecked(false);
|
||||||
radIntervalofechamentoDiario.setChecked(false);
|
radIntervalofechamentoDiario.setChecked(false);
|
||||||
radTipoPagamentoBoleto.setChecked(true);
|
radTipoPagamentoBoleto.setChecked(true);
|
||||||
|
|
||||||
txtDiasemtransito.setValue("");
|
txtDiasemtransito.setValue("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3291,7 +3268,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
return integracionTotvs;
|
return integracionTotvs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isIntegracionAG() {
|
public boolean isIntegracionAG() {
|
||||||
integracionAG = false;
|
integracionAG = false;
|
||||||
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
if (ApplicationProperties.getInstance().integracionTotvs()) {
|
||||||
|
@ -3303,7 +3280,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
public void setIntegracionTotvs(boolean integracionTotvs) {
|
public void setIntegracionTotvs(boolean integracionTotvs) {
|
||||||
this.integracionTotvs = integracionTotvs;
|
this.integracionTotvs = integracionTotvs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIntegracionAG(boolean integracionAG) {
|
public void setIntegracionAG(boolean integracionAG) {
|
||||||
this.integracionAG = integracionAG;
|
this.integracionAG = integracionAG;
|
||||||
}
|
}
|
||||||
|
@ -3444,7 +3421,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
this.lsCategoriaBloquear = lsCategoriaBloquear;
|
this.lsCategoriaBloquear = lsCategoriaBloquear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the txtTaxaConvenienciaPorc
|
* @return the txtTaxaConvenienciaPorc
|
||||||
*/
|
*/
|
||||||
|
@ -3476,15 +3453,15 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
/**
|
/**
|
||||||
* @return the ct
|
* @return the ct
|
||||||
*/
|
*/
|
||||||
public ConstraintPorcentagem getCt() {
|
public ConstraintPorcentagemAllowNull getCt() {
|
||||||
return ct;
|
return ct;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ct the ct to set
|
* @param ct the ct to set
|
||||||
*/
|
*/
|
||||||
public void setCt(ConstraintPorcentagem ct) {
|
public void setCt(ConstraintPorcentagemAllowNull ct) {
|
||||||
this.ct = 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