Get order field to print on PDF

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?

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.

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

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

Use the line_options_xxx tag to create and insert your custom attributes.

hope this helps

Ok, I’ll try that.

Many thanks

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 ?

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

Thank you!

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 :frowning:
Any help is greatly appreciated.

Hi,

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

template_order.odt (16.4 KB)

PROV7_order.odt (33.9 KB)
Sure!

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.

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

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.

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.

Thank you Nazeer, I’ll try that.

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

can you send full screenshot of your draft order

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.

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

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