<?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="report name" pageWidth="750" pageHeight="900" columnWidth="710" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.461537825000007"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="240"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/inventario/solicitud_compras"/>
	<property name="ireport.jasperserver.url" value="http://192.168.2.43:8090/jasperserver/services/repository"/>
	<parameter name="id_vigencia" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_cen_op" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_soli_compra" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="username" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select
tab0.*,tab1.cantidad, tab1.observaciones as detalle,
tab2.codigo_elemento, tab2.desc_catalogo ,
tab3.descripcion as des_area, tab4.razon_soc,
tab4.num_doc, tab5.prefijo,

tab7.num_doc as num_doc_log,
tab7.razon_soc as razon_soc_log

from in_soli_compra tab0

join in_soli_det_compra tab1 on tab0.id_soli_compra= tab1.id_soli_compra and tab0.id_vigencia= tab1.id_vigencia and tab0.id_cen_op = tab1.id_cen_op
join in_codigo_elemento_v tab2 on tab1.id_catalogo= tab2.id_catalogo and tab1.id_linea = tab2.id_linea and tab1.id_clase= tab2.id_clase
join area tab3 on tab0.id_area = tab3.id_area
join interceros tab4 on tab0.id_mae_ter= tab4.id_mae_ter
join centro_operacion tab5 on tab0.id_cen_op= tab5.id_cen_op

left join interceros_v tab7 on tab0.id_usuario_log = tab7.id_mae_ter

