<?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_persona" language="groovy" pageWidth="1000" pageHeight="752" columnWidth="1000" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="0.826446280991739"/>
	<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,
'Personales'  AS TABLA,
 tab4.id_meses,
 tab4.descripcion,
COUNT(*) as CANTIDAD,
COUNT(*) AS TOTAL
FROM (
SELECT  tab2.id_meses,tab3.descripcion,COUNT(*) AS CANTIDAD
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 tab1.num_doc,tab2.id_meses,tab3.descripcion)tab4
group by tab4.id_meses,tab4.descripcion

UNION



SELECT
4 as id,
'Vacaciones' AS TABLA,
tab17.id_meses,
tab17.descripcion,
COUNT(*) as CANTIDAD,
COUNT(*) AS TOTAL
FROM (
SELECT
tab6.id_meses,
tab7.descripcion,
COUNT(*) AS CANTIDAD
from NO_NOVEDAD_VAC tab5
LEFT JOIN NO_PERIODO tab6 ON tab5.id_periodo=tab6.id_periodo
LEFT JOIN MESES tab7 ON tab6.id_meses=tab7.id_meses
where tab6.id_anhos = $P!{id_anhos}
group by tab5.num_doc,tab6.id_meses,tab7.descripcion)tab17
group by tab17.id_meses,tab17.descripcion


UNION



SELECT
3 as id,
'Kardex' AS TABLA,
tab16.id_meses,
tab16.descripcion,
COUNT(*) as CANTIDAD,
COUNT(*) AS TOTAL
FROM (
SELECT tab14.id_meses,tab15.descripcion, COUNT(*) AS CANTIDAD
from NO_NOVEDAD_KARDEX tab13
LEFT JOIN NO_PERIODO tab14 ON tab13.id_periodo=tab14.id_periodo
LEFT JOIN MESES tab15 ON tab14.id_meses=tab15.id_meses
where tab14.id_anhos = $P!{id_anhos}
group by tab13.num_doc,tab14.id_meses,tab15.descripcion)tab16
group by tab16.id_meses,tab16.descripcion


UNION

SELECT 1 as id,
'Nombramiento'  AS TABLA,
tab12.id_meses,tab12.descripcion,
COUNT(*) as CANTIDAD,COUNT(*) AS TOTAL
FROM (
SELECT tab10.id_meses,tab11.descripcion, COUNT(*) AS CANTIDAD
from NO_NOMBRAMIENTO tab9
LEFT JOIN NO_PERIODO tab10 ON tab9.id_periodo=tab10.id_periodo
LEFT JOIN MESES tab11 ON tab10.id_meses=tab11.id_meses
where tab10.id_anhos = $P!{id_anhos}
and tab9.estado=1
group by tab9.num_doc,tab10.id_meses,tab11.descripcion)tab12
group by tab12.id_meses,tab12.descripcion


)tab0
order by tab0.id_meses]]>
	</queryString>
	<field name="ID" class="java.math.BigDecimal"/>
	<field name="TABLA" class="java.lang.String"/>
	<field name="ID_MESES" class="java.math.BigDecimal"/>
	<field name="DESCRIPCION" 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">
			<elementGroup/>
			<bar3DChart>
				<chart>
					<reportElement x="0" y="0" width="1000" height="300"/>
					<chartTitle/>
					<chartSubtitle/>
					<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>
