Completed
Branch develop (2dd6cc)
by
unknown
26:03
created
htdocs/salaries/card.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 			// Create a line of payments
315 315
 			$paiement = new PaymentSalary($db);
316 316
 			$paiement->fk_salary    = $object->id;
317
-			$paiement->chid         = $object->id;	// deprecated
317
+			$paiement->chid         = $object->id; // deprecated
318 318
 			$paiement->datep        = $datep;
319
-			$paiement->datev		= $datev;
319
+			$paiement->datev = $datev;
320 320
 			$paiement->amounts      = array($object->id => $amount); // Tableau de montant
321 321
 			$paiement->fk_typepayment = $type_payment;
322 322
 			$paiement->num_payment  = GETPOST("num_payment", 'alphanohtml');
@@ -345,10 +345,10 @@  discard block
 block discarded – undo
345 345
 
346 346
 			if (GETPOST('saveandnew', 'alpha')) {
347 347
 				setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
348
-				header("Location: card.php?action=create&fk_project=" . urlencode((string) ($projectid)) . "&accountid=" . urlencode((string) ($accountid)) . '&paymenttype=' . urlencode((string) (GETPOSTINT('paymenttype'))) . '&datepday=' . GETPOSTINT("datepday") . '&datepmonth=' . GETPOSTINT("datepmonth") . '&datepyear=' . GETPOSTINT("datepyear"));
348
+				header("Location: card.php?action=create&fk_project=".urlencode((string) ($projectid))."&accountid=".urlencode((string) ($accountid)).'&paymenttype='.urlencode((string) (GETPOSTINT('paymenttype'))).'&datepday='.GETPOSTINT("datepday").'&datepmonth='.GETPOSTINT("datepmonth").'&datepyear='.GETPOSTINT("datepyear"));
349 349
 				exit;
350 350
 			} else {
351
-				header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id);
351
+				header("Location: ".$_SERVER['PHP_SELF'].'?id='.$object->id);
352 352
 				exit;
353 353
 			}
354 354
 		} else {
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 
639 639
 	// Auto create payment
640 640
 	print '<tr><td><label for="auto_create_paiement">'.$langs->trans('AutomaticCreationPayment').'</label></td>';
641
-	print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_paiement) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n";	// Date payment
641
+	print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.(empty($auto_create_paiement) ? '' : 'checked="checked"').' value="1"></td></tr>'."\n"; // Date payment
642 642
 
643 643
 	// Bank
644 644
 	if (isModEnabled("bank")) {
@@ -906,10 +906,10 @@  discard block
 block discarded – undo
906 906
 			$userstatic = new User($db);
907 907
 			$result = $userstatic->fetch($object->fk_user);
908 908
 			if ($result > 0) {
909
-				$morehtmlref .= '<br>' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
909
+				$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1);
910 910
 			}
911 911
 		} else {
912
-			$morehtmlref .= '<br>' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1);
912
+			$morehtmlref .= '<br>'.$form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1);
913 913
 
914 914
 			if (!empty($object->fk_user)) {
915 915
 				$userstatic = new User($db);
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 		print "</td></tr>";
977 977
 	} else {
978 978
 		print "<tr>";
979
-		print '<td class="titlefieldmiddle">' . $langs->trans("DateStartPeriod") . '</td><td>';
979
+		print '<td class="titlefieldmiddle">'.$langs->trans("DateStartPeriod").'</td><td>';
980 980
 		print dol_print_date($object->datesp, 'day');
981 981
 		print '</td></tr>';
982 982
 	}
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 		print "</td></tr>";
988 988
 	} else {
989 989
 		print "<tr>";
990
-		print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>';
990
+		print '<td>'.$langs->trans("DateEndPeriod").'</td><td>';
991 991
 		print dol_print_date($object->dateep, 'day');
992 992
 		print '</td></tr>';
993 993
 	}
@@ -1002,9 +1002,9 @@  discard block
 block discarded – undo
1002 1002
 	print '</td></tr>';*/
1003 1003
 
1004 1004
 	if ($action == 'edit') {
1005
-		print '<tr><td class="fieldrequired">' . $langs->trans("Amount") . '</td><td><input name="amount" size="10" value="' . price($object->amount) . '"></td></tr>';
1005
+		print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.price($object->amount).'"></td></tr>';
1006 1006
 	} else {
1007
-		print '<tr><td>' . $langs->trans("Amount") . '</td><td><span class="amount">' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</span></td></tr>';
1007
+		print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>';
1008 1008
 	}
1009 1009
 
1010 1010
 	// Default mode of payment
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 			if (empty($user->socid)) {
1191 1191
 				$canSendMail = true;
1192 1192
 
1193
-				print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail);
1193
+				print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail);
1194 1194
 			}
1195 1195
 		}
1196 1196
 
@@ -1206,12 +1206,12 @@  discard block
 block discarded – undo
1206 1206
 
1207 1207
 		// Transfer request
1208 1208
 		if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) {
1209
-			print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT . '/salaries/virement_request.php?id=' . $object->id, '');
1209
+			print dolGetButtonAction('', $langs->trans('MakeTransferRequest'), 'default', DOL_URL_ROOT.'/salaries/virement_request.php?id='.$object->id, '');
1210 1210
 		}
1211 1211
 
1212 1212
 		// Emit payment
1213 1213
 		if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) {
1214
-			print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='. $object->id, '');
1214
+			print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='.$object->id, '');
1215 1215
 		}
1216 1216
 
1217 1217
 		// Classify 'paid'
Please login to merge, or discard this patch.
htdocs/includes/OAuth/Common/Http/Client/AbstractClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     {
64 64
         $normalizeHeaders = [];
65 65
         foreach ($headers as $key => $val) {
66
-            $val = ucfirst(strtolower($key)) . ': ' . $val;
66
+            $val = ucfirst(strtolower($key)).': '.$val;
67 67
             $normalizeHeaders[$key] = $val;
68 68
         }
69 69
 
Please login to merge, or discard this patch.
htdocs/categories/class/categorie.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -50,25 +50,25 @@  discard block
 block discarded – undo
50 50
 class Categorie extends CommonObject
51 51
 {
52 52
 	// Categories types (we use string because we want to accept any modules/types in a future)
53
-	const TYPE_PRODUCT				= 'product';
53
+	const TYPE_PRODUCT = 'product';
54 54
 	const TYPE_SUPPLIER				= 'supplier';
55 55
 	const TYPE_CUSTOMER				= 'customer';
56
-	const TYPE_MEMBER				= 'member';
56
+	const TYPE_MEMBER = 'member';
57 57
 	const TYPE_CONTACT				= 'contact';
58
-	const TYPE_USER					= 'user';
58
+	const TYPE_USER = 'user';
59 59
 	const TYPE_PROJECT				= 'project';
60 60
 	const TYPE_ACCOUNT				= 'bank_account';
61 61
 	const TYPE_BANK_LINE			= 'bank_line';
62 62
 	const TYPE_WAREHOUSE			= 'warehouse';
63
-	const TYPE_ACTIONCOMM			= 'actioncomm';
64
-	const TYPE_WEBSITE_PAGE			= 'website_page';
65
-	const TYPE_TICKET				= 'ticket';
66
-	const TYPE_KNOWLEDGEMANAGEMENT	= 'knowledgemanagement';
67
-	const TYPE_FICHINTER			= 'fichinter';
68
-	const TYPE_ORDER				= 'order';
69
-	const TYPE_INVOICE				= 'invoice';
70
-	const TYPE_SUPPLIER_ORDER		= 'supplier_order';
71
-	const TYPE_SUPPLIER_INVOICE		= 'supplier_invoice';
63
+	const TYPE_ACTIONCOMM = 'actioncomm';
64
+	const TYPE_WEBSITE_PAGE = 'website_page';
65
+	const TYPE_TICKET = 'ticket';
66
+	const TYPE_KNOWLEDGEMANAGEMENT = 'knowledgemanagement';
67
+	const TYPE_FICHINTER = 'fichinter';
68
+	const TYPE_ORDER = 'order';
69
+	const TYPE_INVOICE = 'invoice';
70
+	const TYPE_SUPPLIER_ORDER = 'supplier_order';
71
+	const TYPE_SUPPLIER_INVOICE = 'supplier_invoice';
72 72
 
73 73
 
74 74
 	/**
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 			'categorie_contact' => 'fk_categorie',
758 758
 			'categorie_fournisseur' => 'fk_categorie',
759 759
 			'categorie_knowledgemanagement' => array('field' => 'fk_categorie', 'enabled' => isModEnabled('knowledgemanagement')),
760
-			'categorie_fichinter' => array('field' => 'fk_categorie', 'enabled' => false ),  // not yet fully implemented (wait 22) isModEnabled('intervention')),
760
+			'categorie_fichinter' => array('field' => 'fk_categorie', 'enabled' => false), // not yet fully implemented (wait 22) isModEnabled('intervention')),
761 761
 			'categorie_member' => 'fk_categorie',
762 762
 			'categorie_user' => 'fk_categorie',
763 763
 			'categorie_product' => 'fk_categorie',
@@ -1359,14 +1359,14 @@  discard block
 block discarded – undo
1359 1359
 					|| preg_match('/'.$keyfilter3.'/', $fullpath) || preg_match('/'.$keyfilter4.'/', $fullpath));
1360 1360
 
1361 1361
 				if (($test && !$include) || (!$test && $include)) {
1362
-					unset($this->cats[$key]);  // @phpstan-ignore-line
1362
+					unset($this->cats[$key]); // @phpstan-ignore-line
1363 1363
 				}
1364 1364
 			}
1365 1365
 		}
1366 1366
 
1367 1367
 		dol_syslog(get_class($this)."::get_full_arbo dol_sort_array", LOG_DEBUG);
1368 1368
 
1369
-		$this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1);		// Sort on full label like "Label 1 >> Sublabel a >> Subsublabel"
1369
+		$this->cats = dol_sort_array($this->cats, 'fulllabel', 'asc', 1, 0, 1); // Sort on full label like "Label 1 >> Sublabel a >> Subsublabel"
1370 1370
 
1371 1371
 		return $this->cats;
1372 1372
 	}
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
 		$parents = $this->get_meres();
1625 1625
 		if (is_array($parents)) {
1626 1626
 			foreach ($parents as $parent) {
1627
-				$all_ways = $parent->get_all_ways();	// recursivity. TODO Add a protection for infinite loop
1627
+				$all_ways = $parent->get_all_ways(); // recursivity. TODO Add a protection for infinite loop
1628 1628
 				foreach ($all_ways as $way) {
1629 1629
 					$w = $way;
1630 1630
 					$w[] = $this;
@@ -1784,10 +1784,10 @@  discard block
 block discarded – undo
1784 1784
 	 */
1785 1785
 	public function isAnyPhotoAvailable($sdir)
1786 1786
 	{
1787
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
1788
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php';
1787
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
1788
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
1789 1789
 
1790
-		$sdir .= '/' . get_exdir($this->id, 2, 0, 0, $this, 'category') . $this->id . "/photos/";
1790
+		$sdir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'category').$this->id."/photos/";
1791 1791
 
1792 1792
 		$dir_osencoded = dol_osencode($sdir);
1793 1793
 		if (file_exists($dir_osencoded)) {
@@ -1797,7 +1797,7 @@  discard block
 block discarded – undo
1797 1797
 					if (!utf8_check($file)) {
1798 1798
 						$file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory
1799 1799
 					}
1800
-					if (dol_is_file($sdir . $file) && image_format_supported($file) >= 0) {
1800
+					if (dol_is_file($sdir.$file) && image_format_supported($file) >= 0) {
1801 1801
 						return true;
1802 1802
 					}
1803 1803
 				}
@@ -1920,7 +1920,7 @@  discard block
 block discarded – undo
1920 1920
 		$result .= $linkend;
1921 1921
 
1922 1922
 		global $action;
1923
-		$hookmanager->initHooks(array($this->element . 'dao'));
1923
+		$hookmanager->initHooks(array($this->element.'dao'));
1924 1924
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1925 1925
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1926 1926
 		if ($reshook > 0) {
Please login to merge, or discard this patch.
htdocs/public/stripe/ipn.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 		if (!empty($user->email)) {
195 195
 			$sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">";
196 196
 		} else {
197
-			$sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
197
+			$sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
198 198
 		}
199 199
 		$replyto = $sendto;
200 200
 		$sendtocc = '';
201 201
 		if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) {
202
-			$sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>';
202
+			$sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>';
203 203
 		}
204 204
 
205 205
 		$message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." should arrive in your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour');
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
 				if (!empty($user->email)) {
298 298
 					$sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">";
299 299
 				} else {
300
-					$sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
300
+					$sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>';
301 301
 				}
302 302
 				$replyto = $sendto;
303 303
 				$sendtocc = '';
304 304
 				if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) {
305
-					$sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>';
305
+					$sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>';
306 306
 				}
307 307
 
308 308
 				$message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour');
@@ -348,19 +348,19 @@  discard block
 block discarded – undo
348 348
 	dol_syslog("object = ".var_export($event->data, true));
349 349
 	dol_syslog("object = ".var_export($event->data, true), LOG_DEBUG, 0, '_payment');
350 350
 
351
-	include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
351
+	include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
352 352
 	global $stripearrayofkeysbyenv;
353 353
 	$error = 0;
354 354
 	$object = $event->data->object;
355
-	$TRANSACTIONID = $object->id;	// Example pi_123456789...
355
+	$TRANSACTIONID = $object->id; // Example pi_123456789...
356 356
 	$ipaddress = $object->metadata->ipaddress;
357 357
 	$now = dol_now();
358 358
 	$currencyCodeType = strtoupper($object->currency);
359 359
 	$paymentmethodstripeid = $object->payment_method;
360 360
 	$customer_id = $object->customer;
361 361
 	$invoice_id = "";
362
-	$paymentTypeCode = "";			// payment type according to Stripe
363
-	$paymentTypeCodeInDolibarr = "";	// payment type according to Dolibarr
362
+	$paymentTypeCode = ""; // payment type according to Stripe
363
+	$paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr
364 364
 	$payment_amount = 0;
365 365
 	$payment_amountInDolibarr = 0;
366 366
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 		$s = new \Stripe\StripeClient($stripeacc);
434 434
 
435 435
 		$paymentmethodstripe = $s->paymentMethods->retrieve($paymentmethodstripeid);
436
-		$paymentTypeCode =  $paymentmethodstripe->type;
436
+		$paymentTypeCode = $paymentmethodstripe->type;
437 437
 		if ($paymentTypeCode == "ban" || $paymentTypeCode == "sepa_debit") {
438 438
 			$paymentTypeCode = "PRE";
439 439
 		} elseif ($paymentTypeCode == "card") {
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
 			$paiement->datepaye = $now;
461 461
 			$paiement->date = $now;
462 462
 			if ($currencyCodeType == $conf->currency) {
463
-				$paiement->amounts = [$invoice_id => $payment_amount];   // Array with all payments dispatching with invoice id
463
+				$paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id
464 464
 			} else {
465
-				$paiement->multicurrency_amounts = [$invoice_id => $payment_amount];   // Array with all payments dispatching
465
+				$paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching
466 466
 
467 467
 				$postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')';
468 468
 				$ispostactionok = -1;
@@ -485,8 +485,8 @@  discard block
 block discarded – undo
485 485
 
486 486
 			$paiement->num_payment = '';
487 487
 			$paiement->note_public = '';
488
-			$paiement->note_private = 'Stripe Sepa payment received by IPN service listening webhooks - ' . dol_print_date($now, 'standard') . ' (TZ server) using servicestatus=' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID;
489
-			$paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key'];		// May be we should store py_... instead of pi_... but we started with pi_... so we continue.
488
+			$paiement->note_private = 'Stripe Sepa payment received by IPN service listening webhooks - '.dol_print_date($now, 'standard').' (TZ server) using servicestatus='.$servicestatus.($ipaddress ? ' from ip '.$ipaddress : '').' - Transaction ID = '.$TRANSACTIONID;
489
+			$paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue.
490 490
 			$paiement->ext_payment_site = $service;
491 491
 
492 492
 			$ispaymentdone = 0;
@@ -505,23 +505,23 @@  discard block
 block discarded – undo
505 505
 			$db->begin();
506 506
 
507 507
 			if (!$error && !$ispaymentdone) {
508
-				dol_syslog('* Record payment type PRE for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document.');
509
-				dol_syslog('* Record payment type PRE for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document.', LOG_DEBUG, 0, '_payment');
508
+				dol_syslog('* Record payment type PRE for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document.');
509
+				dol_syslog('* Record payment type PRE for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document.', LOG_DEBUG, 0, '_payment');
510 510
 
511 511
 				// This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document
512 512
 				$paiement_id = $paiement->create($user, 1);
513 513
 				if ($paiement_id < 0) {
514
-					$postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors);
514
+					$postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors);
515 515
 					$ispostactionok = -1;
516 516
 					$error++;
517 517
 
518
-					dol_syslog("Failed to create the payment for invoice id " . $invoice_id);
519
-					dol_syslog("Failed to create the payment for invoice id " . $invoice_id, LOG_DEBUG, 0, '_payment');
518
+					dol_syslog("Failed to create the payment for invoice id ".$invoice_id);
519
+					dol_syslog("Failed to create the payment for invoice id ".$invoice_id, LOG_DEBUG, 0, '_payment');
520 520
 				} else {
521 521
 					$postactionmessages[] = 'Payment created';
522 522
 
523
-					dol_syslog("The payment has been created for invoice id " . $invoice_id);
524
-					dol_syslog("The payment has been created for invoice id " . $invoice_id, LOG_DEBUG, 0, '_payment');
523
+					dol_syslog("The payment has been created for invoice id ".$invoice_id);
524
+					dol_syslog("The payment has been created for invoice id ".$invoice_id, LOG_DEBUG, 0, '_payment');
525 525
 				}
526 526
 			}
527 527
 
@@ -553,14 +553,14 @@  discard block
 block discarded – undo
553 553
 						$label = '(CustomerInvoicePayment)';
554 554
 						$result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $customer_id, '');
555 555
 						if ($result < 0) {
556
-							$postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . implode("<br>\n", $paiement->errors);
556
+							$postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').implode("<br>\n", $paiement->errors);
557 557
 							$ispostactionok = -1;
558 558
 							$error++;
559 559
 						} else {
560 560
 							$postactionmessages[] = 'Bank transaction of payment created (by ipn.php file)';
561 561
 						}
562 562
 					} else {
563
-						$postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.';
563
+						$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
564 564
 						$ispostactionok = -1;
565 565
 						$error++;
566 566
 					}
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 			$error++;
733 733
 		}
