Difference between revisions of "Accounting export template Quadratus"

Jump to: navigation, search
m (Created page with "<xml><?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" media-type="text/pl...")
 
Line 1: Line 1:
<xml><?xml version="1.0" encoding="ISO-8859-1"?>
+
<javascript>{
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
  "outputFormat":{
     <xsl:output method="text" media-type="text/plain" indent="no" standalone="yes"
+
    "contentType":"text\/csv",
        omit-xml-declaration="yes" encoding="ISO-8859-1"/>
+
    "charset":"ISO-8859-15",
     <xsl:strip-space elements="*"/>
+
    "filePrefix":"exportQuadratus_",
 
+
     "fileExtension":"txt",
    <xsl:include href="xsl/str.template.xsl"/>
+
    "converter":"ISO"
    <xsl:include href="xsl/formatFunctions.xsl"/>
+
  },
    <xsl:include href="xsl/accountingFormatFunction.xsl"/>
+
  "field":[
 
+
    {
     <!--      Main      -->
+
      "text":"M"
     <xsl:template match="/">
+
     },
        <output-format>
+
    {
            <content_type>text/csv</content_type>
+
      "name":"export_account",
            <charset>ISO-8859-15</charset>
+
      "format":{
            <file_prefix>exportQuatratus_</file_prefix>
+
        "name":"formatText",
            <file_extension>txt</file_extension>
+
        "rightPadding":" ",
            <converter>ISO</converter>
+
        "size":8
         </output-format>
+
      }
        <xsl:apply-templates select="account_entrys/account_entry">
+
     },
            <xsl:sort select="@id" order="ascending" data-type="number"/>
+
     {
         </xsl:apply-templates>
+
      "name":"paper",
    </xsl:template>
+
      "format":{
 
+
        "name":"accountPaper"
     <!--show account line -->
+
      }
     <xsl:template match="account_entry">
+
    },
        <xsl:variable name="flow_id" select="flow_id"/>
+
    {
         <xsl:variable name="accounts"
+
         "text":"000"
            select="/account_entrys/account_entry[flow_id=$flow_id]/account/export_account"/>
+
    },
         <xsl:variable name="line">
+
    {
            <!-- mouvment type on 1 string -->
+
      "name":"account_date",
            <xsl:text>M</xsl:text>
+
      "format":{
           
+
         "name":"formatDate",
            <!-- account number on 8 strings -->
+
        "parameter":[
            <xsl:call-template name="format-text">
+
          "DDMMYY"
                <xsl:with-param name="text" select="account/export_account"/>
+
        ]
                <xsl:with-param name="size" select="8"/>
+
      }
            </xsl:call-template>
+
     },
 
+
     {
            <!-- paper on 2 strings -->
+
      "text":"",
            <xsl:call-template name="choose-paper">
+
      "format":{
                <xsl:with-param name="flowAccounts" select="$accounts"/>
+
        "name":"formatText",
            </xsl:call-template>
+
        "rightPadding":" ",
           
+
         "size":1
            <!-- folio on 3 string default 000 -->
+
      }
            <xsl:text>000</xsl:text>
+
    },
 
+
    {
            <!-- date on 6 strings -->
+
      "text":"",
            <xsl:call-template name="displayDate">
+
      "format":{
                <xsl:with-param name="date">
+
         "name":"formatText",
                    <xsl:call-template name="dateTimeISO">
+
        "rightPadding":" ",
                        <xsl:with-param name="dateTime">
+
        "size":20
                            <xsl:value-of select="converted_account_date"/>
+
      }
                        </xsl:with-param>
+
    },
                    </xsl:call-template>
+
    {
                </xsl:with-param>
+
      "text":"D+",
            </xsl:call-template>
+
      "if":{
 
+
        "leftPart":"debit",
            <!-- Code libellé 1 string -->
+
        "operator":">",
            <xsl:text> </xsl:text>
+
        "rightPart":"0"
 
+
      }
            <!-- label on 20 strings -->
+
    },
            <xsl:text>                    </xsl:text>
+
    {
 
+
      "name":"debit",
            <!-- amount on 13 strings  firt = sign, value in cent -->
+
      "format":{
            <xsl:choose>
+
        "name":"formatNumber",
                <xsl:when test="debit!=0">
+
        "multiplier": 100,
                    <xsl:text>D</xsl:text>      
+
        "parameter":[
                    <xsl:text>+</xsl:text>
+
          "%012.0f"
                    <xsl:value-of select="format-number(debit*100,'000000000000')"/>
+
        ]
                </xsl:when>
+
      },
                <xsl:otherwise>
+
      "if":{
                    <xsl:text>C</xsl:text>
+
        "leftPart":"debit",
                    <xsl:text>+</xsl:text>
+
        "operator":">",
                    <xsl:value-of select="format-number(credit*100,'000000000000')"/> 
+
        "rightPart":"0"
                </xsl:otherwise>
+
      }
            </xsl:choose>
+
    },
 
+
    {
            <!-- account linked 8 strings -->
+
      "text":"C+",
            <xsl:text>        </xsl:text>
+
      "if":{
            <!-- Deadline date 6 strings -->
+
        "leftPart":"debit",
            <xsl:text>      </xsl:text>
+
        "operator":"==",
           
+
        "rightPart":"0"
            <!-- Lettring 2 strings -->
+
      }
            <xsl:text>  </xsl:text>
+
    },
           
+
    {
            <!-- Statistic code 3 strings -->
+
      "name":"credit",
            <xsl:text>  </xsl:text>
+
      "format":{
 
+
        "name":"formatNumber",
            <!-- Document number 5 strings -->
+
        "multiplier": 100,
            <xsl:text>     </xsl:text>
+
        "parameter":[
+
          "%012.0f"
            <!-- entry number 10 strings-->
+
        ]
            <xsl:call-template name="format-text">
+
      },
                <xsl:with-param name="text" select="customer_bill_account_entry/customer_bill_id"/>
+
      "if":{
                <xsl:with-param name="size" select="10"/>
+
        "leftPart":"debit",
            </xsl:call-template>
+
        "operator":"==",
       
+
        "rightPart":"0"
            <!-- Quantity 10 strings -->
+
      }
            <xsl:text>          </xsl:text>
+
     },
           
+
    {
            <!-- accouting document 8 strings  -->
+
      "text":"",
            <xsl:value-of select="format-number($flow_id, '00000000')"/>
+
      "format":{
 
+
        "name":"formatText",
            <!-- currency  3 strings -->
+
        "rightPadding":" ",
            <xsl:text>EUR</xsl:text>
+
        "size":8
 
+
      }
            <!-- paper 3 strings  -->
+
    },
            <xsl:call-template name="format-text">
+
    {
                <xsl:with-param name="text">
+
      "text":"",
                    <xsl:call-template name="choose-paper">
+
      "format":{
                        <xsl:with-param name="flowAccounts" select="$accounts"/>
+
        "name":"formatText",
                    </xsl:call-template>
+
        "rightPadding":" ",
                </xsl:with-param>
+
        "size":6
                <xsl:with-param name="size" select="3"/>
+
      }
            </xsl:call-template>
+
    },
           
+
    {
            <!-- if TVA 3 next fieds-->
+
      "text":"",
            <xsl:choose>
+
      "format":{
                <xsl:when test="account/category=6">
+
        "name":"formatText",
                    <!-- flag TVA 1 string -->
+
        "rightPadding":" ",
                    <xsl:text>O</xsl:text>
+
        "size":2
                    <!-- code TVA  1 string -->
+
      }
                    <xsl:text>1</xsl:text>
+
    },
                    <!-- TVA method 1 string -->                   
+
    {
                    <xsl:text>D</xsl:text>
+
      "text":"",
                </xsl:when>
+
      "format":{
                <xsl:otherwise>
+
        "name":"formatText",
                    <xsl:text>  </xsl:text>
+
        "rightPadding":" ",
                </xsl:otherwise>
+
        "size":3
            </xsl:choose>
+
      }
           
+
    },
            <!-- label on 30 strings -->
+
     {
            <xsl:call-template name="format-text">
+
      "text":"",
                <xsl:with-param name="text">
+
      "format":{
                    <xsl:call-template name="str.characterRemover">
+
        "name":"formatText",
                        <xsl:with-param name="string2Clean">
+
        "rightPadding":" ",
                            <xsl:value-of select="comments"/>
+
        "size":5
                            <xsl:text>&#160;</xsl:text>
+
      }
                            <xsl:value-of select="flight/comments"/>
+
    },
                        </xsl:with-param>
+
    {
                        <xsl:with-param name="character2Remove">
+
      "name":"customer_bill_id",
                            <xsl:text></xsl:text>
+
      "format":{
                        </xsl:with-param>
+
        "name":"formatText",
                    </xsl:call-template>
+
        "rightPadding":" ",
                </xsl:with-param>
+
        "size":10
                <xsl:with-param name="size" select="30"/>
+
      }
            </xsl:call-template>
+
    },
 
+
    {
            <!-- code TVA  2 strings -->
+
      "text":"",
            <xsl:choose>
+
      "format":{
                <xsl:when test="account/category=6">
+
        "name":"formatText",
                    <xsl:text>AF</xsl:text>
+
        "rightPadding":" ",
                </xsl:when>
+
        "size":10
                <xsl:otherwise>
+
      }
                    <xsl:text>  </xsl:text>
+
    },
                </xsl:otherwise>
+
    {
            </xsl:choose>
+
      "name":"flow_id",
           
+
      "format":{
            <!-- account name on 10 strings -->
+
        "name":"formatNumber",
            <xsl:call-template name="accountExportName">
+
        "parameter":[
                <xsl:with-param name="entry" select="account_entry"/>
+
          "%08.0f"
                <xsl:with-param name="size" select="10"/>
+
        ]
            </xsl:call-template>           
+
      }
            <!-- not used on 10 strings -->
+
    },
            <xsl:text>          </xsl:text>
+
    {
           
+
      "text":"EUR"
            <!-- amount currency on 13 strings  with sign-->
+
    },
            <xsl:choose>
+
    {
                <xsl:when test="debit!=0">
+
      "name":"paper",
                    <xsl:text>+</xsl:text>
+
      "format":{
                    <xsl:value-of select="format-number(debit*100,'000000000000')"/>
+
        "name":"accountPaper"
                </xsl:when>
+
      }
                <xsl:otherwise>
+
    },
                    <xsl:text>+</xsl:text>
+
    {
                    <xsl:value-of select="format-number(credit*100,'000000000000')"/> 
+
      "text":"",
                </xsl:otherwise>
+
      "format":{
            </xsl:choose> 
+
        "name":"formatText",
 
+
        "rightPadding":" ",
            <!-- file associated on 12 strings -->
+
        "size":1
            <xsl:text>            </xsl:text>
+
      }
 
+
    },
            <!-- quantiy 2 on 10 strings -->
+
    {
            <xsl:text>          </xsl:text>
+
      "text":"O1D",
           
+
      "if":{
            <!-- export only on 28 strings -->
+
        "leftPart":"account_category",
            <xsl:text>                            </xsl:text>
+
        "operator":"==",
           
+
        "rightPart":"6"
            <xsl:value-of select="$CR"/><xsl:value-of select="$LF"/>
+
      }
        </xsl:variable>
+
    },
         <xsl:value-of select="$line" disable-output-escaping="yes"/>
+
    {
    </xsl:template>
+
      "text":"",
 
+
      "format":{
     <xsl:template name="displayDate">
+
        "name":"formatText",
        <xsl:param name="date"/>
+
        "rightPadding":" ",
         <xsl:value-of select="substring($date,9,2)"/>
+
        "size":3
         <xsl:value-of select="substring($date,6,2)"/>
+
      },
         <xsl:value-of select="substring($date,3,2)"/>
+
      "if":{
     </xsl:template>
+
        "leftPart":"account_category",
 
+
        "operator":"!=",
</xsl:stylesheet></xml>
+
        "rightPart":"6"
 +
      }
 +
    },
 +
    {
 +
      "name":"account_entry_comments",
 +
      "format":{
 +
        "name":"formatText",
 +
        "removeNewLine":true,
 +
        "rightPadding":" ",
 +
        "size":30
 +
      }
 +
    },
 +
    {
 +
      "text":"AF",
 +
      "if":{
 +
        "leftPart":"account_category",
 +
        "operator":"==",
 +
        "rightPart":"6"
 +
      }
 +
    },
 +
    {
 +
      "text":"",
 +
      "format":{
 +
        "name":"formatText",
 +
        "rightPadding":" ",
 +
        "size":2
 +
      },
 +
      "if":{
 +
        "leftPart":"account_category",
 +
        "operator":"!=",
 +
        "rightPart":"6"
 +
      }
 +
    },
 +
    {
 +
      "name":"account_entry_description",
 +
      "format":{
 +
        "name":"formatText",
 +
        "removeNewLine":true,
 +
        "rightPadding":" ",
 +
        "size":10
 +
      }
 +
    },
 +
    {
 +
      "text":"",
 +
      "format":{
 +
        "name":"formatText",
 +
        "rightPadding":" ",
 +
        "size":10
 +
      }
 +
    },
 +
    {
 +
      "text":"+"
 +
    },
 +
    {
 +
      "name":"debit",
 +
      "format":{
 +
        "name":"formatNumber",
 +
        "multiplier":100,
 +
        "parameter":[
 +
          "%012.0f"
 +
        ]
 +
      },
 +
      "if":{
 +
        "leftPart":"debit",
 +
        "operator":">",
 +
        "rightPart":"0"
 +
      }
 +
    },
 +
    {
 +
      "name":"credit",
 +
      "format":{
 +
        "name":"formatNumber",
 +
        "multiplier":100,
 +
        "parameter":[
 +
          "%012.0f"
 +
        ]
 +
      },
 +
      "if":{
 +
        "leftPart":"debit",
 +
        "operator":"==",
 +
        "rightPart":"0"
 +
      }
 +
    },
 +
    {
 +
      "text":"",
 +
      "format":{
 +
         "name":"formatText",
 +
        "rightPadding":" ",
 +
        "size":12
 +
      }
 +
     },
 +
    {
 +
      "text":"",
 +
      "format":{
 +
        "name":"formatText",
 +
         "rightPadding":" ",
 +
        "size":10
 +
      }
 +
    },
 +
    {
 +
      "text":"",
 +
      "format":{
 +
         "name":"formatText",
 +
         "rightPadding":" ",
 +
        "size":28
 +
      }
 +
     }
 +
  ],
 +
  "separator":"",
 +
  "endLine":"\r\n"
 +
}</javascript>

