<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000025" 
	label="Chiffrier CTI - Activité" 
	title="Chiffrier CTI - Activité" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_activite"
	admProvider="shs">
	
	<SELECTIONS>
		
	</SELECTIONS>
	
	<QUERIES> 
		
		<QUERY> 
			<SQL select="SELECT date_trunc('month',date_vente), SUM(montant_comptabilise)
					FROM activite.v_factures_lignes_c_1
					WHERE date_vente &gt;= 2007
					GROUP BY 1 
					ORDER BY 1 " >
				<FIELDS>
					<FIELD name="DATE"  />
					<FIELD name="MF_DC" />
				</FIELDS>
			</SQL>
			<SQL select="SELECT date_trunc('month',date_vente), SUM(montant_comptabilise)
					FROM activite.v_factures_lignes_h_1
					WHERE date_vente &gt;= 2007
					GROUP BY 1 
					ORDER BY 1 " >
				<FIELDS>
					<FIELD name="DATE"  />
					<FIELD name="MF_DH" />
				</FIELDS>
			</SQL>
			<SQL select="SELECT date_trunc('month',date_vente), SUM(montant_facture_c), SUM(montant_facture_h)
					FROM activite.p_factures
					WHERE date_vente &gt;= 2007
					GROUP BY 1 
					ORDER BY 1 " >
				<FIELDS>
					<FIELD name="DATE"  />
					<FIELD name="MF_TC" />
					<FIELD name="MF_TH" />
				</FIELDS>
			</SQL>
			
			<SQL select="SELECT date_trunc('month',date_comptable), SUM(montant_comptabilise), SUM(montant_regle)
					FROM activite.p_facture_solde_tiers_c
					WHERE date_comptable &gt;= 2007
					GROUP BY 1 
					ORDER BY 1 " >
				<FIELDS>
					<FIELD name="DATE"  />
					<FIELD name="MF_SC" />
					<FIELD name="MR_SC" />
				</FIELDS>
			</SQL>
			
			<SQL select="SELECT date_trunc('month',date_comptable), SUM(montant_ventes_c), SUM(montant_ventes_h), SUM(montant_reglements_c)
					FROM activite.p_chiffrier_shs
					WHERE date_comptable &gt;= 2007
					GROUP BY 1 
					ORDER BY 1 " >
				<FIELDS>
					<FIELD name="DATE"  />
					<FIELD name="MF_CC" />
					<FIELD name="MF_CH" />
					<FIELD name="MR_CC" />
				</FIELDS>
			</SQL>
			
			
		</QUERY>
	
		
		
			
	</QUERIES> 
	
	<CALCFIELDS>
	</CALCFIELDS>
	
	<PRESENTATION>
	
		<VIEWLINKS>
		
			
		</VIEWLINKS>
			
				
		
		
		<ONGLET excelLabel="Historique " label="Historique" queryNumber="0">
				
			<DATAGRID title="" key="DATE" keySeq="D" total="false" headerHeight="54" printRatio="1">
														
				<COLUMN dataField="DATE" 
					type="Date"
					inputFormat="AAAA-MM-JJ"
					outputFormat="MMMM YYYY"
					minWidth="80"
					visible="true"
					multiLine="key"
					headerText="Mois" 
					textAlign="left"
					totalFunction="text"
					totalComplement="TOTAL"
				/>
				
				
				<COLUMN dataField="MF_DC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé détail 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é total 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é Clients 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"
					visibleCondition="ENV.ADMPROVIDER == 'shs'"
					fixed="false"
					headerText="SHS Facturé chiffrier Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
				
				<COLUMN dataField="MR_SC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Réglé Clients 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" />
				</COLUMN>
				<COLUMN dataField="MR_CC"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					visibleCondition="ENV.ADMPROVIDER == 'shs'"
					headerText="SHS Réglé chiffrier Clinique"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
				
				<COLUMN dataField="MF_DH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					headerText="CTI Facturé détail 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é total 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_CH"
					type="Number"
					outputFormat="#"
					width="80"
					fixed="false"
					visibleCondition="ENV.ADMPROVIDER == 'shs'"
					headerText="SHS Facturé chiffrier HON"
					align="right"
					multiLine="sum"					
					totalFunction="sum"/>
					
						
			</DATAGRID>
		
		</ONGLET>
		
				
				
	</PRESENTATION>
	
</VUE>

			
