Allow zero quality on supplier order line
This commit is contained in:
parent
85fc471d3d
commit
3f39766064
@ -1554,7 +1554,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (!$qty) $qty = 1;
|
if (empty($qty)) $qty = 0;
|
||||||
if (!$info_bits) $info_bits = 0;
|
if (!$info_bits) $info_bits = 0;
|
||||||
if (empty($txtva)) $txtva = 0;
|
if (empty($txtva)) $txtva = 0;
|
||||||
if (empty($txlocaltax1)) $txlocaltax1 = 0;
|
if (empty($txlocaltax1)) $txlocaltax1 = 0;
|
||||||
@ -2526,7 +2526,6 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
$remise_percent = price2num($remise_percent);
|
$remise_percent = price2num($remise_percent);
|
||||||
$qty = price2num($qty);
|
$qty = price2num($qty);
|
||||||
if (!$qty) $qty = 1;
|
|
||||||
$pu = price2num($pu);
|
$pu = price2num($pu);
|
||||||
$pu_ht_devise = price2num($pu_ht_devise);
|
$pu_ht_devise = price2num($pu_ht_devise);
|
||||||
$txtva = price2num($txtva);
|
$txtva = price2num($txtva);
|
||||||
|
|||||||
@ -406,7 +406,7 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (!GETPOST('qty'))
|
if (GETPOST('qty', 'int') == '')
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -666,7 +666,7 @@ if (empty($reshook))
|
|||||||
$productsupplier = new ProductFournisseur($db);
|
$productsupplier = new ProductFournisseur($db);
|
||||||
if (!empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY))
|
if (!empty($conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY))
|
||||||
{
|
{
|
||||||
if ($line->fk_product > 0 && $productsupplier->get_buyprice(0, price2num($_POST['qty']), $line->fk_product, 'none', GETPOST('socid', 'int')) < 0)
|
if ($line->fk_product > 0 && $productsupplier->get_buyprice(0, price2num(GETPOST('qty', 'int')), $line->fk_product, 'none', GETPOST('socid', 'int')) < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings');
|
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings');
|
||||||
}
|
}
|
||||||
@ -719,7 +719,7 @@ if (empty($reshook))
|
|||||||
$lineid,
|
$lineid,
|
||||||
$_POST['product_desc'],
|
$_POST['product_desc'],
|
||||||
$ht,
|
$ht,
|
||||||
$_POST['qty'],
|
GETPOST('qty', 'int'),
|
||||||
$_POST['remise_percent'],
|
$_POST['remise_percent'],
|
||||||
$vat_rate,
|
$vat_rate,
|
||||||
$localtax1_rate,
|
$localtax1_rate,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user