fixes bug#0011329
dev: emerson qua: jose git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@83240 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4778505267
commit
a105d3a887
|
@ -14,82 +14,115 @@ import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
||||||
|
|
||||||
public class RelatorioDiferencasTransferencias extends Relatorio {
|
public class RelatorioDiferencasTransferencias extends Relatorio {
|
||||||
|
|
||||||
public RelatorioDiferencasTransferencias(Map<String, Object> parametros, Connection conexao) throws Exception
|
public RelatorioDiferencasTransferencias(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||||
{
|
|
||||||
super(parametros, conexao);
|
super(parametros, conexao);
|
||||||
|
|
||||||
this.setCustomDataSource(new ArrayDataSource(this) {
|
this.setCustomDataSource(new ArrayDataSourceTransferencia(this));
|
||||||
|
|
||||||
public void initDados() throws Exception {
|
|
||||||
Connection conexao = this.relatorio.getConexao();
|
|
||||||
Map<String, Object> parametros = this.relatorio.getParametros();
|
|
||||||
|
|
||||||
String sql = getSql();
|
|
||||||
|
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
|
||||||
|
|
||||||
stmt.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
|
|
||||||
stmt.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
|
|
||||||
|
|
||||||
ResultSet rset = stmt.executeQuery();
|
|
||||||
|
|
||||||
while (rset.next()) {
|
|
||||||
|
|
||||||
Map<String, Object> dataResult = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
dataResult.put("classe_original", rset.getString("classe_original"));
|
|
||||||
dataResult.put("total_pago_original", rset.getBigDecimal("total_pago_original"));
|
|
||||||
dataResult.put("classe_novo", rset.getString("classe_novo"));
|
|
||||||
dataResult.put("diferença_preço", rset.getBigDecimal("diferença_preço"));
|
|
||||||
|
|
||||||
this.dados.add(dataResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.resultSet = rset;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void processaParametros() throws Exception {
|
protected void processaParametros() throws Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSql() {
|
private final class ArrayDataSourceTransferencia extends ArrayDataSource {
|
||||||
StringBuilder sql = new StringBuilder();
|
|
||||||
|
private static final String FIELD_VALOR_DIFERENCA = "valor_diferenca";
|
||||||
|
private static final String FIELD_DATA_FINAL = "DATA_FINAL";
|
||||||
|
private static final String FIELD_DATA_INICIAL = "DATA_INICIAL";
|
||||||
|
private static final String FIELD_TOTAL_TRANSF = "total_transf";
|
||||||
|
private static final String FIELD_CLASSE_TRANSF = "classe_transf";
|
||||||
|
private static final String FIELD_TOTAL_ORIGINAL = "total_original";
|
||||||
|
private static final String FIELD_CLASSE_ORIGINAL = "classe_original";
|
||||||
|
private static final String FIELD_DESTINO = "destino";
|
||||||
|
private static final String FIELD_ORIGEM = "origem";
|
||||||
|
private static final String FIELD_BILHETE = "bilhete";
|
||||||
|
private static final String FIELD_AGENCIA_TRANSF = "agencia_transf";
|
||||||
|
private static final String FIELD_EMPRESA = "empresa";
|
||||||
|
|
||||||
sql.append(" SELECT CS_ORIG.DESCCLASE AS classe_original, ");
|
private ArrayDataSourceTransferencia(Relatorio relatorio) throws Exception {
|
||||||
sql.append(" (COALESCE(B_ORIG.PRECIOPAGADO, 0) + COALESCE(B_ORIG.IMPORTETAXAEMBARQUE, 0) + COALESCE(B_ORIG.IMPORTEPEDAGIO, 0) + COALESCE(B_ORIG.IMPORTEOUTROS, 0) + COALESCE(B_ORIG.IMPORTESEGURO, 0) ) AS total_pago_original, ");
|
super(relatorio);
|
||||||
sql.append(" CS_NOVO.DESCCLASE AS classe_novo, ");
|
}
|
||||||
sql.append(" (CASE WHEN TEE.DESCTIPOEVENTO LIKE 'Dif. Maior' THEN ( -1 * (COALESCE(ee.IMPINGRESO, 0)) ) ELSE (COALESCE(ee.IMPINGRESO, 0)) END) AS diferença_preço ");
|
|
||||||
sql.append(" FROM BOLETO B_NOVO ");
|
|
||||||
|
|
||||||
sql.append(" INNER JOIN CAJA_DIVERSOS CD ");
|
public void initDados() throws Exception {
|
||||||
sql.append(" ON CD.NUMOPERACION = B_NOVO.NUMOPERACION");
|
Connection conexao = this.relatorio.getConexao();
|
||||||
sql.append(" INNER JOIN EVENTO_EXTRA EE ");
|
Map<String, Object> parametros = this.relatorio.getParametros();
|
||||||
sql.append(" ON EE.EVENTOEXTRA_ID = CD.EVENTOEXTRA_ID ");
|
|
||||||
sql.append(" INNER JOIN TIPO_EVENTO_EXTRA TEE ");
|
|
||||||
sql.append(" ON TEE.TIPOEVENTOEXTRA_ID = EE.TIPOEVENTOEXTRA_ID ");
|
|
||||||
sql.append(" AND (TEE.DESCTIPOEVENTO LIKE 'Dif. Menor' OR TEE.DESCTIPOEVENTO LIKE 'Dif. Maior') ");
|
|
||||||
sql.append(" INNER JOIN BOLETO B_ORIG ");
|
|
||||||
sql.append(" ON B_ORIG.BOLETO_ID = B_NOVO.BOLETOORIGINAL_ID ");
|
|
||||||
sql.append(" INNER JOIN CLASE_SERVICIO CS_NOVO ");
|
|
||||||
sql.append(" ON CS_NOVO.CLASESERVICIO_ID = B_NOVO.CLASESERVICIO_ID ");
|
|
||||||
sql.append(" INNER JOIN CLASE_SERVICIO CS_ORIG ");
|
|
||||||
sql.append(" ON CS_ORIG.CLASESERVICIO_ID = B_ORIG.CLASESERVICIO_ID ");
|
|
||||||
|
|
||||||
sql.append("WHERE B_NOVO.INDSTATUSBOLETO LIKE 'T' ");
|
String sql = getSql(parametros);
|
||||||
sql.append(" AND B_NOVO.FECHORVENTA >= :DATA_INICIAL ");
|
|
||||||
sql.append(" AND B_NOVO.FECHORVENTA <= :DATA_FINAL ");
|
|
||||||
sql.append(" AND B_NOVO.BOLETOORIGINAL_ID IS NOT NULL ");
|
|
||||||
sql.append(" ORDER BY ");
|
|
||||||
sql.append(" CASE ");
|
|
||||||
sql.append(" WHEN cs_orig.DESCCLASE = cs_novo.DESCCLASE THEN 1 ");
|
|
||||||
sql.append(" WHEN cs_orig.DESCCLASE <> cs_novo.DESCCLASE THEN 2 ");
|
|
||||||
sql.append(" ELSE 3 ");
|
|
||||||
sql.append(" END asc, ");
|
|
||||||
sql.append(" cs_orig.DESCCLASE ");
|
|
||||||
|
|
||||||
return sql.toString();
|
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||||
|
|
||||||
|
stmt.setTimestamp(FIELD_DATA_INICIAL, new Timestamp(DateUtil.inicioFecha((Date) parametros.get(FIELD_DATA_INICIAL)).getTime()));
|
||||||
|
stmt.setTimestamp(FIELD_DATA_FINAL, new Timestamp(DateUtil.fimFecha((Date) parametros.get(FIELD_DATA_FINAL)).getTime()));
|
||||||
|
|
||||||
|
ResultSet rset = stmt.executeQuery();
|
||||||
|
|
||||||
|
while (rset.next()) {
|
||||||
|
|
||||||
|
Map<String, Object> dataResult = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
dataResult.put(FIELD_EMPRESA, rset.getString(FIELD_EMPRESA));
|
||||||
|
dataResult.put(FIELD_AGENCIA_TRANSF, rset.getString(FIELD_AGENCIA_TRANSF));
|
||||||
|
dataResult.put(FIELD_BILHETE, rset.getString(FIELD_BILHETE));
|
||||||
|
dataResult.put(FIELD_ORIGEM, rset.getString(FIELD_ORIGEM));
|
||||||
|
dataResult.put(FIELD_DESTINO, rset.getString(FIELD_DESTINO));
|
||||||
|
dataResult.put(FIELD_CLASSE_ORIGINAL, rset.getString(FIELD_CLASSE_ORIGINAL));
|
||||||
|
dataResult.put(FIELD_TOTAL_ORIGINAL, rset.getBigDecimal(FIELD_TOTAL_ORIGINAL));
|
||||||
|
dataResult.put(FIELD_CLASSE_TRANSF, rset.getString(FIELD_CLASSE_TRANSF));
|
||||||
|
dataResult.put(FIELD_TOTAL_TRANSF, rset.getBigDecimal(FIELD_TOTAL_TRANSF));
|
||||||
|
dataResult.put(FIELD_VALOR_DIFERENCA, rset.getBigDecimal(FIELD_TOTAL_TRANSF).subtract(rset.getBigDecimal(FIELD_TOTAL_ORIGINAL)));
|
||||||
|
|
||||||
|
this.dados.add(dataResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.resultSet = rset;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSql(Map<String, Object> parametros) {
|
||||||
|
StringBuilder sql = new StringBuilder();
|
||||||
|
sql.append(" SELECT E.NOMBEMPRESA EMPRESA, PV.NOMBPUNTOVENTA AGENCIA_TRANSF, B.NUMFOLIOSISTEMA BILHETE, ");
|
||||||
|
sql.append(" PO.DESCPARADA ORIGEM, PD.DESCPARADA DESTINO, CSO.DESCCLASE CLASSE_ORIGINAL, ");
|
||||||
|
sql.append(" COALESCE(BO.PRECIOPAGADO,0) + COALESCE(BO.IMPORTEOUTROS,0) + ");
|
||||||
|
sql.append(" COALESCE(BO.IMPORTEPEDAGIO,0) + COALESCE(BO.IMPORTESEGURO,0) + ");
|
||||||
|
sql.append(" COALESCE(BO.IMPORTETAXAEMBARQUE,0) TOTAL_ORIGINAL, ");
|
||||||
|
sql.append(" CS.DESCCLASE CLASSE_TRANSF, ");
|
||||||
|
sql.append(" COALESCE(B.PRECIOPAGADO,0) + COALESCE(B.IMPORTEOUTROS,0) + ");
|
||||||
|
sql.append(" COALESCE(B.IMPORTEPEDAGIO,0) + COALESCE(B.IMPORTESEGURO,0) + ");
|
||||||
|
sql.append(" COALESCE(B.IMPORTETAXAEMBARQUE,0) TOTAL_TRANSF ");
|
||||||
|
sql.append(" FROM BOLETO B ");
|
||||||
|
sql.append(" INNER JOIN MARCA M ON B.MARCA_ID = M.MARCA_ID ");
|
||||||
|
sql.append(" INNER JOIN EMPRESA E ON M.EMPRESA_ID = E.EMPRESA_ID ");
|
||||||
|
sql.append(" INNER JOIN PUNTO_VENTA PV ON B.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ");
|
||||||
|
sql.append(" INNER JOIN BOLETO BO ON BO.BOLETO_ID = B.BOLETOORIGINAL_ID ");
|
||||||
|
sql.append(" LEFT JOIN CLASE_SERVICIO CS ON CS.CLASESERVICIO_ID = B.CLASESERVICIO_ID ");
|
||||||
|
sql.append(" LEFT JOIN CLASE_SERVICIO CSO ON CSO.CLASESERVICIO_ID = BO.CLASESERVICIO_ID ");
|
||||||
|
sql.append(" LEFT JOIN PARADA PO ON PO.PARADA_ID = B.ORIGEN_ID ");
|
||||||
|
sql.append(" LEFT JOIN PARADA PD ON PD.PARADA_ID = B.DESTINO_ID ");
|
||||||
|
sql.append(" WHERE B.TIPOVENTA_ID = 81 ");
|
||||||
|
sql.append(" AND B.FECHORVENTA >= :DATA_INICIAL ");
|
||||||
|
sql.append(" AND B.FECHORVENTA <= :DATA_FINAL ");
|
||||||
|
if ((String)parametros.get("EMPRESA_ID") != null
|
||||||
|
&& !filtrarTodos("EMPRESA_ID")) {
|
||||||
|
sql.append(" AND M.EMPRESA_ID IN ("+parametros.get("EMPRESA_ID")+")");
|
||||||
|
}
|
||||||
|
if ((String)parametros.get("PUNTOVENTA_ID") != null
|
||||||
|
&& !filtrarTodos("PUNTOVENTA_ID")) {
|
||||||
|
sql.append(" AND B.PUNTOVENTA_ID IN ("+parametros.get("PUNTOVENTA_ID")+")");
|
||||||
|
}
|
||||||
|
|
||||||
|
sql.append(" ORDER BY E.NOMBEMPRESA, PV.NOMBPUNTOVENTA ");
|
||||||
|
|
||||||
|
return sql.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean filtrarTodos(String parametro) {
|
||||||
|
String ids = (String)parametros.get(parametro);
|
||||||
|
for (int i = 0; i < ids.split(", ").length; i++) {
|
||||||
|
if ("-1".equals(ids.split(", ")[i])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -1,17 +1,34 @@
|
||||||
<?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="0"/>
|
<property name="ireport.x" value="86"/>
|
||||||
<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"/>
|
||||||
<parameter name="DATA_FINAL" class="java.util.Date"/>
|
<parameter name="DATA_FINAL" class="java.util.Date"/>
|
||||||
<parameter name="DATA_INICIAL" class="java.util.Date"/>
|
<parameter name="DATA_INICIAL" class="java.util.Date"/>
|
||||||
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
|
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
|
||||||
|
<parameter name="FILTRO_EMPRESA" class="java.lang.String"/>
|
||||||
|
<parameter name="FILTRO_AGENCIA" class="java.lang.String"/>
|
||||||
|
<field name="empresa" class="java.lang.String"/>
|
||||||
|
<field name="agencia_transf" class="java.lang.String"/>
|
||||||
|
<field name="bilhete" class="java.lang.String"/>
|
||||||
|
<field name="origem" class="java.lang.String"/>
|
||||||
|
<field name="destino" class="java.lang.String"/>
|
||||||
<field name="classe_original" class="java.lang.String"/>
|
<field name="classe_original" class="java.lang.String"/>
|
||||||
<field name="total_pago_original" class="java.math.BigDecimal"/>
|
<field name="total_original" class="java.math.BigDecimal"/>
|
||||||
<field name="classe_novo" class="java.lang.String"/>
|
<field name="classe_transf" class="java.lang.String"/>
|
||||||
<field name="diferença_preço" class="java.math.BigDecimal"/>
|
<field name="total_transf" class="java.math.BigDecimal"/>
|
||||||
|
<field name="valor_diferenca" class="java.math.BigDecimal"/>
|
||||||
|
<variable name="total_original_sum" class="java.math.BigDecimal" calculation="Sum">
|
||||||
|
<variableExpression><![CDATA[$F{total_original}]]></variableExpression>
|
||||||
|
</variable>
|
||||||
|
<variable name="total_transf_sum" class="java.math.BigDecimal" calculation="Sum">
|
||||||
|
<variableExpression><![CDATA[$F{total_transf}]]></variableExpression>
|
||||||
|
</variable>
|
||||||
|
<variable name="valor_diferenca_sum" class="java.math.BigDecimal" calculation="Sum">
|
||||||
|
<variableExpression><![CDATA[$F{valor_diferenca}]]></variableExpression>
|
||||||
|
</variable>
|
||||||
<background>
|
<background>
|
||||||
<band splitType="Stretch"/>
|
<band splitType="Stretch"/>
|
||||||
</background>
|
</background>
|
||||||
|
@ -114,69 +131,169 @@
|
||||||
<columnHeader>
|
<columnHeader>
|
||||||
<band height="55" splitType="Stretch">
|
<band height="55" splitType="Stretch">
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="bc37af37-9b2d-46dc-969d-800271b9247b" x="642" y="35" width="129" height="20"/>
|
<reportElement uuid="bc37af37-9b2d-46dc-969d-800271b9247b" x="412" y="35" width="86" height="20"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="12"/>
|
<font size="10"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[VALOR LANÇADO]]></text>
|
<text><![CDATA[Classe Original]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="05f6b0c4-65f5-4413-814f-5f3f5171bb89" x="14" y="35" width="112" height="20"/>
|
<reportElement uuid="05f6b0c4-65f5-4413-814f-5f3f5171bb89" x="0" y="35" width="80" height="20"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="12"/>
|
<font size="10"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[CLASSE ORIGINAL ]]></text>
|
<text><![CDATA[Empresa]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="8b901287-2a27-4555-a9ec-fc89e5b29701" x="343" y="35" width="138" height="20"/>
|
<reportElement uuid="8b901287-2a27-4555-a9ec-fc89e5b29701" x="232" y="35" width="90" height="20"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="12"/>
|
<font size="10"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[CLASSE TRANSFERIDA]]></text>
|
<text><![CDATA[Origem]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
<staticText>
|
<staticText>
|
||||||
<reportElement uuid="127050d6-089c-4486-bffc-0dd6603debd4" x="130" y="35" width="112" height="20"/>
|
<reportElement uuid="127050d6-089c-4486-bffc-0dd6603debd4" x="80" y="35" width="80" height="20"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="12"/>
|
<font size="10"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<text><![CDATA[TOTAL ORIGINAL ]]></text>
|
<text><![CDATA[Agência transf.]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="9f01f9d0-b086-40f4-aa5d-57fa216a2955" x="160" y="35" width="72" height="20"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Nº Bilhete]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="b376832e-c8b6-47f9-b26b-5e0dbe81a34d" x="322" y="35" width="90" height="20"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Destino]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="f43caf02-0714-4e25-93b8-f6251b0473af" x="498" y="35" width="73" height="20"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Total Original]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="02096d93-5c1a-436a-8bb3-b13b76f0d04f" x="571" y="35" width="90" height="20"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Classe transf.]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="4b2a91fe-ac98-4b7c-b02e-d98862580cf4" x="661" y="35" width="70" height="20"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Total Transf.]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement uuid="6f895f9e-f2dd-404f-adf2-125732738753" x="731" y="35" width="70" height="20"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Vlr. Diferença]]></text>
|
||||||
</staticText>
|
</staticText>
|
||||||
</band>
|
</band>
|
||||||
</columnHeader>
|
</columnHeader>
|
||||||
<detail>
|
<detail>
|
||||||
<band height="24" splitType="Stretch">
|
<band height="24" splitType="Stretch">
|
||||||
<textField pattern="¤ #,##0.00">
|
<textField pattern="#,##0.00">
|
||||||
<reportElement uuid="63e7f691-3da7-403b-b3c0-428204cd300b" x="642" y="0" width="129" height="20"/>
|
<reportElement uuid="63e7f691-3da7-403b-b3c0-428204cd300b" x="731" y="0" width="70" height="20"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="10"/>
|
<font size="10"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{diferença_preço}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{valor_diferenca}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField pattern="dd/MM/yyyy">
|
<textField pattern="dd/MM/yyyy">
|
||||||
<reportElement uuid="f328e3a4-f1d7-46f6-9d02-9bfd4ad1d512" x="343" y="0" width="138" 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"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{classe_novo}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{bilhete}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField pattern="¤ #,##0.00">
|
<textField isStretchWithOverflow="true" pattern="">
|
||||||
<reportElement uuid="e5de48ac-118a-416c-a88e-b42b7dc64e40" x="130" y="0" width="112" height="20"/>
|
<reportElement uuid="e5de48ac-118a-416c-a88e-b42b7dc64e40" x="80" y="0" width="80" height="20"/>
|
||||||
<textElement>
|
<textElement>
|
||||||
<font size="10"/>
|
<font size="10"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{total_pago_original}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{agencia_transf}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
<textField pattern="dd/MM/yyyy">
|
<textField isStretchWithOverflow="true" pattern="">
|
||||||
<reportElement uuid="6f0f48bd-579d-4016-938f-75034c33ccf4" x="14" y="0" width="112" height="20"/>
|
<reportElement uuid="6f0f48bd-579d-4016-938f-75034c33ccf4" x="0" y="0" width="80" height="20"/>
|
||||||
|
<textElement textAlignment="Left">
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="">
|
||||||
|
<reportElement uuid="cec35341-5bcd-4d7c-a59e-76434bc6d4fe" x="232" y="0" width="90" height="20"/>
|
||||||
|
<textElement textAlignment="Left">
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="">
|
||||||
|
<reportElement uuid="2b3cb9a8-6893-4bdf-b9eb-2853038a9258" x="322" y="0" width="90" height="20"/>
|
||||||
|
<textElement textAlignment="Left">
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="">
|
||||||
|
<reportElement uuid="c3ec1906-8357-49ca-bbe6-4bb7f927d668" x="412" y="0" width="86" height="20"/>
|
||||||
<textElement textAlignment="Left">
|
<textElement textAlignment="Left">
|
||||||
<font size="10"/>
|
<font size="10"/>
|
||||||
</textElement>
|
</textElement>
|
||||||
<textFieldExpression><![CDATA[$F{classe_original}]]></textFieldExpression>
|
<textFieldExpression><![CDATA[$F{classe_original}]]></textFieldExpression>
|
||||||
</textField>
|
</textField>
|
||||||
|
<textField pattern="#,##0.00">
|
||||||
|
<reportElement uuid="a7933cd7-a8da-40c1-b4fe-7c499fbddcb6" x="498" y="0" width="73" height="20"/>
|
||||||
|
<textElement textAlignment="Left">
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{total_original}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField pattern="">
|
||||||
|
<reportElement uuid="0abd4d65-b47b-4bb5-9db2-fc1b08842641" x="571" y="0" width="90" height="20"/>
|
||||||
|
<textElement textAlignment="Left">
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{classe_transf}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField pattern="#,##0.00">
|
||||||
|
<reportElement uuid="18f38bde-1e97-481b-8f10-bdfe51bc8492" x="661" y="0" width="70" height="20"/>
|
||||||
|
<textElement textAlignment="Left">
|
||||||
|
<font size="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{total_transf}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
</band>
|
</band>
|
||||||
</detail>
|
</detail>
|
||||||
<summary>
|
<summary>
|
||||||
<band height="42" splitType="Stretch"/>
|
<band height="42" splitType="Stretch">
|
||||||
|
<textField pattern="#,##0.00">
|
||||||
|
<reportElement uuid="9250f22d-9830-4dc5-90cf-a1e33a764259" x="498" y="3" width="73" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$V{total_original_sum}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField pattern="#,##0.00">
|
||||||
|
<reportElement uuid="ab84fd96-22bf-4012-ae8c-164b913f1c5f" x="661" y="3" width="70" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$V{total_transf_sum}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField pattern="#,##0.00">
|
||||||
|
<reportElement uuid="aa4d7e9b-a3bd-4a67-a05a-caf728d69037" x="731" y="3" width="70" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$V{valor_diferenca_sum}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
</summary>
|
</summary>
|
||||||
<noData>
|
<noData>
|
||||||
<band height="50">
|
<band height="50">
|
||||||
|
|
|
@ -29,8 +29,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioDescontos;
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioGenericoEmpresasSel;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioDescontosEmpresasSel;
|
|
||||||
|
|
||||||
@Controller("relatorioDescontosController")
|
@Controller("relatorioDescontosController")
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
|
@ -56,8 +55,8 @@ public class RelatorioDescontosController extends MyGenericForwardComposer {
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
empresaList.setItemRenderer(new RenderRelatorioDescontos());
|
empresaList.setItemRenderer(new RenderRelatorioGenericoEmpresasSel());
|
||||||
empresaSelList.setItemRenderer(new RenderRelatorioDescontosEmpresasSel());
|
empresaSelList.setItemRenderer(new RenderRelatorioGenericoEmpresasSel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
@ -13,65 +16,131 @@ import org.zkoss.util.resource.Labels;
|
||||||
import org.zkoss.zhtml.Messagebox;
|
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.Comboitem;
|
|
||||||
import org.zkoss.zul.ComboitemRenderer;
|
|
||||||
import org.zkoss.zul.Datebox;
|
import org.zkoss.zul.Datebox;
|
||||||
|
import org.zkoss.zul.Paging;
|
||||||
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDiferencasTransferencias;
|
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDiferencasTransferencias;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioReceitaServico;
|
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPuntoVentaSimple;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioGenericoEmpresasSel;
|
||||||
|
import com.trg.search.Filter;
|
||||||
|
|
||||||
@Controller("relatorioDiferencasTransferenciasController")
|
@Controller("relatorioDiferencasTransferenciasController")
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class RelatorioDiferencasTransferenciasController extends MyGenericForwardComposer {
|
public class RelatorioDiferencasTransferenciasController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
private static final String LIKE = "%";
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Datebox datInicial;
|
private Datebox datInicial;
|
||||||
private Datebox datFinal;
|
private Datebox datFinal;
|
||||||
|
private Textbox txtNombreEmpresa;
|
||||||
|
private Paging pagingEmpresa;
|
||||||
|
private Paging pagingEmpresaSel;
|
||||||
|
private MyListbox empresaList;
|
||||||
|
private MyListbox empresaSelList;
|
||||||
|
private MyListbox puntoVentaList;
|
||||||
|
private MyListbox puntoVentaSelectedList;
|
||||||
|
private Textbox txtNomeAgencia;
|
||||||
|
private Paging pagingPuntoVenta;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DataSource dataSourceRead;
|
private DataSource dataSourceRead;
|
||||||
|
|
||||||
public Datebox getDatInicial() {
|
@Autowired
|
||||||
return datInicial;
|
private transient PagedListWrapper<Empresa> plwEmpresa;
|
||||||
}
|
|
||||||
|
@Autowired
|
||||||
public void setDatInicial(Datebox datInicial) {
|
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
|
||||||
this.datInicial = datInicial;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Datebox getDatFinal() {
|
|
||||||
return datFinal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDatFinal(Datebox datFinal) {
|
|
||||||
this.datFinal = datFinal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
empresaList.setItemRenderer(new RenderRelatorioGenericoEmpresasSel());
|
||||||
|
empresaSelList.setItemRenderer(new RenderRelatorioGenericoEmpresasSel());
|
||||||
|
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||||
|
puntoVentaSelectedList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
||||||
executarRelatorio();
|
executarRelatorio();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onClick$btnPesquisaEmpresa(Event ev) {
|
||||||
|
HibernateSearchObject<Empresa> empresaBusqueda =
|
||||||
|
new HibernateSearchObject<Empresa>(Empresa.class, pagingEmpresa.getPageSize());
|
||||||
|
|
||||||
|
empresaBusqueda.addFilterILike("nombempresa", obtemFiltroLike(txtNombreEmpresa));
|
||||||
|
empresaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
|
||||||
|
empresaBusqueda.addSortAsc("nombempresa");
|
||||||
|
|
||||||
|
plwEmpresa.init(empresaBusqueda, empresaList, pagingEmpresa);
|
||||||
|
|
||||||
|
validaPesquisaSemRegistro(empresaList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnLimparEmpresa(Event ev) {
|
||||||
|
empresaList.setData(new ArrayList<Empresa>());
|
||||||
|
txtNombreEmpresa.setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDoubleClick$empresaList(Event ev) {
|
||||||
|
Empresa empresa = (Empresa) empresaList.getSelected();
|
||||||
|
if (!Arrays.asList(empresaSelList.getData()).contains(empresa)) {
|
||||||
|
empresaSelList.addItemNovo(empresa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDoubleClick$empresaSelList(Event ev) {
|
||||||
|
Empresa empresa = (Empresa) empresaSelList.getSelected();
|
||||||
|
empresaSelList.removeItem(empresa);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnPesquisaAgencia(Event ev) {
|
||||||
|
HibernateSearchObject<PuntoVenta> puntoVentaBusqueda =
|
||||||
|
new HibernateSearchObject<PuntoVenta>(PuntoVenta.class, pagingPuntoVenta.getPageSize());
|
||||||
|
|
||||||
|
puntoVentaBusqueda.addFilterOr(Filter.like("nombpuntoventa", obtemFiltroLike(txtNomeAgencia)),
|
||||||
|
Filter.like("numPuntoVenta", obtemFiltroLike(txtNomeAgencia)));
|
||||||
|
puntoVentaBusqueda.addSortAsc("nombpuntoventa");
|
||||||
|
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
|
||||||
|
plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
|
||||||
|
|
||||||
|
validaPesquisaSemRegistro(puntoVentaList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnLimparAgencia(Event ev) {
|
||||||
|
puntoVentaList.setData(new ArrayList<Empresa>());
|
||||||
|
txtNomeAgencia.setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDoubleClick$puntoVentaList(Event ev) {
|
||||||
|
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
|
||||||
|
if (!Arrays.asList(puntoVentaSelectedList.getData()).contains(puntoVenta)) {
|
||||||
|
puntoVentaSelectedList.addItemNovo(puntoVenta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDoubleClick$puntoVentaSelectedList(Event ev) {
|
||||||
|
PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaSelectedList.getSelected();
|
||||||
|
puntoVentaSelectedList.removeItem(puntoVentaSel);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws Exception
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
private void executarRelatorio() throws Exception {
|
private void executarRelatorio() throws Exception {
|
||||||
|
if (!isPeriodoValido()) {
|
||||||
if (datInicial != null && datFinal != null && datFinal.getValue().compareTo(datInicial.getValue()) < 0) {
|
|
||||||
try {
|
try {
|
||||||
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||||
Labels.getLabel("relatorioDiferencasTransferenciasController.window.title"),
|
Labels.getLabel("relatorioDiferencasTransferenciasController.window.title"),
|
||||||
|
@ -79,29 +148,27 @@ public class RelatorioDiferencasTransferenciasController extends MyGenericForwar
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
Relatorio relatorio;
|
Relatorio relatorio;
|
||||||
|
|
||||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||||
|
|
||||||
StringBuilder filtro = new StringBuilder();
|
StringBuilder filtro = new StringBuilder();
|
||||||
|
|
||||||
filtro.append("Início período: ");
|
configuraFiltro(filtro, datInicial, "Início período: ");
|
||||||
Calendar cal = Calendar.getInstance();
|
configuraFiltro(filtro, datFinal, "Fim período: ");
|
||||||
cal.setTime(datInicial.getValue());
|
|
||||||
filtro.append(cal.get(Calendar.DATE) + "/");
|
|
||||||
filtro.append((cal.get(Calendar.MONTH) + 1) + "/");
|
|
||||||
filtro.append(cal.get(Calendar.YEAR) + "; ");
|
|
||||||
|
|
||||||
filtro.append("Fim período: ");
|
|
||||||
cal.setTime(datFinal.getValue());
|
|
||||||
filtro.append(cal.get(Calendar.DATE) + "/");
|
|
||||||
filtro.append((cal.get(Calendar.MONTH) + 1) + "/");
|
|
||||||
filtro.append(cal.get(Calendar.YEAR) + "; ");
|
|
||||||
|
|
||||||
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());
|
||||||
|
if (!listaEmpresa.isEmpty()) {
|
||||||
|
parametros.put("EMPRESA_ID", getIdsEmpresa(listaEmpresa));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Object> listaPontosVenda = Arrays.asList(puntoVentaSelectedList.getData());
|
||||||
|
if (!listaPontosVenda.isEmpty()) {
|
||||||
|
parametros.put("PUNTOVENTA_ID", getIdsPontoVenda(listaPontosVenda));
|
||||||
|
}
|
||||||
|
|
||||||
parametros.put("FILTROS", filtro.toString());
|
parametros.put("FILTROS", filtro.toString());
|
||||||
|
|
||||||
|
@ -117,4 +184,123 @@ public class RelatorioDiferencasTransferenciasController extends MyGenericForwar
|
||||||
Labels.getLabel("relatorioDiferencasTransferenciasController.window.title"), args, MODAL);
|
Labels.getLabel("relatorioDiferencasTransferenciasController.window.title"), args, MODAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getIdsEmpresa(List<Object> listaEmpresa) {
|
||||||
|
String ids = "";
|
||||||
|
for (Object empresa : listaEmpresa) {
|
||||||
|
ids += ((Empresa)empresa).getEmpresaId() +", ";
|
||||||
|
}
|
||||||
|
return ids.substring(0, ids.length()-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getIdsPontoVenda(List<Object> listaPontosVenda) {
|
||||||
|
String ids = "";
|
||||||
|
for (Object pontoVenda : listaPontosVenda) {
|
||||||
|
ids += ((PuntoVenta)pontoVenda).getPuntoventaId() +", ";
|
||||||
|
}
|
||||||
|
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() {
|
||||||
|
return datFinal.getValue().compareTo(datInicial.getValue()) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validaPesquisaSemRegistro(MyListbox listBox) {
|
||||||
|
if (listBox.getData().length == 0) {
|
||||||
|
try {
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||||
|
Labels.getLabel("relatorioDiferencasTransferenciasController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String obtemFiltroLike(Textbox filtro) {
|
||||||
|
return LIKE.concat(filtro.getText().trim().toUpperCase().concat(LIKE)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Datebox getDatInicial() {
|
||||||
|
return datInicial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatInicial(Datebox datInicial) {
|
||||||
|
this.datInicial = datInicial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Textbox getTxtNombreEmpresa() {
|
||||||
|
return txtNombreEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTxtNombreEmpresa(Textbox txtNombreEmpresa) {
|
||||||
|
this.txtNombreEmpresa = txtNombreEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Paging getPagingEmpresa() {
|
||||||
|
return pagingEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPagingEmpresa(Paging pagingEmpresa) {
|
||||||
|
this.pagingEmpresa = pagingEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Paging getPagingEmpresaSel() {
|
||||||
|
return pagingEmpresaSel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPagingEmpresaSel(Paging pagingEmpresaSel) {
|
||||||
|
this.pagingEmpresaSel = pagingEmpresaSel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getEmpresaList() {
|
||||||
|
return empresaList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresaList(MyListbox empresaList) {
|
||||||
|
this.empresaList = empresaList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getEmpresaSelList() {
|
||||||
|
return empresaSelList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresaSelList(MyListbox empresaSelList) {
|
||||||
|
this.empresaSelList = empresaSelList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Datebox getDatFinal() {
|
||||||
|
return datFinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDatFinal(Datebox datFinal) {
|
||||||
|
this.datFinal = datFinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getPuntoVentaList() {
|
||||||
|
return puntoVentaList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoVentaList(MyListbox puntoVentaList) {
|
||||||
|
this.puntoVentaList = puntoVentaList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getPuntoVentaSelectedList() {
|
||||||
|
return puntoVentaSelectedList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoVentaSelectedList(MyListbox puntoVentaSelectedList) {
|
||||||
|
this.puntoVentaSelectedList = puntoVentaSelectedList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,6 @@ import org.zkoss.zul.Listcell;
|
||||||
import org.zkoss.zul.Listitem;
|
import org.zkoss.zul.Listitem;
|
||||||
import org.zkoss.zul.ListitemRenderer;
|
import org.zkoss.zul.ListitemRenderer;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.EmpresaImposto;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
|
||||||
|
@ -27,13 +25,10 @@ public class RenderPuntoVentaSimple implements ListitemRenderer {
|
||||||
|
|
||||||
Listcell lc = new Listcell(puntoVenta.getNumPuntoVenta());
|
Listcell lc = new Listcell(puntoVenta.getNumPuntoVenta());
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lc = new Listcell(puntoVenta.getNombpuntoventa());
|
lc = new Listcell(puntoVenta.getNombpuntoventa());
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
|
||||||
Button btn = new Button();
|
Button btn = new Button();
|
||||||
|
|
||||||
lc = new Listcell();
|
lc = new Listcell();
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
|
||||||
|
|
||||||
import org.zkoss.zul.Listcell;
|
|
||||||
import org.zkoss.zul.Listitem;
|
|
||||||
import org.zkoss.zul.ListitemRenderer;
|
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|
||||||
|
|
||||||
public class RenderRelatorioDescontosEmpresasSel implements ListitemRenderer {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(Listitem lstm, Object o) throws Exception {
|
|
||||||
Empresa empresa = (Empresa) o;
|
|
||||||
|
|
||||||
Listcell lc = new Listcell(empresa.getEmpresaId().toString());
|
|
||||||
lc.setParent(lstm);
|
|
||||||
|
|
||||||
lc = new Listcell(empresa.getNombempresa());
|
|
||||||
lc.setParent(lstm);
|
|
||||||
|
|
||||||
lstm.setAttribute("data", empresa);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -9,7 +9,7 @@ import org.zkoss.zul.ListitemRenderer;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
|
||||||
public class RenderRelatorioDescontos implements ListitemRenderer {
|
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 {
|
|
@ -662,8 +662,15 @@ relatorioReceitaServicoController.lbServico.value = N. Servicio
|
||||||
|
|
||||||
#Relatorio de Diferencas de Transferencias
|
#Relatorio de Diferencas de Transferencias
|
||||||
relatorioDiferencasTransferenciasController.window.title = Reporte de diferencias en transferencias
|
relatorioDiferencasTransferenciasController.window.title = Reporte de diferencias en transferencias
|
||||||
relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value = Período de transferencia
|
relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value = Fecha inicial
|
||||||
relatorioDiferencasTransferenciasController.lbAtePeriodoTransferencia.value = Hasta
|
relatorioDiferencasTransferenciasController.lbAtePeriodoTransferencia.value = Fecha final
|
||||||
|
relatorioDiferencasTransferenciasController.lbEmpresa.value = Empresa
|
||||||
|
relatorioDiferencasTransferenciasController.btnPesquisa.label = Búsqueda
|
||||||
|
relatorioDiferencasTransferenciasController.btnLimpar.label = Limpiar
|
||||||
|
relatorioDiferencasTransferenciasController.lbIdEmpresa.value = Id
|
||||||
|
relatorioDiferencasTransferenciasController.puntoVentaSelectedList.codigo = Código
|
||||||
|
relatorioDiferencasTransferenciasController.puntoVentaSelectedList.nome = Nome
|
||||||
|
relatorioDiferencasTransferenciasController.lbAgencia.value = Agencia
|
||||||
|
|
||||||
# Relatorio Sisdap
|
# Relatorio Sisdap
|
||||||
relatorioSisdapController.window.title=Reporte SISDAP
|
relatorioSisdapController.window.title=Reporte SISDAP
|
||||||
|
|
|
@ -706,8 +706,15 @@ relatorioReceitaServicoController.lbServico.value = N. Serviço
|
||||||
|
|
||||||
#Relatorio de Diferencas de Transferencias
|
#Relatorio de Diferencas de Transferencias
|
||||||
relatorioDiferencasTransferenciasController.window.title = Relatório de Diferenças em Transferências
|
relatorioDiferencasTransferenciasController.window.title = Relatório de Diferenças em Transferências
|
||||||
relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value = Período de Transferência
|
relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value = Data inicial
|
||||||
relatorioDiferencasTransferenciasController.lbAtePeriodoTransferencia.value = até
|
relatorioDiferencasTransferenciasController.lbAtePeriodoTransferencia.value = Data final
|
||||||
|
relatorioDiferencasTransferenciasController.lbEmpresa.value = Empresa
|
||||||
|
relatorioDiferencasTransferenciasController.btnPesquisa.label = Buscar
|
||||||
|
relatorioDiferencasTransferenciasController.btnLimpar.label = Limpar
|
||||||
|
relatorioDiferencasTransferenciasController.lbIdEmpresa.value = Id
|
||||||
|
relatorioDiferencasTransferenciasController.puntoVentaSelectedList.codigo = Código
|
||||||
|
relatorioDiferencasTransferenciasController.puntoVentaSelectedList.nome = Nome
|
||||||
|
relatorioDiferencasTransferenciasController.lbAgencia.value = Agência
|
||||||
|
|
||||||
# Relatorio Sisdap
|
# Relatorio Sisdap
|
||||||
relatorioSisdapController.window.title=Relatório SISDAP
|
relatorioSisdapController.window.title=Relatório SISDAP
|
||||||
|
|
|
@ -7,27 +7,108 @@
|
||||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
<window id="winFiltroRelatorioDiferencasTransferencias"
|
<window id="winFiltroRelatorioDiferencasTransferencias"
|
||||||
apply="${relatorioDiferencasTransferenciasController}" contentStyle="overflow:auto"
|
apply="${relatorioDiferencasTransferenciasController}" contentStyle="overflow:auto"
|
||||||
width="800px" border="normal">
|
height="460px" width="570px" border="normal">
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
<column width="15%" />
|
<column width="30%" />
|
||||||
<column width="35%" />
|
<column width="70%" />
|
||||||
<column width="15%" />
|
|
||||||
<column width="35%" />
|
|
||||||
</columns>
|
</columns>
|
||||||
<rows>
|
<rows>
|
||||||
<row>
|
<row>
|
||||||
<label
|
<label value="${c:l('relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value')}" />
|
||||||
value="${c:l('relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value')}" />
|
<datebox id="datInicial" format="dd/MM/yyyy" mold="rounded" width="50%" constraint="no empty, no future" maxlength="10" />
|
||||||
<datebox id="datInicial" format="dd/MM/yyyy"
|
</row>
|
||||||
mold="rounded" width="95%" constraint="no empty, no future"
|
<row>
|
||||||
maxlength="10" />
|
<label value="${c:l('relatorioDiferencasTransferenciasController.lbAtePeriodoTransferencia.value')}" />
|
||||||
|
<datebox id="datFinal" format="dd/MM/yyyy" mold="rounded" width="50%" constraint="no empty, no future" maxlength="10" />
|
||||||
<label
|
</row>
|
||||||
value="${c:l('relatorioDiferencasTransferenciasController.lbAtePeriodoTransferencia.value')}" />
|
<row>
|
||||||
<datebox id="datFinal" format="dd/MM/yyyy"
|
<label value="${c:l('relatorioDiferencasTransferenciasController.lbEmpresa.value')}"/>
|
||||||
mold="rounded" width="95%" constraint="no empty, no future"
|
<bandbox id="bbPesquisaEmpresa" width="100%" mold="rounded" readonly="true">
|
||||||
maxlength="10" />
|
<bandpopup>
|
||||||
|
<vbox>
|
||||||
|
<hbox>
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioDiferencasTransferenciasController.lbEmpresa.value')}" />
|
||||||
|
<textbox id="txtNombreEmpresa"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
|
width="300px" mold="rounded" />
|
||||||
|
<button id="btnPesquisaEmpresa"
|
||||||
|
image="/gui/img/find.png"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.btnPesquisa.label')}" />
|
||||||
|
<button id="btnLimparEmpresa"
|
||||||
|
image="/gui/img/eraser.png"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.btnLimpar.label')}" />
|
||||||
|
</hbox>
|
||||||
|
<paging id="pagingEmpresa" pageSize="10" />
|
||||||
|
<listbox id="empresaList" mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" height="100%" width="700px">
|
||||||
|
<listhead>
|
||||||
|
<listheader width="10%"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.lbIdEmpresa.value')}" />
|
||||||
|
<listheader width="90%"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.lbEmpresa.value')}" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
</vbox>
|
||||||
|
</bandpopup>
|
||||||
|
</bandbox>
|
||||||
|
</row>
|
||||||
|
<row spans="2">
|
||||||
|
<listbox id="empresaSelList" mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" height="100px" width="100%">
|
||||||
|
<listhead>
|
||||||
|
<listheader width="10%" label="${c:l('relatorioDiferencasTransferenciasController.lbIdEmpresa.value')}" />
|
||||||
|
<listheader width="90%" label="${c:l('relatorioDiferencasTransferenciasController.lbEmpresa.value')}" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
<paging id="pagingEmpresaSel" pageSize="10" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('relatorioFinanceiroReceitasDespesasController.lbAgencia.value')}" />
|
||||||
|
<bandbox id="bbPesquisaPuntoVenta" width="100%" mold="rounded" readonly="true">
|
||||||
|
<bandpopup>
|
||||||
|
<vbox>
|
||||||
|
<hbox>
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioDiferencasTransferenciasController.lbAgencia.value')}" />
|
||||||
|
<textbox id="txtNomeAgencia"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
|
width="300px" mold="rounded" />
|
||||||
|
<button id="btnPesquisaAgencia"
|
||||||
|
image="/gui/img/find.png"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.btnPesquisa.label')}" />
|
||||||
|
<button id="btnLimparAgencia"
|
||||||
|
image="/gui/img/eraser.png"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.btnLimpar.label')}" />
|
||||||
|
</hbox>
|
||||||
|
<paging id="pagingPuntoVenta" pageSize="10" />
|
||||||
|
<listbox id="puntoVentaList" mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" height="100%" width="700px">
|
||||||
|
<listhead>
|
||||||
|
<listheader width="15%"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.puntoVentaSelectedList.codigo')}" />
|
||||||
|
<listheader width="85%"
|
||||||
|
label="${c:l('relatorioDiferencasTransferenciasController.puntoVentaSelectedList.nome')}" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
</vbox>
|
||||||
|
</bandpopup>
|
||||||
|
</bandbox>
|
||||||
|
</row>
|
||||||
|
<row spans="2">
|
||||||
|
<listbox id="puntoVentaSelectedList" mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" height="100px" width="100%">
|
||||||
|
<listhead>
|
||||||
|
<listheader width="15%" label="${c:l('relatorioDiferencasTransferenciasController.puntoVentaSelectedList.codigo')}" />
|
||||||
|
<listheader width="85%" label="${c:l('relatorioDiferencasTransferenciasController.puntoVentaSelectedList.nome')}" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
<paging id="pagingPuntoVentaSel" pageSize="10" />
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
|
Loading…
Reference in New Issue