Fix: Regression for negative proposal lines.
This commit is contained in:
parent
1e5c56642c
commit
f041a8a95e
@ -635,7 +635,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
|||||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
|
||||||
$error++;
|
$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');
|
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -646,7 +646,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
|||||||
$error++;
|
$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_ht=0;
|
||||||
$pu_ttc=0;
|
$pu_ttc=0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user