<?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="Mov_dia_aux_det_saldo_subc" language="groovy" pageWidth="101" pageHeight="12" orientation="Landscape" columnWidth="101" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="3.4522712143931042"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="cuenta" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_cia" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_cen_op" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="vig_ini" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="per_ini" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select NVL ( (
SELECT
SUM(SALDO_ANTERIOR) as saldo_anterior
    FROM CN_SALDO
    WHERE SUBCUENTA = $P{cuenta}
    AND ID_VIGENCIA = $P{vig_ini}
    AND ID_PERIODO_CONTABLE = $P{per_ini}
    AND ID_CIA = $P{id_cia}
    AND ID_CEN_OP = $P{id_cen_op}
) , 0 ) AS saldo_anterior,
NVL ( (
SELECT
SUM(SALDO_ACTUAL) as saldo_actual
    FROM CN_SALDO
    WHERE SUBCUENTA = $P{cuenta}
    AND ID_VIGENCIA = $P{vig_ini}
    AND ID_PERIODO_CONTABLE = $P{per_ini}
    AND ID_CIA = $P{id_cia}
    AND ID_CEN_OP = $P{id_cen_op}
) , 0 ) AS saldo_actual
from dual]]>
	</queryString>
	<field name="SALDO_ANTERIOR" class="java.math.BigDecimal"/>
	<field name="SALDO_ACTUAL" class="java.math.BigDecimal"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<detail>
		<band height="10" splitType="Stretch">
			<textField pattern="#,##0.00;(#,##0.00)">
				<reportElement x="0" y="0" width="101" height="10"/>
				<box leftPadding="0" 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="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{SALDO_ACTUAL}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
</jasperReport>
