diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasRequisicao.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasRequisicao.java index 511e746fd..50a097553 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasRequisicao.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasRequisicao.java @@ -27,10 +27,13 @@ public class RelatorioVendasRequisicao extends Relatorio { private Integer empresaId; private Integer puntoventaId; private Integer secretariaId; - - public RelatorioVendasRequisicao(Map parametros, Connection conexao) throws Exception { + private boolean agruparCliente; + + public RelatorioVendasRequisicao(Map parametros, Connection conexao, boolean agruparCliente) throws Exception { super(parametros, conexao); + this.agruparCliente = agruparCliente; + this.setCustomDataSource(new DataSource(this) { @Override @@ -111,6 +114,12 @@ public class RelatorioVendasRequisicao extends Relatorio { bean.setImporte(rset.getBigDecimal("IMPORTE")); bean.setQtde(rset.getInt("QTDE")); + if (agruparCliente) { + bean.setDescricaogrupo(bean.getSecretariaId() + "- " + bean.getDescsecretaria()); + } else { + bean.setDescricaogrupo(bean.getNombpuntoventa()); + } + lsDadosRelatorio.add(bean); } @@ -175,8 +184,13 @@ public class RelatorioVendasRequisicao extends Relatorio { sQuery.append("AND SEC.SECRETARIA_ID = :SECRETARIA_ID "); } - sQuery.append("GROUP BY CDP.NUMDOCUMENTO, SEC.CVESECRETARIA, SEC.DESCSECRETARIA,PV.NOMBPUNTOVENTA, PV.NOMBPUNTOVENTA, E.NOMBEMPRESA, E.EMPRESA_ID, FP.DESCPAGO, CFP.FORMAPAGO_ID, ORI.DESCPARADA, DES.DESCPARADA, CFP.IMPORTE, ORI.CVEPARADA, DES.CVEPARADA, PV.PUNTOVENTA_ID ") - .append("ORDER BY SEC.DESCSECRETARIA, PV.NOMBPUNTOVENTA, FP.DESCPAGO"); + sQuery.append("GROUP BY CDP.NUMDOCUMENTO, SEC.CVESECRETARIA, SEC.DESCSECRETARIA,PV.NOMBPUNTOVENTA, PV.NOMBPUNTOVENTA, E.NOMBEMPRESA, E.EMPRESA_ID, FP.DESCPAGO, CFP.FORMAPAGO_ID, ORI.DESCPARADA, DES.DESCPARADA, CFP.IMPORTE, ORI.CVEPARADA, DES.CVEPARADA, PV.PUNTOVENTA_ID "); + + if (agruparCliente) { + sQuery.append("ORDER BY SEC.DESCSECRETARIA, PV.NOMBPUNTOVENTA, FP.DESCPAGO"); + } else { + sQuery.append("ORDER BY PV.NOMBPUNTOVENTA, SEC.DESCSECRETARIA, FP.DESCPAGO"); + } return sQuery.toString(); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_es.properties index 872de7256..02d32d2e2 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_es.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_es.properties @@ -15,4 +15,5 @@ cabecalho.usuario=Usu label.nombPuntoVenta=Agência label.total=Total label.puntoVenta=Agência: -label.diferenca=Diferença \ No newline at end of file +label.diferenca=Diferença +label.cliente=Cliente \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_pt_BR.properties index 872de7256..02d32d2e2 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasRequisicao_pt_BR.properties @@ -15,4 +15,5 @@ cabecalho.usuario=Usu label.nombPuntoVenta=Agência label.total=Total label.puntoVenta=Agência: -label.diferenca=Diferença \ No newline at end of file +label.diferenca=Diferença +label.cliente=Cliente \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jasper index f63f785c0..88a2beeaf 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jrxml index db4b86b80..20b374c80 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasRequisicao.jrxml @@ -1,14 +1,17 @@ - - + +