Variable substitution system

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search

Substitution variables are keywords that can be used in many places in Dolibarr to be replaced later. It is used for example in the templates of emails or configuration text for a text to be personalized when it is displayed or sent for emails.

These variables will be replaced only if the corresponding data exist on the object (for exemple for a third party mail, the online payement URL doesn't exist and will not be replaced)

Substitution variables available

Variable Displayed Value Note Dolibarr Mini
__USER_SIGNATURE__ My beautiful signature User signature
__USER_ID__ 1 User ID
__USER_LOGIN__ doli9 User Login
__USER_LASTNAME__ Admin User last name
__USER_FIRSTNAME__ Super User first name
__USER_FULLNAME__ SuperAdmin User full name
__USER_SUPERVISOR_ID__ 1 User supervisor ID
__USER_REMOTE_IP__ User remote IP
__MYCOMPANY_NAME__ My little company Name of the company
__MYCOMPANY_EMAIL__ My company contact email
__MYCOMPANY_PROFID1__ 12345678 Prof Id 1 (TIN)
__MYCOMPANY_PROFID2__ 12345678 Prof Id 2 (PAN)
__MYCOMPANY_PROFID3__ 12345678 Prof Id 3 (SRVC TAX)
__MYCOMPANY_PROFID4__ 12345678 Prof Id 4
__MYCOMPANY_PROFID5__ 12345678 Prof Id 5
__MYCOMPANY_CAPITAL__ 10000 Capital of the company
__MYCOMPANY_FULLADDRESS__ 21 Jump street 75500 MyTown India Full address of the company
__MYCOMPANY_ADDRESS__ 21 Jump street address of the company
__MYCOMPANY_ZIP__ 75500 ZIP code of the company address
__MYCOMPANY_TOWN__ MyTown Town of the company address
__MYCOMPANY_COUNTRY__ India Country of the company address
__MYCOMPANY_COUNTRY_ID__ 1 Country ID of the company address
__ID__ 1 ID of the object
__REF__ 1234 Reference of the object
__REF_CLIENT__ 1234 Customer reference of the object
__REF_SUPPLIER__ 1234 Supplier reference of the object
__EXTRAFIELD_XXX__ Object Extrafield (XXX need to be replace by the Extrafield Attribute code)
__THIRDPARTY_ID__ 1 Third party ID of the object
__THIRDPARTY_NAME__ MyCustomer Third party name of the object
__THIRDPARTY_NAME_ALIAS__ MyC Third party name alias of the object
__THIRDPARTY_EMAIL__ Third party email of the object
__MEMBER_TYPE__ Member Type of member V 13.0
__PROJECT_ID__ 1 Project ID of the object
__PROJECT_REF__ 1 Project reference of the object
__PROJECT_NAME__ 1 Project name of the object
__CONTRACT_HIGHEST_PLANNED_START_DATE__ 1/1/2020 Highest date planned for a service start
__CONTRACT_HIGHEST_PLANNED_START_DATETIME__ 1/1/2020 1PM Highest date and hour planned for service start
__CONTRACT_LOWEST_EXPIRATION_DATE__ 1/1/2020 Lowest date for planned expiration of service
__CONTRACT_LOWEST_EXPIRATION_DATETIME__ 1/1/2020 1PM Lowest date and hour for planned expiration of service
__ONLINE_PAYMENT_URL__ Address of the Online payement if applicable
__ONLINE_PAYMENT_TEXT_AND_URL__ Click to pay Text and Url to pay online if applicable
__SECUREKEYPAYMENT__ Security key (if key is not unique per record)
__SECUREKEYPAYMENT_MEMBER__ Security key for payment on a member subscription (one key per member)
__SECUREKEYPAYMENT_ORDER__ Security key for payment on an order
__SECUREKEYPAYMENT_INVOICE__ Security key for payment on an invoice
__SECUREKEYPAYMENT_CONTRACTLINE__ Security key for payment on a a service
__DIRECTDOWNLOAD_URL_PROPOSAL__ Direct download url of a proposal
__DIRECTDOWNLOAD_URL_ORDER__ Direct download url of an order
__DIRECTDOWNLOAD_URL_INVOICE__ Direct download url of an invoice. This needs that the setup INVOICE_ALLOW_EXTERNAL_DOWNLOAD is set to allow to generate the link.
__SHIPPINGTRACKNUM__ XXXXX Shipping tacking number
__SHIPPINGTRACKNUMURL__ Shipping tracking url
__DATE_YMD__ 1/1/2020 Actual date
__DATE_DUE_YMD__ 1/1/2020 Due date
__AMOUNT__ 1243.34 Amount
__AMOUNT_EXCL_TAX__ 1234.45 Amount without taxes
__AMOUNT_VAT__ 123.4 VAT amount
__AMOUNT_FORMATED__ 1243.34 € Amount formated
__AMOUNT_EXCL_TAX_FORMATED__ 1234.45 € Amount without taxes formated
__AMOUNT_VAT_FORMATED__ 123.4 € VAT amount formated
__DAY__ 12 actual day
__DAY_TEXT__ Monday Actual day in text
__DAY_TEXT_SHORT__ Mo Actual day in short text
__DAY_TEXT_MIN__ M Actual day in minimum text
__MONTH__ 3 Actual month
__MONTH_TEXT__ March Actual month in text
__MONTH_TEXT_SHORT__ March Actual month in short text
__MONTH_TEXT_MIN__ M Actual month in minimum text
__YEAR__ 2020 Actual year
__PREVIOUS_DAY__ 11 Previous day
__PREVIOUS_MONTH__ 2 Previous month
__PREVIOUS_YEAR__ 2019 Previous Year
__NEXT_DAY__ 13 Next day
__NEXT_MONTH__ 4 Next month
__NEXT_YEAR__ 2021 next year
__DOL_MAIN_URL_ROOT__ http://mondolibarr/htdocs Root URL of Dolibarr
__(AnyTranslationKey)__ Translation Any translation Key
__[AnyConstantKey]__ 1 Value of a constant key
__CONTACT_NAME_XXX__ Mr T XXX is the contact type defined on Setup->Dictionaries->Contact/Address types (exemple : __CONTACT_NAME_BILLING__ for the billing contact). The output will be Title + LastName + First Name

Custom substitution variables