Hi everybody,
first of all, I´m a very newbie in Dolibarr and also not very good in PHP.
I want to create a report of my customers in the thirdparties ODT Template. I will give a overview about customer datas and needs (for that I created some extrafields), also about appointmens and projects with that contact. You can see the ODT in attachment.
Bericht.odt (17.8 KB)
Bericht18.pdf (60.8 KB)
The problem is, when I create the ODT with the ODT Modul, I only get results for the main tags, given by the systems. I don´t get results for the extrafields and even not for the projetcs and appointments, I only get the tags in the ODT. You can see the result in the pdf in attachment.
I searched the german and the english forums, but I don´t find the rigth solution. Even I don´t want to destroy something ;-).
I think I have to set the setting in one of the PHP Moduls to global, but I don´t know where and how. Or, do I have to do the Other personalized tags modul, like its writen here:
https://wiki.dolibarr.org/index.php/Create_an_ODT_document_template as its writen down there?
But then I don´t know what values I need to but in the PHP. Could anybody help my with that? I would be very thankful!!!
I Use Dolibarr 9.0.3.
Thanks to everyone for your help!
If you want to add a field that is not predefined, this is the solution:
Create a file into the location:
htdocs/mymodule/core/substitutions/functions_mymodule.lib.php
Inside this file, just write one function like this:
/** Function called to complete substitution array (before generating on ODT, or a personalized email)
* functions xxx_completesubstitutionarray are called by make_substitutions() if file
* is inside directory htdocs/core/substitutions
*
-
@param array $substitutionarray Array with substitution key=\>val
-
@param Translate $langs Output langs
-
@param Object $object Object to use to get values
* @return void The entry parameter $substitutionarray is modified
*/
function mymodule_completesubstitutionarray(&$substitutionarray,$langs,$object)
{
global $conf,$db;
$myvalue=‘Put here calculated value to insert’;
$substitutionarray[‘myowntag’]=$myvalue;
}