fixes bug#15327
dev: qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@96696 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
d68b31d2aa
commit
8b2592855e
|
@ -27,10 +27,13 @@ public class RelatorioVendasRequisicao extends Relatorio {
|
|||
private Integer empresaId;
|
||||
private Integer puntoventaId;
|
||||
private Integer secretariaId;
|
||||
private boolean agruparCliente;
|
||||
|
||||
public RelatorioVendasRequisicao(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||
public RelatorioVendasRequisicao(Map<String, Object> parametros, Connection conexao, boolean agruparCliente) throws Exception {
|
||||
super(parametros, conexao);
|
||||
|
||||
this.agruparCliente = agruparCliente;
|
||||
|
||||
this.setCustomDataSource(new DataSource(this) {
|
||||
|
||||
@Override
|
||||
|
@ -111,6 +114,12 @@ public class RelatorioVendasRequisicao extends Relatorio {
|
|||
bean.setImporte(rset.getBigDecimal("IMPORTE"));
|
||||
bean.setQtde(rset.getInt("QTDE"));
|
||||
|
||||
if (agruparCliente) {
|
||||
bean.setDescricaogrupo(bean.getSecretariaId() + "- " + bean.getDescsecretaria());
|
||||
} else {
|
||||
bean.setDescricaogrupo(bean.getNombpuntoventa());
|
||||
}
|
||||
|
||||
lsDadosRelatorio.add(bean);
|
||||
}
|
||||
|
||||
|
@ -175,8 +184,13 @@ public class RelatorioVendasRequisicao extends Relatorio {
|
|||
sQuery.append("AND SEC.SECRETARIA_ID = :SECRETARIA_ID ");
|
||||
}
|
||||
|
||||
sQuery.append("GROUP BY CDP.NUMDOCUMENTO, SEC.CVESECRETARIA, SEC.DESCSECRETARIA,PV.NOMBPUNTOVENTA, PV.NOMBPUNTOVENTA, E.NOMBEMPRESA, E.EMPRESA_ID, FP.DESCPAGO, CFP.FORMAPAGO_ID, ORI.DESCPARADA, DES.DESCPARADA, CFP.IMPORTE, ORI.CVEPARADA, DES.CVEPARADA, PV.PUNTOVENTA_ID ")
|
||||
.append("ORDER BY SEC.DESCSECRETARIA, PV.NOMBPUNTOVENTA, FP.DESCPAGO");
|
||||
sQuery.append("GROUP BY CDP.NUMDOCUMENTO, SEC.CVESECRETARIA, SEC.DESCSECRETARIA,PV.NOMBPUNTOVENTA, PV.NOMBPUNTOVENTA, E.NOMBEMPRESA, E.EMPRESA_ID, FP.DESCPAGO, CFP.FORMAPAGO_ID, ORI.DESCPARADA, DES.DESCPARADA, CFP.IMPORTE, ORI.CVEPARADA, DES.CVEPARADA, PV.PUNTOVENTA_ID ");
|
||||
|
||||
if (agruparCliente) {
|
||||
sQuery.append("ORDER BY SEC.DESCSECRETARIA, PV.NOMBPUNTOVENTA, FP.DESCPAGO");
|
||||
} else {
|
||||
sQuery.append("ORDER BY PV.NOMBPUNTOVENTA, SEC.DESCSECRETARIA, FP.DESCPAGO");
|
||||
}
|
||||
|
||||
return sQuery.toString();
|
||||
|
||||
|
|
|
@ -16,3 +16,4 @@ label.nombPuntoVenta=Ag
|
|||
label.total=Total
|
||||
label.puntoVenta=Agência:
|
||||
label.diferenca=Diferença
|
||||
label.cliente=Cliente
|
|
@ -16,3 +16,4 @@ label.nombPuntoVenta=Ag
|
|||
label.total=Total
|
||||
label.puntoVenta=Agência:
|
||||
label.diferenca=Diferença
|
||||
label.cliente=Cliente
|
Binary file not shown.
|
@ -1,14 +1,17 @@
|
|||
<?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="RelatorioVendasRequisicao" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4">
|
||||
<property name="ireport.zoom" value="1.5"/>
|
||||
<property name="ireport.x" value="554"/>
|
||||
<property name="ireport.y" value="78"/>
|
||||
<property name="ireport.x" value="0"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<style name="Crosstab Data Text" hAlign="Center"/>
|
||||
<parameter name="fecInicio" class="java.lang.String"/>
|
||||
<parameter name="fecFinal" class="java.lang.String"/>
|
||||
<parameter name="noDataRelatorio" class="java.lang.String"/>
|
||||
<parameter name="empresa" class="java.lang.String"/>
|
||||
<parameter name="puntoventa" class="java.lang.String"/>
|
||||
<parameter name="CABECALHO_AGRUPAMENTO_LABEL" class="java.lang.String"/>
|
||||
<parameter name="CABECALHO_AGRUPAMENTO_DESCRICAO" class="java.lang.String"/>
|
||||
<parameter name="AGRUPAMENTO_LABEL" class="java.lang.String"/>
|
||||
<queryString>
|
||||
<![CDATA[]]>
|
||||
</queryString>
|
||||
|
@ -24,6 +27,7 @@
|
|||
<field name="secretariaId" class="java.lang.Integer"/>
|
||||
<field name="descsecretaria" class="java.lang.String"/>
|
||||
<field name="numdocumento" class="java.lang.String"/>
|
||||
<field name="descricaogrupo" class="java.lang.String"/>
|
||||
<variable name="importe_1" class="java.math.BigDecimal" resetType="Group" resetGroup="secretariagroup" calculation="Sum">
|
||||
<variableExpression><![CDATA[$F{importe}]]></variableExpression>
|
||||
</variable>
|
||||
|
@ -38,7 +42,7 @@
|
|||
<variableExpression><![CDATA[$F{importe}]]></variableExpression>
|
||||
</variable>
|
||||
<group name="secretariagroup">
|
||||
<groupExpression><![CDATA[$F{descsecretaria}]]></groupExpression>
|
||||
<groupExpression><![CDATA[$F{descricaogrupo}]]></groupExpression>
|
||||
<groupHeader>
|
||||
<band height="40">
|
||||
<staticText>
|
||||
|
@ -49,8 +53,8 @@
|
|||
<text><![CDATA[Origem]]></text>
|
||||
</staticText>
|
||||
<textField>
|
||||
<reportElement x="53" y="0" width="748" height="20" uuid="8fc0dadc-9470-4614-9ed8-588df8f619a5"/>
|
||||
<textFieldExpression><![CDATA[$F{secretariaId}+" - "+$F{descsecretaria}]]></textFieldExpression>
|
||||
<reportElement x="0" y="0" width="802" height="20" uuid="8fc0dadc-9470-4614-9ed8-588df8f619a5"/>
|
||||
<textFieldExpression><![CDATA[$P{AGRUPAMENTO_LABEL} + ": " + $F{descricaogrupo}]]></textFieldExpression>
|
||||
</textField>
|
||||
<staticText>
|
||||
<reportElement x="410" y="20" width="210" height="20" uuid="3a02ce7f-5b2e-415f-a9b9-d744f1c2d3aa"/>
|
||||
|
@ -73,13 +77,6 @@
|
|||
</textElement>
|
||||
<text><![CDATA[QTDE]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="0" y="0" width="53" height="20" uuid="17a00e66-3046-44ae-829b-be9d6a6c7cc7"/>
|
||||
<textElement>
|
||||
<font isBold="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[CLIENTE:]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="0" y="20" width="190" height="20" uuid="f7d62619-9506-4382-af1a-aad3081a2ba1"/>
|
||||
<textElement textAlignment="Right">
|
||||
|
@ -149,12 +146,8 @@
|
|||
<text><![CDATA[Empresa:]]></text>
|
||||
</staticText>
|
||||
<textField>
|
||||
<reportElement x="0" y="57" width="53" height="20" uuid="1a29d731-e121-4507-8c0b-e93f437e8d80"/>
|
||||
<textFieldExpression><![CDATA[$R{label.puntoVenta}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="53" y="57" width="748" height="20" uuid="53d53aa5-d8c9-43c6-b17d-1e6b49697237"/>
|
||||
<textFieldExpression><![CDATA[$P{puntoventa}]]></textFieldExpression>
|
||||
<reportElement x="0" y="57" width="790" height="20" uuid="53d53aa5-d8c9-43c6-b17d-1e6b49697237"/>
|
||||
<textFieldExpression><![CDATA[$P{CABECALHO_AGRUPAMENTO_LABEL} + ": " + $P{CABECALHO_AGRUPAMENTO_DESCRICAO}]]></textFieldExpression>
|
||||
</textField>
|
||||
<line>
|
||||
<reportElement x="0" y="76" width="801" height="1" uuid="3a4eed21-70b4-44c0-8d34-8c53d44de3cf"/>
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.zkoss.zk.ui.Component;
|
|||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Comboitem;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Radio;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
|
@ -25,6 +26,7 @@ import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasRequisicao;
|
|||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.ConstraintNoEmpty;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxSecretaria;
|
||||
|
@ -48,16 +50,41 @@ public class RelatorioVendasRequisicaoController extends MyGenericForwardCompose
|
|||
private MyComboboxPuntoVenta cmbPuntoVenta;
|
||||
private MyComboboxSecretaria cmbSecretaria;
|
||||
|
||||
// Mantis 15327
|
||||
// Radios que vão definir se o relatório será agrupado por cliente ou por ponto de venda
|
||||
private Radio radioTipoRelatorioPorCliente;
|
||||
private Radio radioTipoRelatorioPorPontoVenda;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
this.lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||
this.radioTipoRelatorioPorCliente.setChecked(true);
|
||||
this.radioTipoRelatorioPorPontoVenda.setChecked(false);
|
||||
}
|
||||
|
||||
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
||||
excutarRelatorios();
|
||||
}
|
||||
|
||||
public void onClick$radioTipoRelatorioPorCliente(Event ev) throws Exception {
|
||||
this.radioTipoRelatorioPorCliente.setChecked(true);
|
||||
this.radioTipoRelatorioPorPontoVenda.setChecked(false);
|
||||
this.cmbPuntoVenta.setConstraint(new ConstraintNoEmpty());
|
||||
this.cmbPuntoVenta.getValue();
|
||||
this.cmbSecretaria.setConstraint("");
|
||||
this.cmbSecretaria.getValue();
|
||||
}
|
||||
|
||||
public void onClick$radioTipoRelatorioPorPontoVenda(Event ev) throws Exception {
|
||||
this.radioTipoRelatorioPorCliente.setChecked(false);
|
||||
this.radioTipoRelatorioPorPontoVenda.setChecked(true);
|
||||
this.cmbPuntoVenta.setConstraint("");
|
||||
this.cmbPuntoVenta.getValue();
|
||||
this.cmbSecretaria.setConstraint(new ConstraintNoEmpty());
|
||||
this.cmbSecretaria.getValue();
|
||||
}
|
||||
|
||||
public void excutarRelatorios() throws SQLException, Exception {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
|
@ -81,12 +108,16 @@ public class RelatorioVendasRequisicaoController extends MyGenericForwardCompose
|
|||
parametros.put("empresa", "Todas;");
|
||||
}
|
||||
|
||||
String nombpuntoventa = "";
|
||||
String descsecretaria = "";
|
||||
|
||||
Comboitem itemPuntoventa = cmbPuntoVenta.getSelectedItem();
|
||||
if(itemPuntoventa != null) {
|
||||
PuntoVenta puntoVenta = (PuntoVenta) itemPuntoventa.getValue();
|
||||
if(puntoVenta.getPuntoventaId() > -1) {
|
||||
nombpuntoventa = puntoVenta.getNombpuntoventa();
|
||||
parametros.put("PUNTOVENTA_ID", puntoVenta.getPuntoventaId());
|
||||
parametros.put("puntoventa", puntoVenta.getNombpuntoventa());
|
||||
parametros.put("puntoventa", nombpuntoventa);
|
||||
} else {
|
||||
parametros.put("puntoventa", "Todas;");
|
||||
}
|
||||
|
@ -99,6 +130,7 @@ public class RelatorioVendasRequisicaoController extends MyGenericForwardCompose
|
|||
if(itemSecretaria != null) {
|
||||
Secretaria secretaria = (Secretaria) itemSecretaria.getValue();
|
||||
if(secretaria.getSecretariaId() > -1) {
|
||||
descsecretaria = secretaria.getDescsecretaria();
|
||||
parametros.put("SECRETARIA_ID", secretaria.getSecretariaId());
|
||||
parametros.put("secretaria", secretaria.getDescsecretaria());
|
||||
} else {
|
||||
|
@ -108,8 +140,18 @@ public class RelatorioVendasRequisicaoController extends MyGenericForwardCompose
|
|||
parametros.put("secretaria", "Todas;");
|
||||
}
|
||||
|
||||
if (radioTipoRelatorioPorCliente.isChecked()) {
|
||||
parametros.put("CABECALHO_AGRUPAMENTO_LABEL", Labels.getLabel("lb.puntoventa"));
|
||||
parametros.put("CABECALHO_AGRUPAMENTO_DESCRICAO", nombpuntoventa);
|
||||
parametros.put("AGRUPAMENTO_LABEL", Labels.getLabel("relatorioVendasRequisicaoController.cliente.label"));
|
||||
} else if (radioTipoRelatorioPorPontoVenda.isChecked()) {
|
||||
parametros.put("CABECALHO_AGRUPAMENTO_LABEL", Labels.getLabel("relatorioVendasRequisicaoController.cliente.label"));
|
||||
parametros.put("CABECALHO_AGRUPAMENTO_DESCRICAO", descsecretaria);
|
||||
parametros.put("AGRUPAMENTO_LABEL", Labels.getLabel("lb.puntoventa"));
|
||||
}
|
||||
|
||||
Map<String, Object> args = new HashMap<String, Object>();
|
||||
Relatorio relatorio = new RelatorioVendasRequisicao(parametros, dataSourceRead.getConnection());
|
||||
Relatorio relatorio = new RelatorioVendasRequisicao(parametros, dataSourceRead.getConnection(), radioTipoRelatorioPorCliente.isChecked());
|
||||
args.put("relatorio", relatorio);
|
||||
|
||||
openWindow("/component/reportView.zul",
|
||||
|
|
|
@ -8269,3 +8269,8 @@ viewTestEmailController.emailSubject = Mensagem de Teste do Email da empresa: {0
|
|||
viewTestEmailController.emailText = Este é um email enviado automaticamente pela ADM TotalBus durante o teste das configurações da sua conta.
|
||||
viewTestEmailController.semDestinatario = Não foi configurado usuário para envio.
|
||||
viewTestEmailController.destinatario = Destinatário
|
||||
|
||||
#relatorioVendasRequisicaoController
|
||||
relatorioVendasRequisicaoController.lbAgruparPor.label = Agrupar por
|
||||
relatorioVendasRequisicaoController.radioTipoRelatorioPorCliente.label = Ordem de Serviço - Secretaria
|
||||
relatorioVendasRequisicaoController.cliente.label = Cliente
|
|
@ -8775,3 +8775,8 @@ viewTestEmailController.emailSubject = Mensagem de Teste do Email da empresa: {0
|
|||
viewTestEmailController.emailText = Este é um email enviado automaticamente pela ADM TotalBus durante o teste das configurações da sua conta.
|
||||
viewTestEmailController.semDestinatario = Não foi configurado usuário para envio.
|
||||
viewTestEmailController.destinatario = Destinatário
|
||||
|
||||
#relatorioVendasRequisicaoController
|
||||
relatorioVendasRequisicaoController.lbAgruparPor.label = Agrupar por
|
||||
relatorioVendasRequisicaoController.radioTipoRelatorioPorCliente.label = Ordem de Serviço - Secretaria
|
||||
relatorioVendasRequisicaoController.cliente.label = Cliente
|
|
@ -7,13 +7,13 @@
|
|||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winFiltroRelatorioVendasRequisicao"
|
||||
apply="${relatorioVendasRequisicaoController}"
|
||||
contentStyle="overflow:auto" width="700px" border="normal">
|
||||
contentStyle="overflow:auto" width="900px" border="normal">
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="15%" />
|
||||
<column width="35%" />
|
||||
<column width="15%" />
|
||||
<column width="10%" />
|
||||
<column width="35%" />
|
||||
<column width="10%" />
|
||||
<column width="45%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
|
@ -48,13 +48,19 @@
|
|||
maxlength="10" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<row >
|
||||
<label
|
||||
value="${c:l('busquedaSecretariaController.window.title')}" />
|
||||
<combobox id="cmbSecretaria"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxSecretaria"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
/>
|
||||
|
||||
<label value="${c:l('relatorioVendasRequisicaoController.lbAgruparPor.label')}" />
|
||||
<radiogroup id="radiogroupTipoRelatorio">
|
||||
<radio id="radioTipoRelatorioPorCliente" label="${c:l('relatorioVendasRequisicaoController.radioTipoRelatorioPorCliente.label')}" />
|
||||
<radio id="radioTipoRelatorioPorPontoVenda" label="${c:l('lb.puntoventa')}" />
|
||||
</radiogroup>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
Loading…
Reference in New Issue