Fix: Regression. Show bad error message when we add a product with no

prices defined.
This commit is contained in:
Laurent Destailleur 2012-11-25 20:38:39 +01:00
parent e76ef823b8
commit b977ea5d87

View File

@ -466,10 +466,19 @@ elseif ($action == 'addline')
}
$ret=$object->fetch_thirdparty();
if ($_POST['idprodfournprice']) // > 0 or -1
if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or ''
{
$product=new Product($db);
$idprod=$product->get_buyprice($_POST['idprodfournprice'], $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat
$idprod=0;
$product=new Product($db);
if (GETPOST('idprodfournprice') == '')
{
$idprod=-1;
}
if (GETPOST('idprodfournprice') > 0)
{
$idprod=$product->get_buyprice(GETPOST('idprodfournprice'), $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat
}
if ($idprod > 0)
{