Revision as of 12:39, 2 May 2014

{
  "outputFormat":{
    "contentType":"text\/csv",
    "charset":"ISO-8859-15",
    "filePrefix":"exportQuadratus_",
    "fileExtension":"txt",
    "converter":"ISO"
  },
  "field":[
    {
      "text":"M"
    },
    {
      "name":"export_account",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":8
      }
    },
    {
      "name":"paper",
      "format":{
        "name":"accountPaper"
      }
    },
    {
        "text":"000"
    },
    {
      "name":"account_date",
      "format":{
        "name":"formatDate",
        "parameter":[
          "DDMMYY"
        ]
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":1
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":20
      }
    },
    {
      "text":"D+",
      "if":{
        "leftPart":"debit",
        "operator":">",
        "rightPart":"0"
      }
    },
    {
      "name":"debit",
      "format":{
        "name":"formatNumber",
        "multiplier": 100,
        "parameter":[
          "%012.0f"
        ]
      },
      "if":{
        "leftPart":"debit",
        "operator":">",
        "rightPart":"0"
      }
    },
    {
      "text":"C+",
      "if":{
        "leftPart":"debit",
        "operator":"==",
        "rightPart":"0"
      }
    },
    {
      "name":"credit",
      "format":{
        "name":"formatNumber",
        "multiplier": 100,
        "parameter":[
          "%012.0f"
        ]
      },
      "if":{
        "leftPart":"debit",
        "operator":"==",
        "rightPart":"0"
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":8
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":6
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":2
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":3
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":5
      }
    },
    {
      "name":"customer_bill_id",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":10
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":10
      }
    },
    {
      "name":"flow_id",
      "format":{
        "name":"formatNumber",
        "parameter":[
          "%08.0f"
        ]
      }
    },
    {
      "text":"EUR"
    },
    {
      "name":"paper",
      "format":{
        "name":"accountPaper"
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":1
      }
    },
    {
      "text":"O1D",
      "if":{
        "leftPart":"account_category",
        "operator":"==",
        "rightPart":"6"
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":3
      },
      "if":{
        "leftPart":"account_category",
        "operator":"!=",
        "rightPart":"6"
      }
    },
    {
      "name":"account_entry_comments",
      "format":{
        "name":"formatText",
        "removeNewLine":true,
        "rightPadding":" ",
        "size":30
      }
    },
    {
      "text":"AF",
      "if":{
        "leftPart":"account_category",
        "operator":"==",
        "rightPart":"6"
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":2
      },
      "if":{
        "leftPart":"account_category",
        "operator":"!=",
        "rightPart":"6"
      }
    },
    {
      "name":"account_entry_description",
      "format":{
        "name":"formatText",
        "removeNewLine":true,
        "rightPadding":" ",
        "size":10
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":10
      }
    },
    {
      "text":"+"
    },
    {
      "name":"debit",
      "format":{
        "name":"formatNumber",
        "multiplier":100,
        "parameter":[
          "%012.0f"
        ]
      },
      "if":{
        "leftPart":"debit",
        "operator":">",
        "rightPart":"0"
      }
    },
    {
      "name":"credit",
      "format":{
        "name":"formatNumber",
        "multiplier":100,
        "parameter":[
          "%012.0f"
        ]
      },
      "if":{
        "leftPart":"debit",
        "operator":"==",
        "rightPart":"0"
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":12
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":10
      }
    },
    {
      "text":"",
      "format":{
        "name":"formatText",
        "rightPadding":" ",
        "size":28
      }
    }
  ],
  "separator":"",
  "endLine":"\r\n"
}