# HG changeset patch
# User Nicolas Chauvat <nicolas.chauvat@logilab.fr>
# Date 1406575521 -7200
# Mon Jul 28 21:25:21 2014 +0200
# Node ID 98e9f170a527ec0c0ccbda5c5d2576a5ba282ef2
# Parent fd4221993d59ff47d33b73f22547ce7ae3640c15
[lib] génère un historique par compte bancaire et non ensemble des comptes 5 (closes #261760)
# User Nicolas Chauvat <nicolas.chauvat@logilab.fr>
# Date 1406575521 -7200
# Mon Jul 28 21:25:21 2014 +0200
# Node ID 98e9f170a527ec0c0ccbda5c5d2576a5ba282ef2
# Parent fd4221993d59ff47d33b73f22547ce7ae3640c15
[lib] génère un historique par compte bancaire et non ensemble des comptes 5 (closes #261760)
@@ -88,11 +88,13 @@
1 visitors.write_journal(file(JP+'xml','w'), compta.paye.journal, debut, fin) 2 visitors.write_grand_livre(file(GP+'xml','w'), compta.paye.glivre, debut, fin) 3 visitors.write_balance(file(BP+'xml','w'), compta.paye.balance, debut, fin) 4 visitors.write_journal(file(BJ+'xml','w'), compta.banque_journal, debut, fin) 5 visitors.write_grand_livre(file(BG+'xml','w'), compta.banque_glivre, debut, fin) 6 - visitors.write_historique_comptes(file(CT+'xml','w'), compta.glivre, debut, fin, '5') 7 + for num, cpt in compta.glivre.get_comptes('5'): 8 + fname = CT.replace('.compte.', '.%s.compte.'%num) 9 + visitors.write_historique_comptes(file(fname+'xml','w'), compta.glivre, debut, fin, cpt.num) 10 visitors.write_historique_comptes(file(CP+'xml','w'), compta.glivre, debut, fin, '7') 11 12 13 def compute_analytique(config, compta, compta_prev) : 14 dates_recap = compta.get_dates()
@@ -229,15 +231,25 @@
15 def write_html(config, compta, date_ext, debut, fin): 16 """ 17 Ecrit tout en html 18 """ 19 params = get_params(config) 20 + # plan comptable 21 + xslt(config.destpath('plan-comptable.xml'), 'plan-comptable2html.xsl', 22 + config.destpath('plan-comptable.html'), params) 23 + # tout sauf tresorerie 24 cibles = compta.get_cibles() 25 for chemin, type_ in config.get_chemins(cibles, date_ext): 26 - xslt(chemin+'xml', HTML_XSL[type_], chemin+'html', params) 27 - xslt(config.destpath('plan-comptable.xml'), 'plan-comptable2html.xsl', 28 - config.destpath('plan-comptable.html'), params) 29 + if 'tresorerie' not in chemin: 30 + xslt(chemin+'xml', HTML_XSL[type_], chemin+'html', params) 31 + # tresorerie 32 + for num, cpt in compta.glivre.get_comptes('5'): 33 + xslt(config.destpath('tresorerie.%s.compte.xml' % num), 'compte2html.xsl', 34 + config.destpath('tresorerie.%s.compte.html' % num), params) 35 + for num, cpt in compta.glivre.get_comptes('5'): 36 + xslt(config.destpath('tresorerie.%s.compte.prev.xml' % num), 'compte2html.xsl', 37 + config.destpath('tresorerie.%s.compte.prev.html' % num), params) 38 39 FO_XSL = {'journal':'journal2fo.xsl', 40 'grand-livre': 'grand-livre2fo.xsl', 41 'balance': 'balance2fo.xsl', 42 'compte-resultat': 'compte-resultat-1col2fo.xsl',
@@ -335,7 +335,12 @@
43 out.write(ENTETE) 44 out.write('<pilote>\n<previsions>\n') 45 _write_pilote(out, compta_prev, dates_prev) 46 out.write('\n</previsions>\n<recapitulatif>\n') 47 _write_pilote(out, compta, dates_recap) 48 - out.write('\n</recapitulatif>\n</pilote>\n') 49 + out.write('\n</recapitulatif>\n') 50 + out.write('<tresorerie>') 51 + for num, cpt in compta.glivre.get_comptes('5'): 52 + out.write('<compte num="%s"/>' % num) 53 + out.write('</tresorerie>\n') 54 + out.write('</pilote>\n') 55
@@ -111,10 +111,12 @@
56 57 </table> 58 59 <p><a href="plan-comptable.html">Plan Comptable</a> - Compta Analytique : <a href="analytique/grand-livre.html">Grand Livre</a> - <a href="analytique/balance.html">Balance</a></p> 60 61 +<p>Tr�sorerie : <xsl:apply-templates select="pilote/tresorerie/compte"/> </p> 62 + 63 <h2>Graphiques</h2> 64 65 <!-- 66 <p align="center"><img border="1" src="comptes.png"/></p> 67 <p align="center"><img border="1" src="tresorerie.png"/></p>
@@ -220,6 +222,13 @@
68 - 69 <a><xsl:attribute name="href">banque.glivre.<xsl:value-of select="@annee"/>-<xsl:if test="@mois < 10">0</xsl:if><xsl:value-of select="@mois"/>.html</xsl:attribute>GL</a></td> 70 </tr> 71 </xsl:template> 72 73 +<xsl:template match="compte"> 74 + 75 +<a><xsl:attribute name="href">tresorerie.<xsl:value-of select="@num"/>.compte.prev.html</xsl:attribute><xsl:value-of select="@num"/></a> 76 +<xsl:text> - </xsl:text> 77 + 78 +</xsl:template> 79 + 80 </xsl:stylesheet>