Difference between revisions of "Accounting export template CsvDebitCredit"

Jump to: navigation, search
(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]] CSVDebitCredit.
    <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: Tab
        <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||13||Filled with appended spaces to match length
 +
|-
 +
|Description||35||Filled with appended spaces to match length
 +
|-
 +
|Amount||8||Number 2 digits after the decimal separator and filled with prepended zeros to match length
 +
|-
 +
|}
  
    <!--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 CHRISTIAN ;00099.00;
        <xsl:variable name="accounts"
+
000067;VT;20140101;706BVOI;Solo FBVOI ;;00099.00
            select="/account_entrys/account_entry[flow_id=$flow_id]/account/export_account"/>
+
000069;VT;20140101;411000;Pilote Éléonore ÉLÉONORE ;00051.00;
        <!-- entry number on 6 rows -->
+
000069;VT;20140101;706BVOI;Solo FBVOI ;;00051.00
        <xsl:value-of select="format-number($flow_id, '000000')"/>
+
000071;VT;20140101;411000;Pilote Nadine NADINE ;00051.00;
        <xsl:text>;</xsl:text>
+
000071;VT;20140101;706BVOI;Solo FBVOI ;;00051.00
        <!-- paper on 2 rows -->
+
000073;VT;20140102;411000;Pilote Éléonore ÉLÉONORE ;00408.00;
        <xsl:call-template name="choose-paper">
+
000073;VT;20140102;706BVOI;Solo FBVOI ;;00408.00
            <xsl:with-param name="flowAccounts" select="$accounts"/>
+
000075;VT;20140103;411000;Pilote Christophe LARATTE ;00099.00;
        </xsl:call-template>
+
000075;VT;20140103;706BVOI;Solo FBVOI ;;00099.00
        <xsl:text>;</xsl:text>
+
000077;VT;20140103;411000;Pilote Marie-France MARIE-FRANCE ;00124.00;
        <!-- date on 16 rows -->
+
000077;VT;20140103;706BVOI;Solo FBVOI ;;00124.00
        <xsl:call-template name="displayDate">
+
000079;VT;20140105;411000;Pilote Erwan ERWAN ;00099.00;
            <xsl:with-param name="date">
+
000079;VT;20140105;706BVOI;Solo FBVOI ;;00099.00
                <xsl:call-template name="dateTimeISO">
+
000343;VT;20140101;411000;Pilote Susie SUSIE ;00159.00;
                    <xsl:with-param name="dateTime" select="converted_account_date"/>
+
000343;VT;20140101;706GNNB;Solo FGNNB ;;00159.00
                </xsl:call-template>
+
000459;VT;20140101;411000;Pilote Thomas THOMAS ;00138.00;
            </xsl:with-param>
+
000459;VT;20140101;706GIKI;Solo FGIKI ;;00138.00
        </xsl:call-template>
+
000461;VT;20140101;411000;Pilote firstTest4 lastTest4 ;00110.00;
        <xsl:text>;</xsl:text>
+
000461;VT;20140101;706GIKI;Solo FGIKI ;;00110.00
        <!-- type on 12 rows -->
+
000463;VT;20140101;411000;Pilote Thomas THOMAS ;00069.00;
        <xsl:value-of select="account/export_account"/>
+
000463;VT;20140101;706GIKI;Solo FGIKI ;;00069.00
        <!-- account number on 11 rows -->
+
000465;VT;20140101;411000;Pilote Richard RICHARD ;00207.00;
        <xsl:text>;</xsl:text>
+
000465;VT;20140101;706GIKI;Solo FGIKI ;;00207.00
        <!-- account name on 30 rows -->
+
000467;VT;20140102;411000;Pilote Briac BRIAC ;00345.00;
        <xsl:call-template name="accountExportName">
+
000467;VT;20140102;706GIKI;Solo FGIKI ;;00345.00
            <xsl:with-param name="entry" select="account_entry"/>
+
000469;VT;20140103;411000;Pilote firstTest5 lastTest5 ;00138.00;
            <xsl:with-param name="size" select="25"/>
+
000469;VT;20140103;706GIKI;Solo FGIKI ;;00138.00
            <xsl:with-param name="forbiddenCharacter">
+
000471;VT;20140103;411000;Pilote firstTest6 lastTest6 ;00138.00;
                <xsl:text>;</xsl:text>
+
000471;VT;20140103;706GIKI;Solo FGIKI ;;00138.00
            </xsl:with-param>
+
000473;VT;20140105;411000;Pilote tom TOM ;00110.00;
        </xsl:call-template>
+
000473;VT;20140105;706GIKI;Solo FGIKI ;;00110.00
        <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:when>
+
            <xsl:otherwise>
+
                <xsl:text>;</xsl:text>
+
                <xsl:value-of select="format-number(credit,'00000.00')"/>
+
            </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 CSVDebitCredit.

Output file description

  • Encoding charset: UTF-8
  • Field character separator: Tab
  • Fields:
Name Length (in character) Description
Flow number 6 Filled with prepended zeros to match length
Export code
Date Format is YYYYMMDD
Export account 13 Filled with appended spaces to match length
Description 35 Filled with appended spaces to match length
Amount 8 Number 2 digits after the decimal separator and filled with prepended zeros to match length

Example of output file

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