Difference between revisions of "Appendix: Operators and functions"
From 1Archive help
(4 intermediate revisions by 2 users not shown) | |||
Line 28: | Line 28: | ||
== List of header field codes and their parameters == | == List of header field codes and their parameters == | ||
<br/> | <br/> | ||
− | <div style="font-size:110%>Usage: #{HEADERFIELD(FIELDCODE, | + | <div style="font-size:110%>Usage: #{HEADERFIELD(FIELDCODE, PARAMETER 1, PARAMETER 2)}</div> |
<br/> | <br/> | ||
'''All environments''': | '''All environments''': | ||
{| class="wikitable" | {| class="wikitable" | ||
+ | ! style="text-align:left; width:150px"|Fieldname | ||
! style="text-align:left; width:150px"|Fieldcode | ! style="text-align:left; width:150px"|Fieldcode | ||
! style="text-align:left; width:150px"|Parameter 1 | ! style="text-align:left; width:150px"|Parameter 1 | ||
Line 38: | Line 39: | ||
! style="text-align:left"|Example usage | ! style="text-align:left"|Example usage | ||
|- | |- | ||
+ | |Supplier | ||
|SUPPCODE | |SUPPCODE | ||
|CODE | |CODE | ||
Line 43: | Line 45: | ||
|#{HEADERFIELD(SUPPCODE,CODE)} | |#{HEADERFIELD(SUPPCODE,CODE)} | ||
|- | |- | ||
+ | | | ||
| | | | ||
|NAME | |NAME | ||
Line 48: | Line 51: | ||
|#{HEADERFIELD(SUPPCODE,NAME)} | |#{HEADERFIELD(SUPPCODE,NAME)} | ||
|- | |- | ||
− | | | + | |Customer |
− | |||
− | |||
− | |||
− | |||
|CUSTCODE | |CUSTCODE | ||
|CODE | |CODE | ||
Line 58: | Line 57: | ||
|#{HEADERFIELD(CUSTCODE,CODE)} | |#{HEADERFIELD(CUSTCODE,CODE)} | ||
|- | |- | ||
+ | | | ||
| | | | ||
|NAME | |NAME | ||
Line 63: | Line 63: | ||
|#{HEADERFIELD(CUSTCODE,NAME)} | |#{HEADERFIELD(CUSTCODE,NAME)} | ||
|- | |- | ||
+ | | | ||
|CUSTVATID | |CUSTVATID | ||
| | | | ||
Line 68: | Line 69: | ||
|#{HEADERFIELD(CUSTVATID)} | |#{HEADERFIELD(CUSTVATID)} | ||
|- | |- | ||
+ | |Journal | ||
|JOURNAL | |JOURNAL | ||
|CODE | |CODE | ||
Line 73: | Line 75: | ||
|#{HEADERFIELD(JOURNAL,CODE)} | |#{HEADERFIELD(JOURNAL,CODE)} | ||
|- | |- | ||
+ | | | ||
| | | | ||
|NAME | |NAME | ||
Line 78: | Line 81: | ||
|#{HEADERFIELD(JOURNAL,NAME)} | |#{HEADERFIELD(JOURNAL,NAME)} | ||
|- | |- | ||
− | | | + | |Invoice date |
− | |||
− | |||
− | |||
− | |||
|INVDATE | |INVDATE | ||
|Dateformat | |Dateformat | ||
Line 88: | Line 87: | ||
|#{HEADERFIELD(INVDATE,yyyy,+1y)} | |#{HEADERFIELD(INVDATE,yyyy,+1y)} | ||
|- | |- | ||
+ | |Comment | ||
|COMMENT1 | |COMMENT1 | ||
| | | | ||
Line 93: | Line 93: | ||
|#{HEADERFIELD(COMMENT1)} | |#{HEADERFIELD(COMMENT1)} | ||
|- | |- | ||
+ | |OGM | ||
|OGM | |OGM | ||
| | | | ||
Line 98: | Line 99: | ||
|#{HEADERFIELD(OGM)} | |#{HEADERFIELD(OGM)} | ||
|- | |- | ||
+ | |Net amount | ||
|NETAMNT | |NETAMNT | ||
| | | | ||
Line 103: | Line 105: | ||
|#{HEADERFIELD(NETAMNT)} | |#{HEADERFIELD(NETAMNT)} | ||
|- | |- | ||
+ | |VAT amount | ||
|VATAMNT | |VATAMNT | ||
| | | | ||
Line 108: | Line 111: | ||
|#{HEADERFIELD(VATAMNT)} | |#{HEADERFIELD(VATAMNT)} | ||
|- | |- | ||
+ | |Total amount | ||
|TOTAMNT | |TOTAMNT | ||
| | | | ||
Line 113: | Line 117: | ||
|#{HEADERFIELD(TOTAMNT)} | |#{HEADERFIELD(TOTAMNT)} | ||
|- | |- | ||
+ | |Currency | ||
|CURRENCY | |CURRENCY | ||
|CODE | |CODE | ||
Line 118: | Line 123: | ||
|#{HEADERFIELD(CURRENCY,CODE)} | |#{HEADERFIELD(CURRENCY,CODE)} | ||
|- | |- | ||
+ | | | ||
| | | | ||
|NAME | |NAME | ||
| | | | ||
|#{HEADERFIELD(CURRENCY,NAME)} | |#{HEADERFIELD(CURRENCY,NAME)} | ||
+ | |- | ||
+ | |Invoice number | ||
+ | |INVNR | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(INVNR)} | ||
+ | |- | ||
+ | |Invoice type | ||
+ | |INVTYPE | ||
+ | |CODE | ||
+ | | | ||
+ | |#{HEADERFIELD(INVTYPE,CODE)} | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |NAME | ||
+ | | | ||
+ | |#{HEADERFIELD(INVTYPE,NAME)} | ||
+ | |- | ||
+ | |Payment term | ||
+ | |PAYMENTTERM | ||
+ | |CODE | ||
+ | | | ||
+ | |#{HEADERFIELD(PAYMENTTERM,CODE)} | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |NAME | ||
+ | | | ||
+ | |#{HEADERFIELD(PAYMENTTERM,NAME)} | ||
+ | |- | ||
+ | |Due date | ||
+ | |INVDUEDATE | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(INVDUEDATE)} | ||
+ | |- | ||
+ | |Voucher number | ||
+ | |VOUCHERNR | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(VOUCHERNR)} | ||
+ | |- | ||
+ | |Paid amount | ||
+ | |PAIDAMOUNT | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(PAIDAMOUNT)} | ||
+ | |- | ||
+ | |Payment method | ||
+ | |PAYMENT_METHOD | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(PAYMENT_METHOD)} | ||
+ | |- | ||
+ | |Paid date | ||
+ | |PAIDDATE | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(PAIDDATE)} | ||
+ | |- | ||
+ | |Payment status | ||
+ | |PAYMENT_STATUS | ||
+ | |CODE | ||
+ | | | ||
+ | |#{HEADERFIELD(PAYMENT_STATUS,CODE)} | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |NAME | ||
+ | | | ||
+ | |#{HEADERFIELD(PAYMENT_STATUS,NAME)} | ||
|} | |} | ||
− | + | <br/> | |
'''EIS and OIS specific fields''': | '''EIS and OIS specific fields''': | ||
{| class="wikitable" | {| class="wikitable" | ||
+ | ! style="text-align:left; width:150px"|Fieldname | ||
! style="text-align:left; width:150px"|Fieldcode | ! style="text-align:left; width:150px"|Fieldcode | ||
! style="text-align:left; width:150px"|Parameter 1 | ! style="text-align:left; width:150px"|Parameter 1 | ||
Line 131: | Line 210: | ||
! style="text-align:left"|Example usage | ! style="text-align:left"|Example usage | ||
|- | |- | ||
+ | |Period | ||
|PERIOD | |PERIOD | ||
|CODE | |CODE | ||
Line 136: | Line 216: | ||
|#{HEADERFIELD(PERIOD,CODE)} | |#{HEADERFIELD(PERIOD,CODE)} | ||
|- | |- | ||
+ | | | ||
| | | | ||
|NAME | |NAME | ||
| | | | ||
|#{HEADERFIELD(PERIOD,NAME)} | |#{HEADERFIELD(PERIOD,NAME)} | ||
+ | |- | ||
+ | |VAT ID | ||
+ | |VATID | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(VATID)} | ||
|} | |} | ||
+ | |||
+ | <br/>{{note|The ''"VATID"'' field is the VAT ID of the supplier, not your own VAT ID.}}<br/> | ||
'''VIS specific fields''': | '''VIS specific fields''': | ||
{| class="wikitable" | {| class="wikitable" | ||
+ | ! style="text-align:left; width:150px"|Fieldname | ||
! style="text-align:left; width:150px"|Fieldcode | ! style="text-align:left; width:150px"|Fieldcode | ||
! style="text-align:left; width:150px"|Parameter 1 | ! style="text-align:left; width:150px"|Parameter 1 | ||
Line 149: | Line 239: | ||
! style="text-align:left"|Example usage | ! style="text-align:left"|Example usage | ||
|- | |- | ||
+ | |Bookyear | ||
|YEAR | |YEAR | ||
|CODE | |CODE | ||
Line 154: | Line 245: | ||
|#{HEADERFIELD(YEAR,CODE)} | |#{HEADERFIELD(YEAR,CODE)} | ||
|- | |- | ||
+ | | | ||
| | | | ||
|NAME | |NAME | ||
| | | | ||
|#{HEADERFIELD(YEAR,NAME)} | |#{HEADERFIELD(YEAR,NAME)} | ||
+ | |- | ||
+ | |Supplier VAT | ||
+ | |SUPPVATID | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(SUPPVATID)} | ||
+ | |- | ||
+ | |Voucher date | ||
+ | |VOUCHERDATE | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(VOUCHERDATE)} | ||
+ | |} | ||
+ | <br/> | ||
+ | |||
+ | '''Connected specific fields''': | ||
+ | {| class="wikitable" | ||
+ | ! style="text-align:left; width:150px"|Fieldname | ||
+ | ! 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 | ||
+ | |PERIOD | ||
+ | |CODE | ||
+ | | | ||
+ | |#{HEADERFIELD(PERIOD,CODE)} | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |NAME | ||
+ | | | ||
+ | |#{HEADERFIELD(PERIOD,NAME)} | ||
+ | |- | ||
+ | |Voucher date | ||
+ | |VOUCHERDATE | ||
+ | | | ||
+ | | | ||
+ | |#{HEADERFIELD(VOUCHERDATE)} | ||
|} | |} | ||
== List of technical field codes and their parameters == | == List of technical field codes and their parameters == | ||
− | + | <br/> | |
− | + | <div style="font-size:110%>Usage: #{TECHNICALFIELD(FIELDCODE, PARAMETER 1, PARAMETER 2)}</div> | |
− | + | <br/> | |
− | + | '''All environments''' | |
− | + | {| class="wikitable" | |
− | + | ! style="text-align:left; width:150px"|Fieldname | |
− | + | ! 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 | ||
+ | |- | ||
+ | |Scan user | ||
+ | |SCANUSER | ||
+ | | | ||
+ | | | ||
+ | |#{TECHNICALFIELD(SCANUSER)} | ||
+ | |- | ||
+ | |Scan batch | ||
+ | |SCANBATCH | ||
+ | | | ||
+ | | | ||
+ | |#{TECHNICALFIELD(SCANBATCH)} | ||
+ | |- | ||
+ | |Scanning date | ||
+ | |SCANNINGDATE | ||
+ | | | ||
+ | | | ||
+ | |#{TECHNICALFIELD(SCANNINGDATE)} | ||
+ | |- | ||
+ | |Incoming date | ||
+ | |INCOMINGDATE | ||
+ | |Dateformat | ||
+ | |Calculation | ||
+ | |#{TECHNICALFIELD(INCOMINGDATE)} | ||
+ | |- | ||
+ | |Accountant | ||
+ | |ACOUNTANT | ||
+ | |Dateformat | ||
+ | |Calculation | ||
+ | |#{TECHNICALFIELD(ACCOUNTANT)} | ||
+ | |- | ||
+ | |Cancel reason | ||
+ | |CANCELREASON | ||
+ | |CODE | ||
+ | | | ||
+ | |#{TECHNICALFIELD(CANCELREASON,CODE)} | ||
+ | |- | ||
+ | | | ||
+ | | | ||
+ | |NAME | ||
+ | | | ||
+ | |#{TECHNICALFIELD(CANCELREASON,NAME)} | ||
+ | |- | ||
+ | |Booking date/Sent to Venice date | ||
+ | |BOOKINGDATE | ||
+ | | | ||
+ | | | ||
+ | |#{TECHNICALFIELD(BOOKINGDATE)} | ||
+ | |} | ||
+ | |||
+ | == List of company field codes and their parameters == | ||
+ | <br/> | ||
+ | <div style="font-size:110%>Usage: #{COMPANYFIELD(FIELDCODE)}</div> | ||
+ | <br/> | ||
== List of functions and their parameters == | == List of functions and their parameters == | ||
− | * COMPANYBARCODE(): | + | * COMPANYBARCODE(): get the barcode of the company of the document. |
− | * COMPANYID() | + | * COMPANYID(): get the ID of the company of the document. |
− | * COMPANYCODE(): | + | * COMPANYCODE(): get the code of the company of the document. |
* COMPANYNAME(): get the name of the company of the document. | * COMPANYNAME(): get the name of the company of the document. | ||
− | |||
− | * DOCUMENTARCHIVEID(): | + | * DOCUMENTARCHIVEID(): get the ID of the document as it is seen in the archive view. |
− | * DOCUMENTID(): | + | * DOCUMENTID(): when a document has another ID (in an external package for example), get that ID. |
* DOCUMENTLIST(): | * DOCUMENTLIST(): | ||
− | * DOCUMENTTYPECODE(): | + | * DOCUMENTTYPECODE(): get the code of the type of the document. |
− | * DOCUMENTTYPENAME(): | + | * DOCUMENTTYPENAME(): get the name of the type of the document. |
− | * RECMETHOD(): | + | * RECMETHOD(): get the name of the reception method of the document. |
− | * RECMETHODCODE(): | + | * RECMETHODCODE(): get the code of the reception method of the document. |
− | * SCANBATCHTYPECODE(): | + | * SCANBATCHTYPECODE(): get the code of the type of the scanbatch with which the document was scanned. |
− | * SCANBATCHTYPENAME(): | + | * SCANBATCHTYPENAME(): get the name of the type of the scanbatch with which the document was scanned. |
− | * SCANNINGUSERNAME(): | + | * SCANNINGUSERNAME(): get the username of the user who scanned the document. |
* OPTINPARTNERS(): | * OPTINPARTNERS(): | ||
* CUSTOMTEXT(): | * CUSTOMTEXT(): | ||
Line 193: | Line 380: | ||
* IF(): | * IF(): | ||
− | * COUNTER(): | + | * COUNTER(): |
* USERNAME(): get the name of the current user logged in. | * USERNAME(): get the name of the current user logged in. |
Latest revision as of 16:13, 28 August 2017
When creating/editing a "Template", you have the possibility to use some operators or functions to automatically fill in a value of a field.
Only text fields can be automatically filled in. These are:
|
The operators and functions are always constructed in the same way:
- Operators: #{OPERATOR(FIELDCODE, PARAMETER1, PARAMETER2)}
- Functions: #{FUNCTION(PARAMETER)}
Operators and functions can be used in combination with fixed text. |
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.
This would result in the following:
When an incorrect operator/function is given, an error will occur when the template is applied. |
The operators/functions are case sensitive, you have to enter the upper case codes of fields (not their name!). |
Contents
1 List of header field codes and their parameters
Usage: #{HEADERFIELD(FIELDCODE, PARAMETER 1, PARAMETER 2)}
All environments:
Fieldname | Fieldcode | Parameter 1 | Parameter 2 | Example usage |
---|---|---|---|---|
Supplier | SUPPCODE | CODE | #{HEADERFIELD(SUPPCODE,CODE)} | |
NAME | #{HEADERFIELD(SUPPCODE,NAME)} | |||
Customer | CUSTCODE | CODE | #{HEADERFIELD(CUSTCODE,CODE)} | |
NAME | #{HEADERFIELD(CUSTCODE,NAME)} | |||
CUSTVATID | #{HEADERFIELD(CUSTVATID)} | |||
Journal | JOURNAL | CODE | #{HEADERFIELD(JOURNAL,CODE)} | |
NAME | #{HEADERFIELD(JOURNAL,NAME)} | |||
Invoice date | INVDATE | Dateformat | Calculation | #{HEADERFIELD(INVDATE,yyyy,+1y)} |
Comment | COMMENT1 | #{HEADERFIELD(COMMENT1)} | ||
OGM | OGM | #{HEADERFIELD(OGM)} | ||
Net amount | NETAMNT | #{HEADERFIELD(NETAMNT)} | ||
VAT amount | VATAMNT | #{HEADERFIELD(VATAMNT)} | ||
Total amount | TOTAMNT | #{HEADERFIELD(TOTAMNT)} | ||
Currency | CURRENCY | CODE | #{HEADERFIELD(CURRENCY,CODE)} | |
NAME | #{HEADERFIELD(CURRENCY,NAME)} | |||
Invoice number | INVNR | #{HEADERFIELD(INVNR)} | ||
Invoice type | INVTYPE | CODE | #{HEADERFIELD(INVTYPE,CODE)} | |
NAME | #{HEADERFIELD(INVTYPE,NAME)} | |||
Payment term | PAYMENTTERM | CODE | #{HEADERFIELD(PAYMENTTERM,CODE)} | |
NAME | #{HEADERFIELD(PAYMENTTERM,NAME)} | |||
Due date | INVDUEDATE | #{HEADERFIELD(INVDUEDATE)} | ||
Voucher number | VOUCHERNR | #{HEADERFIELD(VOUCHERNR)} | ||
Paid amount | PAIDAMOUNT | #{HEADERFIELD(PAIDAMOUNT)} | ||
Payment method | PAYMENT_METHOD | #{HEADERFIELD(PAYMENT_METHOD)} | ||
Paid date | PAIDDATE | #{HEADERFIELD(PAIDDATE)} | ||
Payment status | PAYMENT_STATUS | CODE | #{HEADERFIELD(PAYMENT_STATUS,CODE)} | |
NAME | #{HEADERFIELD(PAYMENT_STATUS,NAME)} |
EIS and OIS specific fields:
Fieldname | Fieldcode | Parameter 1 | Parameter 2 | Example usage |
---|---|---|---|---|
Period | PERIOD | CODE | #{HEADERFIELD(PERIOD,CODE)} | |
NAME | #{HEADERFIELD(PERIOD,NAME)} | |||
VAT ID | VATID | #{HEADERFIELD(VATID)} |
The "VATID" field is the VAT ID of the supplier, not your own VAT ID. |
VIS specific fields:
Fieldname | Fieldcode | Parameter 1 | Parameter 2 | Example usage |
---|---|---|---|---|
Bookyear | YEAR | CODE | #{HEADERFIELD(YEAR,CODE)} | |
NAME | #{HEADERFIELD(YEAR,NAME)} | |||
Supplier VAT | SUPPVATID | #{HEADERFIELD(SUPPVATID)} | ||
Voucher date | VOUCHERDATE | #{HEADERFIELD(VOUCHERDATE)} |
Connected specific fields:
Fieldname | Fieldcode | Parameter 1 | Parameter 2 | Example usage |
---|---|---|---|---|
Period | PERIOD | CODE | #{HEADERFIELD(PERIOD,CODE)} | |
NAME | #{HEADERFIELD(PERIOD,NAME)} | |||
Voucher date | VOUCHERDATE | #{HEADERFIELD(VOUCHERDATE)} |
2 List of technical field codes and their parameters
Usage: #{TECHNICALFIELD(FIELDCODE, PARAMETER 1, PARAMETER 2)}
All environments
Fieldname | Fieldcode | Parameter 1 | Parameter 2 | Example usage |
---|---|---|---|---|
Scan user | SCANUSER | #{TECHNICALFIELD(SCANUSER)} | ||
Scan batch | SCANBATCH | #{TECHNICALFIELD(SCANBATCH)} | ||
Scanning date | SCANNINGDATE | #{TECHNICALFIELD(SCANNINGDATE)} | ||
Incoming date | INCOMINGDATE | Dateformat | Calculation | #{TECHNICALFIELD(INCOMINGDATE)} |
Accountant | ACOUNTANT | Dateformat | Calculation | #{TECHNICALFIELD(ACCOUNTANT)} |
Cancel reason | CANCELREASON | CODE | #{TECHNICALFIELD(CANCELREASON,CODE)} | |
NAME | #{TECHNICALFIELD(CANCELREASON,NAME)} | |||
Booking date/Sent to Venice date | BOOKINGDATE | #{TECHNICALFIELD(BOOKINGDATE)} |
3 List of company field codes and their parameters
Usage: #{COMPANYFIELD(FIELDCODE)}
4 List of functions and their parameters
- COMPANYBARCODE(): get the barcode of the company of the document.
- COMPANYID(): get the ID of the company of the document.
- COMPANYCODE(): get the code of the company of the document.
- COMPANYNAME(): get the name of the company of the document.
- DOCUMENTARCHIVEID(): get the ID of the document as it is seen in the archive view.
- DOCUMENTID(): when a document has another ID (in an external package for example), get that ID.
- DOCUMENTLIST():
- DOCUMENTTYPECODE(): get the code of the type of the document.
- DOCUMENTTYPENAME(): get the name of the type of the document.
- RECMETHOD(): get the name of the reception method of the document.
- RECMETHODCODE(): get the code of the reception method of the document.
- SCANBATCHTYPECODE(): get the code of the type of the scanbatch with which the document was scanned.
- SCANBATCHTYPENAME(): get the name of the type of the scanbatch with which the document was scanned.
- SCANNINGUSERNAME(): get the username of the user who scanned the document.
- OPTINPARTNERS():
- CUSTOMTEXT():
- ENCRYPT():
- IF():
- COUNTER():
- USERNAME(): get the name of the current user logged in.
- USERID():
- USERREALNAME():
- CURRENTDATE():
- GETQUARTER():
5 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