Correção da query do relatório mantis 6555
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@47552 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
98f14b3750
commit
1e28090648
|
@ -23,7 +23,6 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
||||||
public void initDados() throws Exception {
|
public void initDados() throws Exception {
|
||||||
Connection conexao = this.relatorio.getConexao();
|
Connection conexao = this.relatorio.getConexao();
|
||||||
Map<String, Object> parametros = this.relatorio.getParametros();
|
Map<String, Object> parametros = this.relatorio.getParametros();
|
||||||
String usuario = (String) parametros.get("USUARIO");
|
|
||||||
final Integer CARTAO_CREDITO = 2;
|
final Integer CARTAO_CREDITO = 2;
|
||||||
final Integer CARTAO_DEBITO = 3;
|
final Integer CARTAO_DEBITO = 3;
|
||||||
String sql = getSql();
|
String sql = getSql();
|
||||||
|
@ -33,9 +32,7 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
||||||
stmt.setTimestamp("data_inicial", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
|
stmt.setTimestamp("data_inicial", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
|
||||||
stmt.setTimestamp("data_final", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
|
stmt.setTimestamp("data_final", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
|
||||||
stmt.setInt("formaPago1", CARTAO_CREDITO);
|
stmt.setInt("formaPago1", CARTAO_CREDITO);
|
||||||
stmt.setInt("formaPago2", CARTAO_DEBITO);
|
stmt.setInt("formaPago2", CARTAO_DEBITO); ;
|
||||||
//FIXME: Retirar valor fixo
|
|
||||||
stmt.setString("usuario", usuario);
|
|
||||||
|
|
||||||
ResultSet rset = stmt.executeQuery();
|
ResultSet rset = stmt.executeQuery();
|
||||||
|
|
||||||
|
@ -65,15 +62,13 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append(" select distinct c.caja_id, p.nombpuntoventa, f.descpago, c.fechorventa, ptovta.numsitef,");
|
sql.append(" select distinct c.caja_id, p.nombpuntoventa, f.descpago, c.fechorventa, ptovta.numsitef,");
|
||||||
sql.append(" (coalesce(c.preciopagado,0) + coalesce(c.importeoutros,0)+ coalesce(c.importepedagio,0)+ coalesce(c.importeseguro,0) + coalesce(c.importetaxaembarque,0)) as valor_venda,");
|
sql.append(" (coalesce(c.preciopagado,0) + coalesce(c.importeoutros,0)+ coalesce(c.importepedagio,0)+ coalesce(c.importeseguro,0) + coalesce(c.importetaxaembarque,0)) as valor_venda,");
|
||||||
sql.append(" cf.importe as valor_cancelar, u.nombusuario, m.descmotivo, ctj.numautorizacion numautorizacion ");
|
sql.append(" cf.importe as valor_cancelar, m.descmotivo, ctj.numautorizacion numautorizacion ");
|
||||||
sql.append(" from caja c inner join punto_venta p on c.puntoventa_id = p.puntoventa_id ");
|
sql.append(" from caja c inner join punto_venta p on c.puntoventa_id = p.puntoventa_id ");
|
||||||
sql.append(" inner join caja_formapago cf on c.caja_id = cf.caja_id ");
|
sql.append(" inner join caja_formapago cf on c.caja_id = cf.caja_id ");
|
||||||
sql.append(" inner join forma_pago f on cf.formapago_id = f.formapago_id ");
|
sql.append(" inner join forma_pago f on cf.formapago_id = f.formapago_id ");
|
||||||
sql.append(" inner join usuario u on c.usuario_id = u.usuario_id");
|
|
||||||
sql.append(" inner join ptovta_empresa ptovta on c.puntoventa_id = ptovta.puntoventa_id");
|
sql.append(" inner join ptovta_empresa ptovta on c.puntoventa_id = ptovta.puntoventa_id");
|
||||||
sql.append(" inner join motivo_cancelacion m ");
|
sql.append(" inner join motivo_cancelacion m ");
|
||||||
sql.append(" on c.motivocancelacion_id = m.motivocancelacion_id ");
|
sql.append(" on c.motivocancelacion_id = m.motivocancelacion_id ");
|
||||||
sql.append(" and u.usuario_id = :usuario ");
|
|
||||||
if(parametros.get("EMPRESA_ID") != null){
|
if(parametros.get("EMPRESA_ID") != null){
|
||||||
sql.append(" inner join empresa e on p.empresa_id = e.empresa_id and p.empresa_id = " + parametros.get("EMPRESA_ID") );
|
sql.append(" inner join empresa e on p.empresa_id = e.empresa_id and p.empresa_id = " + parametros.get("EMPRESA_ID") );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue