Completed
Branch develop (c1acee)
by
unknown
24:32
created
htdocs/public/members/new.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 					$to = $adh->makeSubstitution(getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'));
425 425
 					$from = getDolGlobalString('ADHERENT_MAIL_FROM', $conf->email_from);
426 426
 					$mailfile = new CMailFile(
427
-						'['.$appli.'] ' . getDolGlobalString('ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'),
427
+						'['.$appli.'] '.getDolGlobalString('ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'),
428 428
 						$to,
429 429
 						$from,
430 430
 						$adh->makeSubstitution(getDolGlobalString('ADHERENT_AUTOREGISTER_NOTIF_MAIL')),
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 		}
605 605
 	} else {
606 606
 		$adht->fetch(getDolGlobalInt('MEMBER_NEWFORM_FORCETYPE'));
607
-		print '<input type="hidden" id="typeid" name="typeid" value="' . getDolGlobalString('MEMBER_NEWFORM_FORCETYPE').'">';
607
+		print '<input type="hidden" id="typeid" name="typeid" value="'.getDolGlobalString('MEMBER_NEWFORM_FORCETYPE').'">';
608 608
 	}
609 609
 	print '</td></tr>'."\n";
610 610
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 		"mor" => $langs->trans("Moral"),
616 616
 	];
617 617
 	$checkednature = GETPOST("morphy", 'alpha');
618
-	$listetype_natures = $adht->morphyByType(1);		// Load the array of morphy per type
618
+	$listetype_natures = $adht->morphyByType(1); // Load the array of morphy per type
619 619
 	$listetype_natures_json = json_encode($listetype_natures);
620 620
 
621 621
 	if (!getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY')) {
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 			print '</td></tr>'."\n";
706 706
 	} else {
707 707
 		//print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
708
-		print '<input type="hidden" id="morphy" name="morphy" value="' . getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY').'">';
708
+		print '<input type="hidden" id="morphy" name="morphy" value="'.getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY').'">';
709 709
 	}
710 710
 
711 711
 	// Company   // TODO : optional hide
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 	}
803 803
 
804 804
 	// Other attributes
805
-	$parameters['tpl_context'] = 'public';	// define template context to public
805
+	$parameters['tpl_context'] = 'public'; // define template context to public
806 806
 	include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
807 807
 
808 808
 	// Comments
@@ -863,9 +863,9 @@  discard block
 block discarded – undo
863 863
 		$adht = new AdherentType($db);
864 864
 		$adht->fetch($typeid);
865 865
 		$caneditamount = $adht->caneditamount;
866
-		$amountbytype = $adht->amountByType(1);		// Load the array of amount per type
866
+		$amountbytype = $adht->amountByType(1); // Load the array of amount per type
867 867
 		$amountbytype_json = json_encode($amountbytype);
868
-		$caneditamountbytype = $adht->caneditamountByType(1);		// Load the array of caneditamount per type
868
+		$caneditamountbytype = $adht->caneditamountByType(1); // Load the array of caneditamount per type
869 869
 		$caneditamountbytype_json = json_encode($caneditamountbytype);
870 870
 
871 871
 
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 
890 890
 		print '<tr><td>'.$langs->trans("Subscription");
891 891
 		if (getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO')) {
892
-			print ' - <a href="' . getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
892
+			print ' - <a href="'.getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>';
893 893
 		}
894 894
 		print '</td><td class="nowrap">';
895 895
 
@@ -1021,10 +1021,10 @@  discard block
 block discarded – undo
1021 1021
 
1022 1022
 		$i = 0;
1023 1023
 		while ($i < $num) {
1024
-			$objp = $db->fetch_object($result);	// Load the member type and information on it
1024
+			$objp = $db->fetch_object($result); // Load the member type and information on it
1025 1025
 
1026 1026
 			$caneditamount = $objp->caneditamount;
1027
-			$amountbytype = $adht->amountByType(1);		// Load the array of amount per type
1027
+			$amountbytype = $adht->amountByType(1); // Load the array of amount per type
1028 1028
 
1029 1029
 			print '<tr class="oddeven">';
1030 1030
 			// Label
Please login to merge, or discard this patch.
htdocs/commande/card.php 1 patch
Spacing   +283 added lines, -283 removed lines patch added patch discarded remove patch
@@ -40,30 +40,30 @@  discard block
 block discarded – undo
40 40
 
41 41
 // Load Dolibarr environment
42 42
 require '../main.inc.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
45
-require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
46
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formorder.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php';
50
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
51
-require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php';
52
-
53
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
54
-require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
45
+require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
46
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
50
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
51
+require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
52
+
53
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
54
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
55 55
 
56 56
 if (isModEnabled("propal")) {
57
-	require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
57
+	require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
58 58
 }
59 59
 
60 60
 if (isModEnabled('project')) {
61
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
62
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
61
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
62
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
63 63
 }
64 64
 
65 65
 if (isModEnabled('variants')) {
66
-	require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php';
66
+	require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
67 67
 }
68 68
 
69 69
 
@@ -91,18 +91,18 @@  discard block
 block discarded – undo
91 91
 
92 92
 
93 93
 $id        = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid'));
94
-$ref       =  GETPOST('ref', 'alpha');
95
-$socid     =  GETPOSTINT('socid');
96
-$action    =  GETPOST('action', 'aZ09');
97
-$cancel    =  GETPOST('cancel', 'alpha');
98
-$confirm   =  GETPOST('confirm', 'alpha');
94
+$ref       = GETPOST('ref', 'alpha');
95
+$socid     = GETPOSTINT('socid');
96
+$action    = GETPOST('action', 'aZ09');
97
+$cancel    = GETPOST('cancel', 'alpha');
98
+$confirm   = GETPOST('confirm', 'alpha');
99 99
 $backtopage = GETPOST('backtopage', 'alpha');
100 100
 
101
-$lineid    =  GETPOSTINT('lineid');
102
-$contactid =  GETPOSTINT('contactid');
103
-$projectid =  GETPOSTINT('projectid');
104
-$origin    =  GETPOST('origin', 'alpha');
105
-$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id'));    // For backward compatibility
101
+$lineid    = GETPOSTINT('lineid');
102
+$contactid = GETPOSTINT('contactid');
103
+$projectid = GETPOSTINT('projectid');
104
+$origin    = GETPOST('origin', 'alpha');
105
+$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility
106 106
 $rank      = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1;
107 107
 
108 108
 // Type Contact default
@@ -147,26 +147,26 @@  discard block
 block discarded – undo
147 147
 $extrafields->fetch_name_optionals_label($object->table_element);
148 148
 
149 149
 // Load object
150
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';     // Must be 'include', not 'include_once'
150
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
151 151
 
152 152
 // Permissions / Rights
153
-$usercanread    =  $user->hasRight("commande", "lire");
154
-$usercancreate  =  $user->hasRight("commande", "creer");
155
-$usercandelete  =  $user->hasRight("commande", "supprimer");
153
+$usercanread    = $user->hasRight("commande", "lire");
154
+$usercancreate  = $user->hasRight("commande", "creer");
155
+$usercandelete  = $user->hasRight("commande", "supprimer");
156 156
 
157 157
 // Advanced permissions
158
-$usercanclose       =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
159
-$usercanvalidate    =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
160
-$usercancancel      =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
161
-$usercansend        =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
162
-$usercangeneretedoc =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
158
+$usercanclose       = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
159
+$usercanvalidate    = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
160
+$usercancancel      = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
161
+$usercansend        = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
162
+$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
163 163
 
164 164
 $usermustrespectpricemin    = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
165 165
 $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
166 166
 
167
-$permissionnote    = $usercancreate;     //  Used by the include of actions_setnotes.inc.php
168
-$permissiondellink = $usercancreate;     //  Used by the include of actions_dellink.inc.php
169
-$permissiontoadd   = $usercancreate;     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
167
+$permissionnote    = $usercancreate; //  Used by the include of actions_setnotes.inc.php
168
+$permissiondellink = $usercancreate; //  Used by the include of actions_dellink.inc.php
169
+$permissiontoadd   = $usercancreate; //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
170 170
 $permissiontoeditextra = $usercancreate;
171 171
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
172 172
 	// For action 'update_extras', is there a specific permission set for the attribute to update
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
 }
193 193
 
194 194
 if (empty($reshook)) {
195
-	$backurlforlist = DOL_URL_ROOT . '/commande/list.php';
195
+	$backurlforlist = DOL_URL_ROOT.'/commande/list.php';
196 196
 
197 197
 	if (empty($backtopage) || ($cancel && empty($id))) {
198 198
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
199 199
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
200 200
 				$backtopage = $backurlforlist;
201 201
 			} else {
202
-				$backtopage = DOL_URL_ROOT . '/commande/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
202
+				$backtopage = DOL_URL_ROOT.'/commande/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
203 203
 			}
204 204
 		}
205 205
 	}
@@ -208,20 +208,20 @@  discard block
 block discarded – undo
208 208
 
209 209
 	if ($cancel) {
210 210
 		if (!empty($backtopageforcancel)) {
211
-			header("Location: " . $backtopageforcancel);
211
+			header("Location: ".$backtopageforcancel);
212 212
 			exit;
213 213
 		} elseif (!empty($backtopage)) {
214
-			header("Location: " . $backtopage);
214
+			header("Location: ".$backtopage);
215 215
 			exit;
216 216
 		}
217 217
 		$action = '';
218 218
 	}
219 219
 
220
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';    // Must be 'include', not 'include_once'
220
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once'
221 221
 
222
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';     // Must be 'include', not 'include_once'
222
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
223 223
 
224
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php';  // Must be 'include', not 'include_once'
224
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
225 225
 
226 226
 	// Action clone object
227 227
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 						setEventMessages('', $warningMsgLineList, 'warnings');
251 251
 					}
252 252
 
253
-					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
253
+					header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
254 254
 					exit;
255 255
 				} else {
256 256
 					setEventMessages($object->error, $object->errors, 'errors');
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
310 310
 			}
311 311
 
312
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
312
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
313 313
 			exit;
314 314
 		} else {
315 315
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
338 338
 			}
339 339
 
340
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
340
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
341 341
 			exit;
342 342
 		} else {
343 343
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -433,14 +433,14 @@  discard block
 block discarded – undo
433 433
 					$object_id = $object->create($user);
434 434
 
435 435
 					if ($object_id > 0) {
436
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
436
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
437 437
 
438 438
 						$classname = ucfirst($subelement);
439 439
 						$srcobject = new $classname($db);
440 440
 						'@phan-var-force Commande|Propal|Contrat $srcobject';
441 441
 						/** @var Commande|Propal|Contrat $srcobject */
442 442
 
443
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
443
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
444 444
 						$result = $srcobject->fetch($object->origin_id);
445 445
 						if ($result > 0) {
446 446
 							$lines = $srcobject->lines;
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 
492 492
 								$tva_tx = $lines[$i]->tva_tx;
493 493
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
494
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
494
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
495 495
 								}
496 496
 
497 497
 								$result = $object->addline(
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 			// End of object creation, we show it
620 620
 			if ($object_id > 0 && !$error) {
621 621
 				$db->commit();
622
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object_id);
622
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object_id);
623 623
 				exit();
624 624
 			} else {
625 625
 				$db->rollback();
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 			}
796 796
 			$tvatx = $line->tva_tx;
797 797
 			if (!empty($line->vat_src_code)) {
798
-				$tvatx .= ' (' . $line->vat_src_code . ')';
798
+				$tvatx .= ' ('.$line->vat_src_code.')';
799 799
 			}
800 800
 			$result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, (float) $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
801 801
 		}
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 				if ($prod->price_min > $line->subprice) {
826 826
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
827 827
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
828
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
828
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
829 829
 				} else {
830 830
 					setEventMessages($prod->error, $prod->errors, 'errors');
831 831
 				}
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 		} else {
901 901
 			setEventMessages($object->error, $object->errors, 'errors');
902 902
 		}
903
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
903
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
904 904
 		exit();
905 905
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
906 906
 		// Handling adding a new subtotal line for subtotals module
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 		} else {
953 953
 			setEventMessages($object->error, $object->errors, 'errors');
954 954
 		}
955
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
955
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
956 956
 		exit();
957 957
 	} elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && $usercancreate) {		// Add a new line
958 958
 		$langs->load('errors');
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 		$pu_ht = '';
970 970
 		$pu_ttc = '';
971 971
 		$pu_ht_devise = '';
972
-		$pu_ttc_devise  = '';
972
+		$pu_ttc_devise = '';
973 973
 
974 974
 		if (GETPOST('price_ht') !== '') {
975 975
 			$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
@@ -998,9 +998,9 @@  discard block
 block discarded – undo
998 998
 
999 999
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1000 1000
 
1001
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1001
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1002 1002
 
1003
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1003
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1004 1004
 		if (empty($remise_percent)) {
1005 1005
 			$remise_percent = 0;
1006 1006
 		}
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 		if (is_array($extralabelsline)) {
1013 1013
 			// Get extra fields
1014 1014
 			foreach ($extralabelsline as $key => $value) {
1015
-				unset($_POST["options_" . $key]);
1015
+				unset($_POST["options_".$key]);
1016 1016
 			}
1017 1017
 		}
1018 1018
 
@@ -1057,8 +1057,8 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
 		if (!$error && ($qty >= 0) && (!empty($line_desc) || (!empty($idprod) && $idprod > 0))) {
1059 1059
 			// Clean parameters
1060
-			$date_start = dol_mktime(GETPOSTINT('date_start' . $predef . 'hour'), GETPOSTINT('date_start' . $predef . 'min'), GETPOSTINT('date_start' . $predef . 'sec'), GETPOSTINT('date_start' . $predef . 'month'), GETPOSTINT('date_start' . $predef . 'day'), GETPOSTINT('date_start' . $predef . 'year'));
1061
-			$date_end = dol_mktime(GETPOSTINT('date_end' . $predef . 'hour'), GETPOSTINT('date_end' . $predef . 'min'), GETPOSTINT('date_end' . $predef . 'sec'), GETPOSTINT('date_end' . $predef . 'month'), GETPOSTINT('date_end' . $predef . 'day'), GETPOSTINT('date_end' . $predef . 'year'));
1060
+			$date_start = dol_mktime(GETPOSTINT('date_start'.$predef.'hour'), GETPOSTINT('date_start'.$predef.'min'), GETPOSTINT('date_start'.$predef.'sec'), GETPOSTINT('date_start'.$predef.'month'), GETPOSTINT('date_start'.$predef.'day'), GETPOSTINT('date_start'.$predef.'year'));
1061
+			$date_end = dol_mktime(GETPOSTINT('date_end'.$predef.'hour'), GETPOSTINT('date_end'.$predef.'min'), GETPOSTINT('date_end'.$predef.'sec'), GETPOSTINT('date_end'.$predef.'month'), GETPOSTINT('date_end'.$predef.'day'), GETPOSTINT('date_end'.$predef.'year'));
1062 1062
 			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
1063 1063
 
1064 1064
 			$price_min = $price_min_ttc = 0;
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 
1089 1089
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1090 1090
 					// If price per customer
1091
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1091
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1092 1092
 
1093 1093
 					$prodcustprice = new ProductCustomerPrice($db);
1094 1094
 
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 									$price_base_type = $custprice_line->price_base_type;
1111 1111
 									$tva_tx = $custprice_line->tva_tx;
1112 1112
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', (string) $tva_tx)) {
1113
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
1113
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
1114 1114
 									}
1115 1115
 									$tva_npr = $custprice_line->recuperableonly;
1116 1116
 									if (empty($tva_tx)) {
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 					}
1158 1158
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1159 1159
 					// If price per customer
1160
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1160
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1161 1161
 
1162 1162
 					$prodcustprice = new ProductCustomerPrice($db);
1163 1163
 
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 									$price_base_type = $custprice_line->price_base_type;
1177 1177
 									$tva_tx = $custprice_line->tva_tx;
1178 1178
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
1179
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
1179
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
1180 1180
 									}
1181 1181
 									$tva_npr = $custprice_line->recuperableonly;
1182 1182
 									if (empty($tva_tx)) {
@@ -1300,23 +1300,23 @@  discard block
 block discarded – undo
1300 1300
 							$outputlangs->load('products');
1301 1301
 						}
1302 1302
 						if (!empty($prod->customcode)) {
1303
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1303
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1304 1304
 						}
1305 1305
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1306 1306
 							$tmptxt .= ' - ';
1307 1307
 						}
1308 1308
 						if (!empty($prod->country_code)) {
1309
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1309
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1310 1310
 						}
1311 1311
 					} else {
1312 1312
 						if (!empty($prod->customcode)) {
1313
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1313
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1314 1314
 						}
1315 1315
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1316 1316
 							$tmptxt .= ' - ';
1317 1317
 						}
1318 1318
 						if (!empty($prod->country_code)) {
1319
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1319
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1320 1320
 						}
1321 1321
 					}
1322 1322
 					$tmptxt .= ')';
@@ -1355,8 +1355,8 @@  discard block
 block discarded – undo
1355 1355
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
1356 1356
 
1357 1357
 			// Margin
1358
-			$fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOSTINT('fournprice' . $predef) : 0);	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1359
-			$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
1358
+			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOSTINT('fournprice'.$predef) : 0); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1359
+			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
1360 1360
 
1361 1361
 			// Prepare a price equivalent for minimum price check
1362 1362
 			$pu_equivalent = $pu_ht;
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 		 */
1601 1601
 
1602 1602
 		// Add buying price
1603
-		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : '');				// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1603
+		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1604 1604
 		$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value
1605 1605
 
1606 1606
 		// Extrafields Lines
@@ -1609,7 +1609,7 @@  discard block
 block discarded – undo
1609 1609
 		// Unset extrafield POST Data
1610 1610
 		if (is_array($extralabelsline)) {
1611 1611
 			foreach ($extralabelsline as $key => $value) {
1612
-				unset($_POST["options_" . $key]);
1612
+				unset($_POST["options_".$key]);
1613 1613
 			}
1614 1614
 		}
1615 1615
 
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 			}
1753 1753
 		}
1754 1754
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
1755
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
1755
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
1756 1756
 		exit();
1757 1757
 	} elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) {
1758 1758
 		$idwarehouse = GETPOSTINT('idwarehouse');
@@ -1789,7 +1789,7 @@  discard block
 block discarded – undo
1789 1789
 					GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
1790 1790
 					&& isModEnabled('invoice') && $user->hasRight('facture', 'creer')
1791 1791
 				) {
1792
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1792
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1793 1793
 
1794 1794
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
1795 1795
 					$forceFields = array();
@@ -1802,7 +1802,7 @@  discard block
 block discarded – undo
1802 1802
 
1803 1803
 					if ($deposit) {
1804 1804
 						setEventMessage('DepositGenerated');
1805
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
1805
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
1806 1806
 					} else {
1807 1807
 						$error++;
1808 1808
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1810,7 +1810,7 @@  discard block
 block discarded – undo
1810 1810
 				}
1811 1811
 
1812 1812
 				// Define output language
1813
-				if (! $error) {
1813
+				if (!$error) {
1814 1814
 					$db->commit();
1815 1815
 
1816 1816
 					if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
@@ -1838,7 +1838,7 @@  discard block
 block discarded – undo
1838 1838
 					}
1839 1839
 
1840 1840
 					if ($locationTarget) {
1841
-						header('Location: ' . $locationTarget);
1841
+						header('Location: '.$locationTarget);
1842 1842
 						exit;
1843 1843
 					}
1844 1844
 				} else {
@@ -1929,7 +1929,7 @@  discard block
 block discarded – undo
1929 1929
 	}
1930 1930
 
1931 1931
 	if ($action == 'update_extras' && $permissiontoeditextra) {
1932
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
1932
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
1933 1933
 
1934 1934
 		$attribute_name = GETPOST('attribute', 'aZ09');
1935 1935
 
@@ -1961,13 +1961,13 @@  discard block
 block discarded – undo
1961 1961
 
1962 1962
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
1963 1963
 			if ($fromElement == 'commande') {
1964
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
1964
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
1965 1965
 				$lineClassName = 'OrderLine';
1966 1966
 			} elseif ($fromElement == 'propal') {
1967
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
1967
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
1968 1968
 				$lineClassName = 'PropaleLigne';
1969 1969
 			} elseif ($fromElement == 'facture') {
1970
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
1970
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
1971 1971
 				$lineClassName = 'FactureLigne';
1972 1972
 			}
1973 1973
 			$nextRang = count($object->lines) + 1;
@@ -2027,19 +2027,19 @@  discard block
 block discarded – undo
2027 2027
 	}
2028 2028
 
2029 2029
 	// Actions when printing a doc from card
2030
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
2030
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
2031 2031
 
2032 2032
 	// Actions to build doc
2033 2033
 	$upload_dir = !empty($conf->commande->multidir_output[$object->entity ?? $conf->entity]) ? $conf->commande->multidir_output[$object->entity ?? $conf->entity] : $conf->commande->dir_output;
2034 2034
 	$permissiontoadd = $usercancreate;
2035
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2035
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2036 2036
 
2037 2037
 	// Actions to send emails
2038 2038
 	$triggersendname = 'ORDER_SENTBYMAIL';
2039 2039
 	$paramname = 'id';
2040 2040
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
2041
-	$trackid = 'ord' . $object->id;
2042
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
2041
+	$trackid = 'ord'.$object->id;
2042
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
2043 2043
 
2044 2044
 
2045 2045
 	if (!$error && getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB') && $usercancreate) {
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
 			}
2052 2052
 
2053 2053
 			if ($result >= 0) {
2054
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2054
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2055 2055
 				exit();
2056 2056
 			} else {
2057 2057
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2073,7 +2073,7 @@  discard block
 block discarded – undo
2073 2073
 			$result = $object->delete_contact($lineid);
2074 2074
 
2075 2075
 			if ($result >= 0) {
2076
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2076
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2077 2077
 				exit();
2078 2078
 			} else {
2079 2079
 				dol_print_error($db);
@@ -2087,7 +2087,7 @@  discard block
 block discarded – undo
2087 2087
  *	View
2088 2088
  */
2089 2089
 
2090
-$title = $object->ref . " - " . $langs->trans('Card');
2090
+$title = $object->ref." - ".$langs->trans('Card');
2091 2091
 if ($action == 'create') {
2092 2092
 	$title = $langs->trans("NewOrder");
2093 2093
 }
@@ -2160,11 +2160,11 @@  discard block
 block discarded – undo
2160 2160
 				$element = $subelement = 'contrat';
2161 2161
 			}
2162 2162
 
2163
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2163
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2164 2164
 
2165 2165
 			$classname = ucfirst($subelement);
2166 2166
 			$objectsrc = new $classname($db);
2167
-			'@phan-var-force Commande|Propal|Contrat $objectsrc';  // Can possibly be other class but CommonObject is too general
2167
+			'@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general
2168 2168
 			$objectsrc->fetch($originid);
2169 2169
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
2170 2170
 				$objectsrc->fetch_lines();
@@ -2258,16 +2258,16 @@  discard block
 block discarded – undo
2258 2258
 		}
2259 2259
 	}
2260 2260
 
2261
-	print '<form name="crea_commande" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2262
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2261
+	print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2262
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2263 2263
 	print '<input type="hidden" name="action" value="add">';
2264
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
2265
-	print '<input type="hidden" name="remise_percent" value="' . $soc->remise_percent . '">';
2266
-	print '<input type="hidden" name="origin" value="' . $origin . '">';
2267
-	print '<input type="hidden" name="originid" value="' . $originid . '">';
2268
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2264
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2265
+	print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
2266
+	print '<input type="hidden" name="origin" value="'.$origin.'">';
2267
+	print '<input type="hidden" name="originid" value="'.$originid.'">';
2268
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2269 2269
 	if (!empty($currency_tx)) {
2270
-		print '<input type="hidden" name="originmulticurrency_tx" value="' . $currency_tx . '">';
2270
+		print '<input type="hidden" name="originmulticurrency_tx" value="'.$currency_tx.'">';
2271 2271
 	}
2272 2272
 
2273 2273
 	print dol_get_fiche_head([]);
@@ -2280,29 +2280,29 @@  discard block
 block discarded – undo
2280 2280
 		print '<table class="border centpercent">';
2281 2281
 
2282 2282
 		// Reference
2283
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td>' . $langs->trans("Draft") . '</td></tr>';
2283
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans("Draft").'</td></tr>';
2284 2284
 
2285 2285
 		// Reference client
2286
-		print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td>';
2286
+		print '<tr><td>'.$langs->trans('RefCustomer').'</td><td>';
2287 2287
 		if (getDolGlobalString('MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER') && !empty($origin) && !empty($originid)) {
2288
-			print '<input type="text" name="ref_client" value="' . $ref_client . '"></td>';
2288
+			print '<input type="text" name="ref_client" value="'.$ref_client.'"></td>';
2289 2289
 		} else {
2290
-			print '<input type="text" name="ref_client" value="' . GETPOST('ref_client') . '"></td>';
2290
+			print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
2291 2291
 		}
2292 2292
 		print '</tr>';
2293 2293
 
2294 2294
 		// Thirdparty
2295 2295
 		print '<tr>';
2296
-		print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
2296
+		print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
2297 2297
 		if ($socid > 0) {
2298 2298
 			print '<td>';
2299 2299
 			print $soc->getNomUrl(1, 'customer');
2300
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2300
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2301 2301
 			print '</td>';
2302 2302
 		} else {
2303 2303
 			print '<td class="valuefieldcreate">';
2304 2304
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2305
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
2305
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
2306 2306
 			// reload page to retrieve customer information
2307 2307
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2308 2308
 				print '<script>
@@ -2318,17 +2318,17 @@  discard block
 block discarded – undo
2318 2318
 				});
2319 2319
 				</script>';
2320 2320
 			}
2321
-			print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&customer=3&fournisseur=0&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>';
2321
+			print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&customer=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
2322 2322
 			print '</td>';
2323 2323
 		}
2324
-		print '</tr>' . "\n";
2324
+		print '</tr>'."\n";
2325 2325
 
2326 2326
 		// Contact of order
