fixes bug#0011515
dev: emerson qua: renato.oliveira git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@83714 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2e26cd8883
commit
63860ec403
|
@ -26,6 +26,7 @@ public class RelatorioDiferencasTransferencias extends Relatorio {
|
||||||
|
|
||||||
private final class ArrayDataSourceTransferencia extends ArrayDataSource {
|
private final class ArrayDataSourceTransferencia extends ArrayDataSource {
|
||||||
|
|
||||||
|
private static final String FILTRO_POR_TODOS = "-1";
|
||||||
private static final String FIELD_VALOR_DIFERENCA = "valor_diferenca";
|
private static final String FIELD_VALOR_DIFERENCA = "valor_diferenca";
|
||||||
private static final String FIELD_DATA_FINAL = "DATA_FINAL";
|
private static final String FIELD_DATA_FINAL = "DATA_FINAL";
|
||||||
private static final String FIELD_DATA_INICIAL = "DATA_INICIAL";
|
private static final String FIELD_DATA_INICIAL = "DATA_INICIAL";
|
||||||
|
@ -117,7 +118,7 @@ public class RelatorioDiferencasTransferencias extends Relatorio {
|
||||||
private boolean filtrarTodos(String parametro) {
|
private boolean filtrarTodos(String parametro) {
|
||||||
String ids = (String)parametros.get(parametro);
|
String ids = (String)parametros.get(parametro);
|
||||||
for (int i = 0; i < ids.split(", ").length; i++) {
|
for (int i = 0; i < ids.split(", ").length; i++) {
|
||||||
if ("-1".equals(ids.split(", ")[i])) {
|
if (FILTRO_POR_TODOS.equals(ids.split(", ")[i])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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="RelatorioDiferencasTransferencias" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="704929c0-c799-46a5-9ca8-3e21a3f3f8b3">
|
<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="RelatorioDiferencasTransferencias" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="704929c0-c799-46a5-9ca8-3e21a3f3f8b3">
|
||||||
<property name="ireport.zoom" value="1.0"/>
|
<property name="ireport.zoom" value="1.0"/>
|
||||||
<property name="ireport.x" value="86"/>
|
<property name="ireport.x" value="0"/>
|
||||||
<property name="ireport.y" value="0"/>
|
<property name="ireport.y" value="0"/>
|
||||||
<parameter name="FILTROS" class="java.lang.String"/>
|
<parameter name="FILTROS" class="java.lang.String"/>
|
||||||
<parameter name="USUARIO" class="java.lang.String"/>
|
<parameter name="USUARIO" class="java.lang.String"/>
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{valor_diferenca}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{valor_diferenca}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField pattern="dd/MM/yyyy">
|
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
|
||||||
<reportElement uuid="f328e3a4-f1d7-46f6-9d02-9bfd4ad1d512" x="160" y="0" width="72" height="20"/>
|
<reportElement uuid="f328e3a4-f1d7-46f6-9d02-9bfd4ad1d512" x="160" y="0" width="72" height="20"/>
|
||||||
<textElement textAlignment="Left">
|
<textElement textAlignment="Left">
|
||||||
<font size="10"/>
|
<font size="10"/>
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -96,7 +95,8 @@ public class RelatorioDiferencasTransferenciasController extends MyGenericForwar
|
||||||
|
|
||||||
public void onDoubleClick$empresaList(Event ev) {
|
public void onDoubleClick$empresaList(Event ev) {
|
||||||
Empresa empresa = (Empresa) empresaList.getSelected();
|
Empresa empresa = (Empresa) empresaList.getSelected();
|
||||||
if (!Arrays.asList(empresaSelList.getData()).contains(empresa)) {
|
if (empresa!= null &&
|
||||||
|
!Arrays.asList(empresaSelList.getData()).contains(empresa)) {
|
||||||
empresaSelList.addItemNovo(empresa);
|
empresaSelList.addItemNovo(empresa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,8 @@ public class RelatorioDiferencasTransferenciasController extends MyGenericForwar
|
||||||
|
|
||||||
public void onDoubleClick$puntoVentaList(Event ev) {
|
public void onDoubleClick$puntoVentaList(Event ev) {
|
||||||
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
|
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
|
||||||
if (!Arrays.asList(puntoVentaSelectedList.getData()).contains(puntoVenta)) {
|
if (puntoVenta != null
|
||||||
|
&& !Arrays.asList(puntoVentaSelectedList.getData()).contains(puntoVenta)) {
|
||||||
puntoVentaSelectedList.addItemNovo(puntoVenta);
|
puntoVentaSelectedList.addItemNovo(puntoVenta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,26 +155,26 @@ public class RelatorioDiferencasTransferenciasController extends MyGenericForwar
|
||||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||||
StringBuilder filtro = new StringBuilder();
|
StringBuilder filtro = new StringBuilder();
|
||||||
|
|
||||||
configuraFiltro(filtro, datInicial, "Início período: ");
|
|
||||||
configuraFiltro(filtro, datFinal, "Fim período: ");
|
|
||||||
|
|
||||||
parametros.put("DATA_INICIAL", (java.util.Date) datInicial.getValue());
|
parametros.put("DATA_INICIAL", (java.util.Date) datInicial.getValue());
|
||||||
parametros.put("DATA_FINAL", (java.util.Date) datFinal.getValue());
|
parametros.put("DATA_FINAL", (java.util.Date) datFinal.getValue());
|
||||||
|
|
||||||
List<Object> listaEmpresa = Arrays.asList(empresaSelList.getData());
|
List<Empresa> listaEmpresa = (List<Empresa>)(Object)Arrays.asList(empresaSelList.getData());
|
||||||
if (!listaEmpresa.isEmpty()) {
|
if (!listaEmpresa.isEmpty()) {
|
||||||
parametros.put("EMPRESA_ID", getIdsEmpresa(listaEmpresa));
|
parametros.put("EMPRESA_ID", getIdsEmpresa(listaEmpresa));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Object> listaPontosVenda = Arrays.asList(puntoVentaSelectedList.getData());
|
List<PuntoVenta> listaPontosVenda = (List<PuntoVenta>)(Object)Arrays.asList(puntoVentaSelectedList.getData());
|
||||||
if (!listaPontosVenda.isEmpty()) {
|
if (!listaPontosVenda.isEmpty()) {
|
||||||
parametros.put("PUNTOVENTA_ID", getIdsPontoVenda(listaPontosVenda));
|
parametros.put("PUNTOVENTA_ID", getIdsPontoVenda(listaPontosVenda));
|
||||||
|
configuraFiltroAgencia(filtro, listaPontosVenda);
|
||||||
|
} else {
|
||||||
|
filtro.append(" Agências: TODAS");
|
||||||
}
|
}
|
||||||
|
|
||||||
parametros.put("FILTROS", filtro.toString());
|
parametros.put("FILTROS", filtro.toString());
|
||||||
|
|
||||||
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioDiferencasTransferenciasController.window.title"));
|
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioDiferencasTransferenciasController.window.title"));
|
||||||
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
|
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getNombusuario());
|
||||||
|
|
||||||
relatorio = new RelatorioDiferencasTransferencias(parametros, dataSourceRead.getConnection());
|
relatorio = new RelatorioDiferencasTransferencias(parametros, dataSourceRead.getConnection());
|
||||||
|
|
||||||
|
@ -185,32 +186,32 @@ public class RelatorioDiferencasTransferenciasController extends MyGenericForwar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getIdsEmpresa(List<Object> listaEmpresa) {
|
private void configuraFiltroAgencia(StringBuilder filtro, List<PuntoVenta> lista) {
|
||||||
|
filtro.append(" Agências: ");
|
||||||
|
for (PuntoVenta pontoVenda : lista) {
|
||||||
|
filtro.append(pontoVenda.getNombpuntoventa());
|
||||||
|
filtro.append(", ");
|
||||||
|
}
|
||||||
|
filtro.delete(filtro.length()-2, filtro.length());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getIdsEmpresa(List<Empresa> lista) {
|
||||||
String ids = "";
|
String ids = "";
|
||||||
for (Object empresa : listaEmpresa) {
|
for (Empresa empresa : lista) {
|
||||||
ids += ((Empresa)empresa).getEmpresaId() +", ";
|
ids += empresa.getEmpresaId() +", ";
|
||||||
}
|
}
|
||||||
return ids.substring(0, ids.length()-2);
|
return ids.substring(0, ids.length()-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getIdsPontoVenda(List<Object> listaPontosVenda) {
|
private String getIdsPontoVenda(List<PuntoVenta> lista) {
|
||||||
String ids = "";
|
StringBuilder ids = new StringBuilder();
|
||||||
for (Object pontoVenda : listaPontosVenda) {
|
for (PuntoVenta pontoVenda : lista) {
|
||||||
ids += ((PuntoVenta)pontoVenda).getPuntoventaId() +", ";
|
ids.append(pontoVenda.getPuntoventaId());
|
||||||
|
ids.append(", ");
|
||||||
}
|
}
|
||||||
return ids.substring(0, ids.length()-2);
|
return ids.substring(0, ids.length()-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private StringBuilder configuraFiltro(StringBuilder filtro, Datebox campoData, String labelCampo) {
|
|
||||||
filtro.append(labelCampo);
|
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
cal.setTime(campoData.getValue());
|
|
||||||
filtro.append(cal.get(Calendar.DATE) + "/");
|
|
||||||
filtro.append((cal.get(Calendar.MONTH) + 1) + "/");
|
|
||||||
filtro.append(cal.get(Calendar.YEAR) + "; ");
|
|
||||||
return filtro;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isPeriodoValido() {
|
private boolean isPeriodoValido() {
|
||||||
return datFinal.getValue().compareTo(datInicial.getValue()) >= 0;
|
return datFinal.getValue().compareTo(datInicial.getValue()) >= 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,9 @@ public class RenderPuntoVentaSimple implements ListitemRenderer {
|
||||||
|
|
||||||
public void render(Listitem lstm, Object o) throws Exception {
|
public void render(Listitem lstm, Object o) throws Exception {
|
||||||
PuntoVenta puntoVenta = (PuntoVenta) o;
|
PuntoVenta puntoVenta = (PuntoVenta) o;
|
||||||
|
if (puntoVenta == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Listcell lc = new Listcell(puntoVenta.getNumPuntoVenta());
|
Listcell lc = new Listcell(puntoVenta.getNumPuntoVenta());
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
|
@ -14,7 +14,9 @@ public class RenderRelatorioGenericoEmpresasSel implements ListitemRenderer {
|
||||||
@Override
|
@Override
|
||||||
public void render(Listitem lstm, Object o) throws Exception {
|
public void render(Listitem lstm, Object o) throws Exception {
|
||||||
Empresa empresa = (Empresa) o;
|
Empresa empresa = (Empresa) o;
|
||||||
|
if (empresa == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Listcell lc = new Listcell(empresa.getEmpresaId().toString());
|
Listcell lc = new Listcell(empresa.getEmpresaId().toString());
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue