InovacaoMediaBrasil/ProcessWorkflowsAndDatabaseScripts

View on GitHub
Src/Sankhya/Relatórios - IReport/Requisição Interna/REQUISICAO.jrxml

Summary

Maintainability
Test Coverage
<?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="REQUISICAO" pageWidth="590" pageHeight="842" columnWidth="562" leftMargin="14" rightMargin="14" topMargin="20" bottomMargin="20">
    <property name="ireport.zoom" value="1.8181818181818743"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="48"/>
    <property name="ireport.scriptlethandling" value="0"/>
    <property name="ireport.encoding" value="UTF-8"/>
    <import value="net.sf.jasperreports.engine.*"/>
    <import value="java.util.*"/>
    <import value="com.sankhya.util.StringUtils"/>
    <import value="net.sf.jasperreports.engine.data.*"/>
    <parameter name="PDIR_MODELO" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["C:\\Sankhya\\Modelos\\"]]></defaultValueExpression>
    </parameter>
    <parameter name="NUNOTA" class="java.math.BigDecimal"/>
    <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["./"]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![CDATA[SELECT CAB.NUNOTA,
       CAB.NUMNOTA,
       CAB.OBSERVACAO,
       CAB.CODVEND,
       ISNULL(RTRIM(APELIDO) + ' - ' + AD_SETORVEND, APELIDO) AS APELIDO,
       CAB.CODPARC


FROM sankhya.TGFCAB CAB,
     sankhya.TGFVEN VEN

WHERE
    VEN.CODVEND = CAB.CODVEND
  AND CAB.NUNOTA = $P{NUNOTA}

 ORDER BY CAB.DTNEG,
         CAB.NUNOTA]]>
    </queryString>
    <field name="NUNOTA" class="java.math.BigDecimal"/>
    <field name="NUMNOTA" class="java.lang.Integer"/>
    <field name="OBSERVACAO" class="java.lang.String"/>
    <field name="CODVEND" class="java.lang.Integer"/>
    <field name="APELIDO" class="java.lang.String"/>
    <field name="CODPARC" class="java.lang.Integer"/>
    <variable name="TOTAL_SERVICO" class="java.math.BigDecimal" calculation="Sum"/>
    <variable name="TOTAL_PRODUTO" class="java.math.BigDecimal" calculation="Sum"/>
    <variable name="DESCONTO_TOTAL" class="java.math.BigDecimal" calculation="Sum"/>
    <variable name="VALOR_LIQUIDO" class="java.math.BigDecimal" calculation="Sum"/>
    <variable name="VALOR_TOTAL_PEIDO" class="java.lang.String"/>
    <group name="NUMNOTA">
        <groupExpression><![CDATA[$F{NUMNOTA}]]></groupExpression>
        <groupHeader>
            <band height="53" splitType="Stretch">
                <staticText>
                    <reportElement key="staticText-2" x="167" y="7" width="74" height="15"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement>
                        <font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <text><![CDATA[SOLICITANTE:]]></text>
                </staticText>
                <textField pattern="" isBlankWhenNull="true">
                    <reportElement key="textField-2" x="242" y="7" width="307" height="15"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Left">
                        <font fontName="SansSerif" size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression class="java.lang.String"><![CDATA[($F{CODVEND} != null && $F{CODVEND}.intValue() != 0 ? "-"+$F{APELIDO} : "")]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement key="staticText-3" x="167" y="30" width="39" height="15"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement>
                        <font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <text><![CDATA[DATA:]]></text>
                </staticText>
                <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
                    <reportElement key="textField-3" x="206" y="30" width="85" height="15"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font fontName="SansSerif" size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
                </textField>
                <line>
                    <reportElement key="line-1" x="0" y="-2" width="562" height="1" forecolor="#000000"/>
                    <graphicElement>
                        <pen lineWidth="1.0" lineStyle="Solid"/>
                    </graphicElement>
                </line>
                <componentElement>
                    <reportElement x="14" y="3" width="147" height="42"/>
                    <jr:barbecue xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" type="Code39 (Extended)" drawText="true" checksumRequired="false">
                        <jr:codeExpression><![CDATA[$F{NUNOTA}.toString() + ","]]></jr:codeExpression>
                    </jr:barbecue>
                </componentElement>
            </band>
        </groupHeader>
        <groupFooter>
            <band splitType="Stretch"/>
        </groupFooter>
    </group>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="50" splitType="Stretch">
            <staticText>
                <reportElement key="staticText" x="188" y="17" width="374" height="33"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="SansSerif" size="24" isBold="true" pdfFontName="Helvetica-Bold"/>
                </textElement>
                <text><![CDATA[PEDIDO REQUISIÇÃO INTERNA]]></text>
            </staticText>
            <image vAlign="Middle">
                <reportElement key="image-1" x="3" y="5" width="240" height="45"/>
                <imageExpression class="java.lang.String"><![CDATA[$P{PDIR_MODELO} + "logo_vitrine_M.jpg"]]></imageExpression>
            </image>
        </band>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="32" splitType="Stretch">
            <subreport isUsingCache="true">
                <reportElement key="ITENS_REQUISICAO" x="3" y="0" width="559" height="32"/>
                <subreportParameter name="NUNOTA">
                    <subreportParameterExpression><![CDATA[$F{NUNOTA}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <returnValue subreportVariable="TOTAL_SERVICO" toVariable="TOTAL_SERVICO" calculation="Sum"/>
                <returnValue subreportVariable="TOTAL_PRODUTO" toVariable="TOTAL_PRODUTO" calculation="Sum"/>
                <returnValue subreportVariable="DESCONTO_TOTAL" toVariable="DESCONTO_TOTAL" calculation="Sum"/>
                <returnValue subreportVariable="VALOR_LIQUIDO" toVariable="VALOR_LIQUIDO" calculation="Sum"/>
                <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "ITENS_REQUISICAO.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </detail>
    <columnFooter>
        <band splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="133">
            <staticText>
                <reportElement key="element-14" x="1" y="1" width="560" height="17" forecolor="#000000"/>
                <box leftPadding="2" rightPadding="2">
                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Center">
                    <font fontName="SansSerif" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>
                </textElement>
                <text><![CDATA[OBSERVAÇÃO]]></text>
            </staticText>
            <textField pattern="" isBlankWhenNull="false">
                <reportElement key="textField" x="167" y="114" width="170" height="19"/>
                <box>
                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right">
                    <font fontName="SansSerif" size="10"/>
                </textElement>
                <textFieldExpression class="java.lang.String"><![CDATA["Página " + $V{PAGE_NUMBER} + " de "]]></textFieldExpression>
            </textField>
            <textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
                <reportElement key="textField" x="337" y="114" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
                <box>
                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">
                    <font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>
                </textElement>
                <textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement key="textField-10" x="2" y="17" width="558" height="77"/>
                <textElement/>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{OBSERVACAO}]]></textFieldExpression>
            </textField>
        </band>
    </summary>
</jasperReport>