Merge pull request #14952 from TobiasSekan/AllowZeroQualityOnSupplierOrderLines

NEW Allow zero quality on supplier/vendor order line
This commit is contained in:
Laurent Destailleur 2020-10-07 15:07:53 +02:00 committed by GitHub
commit 415840e346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -1554,7 +1554,7 @@ class CommandeFournisseur extends CommonOrder
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (!$qty) $qty = 1;
if (empty($qty)) $qty = 0;
if (!$info_bits) $info_bits = 0;
if (empty($txtva)) $txtva = 0;
if (empty($txlocaltax1)) $txlocaltax1 = 0;
@ -2526,7 +2526,6 @@ class CommandeFournisseur extends CommonOrder
$remise_percent = price2num($remise_percent);
$qty = price2num($qty);
if (!$qty) $qty = 1;
$pu = price2num($pu);
$pu_ht_devise = price2num($pu_ht_devise);
$txtva = price2num($txtva);

View File

@ -406,7 +406,7 @@ if (empty($reshook))
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
$error++;
}
if (!GETPOST('qty'))
if (GETPOST('qty', 'int') == '')
{
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error++;
@ -666,7 +666,7 @@ if (empty($reshook))
$productsupplier = new ProductFournisseur($db);
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');
}
@ -719,7 +719,7 @@ if (empty($reshook))
$lineid,
$_POST['product_desc'],
$ht,
$_POST['qty'],
GETPOST('qty', 'int'),
$_POST['remise_percent'],
$vat_rate,
$localtax1_rate,