# Get order field to print on PDF

**URL:** <https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568>\
**Category:** Using my Dolibarr\
**Created:** [April 28, 2019, 4:12pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568 "2019-04-28T16:12:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [April 28, 2019, 4:12pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/1 "2019-04-28T16:12:32Z")

</div>

Hi everyone,

I’d like to know how to get an specific field from the product module to print on PDF order.  
I have very little (close to zero to be honest) php knowledge.

Can anyone please help me?

---

<div class="post-metadata">

**Author:** ![h6585](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@h6585](https://www.dolibarr.org/forum/u/h6585)\
**Post date:** [April 29, 2019, 5:10am UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/2 "2019-04-29T05:10:42Z")

</div>

Hi,

Could you elaborate on what field you want to get printed.

Also, you can have a look at creating an attribute to be printed on the invoice.

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [April 29, 2019, 11:14am UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/3 "2019-04-29T11:14:25Z")

</div>

Hi there, thank you for your reply.  
I need the product accountancy code to be printed, and also another custom field that I created using CustomFields module. I’m using brazilian portuguese language on my system.  
Best regards

---

<div class="post-metadata">

**Author:** ![h6585](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@h6585](https://www.dolibarr.org/forum/u/h6585)\
**Post date:** [April 29, 2019, 12:08pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/4 "2019-04-29T12:08:37Z")

</div>

Hi,

I believe you will have to create a customized ODT file to suit your needs. I am unaware of any other options. Will wait for others to reply.

Check this link to create your ODT

[https://wiki.dolibarr.org/index.php/Create\_an\_ODT\_document\_template](https://wiki.dolibarr.org/index.php/Create_an_ODT_document_template)

Use the line\_options\_xxx tag to create and insert your custom attributes.

hope this helps

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [April 29, 2019, 1:23pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/5 "2019-04-29T13:23:36Z")

</div>

Ok, I’ll try that.

Many thanks

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [April 29, 2019, 2:13pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/6 "2019-04-29T14:13:22Z")

</div>

Hi,

Yes ODT is the way to do.

But be carefull CustomFields module is not Supported in Dolibarr since V4.0.  
Since V4.0, Dolibarr has native Extrafield that is close to previous CustomFields module  
What is your Dolibarr version ?

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [April 29, 2019, 3:07pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/7 "2019-04-29T15:07:34Z")

</div>

Version 9.0.2, running on webserver.  
I’ll uninstall CustomFields module!

Thank you!

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [April 30, 2019, 3:19pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/8 "2019-04-30T15:19:16Z")

</div>

Hello everyone,  
I created an odt file, uploaded to server, went to order module and set it to standard. Then I tried to create order draft and layout using this file is all broken.  
Should I convert it to pdf? If so, how to do it and what to do next? I’m stuck ☹  
Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![h6585](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@h6585](https://www.dolibarr.org/forum/u/h6585)\
**Post date:** [April 30, 2019, 5:20pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/9 "2019-04-30T17:20:54Z")

</div>

Hi,

Can you upload a the odt file and the result file for better understanding.

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [April 30, 2019, 7:11pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/10 "2019-04-30T19:11:50Z")

</div>

[template\_order.odt](https://www.dolibarr.org/forum/uploads/short-url/j3QQt0Eeb4SuFkvffp0R0sDa8fg.odt) (16.4 KB)

[PROV7\_order.odt](https://www.dolibarr.org/forum/uploads/short-url/bxh9pD8NA0nLYWWexVGUilqltC.odt) (33.9 KB)  
Sure!

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [April 30, 2019, 7:52pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/11 "2019-04-30T19:52:05Z")

</div>

Hi,

Everthing seems to work perfectly !  
You should now work on your order document template.

When you use ODT template, Dolibarr will create ODT documents.  
After you can use a ODT2PDF feature but it is quiet difficilt to use.

I you want pdf at the end, better to go with pdf php templates.

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [April 30, 2019, 9:15pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/12 "2019-04-30T21:15:07Z")

</div>

Yeah… this is where my problem starts! I have no idea how to edit the php file. ☹

---

<div class="post-metadata">

**Author:** ![h6585](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@h6585](https://www.dolibarr.org/forum/u/h6585)\
**Post date:** [May 2, 2019, 6:46am UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/13 "2019-05-02T06:46:06Z")

</div>

We are in the same boat here.

I have currently created ODT formats as per my requirements and using them right now. I download the ODT file and then export it as a pdf. Long process but gets the work done.

Working on a php file version while at the same time exploring the ODT2PDF option.

---

<div class="post-metadata">

**Author:** ![nazeer](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/nazeer/32/37_2.png) [@nazeer](https://www.dolibarr.org/forum/u/nazeer)\
**Post date:** [May 3, 2019, 11:09am UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/14 "2019-05-03T11:09:31Z")

</div>

The 1st template is great.  
for better understand change the name to template1.odt or something different to default available template.

The 2nd file you uploaded is the default template you selected to generate odt.  
before generate odt document you need to select the 1st odt template.

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [May 3, 2019, 12:24pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/15 "2019-05-03T12:24:01Z")

</div>

Thank you Nazeer, I’ll try that.

---

<div class="post-metadata">

**Author:** ![AngelBR](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/a/9e8a1a/32.png) [@AngelBR](https://www.dolibarr.org/forum/u/AngelBR)\
**Post date:** [May 3, 2019, 1:13pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/16 "2019-05-03T13:13:26Z")

</div>

Actually, the second file I uploaded (Prov7\_order.odt) was generated by Dolibarr when I tried to create a draft order.

---

<div class="post-metadata">

**Author:** ![nazeer](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/nazeer/32/37_2.png) [@nazeer](https://www.dolibarr.org/forum/u/nazeer)\
**Post date:** [May 6, 2019, 3:48am UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/17 "2019-05-06T03:48:35Z")

</div>

can you send full screenshot of your draft order

---

<div class="post-metadata">

**Author:** ![nazeer](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/nazeer/32/37_2.png) [@nazeer](https://www.dolibarr.org/forum/u/nazeer)\
**Post date:** [May 6, 2019, 3:53am UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/18 "2019-05-06T03:53:35Z")

</div>

First thing to do is rename your customized odt template to something else. eg. xyz.odt

After renaming check xyz.odt it should be desired template.

Next select xyz.odt template to generate order document in Order card.

---

<div class="post-metadata">

**Author:** ![paulorcdo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/paulorcdo/32/445_2.png) [@paulorcdo](https://www.dolibarr.org/forum/u/paulorcdo)\
**Post date:** [February 22, 2022, 12:25pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/19 "2022-02-22T12:25:02Z")

</div>

Hello, it is possible to do this by creating a new pdf template with the settings you want, I just made a module for invoices in a company here in Brazil.

I’m trying to answer all Brazilians’ questions and create an environment to improve communication here User Group Dolibarr Brasil

\*Olá, é possível fazer isso criando um novo template do pdf com os ajustes que você deseja, acabei de fazer um módulo para faturas em uma empresa aqui no Brasil. \*

_Estou tentando responder todas as dúvidas dos brasileiros e criar um ambiente para melhorar a comunicação aqui [Grupo de Usuários Dolibarr Brasil](https://www.dolibarr.org/forum/t/grupo-de-usuarios-dolibarr-brasil/21903)_

---

<div class="post-metadata">

**Author:** ![priojk](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/priojk/32/6121_2.png) [@priojk](https://www.dolibarr.org/forum/u/priojk)\
**Post date:** [February 22, 2022, 1:45pm UTC](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568/20 "2022-02-22T13:45:01Z")

</div>

Hi @paulorcdo,

just a friendly request from my side.

While I appreciate that you are currently trying to set up a Brazilian user group, unfortunately, the number of Portuguese contributions in this English speaking forum starts to reach a level, which I am not very comfortable with.

In particular, this discussion thread which you are currently “hijacking”, has been so far completely in English, benefitting an international audience.

I would very much appreciate, if we can keep the English forum in English. I suppose the Dolibarr organisation would be happy to support you creating a Portuguese forum in the same way as forums for different languages currently exist.

Thank you,

Joachim

[Next page](https://www.dolibarr.org/forum/t/get-order-field-to-print-on-pdf/17568.md?page=2)
