fixes bug #AL-2518
parent
952934cf8a
commit
d14c28cfb3
|
@ -18,6 +18,8 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.relatorios.negocio.CalculoImposto;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
||||
|
@ -32,14 +34,18 @@ import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
|
|||
|
||||
|
||||
public class RelatorioComissaoSintetico extends Relatorio {
|
||||
|
||||
|
||||
private Logger log;
|
||||
private List<RelatorioComissaoSinteticoBean> lsDadosRelatorio;
|
||||
private LinkedHashMap<String, LinkedHashMap<String, Object>> mapCacheConfigComissao;
|
||||
private Set<PuntoVenta> pontoVendaConfiguracao;
|
||||
|
||||
|
||||
|
||||
public RelatorioComissaoSintetico(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||
super(parametros, conexao);
|
||||
log = Logger.getLogger(RelatorioComissaoSintetico.class);
|
||||
CalculoImposto.limpaCache();
|
||||
this.mapCacheConfigComissao = new LinkedHashMap<String, LinkedHashMap<String, Object>>();
|
||||
|
||||
|
@ -269,16 +275,22 @@ private Set<PuntoVenta> pontoVendaConfiguracao;
|
|||
}
|
||||
|
||||
public void setLsDadosRelatorio(List<RelatorioComissaoSinteticoBean> lsDadosRelatorio) {
|
||||
lsDadosRelatorio.forEach(bean -> {
|
||||
BigDecimal totalComissoes = bean.getComissaoTarifa()
|
||||
.add(bean.getComissaoImpPosterior())
|
||||
.add(bean.getComissaoVendaImpPosterior())
|
||||
.add(bean.getComissaoExcBagagem())
|
||||
.add(bean.getComissaoOutros());
|
||||
bean.setComissaoTotal(totalComissoes);
|
||||
});
|
||||
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
|
||||
this.lsDadosRelatorio = lsDadosRelatorio;
|
||||
if(lsDadosRelatorio!=null && !lsDadosRelatorio.isEmpty()) {
|
||||
try {
|
||||
lsDadosRelatorio.forEach(bean -> {
|
||||
BigDecimal totalComissoes = bean.getComissaoTarifa()
|
||||
.add(bean.getComissaoImpPosterior())
|
||||
.add(bean.getComissaoVendaImpPosterior())
|
||||
.add(bean.getComissaoExcBagagem())
|
||||
.add(bean.getComissaoOutros());
|
||||
bean.setComissaoTotal(totalComissoes);
|
||||
});
|
||||
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
|
||||
this.lsDadosRelatorio = lsDadosRelatorio;
|
||||
}catch(ArrayIndexOutOfBoundsException e) {
|
||||
log.error("Erro a gerar relatorio Comissao sintetico", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public HashMap<String, Object> getConfigImposto(Integer empresaId, Integer estadoId) throws Exception {
|
||||
|
|
Loading…
Reference in New Issue