<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000013" label="ACTI. Effets Prix - GHS" 
title="= 'Effets Prix - GHS-EXH par ' +  SELECT.GROUPBY_LABEL + ' (' + SELECT.PERIODE_LABEL + ' à ' + SELECT.TOPERIODE_LABEL + ')' " 
database="iCTI" 
swf="*CTI_view1" 
softCode="iCTI_activite" 
typeEts="" 
globals="ACTI_globals.XML" 
componentsFile="ACTI_components.XML" 
helpDokuWIkiDir="" helpDokuWIkiFile="acti000013"  helpFile="iCTI_ACTI_ACTI000013.HTML">
	<VIEWPROPERTIES componentName="PROPERTIES_ETATDOSSIERS"/>
	<VIEWPROPERTIES>
        <PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value"/>
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse">
		<GROUP label="Période (sortie)">
			<FIELD name="ALIAS_PERIODE" label="" UI="combo" width="220" default="CUM_LAST_MONTH" tree="true" globalListProvider="ALIAS_PERIODE" />
			<FIELD name="PERIODE" label="" UI="combo" tree="true" width="150" default="2014-07-01" printable="false" globalListProvider="DATE_DEBUT" />
			<FIELD name="TOPERIODE" label="à" UI="combo" tree="true" width="150" default="2014-12-31" printable="false" globalListProvider="DATE_FIN" />
		</GROUP>
        
		<GROUP label="Regroupements">
			<FIELD name="GROUPBY" width="220" label="Regroupements" UI="combo" default="MED" tree="true">
				<OPTION label="Options" data="" globalListProvider="SEJOUR_GROUPBY" />
			</FIELD>
			<FIELD name="GROUPBY_TAB" width="100" label="Présentation" UI="combo" default="AUTO" visible="= SELECT.GROUPBY_2 != '-1' ">
				<OPTION label="Automatique" data="AUTO" />
				<OPTION label="Arbre" data="TREE" />
				<OPTION label="Onglet" data="TAB" />
			</FIELD>
		</GROUP>
		<GROUP label="">
			<FIELD name="GROUPBY_2" width="220" label="" UI="combo" default="-1" tree="true">
				<OPTION label="Pas de second niveau" data="-1" treeLevel="1" />
				<OPTION label="Options" data="" globalListProvider="SEJOUR_GROUPBY" />
			</FIELD>
            <FIELD name="GROUPBY_3" label="" UI="combo" default="-1" width="220" tree="true">
				<OPTION label="Pas de troisième niveau" data="-1"/>
				<OPTION label="Options" data="" globalListProvider="SEJOUR_GROUPBY" />
			</FIELD>
		</GROUP>
	</SELECTIONS>
	<SELECTIONS componentName="FILTRES_SEJOURS_SELECTIONS"/>
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_RSS_X" cacheEnabled="true">
				<select><![CDATA[ 
				
					CTISELECT_TREE
                        WORKTABLE{acti000013}
						GROUPBY1{[VIEW.GROUPBY_OID_FIELD],, [VIEW.GROUPBY_COD_FIELD],, [VIEW.GROUPBY_TXT_FIELD]}
						GROUPBY1MODE{[GROUPBY_TAB]}
						GROUPBY2{[VIEW.GROUPBY_2_OID_FIELD],, [VIEW.GROUPBY_2_COD_FIELD],, [VIEW.GROUPBY_2_TXT_FIELD]}
						GROUPBY3{[VIEW.GROUPBY_3_OID_FIELD],, [VIEW.GROUPBY_3_COD_FIELD],, [VIEW.GROUPBY_3_TXT_FIELD]}
						OPTIONS{NOTZERO=1}
						INDICATORS{
                            COUNT(*),
                            SUM(CASE WHEN ok_ghs_f = '1' THEN 1 ELSE 0 END),,
                            SUM(CASE WHEN ok_ghs_f = '1' AND montant_tot_f <> montant_tot_c THEN 1 ELSE 0 END),,
                            SUM(v_sejour_effet_tarif_1.montant_tot_f),,
							SUM(v_sejour_effet_tarif_1.montant_tot_c),,
                            SUM(v_sejour_effet_tarif_1.montant_ghs_c),,
                            SUM(v_sejour_effet_tarif_1.montant_exb_c),,
                            SUM(v_sejour_effet_tarif_1.montant_exh_c),,
                            SUM(v_sejour_effet_tarif_1.montant_tot_p),,
                            SUM(v_sejour_effet_tarif_1.montant_ghs_p),,
                            SUM(v_sejour_effet_tarif_1.montant_exb_p),,
                            SUM(v_sejour_effet_tarif_1.montant_exh_p),,
                            0,,
                            0,,
						}
					FROM activite.v_sejour_effet_tarif_1
                        JOIN #V_SEJOURS_X# ON v_sejours_1.no_sejour = v_sejour_effet_tarif_1.no_sejour
					WHERE v_sejours_1.date_sortie BETWEEN '[PERIODE]' AND '[TOPERIODE]'
						[VIEW.SEJOURS_SELECT]
						
					AFTER{	
						UPDATE acti000013 SET 
							indicateurs[13] = indicateurs[5] - indicateurs[9],
                            indicateurs[14] = base.cti_division(indicateurs[5] - indicateurs[9],indicateurs[5])*100

					}
				]]></select>
				<FIELDS>
					<INSERT name="CTISELECT_TREE_FIELDS" />
					
                    <FIELD name="NSEJ" />
                    <FIELD name="NFAC" />
                    <FIELD name="NFAE" />
					<FIELD name="TOTF" />
					<FIELD name="TOTC" />
					<FIELD name="GHSC" />
					<FIELD name="EXBC" />
					<FIELD name="EXHC" />
					<FIELD name="TOTP" />
					<FIELD name="GHSP" />
					<FIELD name="EXBP" />
					<FIELD name="EXHP" />
                    <FIELD name="TOTE" />
                    <FIELD name="TOTT" />
				</FIELDS>
			</SQL>
		</QUERY>
  
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Liste des séjours" shortLabel="Séjours" view="ACTI000014.XML" componentName="PRESTATIONS_BASE_VIEWLINK" component2Name="STANDARD_BASE_VIEWLINK" component3Name="ETA_DOS_BASE_VIEWLINK">
				<ARG name="PERIODE">
					<value>
						<![CDATA[
                            if (SELECT.GROUPBY == 'MOIS') {return ROW.OID1;}
							if (SELECT.GROUPBY_2 == 'MOIS' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOIS' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISF') {return ROW.OID1;}
							if (SELECT.GROUPBY_2 == 'MOISF' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISF' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISEX') {return ROW.OID1;}
							if (SELECT.GROUPBY_2 == 'MOISEX' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISEX' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
						]]>
					</value>
				</ARG>
				<ARG name="TOPERIODE">
					<value>
						<![CDATA[
							if (SELECT.GROUPBY == 'MOIS') {return ROW.OID1;} 	
							if (SELECT.GROUPBY_2 == 'MOIS' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOIS' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISF') {return ROW.OID1;}	
							if (SELECT.GROUPBY_2 == 'MOISF' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISF' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 
							if (SELECT.GROUPBY == 'MOISEX') {return ROW.OID1;}	
							if (SELECT.GROUPBY_2 == 'MOISEX' && ROW.OID2 != '0' && ROW.OID2 != '-9999999') {return ROW.OID2;} 
							if (SELECT.GROUPBY_3 == 'MOISEX' && ROW.OID3 != '0' && ROW.OID3 != '-9999999') {return ROW.OID3;} 

						]]>
					</value>
				</ARG>
                
                <ARG name="QFAC" value="-1" />
				<ARG name="QFAE" value="-1" />	
				
			</VIEWLINK>
		</VIEWLINKS>
        <ONGLET excelLabel="Effet Prix GHS" label="Effet Prix GHS" multiTab="true" multiTabBreakField="TABD" multiTabBreakLabelField="TABDL" multiTabBreakLonglabelField="TABDLL">
			<DATAGRID title="" total="true" showOthers="true" headerHeight="70" variableRowHeight="true" selectRowInRows="= ROW.OID == '-9999997'" otherRowInRows="= ROW.OID == '-9999998'" totalRowInRows="= ROW.OID == '-9999999'" sortable="= SELECT.GROUPBY_2 == '-1' || SELECT.GROUPBY_TAB == 'TAB'">
				<INSERT name="DATAGRID_MULTITAB_STYLES" />
				<COLUMN dataField="LVL" width="50" type="Char" visible="false" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" />
				<COLUMN dataField="OID" width="60" type="Char" visible="false" headerText="Oid" />
				<COLUMN dataField="COD" width="70" type="Char" headerText="Code" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
					<CELLSTYLE name="paddingLeft" value="15" condition="ROW.LVL == '2' &amp;&amp; SELECT.GROUPBY_TAB != 'TAB'" />
				</COLUMN>
				<COLUMN dataField="TXT" type="Char" minWidth="200" headerText="SELECT.GROUPBY_LABEL" headerTextCalc="true" textAlign="left" totalFunction="text" otherFunction="text" otherComplement="Autres" />
				<COLUMN dataField="CODTXT" type="Char" minWidth="200" visible="false" totalFunction="text" otherFunction="text" calc="true">
					<CALC formula="ROW.COD + ' ' + ROW.TXT.toString().substr(0,10)" />
				</COLUMN>
				
                <COLUMN dataField="NSEJ" type="Number" width="90" outputFormat="#"  
                    headerText="'\nNb séjours'" 
                    headerTextCalc="true" 
                    description="Nombre de séjours analysés"  
                    textAlign="center">

				</COLUMN>
                <COLUMN dataField="NFAC" type="Number" width="90" outputFormat="#"  
                    headerText="'\nNb séjours facturés'" 
                    headerTextCalc="true" 
                    description="Nombre de séjours avec un GHS facturé parmi les séjours choisis"  
                    textAlign="center">
				</COLUMN>
                <COLUMN dataField="NFAE" type="Number" width="90" outputFormat="#"  
                    headerText="'\nNb séjours facturés différemment'" 
                    headerTextCalc="true" 
                    description="Nombre de séjours facturés avec un montant différent de la revalorisation"  
                    textAlign="center">
				</COLUMN>
                
				
                <COLUMN dataField="TOTC" type="Number" width="90" outputFormat="# E"  
                    headerText="'(C1)'+ '\nC.A. Recalculé TOTAL\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant total (GHS+EXH) recalculé à partir du tarif GHS de la période" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
                <COLUMN dataField="GHSC" type="Number" width="90" outputFormat="# E"  
                    headerText="'(C1-GHS)'+ '\nC.A. Recalculé GHS Plein\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant recalculé du GHS plein à partir du tarif GHS de la période" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
                <COLUMN dataField="EXBC" type="Number" width="90" outputFormat="# E"  
                    headerText="'(C1-EXB)'+ '\nC.A. Recalculé EXB\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant recalculé des décotes EXB à partir du tarif GHS de la période" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
                <COLUMN dataField="EXHC" type="Number" width="90" outputFormat="# E"  
                    headerText="'(C1-EXH)'+ '\nC.A. Recalculé EXH\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant recalculé des EXH à partir du tarif GHS de la période" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
                <COLUMN dataField="TOTP" type="Number" width="90" outputFormat="# E"  
                    headerText="'(P1)'+ '\nC.A. Recalculé TOTAL\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N-1&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant total (GHS+EXH) recalculé à partir du tarif GHS de la période précédente" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="GHSP" type="Number" width="90" outputFormat="# E"  
                    headerText="'(P1-GHS)'+ '\nC.A. Recalculé GHS Plein\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N-1&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant recalculé du GHS plein à partir du tarif GHS de la période précédente" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="EXBP" type="Number" width="90" outputFormat="# E"  
                    headerText="'(P1-EXB)'+ '\nC.A. Recalculé EXB\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N-1&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant recalculé des décotes EXB à partir du tarif GHS de la période précédente" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
                <COLUMN dataField="EXHP" type="Number" width="90" outputFormat="# E"  
                    headerText="'(P1-EXH)'+ '\nC.A. Recalculé EXH\n'+ '&lt;font color=\'#DB1702\'&gt;Tarifs N-1&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Montant recalculé des EXH à partir du tarif GHS de la période précédente" 
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xDCDCDC"/>
				</COLUMN>
				
                 <COLUMN dataField="TOTE" type="Number" width="90" outputFormat="# E"  
                    headerText="'(P1)'+ '\nEffet Prix\nen C.A.\n'+ '&lt;font color=\'#DB1702\'&gt;N - N-1&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Différence entre montant recalculé période (C1) et période précédente (P1)"  
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
                <COLUMN dataField="TOTT" type="Number" width="90" outputFormat="0,0%"  
                    headerText="'(T1)'+ '\nEffet Prix\nen %\n'+ '&lt;font color=\'#DB1702\'&gt;N - N-1&lt;/font&gt;'" 
                    headerTextCalc="true" 
                    description="Différence entre montant recalculé période (C1) et période précédente (P1) en pourcentage"  
                    textAlign="center">
						<HEADERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
						<FOOTERCELLSTYLE name="backgroundColor" value="0xbccbed"/>
				</COLUMN>
			</DATAGRID>
		</ONGLET>
		
	</PRESENTATION>
</VUE>
