bug #8121
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@64288 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4cc3c8c855
commit
b897718bf4
|
@ -11,13 +11,17 @@ import org.apache.log4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.lang.Objects;
|
||||||
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.WrongValueException;
|
import org.zkoss.zk.ui.WrongValueException;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zkplus.databind.BindingListModelList;
|
import org.zkoss.zkplus.databind.BindingListModelList;
|
||||||
import org.zkoss.zul.Comboitem;
|
import org.zkoss.zul.Comboitem;
|
||||||
|
import org.zkoss.zul.ComboitemRenderer;
|
||||||
import org.zkoss.zul.Datebox;
|
import org.zkoss.zul.Datebox;
|
||||||
|
import org.zkoss.zul.Radio;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Aidf;
|
import com.rjconsultores.ventaboletos.entidad.Aidf;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
@ -65,6 +69,8 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer {
|
||||||
private MyComboboxEstandar cmbEstado;
|
private MyComboboxEstandar cmbEstado;
|
||||||
private MyComboboxEstandar cmbAidf;
|
private MyComboboxEstandar cmbAidf;
|
||||||
|
|
||||||
|
private Radio radBPR;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
lsEmpresa = empresaService.obtenerTodos();
|
lsEmpresa = empresaService.obtenerTodos();
|
||||||
|
@ -89,8 +95,23 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
lsAidf = aidfService.buscaAidfRMD(empresa.getEmpresaId(), estado.getEstadoId());
|
lsAidf = aidfService.buscaAidfRMD(empresa.getEmpresaId(), estado.getEstadoId());
|
||||||
cmbAidf.setModel(new BindingListModelList(lsAidf, true));
|
|
||||||
|
|
||||||
|
ComboitemRenderer aidfRenderer = new ComboitemRenderer() {
|
||||||
|
public void render(Comboitem item, Object data) {
|
||||||
|
if (data instanceof Aidf) {
|
||||||
|
Aidf aidf = (Aidf) data;
|
||||||
|
String label = (aidf.getAidfId() == null ? "" : aidf.getAidfId().toString() + " - ") +
|
||||||
|
aidf.getSerie() +
|
||||||
|
(aidf.getSubserie() == null ? "" : "-" + aidf.getSubserie());
|
||||||
|
item.setLabel(label);
|
||||||
|
} else {
|
||||||
|
item.setLabel(Objects.toString(data));
|
||||||
|
}
|
||||||
|
item.setValue(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
cmbAidf.setItemRenderer(aidfRenderer);
|
||||||
|
cmbAidf.setModel(new BindingListModelList(lsAidf, true));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +132,7 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer {
|
||||||
if (itemEstado != null) {
|
if (itemEstado != null) {
|
||||||
estado = (Estado) itemEstado.getValue();
|
estado = (Estado) itemEstado.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemAidf != null) {
|
if (itemAidf != null) {
|
||||||
aidf = (Aidf) itemAidf.getValue();
|
aidf = (Aidf) itemAidf.getValue();
|
||||||
}
|
}
|
||||||
|
@ -118,11 +140,29 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer {
|
||||||
if (empresa != null && estado != null) {
|
if (empresa != null && estado != null) {
|
||||||
try {
|
try {
|
||||||
String rmd = null;
|
String rmd = null;
|
||||||
if (aidf != null)
|
if (aidf != null) {
|
||||||
rmd = aidf.getSerie() + aidf.getSubserie();
|
rmd = aidf.getSerie() + (aidf.getSubserie() == null ? "" : "-" + aidf.getSubserie());
|
||||||
|
} else {
|
||||||
|
Messagebox.show(
|
||||||
|
"É necessario selecionar um RMD",
|
||||||
|
Labels.getLabel("indexController.mnImpressaoRMD.label"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
}
|
||||||
|
|
||||||
List<ImpressaoRMD> list = fiscalService.getRegistroImpressaoRMDTipoDVB(dataSourceRead.getConnection(),
|
List<ImpressaoRMD> list = null;
|
||||||
datInicial.getValue(), datFinal.getValue(), empresa, estado, rmd);
|
if (radBPR.isChecked()) {
|
||||||
|
list = fiscalService.getRegistroImpressaoRMDTipoDVB(dataSourceRead.getConnection(),
|
||||||
|
datInicial.getValue(), datFinal.getValue(), empresa, estado, rmd);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
throw new NullPointerException("ERROR: NULL POINTER EXCEPTION");
|
||||||
|
|
||||||
|
// Messagebox.show(
|
||||||
|
// "Os relatórios de ECF ainda não estão sendo impressos.",
|
||||||
|
// Labels.getLabel("indexController.mnImpressaoRMD.label"),
|
||||||
|
// Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||||
parametros.put("list", list);
|
parametros.put("list", list);
|
||||||
|
@ -141,6 +181,10 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer {
|
||||||
log.error("", e);
|
log.error("", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("", e);
|
log.error("", e);
|
||||||
|
|
||||||
|
Messagebox.show(e.getMessage(),
|
||||||
|
Labels.getLabel("indexController.mnImpressaoRMD.label"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
<zk>
|
<zk>
|
||||||
<window id="winBusquedaImpressaoRMD"
|
<window id="winBusquedaImpressaoRMD"
|
||||||
title="${c:l('indexController.mnImpressaoRMD.label')}"
|
title="${c:l('indexController.mnImpressaoRMD.label')}"
|
||||||
apply="${busquedaImpressaoRMDController}"
|
apply="${busquedaImpressaoRMDController}" contentStyle="overflow:auto"
|
||||||
contentStyle="overflow:auto" width="660px" border="normal">
|
width="660px" border="normal">
|
||||||
|
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
|
@ -51,20 +51,25 @@
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row spans="1, 3">
|
<row spans="1, 3">
|
||||||
<label
|
<label value="RMD" />
|
||||||
value="RMD" />
|
|
||||||
<combobox id="cmbAidf" style="width: 483px;"
|
<combobox id="cmbAidf" style="width: 483px;"
|
||||||
mold="rounded" buttonVisible="true"
|
mold="rounded" buttonVisible="true"
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
model="@{winBusquedaImpressaoRMD$composer.lsAidf}" />
|
model="@{winBusquedaImpressaoRMD$composer.lsAidf}" />
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
<row spans="1, 3">
|
||||||
|
<label value="Tipo de Impressão: " />
|
||||||
|
<radiogroup Id="indTipo">
|
||||||
|
<radio id="radBPR" label="BPR" checked="true" />
|
||||||
|
<radio id="radECF" label="ECF" />
|
||||||
|
</radiogroup>
|
||||||
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
|
||||||
<toolbar>
|
<toolbar>
|
||||||
<button id="btnExecutar"
|
<button id="btnExecutar" image="/gui/img/enginer.png"
|
||||||
image="/gui/img/enginer.png"
|
|
||||||
label="${c:l('busquedaExportacaoFiscalController.btnExe.label')}" />
|
label="${c:l('busquedaExportacaoFiscalController.btnExe.label')}" />
|
||||||
</toolbar>
|
</toolbar>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue