--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY nbsp " ">
+<!ENTITY egrave "è">
+<!ENTITY euro "€">
+<!ENTITY agrave "à">
+<!ENTITY eacute "é">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.xemelios.org/namespaces#cg-1.0" xmlns:n="http://www.xemelios.org/namespaces#cg-1.0" xmlns:added="http://projets.admisource.gouv.fr/xemelios/namespaces#added" xmlns:fn="http://projets.admisource.gouv.fr/xemelios/namespaces#functions" version="2.0">
+ <!-- Paramètres de sortie -->
+ <xsl:character-map name="accents">
+ <xsl:output-character character="à" string="&#224;"/>
+ <xsl:output-character character="é" string="&#233;"/>
+ <xsl:output-character character="è" string="&#232;"/>
+ <xsl:output-character character="ê" string="&#234;"/>
+ <xsl:output-character character="ë" string="&#235;"/>
+ <xsl:output-character character="î" string="&#238;"/>
+ <xsl:output-character character="ï" string="&#239;"/>
+ <xsl:output-character character="ô" string="&#244;"/>
+ <xsl:output-character character="ù" string="&#249;"/>
+ <xsl:output-character character="°" string="&#176;"/>
+ </xsl:character-map>
+ <xsl:output method="xhtml" indent="yes" use-character-maps="accents" encoding="ISO-8859-1"/>
+ <xsl:decimal-format name="decformat" decimal-separator="," grouping-separator=" " digit="#" pattern-separator=";" NaN="NaN" minus-sign="-"/>
+
+ <!-- Inclusion des XSL externes -->
+ <xsl:include href="common-xsl/Title.xsl"/>
+ <xsl:include href="common-xsl/Style.xsl"/>
+ <xsl:include href="common-xsl/Error.xsl"/>
+ <xsl:include href="common-xsl/Navigate.xsl"/>
+ <xsl:include href="common-xsl/Header.xsl"/>
+ <xsl:include href="common-xsl/Number.xsl"/><xsl:include href="common-xsl/Footer.xsl"/>
+
+ <!-- Paramètres Web -->
+ <xsl:param name="is.web">-1</xsl:param>
+ <xsl:param name="context.path"/>
+
+ <!-- Paramètres d'entrée -->
+ <xsl:param name="show.formulaire"/>
+ <xsl:param name="browser-destination"/>
+
+ <!-- Paramètres d'entrée de la liste de résultat -->
+ <xsl:param name="numCompte">0</xsl:param>
+
+ <!-- Paramètres d'erreur -->
+ <xsl:param name="error.message">nomessage</xsl:param>
+
+ <!-- Variables -->
+ <xsl:variable name="page-format" select="paysage"/>
+ <xsl:variable name="NumPage" select="/n:CompteGestion/n:VariationBesoinFondRoulement/n:PageVariationBesoinFondRoulement/n:Pied/@NumPage"/>
+ <xsl:variable name="isLastPage" select="/n:CompteGestion/n:VariationBesoinFondRoulement/n:PageVariationBesoinFondRoulement/@added:isLastPage"/>
+ <xsl:variable name="Entete">
+ <xsl:copy-of select="/n:CompteGestion/n:Entete"/>
+ </xsl:variable>
+ <xsl:variable name="Nomenclature" select="$Entete//n:Nomenclature/@V"/>
+ <xsl:variable name="Modele" select="//n:VariationBesoinFondRoulement/n:PageVariationBesoinFondRoulement/@Modele"/>
+
+ <xsl:variable name="Titre">TABLEAU DE FINANCEMENT EMPLOIS ET RESSOURCES DE L'EXERCICE</xsl:variable>
+
+ <!-- pour eviter les sorties parasites de tags non matches -->
+ <xsl:template match="*"/>
+
+ <xsl:variable name="comptes.libelles">
+ <ComptesLibelles>
+ <Type Modele="141">
+ <CompteLibelle pos="0" style="(lib;bold)" Compte="" Libelle="VARIATIONS EXPLOITATION - "CONSTRUCTION ACCESSION""/>
+ <CompteLibelle pos="0" style="(lib;center)" Compte="" Libelle="VARIATIONS DES ACTIFS D'EXPLOITATION"/>
+ <CompteLibelle pos="1" Compte="31" Libelle="-Terrains à aménager"/>
+ <CompteLibelle pos="2" Compte="33" Libelle="-Immeubles en cours"/>
+ <CompteLibelle pos="3" Compte="35 net du 359 sauf 358" Libelle="-Immeubles achevés"/>
+ <CompteLibelle pos="4" Compte="358" Libelle="-Logements temporaires loués"/>
+ <CompteLibelle pos="5" Compte="37" Libelle="-Immeubles acquis par résolution de vente ou adjudication"/>
+ <CompteLibelle pos="6" Compte="40712 -40722" Libelle="-Différences de conversion ou d'indexation -Fournisseurs de stocks immobiliers"/>
+ <CompteLibelle pos="7" Compte="40912" Libelle="-Fournisseurs débiteurs de stocks immobiliers"/>
+ <CompteLibelle pos="8" Compte="412" Libelle="-Créances sur acquéreurs"/>
+ <CompteLibelle pos="9" Compte="4162 et 41682" Libelle="-Acquéreurs douteux ou litigieux"/>
+ <CompteLibelle pos="10" Compte="4862" Libelle="-Frais de commercialisation sur lots vendus non livrés"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="0" style="(lib;center)" Compte="" Libelle="VARIATIONS DES DETTES D'EXPLOITATION"/>
+ <CompteLibelle pos="11" style="(cpt;bold)" Compte="16 partiel (1) -168812" Libelle="-Emprunts accession relais préfinancement (code 4) (1)"/>
+ <CompteLibelle pos="12" Compte="168822" Libelle="-Intérêts courus capitalisés -opérations d'accession"/>
+ <CompteLibelle pos="13" Compte="402" Libelle="-Fournisseurs de stocks immobiliers"/>
+ <CompteLibelle pos="14" Compte="4032" Libelle="-Effets à payer"/>
+ <CompteLibelle pos="15" Compte="40712 -40722" Libelle="-Différences de conversion ou d'indexation -Fournisseurs de stocks immobiliers"/>
+ <CompteLibelle pos="16" Compte="4082" Libelle="-Fournisseurs de stocks immobiliers factures non parvenues"/>
+ <CompteLibelle pos="17" Compte="41912" Libelle="-Avances-acquéreurs"/>
+ <CompteLibelle pos="18" Compte="4872" Libelle="-Produits des ventes sur lots en cours"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="19" style="(lib;bold)(mt1;bordered)(mt2;bordered)(mt3;bordureBottom)(mt4;bordureBottom)" Compte="" Libelle="TOTAUX"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="20" style="(lib;bold)(mt1;bordureTop)(mt2;bordureTop)" Compte="" Libelle="A - VARIATION NETTE EXPLOITATION - "CONSTRUCTION ACCESSION""/>
+ </Type>
+ <Type Modele="142">
+ <CompteLibelle pos="0" style="(lib;bold)" Compte="" Libelle="VARIATIONS EXPLOITATION - "LOCATIF ET GESTION DE PRÊTS""/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="0" Compte="" Libelle="VARIATIONS DES ACTIFS D'EXPLOITATION"/>"/>
+ <CompteLibelle pos="1" Compte="32" Libelle="-Approvisionnements"/>
+ <CompteLibelle pos="2" Compte="411" Libelle="-Locataires et organismes payeurs d'APL"/>
+ <CompteLibelle pos="3" Compte="414" Libelle="-Clients -Autres activités"/>
+ <CompteLibelle pos="4" Compte="415" Libelle="-Emprunteurs, locataires acquéreurs et organismes payeurs d'APL"/>
+ <CompteLibelle pos="5" Compte="416 sauf 4162 et 41682" Libelle="-Clients douteux"/>
+ <CompteLibelle pos="6" Compte="417" Libelle="-Différences de conversion ou d'indexation-Redevables"/>
+ <CompteLibelle pos="7" Compte="418" Libelle="-Produits non encore facturés"/>
+ <CompteLibelle pos="8" Compte="40711 -40721" Libelle="-Différences de conversion ou d'indexation -Fournisseurs"/>
+ <CompteLibelle pos="9" Compte="40911" Libelle="-Fournisseurs d'exploitation débiteurs"/>
+ <CompteLibelle pos="10" Compte="2678 - 2768" Libelle="-Intérêts courus"/>
+ <CompteLibelle pos="11" Compte="42 -43 -44 (sauf 4412)" Libelle="-Autres"/>
+ <CompteLibelle pos="12" Compte="4861" Libelle="-Charges constatées d'avance (exploitation)"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="0" Compte="" Libelle="VARIATIONS DES DETTES D'EXPLOITATION"/>
+ <CompteLibelle pos="13" Compte="4195" Libelle="-Locataires (excédents d'acomptes)"/>
+ <CompteLibelle pos="14" Compte="419 sauf 41912 et 4195" Libelle="-Autres"/>
+ <CompteLibelle pos="15" Compte="401" Libelle="-Fournisseurs (exploitation, gestion)"/>
+ <CompteLibelle pos="16" Compte="4031" Libelle="-Effets à payer"/>
+ <CompteLibelle pos="17" Compte="40711 -40721" Libelle="-Différences de conversion ou d'indexation-Fournisseurs"/>
+ <CompteLibelle pos="18" Compte="4081" Libelle="-Factures non parvenues (exploitation, gestion)"/>
+ <CompteLibelle pos="19" Compte="168811 -168813" Libelle="-Intérêts courus (sauf accessions relais)"/>
+ <CompteLibelle pos="20" Compte="168821 -168823" Libelle="-Intérêts courus capitalisables (hors opérations d'accession)"/>
+ <CompteLibelle pos="21" Compte="417" Libelle="-Différences de conversion ou d'indexation-Redevables"/>
+ <CompteLibelle pos="22" Compte="42 -43 -44" Libelle="-Autres"/>
+ <CompteLibelle pos="23" Compte="4871 -4873" Libelle="-Produits constatés d'avance (exploitation et frais de gestion PAP)"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="24" style="(lib;bold)(mt1;bordered)(mt2;bordered)" Compte="" Libelle="TOTAUX"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="25" style="(lib;bold)" Compte="" Libelle="B -VARIATION NETTE EXPLOITATION - "LOCATIF ET GESTION DE PRETS""/>
+ </Type>
+ <Type Modele="143">
+ <CompteLibelle pos="0" style="(lib;bold)" Compte="" Libelle="VARIATIONS "HORS EXPLOITATION""/>
+ <CompteLibelle pos="0" style="(lib;pad60)" Compte="" Libelle="VARIATIONS DES AUTRES DEBITEURS"/>
+ <CompteLibelle pos="1" Compte="40714 -40724" Libelle="-Différences de conversion ou d'indexation-Fournisseurs d'immobilisations"/>
+ <CompteLibelle pos="2" Compte="40914" Libelle="-Fournisseurs d'immobilisation débiteurs"/>
+ <CompteLibelle pos="3" Compte="4097 -4098" Libelle="-Autres fournisseurs débiteurs"/>
+ <CompteLibelle pos="4" Compte="4412" Libelle="-Subventions d'investissement"/>
+ <CompteLibelle pos="5" Compte="461" Libelle="-Opérations pour compte de tiers"/>
+ <CompteLibelle pos="6" Compte="46 sauf 461" Libelle="-Autres"/>
+ <CompteLibelle pos="7" Compte="47" Libelle="-Comptes transitoires ou d'attente"/>
+ <CompteLibelle pos="0" style="(lib;pad60)" Compte="" Libelle="VARIATIONS DES AUTRES CREDITEURS"/>
+ <CompteLibelle pos="8" Compte="404" Libelle="-Fournisseurs d'immobilisations"/>
+ <CompteLibelle pos="9" Compte="405" Libelle="-Effets à payer"/>
+ <CompteLibelle pos="10" Compte="40714 -40724" Libelle="-Différences de conversion ou d'indexation-Fournisseurs d'immobilisations"/>
+ <CompteLibelle pos="11" Compte="4084" Libelle="-Factures non parvenues"/>
+ <CompteLibelle pos="12" Compte="461" Libelle="-Opérations pour compte de tiers"/>
+ <CompteLibelle pos="13" Compte="46 sauf 461" Libelle="-Autres"/>
+ <CompteLibelle pos="14" Compte="47" Libelle="-Comptes transitoires ou d'attente"/>
+ <CompteLibelle pos="15" Compte="4878" Libelle="-Autres produits constatés d'avance"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="16" style="(lib;total)(mt1;bordered)(mt2;bordered)" Compte="" Libelle="TOTAUX"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="17" style="(cpt;bordureBottom)(lib;totalBordureBottom)(mt1;bordered)(mt2;bordered)(mt3;bordered)(mt4;bordered)" Compte="" Libelle="C -VARIATION NETTE "HORS EXPLOITATION""/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="18" style="(lib;total)" Compte="" Libelle="TOTAL A + B + C"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="0" style="(lib;center)" Compte="" Libelle="VARIATION DU BESOIN EN FONDS DU ROULEMENT"/>
+ </Type>
+ <Type Modele="144">
+ <CompteLibelle pos="0" style="(lib;bold)" Compte="" Libelle="VARIATIONS "TRESORERIE""/>
+ <CompteLibelle pos="1" Compte="50" Libelle="-Valeurs mobilières de placement"/>
+ <CompteLibelle pos="2" Compte="51 -53 -54 (sauf 5181 et 519)" Libelle="-Variations des disponibilités(actif)"/>
+ <CompteLibelle pos="3" Compte="5181 -519" Libelle="-Variations des crédits de trésorerie (passif)"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="4" style="(lib;total)(mt1;bordered)(mt2;bordered)" Compte="" Libelle="TOTAUX"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="5" style="(cpt;bordureBottom)(lib;totalBordureBottom)(mt1;bordureBottom)(mt2;bordureBottom)(mt3;bordureBottom)(mt4;bordureBottom)" Compte="" Libelle="D -VARIATION NETTE DE TRESORERIE"/>
+ <CompteLibelle pos="0" style="(lib;total)" Compte="" Libelle="VARIATION DU FONDS DE ROULEMENT NET GLOBAL (TOTAL A+B+C+D)"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="6" style="(lib;pad150)" Compte="" Libelle="EMPLOI NET (2)"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="0" style="(lib;pad150)" Compte="" Libelle="OU"/>
+ <CompteLibelle Type="vide"/>
+ <CompteLibelle pos="7" style="(lib;pad150)" Compte="" Libelle="RESSOURCE NETTE (3)"/>
+ </Type>
+ </ComptesLibelles>
+ </xsl:variable>
+
+ <xsl:template match="/n:CompteGestion">
+ <html>
+ <head>
+ <xsl:call-template name="title"><xsl:with-param name="Entete" select="//n:Entete"/><xsl:with-param name="etat"><xsl:value-of select="$Titre"/></xsl:with-param></xsl:call-template>
+ <xsl:call-template name="style"/>
+ </head>
+ <body width="100%">
+ <xsl:if test="$error.message!='nomessage'">
+ <xsl:attribute name="onload">javascript:showDialog('<xsl:value-of select="$error.message"/>');</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="Error"><!--xsl:with-param name="error.message" select="$error.message"/--></xsl:call-template>
+ <xsl:call-template name="navigate">
+ <xsl:with-param name="docId">cg-colloc</xsl:with-param>
+ <xsl:with-param name="etatId">VariationBesoinFondRoulement</xsl:with-param>
+ <xsl:with-param name="elementId">PageVariationBesoinFondRoulement</xsl:with-param>
+ <xsl:with-param name="sous.elementId">LigneVariationBesoinFondRoulement</xsl:with-param>
+ <xsl:with-param name="NumPage" select="$NumPage"/>
+ <xsl:with-param name="isLastPage" select="$isLastPage"/>
+ <xsl:with-param name="Entete" select="$Entete"/>
+ <xsl:with-param name="show.formulaire" select="$show.formulaire"/>
+ <xsl:with-param name="show.depense.recette" select="0"/>
+ <xsl:with-param name="is.web" select="$is.web"/>
+ <xsl:with-param name="context.path" select="$context.path"/>
+ </xsl:call-template>
+
+ <xsl:call-template name="header">
+ <xsl:with-param name="Entete" select="$Entete"/>
+ <xsl:with-param name="Titre"><xsl:value-of select="$Titre"/></xsl:with-param>
+ <xsl:with-param name="Titre.Plus"><h1>VARIATION DU BESOIN EN FONDS DE ROULEMENT ET DE LA TRESORERIE</h1><h3><i>La variation des éléments d'actif est calculée à partir des valeurs brutes</i></h3></xsl:with-param>
+ </xsl:call-template>
+
+ <!-- **************** DEBUG **************** -->
+ <!--h1 style="color: red; background-color: yellow;">Type=<xsl:value-of select="/n:CompteGestion/n:VariationBesoinFondRoulement/n:PageVariationBesoinFondRoulement/@Type"/><br/>Modele=<xsl:value-of select="/n:CompteGestion/n:VariationBesoinFondRoulement/n:PageVariationBesoinFondRoulement/@Modele"/></h1-->
+
+ <table width="100%" class="bordered" id="mainNoBorder">
+ <colgroup>
+ <col width="10%"/><!-- Compte -->
+ <col/><!-- Libelle -->
+ <col width="12%"/><!-- Montant1 -->
+ <col width="12%"/><!-- Montant2 -->
+ <col width="12%"/><!-- Montant3 -->
+ <col width="12%"/><!-- Montant4 -->
+ </colgroup>
+ <thead>
+ <tr class="titre">
+ <td rowspan="2" class="bold center titre bordureRight">N° DE<br/>COMPTE</td>
+ <td rowspan="2" class="bold center titre bordureRight">LIBELLES</td>
+ <td colspan="3" class="bold center titre bordureRight bordureBottom">EXERCICE <xsl:value-of select="/n:CompteGestion/n:Entete/n:Infos/n:Collectivite/@Exercice"/></td>
+ <td class="bold center titre bordureRight bordureBottom">EXERCICE <xsl:value-of select="/n:CompteGestion/n:Entete/n:Infos/n:Collectivite/@Exercice - 1"/></td>
+ </tr>
+ <tr class="titre">
+ <td class="bold center titre bordureRight">BESOINS</td>
+ <td class="bold center titre bordureRight">DEGAGEMENT</td>
+ <td class="bold center titre bordureRight">SOLDE (3-4)</td>
+ <td class="bold center titre bordureRight">SOLDE</td>
+ </tr>
+ <tr class="titre">
+ <td class="bold center titre bordureRight bordureBottom">1</td>
+ <td class="bold center titre bordureRight bordureBottom">2</td>
+ <td class="bold center titre bordureRight bordureBottom">3</td>
+ <td class="bold center titre bordureRight bordureBottom">4</td>
+ <td class="bold center titre bordureRight bordureBottom">5</td>
+ <td class="bold center titre bordureRight bordureBottom">6</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:call-template name="donnees">
+ <xsl:with-param name="el" select="/n:CompteGestion/n:VariationBesoinFondRoulement/n:PageVariationBesoinFondRoulement"/>
+ </xsl:call-template>
+ </tbody>
+ </table>
+ <xsl:if test="$Modele='144'">
+ <p class="tiny">(1) Variation de la dette (emprunts code 4 de l'état du passif) et variation des ICNE correspondants (168812)
+ <br/>(2) Emploi net égal à la ressource nette dégagée au tableau 1 précédent.
+ <br/>(3) Ressource nette égale à l'emploi net dégagé au tableau 1 précédent.</p>
+ </xsl:if>
+ <p>
+ <xsl:call-template name="footer"><xsl:with-param name="num.page" select="$NumPage"/><xsl:with-param name="tracabilite"><xsl:copy-of select="//n:Tracabilite"/></xsl:with-param></xsl:call-template>
+ </p>
+
+ <xsl:call-template name="navigate">
+ <xsl:with-param name="docId">cg-colloc</xsl:with-param>
+ <xsl:with-param name="etatId">VariationBesoinFondRoulement</xsl:with-param>
+ <xsl:with-param name="elementId">PageVariationBesoinFondRoulement</xsl:with-param>
+ <xsl:with-param name="sous.elementId">LigneVariationBesoinFondRoulement</xsl:with-param>
+ <xsl:with-param name="NumPage" select="$NumPage"/>
+ <xsl:with-param name="isLastPage" select="$isLastPage"/>
+ <xsl:with-param name="Entete" select="$Entete"/>
+ <xsl:with-param name="show.formulaire" select="$show.formulaire"/>
+ <xsl:with-param name="show.depense.recette" select="0"/>
+ <xsl:with-param name="is.web" select="$is.web"/>
+ <xsl:with-param name="context.path" select="$context.path"/>
+ </xsl:call-template>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="donnees">
+ <xsl:param name="el"/>
+
+ <!-- $el//n:LigneVariationBesoinFondRoulement -->
+ <xsl:for-each select="$comptes.libelles//n:Type[@Modele=$Modele]/n:CompteLibelle">
+ <xsl:variable name="pos" select="@pos"/>
+ <xsl:variable name="type" select="@Type"/>
+ <xsl:choose>
+ <xsl:when test="$type eq 'vide'">
+ <tr>
+ <xsl:choose>
+ <xsl:when test="(position() mod 2) = 0">
+ <xsl:attribute name="id">colorised1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="id">colorised2</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ </tr>
+ </xsl:when>
+ <xsl:when test="$pos and number($pos) eq 0">
+ <tr>
+ <xsl:choose>
+ <xsl:when test="(position() mod 2) = 0">
+ <xsl:attribute name="id">colorised1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="id">colorised2</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'cpt')"><xsl:value-of select="fn:getStyles(@style,'cpt')"/> bordureRight</xsl:when>
+ <xsl:otherwise>bordureRight</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:value-of select="@Compte" disable-output-escaping="yes"/>
+ </td>
+ <td>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'lib')">bordureRight <xsl:value-of select="fn:getStyles(@style,'lib')"/></xsl:when>
+ <xsl:otherwise>bordureRight</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:value-of select="@Libelle" disable-output-escaping="yes"/>
+ </td>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ <td class="bordureRight"> </td>
+ </tr>
+ </xsl:when>
+ <xsl:when test="$pos and number($pos) gt 0">
+ <xsl:variable name="ligne"><xsl:copy-of select="$el//n:LigneVariationBesoinFondRoulement[position()=$pos]"/></xsl:variable>
+ <xsl:variable name="montant.3">
+ <xsl:choose>
+ <xsl:when test="$ligne//@MontantVariationAN"><xsl:value-of select="$ligne//@MontantVariationAN"/></xsl:when>
+ <xsl:when test="$ligne//@MontantVariationBN"><xsl:value-of select="$ligne//@MontantVariationBN"/></xsl:when>
+ <xsl:when test="$ligne//@MontantVariationCN"><xsl:value-of select="$ligne//@MontantVariationCN"/></xsl:when>
+ <xsl:when test="$ligne//@MontantVariationDN"><xsl:value-of select="$ligne//@MontantVariationDN"/></xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="montant.4">
+ <xsl:choose>
+ <xsl:when test="$ligne//@MontantVariationAN-1"><xsl:value-of select="$ligne//@MontantVariationAN-1"/></xsl:when>
+ <xsl:when test="$ligne//@MontantVariationBN-1"><xsl:value-of select="$ligne//@MontantVariationBN-1"/></xsl:when>
+ <xsl:when test="$ligne//@MontantVariationCN-1"><xsl:value-of select="$ligne//@MontantVariationCN-1"/></xsl:when>
+ <xsl:when test="$ligne//@MontantVariationDN-1"><xsl:value-of select="$ligne//@MontantVariationDN-1"/></xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <tr>
+ <xsl:choose>
+ <xsl:when test="(position() mod 2) = 0">
+ <xsl:attribute name="id">colorised1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="id">colorised2</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'cpt')"><xsl:value-of select="fn:getStyles(@style,'cpt')"/> bordureRight</xsl:when>
+ <xsl:otherwise>bordureRight</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:value-of select="@Compte" disable-output-escaping="yes"/>
+ </td>
+ <td class="{concat('bordureRight',' ',fn:getStyles(@style,'lib'))}">
+ <!--xsl:choose>
+ <xsl:when test="contains(@style,'lib')"><xsl:attribute name="class" select="concat('bordureRight',' ',fn:getStyles(@style,'lib'))"/></xsl:when>
+ <xsl:otherwise><xsl:attribute name="class" select="'bordureRight'"/></xsl:otherwise>
+ </xsl:choose-->
+ <xsl:value-of select="@Libelle" disable-output-escaping="yes"/>
+ </td>
+ <td>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'mt1')">montant bordureRight <xsl:value-of select="fn:getStyles(@style,'mt1')"/></xsl:when>
+ <xsl:otherwise>montant bordureRight</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:call-template name="number"><xsl:with-param name="num" select="$ligne//@MontantBesoin"/></xsl:call-template><xsl:if test="string-length($ligne//@MontantBesoin) eq 0"> </xsl:if>
+ </td>
+ <td>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'mt2')">montant bordureRight <xsl:value-of select="fn:getStyles(@style,'mt2')"/></xsl:when>
+ <xsl:otherwise>montant bordureRight</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:call-template name="number"><xsl:with-param name="num" select="$ligne//@MontantDegagement"/></xsl:call-template><xsl:if test="string-length($ligne//@MontantDegagement) eq 0"> </xsl:if>
+ </td>
+ <td>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'mt3')">montant bordureRight <xsl:value-of select="fn:getStyles(@style,'mt3')"/></xsl:when>
+ <xsl:otherwise>montant bordureRight</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:call-template name="number"><xsl:with-param name="num" select="$montant.3"/></xsl:call-template><xsl:if test="string-length($ligne//@MontantVariationAN) eq 0"> </xsl:if>
+ </td>
+ <td>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="contains(@style,'mt4')">montant bordureRight <xsl:value-of select="fn:getStyles(@style,'mt4')"/></xsl:when>
+ <xsl:otherwise>montant bordureRight</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:call-template name="number"><xsl:with-param name="num" select="$montant.4"/></xsl:call-template><xsl:if test="string-length($ligne//@MontantVariationAN-1) eq 0"> </xsl:if>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:function name="fn:getStyles">
+ <xsl:param name="el"/>
+ <xsl:param name="id"/>
+ <xsl:variable name="separator.deb">\(</xsl:variable>
+ <xsl:variable name="separator.fin">\)</xsl:variable>
+ <xsl:variable name="separator.data">;</xsl:variable>
+ <xsl:variable name="styles">
+ <styles>
+ <xsl:for-each select="tokenize($el,$separator.fin)">
+ <xsl:variable name="this"><xsl:value-of select="replace(.,$separator.deb,'')"/></xsl:variable>
+ <xsl:variable name="sts"><sts><xsl:for-each select="tokenize($this,$separator.data)"><st><xsl:value-of select="."/></st></xsl:for-each></sts></xsl:variable>
+ <style>
+ <xsl:attribute name="id"><xsl:value-of select="$sts//n:st[1]/text()"/></xsl:attribute>
+ <xsl:attribute name="style"><xsl:for-each select="$sts//n:st"><xsl:if test="position() gt 1"><xsl:value-of select="text()"/><xsl:if test="(position() < count($sts//n:st)) and (count($sts//n:st) > 2)"> </xsl:if></xsl:if></xsl:for-each></xsl:attribute>
+ </style>
+ </xsl:for-each>
+ </styles>
+ </xsl:variable>
+ <xsl:sequence select="$styles//n:style[@id=$id]/@style"/>
+ </xsl:function>
+</xsl:stylesheet>
\ No newline at end of file