Difference between revisions of "Appendix: Operators and functions"

From 1Archive help
Jump to: navigation, search
(Created page with "When creating/editing a link= "Template", you have the possibility to use some operators or functions to automatically fill in a value of a field. <br/...")
 
Line 27: Line 27:
  
 
== List of header field codes and their parameters ==
 
== List of header field codes and their parameters ==
* SUPPCODE
+
<br/>
** CODE
+
<div style="font-size:110%>Usage: #{HEADERFIELD(FIELDCODE, VALUE OF PARAMETER 1, VALUE OF PARAMETER 2)}</div>
** NAME
+
<br/>
* SUPPVATID
+
'''All environments''':
* CUSTCODE
+
 
** CODE
+
{| class="wikitable"
** NAME
+
! style="text-align:left; width:150px"|Fieldcode
* CUSTVATID
+
! style="text-align:left; width:150px"|Parameter 1
* JOURNAL
+
! style="text-align:left; width:150px"|Parameter 2
** CODE
+
! style="text-align:left"|Example usage
** NAME
+
|-
* INVOICENR
+
|SUPPCODE
* INVDATE
+
|CODE
** Dateformat
+
|
** Calculation
+
|#{HEADERFIELD(SUPPCODE,CODE)}
* COMMENT1
+
|-
* OGM
+
|
* NETAMNT
+
|NAME
* VATAMNT
+
|
* TOTAMNT
+
|#{HEADERFIELD(SUPPCODE,NAME)}
* CURRENCY
+
|-
** CODE
+
|SUPPVATID
** NAME
+
|
* YEAR
+
|
** CODE
+
|#{HEADERFIELD(SUPPVATID)}
** NAME
+
|-
* PERIOD
+
|CUSTCODE
** CODE
+
|CODE
** NAME
+
|
 +
|#{HEADERFIELD(CUSTCODE,CODE)}
 +
|-
 +
|
 +
|NAME
 +
|
 +
|#{HEADERFIELD(CUSTCODE,NAME)}
 +
|-
 +
|CUSTVATID
 +
|
 +
|
 +
|#{HEADERFIELD(CUSTVATID)}
 +
|-
 +
|JOURNAL
 +
|CODE
 +
|
 +
|#{HEADERFIELD(JOURNAL,CODE)}
 +
|-
 +
|
 +
|NAME
 +
|
 +
|#{HEADERFIELD(JOURNAL,NAME)}
 +
|-
 +
|INVOICENR
 +
|
 +
|
 +
|#{HEADERFIELD(INVOICENR)}
 +
|-
 +
|INVDATE
 +
|Dateformat
 +
|Calculation
 +
|#{HEADERFIELD(INVDATE,yyyy,+1y)}
 +
|-
 +
|COMMENT1
 +
|
 +
|
 +
|#{HEADERFIELD(COMMENT1)}
 +
|-
 +
|OGM
 +
|
 +
|
 +
|#{HEADERFIELD(OGM)}
 +
|-
 +
|NETAMNT
 +
|
 +
|
 +
|#{HEADERFIELD(NETAMNT)}
 +
|-
 +
|VATAMNT
 +
|
 +
|
 +
|#{HEADERFIELD(VATAMNT)}
 +
|-
 +
|TOTAMNT
 +
|
 +
|
 +
|#{HEADERFIELD(TOTAMNT)}
 +
|-
 +
|CURRENCY
 +
|CODE
 +
|
 +
|#{HEADERFIELD(CURRENCY,CODE)}
 +
|-
 +
|
 +
|NAME
 +
|
 +
|#{HEADERFIELD(CURRENCY,NAME)}
 +
|}
 +
 
 +
'''EIS and OIS specific fields''':
 +
{| class="wikitable"
 +
! style="text-align:left; width:150px"|Fieldcode
 +
! style="text-align:left; width:150px"|Parameter 1
 +
! style="text-align:left; width:150px"|Parameter 2
 +
! style="text-align:left"|Example usage
 +
|-
 +
|PERIOD
 +
|CODE
 +
|
 +
|#{HEADERFIELD(PERIOD,CODE)}
 +
|-
 +
|
 +
|NAME
 +
|
 +
|#{HEADERFIELD(PERIOD,NAME)}
 +
|}
 +
 
 +
'''VIS specific fields''':
 +
{| class="wikitable"
 +
! style="text-align:left; width:150px"|Fieldcode
 +
! style="text-align:left; width:150px"|Parameter 1
 +
! style="text-align:left; width:150px"|Parameter 2
 +
! style="text-align:left"|Example usage
 +
|-
 +
|YEAR
 +
|CODE
 +
|
 +
|#{HEADERFIELD(YEAR,CODE)}
 +
|-
 +
|
 +
|NAME
 +
|
 +
|#{HEADERFIELD(YEAR,NAME)}
 +
|}
  
 
== List of technical field codes and their parameters ==
 
== List of technical field codes and their parameters ==
Line 100: Line 203:
 
* GETQUARTER():
 
* GETQUARTER():
  
== Date formats ==
+
== Dateformats ==
 
Some operators/functions require a date format to be entered as a parameter. This is how those formats should be built:
 
Some operators/functions require a date format to be entered as a parameter. This is how those formats should be built:
 
* '''d''': day
 
* '''d''': day

Revision as of 12:25, 13 January 2017

When creating/editing a Template.png "Template", you have the possibility to use some operators or functions to automatically fill in a value of a field.


Note.png Only text fields can be automatically filled in. These are:
  • Comment on header level
  • Description on posting line level

The operators and functions are always constructed in the same way:

  • Operators: #{OPERATOR(FIELDCODE, PARAMETER1, PARAMETER2)}
  • Functions: #{FUNCTION(PARAMETER)}

Note.png Operators and functions can be used in combination with fixed text.

Info.png The operators that can be used are all header- and technical fields.
There are also some predefined functions available. See below for more details.

For example:
When you receive an invoice from Electrabel every period, you can use an operator (in combination with fixed text) to automatically fill in the Comment field.


Keywords templates.png

This would result in the following:


Keywords templates result.png


Warning.png When an incorrect operator/function is given, an error will occur when the template is applied.

Warning.png The operators/functions are case sensitive, you have to enter the upper case codes of fields (not their name!).

1 List of header field codes and their parameters


Usage: #{HEADERFIELD(FIELDCODE, VALUE OF PARAMETER 1, VALUE OF PARAMETER 2)}


All environments:

Fieldcode Parameter 1 Parameter 2 Example usage
SUPPCODE CODE #{HEADERFIELD(SUPPCODE,CODE)}
NAME #{HEADERFIELD(SUPPCODE,NAME)}
SUPPVATID #{HEADERFIELD(SUPPVATID)}
CUSTCODE CODE #{HEADERFIELD(CUSTCODE,CODE)}
NAME #{HEADERFIELD(CUSTCODE,NAME)}
CUSTVATID #{HEADERFIELD(CUSTVATID)}
JOURNAL CODE #{HEADERFIELD(JOURNAL,CODE)}
NAME #{HEADERFIELD(JOURNAL,NAME)}
INVOICENR #{HEADERFIELD(INVOICENR)}
INVDATE Dateformat Calculation #{HEADERFIELD(INVDATE,yyyy,+1y)}
COMMENT1 #{HEADERFIELD(COMMENT1)}
OGM #{HEADERFIELD(OGM)}
NETAMNT #{HEADERFIELD(NETAMNT)}
VATAMNT #{HEADERFIELD(VATAMNT)}
TOTAMNT #{HEADERFIELD(TOTAMNT)}
CURRENCY CODE #{HEADERFIELD(CURRENCY,CODE)}
NAME #{HEADERFIELD(CURRENCY,NAME)}

EIS and OIS specific fields:

Fieldcode Parameter 1 Parameter 2 Example usage
PERIOD CODE #{HEADERFIELD(PERIOD,CODE)}
NAME #{HEADERFIELD(PERIOD,NAME)}

VIS specific fields:

Fieldcode Parameter 1 Parameter 2 Example usage
YEAR CODE #{HEADERFIELD(YEAR,CODE)}
NAME #{HEADERFIELD(YEAR,NAME)}

2 List of technical field codes and their parameters

  • SCANBATCH
  • SCANUSER
  • SCANNINGDATE
    • Dateformat
    • Calculation
  • INCOMINGDATE
    • Dateformat
    • Calculation

3 List of functions and their parameters

  • COMPANYBARCODE():
  • COMPANYID()
  • COMPANYCODE():
  • COMPANYNAME(): get the name of the company of the document.
  • COMPANYFIELD():
  • DOCUMENTARCHIVEID():
  • DOCUMENTID():
  • DOCUMENTLIST():
  • DOCUMENTTYPECODE():
  • DOCUMENTTYPENAME():
  • RECMETHOD():
  • RECMETHODCODE():
  • SCANBATCHTYPECODE():
  • SCANBATCHTYPENAME():
  • SCANNINGUSERNAME():
  • OPTINPARTNERS():
  • CUSTOMTEXT():
  • ENCRYPT():
  • IF():
  • COUNTER():
  • USERNAME(): get the name of the current user logged in.
  • USERID():
  • USERREALNAME():
  • CURRENTDATE():
  • GETQUARTER():

4 Dateformats

Some operators/functions require a date format to be entered as a parameter. This is how those formats should be built:

  • d: day
  • M: month
  • y: year
  • H: hour
  • m: minutes
  • EOM: end of month
  • BOM: begin of month