Difference between revisions of "Accounting export template Ebp"
m (Created page with "<xml><?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" media-type="text/plain" ...") |
(No difference)
|
Revision as of 09:36, 18 September 2012
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" media-type="text/plain" indent="no" standalone="yes" omit-xml-declaration="yes" encoding="ISO-8859-1"/> <xsl:strip-space elements="*"/> <xsl:include href="xsl/str.template.xsl"/> <xsl:include href="xsl/formatFunctions.xsl"/> <xsl:include href="xsl/accountingFormatFunction.xsl"/> <!-- Main --> <xsl:template match="/"> <output-format> <content_type>text/plain</content_type> <charset>cp850</charset> <file_prefix>ecriture_</file_prefix> <file_extension>txt</file_extension> <converter>DOS</converter> </output-format> <xsl:apply-templates select="account_entrys/account_entry"> <xsl:sort select="@id" order="ascending" data-type="number"/> </xsl:apply-templates> </xsl:template> <!--show account line --> <xsl:template match="account_entry"> <xsl:variable name="flow_id" select="flow_id"/> <xsl:variable name="accounts" select="/account_entrys/account_entry[flow_id=$flow_id]/account/export_account"/> <!-- entry number on 5 strings --> <xsl:call-template name="replace-zero-head-by-white-space"> <xsl:with-param name="entry" select="format-number($flow_id, '00000')"/> </xsl:call-template> <xsl:text>,</xsl:text> <!-- date on 8 strings --> <xsl:call-template name="displayDate"> <xsl:with-param name="date"> <xsl:call-template name="dateTimeISO"> <xsl:with-param name="dateTime" select="converted_account_date"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> <xsl:text>,</xsl:text> <!-- paper on 2 strings --> <xsl:call-template name="choose-paper"> <xsl:with-param name="flowAccounts" select="$accounts"/> </xsl:call-template> <xsl:text>,</xsl:text> <!-- account number on 15 strings --> <xsl:call-template name="format-text"> <xsl:with-param name="text" select="account/export_account"/> <xsl:with-param name="size" select="15"/> </xsl:call-template> <xsl:text>,</xsl:text> <!-- label on 2 strings --> <xsl:text>,</xsl:text> <!-- account name on 40 strings --> <xsl:text>"</xsl:text> <xsl:call-template name="accountExportName"> <xsl:with-param name="entry" select="account_entry"/> <xsl:with-param name="size" select="40"/> <xsl:with-param name="forbiddenCharacter"> <xsl:text>,</xsl:text> </xsl:with-param> </xsl:call-template> <xsl:text>"</xsl:text> <xsl:text>,</xsl:text> <!-- Ident number 15 string--> <xsl:text>" ",</xsl:text> <!-- amount on 13 strings + 1 string to write D or C --> <xsl:choose> <xsl:when test="debit!=0"> <xsl:value-of select="format-number(debit,'0000000000.00')"/> <xsl:text>,D</xsl:text> </xsl:when> <xsl:otherwise> <xsl:value-of select="format-number(credit,'0000000000.00')"/> <xsl:text>,C</xsl:text> </xsl:otherwise> </xsl:choose> <xsl:text>,</xsl:text> <!-- deadline --> <xsl:call-template name="displayDate"> <xsl:with-param name="date"> <xsl:call-template name="dateTimeISO"> <xsl:with-param name="dateTime" select="converted_account_date"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> <xsl:text>,</xsl:text> <xsl:value-of select="$LF"/> </xsl:template> <xsl:template name="displayDate"> <xsl:param name="date"/> <xsl:value-of select="substring($date,9,2)"/> <xsl:value-of select="substring($date,6,2)"/> <xsl:value-of select="substring($date,1,4)"/> </xsl:template> </xsl:stylesheet>