Try to fix 7492

check if enough quantity
This commit is contained in:
dolibarr95 2017-09-26 14:13:11 +02:00 committed by GitHub
parent d1bee67b40
commit 7b106bc642

View File

@ -561,6 +561,13 @@ if (empty($reshook))
if (!$res) dol_print_error($db); if (!$res) dol_print_error($db);
} }
if( $productsupplier->get_buyprice(0, price2num($_POST['qty']), $line->fk_product, 'none', GETPOST('socid','int')) < 0 )
{
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors');
}
else
{
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
@ -678,6 +685,7 @@ if (empty($reshook))
exit; exit;
} }
} }
}
// Remove a product line // Remove a product line
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)