rodrigo 2013-08-21 20:20:10 +00:00
parent aa7cf53803
commit e4eccf6a81
8 changed files with 354 additions and 181 deletions

View File

@ -28,15 +28,14 @@ public class RelatorioTaxasLinha extends Relatorio {
*/ */
public RelatorioTaxasLinha(Map<String, Object> parametros, Connection conexao) throws Exception { public RelatorioTaxasLinha(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao); super(parametros, conexao);
// TODO Auto-generated constructor stub
this.setCustomDataSource(new DataSource(this) { this.setCustomDataSource(new DataSource(this) {
public void initDados() throws Exception { public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao(); Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros(); Map<String, Object> parametros = this.relatorio.getParametros();
String sql = getSql(); String puntosVentaIds = (String) parametros.get("NUMPUNTOVENTA");
String sql = getSql(puntosVentaIds);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql); NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
stmt.setInt("TIPO_DATA", (Integer) parametros.get("TIPO_DATA")); stmt.setInt("TIPO_DATA", (Integer) parametros.get("TIPO_DATA"));
@ -48,11 +47,6 @@ public class RelatorioTaxasLinha extends Relatorio {
else else
stmt.setNull("EMPRESA_ID", java.sql.Types.INTEGER); stmt.setNull("EMPRESA_ID", java.sql.Types.INTEGER);
if (parametros.get("NUMPUNTOVENTA") != null)
stmt.setString("NUMPUNTOVENTA", (String) parametros.get("NUMPUNTOVENTA"));
else
stmt.setNull("NUMPUNTOVENTA", java.sql.Types.VARCHAR);
if (parametros.get("ORIGEN_ID") != null) if (parametros.get("ORIGEN_ID") != null)
stmt.setInt("ORIGEN_ID", (Integer) parametros.get("ORIGEN_ID")); stmt.setInt("ORIGEN_ID", (Integer) parametros.get("ORIGEN_ID"));
else else
@ -64,7 +58,6 @@ public class RelatorioTaxasLinha extends Relatorio {
stmt.setNull("DESTINO_ID", java.sql.Types.INTEGER); stmt.setNull("DESTINO_ID", java.sql.Types.INTEGER);
this.resultSet = stmt.executeQuery(); this.resultSet = stmt.executeQuery();
} }
public Object valueCustomFields(String fieldName) throws Exception { public Object valueCustomFields(String fieldName) throws Exception {
@ -110,7 +103,6 @@ public class RelatorioTaxasLinha extends Relatorio {
} }
return null; return null;
} }
}); });
} }
@ -121,8 +113,6 @@ public class RelatorioTaxasLinha extends Relatorio {
*/ */
@Override @Override
protected void processaParametros() throws Exception { protected void processaParametros() throws Exception {
// TODO Auto-generated method stub
} }
public HashMap<String, Object> getConfigImposto(Integer puntoVentaId) throws Exception { public HashMap<String, Object> getConfigImposto(Integer puntoVentaId) throws Exception {
@ -140,8 +130,7 @@ public class RelatorioTaxasLinha extends Relatorio {
return cacheConfig; return cacheConfig;
} }
private String getSql() { private String getSql(String puntosVentaIds) {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append(" SELECT RT.PREFIXO, "); sql.append(" SELECT RT.PREFIXO, ");
@ -187,7 +176,11 @@ public class RelatorioTaxasLinha extends Relatorio {
sql.append(" AND DECODE(:TIPO_DATA, 1, CJ.FECCORRIDA, 2, CJ.FECHORVENTA) BETWEEN "); sql.append(" AND DECODE(:TIPO_DATA, 1, CJ.FECCORRIDA, 2, CJ.FECHORVENTA) BETWEEN ");
sql.append(" :DATA_INICIAL AND :DATA_FINAL "); sql.append(" :DATA_INICIAL AND :DATA_FINAL ");
sql.append(" AND EM.EMPRESA_ID = NVL(:EMPRESA_ID, EM.EMPRESA_ID) "); sql.append(" AND EM.EMPRESA_ID = NVL(:EMPRESA_ID, EM.EMPRESA_ID) ");
sql.append(" AND PV.NUMPUNTOVENTA = NVL(:NUMPUNTOVENTA, PV.NUMPUNTOVENTA) ");
if (!puntosVentaIds.equals("Todas")) {
sql.append(" AND PV.NUMPUNTOVENTA IN (").append(puntosVentaIds).append(") ");
}
sql.append(" AND PO.PARADA_ID = NVL(:ORIGEN_ID, PO.PARADA_ID) "); sql.append(" AND PO.PARADA_ID = NVL(:ORIGEN_ID, PO.PARADA_ID) ");
sql.append(" AND PD.PARADA_ID = NVL(:DESTINO_ID, PD.PARADA_ID) "); sql.append(" AND PD.PARADA_ID = NVL(:DESTINO_ID, PD.PARADA_ID) ");
sql.append(" GROUP BY RT.PREFIXO, "); sql.append(" GROUP BY RT.PREFIXO, ");
@ -205,5 +198,4 @@ public class RelatorioTaxasLinha extends Relatorio {
return sql.toString(); return sql.toString();
} }
} }

View File

@ -1,7 +1,7 @@
<?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="RelatorioTaxasLinha" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="efbc89d4-6f08-4ea5-802f-d4f48ed208e2"> <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="RelatorioTaxasLinha" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="efbc89d4-6f08-4ea5-802f-d4f48ed208e2">
<property name="ireport.zoom" value="2.0"/> <property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="22"/> <property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<style name="textStyle" isDefault="true" fontSize="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <style name="textStyle" isDefault="true" fontSize="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="table"> <style name="table">
@ -92,22 +92,22 @@
<text><![CDATA[Total Empresa: ]]></text> <text><![CDATA[Total Empresa: ]]></text>
</staticText> </staticText>
<textField> <textField>
<reportElement uuid="3fcf21e1-b360-4146-ae72-864f9ed007de" x="307" y="0" width="48" height="11"/> <reportElement uuid="3fcf21e1-b360-4146-ae72-864f9ed007de" x="341" y="0" width="34" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_VENDIDOS_1}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_VENDIDOS_1}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="0617c1e5-cd2f-4b67-ba79-d68c6604275e" x="354" y="0" width="64" height="11"/> <reportElement uuid="0617c1e5-cd2f-4b67-ba79-d68c6604275e" x="377" y="0" width="64" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_EMBARQUE_1}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_EMBARQUE_1}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="64e6d5bd-b475-479b-a12b-c4c28025fd57" x="418" y="0" width="68" height="11"/> <reportElement uuid="64e6d5bd-b475-479b-a12b-c4c28025fd57" x="440" y="0" width="56" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_PEDAGIO_1}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_PEDAGIO_1}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="2cf7fe63-7c91-47d0-9ccb-71e1f669579f" x="486" y="0" width="68" height="11"/> <reportElement uuid="2cf7fe63-7c91-47d0-9ccb-71e1f669579f" x="496" y="0" width="58" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_SEGURO_1}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_SEGURO_1}]]></textFieldExpression>
</textField> </textField>
@ -245,76 +245,76 @@
</graphicElement> </graphicElement>
</line> </line>
<staticText> <staticText>
<reportElement uuid="9c579f27-ee14-4804-b73d-64994a6e41ec" x="0" y="1" width="50" height="11"/> <reportElement uuid="9c579f27-ee14-4804-b73d-64994a6e41ec" x="0" y="1" width="46" height="11"/>
<textElement> <textElement>
<font size="7"/> <font size="7"/>
</textElement> </textElement>
<text><![CDATA[Prefixo]]></text> <text><![CDATA[Prefixo]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="7b8a8f38-e513-4a8c-a82b-a9c6ffd21f6f" x="50" y="1" width="55" height="11"/> <reportElement uuid="7b8a8f38-e513-4a8c-a82b-a9c6ffd21f6f" x="47" y="1" width="55" height="11"/>
<textElement> <textElement>
<font size="7"/> <font size="7"/>
</textElement> </textElement>
<text><![CDATA[Origem]]></text> <text><![CDATA[Origem]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="4f8fcbb3-73e7-4b15-9687-30ff12bb1526" x="105" y="1" width="55" height="11"/> <reportElement uuid="4f8fcbb3-73e7-4b15-9687-30ff12bb1526" x="102" y="1" width="55" height="11"/>
<textElement> <textElement>
<font size="7"/> <font size="7"/>
</textElement> </textElement>
<text><![CDATA[Destino]]></text> <text><![CDATA[Destino]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="7b817589-f754-49f1-bf53-856be52946fb" mode="Transparent" x="211" y="1" width="32" height="11" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="7b817589-f754-49f1-bf53-856be52946fb" mode="Transparent" x="245" y="1" width="32" height="11" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<text><![CDATA[Tx. Emb.]]></text> <text><![CDATA[Emb.]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="93a5880a-7547-4e53-85f4-09a6c22d5699" mode="Transparent" x="243" y="1" width="32" height="11" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="93a5880a-7547-4e53-85f4-09a6c22d5699" mode="Transparent" x="277" y="1" width="32" height="11" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<text><![CDATA[Tx. Ped.]]></text> <text><![CDATA[Ped.]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="1d4f5650-a014-468d-a9b2-c58887492ace" mode="Transparent" x="275" y="1" width="32" height="11" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="1d4f5650-a014-468d-a9b2-c58887492ace" mode="Transparent" x="309" y="1" width="32" height="11" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<text><![CDATA[Tx. Seg.]]></text> <text><![CDATA[Seg.]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="9b724ccc-0e90-4271-9e51-54128161d074" mode="Transparent" x="355" y="1" width="63" height="11" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="9b724ccc-0e90-4271-9e51-54128161d074" mode="Transparent" x="377" y="1" width="63" height="11" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<text><![CDATA[Total Tx. Embarque]]></text> <text><![CDATA[Total Embarque]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="88be8133-60fd-45a5-9c81-363647bb3002" mode="Transparent" x="418" y="1" width="68" height="11" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="88be8133-60fd-45a5-9c81-363647bb3002" mode="Transparent" x="440" y="1" width="56" height="11" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<text><![CDATA[Total Tx. Pedagio]]></text> <text><![CDATA[Total Pedagio]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="bb5f610e-adc6-4f73-ba16-11ce1ec169a3" mode="Transparent" x="486" y="1" width="68" height="11" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="bb5f610e-adc6-4f73-ba16-11ce1ec169a3" mode="Transparent" x="496" y="1" width="58" height="11" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
</textElement> </textElement>
<text><![CDATA[Total Tx. Seguro]]></text> <text><![CDATA[Total Seguro]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="c41834a6-5ca0-4bba-a5ac-0cc2dd7a35b5" mode="Transparent" x="307" y="1" width="48" height="11" forecolor="#000000" backcolor="#FFFFFF"/> <reportElement uuid="c41834a6-5ca0-4bba-a5ac-0cc2dd7a35b5" mode="Transparent" x="341" y="1" width="34" height="11" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/> <paragraph lineSpacing="Single"/>
@ -322,7 +322,7 @@
<text><![CDATA[Vendidos]]></text> <text><![CDATA[Vendidos]]></text>
</staticText> </staticText>
<staticText> <staticText>
<reportElement uuid="32c20a27-414c-41be-86b2-0d23645acd18" x="160" y="1" width="51" height="11"/> <reportElement uuid="32c20a27-414c-41be-86b2-0d23645acd18" x="157" y="1" width="88" height="11"/>
<textElement> <textElement>
<font size="7"/> <font size="7"/>
</textElement> </textElement>
@ -333,57 +333,57 @@
<detail> <detail>
<band height="11"> <band height="11">
<textField> <textField>
<reportElement uuid="b12cbc2b-3eac-4c2c-b94c-cac2e746b2c2" x="0" y="0" width="49" height="11"/> <reportElement uuid="b12cbc2b-3eac-4c2c-b94c-cac2e746b2c2" x="0" y="0" width="46" height="11"/>
<textElement/> <textElement/>
<textFieldExpression><![CDATA[$F{PREFIXO}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{PREFIXO}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="d19cff45-ad13-4a6b-b6f3-3e871a6d8d58" x="51" y="0" width="54" height="11"/> <reportElement uuid="d19cff45-ad13-4a6b-b6f3-3e871a6d8d58" x="47" y="0" width="55" height="11"/>
<textElement/> <textElement/>
<textFieldExpression><![CDATA[$F{CIDADE_ORIGEM}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{CIDADE_ORIGEM}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="f868a599-c0bb-4187-97b6-7681b753abbf" x="105" y="0" width="55" height="11"/> <reportElement uuid="f868a599-c0bb-4187-97b6-7681b753abbf" x="102" y="0" width="55" height="11"/>
<textElement/> <textElement/>
<textFieldExpression><![CDATA[$F{CIDADE_DESTINO}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{CIDADE_DESTINO}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="6454beed-fb72-4aa5-8bff-7eb4ea6c26ba" x="211" y="0" width="32" height="11"/> <reportElement uuid="6454beed-fb72-4aa5-8bff-7eb4ea6c26ba" x="245" y="0" width="32" height="11"/>
<textElement textAlignment="Right" markup="none"/> <textElement textAlignment="Right" markup="none"/>
<textFieldExpression><![CDATA[$F{IMPORTETAXAEMBARQUE}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{IMPORTETAXAEMBARQUE}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="1242bccb-ce44-47d6-ac13-6f4df97f707e" x="243" y="0" width="32" height="11"/> <reportElement uuid="1242bccb-ce44-47d6-ac13-6f4df97f707e" x="277" y="0" width="32" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{IMPORTEPEDAGIO}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{IMPORTEPEDAGIO}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="2184d556-1501-4525-8d09-510f9d798b86" x="275" y="0" width="32" height="11"/> <reportElement uuid="2184d556-1501-4525-8d09-510f9d798b86" x="309" y="0" width="32" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{IMPORTESEGURO}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{IMPORTESEGURO}]]></textFieldExpression>
</textField> </textField>
<textField pattern=""> <textField pattern="">
<reportElement uuid="49969921-90d5-4873-9b56-9b6e6be548c5" x="307" y="0" width="48" height="11"/> <reportElement uuid="49969921-90d5-4873-9b56-9b6e6be548c5" x="341" y="0" width="34" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{TOTAL_VENDIDOS}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{TOTAL_VENDIDOS}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="58c1e14e-9c44-4e34-8b57-fbb6af384ce3" x="355" y="0" width="63" height="11"/> <reportElement uuid="58c1e14e-9c44-4e34-8b57-fbb6af384ce3" x="377" y="0" width="63" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{TOTAL_EMBARQUE}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{TOTAL_EMBARQUE}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="05426ccc-ff54-4381-8406-ae0c4290a54b" x="418" y="0" width="68" height="11"/> <reportElement uuid="05426ccc-ff54-4381-8406-ae0c4290a54b" x="440" y="0" width="56" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{TOTAL_PEDAGIO}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{TOTAL_PEDAGIO}]]></textFieldExpression>
</textField> </textField>
<textField pattern="#,##0.00"> <textField pattern="#,##0.00">
<reportElement uuid="8a365def-0ad3-48e8-b942-5d00f5d74a21" x="486" y="0" width="68" height="11"/> <reportElement uuid="8a365def-0ad3-48e8-b942-5d00f5d74a21" x="496" y="0" width="58" height="11"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{TOTAL_SEGURO}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{TOTAL_SEGURO}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="b2a45c9f-3da0-4273-9941-c9e31ee61723" x="160" y="0" width="51" height="11"/> <reportElement uuid="b2a45c9f-3da0-4273-9941-c9e31ee61723" x="157" y="0" width="88" height="11"/>
<textElement/> <textElement/>
<textFieldExpression><![CDATA[$F{NOMBPUNTOVENTA}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{NOMBPUNTOVENTA}]]></textFieldExpression>
</textField> </textField>
@ -392,22 +392,22 @@
<lastPageFooter> <lastPageFooter>
<band height="11"> <band height="11">
<textField evaluationTime="Auto"> <textField evaluationTime="Auto">
<reportElement uuid="f0b0773e-5235-4ee8-84d3-8741ecce0dae" x="307" y="-1" width="48" height="12"/> <reportElement uuid="f0b0773e-5235-4ee8-84d3-8741ecce0dae" x="341" y="-1" width="34" height="12"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_VENDIDOS_2}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_VENDIDOS_2}]]></textFieldExpression>
</textField> </textField>
<textField evaluationTime="Auto" pattern="#,##0.00"> <textField evaluationTime="Auto" pattern="#,##0.00">
<reportElement uuid="1d265368-d216-4cec-a824-a0c0b5536a43" x="355" y="-1" width="63" height="12"/> <reportElement uuid="1d265368-d216-4cec-a824-a0c0b5536a43" x="377" y="-1" width="63" height="12"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_EMBARQUE_2}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_EMBARQUE_2}]]></textFieldExpression>
</textField> </textField>
<textField evaluationTime="Auto" pattern="#,##0.00"> <textField evaluationTime="Auto" pattern="#,##0.00">
<reportElement uuid="adfa3eb3-6ab0-4141-aced-e3d231e4f433" x="418" y="-1" width="68" height="12"/> <reportElement uuid="adfa3eb3-6ab0-4141-aced-e3d231e4f433" x="440" y="-1" width="56" height="12"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_PEDAGIO_2}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_PEDAGIO_2}]]></textFieldExpression>
</textField> </textField>
<textField evaluationTime="Auto" pattern="#,##0.00"> <textField evaluationTime="Auto" pattern="#,##0.00">
<reportElement uuid="a4f4cff0-6b6e-42f0-9f07-7cbd06f5a545" x="486" y="-1" width="68" height="12"/> <reportElement uuid="a4f4cff0-6b6e-42f0-9f07-7cbd06f5a545" x="496" y="-1" width="58" height="12"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{TOTAL_SEGURO_2}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{TOTAL_SEGURO_2}]]></textFieldExpression>
</textField> </textField>

