Browse Source

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

Laurent Destailleur 2 years ago
parent
commit
f460a3db2b
2 changed files with 6 additions and 7 deletions
  1. 5 6
      htdocs/compta/paiement/card.php
  2. 1 1
      htdocs/product/reassortlot.php

+ 5 - 6
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;
 		}

+ 1 - 1
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;