2327 2327
 		if ($socid > 0) {
2328 2328
 			// Contacts (ask contact only if thirdparty already defined).
2329 2329
 			// print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
2330 2330
 			print "<tr><td>";
2331
-			print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_" . $type_contact_code));
2331
+			print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_".$type_contact_code));
2332 2332
 			print '</td><td>';
2333 2333
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2334 2334
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx');
@@ -2336,26 +2336,26 @@  discard block
 block discarded – undo
2336 2336
 			print '</td></tr>';
2337 2337
 
2338 2338
 			// Ligne info remises tiers
2339
-			print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
2339
+			print '<tr><td>'.$langs->trans('Discounts').'</td><td>';
2340 2340
 
2341 2341
 			$absolute_discount = $soc->getAvailableDiscounts();
2342 2342
 
2343 2343
 			$thirdparty = $soc;
2344 2344
 			$discount_type = 0;
2345
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2346
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2345
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2346
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2347 2347
 
2348 2348
 			print '</td></tr>';
2349 2349
 		}
2350 2350
 
2351 2351
 		// Date
2352
-		print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td>';
2352
+		print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
2353 2353
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2354 2354
 		print $form->selectDate('', 're', 0, 0, 0, "crea_commande", 1, 1); // Always autofill date with current date
2355 2355
 		print '</td></tr>';
2356 2356
 
2357 2357
 		// Date delivery planned
2358
-		print '<tr><td>' . $langs->trans("DateDeliveryPlanned") . '</td>';
2358
+		print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
2359 2359
 		print '<td colspan="3">';
2360 2360
 		$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date);
2361 2361
 		print img_picto('', 'action', 'class="pictofixedwidth"');
@@ -2364,33 +2364,33 @@  discard block
 block discarded – undo
2364 2364
 		print '</tr>';
2365 2365
 
2366 2366
 		// Delivery delay
2367
-		print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td>';
2367
+		print '<tr class="fielddeliverydelay"><td>'.$langs->trans('AvailabilityPeriod').'</td><td>';
2368 2368
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
2369 2369
 		$form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOST('availability_id') : $availability_id), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2370 2370
 		print '</td></tr>';
2371 2371
 
2372 2372
 		// Terms of payment
2373
-		print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2373
+		print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2374 2374
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2375 2375
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', (float) $deposit_percent);
2376 2376
 		print '</td></tr>';
2377 2377
 
2378 2378
 		// Payment mode
2379
-		print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td>';
2379
+		print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
2380 2380
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2381 2381
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2382 2382
 		print '</td></tr>';
2383 2383
 
2384 2384
 		// Bank Account
2385 2385
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) {
2386
-			print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
2387
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2386
+			print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
2387
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2388 2388
 			print '</td></tr>';
2389 2389
 		}
2390 2390
 
2391 2391
 		// Shipping Method
2392 2392
 		if (isModEnabled('shipping')) {
2393
-			print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>';
2393
+			print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
2394 2394
 			print img_picto('', 'object_dolly', 'class="pictofixedwidth"');
2395 2395
 			$form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2396 2396
 			print '</td></tr>';
@@ -2398,15 +2398,15 @@  discard block
 block discarded – undo
2398 2398
 
2399 2399
 		// Warehouse
2400 2400
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
2401
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2401
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2402 2402
 			$formproduct = new FormProduct($db);
2403
-			print '<tr><td>' . $langs->trans('Warehouse') . '</td><td>';
2404
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses((GETPOSTISSET('warehouse_id') ? GETPOST('warehouse_id') : $warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2403
+			print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
2404
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id') ? GETPOST('warehouse_id') : $warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2405 2405
 			print '</td></tr>';
2406 2406
 		}
2407 2407
 
2408 2408
 		// Source / Channel - What trigger creation
2409
-		print '<tr><td>' . $langs->trans('Source') . '</td><td>';
2409
+		print '<tr><td>'.$langs->trans('Source').'</td><td>';
2410 2410
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2411 2411
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2412 2412
 		print '</td></tr>';
@@ -2417,9 +2417,9 @@  discard block
 block discarded – undo
2417 2417
 		if (isModEnabled('project')) {
2418 2418
 			$langs->load("projects");
2419 2419
 			print '<tr>';
2420
-			print '<td>' . $langs->trans("Project") . '</td><td>';
2421
-			print img_picto('', 'project', 'class="pictofixedwidth"') . $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2422
-			print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->trans("AddProject") . '"></span></a>';
2420
+			print '<td>'.$langs->trans("Project").'</td><td>';
2421
+			print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2422
+			print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
2423 2423
 			print '</td>';
2424 2424
 			print '</tr>';
2425 2425
 		}
@@ -2427,7 +2427,7 @@  discard block
 block discarded – undo
2427 2427
 		// Incoterms
2428 2428
 		if (isModEnabled('incoterm')) {
2429 2429
 			print '<tr>';
2430
-			print '<td><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->fk_incoterms) ? (string) $objectsrc->fk_incoterms : (string) $soc->fk_incoterms, 1) . '</label></td>';
2430
+			print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->fk_incoterms) ? (string) $objectsrc->fk_incoterms : (string) $soc->fk_incoterms, 1).'</label></td>';
2431 2431
 			print '<td class="maxwidthonsmartphone">';
2432 2432
 			$incoterm_id = GETPOST('incoterm_id');
2433 2433
 			$location_incoterms = GETPOST('location_incoterms');
@@ -2443,7 +2443,7 @@  discard block
 block discarded – undo
2443 2443
 		// Other attributes
2444 2444
 		$parameters = array();
2445 2445
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
2446
-			$parameters['objectsrc'] =  $objectsrc;
2446
+			$parameters['objectsrc'] = $objectsrc;
2447 2447
 		}
2448 2448
 		$parameters['socid'] = $socid;
2449 2449
 
@@ -2464,9 +2464,9 @@  discard block
 block discarded – undo
2464 2464
 		}
2465 2465
 
2466 2466
 		// Template to use by default
2467
-		print '<tr><td>' . $langs->trans('DefaultModel') . '</td>';
2467
+		print '<tr><td>'.$langs->trans('DefaultModel').'</td>';
2468 2468
 		print '<td>';
2469
-		include_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php';
2469
+		include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
2470 2470
 		$liste = ModelePDFCommandes::liste_modeles($db);
2471 2471
 		$preselected = getDolGlobalString('COMMANDE_ADDON_PDF');
2472 2472
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
@@ -2476,22 +2476,22 @@  discard block
 block discarded – undo
2476 2476
 		// Multicurrency
2477 2477
 		if (isModEnabled("multicurrency")) {
2478 2478
 			print '<tr>';
2479
-			print '<td>' . $form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0) . '</td>';
2479
+			print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>';
2480 2480
 			print '<td class="maxwidthonsmartphone">';
2481
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2481
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2482 2482
 			print '</td></tr>';
2483 2483
 		}
2484 2484
 
2485 2485
 		// Categories
2486 2486
 		if (isModEnabled('category')) {
2487
-			print '<tr><td>' . $langs->trans("Categories") . '</td><td colspan="3">';
2487
+			print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
2488 2488
 			print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
2489 2489
 			print "</td></tr>";
2490 2490
 		}
2491 2491
 
2492 2492
 		// Note public
2493 2493
 		print '<tr>';
2494
-		print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
2494
+		print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
2495 2495
 		print '<td>';
2496 2496
 
2497 2497
 		$doleditor = new DolEditor('note_public', (string) $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
 		// Note private
2503 2503
 		if (empty($user->socid)) {
2504 2504
 			print '<tr>';
2505
-			print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
2505
+			print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
2506 2506
 			print '<td>';
2507 2507
 
2508 2508
 			$doleditor = new DolEditor('note_private', (string) $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2520,12 +2520,12 @@  discard block
 block discarded – undo
2520 2520
 				$objectsrc->update_price(1);
2521 2521
 			}
2522 2522
 
2523
-			print "\n<!-- " . $classname . " info -->\n";
2524
-			print '<input type="hidden" name="amount"   value="' . $objectsrc->total_ht . '">' . "\n";
2525
-			print '<input type="hidden" name="total"    value="' . $objectsrc->total_ttc . '">' . "\n";
2526
-			print '<input type="hidden" name="tva"      value="' . $objectsrc->total_tva . '">' . "\n";
2527
-			print '<input type="hidden" name="origin"   value="' . $objectsrc->element . '">';
2528
-			print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">';
2523
+			print "\n<!-- ".$classname." info -->\n";
2524
+			print '<input type="hidden" name="amount"   value="'.$objectsrc->total_ht.'">'."\n";
2525
+			print '<input type="hidden" name="total"    value="'.$objectsrc->total_ttc.'">'."\n";
2526
+			print '<input type="hidden" name="tva"      value="'.$objectsrc->total_tva.'">'."\n";
2527
+			print '<input type="hidden" name="origin"   value="'.$objectsrc->element.'">';
2528
+			print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
2529 2529
 
2530 2530
 			switch ($classname) {
2531 2531
 				case 'Propal':
@@ -2544,25 +2544,25 @@  discard block
 block discarded – undo
2544 2544
 					$newclassname = $classname;
2545 2545
 			}
2546 2546
 
2547
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2547
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2548 2548
 
2549 2549
 			// Amount
2550
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht) . '</td></tr>';
2551
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva) . "</td></tr>";
2550
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>';
2551
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>";
2552 2552
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1 RE
2553
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1) . "</td></tr>";
2553
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>";
2554 2554
 			}
