<?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="LibroDiarioDetallado_subreport1_subreport1" language="groovy" pageWidth="752" pageHeight="572" orientation="Landscape" columnWidth="752" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="4.594972986357241"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="id_documento" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_cia" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_cad" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_cen_op" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_vigencia" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="nom_td" class="java.lang.String"/>
	<parameter name="doc_soporte" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT
tab0.id_mov_cont as id_mov_cont,
tab0.id_documento as id_documento,
tab0.id_cad as id_cad,
tab0.id_vigencia as id_vigencia,
tab0.id_cen_op as id_cen_op,
tab0.id_cia as id_cia,
tab0.id_catalogo as id_catalogo,
tab0.id_cuenta_mayor as id_cuenta_mayor,
tab0.id_grupo_cuenta as id_grupo_cuenta,
tab0.id_clase_cuenta as id_clase_cuenta,
tab0.id_mae_ter as id_mae_ter,
tab0.id_auxiliar as id_auxiliar,
tab0.id_sub_aux as id_sub_aux,
tab0.id_centro_costo as id_centro_costo,
tab0.id_sub_centro_costo as id_sub_centro_costo,
tab0.debito as debito, tab0.credito as credito,
tab0.valor_base as valor_base,
tab1.cod_aux as cod_aux,
tab1.nombre as nombre_auxiliar,
tab2.digitos as digitos,
tab2.nombre as nombre,
tab3.nitocc as nitocc,
tab3.nombre as nombre_tercero


FROM CN_MOVIMIENTO_CONTABLE tab0
 JOIN CN_SUBC_DIGITOS tab2
ON tab0.id_clase_cuenta = tab2.id_clase_cuenta
AND tab0.id_grupo_cuenta = tab2.id_grupo_cuenta
AND tab0.id_cuenta_mayor = tab2.id_cuenta_mayor
AND tab0.id_catalogo = tab2.id_catalogo
AND tab0.id_cia = tab2.id_cia
LEFT JOIN CN_SUBC_DIGITOS_AUX tab1
ON tab0.id_clase_cuenta = tab1.id_clase_cuenta
AND tab0.id_grupo_cuenta = tab1.id_grupo_cuenta
AND tab0.id_cuenta_mayor = tab1.id_cuenta_mayor
AND tab0.id_catalogo = tab1.id_catalogo
AND tab0.id_auxiliar = tab1.id_auxiliar
AND tab0.id_cia = tab1.id_cia
LEFT JOIN CN_MAE_TER tab3
ON tab0.id_mae_ter = tab3.id_mae_ter
AND tab0.id_cia = tab3.id_cia

WHERE tab0.id_documento = $P{id_documento}
AND tab0.id_cia = $P{id_cia}
AND tab0.id_cad = $P{id_cad}
AND tab0.id_cen_op = $P{id_cen_op}
AND tab0.id_vigencia = $P{id_vigencia}

