Completed
Branch develop (bd1927)
by
unknown
22:42
created
htdocs/compta/bank/transfer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		$number[$i] = GETPOST($i.'_num_chq', 'alpha');
99 99
 
100 100
 		$tabnum[$i] = 0;
101
-		if (!empty($label[$i]) || !($amount[$i] <= 0) || !($accountfrom[$i] < 0) || !($accountto[$i]  < 0)) {
101
+		if (!empty($label[$i]) || !($amount[$i] <= 0) || !($accountfrom[$i] < 0) || !($accountto[$i] < 0)) {
102 102
 			$tabnum[$i] = 1;
103 103
 		}
104 104
 		$i++;
@@ -111,28 +111,28 @@  discard block
 block discarded – undo
111 111
 		if ($tabnum[$n] === 1) {
112 112
 			if ($accountfrom[$n] < 0) {
113 113
 				$error++;
114
-				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferFrom")), null, 'errors');
114
+				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("TransferFrom")), null, 'errors');
115 115
 			}
116 116
 			if ($accountto[$n] < 0) {
117 117
 				$error++;
118
-				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("TransferTo")), null, 'errors');
118
+				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("TransferTo")), null, 'errors');
119 119
 			}
120 120
 			if (!$type[$n]) {
121 121
 				$error++;
122
-				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Type")), null, 'errors');
122
+				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Type")), null, 'errors');
123 123
 			}
124 124
 			if (!$dateo[$n]) {
125 125
 				$error++;
126
-				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Date")), null, 'errors');
126
+				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Date")), null, 'errors');
127 127
 			}
128 128
 
129 129
 			if (!($label[$n])) {
130 130
 				$error++;
131
-				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' . $langs->transnoentities("Description")), null, 'errors');
131
+				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Description")), null, 'errors');
132 132
 			}
133 133
 			if (!($amount[$n])) {
134 134
 				$error++;
135
-				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n. ' ' .$langs->transnoentities("Amount")), null, 'errors');
135
+				setEventMessages($langs->trans("ErrorFieldRequired", '#'.$n.' '.$langs->transnoentities("Amount")), null, 'errors');
136 136
 			}
137 137
 
138 138
 			$tmpaccountfrom = new Account($db);
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 print '<td class="hideobject multicurrency right">'.$langs->trans("AmountToOthercurrency").'</td>';
313 313
 print '</tr>';
314 314
 
315
-for ($i = 1 ; $i < $MAXLINESFORTRANSFERT; $i++) {
315
+for ($i = 1; $i < $MAXLINESFORTRANSFERT; $i++) {
316 316
 	$label = '';
317 317
 	$amount = '';
318 318
 	$amountto = '';
Please login to merge, or discard this patch.
htdocs/commande/card.php 1 patch
Spacing   +274 added lines, -274 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,28 +2336,28 @@  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
-		$dateorder = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_ORDER') ? -1 : '');		// By default '' so we will autofill date. -1 means keep empty.
2352
+		$dateorder = (getDolGlobalString('MAIN_DO_NOT_AUTOFILL_DATE_ORDER') ? -1 : ''); // By default '' so we will autofill date. -1 means keep empty.
2353 2353
 
2354
-		print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td>';
2354
+		print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
2355 2355
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2356 2356
 		print $form->selectDate($dateorder, 're', 0, 0, 0, "crea_commande", 1, 1); // Always autofill date with current date
2357 2357
 		print '</td></tr>';
2358 2358
 
2359 2359
 		// Date delivery planned
2360
-		print '<tr><td>' . $langs->trans("DateDeliveryPlanned") . '</td>';
2360
+		print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
2361 2361
 		print '<td colspan="3">';
2362 2362
 		$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date);
2363 2363
 		print img_picto('', 'action', 'class="pictofixedwidth"');
@@ -2366,33 +2366,33 @@  discard block
 block discarded – undo
2366 2366
 		print '</tr>';
2367 2367
 
2368 2368
 		// Delivery delay
2369
-		print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td>';
2369
+		print '<tr class="fielddeliverydelay"><td>'.$langs->trans('AvailabilityPeriod').'</td><td>';
2370 2370
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
2371 2371
 		$form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOST('availability_id') : $availability_id), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2372 2372
 		print '</td></tr>';
2373 2373
 
2374 2374
 		// Terms of payment
2375
-		print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2375
+		print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2376 2376
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2377 2377
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', (float) $deposit_percent);
2378 2378
 		print '</td></tr>';
2379 2379
 
2380 2380
 		// Payment mode
2381
-		print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td>';
2381
+		print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
2382 2382
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2383 2383
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2384 2384
 		print '</td></tr>';
2385 2385
 
2386 2386
 		// Bank Account
2387 2387
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) {
2388
-			print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
2389
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2388
+			print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
2389
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2390 2390
 			print '</td></tr>';
2391 2391
 		}
2392 2392
 
2393 2393
 		// Shipping Method
2394 2394
 		if (isModEnabled('shipping')) {
2395
-			print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>';
2395
+			print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
2396 2396
 			print img_picto('', 'object_dolly', 'class="pictofixedwidth"');
2397 2397
 			$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');
2398 2398
 			print '</td></tr>';
@@ -2400,15 +2400,15 @@  discard block
 block discarded – undo
2400 2400
 
2401 2401
 		// Warehouse
2402 2402
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
2403
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2403
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2404 2404
 			$formproduct = new FormProduct($db);
2405
-			print '<tr><td>' . $langs->trans('Warehouse') . '</td><td>';
2406
-			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
+			print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
2406
+			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');
2407 2407
 			print '</td></tr>';
2408 2408
 		}
