In the diffrent documents of Dolibarr (business proposition, orders, invoices), it’s possible to choose the buying price used to calculate the mark-up (if the mark-up module is enabled, of course).

But this list lacks an important information, namely the name of the supplier corresponding to each suggested price.

Again, the modification is quite simple :

  1. You have to modigy the file fourn/ajax/getSupplierPrices.php to pick up the name of the supplier :

line 49 $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, s.nom,";

line 103 $prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title, "fourn" => $objp->nom);

2) You then have to modify the template core/tpl/objectline_create.php to display the name :

line 464 options += '>'+this.label+' ('+this.fourn+')</option>';

Note that these line numbers correspond to the 3.6.3 version of Dolibarr

These modifications will be suggested asap on github to be integrated in Dolibarr’s core.

Dans les différents documents de Dolibarr (propales, commandes, factures), il est possible de choisir le prix d’achat utilisé pour calculer les marges (si on a activé auparavant le module marges, bien sûr).

Or cette liste de prix manque d’une information essentielle, à savoir le nom du fournisseur correspondant à chaque prix proposé.

Là encore, la modification est relativement simple :

1) il faut modifier le fichier fourn/ajax/getSupplierPrices.php pour récupérer le nom du fournisseur :

ligne 49 $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, s.nom,";

ligne 103 $prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title, "fourn" => $objp->nom);

2) il faut ensuite modifier le template core/tpl/objectline_create.php pour afficher le nom :

ligne 464 options += '>'+this.label+' ('+this.fourn+')</option>';

Notez que les numéros de ligne correspondent à une version 3.6.3 de dolibarr

Ces modifications seront proposées asap sur github pour être intégrées dans le coeur de Dolibarr.