fixes bug#12811

dev:julio
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@87536 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2018-11-29 21:32:06 +00:00
parent 7b8346afcb
commit 62b4a88a04
10 changed files with 294 additions and 178 deletions

View File

@ -156,7 +156,7 @@ public class RelatorioDocumentosFiscais extends Relatorio {
sql.append("FROM ");
sql.append(" (SELECT DISTINCT ");
sql.append(" c.caja_id, ");
sql.append(" a.ACFISCAL AS numAidf, ");
sql.append(" a.docfiscal AS numAidf, ");
sql.append(" to_number(c.numfoliopreimpreso) as folio, ");
sql.append(" a.serie AS serie, ");
sql.append(" a.subserie AS subserie, ");
@ -174,7 +174,7 @@ public class RelatorioDocumentosFiscais extends Relatorio {
sql.append(" eai.NOMBESTADO AS nomeEstado, ");
sql.append(" coalesce(pos.DESCPARADA, po.DESCPARADA) AS origem, ");
sql.append(" coalesce(pds.DESCPARADA, 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(" CASE WHEN((coalesce(eai.cveestado, eos.cveestado, eo.cveestado)) = (coalesce(eds.cveestado, ed.cveestado))) THEN 0 ELSE 1 END AS isInterEstadual, ");
sql.append(" COALESCE((IMPORTETAXAEMBARQUE + IMPORTEPEDAGIO + IMPORTESEGURO),0) AS vlrisento ");
sql.append(" FROM caja c ");
sql.append(" INNER JOIN aidf a ON a.aidf_id = c.aidf_id ");
@ -196,13 +196,13 @@ public class RelatorioDocumentosFiscais extends Relatorio {
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(" and ei.estado_id = a.estado_id and ei.activo = 1 ");
sql.append(" and ei.estado_id = eai.estado_id and ei.activo = 1 ");
sql.append(" WHERE c.feccreacion between :DATA_INICIAL and :DATA_FINAL ");
sql.append(" AND e.empresa_id = " + empresaId + " ");
sql.append(" AND a.aidfesp_id = 1 ");
sql.append(somenteCancelado == true ? " AND c.INDCANCELACION = 1 " : " ");
sql.append(aidf != null ? " AND a.AIDF_ID = " + aidf.getAidfId() + " " : " ");
sql.append(estadoId != null ? " AND a.ESTADO_ID IN (" + estadoId + ") " : " ");
sql.append(somenteCancelado == true ? " AND c.indcancelacion = 1 " : " ");
sql.append(aidf != null ? " AND a.aidf_id = " + aidf.getAidfId() + " " : " ");
sql.append(estadoId != null && !isEstadoTodos(estadoId) ? " AND eai.estado_id IN (" + estadoId + ") " : " ");
sql.append(" ORDER BY a.ACFISCAL, to_number(c.numfoliopreimpreso) ");
sql.append(" ) tabela ");
sql.append(tipoLinha.equals(" INTERMUNICIPAL") ? " where tabela.isInterEstadual = 1 " : tipoLinha.equals("INTERESTADUAL") ? " where tabela.isInterEstadual = 0 " : " ");
@ -229,12 +229,12 @@ public class RelatorioDocumentosFiscais extends Relatorio {
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(" coalesce(sum(tabela.qntancelados),0) AS valorCancelado, ");
sql.append(" sum(tabela.outras) AS outras, ");
sql.append(" sum(tabela.vlrisento) AS isentas ");
sql.append("FROM ");
sql.append(" (SELECT DISTINCT ");
sql.append(" aidf.DOCFISCAL, ");
sql.append(" a.docfiscal, ");
sql.append(" aidf.forminicial, ");
sql.append(" aidf.formfinal, ");
sql.append(" coalesce(cdv.NUMSERIEPREIMPRESA, 'X') AS numAidf, ");
@ -244,6 +244,7 @@ public class RelatorioDocumentosFiscais extends Relatorio {
sql.append(" case when cdv.precio < 0 then 31 else null end AS motivoCancelacion, ");
sql.append(" cdv.precio AS tarifa, ");
sql.append(" cdv.precio as valor, ");
sql.append(" CASE WHEN cdv.precio < 0 THEN 1 ELSE 0 END AS qntancelados, ");
sql.append(" ed.tributacaoimportacao AS valorAliquiotaICMS, ");
sql.append(" CASE WHEN cdv.precio >= 0 THEN cdv.precio ELSE 0 END AS valorContabil, ");
sql.append(" CASE WHEN cdv.precio < 0 THEN cdv.precio ELSE 0 END AS valorCancelado, ");
@ -260,17 +261,17 @@ public class RelatorioDocumentosFiscais extends Relatorio {
sql.append("from evento_extra ee ");
sql.append(" join caja_diversos cdv on cdv.eventoextra_id = ee.eventoextra_id ");
sql.append(" join aidf aidf on aidf.serie = cdv.numseriepreimpresa and cdv.numfoliopreimpreso between aidf.forminicial and aidf.formfinal ");
sql.append(" LEFT JOIN estado eai ON aidf.estado_id = eai.estado_id ");
sql.append(" left join estado eai ON aidf.estado_id = eai.estado_id ");
sql.append(" join punto_venta pv on pv.puntoventa_id = cdv.puntoventa_id ");
sql.append(" join parada pp on pp.parada_id = pv.parada_id ");
sql.append(" join ciudad cc on cc.ciudad_id = pp.ciudad_id ");
sql.append(" join estado es on es.estado_id = cc.estado_id ");
sql.append(" join empresa_imposto ed ON ed.empresa_id = ee.empresa_id and es.estado_id = ed.estado_id and ed.activo = 1 ");
sql.append(" join empresa_imposto ed ON ed.empresa_id = ee.empresa_id and ed.estado_id = coalesce(aidf.estado_id, es.estado_id) and ed.activo = 1 ");
sql.append("where ee.tipoeventoextra_id in (1,81,82) ");
sql.append(" and ee.fechoringreso between :DATA_INICIAL and :DATA_FINAL ");
sql.append(" and aidf.aidfesp_id = 2 ");
sql.append(" and ee.empresa_id = " + empresaId + " ");
sql.append(" and eai.estado_id IN (" + estadoId + ") ");
sql.append(estadoId != null && !isEstadoTodos(estadoId) ? " and eai.estado_id IN (" + estadoId + ") " : "");
sql.append(aidf != null ? " and aidf.aidf_id = " + aidf.getAidfId() + " " : " ");
// sql.append(somenteCancelado == true ? " AND c.INDCANCELACION = 1" : " ");
sql.append(" )tabela ");
@ -288,4 +289,10 @@ public class RelatorioDocumentosFiscais extends Relatorio {
return sql.toString();
}
private boolean isEstadoTodos(Integer estadoId) {
if (estadoId == -1 || estadoId == null)
return true;
else
return false;
}
}

View File

@ -42,8 +42,15 @@ public class RelatorioDocumentosFiscaisAgrupadoPorLocalidade extends Relatorio {
String tipoLinha = (String) parametros.get("TIPO_LINHA");
Aidf aidf = (Aidf) parametros.get("AIDF");
Boolean somenteCancelado = (Boolean) parametros.get("SOMENTE_CANCELADO");
String especie = (String) parametros.get("ESPECIE");
Integer estadoId = (Integer) parametros.get("ESTADO_ID");
String sql = getSql(empresaId, agencia, somenteCancelado, tipoLinha, aidf);
String sql = null;
if (especie.equals("Bilhetes BPR")) {
sql = getSqlBPR(empresaId, agencia, somenteCancelado, tipoLinha, aidf, estadoId);
} else {
sql = getSqlExcessoBagagem(empresaId, agencia, somenteCancelado, tipoLinha, aidf, estadoId);
}
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
@ -67,8 +74,13 @@ public class RelatorioDocumentosFiscaisAgrupadoPorLocalidade extends Relatorio {
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"));
BigDecimal formInicial = (BigDecimal) rset.getObject("formInicial");
bean.setFormInicial(formInicial.toString());
BigDecimal formFinal = (BigDecimal) rset.getObject("formFinal");
bean.setFormFinal(formFinal.toString());
bean.setSerie((String) rset.getObject("serie"));
bean.setSubSerie((String) rset.getObject("subSerie"));
bean.setValorContabil((BigDecimal) rset.getObject("valorContabil"));
@ -78,10 +90,13 @@ public class RelatorioDocumentosFiscaisAgrupadoPorLocalidade extends Relatorio {
bean.setOutras((BigDecimal) rset.getObject("outras"));
bean.setValorCancelado((BigDecimal) rset.getObject("valorCancelado"));
bean.setNomeEstado((String) rset.getObject("nomeEstado"));
if (especie.equals("Bilhetes BPR")) {
bean.setNomeOrigem((String) rset.getObject("nomeOrigem"));
bean.setNomeDestino((String) rset.getObject("nomeDestino"));
lsDadosRelatorio.add(bean);
}
lsDadosRelatorio.add(bean);
}
if (lsDadosRelatorio.size() > 0) {
@ -123,43 +138,51 @@ public class RelatorioDocumentosFiscaisAgrupadoPorLocalidade extends Relatorio {
this.lsDadosRelatorio = lsDadosRelatorio;
}
private String getSql(Integer empresaId, String agencia, Boolean somenteCancelado, String tipoLinha, Aidf aidf) {
private String getSqlBPR(Integer empresaId, String agencia, Boolean somenteCancelado, String tipoLinha, Aidf aidf, Integer estadoId) {
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(" min(tabela.folio) AS formInicial, ");
sql.append(" max(tabela.folio) 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(" tabela.valorAliquiotaICMS AS valorAliquiotaICMS, ");
sql.append(" SUM(tabela.valorICMS) AS valorICMS, ");
sql.append(" sum(tabela.qntancelados) AS valorCancelado, ");
sql.append(" SUM(tabela.outras) AS outras, ");
sql.append(" sum(tabela.vlrisento) AS isentas ");
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(" (SELECT DISTINCT ");
sql.append(" c.caja_id, ");
sql.append(" a.docfiscal AS numAidf, ");
sql.append(" to_number(c.numfoliopreimpreso) as folio, ");
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(" ei.tributacaoimportacao AS valorAliquiotaICMS, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NOT NULL THEN 1 ELSE 0 END AS qntancelados, ");
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(" (coalesce(ei.PORCREDBASEICMS, 0) / 100.0) AS redBaseCalcIcms, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO - (c.PRECIOPAGADO * (coalesce(ei.PORCREDBASEICMS, 0) / 100.0) ) ELSE 0 END AS valorBaseCalculo, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN ((c.PRECIOPAGADO - (c.PRECIOPAGADO * (coalesce(ei.PORCREDBASEICMS, 0) / 100.0) )) * ei.TRIBUTACAOIMPORTACAO) / 100 ELSE 0 END AS valorICMS, ");
sql.append(" CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN c.PRECIOPAGADO - (c.PRECIOPAGADO - (c.PRECIOPAGADO * (coalesce(ei.PORCREDBASEICMS, 0) / 100.0) )) ELSE 0 END AS outras, ");
sql.append(" eai.estado_id AS estadoId, ");
sql.append(" eai.NOMBESTADO AS nomeEstado, ");
sql.append(" coalesce(pos.DESCPARADA, po.DESCPARADA) AS origem, ");
sql.append(" coalesce(pds.DESCPARADA, pd.DESCPARADA) AS destino, ");
sql.append(" CASE WHEN((coalesce(eai.cveestado, eos.cveestado, eo.cveestado)) = (coalesce(eds.cveestado, ed.cveestado))) THEN 0 ELSE 1 END AS isInterEstadual, ");
sql.append(" COALESCE((IMPORTETAXAEMBARQUE + IMPORTEPEDAGIO + IMPORTESEGURO),0) AS vlrisento ");
sql.append(" FROM caja c ");
sql.append(" INNER JOIN aidf a ON a.aidf_id = c.aidf_id ");
sql.append(" LEFT JOIN estado eai ON a.estado_id = eai.estado_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 ");
@ -168,11 +191,8 @@ public class RelatorioDocumentosFiscaisAgrupadoPorLocalidade extends Relatorio {
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 alias_servico s ON s.origen_id = c.origen_id AND s.destino_id = c.destino_id ");
sql.append(" AND (s.corrida_id = c.corrida_id OR s.corrida_id IS NULL) AND s.ruta_id = c.ruta_id AND s.activo = 1 ");
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 ");
@ -180,19 +200,105 @@ public class RelatorioDocumentosFiscaisAgrupadoPorLocalidade extends Relatorio {
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(" and ei.estado_id = eai.estado_id and ei.activo = 1 ");
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(aidf != null ? " AND a.AIDF_ID = " + aidf.getAidfId() + " " : " ");
sql.append(")TABELA ");
sql.append(" AND e.empresa_id = " + empresaId + " ");
sql.append(" AND a.aidfesp_id = 1 ");
sql.append(somenteCancelado == true ? " AND c.indcancelacion = 1" : " ");
sql.append(aidf != null ? " AND a.aidf_id = " + aidf.getAidfId() + " " : " ");
sql.append(estadoId != null && !isEstadoTodos(estadoId) ? " and eai.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("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");
sql.append("GROUP BY tabela.numAidf, ");
sql.append(" tabela.serie, ");
sql.append(" tabela.subserie, ");
sql.append(" tabela.nomeestado, ");
sql.append(" tabela.origem, ");
sql.append(" tabela.destino, ");
sql.append(" tabela.valoraliquiotaicms ");
sql.append("ORDER BY tabela.nomeEstado, tabela.numAidf, tabela.origem, tabela.destino ");
return sql.toString();
}
private String getSqlExcessoBagagem(Integer empresaId, String agencia, Boolean somenteCancelado, String tipoLinha, Aidf aidf, Integer estadoId) {
StringBuilder sql = new StringBuilder();
sql.append("SELECT tabela.docfiscal AS numAidf, ");
sql.append(" to_number(tabela.forminicial) AS formInicial, ");
sql.append(" to_number(tabela.formfinal) AS formFinal, ");
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(" sum(valorBaseCalculo) AS valorBaseCalculo, ");
sql.append(" tabela.valorAliquiotaICMS AS valorAliquiotaICMS, ");
sql.append(" sum(tabela.valorICMS) AS valorICMS, ");
sql.append(" coalesce(sum(tabela.qntancelados),0) AS valorCancelado, ");
sql.append(" sum(tabela.outras) AS outras, ");
sql.append(" sum(tabela.vlrisento) AS isentas ");
sql.append("FROM ");
sql.append(" (SELECT DISTINCT ");
sql.append(" aidf.docfiscal, ");
sql.append(" aidf.forminicial, ");
sql.append(" aidf.formfinal, ");
sql.append(" coalesce(cdv.NUMSERIEPREIMPRESA, 'X') AS numAidf, ");
sql.append(" aidf.serie AS serie, ");
sql.append(" aidf.subserie AS subserie, ");
sql.append(" coalesce(cdv.NUMFOLIOPREIMPRESO, '0') AS folio, ");
sql.append(" case when cdv.precio < 0 then 31 else null end AS motivoCancelacion, ");
sql.append(" cdv.precio AS tarifa, ");
sql.append(" cdv.precio as valor, ");
sql.append(" CASE WHEN cdv.precio < 0 THEN 1 ELSE 0 END AS qntancelados, ");
sql.append(" ed.tributacaoimportacao AS valorAliquiotaICMS, ");
sql.append(" CASE WHEN cdv.precio >= 0 THEN cdv.precio ELSE 0 END AS valorContabil, ");
sql.append(" CASE WHEN cdv.precio < 0 THEN cdv.precio ELSE 0 END AS valorCancelado, ");
sql.append(" COALESCE(ed.PORCREDBASEICMS / 100,0) AS redBaseCalcIcms, ");
sql.append(" CASE WHEN cdv.precio >= 0 THEN cdv.precio - (cdv.precio * COALESCE(ed.PORCREDBASEICMS / 100,0)) ELSE 0 END AS valorBaseCalculo, ");
sql.append(" CASE WHEN cdv.precio >= 0 THEN ((cdv.precio * ((ed.TRIBUTACAOIMPORTACAO - (COALESCE(ed.PORCREDBASEICMS * ed.TRIBUTACAOIMPORTACAO /100,0))))) / 100) ELSE 0 END AS valorICMS, ");
sql.append(" CASE WHEN cdv.precio >= 0 THEN cdv.precio - (cdv.precio - (cdv.precio * COALESCE(ed.PORCREDBASEICMS / 100,0))) ELSE 0 END AS outras, ");
sql.append(" eai.estado_id AS estadoId, ");
sql.append(" eai.NOMBESTADO AS nomeEstado, ");
sql.append(" '' AS origem, ");
sql.append(" '' AS destino, ");
sql.append(" 0 AS isInterEstadual, ");
sql.append(" 0 AS vlrisento ");
sql.append("from evento_extra ee ");
sql.append(" join caja_diversos cdv on cdv.eventoextra_id = ee.eventoextra_id ");
sql.append(" join aidf aidf on aidf.serie = cdv.numseriepreimpresa and cdv.numfoliopreimpreso between aidf.forminicial and aidf.formfinal ");
sql.append(" left join estado eai ON aidf.estado_id = eai.estado_id ");
sql.append(" join punto_venta pv on pv.puntoventa_id = cdv.puntoventa_id ");
sql.append(" join parada pp on pp.parada_id = pv.parada_id ");
sql.append(" join ciudad cc on cc.ciudad_id = pp.ciudad_id ");
sql.append(" join estado es on es.estado_id = cc.estado_id ");
sql.append(" join empresa_imposto ed ON ed.empresa_id = ee.empresa_id and ed.estado_id = coalesce(aidf.estado_id, es.estado_id) and ed.activo = 1 ");
sql.append("where ee.tipoeventoextra_id in (1,81,82) ");
sql.append(" and ee.fechoringreso between :DATA_INICIAL and :DATA_FINAL ");
sql.append(" and aidf.aidfesp_id = 2 ");
sql.append(" and ee.empresa_id = " + empresaId + " ");
sql.append(estadoId != null && !isEstadoTodos(estadoId) ? " and eai.estado_id IN (" + estadoId + ") " : "");
sql.append(aidf != null ? " and aidf.aidf_id = " + aidf.getAidfId() + " " : " ");
// sql.append(somenteCancelado == true ? " AND c.INDCANCELACION = 1" : " ");
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, ");
sql.append(" tabela.serie, ");
sql.append(" tabela.subSerie, ");
sql.append(" tabela.nomeEstado, ");
sql.append(" tabela.valorAliquiotaICMS, ");
sql.append(" tabela.docfiscal, ");
sql.append(" tabela.forminicial, ");
sql.append(" tabela.formfinal ");
sql.append("ORDER BY tabela.nomeEstado, tabela.numAidf ");
return sql.toString();
}
private boolean isEstadoTodos(Integer estadoId) {
if (estadoId == -1 || estadoId == null)
return true;
else
return false;
}
}

View File

@ -3,26 +3,27 @@ msg.noData=N
#Labels cabeçalho
cabecalho.nome=Relatório Documentos Fiscais
cabecalho.relatorio=Relatório
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.especie=Espécie:
label.empresa=Empresa:
label.formInicial=Inicial
label.formFinal=Final
label.formInicial=Inicial
label.formFinal=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.valorBaseCalculo=Base Cálc.
label.valorAliquiotaICMS=ICMS
label.valorICMS=Valor ICMS
label.isentas=Isentas
label.outras=Outras
label.valorCancelado=Qtd. Cancec
label.valorCancelado=Cant
label.origem=Origem
label.destino=Destino
label.estado=Estado
header.data=Período
header.a=a
header.tipoLinha=Tipo Linha
label.estado=Estado:
label.totais=Totais:

View File

@ -11,20 +11,19 @@ label.periodo=Per
label.UF=UF
label.especie=Espécie:
label.empresa=Empresa:
label.formInicial=Inicial
label.formFinal=Final
label.formInicial=Inicial
label.formFinal=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.valorBaseCalculo=Base Cálc.
label.valorAliquiotaICMS=ICMS
label.valorICMS=Valor ICMS
label.isentas=Isentas
label.outras=Outras
label.valorCancelado=Qtd. Cancec
label.valorCancelado=Cant
label.origem=Origem
label.destino=Destino
label.estado=Estado:
label.totais=Totais:

View File

@ -1,7 +1,7 @@
<?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="RelatorioDocumentosFiscais" pageWidth="874" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="834" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="RelatorioDocumentosFiscais" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e">
<property name="ireport.zoom" value="1.3636363636363678"/>
<property name="ireport.x" value="192"/>
<property name="ireport.x" value="402"/>
<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"/>
@ -113,11 +113,11 @@
<textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="311" y="26" width="53" height="17" uuid="eed2f1a3-3688-4d0c-b0da-77ff99289c93"/>
<reportElement x="311" y="26" width="82" height="17" uuid="eed2f1a3-3688-4d0c-b0da-77ff99289c93"/>
<textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="364" y="26" width="57" height="17" uuid="b151a471-e821-4b4f-b9a2-a5cc73d2e702"/>
<reportElement x="393" y="26" width="87" height="17" uuid="b151a471-e821-4b4f-b9a2-a5cc73d2e702"/>
<textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
@ -149,7 +149,7 @@
<textFieldExpression><![CDATA[$R{label.especie}]]></textFieldExpression>
</textField>
<textField pattern="">
<reportElement x="311" y="44" width="110" height="20" uuid="0d0d4e1d-f34f-4846-8d74-1846a69ec3a0"/>
<reportElement x="311" y="44" width="169" height="20" uuid="0d0d4e1d-f34f-4846-8d74-1846a69ec3a0"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$P{ESPECIE}]]></textFieldExpression>
</textField>
@ -262,87 +262,87 @@
</columnHeader>
<detail>
<band height="17" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<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">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorICMS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="99" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="ad46494b-0240-46d1-a775-f91f0035d7f8"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{formInicial}]]></textFieldExpression>
</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="110" height="17" isPrintWhenDetailOverflows="true" uuid="0ed9578b-73d5-4f51-b21c-07d9419bbc08"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
<textElement 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="152" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="1ed844e5-7aa4-49ee-8024-765e5ae49f74"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{formFinal}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<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">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorBaseCalculo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="false">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="false">
<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">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{isentas} == null ? BigDecimal.ZERO :$F{isentas}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<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">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorAliquiotaICMS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<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">
<font size="11" isBold="false"/>
<textElement 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="258" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="7f08e540-2cf9-4da3-b40a-fb7d5275751f"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{subSerie}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="205" y="0" width="53" height="17" isPrintWhenDetailOverflows="true" uuid="16c5bcd4-ac1c-4c49-b065-5794fb9c2e32"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
<textElement 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="99" height="17" isPrintWhenDetailOverflows="true" uuid="16f536ed-9001-4b34-85f4-a01198390b7d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="11" isBold="false"/>
<textElement verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{numAIDF}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0" 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"/>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorCancelado}]]></textFieldExpression>
</textField>
@ -356,9 +356,8 @@
</pageFooter>
<summary>
<band height="30">
<textField pattern="¤ #,##0.00">
<textField pattern="#,##0.00">
<reportElement x="634" y="0" width="67" height="26" uuid="dbf285d9-c756-4ee7-92fd-3f406c0d15fe"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ISENTAS}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
@ -368,27 +367,23 @@
</textElement>
<textFieldExpression><![CDATA[$R{label.totais}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<textField pattern="#,##0.00">
<reportElement x="558" y="0" width="76" height="26" uuid="d9e6ccc3-bd50-4f69-aefc-038ead5d42a1"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_ICMS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<textField pattern="#,##0.00">
<reportElement x="701" y="0" width="66" height="26" uuid="0421c020-3268-4108-b906-74dc51966ceb"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_OUTRAS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<textField pattern="#,##0.00">
<reportElement x="311" y="0" width="110" height="26" uuid="24994170-a664-4bbd-a1af-5adf2065859f"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_CONTABIL}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<textField pattern="#,##0.00">
<reportElement x="421" y="0" width="71" height="26" uuid="dc457e5a-f70b-4ddd-a7f3-84203983597d"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_BASE_CALCULO}]]></textFieldExpression>
</textField>
<textField pattern="###0">
<textField pattern="#,##0">
<reportElement x="767" y="0" width="66" height="26" uuid="a1630e46-8a69-4338-a9d8-eef4f6237895"/>
<textElement textAlignment="Center" verticalAlignment="Top"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_CANCELADO}]]></textFieldExpression>

View File

@ -1,7 +1,7 @@
<?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.x" value="697"/>
<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"/>
@ -58,7 +58,7 @@
</band>
</title>
<pageHeader>
<band height="71">
<band height="74">
<textField>
<reportElement x="291" y="34" width="63" height="17" uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716"/>
<textElement verticalAlignment="Middle">
@ -164,113 +164,113 @@
</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>
<band height="26" splitType="Stretch">
<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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="2" width="59" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="59" y="2" width="42" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="101" y="2" width="42" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="143" y="2" width="42" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="185" y="2" width="46" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="231" y="2" width="70" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="301" y="2" width="89" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="390" y="2" width="62" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="452" y="2" width="71" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="523" y="2" width="47" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="570" y="2" width="62" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="632" y="2" width="29" height="17" 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"/>
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="759" y="2" width="99" height="17" 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>
<line>
<reportElement x="0" y="23" width="858" height="1" uuid="305304b9-b2a6-4a2c-8fb3-73cd47d6db0a"/>
</line>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" mode="Transparent" x="661" y="2" width="98" height="17" 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>
</band>
</columnHeader>
<detail>
<band height="17" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<band height="18" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="#,##0.00" 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"/>
@ -278,13 +278,13 @@
<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"/>
<reportElement stretchType="RelativeToTallestObject" x="59" y="0" width="42" 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">
<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"/>
@ -292,34 +292,34 @@
<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"/>
<reportElement stretchType="RelativeToTallestObject" x="101" y="0" width="42" 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">
<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">
<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">
<textField isStretchWithOverflow="true" pattern="#,##0" 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">
<textField isStretchWithOverflow="true" pattern="#,##0.00" 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"/>
@ -333,7 +333,7 @@
</textElement>
<textFieldExpression><![CDATA[$F{subSerie}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<textField isStretchWithOverflow="true" pattern="" 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"/>
@ -341,30 +341,30 @@
<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"/>
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="59" height="17" isPrintWhenDetailOverflows="true" uuid="16f536ed-9001-4b34-85f4-a01198390b7d"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
<font size="9" 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">
<textField isStretchWithOverflow="true" pattern="#,##0" isBlankWhenNull="false">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="632" y="1" width="29" height="16" isPrintWhenDetailOverflows="true" uuid="e2ad1400-e2c6-48b0-98c8-812d3c8f008d"/>
<textElement 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"/>
<reportElement mode="Transparent" x="759" y="1" width="99" height="16" isPrintWhenDetailOverflows="true" uuid="ab64adc6-7308-40a2-bc42-f9cbbe36f1c1"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
<font size="9" 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"/>
<reportElement mode="Transparent" x="661" y="1" width="98" height="16" isPrintWhenDetailOverflows="true" uuid="2d13bf77-fa2e-4333-9d3a-3661eb040ef8"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font size="10" isBold="false"/>
<font size="9" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{nomeOrigem}]]></textFieldExpression>
</textField>
@ -372,7 +372,7 @@
</detail>
<summary>
<band height="32">
<textField pattern="¤ #,##0.00">
<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>
@ -383,32 +383,32 @@
</textElement>
<textFieldExpression><![CDATA[$R{label.totais}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<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">
<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">
<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">
<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">
<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"/>
<textField pattern="#,##0.00">
<reportElement x="632" y="0" width="29" height="29" uuid="c5245a48-70a4-4050-8da8-4a2d1b0a447d"/>
<textElement verticalAlignment="Top"/>
<textFieldExpression><![CDATA[$P{TOTAL_VALOR_CANCELADO}]]></textFieldExpression>
</textField>
</band>

View File

@ -1,12 +1,14 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
@ -71,7 +73,13 @@ public class RelatorioDocumentosFiscaisController extends MyGenericForwardCompos
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
lsEmpresa = empresaService.obtenerTodos();
lsEstado = estadoService.obtenerTodos();
lsEstado = new ArrayList<Estado>();
Estado estadoTodos = new Estado(-1);
estadoTodos.setNombestado("TODOS");
lsEstado.add(estadoTodos);
lsEstado.addAll(estadoService.obtenerTodos());
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@ -95,12 +103,12 @@ public class RelatorioDocumentosFiscaisController extends MyGenericForwardCompos
Boolean somenteCancelado = ckbSomenteCancelado.isChecked();
Radio radio = rdgInterestadualMunicial.getSelectedItem();
String tipoLinha;
String tipoLinha = StringUtils.EMPTY;
if (radio.getValue().equals("0")) {
tipoLinha = "INTERMUNICIPAL";
} else if (radio.getValue().equals("1")) {
tipoLinha = "INTERESTADUAL";
} else {
} else if (radio.getValue().equals("2")) {
tipoLinha = "TODOS";
}

View File

@ -57,7 +57,7 @@
<radio Id="rdIntermunicipal" value="1"
label="${c:l('relatorioDocumentosFiscaisController.lbIntermunicipal.label')}" />
<radio
Id="rdTodosIntermunicipalInterestadual" value="0" checked="true"
Id="rdTodosIntermunicipalInterestadual" value="2" checked="true"
label="${c:l('relatorioDocumentosFiscaisController.lbTodosIntermunicipalInterestadual.label')}" />
</hbox>
</radiogroup>