View File

@ -4,6 +4,8 @@
*/ */
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.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -14,17 +16,20 @@ 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.Checkbox; import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Comboitem; import org.zkoss.zul.Comboitem;
import org.zkoss.zul.ComboitemRenderer; import org.zkoss.zul.ComboitemRenderer;
import org.zkoss.zul.Datebox; import org.zkoss.zul.Datebox;
import org.zkoss.zul.Paging;
import org.zkoss.zul.Radiogroup; import org.zkoss.zul.Radiogroup;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Parada; import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAcompanhamentoEquivalentes; import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioTaxasLinha; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioTaxasLinha;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EmpresaService;
@ -33,7 +38,12 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve;
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.MyTextbox; import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioTaxasLinhaPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioTaxasLinhaPuntoVentaSelecionados;
/** /**
* *
@ -43,106 +53,50 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
@Scope("prototype") @Scope("prototype")
public class RelatorioTaxasLinhaController extends MyGenericForwardComposer { public class RelatorioTaxasLinhaController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
@Autowired
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
@Autowired @Autowired
private DataSource dataSource; private DataSource dataSource;
@Autowired @Autowired
private EmpresaService empresaService; private EmpresaService empresaService;
private List<Empresa> lsEmpresa; private List<Empresa> lsEmpresa;
private MyComboboxParada cmbParadaOrigem; private MyComboboxParada cmbParadaOrigem;
private MyComboboxParadaCve cmbParadaOrigemCve; private MyComboboxParadaCve cmbParadaOrigemCve;
private MyComboboxParada cmbParadaDestino; private MyComboboxParada cmbParadaDestino;
private MyComboboxParadaCve cmbParadaDestinoCve; private MyComboboxParadaCve cmbParadaDestinoCve;
private Datebox datInicial; private Datebox datInicial;
private Datebox datFinal; private Datebox datFinal;
private MyTextbox txtNumPuntoVenta; private MyTextbox txtNombrePuntoVenta;
private Radiogroup rdGroupTipoData; private Radiogroup rdGroupTipoData;
private Checkbox chkSubtrairIcms; private Checkbox chkSubtrairIcms;
private MyComboboxEstandar cmbEmpresa; private MyComboboxEstandar cmbEmpresa;
private Bandbox bbPesquisaPuntoVenta;
private MyListbox puntoVentaList;
private MyListbox puntoVentaSelList;
private Paging pagingPuntoVenta;
public void onClick$btnExecutarRelatorio(Event ev) throws Exception { private void executarPesquisa() {
executarRelatorio(); HibernateSearchObject<PuntoVenta> puntoVentaBusqueda =
} new HibernateSearchObject<PuntoVenta>(PuntoVenta.class, pagingPuntoVenta.getPageSize());
/** puntoVentaBusqueda.addFilterILike("nombpuntoventa", "%" + txtNombrePuntoVenta.getValue() + "%");
* @throws Exception puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
*
*/
private void executarRelatorio() throws Exception {
Relatorio relatorio; puntoVentaBusqueda.addSortAsc("nombpuntoventa");
Map<String, Object> parametros = new HashMap<String, Object>();
StringBuilder filtro = new StringBuilder();
parametros.put("DATA_INICIAL", (java.util.Date) this.datInicial.getValue()); puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue());
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioTaxasLinhaController.window.title"));
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("TIPO_DATA", Integer.parseInt(rdGroupTipoData.getSelectedItem().getValue()));
parametros.put("NUMPUNTOVENTA", txtNumPuntoVenta.getValue());
parametros.put("B_SUBTRAIR_ICMS", chkSubtrairIcms.isChecked());
filtro.append("Agência: ");
if( txtNumPuntoVenta.getValue().equals(""))
filtro.append("Todas; ");
else
filtro.append(txtNumPuntoVenta.getValue()+"; ");
filtro.append(" Tipo de Data: "+( rdGroupTipoData.getSelectedItem().getValue().equals(1)?" Origem;":"Destino;"));
filtro.append(" Subtrair ICMS: "+( chkSubtrairIcms.isChecked()?" Sim;":"Não;"));
filtro.append(" Empresa: "); plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
if (itemEmpresa != null) { if (puntoVentaList.getData().length == 0) {
Empresa empresa = (Empresa) itemEmpresa.getValue(); try {
parametros.put("EMPRESA_ID", empresa.getEmpresaId()); Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
parametros.put("EMPRESA", empresa.getNombempresa()); Labels.getLabel("relatorioTaxasLinhaController.window.title"),
filtro.append(empresa.getNombempresa()+";"); Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
} }
else
filtro.append("Todas;");
filtro.append(" Origem: ");
Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem();
if (cbiOrigem != null) {
Parada origem = (Parada) cbiOrigem.getValue();
parametros.put("ORIGEN_ID", origem.getParadaId());
filtro.append(origem.getCveparada()+";");
}
else
filtro.append("Todas;");
filtro.append(" Destino: ");
Comboitem cbiDestino = cmbParadaDestino.getSelectedItem();
if (cbiDestino != null) {
Parada destino = (Parada) cbiDestino.getValue();
parametros.put("DESTINO_ID", destino.getParadaId());
filtro.append(destino.getCveparada()+";");
}
else
filtro.append("Todos;");
parametros.put("FILTROS", filtro.toString());
relatorio = new RelatorioTaxasLinha(parametros, dataSource.getConnection());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioTaxasLinhaController.window.title"), args, MODAL);
} }
@Override @Override
@ -152,29 +106,135 @@ public class RelatorioTaxasLinhaController extends MyGenericForwardComposer {
super.doAfterCompose(comp); super.doAfterCompose(comp);
cmbParadaOrigemCve.setItemRenderer(new ComboitemRenderer() { cmbParadaOrigemCve.setItemRenderer(new ComboitemRenderer() {
@Override @Override
public void render(Comboitem cmbtm, Object o) throws Exception { public void render(Comboitem cmbtm, Object o) throws Exception {
Parada parada = (Parada) o; Parada parada = (Parada) o;
cmbtm.setLabel(parada.getCveparada()); cmbtm.setLabel(parada.getCveparada());
cmbtm.setValue(parada); cmbtm.setValue(parada);
} }
}); });
cmbParadaDestinoCve.setItemRenderer(new ComboitemRenderer() { cmbParadaDestinoCve.setItemRenderer(new ComboitemRenderer() {
@Override @Override
public void render(Comboitem cmbtm, Object o) throws Exception { public void render(Comboitem cmbtm, Object o) throws Exception {
Parada parada = (Parada) o; Parada parada = (Parada) o;
cmbtm.setLabel(parada.getCveparada()); cmbtm.setLabel(parada.getCveparada());
cmbtm.setValue(parada); cmbtm.setValue(parada);
} }
}); });
puntoVentaList.setItemRenderer(new RenderRelatorioTaxasLinhaPuntoVenta());
puntoVentaSelList.setItemRenderer(new RenderRelatorioTaxasLinhaPuntoVentaSelecionados());
}
public void onClick$btnPesquisa(Event ev) {
executarPesquisa();
}
public void onDoubleClick$puntoVentaSelList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaSelList.getSelected();
puntoVentaSelList.removeItem(puntoVenta);
}
public void onDoubleClick$puntoVentaList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
puntoVentaSelList.addItemNovo(puntoVenta);
}
public void onClick$btnLimpar(Event ev) {
puntoVentaList.setData(new ArrayList<PuntoVenta>());
bbPesquisaPuntoVenta.setText("");
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
/**
* @throws Exception
*
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private void executarRelatorio() throws Exception {
Relatorio relatorio;
Map<String, Object> parametros = new HashMap<String, Object>();
StringBuilder filtro = new StringBuilder();
filtro.append("Agência: ");
String puntoVentaIds = "";
String puntoVentas = "";
List<PuntoVenta> lsPuntoVentaSelecionados = new ArrayList(Arrays.asList(puntoVentaSelList.getData()));
if (lsPuntoVentaSelecionados.isEmpty()) {
puntoVentas = "Todas";
puntoVentaIds = "Todas";
} else {
for (int i = 0; i < lsPuntoVentaSelecionados.size(); i++) {
PuntoVenta puntoVenta = lsPuntoVentaSelecionados.get(i);
puntoVentas = puntoVentas + puntoVenta.getNombpuntoventa() + ",";
puntoVentaIds = puntoVentaIds + puntoVenta.getPuntoventaId() + ",";
}
// removendo ultima virgula
puntoVentaIds = puntoVentaIds.substring(0, puntoVentaIds.length() - 1);
puntoVentas = puntoVentas.substring(0, puntoVentas.length() - 1);
}
filtro.append(puntoVentas).append(";");
parametros.put("DATA_INICIAL", (java.util.Date) this.datInicial.getValue());
parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue());
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioTaxasLinhaController.window.title"));
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("TIPO_DATA", Integer.parseInt(rdGroupTipoData.getSelectedItem().getValue()));
parametros.put("NUMPUNTOVENTA", puntoVentaIds);
parametros.put("B_SUBTRAIR_ICMS", chkSubtrairIcms.isChecked());
filtro.append(" Tipo de Data: " + (rdGroupTipoData.getSelectedItem().getValue().equals(1) ? " Origem;" : "Destino;"));
filtro.append(" Subtrair ICMS: " + (chkSubtrairIcms.isChecked() ? " Sim;" : "Não;"));
filtro.append(" Empresa: ");
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
if (itemEmpresa != null) {
Empresa empresa = (Empresa) itemEmpresa.getValue();
parametros.put("EMPRESA_ID", empresa.getEmpresaId());
parametros.put("EMPRESA", empresa.getNombempresa());
filtro.append(empresa.getNombempresa() + ";");
} else {
filtro.append("Todas;");
}
filtro.append(" Origem: ");
Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem();
if (cbiOrigem != null) {
Parada origem = (Parada) cbiOrigem.getValue();
parametros.put("ORIGEN_ID", origem.getParadaId());
filtro.append(origem.getCveparada() + ";");
} else {
filtro.append("Todas;");
}
filtro.append(" Destino: ");
Comboitem cbiDestino = cmbParadaDestino.getSelectedItem();
if (cbiDestino != null) {
Parada destino = (Parada) cbiDestino.getValue();
parametros.put("DESTINO_ID", destino.getParadaId());
filtro.append(destino.getCveparada() + ";");
} else {
filtro.append("Todos;");
}
parametros.put("FILTROS", filtro.toString());
relatorio = new RelatorioTaxasLinha(parametros, dataSource.getConnection());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioTaxasLinhaController.window.title"), args, MODAL);
} }
public List<Empresa> getLsEmpresa() { public List<Empresa> getLsEmpresa() {
@ -189,28 +249,22 @@ public class RelatorioTaxasLinhaController extends MyGenericForwardComposer {
if (cmbParadaOrigemCve.getSelectedItem() != null) { if (cmbParadaOrigemCve.getSelectedItem() != null) {
cmbParadaOrigem.setComboItemByParada((Parada) cmbParadaOrigemCve.getSelectedItem().getValue()); cmbParadaOrigem.setComboItemByParada((Parada) cmbParadaOrigemCve.getSelectedItem().getValue());
} }
} }
public void onSelect$cmbParadaOrigem(Event ev) { public void onSelect$cmbParadaOrigem(Event ev) {
if (cmbParadaOrigem.getSelectedItem() != null) if (cmbParadaOrigem.getSelectedItem() != null)
cmbParadaOrigemCve.setComboItemByParada((Parada) cmbParadaOrigem.getSelectedItem().getValue()); cmbParadaOrigemCve.setComboItemByParada((Parada) cmbParadaOrigem.getSelectedItem().getValue());
} }
public void onSelect$cmbParadaDestinoCve(Event ev) { public void onSelect$cmbParadaDestinoCve(Event ev) {
if (cmbParadaDestinoCve.getSelectedItem() != null) {
if (cmbParadaDestinoCve.getSelectedItem() != null)
cmbParadaDestino.setComboItemByParada((Parada) cmbParadaDestinoCve.getSelectedItem().getValue()); cmbParadaDestino.setComboItemByParada((Parada) cmbParadaDestinoCve.getSelectedItem().getValue());
}
} }
public void onSelect$cmbParadaDestino(Event ev) { public void onSelect$cmbParadaDestino(Event ev) {
if (cmbParadaDestino.getSelectedItem() != null) {
if (cmbParadaDestino.getSelectedItem() != null)
cmbParadaDestinoCve.setComboItemByParada((Parada) cmbParadaDestino.getSelectedItem().getValue()); cmbParadaDestinoCve.setComboItemByParada((Parada) cmbParadaDestino.getSelectedItem().getValue());
}
} }
} }

View File

@ -0,0 +1,31 @@
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;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
public class RenderRelatorioTaxasLinhaPuntoVenta implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
PuntoVenta puntoVenta = (PuntoVenta) o;
Listcell lc = new Listcell(puntoVenta.getNombpuntoventa());
lc.setParent(lstm);
Empresa empresa = puntoVenta.getEmpresa();
if (empresa != null) {
lc = new Listcell(empresa.getNombempresa());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
lc = new Listcell(puntoVenta.getNumPuntoVenta());
lc.setParent(lstm);
lstm.setAttribute("data", puntoVenta);
}
}

View File

@ -0,0 +1,53 @@
package com.rjconsultores.ventaboletos.web.utilerias.render;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Button;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
public class RenderRelatorioTaxasLinhaPuntoVentaSelecionados implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
PuntoVenta puntoVenta = (PuntoVenta) o;
Listcell lc = new Listcell(puntoVenta.getNombpuntoventa());
lc.setParent(lstm);
Empresa empresa = puntoVenta.getEmpresa();
if (empresa != null) {
lc = new Listcell(empresa.getNombempresa());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
lc = new Listcell(puntoVenta.getNumPuntoVenta());
lc.setParent(lstm);
Button btn = new Button();
lc = new Listcell();
lc.setParent(lstm);
btn.setWidth("16");
btn.setHeight("16");
btn.setImage("/gui/img/remove.png");
btn.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
MyListbox listBox = (MyListbox) event.getTarget().getParent().getParent().getParent();
Listitem listItem = (Listitem) event.getTarget().getParent().getParent();
listBox.removeItem((PuntoVenta) listItem.getAttribute("data"));
}
});
lc.appendChild(btn);
lstm.setAttribute("data", puntoVenta);
}
}

View File

@ -368,12 +368,13 @@ relatorioAcompanhamentoEquivalentesController.lbEmpresa.value = Empresa
#Relatório de Taxas por Linha #Relatório de Taxas por Linha
relatorioTaxasLinhaController.window.title = Relatório de Taxas por Linha relatorioTaxasLinhaController.window.title = Relatório de Taxas por Linha
relatorioTaxasLinhaController.lbEmpresa.value = Empresa relatorioTaxasLinhaController.lbEmpresa.value = Empresa
relatorioTaxasLinhaController.lbNumero.value = Número
relatorioTaxasLinhaController.lbAte.value = até relatorioTaxasLinhaController.lbAte.value = até
relatorioTaxasLinhaController.lbDatInicial.value = Data Inicial relatorioTaxasLinhaController.lbDatInicial.value = Data Inicial
relatorioTaxasLinhaController.lbDatFinal.value = Data Final relatorioTaxasLinhaController.lbDatFinal.value = Data Final
relatorioTaxasLinhaController.lbTipoData.value = Tipo de Data relatorioTaxasLinhaController.lbTipoData.value = Tipo de Data
relatorioTaxasLinhaController.lbTipoData.venda.value = Venda relatorioTaxasLinhaController.lbTipoData.venda.value = Data Venda
relatorioTaxasLinhaController.lbTipoData.servico.value = Serviço relatorioTaxasLinhaController.lbTipoData.servico.value = Data Serviço
relatorioTaxasLinhaController.lbChkSubtrairIcms.value = Subtrair ICMS relatorioTaxasLinhaController.lbChkSubtrairIcms.value = Subtrair ICMS
relatorioTaxasLinhaController.lbPuntoVenta.value = N. Agência relatorioTaxasLinhaController.lbPuntoVenta.value = N. Agência
relatorioTaxasLinhaController.lbCidadaOrigem.value = Localidade Origem relatorioTaxasLinhaController.lbCidadaOrigem.value = Localidade Origem

View File

@ -7,7 +7,7 @@
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioTaxasLinha" <window id="winFiltroRelatorioTaxasLinha"
apply="${relatorioTaxasLinhaController}" contentStyle="overflow:auto" apply="${relatorioTaxasLinhaController}" contentStyle="overflow:auto"
height="200px" width="600px" border="normal"> width="800px" border="normal">
<grid fixedLayout="true"> <grid fixedLayout="true">
<columns> <columns>
<column width="15%" /> <column width="15%" />
@ -19,64 +19,50 @@
<row> <row>
<label <label
value="${c:l('relatorioTaxasLinhaController.lbDatInicial.value')}" /> value="${c:l('relatorioTaxasLinhaController.lbDatInicial.value')}" />
<datebox id="datInicial" format="dd/MM/yyyy" <datebox id="datInicial" format="dd/MM/yyyy"
lenient="false" constraint="no empty" maxlength="10" /> mold="rounded" width="95%" lenient="false" constraint="no empty"
maxlength="10" />
<label <label
value="${c:l('relatorioTaxasLinhaController.lbDatFinal.value')}" /> value="${c:l('relatorioTaxasLinhaController.lbDatFinal.value')}" />
<datebox id="datFinal" format="dd/MM/yyyy" <datebox id="datFinal" format="dd/MM/yyyy"
lenient="false" constraint="no empty" maxlength="10" /> mold="rounded" width="95%" lenient="false" constraint="no empty"
maxlength="10" />
</row> </row>
<row> <row>
<label <label
value="${c:l('relatorioTaxasLinhaController.lbCidadaOrigem.value')}" /> value="${c:l('relatorioTaxasLinhaController.lbCidadaOrigem.value')}" />
<cell> <cell>
<combobox id="cmbParadaOrigemCve" <combobox id="cmbParadaOrigemCve"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve"
mold="rounded" buttonVisible="true" width="25%" /> mold="rounded" buttonVisible="true" width="30%" />
<combobox id="cmbParadaOrigem" <combobox id="cmbParadaOrigem"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
mold="rounded" buttonVisible="true" width="70%" /> mold="rounded" buttonVisible="true" width="65%" />
</cell> </cell>
<label <label
value="${c:l('relatorioTaxasLinhaController.lbCidadeDestino.value')}" /> value="${c:l('relatorioTaxasLinhaController.lbCidadeDestino.value')}" />
<cell> <cell>
<combobox id="cmbParadaDestinoCve" <combobox id="cmbParadaDestinoCve"
autodrop="false" autodrop="false"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve"
mold="rounded" buttonVisible="true" width="25%" /> mold="rounded" buttonVisible="true" width="30%" />
<combobox id="cmbParadaDestino" autodrop="false" <combobox id="cmbParadaDestino" autodrop="false"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
mold="rounded" buttonVisible="true" width="70%" /> mold="rounded" buttonVisible="true" width="65%" />
</cell> </cell>
</row> </row>
<row> <row spans="1,1,2">
<label <label
value="${c:l('relatorioTaxasLinhaController.lbEmpresa.value')}" /> value="${c:l('relatorioTaxasLinhaController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa" mold="rounded" <combobox id="cmbEmpresa" mold="rounded"
buttonVisible="true" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioTaxasLinha$composer.lsEmpresa}" model="@{winFiltroRelatorioTaxasLinha$composer.lsEmpresa}"
width="180px" /> width="95%" />
<label
value="${c:l('relatorioTaxasLinhaController.lbPuntoVenta.value')}" />
<textbox id="txtNumPuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
maxlength="7" width="180px" />
</row> <hbox>
<row>
<label
value="${c:l('relatorioTaxasLinhaController.lbTipoData.value')}" />
<cell>
<radiogroup id="rdGroupTipoData"> <radiogroup id="rdGroupTipoData">
<radio radiogroup="rdGroupTipoData" <radio radiogroup="rdGroupTipoData"
value="1" checked="true" value="1" checked="true"
@ -85,11 +71,67 @@
value="2" value="2"
label="${c:l('relatorioTaxasLinhaController.lbTipoData.servico.value')}" /> label="${c:l('relatorioTaxasLinhaController.lbTipoData.servico.value')}" />
</radiogroup> </radiogroup>
</cell>
<cell colspan="2">
<checkbox id="chkSubtrairIcms" <checkbox id="chkSubtrairIcms"
label="${c:l('relatorioTaxasLinhaController.lbChkSubtrairIcms.value')}" /> label="${c:l('relatorioTaxasLinhaController.lbChkSubtrairIcms.value')}" />
</cell> </hbox>
</row>
<row spans="1,3">
<label
value="${c:l('relatorioTaxasLinhaController.lbPuntoVenta.value')}" />
<bandbox id="bbPesquisaPuntoVenta" width="100%"
mold="rounded" readonly="true">
<bandpopup>
<vbox>
<hbox>
<label
value="${c:l('relatorioTaxasLinhaController.lbPuntoVenta.value')}" />
<textbox id="txtNombrePuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
width="300px" mold="rounded" />
<button id="btnPesquisa"
image="/gui/img/find.png"
label="${c:l('relatorioLinhaOperacionalController.btnPesquisa.label')}" />
<button id="btnLimpar"
image="/gui/img/eraser.png"
label="${c:l('relatorioLinhaOperacionalController.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
label="${c:l('relatorioTaxasLinhaController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioTaxasLinhaController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioTaxasLinhaController.lbNumero.value')}" />
</listhead>
</listbox>
</vbox>
</bandpopup>
</bandbox>
</row>
<row spans="4">
<listbox id="puntoVentaSelList" mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" height="100px" width="100%">
<listhead>
<listheader
label="${c:l('relatorioTaxasLinhaController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioTaxasLinhaController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioTaxasLinhaController.lbNumero.value')}" />
<listheader width="5%" />
</listhead>
</listbox>
<paging id="pagingSelPuntoVenta" pageSize="10" />
</row> </row>
</rows> </rows>
</grid> </grid>