2555 2555
 
2556 2556
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2 IRPF
2557
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2) . "</td></tr>";
2557
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>";
2558 2558
 			}
2559 2559
 
2560
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc) . "</td></tr>";
2560
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>";
2561 2561
 
2562 2562
 			if (isModEnabled("multicurrency")) {
2563
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2564
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2565
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2563
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2564
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2565
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2566 2566
 			}
2567 2567
 		}
2568 2568
 
@@ -2613,7 +2613,7 @@  discard block
 block discarded – undo
2613 2613
 
2614 2614
 		// Confirmation to delete
2615 2615
 		if ($action == 'delete') {
2616
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
2616
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
2617 2617
 		}
2618 2618
 
2619 2619
 		// Confirmation of validation
@@ -2632,7 +2632,7 @@  discard block
 block discarded – undo
2632 2632
 
2633 2633
 			$text = $langs->trans('ConfirmValidateOrder', $numref);
2634 2634
 			if (isModEnabled('notification')) {
2635
-				require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2635
+				require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2636 2636
 				$notify = new Notify($db);
2637 2637
 				$text .= '<br>';
2638 2638
 				$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid, $object);
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
 			$formquestion = array();
2649 2649
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2650 2650
 				$langs->load("stocks");
2651
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2651
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2652 2652
 				$formproduct = new FormProduct($db);
2653 2653
 				$forcecombo = 0;
2654 2654
 				if ($conf->browser->name == 'ie') {
@@ -2666,7 +2666,7 @@  discard block
 block discarded – undo
2666 2666
 			$nbMandated = 0;
2667 2667
 			foreach ($object->lines as $line) {
2668 2668
 				$res = $line->fetch_product();
2669
-				if ($res  > 0) {
2669
+				if ($res > 0) {
2670 2670
 					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2671 2671
 						$nbMandated++;
2672 2672
 						break;
@@ -2678,7 +2678,7 @@  discard block
 block discarded – undo
2678 2678
 					setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2679 2679
 					$error++;
2680 2680
 				} else {
2681
-					$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2681
+					$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2682 2682
 				}
2683 2683
 			}
2684 2684
 
@@ -2690,7 +2690,7 @@  discard block
 block discarded – undo
2690 2690
 				$deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2691 2691
 
2692 2692
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2693
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2693
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2694 2694
 
2695 2695
 					$object->fetchObjectLinked();
2696 2696
 
@@ -2793,7 +2793,7 @@  discard block
 block discarded – undo
2793 2793
 			}
2794 2794
 
2795 2795
 			if (!$error) {
2796
-				$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240);
2796
+				$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240);
2797 2797
 			}
2798 2798
 		}
2799 2799
 
@@ -2810,7 +2810,7 @@  discard block
 block discarded – undo
2810 2810
 			$formquestion = array();
2811 2811
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2812 2812
 				$langs->load("stocks");
2813
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2813
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2814 2814
 				$formproduct = new FormProduct($db);
2815 2815
 				$forcecombo = 0;
2816 2816
 				if ($conf->browser->name == 'ie') {
@@ -2829,12 +2829,12 @@  discard block
 block discarded – undo
2829 2829
 				];
2830 2830
 			}
2831 2831
 
2832
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
2832
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
2833 2833
 		}
2834 2834
 
2835 2835
 		// Confirmation of closing
2836 2836
 		if ($action == 'shipped') {
2837
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
2837
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
2838 2838
 		}
2839 2839
 
2840 2840
 		// Confirmation of cancellation
@@ -2850,7 +2850,7 @@  discard block
 block discarded – undo
2850 2850
 			$formquestion = array();
2851 2851
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2852 2852
 				$langs->load("stocks");
2853
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2853
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2854 2854
 				$formproduct = new FormProduct($db);
2855 2855
 				$forcecombo = 0;
2856 2856
 				if ($conf->browser->name == 'ie') {
@@ -2864,12 +2864,12 @@  discard block
 block discarded – undo
2864 2864
 				);
2865 2865
 			}
2866 2866
 
2867
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1);
2867
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1);
2868 2868
 		}
2869 2869
 
2870 2870
 		// Confirmation to delete line
2871 2871
 		if ($action == 'ask_deleteline') {
2872
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2872
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2873 2873
 		}
2874 2874
 
2875 2875
 		// Confirmation de la suppression d'une ligne subtotal
@@ -2882,7 +2882,7 @@  discard block
 block discarded – undo
2882 2882
 				$title = "DeleteTitleLine";
2883 2883
 				$question = "ConfirmDeleteTitleLine";
2884 2884
 			}
2885
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2885
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2886 2886
 		}
2887 2887
 
2888 2888
 		// Clone confirmation
@@ -2892,7 +2892,7 @@  discard block
 block discarded – undo
2892 2892
 			$formquestion = array(
2893 2893
 				array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, array(), 0, 'maxwidth300'))
2894 2894
 			);
2895
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
2895
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
2896 2896
 		}
2897 2897
 
2898 2898
 		// Subtotal line form
@@ -2900,12 +2900,12 @@  discard block
 block discarded – undo
2900 2900
 			$langs->load('subtotals');
2901 2901
 			$type = 'title';
2902 2902
 			$depth_array = $object->getPossibleLevels($langs);
2903
-			include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_create.tpl.php';
2903
+			include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_create.tpl.php';
2904 2904
 		} elseif ($action == 'add_subtotal_line') {
2905 2905
 			$langs->load('subtotals');
2906 2906
 			$type = 'subtotal';
2907 2907
 			$titles = $object->getPossibleTitles();
2908
-			include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_create.tpl.php';
2908
+			include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_create.tpl.php';
2909 2909
 		}
2910 2910
 
2911 2911
 		// Call Hook formConfirm
@@ -2924,16 +2924,16 @@  discard block
 block discarded – undo
2924 2924
 
2925 2925
 		// Order card
2926 2926
 
2927
-		$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2927
+		$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2928 2928
 
2929 2929
 		$morehtmlref = '<div class="refidno">';
2930 2930
 		// Ref customer
2931 2931
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string', '', 0, 1);
2932
-		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string' . (isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2932
+		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2933 2933
 		// Thirdparty
2934
-		$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
2934
+		$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2935 2935
 		if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
2936
-			$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/commande/list.php?socid=' . $object->thirdparty->id . '&search_societe=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherOrders") . '</a>)';
2936
+			$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
2937 2937
 		}
2938 2938
 		// Project
2939 2939
 		if (isModEnabled('project')) {
@@ -2942,16 +2942,16 @@  discard block
 block discarded – undo
2942 2942
 			if ($usercancreate) {
2943 2943
 				$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
2944 2944
 				if ($action != 'classify') {
2945
-					$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
2945
+					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
2946 2946
 				}
2947
-				$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
2947
+				$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
2948 2948
 			} else {
2949 2949
 				if (!empty($object->fk_project)) {
2950 2950
 					$proj = new Project($db);
2951 2951
 					$proj->fetch($object->fk_project);
2952 2952
 					$morehtmlref .= $proj->getNomUrl(1);
2953 2953
 					if ($proj->title) {
2954
-						$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
2954
+						$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
2955 2955
 					}
2956 2956
 				}
2957 2957
 			}
@@ -2979,20 +2979,20 @@  discard block
 block discarded – undo
2979 2979
 				print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo'));
2980 2980
 				print '</td>';
2981 2981
 				if ($action != 'editposinfo' && $usercancreate) {
2982
-					print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editposinfo&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetPOSInfo'), 1) . '</a></td>';
2982
+					print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editposinfo&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetPOSInfo'), 1).'</a></td>';
2983 2983
 				}
2984 2984
 				print '</tr></table>';
2985 2985
 				print '</td><td class="valuefield fieldname_type">';
2986
-				print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" name="formposinfo">';
2986
+				print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="formposinfo">';
2987 2987
 				print '<input type="hidden" name="action" value="setposinfo">';
2988
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
2988
+				print '<input type="hidden" name="token" value="'.newToken().'">';
2989 2989
 				if ($action == 'editposinfo') {
2990
-					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="' . $langs->trans("POSModule") . '" value="' . $object->module_source . '"> ';
2991
-					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="' . $langs->trans("Terminal") . '" value="' . $object->pos_source . '">';
2992
-					print '<input type="submit" class="button" name="submitposinfo" value="' . $langs->trans("Submit") . '">';
2990
+					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="'.$langs->trans("POSModule").'" value="'.$object->module_source.'"> ';
2991
+					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="'.$langs->trans("Terminal").'" value="'.$object->pos_source.'">';
2992
+					print '<input type="submit" class="button" name="submitposinfo" value="'.$langs->trans("Submit").'">';
2993 2993
 				} else {
2994 2994
 					if ($object->module_source) {
2995
-						print '<span class="opacitymediumbycolor paddingleft">' . dolPrintHTML(ucfirst($object->module_source) . ' - ' . $langs->transnoentitiesnoconv("Terminal") . ' ' . $object->pos_source) . '</span>';
2995
+						print '<span class="opacitymediumbycolor paddingleft">'.dolPrintHTML(ucfirst($object->module_source).' - '.$langs->transnoentitiesnoconv("Terminal").' '.$object->pos_source).'</span>';
2996 2996
 					}
2997 2997
 				}
2998 2998
 				print '</form>';
@@ -3005,7 +3005,7 @@  discard block
 block discarded – undo
3005 3005
 				print $langs->trans('OutstandingBill');
3006 3006
 				print '</td><td class="valuefield">';
3007 3007
 				$arrayoutstandingbills = $soc->getOutstandingBills();
3008
-				print price($arrayoutstandingbills['opened']) . ' / ';
3008
+				print price($arrayoutstandingbills['opened']).' / ';
3009 3009
 				print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency);
