-remoção de validação desnecessária
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@24341 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
796edc5c94
commit
e4f8447a97
|
@ -838,181 +838,163 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
puntoVenta.setUsuarioBancario(null);
|
puntoVenta.setUsuarioBancario(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PuntoVenta> lsPv = puntoVentaService.buscar(puntoVenta.getNombpuntoventa() , puntoVenta.getNumPuntoVenta());
|
if (cmbColonia.getSelectedItem() != null) {
|
||||||
|
puntoVenta.setColonia((Colonia) cmbColonia.getSelectedItem().getValue());
|
||||||
boolean podeSalvar = false;
|
|
||||||
|
|
||||||
if (lsPv.isEmpty()) {
|
|
||||||
podeSalvar = true;
|
|
||||||
}
|
}
|
||||||
for (PuntoVenta pv : lsPv) {
|
|
||||||
if (pv.getPuntoventaId().equals(puntoVenta.getPuntoventaId())) {
|
puntoVenta.setActivo(Boolean.TRUE);
|
||||||
podeSalvar = true;
|
puntoVenta.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
puntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
puntoVenta.setLsFormaPagoDet(lsFormaPagoDet);
|
||||||
|
puntoVenta.setLsParamRecoleccion(lsParamRecoleccion);
|
||||||
|
puntoVenta.setLsPtovtaEmpresa(lsPtovtaEmpresa);
|
||||||
|
puntoVenta.setLsPtovtaUsuarioBancario(lsPtovtaUsuarioBancario);
|
||||||
|
puntoVenta.setPtovtaAntecipacomissaoList(lsAntecipacomissao);
|
||||||
|
puntoVenta.setPtovtaHorarioList(lsHorario);
|
||||||
|
puntoVenta.setPtovtaEstoqueList(lsEstoque);
|
||||||
|
String getString = null;
|
||||||
|
if(!txtNumFax.getValue().equals("")){
|
||||||
|
getString = this.replaceTextbox(txtNumFax);
|
||||||
|
if(getString.length()>= 11){
|
||||||
|
puntoVenta.setNumfax(txtNumFax.getValue().replace("_", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!numtelefonouno.getValue().equals("")){
|
||||||
|
getString = this.replaceTextbox(numtelefonouno);
|
||||||
|
if(getString.length()>= 11){
|
||||||
|
puntoVenta.setNumtelefonouno(numtelefonouno.getValue().replace("_", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!numtelefonodos.getValue().equals("")){
|
||||||
|
getString = this.replaceTextbox(numtelefonodos);
|
||||||
|
if(getString.length()>= 11){
|
||||||
|
puntoVenta.setNumtelefonodos(numtelefonodos.getValue().replace("_", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
puntoVenta.setIndValidaStock(checkStock.isChecked());
|
||||||
|
|
||||||
|
if(cmbBanco.getSelectedItem()== null){
|
||||||
|
puntoVenta.setAgenciaId(null);
|
||||||
|
}else{
|
||||||
|
puntoVenta.getAgenciaId().setInstiFinanceiraId((InstiFinanceira) cmbBanco.getSelectedItem().getValue());
|
||||||
|
if (cmbPessoa.getSelectedItem() != null){
|
||||||
|
puntoVenta.getAgenciaId().setPessoa((String) cmbPessoa.getSelectedItem().getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmbTipoConta.getSelectedItem() != null){
|
||||||
|
puntoVenta.getAgenciaId().setTipo((String) cmbTipoConta.getSelectedItem().getValue());
|
||||||
|
}
|
||||||
|
puntoVenta.getAgenciaId().setActivo(Boolean.TRUE);
|
||||||
|
puntoVenta.getAgenciaId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
puntoVenta.getAgenciaId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(txtTitularCpf.getValue().equals("")){
|
||||||
|
puntoVenta.setTitularId(null);
|
||||||
|
}else{
|
||||||
|
puntoVenta.getTitularId().setActivo(Boolean.TRUE);
|
||||||
|
puntoVenta.getTitularId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
puntoVenta.getTitularId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
if((txtIss.getValue().equals(""))&&(txtRoyaties.getValue().equals("")) && (txtExcessoAlta.getValue().equals(""))
|
||||||
|
&&(txtExcessoBaixa.getValue().equals(""))&&(txtPassagemBaixa.getValue().equals(""))
|
||||||
|
&&(txtPassagemAlta.getValue().equals(""))&&(txtSeguroBaixa.getValue().equals("")) ){
|
||||||
|
puntoVenta.setComissaoId(null);
|
||||||
|
}else{
|
||||||
|
if (cmbReceita.getSelectedItem() != null){
|
||||||
|
puntoVenta.getComissaoId().setReceita((String) cmbReceita.getSelectedItem().getValue());
|
||||||
|
}
|
||||||
|
puntoVenta.getComissaoId().setEnviarrecibo(checkRecibo.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setTarifaReceita(checkTarifaReceita.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setTaxaReceita(checkTaxaReceita.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setSeguroReceita(checkSeguroReceita.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setPedagioReceita(checkPedagioReceita.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setTarifaDev(checkTarifaDev.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setTaxaDev(checkTaxaDev.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setSeguroDev(checkSeguroDev.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setPegagioDev(checkPedagioDev.isChecked());
|
||||||
|
puntoVenta.getComissaoId().setExcessoAlta(txtExcessoAlta.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setExcessoBaixa(txtExcessoBaixa.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setPassagemBaixa(txtPassagemBaixa.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setPassagemAlta(txtPassagemAlta.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setSeguroBaixa(txtSeguroBaixa.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setSeguroAlta(txtSeguroAlta.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setOutrosBaixa(txtOutrosBaixa.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setOutrosAlta(txtOutrosAlta.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setIssretido(txtIss.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setRoyalties(txtRoyaties.getValueDecimal());
|
||||||
|
puntoVenta.getComissaoId().setActivo(Boolean.TRUE);
|
||||||
|
puntoVenta.getComissaoId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
puntoVenta.getComissaoId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
if((txtResponAluguel.getValue().equals("")&&(txtResponTel.getValue().equals("")))){
|
||||||
|
puntoVenta.setDiversosId(null);
|
||||||
|
}else{
|
||||||
|
puntoVenta.getDiversosId().setBilheteInfo(checkBilheteInfo.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setInformatizada(checkInformatizada.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setVendaInternet(checkVendaInternet.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setTeleEntrega(checkTeleEntrega.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setDigitacaoSeq(checkDigitacao.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setTrabalhaBilhete(checkBilhete.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setOfpsPropria(checkOfpsPropria.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setOfpsTerceiros(checkOfpsTerceiros.isChecked());
|
||||||
|
puntoVenta.getDiversosId().setActivo(Boolean.TRUE);
|
||||||
|
puntoVenta.getDiversosId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
puntoVenta.getDiversosId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
if(cmbPosicao.getSelectedItem() != null){
|
||||||
|
puntoVenta.getDiversosId().setPosicao((String) cmbPosicao.getSelectedItem().getValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (podeSalvar) {
|
|
||||||
if (cmbColonia.getSelectedItem() != null) {
|
|
||||||
puntoVenta.setColonia((Colonia) cmbColonia.getSelectedItem().getValue());
|
|
||||||
}
|
|
||||||
puntoVenta.setActivo(Boolean.TRUE);
|
|
||||||
puntoVenta.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
puntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
puntoVenta.setLsFormaPagoDet(lsFormaPagoDet);
|
|
||||||
puntoVenta.setLsParamRecoleccion(lsParamRecoleccion);
|
|
||||||
puntoVenta.setLsPtovtaEmpresa(lsPtovtaEmpresa);
|
|
||||||
puntoVenta.setLsPtovtaUsuarioBancario(lsPtovtaUsuarioBancario);
|
|
||||||
puntoVenta.setPtovtaAntecipacomissaoList(lsAntecipacomissao);
|
|
||||||
puntoVenta.setPtovtaHorarioList(lsHorario);
|
|
||||||
puntoVenta.setPtovtaEstoqueList(lsEstoque);
|
|
||||||
String getString = null;
|
|
||||||
if(!txtNumFax.getValue().equals("")){
|
|
||||||
getString = this.replaceTextbox(txtNumFax);
|
|
||||||
if(getString.length()>= 11){
|
|
||||||
puntoVenta.setNumfax(txtNumFax.getValue().replace("_", ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!numtelefonouno.getValue().equals("")){
|
|
||||||
getString = this.replaceTextbox(numtelefonouno);
|
|
||||||
if(getString.length()>= 11){
|
|
||||||
puntoVenta.setNumtelefonouno(numtelefonouno.getValue().replace("_", ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!numtelefonodos.getValue().equals("")){
|
|
||||||
getString = this.replaceTextbox(numtelefonodos);
|
|
||||||
if(getString.length()>= 11){
|
|
||||||
puntoVenta.setNumtelefonodos(numtelefonodos.getValue().replace("_", ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
puntoVenta.setIndValidaStock(checkStock.isChecked());
|
|
||||||
|
|
||||||
if(cmbBanco.getSelectedItem()== null){
|
|
||||||
puntoVenta.setAgenciaId(null);
|
|
||||||
}else{
|
|
||||||
puntoVenta.getAgenciaId().setInstiFinanceiraId((InstiFinanceira) cmbBanco.getSelectedItem().getValue());
|
|
||||||
if (cmbPessoa.getSelectedItem() != null){
|
|
||||||
puntoVenta.getAgenciaId().setPessoa((String) cmbPessoa.getSelectedItem().getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmbTipoConta.getSelectedItem() != null){
|
|
||||||
puntoVenta.getAgenciaId().setTipo((String) cmbTipoConta.getSelectedItem().getValue());
|
|
||||||
}
|
|
||||||
puntoVenta.getAgenciaId().setActivo(Boolean.TRUE);
|
|
||||||
puntoVenta.getAgenciaId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
puntoVenta.getAgenciaId().setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(txtTitularCpf.getValue().equals("")){
|
|
||||||
puntoVenta.setTitularId(null);
|
|
||||||
}else{
|
|
||||||
puntoVenta.getTitularId().setActivo(Boolean.TRUE);
|
|
||||||
puntoVenta.getTitularId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
puntoVenta.getTitularId().setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
if((txtIss.getValue().equals(""))&&(txtRoyaties.getValue().equals("")) && (txtExcessoAlta.getValue().equals(""))
|
|
||||||
&&(txtExcessoBaixa.getValue().equals(""))&&(txtPassagemBaixa.getValue().equals(""))
|
|
||||||
&&(txtPassagemAlta.getValue().equals(""))&&(txtSeguroBaixa.getValue().equals("")) ){
|
|
||||||
puntoVenta.setComissaoId(null);
|
|
||||||
}else{
|
|
||||||
if (cmbReceita.getSelectedItem() != null){
|
|
||||||
puntoVenta.getComissaoId().setReceita((String) cmbReceita.getSelectedItem().getValue());
|
|
||||||
}
|
|
||||||
puntoVenta.getComissaoId().setEnviarrecibo(checkRecibo.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setTarifaReceita(checkTarifaReceita.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setTaxaReceita(checkTaxaReceita.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setSeguroReceita(checkSeguroReceita.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setPedagioReceita(checkPedagioReceita.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setTarifaDev(checkTarifaDev.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setTaxaDev(checkTaxaDev.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setSeguroDev(checkSeguroDev.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setPegagioDev(checkPedagioDev.isChecked());
|
|
||||||
puntoVenta.getComissaoId().setExcessoAlta(txtExcessoAlta.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setExcessoBaixa(txtExcessoBaixa.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setPassagemBaixa(txtPassagemBaixa.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setPassagemAlta(txtPassagemAlta.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setSeguroBaixa(txtSeguroBaixa.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setSeguroAlta(txtSeguroAlta.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setOutrosBaixa(txtOutrosBaixa.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setOutrosAlta(txtOutrosAlta.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setIssretido(txtIss.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setRoyalties(txtRoyaties.getValueDecimal());
|
|
||||||
puntoVenta.getComissaoId().setActivo(Boolean.TRUE);
|
|
||||||
puntoVenta.getComissaoId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
puntoVenta.getComissaoId().setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
if((txtResponAluguel.getValue().equals("")&&(txtResponTel.getValue().equals("")))){
|
|
||||||
puntoVenta.setDiversosId(null);
|
|
||||||
}else{
|
|
||||||
puntoVenta.getDiversosId().setBilheteInfo(checkBilheteInfo.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setInformatizada(checkInformatizada.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setVendaInternet(checkVendaInternet.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setTeleEntrega(checkTeleEntrega.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setDigitacaoSeq(checkDigitacao.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setTrabalhaBilhete(checkBilhete.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setOfpsPropria(checkOfpsPropria.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setOfpsTerceiros(checkOfpsTerceiros.isChecked());
|
|
||||||
puntoVenta.getDiversosId().setActivo(Boolean.TRUE);
|
|
||||||
puntoVenta.getDiversosId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
puntoVenta.getDiversosId().setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
if(cmbPosicao.getSelectedItem() != null){
|
|
||||||
puntoVenta.getDiversosId().setPosicao((String) cmbPosicao.getSelectedItem().getValue());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<PtovtaEmpresa> lsPto = new ArrayList<PtovtaEmpresa>();
|
||||||
List<PtovtaEmpresa> lsPto = new ArrayList<PtovtaEmpresa>();
|
for (PtovtaEmpresa pto : lsPtovtaEmpresa) {
|
||||||
for (PtovtaEmpresa pto : lsPtovtaEmpresa) {
|
if (!pto.getActivo()) {
|
||||||
if (!pto.getActivo()) {
|
ptovtaEmpresaService.borrarFisico(pto);
|
||||||
ptovtaEmpresaService.borrarFisico(pto);
|
|
||||||
} else {
|
|
||||||
pto.setPuntoVenta(puntoVenta);
|
|
||||||
lsPto.add(pto);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
puntoVenta.setLsPtovtaEmpresa(lsPto);
|
|
||||||
|
|
||||||
List<PtoVtaUsuarioBancario> lsPto2 = new ArrayList<PtoVtaUsuarioBancario>();
|
|
||||||
for (PtoVtaUsuarioBancario pto2 : lsPtovtaUsuarioBancario) {
|
|
||||||
if (!pto2.getActivo()) {
|
|
||||||
ptoVtaUsuarioBancarioService.borrarFisico(pto2);
|
|
||||||
} else {
|
|
||||||
pto2.setPuntoVenta(puntoVenta);
|
|
||||||
lsPto2.add(pto2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
puntoVenta.setLsPtovtaUsuarioBancario(lsPto2);
|
|
||||||
|
|
||||||
if (radAprobacionAutorizado.isChecked()) {
|
|
||||||
puntoVenta.setStatusaprobacion("A");
|
|
||||||
} else if (radAprobacionLatente.isChecked()) {
|
|
||||||
puntoVenta.setStatusaprobacion("L");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (puntoVenta.getPuntoventaId() == null) {
|
|
||||||
puntoVentaService.suscribir(puntoVenta);
|
|
||||||
puntoVentaList.addItem(puntoVenta);
|
|
||||||
} else {
|
} else {
|
||||||
puntoVentaService.actualizacion(puntoVenta);
|
pto.setPuntoVenta(puntoVenta);
|
||||||
puntoVentaList.updateItem(puntoVenta);
|
lsPto.add(pto);
|
||||||
}
|
}
|
||||||
|
|
||||||
Messagebox.show(
|
|
||||||
Labels.getLabel("editarPuntoVentaController.MSG.suscribirOK"),
|
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
|
||||||
|
|
||||||
closeWindow();
|
|
||||||
} else {
|
|
||||||
Messagebox.show(
|
|
||||||
Labels.getLabel("MSG.Registro.Existe"),
|
|
||||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
}
|
}
|
||||||
|
puntoVenta.setLsPtovtaEmpresa(lsPto);
|
||||||
|
|
||||||
|
List<PtoVtaUsuarioBancario> lsPto2 = new ArrayList<PtoVtaUsuarioBancario>();
|
||||||
|
for (PtoVtaUsuarioBancario pto2 : lsPtovtaUsuarioBancario) {
|
||||||
|
if (!pto2.getActivo()) {
|
||||||
|
ptoVtaUsuarioBancarioService.borrarFisico(pto2);
|
||||||
|
} else {
|
||||||
|
pto2.setPuntoVenta(puntoVenta);
|
||||||
|
lsPto2.add(pto2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
puntoVenta.setLsPtovtaUsuarioBancario(lsPto2);
|
||||||
|
|
||||||
|
if (radAprobacionAutorizado.isChecked()) {
|
||||||
|
puntoVenta.setStatusaprobacion("A");
|
||||||
|
} else if (radAprobacionLatente.isChecked()) {
|
||||||
|
puntoVenta.setStatusaprobacion("L");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (puntoVenta.getPuntoventaId() == null) {
|
||||||
|
puntoVentaService.suscribir(puntoVenta);
|
||||||
|
puntoVentaList.addItem(puntoVenta);
|
||||||
|
} else {
|
||||||
|
puntoVentaService.actualizacion(puntoVenta);
|
||||||
|
puntoVentaList.updateItem(puntoVenta);
|
||||||
|
}
|
||||||
|
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarPuntoVentaController.MSG.suscribirOK"),
|
||||||
|
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
closeWindow();
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.error("editarPuntoVentaController: ", ex);
|
log.error("editarPuntoVentaController: ", ex);
|
||||||
|
|
Loading…
Reference in New Issue