--- /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:BalanceGenerale/n:PageBalanceGenerale/n:Pied/@NumPage"/>
+ <xsl:variable name="isLastPage" select="/n:CompteGestion/n:BalanceGenerale/n:PageBalanceGenerale/@added:isLastPage"/>
+ <xsl:variable name="Entete" select="/n:CompteGestion/n:Entete"/>
+
+ <xsl:variable name="liens.comptes" select="document('./LiensBalance.xml')"/>
+
+ <xsl:variable name="siret.annexe" select="//n:Entete/n:Infos/n:BudgetBA[@Code=//n:EnteteBalanceGenerale/@CodeBudgetAnnexe]/@SiretBA"/>
+
+ <!-- pour eviter les sorties parasites de tags non matches -->
+ <xsl:template match="*"/>
+
+ <xsl:template match="/n:CompteGestion">
+ <html>
+ <head>
+ <!--title>Balance des Comptes</title-->
+ <xsl:call-template name="title"><xsl:with-param name="Entete" select="//n:Entete"/><xsl:with-param name="etat">Balance des Comptes</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">BalanceGenerale</xsl:with-param>
+ <xsl:with-param name="elementId">PageBalanceGenerale</xsl:with-param>
+ <xsl:with-param name="sous.elementId">LigneBalanceGenerale</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:choose>
+ <xsl:when test="//n:Nomenclature/@V='M21'">Balance Réglementaire des Comptes du Grand Livre</xsl:when>
+ <xsl:otherwise>Balance des Comptes</xsl:otherwise>
+ </xsl:choose></xsl:with-param>
+ <xsl:with-param name="Titre.Plus">
+ <xsl:if test="//n:Nomenclature/@V='M21'">
+ <xsl:variable name="date">
+ <xsl:call-template name="iso-date-header"><xsl:with-param name="datebrute" select="//n:EnteteBalanceGenerale/@Date2"/></xsl:call-template>
+ </xsl:variable>
+ <h2>Arrêté à la date du <xsl:value-of select="$date"/></h2></xsl:if></xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="mainTable">
+ <xsl:with-param name="el" select="/n:CompteGestion/n:BalanceGenerale/n:PageBalanceGenerale"/>
+ </xsl:call-template>
+ <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">BalanceGenerale</xsl:with-param>
+ <xsl:with-param name="elementId">PageBalanceGenerale</xsl:with-param>
+ <xsl:with-param name="sous.elementId">LigneBalanceGenerale</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="mainTable">
+ <xsl:param name="el"/>
+ <table width="100%" id="main" class="bordered">
+ <colgroup>
+ <col width="5%"/>
+ <col width="24%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ <col width="7%"/>
+ </colgroup>
+ <thead>
+ <tr class="titre">
+ <td colspan="2" > </td>
+ <td colspan="2" class="titre bold center bordered">BALANCE D'ENTREE</td>
+ <td colspan="2" class="titre bold center bordered">OPERATIONS NON BUDGETAIRES</td>
+ <td colspan="2" class="titre bold center bordered">OPERATIONS BUDGETAIRES</td>
+ <td colspan="2" class="titre bold center bordered">TOTAUX</td>
+ <td colspan="2" class="titre bold center bordered">SOLDES</td>
+ </tr>
+ <tr>
+ <td class="titre2 bold center bordered">COMPTES</td>
+ <td class="titre2 bold center bordered">INTITULE</td>
+ <td class="titre2 bold center bordered">DEBIT</td>
+ <td class="titre2 bold center bordered">CREDIT</td>
+ <td class="titre2 bold center bordered">DEBIT</td>
+ <td class="titre2 bold center bordered">CREDIT</td>
+ <td class="titre2 bold center bordered">DEBIT</td>
+ <td class="titre2 bold center bordered">CREDIT</td>
+ <td class="titre2 bold center bordered">DEBIT</td>
+ <td class="titre2 bold center bordered">CREDIT</td>
+ <td class="titre2 bold center bordered">DEBIT</td>
+ <td class="titre2 bold center bordered">CREDIT</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="$el/n:LigneBalanceGenerale">
+ <tr>
+ <xsl:choose>
+ <xsl:when test="$numCompte != '0' and @NumCompte=$numCompte">
+ <xsl:attribute name="id">highlighted</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <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>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="contains(lower-case(@LibelleReglementaire),'total') and contains(lower-case(@LibelleReglementaire),'sous')">
+ <td class="center bold bordureRight"><!--xsl:call-template name="link.compte.numero"><xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/></xsl:call-template-->
+ <xsl:value-of select="normalize-space(@NumCompte)"/>
+ </td>
+ <td class="bold bordureRight"><xsl:value-of select="@LibelleReglementaire"/><xsl:if test="@LibelleReglementaireComplement"><br/><xsl:value-of select="@LibelleReglementaireComplement"/></xsl:if></td>
+ <td class="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantBalanceDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantBalanceCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeNonBudDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeNonBudCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <!--xsl:call-template name="link.compte.operations.budgetaires">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ <xsl:with-param name="montant" select="@MontantOpeBudDebit1"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeBudDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <!--xsl:call-template name="link.compte.operations.budgetaires">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ <xsl:with-param name="montant" select="@MontantOpeBudCredit1"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeBudCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <!--xsl:call-template name="link.montant.totaux">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantTotDebit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantTotDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <!--xsl:call-template name="link.montant.totaux">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantTotCredit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantTotCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <!--xsl:call-template name="link.montant.solde">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantSolDebit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantSolDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <!--xsl:call-template name="link.montant.solde">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantSolCredit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantSolCredit1"/>
+ </xsl:call-template>
+ </td>
+ </xsl:when>
+ <xsl:when test="contains(lower-case(@LibelleReglementaire),'total') and not(contains(lower-case(@LibelleReglementaire),'sous'))">
+ <td class="center bold bordered">
+ <!--xsl:call-template name="link.compte.numero">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ </xsl:call-template-->
+ <xsl:value-of select="normalize-space(@NumCompte)"/>
+ </td>
+ <td class="bold bordered"><xsl:value-of select="@LibelleReglementaire"/><xsl:if test="@LibelleReglementaireComplement"><br/><xsl:value-of select="@LibelleReglementaireComplement"/></xsl:if></td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantBalanceDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantBalanceCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeNonBudDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeNonBudCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <!--xsl:call-template name="link.compte.operations.budgetaires">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ <xsl:with-param name="montant" select="@MontantOpeBudDebit1"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeBudDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <!--xsl:call-template name="link.compte.operations.budgetaires">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ <xsl:with-param name="montant" select="@MontantOpeBudCredit1"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeBudCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <!--xsl:call-template name="link.montant.totaux">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantTotDebit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantTotDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <!--xsl:call-template name="link.montant.totaux">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantTotCredit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantTotCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <!--xsl:call-template name="link.montant.solde">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantSolDebit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantSolDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <!--xsl:call-template name="link.montant.solde">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantSolCredit1"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantSolCredit1"/>
+ </xsl:call-template>
+ </td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td class="center bordureRight">
+ <!--xsl:call-template name="link.compte.numero">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ </xsl:call-template-->
+ <xsl:value-of select="normalize-space(@NumCompte)"/>
+ </td>
+ <td class="bordureRight"><xsl:value-of select="@LibelleReglementaire"/><xsl:if test="@LibelleReglementaireComplement"><br/><xsl:value-of select="@LibelleReglementaireComplement"/></xsl:if></td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantBalanceDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantBalanceCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeNonBudDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@MontantOpeNonBudCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="link.compte.operations.budgetaires">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ <xsl:with-param name="montant" select="@MontantOpeBudDebit1"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="link.compte.operations.budgetaires">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ <xsl:with-param name="montant" select="@MontantOpeBudCredit1"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="link.montant.totaux">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantTotDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="link.montant.totaux">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantTotCredit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="link.montant.solde">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantSolDebit1"/>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="link.montant.solde">
+ <xsl:with-param name="num.compte" select="@NumCompte"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ <xsl:with-param name="montant" select="@MontantSolCredit1"/>
+ </xsl:call-template>
+ </td>
+ </xsl:otherwise>
+ </xsl:choose>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="link.compte.operations.budgetaires">
+ <xsl:param name="num.compte"/>
+ <xsl:param name="montant"/>
+ <xsl:param name="CodRD"/>
+
+ <xsl:choose>
+ <xsl:when test="string-length($num.compte) > 2 and count($liens.comptes/Editions/Comptes[@Edition=$Entete//n:CompteGestion/@V]) > 0">
+ <xsl:choose>
+ <xsl:when test="starts-with($num.compte,'1') or starts-with($num.compte,'2') or starts-with($num.compte,'6') or starts-with($num.compte,'7') or starts-with($num.compte,'48') or starts-with($num.compte,'49')">
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:text disable-output-escaping="yes">xemelios:/customLink?srcDocId=cg-colloc&srcEtatId=BalanceGenerale&srcElementId=PageBalanceGenerale&srcCollectivite=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@Siret"/>
+ <xsl:text disable-output-escaping="yes">&srcBudget=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@CodeBudget"/>
+ <xsl:text disable-output-escaping="yes">&sp1=</xsl:text><xsl:value-of select="//n:Entete/n:Infos/n:Collectivite/@Exercice"/>
+ <xsl:text disable-output-escaping="yes">&numCompte=</xsl:text><xsl:value-of select="$num.compte"/>
+ <xsl:text disable-output-escaping="yes">&montant=</xsl:text><xsl:value-of select="$montant"/>
+ <xsl:text disable-output-escaping="yes">&cg=</xsl:text><xsl:value-of select="$Entete//n:CompteGestion[1]/@V"/>
+ <xsl:if test="string-length($CodRD) > 0"><xsl:text disable-output-escaping="yes">&CodRD=</xsl:text><xsl:value-of select="$CodRD"/></xsl:if>
+ <xsl:if test="$siret.annexe">
+ <xsl:text disable-output-escaping="yes">&BudgetBA=</xsl:text><xsl:value-of select="//n:EnteteBalanceGenerale/@CodeBudgetAnnexe"/>
+ <xsl:text disable-output-escaping="yes">&SiretBA=</xsl:text><xsl:value-of select="$siret.annexe"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><xsl:call-template name="number"><xsl:with-param name="num" select="$montant"/></xsl:call-template></xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--xsl:template name="link.compte.numero">
+ <xsl:param name="num.compte"/>
+ <xsl:param name="montant"/>
+
+ <xsl:if test="string-length($num.compte) > 2">
+ <xsl:choose-->
+ <!-- Comptes de Classe 4 ou 5 -->
+ <!--xsl:when test="(not(starts-with($num.compte,'4')) and not(starts-with($num.compte,'5'))) and (not(starts-with($num.compte,'48')) and not(starts-with($num.compte,'49')))"-->
+ <!--xsl:when test="not(starts-with($num.compte,'4')) and not(starts-with($num.compte,'5'))">
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:text disable-output-escaping="yes">xemelios:/customLink?srcDocId=cg-colloc&srcEtatId=BalanceGenerale&srcElementId=PageBalanceGenerale&srcCollectivite=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@Siret"/>
+ <xsl:text disable-output-escaping="yes">&srcBudget=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@CodeBudget"/>
+ <xsl:text disable-output-escaping="yes">&sp1=</xsl:text><xsl:value-of select="//n:Entete/n:Infos/n:Collectivite/@Exercice"/>
+ <xsl:text disable-output-escaping="yes">&numCompte=</xsl:text><xsl:value-of select="$num.compte"/>
+ </xsl:attribute>
+ <xsl:value-of select="$num.compte"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="$num.compte"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template-->
+
+ <xsl:template name="link.montant.solde">
+ <xsl:param name="num.compte"/>
+ <xsl:param name="montant"/>
+ <xsl:param name="CodRD"/>
+
+ <xsl:choose>
+ <xsl:when test="string-length($num.compte) > 2 and count($liens.comptes/Editions/Comptes[@Edition=$Entete//n:CompteGestion[1]/@V]) > 0">
+ <xsl:choose>
+ <xsl:when test="not(starts-with($num.compte,'1')) and not(starts-with($num.compte,'2')) and not(starts-with($num.compte,'3')) and not(starts-with($num.compte,'6')) and not(starts-with($num.compte,'7')) and fn:is.link.solde($num.compte)">
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:text disable-output-escaping="yes">xemelios:/customLink?srcDocId=cg-colloc&srcEtatId=BalanceGenerale&srcElementId=PageBalanceGenerale&srcCollectivite=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@Siret"/>
+ <xsl:text disable-output-escaping="yes">&srcBudget=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@CodeBudget"/>
+ <xsl:text disable-output-escaping="yes">&sp1=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@Exercice"/>
+ <xsl:text disable-output-escaping="yes">&numCompte=</xsl:text><xsl:value-of select="$num.compte"/>
+ <xsl:text disable-output-escaping="yes">&montant=</xsl:text><xsl:value-of select="$montant"/>
+ <xsl:text disable-output-escaping="yes">&type=solde</xsl:text>
+ <xsl:text disable-output-escaping="yes">&cg=</xsl:text><xsl:value-of select="$Entete//n:CompteGestion[1]/@V"/>
+ <xsl:if test="string-length($CodRD) > 0"><xsl:text disable-output-escaping="yes">&CodRD=</xsl:text><xsl:value-of select="$CodRD"/></xsl:if>
+ <xsl:if test="$siret.annexe">
+ <xsl:text disable-output-escaping="yes">&BudgetBA=</xsl:text><xsl:value-of select="//n:EnteteBalanceGenerale/@CodeBudgetAnnexe"/>
+ <xsl:text disable-output-escaping="yes">&SiretBA=</xsl:text><xsl:value-of select="$siret.annexe"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><xsl:call-template name="number"><xsl:with-param name="num" select="$montant"/></xsl:call-template></xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="link.montant.totaux">
+ <xsl:param name="num.compte"/>
+ <xsl:param name="montant"/>
+ <xsl:param name="CodRD"/>
+
+ <xsl:choose>
+ <xsl:when test="string-length($num.compte) > 2 and count($liens.comptes/Editions/Comptes[@Edition=$Entete//n:CompteGestion[1]/@V]) > 0">
+ <xsl:choose>
+ <xsl:when test="not(starts-with($num.compte,'1')) and not(starts-with($num.compte,'2')) and not(starts-with($num.compte,'3')) and not(starts-with($num.compte,'6')) and not(starts-with($num.compte,'7')) and fn:is.link.solde($num.compte)">
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:text disable-output-escaping="yes">xemelios:/customLink?srcDocId=cg-colloc&srcEtatId=BalanceGenerale&srcElementId=PageBalanceGenerale&srcCollectivite=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@Siret"/>
+ <xsl:text disable-output-escaping="yes">&srcBudget=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@CodeBudget"/>
+ <xsl:text disable-output-escaping="yes">&sp1=</xsl:text><xsl:value-of select="$Entete//n:Collectivite/@Exercice"/>
+ <xsl:text disable-output-escaping="yes">&numCompte=</xsl:text><xsl:value-of select="$num.compte"/>
+ <xsl:text disable-output-escaping="yes">&montant=</xsl:text><xsl:value-of select="$montant"/>
+ <xsl:text disable-output-escaping="yes">&type=totaux</xsl:text>
+ <xsl:text disable-output-escaping="yes">&cg=</xsl:text><xsl:value-of select="$Entete//n:CompteGestion[1]/@V"/>
+ <xsl:if test="string-length($CodRD) > 0"><xsl:text disable-output-escaping="yes">&CodRD=</xsl:text><xsl:value-of select="$CodRD"/></xsl:if>
+ <xsl:if test="$siret.annexe">
+ <xsl:text disable-output-escaping="yes">&BudgetBA=</xsl:text><xsl:value-of select="//n:EnteteBalanceGenerale/@CodeBudgetAnnexe"/>
+ <xsl:text disable-output-escaping="yes">&SiretBA=</xsl:text><xsl:value-of select="$siret.annexe"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><xsl:call-template name="number"><xsl:with-param name="num" select="$montant"/></xsl:call-template></xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Fonctions -->
+ <xsl:function name="fn:is.link.totaux">
+ <xsl:param name="num.compte"/>
+ <xsl:param name="cod.rd"/>
+ <xsl:choose>
+ <xsl:when test="$cod.rd='D' and count($liens.comptes/Editions/Comptes[@Edition=$Entete//n:CompteGestion[1]/@V]//Compte[@Numero=$num.compte and string-length(@Debit) > 0]) > 0">1</xsl:when>
+ <xsl:when test="$cod.rd='R' and count($liens.comptes/Editions/Comptes[@Edition=$Entete//n:CompteGestion[1]/@V]//Compte[@Numero=$num.compte and string-length(@Credit) > 0]) > 0">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:function>
+
+ <xsl:function name="fn:is.link.solde">
+ <xsl:param name="num.compte"/>
+ <xsl:choose>
+ <xsl:when test="count($liens.comptes/Editions/Comptes[@Edition=$Entete//n:CompteGestion[1]/@V]//Compte[@Numero=$num.compte and string-length(@Solde) > 0]) > 0">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:function>
+</xsl:stylesheet>