Src/Sankhya/Relatórios - IReport/Romaneio - 505/ROMANEIO.jrxml
<?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="ROMANEIO" pageWidth="590" pageHeight="842" columnWidth="562" leftMargin="14" rightMargin="14" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.818181818181821"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="29"/>
<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>
<parameter name="NUNOTAORIG" class="java.math.BigDecimal"/>
<queryString>
<![CDATA[SELECT TOP 1 CAB.NUNOTA
, CAB.NUMNOTA
, ORIG.DTNEG
, CAB.OBSERVACAO
, CAB.AD_PEDORIGINAL
, CAB.CODPARCTRANSP
, PAR.CODPARC
, PAR.NOMEPARC
, PAR.CEP
, PAR.INSCESTADNAUF
, RTRIM(ENDE.NOMEEND) AS NOMEEND
, PAR.NUMEND
, RTRIM(CID.NOMECID) AS NOMECID
, UFS.UF
, RTRIM(BAI.NOMEBAI) AS NOMEBAI
, ORIG.CODTIPOPER
, CAB.CODVEND
, FL.DATA
, VEN.AD_CODAFILIADO
, USU.CODGRUPO
FROM SANKHYA.TGFCAB CAB WITH(NOLOCK)
, SANKHYA.TGFVEN VEN WITH(NOLOCK)
, SANKHYA.TSIUSU USU WITH(NOLOCK)
, SANKHYA.TGFPAR PAR WITH(NOLOCK)
, SANKHYA.TSIEND ENDE WITH(NOLOCK)
, SANKHYA.TSIUFS UFS WITH(NOLOCK)
, SANKHYA.TSICID CID WITH(NOLOCK)
, SANKHYA.TSIBAI BAI WITH(NOLOCK)
, SANKHYA.TGFCAB ORIG WITH(NOLOCK)
, SANKHYA.TGFVAR VAR WITH(NOLOCK)
, SANKHYA.AD_PEDIDOVTEXSCFLUXO FL WITH(NOLOCK)
WHERE CAB.CODPARC = PAR.CODPARC
AND VEN.CODVEND = CAB.CODVEND
AND USU.CODUSU = CAB.CODUSUINC
AND PAR.CODEND = ENDE.CODEND
AND PAR.CODCID = CID.CODCID
AND CID.UF = UFS.CODUF
AND PAR.CODBAI= BAI.CODBAI
AND CAB.NUNOTA = VAR.NUNOTA
AND VAR.NUNOTA != VAR.NUNOTAORIG
AND VAR.NUNOTAORIG = ORIG.NUNOTA
AND FL.PEDORIGINAL = CAB.AD_PEDORIGINAL
AND FL.OCORRENCIA = 'B'
AND CAB.NUNOTA = $P{NUNOTA}
ORDER BY CAB.DTNEG DESC, CAB.NUNOTA, FL.DATA ASC]]>
</queryString>
<field name="NUNOTA" class="java.math.BigDecimal"/>
<field name="NUMNOTA" class="java.lang.Integer"/>
<field name="DTNEG" class="java.sql.Timestamp"/>
<field name="OBSERVACAO" class="java.sql.Clob"/>
<field name="AD_PEDORIGINAL" class="java.lang.Integer"/>
<field name="CODPARCTRANSP" class="java.lang.Integer"/>
<field name="CODPARC" class="java.lang.Integer"/>
<field name="NOMEPARC" class="java.lang.String"/>
<field name="CEP" class="java.lang.String"/>
<field name="INSCESTADNAUF" class="java.lang.String"/>
<field name="NOMEEND" class="java.lang.String"/>
<field name="NUMEND" class="java.lang.String"/>
<field name="NOMECID" class="java.lang.String"/>
<field name="UF" class="java.lang.String"/>
<field name="NOMEBAI" class="java.lang.String"/>
<field name="CODTIPOPER" class="java.lang.Integer"/>
<field name="CODVEND" class="java.lang.Integer"/>
<field name="DATA" class="java.sql.Timestamp"/>
<field name="AD_CODAFILIADO" class="java.lang.String"/>
<field name="CODGRUPO" class="java.lang.Integer"/>
<group name="NUMNOTA">
<groupExpression><![CDATA[$F{NUMNOTA}]]></groupExpression>
<groupHeader>
<band height="43" splitType="Stretch">
<staticText>
<reportElement key="staticText" x="272" y="1" width="108" 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" verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[PEDIDO ORIGINAL]]></text>
</staticText>
<componentElement>
<reportElement x="3" y="3" width="126" height="25"/>
<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>
<staticText>
<reportElement key="staticText-3" x="408" y="3" width="55" 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" verticalAlignment="Middle">
<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="464" y="3" width="97" 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" verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[$F{DTNEG}]]></textFieldExpression>
</textField>
<line>
<reportElement key="line-1" x="1" y="0" width="561" height="1" forecolor="#000000"/>
</line>
<textField pattern="#,##0" isBlankWhenNull="true">
<reportElement key="textField" x="272" y="16" width="108" height="23"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="14" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{AD_PEDORIGINAL}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="staticText-3" x="408" y="18" width="55" height="21"/>
<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" verticalAlignment="Middle">
<font fontName="SansSerif" size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[DATA BAIXA:]]></text>
</staticText>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement key="textField-3" x="464" y="18" width="96" height="21"/>
<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" verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[$F{DATA}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band splitType="Stretch"/>
</groupFooter>
</group>
<group name="CODPARC">
<groupExpression><![CDATA[$F{CODPARC}]]></groupExpression>
<groupHeader>
<band height="48" splitType="Stretch">
<staticText>
<reportElement key="staticText" x="3" y="0" width="51" height="15" forecolor="#000000"/>
<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" verticalAlignment="Middle">
<font fontName="SansSerif" size="9" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[PARCEIRO:]]></text>
</staticText>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement key="textField" x="56" y="0" width="504" height="15" forecolor="#000000"/>
<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 verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMEPARC}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement key="textField" x="56" y="16" width="268" height="15"/>
<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 verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMEEND}+", "+$F{NUMEND}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement key="textField" x="56" y="32" width="268" height="15"/>
<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 verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMECID}+"/"+$F{UF}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement key="textField" x="373" y="32" width="187" height="14"/>
<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 verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[StringUtils.formataCep($F{CEP})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement key="textField" x="373" y="16" width="187" height="15"/>
<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 verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMEBAI}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="staticText-5" x="3" y="16" width="51" height="15" forecolor="#000000"/>
<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" verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[END:]]></text>
</staticText>
<staticText>
<reportElement key="staticText-6" x="3" y="32" width="51" height="15" forecolor="#000000"/>
<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" verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[CIDADE:]]></text>
</staticText>
<staticText>
<reportElement key="staticText-12" x="327" y="16" width="46" height="15" forecolor="#000000"/>
<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" verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[BAIRRO:]]></text>
</staticText>
<staticText>
<reportElement key="staticText-13" x="327" y="32" width="46" height="16" forecolor="#000000"/>
<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" verticalAlignment="Middle">
<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<text><![CDATA[CEP:]]></text>
</staticText>
</band>
</groupHeader>
<groupFooter>
<band splitType="Stretch"/>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="50" splitType="Stretch">
<image vAlign="Middle">
<reportElement key="image-1" x="2" y="0" width="246" height="47"/>
<imageExpression class="java.lang.String"><![CDATA[($P{PDIR_MODELO} +
($F{AD_CODAFILIADO} != null
? "Marketplaces\\" + $F{AD_CODAFILIADO} + ".jpg"
: ($F{CODTIPOPER} == 503
? "Lojas\\EditoraInovacao.jpg"
: ($F{CODTIPOPER} == 502
? ($F{CODVEND} == 94
? "Lojas\\TaniaSilva.jpg"
: "Lojas\\VitrineDoArtesanato.jpg")
: ($F{CODTIPOPER} == 504
? "Lojas\\EditoraInovacao.jpg"
: "Lojas\\WMW.jpg")))))]]></imageExpression>
</image>
<image vAlign="Middle">
<reportElement key="image-2" x="208" y="1" width="165" height="48"/>
<imageExpression class="java.lang.String"><![CDATA[$P{PDIR_MODELO} + "Transportadoras\\" + (
$F{CODPARCTRANSP} == 36024
? "Correios"
: ($F{CODPARCTRANSP} == 156640
? "Mercado Envios"
: ($F{CODPARCTRANSP} == 206272
? "Mandae"
: "Editora Inovação")
)
) + "\\logo.jpg"]]></imageExpression>
</image>
<textField isBlankWhenNull="false">
<reportElement key="textField" x="392" y="2" width="168" height="43"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="20" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[($F{CODTIPOPER} == 504 ? "REENVIO" :
($F{CODGRUPO} == 7 ? "SAC" :
($F{AD_CODAFILIADO} == null ? "ROMANEIO" :
"MARKETPLACE")))]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band splitType="Stretch"/>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<subreport isUsingCache="true">
<reportElement key="ITENS_ROMANEIO" positionType="Float" stretchType="RelativeToTallestObject" x="2" y="0" width="559" height="20" isPrintWhenDetailOverflows="true"/>
<subreportParameter name="NUNOTA">
<subreportParameterExpression><![CDATA[$F{NUNOTA}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "ITENS_ROMANEIO.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="102" splitType="Stretch">
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField" x="145" y="26" 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="315" y="26" width="64" 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>
<line>
<reportElement key="line" x="0" y="35" width="170" height="1"/>
</line>
<line>
<reportElement key="line" x="392" y="34" width="170" height="1"/>
</line>
<staticText>
<reportElement key="staticText" x="2" y="36" width="168" height="15"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Separador]]></text>
</staticText>
<staticText>
<reportElement key="staticText" x="392" y="36" width="168" height="15"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Conferente]]></text>
</staticText>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>