WHERE
1=1
and tab0.id_cen_op = $P{id_cen_op}
and tab0.id_vigencia=$P{id_vigencia}
and tab0.id_soli_compra = $P{id_soli_compra}]]>
	</queryString>
	<field name="ID_SOLI_COMPRA" class="java.math.BigDecimal"/>
	<field name="ID_VIGENCIA" class="java.math.BigDecimal"/>
	<field name="ID_CEN_OP" class="java.math.BigDecimal"/>
	<field name="ID_AREA" class="java.math.BigDecimal"/>
	<field name="ID_MAE_TER" class="java.math.BigDecimal"/>
	<field name="OBSERVACIONES" class="java.lang.String"/>
	<field name="FECHA_SOLICITUD" class="java.sql.Timestamp"/>
	<field name="ESTADO" class="java.math.BigDecimal"/>
	<field name="ANULADO" class="java.math.BigDecimal"/>
	<field name="FECHA_ANU" class="java.sql.Timestamp"/>
	<field name="MOTIVO_ANU" class="java.lang.String"/>
	<field name="ID_USUARIO_ANU" class="java.math.BigDecimal"/>
	<field name="ID_USUARIO_LOG" class="java.math.BigDecimal"/>
	<field name="CANTIDAD" class="java.math.BigDecimal"/>
	<field name="DETALLE" class="java.lang.String"/>
	<field name="CODIGO_ELEMENTO" class="java.lang.String"/>
	<field name="DESC_CATALOGO" class="java.lang.String"/>
	<field name="DES_AREA" class="java.lang.String"/>
	<field name="RAZON_SOC" class="java.lang.String"/>
	<field name="NUM_DOC" class="java.lang.String"/>
	<field name="PREFIJO" class="java.lang.String"/>
	<field name="NUM_DOC_LOG" class="java.lang.String"/>
	<field name="RAZON_SOC_LOG" class="java.lang.String"/>
	<variable name="total_items" class="java.math.BigDecimal" calculation="Count">
		<variableExpression><![CDATA[$F{CODIGO_ELEMENTO}]]></variableExpression>
	</variable>
	<variable name="total_cant" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{CANTIDAD}]]></variableExpression>
	</variable>
	<background>
		<band height="418">
			<image>
				<reportElement x="210" y="0" width="480" height="240">
					<printWhenExpression><![CDATA[$F{ANULADO}.intValue()==1]]></printWhenExpression>
				</reportElement>
				<imageExpression class="java.lang.String"><![CDATA["repo:anulado.jpg"]]></imageExpression>
			</image>
		</band>
	</background>
	<title>
		<band height="10" splitType="Stretch"/>
	</title>
	<pageHeader>
		<band height="159" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="60" width="454" height="99"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="1.0"/>
					<topPen lineWidth="1.0"/>
					<leftPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
					<rightPen lineWidth="1.0"/>
				</box>
				<textElement/>
				<text><![CDATA[]]></text>
			</staticText>
			<staticText>
				<reportElement x="454" y="60" width="256" height="99"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="1.0"/>
					<topPen lineWidth="1.0"/>
					<leftPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
					<rightPen lineWidth="1.0"/>
				</box>
				<textElement/>
				<text><![CDATA[]]></text>
			</staticText>
			<staticText>
				<reportElement x="0" y="70" width="107" height="20"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[SOLICITADO POR:]]></text>
			</staticText>
			<staticText>
				<reportElement x="0" y="132" width="107" height="20"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[OBSERVACIONES:]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="107" y="70" width="344" height="20"/>
				<textElement verticalAlignment="Middle">
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{RAZON_SOC}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="479" y="70" width="74" height="20"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[No.]]></text>
			</staticText>
			<staticText>
				<reportElement x="479" y="98" width="74" height="20"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[FECHA:]]></text>
			</staticText>
			<staticText>
				<reportElement x="479" y="125" width="74" height="20"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[CIUDAD:]]></text>
			</staticText>
			<textField pattern="###0" isBlankWhenNull="true">
				<reportElement x="553" y="70" width="126" height="20" isRemoveLineWhenBlank="true"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{ID_SOLI_COMPRA}]]></textFieldExpression>
			</textField>
			<textField pattern="dd-MM-yyyy" isBlankWhenNull="true">
				<reportElement x="553" y="98" width="126" height="20" isRemoveLineWhenBlank="true"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{FECHA_SOLICITUD}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="553" y="125" width="126" height="20" isRemoveLineWhenBlank="true"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PREFIJO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="107" y="105" width="345" height="20"/>
				<textElement verticalAlignment="Middle">
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DES_AREA}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="107" y="132" width="345" height="20"/>
				<textElement verticalAlignment="Middle">
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{OBSERVACIONES}]]></textFieldExpression>
			</textField>
			<image>
				<reportElement x="0" y="0" width="283" height="53"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
			<staticText>
				<reportElement x="0" y="105" width="107" height="20"/>
				<textElement verticalAlignment="Middle">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[AREA:]]></text>
			</staticText>
			<textField>
				<reportElement x="294" y="33" width="416" height="20"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font size="16"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[" SOLICITUD DE COMPRA No."+$F{ID_SOLI_COMPRA}.toString()]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="47" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="0" y="22" width="95" height="25" backcolor="#E2D9D9"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None"/>
				<text><![CDATA[CÓDIGO]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="95" y="22" width="261" height="25" backcolor="#E2D9D9"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None"/>
				<text><![CDATA[DESCRIPCIÓN]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="356" y="22" width="286" height="25" backcolor="#E2D9D9"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None"/>
				<text><![CDATA[DETALLE]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="642" y="22" width="68" height="25" backcolor="#E2D9D9"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None"/>
				<text><![CDATA[CANT.]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="20" splitType="Immediate">
			<textField isBlankWhenNull="true">
				<reportElement x="0" y="0" width="95" height="20"/>
				<box leftPadding="4" rightPadding="4">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CODIGO_ELEMENTO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="95" y="0" width="261" height="20"/>
				<box leftPadding="4" rightPadding="4">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle">
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESC_CATALOGO}]]></textFieldExpression>
			</textField>
			<textField pattern="###0" isBlankWhenNull="true">
				<reportElement x="356" y="0" width="286" height="20"/>
				<box leftPadding="4" rightPadding="4">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DETALLE}]]></textFieldExpression>
			</textField>
			<textField pattern="###0;(-###0)" isBlankWhenNull="true">
				<reportElement x="642" y="0" width="68" height="20"/>
				<box leftPadding="4" rightPadding="7">
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{CANTIDAD}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="20" splitType="Stretch">
			<textField pattern="#,##0.00;(-#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Opaque" x="0" y="0" width="510" height="20" forecolor="#000000" backcolor="#E2D9D9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[" Total Items: "+$V{total_items}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="510" y="0" width="132" height="20" forecolor="#000000" backcolor="#E2D9D9"/>
				<box>
					<topPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[TOTAL:]]></text>
			</staticText>
			<textField pattern="###0;(-###0)" isBlankWhenNull="true">
				<reportElement mode="Opaque" x="642" y="0" width="68" height="20" isRemoveLineWhenBlank="true" backcolor="#E2D9D9"/>
				<box leftPadding="0" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_cant}]]></textFieldExpression>
			</textField>
		</band>
	</columnFooter>
	<pageFooter>
		<band height="24">
			<textField>
				<reportElement mode="Opaque" x="0" y="12" width="356" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Impreso por: "+$P{username}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="0" width="356" height="12" forecolor="#575757" backcolor="#FFFFFF">
					<printWhenExpression><![CDATA[$F{RAZON_SOC_LOG} != null]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Elaborado por: "+$F{RAZON_SOC_LOG}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<lastPageFooter>
		<band height="124">
			<staticText>
				<reportElement x="0" y="20" width="710" height="80"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement/>
				<text><![CDATA[]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="46" y="76" width="216" height="13"/>
				<box leftPadding="5" rightPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["CC/Nit: "+$F{NUM_DOC}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="46" y="56" width="216" height="20"/>
				<box leftPadding="2" rightPadding="2">
					<topPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{RAZON_SOC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="112" width="356" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Impreso por: "+$P{username}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="100" width="356" height="12" forecolor="#575757" backcolor="#FFFFFF">
					<printWhenExpression><![CDATA[$F{RAZON_SOC_LOG} != null]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Elaborado por: "+$F{RAZON_SOC_LOG}]]></textFieldExpression>
			</textField>
		</band>
	</lastPageFooter>
	<summary>
		<band height="20"/>
	</summary>
</jasperReport>
