walace 2017-09-06 17:29:52 +00:00
parent 243f69fdd4
commit 475e5b418f
11 changed files with 918 additions and 97 deletions

View File

@ -1,6 +1,7 @@
package com.rjconsultores.ventaboletos.relatorios.impl; package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -37,12 +38,13 @@ public class RelatorioDocumentosFiscais extends Relatorio {
Map<String, Object> parametros = this.relatorio.getParametros(); Map<String, Object> parametros = this.relatorio.getParametros();
Integer empresaId = (Integer) parametros.get("EMPRESA_ID"); Integer empresaId = (Integer) parametros.get("EMPRESA_ID");
Integer estadoId = (Integer) parametros.get("ESTADO_ID");
String agencia = (String) parametros.get("PUNTOVENTA"); String agencia = (String) parametros.get("PUNTOVENTA");
String tipoLinha = (String) parametros.get("TIPO_LINHA"); String tipoLinha = (String) parametros.get("TIPO_LINHA");
Aidf aidf = (Aidf) parametros.get("AIDF"); Aidf aidf = (Aidf) parametros.get("AIDF");
Boolean somenteCancelado = (Boolean) parametros.get("SOMENTE_CANCELADO"); Boolean somenteCancelado = (Boolean) parametros.get("SOMENTE_CANCELADO");
String sql = getSql(empresaId, agencia, somenteCancelado, tipoLinha, aidf); String sql = getSql(empresaId, agencia, somenteCancelado, tipoLinha, aidf, estadoId);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql); NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
@ -53,8 +55,14 @@ public class RelatorioDocumentosFiscais extends Relatorio {
rset = stmt.executeQuery(); rset = stmt.executeQuery();
lsDadosRelatorio = new ArrayList<RelatorioDocumentosFiscaisBean>(); lsDadosRelatorio = new ArrayList<RelatorioDocumentosFiscaisBean>();
BigDecimal saldo = BigDecimal.ZERO;
BigDecimal total = BigDecimal.ZERO; BigDecimal totalValorContabil = BigDecimal.ZERO;
BigDecimal totalValorBaseCalculo = BigDecimal.ZERO;
BigDecimal totalValorAliquiotaICMS = BigDecimal.ZERO;
BigDecimal totalValorICMS = BigDecimal.ZERO;
BigDecimal totalValorIsentas = BigDecimal.ZERO;
BigDecimal totalValorOutras = BigDecimal.ZERO;
BigDecimal totalValorCancelado = BigDecimal.ZERO;
while (rset.next()) { while (rset.next()) {
@ -70,16 +78,43 @@ public class RelatorioDocumentosFiscais extends Relatorio {
bean.setValorICMS((BigDecimal) rset.getObject("valorICMS")); bean.setValorICMS((BigDecimal) rset.getObject("valorICMS"));
bean.setOutras((BigDecimal) rset.getObject("outras")); bean.setOutras((BigDecimal) rset.getObject("outras"));
bean.setValorCancelado((BigDecimal) rset.getObject("valorCancelado")); bean.setValorCancelado((BigDecimal) rset.getObject("valorCancelado"));
bean.setEstadoId((Integer) Integer.parseInt(rset.getObject("estadoId").toString())); bean.setNomeEstado((String) rset.getObject("nomeEstado"));
lsDadosRelatorio.add(bean); lsDadosRelatorio.add(bean);
} }
if (lsDadosRelatorio.size() > 0) { if (lsDadosRelatorio.size() > 0) {
for (RelatorioDocumentosFiscaisBean bean : lsDadosRelatorio) {
bean.setValorContabil(bean.getValorContabil().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorBaseCalculo(bean.getValorBaseCalculo().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorAliquiotaICMS(bean.getValorAliquiotaICMS().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorICMS(bean.getValorICMS().setScale(2, RoundingMode.HALF_EVEN));
bean.setOutras(bean.getOutras().setScale(2, RoundingMode.HALF_EVEN));
// bean.setIsentas(bean.getIsentas().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorCancelado(bean.getValorCancelado().setScale(2, RoundingMode.HALF_EVEN));
totalValorContabil = totalValorContabil.add(bean.getValorContabil() != null ? bean.getValorContabil() : BigDecimal.ZERO);
totalValorBaseCalculo = totalValorBaseCalculo.add(bean.getValorBaseCalculo() != null ? bean.getValorBaseCalculo() : BigDecimal.ZERO);
totalValorAliquiotaICMS = totalValorAliquiotaICMS.add(bean.getValorAliquiotaICMS() != null ? bean.getValorAliquiotaICMS() : BigDecimal.ZERO);
totalValorICMS = totalValorICMS.add(bean.getValorICMS() != null ? bean.getValorICMS() : BigDecimal.ZERO);
// totalValorIsentas = totalValorIsentas.add(bean.getIsentas() != null ? bean.getIsentas() : BigDecimal.ZERO);
totalValorOutras = totalValorOutras.add(bean.getOutras() != null ? bean.getOutras() : BigDecimal.ZERO);
totalValorCancelado = totalValorCancelado.add(bean.getValorCancelado() != null ? bean.getValorCancelado() : BigDecimal.ZERO);
}
setLsDadosRelatorio(lsDadosRelatorio); setLsDadosRelatorio(lsDadosRelatorio);
parametros.put("SALDO", saldo.subtract(total));
parametros.put("TOTAL", total); parametros.put("TOTAL_VALOR_CONTABIL", totalValorContabil);
parametros.put("TOTAL_VALOR_BASE_CALCULO", totalValorBaseCalculo);
parametros.put("TOTAL_VALOR_ALIQUIOTA_ICMS", totalValorAliquiotaICMS);
parametros.put("TOTAL_VALOR_ICMS", totalValorICMS);
parametros.put("TOTAL_VALOR_ISENTAS", totalValorIsentas);
parametros.put("TOTAL_VALOR_OUTRAS", totalValorOutras);
parametros.put("TOTAL_VALOR_CANCELADO", totalValorCancelado);
} }
} }
}); });
@ -90,21 +125,22 @@ public class RelatorioDocumentosFiscais extends Relatorio {
this.lsDadosRelatorio = lsDadosRelatorio; this.lsDadosRelatorio = lsDadosRelatorio;
} }
private String getSql(Integer empresaId, String agencia, Boolean somenteCancelado, String tipoLinha, Aidf aidf) { private String getSql(Integer empresaId, String agencia, Boolean somenteCancelado, String tipoLinha, Aidf aidf, Integer estadoId) {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append("SELECT coalesce(tabela.numAidf, '') as numAidf, ");
sql.append(" tabela.formInicial as formInicial, "); sql.append("SELECT coalesce(tabela.numAidf, '') AS numAidf, ");
sql.append(" tabela.formFinal as formFinal, "); sql.append(" tabela.formInicial AS formInicial, ");
sql.append(" tabela.serie as serie, "); sql.append(" tabela.formFinal AS formFinal, ");
sql.append(" tabela.subSerie as subSerie , "); sql.append(" tabela.serie AS serie, ");
sql.append(" tabela.subSerie AS subSerie, ");
sql.append(" tabela.nomeEstado AS nomeEstado, ");
sql.append(" coalesce(sum(tabela.valorContabil),0) AS valorContabil, "); sql.append(" coalesce(sum(tabela.valorContabil),0) AS valorContabil, ");
sql.append(" (sum(tabela.valorContabil) - (sum(tabela.valorContabil) * tabela.redBaseCalcIcms)) AS valorBaseCalculo, "); sql.append(" sum(valorBaseCalculo) AS valorBaseCalculo, ");
sql.append(" tabela.ICMS AS valorAliquiotaICMS, "); sql.append(" tabela.valorAliquiotaICMS AS valorAliquiotaICMS, ");
sql.append(" (sum(tabela.valorContabil) - (sum(tabela.valorContabil) * tabela.redBaseCalcIcms)) * tabela.ICMS AS valorICMS, "); sql.append(" sum(tabela.valorICMS) AS valorICMS, ");
sql.append(" sum(tabela.valorContabil) - (sum(tabela.valorContabil) - (sum(tabela.valorContabil) * tabela.redBaseCalcIcms)) AS outras, "); sql.append(" coalesce(sum(tabela.valorCancelado),0) AS valorCancelado, ");
sql.append(" coalesce(sum(tabela.valorCancelado),0) AS valorCancelado, "); sql.append(" sum(tabela.outras) AS outras ");
sql.append(" tabela.estadoId as estadoId ");
sql.append("FROM "); sql.append("FROM ");
sql.append(" (SELECT a.ACFISCAL AS numAidf, "); sql.append(" (SELECT a.ACFISCAL AS numAidf, ");
sql.append(" a.FORMINICIAL AS formInicial, "); sql.append(" a.FORMINICIAL AS formInicial, ");
@ -113,15 +149,15 @@ public class RelatorioDocumentosFiscais extends Relatorio {
sql.append(" a.SUBSERIE AS subSerie, "); sql.append(" a.SUBSERIE AS subSerie, ");
sql.append(" c.MOTIVOCANCELACION_ID AS motivoCancelacion, "); sql.append(" c.MOTIVOCANCELACION_ID AS motivoCancelacion, ");
sql.append(" c.PRECIOBASE AS tarifa, "); sql.append(" c.PRECIOBASE AS tarifa, ");
sql.append(" ed.ICMS AS ICMS, "); sql.append(" ed.ICMS AS valorAliquiotaICMS, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO ELSE 0 END AS valorContabil, "); sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO ELSE 0 END AS valorContabil, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NOT NULL THEN c.PRECIOPAGADO ELSE 0 "); sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NOT NULL THEN c.PRECIOPAGADO ELSE 0 END AS valorCancelado, ");
sql.append(" END AS valorCancelado, ");
sql.append(" coalesce(ei.PORCREDBASEICMS / 100,0) AS redBaseCalcIcms, "); sql.append(" coalesce(ei.PORCREDBASEICMS / 100,0) AS redBaseCalcIcms, ");
sql.append(" ei.estado_id AS estadoId, "); sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO - (c.PRECIOPAGADO * coalesce(ei.PORCREDBASEICMS / 100,0)) ELSE 0 END AS valorBaseCalculo, ");
sql.append(" po.DESCPARADA AS origem, "); sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN ((c.PRECIOPAGADO - (c.PRECIOPAGADO * coalesce(ei.PORCREDBASEICMS / 100,0))) * ed.ICMS) / 100 ELSE 0 END AS valorICMS, ");
sql.append(" pd.DESCPARADA AS destino, "); sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO - (c.PRECIOPAGADO - (c.PRECIOPAGADO * coalesce(ei.PORCREDBASEICMS / 100,0))) ELSE 0 END AS outras, ");
sql.append(" CASE WHEN((coalesce(eos.cveestado, eo.cveestado)) = (coalesce(eds.cveestado, ed.cveestado))) then 0 else 1 end as isInterEstadual "); sql.append(" eo.estado_id AS estadoId, eo.NOMBESTADO AS nomeEstado, po.DESCPARADA AS origem, pd.DESCPARADA AS destino, ");
sql.append(" CASE WHEN((coalesce(eos.cveestado, eo.cveestado)) = (coalesce(eds.cveestado, ed.cveestado))) THEN 0 ELSE 1 END AS isInterEstadual ");
sql.append(" FROM caja c "); sql.append(" FROM caja c ");
sql.append(" INNER JOIN aidf a ON a.aidf_id = c.aidf_id "); sql.append(" INNER JOIN aidf a ON a.aidf_id = c.aidf_id ");
sql.append(" JOIN marca m ON c.marca_id = m.marca_id "); sql.append(" JOIN marca m ON c.marca_id = m.marca_id ");
@ -144,21 +180,17 @@ public class RelatorioDocumentosFiscais extends Relatorio {
sql.append(" LEFT JOIN ciudad cds ON cds.ciudad_id = pds.ciudad_id "); sql.append(" LEFT JOIN ciudad cds ON cds.ciudad_id = pds.ciudad_id ");
sql.append(" LEFT JOIN estado eds ON eds.estado_id = cds.estado_id "); sql.append(" LEFT JOIN estado eds ON eds.estado_id = cds.estado_id ");
sql.append(" INNER JOIN empresa_imposto ei ON ei.empresa_id = e.empresa_id "); sql.append(" INNER JOIN empresa_imposto ei ON ei.empresa_id = e.empresa_id ");
sql.append(" WHERE c.feccreacion between :DATA_INICIAL and :DATA_FINAL "); sql.append(" WHERE c.feccreacion between :DATA_INICIAL and :DATA_FINAL ");
sql.append("AND c.EMPRESACORRIDA_ID =" + empresaId + " "); sql.append("AND c.EMPRESACORRIDA_ID =" + empresaId + " ");
sql.append(somenteCancelado == true ? " AND c.INDCANCELACION = 1" : " "); sql.append(somenteCancelado == true ? " AND c.INDCANCELACION = 1" : " ");
sql.append("AND a.AIDF_ID = " + aidf.getAidfId() + " "); // sql.append("AND a.AIDF_ID = " + aidf.getAidfId() + " ");
sql.append(" AND coalesce(eos.cveestado, eo.cveestado) IN ('BA') )tabela "); sql.append("AND coalesce(eos.estado_id, eo.estado_id) IN (" + estadoId + ") ");
sql.append(")tabela ");
sql.append(tipoLinha.equals("INTERMUNICIPAL") ? " where tabela.isInterEstadual = 1" : tipoLinha.equals("INTERESTADUAL") ? " where tabela.isInterEstadual = 0" : " "); sql.append(tipoLinha.equals("INTERMUNICIPAL") ? " where tabela.isInterEstadual = 1" : tipoLinha.equals("INTERESTADUAL") ? " where tabela.isInterEstadual = 0" : " ");
sql.append("GROUP BY tabela.numAidf, "); sql.append("GROUP BY tabela.numAidf,tabela.formInicial, ");
sql.append(" tabela.formInicial, "); sql.append(" tabela.formFinal,tabela.serie, tabela.subSerie,tabela.nomeEstado, ");
sql.append(" tabela.formFinal, "); sql.append(" tabela.valorAliquiotaICMS ");
sql.append(" tabela.serie, "); sql.append("ORDER BY tabela.nomeEstado");
sql.append(" tabela.subSerie, ");
sql.append(" tabela.ICMS, ");
sql.append(" tabela.redBaseCalcIcms, ");
sql.append(" tabela.estadoId");
return sql.toString(); return sql.toString();
} }

View File

@ -0,0 +1,200 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.rjconsultores.ventaboletos.entidad.Aidf;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioDocumentosFiscaisBean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class RelatorioDocumentosFiscaisAgrupadoPorLocalidade extends Relatorio {
public RelatorioDocumentosFiscaisAgrupadoPorLocalidade(Map<String, Object> parametros, Connection conexao) {
super(parametros, conexao);
}
private List<RelatorioDocumentosFiscaisBean> lsDadosRelatorio;
@Override
protected void processaParametros() throws Exception {
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
Integer empresaId = (Integer) parametros.get("EMPRESA_ID");
String agencia = (String) parametros.get("PUNTOVENTA");
String tipoLinha = (String) parametros.get("TIPO_LINHA");
Aidf aidf = (Aidf) parametros.get("AIDF");
Boolean somenteCancelado = (Boolean) parametros.get("SOMENTE_CANCELADO");
String sql = getSql(empresaId, agencia, somenteCancelado, tipoLinha, aidf);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
stmt.setTimestamp("DATA_INICIAL", (Timestamp) parametros.get("DATA_INICIAL"));
stmt.setTimestamp("DATA_FINAL", (Timestamp) parametros.get("DATA_FINAL"));
ResultSet rset = null;
rset = stmt.executeQuery();
lsDadosRelatorio = new ArrayList<RelatorioDocumentosFiscaisBean>();
BigDecimal totalValorContabil = BigDecimal.ZERO;
BigDecimal totalValorBaseCalculo = BigDecimal.ZERO;
BigDecimal totalValorAliquiotaICMS = BigDecimal.ZERO;
BigDecimal totalValorICMS = BigDecimal.ZERO;
BigDecimal totalValorIsentas = BigDecimal.ZERO;
BigDecimal totalValorOutras = BigDecimal.ZERO;
BigDecimal totalValorCancelado = BigDecimal.ZERO;
while (rset.next()) {
RelatorioDocumentosFiscaisBean bean = new RelatorioDocumentosFiscaisBean();
bean.setNumAIDF((String) (rset.getObject("numAIDF") == null ? "" : rset.getObject("numAIDF")));
bean.setFormInicial((String) rset.getObject("formInicial"));
bean.setFormFinal((String) rset.getObject("formFinal"));
bean.setSerie((String) rset.getObject("serie"));
bean.setSubSerie((String) rset.getObject("subSerie"));
bean.setValorContabil((BigDecimal) rset.getObject("valorContabil"));
bean.setValorBaseCalculo((BigDecimal) rset.getObject("valorBaseCalculo"));
bean.setValorAliquiotaICMS((BigDecimal) rset.getObject("valorAliquiotaICMS"));
bean.setValorICMS((BigDecimal) rset.getObject("valorICMS"));
bean.setOutras((BigDecimal) rset.getObject("outras"));
bean.setValorCancelado((BigDecimal) rset.getObject("valorCancelado"));
bean.setNomeEstado((String) rset.getObject("nomeEstado"));
bean.setNomeOrigem((String) rset.getObject("nomeOrigem"));
bean.setNomeDestino((String) rset.getObject("nomeDestino"));
lsDadosRelatorio.add(bean);
}
if (lsDadosRelatorio.size() > 0) {
for (RelatorioDocumentosFiscaisBean bean : lsDadosRelatorio) {
bean.setValorContabil(bean.getValorContabil().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorBaseCalculo(bean.getValorBaseCalculo().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorAliquiotaICMS(bean.getValorAliquiotaICMS().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorICMS(bean.getValorICMS().setScale(2, RoundingMode.HALF_EVEN));
bean.setOutras(bean.getOutras().setScale(2, RoundingMode.HALF_EVEN));
//bean.setIsentas(bean.getIsentas().setScale(2, RoundingMode.HALF_EVEN));
bean.setValorCancelado(bean.getValorCancelado().setScale(2, RoundingMode.HALF_EVEN));
totalValorContabil = totalValorContabil.add(bean.getValorContabil() != null ? bean.getValorContabil() : BigDecimal.ZERO);
totalValorBaseCalculo = totalValorBaseCalculo.add(bean.getValorBaseCalculo() != null ? bean.getValorBaseCalculo() : BigDecimal.ZERO);
totalValorAliquiotaICMS = totalValorAliquiotaICMS.add(bean.getValorAliquiotaICMS() != null ? bean.getValorAliquiotaICMS() : BigDecimal.ZERO);
totalValorICMS = totalValorICMS.add(bean.getValorICMS() != null ? bean.getValorICMS() : BigDecimal.ZERO);
//totalValorIsentas = totalValorIsentas.add(bean.getIsentas() != null ? bean.getIsentas() : BigDecimal.ZERO);
totalValorOutras = totalValorOutras.add(bean.getOutras() != null ? bean.getOutras() : BigDecimal.ZERO);
totalValorCancelado = totalValorCancelado.add(bean.getValorCancelado() != null ? bean.getValorCancelado() : BigDecimal.ZERO);
}
setLsDadosRelatorio(lsDadosRelatorio);
parametros.put("TOTAL_VALOR_CONTABIL", totalValorContabil);
parametros.put("TOTAL_VALOR_BASE_CALCULO", totalValorBaseCalculo);
parametros.put("TOTAL_VALOR_ALIQUIOTA_ICMS", totalValorAliquiotaICMS);
parametros.put("TOTAL_VALOR_ICMS", totalValorICMS);
parametros.put("TOTAL_VALOR_ISENTAS", totalValorIsentas);
parametros.put("TOTAL_VALOR_OUTRAS", totalValorOutras);
parametros.put("TOTAL_VALOR_CANCELADO", totalValorCancelado);
}
}
});
}
public void setLsDadosRelatorio(List<RelatorioDocumentosFiscaisBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
private String getSql(Integer empresaId, String agencia, Boolean somenteCancelado, String tipoLinha, Aidf aidf) {
StringBuilder sql = new StringBuilder();
sql.append("SELECT coalesce(tabela.numAidf, '') AS numAidf, ");
sql.append(" tabela.formInicial AS formInicial, ");
sql.append(" tabela.formFinal AS formFinal, ");
sql.append(" tabela.serie AS serie, ");
sql.append(" tabela.subSerie AS subSerie, ");
sql.append(" tabela.nomeEstado AS nomeEstado, ");
sql.append(" tabela.origem AS nomeOrigem, ");
sql.append(" tabela.destino AS nomeDestino, ");
sql.append(" coalesce(sum(tabela.valorContabil),0) AS valorContabil, ");
sql.append(" sum(valorBaseCalculo) AS valorBaseCalculo, ");
sql.append(" tabela.valorAliquiotaICMS AS valorAliquiotaICMS, ");
sql.append(" sum(tabela.valorICMS) AS valorICMS, ");
sql.append(" coalesce(sum(tabela.valorCancelado),0) AS valorCancelado, ");
sql.append(" sum(tabela.outras) AS outras ");
sql.append("FROM ");
sql.append(" (SELECT a.ACFISCAL AS numAidf, ");
sql.append(" a.FORMINICIAL AS formInicial, ");
sql.append(" a.FORMFINAL AS formFinal, ");
sql.append(" a.SERIE AS serie, ");
sql.append(" a.SUBSERIE AS subSerie, ");
sql.append(" c.MOTIVOCANCELACION_ID AS motivoCancelacion, ");
sql.append(" c.PRECIOBASE AS tarifa, ");
sql.append(" ed.ICMS AS valorAliquiotaICMS, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO ELSE 0 END AS valorContabil, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NOT NULL THEN c.PRECIOPAGADO ELSE 0 END AS valorCancelado, ");
sql.append(" coalesce(ei.PORCREDBASEICMS / 100,0) AS redBaseCalcIcms, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO - (c.PRECIOPAGADO * coalesce(ei.PORCREDBASEICMS / 100,0)) ELSE 0 END AS valorBaseCalculo, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN ((c.PRECIOPAGADO - (c.PRECIOPAGADO * coalesce(ei.PORCREDBASEICMS / 100,0))) * ed.ICMS) / 100ELSE 0 END AS valorICMS, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO - (c.PRECIOPAGADO - (c.PRECIOPAGADO * coalesce(ei.PORCREDBASEICMS / 100,0))) ELSE 0 END AS outras, ");
sql.append(" eo.estado_id AS estadoId, eo.NOMBESTADO AS nomeEstado, po.DESCPARADA AS origem, pd.DESCPARADA AS destino, ");
sql.append(" CASE WHEN((coalesce(eos.cveestado, eo.cveestado)) = (coalesce(eds.cveestado, ed.cveestado))) THEN 0 ELSE 1 END AS isInterEstadual ");
sql.append(" FROM caja c ");
sql.append(" INNER JOIN aidf a ON a.aidf_id = c.aidf_id ");
sql.append(" JOIN marca m ON c.marca_id = m.marca_id ");
sql.append(" JOIN empresa e ON e.empresa_id = m.empresa_id ");
sql.append(" JOIN parada po ON po.parada_id = c.origen_id ");
sql.append(" JOIN ciudad co ON co.ciudad_id = po.ciudad_id ");
sql.append(" JOIN estado eo ON eo.estado_id = co.estado_id ");
sql.append(" JOIN parada pd ON pd.parada_id = c.destino_id ");
sql.append(" JOIN ciudad cd ON cd.ciudad_id = pd.ciudad_id ");
sql.append(" JOIN estado ed ON ed.estado_id = cd.estado_id ");
sql.append(" LEFT JOIN alias_servico s ON s.origen_id = c.origen_id ");
sql.append(" AND s.destino_id = c.destino_id ");
sql.append(" AND (s.corrida_id = c.corrida_id ");
sql.append(" OR s.corrida_id IS NULL) ");
sql.append(" AND s.ruta_id = c.ruta_id ");
sql.append(" LEFT JOIN parada pos ON pos.parada_id = s.aliasorigen_id ");
sql.append(" LEFT JOIN ciudad cos ON cos.ciudad_id = pos.ciudad_id ");
sql.append(" LEFT JOIN estado eos ON eos.estado_id = cos.estado_id ");
sql.append(" LEFT JOIN parada pds ON pds.parada_id = s.aliasdestino_id ");
sql.append(" LEFT JOIN ciudad cds ON cds.ciudad_id = pds.ciudad_id ");
sql.append(" LEFT JOIN estado eds ON eds.estado_id = cds.estado_id ");
sql.append(" INNER JOIN empresa_imposto ei ON ei.empresa_id = e.empresa_id ");
sql.append(" WHERE c.feccreacion between :DATA_INICIAL and :DATA_FINAL ");
sql.append("AND c.EMPRESACORRIDA_ID =" + empresaId + " ");
sql.append(somenteCancelado == true ? " AND c.INDCANCELACION = 1" : " ");
// sql.append("AND a.AIDF_ID = " + aidf.getAidfId() + " ");
sql.append(")tabela ");
sql.append(tipoLinha.equals("INTERMUNICIPAL") ? " where tabela.isInterEstadual = 1" : tipoLinha.equals("INTERESTADUAL") ? " where tabela.isInterEstadual = 0" : " ");
sql.append("GROUP BY tabela.numAidf,tabela.formInicial, ");
sql.append(" tabela.formFinal,tabela.serie, tabela.subSerie,tabela.nomeEstado, ");
sql.append(" tabela.origem, tabela.destino, ");
sql.append(" tabela.valorAliquiotaICMS ");
sql.append("ORDER BY tabela.nomeEstado,tabela.origem, tabela.destino");
return sql.toString();
}
}

View File

@ -0,0 +1,28 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Documentos Fiscais
cabecalho.relatorio=Relatório
label.periodo=Período:
label.UF=UF
label.especie=Espécie
label.empresa=Empresa:
label.formInicial=Nº Inicial
label.formFinal=Nº Final
label.numAIDF=AIDF
label.serie=Série
label.subSerie=SubSérie
label.valorContabil=Vlr Contábil
label.valorBaseCalculo=Vlr Base Cálc.
label.valorAliquiotaICMS=Alíquota ICMS
label.valorICMS=Valor ICMS
label.isentas=Isentas
label.outras=Outras
label.valorCancelado=Qtd. Cancec
label.origem=Origem
label.destino=Destino
label.estado=Estado
header.data=Período
header.a=a
header.tipoLinha=Tipo Linha

View File

@ -0,0 +1,30 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Documentos Fiscais
cabecalho.relatorio=Relatório Documentos Fiscais
header.periodo=Período:
header.a=a
header.tipoLinha=Tipo Linha:
label.periodo=Período:
label.UF=UF
label.especie=Espécie:
label.empresa=Empresa:
label.formInicial=Nº Inicial
label.formFinal=Nº Final
label.numAIDF=AIDF
label.serie=Série
label.subSerie=SubSérie
label.valorContabil=Vlr Contábil
label.valorBaseCalculo=Vlr Base Cálc.
label.valorAliquiotaICMS=Alíquota ICMS
label.valorICMS=Valor ICMS
label.isentas=Isentas
label.outras=Outras
label.valorCancelado=Qtd. Cancec
label.origem=Origem
label.destino=Destino
label.estado=Estado:
label.totais=Totais:

View File

@ -7,7 +7,7 @@ cabecalho.relatorio=Relat
label.periodo=Período: label.periodo=Período:
label.UF=UF label.UF=UF
label.especie=Espécie label.especie=Espécie
label.empresa=Empresa label.empresa=Empresa:
label.formInicial=Nº Inicial label.formInicial=Nº Inicial
label.formFinal=Nº Final label.formFinal=Nº Final
label.numAIDF=AIDF label.numAIDF=AIDF
@ -20,4 +20,6 @@ label.valorICMS=Valor ICMS
label.isentas=Isentas label.isentas=Isentas
label.outras=Outras label.outras=Outras
label.valorCancelado=Qtd. Cancec label.valorCancelado=Qtd. Cancec
header.data=Período header.periodo=Período:
header.tipoLinha=Tipo Linha:
header.estado=Estado:

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioAgenciaFechamento" pageWidth="898" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="858" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="RelatorioAgenciaFechamento" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e"> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioDocumentosFiscais" pageWidth="898" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="858" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="RelatorioDocumentosFiscais" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e">
<property name="ireport.zoom" value="2.6573415000000056"/> <property name="ireport.zoom" value="1.650000000000005"/>
<property name="ireport.x" value="470"/> <property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageHeader"/> <property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/> <property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/>
@ -14,6 +14,16 @@
<parameter name="DATA_FINAL" class="java.util.Date"/> <parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="TITULO" class="java.lang.String"/> <parameter name="TITULO" class="java.lang.String"/>
<parameter name="EMPRESA" class="java.lang.String"/> <parameter name="EMPRESA" class="java.lang.String"/>
<parameter name="ESTADO" class="java.lang.String"/>
<parameter name="ESPECIE" class="java.lang.String"/>
<parameter name="TIPO_LINHA" class="java.lang.String"/>
<parameter name="TOTAL_VALOR_CONTABIL" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_BASE_CALCULO" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_ALIQUIOTA_ICMS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_ICMS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_ISENTAS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_OUTRAS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_CANCELADO" class="java.math.BigDecimal"/>
<queryString> <queryString>
<![CDATA[]]> <![CDATA[]]>
</queryString> </queryString>
@ -37,17 +47,28 @@
<background> <background>
<band splitType="Stretch"/> <band splitType="Stretch"/>
</background> </background>
<title>
<band height="28">
<textField>
<reportElement x="258" y="2" width="300" height="20" uuid="e15d26de-6873-4576-b49b-8dc546b39dbe"/>
<textElement textAlignment="Center">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader> <pageHeader>
<band height="48" splitType="Stretch"> <band height="89" splitType="Stretch">
<textField> <textField>
<reportElement x="258" y="26" width="53" height="17" uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716"/> <reportElement x="258" y="26" width="53" height="17" uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716"/>
<textElement> <textElement>
<font size="12" isBold="true"/> <font size="12" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{header.data}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{header.periodo}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="701" y="6" width="56" height="20" uuid="66b2d0f6-2bf1-4bc7-9ec0-a34444e04d60"/> <reportElement x="634" y="6" width="123" height="20" uuid="66b2d0f6-2bf1-4bc7-9ec0-a34444e04d60"/>
<textElement> <textElement>
<font size="12"/> <font size="12"/>
</textElement> </textElement>
@ -67,13 +88,6 @@
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{header.pagina}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{header.pagina}]]></textFieldExpression>
</textField> </textField>
<textField>
<reportElement x="0" y="0" width="231" height="20" uuid="652312bd-292a-424d-a234-5f157e3699c6"/>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm"> <textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="757" y="6" width="98" height="20" uuid="6f671365-868e-41a6-81ee-a308d1d91e1d"/> <reportElement x="757" y="6" width="98" height="20" uuid="6f671365-868e-41a6-81ee-a308d1d91e1d"/>
<textElement textAlignment="Left"> <textElement textAlignment="Left">
@ -89,10 +103,10 @@
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField> </textField>
<line> <line>
<reportElement x="0" y="45" width="857" height="1" uuid="ee05e1fa-6963-4ff9-b3c8-c6cd1bb54e94"/> <reportElement x="-1" y="87" width="858" height="1" uuid="ee05e1fa-6963-4ff9-b3c8-c6cd1bb54e94"/>
</line> </line>
<textField> <textField>
<reportElement x="99" y="23" width="132" height="20" uuid="4d4f219a-3607-4255-b549-fc5ada2ad59e"/> <reportElement x="99" y="23" width="159" height="20" uuid="4d4f219a-3607-4255-b549-fc5ada2ad59e"/>
<textElement verticalAlignment="Bottom"> <textElement verticalAlignment="Bottom">
<font size="10"/> <font size="10"/>
</textElement> </textElement>
@ -113,6 +127,46 @@
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.empresa}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.empresa}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="44" width="99" height="20" isPrintWhenDetailOverflows="true" uuid="37578e45-7834-459f-b021-b38fa08df7e4"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.estado}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="99" y="44" width="159" height="20" uuid="4ace9692-147a-46cb-9ae3-5c7224a3d4d0"/>
<textElement verticalAlignment="Bottom">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$P{ESTADO}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="258" y="43" width="53" height="21" isPrintWhenDetailOverflows="true" uuid="5237474d-82e1-4fae-84f7-9a469370c9c4"/>
<textElement verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.especie}]]></textFieldExpression>
</textField>
<textField pattern="">
<reportElement x="311" y="44" width="110" height="20" uuid="0d0d4e1d-f34f-4846-8d74-1846a69ec3a0"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$P{ESPECIE}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="99" y="64" width="159" height="20" uuid="939e9c97-0283-4ff5-8fa0-8ffca9f15420"/>
<textElement verticalAlignment="Bottom">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$P{TIPO_LINHA}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="64" width="99" height="20" isPrintWhenDetailOverflows="true" uuid="0ccfd171-e97a-4b60-ba4c-ccc2033c1678"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.tipoLinha}]]></textFieldExpression>
</textField>
</band> </band>
</pageHeader> </pageHeader>
<columnHeader> <columnHeader>
@ -156,49 +210,49 @@
<textFieldExpression><![CDATA[$R{label.subSerie}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.subSerie}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="311" y="2" width="53" height="26" isPrintWhenDetailOverflows="true" uuid="e3f4df4e-24a9-45b3-8ac3-f8b66d46a15f"/> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="311" y="2" width="110" height="26" isPrintWhenDetailOverflows="true" uuid="e3f4df4e-24a9-45b3-8ac3-f8b66d46a15f"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none"> <textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.valorContabil}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.valorContabil}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="364" y="2" width="53" height="26" isPrintWhenDetailOverflows="true" uuid="79775d53-3de4-4c0c-8ec7-3be13738dc14"/> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="421" y="2" width="71" height="26" isPrintWhenDetailOverflows="true" uuid="79775d53-3de4-4c0c-8ec7-3be13738dc14"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none"> <textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.valorBaseCalculo}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.valorBaseCalculo}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="417" y="2" width="53" height="26" isPrintWhenDetailOverflows="true" uuid="746627ad-15b0-4435-93ce-6d370b75e594"/> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="492" y="2" width="66" height="26" isPrintWhenDetailOverflows="true" uuid="746627ad-15b0-4435-93ce-6d370b75e594"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none"> <textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.valorAliquiotaICMS}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.valorAliquiotaICMS}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="470" y="2" width="53" height="26" isPrintWhenDetailOverflows="true" uuid="0844b500-feab-477d-ade1-2d943491de32"/> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="558" y="2" width="76" height="26" isPrintWhenDetailOverflows="true" uuid="0844b500-feab-477d-ade1-2d943491de32"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none"> <textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.valorICMS}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.valorICMS}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="523" y="2" width="53" height="26" isPrintWhenDetailOverflows="true" uuid="3647e647-81bb-4098-afce-52d942daa341"/> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="634" y="2" width="67" height="26" isPrintWhenDetailOverflows="true" uuid="3647e647-81bb-4098-afce-52d942daa341"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none"> <textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.isentas}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.isentas}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="576" y="2" width="53" height="26" isPrintWhenDetailOverflows="true" uuid="328a6678-fc02-4845-98e6-a3d3bfaa2c73"/> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="701" y="2" width="66" height="26" isPrintWhenDetailOverflows="true" uuid="328a6678-fc02-4845-98e6-a3d3bfaa2c73"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none"> <textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.outras}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.outras}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="629" y="2" width="57" height="26" isPrintWhenDetailOverflows="true" uuid="2cca17d2-47ba-4dba-a8c3-96e4f6d7deff"/> <reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="767" y="2" width="66" height="26" isPrintWhenDetailOverflows="true" uuid="2cca17d2-47ba-4dba-a8c3-96e4f6d7deff"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none"> <textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="11" isBold="true"/> <font size="11" isBold="true"/>
</textElement> </textElement>
@ -208,8 +262,8 @@
</columnHeader> </columnHeader>
<detail> <detail>
<band height="17" splitType="Stretch"> <band height="17" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="470" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="784343f8-f7aa-4997-82e7-312878bd9a27"/> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="558" y="1" width="76" height="16" isPrintWhenDetailOverflows="true" uuid="784343f8-f7aa-4997-82e7-312878bd9a27"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/> <font size="11" isBold="false"/>
</textElement> </textElement>
@ -222,8 +276,8 @@
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{formInicial}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{formInicial}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="311" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="0ed9578b-73d5-4f51-b21c-07d9419bbc08"/> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="311" y="0" width="110" height="17" isPrintWhenDetailOverflows="true" uuid="0ed9578b-73d5-4f51-b21c-07d9419bbc08"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/> <font size="11" isBold="false"/>
</textElement> </textElement>
@ -236,41 +290,34 @@
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{formFinal}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{formFinal}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="364" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="92017408-1781-4e17-90b7-5ff86457cf6d"/> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="421" y="0" width="71" height="17" isPrintWhenDetailOverflows="true" uuid="92017408-1781-4e17-90b7-5ff86457cf6d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/> <font size="11" isBold="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{valorBaseCalculo}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{valorBaseCalculo}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="523" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="b7842ed3-aa20-4fe9-996a-c8397aa66c40"/> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="634" y="1" width="67" height="16" isPrintWhenDetailOverflows="true" uuid="b7842ed3-aa20-4fe9-996a-c8397aa66c40"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/> <font size="11" isBold="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{isentas}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{isentas}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="417" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="36f5d507-0340-4c7e-b44b-5057c1e8bee6"/> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="492" y="1" width="66" height="16" isPrintWhenDetailOverflows="true" uuid="36f5d507-0340-4c7e-b44b-5057c1e8bee6"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/> <font size="11" isBold="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{valorAliquiotaICMS}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{valorAliquiotaICMS}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="576" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="c24531bc-66b7-459b-9c60-07bea18e98d9"/> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="701" y="1" width="66" height="16" isPrintWhenDetailOverflows="true" uuid="c24531bc-66b7-459b-9c60-07bea18e98d9"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/> <font size="11" isBold="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{outras}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{outras}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="629" y="0" width="57" height="17" isPrintWhenDetailOverflows="true" uuid="e2ad1400-e2c6-48b0-98c8-812d3c8f008d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorCancelado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="258" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="7f08e540-2cf9-4da3-b40a-fb7d5275751f"/> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="258" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="7f08e540-2cf9-4da3-b40a-fb7d5275751f"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none"> <textElement textAlignment="Center" verticalAlignment="Top" markup="none">
@ -292,15 +339,61 @@
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{numAIDF}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{numAIDF}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="767" y="1" width="66" height="16" isPrintWhenDetailOverflows="true" uuid="e2ad1400-e2c6-48b0-98c8-812d3c8f008d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorCancelado}]]></textFieldExpression>
</textField>
</band> </band>
</detail> </detail>
<lastPageFooter> <columnFooter>
<band height="18"> <band height="8"/>
<line> </columnFooter>
<reportElement mode="Transparent" x="0" y="0" width="857" height="1" uuid="1653e342-87ec-40f2-94ad-5d27b1020c3a"/> <pageFooter>
</line> <band height="8"/>
</pageFooter>
<summary>
<band height="33">
<textField pattern="¤ #,##0.00">
<reportElement x="634" y="0" width="67" height="26" uuid="dbf285d9-c756-4ee7-92fd-3f406c0d15fe"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ISENTAS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="3" y="0" width="96" height="26" isPrintWhenDetailOverflows="true" uuid="b21a7ce5-7a71-46fe-b541-2a6ea4aed506"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.totais}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="558" y="0" width="76" height="26" uuid="d9e6ccc3-bd50-4f69-aefc-038ead5d42a1"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ICMS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="701" y="0" width="66" height="26" uuid="0421c020-3268-4108-b906-74dc51966ceb"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_OUTRAS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="311" y="0" width="110" height="26" uuid="24994170-a664-4bbd-a1af-5adf2065859f"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_CONTABIL}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="492" y="0" width="66" height="26" uuid="1e6a74f4-2122-4488-b1c9-b5428257dd34"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ALIQUIOTA_ICMS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="421" y="0" width="71" height="26" uuid="dc457e5a-f70b-4ddd-a7f3-84203983597d"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_BASE_CALCULO}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="764" y="0" width="69" height="26" uuid="a1630e46-8a69-4338-a9d8-eef4f6237895"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_CANCELADO}]]></textFieldExpression>
</textField>
</band> </band>
</lastPageFooter> </summary>
<noData> <noData>
<band height="20"> <band height="20">
<textField> <textField>

