CORREÇÕES RELATORIO TRECHO VENDIDO

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@29586 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2013-07-30 19:02:01 +00:00
parent d18bcae11c
commit 5bcf2cee74
1 changed files with 51 additions and 38 deletions

View File

@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels; import org.zkoss.util.resource.Labels;
import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Bandbox; import org.zkoss.zul.Bandbox;
@ -63,6 +65,8 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
private Datebox datInicial; private Datebox datInicial;
private Datebox datFinal; private Datebox datFinal;
private MyListbox puntoVentaSelList;
private Combobox cmbEmpresa; private Combobox cmbEmpresa;
private List<Empresa> lsEmpresa; private List<Empresa> lsEmpresa;
@ -73,36 +77,39 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
Timestamp dataInicio = new Timestamp(((java.util.Date) this.datInicial.getValue()).getTime()); Timestamp dataInicio = new Timestamp(((java.util.Date) this.datInicial.getValue()).getTime());
Timestamp dataFinal = new Timestamp(((java.util.Date) this.datFinal.getValue()).getTime()); Timestamp dataFinal = new Timestamp(((java.util.Date) this.datFinal.getValue()).getTime());
if (dataInicio.equals(dataFinal)) { GregorianCalendar auxDataInicio = (GregorianCalendar) GregorianCalendar.getInstance();
auxDataInicio.setTimeInMillis(dataInicio.getTime());
GregorianCalendar auxDataInicio = (GregorianCalendar) GregorianCalendar.getInstance(); int year = auxDataInicio.get(Calendar.YEAR);
auxDataInicio.setTimeInMillis(dataInicio.getTime()); int month = auxDataInicio.get(Calendar.MONTH);
int date = auxDataInicio.get(Calendar.DATE);
int year = auxDataInicio.get(Calendar.YEAR); int hourOfDay = 00;
int month = auxDataInicio.get(Calendar.MONTH); int minute = 00;
int date = auxDataInicio.get(Calendar.DATE); int second = 00;
int hourOfDay = 00; auxDataInicio.set(year, month, date, hourOfDay, minute, second);
int minute = 00; dataInicio = new Timestamp(auxDataInicio.getTimeInMillis());
int second = 00;
auxDataInicio.set(year, month, date, hourOfDay, minute, second); GregorianCalendar auxDataFinal = (GregorianCalendar) GregorianCalendar.getInstance();
dataInicio = new Timestamp(auxDataInicio.getTimeInMillis()); auxDataFinal.setTimeInMillis(dataFinal.getTime());
GregorianCalendar auxDataFinal = (GregorianCalendar) GregorianCalendar.getInstance(); year = auxDataFinal.get(Calendar.YEAR);
auxDataFinal.setTimeInMillis(dataFinal.getTime()); month = auxDataFinal.get(Calendar.MONTH);
date = auxDataFinal.get(Calendar.DATE);
hourOfDay = 23; hourOfDay = 23;
minute = 59; minute = 59;
second = 59; second = 59;
auxDataFinal.set(year, month, date, hourOfDay, minute, second); auxDataFinal.set(year, month, date, hourOfDay, minute, second);
dataFinal = new Timestamp(auxDataFinal.getTimeInMillis()); dataFinal = new Timestamp(auxDataFinal.getTimeInMillis());
}
parametros.put("DATA_INICIO", dataInicio); parametros.put("DATA_INICIO", dataInicio);
parametros.put("DATA_FINAL", dataFinal); parametros.put("DATA_FINAL", dataFinal);
lsNumPuntoVenta = new ArrayList(Arrays.asList(puntoVentaSelList.getData()));
if (lsNumPuntoVenta.size() > 0) { if (lsNumPuntoVenta.size() > 0) {
String puntoVentaExpression = null; String puntoVentaExpression = null;
for (PuntoVenta p : lsNumPuntoVenta) { for (PuntoVenta p : lsNumPuntoVenta) {
@ -112,7 +119,6 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
puntoVentaExpression += ", " + p.getPuntoventaId().toString(); puntoVentaExpression += ", " + p.getPuntoventaId().toString();
} }
} }
System.out.println(puntoVentaExpression);
parametros.put("PUNTOVENTA_ID", puntoVentaExpression); parametros.put("PUNTOVENTA_ID", puntoVentaExpression);
parametros.put("PUNTOVENTA", puntoVentaExpression); parametros.put("PUNTOVENTA", puntoVentaExpression);
} else { } else {
@ -148,17 +154,22 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
Labels.getLabel("relatorioTrechoVendidoController.window.title"), args, MODAL); Labels.getLabel("relatorioTrechoVendidoController.window.title"), args, MODAL);
} }
public void onDoubleClick$puntoVentaList(Event ev) {
PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaList.getSelected();
puntoVentaSelList.addItemNovo(puntoVentaSel);
}
public void onDoubleClick$puntoVentaSelList(Event ev) {
PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaSelList.getSelected();
puntoVentaSelList.removeItem(puntoVentaSel);
}
public void onSelect$puntoVentaList(Event ev) { public void onSelect$puntoVentaList(Event ev) {
String strListPuntoVenta = new String();
ArrayList<Object> lsSelecionados = (ArrayList<Object>) puntoVentaList.getSelectedsItens();
lsNumPuntoVenta.clear();
for (Object objPuntoVenta : lsSelecionados) {
strListPuntoVenta = ((PuntoVenta) objPuntoVenta).getNombpuntoventa() + " " + strListPuntoVenta;
lsNumPuntoVenta.add(((PuntoVenta) objPuntoVenta));
}
this.bbPesquisaPuntoVenta.setValue(strListPuntoVenta);
} }
public void onClick$btnLimpar(Event ev) { public void onClick$btnLimpar(Event ev) {
@ -193,21 +204,23 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta); plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
// if (puntoVentaList.getData().length == 0) { if (puntoVentaList.getData().length == 0) {
// try { try {
// Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
// Labels.getLabel("relatorioTrechoVendidoController.window.title"), Labels.getLabel("relatorioReceitaDiariaAgenciaController.window.title"),
// Messagebox.OK, Messagebox.INFORMATION); Messagebox.OK, Messagebox.INFORMATION);
// } catch (InterruptedException ex) { } catch (InterruptedException ex) {
// } }
// } }
} }
@Override @Override
public void doAfterCompose(Component comp) throws Exception { public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp); super.doAfterCompose(comp);
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
lsEmpresa = empresaService.obtenerTodos(); lsEmpresa = empresaService.obtenerTodos();
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
puntoVentaSelList.setItemRenderer(new RenderPuntoVentaSimple());
} }
public DataSource getDataSource() { public DataSource getDataSource() {