order by
tab0.id_mov_cont]]>
	</queryString>
	<field name="ID_MOV_CONT" class="java.math.BigDecimal"/>
	<field name="ID_DOCUMENTO" class="java.math.BigDecimal"/>
	<field name="ID_CAD" class="java.math.BigDecimal"/>
	<field name="ID_VIGENCIA" class="java.math.BigDecimal"/>
	<field name="ID_CEN_OP" class="java.math.BigDecimal"/>
	<field name="ID_CIA" class="java.math.BigDecimal"/>
	<field name="ID_CATALOGO" class="java.math.BigDecimal"/>
	<field name="ID_CUENTA_MAYOR" class="java.math.BigDecimal"/>
	<field name="ID_GRUPO_CUENTA" class="java.math.BigDecimal"/>
	<field name="ID_CLASE_CUENTA" class="java.math.BigDecimal"/>
	<field name="ID_MAE_TER" class="java.math.BigDecimal"/>
	<field name="ID_AUXILIAR" class="java.math.BigDecimal"/>
	<field name="ID_SUB_AUX" class="java.math.BigDecimal"/>
	<field name="ID_CENTRO_COSTO" class="java.math.BigDecimal"/>
	<field name="ID_SUB_CENTRO_COSTO" class="java.math.BigDecimal"/>
	<field name="DEBITO" class="java.math.BigDecimal"/>
	<field name="CREDITO" class="java.math.BigDecimal"/>
	<field name="VALOR_BASE" class="java.math.BigDecimal"/>
	<field name="COD_AUX" class="java.lang.String"/>
	<field name="NOMBRE_AUXILIAR" class="java.lang.String"/>
	<field name="DIGITOS" class="java.lang.String"/>
	<field name="NOMBRE" class="java.lang.String"/>
	<field name="NITOCC" class="java.lang.String"/>
	<field name="NOMBRE_TERCERO" class="java.lang.String"/>
	<variable name="sum_debito" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{DEBITO}]]></variableExpression>
	</variable>
	<variable name="sum_credito" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{CREDITO}]]></variableExpression>
	</variable>
	<background>
		<band splitType="Stretch"/>
	</background>
	<columnHeader>
		<band height="12">
			<staticText>
				<reportElement mode="Opaque" x="0" y="0" width="73" height="12" backcolor="#CDE2F6"/>
				<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[Subcuenta]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="218" y="0" width="149" height="12" backcolor="#CDE2F6"/>
				<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>
			<staticText>
				<reportElement mode="Opaque" x="367" y="0" width="145" height="12" backcolor="#CDE2F6"/>
				<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[Tercero]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="512" y="0" width="120" height="12" backcolor="#CDE2F6"/>
				<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[Débito]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="632" y="0" width="120" height="12" backcolor="#CDE2F6"/>
				<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[Crédito]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="73" y="0" width="145" height="12" backcolor="#CDE2F6"/>
				<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[Subcuenta]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="10" splitType="Stretch">
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="false">
				<reportElement mode="Transparent" x="0" y="0" width="73" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<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" 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[$F{DIGITOS}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="218" y="0" width="149" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2" rightPadding="0">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<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[( $F{COD_AUX}.toString().equals("null")
    ? ""
    : $F{COD_AUX}+" "+$F{NOMBRE_AUXILIAR})]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="367" y="0" width="145" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2" rightPadding="0">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<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[$F{NOMBRE_TERCERO}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="512" y="0" width="120" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<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" 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.math.BigDecimal"><![CDATA[$F{DEBITO}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="632" y="0" width="120" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<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" 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.math.BigDecimal"><![CDATA[$F{CREDITO}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="73" y="0" width="145" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<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" 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[$F{NOMBRE}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<summary>
		<band height="17">
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Opaque" x="512" y="0" width="120" height="12" forecolor="#000000" backcolor="#D2D0D0"/>
				<box 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" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{sum_debito}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="283" y="0" width="84" height="12" forecolor="#000000" backcolor="#D2D0D0"/>
				<box leftPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Right" 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[Doc. Soporte: ]]></text>
			</staticText>
			<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
				<reportElement mode="Opaque" x="632" y="0" width="120" height="12" forecolor="#000000" backcolor="#D2D0D0"/>
				<box 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" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{sum_credito}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement mode="Opaque" x="367" y="0" width="145" height="12" forecolor="#000000" backcolor="#D2D0D0"/>
				<box rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{doc_soporte}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="0" y="0" width="135" height="12" forecolor="#000000" backcolor="#D2D0D0"/>
				<box leftPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.0"/>
				</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  documento: ]]></text>
			</staticText>
			<textField>
				<reportElement mode="Opaque" x="135" y="0" width="148" height="12" forecolor="#000000" backcolor="#D2D0D0"/>
				<box rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement 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[$P{nom_td}]]></textFieldExpression>
			</textField>
		</band>
	</summary>
</jasperReport>
