Extrafield -> Third parties | Crabe PDF-PHP

Dolibarr 11.0.3

I use a modified version of the Crabe-PDF -PHP, in which I use, among other things, Extrafield from the Invoices module. It works very well and is not difficult.

Unfortunately, this does not work with Extrafield from the “Partner” module (third party)

The following is available in PHP:
The entry:

require_once DOL_DOCUMENT_ROOT. '/ core / class / extrafields.class.php';

and I add the extra field with a:

$ pdf-> MultiCell ($ w, 3, 'ID:'. $ outputlangs-> convToOutputCharset. $ object-> array_options, '', 'L');

The result is that the content is not displayed in the PDF.

Can someone help?

Hi Karl-Heinz,

If you really wrote that line, it had very poor chance to work.

First reread the wiki on extrafields (https://wiki.dolibarr.org/index.php/Extrafields#Display_extrafield_value_into_PDF_or_HTML), the array_options is… an array. You will find quite some information on how to use the extrafields, including in pdf models.

Second, you need to ensure you are looking at the “right” options. I mean, in crabe, $object normally relates to the invoice, while customer data are in $object->thirdparty (unless you want to load them apart).

Third, convToOutputCharset is a function taking the string as an argument to convert it as the right character set.

Regards,
Marc

Hi,

Have a look there : https://wiki.dolibarr.org/index.php/Add_Extrafields_on_PDF_Models
and espcialy here : https://wiki.dolibarr.org/index.php/Add_Extrafields_on_PDF_Models#Special_Case_for_Third_party_extrafields

117/5000

Thanks for the help, I got it done.
With: $object->thirdparty->array_options ['options_super_service_number']

The mistake was in the path. Originally $object->array_options.
The correct path is: $object->thirdparty->array_options

2 Likes