View File

@ -0,0 +1,424 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioDocumentosFiscaisAgrupadoPorLocalidade" pageWidth="898" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="858" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="RelatorioDocumentosFiscaisAgrupadoPorLocalidade" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e">
<property name="ireport.zoom" value="1.6500000000000064"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<property name="collapseRowSpan" value="true"/>
<parameter name="DATA_INICIAL" class="java.util.Date">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="TITULO" class="java.lang.String"/>
<parameter name="EMPRESA" class="java.lang.String"/>
<parameter name="TIPO_LINHA" class="java.lang.String"/>
<parameter name="ESPECIE" class="java.lang.String"/>
<parameter name="TOTAL_VALOR_CONTABIL" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_BASE_CALCULO" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_ALIQUIOTA_ICMS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_ICMS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_ISENTAS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_OUTRAS" class="java.math.BigDecimal"/>
<parameter name="TOTAL_VALOR_CANCELADO" class="java.math.BigDecimal"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="numAIDF" class="java.lang.String"/>
<field name="formInicial" class="java.lang.String"/>
<field name="formFinal" class="java.lang.String"/>
<field name="serie" class="java.lang.String"/>
<field name="subSerie" class="java.lang.String"/>
<field name="valorContabil" class="java.math.BigDecimal"/>
<field name="valorBaseCalculo" class="java.math.BigDecimal"/>
<field name="valorAliquiotaICMS" class="java.math.BigDecimal"/>
<field name="valorICMS" class="java.math.BigDecimal"/>
<field name="outras" class="java.math.BigDecimal"/>
<field name="valorCancelado" class="java.math.BigDecimal"/>
<field name="nomeEstado" class="java.lang.String"/>
<field name="nomeOrigem" class="java.lang.String"/>
<field name="nomeDestino" class="java.lang.String"/>
<field name="codOrigem" class="java.lang.String"/>
<field name="codDestino" class="java.lang.String"/>
<field name="isentas" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="22">
<textField>
<reportElement x="231" y="0" width="231" height="20" uuid="652312bd-292a-424d-a234-5f157e3699c6"/>
<textElement textAlignment="Center">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="71">
<textField>
<reportElement x="291" y="34" width="63" height="17" uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.periodo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="632" y="6" width="79" height="20" uuid="66b2d0f6-2bf1-4bc7-9ec0-a34444e04d60"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="833" y="26" width="22" height="17" uuid="8ca68351-fc00-4f19-b94f-f2fd1f41964f"/>
<textElement textAlignment="Right">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="767" y="26" width="42" height="17" uuid="be1692e9-f130-4d08-9173-6ca3e4699030"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.pagina}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="711" y="6" width="144" height="20" uuid="6f671365-868e-41a6-81ee-a308d1d91e1d"/>
<textElement textAlignment="Left">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="809" y="26" width="24" height="17" uuid="7548d623-fb6c-48d4-b8b7-504f5437a79a"/>
<textElement textAlignment="Right">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="69" width="857" height="1" uuid="ee05e1fa-6963-4ff9-b3c8-c6cd1bb54e94"/>
</line>
<textField>
<reportElement x="65" y="31" width="166" height="20" uuid="4d4f219a-3607-4255-b549-fc5ada2ad59e"/>
<textElement verticalAlignment="Bottom">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="354" y="34" width="55" height="17" uuid="eed2f1a3-3688-4d0c-b0da-77ff99289c93"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="436" y="34" width="87" height="17" uuid="b151a471-e821-4b4f-b9a2-a5cc73d2e702"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="31" width="65" height="20" isPrintWhenDetailOverflows="true" uuid="e97938f6-a4ba-488b-b53c-50d9420422ac"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="409" y="34" width="27" height="17" uuid="f93fcaeb-bcdf-4227-82e9-5009b12f4c6f"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.a}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="51" width="65" height="16" isPrintWhenDetailOverflows="true" uuid="7fecbb95-44f8-4ef1-bc71-4f0049d0d8e4"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.tipoLinha}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="65" y="51" width="166" height="16" uuid="c18bd5b7-57c5-4014-8fcc-6a7cf55e8087"/>
<textElement verticalAlignment="Bottom">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$P{TIPO_LINHA}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="291" y="51" width="63" height="16" isPrintWhenDetailOverflows="true" uuid="ab76a186-78ed-4a3a-972f-268bc271edc7"/>
<textElement verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.especie}]]></textFieldExpression>
</textField>
<textField pattern="">
<reportElement x="354" y="50" width="169" height="17" uuid="6b1044a4-949d-4717-a1ff-dbfb0ebac687"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{ESPECIE}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="32" splitType="Stretch">
<line>
<reportElement mode="Transparent" x="0" y="30" width="857" height="1" uuid="ae94e51c-f84c-405c-a9c3-d8fd0c48f03a"/>
</line>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="2" width="47" height="26" isPrintWhenDetailOverflows="true" uuid="2cbc8ddc-38e5-4914-8189-5761ddeb2ce9"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.numAIDF}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="47" y="2" width="49" height="26" isPrintWhenDetailOverflows="true" uuid="7965e761-2e24-4f17-84eb-9431c98ce72c"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.formInicial}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="96" y="2" width="47" height="26" isPrintWhenDetailOverflows="true" uuid="bbaa5f53-76e0-491e-9145-e522122709e5"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.formFinal}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="143" y="2" width="42" height="26" isPrintWhenDetailOverflows="true" uuid="2b25ca5a-2c25-4c7d-87d1-5bfd205177a9"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.serie}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="185" y="2" width="46" height="26" isPrintWhenDetailOverflows="true" uuid="ab6b6770-67e8-4224-9304-8de30d3c1384"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.subSerie}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="231" y="2" width="70" height="26" isPrintWhenDetailOverflows="true" uuid="e3f4df4e-24a9-45b3-8ac3-f8b66d46a15f"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.valorContabil}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="301" y="2" width="89" height="26" isPrintWhenDetailOverflows="true" uuid="79775d53-3de4-4c0c-8ec7-3be13738dc14"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.valorBaseCalculo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="390" y="2" width="62" height="26" isPrintWhenDetailOverflows="true" uuid="746627ad-15b0-4435-93ce-6d370b75e594"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.valorAliquiotaICMS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="452" y="2" width="71" height="26" isPrintWhenDetailOverflows="true" uuid="0844b500-feab-477d-ade1-2d943491de32"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.valorICMS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="523" y="2" width="47" height="26" isPrintWhenDetailOverflows="true" uuid="3647e647-81bb-4098-afce-52d942daa341"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.isentas}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="570" y="2" width="62" height="26" isPrintWhenDetailOverflows="true" uuid="328a6678-fc02-4845-98e6-a3d3bfaa2c73"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.outras}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="632" y="2" width="79" height="26" isPrintWhenDetailOverflows="true" uuid="2cca17d2-47ba-4dba-a8c3-96e4f6d7deff"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.valorCancelado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="711" y="2" width="56" height="26" isPrintWhenDetailOverflows="true" uuid="cd5f476c-9e31-4d89-a23d-0b64befacacb"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.origem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="767" y="2" width="88" height="26" isPrintWhenDetailOverflows="true" uuid="b5390ba3-67ed-43f1-afd7-96be9bb7aec5"/>
<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="17" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="452" y="1" width="71" height="16" isPrintWhenDetailOverflows="true" uuid="784343f8-f7aa-4997-82e7-312878bd9a27"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorICMS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="47" y="0" width="49" height="17" isPrintWhenDetailOverflows="true" uuid="ad46494b-0240-46d1-a775-f91f0035d7f8"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{formInicial}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement mode="Transparent" x="231" y="0" width="70" height="17" isPrintWhenDetailOverflows="true" uuid="0ed9578b-73d5-4f51-b21c-07d9419bbc08"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorContabil}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="96" y="0" width="47" height="17" isPrintWhenDetailOverflows="true" uuid="1ed844e5-7aa4-49ee-8024-765e5ae49f74"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{formFinal}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement mode="Transparent" x="301" y="0" width="89" height="17" isPrintWhenDetailOverflows="true" uuid="92017408-1781-4e17-90b7-5ff86457cf6d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorBaseCalculo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement mode="Transparent" x="523" y="1" width="47" height="16" isPrintWhenDetailOverflows="true" uuid="b7842ed3-aa20-4fe9-996a-c8397aa66c40"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{isentas}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement mode="Transparent" x="390" y="1" width="62" height="16" isPrintWhenDetailOverflows="true" uuid="36f5d507-0340-4c7e-b44b-5057c1e8bee6"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorAliquiotaICMS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="570" y="1" width="62" height="16" isPrintWhenDetailOverflows="true" uuid="c24531bc-66b7-459b-9c60-07bea18e98d9"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{outras}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="185" y="0" width="46" height="17" isPrintWhenDetailOverflows="true" uuid="7f08e540-2cf9-4da3-b40a-fb7d5275751f"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{subSerie}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="143" y="0" width="42" height="17" isPrintWhenDetailOverflows="true" uuid="16c5bcd4-ac1c-4c49-b065-5794fb9c2e32"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{serie}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="47" height="17" isPrintWhenDetailOverflows="true" uuid="16f536ed-9001-4b34-85f4-a01198390b7d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{numAIDF}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="632" y="1" width="79" height="16" isPrintWhenDetailOverflows="true" uuid="e2ad1400-e2c6-48b0-98c8-812d3c8f008d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorCancelado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="767" y="1" width="88" height="16" isPrintWhenDetailOverflows="true" uuid="ab64adc6-7308-40a2-bc42-f9cbbe36f1c1"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{nomeDestino}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="711" y="1" width="56" height="16" isPrintWhenDetailOverflows="true" uuid="2d13bf77-fa2e-4333-9d3a-3661eb040ef8"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{nomeOrigem}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band height="32">
<textField pattern="¤ #,##0.00">
<reportElement x="231" y="3" width="70" height="26" uuid="834332cc-cdf3-4d63-871b-f9db0d9fcb06"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_CONTABIL}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="3" width="96" height="26" isPrintWhenDetailOverflows="true" uuid="1dc21d99-1a31-42ef-bf92-474546d012e8"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.totais}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="301" y="3" width="89" height="26" uuid="7775c93d-edeb-4950-9622-69d6bd111097"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_BASE_CALCULO}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="390" y="3" width="62" height="26" uuid="8846841b-4f78-4e64-8b66-e78ec61de45c"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ALIQUIOTA_ICMS}]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="2" width="855" height="1" uuid="870d28e1-ef95-4443-a22c-4d4f870486d2"/>
</line>
<textField pattern="¤ #,##0.00">
<reportElement x="452" y="3" width="71" height="26" uuid="71cc7c02-1c3d-4fa6-adb3-d3db06404619"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ICMS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="523" y="3" width="47" height="26" uuid="8b50a985-541a-4588-a08f-de8b76bafe47"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ISENTAS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="570" y="3" width="62" height="26" uuid="8e4e9057-d66a-44c3-accc-1a25b8d42a3b"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_OUTRAS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="632" y="0" width="69" height="29" uuid="c5245a48-70a4-4050-8da8-4a2d1b0a447d"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_CANCELADO}]]></textFieldExpression>
</textField>
</band>
</summary>
<noData>
<band height="20">
<textField>
<reportElement x="0" y="0" width="857" height="20" uuid="5a6c1b7b-2242-4cf1-b957-723b906ee620"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -26,6 +26,7 @@ import com.rjconsultores.ventaboletos.entidad.Aidf;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.Estado;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDocumentosFiscais; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDocumentosFiscais;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDocumentosFiscaisAgrupadoPorLocalidade;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.AidfService; import com.rjconsultores.ventaboletos.service.AidfService;
import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EmpresaService;
@ -33,8 +34,6 @@ import com.rjconsultores.ventaboletos.service.EstadoService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
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.render.RenderEstadoUf;
@Controller("relatorioDocumentosFiscaisController") @Controller("relatorioDocumentosFiscaisController")
@Scope("prototype") @Scope("prototype")
@ -62,6 +61,7 @@ public class RelatorioDocumentosFiscaisController extends MyGenericForwardCompos
private List<Aidf> aidfList; private List<Aidf> aidfList;
private Checkbox ckbSomenteCancelado; private Checkbox ckbSomenteCancelado;
private Radiogroup rdgInterestadualMunicial; private Radiogroup rdgInterestadualMunicial;
private Radiogroup rdTipoAgrupamento;
@Autowired @Autowired
private AidfService aidfService; private AidfService aidfService;
private List<Aidf> lsAidf; private List<Aidf> lsAidf;
@ -92,19 +92,28 @@ public class RelatorioDocumentosFiscaisController extends MyGenericForwardCompos
Radio radio = rdgInterestadualMunicial.getSelectedItem(); Radio radio = rdgInterestadualMunicial.getSelectedItem();
String tipoLinha; String tipoLinha;
if (radio.getValue().equals("1")) { if (radio.getValue().equals("0")) {
tipoLinha = "INTERMUNICIPAL"; tipoLinha = "INTERMUNICIPAL";
} } else if (radio.getValue().equals("1")) {
if (radio.getValue().equals("2")) {
tipoLinha = "INTERESTADUAL"; tipoLinha = "INTERESTADUAL";
} else { } else {
tipoLinha = "TODOS"; tipoLinha = "TODOS";
} }
Radio rdEspecie = rdgInterestadualMunicial.getSelectedItem();
String especie;
if (rdEspecie.getValue().equals("0")) {
especie = "Bilhetes BPR";
} else {
especie = "Excesso de Bagagem(EB)";
}
parametros.put("AIDF", aidf); parametros.put("AIDF", aidf);
parametros.put("ESTADO_ID", estado.getEstadoId()); parametros.put("ESTADO_ID", estado.getEstadoId());
parametros.put("ESTADO", estado.getNombestado());
parametros.put("TIPO_LINHA", tipoLinha); parametros.put("TIPO_LINHA", tipoLinha);
parametros.put("SOMENTE_CANCELADO", somenteCancelado); parametros.put("SOMENTE_CANCELADO", somenteCancelado);
parametros.put("ESPECIE", especie);
if (empresa != null) { if (empresa != null) {
parametros.put("EMPRESA", empresa.getNombempresa()); parametros.put("EMPRESA", empresa.getNombempresa());
parametros.put("EMPRESA_ID", empresa.getEmpresaId()); parametros.put("EMPRESA_ID", empresa.getEmpresaId());
@ -112,9 +121,12 @@ public class RelatorioDocumentosFiscaisController extends MyGenericForwardCompos
parametros.put("EMPRESA", "TODOS"); parametros.put("EMPRESA", "TODOS");
} }
parametros.put("TITULO", Labels.getLabel("relatorioDocumentosFiscaisController.window.title")); parametros.put("TITULO", Labels.getLabel("relatorioDocumentosFiscaisController.window.title"));
Radio radioAgrupamento = rdTipoAgrupamento.getSelectedItem();
relatorio = new RelatorioDocumentosFiscais(parametros, dataSourceRead.getConnection()); if (radioAgrupamento.getValue().equals("0")) {
relatorio = new RelatorioDocumentosFiscais(parametros, dataSourceRead.getConnection());
} else {
relatorio = new RelatorioDocumentosFiscaisAgrupadoPorLocalidade(parametros, dataSourceRead.getConnection());
}
Map args = new HashMap(); Map args = new HashMap();
args.put("relatorio", relatorio); args.put("relatorio", relatorio);

