Product / service on Dolibarr 2.6

Hi !

Is it possible to display information Product / Service on PDF ?
For exemple like in web interface with a little pics with a hand under a box ?

The best of all could be an option witch can be activate or no in configuration :wink:

Where can I find ALL the hidden option for dolibarr (htdocs/admin/const.php) ?

All hidden features are described on wiki page:

http://wiki.dolibarr.org/index.php/First_setup

(still waiting for translation in english)

This option didn’t work !

PRODUCT_ADD_TYPE_IN_DOCUMENTS => Ajoute le texte « Produit » ou « Service » devant les lignes détails sur les PDF générés.

This is a little anoying thing, when your forget to select Product or service, you loose all you enter…

Up

Is there a way to make this option work ?
PRODUCT_ADD_TYPE_IN_DOCUMENTS

Is there a way to make dolibarr remember what we have input, if we forget to select Product or Service ?

Thanks

Hi,

way to make working the option PRODUCT_ADD_TYPE_IN_DOCUMENTS:

with admin user:

go to menu « home->setup->other setup » and add the value PRODUCT_ADD_TYPE_IN_DOCUMENTS in the name field, value 0 or 1 in the value field (disabled or active).

…And test the results :wink:

A fix has been done in CVS to remember the description if product/service type has been forgotten.

Simnandez wrote:

Hummm In fact it works with product from database !

If I input something with the flag product or service directly in my document, it isn’t printed on the documents !

eldy wrote:

Thanks :wink:

All hidden options are available on page
http://wiki.dolibarr.org/index.php/First_setup

If you find one not in this list. Tell us, this means it was forgotten but there is no other space.

J’ai la même erreur.
Lorsque c’est un produit dans la base de données, aucun problème.
Par contre lorsqu’il s’agit des lignes rajoutées manuellement en service ou produit, ils se mettent tous en Produit même si c’est un service.
Je pense que la fonction $prodser->isService() dans pdf.lib.php ne fonctionne pas sur les lignes manuelles.

:1st_place_medal:
image

Blague à part, je ne pense pas qu’une réponse donnée il y a 12 ans puisse encore être valable aujourd’hui ^^

En effet, mais je me suis dis qu’il n’était pas nécessaire de créer un nouveau.
Je corrige actuellement le problème… et posterai le nouveau code d’ici peu

Voici le code qui permet de mettre si c’est un produit ou service sur les lignes entrées manuellement.

if (!empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS))   // In standard mode, we do not show this
    {
        if (isset($prodser->id))
        {
            if ($prodser->isService())
            {
                $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
            }
            else
            {
                $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Product")." ";
            }
        }
        else
        {
            if ($object->lines[$i]->product_type == 1)
            {
                $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
            }
            else if ($object->lines[$i]->product_type == 0)
            {
                $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Product")." ";
            }
        }
    }

Je fais un teste sur $prodser->id, je suppose que si c’est un produit entrée manuellement, il n’a pas d’ID dans la base de données.

Cela implique de modifier le fichier pdf.lib.php qui sera écrasé à la prochaine MAJ.

Faut-il faire une PR ?