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; } diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index babdcce2783..40c8fcf4292 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;