<?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="hist_element_entradas" language="groovy" pageWidth="1000" pageHeight="555" orientation="Landscape" columnWidth="1000" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isTitleNewPage="true">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/inventario/inf_hist_elemento"/>
	<property name="ireport.jasperserver.url" value="http://192.168.2.43:8090/jasperserver/services/repository"/>
	<parameter name="id_meses" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="vigencia" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="wherePlaqueta" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="whereInventarioDV" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="whereSerie" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="vigencia_mes" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="wherePlaca" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="ID_INVENTARIO_DV" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select tab0.* from(
select da.id_toma_inventario, da.id_asignacion_toma, da.id_inventario_dv, da.id_partes_inventario, ato.descripcion as desc_toma, ri.id_recurso_inventario, ri.foto_recurso, pi.serie, pi.plaqueta, pi.placa, pi.observaciones, pc.nombre as nombre_partes, t.fecha_inicio, t.fecha_fin
from in_detalle_asignacion da join in_asignacion_toma ato on da.id_asignacion_toma=ato.id_asignacion_toma
join in_toma_inventario t on da.id_toma_inventario=t.id_toma_inventario
join in_recurso_inventario ri on da.id_detalle_asignacion=ri.id_detalle_asignacion
join in_partes_inventario pi on da.id_partes_inventario=pi.id_partes_inventario
join in_partes_clase pc on pi.id_partes_clase =pc.id_partes_clase
order by t.fecha_inicio, da.id_inventario_dv, da.id_partes_inventario, ri.id_recurso_inventario
)tab0

where 1=1 and tab0.id_inventario_dv =$P{ID_INVENTARIO_DV}
$P!{wherePlaqueta}
$P!{whereSerie}
$P!{wherePlaca}]]>
	</queryString>
	<field name="ID_TOMA_INVENTARIO" class="java.math.BigDecimal"/>
	<field name="ID_ASIGNACION_TOMA" class="java.math.BigDecimal"/>
	<field name="ID_INVENTARIO_DV" class="java.math.BigDecimal"/>
	<field name="ID_PARTES_INVENTARIO" class="java.math.BigDecimal"/>
	<field name="DESC_TOMA" class="java.lang.String"/>
	<field name="ID_RECURSO_INVENTARIO" class="java.math.BigDecimal"/>
	<field name="FOTO_RECURSO" class="oracle.sql.BLOB"/>
	<field name="SERIE" class="java.lang.String"/>
	<field name="PLAQUETA" class="java.math.BigDecimal"/>
	<field name="PLACA" class="java.lang.String"/>
	<field name="OBSERVACIONES" class="java.lang.String"/>
	<field name="NOMBRE_PARTES" class="java.lang.String"/>
	<field name="FECHA_INICIO" class="java.sql.Timestamp"/>
	<field name="FECHA_FIN" class="java.sql.Timestamp"/>
	<group name="partes_inventario">
		<groupExpression><![CDATA[$F{ID_PARTES_INVENTARIO}]]></groupExpression>
		<groupHeader>
			<band height="50">
				<textField>
					<reportElement x="150" y="10" width="200" height="20"/>
					<box leftPadding="2">
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMBRE_PARTES}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="true">
					<reportElement x="425" y="10" width="127" height="20"/>
					<box leftPadding="2">
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{SERIE}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="true">
					<reportElement x="627" y="10" width="127" height="20"/>
					<box leftPadding="2">
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{PLAQUETA}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="true">
					<reportElement x="829" y="10" width="129" height="20"/>
					<box leftPadding="2">
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{PLACA}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="true">
					<reportElement x="150" y="30" width="808" height="20"/>
					<box leftPadding="2">
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{OBSERVACIONES}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement mode="Opaque" x="0" y="10" width="150" height="20" backcolor="#88C2F9"/>
					<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 verticalAlignment="Middle">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Tipo de parte]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="350" y="10" width="75" height="20" backcolor="#88C2F9"/>
					<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 verticalAlignment="Middle">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Serie]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="552" y="10" width="75" height="20" backcolor="#88C2F9"/>
					<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 verticalAlignment="Middle">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Plaqueta]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="754" y="10" width="75" height="20" backcolor="#88C2F9"/>
					<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 verticalAlignment="Middle">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Placa]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="0" y="30" width="150" height="20" backcolor="#88C2F9"/>
					<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 verticalAlignment="Middle">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Observaciones]]></text>
				</staticText>
			</band>
		</groupHeader>
	</group>
	<group name="toma_inventario">
		<groupExpression><![CDATA[$F{ID_TOMA_INVENTARIO}]]></groupExpression>
		<groupHeader>
			<band height="54">
				<textField>
					<reportElement x="150" y="14" width="125" height="20"/>
					<box leftPadding="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" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{ID_TOMA_INVENTARIO}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement x="150" y="34" width="808" height="20"/>
					<box leftPadding="2">
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{DESC_TOMA}]]></textFieldExpression>
				</textField>
				<textField pattern="dd/MM/yyyy">
					<reportElement x="767" y="14" width="191" height="20"/>
					<box leftPadding="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" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.util.Date"><![CDATA[$F{FECHA_FIN}]]></textFieldExpression>
				</textField>
				<textField pattern="dd/MM/yyyy">
					<reportElement x="425" y="14" width="192" height="20"/>
					<box leftPadding="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" markup="none">
						<font size="7"/>
					</textElement>
					<textFieldExpression class="java.util.Date"><![CDATA[$F{FECHA_INICIO}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement mode="Opaque" x="0" y="14" width="150" height="20" backcolor="#88C2F9"/>
					<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">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[No Toma Física]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="275" y="14" width="150" height="20" backcolor="#88C2F9"/>
					<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">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Fecha Inicio]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="617" y="14" width="150" height="20" backcolor="#88C2F9"/>
					<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">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Fecha Fin]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="0" y="34" width="150" height="20" backcolor="#88C2F9"/>
					<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">
						<font size="7" isBold="true"/>
					</textElement>
					<text><![CDATA[Descripción Toma]]></text>
				</staticText>
			</band>
		</groupHeader>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<detail>
		<band height="140" splitType="Stretch">
			<image hAlign="Center" vAlign="Top" isUsingCache="true">
				<reportElement x="417" y="14" width="200" height="126" isRemoveLineWhenBlank="true"/>
				<graphicElement>
					<pen lineWidth="0.75"/>
				</graphicElement>
				<imageExpression class="java.io.InputStream"><![CDATA[$F{FOTO_RECURSO}.getBinaryStream()]]></imageExpression>
			</image>
		</band>
	</detail>
</jasperReport>
