Close

Altairis Blog

Altairis Blog

Dolibarr – Display the name of the supplier during the selection of the buying price

Dolibarr – Display the name of the supplier during the selection of the buying price

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.