2409 2409
 
2410 2410
 		// Source / Channel - What trigger creation
2411
-		print '<tr><td>' . $langs->trans('Source') . '</td><td>';
2411
+		print '<tr><td>'.$langs->trans('Source').'</td><td>';
2412 2412
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2413 2413
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2414 2414
 		print '</td></tr>';
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
 			$langs->load("projects");
2421 2421
 			print '<tr>';
2422 2422
 			print '<td>'.$langs->trans("Project").'</td><td>';
2423
-			print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects((($soc->id > 0  && !getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_CUSTOMERS')) ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2423
+			print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects((($soc->id > 0 && !getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_CUSTOMERS')) ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2424 2424
 			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>';
2425 2425
 			print '</td>';
2426 2426
 			print '</tr>';
@@ -2429,7 +2429,7 @@  discard block
 block discarded – undo
2429 2429
 		// Incoterms
2430 2430
 		if (isModEnabled('incoterm')) {
2431 2431
 			print '<tr>';
2432
-			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>';
2432
+			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>';
2433 2433
 			print '<td class="maxwidthonsmartphone">';
2434 2434
 			$incoterm_id = GETPOST('incoterm_id');
2435 2435
 			$location_incoterms = GETPOST('location_incoterms');
@@ -2445,7 +2445,7 @@  discard block
 block discarded – undo
2445 2445
 		// Other attributes
2446 2446
 		$parameters = array();
2447 2447
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
2448
-			$parameters['objectsrc'] =  $objectsrc;
2448
+			$parameters['objectsrc'] = $objectsrc;
2449 2449
 		}
2450 2450
 		$parameters['socid'] = $socid;
2451 2451
 
@@ -2466,9 +2466,9 @@  discard block
 block discarded – undo
2466 2466
 		}
2467 2467
 
2468 2468
 		// Template to use by default
2469
-		print '<tr><td>' . $langs->trans('DefaultModel') . '</td>';
2469
+		print '<tr><td>'.$langs->trans('DefaultModel').'</td>';
2470 2470
 		print '<td>';
2471
-		include_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php';
2471
+		include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
2472 2472
 		$liste = ModelePDFCommandes::liste_modeles($db);
2473 2473
 		$preselected = getDolGlobalString('COMMANDE_ADDON_PDF');
2474 2474
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
@@ -2478,22 +2478,22 @@  discard block
 block discarded – undo
2478 2478
 		// Multicurrency
2479 2479
 		if (isModEnabled("multicurrency")) {
2480 2480
 			print '<tr>';
2481
-			print '<td>' . $form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0) . '</td>';
2481
+			print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>';
2482 2482
 			print '<td class="maxwidthonsmartphone">';
2483
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2483
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2484 2484
 			print '</td></tr>';
2485 2485
 		}
2486 2486
 
2487 2487
 		// Categories
2488 2488
 		if (isModEnabled('category')) {
2489
-			print '<tr><td>' . $langs->trans("Categories") . '</td><td colspan="3">';
2489
+			print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
2490 2490
 			print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
2491 2491
 			print "</td></tr>";
2492 2492
 		}
2493 2493
 
2494 2494
 		// Note public
2495 2495
 		print '<tr>';
2496
-		print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
2496
+		print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
2497 2497
 		print '<td>';
2498 2498
 
2499 2499
 		$doleditor = new DolEditor('note_public', (string) $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2504,7 +2504,7 @@  discard block
 block discarded – undo
2504 2504
 		// Note private
2505 2505
 		if (empty($user->socid)) {
2506 2506
 			print '<tr>';
2507
-			print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
2507
+			print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
2508 2508
 			print '<td>';
2509 2509
 
2510 2510
 			$doleditor = new DolEditor('note_private', (string) $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2522,12 +2522,12 @@  discard block
 block discarded – undo
2522 2522
 				$objectsrc->update_price(1);
2523 2523
 			}
2524 2524
 
2525
-			print "\n<!-- " . $classname . " info -->\n";
2526
-			print '<input type="hidden" name="amount"   value="' . $objectsrc->total_ht . '">' . "\n";
2527
-			print '<input type="hidden" name="total"    value="' . $objectsrc->total_ttc . '">' . "\n";
2528
-			print '<input type="hidden" name="tva"      value="' . $objectsrc->total_tva . '">' . "\n";
2529
-			print '<input type="hidden" name="origin"   value="' . $objectsrc->element . '">';
2530
-			print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">';
2525
+			print "\n<!-- ".$classname." info -->\n";
2526
+			print '<input type="hidden" name="amount"   value="'.$objectsrc->total_ht.'">'."\n";
2527
+			print '<input type="hidden" name="total"    value="'.$objectsrc->total_ttc.'">'."\n";
2528
+			print '<input type="hidden" name="tva"      value="'.$objectsrc->total_tva.'">'."\n";
2529
+			print '<input type="hidden" name="origin"   value="'.$objectsrc->element.'">';
2530
+			print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
2531 2531
 
2532 2532
 			switch ($classname) {
2533 2533
 				case 'Propal':
@@ -2546,25 +2546,25 @@  discard block
 block discarded – undo
2546 2546
 					$newclassname = $classname;
2547 2547
 			}
2548 2548
 
2549
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2549
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2550 2550
 
2551 2551
 			// Amount
2552
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht) . '</td></tr>';
2553
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva) . "</td></tr>";
2552
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>';
2553
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>";
2554 2554
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1 RE
2555
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1) . "</td></tr>";
2555
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>";
2556 2556
 			}
2557 2557
 
2558 2558
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2 IRPF
2559
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2) . "</td></tr>";
2559
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>";
2560 2560
 			}
