You can't do that with Dolibarr below 3.3 (the current experimental branch), because the *yourmodule*_completesubstitutionarray() function can only work on non-line substitutions.
For product lines, you must have Dolibarr >= 3.3 and use the following substitution function: *yourmodule*_completesubstitutionarray_lines(&$substitutionarray,$outputlangs,$object,$line)
This one will be called for each product/service and will provide you with the $line object.
This is a functionality that I implemented by myself, so I know it works because I thoroughly tested it ;)
You can find more informations here:
http://wiki.dolibarr.org/index.php/Create_an_ODT_document_template#Other_personalized_tags_for_lines
↧