Completed
Branch develop (3cefab)
by
unknown
23:57
created
htdocs/public/payment/newpayment.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
 	if (getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) {
342 342
 		if ($tmpsource && $REF) {
343 343
 			// Use the source in the hash to avoid duplicates if the references are identical
344
-			$tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $tmpsource.$REF, $SECUREKEY, '2');
344
+			$tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$tmpsource.$REF, $SECUREKEY, '2');
345 345
 			// Do a second test for retro-compatibility (token may have been hashed with membersubscription in external module)
346 346
 			if ($tmpsource != $source) {
347
-				$tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $source.$REF, $SECUREKEY, '2');
347
+				$tokenisok = dol_verifyHash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$source.$REF, $SECUREKEY, '2');
348 348
 			}
349 349
 		} else {
350 350
 			$tokenisok = dol_verifyHash($conf->global->PAYMENT_SECURITY_TOKEN, $SECUREKEY, '2');
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		$tokenisok = ($conf->global->PAYMENT_SECURITY_TOKEN == $SECUREKEY);
354 354
 	}
355 355
 
356
-	if (! $tokenisok) {
356
+	if (!$tokenisok) {
357 357
 		if (!getDolGlobalString('PAYMENT_SECURITY_ACCEPT_ANY_TOKEN')) {
358 358
 			$valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility
359 359
 		} else {
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 $paramcreditor = 'ONLINE_PAYMENT_CREDITOR';
383 383
 $paramcreditorlong = 'ONLINE_PAYMENT_CREDITOR_'.$suffix;
384 384
 if (getDolGlobalString($paramcreditorlong)) {
385
-	$creditor = getDolGlobalString($paramcreditorlong);	// use label long of the seller to show
385
+	$creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show
386 386
 } elseif (getDolGlobalString($paramcreditor)) {
387
-	$creditor = getDolGlobalString($paramcreditor);		// use label short of the seller to show
387
+	$creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show
388 388
 }
389 389
 
390 390
 $mesg = '';
@@ -834,8 +834,8 @@  discard block
 block discarded – undo
834 834
 	$remoteip = getUserRemoteIP();
835 835
 
836 836
 	$_SESSION["onlinetoken"] = $stripeToken;
837
-	$_SESSION["FinalPaymentAmt"] = $amount;			// amount really paid (coming from Stripe). Will be used for check in paymentok.php.
838
-	$_SESSION["currencyCodeType"] = $currency;		// currency really used for payment (coming from Stripe). Will be used for check in paymentok.php.
837
+	$_SESSION["FinalPaymentAmt"] = $amount; // amount really paid (coming from Stripe). Will be used for check in paymentok.php.
838
+	$_SESSION["currencyCodeType"] = $currency; // currency really used for payment (coming from Stripe). Will be used for check in paymentok.php.
839 839
 	$_SESSION["paymentType"] = '';
840 840
 	$_SESSION['ipaddress'] = ($remoteip ? $remoteip : 'unknown'); // Payer ip
841 841
 	$_SESSION['payerID'] = is_object($customer) ? $customer->id : '';
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 
882 882
 $head = '';
883 883
 if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) {
884
-	$head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.(!empty($getpostlang) ? $getpostlang : $langs->defaultlang).'">'."\n";
884
+	$head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.(!empty($getpostlang) ? $getpostlang : $langs->defaultlang).'">'."\n";
885 885
 }
886 886
 
887 887
 $conf->dol_hide_topmenu = 1;
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 	if (preg_match('/^\((.*)\)$/', $conf->global->PAYMENT_NEWFORM_TEXT, $reg)) {
1006 1006
 		$text .= $langs->trans($reg[1])."<br>\n";
1007 1007
 	} else {
1008
-		$text .= getDolGlobalString('PAYMENT_NEWFORM_TEXT') . "<br>\n";
1008
+		$text .= getDolGlobalString('PAYMENT_NEWFORM_TEXT')."<br>\n";
1009 1009
 	}
1010 1010
 	$text = '<tr><td align="center"><br>'.$text.'<br></td></tr>'."\n";
1011 1011
 }
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 print $text;
1017 1017
 
1018 1018
 // Output payment summary form
1019
-print '<tr><td align="center">';	// class=center does not have the payment button centered so we keep align here.
1019
+print '<tr><td align="center">'; // class=center does not have the payment button centered so we keep align here.
1020 1020
 print '<table class="centpercent left" id="tablepublicpayment">';
1021 1021
 print '<tr class="hideonsmartphone"><td colspan="2" align="left" class="opacitymedium">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
1022 1022
 
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 		// Currency
1059 1059
 		print ' <b>'.$langs->trans("Currency".$currency).'</b>';
1060 1060
 	} else {
1061
-		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1061
+		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1062 1062
 		print '<input type="hidden" name="amount" value="'.$amount.'">';
1063 1063
 		print '<input type="hidden" name="newamount" value="'.$amount.'">';
1064 1064
 	}
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 		// Currency
1160 1160
 		print ' <b>'.$langs->trans("Currency".$currency).'</b>';