2561 2561
 
2562
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc) . "</td></tr>";
2562
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>";
2563 2563
 
2564 2564
 			if (isModEnabled("multicurrency")) {
2565
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2566
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2567
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2565
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2566
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2567
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2568 2568
 			}
2569 2569
 		}
2570 2570
 
@@ -2634,7 +2634,7 @@  discard block
 block discarded – undo
2634 2634
 
2635 2635
 			$text = $langs->trans('ConfirmValidateOrder', $numref);
2636 2636
 			if (isModEnabled('notification')) {
2637
-				require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2637
+				require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2638 2638
 				$notify = new Notify($db);
2639 2639
 				$text .= '<br>';
2640 2640
 				$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid, $object);
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
 			$formquestion = array();
2651 2651
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2652 2652
 				$langs->load("stocks");
2653
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2653
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2654 2654
 				$formproduct = new FormProduct($db);
2655 2655
 				$forcecombo = 0;
2656 2656
 				if ($conf->browser->name == 'ie') {
@@ -2668,7 +2668,7 @@  discard block
 block discarded – undo
2668 2668
 			$nbMandated = 0;
2669 2669
 			foreach ($object->lines as $line) {
2670 2670
 				$res = $line->fetch_product();
2671
-				if ($res  > 0) {
2671
+				if ($res > 0) {
2672 2672
 					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2673 2673
 						$nbMandated++;
2674 2674
 						break;
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
 					setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2681 2681
 					$error++;
2682 2682
 				} else {
2683
-					$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2683
+					$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2684 2684
 				}
2685 2685
 			}
2686 2686
 
@@ -2692,7 +2692,7 @@  discard block
 block discarded – undo
2692 2692
 				$deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2693 2693
 
2694 2694
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2695
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2695
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2696 2696
 
2697 2697
 					$object->fetchObjectLinked();
2698 2698
 
@@ -2812,7 +2812,7 @@  discard block
 block discarded – undo
2812 2812
 			$formquestion = array();
2813 2813
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2814 2814
 				$langs->load("stocks");
2815
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2815
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2816 2816
 				$formproduct = new FormProduct($db);
2817 2817
 				$forcecombo = 0;
2818 2818
 				if ($conf->browser->name == 'ie') {
@@ -2852,7 +2852,7 @@  discard block
 block discarded – undo
2852 2852
 			$formquestion = array();
2853 2853
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2854 2854
 				$langs->load("stocks");
2855
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2855
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2856 2856
 				$formproduct = new FormProduct($db);
2857 2857
 				$forcecombo = 0;
2858 2858
 				if ($conf->browser->name == 'ie') {
@@ -2871,7 +2871,7 @@  discard block
 block discarded – undo
2871 2871
 
2872 2872
 		// Confirmation to delete line
2873 2873
 		if ($action == 'ask_deleteline') {
2874
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2874
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2875 2875
 		}
2876 2876
 
2877 2877
 		// Confirmation de la suppression d'une ligne subtotal
@@ -2884,7 +2884,7 @@  discard block
 block discarded – undo
2884 2884
 				$title = "DeleteTitleLine";
2885 2885
 				$question = "ConfirmDeleteTitleLine";
2886 2886
 			}
2887
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2887
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2888 2888
 		}
2889 2889
 
2890 2890
 		// Clone confirmation
@@ -2902,12 +2902,12 @@  discard block
 block discarded – undo
2902 2902
 			$langs->load('subtotals');
2903 2903
 			$type = 'title';
2904 2904
 			$depth_array = $object->getPossibleLevels($langs);
2905
-			include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_create.tpl.php';
2905
+			include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_create.tpl.php';
2906 2906
 		} elseif ($action == 'add_subtotal_line') {
2907 2907
 			$langs->load('subtotals');
2908 2908
 			$type = 'subtotal';
2909 2909
 			$titles = $object->getPossibleTitles();
2910
-			include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_create.tpl.php';
2910
+			include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_create.tpl.php';
2911 2911
 		}
2912 2912
 
2913 2913
 		// Call Hook formConfirm
@@ -2926,16 +2926,16 @@  discard block
 block discarded – undo
2926 2926
 
2927 2927
 		// Order card
2928 2928
 
2929
-		$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2929
+		$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2930 2930
 
2931 2931
 		$morehtmlref = '<div class="refidno">';
2932 2932
 		// Ref customer
2933 2933
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string', '', 0, 1);
2934
-		$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);
2934
+		$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);
2935 2935
 		// Thirdparty
2936
-		$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
2936
+		$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2937 2937
 		if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
2938
-			$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/commande/list.php?socid=' . $object->thirdparty->id . '&search_societe=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherOrders") . '</a>)';
2938
+			$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
2939 2939
 		}
2940 2940
 		// Project
