<?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="boletin_cont_ppye_sgr" language="groovy" pageWidth="950" pageHeight="612" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="910" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.2396694214876052"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/inventario/boletin_cont_ppye_sgr"/>
	<property name="ireport.jasperserver.url" value="http://localhost:18091/jasperserver/services/repository"/>
	<parameter name="vigencia" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_meses" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="whereLinea" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereGrupoAlmacenamiento" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereCenOp" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="whereGrupo" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereTipoTransac1" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="whereTipoOrigenTab" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="username" class="java.lang.String" isForPrompting="false">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select
/* tag para validar contra que es la diferencia - 20180829 */
case
when SUBSTR(tab0.digitos,0,1) = '1' then 1
/*when tab0.digitos = '891521' then 1 -- Se comenta para la cuenta quemada - 20180829 */
else 8 end as tag_dig,
tab0.*
from(

SELECT
nvl(tab0.mes,tab1.mes) as mes,
nvl(tab0.id_cen_op,tab1.id_cen_op) as id_cen_op,
nvl(tab0.nom_cen_op,tab1.nom_cen_op) as nom_cen_op,
nvl(tab0.digitos,tab1.cuenta) as digitos,
nvl(tab0.nom_cuenta,tab1.nombre_cuenta) as nom_cuenta,
nvl(tab0.cod_aux,tab1.auxiliar) as cod_aux,
nvl(tab0.nom_aux,tab1.nombre_cuenta) as nom_aux,

nvl(tab0.costo_hist,0) as costo_hist,
nvl(tab0.depre_mes,0) as depre_mes,
nvl(tab0.valor_lib2,0) as valor_lib2,
nvl(tab0.valor_valoracion,0) as valor_valoracion,
nvl(tab0.ajuste_ch_convergencia,0) as ajuste_ch_convergencia,
nvl(tab0.valor_deterioro,0) as valor_deterioro,
nvl(tab0.valor_residual,0) as valor_residual,
nvl(tab0.depre_acum,0) as depre_acum,
nvl(tab0.valor_lib,0) as valor_lib,

nvl(tab1.nuevo_saldo,0) as saldo_balance

FROM(

    SELECT
    tab0.mes,
    tab0.id_cen_op,
    tab0.nom_cen_op,
    tab0.digitos,
    tab0.nom_cuenta,
    tab0.cod_aux,
    tab0.nom_aux,

    sum(nvl(tab0.costo_hist,0)) as costo_hist,
    sum(nvl(tab0.depre_mes,0)) as depre_mes,
    sum(nvl(tab0.valor_lib2,0)) as valor_lib2,
    sum(nvl(tab0.valor_valoracion,0)) as valor_valoracion,
    sum(nvl(tab0.ajuste_ch_convergencia,0)) as ajuste_ch_convergencia,
    sum(nvl(tab0.valor_deterioro,0)) as valor_deterioro,
    sum(nvl(tab0.valor_residual,0)) as valor_residual,
    sum(nvl(tab0.depre_acum,0)) as depre_acum,
    sum(nvl(tab0.valor_lib,0)) as valor_lib

    FROM(

        SELECT
        tab0.*,

        cont.digitos as digitos_grup,
        upper(cont.nom_cuenta) as nom_cuenta_grup,
        cont.cod_aux as cod_aux_grup,
        upper(cont.nom_aux) as nom_aux_grup,
        contdd.digitos as digitos_contdd,
        upper(contdd.nom_cuenta) as nom_cuenta_contdd,
        contdd.cod_aux as cod_aux_contdd,
        upper(contdd.nom_aux) as nom_aux_contdd,
        contdc.digitos as digitos_contdc,
        upper(contdc.nom_cuenta) as nom_cuenta_contdc,
        contdc.cod_aux as cod_aux_contdc,
        upper(contdc.nom_aux) as nom_aux_contdc

        FROM(

            select distinct
            tabFin.*,
            tabFin.costo_hist+( tabFin.valor_valoracion + tabFin.AJUSTE_CH_CONVERGENCIA + tabFin.valor_deterioro - tabFin.valor_residual )-(tabFin.depre_acum+tabFin.depre_mes) as valor_lib
            from (

                select

                case
                when tab0.id_grupo_almacenamiento is not null then tab0.id_grupo_almacenamiento
                else table2.id_grupo_almacenamiento
                end as id_grupo,

                case
                when tab0.digitos is not null then tab0.digitos
                else table2.digitos
                end as digitos,

                case
                when tab0.nom_cuenta is not null then upper(tab0.nom_cuenta)
                else upper(table2.nom_cuenta)
                end as nom_cuenta,

                case
                when tab0.id_clase is not null then tab0.id_clase
                else table2.id_clase
                end as id_clase,

                case
                when tab0.costo_hist is not null then tab0.costo_hist
                when table2.costo_hist is not null then table2.costo_hist
                end as costo_hist,

                case
                when tab0.depre_mes is not null then tab0.depre_mes
                else 0
                end as depre_mes,

                case
                when tab0.valor_lib is not null then tab0.valor_lib
                else table2.valor_lib
                end as valor_lib2,

                case
                when tab0.valor_valoracion is not null then tab0.valor_valoracion
                else table2.valor_valoracion
                end as valor_valoracion,

                case
                when tab0.AJUSTE_CH_CONVERGENCIA is not null then tab0.AJUSTE_CH_CONVERGENCIA
                else table2.AJUSTE_CH_CONVERGENCIA
                end as AJUSTE_CH_CONVERGENCIA,

                case
                when tab0.valor_deterioro is not null then tab0.valor_deterioro
                else table2.valor_deterioro
                end as valor_deterioro,

                case
                when tab0.valor_residual is not null then tab0.valor_residual
                else table2.valor_residual
                end as valor_residual,

                case
                when tab0.id_linea is not null then tab0.id_linea
                else table2.id_linea
                end as id_linea,

                case
                when tab0.cod_aux is not null then tab0.cod_aux
                else table2.cod_aux
                end as cod_aux,

                case
                when tab0.nom_aux is not null then upper(tab0.nom_aux)
                else upper(table2.nom_aux)
                end as nom_aux,

                case
                when table2.depre_acum is not null then table2.depre_acum
                else 0
                end as depre_acum,

                tab6.caracteres, tab6.descripcion as desc_clase, tab7.digitos as linea, tab8.descripcion as desc_grup,
                (select descripcion as mes from meses
                  where id_meses=$P{id_meses}
                ) as mes,

                (select centr.prefijo from centro_operacion centr
                  where 1=1
                  and centr.id_cen_op = tab0.id_cen_op
                ) as nom_cen_op,
                tab0.id_cen_op

                from

                (


		select
                    tab999.id_grupo_almacenamiento, tab999.digitos, tab999.nom_cuenta, tab999.id_clase,
                    sum(tab999.costo_hist) as costo_hist,
                    sum(tab999.depre_mes) as depre_mes,
                    sum(tab999.valor_lib) as valor_lib,
                    sum(tab999.valor_valoracion) as valor_valoracion,
                    sum(tab999.AJUSTE_CH_CONVERGENCIA) as AJUSTE_CH_CONVERGENCIA,
                    sum(tab999.valor_deterioro) as valor_deterioro,
                    sum(tab999.valor_residual) as valor_residual,
                    tab999.id_linea, tab999.cod_aux, tab999.nom_aux,
                    tab999.id_cen_op

                    from(

                    select
                    tab2.id_grupo_almacenamiento, tab1.digitos, tab1.nom_cuenta, tab.id_clase, sum(tab.costo_inicial) as costo_hist,
                    sum(case when tab5.id_meses = $P{id_meses} and tab5.id_vigencia = $P{vigencia} then tab5.valor_depreciado else 0 end) as depre_mes,
                    sum(tab0.costo_actual) as valor_lib,
                    sum(tab0.valor_valoracion) as valor_valoracion,
                    sum(tab.AJUSTE_CH_CONVERGENCIA) as AJUSTE_CH_CONVERGENCIA,
                    sum(tab0.valor_deterioro) as valor_deterioro,
                    sum(tab0.valor_residual) as valor_residual,
                    tab.id_linea, tab1.cod_aux, tab1.nom_aux,
                    case when tiporg.id_cen_op is not null then tiporg.id_cen_op else tab0.id_cen_op end as id_cen_op

                    from in_inventario_dv tab
                    join in_saldo_inventario_dv tab0 on tab0.id_inventario_dv = tab.id_inventario_dv and tab0.id_vigencia = $P{vigencia} and tab0.id_meses= $P{id_meses}
                    join in_tipo_almacenamiento tab2 on tab0.id_tipo_almacenamiento= tab2.id_tipo_almacenamiento
                    left join in_param_contab tab1 on tab1.id_clase=tab.id_clase and tab1.id_linea= tab.id_linea and tab1.id_grupo=tab2.id_grupo_almacenamiento
                    $P!{whereTipoTransac1}
                    left join  (
                                   select
                                   aut.id_inventario_dv,
                                   aut.id_vigencia,
                                   aut.id_meses,
                                   sum(aut.num_dias) as num_dias,
                                   sum(aut.valor_depreciado) as valor_depreciado
                                   from in_depreciacion aut
                                   group by
                                   aut.id_inventario_dv,
                                   aut.id_vigencia,
                                   aut.id_meses
                    )tab5 on tab5.id_inventario_dv = tab.id_inventario_dv and tab5.id_meses = $P{id_meses} and tab5.id_vigencia = $P{vigencia}
                    left join in_tipo_transac tab4 on tab1.id_tipo_transac= tab4.id_tipo_transac

                    left join in_tipo_origen tiporg on tiporg.id_tipo_origen = tab.id_tipo_origen

                    where 1= 1 and tab0.estado=1
                    $P!{whereCenOp} $P!{whereTipoOrigenTab}

                    group by tab2.id_grupo_almacenamiento, tab1.digitos, tab1.nom_cuenta, tab.id_linea, tab.id_clase,  tab1.cod_aux, tab1.nom_aux, tab0.id_cen_op, tiporg.id_cen_op

                    )tab999 group by tab999.id_grupo_almacenamiento, tab999.digitos, tab999.nom_cuenta, tab999.id_linea, tab999.id_clase,  tab999.cod_aux, tab999.nom_aux, tab999.id_cen_op



                )tab0

                join in_clase tab6 on tab6.id_clase = tab0.id_clase and tab6.id_linea= tab0.id_linea
                join in_linea tab7 on tab7.id_linea= tab0.id_linea
                left join in_grupo_almacenamiento tab8 on tab8.id_grupo_almacenamiento= tab0.id_grupo_almacenamiento
                full  join (

		select
                    tab999.id_grupo_almacenamiento, tab999.digitos, tab999.nom_cuenta, tab999.id_clase,
                    sum(tab999.costo_hist) as costo_hist,
                    sum(tab999.valor_lib) as valor_lib,
                    sum(tab999.valor_valoracion) as valor_valoracion,
                    sum(tab999.AJUSTE_CH_CONVERGENCIA) as AJUSTE_CH_CONVERGENCIA,
                    sum(tab999.valor_deterioro) as valor_deterioro,
                    sum(tab999.valor_residual) as valor_residual,
                    tab999.id_linea, tab999.cod_aux, tab999.nom_aux,
                    sum(tab999.depre_acum) as depre_acum,
                    tab999.id_cen_op

                    from(

                    select
                    tab2.id_grupo_almacenamiento, tab1.digitos, tab1.nom_cuenta, tab.id_clase, sum(tab.costo_inicial) as costo_hist,
                    sum(tab0.costo_actual) as valor_lib,
                    sum(tab0.valor_valoracion) as valor_valoracion,
                    sum(tab.AJUSTE_CH_CONVERGENCIA) as AJUSTE_CH_CONVERGENCIA,
                    sum(tab0.valor_deterioro) as valor_deterioro,
                    sum(tab0.valor_residual) as valor_residual,
                    tab.id_linea, tab1.cod_aux, tab1.nom_aux
                    ,sum(tab5.valor_depreciado) as depre_acum,
                    case when tiporg.id_cen_op is not null then tiporg.id_cen_op else tab0.id_cen_op end as id_cen_op

                    from in_inventario_dv tab
                    join in_saldo_inventario_dv tab0 on tab0.id_inventario_dv = tab.id_inventario_dv and tab0.id_vigencia = $P{vigencia} and tab0.id_meses= $P{id_meses}
                    join in_tipo_almacenamiento tab2 on tab0.id_tipo_almacenamiento= tab2.id_tipo_almacenamiento
                    left join in_param_contab tab1 on tab1.id_clase=tab.id_clase and tab1.id_linea= tab.id_linea and tab1.id_grupo=tab2.id_grupo_almacenamiento
                     $P!{whereTipoTransac1}
                    left join  (
                                   select
                                   aut.id_inventario_dv,
                                   aut.id_vigencia,
                                   aut.id_meses,
                                   sum(aut.num_dias) as num_dias,
                                   sum(aut.valor_depreciado) as valor_depreciado
                                   from in_depreciacion aut
                                   group by
                                   aut.id_inventario_dv,
                                   aut.id_vigencia,
                                   aut.id_meses
                            )tab5 on tab5.id_inventario_dv = tab0.id_inventario_dv
                    left join in_tipo_transac tab4 on tab1.id_tipo_transac= tab4.id_tipo_transac

                    left join in_tipo_origen tiporg on tiporg.id_tipo_origen = tab.id_tipo_origen

                    where 1= 1 and tab0.estado=1  and tab2.aplica_boletin = 1
                    and tab5.id_vigencia||lpad(tab5.id_meses,2,'0')  <  $P{vigencia}||lpad($P{id_meses},2,'0')
                    $P!{whereCenOp} $P!{whereTipoOrigenTab}

                    group by tab2.id_grupo_almacenamiento, tab1.digitos, tab1.nom_cuenta, tab.id_linea, tab.id_clase,  tab1.cod_aux, tab1.nom_aux, tab0.id_cen_op, tiporg.id_cen_op

                    )tab999 group by tab999.id_grupo_almacenamiento, tab999.digitos, tab999.nom_cuenta, tab999.id_linea, tab999.id_clase,  tab999.cod_aux, tab999.nom_aux, tab999.id_cen_op

                )table2 on tab0.id_grupo_almacenamiento=table2.id_grupo_almacenamiento
                and tab0.id_linea=table2.id_linea and tab0.id_clase=table2.id_clase
                and nvl(tab0.digitos,0)=nvl(table2.digitos,0)
                and tab0.id_cen_op = table2.id_cen_op

            )tabFin

        )tab0

        left join (
          select
           aut.*,
           row_number() over (
            partition by aut.id_grupo, aut.id_linea, aut.id_clase
            order by aut.id_grupo, aut.id_linea, aut.id_clase
           ) as rn
          from in_param_contab aut
          where aut.id_tipo_transac = 1
        )cont
        on tab0.id_grupo = cont.id_grupo
        and tab0.id_clase = cont.id_clase
        and tab0.id_linea = cont.id_linea
        and cont.rn = 1


        left join (
          select
           aut.*,
           row_number() over (
            partition by aut.id_grupo, aut.id_linea, aut.id_clase
            order by aut.id_grupo, aut.id_linea, aut.id_clase
           ) as rn
          from in_param_contab aut
          where aut.id_tipo_transac = 2
          and aut.naturaleza = 'D'
        )contdd
        on tab0.id_grupo = contdd.id_grupo
        and tab0.id_clase = contdd.id_clase
        and tab0.id_linea = contdd.id_linea
        and contdd.rn = 1


        left join (
          select
           aut.*,
           row_number() over (
            partition by aut.id_grupo, aut.id_linea, aut.id_clase
            order by aut.id_grupo, aut.id_linea, aut.id_clase
           ) as rn
          from in_param_contab aut
          where aut.id_tipo_transac = 2
          and aut.naturaleza = 'C'
        )contdc
        on tab0.id_grupo = contdc.id_grupo
        and tab0.id_clase = contdc.id_clase
        and tab0.id_linea = contdc.id_linea
        and contdc.rn = 1

        where 1=1
        $P!{whereLinea}
        $P!{whereGrupo}

    )tab0

    group by
    tab0.mes,
    tab0.id_cen_op,
    tab0.nom_cen_op,
    tab0.digitos,
    tab0.nom_cuenta,
    tab0.cod_aux,
    tab0.nom_aux

)tab0

FULL join CN_SALDOS_VIGMES_BOLETIN_V tab1
on tab1.id_cen_op = tab0.id_cen_op
and tab1.cuenta = tab0.digitos
and tab1.auxiliar = tab0.cod_aux
and tab1.ID_VIGENCIA = $P{vigencia}
and tab1.ID_PERIODO_CONTABLE = $P{id_meses}

where
nvl(tab1.ID_VIGENCIA,2018) = $P{vigencia}
and nvl(tab1.ID_PERIODO_CONTABLE,12) = $P{id_meses}

)tab0

