Difference between revisions of "Accounting export template Csv"

Jump to: navigation, search
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" ...")
 
m (Text replacement - "[[Accounting_export_template_list|" to "[[Accounting-export-template-list|")
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<xml><?xml version="1.0" encoding="UTF-8"?>
+
=Introduction=
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
This page described the generic [[Accounting-export-template-list|accounting export template]] CSV.
    <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"/>
+
=Output file description=
    <xsl:include href="xsl/formatFunctions.xsl"/>
+
    <xsl:include href="xsl/accountingFormatFunction.xsl"/>
+
  
    <!--      Main      -->
+
* Encoding charset: UTF-8
    <xsl:template match="/">
+
* Field character separator: ;
        <output-format>
+
* Fields:
            <content_type>text/csv</content_type>
+
{| class="wikitable"
            <charset>UTF-8</charset>
+
!Name!!Length (in character)!!Description
            <file_prefix>accountancy_</file_prefix>
+
|-
            <file_extension>csv</file_extension>
+
|Flow number||6||Filled with prepended zeros to match length
            <converter>Default</converter>
+
|-
        </output-format>
+
|Export code||||
        <xsl:apply-templates select="account_entrys/account_entry">
+
|-
            <xsl:sort select="@data_date" order="ascending" data-type="text"/>
+
|Date||||Format is YYYYMMDD
        </xsl:apply-templates>
+
|-
    </xsl:template>
+
|Export account||||
 +
|-
 +
|Description||25||Filled with appended spaces to match length
 +
|-
 +
|Amount||8||Number with 2 digits after the decimal separator and filled with prepended zeros to match length
 +
|-
 +
|Character C or D||||C for credit, D for debit
 +
|-
 +
|}
  
    <!--show account line -->
+
=Example of output file=
    <xsl:template match="account_entry">
+
 
        <xsl:variable name="flow_id" select="flow_id"/>
+
<pre>000067;VT;20140101;411000;Pilote CHRISTIAN CHRISTIA;00099.00;D
        <xsl:variable name="accounts"
+
000067;VT;20140101;706BVOI;Solo FBVOI              ;00099.00;C
            select="/account_entrys/account_entry[flow_id=$flow_id]/account/export_account"/>
+
000069;VT;20140101;411000;Pilote Éléonore ÉLÉONORE ;00051.00;D
        <!-- entry number on 6 rows -->
+
000069;VT;20140101;706BVOI;Solo FBVOI              ;00051.00;C
        <xsl:value-of select="format-number($flow_id, '000000')"/>
+
000071;VT;20140101;411000;Pilote Nadine NADINE    ;00051.00;D
        <xsl:text>;</xsl:text>
+
000071;VT;20140101;706BVOI;Solo FBVOI              ;00051.00;C
        <!-- paper on 2 rows -->
+
000073;VT;20140102;411000;Pilote Éléonore ÉLÉONORE ;00408.00;D
        <xsl:call-template name="choose-paper">
+
000073;VT;20140102;706BVOI;Solo FBVOI              ;00408.00;C
            <xsl:with-param name="flowAccounts" select="$accounts"/>
+
000075;VT;20140103;411000;Pilote Christophe LARATTE;00099.00;D
        </xsl:call-template>
+
000075;VT;20140103;706BVOI;Solo FBVOI              ;00099.00;C
        <xsl:text>;</xsl:text>
+
000077;VT;20140103;411000;Pilote Marie-France MARIE;00124.00;D
        <!-- date on 16 rows -->
+
000077;VT;20140103;706BVOI;Solo FBVOI              ;00124.00;C
        <xsl:call-template name="displayDate">
+
000079;VT;20140105;411000;Pilote Erwan ERWAN      ;00099.00;D
            <xsl:with-param name="date">
+
000079;VT;20140105;706BVOI;Solo FBVOI              ;00099.00;C
                <xsl:call-template name="dateTimeISO">
+
000343;VT;20140101;411000;Pilote Susie SUSIE      ;00159.00;D
                    <xsl:with-param name="dateTime" select="converted_account_date"/>
+
000343;VT;20140101;706GNNB;Solo FGNNB              ;00159.00;C
                </xsl:call-template>
+
000459;VT;20140101;411000;Pilote Thomas THOMAS    ;00138.00;D
            </xsl:with-param>
+
000459;VT;20140101;706GIKI;Solo FGIKI              ;00138.00;C
        </xsl:call-template>
+
000461;VT;20140101;411000;Pilote firstTest4 lastTes;00110.00;D
        <xsl:text>;</xsl:text>
+
000461;VT;20140101;706GIKI;Solo FGIKI              ;00110.00;C
        <!-- type on 12 rows -->
+
000463;VT;20140101;411000;Pilote Thomas THOMAS    ;00069.00;D
        <xsl:value-of select="account/export_account"/>
+
000463;VT;20140101;706GIKI;Solo FGIKI              ;00069.00;C
        <!-- account number on 11 rows -->
+
000465;VT;20140101;411000;Pilote Richard RICHARD  ;00207.00;D
        <xsl:text>;</xsl:text>
+
000465;VT;20140101;706GIKI;Solo FGIKI              ;00207.00;C
        <!-- account name on 30 rows -->
+
000467;VT;20140102;411000;Pilote Briac BRIAC      ;00345.00;D
        <xsl:call-template name="accountExportName">