2941 2941
 		if (isModEnabled('project')) {
@@ -2944,16 +2944,16 @@  discard block
 block discarded – undo
2944 2944
 			if ($usercancreate) {
2945 2945
 				$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
2946 2946
 				if ($action != 'classify') {
2947
-					$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
2947
+					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
2948 2948
 				}
2949
-				$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');
2949
+				$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');
2950 2950
 			} else {
2951 2951
 				if (!empty($object->fk_project)) {
2952 2952
 					$proj = new Project($db);
2953 2953
 					$proj->fetch($object->fk_project);
2954 2954
 					$morehtmlref .= $proj->getNomUrl(1);
2955 2955
 					if ($proj->title) {
2956
-						$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
2956
+						$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
2957 2957
 					}
2958 2958
 				}
2959 2959
 			}
@@ -2981,20 +2981,20 @@  discard block
 block discarded – undo
2981 2981
 				print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo'));
2982 2982
 				print '</td>';
2983 2983
 				if ($action != 'editposinfo' && $usercancreate) {
2984
-					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>';
2984
+					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>';
2985 2985
 				}
2986 2986
 				print '</tr></table>';
2987 2987
 				print '</td><td class="valuefield fieldname_type">';
2988
-				print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" name="formposinfo">';
2988
+				print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="formposinfo">';
2989 2989
 				print '<input type="hidden" name="action" value="setposinfo">';
2990
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
2990
+				print '<input type="hidden" name="token" value="'.newToken().'">';
2991 2991
 				if ($action == 'editposinfo') {
2992
-					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="' . $langs->trans("POSModule") . '" value="' . $object->module_source . '"> ';
2993
-					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="' . $langs->trans("Terminal") . '" value="' . $object->pos_source . '">';
2994
-					print '<input type="submit" class="button" name="submitposinfo" value="' . $langs->trans("Submit") . '">';
2992
+					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="'.$langs->trans("POSModule").'" value="'.$object->module_source.'"> ';
2993
+					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="'.$langs->trans("Terminal").'" value="'.$object->pos_source.'">';
2994
+					print '<input type="submit" class="button" name="submitposinfo" value="'.$langs->trans("Submit").'">';
2995 2995
 				} else {
2996 2996
 					if ($object->module_source) {
2997
-						print '<span class="opacitymediumbycolor paddingleft">' . dolPrintHTML(ucfirst($object->module_source) . ' - ' . $langs->transnoentitiesnoconv("Terminal") . ' ' . $object->pos_source) . '</span>';
2997
+						print '<span class="opacitymediumbycolor paddingleft">'.dolPrintHTML(ucfirst($object->module_source).' - '.$langs->transnoentitiesnoconv("Terminal").' '.$object->pos_source).'</span>';
2998 2998
 					}
2999 2999
 				}
3000 3000
 				print '</form>';
@@ -3007,7 +3007,7 @@  discard block
 block discarded – undo
3007 3007
 				print $langs->trans('OutstandingBill');
3008 3008
 				print '</td><td class="valuefield">';
3009 3009
 				$arrayoutstandingbills = $soc->getOutstandingBills();
3010
-				print price($arrayoutstandingbills['opened']) . ' / ';
3010
+				print price($arrayoutstandingbills['opened']).' / ';
3011 3011
 				print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency);
3012 3012
 				print '</td>';
3013 3013
 				print '</tr>';
@@ -3022,11 +3022,11 @@  discard block
 block discarded – undo
3022 3022
 				$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3023 3023
 			}
3024 3024
 
3025
-			$addrelativediscount = '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditRelativeDiscounts") . '</a>';
3026
-			$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
3027
-			$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>';
3025
+			$addrelativediscount = '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditRelativeDiscounts").'</a>';
3026
+			$addabsolutediscount = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditGlobalDiscounts").'</a>';
3027
+			$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>';
3028 3028
 
3029
-			print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td class="valuefield">';
3029
+			print '<tr><td class="titlefield">'.$langs->trans('Discounts').'</td><td class="valuefield">';
3030 3030
 
3031 3031
 			$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3032 3032
 			$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3035,8 +3035,8 @@  discard block
 block discarded – undo
3035 3035
 
3036 3036
 			$thirdparty = $soc;
3037 3037
 			$discount_type = 0;
3038
-			$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3039
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3038
+			$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3039
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3040 3040
 
3041 3041
 			print '</td></tr>';
3042 3042
 
@@ -3046,17 +3046,17 @@  discard block
 block discarded – undo
3046 3046
 			print $form->editfieldkey("Date", 'date', '', $object, (int) $editenable);
3047 3047
 			print '</td><td class="valuefield">';
3048 3048
 			if ($action == 'editdate') {
3049
-				print '<form name="setdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3050
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3049
+				print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3050
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3051 3051
 				print '<input type="hidden" name="action" value="setdate">';
3052
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3052
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3053 3053
 				print $form->selectDate($object->date, 'order_', 0, 0, 0, "setdate");
3054
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3054
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3055 3055
 				print '</form>';
3056 3056
 			} else {
3057 3057
 				print $object->date ? dol_print_date($object->date, 'day') : '&nbsp;';
3058 3058
 				if ($object->hasDelay() && empty($object->delivery_date)) {	// If there is a delivery date planned, warning should be on this date
3059
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3059
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3060 3060
 				}
3061 3061
 			}
3062 3062
 			print '</td>';
@@ -3068,17 +3068,17 @@  discard block
 block discarded – undo
3068 3068
 			print $form->editfieldkey("DateDeliveryPlanned", 'date_livraison', '', $object, (int) $editenable);
3069 3069
 			print '</td><td class="valuefield">';
3070 3070
 			if ($action == 'editdate_livraison') {
3071
-				print '<form name="setdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3072
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3071
+				print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3072
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3073 3073
 				print '<input type="hidden" name="action" value="setdate_livraison">';
3074
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3074
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3075 3075
 				print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
3076
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3076
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3077 3077
 				print '</form>';
3078 3078
 			} else {
3079 3079
 				print $object->delivery_date ? dol_print_date($object->delivery_date, 'dayhour') : '&nbsp;';
3080 3080
 				if ($object->hasDelay() && !empty($object->delivery_date)) {
3081
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3081
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3082 3082
 				}
3083 3083
 			}
