fixes bug 6897 Adicionada coluna que mostra o Valor Total da Compra (Valor total da cesta de compras).
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@50899 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2984e78ebf
commit
8a8f8930e8
|
@ -39,6 +39,7 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
dataResult.put("cartao", rset.getString("numtarjeta").replace('*', ' ').trim());
|
||||
dataResult.put("datavenda", rset.getDate("fechorventa"));
|
||||
dataResult.put("datadevolucao", rset.getDate("datadevolucao"));
|
||||
dataResult.put("valor_total_compra", rset.getBigDecimal("valor_cesta"));
|
||||
dataResult.put("valorvenda", rset.getBigDecimal("valor_venda"));
|
||||
dataResult.put("valorcancelar", rset.getBigDecimal("valor_cancelar"));
|
||||
dataResult.put("autorizacao", rset.getString("numautorizacion"));
|
||||
|
@ -60,10 +61,25 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
|
||||
private String getSql() {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append(" WITH boletos_originais AS ");
|
||||
sql.append(" WITH cesta_compras AS ");
|
||||
sql.append(" (SELECT c.numoperacion as numoperacion_cc, ");
|
||||
sql.append(" sum((COALESCE(c.preciopagado,0) + COALESCE(c.importeoutros,0)+ COALESCE(c.importepedagio,0)+ COALESCE(c.importeseguro,0) + COALESCE(c.importetaxaembarque,0)))AS valor_cesta ");
|
||||
sql.append(" FROM CAJA c ");
|
||||
sql.append(" INNER JOIN BOLETO b on b.numoperacion = c.numoperacion ");
|
||||
sql.append(" AND b.numfoliosistema = c.numfoliosistema ");
|
||||
if (parametros.get("EMPRESA_ID") != null) {
|
||||
sql.append(" INNER JOIN marca m ON m.marca_id = b.marca_id ");
|
||||
sql.append(" AND m.empresa_id = " + parametros.get("EMPRESA_ID"));
|
||||
}
|
||||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
sql.append(" AND c.puntoventa_id IN (" + parametros.get("NUMPUNTOVENTA") + ")");
|
||||
}
|
||||
sql.append(" AND c.fechorventa between :data_inicial and :data_final ");
|
||||
sql.append(" GROUP BY c.numoperacion), ");
|
||||
sql.append(" boletos_originais AS ");
|
||||
sql.append(" (SELECT distinct b.boleto_id as boleto_id_bo, ctj.numtarjeta as numtarjeta_bo, ptovta.numsitef as numsitef_bo, ");
|
||||
sql.append(" ctj.numautorizacion as numautorizacion_bo, ctj.nsu as nsu_bo ");
|
||||
sql.append(" FROM boleto b, caja_det_pago cdt, caja c, caja_tarjeta ctj, ptovta_empresa ptovta ");
|
||||
sql.append(" ctj.numautorizacion as numautorizacion_bo, ctj.nsu as nsu_bo, ce.valor_cesta AS valor_cesta_bo ");
|
||||
sql.append(" FROM boleto b, caja_det_pago cdt, caja c, caja_tarjeta ctj, ptovta_empresa ptovta, cesta_compras ce ");
|
||||
sql.append(" WHERE b.boleto_id IN ");
|
||||
sql.append(" ( SELECT b.boletooriginal_id FROM OCD o ");
|
||||
sql.append(" INNER JOIN boleto b ON o.BOLETO_ID = b.BOLETO_ID ");
|
||||
|
@ -86,7 +102,8 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
sql.append(" AND cdt.caja_id = c.caja_id ");
|
||||
sql.append(" AND cdt.cajadetpago_id = ctj.cajadetpago_id ");
|
||||
sql.append(" AND cdt.formapago_id IN (2) ");
|
||||
sql.append(" AND b.puntoventa_id = ptovta.puntoventa_id),");
|
||||
sql.append(" AND b.puntoventa_id = ptovta.puntoventa_id");
|
||||
sql.append(" AND ce.numoperacion_cc = b.numoperacion),");
|
||||
sql.append(" boletos_novos AS( ");
|
||||
sql.append(" SELECT c.caja_id as caja_id_bn, b.boleto_id as boleto_id_bn, b.boletooriginal_id as boleto_id_original_bn, ");
|
||||
sql.append(" b.puntoventa_id as puntoventa_id_bn, p.nombpuntoventa as nombpuntoventa_bn, c.fechorventa as fechorventa_bn, ");
|
||||
|
@ -114,7 +131,7 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
|
||||
sql.append(" select * from (select distinct c.caja_id, p.nombpuntoventa, ctj.numtarjeta, 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(" TO_CHAR(coalesce(cf.importe,0) - (coalesce(cf.importe,0)*(ocd.PENALIZACION/100)),'FM9999999.90') as valor_cancelar, m.descmotivo, ctj.numautorizacion, ctj.nsu, c.numfoliosistema, o.fecinc as datadevolucao ");
|
||||
sql.append(" TO_CHAR(coalesce(cf.importe,0) - (coalesce(cf.importe,0)*(ocd.PENALIZACION/100)),'FM9999999.90') as valor_cancelar, m.descmotivo, ctj.numautorizacion, ctj.nsu, c.numfoliosistema, o.fecinc as datadevolucao, ce.valor_cesta");
|
||||
sql.append(" from caja c ");
|
||||
sql.append(" inner join boleto b ON c.numoperacion = b.numoperacion AND b.numfoliosistema = c.numfoliosistema ");
|
||||
sql.append(" inner join ocd o ON o.BOLETO_ID = b.BOLETO_ID ");
|
||||
|
@ -136,7 +153,8 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
sql.append(" inner join marca ma on ma.marca_id = c.marca_id");
|
||||
if (parametros.get("EMPRESA_ID") != null) {
|
||||
sql.append(" inner join empresa e on e.empresa_id = ma.empresa_id and ma.empresa_id = " + parametros.get("EMPRESA_ID"));
|
||||
}
|
||||
}
|
||||
sql.append(" INNER JOIN cesta_compras ce on ce.numoperacion_cc = b.numoperacion ");
|
||||
sql.append(")");
|
||||
|
||||
sql.append(" union ");
|
||||
|
@ -144,7 +162,7 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
sql.append(" select * from (select distinct c.caja_id, p.nombpuntoventa, ctj.numtarjeta, 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(" TO_CHAR(coalesce(o.VALOR_TARJETA,0),'FM9999999.90') as valor_cancelar,");
|
||||
sql.append(" 'OCD' as descmotivo, ctj.numautorizacion, ctj.nsu, c.numfoliosistema, o.fecinc as datadevolucao ");
|
||||
sql.append(" 'OCD' as descmotivo, ctj.numautorizacion, ctj.nsu, c.numfoliosistema, o.fecinc as datadevolucao, ce.valor_cesta ");
|
||||
sql.append(" from OCD o");
|
||||
sql.append(" inner join boleto b on o.BOLETO_ID = b.BOLETO_ID");
|
||||
sql.append(" inner join caja c on c.numoperacion = b.numoperacion and b.numfoliosistema = c.numfoliosistema");
|
||||
|
@ -161,13 +179,14 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
sql.append(" and p.puntoventa_id IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
|
||||
}
|
||||
sql.append(" INNER JOIN cesta_compras ce on ce.numoperacion_cc = b.numoperacion");
|
||||
sql.append(" order by c.fechorventa, o.fecinc )");
|
||||
|
||||
sql.append(" union ");
|
||||
|
||||
sql.append(" select bn.caja_id_bn, bn.nombpuntoventa_bn, bo.numtarjeta_bo, bn.fechorventa_bn, ");
|
||||
sql.append(" bo.numsitef_bo, bn.valor_venda_bn, bn.valor_cancelar_bn, 'OCD' as descmotivo, bo.numautorizacion_bo, bo.nsu_bo, ");
|
||||
sql.append(" numfoliosistema_bn, datadevolucao_bn ");
|
||||
sql.append(" numfoliosistema_bn, datadevolucao_bn, valor_cesta_bo ");
|
||||
sql.append(" FROM boletos_originais bo ");
|
||||
sql.append(" inner join boletos_novos bn on bo.boleto_id_bo = bn.boleto_id_original_bn ");
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ cabecalho.filtros=Filtros:
|
|||
label.Estabelecimento=Estabelecimento
|
||||
label.cartao=Cartão
|
||||
label.data=Data da compra
|
||||
label.valor.cesta=Total da Compra
|
||||
label.valor.venda=Valor da venda
|
||||
label.valor.cancelar=Valor a cancelar
|
||||
label.autorizacao=Autorização
|
||||
|
|
|
@ -15,6 +15,7 @@ cabecalho.filtros=Filtros:
|
|||
label.Estabelecimento=Estabelecimento
|
||||
label.cartao=Cartão
|
||||
label.data=Data da compra
|
||||
label.valor.cesta=Total da Compra
|
||||
label.valor.venda=Valor da venda
|
||||
label.valor.cancelar=Valor a cancelar
|
||||
label.autorizacao=Autorização
|
||||
|
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioCancelamentoVendaCartao" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c092ef85-9334-4225-93d7-1acb7cf4d021">
|
||||
<property name="ireport.zoom" value="1.1000000000000005"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.x" value="11"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="pageHeader"/>
|
||||
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/>
|
||||
|
@ -25,6 +25,7 @@
|
|||
<field name="nsu" class="java.lang.String"/>
|
||||
<field name="numfoliosistema" class="java.lang.String"/>
|
||||
<field name="datadevolucao" class="java.util.Date"/>
|
||||
<field name="valor_total_compra" class="java.math.BigDecimal"/>
|
||||
<background>
|
||||
<band splitType="Stretch"/>
|
||||
</background>
|
||||
|
@ -127,7 +128,7 @@
|
|||
<columnHeader>
|
||||
<band height="14" splitType="Stretch">
|
||||
<textField isStretchWithOverflow="true">
|
||||
<reportElement uuid="337f441e-ca7f-402c-8407-f3406ec2b4b0" x="2" y="0" width="182" height="14" isPrintWhenDetailOverflows="true"/>
|
||||
<reportElement uuid="337f441e-ca7f-402c-8407-f3406ec2b4b0" x="2" y="0" width="115" height="14" isPrintWhenDetailOverflows="true"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="1.0"/>
|
||||
</box>
|
||||
|
@ -167,7 +168,7 @@
|
|||
<textFieldExpression><![CDATA[$R{label.valor.venda}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="d9a2225c-8883-4a35-9c16-8af9bcfe6577" x="284" y="0" width="66" height="14"/>
|
||||
<reportElement uuid="d9a2225c-8883-4a35-9c16-8af9bcfe6577" x="217" y="0" width="66" height="14"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="1.0"/>
|
||||
</box>
|
||||
|
@ -177,7 +178,7 @@
|
|||
<textFieldExpression><![CDATA[$R{label.data}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="" isBlankWhenNull="false">
|
||||
<reportElement uuid="0583701e-920a-473b-b1e4-6137f8d022df" mode="Transparent" x="234" y="0" width="50" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<reportElement uuid="0583701e-920a-473b-b1e4-6137f8d022df" mode="Transparent" x="167" y="0" width="50" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="1.0"/>
|
||||
</box>
|
||||
|
@ -198,7 +199,7 @@
|
|||
<textFieldExpression><![CDATA[$R{label.autorizacao}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="" isBlankWhenNull="false">
|
||||
<reportElement uuid="f9ea7239-48e1-4207-b957-dc4aadcaa590" mode="Transparent" x="184" y="0" width="50" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<reportElement uuid="f9ea7239-48e1-4207-b957-dc4aadcaa590" mode="Transparent" x="117" y="0" width="50" height="14" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="1.0"/>
|
||||
</box>
|
||||
|
@ -229,7 +230,7 @@
|
|||
<textFieldExpression><![CDATA[$R{label.numfoliosistema}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="876fa163-5ff5-4eef-b32c-0f5b6b40672c" x="350" y="0" width="66" height="14"/>
|
||||
<reportElement uuid="876fa163-5ff5-4eef-b32c-0f5b6b40672c" x="283" y="0" width="66" height="14"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="1.0"/>
|
||||
</box>
|
||||
|
@ -238,26 +239,36 @@
|
|||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.devolucao}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement uuid="77a2f088-9771-472c-bffe-cd1345050e51" x="349" y="0" width="66" height="14"/>
|
||||
<box>
|
||||
<bottomPen lineWidth="1.0"/>
|
||||
</box>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.valor.cesta}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</columnHeader>
|
||||
<detail>
|
||||
<band height="10" splitType="Stretch">
|
||||
<textField>
|
||||
<reportElement uuid="c35afacb-b160-4ace-b7be-c2e2f54ac1c0" x="234" y="0" width="50" height="10"/>
|
||||
<reportElement uuid="c35afacb-b160-4ace-b7be-c2e2f54ac1c0" x="167" y="0" width="50" height="10"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top">
|
||||
<font size="7" isBold="false" isItalic="false"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{cartao}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement uuid="73582b2a-b21b-4637-990c-aff7423a8e27" x="184" y="0" width="50" height="10"/>
|
||||
<reportElement uuid="73582b2a-b21b-4637-990c-aff7423a8e27" x="117" y="0" width="50" height="10"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top">
|
||||
<font size="7" isBold="false" isItalic="false"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{numerositef}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
|
||||
<reportElement uuid="29ae3fa8-9db1-46c8-bcf7-cb9aa7bc6eb3" mode="Transparent" x="284" y="0" width="66" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<reportElement uuid="29ae3fa8-9db1-46c8-bcf7-cb9aa7bc6eb3" mode="Transparent" x="217" y="0" width="66" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
|
@ -272,7 +283,7 @@
|
|||
<textFieldExpression><![CDATA[$F{autorizacao}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy">
|
||||
<reportElement uuid="bfb9d635-bbc1-4e92-890a-df8299bc8daa" x="2" y="0" width="182" height="10" isPrintWhenDetailOverflows="true"/>
|
||||
<reportElement uuid="bfb9d635-bbc1-4e92-890a-df8299bc8daa" x="2" y="0" width="115" height="10" isPrintWhenDetailOverflows="true"/>
|
||||
<textElement verticalAlignment="Top">
|
||||
<font size="7" isBold="false" isItalic="false"/>
|
||||
</textElement>
|
||||
|
@ -315,13 +326,21 @@
|
|||
<textFieldExpression><![CDATA[$F{numfoliosistema}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
|
||||
<reportElement uuid="c25823fc-1130-4b93-bb7b-c6dd9c8fb6b3" mode="Transparent" x="350" y="0" width="66" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<reportElement uuid="c25823fc-1130-4b93-bb7b-c6dd9c8fb6b3" mode="Transparent" x="283" y="0" width="66" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{datadevolucao}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
|
||||
<reportElement uuid="97d702dc-422a-49a2-bf61-0c4b70e1d092" mode="Transparent" x="349" y="0" width="66" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{valor_total_compra}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</detail>
|
||||
<summary>
|
||||
|
|
Loading…
Reference in New Issue