1161 1161
 	} else {
1162
-		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1162
+		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1163 1163
 		print '<input type="hidden" name="amount" value="'.$amount.'">';
1164 1164
 		print '<input type="hidden" name="newamount" value="'.$amount.'">';
1165 1165
 	}
@@ -1291,12 +1291,12 @@  discard block
 block discarded – undo
1291 1291
 			print '<input class="flat maxwidth75" type="text" name="newamount" value="'.price2num(GETPOST("newamount", "alpha"), 'MT').'">';
1292 1292
 			print ' <b>'.$langs->trans("Currency".$currency).'</b>';
1293 1293
 		} else {
1294
-			print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1294
+			print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1295 1295
 			print '<input type="hidden" name="amount" value="'.$amount.'">';
1296 1296
 			print '<input type="hidden" name="newamount" value="'.$amount.'">';
1297 1297
 		}
1298 1298
 	} else {
1299
-		print '<b class="amount">'.price($object->total_ttc, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1299
+		print '<b class="amount">'.price($object->total_ttc, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1300 1300
 	}
1301 1301
 	print '<input type="hidden" name="currency" value="'.$currency.'">';
1302 1302
 	print '</td></tr>'."\n";
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
 		// Currency
1501 1501
 		print ' <b>'.$langs->trans("Currency".$currency).'</b>';
1502 1502
 	} else {
1503
-		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1503
+		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1504 1504
 		print '<input type="hidden" name="amount" value="'.$amount.'">';
1505 1505
 		print '<input type="hidden" name="newamount" value="'.$amount.'">';
1506 1506
 	}
@@ -1562,7 +1562,7 @@  discard block
 block discarded – undo
1562 1562
 	$member = new Adherent($db);
1563 1563
 	$adht = new AdherentType($db);
1564 1564
 
1565
-	$result = $member->fetch(0, $ref, 0, '', true, true);	// This fetch also ->last_subscription_amount
1565
+	$result = $member->fetch(0, $ref, 0, '', true, true); // This fetch also ->last_subscription_amount
1566 1566
 	if ($result <= 0) {
1567 1567
 		$mesg = $member->error;
1568 1568
 		$error++;
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
 		$newtypeid = (int) (GETPOSTISSET("typeid") ? GETPOSTINT("typeid") : $member->typeid);
1667 1667
 		if (getDolGlobalString('MEMBER_ALLOW_CHANGE_OF_TYPE')) {
1668 1668
 			$typeid = $newtypeid;
1669
-			$adht->fetch($typeid);	// Reload with the new type id
1669
+			$adht->fetch($typeid); // Reload with the new type id
1670 1670
 		}
1671 1671
 
1672 1672
 		$caneditamount = $adht->caneditamount;
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
 	print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount");
1727 1727
 	// This place no longer allows amount edition
1728 1728
 	if (getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO')) {
1729
-		print ' - <a href="' . getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
1729
+		print ' - <a href="'.getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
1730 1730
 	}
1731 1731
 	print '</td><td class="CTableRow2">';
1732 1732
 
@@ -1740,9 +1740,9 @@  discard block
 block discarded – undo
1740 1740
 			print '<input type="text" class="width75" name="newamount" value="'.price($amount, 1, $langs, 1, -1, -1).'">';
1741 1741
 		}
1742 1742
 	} else {
1743
-		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1743
+		print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1744 1744
 		if ($minimumamount > $amount) {
1745
-			print ' &nbsp; <span class="opacitymedium small">'. $langs->trans("AmountIsLowerToMinimumNotice", price($minimumamount, 1, $langs, 1, -1, -1, $currency)).'</span>';
1745
+			print ' &nbsp; <span class="opacitymedium small">'.$langs->trans("AmountIsLowerToMinimumNotice", price($minimumamount, 1, $langs, 1, -1, -1, $currency)).'</span>';
1746 1746
 		}
1747 1747
 		print '<input type="hidden" name="newamount" value="'.$amount.'">';
1748 1748
 	}
@@ -1863,7 +1863,7 @@  discard block
 block discarded – undo
1863 1863
 			print ' ('.$langs->trans("ToComplete");
1864 1864
 		}
1865 1865
 		if (getDolGlobalString('DONATION_EXT_URL_SUBSCRIPTION_INFO')) {
1866
-			print ' - <a href="' . getDolGlobalString('DONATION_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
1866
+			print ' - <a href="'.getDolGlobalString('DONATION_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
1867 1867
 		}
1868 1868
 		if (!getDolGlobalString('DONATION_NEWFORM_AMOUNT')) {
1869 1869
 			print ')';
@@ -1901,7 +1901,7 @@  discard block
 block discarded – undo
1901 1901
 			$valtoshow = max(getDolGlobalString('DONATION_MIN_AMOUNT'), $valtoshow);
1902 1902
 			$amount = $valtoshow;
1903 1903
 		}
1904
-		print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1904
+		print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1905 1905
 		print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
1906 1906
 		print '<input type="hidden" name="newamount" value="'.$valtoshow.'">';
1907 1907
 	}
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
 	print '</b>';
1978 1978
 	print '</td></tr>'."\n";
1979 1979
 
1980
-	if (! is_object($attendee->project)) {
1980
+	if (!is_object($attendee->project)) {
1981 1981
 		$text = 'ErrorProjectNotFound';
1982 1982
 	} else {
1983 1983
 		$text = $langs->trans("PaymentEvent").' - '.$attendee->project->title;
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
 	print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount");
1995 1995
 	print '</td><td class="CTableRow2">';
1996 1996
 	$valtoshow = $amount;
1997
-	print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
1997
+	print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
1998 1998
 	print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
1999 1999
 	print '<input type="hidden" name="newamount" value="'.$valtoshow.'">';
2000 2000
 	print '<input type="hidden" name="currency" value="'.$currency.'">';
@@ -2078,7 +2078,7 @@  discard block
 block discarded – undo
2078 2078
 	print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount");
2079 2079
 	print '</td><td class="CTableRow2">';
2080 2080
 	$valtoshow = $amount;
2081
-	print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>';	// Price with currency
2081
+	print '<b class="amount">'.price($valtoshow, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
2082 2082
 	print '<input type="hidden" name="amount" value="'.$valtoshow.'">';
2083 2083
 	print '<input type="hidden" name="newamount" value="'.$valtoshow.'">';
2084 2084
 	print '<input type="hidden" name="currency" value="'.$currency.'">';
@@ -2335,7 +2335,7 @@  discard block
 block discarded – undo
2335 2335
 
2336 2336
 		//print '<br>';
2337 2337
 
2338
-		print '<!-- Show Stripe form payment-form STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = ' . getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION').' STRIPE_USE_NEW_CHECKOUT = ' . getDolGlobalString('STRIPE_USE_NEW_CHECKOUT').' -->'."\n";
2338
+		print '<!-- Show Stripe form payment-form STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = '.getDolGlobalString('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION').' STRIPE_USE_NEW_CHECKOUT = '.getDolGlobalString('STRIPE_USE_NEW_CHECKOUT').' -->'."\n";
2339 2339
 		print '<form action="'.$_SERVER['REQUEST_URI'].'" method="POST" id="payment-form">'."\n";
2340 2340
 
2341 2341
 		print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
Please login to merge, or discard this patch.
htdocs/compta/sociales/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 				$object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm');
294 294
 			} else {
295 295
 				// Note date_ech is often a little bit higher than dateperiod
296
-				$newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear'));	// = date of creation or due date
296
+				$newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear')); // = date of creation or due date
297 297
 				$newdateperiod = dol_mktime(0, 0, 0, GETPOSTINT('clone_periodmonth'), GETPOSTINT('clone_periodday'), GETPOSTINT('clone_periodyear'));
298 298
 
299 299
 				if ($newdateperiod) {
@@ -535,10 +535,10 @@  discard block
 block discarded – undo
535 535
 				$userstatic = new User($db);
536 536
 				$result = $userstatic->fetch($object->fk_user);
537 537
 				if ($result > 0) {
538
-					$morehtmlref .= '<br>' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(1);
538
+					$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(1);
539 539
 				}
540 540
 			} else {
541
-				$morehtmlref .= '<br>' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->hasRight('salaries', 'write'), 'string', '', 0, 1);
541
+				$morehtmlref .= '<br>'.$form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->hasRight('salaries', 'write'), 'string', '', 0, 1);
542 542
 				if ($object->fk_user > 0) {
543 543
 					$userstatic = new User($db);
544 544
 					$result = $userstatic->fetch($object->fk_user);
Please login to merge, or discard this patch.
htdocs/product/class/product.class.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	/**
151 151
 	 * @var string
152 152
 	 */
153
-	public $price_formated;			// used by takepos/ajax/ajax.php
153
+	public $price_formated; // used by takepos/ajax/ajax.php
154 154
 
155 155
 	/**
156 156
 	 * Selling price with tax
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	/**
163 163
 	 * @var string
164 164
 	 */
165
-	public $price_ttc_formated;		// used by takepos/ajax/ajax.php
165
+	public $price_ttc_formated; // used by takepos/ajax/ajax.php
166 166
 
167 167
 	/**
168 168
 	 * Minimum price net
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 	/**
512 512
 	 * @var int|string
513 513
 	 */
514
-	public $weight_units;	// scale -3, 0, 3, 6
514
+	public $weight_units; // scale -3, 0, 3, 6
515 515
 	/**
516 516
 	 * @var float|string
517 517
 	 */
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	/**
520 520
 	 * @var int|string
521 521
 	 */
522
-	public $length_units;	// scale -3, 0, 3, 6
522
+	public $length_units; // scale -3, 0, 3, 6
523 523
 	/**
524 524
 	 * @var float|string
525 525
 	 */
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 	/**
528 528
 	 * @var int|string
529 529
 	 */
530
-	public $width_units;	// scale -3, 0, 3, 6
530
+	public $width_units; // scale -3, 0, 3, 6
531 531
 	/**
532 532
 	 * @var float|string|null
533 533
 	 */
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * @var int|string|null
537 537
 	 */
538
-	public $height_units;	// scale -3, 0, 3, 6
538
+	public $height_units; // scale -3, 0, 3, 6
539 539
 	/**
540 540
 	 * @var float|string|null
541 541
 	 */
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	/**
544 544
 	 * @var int|string|null
545 545
 	 */
546
-	public $surface_units;	// scale -3, 0, 3, 6
546
+	public $surface_units; // scale -3, 0, 3, 6
547 547
 	/**
548 548
 	 * @var float|string|null
549 549
 	 */
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	/**
552 552
 	 * @var int|string|null
553 553
 	 */
554
-	public $volume_units;	// scale -3, 0, 3, 6
554
+	public $volume_units; // scale -3, 0, 3, 6
555 555
 
556 556
 	/**
557 557
 	 * @var float|string|null
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 	/**
561 561
 	 * @var ?string
562 562
 	 */
563
-	public $net_measure_units;	// scale -3, 0, 3, 6
563
+	public $net_measure_units; // scale -3, 0, 3, 6
564 564
 
565 565
 	/**
566 566
 	 * @var string
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 		'import_key'    => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
871 871
 		//'tosell'       =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
872 872
 		//'tobuy'        =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
873
-		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1,  'notnull' => 1, 'default' => '0', 'index' => 1,  'position' => 1000),
873
+		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
874 874
 	);
875 875
 
876 876
 	/**
@@ -1174,9 +1174,9 @@  discard block
 block discarded – undo
1174 1174
 
1175 1175
 							// update accountancy for this entity
1176 1176
 							if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1177
-								$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1177
+								$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1178 1178
 
1179
-								$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1179
+								$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1180 1180
 								$sql .= " fk_product";
1181 1181
 								$sql .= ", entity";
1182 1182
 								$sql .= ", accountancy_code_buy";
@@ -1187,13 +1187,13 @@  discard block
 block discarded – undo
1187 1187
 								$sql .= ", accountancy_code_sell_export";
1188 1188
 								$sql .= ") VALUES (";
1189 1189
 								$sql .= $this->id;
1190
-								$sql .= ", " . ((int) $conf->entity);
1191
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1192
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1193
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1194
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1195
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1196
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1190
+								$sql .= ", ".((int) $conf->entity);
1191
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1192
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1193
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1194
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1195
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1196
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1197 1197
 								$sql .= ")";
1198 1198
 								$result = $this->db->query($sql);
1199 1199
 								if (!$result) {
@@ -1574,12 +1574,12 @@  discard block
 block discarded – undo
1574 1574
 			$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null');
1575 1575
 			$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
1576 1576
 			if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1577
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
1578
-				$sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1579
-				$sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1580
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
1581
-				$sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1582
-				$sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1577
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
1578
+				$sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1579
+				$sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'";
1580
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
1581
+				$sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1582
+				$sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'";
1583 1583
 			}
1584 1584
 			$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null");
1585 1585
 			$sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null');
@@ -1609,9 +1609,9 @@  discard block
 block discarded – undo
1609 1609
 
1610 1610
 				// update accountancy for this entity
1611 1611
 				if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1612
-					$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1612
+					$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1613 1613
 
1614
-					$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1614
+					$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1615 1615
 					$sql .= " fk_product";
1616 1616
 					$sql .= ", entity";
1617 1617
 					$sql .= ", accountancy_code_buy";
@@ -1622,13 +1622,13 @@  discard block
 block discarded – undo
1622 1622
 					$sql .= ", accountancy_code_sell_export";
1623 1623
 					$sql .= ") VALUES (";
1624 1624
 					$sql .= ((int) $this->id);
1625
-					$sql .= ", " . ((int) $conf->entity);
1626
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1627
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1628
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1629
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1630
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1631
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1625
+					$sql .= ", ".((int) $conf->entity);
1626
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1627
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1628
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1629
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1630
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1631
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1632 1632
 					$sql .= ")";
1633 1633
 					$result = $this->db->query($sql);
1634 1634
 					if (!$result) {
@@ -1706,7 +1706,7 @@  discard block
 block discarded – undo
1706 1706
 								$error++;
1707 1707
 							} else {
1708 1708
 								// to keep old entries with the new dir
1709
-								require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
1709
+								require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
1710 1710
 								$ecmfiles = new EcmFiles($this->db);
1711 1711
 								$ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref));
1712 1712
 							}
@@ -2004,7 +2004,7 @@  discard block
 block discarded – undo
2004 2004
 				}
2005 2005
 			} elseif (isset($this->multilangs[$key])) {
2006 2006
 				if (empty($this->multilangs[$key]["label"])) {
2007
-					$this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2007
+					$this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2008 2008
 					return -1;
2009 2009
 				}
2010 2010
 
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 	 */
2202 2202
 	private function getArrayForPriceCompare($level = 0)
2203 2203
 	{
2204
-		$testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
2204
+		$testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly');
2205 2205
 
2206 2206
 		foreach ($testExit as $field) {
2207 2207
 			if (!isset($this->$field)) {
@@ -2891,12 +2891,12 @@  discard block
 block discarded – undo
2891 2891
 
2892 2892
 		// For MultiCompany
2893 2893
 		// PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
2894
-		$separatedEntityPMP = false;	// Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2895
-		$separatedStock = false;		// Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2894
+		$separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2895
+		$separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2896 2896
 		$visibleWarehousesEntities = $conf->entity;
2897 2897
 		if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
2898 2898
 			if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
2899
-				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2899
+				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2900 2900
 				if ($this->db->num_rows($checkPMPPerEntity) > 0) {
2901 2901
 					$separatedEntityPMP = true;
2902 2902
 				}
@@ -2904,7 +2904,7 @@  discard block
 block discarded – undo
2904 2904
 			global $mc;
2905 2905
 			$separatedStock = true;
2906 2906
 			if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) {
2907
-				$visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']);
2907
+				$visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']);
2908 2908
 			}
2909 2909
 		}
2910 2910
 		if ($separatedEntityPMP) {
@@ -2922,10 +2922,10 @@  discard block
 block discarded – undo
2922 2922
 		}
2923 2923
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2924 2924
 		if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) {
2925
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
2925
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
2926 2926
 		}
2927 2927
 		if ($separatedStock) {
2928
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2928
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2929 2929
 		}
2930 2930
 
2931 2931
 		if ($id) {
@@ -3087,15 +3087,15 @@  discard block
 block discarded – undo
3087 3087
 						$sql .= " WHERE entity IN (".getEntity('productprice').")";
3088 3088
 						$sql .= " AND price_level=".((int) $i);
3089 3089
 						$sql .= " AND fk_product = ".((int) $this->id);
3090
-						$sql .= " ORDER BY date_price DESC, rowid DESC";	// Get the most recent line
3091
-						$sql .= " LIMIT 1";									// Only the first one
3090
+						$sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line
3091
+						$sql .= " LIMIT 1"; // Only the first one
3092 3092
 						$resql = $this->db->query($sql);
3093 3093
 						if ($resql) {
3094 3094
 							$result = $this->db->fetch_array($resql);
3095 3095
 
3096 3096
 							$this->multiprices[$i] = $result ? $result["price"] : null;
3097 3097
 							$this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null;
3098
-							$this->multiprices_min[$i] =  $result ? $result["price_min"] : null;
3098
+							$this->multiprices_min[$i] = $result ? $result["price_min"] : null;
3099 3099
 							$this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null;
3100 3100
 							$this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null;
3101 3101
 							// Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on
@@ -3320,7 +3320,7 @@  discard block
 block discarded – undo
3320 3320
 				$obj = $this->db->fetch_object($result);
3321 3321
 				$this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0;
3322 3322
 				$this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0;
3323
-				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0;		// qty may be a float due to the SUM()
3323
+				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM()
3324 3324
 			} else {
3325 3325
 				$this->error = $this->db->error();
3326 3326
 				$error++;
@@ -4823,7 +4823,7 @@  discard block
 block discarded – undo
4823 4823
 				//Addition of a product with the highest rank +1
4824 4824
 				$sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)";
4825 4825
 				$sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")";
4826
-				if (! $this->db->query($sql)) {
4826
+				if (!$this->db->query($sql)) {
4827 4827
 					dol_print_error($this->db);
4828 4828
 					return -1;
4829 4829
 				} else {
@@ -4944,7 +4944,7 @@  discard block
 block discarded – undo
4944 4944
 				$sql = "UPDATE ".$this->db->prefix()."product_association";
4945 4945
 				$sql .= " SET rang = ".((int) $cpt);
4946 4946
 				$sql .= " WHERE rowid = ".((int) $objrank->rowid);
4947
-				if (! $this->db->query($sql)) {
4947
+				if (!$this->db->query($sql)) {
4948 4948
 					dol_print_error($this->db);
4949 4949
 					return -1;
4950 4950
 				}
@@ -5379,7 +5379,7 @@  discard block
 block discarded – undo
5379 5379
 		if (isset($this->sousprods) && is_array($this->sousprods)) {
5380 5380
 			foreach ($this->sousprods as $prod_name => $desc_product) {
5381 5381
 				if (is_array($desc_product)) {
5382
-					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load);	// This set $this->res
5382
+					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res
5383 5383
 				}
5384 5384
 			}
5385 5385
 		}
@@ -5536,7 +5536,7 @@  discard block
 block discarded – undo
5536 5536
 		$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
5537 5537
 		$sql .= " ORDER BY pa.rang";
5538 5538
 
5539
-		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5539
+		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5540 5540
 
5541 5541
 		if ($level == 1) {
5542 5542
 			$alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately
@@ -5601,7 +5601,7 @@  discard block
 block discarded – undo
5601 5601
 			$parent[$this->label][$keyChild] = $valueChild;
5602 5602
 		}
5603 5603
 		foreach ($parent as $key => $value) {        // key=label, value is array of children
5604
-			$this->sousprods[$key] = $value;  // @phan-suppress-current-line PhanTypeMismatchProperty
5604
+			$this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty
5605 5605
 		}
5606 5606
 	}
5607 5607
 
@@ -5637,7 +5637,7 @@  discard block
 block discarded – undo
5637 5637
 		if (!empty($this->entity) && $permissiontoreadproduct) {
5638 5638
 			$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1');
5639 5639
 			if ($this->nbphoto > 0) {
5640
-				$datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>';
5640
+				$datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>';
5641 5641
 			}
5642 5642
 		}
5643 5643
 
@@ -5647,7 +5647,7 @@  discard block
 block discarded – undo
5647 5647
 			$datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>';
5648 5648
 		}
5649 5649
 		if (isset($this->status) && isset($this->status_buy)) {
5650
-			$datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1);
5650
+			$datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1);
5651 5651
 		}
5652 5652
 
5653 5653
 		if (!empty($this->ref)) {
@@ -5697,7 +5697,7 @@  discard block
 block discarded – undo
5697 5697
 					$labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units);
5698 5698
 				}
5699 5699
 				if ($labelsurfacevolume) {
5700
-					$datas['surface'] = "<br>" . $labelsurfacevolume;
5700
+					$datas['surface'] = "<br>".$labelsurfacevolume;
5701 5701
 				}
5702 5702
 			}
5703 5703
 			if ($this->isService() && !empty($this->duration_value)) {
@@ -5739,9 +5739,9 @@  discard block
 block discarded – undo
5739 5739
 			}
5740 5740
 			// show categories for this record only in ajax to not overload lists
5741 5741
 			if (isModEnabled('category') && !$nofetch) {
5742
-				require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5742
+				require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5743 5743
 				$form = new Form($this->db);
5744
-				$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5744
+				$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5745 5745
 			}
5746 5746
 		}
5747 5747
 
@@ -6265,7 +6265,7 @@  discard block
 block discarded – undo
6265 6265
 		if (isModEnabled("supplier_order")) {
6266 6266
 			$filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4');
6267 6267
 			if (isset($includedraftpoforvirtual)) {
6268
-				$filterStatus = '0,1,2,'.$filterStatus;	// 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6268
+				$filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6269 6269
 			}
6270 6270
 			$result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock);
6271 6271
 			if ($result < 0) {
@@ -6682,7 +6682,7 @@  discard block
 block discarded – undo
6682 6682
 		if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
6683 6683
 			$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
6684 6684
 			foreach ($dirsociete as $dirroot) {
6685
-				$res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6685
+				$res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6686 6686
 				if ($res) {
6687 6687
 					break;
6688 6688
 				}
Please login to merge, or discard this patch.