3084 3084
 			print '</td>';
@@ -3090,9 +3090,9 @@  discard block
 block discarded – undo
3090 3090
 			print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, (int) $editenable);
3091 3091
 			print '</td><td class="valuefield">';
3092 3092
 			if ($action == 'editavailability') {
3093
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3093
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3094 3094
 			} else {
3095
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3095
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3096 3096
 			}
3097 3097
 			print '</td></tr>';
3098 3098
 
@@ -3103,9 +3103,9 @@  discard block
 block discarded – undo
3103 3103
 				print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, (int) $editenable);
3104 3104
 				print '</td><td class="valuefield">';
3105 3105
 				if ($action == 'editshippingmethod') {
3106
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3106
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3107 3107
 				} else {
3108
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3108
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3109 3109
 				}
3110 3110
 				print '</td>';
3111 3111
 				print '</tr>';
@@ -3114,16 +3114,16 @@  discard block
 block discarded – undo
3114 3114
 			// Warehouse
3115 3115
 			if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
3116 3116
 				$langs->load('stocks');
3117
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3117
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3118 3118
 				$formproduct = new FormProduct($db);
3119 3119
 				print '<tr><td>';
3120 3120
 				$editenable = $usercancreate;
3121 3121
 				print $form->editfieldkey("Warehouse", 'warehouse', '', $object, (int) $editenable);
3122 3122
 				print '</td><td class="valuefield">';
3123 3123
 				if ($action == 'editwarehouse') {
3124
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3124
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3125 3125
 				} else {
3126
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3126
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3127 3127
 				}
3128 3128
 				print '</td>';
3129 3129
 				print '</tr>';
@@ -3135,9 +3135,9 @@  discard block
 block discarded – undo
3135 3135
 			print $form->editfieldkey("Source", 'demandreason', '', $object, (int) $editenable);
3136 3136
 			print '</td><td class="valuefield">';
3137 3137
 			if ($action == 'editdemandreason') {
3138
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3138
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3139 3139
 			} else {
3140
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3140
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3141 3141
 			}
3142 3142
 			print '</td></tr>';
3143 3143
 
@@ -3147,9 +3147,9 @@  discard block
 block discarded – undo
3147 3147
 			print $form->editfieldkey("PaymentConditionsShort", 'conditions', '', $object, (int) $editenable);
3148 3148
 			print '</td><td class="valuefield">';
3149 3149
 			if ($action == 'editconditions') {
3150
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3150
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3151 3151
 			} else {
3152
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3152
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3153 3153
 			}
3154 3154
 			print '</td>';
3155 3155
 
@@ -3161,9 +3161,9 @@  discard block
 block discarded – undo
3161 3161
 			print $form->editfieldkey("PaymentMode", 'mode', '', $object, (int) $editenable);
3162 3162
 			print '</td><td class="valuefield">';
3163 3163
 			if ($action == 'editmode') {
3164
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3164
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3165 3165
 			} else {
3166
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3166
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3167 3167
 			}
3168 3168
 			print '</td></tr>';
3169 3169
 
@@ -3185,13 +3185,13 @@  discard block
 block discarded – undo
3185 3185
 			$totalWeight = $tmparray['weight'];
3186 3186
 			$totalVolume = $tmparray['volume'];
3187 3187
 			if ($totalWeight) {
3188
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3188
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3189 3189
 				print '<td class="valuefield">';
3190 3190
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'));
3191 3191
 				print '</td></tr>';
3192 3192
 			}
3193 3193
 			if ($totalVolume) {
3194
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3194
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3195 3195
 				print '<td class="valuefield">';
3196 3196
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'));
3197 3197
 				print '</td></tr>';
@@ -3209,7 +3209,7 @@  discard block
 block discarded – undo
3209 3209
 				if ($action != 'editincoterm') {
3210 3210
 					print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3211 3211
 				} else {
3212
-					print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3212
+					print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3213 3213
 				}
3214 3214
 				print '</td></tr>';
3215 3215
 			}
@@ -3221,9 +3221,9 @@  discard block
 block discarded – undo
3221 3221
 				print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, (int) $editenable);
3222 3222
 				print '</td><td class="valuefield">';
3223 3223
 				if ($action == 'editbankaccount') {
3224
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3224
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3225 3225
 				} else {
3226
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3226
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3227 3227
 				}
3228 3228
 				print '</td>';
3229 3229
 				print '</tr>';
@@ -3236,7 +3236,7 @@  discard block
 block discarded – undo
3236 3236
 				print $langs->trans("Categories");
3237 3237
 				print '<td><td class="right">';
3238 3238
 				if ($usercancreate) {
3239
-					print '<a class="editfielda" href="' . DOL_URL_ROOT . '/commande/card.php?id=' . $object->id . '&action=edittags&token=' . newToken() . '">' . img_edit() . '</a>';
3239
+					print '<a class="editfielda" href="'.DOL_URL_ROOT.'/commande/card.php?id='.$object->id.'&action=edittags&token='.newToken().'">'.img_edit().'</a>';
3240 3240
 				} else {
3241 3241
 					print '&nbsp;';
3242 3242
 				}
@@ -3244,11 +3244,11 @@  discard block
 block discarded – undo
3244 3244
 				print '</td>';
3245 3245
 				print '<td>';
