Creating a module for odt template

Hello to the community :slight_smile:

I need a little help with my “custom module”.

I have created a custom odt template for invoices and now I want to display some extra information, so I decided to create a simple module, in order to create a personalized tag.

So, the information that I want to display is the {line_qty} multiple with {line_up_locale}

my code look like this :

<?php
function mymodule_completesubstitutionarray_lines(&$substitutionarray,$langs,$object,$line)
{
   global $conf,$db;
   $myvalue= $line->qty * $line->up_locate;     
   $substitutionarray['line_pre_discount_value']= $myvalue;
}
?>

The above code returns zero as a value and I don’t know what I’m doing wrong.
How do i suppose to get these values ??

Thank you in advance!

UPDATE
I found the original file of Dolibarr at the following path:

htdocs/compta/facture/class/facture.class.php

and i searched to see the variables. I found the up_locale and the name of this variable was subprice. So i kind of found a solution.

I posted so if someone in the future have this problem he can read this thread. :slight_smile:

2 Likes

Hi, I hope you can see this question.

How do you get to add odt template generation to your custom module because now I can only generate pdf files.