<?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="novedades_por_tipo" language="groovy" pageWidth="1000" pageHeight="800" columnWidth="1000" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="0.9090909090909151"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/nomina/no_ana_novedades_anual"/>
	<property name="ireport.jasperserver.url" value="http://192.168.2.43:8090/jasperserver/services/repository"/>
	<parameter name="id_periodo" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_anhos" class="java.lang.String">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="id_meses" class="java.lang.String">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT *   FROM (
SELECT 2 as id,
tab2.id_meses,
tab3.descripcion,
'Personas' AS TABLA,
COUNT(*) AS CANTIDAD,
COUNT(*) AS TOTAL
from NO_NOVEDAD_PERSONAL tab1
LEFT JOIN NO_PERIODO tab2 ON tab1.id_periodo=tab2.id_periodo
LEFT JOIN MESES tab3 ON tab2.id_meses=tab3.id_meses
where tab2.id_anhos = $P!{id_anhos}
group by tab2.id_meses,tab3.descripcion
UNION
SELECT 3 as id,tab5.id_meses,tab6.descripcion,'Kardex' AS TABLA,COUNT(*) AS CANTIDAD,COUNT(*) AS TOTAL
from NO_NOVEDAD_KARDEX tab4
LEFT JOIN NO_PERIODO tab5 ON tab4.id_periodo=tab5.id_periodo
LEFT JOIN MESES tab6 ON tab5.id_meses=tab6.id_meses
where tab5.id_anhos = $P!{id_anhos}
group by tab5.id_meses,tab6.descripcion
UNION
SELECT 4 as id,tab8.id_meses,tab9.descripcion ,'Vacaciones' AS TABLA,COUNT(*) AS CANTIDAD,COUNT(*) AS TOTAL
from NO_NOVEDAD_VAC tab7
LEFT JOIN NO_PERIODO tab8 ON tab7.id_periodo=tab8.id_periodo
LEFT JOIN MESES tab9 ON tab8.id_meses=tab9.id_meses
where tab8.id_anhos = $P!{id_anhos}
group by tab8.id_meses,tab9.descripcion
UNION
SELECT 1 as id,tab11.id_meses,tab12.descripcion,'Nombramiento'  AS TABLA, COUNT(*) AS CANTIDAD,COUNT(*) AS TOTAL
from NO_NOMBRAMIENTO tab10
LEFT JOIN NO_PERIODO tab11 ON tab10.id_periodo=tab11.id_periodo
LEFT JOIN MESES tab12 ON tab11.id_meses=tab12.id_meses
where tab11.id_anhos =  $P!{id_anhos} and tab10.estado=1
group by tab11.id_meses,tab12.descripcion
)tab0

order by tab0.id_meses]]>
	</queryString>
	<field name="ID" class="java.math.BigDecimal"/>
	<field name="ID_MESES" class="java.math.BigDecimal"/>
	<field name="DESCRIPCION" class="java.lang.String"/>
	<field name="TABLA" class="java.lang.String"/>
	<field name="CANTIDAD" class="java.math.BigDecimal"/>
	<field name="TOTAL" class="java.math.BigDecimal"/>
	<variable name="cantidad" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{CANTIDAD}]]></variableExpression>
	</variable>
	<columnHeader>
		<band height="38" splitType="Stretch"/>
	</columnHeader>
	<columnFooter>
		<band height="11" splitType="Stretch"/>
	</columnFooter>
	<summary>
		<band height="300" splitType="Stretch">
			<bar3DChart>
				<chart>
					<reportElement x="0" y="0" width="1000" height="300"/>
					<chartTitle/>
					<chartSubtitle/>
					<chartLegend>
						<font size="8" isUnderline="false"/>
					</chartLegend>
				</chart>
				<categoryDataset>
					<categorySeries>
						<seriesExpression><![CDATA[$F{TABLA}]]></seriesExpression>
						<categoryExpression><![CDATA[$F{DESCRIPCION}]]></categoryExpression>
						<valueExpression><![CDATA[$F{CANTIDAD}]]></valueExpression>
						<labelExpression><![CDATA[$F{TABLA}]]></labelExpression>
					</categorySeries>
				</categoryDataset>
				<bar3DPlot>
					<plot/>
					<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
					<categoryAxisFormat>
						<axisFormat>
							<labelFont/>
							<tickLabelFont/>
						</axisFormat>
					</categoryAxisFormat>
					<valueAxisFormat>
						<axisFormat>
							<labelFont/>
							<tickLabelFont/>
						</axisFormat>
					</valueAxisFormat>
				</bar3DPlot>
			</bar3DChart>
		</band>
	</summary>
</jasperReport>