3010 3010
 				print '</td>';
3011 3011
 				print '</tr>';
@@ -3020,11 +3020,11 @@  discard block
 block discarded – undo
3020 3020
 				$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3021 3021
 			}
3022 3022
 
3023
-			$addrelativediscount = '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditRelativeDiscounts") . '</a>';
3024
-			$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
3025
-			$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
3023
+			$addrelativediscount = '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditRelativeDiscounts").'</a>';
3024
+			$addabsolutediscount = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditGlobalDiscounts").'</a>';
3025
+			$addcreditnote = '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$soc->id.'&type=2&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddCreditNote").'</a>';
3026 3026
 
3027
-			print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td class="valuefield">';
3027
+			print '<tr><td class="titlefield">'.$langs->trans('Discounts').'</td><td class="valuefield">';
3028 3028
 
3029 3029
 			$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3030 3030
 			$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3033,8 +3033,8 @@  discard block
 block discarded – undo
3033 3033
 
3034 3034
 			$thirdparty = $soc;
3035 3035
 			$discount_type = 0;
3036
-			$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3037
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3036
+			$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3037
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3038 3038
 
3039 3039
 			print '</td></tr>';
3040 3040
 
@@ -3044,17 +3044,17 @@  discard block
 block discarded – undo
3044 3044
 			print $form->editfieldkey("Date", 'date', '', $object, (int) $editenable);
3045 3045
 			print '</td><td class="valuefield">';
3046 3046
 			if ($action == 'editdate') {
3047
-				print '<form name="setdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3048
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3047
+				print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3048
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3049 3049
 				print '<input type="hidden" name="action" value="setdate">';
3050
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3050
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3051 3051
 				print $form->selectDate($object->date, 'order_', 0, 0, 0, "setdate");
3052
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3052
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3053 3053
 				print '</form>';
3054 3054
 			} else {
3055 3055
 				print $object->date ? dol_print_date($object->date, 'day') : '&nbsp;';
3056 3056
 				if ($object->hasDelay() && empty($object->delivery_date)) {	// If there is a delivery date planned, warning should be on this date
3057
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3057
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3058 3058
 				}
3059 3059
 			}
3060 3060
 			print '</td>';
@@ -3066,17 +3066,17 @@  discard block
 block discarded – undo
3066 3066
 			print $form->editfieldkey("DateDeliveryPlanned", 'date_livraison', '', $object, (int) $editenable);
3067 3067
 			print '</td><td class="valuefield">';
3068 3068
 			if ($action == 'editdate_livraison') {
3069
-				print '<form name="setdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3070
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3069
+				print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3070
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3071 3071
 				print '<input type="hidden" name="action" value="setdate_livraison">';
3072
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3072
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3073 3073
 				print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
3074
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3074
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3075 3075
 				print '</form>';
3076 3076
 			} else {
3077 3077
 				print $object->delivery_date ? dol_print_date($object->delivery_date, 'dayhour') : '&nbsp;';
3078 3078
 				if ($object->hasDelay() && !empty($object->delivery_date)) {
3079
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3079
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3080 3080
 				}
3081 3081
 			}
3082 3082
 			print '</td>';
@@ -3088,9 +3088,9 @@  discard block
 block discarded – undo
3088 3088
 			print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, (int) $editenable);
3089 3089
 			print '</td><td class="valuefield">';
3090 3090
 			if ($action == 'editavailability') {
3091
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3091
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3092 3092
 			} else {
3093
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3093
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3094 3094
 			}
3095 3095
 			print '</td></tr>';
3096 3096
 
@@ -3101,9 +3101,9 @@  discard block
 block discarded – undo
3101 3101
 				print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, (int) $editenable);
3102 3102
 				print '</td><td class="valuefield">';
3103 3103
 				if ($action == 'editshippingmethod') {
3104
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3104
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3105 3105
 				} else {
3106
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3106
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3107 3107
 				}
3108 3108
 				print '</td>';
3109 3109
 				print '</tr>';
@@ -3112,16 +3112,16 @@  discard block
 block discarded – undo
3112 3112
 			// Warehouse
3113 3113
 			if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
3114 3114
 				$langs->load('stocks');
3115
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3115
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3116 3116
 				$formproduct = new FormProduct($db);
3117 3117
 				print '<tr><td>';
3118 3118
 				$editenable = $usercancreate;
3119 3119
 				print $form->editfieldkey("Warehouse", 'warehouse', '', $object, (int) $editenable);
3120 3120
 				print '</td><td class="valuefield">';
3121 3121
 				if ($action == 'editwarehouse') {
3122
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3122
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3123 3123
 				} else {
3124
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3124
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3125 3125
 				}
3126 3126
 				print '</td>';
3127 3127
 				print '</tr>';
@@ -3133,9 +3133,9 @@  discard block
 block discarded – undo
3133 3133
 			print $form->editfieldkey("Source", 'demandreason', '', $object, (int) $editenable);
3134 3134
 			print '</td><td class="valuefield">';
3135 3135
 			if ($action == 'editdemandreason') {
3136
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3136
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3137 3137
 			} else {
3138
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3138
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3139 3139
 			}
3140 3140
 			print '</td></tr>';
3141 3141
 
@@ -3145,9 +3145,9 @@  discard block
 block discarded – undo
3145 3145
 			print $form->editfieldkey("PaymentConditionsShort", 'conditions', '', $object, (int) $editenable);
3146 3146
 			print '</td><td class="valuefield">';
3147 3147
 			if ($action == 'editconditions') {
3148
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3148
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3149 3149
 			} else {
3150
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3150
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3151 3151
 			}
3152 3152
 			print '</td>';
3153 3153
 
@@ -3159,9 +3159,9 @@  discard block
 block discarded – undo
3159 3159
 			print $form->editfieldkey("PaymentMode", 'mode', '', $object, (int) $editenable);
3160 3160
 			print '</td><td class="valuefield">';
3161 3161
 			if ($action == 'editmode') {
3162
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3162
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3163 3163
 			} else {
3164
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3164
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3165 3165
 			}
3166 3166
 			print '</td></tr>';
3167 3167
 
@@ -3183,13 +3183,13 @@  discard block
 block discarded – undo
3183 3183
 			$totalWeight = $tmparray['weight'];
3184 3184
 			$totalVolume = $tmparray['volume'];
3185 3185
 			if ($totalWeight) {
3186
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3186
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3187 3187
 				print '<td class="valuefield">';
3188 3188
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
3189 3189
 				print '</td></tr>';
3190 3190
 			}
3191 3191
 			if ($totalVolume) {
3192
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3192
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3193 3193
 				print '<td class="valuefield">';
3194 3194
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no');
3195 3195
 				print '</td></tr>';
@@ -3207,7 +3207,7 @@  discard block
 block discarded – undo
3207 3207
 				if ($action != 'editincoterm') {
3208 3208
 					print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3209 3209
 				} else {
3210
-					print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3210
+					print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3211 3211
 				}
3212 3212
 				print '</td></tr>';
3213 3213
 			}
@@ -3219,9 +3219,9 @@  discard block
 block discarded – undo
3219 3219
 				print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, (int) $editenable);
3220 3220
 				print '</td><td class="valuefield">';
3221 3221
 				if ($action == 'editbankaccount') {
3222
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3222
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3223 3223
 				} else {
3224
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3224
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3225 3225
 				}
3226 3226
 				print '</td>';
3227 3227
 				print '</tr>';
@@ -3234,7 +3234,7 @@  discard block
 block discarded – undo
3234 3234
 				print $langs->trans("Categories");
3235 3235
 				print '<td><td class="right">';
3236 3236
 				if ($usercancreate) {
3237
-					print '<a class="editfielda" href="' . DOL_URL_ROOT . '/commande/card.php?id=' . $object->id . '&action=edittags&token=' . newToken() . '">' . img_edit() . '</a>';
3237
+					print '<a class="editfielda" href="'.DOL_URL_ROOT.'/commande/card.php?id='.$object->id.'&action=edittags&token='.newToken().'">'.img_edit().'</a>';
3238 3238
 				} else {
3239 3239
 					print '&nbsp;';
3240 3240
 				}
@@ -3242,11 +3242,11 @@  discard block
 block discarded – undo
3242 3242
 				print '</td>';
3243 3243
 				print '<td>';
3244 3244
 				if ($action == 'edittags') {
3245
-					print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
3245
+					print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
3246 3246
 					print '<input type="hidden" name="action" value="settags">';
3247
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
3247
+					print '<input type="hidden" name="token" value="'.newToken().'">';
3248 3248
 					print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
3249
-					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
3249
+					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
3250 3250
 					print '</form>';
3251 3251
 				} else {
3252 3252
 					print $form->showCategories($object->id, Categorie::TYPE_ORDER, 1);
@@ -3255,7 +3255,7 @@  discard block
 block discarded – undo
3255 3255
 			}
3256 3256
 
3257 3257
 			// Other attributes
3258
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3258
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3259 3259
 
3260 3260
 			print '</table>';
3261 3261
 
@@ -3265,40 +3265,40 @@  discard block
 block discarded – undo
3265 3265
 
3266 3266
 			print '<table class="border tableforfield centpercent">';
3267 3267
 
3268
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3268
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3269 3269
 
3270 3270
 			$alert = '';
3271 3271
 			if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) {
3272
-				$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
3272
+				$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
3273 3273
 			}
3274 3274
 
3275 3275
 			print '<tr>';
3276
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3277
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3276
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3277
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3278 3278
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3279 3279
 				// Multicurrency Amount HT
3280
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3280
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3281 3281
 			}
3282 3282
 			print '</tr>';
3283 3283
 
3284 3284
 			print '<tr>';
3285
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
3286
-			print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3285
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
3286
+			print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3287 3287
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3288 3288
 				// Multicurrency Amount VAT
3289
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3289
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3290 3290
 			}
3291 3291
 			print '</tr>';
3292 3292
 
3293 3293
 			// Amount Local Taxes
3294 3294
 			if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3295 3295
 				print '<tr>';
3296
-				print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3297
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3296
+				print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3297
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3298 3298
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3299 3299
 					$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3300 3300
 
3301
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3301
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3302 3302
 				}
3303 3303
 				print '</tr>';
3304 3304
 			}
@@ -3306,24 +3306,24 @@  discard block
 block discarded – undo
3306 3306
 			// Amount Local Taxes
3307 3307
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3308 3308
 				print '<tr>';
3309
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3310
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3309
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3310
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3311 3311
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3312 3312
 					$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3313 3313
 
3314
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3314
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3315 3315
 				}
3316 3316
 				print '</tr>';
3317 3317
 			}
3318 3318
 
3319 3319
 			print '<tr>';
3320
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3321
-			print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
3320
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3321
+			print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
3322 3322
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3323 3323
 				// Multicurrency Amount TTC
3324
-				print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
3324
+				print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
3325 3325
 			}
3326
-			print '</tr>' . "\n";
3326
+			print '</tr>'."\n";
3327 3327
 
3328 3328
 			print '</table>';
3329 3329
 
@@ -3344,13 +3344,13 @@  discard block
 block discarded – undo
3344 3344
 			if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3345 3345
 				$blocname = 'contacts';
3346 3346
 				$title = $langs->trans('ContactsAddresses');
3347
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3347
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3348 3348
 			}
3349 3349
 
3350 3350
 			if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3351 3351
 				$blocname = 'notes';
3352 3352
 				$title = $langs->trans('Notes');
3353
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3353
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3354 3354
 			}
3355 3355
 
