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] 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; }