diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index ed8084d18dc..8f6df313506 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -590,7 +590,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $prodcustprice = new Productcustomerprice($db); - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result >= 0) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d81ee394fbf..26c777f788d 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1156,7 +1156,7 @@ else if ($action == 'addline' && $user->rights->facture->creer) $prodcustprice = new Productcustomerprice($db); - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result >= 0) {