Skip to content
Snippets Groups Projects
Commit 6ac7e225 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #1494 from atm-gauthier/3.5

Correction when adding line with price as '0'
parents ed4f7fd0 eb43bc49
No related branches found
No related tags found
No related merge requests found
...@@ -219,8 +219,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) ...@@ -219,8 +219,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error++; $error++;
} }
if (! GETPOST('addline_predefined') && (! GETPOST('pu') || GETPOST('pu')=='')) // Unit price can be 0 but not '' if (! GETPOST('addline_predefined') && ( GETPOST('pu')==='')) // Unit price can be 0 but not ''
{ {
setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors');
$error++; $error++;
} }
...@@ -239,7 +240,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) ...@@ -239,7 +240,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
// Ecrase $pu par celui du produit // Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit // Ecrase $desc par celui du produit
// Ecrase $txtva par celui du produit // Ecrase $txtva par celui du produit
if (GETPOST('addline_predefined') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' if ((GETPOST('addline_predefined') || GETPOST('idprodfournprice')) && ( GETPOST('pu')!=='')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or ''
{ {
$idprod=0; $idprod=0;
$productsupplier = new ProductFournisseur($db); $productsupplier = new ProductFournisseur($db);
...@@ -299,7 +300,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) ...@@ -299,7 +300,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors'); setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors');
} }
} }
else else if( GETPOST('pu')!=='' || GETPOST('amountttc')!=='' )
{ {
$type=$_POST["type"]; $type=$_POST["type"];
$desc=$_POST['dp_desc']; $desc=$_POST['dp_desc'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment