Passed
Branch develop (7dcc66)
by Laurent
27:25
created
htdocs/salaries/payment_salary/card.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 	$result = $object->fetch($id);
48 48
 	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
49 49
 }
50
-restrictedArea($user, 'salaries', $object->fk_salary, 'salary', '');	// $object is payment of salary
50
+restrictedArea($user, 'salaries', $object->fk_salary, 'salary', ''); // $object is payment of salary
51 51
 
52 52
 
53 53
 /*
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,9 @@  discard block
 block discarded – undo
31 31
 require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
32 32
 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
33 33
 require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
34
-if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
34
+if (!empty($conf->banque->enabled)) {
35
+	require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
36
+}
35 37
 
36 38
 // Load translation files required by the page
37 39
 $langs->loadLangs(array('bills', 'banks', 'companies', 'salaries'));
@@ -40,13 +42,17 @@  discard block
 block discarded – undo
40 42
 $id = GETPOST("id", 'int');
41 43
 $action = GETPOST('action', 'aZ09');
42 44
 $confirm = GETPOST('confirm');
43
-if ($user->socid) $socid = $user->socid;
45
+if ($user->socid) {
46
+	$socid = $user->socid;
47
+}
44 48
 
45 49
 $object = new PaymentSalary($db);
46 50
 if ($id > 0) {
47 51
 	$result = $object->fetch($id);
48
-	if (!$result) dol_print_error($db, 'Failed to get payment id '.$id);
49
-}
52
+	if (!$result) {
53
+		dol_print_error($db, 'Failed to get payment id '.$id);
54
+	}
55
+	}
50 56
 restrictedArea($user, 'salaries', $object->fk_salary, 'salary', '');	// $object is payment of salary
51 57
 
52 58
 
Please login to merge, or discard this patch.
htdocs/projet/class/project.class.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,8 +126,8 @@
 block discarded – undo
126 126
 	public $usage_bill_time; // Is the time spent on project must be invoiced or not
127 127
 
128 128
 	/**
129
-	   * @var integer		Event organization: Use Event Organization
130
-	   */
129
+	 * @var integer		Event organization: Use Event Organization
130
+	 */
131 131
 	public $usage_organize_event;
132 132
 
133 133
 	/**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1601,7 +1601,7 @@
 block discarded – undo
1601 1601
 
1602 1602
 				foreach (array('internal', 'external') as $source) {
1603 1603
 					$tab = $origin_project->liste_contact(-1, $source);
1604
-					if (is_array($tab) && count($tab)>0) {
1604
+					if (is_array($tab) && count($tab) > 0) {
1605 1605
 						foreach ($tab as $contacttoadd) {
1606 1606
 							$clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger);
1607 1607
 							if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
Please login to merge, or discard this patch.
htdocs/compta/tva/index.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
 
240 240
 	print '<table class="noborder centpercent">';
241 241
 	print '<tr class="liste_titre">';
242
-	print '<td width="30%">' . $langs->trans("Year") . " " . $y . '</td>';
243
-	print '<td class="right">' . $langs->trans("VATToPay") . '</td>';
244
-	print '<td class="right">' . $langs->trans("VATToCollect") . '</td>';
245
-	print '<td class="right">' . $langs->trans("Balance") . '</td>';
246
-	print '<td>&nbsp;</td>' . "\n";
247
-	print '</tr>' . "\n";
242
+	print '<td width="30%">'.$langs->trans("Year")." ".$y.'</td>';
243
+	print '<td class="right">'.$langs->trans("VATToPay").'</td>';
244
+	print '<td class="right">'.$langs->trans("VATToCollect").'</td>';
245
+	print '<td class="right">'.$langs->trans("Balance").'</td>';
246
+	print '<td>&nbsp;</td>'."\n";
247
+	print '</tr>'."\n";
248 248
 
249 249
 	$tmp = dol_getdate($date_start);
250 250
 	$y = $tmp['year'];
@@ -388,17 +388,17 @@  discard block
 block discarded – undo
388 388
 
389 389
 		if (!is_array($x_coll) && $coll_listbuy == -1) {
390 390
 			$langs->load("errors");
391
-			print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
391
+			print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
392 392
 			break;
393 393
 		}
394 394
 		if (!is_array($x_paye) && $coll_listbuy == -2) {
395
-			print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
395
+			print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
396 396
 			break;
397 397
 		}
398 398
 
399 399
 
400 400
 		print '<tr class="oddeven">';
401
-		print '<td class="nowrap"><a href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?leftmenu=tax_vat&month=' . $m . '&year=' . $y . '">' . dol_print_date(dol_mktime(0, 0, 0, $m, 1, $y), "%b %Y") . '</a></td>';
401
+		print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/tva/quadri_detail.php?leftmenu=tax_vat&month='.$m.'&year='.$y.'">'.dol_print_date(dol_mktime(0, 0, 0, $m, 1, $y), "%b %Y").'</a></td>';
402 402
 
403 403
 		$x_coll_sum = 0;
404 404
 		foreach (array_keys($x_coll) as $rate) {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 				$x_coll_sum += $temp_vat;
439 439
 			}
440 440
 		}
441
-		print '<td class="nowrap right"><span class="amount">' . price(price2num($x_coll_sum, 'MT')) . '</span></td>';
441
+		print '<td class="nowrap right"><span class="amount">'.price(price2num($x_coll_sum, 'MT')).'</span></td>';
442 442
 
443 443
 		$x_paye_sum = 0;
444 444
 		foreach (array_keys($x_paye) as $rate) {
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 				$x_paye_sum += $temp_vat;
479 479
 			}
480 480
 		}
481
-		print '<td class="nowrap right"><span class="amount">' . price(price2num($x_paye_sum, 'MT')) . '</span></td>';
481
+		print '<td class="nowrap right"><span class="amount">'.price(price2num($x_paye_sum, 'MT')).'</span></td>';
482 482
 
483 483
 		$subtotalcoll = $subtotalcoll + $x_coll_sum;
484 484
 		$subtotalpaye = $subtotalpaye + $x_paye_sum;
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 		$total = $total + $diff;
488 488
 		$subtotal = price2num($subtotal + $diff, 'MT');
489 489
 
490
-		print '<td class="nowrap right"><span class="amount">' . price(price2num($diff, 'MT')) . '</span></td>' . "\n";
490
+		print '<td class="nowrap right"><span class="amount">'.price(price2num($diff, 'MT')).'</span></td>'."\n";
491 491
 		print "<td>&nbsp;</td>\n";
492 492
 		print "</tr>\n";
493 493
 
@@ -496,10 +496,10 @@  discard block
 block discarded – undo
496 496
 		$m++;
497 497
 		if ($i > 2) {
498 498
 			print '<tr class="liste_total">';
499
-			print '<td class="right"><a href="quadri_detail.php?leftmenu=tax_vat&q=' . round($m / 3) . '&year=' . $y . '">' . $langs->trans("SubTotal") . '</a>:</td>';
500
-			print '<td class="nowrap right">' . price(price2num($subtotalcoll, 'MT')) . '</td>';
501
-			print '<td class="nowrap right">' . price(price2num($subtotalpaye, 'MT')) . '</td>';
502
-			print '<td class="nowrap right">' . price(price2num($subtotal, 'MT')) . '</td>';
499
+			print '<td class="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m / 3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
500
+			print '<td class="nowrap right">'.price(price2num($subtotalcoll, 'MT')).'</td>';
501
+			print '<td class="nowrap right">'.price(price2num($subtotalpaye, 'MT')).'</td>';
502
+			print '<td class="nowrap right">'.price(price2num($subtotal, 'MT')).'</td>';
503 503
 			print '<td>&nbsp;</td></tr>';
504 504
 			$i = 0;
505 505
 			$subtotalcoll = 0;
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 			$subtotal = 0;
508 508
 		}
509 509
 	}
510
-	print '<tr class="liste_total"><td class="right" colspan="3">' . $langs->trans("TotalToPay") . ':</td><td class="nowrap right">' . price(price2num($total, 'MT')) . '</td>';
510
+	print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("TotalToPay").':</td><td class="nowrap right">'.price(price2num($total, 'MT')).'</td>';
511 511
 	print "<td>&nbsp;</td>\n";
512 512
 	print '</tr>';
513 513
 
@@ -525,18 +525,18 @@  discard block
 block discarded – undo
525 525
 	$sql = '';
526 526
 
527 527
 	$sql .= "SELECT SUM(amount) as mm, date_format(tva.datev,'%Y-%m') as dm, 'claimed' as mode";
528
-	$sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva";
529
-	$sql .= " WHERE tva.entity = " . $conf->entity;
530
-	$sql .= " AND (tva.datev >= '" . $db->idate($date_start) . "' AND tva.datev <= '" . $db->idate($date_end) . "')";
528
+	$sql .= " FROM ".MAIN_DB_PREFIX."tva as tva";
529
+	$sql .= " WHERE tva.entity = ".$conf->entity;
530
+	$sql .= " AND (tva.datev >= '".$db->idate($date_start)."' AND tva.datev <= '".$db->idate($date_end)."')";
531 531
 	$sql .= " GROUP BY dm";
532 532
 
533 533
 	$sql .= " UNION ";
534 534
 
535 535
 	$sql .= "SELECT SUM(ptva.amount) as mm, date_format(tva.datev,'%Y-%m') as dm, 'paid' as mode";
536
-	$sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva";
537
-	$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "payment_vat as ptva ON (tva.rowid = ptva.fk_tva)";
538
-	$sql .= " WHERE tva.entity = " . $conf->entity;
539
-	$sql .= " AND (tva.datev >= '" . $db->idate($date_start) . "' AND tva.datev <= '" . $db->idate($date_end) . "')";
536
+	$sql .= " FROM ".MAIN_DB_PREFIX."tva as tva";
537
+	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_vat as ptva ON (tva.rowid = ptva.fk_tva)";
538
+	$sql .= " WHERE tva.entity = ".$conf->entity;
539
+	$sql .= " AND (tva.datev >= '".$db->idate($date_start)."' AND tva.datev <= '".$db->idate($date_end)."')";
540 540
 	$sql .= " GROUP BY dm";
541 541
 
542 542
 	$sql .= " ORDER BY dm ASC, mode ASC";
Please login to merge, or discard this patch.
htdocs/product/stock/massstockmove.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -311,14 +311,14 @@
 block discarded – undo
311 311
 		$importcsv = new ImportCsv($db, 'massstocklist');
312 312
 		//print $importcsv->separator;
313 313
 
314
-		$nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath)-1;
314
+		$nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath) - 1;
315 315
 		$importcsv->import_open_file($fullpath);
316 316
 		$labelsrecord = $importcsv->import_read_record();
317 317
 
318 318
 		if ($nblinesrecord < 1) {
319 319
 			setEventMessages($langs->trans("BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors');
320 320
 		} else {
321
-			$i=0;
321
+			$i = 0;
322 322
 			$data = array();
323 323
 			$productstatic = new Product($db);
324 324
 			$warehousestatics = new Entrepot($db);
Please login to merge, or discard this patch.
htdocs/admin/system/modules.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -286,19 +286,19 @@
 block discarded – undo
286 286
 
287 287
 // sort list
288 288
 if ($sortfield == "name" && $sortorder == "asc") {
289
-	usort($moduleList, function (stdClass $a, stdClass $b) {
289
+	usort($moduleList, function(stdClass $a, stdClass $b) {
290 290
 		return strcasecmp($a->name, $b->name);
291 291
 	});
292 292
 } elseif ($sortfield == "name" && $sortorder == "desc") {
293
-	usort($moduleList, function (stdClass $a, stdClass $b) {
293
+	usort($moduleList, function(stdClass $a, stdClass $b) {
294 294
 		return strcasecmp($b->name, $a->name);
295 295
 	});
296 296
 } elseif ($sortfield == "version" && $sortorder == "asc") {
297
-	usort($moduleList, function (stdClass $a, stdClass $b) {
297
+	usort($moduleList, function(stdClass $a, stdClass $b) {
298 298
 		return strcasecmp($a->version, $b->version);
299 299
 	});
300 300
 } elseif ($sortfield == "version" && $sortorder == "desc") {
301
-	usort($moduleList, function (stdClass $a, stdClass $b) {
301
+	usort($moduleList, function(stdClass $a, stdClass $b) {
302 302
 		return strcasecmp($b->version, $a->version);
303 303
 	});
304 304
 } elseif ($sortfield == "id" && $sortorder == "asc") {
Please login to merge, or discard this patch.
htdocs/compta/tva/class/tva.class.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		return $solde;
417 417
 	}
418 418
 
419
-    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
419
+	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
420 420
 	/**
421 421
 	 * 	Total of the VAT from invoices emitted by the thirdparty.
422 422
 	 *
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	 */
426 426
 	public function tva_sum_collectee($year = 0)
427 427
 	{
428
-        // phpcs:enable
428
+		// phpcs:enable
429 429
 
430 430
 		$sql = "SELECT sum(f.total_tva) as amount";
431 431
 		$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		}
451 451
 	}
452 452
 
453
-    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
453
+	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
454 454
 	/**
455 455
 	 * 	VAT payed
456 456
 	 *
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 	 */
460 460
 	public function tva_sum_payee($year = 0)
461 461
 	{
462
-        // phpcs:enable
462
+		// phpcs:enable
463 463
 
464 464
 		$sql = "SELECT sum(f.total_tva) as total_tva";
465 465
 		$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 	}
486 486
 
487 487
 
488
-    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
488
+	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
489 489
 	/**
490 490
 	 * 	Total of the VAT payed
491 491
 	 *
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 	 */
495 495
 	public function tva_sum_reglee($year = 0)
496 496
 	{
497
-        // phpcs:enable
497
+		// phpcs:enable
498 498
 
499 499
 		$sql = "SELECT sum(f.amount) as amount";
500 500
 		$sql .= " FROM ".MAIN_DB_PREFIX."tva as f";
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 		}
666 666
 	}
667 667
 
668
-    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
668
+	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
669 669
 	/**
670 670
 	 *  Update link between payment tva and line generate into llx_bank
671 671
 	 *
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 	 */
675 675
 	public function update_fk_bank($id_bank)
676 676
 	{
677
-        // phpcs:enable
677
+		// phpcs:enable
678 678
 		$sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.(int) $id_bank;
679 679
 		$sql .= ' WHERE rowid = '.(int) $this->id;
680 680
 		$result = $this->db->query($sql);
Please login to merge, or discard this patch.
htdocs/societe/checkvat/checkVatPopup.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  *		\brief      Popup screen to validate VAT
22 22
  */
23 23
 
24
-if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');		// Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
24
+if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
25 25
 
26 26
 require "../../main.inc.php";
27 27
 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,10 @@
 block discarded – undo
21 21
  *		\brief      Popup screen to validate VAT
22 22
  */
23 23
 
24
-if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');		// Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
24
+if (! defined('NOTOKENRENEWAL')) {
25
+	define('NOTOKENRENEWAL', '1');
26
+}
27
+// Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
25 28
 
26 29
 require "../../main.inc.php";
27 30
 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
Please login to merge, or discard this patch.
htdocs/api/class/api_login.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
60 60
 
61 61
 		// Is the login API disabled ? The token must be generated from backoffice only.
62
-		if (! empty($conf->global->API_DISABLE_LOGIN_API)) {
62
+		if (!empty($conf->global->API_DISABLE_LOGIN_API)) {
63 63
 			dol_syslog("Warning: A try to use the login API has been done while the login API is disabled. You must generate or get the token from the backoffice.", LOG_WARNING);
64 64
 			throw new RestException(403, "Error, the login API has been disabled for security purpose. You must generate or get the token from the backoffice.");
65 65
 		}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		}
92 92
 
93 93
 		include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
94
-		$login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api');		// Check credentials.
94
+		$login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials.
95 95
 		if (empty($login)) {
96 96
 			throw new RestException(403, 'Access denied');
97 97
 		}
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			}
113 113
 
114 114
 			// Generate token for user
115
-			$token = dol_hash($login.uniqid().(empty($conf->global->MAIN_API_KEY)?'':$conf->global->MAIN_API_KEY), 1);
115
+			$token = dol_hash($login.uniqid().(empty($conf->global->MAIN_API_KEY) ? '' : $conf->global->MAIN_API_KEY), 1);
116 116
 
117 117
 			// We store API token into database
118 118
 			$sql = "UPDATE ".MAIN_DB_PREFIX."user";
Please login to merge, or discard this patch.
htdocs/expedition/shipment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 	$socid = $user->socid;
80 80
 }
81 81
 
82
-$result = restrictedArea($user, 'expedition', 0, '');	// We use 0 for id, because there is no particular shipment on this tab, only id of order is known
82
+$result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, because there is no particular shipment on this tab, only id of order is known
83 83
 
84 84
 
85 85
 
Please login to merge, or discard this patch.