Fix: displays error when the supplier price does not exist.

This commit is contained in:
Bahfir Abbes 2016-02-26 22:48:01 +01:00
parent 5e2261c9bd
commit 4cbc1539b9

View File

@ -1012,8 +1012,9 @@ if (empty($reshook))
$array_option = $lines[$i]->array_options; $array_option = $lines[$i]->array_options;
} }
$idprod = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty); $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty);
$res = $productsupplier->fetch($idprod); if ($result>0) {
$productsupplier->fetch($productsupplier->id);
$soc=new societe($db); $soc=new societe($db);
$soc->fetch($socid); $soc->fetch($socid);
$tva_tx=($origin=="commande")?get_default_tva($soc,$mysoc,$lines[$i]->fk_product,$idprod):$lines[$i]->tva_tx; $tva_tx=($origin=="commande")?get_default_tva($soc,$mysoc,$lines[$i]->fk_product,$idprod):$lines[$i]->tva_tx;
@ -1038,7 +1039,7 @@ if (empty($reshook))
array(), array(),
$lines[$i]->fk_unit $lines[$i]->fk_unit
); );
}
if ($result < 0) { if ($result < 0) {
$error++; $error++;
break; break;