<?xml version="1.0" encoding="ISO-8859-1"?>
<persistence-config extends="DOC_PES_Facture" file="PES_Facture/PES-Facture-persist.xml">
    <layer name="mysql" persistence-model="xemelios-sql">
        <document id="DOC_FactureDepense" extends="DOC_PES_Facture">
            <table type="repository" base-name="FACTUREDEPENSE_REPOSITORY" extends="PES_FACTURE_REPOSITORY"/>
            <table type="special-key" base-name="FACTUREDEPENSE_SPECIAL_KEYS" extends="PES_FACTURE_SPECIAL_KEYS"/>
            <table type="list-bc" base-name="FACTUREDEPENSE_LIST_BUDG_COLL" extends="PES_FACTURE_LIST_BUDG_COLL"/>
            
            <etat id="PESFacture" import-xslt-file="Facture-depense/PES-Facture-import-mysql.xsl">
				<table type="document" base-name="FACTUREDEPENSE_DOCUMENTS" extends="PES_FACTURE_DOCUMENTS"/>
				<table type="index" base-name="FACTUREDEPENSE_PESFACTURE_IX" extends="PES_FACTURE_PESFACTURE_IX" main="true"/>
				<table type="index" base-name="FACTUREDEPENSE_PESFACTURE_TIERS_IX" extends="PES_FACTURE_PESFACTURE_TIERS_IX"/>
				<table type="index" base-name="FACTUREDEPENSE_PESFACTURE_FACTUREINDIV_IX" extends="PES_FACTURE_PESFACTURE_FACTUREINDIV_IX"/>
				<table type="index" base-name="FACTUREDEPENSE_FACTUREINDIV_REFERENCE_IX" extends="PES_FACTURE_FACTUREINDIV_REFERENCE_IX"/>
				<table type="index" base-name="FACTUREDEPENSE_FACTUREINDIV_TIERS_IX" extends="PES_FACTURE_FACTUREINDIV_TIERS_IX"/>
				<table type="index" base-name="FACTUREDEPENSE_FACTUREINDIV_LIGNEFACTURE_IX" extends="PES_FACTURE_FACTUREINDIV_LIGNEFACTURE_IX"/>
				<table type="index" base-name="FACTUREDEPENSE_LIGNEFACTURE_TIERS_IX" extends="PES_FACTURE_LIGNEFACTURE_TIERS_IX"/>
				<table type="index" base-name="FACTUREDEPENSE_LIGNEFACTURE_REFERENCE_IX" extends="PES_FACTURE_LIGNEFACTURE_REFERENCE_IX"/>
				<table type="index" base-name="FACTUREDEPENSE_FACTUREINDIV_DETAILTVA_IX" extends="PES_FACTURE_FACTUREINDIV_DETAILTVA_IX"/>
            	<criteria id="CRI_PES_FACTURE_FACTUREINDIV_LIGNEFACTURE_CODENATURE2" type="1"
            		sql-index-id="SQI_PES_FACTURE_FACTUREINDIV_LIGNEFACTURE_CODENATURE">
            		<where-clause>fn:string-compare(${table}.${column},CodeNature)</where-clause>
            	</criteria>
            	
				<element id="PES_FACTURE_PESFACTURE_TIERS_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_PESFACTURE_TIERS_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_PESFACTURE_TIERS_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				<element id="PES_FACTURE_PESFACTURE_FACTUREINDIV_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_PESFACTURE_FACTUREINDIV_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_PESFACTURE_FACTUREINDIV_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				<element id="PES_FACTURE_FACTUREINDIV_REFERENCE_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_FACTUREINDIV_REFERENCE_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_FACTUREINDIV_REFERENCE_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				<element id="PES_FACTURE_FACTUREINDIV_TIERS_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_FACTUREINDIV_TIERS_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_FACTUREINDIV_TIERS_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				<element id="PES_FACTURE_FACTUREINDIV_LIGNEFACTURE_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_FACTUREINDIV_LIGNEFACTURE_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_FACTUREINDIV_LIGNEFACTURE_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				<element id="PES_FACTURE_LIGNEFACTURE_TIERS_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_LIGNEFACTURE_TIERS_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_LIGNEFACTURE_TIERS_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				<element id="PES_FACTURE_LIGNEFACTURE_REFERENCE_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_LIGNEFACTURE_REFERENCE_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_LIGNEFACTURE_REFERENCE_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				<element id="PES_FACTURE_FACTUREINDIV_DETAILTVA_IX"> 
					<sql-count>COUNT(DISTINCT(CONCAT(FACTUREDEPENSE_PESFACTURE_IX.DOC_ID,FACTUREDEPENSE_FACTUREINDIV_DETAILTVA_IX.NODE_ID)))</sql-count>
					<special-cond>FACTUREDEPENSE_FACTUREINDIV_DETAILTVA_IX.NODE_ID IS NOT NULL</special-cond>
				</element>
				                
			</etat>            
        </document>
    </layer>
</persistence-config>