where
tab0.digitos in (SELECT digitos FROM in_param_contab where id_tipo_transac = 1)
$P!{whereCenOp}

/*Para el filtro segun el tipo de origen -20190424*/
and ( tab0.id_cen_op in (select id_cen_op from in_tipo_origen) or ( (select count(id_cen_op) from in_tipo_origen) <= 0 ) )

order by
tab0.nom_cen_op,
tab0.digitos,
tab0.cod_aux]]>
	</queryString>
	<field name="TAG_DIG" class="java.math.BigDecimal"/>
	<field name="MES" class="java.lang.String"/>
	<field name="ID_CEN_OP" class="java.math.BigDecimal"/>
	<field name="NOM_CEN_OP" class="java.lang.String"/>
	<field name="DIGITOS" class="java.lang.String"/>
	<field name="NOM_CUENTA" class="java.lang.String"/>
	<field name="COD_AUX" class="java.lang.String"/>
	<field name="NOM_AUX" class="java.lang.String"/>
	<field name="COSTO_HIST" class="java.math.BigDecimal"/>
	<field name="DEPRE_MES" class="java.math.BigDecimal"/>
	<field name="VALOR_LIB2" class="java.math.BigDecimal"/>
	<field name="VALOR_VALORACION" class="java.math.BigDecimal"/>
	<field name="AJUSTE_CH_CONVERGENCIA" class="java.math.BigDecimal"/>
	<field name="VALOR_DETERIORO" class="java.math.BigDecimal"/>
	<field name="VALOR_RESIDUAL" class="java.math.BigDecimal"/>
	<field name="DEPRE_ACUM" class="java.math.BigDecimal"/>
	<field name="VALOR_LIB" class="java.math.BigDecimal"/>
	<field name="SALDO_BALANCE" class="java.math.BigDecimal"/>
	<variable name="total_hist" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{COSTO_HIST}]]></variableExpression>
	</variable>
	<variable name="total_dep_acu" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{DEPRE_ACUM}]]></variableExpression>
	</variable>
	<variable name="total_dep_mes" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{DEPRE_MES}]]></variableExpression>
	</variable>
	<variable name="total_lib" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR_LIB}]]></variableExpression>
	</variable>
	<variable name="total_valo" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR_VALORACION}]]></variableExpression>
	</variable>
	<variable name="total_dete" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR_DETERIORO}]]></variableExpression>
	</variable>
	<variable name="total_resi" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR_RESIDUAL}]]></variableExpression>
	</variable>
	<variable name="total_act" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[($F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA})-$F{DEPRE_ACUM}-$F{DEPRE_MES}]]></variableExpression>
	</variable>
	<variable name="total_conv" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{AJUSTE_CH_CONVERGENCIA}]]></variableExpression>
	</variable>
	<variable name="total_nuevo" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA}]]></variableExpression>
	</variable>
	<variable name="total_saldo" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{SALDO_BALANCE}]]></variableExpression>
	</variable>
	<variable name="total_dif" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[( $F{TAG_DIG} != 1
    ? ($F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA})-$F{DEPRE_ACUM}-$F{DEPRE_MES}-$F{SALDO_BALANCE}
    : ($F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA})-$F{SALDO_BALANCE}
)]]></variableExpression>
	</variable>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="60" splitType="Stretch">
			<textField pattern="dd-MMM-yyyy   hh:mm aaa">
				<reportElement mode="Opaque" x="670" y="12" width="240" height="12" forecolor="#000000" backcolor="#FFFFFF"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="230" y="0" width="440" height="40"/>
				<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Sistema de Contabilidad
