Correção em tela de cadastro de totalizadores não fiscais, relatorios gerenciais e formas de pagamento.
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@45429 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ba70a45508
commit
f8fb03e77a
|
@ -2,7 +2,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.impressaofiscal;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@ -15,21 +14,16 @@ import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.Executions;
|
import org.zkoss.zk.ui.Executions;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zul.Button;
|
import org.zkoss.zul.Button;
|
||||||
import org.zkoss.zul.Checkbox;
|
|
||||||
import org.zkoss.zul.Combobox;
|
import org.zkoss.zul.Combobox;
|
||||||
import org.zkoss.zul.Comboitem;
|
import org.zkoss.zul.Comboitem;
|
||||||
import org.zkoss.zul.Textbox;
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FiscalFormapagoEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.FiscalFormapagoEmpresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FiscalTotnaofiscalEmpresa;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.FormaPago;
|
import com.rjconsultores.ventaboletos.entidad.FormaPago;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
|
||||||
import com.rjconsultores.ventaboletos.service.FiscalImpressoraService;
|
import com.rjconsultores.ventaboletos.service.FiscalImpressoraService;
|
||||||
import com.rjconsultores.ventaboletos.service.FormaPagoService;
|
import com.rjconsultores.ventaboletos.service.FormaPagoService;
|
||||||
import com.rjconsultores.ventaboletos.service.TipoEventoExtraService;
|
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.gui.controladores.impressaofiscal.EditarTotnaofiscalEmpresaController.TipoTotalizadorNaoFiscal;
|
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
|
||||||
|
@ -128,6 +122,14 @@ public class EditarFormapagoEmpresaController extends MyGenericForwardComposer
|
||||||
formapagoEmpresa.setFecmodif(Calendar.getInstance().getTime());
|
formapagoEmpresa.setFecmodif(Calendar.getInstance().getTime());
|
||||||
formapagoEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
formapagoEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
|
||||||
|
if(formapagoEmpresa.getTipoformapago()!= TipoFormaPagamento.CUSTOM.name() && formapagoEmpresaList.getListData().contains(formapagoEmpresa)){
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarFormapagoEmpresaController.MSG.erroTipoFormaPago"),
|
||||||
|
Labels.getLabel("editarFormapagoEmpresaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(formapagoEmpresa.getFiscalformapagoempresaId() == null){
|
if(formapagoEmpresa.getFiscalformapagoempresaId() == null){
|
||||||
fiscalImpressoraService.suscribirFormapagoEmpresa(formapagoEmpresa);
|
fiscalImpressoraService.suscribirFormapagoEmpresa(formapagoEmpresa);
|
||||||
formapagoEmpresaList.addItemNovo(formapagoEmpresa);
|
formapagoEmpresaList.addItemNovo(formapagoEmpresa);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -101,6 +100,13 @@ public class EditarRelgerencialEmpresaController extends MyGenericForwardCompose
|
||||||
relgerencialEmpresa.setActivo(true);
|
relgerencialEmpresa.setActivo(true);
|
||||||
relgerencialEmpresa.setFecmodif(Calendar.getInstance().getTime());
|
relgerencialEmpresa.setFecmodif(Calendar.getInstance().getTime());
|
||||||
relgerencialEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
relgerencialEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
if(relgerencialEmpresaList.getListData().contains(relgerencialEmpresa)){
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarRelgerencialEmpresaController.MSG.erroTipoRelgerencial"),
|
||||||
|
Labels.getLabel("editarRelgerencialEmpresaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(relgerencialEmpresa.getFiscalrelgerencialId() == null){
|
if(relgerencialEmpresa.getFiscalrelgerencialId() == null){
|
||||||
fiscalImpressoraService.suscribirRelgerencialEmpresa(relgerencialEmpresa);
|
fiscalImpressoraService.suscribirRelgerencialEmpresa(relgerencialEmpresa);
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.impressaofiscal;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@ -86,10 +88,25 @@ public class EditarTotnaofiscalEmpresaController extends MyGenericForwardCompose
|
||||||
}
|
}
|
||||||
|
|
||||||
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
//obter Tipos de evento extra
|
||||||
lsTipoEventoExtra = tipoEventoExtraService.obtenerTodos();
|
lsTipoEventoExtra = tipoEventoExtraService.obtenerTodos();
|
||||||
|
TipoEventoExtra eventoExtra = new TipoEventoExtra();
|
||||||
|
//Incluir valor vazio
|
||||||
|
eventoExtra.setDescTipoEvento(" ");
|
||||||
|
lsTipoEventoExtra.add(eventoExtra);
|
||||||
|
//organizar lista apresentada na tela
|
||||||
|
Comparator<TipoEventoExtra> comparator = new Comparator<TipoEventoExtra>() {
|
||||||
|
@Override
|
||||||
|
public int compare(TipoEventoExtra o1, TipoEventoExtra o2) {
|
||||||
|
return o1.getDescTipoEvento().compareTo(o2.getDescTipoEvento());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Collections.sort(lsTipoEventoExtra,comparator);
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
totnaofiscalEmpresa = (FiscalTotnaofiscalEmpresa) Executions.getCurrent().getArg().get("totnaofiscalEmpresa");
|
totnaofiscalEmpresa = (FiscalTotnaofiscalEmpresa) Executions.getCurrent().getArg().get("totnaofiscalEmpresa");
|
||||||
totnaofiscalEmpresaList = (MyListbox) Executions.getCurrent().getArg().get("totnaofiscalEmpresaList");
|
totnaofiscalEmpresaList = (MyListbox) Executions.getCurrent().getArg().get("totnaofiscalEmpresaList");
|
||||||
|
|
||||||
|
@ -99,17 +116,17 @@ public class EditarTotnaofiscalEmpresaController extends MyGenericForwardCompose
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||||
|
|
||||||
cmbEmpresa.getValue();
|
cmbEmpresa.getValue();
|
||||||
cmbTipoEventoExtra.getValue();
|
cmbTipoEventoExtra.getValue();
|
||||||
cmbTipototalizador.getValue();
|
cmbTipototalizador.getValue();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
Comboitem itemTipoEventoExtra = cmbTipoEventoExtra.getSelectedItem();
|
Comboitem itemTipoEventoExtra = cmbTipoEventoExtra.getSelectedItem();
|
||||||
if(itemTipoEventoExtra != null){
|
if(itemTipoEventoExtra != null && !"".equals(itemTipoEventoExtra.getValue().toString().trim())){
|
||||||
TipoEventoExtra tipoeventoextra = (TipoEventoExtra) itemTipoEventoExtra.getValue();
|
TipoEventoExtra tipoeventoextra = (TipoEventoExtra) itemTipoEventoExtra.getValue();
|
||||||
totnaofiscalEmpresa.setTipoeventoextra(tipoeventoextra);
|
totnaofiscalEmpresa.setTipoeventoextra(tipoeventoextra);
|
||||||
|
}else{
|
||||||
|
totnaofiscalEmpresa.setTipoeventoextra(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
Comboitem itemTipototalizador = cmbTipototalizador.getSelectedItem();
|
Comboitem itemTipototalizador = cmbTipototalizador.getSelectedItem();
|
||||||
|
@ -125,12 +142,24 @@ public class EditarTotnaofiscalEmpresaController extends MyGenericForwardCompose
|
||||||
totnaofiscalEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
totnaofiscalEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
if(totnaofiscalEmpresa.getTipototalizador()!= TipoTotalizadorNaoFiscal.CUSTOM.name() && totnaofiscalEmpresaList.getListData().contains(totnaofiscalEmpresa)){
|
if(totnaofiscalEmpresa.getTipototalizador()!= TipoTotalizadorNaoFiscal.CUSTOM.name() && totnaofiscalEmpresaList.getListData().contains(totnaofiscalEmpresa)){
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarTotnaofiscalEmpresaController.MSG.suscribirOK"),
|
Labels.getLabel("editarTotnaofiscalEmpresaController.MSG.erroTipoTotalizador"),
|
||||||
Labels.getLabel("editarTotnaofiscalEmpresaController.window.title"),
|
Labels.getLabel("editarTotnaofiscalEmpresaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Object totalizador : totnaofiscalEmpresaList.getListData()) {
|
||||||
|
if(totnaofiscalEmpresa.getTipoeventoextra()!= null && !"".equals(totnaofiscalEmpresa.getTipoeventoextra().getDescTipoEvento().trim())
|
||||||
|
&& ((FiscalTotnaofiscalEmpresa)totalizador).getTipoeventoextra()!= null
|
||||||
|
&& totnaofiscalEmpresa.getTipoeventoextra().getDescTipoEvento().equals(((FiscalTotnaofiscalEmpresa)totalizador).getTipoeventoextra().getDescTipoEvento())){
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarTotnaofiscalEmpresaController.MSG.erroTipoEventoExtra"),
|
||||||
|
Labels.getLabel("editarTotnaofiscalEmpresaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(totnaofiscalEmpresa.getFiscaltotnaofiscalId() == null){
|
if(totnaofiscalEmpresa.getFiscaltotnaofiscalId() == null){
|
||||||
fiscalImpressoraService.suscribirTotnaofiscalEmpresa(totnaofiscalEmpresa);
|
fiscalImpressoraService.suscribirTotnaofiscalEmpresa(totnaofiscalEmpresa);
|
||||||
totnaofiscalEmpresaList.addItemNovo(totnaofiscalEmpresa);
|
totnaofiscalEmpresaList.addItemNovo(totnaofiscalEmpresa);
|
||||||
|
|
Loading…
Reference in New Issue