fixes bug #10474
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@77994 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
78082cdfa7
commit
9eb985c105
|
@ -90,7 +90,7 @@ public class RelatorioFolioRmd extends Relatorio {
|
|||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("select f.folio as foliormd, ");
|
||||
sql.append(" case when f.indcancelacion = 1 then 'CANCELADO' else 'IMPRESSO' end as status, ");
|
||||
sql.append(" case when f.indcancelacion = 1 then 'CANCELADO' when f.indinactivo = 1 then 'INATIVO' else 'IMPRESSO' end as status, ");
|
||||
sql.append(" to_char(f.fechorfolio, 'yyyymmdd') as fechorfolio, ");
|
||||
sql.append(" e.nombempresa as empresa, ");
|
||||
sql.append(" eo.cveestado as uf, ");
|
||||
|
@ -104,11 +104,14 @@ public class RelatorioFolioRmd extends Relatorio {
|
|||
sql.append(" f.outros as outros, ");
|
||||
sql.append(" f.icms as icms ");
|
||||
sql.append("from folio_consumo_rmd f ");
|
||||
sql.append(" left join folio_consumo_rmd ff on f.folio = ff.folio and f.rmd_id = ff.rmd_id and f.indinactivo = 1 and f.indimpresso = 0 ");
|
||||
sql.append(" inner join aidf ai on f.rmd_id = ai.aidf_id and ai.aidfesp_id = 3 ");
|
||||
sql.append(" inner join empresa e on e.empresa_id = f.empresa_id ");
|
||||
sql.append(" join estado eo on eo.estado_id = f.estado_id ");
|
||||
sql.append("where f.empresa_id = :empresaId and f.rmd_id = :rmdId and f.estado_id = :estadoId ");
|
||||
sql.append(" and f.indinactivo <> 1 and f.activo = 1 ");
|
||||
sql.append(" and f.activo = 1 and f.valorcontabil > 0 ");
|
||||
sql.append(" and ff.folioconsumormd_id is null and ((f.indinactivo = 0 and f.indimpresso = 1) or f.indinactivo = 1 and f.indimpresso = 0 ) ");
|
||||
//sql.append(" and ((f.indinactivo = 0 and f.indimpresso = 1) or f.indinactivo = 1 and f.indimpresso = 0 ) ");
|
||||
sql.append("order by foliormd ");
|
||||
|
||||
return sql.toString();
|
||||
|
|
Loading…
Reference in New Issue