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

Fix: Regression for negative proposal lines.

parent 1e5c5664
No related branches found
No related tags found
No related merge requests found
......@@ -635,7 +635,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++;
}
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal.
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
$error++;
......@@ -646,7 +646,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
$error++;
}
if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod)))
if (! $error && (GETPOST('qty') != 0) && (! empty($product_desc) || ! empty($idprod))) // Price can be negative for proposal.
{
$pu_ht=0;
$pu_ttc=0;
......@@ -1191,7 +1191,7 @@ if ($action == 'create')
}
print '<table class="border" width="100%">';
// Reference
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans("Draft").'</td></tr>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment