<?xml version="1.0" encoding="ISO-8859-15"?>
<VUE name="ACTI000006" label="Activité. Contrôle des en-cours CTI" title="= 'Contrôle des en-cours CTI (' +  SELECT.TOPERIODE_LABEL + ')'" database="iCTI" swf="*CTI_view1" softCode="iCTI_activite" globals="ACTI_globals.XML" componentsFile="ACTI_components.XML" 
    helpFile="iCTI_ACTI_ACTI000104.HTML"
    helpDokuWIkiDir="activite:comptabilisation_et_en_cours:encours" 
    helpDokuWIkiFile="acti000104" 
>    
	<VIEWPROPERTIES componentName="PROPERTIES_PRESTATIONS"/>
	<VIEWPROPERTIES>
		
	</VIEWPROPERTIES>
	<SELECTIONS label="Paramètres de l'analyse" displayText="= var display:String = '';
						
						return display;
						">
		<GROUP label="Période comptable">
			<FIELDx name="PERIODE" label="de" UI="combo" tree="true" width="200" default="2015-12-01" globalListProvider="DATE_DEBUT">
			</FIELDx>
			<FIELD name="TOPERIODE" label="" UI="combo" tree="true" width="200" default="2015-12-31" globalListProvider="DATE_FIN">
			</FIELD>
		</GROUP>
		
	</SELECTIONS>

	
	<SELECTIONS componentName="FILTRES_SEJOURS_SELECTIONS"/>
	<SELECTIONS componentName="FILTRES_PASSAGES_SELECTIONS" />
	<QUERIES>
		<QUERY label="">
			<SQL optimizer="V_SEJOURS_X" optimizer2="V_FACTURES_ENCOURS_LIGNES_C_X">
				<select><![CDATA[		
					
					
					DROP TABLE IF EXISTS w_sejours;
					CREATE TEMP TABLE w_sejours AS
					SELECT no_sejour, 
						CASE WHEN type_sejour <> '9' AND
							type_sejour <> '6' AND
							code_prevu <> '1' AND
							date_trunc('month',date_entree) <= date_trunc('month','[TOPERIODE]'::date) AND
							date_trunc('month',date_sortie) >= date_trunc('month','[TOPERIODE]'::date) THEN '1'::text ELSE '0' END AS in_periode,
						0::numeric AS nb_fac,
						0::numeric AS nb_fac_av,
						0::numeric AS montant_fac,
						0::numeric AS montant_fac_ghs,
						0::numeric AS montant_fac_sup,
						0::numeric AS montant_fac_sho,
						0::numeric AS montant_fac_div,
						0::numeric AS nb_ens,
						0::numeric AS nb_ens_av,
						0::numeric AS nb_ens_ec,
						0::numeric AS nb_ens_ev,
						0::numeric AS montant_ens,
						0::numeric AS montant_ens_ghs,
						0::numeric AS montant_ens_sup,
						0::numeric AS montant_ens_sho,
						0::numeric AS montant_ens_div,
						0::numeric AS nb_enp,
						0::numeric AS nb_enp_av,
						0::numeric AS nb_enp_ec,
						0::numeric AS nb_enp_ev,
						0::numeric AS montant_enp,
						0::numeric AS montant_enp_ghs,
						0::numeric AS montant_enp_sup,
						0::numeric AS montant_enp_sho,
						0::numeric AS montant_enp_div
					FROM activite.p_sejours
					WHERE 
						(
							type_sejour <> '9' AND
							type_sejour <> '6' AND
							code_prevu <> '1' AND
							date_trunc('month',date_entree) <= date_trunc('month','[TOPERIODE]'::date) AND
							date_trunc('month',date_sortie) >= date_trunc('month','[TOPERIODE]'::date)
						)
						
						OR
						(
							no_sejour IN (
								SELECT no_sejour FROM activite.p_factures
								WHERE code_facture >= '1' AND date_trunc('month',date_vente) = date_trunc('month','[TOPERIODE]'::date)
							)
						)
					;

					DROP TABLE IF EXISTS w_rub_sho;
					CREATE TEMP TABLE w_rub_sho AS
					SELECT to_id AS sho_to_id
					FROM activite.t_listes
					JOIN activite.t_listes_contenu ON liste_id = t_listes.oid
					WHERE t_listes.code = 'CTI_SHO_R'
					GROUP BY 1;


					UPDATE w_sejours SET
						nb_ens = subview.nb,
						nb_ens_av = subview.nb_av,
						nb_ens_ec = subview.nb_ec,
						nb_ens_ev = subview.nb_ev,
						montant_ens = subview.montant,
						montant_ens_ghs = subview.montant_ghs,
						montant_ens_sup = subview.montant_sup,
						montant_ens_sho = subview.montant_sho,
						montant_ens_div = subview.montant - subview.montant_ghs - subview.montant_sup - subview.montant_sho
					FROM
					(
						SELECT no_sejour, 
							count(DISTINCT p_factures_encours.no_facture) AS nb,
							count(DISTINCT CASE WHEN p_factures_encours.montant_encours_c < 0 THEN p_factures_encours.no_facture ELSE NULL END) AS nb_av,
							count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EC%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ec,
							count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EV%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ev,
							SUM(p_factures_encours_lignes_c.montant_encours) AS montant,
							SUM(CASE WHEN t_prestations.code IN ('GHS','EXH') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_ghs,
							SUM(CASE WHEN t_prestations.code IN ('REA', 'STF', 'SRC', 'NN1', 'NN2', 'NN3') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sup,
							SUM(CASE WHEN sho_to_id IS NOT NULL THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sho
						FROM activite.p_factures_encours
						JOIN activite.p_factures_encours_lignes_c ON p_factures_encours.no_facture = p_factures_encours_lignes_c.no_facture
						JOIN activite.t_prestations ON prestation_id = t_prestations.oid
						LEFT JOIN w_rub_sho ON rubrique_facturation_id = sho_to_id
						WHERE date(date_trunc('month',date_encours)) = date(date_trunc('month','[TOPERIODE]'::date)) AND 
							code_origine = 'C' AND 
							code_sorti = '1'
						GROUP BY 1
					) subview
					WHERE w_sejours.no_sejour = subview.no_sejour
					;

					UPDATE w_sejours SET
						nb_enp = subview.nb,
						nb_enp_av = subview.nb_av,
						nb_enp_ec = subview.nb_ec,
						nb_enp_ev = subview.nb_ev,
						montant_enp = subview.montant,
						montant_enp_ghs = subview.montant_ghs,
						montant_enp_sup = subview.montant_sup,
						montant_enp_sho = subview.montant_sho,
						montant_enp_div = subview.montant - subview.montant_ghs - subview.montant_sup - subview.montant_sho
					FROM
					(
						SELECT no_sejour, 
							count(DISTINCT p_factures_encours.no_facture) AS nb,
							count(DISTINCT CASE WHEN p_factures_encours.montant_encours_c < 0 THEN p_factures_encours.no_facture ELSE NULL END) AS nb_av,
							count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EC%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ec,
							count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EV%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ev,
							SUM(p_factures_encours_lignes_c.montant_encours) AS montant,
							SUM(CASE WHEN t_prestations.code IN ('GHS','EXH') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_ghs,
							SUM(CASE WHEN t_prestations.code IN ('REA', 'STF', 'SRC', 'NN1', 'NN2', 'NN3') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sup,
							SUM(CASE WHEN sho_to_id IS NOT NULL THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sho
						FROM activite.p_factures_encours
						JOIN activite.p_factures_encours_lignes_c ON p_factures_encours.no_facture = p_factures_encours_lignes_c.no_facture
						JOIN activite.t_prestations ON prestation_id = t_prestations.oid
						LEFT JOIN w_rub_sho ON rubrique_facturation_id = sho_to_id
						WHERE date(date_trunc('month',date_encours)) = date(date_trunc('month','[TOPERIODE]'::date)) AND 
							code_origine = 'C' AND 
							code_sorti = '0'
						GROUP BY 1
					) subview
					WHERE w_sejours.no_sejour = subview.no_sejour
					;

					UPDATE w_sejours SET
						nb_fac = subview.nb,
						nb_fac_av = subview.nb_av,
						montant_fac = subview.montant,
						montant_fac_ghs = subview.montant_ghs,
						montant_fac_sup = subview.montant_sup,
						montant_fac_sho = subview.montant_sho,
						montant_fac_div = subview.montant - subview.montant_ghs - subview.montant_sup - subview.montant_sho
					FROM
					(
						SELECT no_sejour, 
							count(DISTINCT p_factures.no_facture) AS nb,
							count(DISTINCT CASE WHEN p_factures.montant_facture_c < 0 THEN p_factures.no_facture ELSE NULL END) AS nb_av,
							SUM(p_factures_lignes_c.montant_facture) AS montant,
							SUM(CASE WHEN t_prestations.code IN ('GHS','EXH') THEN p_factures_lignes_c.montant_facture ELSE 0 END) AS montant_ghs,
							SUM(CASE WHEN t_prestations.code IN ('REA', 'STF', 'SRC', 'NN1', 'NN2', 'NN3') THEN p_factures_lignes_c.montant_facture ELSE 0 END) AS montant_sup,
							SUM(CASE WHEN sho_to_id IS NOT NULL THEN p_factures_lignes_c.montant_facture ELSE 0 END) AS montant_sho
						FROM activite.p_factures
						JOIN activite.p_factures_lignes_c ON p_factures.no_facture = p_factures_lignes_c.no_facture
						JOIN activite.t_prestations ON prestation_id = t_prestations.oid
						LEFT JOIN w_rub_sho ON rubrique_facturation_id = sho_to_id
						WHERE date(date_trunc('month',date_vente)) = date(date_trunc('month','[TOPERIODE]'::date)) 
						GROUP BY 1
					) subview
					WHERE w_sejours.no_sejour = subview.no_sejour
					;
					
					-- Factures en encours hors période
					INSERT INTO w_sejours
						(
						no_sejour,
						in_periode,
						nb_fac,
						nb_fac_av,
						montant_fac,
						montant_fac_ghs,
						montant_fac_sup,
						montant_fac_sho,
						montant_fac_div,
						nb_ens,
						nb_ens_av,
						nb_ens_ec,
						nb_ens_ev,
						montant_ens,
						montant_ens_ghs,
						montant_ens_sup,
						montant_ens_sho,
						montant_ens_div,
						nb_enp,
						nb_enp_av,
						nb_enp_ec,
						nb_enp_ev,
						montant_enp,
						montant_enp_ghs,
						montant_enp_sup,
						montant_enp_sho,
						montant_enp_div
						)
					SELECT no_sejour, 
						'0'::text AS in_periode,
						0::numeric AS nb_fac,
						0::numeric AS nb_fac_av,
						0::numeric AS montant_fac,
						0::numeric AS montant_fac_ghs,
						0::numeric AS montant_fac_sup,
						0::numeric AS montant_fac_sho,
						0::numeric AS montant_fac_div,
						0::numeric AS nb_ens,
						0::numeric AS nb_ens_av,
						0::numeric AS nb_ens_ec,
						0::numeric AS nb_ens_ev,
						0::numeric AS montant_ens,
						0::numeric AS montant_ens_ghs,
						0::numeric AS montant_ens_sup,
						0::numeric AS montant_ens_sho,
						0::numeric AS montant_ens_div,
						count(DISTINCT p_factures_encours.no_facture) AS nb,
						count(DISTINCT CASE WHEN p_factures_encours.montant_encours_c < 0 THEN p_factures_encours.no_facture ELSE NULL END) AS nb_av,
						count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EC%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ec,
						count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EV%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ev,
						SUM(p_factures_encours_lignes_c.montant_encours) AS montant,
						SUM(CASE WHEN t_prestations.code IN ('GHS','EXH') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_ghs,
						SUM(CASE WHEN t_prestations.code IN ('REA', 'STF', 'SRC', 'NN1', 'NN2', 'NN3') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sup,
						SUM(CASE WHEN sho_to_id IS NOT NULL THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sho,
						SUM(CASE WHEN t_prestations.code NOT IN ('GHS','EXH') AND sho_to_id IS NULL THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_div
							
					FROM activite.p_factures_encours
					JOIN activite.p_factures_encours_lignes_c ON p_factures_encours.no_facture = p_factures_encours_lignes_c.no_facture
					JOIN activite.t_prestations ON prestation_id = t_prestations.oid
					LEFT JOIN w_rub_sho ON rubrique_facturation_id = sho_to_id
					WHERE date(date_trunc('month',date_encours)) = date(date_trunc('month','[TOPERIODE]'::date)) AND 
						code_origine = 'C' AND 
						code_sorti = '0' AND
						no_sejour NOT IN (SELECT no_sejour FROM w_sejours)
					GROUP BY 1
					;
					
					INSERT INTO w_sejours
						(
						no_sejour,
						in_periode,
						nb_fac,
						nb_fac_av,
						montant_fac,
						montant_fac_ghs,
						montant_fac_sup,
						montant_fac_sho,
						montant_fac_div,
						nb_ens,
						nb_ens_av,
						nb_ens_ec,
						nb_ens_ev,
						montant_ens,
						montant_ens_ghs,
						montant_ens_sup,
						montant_ens_sho,
						montant_ens_div,
						nb_enp,
						nb_enp_av,
						nb_enp_ec,
						nb_enp_ev,
						montant_enp,
						montant_enp_ghs,
						montant_enp_sup,
						montant_enp_sho,
						montant_enp_div
						)
					SELECT no_sejour, 
						'0'::text AS in_periode,
						0::numeric AS nb_fac,
						0::numeric AS nb_fac_av,
						0::numeric AS montant_fac,
						0::numeric AS montant_fac_ghs,
						0::numeric AS montant_fac_sup,
						0::numeric AS montant_fac_sho,
						0::numeric AS montant_fac_div,
						count(DISTINCT p_factures_encours.no_facture) AS nb,
						count(DISTINCT CASE WHEN p_factures_encours.montant_encours_c < 0 THEN p_factures_encours.no_facture ELSE NULL END) AS nb_av,
						count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EC%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ec,
						count(DISTINCT CASE WHEN p_factures_encours.no_facture LIKE '%.EV%' THEN p_factures_encours.no_facture ELSE NULL END) AS nb_ev,
						SUM(p_factures_encours_lignes_c.montant_encours) AS montant,
						SUM(CASE WHEN t_prestations.code IN ('GHS','EXH') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_ghs,
						SUM(CASE WHEN t_prestations.code IN ('REA', 'STF', 'SRC', 'NN1', 'NN2', 'NN3') THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sup,
						SUM(CASE WHEN sho_to_id IS NOT NULL THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_sho,
						SUM(CASE WHEN t_prestations.code NOT IN ('GHS','EXH') AND sho_to_id IS NULL THEN p_factures_encours_lignes_c.montant_encours ELSE 0 END) AS montant_div,
						0::numeric AS nb_ens,
						0::numeric AS nb_ens_av,
						0::numeric AS nb_ens_ec,
						0::numeric AS nb_ens_ev,
						0::numeric AS montant_ens,
						0::numeric AS montant_ens_ghs,
						0::numeric AS montant_ens_sup,
						0::numeric AS montant_ens_sho,
						0::numeric AS montant_ens_div
						
					FROM activite.p_factures_encours
					JOIN activite.p_factures_encours_lignes_c ON p_factures_encours.no_facture = p_factures_encours_lignes_c.no_facture
					JOIN activite.t_prestations ON prestation_id = t_prestations.oid
					LEFT JOIN w_rub_sho ON rubrique_facturation_id = sho_to_id
					WHERE date(date_trunc('month',date_encours)) = date(date_trunc('month','[TOPERIODE]'::date)) AND 
						code_origine = 'C' AND 
						code_sorti = '1' AND
						no_sejour NOT IN (SELECT no_sejour FROM w_sejours)
					GROUP BY 1
					;
					

					
				]]></select>
			</SQL>
			
			<SQL optimizer="V_SEJOURS_X">
				<select><![CDATA[		
					SELECT 
						w_sejours.no_sejour, 
						nom || ' '|| prenom,
						substr(type_sejour_texte,1,3),
						date_entree,
						date_sortie,
						lieu_sortie_service_code,
						medecin_sejour_nom_prenom,
						CASE WHEN ghm_id > 0 THEN ghm_code ELSE '' END,
						 
						CASE WHEN in_periode = '1' AND type_sejour IN ('1','2','5') AND
								(w_sejours.montant_fac+w_sejours.montant_ens+w_sejours.montant_enp) = 0 THEN ' ZZ'
							ELSE '' END
						||
						CASE WHEN in_periode = '0' THEN ' HP'
							ELSE '' END	
						||
						CASE WHEN nb_fac_av > 0 THEN ' AF'
							ELSE '' END	
						||
						CASE WHEN nb_ens_av > 0 OR nb_enp_av > 0 THEN ' AE'
							ELSE '' END	
						||
						CASE WHEN nb_ens_ev > 0 OR nb_enp_ev > 0 THEN ' EV' ||
							CASE WHEN nb_ens_ec > 0 OR nb_enp_ec > 0 THEN '+EC' ELSE '' END
							ELSE '' END	
							,
						
						w_sejours.montant_fac,
						w_sejours.montant_fac_ghs,
						w_sejours.montant_fac_sup,
						w_sejours.montant_fac_sho,
						w_sejours.montant_fac_div,

						w_sejours.montant_ens,
						w_sejours.montant_ens_ghs,
						w_sejours.montant_ens_sup,
						w_sejours.montant_ens_sho,
						w_sejours.montant_ens_div,

						w_sejours.montant_enp,
						w_sejours.montant_enp_ghs,
						w_sejours.montant_enp_sup,
						w_sejours.montant_enp_sho,
						w_sejours.montant_enp_div
						
					FROM w_sejours
						JOIN activite.v_sejours_1 ON w_sejours.no_sejour = v_sejours_1.no_sejour
						LEFT JOIN activite.p_patients ON v_sejours_1.no_patient = p_patients.no_patient
					WHERE 1=1
						[VIEW.SEJOURS_SELECT]
						[VIEW.PASSAGES_SELECT]

					UNION ALL

					SELECT 
						'-9999999', 
						count(DISTINCT w_sejours.no_sejour)::text || ' Séjours', 
						NULL, 
						NULL, 
						NULL, 
						NULL, 
						NULL,
						NULL,
						NULL,
						
						SUM(w_sejours.montant_fac),
						SUM(w_sejours.montant_fac_ghs),
						SUM(w_sejours.montant_fac_sup),
						SUM(w_sejours.montant_fac_sho),
						SUM(w_sejours.montant_fac_div),

						SUM(w_sejours.montant_ens),
						SUM(w_sejours.montant_ens_ghs),
						SUM(w_sejours.montant_ens_sup),
						SUM(w_sejours.montant_ens_sho),
						SUM(w_sejours.montant_ens_div),

						SUM(w_sejours.montant_enp),
						SUM(w_sejours.montant_enp_ghs),
						SUM(w_sejours.montant_enp_sup),
						SUM(w_sejours.montant_enp_sho),
						SUM(w_sejours.montant_enp_div)
						
					FROM w_sejours
						JOIN activite.v_sejours_1 ON w_sejours.no_sejour = v_sejours_1.no_sejour
					WHERE 1=1
						[VIEW.SEJOURS_SELECT]
						[VIEW.PASSAGES_SELECT]
					ORDER BY 1
					;
				
				
				]]></select>
				<FIELDS>
					<FIELD name="SEJ"/>
					<FIELD name="NOM"/>
					<FIELD name="TYS"/>
					<FIELD name="DEN"/>
					<FIELD name="DSO"/>
					<FIELD name="SER"/>
					<FIELD name="MED"/>
					<FIELD name="GHM"/>
					<FIELD name="ATT"/>
					<FIELD name="FAC"/>
					<FIELD name="FACGHS"/>
					<FIELD name="FACSUP"/>
					<FIELD name="FACSHO"/>
					<FIELD name="FACDIV"/>
					<FIELD name="ENS"/>
					<FIELD name="ENSGHS"/>
					<FIELD name="ENSSUP"/>
					<FIELD name="ENSSHO"/>
					<FIELD name="ENSDIV"/>
					<FIELD name="ENP"/>
					<FIELD name="ENPGHS"/>
					<FIELD name="ENPSUP"/>
					<FIELD name="ENPSHO"/>
					<FIELD name="ENPDIV"/>
				</FIELDS>
			</SQL>
					
		</QUERY>
		<QUERY type="propertiesLink" name="VIEWPROPERTIES" forRows="false">
		</QUERY>
	</QUERIES>
	<PRESENTATION>
		<VIEWLINKS>
			<VIEWLINK label="Détail séjour" shortLabel="Détail séjour" view="ACTI000020.XML">
				<ARG name="SEJOUR" value="ROW.SEJ"/>
			</VIEWLINK>
		</VIEWLINKS>
		<ONGLET excelLabel="Liste" label="Liste">
			<DATAGRID title="" total="true" headerHeight="48" totalRowInRows="= ROW.SEJ == '-9999999'">
				<COLUMN dataField="SEJ" frozen="left" width="100" type="Char" headerText="No séjour" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="TOTAL">
				</COLUMN>
				<COLUMN dataField="NOM" frozen="left" type="Char" minWidth="150" headerText="Nom" textAlign="left" totalFunction="text" totalComplement="">
				</COLUMN>
				<COLUMN dataField="TYS" width="40" type="Char" headerText="Type" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="">
				</COLUMN>
				<COLUMN dataField="DEN" width="60" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" headerText="Date entrée" textAlign="right" totalFunction="text">
				</COLUMN>
				<COLUMN dataField="DSO" width="60" type="Date" inputFormat="AAAA-MM-JJ" outputFormat="DD/MM/YY" headerText="Date sortie" textAlign="right" totalFunction="text">
				</COLUMN>
				<COLUMN dataField="SER" width="80" type="Char" headerText="Service" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="">
				</COLUMN>
				<COLUMN dataField="MED" width="100" type="Char" headerText="Médecin" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="">
				</COLUMN>
				<COLUMN dataField="GHM" width="60" type="Char" headerText="GHM" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="">
				</COLUMN>
				
				<COLUMN dataField="ATT" width="100" type="Char" headerText="ATT" 
					description="HP=Hors période, ZZ=Aucun montant facturé ou encours, AF=Avoir facture, AE=Avoir en encours, EV=Encours issus des dossiers facturés après période, EV+EC=Encours issus des dossiers facturés après période et encours valorisés par CTI" textAlign="left" otherFunction="text" totalFunction="text" totalComplement="">
				</COLUMN>
				
				<COLUMN dataField="FAC" width="90" type="Number" outputFormat="#E" fixed="false" visible="true" headerText="Facturé@LF@TOTAL" 
					description="Montant TOTAL facturé" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="FACGHS" width="90" type="Number" outputFormat="#E" visible="true" headerText="Facturé@LF@dont GHS" 
					description="Montant GHS facturés (prestations GHS, EXH)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="FACSUP" width="90" type="Number" outputFormat="#E" visible="true" headerText="Facturé@LF@dont SUP" 
					description="Montant suppléments facturés (prestations REA,STF,SRC,NN1,NN2,NN3)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="FACSHO" width="90" type="Number" outputFormat="#E" visible="true" headerText="Facturé@LF@dont CP" 
					description="Montant chambre particulières facturées (rubriques de la liste CTI_SHO_R)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>

				
				<COLUMN dataField="ENS" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Sortis@LF@TOTAL" 
					description="Montant TOTAL encours sorties du mois et antérieures" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="ENSGHS" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Sortis@LF@dont GHS" 
					description="Montant GHS encours sorties du mois et antérieures (prestations GHS, EXH)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="ENSSUP" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Sortis@LF@dont SUP" 
					description="Montant suppléments encours sorties du mois et antérieures (prestations REA,STF,SRC,NN1,NN2,NN3)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="ENSSHO" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Sortis@LF@dont CP" 
					description="Montant chambre particulières encours sorties du mois et antérieures (rubriques de la liste CTI_SHO_R)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>

				
				
				<COLUMN dataField="ENP" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Présents@LF@TOTAL" 
					description="Montant TOTAL encours présents fin de mois" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="ENPGHS" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Présents@LF@dont GHS" 
					description="Montant GHS encours présents fin de mois (prestations GHS, EXH)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="ENPSUP" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Présents@LF@dont SUP" 
					description="Montant suppléments encours présents fin de mois (prestations REA,STF,SRC,NN1,NN2,NN3)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>
				<COLUMN dataField="ENPSHO" width="90" type="Number" outputFormat="#E" visible="true" headerText="En-cours@LF@Présents@LF@dont CP" 
					description="Montant chambre particulières encours présents fin de mois (rubriques de la liste CTI_SHO_R)" textAlign="right" totalFunction="sum" otherFunction="">
					
				</COLUMN>

			</DATAGRID>
		</ONGLET>
	</PRESENTATION>
</VUE>