+
000467;VT;20140102;706GIKI;Solo FGIKI              ;00345.00;C
            <xsl:with-param name="entry" select="account_entry"/>
+
000469;VT;20140103;411000;Pilote firstTest5 lastTes;00138.00;D
            <xsl:with-param name="size" select="25"/>
+
000469;VT;20140103;706GIKI;Solo FGIKI              ;00138.00;C
            <xsl:with-param name="forbiddenCharacter">
+
000471;VT;20140103;411000;Pilote firstTest6 lastTes;00138.00;D
                <xsl:text>;</xsl:text>
+
000471;VT;20140103;706GIKI;Solo FGIKI              ;00138.00;C
            </xsl:with-param>
+
000473;VT;20140105;411000;Pilote tom TOM          ;00110.00;D
        </xsl:call-template>
+
000473;VT;20140105;706GIKI;Solo FGIKI              ;00110.00;C
        <xsl:text>;</xsl:text>
+
</pre>
        <!-- amount on 8 rows + 1 ROW to say D or C -->
+
        <xsl:choose>
+
            <xsl:when test="debit!=0">
+
                <xsl:value-of select="format-number(debit,'00000.00')"/>
+
                <xsl:text>;</xsl:text>
+
                <xsl:text>D</xsl:text>
+
            </xsl:when>
+
            <xsl:otherwise>
+
                <xsl:value-of select="format-number(credit,'00000.00')"/>
+
                <xsl:text>;</xsl:text>
+
                <xsl:text>C</xsl:text>
+
            </xsl:otherwise>
+
        </xsl:choose>
+
        <xsl:value-of select="$LF"/>
+
    </xsl:template>
+
   
+
    <xsl:template name="displayDate">
+
        <xsl:param name="date"/>
+
        <xsl:value-of select="substring($date,1,4)"/>
+
        <xsl:value-of select="substring($date,6,2)"/>
+
        <xsl:value-of select="substring($date,9,2)"/>
+
    </xsl:template>
+
+
</xsl:stylesheet></xml>
+

Latest revision as of 11:13, 18 July 2016

Introduction

This page described the generic accounting export template CSV.

Output file description

  • Encoding charset: UTF-8
  • Field character separator: ;
  • Fields:
Name Length (in character) Description
Flow number 6 Filled with prepended zeros to match length
Export code
Date Format is YYYYMMDD
Export account
Description 25 Filled with appended spaces to match length
Amount 8 Number with 2 digits after the decimal separator and filled with prepended zeros to match length
Character C or D C for credit, D for debit

Example of output file

000067;VT;20140101;411000;Pilote CHRISTIAN CHRISTIA;00099.00;D
000067;VT;20140101;706BVOI;Solo FBVOI               ;00099.00;C
000069;VT;20140101;411000;Pilote Éléonore ÉLÉONORE ;00051.00;D
000069;VT;20140101;706BVOI;Solo FBVOI               ;00051.00;C
000071;VT;20140101;411000;Pilote Nadine NADINE     ;00051.00;D
000071;VT;20140101;706BVOI;Solo FBVOI               ;00051.00;C
000073;VT;20140102;411000;Pilote Éléonore ÉLÉONORE ;00408.00;D
000073;VT;20140102;706BVOI;Solo FBVOI               ;00408.00;C
000075;VT;20140103;411000;Pilote Christophe LARATTE;00099.00;D
000075;VT;20140103;706BVOI;Solo FBVOI               ;00099.00;C
000077;VT;20140103;411000;Pilote Marie-France MARIE;00124.00;D
000077;VT;20140103;706BVOI;Solo FBVOI               ;00124.00;C
000079;VT;20140105;411000;Pilote Erwan ERWAN       ;00099.00;D
000079;VT;20140105;706BVOI;Solo FBVOI               ;00099.00;C
000343;VT;20140101;411000;Pilote Susie SUSIE       ;00159.00;D
000343;VT;20140101;706GNNB;Solo FGNNB               ;00159.00;C
000459;VT;20140101;411000;Pilote Thomas THOMAS     ;00138.00;D
000459;VT;20140101;706GIKI;Solo FGIKI               ;00138.00;C
000461;VT;20140101;411000;Pilote firstTest4 lastTes;00110.00;D
000461;VT;20140101;706GIKI;Solo FGIKI               ;00110.00;C
000463;VT;20140101;411000;Pilote Thomas THOMAS     ;00069.00;D
000463;VT;20140101;706GIKI;Solo FGIKI               ;00069.00;C
000465;VT;20140101;411000;Pilote Richard RICHARD   ;00207.00;D
000465;VT;20140101;706GIKI;Solo FGIKI               ;00207.00;C
000467;VT;20140102;411000;Pilote Briac BRIAC       ;00345.00;D
000467;VT;20140102;706GIKI;Solo FGIKI               ;00345.00;C
000469;VT;20140103;411000;Pilote firstTest5 lastTes;00138.00;D
000469;VT;20140103;706GIKI;Solo FGIKI               ;00138.00;C
000471;VT;20140103;411000;Pilote firstTest6 lastTes;00138.00;D
000471;VT;20140103;706GIKI;Solo FGIKI               ;00138.00;C
000473;VT;20140105;411000;Pilote tom TOM           ;00110.00;D
000473;VT;20140105;706GIKI;Solo FGIKI               ;00110.00;C