.

lunes, 2 de septiembre de 2024

DOLIBARR - Sistema de Variables de Sustitución

Son editadas en el directorio: /htdocs/core/lib/functions.lib.php 


Variable substitution system

Ir a la navegaciónIr a la búsqueda


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

Dolibarr User

    VariableDisplayed ValueNoteDolibarr Mini
    __USER_SIGNATURE__My beautiful signatureUser signature
    __USER_SIGNATURE__My beautiful signatureUser signature
    __USER_ID__1User ID
    __USER_LOGIN__doli9User Login
    __USER_LASTNAME__AdminUser last name
    __USER_FIRSTNAME__SuperUser first name
    __USER_FULLNAME__SuperAdminUser full name
    __USER_SUPERVISOR_ID__1User supervisor ID
    __USER_REMOTE_IP__xxx.xxx.xxx.xxxUser remote IP

      My Company

        VariableDisplayed ValueNoteDolibarr Mini
        __MYCOMPANY_NAME__My little companyName of the company
        __MYCOMPANY_EMAIL__contact@mycompany.comMy company contact email
        __MYCOMPANY_PHONE__0123456789My company phone number
        __MYCOMPANY_FAX__0123456789My company fax number
        __MYCOMPANY_PROFID1__12345678Prof Id 1 (TIN)
        __MYCOMPANY_PROFID2__12345678Prof Id 2 (PAN)
        __MYCOMPANY_PROFID3__12345678Prof Id 3 (SRVC TAX)
        __MYCOMPANY_PROFID4__12345678Prof Id 4
        __MYCOMPANY_PROFID5__12345678Prof Id 5
        __MYCOMPANY_PROFID6__12345678VAT ID
        __MYCOMPANY_CAPITAL__10000Capital of the company
        __MYCOMPANY_FULLADDRESS__21 Jump street 75500 MyTown IndiaFull address of the company
        __MYCOMPANY_ADDRESS__21 Jump streetaddress of the company
        __MYCOMPANY_ZIP__75500ZIP code of the company address
        __MYCOMPANY_TOWN__MyTownTown of the company address
        __MYCOMPANY_COUNTRY__IndiaCountry of the company address
        __MYCOMPANY_COUNTRY_ID__1Country ID of the company address
        __MYCOMPANY_COUNTRY_CODE__1Country Code of the company address
        __MYCOMPANY_CURRENCY_CODE__EURMain currency

          Object

          Generic

            VariableDisplayed ValueNoteDolibarr Mini
            __ID__1ID of the object
            __REF__1234Reference of the object
            __REF_CLIENT__1234Customer reference of the object
            __REF_SUPPLIER__1234Supplier reference of the object
            __NOTE_PUBLIC__My Public noteObject Public NoteV 13
            __NOTE_PRIVATE__My Private noteObject Private NoteV 13
            __DATE_DELIVERY__01/02/2021Delivery dateV 13

              Objects with amounts

                VariableDisplayed ValueNoteDolibarr Mini
                __DATE_YMD__1/1/2020Object date
                __DATE_DUE_YMD__1/1/2020Due date
                __AMOUNT__1243.34Amount
                __AMOUNT_TEXT__One thousand five hundred ...Amount in wordsV13
                __AMOUNT_TEXTCURRENCY__One thousand five hundred ...Amount in words with currencyV13
                __AMOUNT_EXCL_TAX__1234.45Amount without taxes
                __AMOUNT_VAT__123.4VAT amount
                __AMOUNT_VAT_TEXT__One thousand five hundred ...VAT Amount in wordsV13
                __AMOUNT_VAT_TEXTCURRENCY__One thousand five hundred ...VAT Amount in words with currencyV13
                __AMOUNT_TAX2__123.4TAX2 amount
                __AMOUNT_TAX3__123.4TAX3 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
                __AMOUNT_TAX2_FORMATED__123.4 €TAX2 amount formatedV13
                __AMOUNT_TAX3_FORMATED__123.4 €TAX3 amount formatedV13
                __AMOUNT_MULTICURRENCY__1234.45 $Amount in MulticurrencyV13
                __AMOUNT_MULTICURRENCY_TEXT__One thousan five hundred ...Amount in Multicurrency in wordsV13
                __AMOUNT_MULTICURRENCY_TEXTCURRENCY__One thousan five hundred ...Amount in Multicurrency in words with currencyV13

                  Member

                    VariableDisplayed ValueNoteDolibarr Mini
                    __MEMBER_ID__123Member IDV 13
                    __MEMBER_CIVILITY__V 13
                    __MEMBER_FIRSTNAME__V 13
                    __MEMBER_LASTNAME__V 13
                    __MEMBER_FULLNAME__V 13
                    __MEMBER_COMPANY__V 13
                    __MEMBER_ADDRESS__V 13
                    __MEMBER_ZIP__V 13
                    __MEMBER_TOWN__V 13
                    __MEMBER_COUNTRY__V 13
                    __MEMBER_EMAIL__V 13
                    __MEMBER_BIRTH__V 13
                    __MEMBER_PHOTO__V 13
                    __MEMBER_LOGIN__V 13
                    __MEMBER_PASSWORD__V 13
                    __MEMBER_PHONE__V 13
                    __MEMBER_PHONEPRO__V 13
                    __MEMBER_PHONEMOBILE__V 13
                    __MEMBER_TYPE__MemberType of memberV 13
                    __MEMBER_FIRST_SUBSCRIPTION_DATE__V 13
                    __MEMBER_FIRST_SUBSCRIPTION_DATE_START__V 13
                    __MEMBER_FIRST_SUBSCRIPTION_DATE_END__V 13
                    __MEMBER_LAST_SUBSCRIPTION_DATE__V 13
                    __MEMBER_LAST_SUBSCRIPTION_DATE_START__V 13
                    __MEMBER_LAST_SUBSCRIPTION_DATE_END__V 13

                      Thirdparty

                        VariableDisplayed ValueNoteDolibarr Mini
                        __THIRDPARTY_ID__1Third party ID of the object
                        __THIRDPARTY_NAME__MyCustomerThird party name of the object
                        __THIRDPARTY_NAME_ALIAS__MyCThird party name alias of the object
                        __THIRDPARTY_CODE_CLIENT__V13
                        __THIRDPARTY_CODE_FOURNISSEUR__V13
                        __THIRDPARTY_EMAIL__contact@mycustomer.comThird party email of the object
                        __THIRDPARTY_PHONE__V13
                        __THIRDPARTY_FAX__V13
                        __THIRDPARTY_ADDRESS__V13
                        __THIRDPARTY_ZIP__V13
                        __THIRDPARTY_TOWN__V13
                        __THIRDPARTY_COUNTRY_ID__V13
                        __THIRDPARTY_COUNTRY_CODE__V13
                        __THIRDPARTY_IDPROF1__V13
                        __THIRDPARTY_IDPROF2__V13
                        __THIRDPARTY_IDPROF3__V13
                        __THIRDPARTY_IDPROF4__V13
                        __THIRDPARTY_IDPROF5__V13
                        __THIRDPARTY_IDPROF6__V13
                        __THIRDPARTY_TVAINTRA__V13
                        __THIRDPARTY_NOTE_PUBLIC__V13
                        __THIRDPARTY_NOTE_PRIVATE__V13

                          Candidate

                            VariableDisplayed ValueNoteDolibarr Mini
                            __CANDIDATE_FULLNAME__V13
                            __CANDIDATE_FIRSTNAME__V13
                            __CANDIDATE_LASTNAME__V13

                              Project

                                VariableDisplayed ValueNoteDolibarr Mini
                                __PROJECT_ID__1Project ID of the object
                                __PROJECT_REF__1Project reference of the object
                                __PROJECT_NAME__1Project name of the object

                                  Shipment

                                    VariableDisplayed ValueNoteDolibarr Mini
                                    __SHIPPINGTRACKNUM__XXXXXShipping tacking number
                                    __SHIPPINGTRACKNUMURL__http://trackingcompagny.com/XXXXXShipping tracking url

                                      Reception

                                        VariableDisplayed ValueNoteDolibarr Mini
                                        __RECEPTIONTRACKNUM__XXXXXShipping tacking numberV13
                                        __RECEPTIONTRACKNUMURL__http://trackingcompagny.com/XXXXXShipping tracking urlV13

                                          Contract

                                            VariableDisplayed ValueNoteDolibarr Mini
                                            __CONTRACT_HIGHEST_PLANNED_START_DATE__1/1/2020Highest date planned for a service start
                                            __CONTRACT_HIGHEST_PLANNED_START_DATETIME__1/1/2020 1PMHighest date and hour planned for service start
                                            __CONTRACT_LOWEST_EXPIRATION_DATE__1/1/2020Lowest date for planned expiration of service
                                            __CONTRACT_LOWEST_EXPIRATION_DATETIME__1/1/2020 1PMLowest date and hour for planned expiration of service

                                              Extrafield

                                              Generic Rule

                                                VariableDisplayed ValueNoteDolibarr Mini
                                                __EXTRAFIELD_XXX__Object Extrafield (XXX need to be replace by the Extrafield Attribute code)

                                                  Date Extrafield

                                                    VariableDisplayed ValueNoteDolibarr Mini
                                                    __EXTRAFIELD_XXX__Object Extrafield (XXX need to be replace by the Extrafield Attribute code)
                                                    __EXTRAFIELD_XXX_LOCALE__Object Extrafield (XXX need to be replace by the Extrafield Attribute code) in locale
                                                    __EXTRAFIELD_XXX_RFC__Object Extrafield (XXX need to be replace by the Extrafield Attribute code) in RFC

                                                      Datetime Extrafield

                                                        VariableDisplayed ValueNoteDolibarr Mini
                                                        __EXTRAFIELD_XXX__Object Extrafield (XXX need to be replace by the Extrafield Attribute code)
                                                        __EXTRAFIELD_XXX_LOCALE__Object Extrafield (XXX need to be replace by the Extrafield Attribute code) in locale
                                                        __EXTRAFIELD_XXX_DAY_LOCALE__Object Extrafield (XXX need to be replace by the Extrafield Attribute code) only the day in locale
                                                        __EXTRAFIELD_XXX_RFC__Object Extrafield (XXX need to be replace by the Extrafield Attribute code) in RFC

                                                          Online Payment

                                                            VariableDisplayed ValueNoteDolibarr Mini
                                                            __ONLINE_PAYMENT_URL__http://mydoli.com/paymentAddress of the Online payement if applicable
                                                            __ONLINE_PAYMENT_TEXT_AND_URL__Click to payText and Url to pay online if applicable

                                                              Online Proposal Signature

                                                                VariableDisplayed ValueNoteDolibarr Mini
                                                                __ONLINE_SIGN_URL__http://mydoli.com/public/onlinesignAddress of the Online Signature for proposal15

                                                                  Online Intervention Signature

                                                                    VariableDisplayed ValueNoteDolibarr Mini
                                                                    __ONLINE_SIGN_FICHINTER_URL__http://mydoli.com/public/onlinesignAddress of the Online Signature for intervention

                                                                      Document download

                                                                        VariableDisplayed ValueNoteDolibarr Mini
                                                                        __DIRECTDOWNLOAD_URL_PROPOSAL__http://mydoli.com/proposal.pdfDirect download url of a proposal
                                                                        __DIRECTDOWNLOAD_URL_ORDER__http://mydoli.com/order.pdfDirect download url of an order
                                                                        __DIRECTDOWNLOAD_URL_INVOICE__http://mydoli.com/invoice.pdfDirect download url of an invoice. This needs that the setup INVOICE_ALLOW_EXTERNAL_DOWNLOAD is set to allow to generate the link.
                                                                        __DIRECTDOWNLOAD_URL_FICHINTER__http://mydoli.com/fichinter.pdfDirect download url of an intervention. This needs that the setup FICHINTER_ALLOW_EXTERNAL_DOWNLOAD is set to allow to generate the link.
                                                                        __URL_PROPOSAL__http://mydoli.com/comm/propal/card.php?id=xxx
                                                                        __URL_ORDER__http://mydoli.com/commande/card.php?id=xxxx
                                                                        __URL_INVOICE__http://mydoli.com/compta/facture/card.php?id=xxx
                                                                        __URL_FICHINTER__

                                                                          Event

                                                                            VariableDisplayed ValueNoteDolibarr Mini
                                                                            __EVENT_LABEL__V13
                                                                            __EVENT_DATE__V13
                                                                            __EVENT_TIME__V13

                                                                              Dates

                                                                                VariableDisplayed ValueNoteDolibarr Mini
                                                                                __DAY__12actual day
                                                                                __DAY_TEXT__MondayActual day in text
                                                                                __DAY_TEXT_SHORT__MoActual day in short text
                                                                                __DAY_TEXT_MIN__MActual day in minimum text
                                                                                __MONTH__3Actual month
                                                                                __MONTH_TEXT__MarchActual month in text
                                                                                __MONTH_TEXT_SHORT__MarchActual month in short text
                                                                                __MONTH_TEXT_MIN__MActual month in minimum text
                                                                                __YEAR__2020Actual year
                                                                                __PREVIOUS_DAY__11Previous day
                                                                                __PREVIOUS_MONTH__2Previous month
                                                                                __PREVIOUS_YEAR__2019Previous Year
                                                                                __NEXT_DAY__13Next day
                                                                                __NEXT_MONTH__4Next month
                                                                                __NEXT_YEAR__2021next year

                                                                                  Multicompany

                                                                                    VariableDisplayed ValueNoteDolibarr Mini
                                                                                    __ENTITY_ID__V13

                                                                                      System

                                                                                        VariableDisplayed ValueNoteDolibarr Mini
                                                                                        __DOL_MAIN_URL_ROOT__http://mondolibarr/htdocsRoot URL of Dolibarr
                                                                                        __(AnyTranslationKey)__TranslationAny translation Key
                                                                                        __(AnyTranslationKey|langfile)__TranslationAny translation Key (load also language file before)V13
                                                                                        __[AnyConstantKey]__1Value of a constant key

                                                                                          For Emails

                                                                                            VariableDisplayed ValueNoteDolibarr Mini
                                                                                            __CONTACT_NAME_XXX__Mister TXXX is the contact type defined on Setup->Dictionaries->Contact/Address types (exemple : __CONTACT_NAME_BILLING__ for the billing contact). The output will be LastName + First NameV14
                                                                                            __CONTACT_LASTNAME_XXX__TXXX is the contact type defined on Setup->Dictionaries->Contact/Address types (exemple : __CONTACT_NAME_BILLING__ for the billing contact).V14
                                                                                            __CONTACT_FIRSTNAME_XXX__MisterXXX is the contact type defined on Setup->Dictionaries->Contact/Address types (exemple : __CONTACT_NAME_BILLING__ for the billing contact).V14
                                                                                            __CONTACT_TITLE_XXX__MrXXX is the contact type defined on Setup->Dictionaries->Contact/Address types (exemple : __CONTACT_NAME_BILLING__ for the billing contact).V14
                                                                                            __CHECK_READ__Insert a blank image with a callback URL to Dolibarr (/public/emailing/mailing-read.php?tag=)

                                                                                              Custom substitution variables

                                                                                              Custom substitution variables can be added by external modules. For this, the external module must embed a file called mymodule/core/substitutions/functions_mymodules.lib.php

                                                                                              DOLIBARR - Sistema de Variables de Sustitución

                                                                                              Son editadas en el directorio: /htdocs/core/lib/functions.lib.php   Variable substitution system Ir a la navegación Ir a la búsqueda Return ...