Difference between revisions of "Accounting export template Sage"

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" ...")
 
(Output file description)
 
(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 [[Accounting-export-template-list|accounting export template]] Sage.
    <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/formatFunctions.xsl"/>
+
=Output file description=
    <xsl:include href="xsl/accountingFormatFunction.xsl"/>
+
    <xsl:include href="xsl/reportFunction.xsl"/>
+
  
    <!--     Main      -->
+
* Encoding charset: ISO-8859-15
    <xsl:template match="/">
+
* Field character separator: Tab
        <output-format>
+
* First line contains client structure name
            <content_type>text/plain</content_type>
+
* Fields:
            <charset>ISO-8859-15</charset>
+
{| class="wikitable"
            <file_prefix>Import_</file_prefix>
+
!Name!!Length (in character)!!Description
            <file_extension>pnm</file_extension>
+
|-
            <converter>ISOWithHeader</converter>
+
|Export code||||
        </output-format>
+
|-
        <xsl:apply-templates select="account_entrys/account_entry">
+
|||||1 space
            <xsl:sort select="@id" order="ascending" data-type="number"/>
+
|-
        </xsl:apply-templates>
+
|Date||||Format is DDMMYY
    </xsl:template>
+
|-
 +
|||||2 spaces
 +
|-
 +
|Export account||13||Filled with appended spaces to match length
 +
|-
 +
|||||1 space
 +
|-
 +
|||||13 spaces
 +
|-
 +
|id||13||Filled with appended spaces to match length
 +
|-
 +
|Description||25||Filled with appended spaces to match length
 +
|-
 +
|||||1 space
 +
|-
 +
|||||6 spaces
 +
|-
 +
|Character C or D||||C for credit, D for debit
 +
|-
 +
|Amount||20||Number with 20 digits before the decimal separator and 2 digits after
 +
|-
 +
|Character N||||
 +
|-
 +
|Flow id||7||Filled with prepended  zeros to match length
 +
|-
 +
|||||26 spaces
 +
|}
  
    <!--show account line -->
+
=Example of output file=
    <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"/>
+
        <xsl:variable name="line">
+
            <!-- paper 3 strings -->
+
            <xsl:call-template name="choose-paper">
+
                <xsl:with-param name="flowAccounts" select="$accounts"/>
+
            </xsl:call-template>
+
            <xsl:text> </xsl:text>
+
            <!-- date on  6 strings -->
+
            <xsl:call-template name="dateSage">
+
                <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>
+
            <!-- type on 2 strings -->
+
            <xsl:text>  </xsl:text>
+
            <!-- account number on 13 strings -->
+
            <xsl:call-template name="format-text">
+
                <xsl:with-param name="text" select="account/export_account"/>
+
                <xsl:with-param name="size" select="13"/>
+
            </xsl:call-template>
+
            <!-- Account t ype on 1 string -->
+
            <xsl:text> </xsl:text>
+
            <!-- auxillary account on 13 strings -->
+
            <xsl:text>            </xsl:text>
+
            <!-- transaction reference on 13 strings -->
+
            <xsl:call-template name="format-text">
+
                <xsl:with-param name="text" select="@id"/>
+
                <xsl:with-param name="size" select="13"/>
+
            </xsl:call-template>
+
            <!-- transaction name on 25 strings -->
+
            <xsl:call-template name="accountExportName">
+
                <xsl:with-param name="entry" select="account_entry"/>
+
                <xsl:with-param name="size" select="25"/>
+
            </xsl:call-template>
+
            <!-- Paiment mod on 1 string -->
+
            <xsl:text> </xsl:text>
+
            <!-- Due date on 6 strings -->
+
            <xsl:text>      </xsl:text>
+
            <!-- amount on  1 string to write D or C + 20 strings, two digits -->
+
            <xsl:choose>
+
                <xsl:when test="debit!=0">
+
                    <xsl:text>D</xsl:text>
+
                    <xsl:call-template name="replace-zero-head-by-white-space">
+
                        <xsl:with-param name="entry">
+
                            <xsl:value-of select="format-number(debit,'00000000000000000.00')"/>
+
                        </xsl:with-param>
+
                    </xsl:call-template>
+
                </xsl:when>
+
                <xsl:otherwise>
+
                    <xsl:text>C</xsl:text>
+
                    <xsl:call-template name="replace-zero-head-by-white-space">
+
                        <xsl:with-param name="entry">
+
                            <xsl:value-of select="format-number(credit,'00000000000000000.00')"/>
+
                        </xsl:with-param>
+
                    </xsl:call-template>
+
                </xsl:otherwise>
+
            </xsl:choose>
+
            <!-- Transaction type on 1 string -->
+
            <xsl:text>N</xsl:text>
+
            <!-- Entry number on 7 strings -->
+
            <xsl:value-of select="format-number($flow_id, '0000000')"/>
+
            <!-- not used on 26 strings -->
+
            <xsl:text>                          </xsl:text>
+
            <xsl:value-of select="$CR"/><xsl:value-of select="$LF"/>
+
        </xsl:variable>
+
        <xsl:value-of select="$line" disable-output-escaping="yes"/>
+
    </xsl:template>
+
  
</xsl:stylesheet></xml>
+
<pre>demo
 +
VT 010114  411000                    67          Pilote CHRISTIAN CHRISTIA      D              99.00N0000067                         
 +
VT 010114  706BVOI                    68          Solo FBVOI                      C              99.00N0000067                         
 +
VT 010114  411000                    69          Pilote Éléonore ÉLÉONORE        D              51.00N0000069                         
 +
VT 010114  706BVOI                    70          Solo FBVOI                      C              51.00N0000069                         
 +
VT 010114  411000                    71          Pilote Nadine NADINE            D              51.00N0000071                         
 +
VT 010114  706BVOI                    72          Solo FBVOI                      C              51.00N0000071                         
 +
VT 020114  411000                    73          Pilote Éléonore ÉLÉONORE        D              408.00N0000073                         
 +
VT 020114  706BVOI                    74          Solo FBVOI                      C              408.00N0000073                         
 +
VT 030114  411000                    75          Pilote Christophe LARATTE      D              99.00N0000075                         
 +
VT 030114  706BVOI                    76          Solo FBVOI                      C              99.00N0000075                         
 +
VT 030114  411000                    77          Pilote Marie-France MARIE      D              124.00N0000077                         
 +
VT 030114  706BVOI                    78          Solo FBVOI                      C              124.00N0000077                         
 +
VT 050114  411000                    79          Pilote Erwan ERWAN              D              99.00N0000079                         
 +
VT 050114  706BVOI                    80          Solo FBVOI                      C              99.00N0000079                         
 +
VT 010114  411000                    343          Pilote Susie SUSIE              D              159.00N0000343                         
 +
VT 010114  706GNNB                    344          Solo FGNNB                      C              159.00N0000343                         
 +
VT 010114  411000                    459          Pilote Thomas THOMAS            D              138.00N0000459                         
 +
VT 010114  706GIKI                    460          Solo FGIKI                      C              138.00N0000459                         
 +
VT 010114  411000                    461          Pilote firstTest4 lastTes      D              110.00N0000461                         
 +
VT 010114  706GIKI                    462          Solo FGIKI                      C              110.00N0000461                         
 +
VT 010114  411000                    463          Pilote Thomas THOMAS            D              69.00N0000463                         
 +
VT 010114  706GIKI                    464          Solo FGIKI                      C              69.00N0000463                         
 +
VT 010114  411000                    465          Pilote Richard RICHARD          D              207.00N0000465                         
 +
VT 010114  706GIKI                    466          Solo FGIKI                      C              207.00N0000465                         
 +
VT 020114  411000                    467          Pilote Briac BRIAC              D              345.00N0000467                         
 +
VT 020114  706GIKI                    468          Solo FGIKI                      C              345.00N0000467                         
 +
VT 030114  411000                    469          Pilote firstTest5 lastTes      D              138.00N0000469                         
 +
VT 030114  706GIKI                    470          Solo FGIKI                      C              138.00N0000469                         
 +
VT 030114  411000                    471          Pilote firstTest6 lastTes      D              138.00N0000471                         
 +
VT 030114  706GIKI                    472          Solo FGIKI                      C              138.00N0000471                         
 +
VT 050114  411000                    473          Pilote tom TOM                  D              110.00N0000473                         
 +
VT 050114  706GIKI                    474          Solo FGIKI                      C              110.00N0000473                         
 +
</pre>

Latest revision as of 18:04, 15 November 2017

Introduction

This page described the accounting export template Sage.

Output file description

  • Encoding charset: ISO-8859-15
  • Field character separator: Tab
  • First line contains client structure name
  • Fields:
Name Length (in character) Description
Export code
1 space
Date Format is DDMMYY
2 spaces
Export account 13 Filled with appended spaces to match length
1 space
13 spaces
id 13 Filled with appended spaces to match length
Description 25 Filled with appended spaces to match length
1 space
6 spaces
Character C or D C for credit, D for debit
Amount 20 Number with 20 digits before the decimal separator and 2 digits after
Character N
Flow id 7 Filled with prepended zeros to match length
26 spaces

Example of output file

demo
VT 010114  411000                     67           Pilote CHRISTIAN CHRISTIA       D               99.00N0000067                          
VT 010114  706BVOI                    68           Solo FBVOI                      C               99.00N0000067                          
VT 010114  411000                     69           Pilote Éléonore ÉLÉONORE        D               51.00N0000069                          
VT 010114  706BVOI                    70           Solo FBVOI                      C               51.00N0000069                          
VT 010114  411000                     71           Pilote Nadine NADINE            D               51.00N0000071                          
VT 010114  706BVOI                    72           Solo FBVOI                      C               51.00N0000071                          
VT 020114  411000                     73           Pilote Éléonore ÉLÉONORE        D              408.00N0000073                          
VT 020114  706BVOI                    74           Solo FBVOI                      C              408.00N0000073                          
VT 030114  411000                     75           Pilote Christophe LARATTE       D               99.00N0000075                          
VT 030114  706BVOI                    76           Solo FBVOI                      C               99.00N0000075                          
VT 030114  411000                     77           Pilote Marie-France MARIE       D              124.00N0000077                          
VT 030114  706BVOI                    78           Solo FBVOI                      C              124.00N0000077                          
VT 050114  411000                     79           Pilote Erwan ERWAN              D               99.00N0000079                          
VT 050114  706BVOI                    80           Solo FBVOI                      C               99.00N0000079                          
VT 010114  411000                     343          Pilote Susie SUSIE              D              159.00N0000343                          
VT 010114  706GNNB                    344          Solo FGNNB                      C              159.00N0000343                          
VT 010114  411000                     459          Pilote Thomas THOMAS            D              138.00N0000459                          
VT 010114  706GIKI                    460          Solo FGIKI                      C              138.00N0000459                          
VT 010114  411000                     461          Pilote firstTest4 lastTes       D              110.00N0000461                          
VT 010114  706GIKI                    462          Solo FGIKI                      C              110.00N0000461                          
VT 010114  411000                     463          Pilote Thomas THOMAS            D               69.00N0000463                          
VT 010114  706GIKI                    464          Solo FGIKI                      C               69.00N0000463                          
VT 010114  411000                     465          Pilote Richard RICHARD          D              207.00N0000465                          
VT 010114  706GIKI                    466          Solo FGIKI                      C              207.00N0000465                          
VT 020114  411000                     467          Pilote Briac BRIAC              D              345.00N0000467                          
VT 020114  706GIKI                    468          Solo FGIKI                      C              345.00N0000467                          
VT 030114  411000                     469          Pilote firstTest5 lastTes       D              138.00N0000469                          
VT 030114  706GIKI                    470          Solo FGIKI                      C              138.00N0000469                          
VT 030114  411000                     471          Pilote firstTest6 lastTes       D              138.00N0000471                          
VT 030114  706GIKI                    472          Solo FGIKI                      C              138.00N0000471                          
VT 050114  411000                     473          Pilote tom TOM                  D              110.00N0000473                          
VT 050114  706GIKI                    474          Solo FGIKI                      C              110.00N0000473