3356 3356
 			/*
@@ -3365,20 +3365,20 @@  discard block
 block discarded – undo
3365 3365
 			global $inputalsopricewithtax;
3366 3366
 			$inputalsopricewithtax = 1;
3367 3367
 
3368
-			print '<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3369
-			<input type="hidden" name="token" value="' . newToken() . '">
3370
-			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3368
+			print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3369
+			<input type="hidden" name="token" value="' . newToken().'">
3370
+			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3371 3371
 			<input type="hidden" name="mode" value="">
3372 3372
 			<input type="hidden" name="page_y" value="">
3373
-			<input type="hidden" name="id" value="' . $object->id . '">
3374
-			<input type="hidden" name="backtopage" value="' . $backtopage . '">
3373
+			<input type="hidden" name="id" value="' . $object->id.'">
3374
+			<input type="hidden" name="backtopage" value="' . $backtopage.'">
3375 3375
 				';
3376 3376
 
3377 3377
 			if (!empty($conf->use_javascript_ajax) && $object->status == Commande::STATUS_DRAFT) {
3378 3378
 				if (isModEnabled('subtotals')) {
3379
-					include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3379
+					include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3380 3380
 				} else {
3381
-					include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3381
+					include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3382 3382
 				}
3383 3383
 			}
3384 3384
 
@@ -3433,22 +3433,22 @@  discard block
 block discarded – undo
3433 3433
 
3434 3434
 				// Reopen a closed order
3435 3435
 				if (($object->status == Commande::STATUS_CLOSED || $object->status == Commande::STATUS_CANCELED) && $usercancreate && (!$object->billed || !getDolGlobalInt('ORDER_DONT_REOPEN_BILLED'))) {
3436
-					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"] . '?action=reopen&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3436
+					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
3437 3437
 				}
3438 3438
 
3439 3439
 				// Send
3440 3440
 				if (empty($user->socid)) {
3441 3441
 					if ($object->status > Commande::STATUS_DRAFT || getDolGlobalString('COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS')) {
3442 3442
 						if ($usercansend) {
3443
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '');
3443
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3444 3444
 						} else {
3445
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'] . '#', '', false);
3445
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
3446 3446
 						}
3447 3447
 					}
3448 3448
 				}
3449 3449
 
3450 3450
 				// Subtotal
3451
-				if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3451
+				if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3452 3452
 					$langs->load('subtotals');
3453 3453
 
3454 3454
 					$url_button = array();
@@ -3458,7 +3458,7 @@  discard block
 block discarded – undo
3458 3458
 						'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
3459 3459
 						'perm' => (bool) $usercancreate,
3460 3460
 						'label' => $langs->trans('AddTitleLine'),
3461
-						'url' => '/commande/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3461
+						'url' => '/commande/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3462 3462
 					);
3463 3463
 
3464 3464
 					$url_button[] = array(
@@ -3466,7 +3466,7 @@  discard block
 block discarded – undo
3466 3466
 						'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
3467 3467
 						'perm' => (bool) $usercancreate,
3468 3468
 						'label' => $langs->trans('AddSubtotalLine'),
3469
-						'url' => '/commande/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3469
+						'url' => '/commande/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3470 3470
 					);
3471 3471
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
3472 3472
 				}
@@ -3474,15 +3474,15 @@  discard block
 block discarded – undo
3474 3474
 				// Valid
3475 3475
 				if ($object->status == Commande::STATUS_DRAFT && ($object->total_ttc >= 0 || getDolGlobalString('ORDER_ENABLE_NEGATIVE')) && $usercanvalidate) {
3476 3476
 					if ($numlines > 0) {
3477
-						print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"] . '?action=validate&amp;token=' . newToken() . '&amp;id=' . $object->id, (string) $object->id, 1);
3477
+						print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&amp;token='.newToken().'&amp;id='.$object->id, (string) $object->id, 1);
3478 3478
 					} else {
3479 3479
 						$langs->load("errors");
3480
-						print dolGetButtonAction($langs->trans("ErrorObjectMustHaveLinesToBeValidated", $object->ref), $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"] . '?action=validate&amp;token=' . newToken() . '&amp;id=' . $object->id, (string) $object->id, -1);
3480
+						print dolGetButtonAction($langs->trans("ErrorObjectMustHaveLinesToBeValidated", $object->ref), $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&amp;token='.newToken().'&amp;id='.$object->id, (string) $object->id, -1);
3481 3481
 					}
3482 3482
 				}
3483 3483
 				// Edit
3484 3484
 				if (($object->status == Commande::STATUS_VALIDATED || ($object->status == Commande::STATUS_SHIPMENTONPROCESS && getDolGlobalString('EDIT_ORDER_SHIPMENT_ON_PROCESS'))) && $usercancreate) {
3485
-					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"] . '?action=modif&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3485
+					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&amp;token='.newToken().'&amp;id='.$object->id, '');
3486 3486
 				}
3487 3487
 
3488 3488
 				$arrayforbutaction = array();
@@ -3494,7 +3494,7 @@  discard block
 block discarded – undo
3494 3494
 						'enabled' => (isModEnabled("supplier_order") && $object->status > Commande::STATUS_DRAFT),
3495 3495
 						'perm' => $usercancreatepurchaseorder,
3496 3496
 						'label' => 'AddPurchaseOrder',
3497
-						'url' => '/fourn/commande/card.php?action=create&amp;origin=' . urlencode($object->element) . '&amp;originid=' . ((int) $object->id)
3497
+						'url' => '/fourn/commande/card.php?action=create&amp;origin='.urlencode($object->element).'&amp;originid='.((int) $object->id)
3498 3498
 					);
3499 3499
 				}
3500 3500
 
@@ -3511,7 +3511,7 @@  discard block
 block discarded – undo
3511 3511
 						'enabled' => (isModEnabled("intervention") && $object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0),
3512 3512
 						'perm' => ($user->hasRight('ficheinter', 'creer') == 1),
3513 3513
 						'label' => 'AddIntervention',
3514
-						'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3514
+						'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3515 3515
 					);
3516 3516
 				}
3517 3517
 
@@ -3521,7 +3521,7 @@  discard block
 block discarded – undo
3521 3521
 					'enabled' => (isModEnabled("contract") && ($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS || $object->status == Commande::STATUS_CLOSED)),
3522 3522
 					'perm' => ($user->hasRight('contrat', 'creer') == 1),
3523 3523
 					'label' => 'AddContract',
3524
-					'url' => '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
3524
+					'url' => '/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid,
3525 3525
 				);
3526 3526
 				/*if (isModEnabled('contrat') && ($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS || $object->status == Commande::STATUS_CLOSED)) {
3527 3527
 					$langs->load("contracts");
@@ -3545,7 +3545,7 @@  discard block
 block discarded – undo
3545 3545
 								'enabled' => (isModEnabled("shipping") && ($object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3546 3546
 								'perm' => $user->hasRight('expedition', 'creer'),
3547 3547
 								'label' => 'CreateShipment',
3548
-								'url' => '/expedition/shipment.php?id=' . $object->id
3548
+								'url' => '/expedition/shipment.php?id='.$object->id
3549 3549
 							);
3550 3550
 						} else {
3551 3551
 							//c$langs->load("errors");
@@ -3555,7 +3555,7 @@  discard block
 block discarded – undo
3555 3555
 								'enabled' => (isModEnabled("shipping") && ($object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3556 3556
 								'perm' => 0,
3557 3557
 								'label' => 'CreateShipment',
3558
-								'url' => '/expedition/shipment.php?id=' . $object->id
3558
+								'url' => '/expedition/shipment.php?id='.$object->id
3559 3559
 							);
3560 3560
 						}
3561 3561
 					}
@@ -3567,7 +3567,7 @@  discard block
 block discarded – undo
3567 3567
 					'enabled' => (isModEnabled('invoice') && $object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0),
3568 3568
 					'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')),
3569 3569
 					'label' => 'CreateBill',
3570
-					'url' => '/compta/facture/card.php?action=create&amp;token=' . newToken() . '&amp;origin=' . urlencode($object->element) . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid
3570
+					'url' => '/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid
3571 3571
 				);
3572 3572
 				/*
3573 3573
 				 if (isModEnabled('facture') && $object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
@@ -3588,38 +3588,38 @@  discard block
 block discarded – undo
3588 3588
 
3589 3589
 				// Set to shipped
3590 3590
 				if (($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
3591
-					print dolGetButtonAction('', $langs->trans('ClassifyShipped'), 'default', $_SERVER["PHP_SELF"] . '?action=shipped&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3591
+					print dolGetButtonAction('', $langs->trans('ClassifyShipped'), 'default', $_SERVER["PHP_SELF"].'?action=shipped&amp;token='.newToken().'&amp;id='.$object->id, '');
3592 3592
 				}
3593 3593
 
3594 3594
 				// Set billed or unbilled
3595 3595
 				// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
3596 3596
 				if ($object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
3597 3597
 					if ($usercancreate && $object->status >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) {
3598
-						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"] . '?action=classifybilled&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3598
+						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&amp;token='.newToken().'&amp;id='.$object->id, '');
3599 3599
 					}
3600 3600
 				}
3601 3601
 				if ($object->status > Commande::STATUS_DRAFT && $object->billed) {
3602 3602
 					if ($usercancreate && $object->status >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) {
3603
-						print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'delete', $_SERVER["PHP_SELF"] . '?action=classifyunbilled&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3603
+						print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'delete', $_SERVER["PHP_SELF"].'?action=classifyunbilled&amp;token='.newToken().'&amp;id='.$object->id, '');
3604 3604
 					}
3605 3605
 				}
3606 3606
 
3607 3607
 				// Clone
3608 3608
 				if ($usercancreate) {
3609
-					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"] . '?action=clone&token=' . newToken() . '&id=' . $object->id . '&socid=' . $object->socid, '');
3609
+					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id.'&socid='.$object->socid, '');
3610 3610
 				}
3611 3611
 
3612 3612
 				// Cancel order
3613 3613
 				if ($object->status == Commande::STATUS_VALIDATED && !empty($usercancancel)) {
3614
-					print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelOrder") . '</a>';
3614
+					print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelOrder").'</a>';
3615 3615
 				}
3616 3616
 
3617 3617
 				// Delete order
3618 3618
 				if ($usercandelete) {
3619 3619
 					if ($numshipping == 0) {
3620
-						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"] . '?action=delete&token=' . newToken() . '&id=' . $object->id, '');
3620
+						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
3621 3621
 					} else {
3622
-						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'] . '#', '', false);
3622
+						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3623 3623
 					}
3624 3624
 				}
3625 3625
 			}
@@ -3636,9 +3636,9 @@  discard block
 block discarded – undo
3636 3636
 			print '<a name="builddoc"></a>'; // ancre
3637 3637
 			// Documents
3638 3638
 			$objref = dol_sanitizeFileName($object->ref);
3639
-			$relativepath = $objref . '/' . $objref . '.pdf';
3640
-			$filedir = $conf->commande->multidir_output[$object->entity ?? $conf->entity] . '/' . $objref;
3641
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3639
+			$relativepath = $objref.'/'.$objref.'.pdf';
3640
+			$filedir = $conf->commande->multidir_output[$object->entity ?? $conf->entity].'/'.$objref;
3641
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3642 3642
 			$genallowed = $usercanread;
3643 3643
 			$delallowed = $usercancreate;
3644 3644
 			print $formfile->showdocuments('commande', $objref, $filedir, $urlsource, $genallowed, (int) $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang, '', $object);
@@ -3661,7 +3661,7 @@  discard block
 block discarded – undo
3661 3661
 
3662 3662
 			// Show online payment link
3663 3663
 			// The list can be complete by the hook 'doValidatePayment' executed inside getValidOnlinePaymentMethods()
3664
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3664
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3665 3665
 			$validpaymentmethod = getValidOnlinePaymentMethods('');
3666 3666
 			$useonlinepayment = count($validpaymentmethod);
3667 3667
 
@@ -3670,8 +3670,8 @@  discard block
 block discarded – undo
3670 3670
 			}
3671 3671
 			if ($object->status != Commande::STATUS_DRAFT && $useonlinepayment) {
3672 3672
 				print '<br><!-- Link to pay -->';
3673
-				require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3674
-				print showOnlinePaymentUrl('order', $object->ref) . '<br>';
3673
+				require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3674
+				print showOnlinePaymentUrl('order', $object->ref).'<br>';
3675 3675
 			}
3676 3676
 
3677 3677
 			print '</div><div class="fichehalfright">';
@@ -3679,11 +3679,11 @@  discard block
 block discarded – undo
3679 3679
 			$MAXEVENT = 10;
3680 3680
 
3681 3681
 			//button to go to messaging from the events box
3682
-			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/commande/messaging.php?id=' . $object->id);
3683
-			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/commande/agenda.php?id=' . $object->id);
3682
+			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/commande/messaging.php?id='.$object->id);
3683
+			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id);
3684 3684
 
3685 3685
 			// List of actions on element
3686
-			include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3686
+			include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3687 3687
 			$formactions = new FormActions($db);
3688 3688
 			$somethingshown = $formactions->showactions($object, 'order', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3689 3689
 
@@ -3694,9 +3694,9 @@  discard block
 block discarded – undo
3694 3694
 		$modelmail = 'order_send';
3695 3695
 		$defaulttopic = 'SendOrderRef';
3696 3696
 		$diroutput = getMultidirOutput($object);
3697
-		$trackid = 'ord' . $object->id;
3697
+		$trackid = 'ord'.$object->id;
3698 3698
 
3699
-		include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3699
+		include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3700 3700
 	}
3701 3701
 }
3702 3702
 
Please login to merge, or discard this patch.