Wrond source for material to Supplier

Hi all,
we are using a version 5.0.5 of Dolibarr. Today i had to create a new vendor (supplier) and to attach some new materials with all attributes - buying price, supplier ref. and so on. The problem occurs when i have place a purchase order to this new supplier with the new materials. The price in the order to the supplier for each new material was different from this one i set u earlier. When i looked over the PDF form i saw that the system tools randomly for each material the price and reference number from other materials that are already created and we are using them regularly. I didn’t create the new materials by copying them from other already created but from just the begging.
Amy idea what could be the problem?!

Thanks!

Hello everyone,

Something similar happens to me also. If I create a new product with its supplier price and then I add into a new purchase order, it results into a random prince and discount different from the one I wrote in the product. Then, if I go back to the product I can see the correct price.
It is very weird and very annoying.
It started happening after upgrading from 4.0.2 to 5.0.5. In the database, the table llx_product_fournisseur_price seems to be properly completed.
Any help will be appreciated.

Best regards

Can you reproduce on demo.dolibarr.org and provide ref of Purchase Order concerned ?

I have just tried to reproduce it in the demo site but there it works properly. Perhaps it is something related to the upgrade.

Hi there,
it’s works very well in the test database but in the updates versions it’s a problem. Here, you may see some pics from my real database what goes wrong:

  1. FGL_1.jpg - shows a record for the material in the buying section (a supplier, a material number in my system and in the suppliers system, the price that is from this supplier)
  2. FGL_2.jpg - shows what is happening when i am trying to place an order for this material to the same supplier (price is different)
  3. FGL_3.jpg - shows the PDF order and it seems that the supplier’s material code for this item is not the correct one. The system took a material code for another item that is ordered from another supplier. In the same time the item number that is in our system is correct.

Also i found out that if i place a price request for the same material to the again this supplier and then generate an order everything is correct and as it should be. The thing is that we are not using a price request to have a prices for the materials. We are entering a complete price lists from all of our suppliers and generating a purchase orders directly.
If you can advise us how we can clear this problem it will be great.

BR!

And the pics

Pièces jointes :

Hello,

I did some investigation and I have found how to fix it.
The error is in the file htdocs/fourn/commande/card.php and was introduced in the version 5.0.5. I have a dolibarr 6 installed and checked it only substituting this file with versions 5.0.4 and 5.0.5. With 5.0.4 price is ok when adding a line in a supply order but is not using 5.0.5 version of the file.
To fix it I have changed the $productsupplier->id by a GETPOST(‘idprodfournprice’) in the line 393 (dolibarr 5.0.5) or 412 (dolibarr 6.0.0).
I hope this helps to someone else.

Best regards

Hi there,
i have tried it but no. It gives this Error - see the attached pic.

Pièces jointes :

I am very sorry for you… I can not see atached pictures.

It says: syntax error, unexpected ‘$productsupplier’ (T_VARIABLE) in …/card.php on line 394

BR!

Hello,
Try this one. This is for 5.0.5 with this line edited and tested.
Good look.

Let’s see if this link to the file on wetransfer works:
https://wetransfer.com/downloads/451bd40fbf442156654367ae0f357bf720170915095557/6cf395a60c8eaecb6e1b1a2a7d16223920170915095557/64f167

1 Like

Hi there, now everything works properly.
Thanks for the help!

BR!