Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a

This commit is contained in:
Laurent Destailleur 2014-02-28 16:00:57 +01:00
parent de159d569a
commit 74404749c6
2 changed files with 12 additions and 4 deletions

View File

@ -186,7 +186,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$error = 0;
// Set if we used free entry or predefined product
if (GETPOST('addline_libre'))
if (GETPOST('addline_libre')
|| (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
{
$predef='';
$idprod=0;
@ -194,7 +196,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$price_ht = GETPOST('price_ht');
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
}
if (GETPOST('addline_predefined'))
if (GETPOST('addline_predefined')
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
{
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
$idprod=GETPOST('idprod', 'int');

View File

@ -532,7 +532,9 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
$error=0;
// Set if we used free entry or predefined product
if (GETPOST('addline_libre'))
if (GETPOST('addline_libre')
|| (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
{
$predef='';
$idprod=0;
@ -540,7 +542,9 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
$price_ht = GETPOST('price_ht');
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
}
if (GETPOST('addline_predefined'))
if (GETPOST('addline_predefined')
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
{
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
$idprod=GETPOST('idprod', 'int');