View File

@ -40,9 +40,9 @@
value="${c:l('relatorioDocumentosFiscaisController.lbAgruparPor.label')}" /> value="${c:l('relatorioDocumentosFiscaisController.lbAgruparPor.label')}" />
<radiogroup Id="rdTipoAgrupamento"> <radiogroup Id="rdTipoAgrupamento">
<hbox align="center"> <hbox align="center">
<radio Id="rdUF" value="2" <radio Id="rdUF" value="0" checked="true"
label="${c:l('relatorioDocumentosFiscaisController.lbUF.label')}" /> label="${c:l('relatorioDocumentosFiscaisController.lbUF.label')}" />
<radio Id="rdLocalidade" value="0" <radio Id="rdLocalidade" value="1"
label="${c:l('relatorioDocumentosFiscaisController.lbLocalidade.label')}" /> label="${c:l('relatorioDocumentosFiscaisController.lbLocalidade.label')}" />
</hbox> </hbox>
</radiogroup> </radiogroup>
@ -52,9 +52,9 @@
value="${c:l('relatorioDocumentosFiscaisController.lbTrazerDados.label')}" /> value="${c:l('relatorioDocumentosFiscaisController.lbTrazerDados.label')}" />
<radiogroup Id="rdgInterestadualMunicial"> <radiogroup Id="rdgInterestadualMunicial">
<hbox align="center"> <hbox align="center">
<radio Id="rdInterestadual" value="1" <radio Id="rdInterestadual" value="0"
label="${c:l('relatorioDocumentosFiscaisController.lbInterestadual.label')}" /> label="${c:l('relatorioDocumentosFiscaisController.lbInterestadual.label')}" />
<radio Id="rdIntermunicipal" value="2" <radio Id="rdIntermunicipal" value="1"
label="${c:l('relatorioDocumentosFiscaisController.lbIntermunicipal.label')}" /> label="${c:l('relatorioDocumentosFiscaisController.lbIntermunicipal.label')}" />
<radio <radio
Id="rdTodosIntermunicipalInterestadual" value="0" checked="true" Id="rdTodosIntermunicipalInterestadual" value="0" checked="true"