Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.27k stars 2.73k forks source link

Importing supplier prices (of products or services) does not work as expected: supplier code unusable #15490

Closed zuiko closed 2 years ago

zuiko commented 3 years ago

Bug

Version: 12.0.3
OS: Linux Debian 3.16.64-2 (2019-04-01) x86_64
Web server: Apache/2
PHP: PHP 5.6.40
Database: MySQL or MariaDB 5.6.48-log
URL(s): /imports/import.php?step=2&datatoimport=produit_supplierprices&excludefirstline=1&separator=%2C&enclosure=%22

Expected and actual behavior

Wanting to import supplier product prices for existing supplier, I used a csv file formatted like the template provided. For the 2 first columns, the template indicates: Produit ou Service (sp.fk_product),Fournisseur (sp.fk_soc) PRODUCT_REF or id:123456,My Supplier but if you simply put a product reference on the 1st column and a supplier code on the 2d this line will be rejected. One way to have a chance to import such information is to fill: Produit ou Service (sp.fk_product),Fournisseur (sp.fk_soc) ref:PRODUCT_REF,id:12345 So, to have a chance to do that, you need, before, to export suppliers to take their id. This way is not very convenient and does not conform to the model provided. It would be better, at least, to accept ref:SUPPLIER_CODE for sp.fk_soc The best could be, to be able to fill directly with the product code (even numerical) and the supplier code without any prefix (ref: or id:).

Steps to reproduce the behavior

In order to import product supplier prices, fill a csv file with data in accordance with the model provided and and see the rejection.

Attached files (Screenshots, screencasts, dolibarr.log, debugging informations…)

[template provided]

Produit ou Service (sp.fk_product),Fournisseur (sp.fk_soc),Réf. produit fournisseur (sp.ref_fourn),Qté achat minimum (sp.quantity),Taux TVA (sp.tva_tx),Code Taux TVA (sp.default_vat_code),DeliveryDelay (sp.delivery_time_days),SupplierReputation (sp.supplier_reputation),Prix quantité min. HT (sp.price),Prix unitaire HT (sp.unitprice),Remise par défaut quantité min. (sp.remise_percent) PRODUCT_REF or id:123456,My Supplier,XYZ-F123456,5,10,,5,FAVORITE / NOTTHGOOD / DONOTORDER,50.00,10,20

StephaneLesage commented 3 years ago

Hi, I was confronted to the same problem but for contacts and sales representatives which I fixed. So I modified my PR #15489 to all imports including supplier prices, which should solve your problem. This is currently applicable to the dev branch for v13.0 coming release. I'll try to do the patch for v12 also.

zuiko commented 3 years ago

Hi, Thank you for having synthesized and generalized the problem I expressed and especially for having actively engaged the fix of the bug.

eldy commented 3 years ago

Fixed in PR #15489

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).