--- /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.w3.org/1999/xhtml" xmlns:n="http://www.xemelios.org/namespaces#cge" xmlns:added="http://www.xemelios.org/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: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/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"/>
+
+ <!-- Paramètres d'entrée -->
+ <xsl:param name="show.formulaire"/>
+ <xsl:param name="browser-destination"/>
+
+ <!-- Paramètres Web -->
+ <xsl:param name="is.web">-1</xsl:param>
+ <xsl:param name="context.path"/>
+
+ <!-- Paramètres d'entrée de la liste de résultat -->
+ <xsl:param name="numCompte">0</xsl:param>
+ <xsl:param name="generatedId">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:CompteGestionEtat/n:BalanceGenerale/n:PageBalanceGenerale/n:Pied/@NumPage"/>
+ <xsl:variable name="LastPage" select="/n:CompteGestionEtat/n:BalanceGenerale/n:PageBalanceGenerale/@added:LastPage"/>
+ <xsl:variable name="isLastPage" select="/n:CompteGestionEtat/n:BalanceGenerale/n:PageBalanceGenerale/@added:isLastPage"/>
+ <xsl:variable name="Entete" select="/n:CompteGestionEtat/n:Entete"/>
+
+ <!--xsl:variable name="liens.comptes" select="document('./LiensBalance.xml')"/-->
+ <xsl:variable name="liens.comptes" select="document('./LiensBalanceSuspended.xml')"/>
+
+
+ <!-- pour eviter les sorties parasites de tags non matches -->
+ <xsl:template match="*"/>
+
+ <xsl:template match="/n:CompteGestionEtat">
+ <html>
+ <head>
+ <title>Balance Générale des Comptes</title>
+ <xsl:call-template name="style"/>
+ <!--script language="text/javascript">
+ function scrollTo() {
+ try {
+ document.getElementById("main").scrollTop = document.getElementById("highlighted").offsetTop - document.getElementById("main").offsetTop;
+ } catch (e) {
+ alert("Pb scrollTo !");
+ }
+ }
+ </script-->
+ </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:if test="$error.message='nomessage' and $numCompte!='0'">
+ <xsl:attribute name="onload">javascript:scrollTo();</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-etat</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="LastPage" select="$LastPage"/>
+ <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">Balance Générale des Comptes</xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="mainTable">
+ <xsl:with-param name="el" select="/n:CompteGestionEtat/n:BalanceGenerale/n:PageBalanceGenerale"/>
+ </xsl:call-template>
+ <p>
+ <center>Page <xsl:choose><xsl:when test="$LastPage and string-length($LastPage) > 0"><xsl:value-of select="$NumPage"/> / <xsl:value-of select="$LastPage"/></xsl:when><xsl:otherwise>- <xsl:value-of select="$NumPage"/></xsl:otherwise></xsl:choose></center>
+ </p>
+ <xsl:call-template name="navigate">
+ <xsl:with-param name="docId">cg-etat</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="LastPage" select="$LastPage"/>
+ <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.formulaire.compte" select="1"/>
+ <xsl:with-param name="show.depense.recette" select="0"/>
+ <xsl:with-param name="ancre">#footer</xsl:with-param>
+ <xsl:with-param name="display.logos.entete">0</xsl:with-param>
+ <xsl:with-param name="is.web" select="$is.web"/>
+ <xsl:with-param name="context.path" select="$context.path"/>
+ </xsl:call-template>
+ <p id="footer"/>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="mainTable">
+ <xsl:param name="el"/>
+ <table width="100%" id="main" class="bordered">
+ <colgroup>
+ <col width="40%"/>
+ <col width="4%"/>
+ <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 borderedBold">Balance d'entrée<br/>au 1<sup>er</sup> Janvier</td>
+ <td colspan="2" class="titre bold center borderedBold">Opérations de l'année</td>
+ <td colspan="2" class="titre bold center borderedBold">Opérations de fin d'année<br/>et d'inventaire</td>
+ <td colspan="2" class="titre bold center borderedBold">Balance de sortie<br/>au 31 Décembre</td>
+ </tr>
+ <tr>
+ <td class="titre2 bold center borderedBold">Désignation des Comptes</td>
+ <td class="titre2 bold center borderedBold">Numéro<br/>des<br/>Comptes</td>
+ <td class="titre2 bold center borderedBold">Débit</td>
+ <td class="titre2 bold center borderedBold">Crédit</td>
+ <td class="titre2 bold center borderedBold">Débit</td>
+ <td class="titre2 bold center borderedBold">Crédit</td>
+ <td class="titre2 bold center borderedBold">Débit</td>
+ <td class="titre2 bold center borderedBold">Crédit</td>
+ <td class="titre2 bold center borderedBold">Débit</td>
+ <td class="titre2 bold center borderedBold">Crédit</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="$el/n:LigneBalanceGenerale">
+ <!--xsl:sort select="concat(@NumCompte,string-length(@NumCompte),@added:Padding)" data-type="text" order="ascending"/-->
+ <tr>
+ <xsl:choose>
+ <xsl:when test="$generatedId = '0' and $numCompte != '0' and @NumCompte=$numCompte">
+ <xsl:attribute name="id">highlighted</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$generatedId != '0' and @added:generated-id=$generatedId">
+ <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($el/@LibelleCpte),'total') and (contains(lower-case($el/@LibelleCpte),'compte') or contains(lower-case($el/@LibelleCpte),'classe'))) and not(contains(lower-case(@LibelleCpte),'sous'))">
+ <xsl:attribute name="class">Total</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains(lower-case(@LibelleCpte),'total') and contains(lower-case(@LibelleCpte),'sous')">
+ <xsl:attribute name="class">SousTotal</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise><xsl:attribute name="class">NotTotal</xsl:attribute></xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="contains(lower-case(@LibelleCpte),'total') and contains(lower-case(@LibelleCpte),'sous')">
+ <td class="bold bordureRight"><xsl:attribute name="id">padding<xsl:value-of select="@added:Padding"/></xsl:attribute><xsl:value-of select="@LibelleCpte"/></td>
+ <td class="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="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceEntreeDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceEntreeCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@OperationDebit"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@OperationCredit"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationFinDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationFinCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@BalanceSortieDebit"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceSortieDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@BalanceSortieCredit"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceSortieCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ </xsl:when>
+ <xsl:when test="(contains(lower-case(@LibelleCpte),'total') and (contains(lower-case(@LibelleCpte),'compte') or contains(lower-case(@LibelleCpte),'classe'))) and not(contains(lower-case(@LibelleCpte),'sous'))">
+ <td class="bold bordered"><xsl:attribute name="id">padding<xsl:value-of select="@added:Padding"/></xsl:attribute><xsl:value-of select="@LibelleCpte"/></td>
+ <td class="bold bordered">
+ <!--xsl:call-template name="link.compte.numero">
+ <xsl:with-param name="num.compte" select="normalize-space(@NumCompte)"/>
+ </xsl:call-template-->
+ <xsl:if test="not(number(normalize-space(@NumCompte)) eq 0)"><xsl:value-of select="normalize-space(@NumCompte)"/></xsl:if>
+ </td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceEntreeDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceEntreeCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@OperationDebit"/>
+ <xsl:with-param name="CodRD">D</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@OperationCredit"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationFinDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bold bordered">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationFinCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@BalanceSortieDebit"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceSortieDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@BalanceSortieCredit"/>
+ </xsl:call-template-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceSortieCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td class="bordureRight"><xsl:attribute name="id">padding<xsl:value-of select="@added:Padding"/></xsl:attribute><xsl:value-of select="@LibelleCpte"/></td>
+ <td class="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="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceEntreeDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@BalanceEntreeCredit"/>
+ <xsl:with-param name="hide.zero">1</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="@OperationDebit"/>
+ <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="@OperationCredit"/>
+ <xsl:with-param name="CodRD">R</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationFinDebit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </td>
+ <td class="montant bordureRight">
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="@OperationFinCredit"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </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="@BalanceSortieDebit"/>
+ </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="@BalanceSortieCredit"/>
+ </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"/>
+
+ <!-- Commenter en attendant d'aoir les liens vers les etat du CGE -->
+ <!--xsl:if test="string-length($num.compte) > 2">
+ <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-etat&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:if test="string-length($CodRD) > 0"><xsl:text disable-output-escaping="yes">&CodRD=</xsl:text><xsl:value-of select="$CodRD"/></xsl:if>
+ </xsl:attribute>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ <!--/xsl:otherwise>
+ </xsl:choose>
+ </xsl:if-->
+ </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-etat&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:if test="string-length($num.compte) > 2">
+ <xsl:choose>
+ <xsl:when test="not(starts-with($num.compte,'1')) and not(starts-with($num.compte,'2')) 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-etat&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:CompteGestionEtat/@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:attribute>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ <!--/xsl:otherwise>
+ </xsl:choose>
+ </xsl:if-->
+ </xsl:template>
+
+ <xsl:template name="link.montant.totaux">
+ <xsl:param name="num.compte"/>
+ <xsl:param name="montant"/>
+ <xsl:param name="CodRD"/>
+
+ <!--xsl:if test="string-length($num.compte) > 2">
+ <xsl:choose>
+ <xsl:when test="not(starts-with($num.compte,'1')) and not(starts-with($num.compte,'2')) 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-etat&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:CompteGestionEtat/@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:attribute>
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise-->
+ <xsl:call-template name="number">
+ <xsl:with-param name="num" select="$montant"/>
+ <xsl:with-param name="hide.zero">1</xsl:with-param>
+ </xsl:call-template>
+ <!--/xsl:otherwise>
+ </xsl:choose>
+ </xsl:if-->
+ </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:CompteGestionEtat/@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:CompteGestionEtat/@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:CompteGestionEtat/@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>