734 734
 
735
-		if (! $error) {
735
+		if (!$error) {
736 736
 			$db->commit();
737 737
 		} else {
738 738
 			$db->rollback();
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 		$companypaymentmode->card_type       = $event->data->object->card->branding;
767 767
 
768 768
 		$companypaymentmode->owner_name      = $event->data->object->billing_details->name;
769
-		$companypaymentmode->proprio         = $companypaymentmode->owner_name;			// We may still need this formodulebuilder because name of field is "proprio"
769
+		$companypaymentmode->proprio         = $companypaymentmode->owner_name; // We may still need this formodulebuilder because name of field is "proprio"
770 770
 
771 771
 		$companypaymentmode->exp_date_month  = (int) $event->data->object->card->exp_month;
772 772
 		$companypaymentmode->exp_date_year   = (int) $event->data->object->card->exp_year;
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 		$companypaymentmode->label           = '';
809 809
 		$companypaymentmode->number          = $db->escape($event->data->object->id);
810 810
 		$companypaymentmode->last_four       = $db->escape($event->data->object->card->last4);
811
-		$companypaymentmode->proprio         = $db->escape($event->data->object->billing_details->name);	// deprecated
811
+		$companypaymentmode->proprio         = $db->escape($event->data->object->billing_details->name); // deprecated
812 812
 		$companypaymentmode->owner_name      = $db->escape($event->data->object->billing_details->name);
813 813
 		$companypaymentmode->exp_date_month  = (int) $event->data->object->card->exp_month;
814 814
 		$companypaymentmode->exp_date_year   = (int) $event->data->object->card->exp_year;
@@ -864,12 +864,12 @@  discard block
 block discarded – undo
864 864
 	$paymentmethodstripeid = $object->payment_method;
865 865
 	$customer_id = $object->customer;
866 866
 	$reason = $object->reason;
867
-	$amountdisputestripe = $object->amoutndispute;	// In stripe format
868
-	$amountdispute = $amountdisputestripe;			// In real currency format
867
+	$amountdisputestripe = $object->amoutndispute; // In stripe format
868
+	$amountdispute = $amountdisputestripe; // In real currency format
869 869
 
870 870
 	$invoice_id = 0;
871
-	$paymentTypeCode = "";			// payment type according to Stripe
872
-	$paymentTypeCodeInDolibarr = "";	// payment type according to Dolibarr
871
+	$paymentTypeCode = ""; // payment type according to Stripe
872
+	$paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr
873 873
 	$payment_amount = 0;
874 874
 	$payment_amountInDolibarr = 0;
875 875
 
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 	$paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching
952 952
 	*/
953 953
 	$paiement->paiementid   = dol_getIdFromCode($db, 'PRE', 'c_paiement', 'code', 'id', 1);
954
-	$paiement->num_payment  = $object->id;	// A string like 'du_...'
954
+	$paiement->num_payment  = $object->id; // A string like 'du_...'
955 955
 	$paiement->note_public = 'Fund withdrawn by bank. Reason: '.$reason;
956 956
 	$paiement->note_private = '';
957 957
 	$paiement->fk_account   = $accountfrom->id;
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 		$error++;
968 968
 	}
969 969
 
970
-	if (! $error && $tmpinvoice->status == Facture::STATUS_CLOSED) {
970
+	if (!$error && $tmpinvoice->status == Facture::STATUS_CLOSED) {
971 971
 		// Switch back the invoice to status validated
972 972
 		$result = $tmpinvoice->setStatut(Facture::STATUS_VALIDATED);
973 973
 		if ($result < 0) {
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 		}
977 977
 	}
978 978
 
979
-	if (! $error) {
979
+	if (!$error) {
980 980
 		$paiement_id = $paiement->create($user, 0, $tmpinvoice->thirdparty); // This include regenerating documents
981 981
 		if ($paiement_id < 0) {
982 982
 			$errormsg = $paiement->error.implode(', ', $paiement->errors);
Please login to merge, or discard this patch.