Update fournisseur.product.class.php

This commit is contained in:
Laurent Destailleur 2019-12-14 22:25:34 +01:00 committed by GitHub
parent cc1454c8d5
commit e9a0646f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,7 +391,6 @@ class ProductFournisseur extends Product
return -2;
}
}
else
{
dol_syslog(get_class($this) . '::update_buyprice without knowing id of line, so we delete from company, quantity and supplier_ref and insert again', LOG_DEBUG);
@ -434,6 +433,8 @@ class ProductFournisseur extends Product
$sql .= (empty($fk_barcode_type) ? 'NULL' : "'" . $this->db->escape($fk_barcode_type) . "'");
$sql .= ")";
$this->product_fourn_price_id = 0;
$resql = $this->db->query($sql);
if ($resql) {
$this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price");