<?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="959" pageHeight="100" orientation="Landscape" columnWidth="959" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="39"/>
	<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 distinct mov.prefijo, mov.id_movimientos_dv, mov.fecha_mov, mov.fecha_mov_time, mov.desc_concep_mov, mov.desc_tipo_almac_fin, mov.completo_fin, estr.nombre as desc_estructura, mov.desc_espacio_fin, tab1.id_inventario_dv,
inv.costo_inicial, sal.costo_actual as valor_libros, inv.costo_inicial- sal.costo_actual as depre_acumulada, mov.estado, mov.anulado, sal.id_meses, sal.id_vigencia, mov.id_tipo_movimiento, ope.nom_cen_op
from in_movimientos_dv_v mov
join in_det_mov_dv tab1 on mov.id_movimientos_dv=tab1.id_movimientos_dv and mov.id_tipo_movimiento=tab1.id_tipo_movimiento and mov.id_vigencia=tab1.id_vigencia and mov.id_cen_op=tab1.id_cen_op
join in_inventario_dv inv on tab1.id_inventario_dv=inv.id_inventario_dv
join in_estructura estr on mov.id_estructura_fin = estr.id_estructura
join centro_operacion ope on mov.id_cen_op_fin=ope.id_cen_op
left join in_saldo_inventario_dv sal on tab1.id_inventario_dv=sal.id_inventario_dv and sal.id_meses=extract(MONTH FROM mov.fecha_mov) and sal.id_vigencia= extract(year from mov.fecha_mov)
left join in_partes_inventario tab0  on tab1.id_inventario_dv=tab0.id_inventario_dv
left join in_partes_clase pc on tab0.id_partes_clase=pc.id_partes_clase




where 1=1
$P!{whereSerie}
$P!{wherePlaqueta}
$P!{wherePlaca}
order by mov.fecha_mov_time desc


)tab0

where
tab0.fecha_mov <= last_day(to_date($P{vigencia_mes}, 'yyyy-mm'))
and id_tipo_movimiento=1 and tab0.id_inventario_dv = $P{ID_INVENTARIO_DV}]]>
	</queryString>
	<field name="PREFIJO" class="java.lang.String"/>
	<field name="ID_MOVIMIENTOS_DV" class="java.math.BigDecimal"/>
	<field name="FECHA_MOV" class="java.sql.Timestamp"/>
	<field name="FECHA_MOV_TIME" class="oracle.sql.TIMESTAMP"/>
	<field name="DESC_CONCEP_MOV" class="java.lang.String"/>
	<field name="DESC_TIPO_ALMAC_FIN" class="java.lang.String"/>
	<field name="COMPLETO_FIN" class="java.lang.String"/>
	<field name="DESC_ESTRUCTURA" class="java.lang.String"/>
	<field name="DESC_ESPACIO_FIN" class="java.lang.String"/>
	<field name="ID_INVENTARIO_DV" class="java.math.BigDecimal"/>
	<field name="COSTO_INICIAL" class="java.math.BigDecimal"/>
	<field name="VALOR_LIBROS" class="java.math.BigDecimal"/>
	<field name="DEPRE_ACUMULADA" class="java.math.BigDecimal"/>
	<field name="ESTADO" class="java.math.BigDecimal"/>
	<field name="ANULADO" class="java.math.BigDecimal"/>
	<field name="ID_MESES" class="java.math.BigDecimal"/>
	<field name="ID_VIGENCIA" class="java.math.BigDecimal"/>
	<field name="ID_TIPO_MOVIMIENTO" class="java.math.BigDecimal"/>
	<field name="NOM_CEN_OP" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<columnHeader>
		<band height="50" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="0" width="168" height="20" isRemoveLineWhenBlank="true"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle">
					<font size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Tipo Movimiento           :]]></text>
			</staticText>
			<staticText>
				<reportElement x="168" y="0" width="793" height="20"/>
				<textElement textAlignment="Left" verticalAlignment="Middle" markup="none"/>
				<text><![CDATA[ENTRADA INVENTARIO]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="482" y="32" width="112" height="18" 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[Estructura]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="594" y="32" width="113" height="18" 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[Espacio]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="357" y="32" width="125" height="18" 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[Responsable]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="98" y="32" width="53" height="18" 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]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="232" y="32" width="125" height="18" 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[Tipo Almacenamiento]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="916" y="32" width="42" height="18" 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[Estado]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="151" y="32" width="81" height="18" 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[Concepto]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="780" y="32" width="75" height="18" 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[Depreciación Acumulada]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="48" y="32" width="50" height="18" 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[Cen Op]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="707" y="32" width="73" height="18" 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[Costo Historico]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="0" y="32" width="48" height="18" 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 Mov.]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="855" y="32" width="61" height="18" 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[Valor Libros]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="20" splitType="Stretch">
			<textField pattern="#,##0.00;#,##0.00-" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="707" y="0" width="73" height="20"/>
				<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="Right" verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{COSTO_INICIAL}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="232" y="0" width="125" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESC_TIPO_ALMAC_FIN}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="482" y="0" width="112" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESC_ESTRUCTURA}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="48" y="0" width="50" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PREFIJO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="916" y="0" width="42" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ESTADO}==1?"Abierto":$F{ANULADO}==1?"Anulado":"Cerrado"]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="48" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{ID_MOVIMIENTOS_DV}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="357" y="0" width="125" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{COMPLETO_FIN}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="151" y="0" width="81" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESC_CONCEP_MOV}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;#,##0.00-" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="780" y="0" width="75" height="20"/>
				<box leftPadding="2" rightPadding="3">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{DEPRE_ACUMULADA}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="594" y="0" width="113" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESC_ESPACIO_FIN}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="98" y="0" width="53" height="20"/>
				<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"/>
				</textElement>
				<textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{FECHA_MOV}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;#,##0.00-" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="855" y="0" width="61" height="20"/>
				<box leftPadding="2" rightPadding="3">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR_LIBROS}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
</jasperReport>
