Correção de equals
fixes bug 6745 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@49225 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2fb248ab86
commit
b72815fc6a
|
@ -152,12 +152,12 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
lsTodosEstados = estadoService.obtenerTodos();
|
lsTodosEstados = estadoService.obtenerTodos();
|
||||||
lsCidades = new ArrayList<Ciudad>();
|
lsCidades = new ArrayList<Ciudad>();
|
||||||
lsBanco = instFinanceiraService.obtenerTodos();
|
lsBanco = instFinanceiraService.obtenerTodos();
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
lsEmpresaContaBancaria = new ArrayList<EmpresaContaBancaria>();
|
lsEmpresaContaBancaria = new ArrayList<EmpresaContaBancaria>();
|
||||||
empresaContaBancariaList.setItemRenderer(new RenderEmpresaContaBancaria());
|
empresaContaBancariaList.setItemRenderer(new RenderEmpresaContaBancaria());
|
||||||
|
|
||||||
empresaImpostoList.setItemRenderer(new RenderEmpresaImposto());
|
empresaImpostoList.setItemRenderer(new RenderEmpresaImposto());
|
||||||
empresaImpostoList.addEventListener("onDoubleClick", new EventListener() {
|
empresaImpostoList.addEventListener("onDoubleClick", new EventListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -184,11 +184,11 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
empresa = empresaService.obtenerID(empresa.getEmpresaId());
|
empresa = empresaService.obtenerID(empresa.getEmpresaId());
|
||||||
lsEmpresaImposto = empresaImpostoService.buscarByEmpresa(empresa);
|
lsEmpresaImposto = empresaImpostoService.buscarByEmpresa(empresa);
|
||||||
empresaImpostoList.setData(lsEmpresaImposto);
|
empresaImpostoList.setData(lsEmpresaImposto);
|
||||||
inscEstadualList.setData(empresa.getInscricoesEstaduaisActivas());
|
inscEstadualList.setData(empresa.getInscricoesEstaduaisActivas());
|
||||||
|
|
||||||
//Contas Bancárias das Empresas
|
// Contas Bancárias das Empresas
|
||||||
lsEmpresaContaBancaria = empresa.getEmpresaContaBancaria();
|
lsEmpresaContaBancaria = empresa.getEmpresaContaBancaria();
|
||||||
empresaContaBancariaList.setData(lsEmpresaContaBancaria);
|
empresaContaBancariaList.setData(lsEmpresaContaBancaria);
|
||||||
}
|
}
|
||||||
|
|
||||||
txtNome.focus();
|
txtNome.focus();
|
||||||
|
@ -356,7 +356,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
public void onClick$btnAdicionarInscEstadual(Event ev) throws InterruptedException {
|
public void onClick$btnAdicionarInscEstadual(Event ev) throws InterruptedException {
|
||||||
Estado estado = (Estado) cmbEstadoInscEstadual.getSelectedItem().getValue();
|
Estado estado = (Estado) cmbEstadoInscEstadual.getSelectedItem().getValue();
|
||||||
String inscEstadual = txtInscEstadual.getValue();
|
String inscEstadual = txtInscEstadual.getValue();
|
||||||
|
|
||||||
for (int i = 0; i < inscEstadualList.getModel().getSize(); i++) {
|
for (int i = 0; i < inscEstadualList.getModel().getSize(); i++) {
|
||||||
if (((InscricaoEstadual) inscEstadualList.getModel().getElementAt(i)).getEstado().equals(estado)) {
|
if (((InscricaoEstadual) inscEstadualList.getModel().getElementAt(i)).getEstado().equals(estado)) {
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
|
@ -416,12 +416,12 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
public void setBtnRemoverInscEstadual(Button btnRemoverInscEstadual) {
|
public void setBtnRemoverInscEstadual(Button btnRemoverInscEstadual) {
|
||||||
this.btnRemoverInscEstadual = btnRemoverInscEstadual;
|
this.btnRemoverInscEstadual = btnRemoverInscEstadual;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSelect$cmbBanco() {
|
public void onSelect$cmbBanco() {
|
||||||
InstiFinanceira banco = (InstiFinanceira) cmbBanco.getSelectedItem().getValue();
|
InstiFinanceira banco = (InstiFinanceira) cmbBanco.getSelectedItem().getValue();
|
||||||
txtNomeBanco.setValue(banco.getNome());
|
txtNomeBanco.setValue(banco.getNome());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<InstiFinanceira> getLsBanco() {
|
public List<InstiFinanceira> getLsBanco() {
|
||||||
return lsBanco;
|
return lsBanco;
|
||||||
}
|
}
|
||||||
|
@ -437,22 +437,22 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
public void setCmbBanco(Combobox cmbBanco) {
|
public void setCmbBanco(Combobox cmbBanco) {
|
||||||
this.cmbBanco = cmbBanco;
|
this.cmbBanco = cmbBanco;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Textbox getTxtNomeBanco() {
|
public Textbox getTxtNomeBanco() {
|
||||||
return txtNomeBanco;
|
return txtNomeBanco;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTxtNomeBanco(Textbox txtNomeBanco) {
|
public void setTxtNomeBanco(Textbox txtNomeBanco) {
|
||||||
this.txtNomeBanco = txtNomeBanco;
|
this.txtNomeBanco = txtNomeBanco;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MyListbox getEmpresaContaBancariaList() {
|
public MyListbox getEmpresaContaBancariaList() {
|
||||||
return empresaContaBancariaList;
|
return empresaContaBancariaList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmpresaContaBancariaList(MyListbox empresaContaBancariaList) {
|
public void setEmpresaContaBancariaList(MyListbox empresaContaBancariaList) {
|
||||||
this.empresaContaBancariaList = empresaContaBancariaList;
|
this.empresaContaBancariaList = empresaContaBancariaList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Textbox getTxtNumConta() {
|
public Textbox getTxtNumConta() {
|
||||||
return txtNumConta;
|
return txtNumConta;
|
||||||
|
@ -471,14 +471,14 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnRemoverContaBancaria(Event ev) {
|
public void onClick$btnRemoverContaBancaria(Event ev) {
|
||||||
|
|
||||||
EmpresaContaBancaria empresaToRemove = (EmpresaContaBancaria) empresaContaBancariaList.getSelected();
|
EmpresaContaBancaria empresaToRemove = (EmpresaContaBancaria) empresaContaBancariaList.getSelected();
|
||||||
|
|
||||||
if (empresaToRemove != null) {
|
if (empresaToRemove != null) {
|
||||||
lsEmpresaContaBancaria.remove(empresaToRemove);
|
lsEmpresaContaBancaria.remove(empresaToRemove);
|
||||||
empresaToRemove.setFecmodif(Calendar.getInstance().getTime());
|
empresaToRemove.setFecmodif(Calendar.getInstance().getTime());
|
||||||
empresaToRemove.setActivo(Boolean.FALSE);
|
empresaToRemove.setActivo(Boolean.FALSE);
|
||||||
empresaToRemove.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
empresaToRemove.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
lsEmpresaContaBancaria.add(empresaToRemove);
|
lsEmpresaContaBancaria.add(empresaToRemove);
|
||||||
empresaContaBancariaList.updateItem(empresaToRemove);
|
empresaContaBancariaList.updateItem(empresaToRemove);
|
||||||
empresaContaBancariaList.removeItem(empresaToRemove);
|
empresaContaBancariaList.removeItem(empresaToRemove);
|
||||||
|
@ -494,47 +494,54 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnAdicionarContaBancaria(Event ev) throws InterruptedException {
|
public void onClick$btnAdicionarContaBancaria(Event ev) throws InterruptedException {
|
||||||
|
|
||||||
if(infoContaBancariaValida()) {
|
if (infoContaBancariaValida()) {
|
||||||
InstiFinanceira instiFinanceira = (InstiFinanceira) cmbBanco.getSelectedItem().getValue();
|
InstiFinanceira instiFinanceira = (InstiFinanceira) cmbBanco.getSelectedItem().getValue();
|
||||||
String numConta = txtNumConta.getValue();
|
String numConta = txtNumConta.getValue();
|
||||||
String numAgencia = txtNumAgencia.getValue();
|
String numAgencia = txtNumAgencia.getValue();
|
||||||
|
|
||||||
EmpresaContaBancaria empresaContaBancariaToAdd = new EmpresaContaBancaria();
|
EmpresaContaBancaria empresaContaBancariaToAdd = new EmpresaContaBancaria();
|
||||||
empresaContaBancariaToAdd.setActivo(Boolean.TRUE);
|
empresaContaBancariaToAdd.setActivo(Boolean.TRUE);
|
||||||
empresaContaBancariaToAdd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
empresaContaBancariaToAdd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
empresaContaBancariaToAdd.setFecmodif(Calendar.getInstance().getTime());
|
empresaContaBancariaToAdd.setFecmodif(Calendar.getInstance().getTime());
|
||||||
empresaContaBancariaToAdd.setEmpresa(empresa);
|
empresaContaBancariaToAdd.setEmpresa(empresa);
|
||||||
empresaContaBancariaToAdd.setInstituicaoFinandeira(instiFinanceira);
|
empresaContaBancariaToAdd.setInstituicaoFinandeira(instiFinanceira);
|
||||||
empresaContaBancariaToAdd.setNumAgencia(numAgencia);
|
empresaContaBancariaToAdd.setNumAgencia(numAgencia);
|
||||||
empresaContaBancariaToAdd.setNumConta(numConta);
|
empresaContaBancariaToAdd.setNumConta(numConta);
|
||||||
|
|
||||||
boolean achou = Boolean.FALSE;
|
boolean achou = Boolean.FALSE;
|
||||||
for (EmpresaContaBancaria empresaContaBancariaInTheList : lsEmpresaContaBancaria) {
|
for (EmpresaContaBancaria empresaContaBancariaInTheList : lsEmpresaContaBancaria) {
|
||||||
if(empresaContaBancariaInTheList.equals(empresaContaBancariaToAdd)) {
|
if (empresaContaBancariaInTheList.equals(empresaContaBancariaToAdd)) {
|
||||||
achou = Boolean.TRUE;
|
achou = Boolean.TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!achou) {
|
if (!achou) {
|
||||||
lsEmpresaContaBancaria.add(empresaContaBancariaToAdd);
|
lsEmpresaContaBancaria.add(empresaContaBancariaToAdd);
|
||||||
empresa.setEmpresaContaBancaria(lsEmpresaContaBancaria);
|
empresa.setEmpresaContaBancaria(lsEmpresaContaBancaria);
|
||||||
}
|
|
||||||
|
List<EmpresaContaBancaria> tempList = new ArrayList<EmpresaContaBancaria>();
|
||||||
List<EmpresaContaBancaria> tempList = new ArrayList<EmpresaContaBancaria>();
|
if (lsEmpresaContaBancaria != null) {
|
||||||
if(lsEmpresaContaBancaria != null) {
|
for (EmpresaContaBancaria empresaContaBancaria : lsEmpresaContaBancaria) {
|
||||||
for (EmpresaContaBancaria empresaContaBancaria : lsEmpresaContaBancaria) {
|
if (empresaContaBancaria.getActivo()) {
|
||||||
if(empresaContaBancaria.getActivo()) {
|
tempList.add(empresaContaBancaria);
|
||||||
tempList.add(empresaContaBancaria);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
empresaContaBancariaList.setData(tempList);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarEmpresaController.MSG.jaExisteContaComAsMesmasInfoCadastradas"),
|
||||||
|
Labels.getLabel("editarEmpresaController.contaBancaria.label"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
empresaContaBancariaList.setData(tempList);
|
|
||||||
clearContaBancaria();
|
clearContaBancaria();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearContaBancaria() {
|
private void clearContaBancaria() {
|
||||||
|
@ -553,23 +560,23 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(txtNumConta.getValue() == null) {
|
if (txtNumConta.getValue() == null) {
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarEmpresaController.MSG.informeConta"),
|
Labels.getLabel("editarEmpresaController.MSG.informeConta"),
|
||||||
Labels.getLabel("editarEmpresaController.contaBancaria.label"),
|
Labels.getLabel("editarEmpresaController.contaBancaria.label"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(txtNumAgencia.getValue() == null) {
|
if (txtNumAgencia.getValue() == null) {
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarEmpresaController.MSG.informeAgencia"),
|
Labels.getLabel("editarEmpresaController.MSG.informeAgencia"),
|
||||||
Labels.getLabel("editarEmpresaController.contaBancaria.label"),
|
Labels.getLabel("editarEmpresaController.contaBancaria.label"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -791,6 +791,7 @@ editarEmpresaController.MSG.informeBanco = Informe o Banco
|
||||||
editarEmpresaController.MSG.informeConta = Informe a Conta
|
editarEmpresaController.MSG.informeConta = Informe a Conta
|
||||||
editarEmpresaController.MSG.informeAgencia = Informe a Agência
|
editarEmpresaController.MSG.informeAgencia = Informe a Agência
|
||||||
editarEmpresaController.MSG.selecioneUmItem = Selecione a Conta Bancária a ser Removida
|
editarEmpresaController.MSG.selecioneUmItem = Selecione a Conta Bancária a ser Removida
|
||||||
|
editarEmpresaController.MSG.jaExisteContaComAsMesmasInfoCadastradas = Já existe uma conta com as mesmas informações cadastrada
|
||||||
|
|
||||||
#Empresa impuesto
|
#Empresa impuesto
|
||||||
editarEmpresaImpostoController.window.title = Configuración de impuesto por empresa/estado
|
editarEmpresaImpostoController.window.title = Configuración de impuesto por empresa/estado
|
||||||
|
|
|
@ -827,6 +827,7 @@ editarEmpresaController.MSG.informeBanco = Informe o Banco
|
||||||
editarEmpresaController.MSG.informeConta = Informe a Conta
|
editarEmpresaController.MSG.informeConta = Informe a Conta
|
||||||
editarEmpresaController.MSG.informeAgencia = Informe a Agência
|
editarEmpresaController.MSG.informeAgencia = Informe a Agência
|
||||||
editarEmpresaController.MSG.selecioneUmItem = Selecione a Conta Bancária a ser Removida
|
editarEmpresaController.MSG.selecioneUmItem = Selecione a Conta Bancária a ser Removida
|
||||||
|
editarEmpresaController.MSG.jaExisteContaComAsMesmasInfoCadastradas = Já existe uma conta com as mesmas informações cadastrada
|
||||||
|
|
||||||
#Empresa Imposto
|
#Empresa Imposto
|
||||||
editarEmpresaImpostoController.window.title = Configuração de Imposto por Empresa/Estado
|
editarEmpresaImpostoController.window.title = Configuração de Imposto por Empresa/Estado
|
||||||
|
|
Loading…
Reference in New Issue