diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgencia.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgencia.java index 709afbfa2..25cbd8ced 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgencia.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgencia.java @@ -16,10 +16,6 @@ import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; -/** - * @author Thiago - * - */ public class RelatorioFormaPagamentoAgencia extends RelatorioDemandas { public RelatorioFormaPagamentoAgencia(Map parametros, Connection conexao) throws Exception { super(parametros, conexao); @@ -61,11 +57,11 @@ public class RelatorioFormaPagamentoAgencia extends RelatorioDemandas { sql.append(" select to_char(c.fechorventa, 'dd/MM/yyyy') as data, "); sql.append(" pv.NOMBPUNTOVENTA as agencia, "); sql.append(" fp.DESCPAGO as forma_pagamento, "); - sql.append(" sum(nvl(c.PRECIOPAGADO,0)) as tarifa, "); + sql.append(" SUM(CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN 1 ELSE -1 END * NVL(cfp.IMPORTE,0)) AS tarifa,"); sql.append(" sum(nvl(c.IMPORTEPEDAGIO,0)) as pedagio, "); sql.append(" sum(nvl(c.IMPORTESEGURO,0)) as seguro, "); sql.append(" sum(nvl(c.IMPORTETAXAEMBARQUE,0)) as taxa, "); - sql.append(" sum((nvl(c.PRECIOPAGADO,0) + nvl(c.IMPORTEPEDAGIO,0) + nvl(c.IMPORTESEGURO,0) + nvl(c.IMPORTETAXAEMBARQUE,0))) as total, "); + sql.append(" sum((CASE WHEN c.MOTIVOCANCELACION_ID IS NULL THEN 1 ELSE -1 END * NVL(cfp.IMPORTE,0) + NVL(c.IMPORTEPEDAGIO,0) + NVL(c.IMPORTESEGURO,0) + NVL(c.IMPORTETAXAEMBARQUE,0))) AS total, "); sql.append(" count(c.PRECIOPAGADO) as qtde "); sql.append(" from caja c "); sql.append(" join caja_formapago cfp on c.caja_id = cfp.caja_id "); @@ -73,7 +69,8 @@ public class RelatorioFormaPagamentoAgencia extends RelatorioDemandas { sql.append(" join punto_venta pv on pv.PUNTOVENTA_ID = c.PUNTOVENTA_ID "); sql.append(" join marca m on m.MARCA_ID = c.MARCA_ID and m.activo = 1 "); sql.append(where); - sql.append(" group by to_char(c.fechorventa, 'dd/MM/yyyy'), pv.NOMBPUNTOVENTA, fp.DESCPAGO, c.EMPRESAPUNTOVENTA_ID "); + sql.append(" AND c.INDREIMPRESION = 0 "); + sql.append(" group by to_char(c.fechorventa, 'dd/MM/yyyy'), pv.NOMBPUNTOVENTA, fp.DESCPAGO "); sql.append(" order by data, agencia, forma_pagamento"); NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString()); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_es.properties new file mode 100644 index 000000000..a42f09696 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_es.properties @@ -0,0 +1,14 @@ +TITULO = Relatório de Forma de Pagamento por Agência +PERIODO = PERÍODO + +DATA = DATA +AGENCIA = AGÊNCIA +FORMA_PAG = FORMA DE PAG. +VALOR = VALOR +PEDAGIO = PEDÁGIO +SEGURO = SEGURO +TAXAS = TAXAS +TOTAL = TOTAL +QTDE = QTDE + +msg.noData=Não foi possivel obter dados com os parâmetros informados. \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties index 4c7dfdb6a..a42f09696 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgencia_pt_BR.properties @@ -1 +1,14 @@ +TITULO = Relatório de Forma de Pagamento por Agência +PERIODO = PERÍODO + +DATA = DATA +AGENCIA = AGÊNCIA +FORMA_PAG = FORMA DE PAG. +VALOR = VALOR +PEDAGIO = PEDÁGIO +SEGURO = SEGURO +TAXAS = TAXAS +TOTAL = TOTAL +QTDE = QTDE + msg.noData=Não foi possivel obter dados com os parâmetros informados. \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jasper index c279cdfba..d1756e75b 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jrxml index 8404bd03d..3dddbe19f 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgencia.jrxml @@ -39,21 +39,21 @@ - <band height="68" splitType="Stretch"> - <staticText> - <reportElement uuid="7f9cea32-d0e7-4c05-9efc-233cdd5137ab" x="1" y="39" width="65" height="20"/> - <textElement> + <band height="59" splitType="Stretch"> + <textField> + <reportElement uuid="3152d9c0-592e-4136-b3d8-2a674e779468" x="1" y="39" width="65" height="20"/> + <textElement markup="none"> <font isBold="true"/> </textElement> - <text><![CDATA[PERÃODO:]]></text> - </staticText> - <staticText> - <reportElement uuid="367cee8b-2874-4078-b9c4-90285e81ec06" x="30" y="0" width="802" height="20"/> - <textElement textAlignment="Center"> + <textFieldExpression><![CDATA[$R{PERIODO}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="50b8071e-9e65-49d2-bd12-b9354502caf3" x="30" y="0" width="802" height="20"/> + <textElement textAlignment="Center" markup="none"> <font size="14" isBold="true"/> </textElement> - <text><![CDATA[Relatório de Forma de Pagamento por Agência]]></text> - </staticText> + <textFieldExpression><![CDATA[$R{TITULO}]]></textFieldExpression> + </textField> <staticText> <reportElement uuid="c45a1ecd-8b5e-4bd7-9139-56e0844cea7e" x="145" y="39" width="10" height="20"/> <textElement> @@ -75,69 +75,69 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - + +