fixes bug#19807

dev:valdevir
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@102766 d1611594-4594-4d17-8e1d-87c2c4800839
master
wilian 2020-08-04 18:56:06 +00:00
parent 4a61f1f01f
commit 3cd65f011f
5 changed files with 112 additions and 8 deletions

View File

@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
import java.util.Calendar; import java.util.Calendar;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
@ -15,6 +16,7 @@ import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Radio; import org.zkoss.zul.Radio;
import com.rjconsultores.ventaboletos.entidad.ContaMD; import com.rjconsultores.ventaboletos.entidad.ContaMD;
import com.rjconsultores.ventaboletos.enums.MDOrigem;
import com.rjconsultores.ventaboletos.service.ContaMDService; import com.rjconsultores.ventaboletos.service.ContaMDService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -64,6 +66,11 @@ public class EditarContaMDController extends MyGenericForwardComposer {
txtNome.setText(conta.getNome()); txtNome.setText(conta.getNome());
} }
if(conta.getContaId() == null) {
radioTipoC.setChecked(Boolean.TRUE);
radioStatusI.setChecked(Boolean.TRUE);
}
if (conta.getTipo() != null) { if (conta.getTipo() != null) {
if (conta.getTipo().equals("C")) { if (conta.getTipo().equals("C")) {
radioTipoC.setChecked(Boolean.TRUE); radioTipoC.setChecked(Boolean.TRUE);
@ -96,13 +103,13 @@ public class EditarContaMDController extends MyGenericForwardComposer {
chkOrigemIN.setChecked(Boolean.FALSE); chkOrigemIN.setChecked(Boolean.FALSE);
chkOrigemEE.setChecked(Boolean.FALSE); chkOrigemEE.setChecked(Boolean.FALSE);
chkOrigemFP.setChecked(Boolean.FALSE); chkOrigemFP.setChecked(Boolean.FALSE);
if (origem == null || origem.contains("IN")) { if (origem == null || origem.contains(MDOrigem.INTERNO.getValue())) {
chkOrigemIN.setChecked(Boolean.TRUE); chkOrigemIN.setChecked(Boolean.TRUE);
} }
if (origem != null && origem.contains("EE")) { if (origem != null && origem.contains(MDOrigem.EVENTO_EXTRA.getValue())) {
chkOrigemEE.setChecked(Boolean.TRUE); chkOrigemEE.setChecked(Boolean.TRUE);
} }
if (origem != null && origem.contains("FP")) { if (origem != null && origem.contains(MDOrigem.FORMA_PAGAMENTO.getValue())) {
chkOrigemFP.setChecked(Boolean.TRUE); chkOrigemFP.setChecked(Boolean.TRUE);
} }
@ -112,6 +119,9 @@ public class EditarContaMDController extends MyGenericForwardComposer {
} }
txtNome.focus(); txtNome.focus();
if(conta.getContaId() == null) {
txtCodigoContabil.focus();
}
} }
public void onClick$btnSalvar(Event ev) throws InterruptedException { public void onClick$btnSalvar(Event ev) throws InterruptedException {
@ -150,17 +160,17 @@ public class EditarContaMDController extends MyGenericForwardComposer {
StringBuilder origem = new StringBuilder(); StringBuilder origem = new StringBuilder();
if (chkOrigemIN.isChecked()) { if (chkOrigemIN.isChecked()) {
origem.append("IN"); origem.append(MDOrigem.INTERNO.getValue());
conta.setReferencia(null); conta.setReferencia(null);
} else { } else {
if (chkOrigemEE.isChecked()) { if (chkOrigemEE.isChecked()) {
origem.append("EE"); origem.append(MDOrigem.EVENTO_EXTRA.getValue());
} }
if (chkOrigemFP.isChecked()) { if (chkOrigemFP.isChecked()) {
if(origem.length() > 0) { if(origem.length() > 0) {
origem.append(";"); origem.append(";");
} }
origem.append("FP"); origem.append(MDOrigem.FORMA_PAGAMENTO.getValue());
} }
conta.setReferencia(txtReferencia.getText()); conta.setReferencia(txtReferencia.getText());
} }
@ -210,6 +220,15 @@ public class EditarContaMDController extends MyGenericForwardComposer {
} }
private boolean validarCamposOrigem() throws InterruptedException { private boolean validarCamposOrigem() throws InterruptedException {
if(!chkOrigemIN.isChecked() && !chkOrigemEE.isChecked() && !chkOrigemFP.isChecked()) {
Messagebox.show(
Labels.getLabel("editarContaMDController.MSG.erroOrigemNaoInformada.value"),
Labels.getLabel("editarContaMDController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return false;
}
if (chkOrigemIN.isChecked() && (chkOrigemEE.isChecked() || chkOrigemFP.isChecked())) { if (chkOrigemIN.isChecked() && (chkOrigemEE.isChecked() || chkOrigemFP.isChecked())) {
Messagebox.show( Messagebox.show(
Labels.getLabel("editarContaMDController.MSG.erroOrigem.value"), Labels.getLabel("editarContaMDController.MSG.erroOrigem.value"),
@ -217,8 +236,73 @@ public class EditarContaMDController extends MyGenericForwardComposer {
Messagebox.OK, Messagebox.EXCLAMATION); Messagebox.OK, Messagebox.EXCLAMATION);
return false; return false;
} }
txtReferencia.getValue();
if((chkOrigemEE.isChecked() || chkOrigemFP.isChecked()) && StringUtils.isBlank(txtReferencia.getValue())) {
Messagebox.show(
Labels.getLabel("editarContaMDController.MSG.erroReferenciaOrigemNaoInformada.value"),
Labels.getLabel("editarContaMDController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return false;
}
return true; return true;
} }
public void onCheck$chkOrigemIN(Event ev) throws InterruptedException {
if(!chkOrigemIN.isChecked()) {
int resp = Messagebox.show(
Labels.getLabel("editarContaMDController.MSG.origemInternoPergunta.value"),
Labels.getLabel("editarContaMDController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.NO) {
chkOrigemIN.setChecked(true);
}
}
}
public void onClick$btnApagar(Event ev) throws InterruptedException {
if(chkOrigemIN.isChecked()) {
Messagebox.show(
Labels.getLabel("editarContaMDController.MSG.origemInternoExclusao.value"),
Labels.getLabel("editarContaMDController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
int resp = Messagebox.show(
Labels.getLabel("editarContaMDController.MSG.exclusao.value"),
Labels.getLabel("editarContaMDController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.YES) {
StringBuilder origem = new StringBuilder();
if (chkOrigemIN.isChecked()) {
origem.append(MDOrigem.INTERNO.getValue());
conta.setReferencia(null);
} else {
if (chkOrigemEE.isChecked()) {
origem.append(MDOrigem.EVENTO_EXTRA.getValue());
}
if (chkOrigemFP.isChecked()) {
if(origem.length() > 0) {
origem.append(";");
}
origem.append(MDOrigem.FORMA_PAGAMENTO.getValue());
}
conta.setReferencia(txtReferencia.getText());
}
contaMDService.borrar(conta);
contaList.removeItem(conta);
Messagebox.show(
Labels.getLabel("editarContaMDController.MSG.BorrarOK"),
Labels.getLabel("editarContaMDController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
closeWindow();
}
}
public ContaMD getConta() { public ContaMD getConta() {
return conta; return conta;

View File

@ -8692,6 +8692,7 @@ busquedaContasMDController.btnRefresh.tooltiptext=Atualizar
busquedaContasMDController.btnCerrar.tooltiptext=Fechar busquedaContasMDController.btnCerrar.tooltiptext=Fechar
busquedaContasMDController.txtNombre.label = Nome busquedaContasMDController.txtNombre.label = Nome
busquedaContasMDController.btnPesquisa.label = Buscar busquedaContasMDController.btnPesquisa.label = Buscar
busquedaContasMDController.btnNovo.tooltiptext=Novo
busquedaContasMDController.lhId.label = Cód busquedaContasMDController.lhId.label = Cód
busquedaContasMDController.lhNome.label = Nome busquedaContasMDController.lhNome.label = Nome
@ -8701,6 +8702,7 @@ busquedaContasMDController.lhStatus.label = Status
editarContaMDController.window.title=Conta MD editarContaMDController.window.title=Conta MD
editarContaMDController.btnSalvar.tooltiptext = Salvar editarContaMDController.btnSalvar.tooltiptext = Salvar
editarContaMDController.btnFechar.tooltiptext = Fechar editarContaMDController.btnFechar.tooltiptext = Fechar
editarContaMDController.btnApagar.tooltiptext = Excluir
editarContaMDController.lbCodigoContabil.value = Código Contábil editarContaMDController.lbCodigoContabil.value = Código Contábil
editarContaMDController.lbNome.value = Nome editarContaMDController.lbNome.value = Nome
@ -8721,6 +8723,12 @@ editarContaMDController.MSG.BorrarPergunta = Deseja eliminar essa Conta?
editarContaMDController.MSG.BorrarOK = Conta excluida com sucesso. editarContaMDController.MSG.BorrarOK = Conta excluida com sucesso.
editarContaMDController.MSG.CodContabil.Invalido = Código Contábil inválido. editarContaMDController.MSG.CodContabil.Invalido = Código Contábil inválido.
editarContaMDController.MSG.erroOrigem.value = Não é permitido selecionar Origem Interno e outras origens editarContaMDController.MSG.erroOrigem.value = Não é permitido selecionar Origem Interno e outras origens
editarContaMDController.MSG.erroOrigemNaoInformada.value = Selecione uma Origem
editarContaMDController.MSG.erroReferenciaOrigemNaoInformada.value = Referência não informada
editarContaMDController.MSG.erroTipoNaoInformado.value = Informe o Tipo
editarContaMDController.MSG.origemInternoPergunta.value = Tem certeza que deseja alterar a Origem Interno?
editarContaMDController.MSG.origemInternoExclusao.value = Não é possível excluir Conta de Origem Interno
editarContaMDController.MSG.exclusao.value = Tem certeza que deseja excluir?
#Relatório MMPH - DER-PR #Relatório MMPH - DER-PR
relatorioMmphDerController.window.title = Relatório MMPH - DER-PR relatorioMmphDerController.window.title = Relatório MMPH - DER-PR

View File

@ -8022,6 +8022,7 @@ busquedaContasMDController.btnRefresh.tooltiptext=Atualizar
busquedaContasMDController.btnCerrar.tooltiptext=Fechar busquedaContasMDController.btnCerrar.tooltiptext=Fechar
busquedaContasMDController.txtNombre.label = Nome busquedaContasMDController.txtNombre.label = Nome
busquedaContasMDController.btnPesquisa.label = Buscar busquedaContasMDController.btnPesquisa.label = Buscar
busquedaContasMDController.btnNovo.tooltiptext=Novo
busquedaContasMDController.lhId.label = Cód busquedaContasMDController.lhId.label = Cód
busquedaContasMDController.lhNome.label = Nome busquedaContasMDController.lhNome.label = Nome
@ -8031,6 +8032,7 @@ busquedaContasMDController.lhStatus.label = Status
editarContaMDController.window.title=Conta MD editarContaMDController.window.title=Conta MD
editarContaMDController.btnSalvar.tooltiptext = Salvar editarContaMDController.btnSalvar.tooltiptext = Salvar
editarContaMDController.btnFechar.tooltiptext = Fechar editarContaMDController.btnFechar.tooltiptext = Fechar
editarContaMDController.btnApagar.tooltiptext = Excluir
editarContaMDController.lbCodigoContabil.value = Código Contábil editarContaMDController.lbCodigoContabil.value = Código Contábil
editarContaMDController.lbNome.value = Nome editarContaMDController.lbNome.value = Nome
@ -8051,6 +8053,12 @@ editarContaMDController.MSG.BorrarPergunta = Deseja eliminar essa Conta?
editarContaMDController.MSG.BorrarOK = Conta excluida com sucesso. editarContaMDController.MSG.BorrarOK = Conta excluida com sucesso.
editarContaMDController.MSG.CodContabil.Invalido = Código Contábil inválido. editarContaMDController.MSG.CodContabil.Invalido = Código Contábil inválido.
editarContaMDController.MSG.erroOrigem.value = Não é permitido selecionar Origem Interno e outras origens editarContaMDController.MSG.erroOrigem.value = Não é permitido selecionar Origem Interno e outras origens
editarContaMDController.MSG.erroOrigemNaoInformada.value = Selecione uma Origem
editarContaMDController.MSG.erroReferenciaOrigemNaoInformada.value = Referência não informada
editarContaMDController.MSG.erroTipoNaoInformado.value = Informe o Tipo
editarContaMDController.MSG.origemInternoPergunta.value = Tem certeza que deseja alterar a Origem Interno?
editarContaMDController.MSG.origemInternoExclusao.value = Não é possível excluir Conta de Origem Interno
editarContaMDController.MSG.exclusao.value = Tem certeza que deseja excluir?
# Filtro Depósitos # Filtro Depósitos
relatorioDepositosController.window.title=Fechamento Cnt Corrente / Depósitos relatorioDepositosController.window.title=Fechamento Cnt Corrente / Depósitos

View File

@ -11,7 +11,8 @@
<toolbar> <toolbar>
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px" <button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
tooltiptext="${c:l('busquedaContasMDController.btnRefresh.tooltiptext')}" /> tooltiptext="${c:l('busquedaContasMDController.btnRefresh.tooltiptext')}" />
<separator orient="vertical" /> <button id="btnNovo" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('busquedaContasMDController.btnNovo.tooltiptext')}" />
<button id="btnCerrar" onClick="winBusquedaContasMD.detach()" image="/gui/img/exit.png" width="35px" <button id="btnCerrar" onClick="winBusquedaContasMD.detach()" image="/gui/img/exit.png" width="35px"
tooltiptext="${c:l('busquedaContasMDController.btnCerrar.tooltiptext')}"/> tooltiptext="${c:l('busquedaContasMDController.btnCerrar.tooltiptext')}"/>
</toolbar> </toolbar>

View File

@ -14,6 +14,9 @@
<button id="btnSalvar" height="20" <button id="btnSalvar" height="20"
image="/gui/img/save.png" width="35px" image="/gui/img/save.png" width="35px"
tooltiptext="${c:l('editarContaMDController.btnSalvar.tooltiptext')}"/> tooltiptext="${c:l('editarContaMDController.btnSalvar.tooltiptext')}"/>
<button id="btnApagar" height="20"
image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('editarContaMDController.btnApagar.tooltiptext')}" />
<button id="btnFechar" height="20" <button id="btnFechar" height="20"
image="/gui/img/exit.png" width="35px" image="/gui/img/exit.png" width="35px"
onClick="winEditarContaMD.detach()" onClick="winEditarContaMD.detach()"