3246 3246
 				if ($action == 'edittags') {
3247
-					print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
3247
+					print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
3248 3248
 					print '<input type="hidden" name="action" value="settags">';
3249
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
3249
+					print '<input type="hidden" name="token" value="'.newToken().'">';
3250 3250
 					print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
3251
-					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
3251
+					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
3252 3252
 					print '</form>';
3253 3253
 				} else {
3254 3254
 					print $form->showCategories($object->id, Categorie::TYPE_ORDER, 1);
@@ -3257,7 +3257,7 @@  discard block
 block discarded – undo
3257 3257
 			}
3258 3258
 
3259 3259
 			// Other attributes
3260
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3260
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3261 3261
 
3262 3262
 			print '</table>';
3263 3263
 
@@ -3267,40 +3267,40 @@  discard block
 block discarded – undo
3267 3267
 
3268 3268
 			print '<table class="border tableforfield centpercent">';
3269 3269
 
3270
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3270
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3271 3271
 
3272 3272
 			$alert = '';
3273 3273
 			if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) {
3274
-				$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
3274
+				$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
3275 3275
 			}
3276 3276
 
3277 3277
 			print '<tr>';
3278
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3279
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3278
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3279
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3280 3280
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3281 3281
 				// Multicurrency Amount HT
3282
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3282
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3283 3283
 			}
3284 3284
 			print '</tr>';
3285 3285
 
3286 3286
 			print '<tr>';
3287
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
3288
-			print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3287
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
3288
+			print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3289 3289
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3290 3290
 				// Multicurrency Amount VAT
3291
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3291
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3292 3292
 			}
3293 3293
 			print '</tr>';
3294 3294
 
3295 3295
 			// Amount Local Taxes
3296 3296
 			if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3297 3297
 				print '<tr>';
3298
-				print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3299
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3298
+				print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3299
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3300 3300
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3301 3301
 					$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3302 3302
 
3303
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3303
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3304 3304
 				}
3305 3305
 				print '</tr>';
3306 3306
 			}
@@ -3308,24 +3308,24 @@  discard block
 block discarded – undo
3308 3308
 			// Amount Local Taxes
3309 3309
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3310 3310
 				print '<tr>';
3311
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3312
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3311
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3312
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3313 3313
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3314 3314
 					$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3315 3315
 
3316
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3316
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3317 3317
 				}
3318 3318
 				print '</tr>';
3319 3319
 			}
3320 3320
 
3321 3321
 			print '<tr>';
3322
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3323
-			print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
3322
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3323
+			print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
3324 3324
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3325 3325
 				// Multicurrency Amount TTC
3326
-				print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
3326
+				print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
3327 3327
 			}
3328
-			print '</tr>' . "\n";
3328
+			print '</tr>'."\n";
3329 3329
 
3330 3330
 			print '</table>';
3331 3331
 
@@ -3346,13 +3346,13 @@  discard block
 block discarded – undo
3346 3346
 			if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3347 3347
 				$blocname = 'contacts';
3348 3348
 				$title = $langs->trans('ContactsAddresses');
3349
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3349
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3350 3350
 			}
3351 3351
 
3352 3352
 			if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3353 3353
 				$blocname = 'notes';
3354 3354
 				$title = $langs->trans('Notes');
3355
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3355
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3356 3356
 			}
3357 3357
 
