fixes bug #7678
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@57839 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
f2e92d5219
commit
11a97d970c
|
@ -5,7 +5,6 @@ import java.sql.ResultSet;
|
|||
import java.sql.SQLException;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
|
@ -18,7 +17,6 @@ import java.util.TreeSet;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
|
@ -147,34 +145,21 @@ public class RelatorioMovimentosAtraso extends Relatorio {
|
|||
NamedParameterStatement stmt = null;
|
||||
try {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT DISTINCT B.PUNTOVENTA_ID, TO_DATE(B.FECHORVENTA,'DD/MM/YYYY') AS FECHORVENTA ")
|
||||
sQuery.append("SELECT B.PUNTOVENTA_ID, TO_DATE(B.FECHORVENTA,'DD/MM/YYYY') AS FECHORVENTA ")
|
||||
.append("FROM BOLETO B ")
|
||||
.append("INNER JOIN MARCA M ON B.MARCA_ID = M.MARCA_ID ")
|
||||
.append("WHERE B.ACTIVO = 1 ")
|
||||
.append("AND TO_DATE(B.FECHORVENTA,'DD/MM/YYYY') BETWEEN TO_DATE(:dataInicial,'DD/MM/YYYY') AND TO_DATE(:dataFinal,'DD/MM/YYYY') ")
|
||||
.append("AND B.TIPOVENTA_ID IN (")
|
||||
.append(Arrays.asList(Constantes.TPV_BOLETO_REMOTO,Constantes.TPV_MANUAL,Constantes.TPV_DIRECTO_NORMAL, Constantes.TPV_TRANSFERENCIAS).toString().replaceAll("[^0-9,]", ""))
|
||||
.append(") ")
|
||||
.append("AND ( ")
|
||||
.append(" (B.INDSTATUSBOLETO = 'V' AND (B.MOTIVOCANCELACION_ID IS NULL OR B.MOTIVOCANCELACION_ID IN (")
|
||||
.append(Arrays.asList(Constantes.MVO_CANCEL_CANCELACION,Constantes.MVO_CANCEL_DEVOLUCAO,Constantes.MVO_CANCEL_TROCA).toString().replaceAll("[^0-9,]", ""))
|
||||
.append(" ))) ")
|
||||
.append(" OR ")
|
||||
.append(" (B.INDSTATUSBOLETO = 'C' AND B.MOTIVOCANCELACION_ID IN (")
|
||||
.append(Arrays.asList(Constantes.MVO_CANCEL_CANCELACION,Constantes.MVO_CANCEL_DEVOLUCAO).toString().replaceAll("[^0-9,]", ""))
|
||||
.append(" )) ")
|
||||
.append(" OR ")
|
||||
.append(" (B.INDSTATUSBOLETO = 'T' AND (B.MOTIVOCANCELACION_ID IS NULL OR B.MOTIVOCANCELACION_ID IN (")
|
||||
.append(Arrays.asList(Constantes.MVO_CANCEL_CANCELACION,Constantes.MVO_CANCEL_DEVOLUCAO).toString().replaceAll("[^0-9,]", ""))
|
||||
.append(" ))) ")
|
||||
.append(" ) ");
|
||||
.append("AND B.FECHORVENTA BETWEEN :dataInicial AND :dataFinal ");
|
||||
|
||||
if(empresaId != null) {
|
||||
sQuery.append("AND B.EMPRESACORRIDA_ID = :empresaId ");
|
||||
sQuery.append("AND M.EMPRESA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if(puntoventaId != null) {
|
||||
sQuery.append("AND B.PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
sQuery.append("GROUP BY B.PUNTOVENTA_ID, TO_DATE(B.FECHORVENTA, 'DD/MM/YYYY') ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
|
@ -342,8 +327,8 @@ public class RelatorioMovimentosAtraso extends Relatorio {
|
|||
cal.set(Calendar.MONTH, Integer.valueOf(vetCompetencia[0]) - 1);
|
||||
cal.set(Calendar.YEAR, Integer.valueOf(vetCompetencia[1]));
|
||||
|
||||
this.dataInicial = DateUtil.getDateFromString(cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "/" + competencia, "dd/MM/yyyy");
|
||||
this.dataFinal = DateUtil.getDateFromString(cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "/" + competencia, "dd/MM/yyyy");
|
||||
this.dataInicial = DateUtil.inicioFecha(DateUtil.getDateFromString(cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "/" + competencia, "dd/MM/yyyy"));
|
||||
this.dataFinal = DateUtil.fimFecha(DateUtil.getDateFromString(cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "/" + competencia, "dd/MM/yyyy"));
|
||||
}
|
||||
|
||||
if(status != null) {
|
||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
<?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="RelatorioMovimentosAtraso" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="822" leftMargin="10" rightMargin="10" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4">
|
||||
<property name="ireport.zoom" value="1.5"/>
|
||||
<property name="ireport.zoom" value="0.75"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<style name="Crosstab Data Text" hAlign="Center"/>
|
||||
|
@ -49,28 +49,28 @@
|
|||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="0" y="60" width="637" height="20" uuid="a16eb33b-78ca-4fb4-80c2-f5c85a0d09c3"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{cabecalho.puntoventa} + " " + $P{puntoventa}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="0" y="80" width="801" height="20" uuid="979b7126-0e47-4885-8a07-d8f9aa75a204"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{cabecalho.usuario} + " " + $P{usuario}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="0" y="40" width="637" height="20" uuid="90cdfa43-be94-4edc-b974-e267d2c5e82a"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{cabecalho.empresa} + " " + $P{empresa}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="0" y="20" width="637" height="20" uuid="f75c1624-725f-4ed7-9db7-7d396221d505"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{cabecalho.competencia} + " " + $P{competencia}]]></textFieldExpression>
|
||||
</textField>
|
||||
|
@ -95,42 +95,42 @@
|
|||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="82" y="0" width="151" height="20" uuid="3f75c9b2-2080-4269-aadc-c7b914f07203"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.puntoventa}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="233" y="0" width="105" height="20" uuid="0b6d3444-aed1-4928-8f1a-d4b48b269ec7"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.telefone}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="338" y="0" width="42" height="20" uuid="8b479f1f-b6d6-4b33-a8f4-d72551fa3def"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.uf}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="380" y="0" width="200" height="20" uuid="b2bbb907-984f-409e-9e36-c9f8e45361b6"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.subordinante}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="580" y="0" width="114" height="20" uuid="e0e1ce89-2e4d-4b99-bbc0-542bb917f3d7"/>
|
||||
<reportElement stretchType="RelativeToTallestObject" x="580" y="0" width="82" height="20" uuid="e0e1ce89-2e4d-4b99-bbc0-542bb917f3d7"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.periodicidade}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="694" y="0" width="128" height="20" uuid="8c5a026b-3efc-4830-994b-158fd657c748"/>
|
||||
<reportElement stretchType="RelativeToTallestObject" x="662" y="0" width="160" height="20" uuid="8c5a026b-3efc-4830-994b-158fd657c748"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.diasEmAtraso}]]></textFieldExpression>
|
||||
</textField>
|
||||
|
@ -140,7 +140,7 @@
|
|||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="82" height="20" uuid="34f306b0-fcd2-421c-84b8-8b863c4ee958"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
<font size="6" isBold="true"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.numpuntoventa}]]></textFieldExpression>
|
||||
</textField>
|
||||
|
@ -149,31 +149,52 @@
|
|||
<detail>
|
||||
<band height="25">
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="694" y="0" width="128" height="20" uuid="dc1ce697-5085-42fb-aa3f-15dc7368cd50"/>
|
||||
<reportElement stretchType="RelativeToTallestObject" x="662" y="0" width="160" height="20" uuid="dc1ce697-5085-42fb-aa3f-15dc7368cd50"/>
|
||||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{strDiasEmAtraso}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="580" y="0" width="114" height="20" uuid="c479c5c1-f2f1-4c10-b812-19b8f371a912"/>
|
||||
<reportElement stretchType="RelativeToTallestObject" x="580" y="0" width="82" height="20" uuid="c479c5c1-f2f1-4c10-b812-19b8f371a912"/>
|
||||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{desIntervalofechamento}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="380" y="0" width="200" height="20" uuid="b1576f5b-e86a-4713-81ad-9d394c34fa7e"/>
|
||||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{nombpuntoventaPadre}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="338" y="0" width="42" height="20" uuid="10823e45-0be5-4ac1-9948-a3428923d075"/>
|
||||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{uf}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="233" y="0" width="105" height="20" uuid="673869d3-710d-4bbd-8545-9b2d70a18541"/>
|
||||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{numtelefonouno}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="82" height="20" uuid="426ff840-8693-4d88-8372-00797accab08"/>
|
||||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{numPuntoVenta}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="82" y="0" width="151" height="20" uuid="f0fd7c82-9814-48bb-a6cd-a078eea4672c"/>
|
||||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{nombpuntoventa}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
|
|
Loading…
Reference in New Issue