From 172c8decdf2796eb2b9f5719cba8501e5e4abca2 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 29 Nov 2022 15:39:48 +0100 Subject: [PATCH 1/2] Fix(Scrutinizer) https://scrutinizer-ci.com/g/Dolibarr/dolibarr/issues/develop/files/htdocs/product/reassortlot.php?selectedLabels%5B0%5D=9&selectedSeverities%5B0%5D=10&orderField=lastFound&order=desc&honorSelectedPaths=0 --- htdocs/product/reassortlot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index f3ad55d526d..5b5c7dbafa0 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -635,7 +635,7 @@ while ($i < $imaxinloop) { $product_static->status_batch = $objp->tobatch; $product_lot_static->batch = $objp->batch; - $product_lot_static->product_id = $objp->rowid; + $product_lot_static->fk_product = $objp->rowid; $product_lot_static->id = $objp->lotid; $product_lot_static->eatby = $objp->eatby; $product_lot_static->sellby = $objp->sellby; From 374aaad80034e8b1e35b50fed0318e9b7b98c9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 29 Nov 2022 21:35:00 +0100 Subject: [PATCH 2/2] fix warnings --- htdocs/compta/paiement/card.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 58a27c94974..4930ce9e53c 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -67,12 +67,11 @@ if ($socid && $socid != $object->thirdparty->id) { $error = 0; - /* * Actions */ -if ($action == 'setnote' && $user->rights->facture->paiement) { +if ($action == 'setnote' && $user->hasRight('facture', 'paiement')) { $db->begin(); $result = $object->update_note(GETPOST('note', 'restricthtml')); @@ -142,13 +141,13 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture $invoice = new Facture($db); if ($invoice->fetch($objp->facid) <= 0) { - $errors++; + $error++; setEventMessages($invoice->error, $invoice->errors, 'errors'); break; } if ($invoice->generateDocument($invoice->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) { - $errors++; + $error++; setEventMessages($invoice->error, $invoice->errors, 'errors'); break; } @@ -159,12 +158,12 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture $db->free($resql); } else { - $errors++; + $error++; setEventMessages($db->error, $db->errors, 'errors'); } } - if (! $errors) { + if (! $error) { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); exit; }