3358 3358
 			/*
@@ -3367,20 +3367,20 @@  discard block
 block discarded – undo
3367 3367
 			global $inputalsopricewithtax;
3368 3368
 			$inputalsopricewithtax = 1;
3369 3369
 
3370
-			print '<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3371
-			<input type="hidden" name="token" value="' . newToken() . '">
3372
-			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3370
+			print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3371
+			<input type="hidden" name="token" value="' . newToken().'">
3372
+			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3373 3373
 			<input type="hidden" name="mode" value="">
3374 3374
 			<input type="hidden" name="page_y" value="">
3375
-			<input type="hidden" name="id" value="' . $object->id . '">
3376
-			<input type="hidden" name="backtopage" value="' . $backtopage . '">
3375
+			<input type="hidden" name="id" value="' . $object->id.'">
3376
+			<input type="hidden" name="backtopage" value="' . $backtopage.'">
3377 3377
 				';
3378 3378
 
3379 3379
 			if (!empty($conf->use_javascript_ajax) && $object->status == Commande::STATUS_DRAFT) {
3380 3380
 				if (isModEnabled('subtotals')) {
3381
-					include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3381
+					include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3382 3382
 				} else {
3383
-					include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3383
+					include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3384 3384
 				}
3385 3385
 			}
3386 3386
 
@@ -3435,16 +3435,16 @@  discard block
 block discarded – undo
3435 3435
 
3436 3436
 				// Reopen a closed order
3437 3437
 				if (($object->status == Commande::STATUS_CLOSED || $object->status == Commande::STATUS_CANCELED) && $usercancreate && (!$object->billed || !getDolGlobalInt('ORDER_DONT_REOPEN_BILLED'))) {
3438
-					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"] . '?action=reopen&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3438
+					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
3439 3439
 				}
3440 3440
 
3441 3441
 				// Send
3442 3442
 				if (empty($user->socid)) {
3443 3443
 					if ($object->status > Commande::STATUS_DRAFT || getDolGlobalString('COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS')) {
3444 3444
 						if ($usercansend) {
3445
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '');
3445
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3446 3446
 						} else {
3447
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'] . '#', '', false);
3447
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
3448 3448
 						}
3449 3449
 					}
3450 3450
 				}
@@ -3461,7 +3461,7 @@  discard block
 block discarded – undo
3461 3461
 						'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
3462 3462
 						'perm' => (bool) $usercancreate,
3463 3463
 						'label' => $langs->trans('AddTitleLine'),
3464
-						'url' => '/commande/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3464
+						'url' => '/commande/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3465 3465
 					);
3466 3466
 
3467 3467
 					$url_button[] = array(
@@ -3469,7 +3469,7 @@  discard block
 block discarded – undo
3469 3469
 						'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
3470 3470
 						'perm' => (bool) $usercancreate,
3471 3471
 						'label' => $langs->trans('AddSubtotalLine'),
3472
-						'url' => '/commande/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3472
+						'url' => '/commande/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3473 3473
 					);
3474 3474
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
3475 3475
 				}
@@ -3477,15 +3477,15 @@  discard block
 block discarded – undo
3477 3477
 				// Valid
3478 3478
 				if ($object->status == Commande::STATUS_DRAFT && ($object->total_ttc >= 0 || getDolGlobalString('ORDER_ENABLE_NEGATIVE')) && $usercanvalidate) {
3479 3479
 					if ($numlines > 0) {
3480
-						print dolGetButtonAction('', $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('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&amp;token='.newToken().'&amp;id='.$object->id, (string) $object->id, 1);
3481 3481
 					} else {
3482 3482
 						$langs->load("errors");
3483
-						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);
3483
+						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);
3484 3484
 					}
3485 3485
 				}
3486 3486
 				// Edit
3487 3487
 				if (($object->status == Commande::STATUS_VALIDATED || ($object->status == Commande::STATUS_SHIPMENTONPROCESS && getDolGlobalString('EDIT_ORDER_SHIPMENT_ON_PROCESS'))) && $usercancreate) {
3488
-					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"] . '?action=modif&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3488
+					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&amp;token='.newToken().'&amp;id='.$object->id, '');
3489 3489
 				}
3490 3490
 
3491 3491
 				$arrayforbutaction = array();
@@ -3497,7 +3497,7 @@  discard block
 block discarded – undo
3497 3497
 						'enabled' => (isModEnabled("supplier_order") && $object->status > Commande::STATUS_DRAFT),
3498 3498
 						'perm' => $usercancreatepurchaseorder,
3499 3499
 						'label' => 'AddPurchaseOrder',
3500
-						'url' => '/fourn/commande/card.php?action=create&amp;origin=' . urlencode($object->element) . '&amp;originid=' . ((int) $object->id)
3500
+						'url' => '/fourn/commande/card.php?action=create&amp;origin='.urlencode($object->element).'&amp;originid='.((int) $object->id)
3501 3501
 					);
3502 3502
 				}
3503 3503
 
@@ -3514,7 +3514,7 @@  discard block
 block discarded – undo
3514 3514
 						'enabled' => (isModEnabled("intervention") && $object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0),
3515 3515
 						'perm' => ($user->hasRight('ficheinter', 'creer') == 1),
3516 3516
 						'label' => 'AddIntervention',
3517
-						'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3517
+						'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3518 3518
 					);
3519 3519
 				}
3520 3520
 
@@ -3524,7 +3524,7 @@  discard block
 block discarded – undo
3524 3524
 					'enabled' => (isModEnabled("contract") && ($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS || $object->status == Commande::STATUS_CLOSED)),
3525 3525
 					'perm' => ($user->hasRight('contrat', 'creer') == 1),
3526 3526
 					'label' => 'AddContract',
3527
-					'url' => '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
3527
+					'url' => '/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid,
3528 3528
 				);
3529 3529
 				/*if (isModEnabled('contract') && ($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS || $object->status == Commande::STATUS_CLOSED)) {
3530 3530
 					$langs->load("contracts");
@@ -3548,7 +3548,7 @@  discard block
 block discarded – undo
3548 3548
 								'enabled' => (isModEnabled("shipping") && ($object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3549 3549
 								'perm' => $user->hasRight('expedition', 'creer'),
3550 3550
 								'label' => 'CreateShipment',
3551
-								'url' => '/expedition/shipment.php?id=' . $object->id
3551
+								'url' => '/expedition/shipment.php?id='.$object->id
3552 3552
 							);
3553 3553
 						} else {
3554 3554
 							//c$langs->load("errors");
@@ -3558,7 +3558,7 @@  discard block
 block discarded – undo
3558 3558
 								'enabled' => (isModEnabled("shipping") && ($object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3559 3559
 								'perm' => 0,
3560 3560
 								'label' => 'CreateShipment',
3561
-								'url' => '/expedition/shipment.php?id=' . $object->id
3561
+								'url' => '/expedition/shipment.php?id='.$object->id
3562 3562
 							);
3563 3563
 						}
3564 3564
 					}
@@ -3570,7 +3570,7 @@  discard block
 block discarded – undo
3570 3570
 					'enabled' => (isModEnabled('invoice') && $object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0),
3571 3571
 					'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')),
3572 3572
 					'label' => 'CreateBill',
3573
-					'url' => '/compta/facture/card.php?action=create&amp;token=' . newToken() . '&amp;origin=' . urlencode($object->element) . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid
3573
+					'url' => '/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid
3574 3574
 				);
3575 3575
 				/*
3576 3576
 				 if (isModEnabled('facture') && $object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
@@ -3591,38 +3591,38 @@  discard block
 block discarded – undo
3591 3591
 
3592 3592
 				// Set to shipped
3593 3593
 				if (($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
3594
-					print dolGetButtonAction('', $langs->trans('ClassifyShipped'), 'default', $_SERVER["PHP_SELF"] . '?action=shipped&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3594
+					print dolGetButtonAction('', $langs->trans('ClassifyShipped'), 'default', $_SERVER["PHP_SELF"].'?action=shipped&amp;token='.newToken().'&amp;id='.$object->id, '');
3595 3595
 				}
3596 3596
 
3597 3597
 				// Set billed or unbilled
3598 3598
 				// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
3599 3599
 				if ($object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
3600 3600
 					if ($usercancreate && $object->status >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) {
3601
-						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"] . '?action=classifybilled&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3601
+						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&amp;token='.newToken().'&amp;id='.$object->id, '');
3602 3602
 					}
3603 3603
 				}
3604 3604
 				if ($object->status > Commande::STATUS_DRAFT && $object->billed) {
3605 3605
 					if ($usercancreate && $object->status >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) {
3606
-						print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'delete', $_SERVER["PHP_SELF"] . '?action=classifyunbilled&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3606
+						print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'delete', $_SERVER["PHP_SELF"].'?action=classifyunbilled&amp;token='.newToken().'&amp;id='.$object->id, '');
3607 3607
 					}
3608 3608
 				}
3609 3609
 
3610 3610
 				// Clone
3611 3611
 				if ($usercancreate) {
3612
-					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"] . '?action=clone&token=' . newToken() . '&id=' . $object->id . '&socid=' . $object->socid, '');
3612
+					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id.'&socid='.$object->socid, '');
3613 3613
 				}
3614 3614
 
3615 3615
 				// Cancel order
3616 3616
 				if ($object->status == Commande::STATUS_VALIDATED && !empty($usercancancel)) {
3617
-					print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelOrder") . '</a>';
3617
+					print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelOrder").'</a>';
3618 3618
 				}
3619 3619
 
3620 3620
 				// Delete order
3621 3621
 				if ($usercandelete) {
3622 3622
 					if ($numshipping == 0) {
3623
-						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"] . '?action=delete&token=' . newToken() . '&id=' . $object->id, '');
3623
+						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
3624 3624
 					} else {
3625
-						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'] . '#', '', false);
3625
+						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3626 3626
 					}
3627 3627
 				}
3628 3628
 			}
@@ -3639,8 +3639,8 @@  discard block
 block discarded – undo
3639 3639
 			print '<a name="builddoc"></a>'; // ancre
3640 3640
 			// Documents
3641 3641
 			$objref = dol_sanitizeFileName($object->ref);
3642
-			$relativepath = $objref . '/' . $objref . '.pdf';
3643
-			$filedir = $conf->commande->multidir_output[$object->entity ?? $conf->entity] . '/' . $objref;
3642
+			$relativepath = $objref.'/'.$objref.'.pdf';
3643
+			$filedir = $conf->commande->multidir_output[$object->entity ?? $conf->entity].'/'.$objref;
3644 3644
 			$urlsource = dolBuildUrl($_SERVER["PHP_SELF"], ["id" => $object->id]);
3645 3645
 			$genallowed = $usercanread;
3646 3646
 			$delallowed = $usercancreate;
@@ -3669,7 +3669,7 @@  discard block
 block discarded – undo
3669 3669
 
3670 3670
 			// Show online payment link
3671 3671
 			// The list can be complete by the hook 'doValidatePayment' executed inside getValidOnlinePaymentMethods()
3672
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3672
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3673 3673
 			$validpaymentmethod = getValidOnlinePaymentMethods('');
3674 3674
 			$useonlinepayment = count($validpaymentmethod);
3675 3675
 
@@ -3678,8 +3678,8 @@  discard block
 block discarded – undo
3678 3678
 			}
3679 3679
 			if ($object->status != Commande::STATUS_DRAFT && $useonlinepayment) {
3680 3680
 				print '<br><!-- Link to pay -->';
3681
-				require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3682
-				print showOnlinePaymentUrl('order', $object->ref) . '<br>';
3681
+				require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3682
+				print showOnlinePaymentUrl('order', $object->ref).'<br>';
3683 3683
 			}
3684 3684
 
3685 3685
 			print '</div><div class="fichehalfright">';
@@ -3687,11 +3687,11 @@  discard block
 block discarded – undo
3687 3687
 			$MAXEVENT = 10;
3688 3688
 
3689 3689
 			//button to go to messaging from the events box
3690
-			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', dolBuildUrl(DOL_URL_ROOT . '/commande/messaging.php', ['id' => $object->id]));
3691
-			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dolBuildUrl(DOL_URL_ROOT . '/commande/agenda.php', ['id' => $object->id]));
3690
+			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', dolBuildUrl(DOL_URL_ROOT.'/commande/messaging.php', ['id' => $object->id]));
3691
+			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dolBuildUrl(DOL_URL_ROOT.'/commande/agenda.php', ['id' => $object->id]));
3692 3692
 
3693 3693
 			// List of actions on element
3694
-			include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3694
+			include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3695 3695
 			$formactions = new FormActions($db);
3696 3696
 			$somethingshown = $formactions->showactions($object, 'order', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3697 3697
 
@@ -3702,9 +3702,9 @@  discard block
 block discarded – undo
3702 3702
 		$modelmail = 'order_send';
3703 3703
 		$defaulttopic = 'SendOrderRef';
3704 3704
 		$diroutput = getMultidirOutput($object);
3705
-		$trackid = 'ord' . $object->id;
3705
+		$trackid = 'ord'.$object->id;
3706 3706
 
3707
-		include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3707
+		include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3708 3708
 	}
3709 3709
 }
3710 3710
 
Please login to merge, or discard this patch.