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.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Bandbox;
@ -63,6 +65,8 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
private Datebox datInicial;
private Datebox datFinal;
private MyListbox puntoVentaSelList;
private Combobox cmbEmpresa;
private List<Empresa> lsEmpresa;
@ -73,8 +77,6 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
Timestamp dataInicio = new Timestamp(((java.util.Date) this.datInicial.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());
@ -92,17 +94,22 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
GregorianCalendar auxDataFinal = (GregorianCalendar) GregorianCalendar.getInstance();
auxDataFinal.setTimeInMillis(dataFinal.getTime());
year = auxDataFinal.get(Calendar.YEAR);
month = auxDataFinal.get(Calendar.MONTH);
date = auxDataFinal.get(Calendar.DATE);
hourOfDay = 23;
minute = 59;
second = 59;
auxDataFinal.set(year, month, date, hourOfDay, minute, second);
dataFinal = new Timestamp(auxDataFinal.getTimeInMillis());
}
parametros.put("DATA_INICIO", dataInicio);
parametros.put("DATA_FINAL", dataFinal);
lsNumPuntoVenta = new ArrayList(Arrays.asList(puntoVentaSelList.getData()));
if (lsNumPuntoVenta.size() > 0) {
String puntoVentaExpression = null;
for (PuntoVenta p : lsNumPuntoVenta) {
@ -112,7 +119,6 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
puntoVentaExpression += ", " + p.getPuntoventaId().toString();
}
}
System.out.println(puntoVentaExpression);
parametros.put("PUNTOVENTA_ID", puntoVentaExpression);
parametros.put("PUNTOVENTA", puntoVentaExpression);
} else {
@ -148,17 +154,22 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
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) {
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) {
@ -193,21 +204,23 @@ public class RelatorioTrechoVendidoController extends MyGenericForwardComposer {
plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
// if (puntoVentaList.getData().length == 0) {
// try {
// Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
// Labels.getLabel("relatorioTrechoVendidoController.window.title"),
// Messagebox.OK, Messagebox.INFORMATION);
// } catch (InterruptedException ex) {
// }
// }
if (puntoVentaList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioReceitaDiariaAgenciaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
lsEmpresa = empresaService.obtenerTodos();
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
puntoVentaSelList.setItemRenderer(new RenderPuntoVentaSimple());
}
public DataSource getDataSource() {