<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000087" 
	label="Chiffrier CTI - Activité" 
	title="Chiffrier CTI - Activité" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_activite"
	admProvider="sigems">
	
	<SELECTIONS>
		
	</SELECTIONS>
	
	<QUERIES> 
		
		<QUERY> 
			<SQL>
				<select><![CDATA[
							DROP TABLE IF EXISTS w_chiffrier_comptable;
							CREATE TEMP TABLE w_chiffrier_comptable
							(
								date_comptable date ,
								montant_comptabilise_d_c numeric(13,2) DEFAULT 0,
								montant_comptabilise_t_c numeric(13,2) DEFAULT 0,
								montant_comptabilise_s_c numeric(13,2) DEFAULT 0,
								montant_comptabilise_c_c numeric(13,2) DEFAULT 0,
								montant_regle_s_c numeric(13,2) DEFAULT 0,
								montant_regle_c_c numeric(13,2) DEFAULT 0,

								montant_comptabilise_d_h numeric(13,2) DEFAULT 0,
								montant_comptabilise_t_h numeric(13,2) DEFAULT 0,
								montant_comptabilise_s_h numeric(13,2) DEFAULT 0,
								montant_comptabilise_c_h numeric(13,2) DEFAULT 0,
								montant_regle_s_h numeric(13,2) DEFAULT 0,
								montant_regle_c_h numeric(13,2) DEFAULT 0
							) ;
					
							INSERT INTO w_chiffrier_comptable(date_comptable, montant_comptabilise_d_c)
							SELECT date_trunc('month',date_vente) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_d_c
							FROM activite.v_factures_lignes_c_1
							WHERE date_vente BETWEEN '20070101' AND '20201231'
							GROUP BY 1;
					
							INSERT INTO w_chiffrier_comptable(date_comptable, montant_comptabilise_d_h)
							SELECT date_trunc('month',date_vente) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_d_h
							FROM activite.v_factures_lignes_h_1
							WHERE date_vente BETWEEN '20070101' AND '20201231'
							GROUP BY 1;
					
							INSERT INTO w_chiffrier_comptable(date_comptable, montant_comptabilise_t_c, montant_comptabilise_t_h)
							SELECT date_trunc('month',date_vente) AS date_comptable, 
								SUM(montant_comptabilise_c) AS montant_comptabilise_t_c, 
								SUM(montant_comptabilise_h) AS montant_comptabilise_t_h
							FROM activite.p_factures
							WHERE date_vente BETWEEN '20070101' AND '20201231'
							GROUP BY 1;
					
							INSERT INTO w_chiffrier_comptable(date_comptable, montant_comptabilise_s_c, montant_regle_s_c)
							SELECT date_trunc('month',date_comptable) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_s_c, 
								SUM(CASE WHEN od_avoir <> '1' THEN montant_regle ELSE 0 END) AS montant_regle_s_c
							FROM activite.p_facture_solde_tiers_c
							WHERE date_comptable BETWEEN '20070101' AND '20201231'
							GROUP BY 1 ;
					
							INSERT INTO w_chiffrier_comptable(date_comptable, montant_comptabilise_s_h, montant_regle_s_h)
							SELECT date_trunc('month',date_comptable) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_s_h, 
								SUM(CASE WHEN od_avoir <> '1' THEN montant_regle ELSE 0 END) AS montant_regle_s_h
							FROM activite.p_factures_soldes_h
							WHERE date_comptable BETWEEN '20070101' AND '20201231'
							GROUP BY 1 ;
					
							INSERT INTO w_chiffrier_comptable(date_comptable, montant_comptabilise_c_c, montant_comptabilise_c_h, montant_regle_c_c, montant_regle_c_h)
							SELECT date_trunc('month',date_comptable) AS date_comptable, 
								SUM(montant_ventes_c) AS montant_comptabilise_c_c, 
								SUM(montant_ventes_h) AS montant_comptabilise_c_h, 
								SUM(montant_reglements_c) AS montant_regle_c_c, 
								SUM(montant_reglements_h) AS montant_regle_c_h
							FROM activite.p_chiffrier_comptable
							WHERE date_comptable BETWEEN '20070101' AND '20201231'
							GROUP BY 1 ;
					
							SELECT 
								date_comptable ,
								SUM(montant_comptabilise_d_c),
								SUM(montant_comptabilise_t_c),
								SUM(montant_comptabilise_s_c),
								SUM(montant_comptabilise_c_c),
								SUM(montant_regle_s_c),
								SUM(montant_regle_c_c),
								SUM(montant_comptabilise_d_h),
								SUM(montant_comptabilise_t_h),
								SUM(montant_comptabilise_s_h),
								SUM(montant_comptabilise_c_h),
								SUM(montant_regle_s_h),
								SUM(montant_regle_c_h)
							FROM w_chiffrier_comptable
							WHERE date_comptable >= 
								(SELECT min(date_comptable) 
									FROM w_chiffrier_comptable 
									WHERE montant_comptabilise_d_c <> 0 OR
										montant_comptabilise_t_c <> 0 OR
										montant_comptabilise_s_c <> 0)
							GROUP BY 1
							ORDER BY 1 DESC;
					]]></select>
				<FIELDS>
					<FIELD name="DATE"  />
					<FIELD name="MF_DC" />
					<FIELD name="MF_TC" />
					<FIELD name="MF_SC" />
					<FIELD name="MF_CC" />
					<FIELD name="MR_SC" />
					<FIELD name="MR_CC" />
					<FIELD name="MF_DH" />
					<FIELD name="MF_TH" />
					<FIELD name="MF_SH" />
					<FIELD name="MF_CH" />
					<FIELD name="MR_SH" />
					<FIELD name="MR_CH" />
				</FIELDS>
			</SQL>
			
			
		</QUERY>
		
		<QUERY> 
			<SQL>
				<select><![CDATA[
							DROP TABLE IF EXISTS w_chiffrier_comptable;
							CREATE TEMP TABLE w_chiffrier_comptable
							(
								no_facture text,
								date_comptable date ,
								montant_comptabilise_d_c numeric(13,2) DEFAULT 0,
								montant_comptabilise_t_c numeric(13,2) DEFAULT 0,
								montant_comptabilise_s_c numeric(13,2) DEFAULT 0,
								montant_comptabilise_c_c numeric(13,2) DEFAULT 0,
								montant_regle_s_c numeric(13,2) DEFAULT 0,
								montant_regle_c_c numeric(13,2) DEFAULT 0,

								montant_comptabilise_d_h numeric(13,2) DEFAULT 0,
								montant_comptabilise_t_h numeric(13,2) DEFAULT 0,
								montant_comptabilise_s_h numeric(13,2) DEFAULT 0,
								montant_comptabilise_c_h numeric(13,2) DEFAULT 0,
								montant_regle_s_h numeric(13,2) DEFAULT 0,
								montant_regle_c_h numeric(13,2) DEFAULT 0
							) ;
					
							INSERT INTO w_chiffrier_comptable(no_facture, date_comptable, montant_comptabilise_d_c)
							SELECT no_facture, date_trunc('month',date_vente) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_d_c
							FROM activite.v_factures_lignes_c_1
							WHERE date_vente BETWEEN '20070101' AND '20201231' AND montant_comptabilise <> 0
							GROUP BY 1,2;
					
							INSERT INTO w_chiffrier_comptable(no_facture, date_comptable, montant_comptabilise_d_h)
							SELECT no_facture, date_trunc('month',date_vente) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_d_h
							FROM activite.v_factures_lignes_h_1
							WHERE date_vente BETWEEN '20070101' AND '20201231' AND montant_comptabilise <> 0
							GROUP BY 1,2;
					
							INSERT INTO w_chiffrier_comptable(no_facture, date_comptable, montant_comptabilise_t_c, montant_comptabilise_t_h)
							SELECT no_facture, date_trunc('month',date_vente) AS date_comptable, 
								SUM(montant_comptabilise_c) AS montant_comptabilise_t_c, 
								SUM(montant_comptabilise_h) AS montant_comptabilise_t_h
							FROM activite.p_factures
							WHERE date_vente BETWEEN '20070101' AND '20201231' AND (montant_comptabilise_c <> 0 OR montant_comptabilise_h <> 0)
							GROUP BY 1,2;
					
							INSERT INTO w_chiffrier_comptable(no_facture, date_comptable, montant_comptabilise_s_c, montant_regle_s_c)
							SELECT no_facture, date_trunc('month',date_comptable) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_s_c, 
								SUM(CASE WHEN od_avoir <> '1' THEN montant_regle ELSE 0 END) AS montant_regle_s_c
							FROM activite.p_facture_solde_tiers_c
							WHERE date_comptable BETWEEN '20070101' AND '20201231' AND (montant_comptabilise <> 0 OR montant_regle <> 0)
							GROUP BY 1,2 ;
					
							INSERT INTO w_chiffrier_comptable(no_facture, date_comptable, montant_comptabilise_s_h, montant_regle_s_h)
							SELECT no_facture, date_trunc('month',date_comptable) AS date_comptable, 
								SUM(montant_comptabilise) AS montant_comptabilise_s_h, 
								SUM(CASE WHEN od_avoir <> '1' THEN montant_regle ELSE 0 END) AS montant_regle_s_h
							FROM activite.p_factures_soldes_h
							WHERE date_comptable BETWEEN '20070101' AND '20201231' AND (montant_comptabilise <> 0 OR montant_regle <> 0)
							GROUP BY 1,2 ;
					
							INSERT INTO w_chiffrier_comptable(no_facture, date_comptable, montant_comptabilise_c_c, montant_comptabilise_c_h, montant_regle_c_c, montant_regle_c_h)
							SELECT no_facture, date_trunc('month',date_comptable) AS date_comptable, 
								SUM(montant_ventes_c) AS montant_comptabilise_c_c, 
								SUM(montant_ventes_h) AS montant_comptabilise_c_h, 
								SUM(montant_reglements_c) AS montant_regle_c_c, 
								SUM(montant_reglements_h) AS montant_regle_c_h
							FROM activite.p_factures_comptables
							WHERE date_comptable BETWEEN '20070101' AND '20201231'
							GROUP BY 1,2 ;
					
							SELECT 
								w_chiffrier_comptable.no_facture ,
								date_comptable ,
								p_factures.no_sejour ,
								p_patients.nom ||  ' ' || p_patients.prenom ,
								SUM(montant_comptabilise_d_c),
								SUM(montant_comptabilise_t_c),
								SUM(montant_comptabilise_s_c),
								SUM(montant_comptabilise_c_c),
								SUM(montant_regle_s_c),
								SUM(montant_regle_c_c),
								SUM(montant_comptabilise_d_h),
								SUM(montant_comptabilise_t_h),
								SUM(montant_comptabilise_s_h),
								SUM(montant_comptabilise_c_h),
								SUM(montant_regle_s_h),
								SUM(montant_regle_c_h)
							FROM w_chiffrier_comptable 
								LEFT JOIN activite.p_factures ON w_chiffrier_comptable.no_facture = p_factures.no_facture
								LEFT JOIN activite.p_sejours ON p_factures.no_sejour = p_sejours.no_sejour
								LEFT JOIN activite.p_patients ON p_sejours.no_patient = p_patients.no_patient
							GROUP BY 1,2,3,4
							HAVING 
								SUM(montant_comptabilise_d_c) <> SUM(montant_comptabilise_t_c) OR
								SUM(montant_comptabilise_d_h) <> SUM(montant_comptabilise_t_h) OR
								SUM(montant_comptabilise_d_c) <> SUM(montant_comptabilise_s_c) OR
								SUM(montant_comptabilise_d_h) <> SUM(montant_comptabilise_s_h) OR
								SUM(montant_comptabilise_d_c) <> SUM(montant_comptabilise_c_c) OR
								SUM(montant_comptabilise_d_h) <> SUM(montant_comptabilise_c_h) 
								--OR 
								--SUM(montant_regle_s_c) <> SUM(montant_regle_c_c) OR
								--SUM(montant_regle_s_h) <> SUM(montant_regle_c_h) 
							ORDER BY 2 DESC,1
							LIMIT 100;
							
					]]></select>
				<FIELDS>
					<FIELD name="FAC"  />
					<FIELD name="DATE"  />
					<FIELD name="SEJ"  />
					<FIELD name="NOM" ifHideNames="Non autorisé"  />
					<FIELD name="MF_DC" />
					<FIELD name="MF_TC" />
					<FIELD name="MF_SC" />
					<FIELD name="MF_CC" />
					<FIELD name="MR_SC" />
					<FIELD name="MR_CC" />
					<FIELD name="MF_DH" />
					<FIELD name="MF_TH" />
					<FIELD name="MF_SH" />
					<FIELD name="MF_CH" />
					<FIELD name="MR_SH" />
					<FIELD name="MR_CH" />
				</FIELDS>
			</SQL>
			
			
		</QUERY>
		
		
		<QUERY> 
			<SQL>
				<select><![CDATA[
						DROP TABLE IF EXISTS w_chiffrier_dossiers;

						CREATE TEMP TABLE w_chiffrier_dossiers AS 
						SELECT 
							to_number(ANN_DOS2,99) AS ANN_DOS2,
							SUM(SJ1 + SJ2 + SJ3) AS chiffrier_c,
							0::numeric AS dos2_c,
							SUM(HO1 + HO2 + HO3) AS chiffrier_h,
							0::numeric AS dos2_h
						FROM prod_sigems.CHIFFRIER_DOSSIERS
						GROUP BY 1;



						INSERT INTO w_chiffrier_dossiers
						SELECT 
							to_number(ANN_DOS2,99) AS ANN_DOS2,
							0::numeric AS chiffrier_c,
							SUM(SJ1_DOS2 + SJ2_DOS2 + SJ3_DOS2) AS dos2_c,
							0::numeric AS chiffrier_h,
							SUM(HO1_DOS2 + HO2_DOS2 + HO3_DOS2) AS dos2_h
						FROM prod_sigems.DOS2 WHERE DFA_DOS2 IS NOT NULL
						GROUP BY 1;

						SELECT 
							ANN_DOS2,
							SUM(chiffrier_c),
							SUM(dos2_c),
							SUM(chiffrier_h),
							SUM(dos2_h)
						FROM w_chiffrier_dossiers
						GROUP BY 1
						HAVING SUM(dos2_c) <> 0 OR SUM(dos2_h) <> 0
						ORDER BY ANN_DOS2
							
					]]></select>
				<FIELDS>
					<FIELD name="ANNEE"  />
					<FIELD name="MCC"  />
					<FIELD name="MFC"  />
					<FIELD name="MCH"  />
					<FIELD name="MFH"  />
				</FIELDS>
			</SQL>
			
			
		</QUERY>

			
	</QUERIES> 
	
	<CALCFIELDS>
	</CALCFIELDS>
	
	<PRESENTATION>
	
		<VIEWLINKS>
		
			
		</VIEWLINKS>
			
				
		
		
		<ONGLET excelLabel="Chiffrier Comptable" label="Chiffrier Comptable" queryNumber="0">
				
			<DATAGRID title="" total="false" headerHeight="54" printRatio="1">
														
				<COLUMN dataField="DATE" 
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="MMMM YYYY"
					minWidth="80"
					visible="true"
					headerText="Mois comptable" 
					textAlign="left"
					totalFunction="text"
					totalComplement="TOTAL"
				/>
				
				
				<COLUMN dataField="MF_DC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé@LF@Détail@LF@Clinique"
					multiLine="sum"	
					totalFunction="sum"
					align="right">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_DC != ROW.MF_CC &amp;&amp; Number(ROW.MF_CC) != 0" />
				</COLUMN>
				<COLUMN dataField="MF_TC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé@LF@Total@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_TC != ROW.MF_CC &amp;&amp; Number(ROW.MF_CC) != 0" />
				</COLUMN>
				<COLUMN dataField="MF_SC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé@LF@Clients@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_SC != ROW.MF_CC &amp;&amp; Number(ROW.MF_CC) != 0" />
				</COLUMN>
				<COLUMN dataField="MF_CC"
					type="Number"
					outputFormat="#"
					width="80"
					visible="true"
					fixed="false"
					headerText="PRO Facturé@LF@Chiffrier@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
				
				<COLUMNx dataField="MR_SC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Réglé@LF@Clients@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MR_SC != ROW.MR_CC &amp;&amp; Number(ROW.MR_CC) != 0" />
				</COLUMNx>
				<COLUMNx dataField="MR_CC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					visible="true"
					headerText="PRO Réglé@LF@Chiffrier@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
				
				<COLUMN dataField="MF_DH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé@LF@Détail@LF@HON"
					multiLine="sum"	
					totalFunction="sum"
					align="right" >
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_DH != ROW.MF_CH &amp;&amp; Number(ROW.MF_CH) != 0" />
				</COLUMN>
				<COLUMN dataField="MF_TH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé@LF@Total@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_TH != ROW.MF_CH &amp;&amp; Number(ROW.MF_CH) != 0" />
				</COLUMN>
				<COLUMN dataField="MF_SH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé@LF@Clients@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_SH != ROW.MF_CH &amp;&amp; Number(ROW.MF_CH) != 0" />
				</COLUMN>
				<COLUMN dataField="MF_CH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					visible="true"
					headerText="PRO Facturé@LF@Chiffrier@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
					
				<COLUMNx dataField="MR_SH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Réglé@LF@Clients@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MR_SH != ROW.MR_CH &amp;&amp; Number(ROW.MR_CH) != 0" />
				</COLUMNx>
				<COLUMNx dataField="MR_CH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					visible="true"
					headerText="PRO Réglé@LF@Chiffrier@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
					
						
			</DATAGRID>
		
		</ONGLET>
		
		
		<ONGLET excelLabel="Erreurs Factures" label="Erreurs Factures" queryNumber="1">
				
			<DATAGRID title="" total="false" headerHeight="54" printRatio="1">
			
				<COLUMN dataField="FAC" 
					type="Char"
					width="100"
					visible="true"
					headerText="Facture" 
					textAlign="left"
					totalFunction="text"
					totalComplement="TOTAL"
				/>
														
				<COLUMN dataField="DATE" 
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="MM YYYY"
					width="50"
					visible="true"
					headerText="Mois" 
					textAlign="left"
					totalFunction="text"
					totalComplement="TOTAL"
				/>
				
				<COLUMN dataField="SEJ" 
					type="Char"
					width="100"
					visible="true"
					headerText="Séjour" 
					textAlign="left"
					totalFunction="text"
					totalComplement="TOTAL"
				/>
				
				<COLUMN dataField="NOM" 
					type="Char"
					minWidth="100"
					visible="true"
					headerText="Nom" 
					textAlign="left"
					totalFunction="text"
					totalComplement="TOTAL"
				/>
				
				
				<COLUMN dataField="MF_DC"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Facturé@LF@Détail@LF@Clinique"
					multiLine="sum"	
					totalFunction="sum"
					align="right">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_DC != ROW.MF_CC " />
				</COLUMN>
				<COLUMN dataField="MF_TC"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Facturé@LF@Total@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_TC != ROW.MF_CC " />
				</COLUMN>
				<COLUMN dataField="MF_SC"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Facturé@LF@Clients@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_SC != ROW.MF_CC " />
				</COLUMN>
				<COLUMN dataField="MF_CC"
					type="Number"
					outputFormat="#,00"
					width="75"
					visible="true"
					fixed="false"
					headerText="PRO Facturé@LF@Chiffrier@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
				
				<COLUMNx dataField="MR_SC"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Réglé@LF@Clients@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MR_SC != ROW.MR_CC " />
				</COLUMNx>
				<COLUMNx dataField="MR_CC"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					visible="true"
					headerText="PRO Réglé@LF@Chiffrier@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
				
				<COLUMN dataField="MF_DH"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Facturé@LF@Détail@LF@HON"
					multiLine="sum"	
					totalFunction="sum"
					align="right" >
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_DH != ROW.MF_CH " />
				</COLUMN>
				<COLUMN dataField="MF_TH"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Facturé@LF@Total@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_TH != ROW.MF_CH " />
				</COLUMN>
				<COLUMN dataField="MF_SH"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Facturé@LF@Clients@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MF_SH != ROW.MF_CH " />
				</COLUMN>
				<COLUMN dataField="MF_CH"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					visible="true"
					headerText="PRO Facturé@LF@Chiffrier@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
					
				<COLUMNx dataField="MR_SH"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					headerText="CTI Réglé@LF@Clients@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MR_SH != ROW.MR_CH " />
				</COLUMNx>
				<COLUMNx dataField="MR_CH"
					type="Number"
					outputFormat="#,00"
					width="75"
					fixed="false"
					visible="true"
					headerText="PRO Réglé@LF@Chiffrier@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
					
						
			</DATAGRID>
		
		</ONGLET>
		
		<ONGLET excelLabel="Chiffrier Données Importées" label="Chiffrier Données Importées" queryNumber="2">
				
			<DATAGRID title="" total="false" headerHeight="54" printRatio="1">
														
				<COLUMN dataField="ANNEE" 
					type="Number"
					outputFormat="#"
					minWidth="80"
					visible="true"
					headerText="Année dossier" 
					textAlign="left"
					totalFunction="text"
					totalComplement="TOTAL"
				/>
				
				<COLUMN dataField="MFC"
					type="Number"
					outputFormat="#"
					width="100"
					fixed="false"
					headerText="DOS2 Facturé@LF@Détail@LF@HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MCC != ROW.MFC" />
				</COLUMN>
				<COLUMN dataField="MCC"
					type="Number"
					outputFormat="#"
					width="100"
					fixed="false"
					headerText="Histo Facturé@LF@Total@LF@HON"
					multiLine="sum"	
					totalFunction="sum"
					align="right">
				</COLUMN>
				
				<COLUMN dataField="MFH"
					type="Number"
					outputFormat="#"
					width="100"
					fixed="false"
					headerText="DOS2 Facturé@LF@Détail@LF@Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum">
					<CELLSTYLE name="cellIndicator" value="circle, 5, right top, 0xFF6600" 
							condition="ROW.MCC != ROW.MFC" />
				</COLUMN>
				<COLUMN dataField="MCH"
					type="Number"
					outputFormat="#"
					width="100"
					fixed="false"
					headerText="Histo Facturé@LF@Total@LF@Clinique"
					multiLine="sum"	
					totalFunction="sum"
					align="right">
				</COLUMN>
				
					
						
			</DATAGRID>
		
		</ONGLET>		
				
	</PRESENTATION>
	
</VUE>

			
