From 17ae12abfdf91ac4e5e5ea78f9cc072fb2953d93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Feb 2023 21:09:20 +0100 Subject: [PATCH] Fix warning --- htdocs/compta/facture/class/facture.class.php | 4 ++-- htdocs/expedition/card.php | 2 +- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8505af85ce5..dcf43bcf0cb 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3245,7 +3245,7 @@ class Facture extends CommonInvoice $sortorder = 'ASC,ASC,ASC,ASC'; } - $resBatchList = $productbatch->findAllForProduct($productStatic->id, $idwarehouse, (!empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER) ? null : 0), $sortfield, $sortorder); + $resBatchList = $productbatch->findAllForProduct($productStatic->id, $idwarehouse, (getDolGlobalInt('STOCK_ALLOW_NEGATIVE_TRANSFER') ? null : 0), $sortfield, $sortorder); if (!is_array($resBatchList)) { $error++; $this->error = $this->db->lasterror(); @@ -3288,7 +3288,7 @@ class Facture extends CommonInvoice } if (!$error && $product_qty_remain > 0) { - if ($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER) { + if (getDolGlobalInt('STOCK_ALLOW_NEGATIVE_TRANSFER')) { // take in the first batch $batch = $batchList[0]; $result = $mouvP->livraison($user, $productStatic->id, $idwarehouse, $product_qty_remain, $this->lines[$i]->subprice, $langs->trans('InvoiceValidatedInDolibarr', $num), '', '', '', $batch->batch); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index a9fcea34440..97e846f3054 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1268,7 +1268,7 @@ if ($action == 'create') { print ''; $stockMin = false; - if (empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { + if (!getDolGlobalInt('STOCK_ALLOW_NEGATIVE_TRANSFER')) { $stockMin = 0; } print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1, 0, array(), 'minwidth200', '', 1, $stockMin, 'stock DESC, e.ref'); diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 2392962a500..6c491bfc6e0 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -391,7 +391,7 @@ class MouvementStock extends CommonObject // Check if stock is enough when qty is < 0 // Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2. - if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { + if ($movestock && $qty < 0 && !getDolGlobalInt('STOCK_ALLOW_NEGATIVE_TRANSFER')) { if (isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { $foundforbatch = 0; $qtyisnotenough = 0;