Informe Boletín Contable - Conciliación PPYE - SGR]]></text>
			</staticText>
			<image>
				<reportElement x="0" y="10" width="141" height="40"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
			<staticText>
				<reportElement mode="Opaque" x="670" y="0" width="240" height="12" forecolor="#000000" backcolor="#FFFFFF"/>
				<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[Fecha de Impresión:]]></text>
			</staticText>
			<textField>
				<reportElement x="230" y="40" width="440" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Periodo de "+$F{MES}+" del "+$P{vigencia}]]></textFieldExpression>
			</textField>
			<textField pattern="dd-MMM-yyyy   hh:mm aaa">
				<reportElement mode="Opaque" x="670" y="40" width="240" height="20" forecolor="#000000" backcolor="#FFFFFF"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[!$P{whereCenOp}.equals("")?$F{NOM_CEN_OP}:"CONSOLIDADO"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="670" y="24" width="240" height="16" forecolor="#000000" backcolor="#FFFFFF"/>
				<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[Centro Operación:]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="13" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="20" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="0" y="0" width="150" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<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" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Regional]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="310" y="0" width="120" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<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" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Nuevo Costo Histórico]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="790" y="0" width="120" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<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" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Diferencia]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="430" y="0" width="120" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<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" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Valor en Libros]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="550" y="0" width="120" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<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" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Depreciacion Acumulada]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="670" y="0" width="120" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<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" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Saldo Balance]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="150" y="0" width="80" height="20" backcolor="#88C2F9"/>
				<box>
					<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="8" isBold="true"/>
				</textElement>
				<text><![CDATA[Cuenta ]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="230" y="0" width="80" height="20" backcolor="#88C2F9"/>
				<box>
					<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="8" isBold="true"/>
				</textElement>
				<text><![CDATA[Auxiliar]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="10" splitType="Stretch">
			<textField>
				<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="150" height="10"/>
				<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 verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NOM_CEN_OP}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="310" y="0" width="120" height="10"/>
				<box leftPadding="0" 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="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="790" y="0" width="120" height="10"/>
				<box leftPadding="0" 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="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[( $F{TAG_DIG} != 1
    ? ($F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA})-$F{DEPRE_ACUM}-$F{DEPRE_MES}-$F{SALDO_BALANCE}
    : ($F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA})-$F{SALDO_BALANCE}
)]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="430" y="0" width="120" height="10"/>
				<box leftPadding="0" 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="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[($F{COSTO_HIST}+$F{VALOR_VALORACION}+$F{AJUSTE_CH_CONVERGENCIA})-$F{DEPRE_ACUM}-$F{DEPRE_MES}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="550" y="0" width="120" height="10"/>
				<box leftPadding="0" 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="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{DEPRE_ACUM}+$F{DEPRE_MES}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="670" y="0" width="120" height="10"/>
				<box leftPadding="0" 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="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{SALDO_BALANCE}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="150" y="0" width="80" height="10"/>
				<box leftPadding="0">
					<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{DIGITOS}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="230" y="0" width="80" height="10"/>
				<box leftPadding="0">
					<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{COD_AUX}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="11" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="24" splitType="Stretch">
			<textField>
				<reportElement mode="Opaque" x="377" y="12" width="89" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<textElement textAlignment="Right" 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["Página "+$V{PAGE_NUMBER}+" de "]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="467" y="12" width="60" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<textElement 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[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="377" y="0" width="150" height="12" forecolor="#575757"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<text><![CDATA[Websafi - Contabilidad]]></text>
			</staticText>
			<textField>
				<reportElement mode="Opaque" x="0" y="12" width="310" 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>
		</band>
	</pageFooter>
	<summary>
		<band height="18" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="0" y="0" width="310" height="11" forecolor="#000000" backcolor="#CEC9C9"/>
				<box>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[TOTAL :]]></text>
			</staticText>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="310" y="0" width="120" height="11" isRemoveLineWhenBlank="true" backcolor="#CEC9C9"/>
				<box leftPadding="0" 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="6" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_nuevo}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="430" y="0" width="120" height="11" isRemoveLineWhenBlank="true" backcolor="#CEC9C9"/>
				<box leftPadding="0" 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="6" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_act}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="790" y="0" width="120" height="11" isRemoveLineWhenBlank="true" backcolor="#CEC9C9"/>
				<box leftPadding="0" 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="6" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_dif}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="550" y="0" width="120" height="11" isRemoveLineWhenBlank="true" backcolor="#CEC9C9"/>
				<box leftPadding="0" 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="6" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_dep_acu}+$V{total_dep_mes}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="670" y="0" width="120" height="11" isRemoveLineWhenBlank="true" backcolor="#CEC9C9"/>
				<box leftPadding="0" 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="6" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_saldo}]]></textFieldExpression>
			</textField>
		</band>
	</summary>
	<noData>
		<band height="20">
			<staticText>
				<reportElement x="0" y="0" width="910" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[No hay objetos a mostrar.]]></text>
			</staticText>
		</band>
	</noData>
</jasperReport>
