# Invoice Template - How To?

**URL:** <https://www.dolibarr.org/forum/t/invoice-template-how-to/11119>\
**Category:** Using my Dolibarr\
**Created:** [September 18, 2014, 9:38am UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119 "2014-09-18T09:38:47Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![virtilia](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/virtilia/32/315_2.png) [@virtilia](https://www.dolibarr.org/forum/u/virtilia)\
**Post date:** [September 18, 2014, 9:38am UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/1 "2014-09-18T09:38:47Z")

</div>

Hello,  
I am trying to create a new .ODT invoice template using Open Office 4.1.1 and Dolibarr 3.6.0. I can open the existing template file (dolibarr/documents/doctemplates/invoices/template\_invoice.odt) in Open Office and save it using a different name - and it will work.  
It will not work anymore after deleting parts of the document.  
If I create a new .ODT document as described in the dolibarr wiki ([http://wiki.dolibarr.org/index.php/Create\_an\_ODT\_document\_template](http://wiki.dolibarr.org/index.php/Create_an_ODT_document_template)) entering just a simple tag like {mycompany\_name} it will not work returning the messages “facture\_pdf\_create Error: ‘lines’ segment not found in the document” and " ErrorBadValueForParamNotAString".  
What is the ‘lines segment’?  
How to create a working .ODT document?  
Can someone help, please?  
Thanks in advance!  
virtilia

---

<div class="post-metadata">

**Author:** ![ndrosis](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ndrosis/32/231_2.png) [@ndrosis](https://www.dolibarr.org/forum/u/ndrosis)\
**Post date:** [September 18, 2014, 5:16pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/2 "2014-09-18T17:16:03Z")

</div>

Try create new ODT file and be careful the tags must be rounded with {} or [] for arrays (see later) and must be typed with no stop using Office suite (with no backward and no copy-paste). If not doing that, Office suite add some invisible informations making replacement not possible.

---

<div class="post-metadata">

**Author:** ![virtilia](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/virtilia/32/315_2.png) [@virtilia](https://www.dolibarr.org/forum/u/virtilia)\
**Post date:** [September 19, 2014, 12:25pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/3 "2014-09-19T12:25:19Z")

</div>

Thank you, ndrosis. Thats exactly what I did - I created a new .ODT text file and entered the tag {my company\_logo} without deleting any characters or any further typing or cut/copy-paste. I saved the file in the correct location, but when I chose that template file instead of crabe or the provided template\_invoice.odt (which both work) an error message screen appears with error messages like “facture\_pdf\_create Error: ‘lines’ segment not found in the document” and " ErrorBadValueForParamNotAString".  
I tried the same using LibreOffice instead of Open Office with no difference, so it is apparently not an issue caused by a wrong Office version.  
If the tag wasn’t surrounded by “{}” wouldn’t Dolibarr just ignore the tag and not replace it by content instead of crashing with those error messages?

---

<div class="post-metadata">

**Author:** ![ndrosis](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ndrosis/32/231_2.png) [@ndrosis](https://www.dolibarr.org/forum/u/ndrosis)\
**Post date:** [September 19, 2014, 12:36pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/4 "2014-09-19T12:36:32Z")

</div>

You have inserted the [Lines of object?](http://wiki.dolibarr.org/index.php/Create_an_ODT_document_template#Lines_of_object)

---

<div class="post-metadata">

**Author:** ![virtilia](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/virtilia/32/315_2.png) [@virtilia](https://www.dolibarr.org/forum/u/virtilia)\
**Post date:** [September 21, 2014, 2:45pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/5 "2014-09-21T14:45:19Z")

</div>

Yes, to test lines of object I entered in a brand new .ODT document:

[!-- BEGIN lies –]  
{line\_fulldesc}  
{line\_up}  
{line\_qty}  
{line\_price\_ttc}  
[!-- END lines –]

When trying to create the invoice I get:

Dolibarr has detected a technical error.  
This is information that can help diagnostic:  
Date: 20140921164103  
Dolibarr: 3.6.0  
Level of features: 0  
PHP: 5.5.10  
Server: Apache

Requested Url: /dolibarr/htdocs/compta/facture.php?facid=3  
Referer: [https://virtilia.endofinternet.org:8890/dolibarr/htdocs/compta/facture.php?facid=3](https://virtilia.endofinternet.org:8890/dolibarr/htdocs/compta/facture.php?facid=3)  
Menu manager: eldy\_menu.php

Database type manager: mysqli  
Request for last database access in error: No request in error  
Return code for last database access in error: No request in error  
Information for last database access in error: No request in error

Message: facture\_pdf\_create Error: ‘lines’ segment not found in the document  
Dolibarr has detected a technical error.  
This is information that can help diagnostic:  
Date: 20140921164103  
Dolibarr: 3.6.0  
Level of features: 0  
PHP: 5.5.10  
Server: Apache

Requested Url: /dolibarr/htdocs/compta/facture.php?facid=3  
Referer: [https://virtilia.endofinternet.org:8890/dolibarr/htdocs/compta/facture.php?facid=3](https://virtilia.endofinternet.org:8890/dolibarr/htdocs/compta/facture.php?facid=3)  
Menu manager: eldy\_menu.php

Database type manager: mysqli  
Request for last database access in error: No request in error  
Return code for last database access in error: No request in error  
Information for last database access in error: No request in error

Message: ErrorBadValueForParamNotAString

---

<div class="post-metadata">

**Author:** ![ndrosis](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ndrosis/32/231_2.png) [@ndrosis](https://www.dolibarr.org/forum/u/ndrosis)\
**Post date:** [September 21, 2014, 9:11pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/6 "2014-09-21T21:11:03Z")

</div>

Try add this  
[!-- BEGIN row.lies --]  
{line\_fulldesc}  
{line\_up}  
{line\_qty}  
{line\_price\_ttc}  
[!-- END row.lines --]

---

<div class="post-metadata">

**Author:** ![ndrosis](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ndrosis/32/231_2.png) [@ndrosis](https://www.dolibarr.org/forum/u/ndrosis)\
**Post date:** [September 21, 2014, 9:13pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/7 "2014-09-21T21:13:42Z")

</div>

> [@ndrosis](#):
>
> Try add this  
> [!-- BEGIN row.lies --]  
> {line\_fulldesc}  
> {line\_up}  
> {line\_qty}  
> {line\_price\_ttc}  
> [!-- END row.lines --]

`
[!-- BEGIN row.lines --]
{line_fulldesc}
{line_up}
{line_qty}
{line_price_ttc}
[!-- END row.lines --]`

---

<div class="post-metadata">

**Author:** ![virtilia](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/virtilia/32/315_2.png) [@virtilia](https://www.dolibarr.org/forum/u/virtilia)\
**Post date:** [September 28, 2014, 8:11pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/8 "2014-09-28T20:11:22Z")

</div>

Yes, I did - same error message as before. What makes me wonder is that the error statement names “facture\_pdf\_create”:  
Message: facture\_pdf\_create Error: ‘lines’ segment not found in the document  
Does it mean that the corresponding PHP module for creating a PDF file is called? I wanted to create an .ODT invoice, not a PDF…

---

<div class="post-metadata">

**Author:** ![virtilia](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/virtilia/32/315_2.png) [@virtilia](https://www.dolibarr.org/forum/u/virtilia)\
**Post date:** [September 28, 2014, 8:27pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/9 "2014-09-28T20:27:05Z")

</div>

An invoice will only be created if “crabe” is selected as pdf template or if the original “template\_invoice.odt” is used. Also a copy of “template\_invoice.odt” will work, but no other .ODT file that has been exactly created according to the rules (no backspace, no copy-paste etc.). I am desperate.

---

<div class="post-metadata">

**Author:** ![zungmann](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/z/e47774/32.png) [@zungmann](https://www.dolibarr.org/forum/u/zungmann)\
**Post date:** [November 2, 2014, 3:40am UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/10 "2014-11-02T03:40:57Z")

</div>

I had the same error you got there. I was editing the odt invoice template to suite my needs. I was adding a column No. in the table and was expecting to fill in with row number of product/service and left blank for a while. I got the error when push the ‘Generate’ invoice with my template. Remove the column and back to normal.

Anyway, how can I add row number to the table?

---

<div class="post-metadata">

**Author:** ![Janne](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/f19dbf/32.png) [@Janne](https://www.dolibarr.org/forum/u/Janne)\
**Post date:** [December 19, 2014, 9:13pm UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/11 "2014-12-19T21:13:03Z")

</div>

Having exact same issues here. [[url=www.dolibarr.org/t/something-fishy-in-odt-templates/11536/1](http://url=www.dolibarr.org/t/something-fishy-in-odt-templates/11536/1) to post[/url]

As this seems to be an issue to more than just us here, it would be nice to crack.

---

<div class="post-metadata">

**Author:** ![sadomba](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/sadomba/32/96_2.png) [@sadomba](https://www.dolibarr.org/forum/u/sadomba)\
**Post date:** [January 16, 2015, 8:23am UTC](https://www.dolibarr.org/forum/t/invoice-template-how-to/11119/12 "2015-01-16T08:23:07Z")

</div>

hi,  
I am new to Dolibarr and linux OS.  
I have just installed ubuntu 14.04 and Dolibarr. I have read other posts on how to customise the invoice and tried to follow the instructions. I am trying to create a new .ODT invoice template using Open Office 4.1.1 and Dolibarr 3.3.4. I can not find the path (dolibarr/documents/doctemplates/invoices/template\_invoice.odt) in Open Office.
