fix bug #0009384 - correção da query, padrão da serie é diferente

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@72361 d1611594-4594-4d17-8e1d-87c2c4800839
master
bruno.neves 2017-08-07 14:41:49 +00:00
parent 55d3d5c3d8
commit 435d90b39d
1 changed files with 3 additions and 3 deletions

View File

@ -60,9 +60,9 @@ public class RelatorioAidfDetalhado extends Relatorio {
sql.append(" inner join abasto_boleto ab on a.empresa_id = ab.empresa_id and ab.ACTIVO = 1 ");
sql.append(" inner join det_abasto_boleto dab on dab.abastoboleto_id = ab.abastoboleto_id and dab.ACTIVO = 1 ");
sql.append(" inner join punto_venta p on p.puntoventa_id = ab.puntoventa_id and p.ACTIVO = 1");
sql.append(" inner join folio_preimpreso fp on (a.serie=fp.numeserie or concat(a.aidf_id, concat(a.serie,a.subserie))=fp.numeserie) and fp.ACTIVO = 1");
sql.append("where (case when (length(dab.numseriepreimpresa) < 3) then '0' else substr(dab.numseriepreimpresa,0,3) end) = cast(a.aidf_id as varchar(10))");
sql.append(" and a.ACTIVO = 1");
sql.append(" inner join folio_preimpreso fp on (a.serie=fp.numeserie or concat(a.aidf_id, concat(a.serie,a.subserie))=fp.numeserie OR concat(a.serie,concat('-',a.subserie))=fp.numeserie) and fp.ACTIVO = 1");
sql.append(" where ");
sql.append(" a.ACTIVO = 1");
if(parametros.get("EMPRESA_ID") != null){
sql.append(" and a.empresa_id = ").append(parametros.get("EMPRESA_ID"));
}