Foi inserido a opção todas no relatorios financeiros referente ao menu Resumo por agencia.
fixes bug#10957 dev:fabio qua:jose git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@81409 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
604c4b6209
commit
06d426fa20
|
@ -43,7 +43,7 @@ public class RelatorioAgenciaFechamento extends Relatorio {
|
||||||
|
|
||||||
lsDadosRelatorio = new ArrayList<RelatorioAgenciaFechamentoBean>();
|
lsDadosRelatorio = new ArrayList<RelatorioAgenciaFechamentoBean>();
|
||||||
|
|
||||||
String sql = carregarDadosTotaisdeVenda(puntoVenta);
|
String sql = carregarDadosTotaisdeVenda(puntoVenta, empresa);
|
||||||
|
|
||||||
log.debug(sql);
|
log.debug(sql);
|
||||||
|
|
||||||
|
@ -55,10 +55,6 @@ public class RelatorioAgenciaFechamento extends Relatorio {
|
||||||
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
||||||
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
||||||
|
|
||||||
if (empresa != null && !empresa.equals("")) {
|
|
||||||
stmt.setInt("empresaId", Integer.parseInt(empresa));
|
|
||||||
}
|
|
||||||
|
|
||||||
rset1= stmt.executeQuery();
|
rset1= stmt.executeQuery();
|
||||||
|
|
||||||
while (rset1.next()) {
|
while (rset1.next()) {
|
||||||
|
@ -89,15 +85,12 @@ public class RelatorioAgenciaFechamento extends Relatorio {
|
||||||
agenciaFechamento.setQtdEstornado(rset1.getInt("qtdEstornado"));
|
agenciaFechamento.setQtdEstornado(rset1.getInt("qtdEstornado"));
|
||||||
qtdSeguro = rset1.getInt("qtdSeguro");
|
qtdSeguro = rset1.getInt("qtdSeguro");
|
||||||
|
|
||||||
stmt = new NamedParameterStatement(conexao, carregarEventosExtras(puntoVentaId));
|
String strQueryEventoExtra = carregarEventosExtras(puntoVentaId, empresa);
|
||||||
|
stmt = new NamedParameterStatement(conexao, strQueryEventoExtra);
|
||||||
|
|
||||||
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
||||||
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
||||||
|
|
||||||
if (empresa != null && !empresa.equals("")) {
|
|
||||||
stmt.setInt("empresaId", Integer.parseInt(empresa));
|
|
||||||
}
|
|
||||||
|
|
||||||
rset2 = stmt.executeQuery();
|
rset2 = stmt.executeQuery();
|
||||||
|
|
||||||
if (rset2.next()) {
|
if (rset2.next()) {
|
||||||
|
@ -140,7 +133,7 @@ public class RelatorioAgenciaFechamento extends Relatorio {
|
||||||
protected void processaParametros() throws Exception {
|
protected void processaParametros() throws Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String carregarDadosTotaisdeVenda(String puntoVenta) {
|
private String carregarDadosTotaisdeVenda(String puntoVenta, String empresa) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append(" SELECT pv.PUNTOVENTA_ID AS codigo, ");
|
sql.append(" SELECT pv.PUNTOVENTA_ID AS codigo, ");
|
||||||
|
@ -244,7 +237,9 @@ public class RelatorioAgenciaFechamento extends Relatorio {
|
||||||
}
|
}
|
||||||
sql.append(" AND c.TIPOVENTA_ID <> 6 ");
|
sql.append(" AND c.TIPOVENTA_ID <> 6 ");
|
||||||
sql.append(" AND c.INDREIMPRESION = 0 ");
|
sql.append(" AND c.INDREIMPRESION = 0 ");
|
||||||
sql.append(" AND m.empresa_id = :empresaId ");
|
if (empresa != null && !empresa.equals("") && !empresa.equals("-1")) {
|
||||||
|
sql.append(" AND m.empresa_id = "+empresa+" ");
|
||||||
|
}
|
||||||
sql.append(" GROUP BY pv.PUNTOVENTA_ID, pv.nombpuntoventa ");
|
sql.append(" GROUP BY pv.PUNTOVENTA_ID, pv.nombpuntoventa ");
|
||||||
sql.append(" ORDER BY pv.nombpuntoventa ");
|
sql.append(" ORDER BY pv.nombpuntoventa ");
|
||||||
|
|
||||||
|
@ -252,7 +247,7 @@ public class RelatorioAgenciaFechamento extends Relatorio {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String carregarEventosExtras(String puntoVenta) {
|
private String carregarEventosExtras(String puntoVenta, String empresa) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append(" SELECT ");
|
sql.append(" SELECT ");
|
||||||
|
@ -273,7 +268,10 @@ public class RelatorioAgenciaFechamento extends Relatorio {
|
||||||
if (puntoVenta != null && !puntoVenta.equals("-1")) {
|
if (puntoVenta != null && !puntoVenta.equals("-1")) {
|
||||||
sql.append(" AND cd.PUNTOVENTA_ID = ").append(puntoVenta);
|
sql.append(" AND cd.PUNTOVENTA_ID = ").append(puntoVenta);
|
||||||
}
|
}
|
||||||
sql.append(" AND ee.EMPRESA_ID=:empresaId ");
|
if (empresa != null && !empresa.equals("") && !empresa.equals("-1")) {
|
||||||
|
sql.append(" AND ee.EMPRESA_ID = "+empresa+" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.debug(sql.toString());
|
log.debug(sql.toString());
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ public class RelatorioAgenciaFechamentoAntigo extends Relatorio {
|
||||||
|
|
||||||
lsDadosRelatorio = new ArrayList<RelatorioAgenciaFechamentoAntigoBean>();
|
lsDadosRelatorio = new ArrayList<RelatorioAgenciaFechamentoAntigoBean>();
|
||||||
|
|
||||||
String sql = carregarDadosTotaisdeVenda(puntoVenta);
|
String sql = carregarDadosTotaisdeVenda(puntoVenta, empresa);
|
||||||
|
|
||||||
System.out.println(sql);
|
System.out.println(sql);
|
||||||
|
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||||
ResultSet rset1 = null;
|
ResultSet rset1 = null;
|
||||||
ResultSet rset2 = null;
|
ResultSet rset2 = null;
|
||||||
|
@ -53,10 +53,6 @@ public class RelatorioAgenciaFechamentoAntigo extends Relatorio {
|
||||||
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
||||||
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
||||||
|
|
||||||
if (empresa != null && !empresa.equals("")) {
|
|
||||||
stmt.setInt("empresaId", Integer.parseInt(empresa));
|
|
||||||
}
|
|
||||||
|
|
||||||
rset1= stmt.executeQuery();
|
rset1= stmt.executeQuery();
|
||||||
|
|
||||||
while (rset1.next()) {
|
while (rset1.next()) {
|
||||||
|
@ -105,22 +101,12 @@ public class RelatorioAgenciaFechamentoAntigo extends Relatorio {
|
||||||
total = total.add(digitado != null ? digitado : BigDecimal.ZERO);
|
total = total.add(digitado != null ? digitado : BigDecimal.ZERO);
|
||||||
total = total.subtract(anulado != null ? anulado : BigDecimal.ZERO);
|
total = total.subtract(anulado != null ? anulado : BigDecimal.ZERO);
|
||||||
total = total.subtract(devolvido != null ? devolvido : BigDecimal.ZERO);
|
total = total.subtract(devolvido != null ? devolvido : BigDecimal.ZERO);
|
||||||
|
String strQueryReceitaDespesas = carregarDadosReceitaDespesa(puntoVentaId, empresa);
|
||||||
|
stmt = new NamedParameterStatement(conexao, strQueryReceitaDespesas);
|
||||||
|
|
||||||
stmt = new NamedParameterStatement(conexao, carregarDadosReceitaDespesa(puntoVentaId));
|
|
||||||
|
|
||||||
System.out.println(carregarDadosReceitaDespesa(puntoVentaId));
|
|
||||||
|
|
||||||
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
||||||
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
||||||
|
|
||||||
if (empresa != null && !empresa.equals("")) {
|
|
||||||
stmt.setInt("empresaId", Integer.parseInt(empresa));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (puntoVentaId != null ) {
|
|
||||||
stmt.setString("puntoVentaId", puntoVentaId);
|
|
||||||
}
|
|
||||||
|
|
||||||
rset2 = stmt.executeQuery();
|
rset2 = stmt.executeQuery();
|
||||||
|
|
||||||
if (rset2.next()) {
|
if (rset2.next()) {
|
||||||
|
@ -172,7 +158,7 @@ public class RelatorioAgenciaFechamentoAntigo extends Relatorio {
|
||||||
protected void processaParametros() throws Exception {
|
protected void processaParametros() throws Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String carregarDadosTotaisdeVenda(String puntoVenta) {
|
private String carregarDadosTotaisdeVenda(String puntoVenta, String empresa) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append(" SELECT ");
|
sql.append(" SELECT ");
|
||||||
|
@ -213,7 +199,9 @@ public class RelatorioAgenciaFechamentoAntigo extends Relatorio {
|
||||||
}
|
}
|
||||||
sql.append(" AND c.TIPOVENTA_ID <> 6 ");
|
sql.append(" AND c.TIPOVENTA_ID <> 6 ");
|
||||||
sql.append(" AND c.INDREIMPRESION = 0 ");
|
sql.append(" AND c.INDREIMPRESION = 0 ");
|
||||||
sql.append(" AND m.empresa_id = :empresaId ");
|
if (empresa != null && !empresa.equals("") && !empresa.equals("-1")) {
|
||||||
|
sql.append(" AND m.empresa_id = "+empresa+" ");
|
||||||
|
}
|
||||||
sql.append(" GROUP BY pv.PUNTOVENTA_ID , pv.nombpuntoventa ");
|
sql.append(" GROUP BY pv.PUNTOVENTA_ID , pv.nombpuntoventa ");
|
||||||
sql.append(" ORDER BY pv.PUNTOVENTA_ID , pv.nombpuntoventa ");
|
sql.append(" ORDER BY pv.PUNTOVENTA_ID , pv.nombpuntoventa ");
|
||||||
|
|
||||||
|
@ -233,7 +221,7 @@ public class RelatorioAgenciaFechamentoAntigo extends Relatorio {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String carregarDadosReceitaDespesa(String puntoVenta) {
|
private String carregarDadosReceitaDespesa(String puntoVenta, String empresa) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append(" SELECT ");
|
sql.append(" SELECT ");
|
||||||
|
@ -250,9 +238,12 @@ public class RelatorioAgenciaFechamentoAntigo extends Relatorio {
|
||||||
sql.append(" AND cd.TURNO_ID IS NOT NULL ");
|
sql.append(" AND cd.TURNO_ID IS NOT NULL ");
|
||||||
sql.append(" AND cd.FECCORTE BETWEEN :de AND :ate ");
|
sql.append(" AND cd.FECCORTE BETWEEN :de AND :ate ");
|
||||||
if (puntoVenta != null && !puntoVenta.equals("-1")) {
|
if (puntoVenta != null && !puntoVenta.equals("-1")) {
|
||||||
sql.append(" AND cd.PUNTOVENTA_ID = :puntoVentaId ");
|
sql.append(" AND cd.PUNTOVENTA_ID = "+puntoVenta+" ");
|
||||||
}
|
}
|
||||||
sql.append(" AND ee.EMPRESA_ID=:empresaId ");
|
if (empresa != null && !empresa.equals("") && !empresa.equals("-1")) {
|
||||||
|
sql.append(" AND ee.EMPRESA_ID = "+empresa+" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class RelatorioAgenciaFechamentoResumoDiario extends Relatorio {
|
||||||
|
|
||||||
lsDadosRelatorio = new ArrayList<RelatorioAgenciaFechamentoAntigoBean>();
|
lsDadosRelatorio = new ArrayList<RelatorioAgenciaFechamentoAntigoBean>();
|
||||||
|
|
||||||
String sql = carregarDadosTotaisdeVenda(puntoVenta);
|
String sql = carregarDadosTotaisdeVenda(puntoVenta, empresa);
|
||||||
|
|
||||||
System.out.println(sql);
|
System.out.println(sql);
|
||||||
|
|
||||||
|
@ -53,10 +53,6 @@ public class RelatorioAgenciaFechamentoResumoDiario extends Relatorio {
|
||||||
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
||||||
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
||||||
|
|
||||||
if (empresa != null && !empresa.equals("")) {
|
|
||||||
stmt.setInt("empresaId", Integer.parseInt(empresa));
|
|
||||||
}
|
|
||||||
|
|
||||||
rset1= stmt.executeQuery();
|
rset1= stmt.executeQuery();
|
||||||
|
|
||||||
while (rset1.next()) {
|
while (rset1.next()) {
|
||||||
|
@ -106,21 +102,12 @@ public class RelatorioAgenciaFechamentoResumoDiario extends Relatorio {
|
||||||
total = total.subtract(anulado != null ? anulado : BigDecimal.ZERO);
|
total = total.subtract(anulado != null ? anulado : BigDecimal.ZERO);
|
||||||
total = total.subtract(devolvido != null ? devolvido : BigDecimal.ZERO);
|
total = total.subtract(devolvido != null ? devolvido : BigDecimal.ZERO);
|
||||||
|
|
||||||
stmt = new NamedParameterStatement(conexao, carregarDadosReceitaDespesa(puntoVentaId));
|
String strQueryReceitaDespesa = carregarDadosReceitaDespesa(puntoVentaId, empresa);
|
||||||
|
stmt = new NamedParameterStatement(conexao, strQueryReceitaDespesa);
|
||||||
|
|
||||||
System.out.println(carregarDadosReceitaDespesa(puntoVentaId));
|
|
||||||
|
|
||||||
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
|
||||||
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));
|
||||||
|
|
||||||
if (empresa != null && !empresa.equals("")) {
|
|
||||||
stmt.setInt("empresaId", Integer.parseInt(empresa));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (puntoVentaId != null ) {
|
|
||||||
stmt.setString("puntoVentaId", puntoVentaId);
|
|
||||||
}
|
|
||||||
|
|
||||||
rset2 = stmt.executeQuery();
|
rset2 = stmt.executeQuery();
|
||||||
|
|
||||||
if (rset2.next()) {
|
if (rset2.next()) {
|
||||||
|
@ -172,7 +159,7 @@ public class RelatorioAgenciaFechamentoResumoDiario extends Relatorio {
|
||||||
protected void processaParametros() throws Exception {
|
protected void processaParametros() throws Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String carregarDadosTotaisdeVenda(String puntoVenta) {
|
private String carregarDadosTotaisdeVenda(String puntoVenta, String empresa) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append(" SELECT ");
|
sql.append(" SELECT ");
|
||||||
|
@ -213,7 +200,9 @@ public class RelatorioAgenciaFechamentoResumoDiario extends Relatorio {
|
||||||
}
|
}
|
||||||
sql.append(" AND c.TIPOVENTA_ID <> 6 ");
|
sql.append(" AND c.TIPOVENTA_ID <> 6 ");
|
||||||
sql.append(" AND c.INDREIMPRESION = 0 ");
|
sql.append(" AND c.INDREIMPRESION = 0 ");
|
||||||
sql.append(" AND m.empresa_id = :empresaId ");
|
if (empresa != null && !empresa.equals("") && !empresa.equals("-1")) {
|
||||||
|
sql.append(" AND m.empresa_id = "+empresa+" ");
|
||||||
|
}
|
||||||
sql.append(" GROUP BY pv.NUMPUNTOVENTA , pv.nombpuntoventa ");
|
sql.append(" GROUP BY pv.NUMPUNTOVENTA , pv.nombpuntoventa ");
|
||||||
sql.append(" ORDER BY pv.NUMPUNTOVENTA , pv.nombpuntoventa ");
|
sql.append(" ORDER BY pv.NUMPUNTOVENTA , pv.nombpuntoventa ");
|
||||||
|
|
||||||
|
@ -233,7 +222,7 @@ public class RelatorioAgenciaFechamentoResumoDiario extends Relatorio {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String carregarDadosReceitaDespesa(String puntoVenta) {
|
private String carregarDadosReceitaDespesa(String puntoVenta, String empresa) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append(" SELECT ");
|
sql.append(" SELECT ");
|
||||||
|
@ -250,9 +239,11 @@ public class RelatorioAgenciaFechamentoResumoDiario extends Relatorio {
|
||||||
sql.append(" AND cd.TURNO_ID IS NOT NULL ");
|
sql.append(" AND cd.TURNO_ID IS NOT NULL ");
|
||||||
sql.append(" AND cd.FECCORTE BETWEEN :de AND :ate ");
|
sql.append(" AND cd.FECCORTE BETWEEN :de AND :ate ");
|
||||||
if (puntoVenta != null && !puntoVenta.equals("-1")) {
|
if (puntoVenta != null && !puntoVenta.equals("-1")) {
|
||||||
sql.append(" AND cd.PUNTOVENTA_ID = :puntoVentaId ");
|
sql.append(" AND cd.PUNTOVENTA_ID = "+puntoVenta+" ");
|
||||||
|
}
|
||||||
|
if (empresa != null && !empresa.equals("") && !empresa.equals("-1")) {
|
||||||
|
sql.append(" AND ee.EMPRESA_ID = "+empresa+" ");
|
||||||
}
|
}
|
||||||
sql.append(" AND ee.EMPRESA_ID=:empresaId ");
|
|
||||||
|
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,7 @@ public class RelatorioAgenciaFechamentoController extends MyGenericForwardCompos
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
lsEmpresas = empresaService.obtenerTodos();
|
lsEmpresas = empresaService.obtenerTodos();
|
||||||
|
lsEmpresas.add(0, new Empresa(-1,"TODAS"));
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiro());
|
puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiro());
|
||||||
puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSelecionados());
|
puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSelecionados());
|
||||||
|
|
Loading…
Reference in New Issue