Completed
Branch develop (63dc33)
by
unknown
27:20
created
htdocs/supplier_proposal/class/supplier_proposal.class.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	/**
177 177
 	 * @var string
178 178
 	 */
179
-	public $cond_reglement_doc;		// label doc
179
+	public $cond_reglement_doc; // label doc
180 180
 
181 181
 	/**
182 182
 	 * @var string
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
 		$this->status = 0;
1178 1178
 		$this->statut = 0;
1179 1179
 
1180
-		if (!getDolGlobalString('SUPPLIER_PROPOSAL_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/supplier_proposal/" . getDolGlobalString('SUPPLIER_PROPOSAL_ADDON').".php")) {
1180
+		if (!getDolGlobalString('SUPPLIER_PROPOSAL_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/supplier_proposal/".getDolGlobalString('SUPPLIER_PROPOSAL_ADDON').".php")) {
1181 1181
 			$this->error = 'ErrorSetupNotComplete';
1182 1182
 			return -1;
1183 1183
 		}
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
 		$this->date = $now;
1189 1189
 
1190 1190
 		// Set ref
1191
-		require_once DOL_DOCUMENT_ROOT."/core/modules/supplier_proposal/" . getDolGlobalString('SUPPLIER_PROPOSAL_ADDON').'.php';
1191
+		require_once DOL_DOCUMENT_ROOT."/core/modules/supplier_proposal/".getDolGlobalString('SUPPLIER_PROPOSAL_ADDON').'.php';
1192 1192
 		$obj = getDolGlobalString('SUPPLIER_PROPOSAL_ADDON');
1193 1193
 		$modSupplierProposal = new $obj();
1194 1194
 		'@phan-var-force ModeleNumRefSupplierProposal $modSupplierProposal';
@@ -1290,14 +1290,14 @@  discard block
 block discarded – undo
1290 1290
 				$this->status               = (int) $obj->status;
1291 1291
 				$this->datec                = $this->db->jdate($obj->datec); // TODO deprecated
1292 1292
 				$this->datev                = $this->db->jdate($obj->datev); // TODO deprecated
1293
-				$this->date_creation = $this->db->jdate($obj->datec);	// Creation date
1294
-				$this->date_modification = $this->db->jdate($obj->date_modification);	// Modification date
1293
+				$this->date_creation = $this->db->jdate($obj->datec); // Creation date
1294
+				$this->date_modification = $this->db->jdate($obj->date_modification); // Modification date
1295 1295
 				$this->date = $this->date_creation;
1296 1296
 				$this->date_validation = $this->db->jdate($obj->datev); // Validation date
1297 1297
 				$this->delivery_date = $this->db->jdate($obj->delivery_date);
1298 1298
 				$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
1299 1299
 
1300
-				$this->last_main_doc    = $obj->last_main_doc;
1300
+				$this->last_main_doc = $obj->last_main_doc;
1301 1301
 				$this->mode_reglement_id    = $obj->fk_mode_reglement;
1302 1302
 				$this->mode_reglement_code  = $obj->mode_reglement_code;
1303 1303
 				$this->mode_reglement       = $obj->mode_reglement;
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 						$line->total_localtax1	= $objp->total_localtax1;
1373 1373
 						$line->total_localtax2	= $objp->total_localtax2;
1374 1374
 						$line->total_ttc        = $objp->total_ttc;
1375
-						$line->fk_fournprice 	= $objp->fk_fournprice;
1375
+						$line->fk_fournprice = $objp->fk_fournprice;
1376 1376
 						$marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht);
1377 1377
 						$line->pa_ht = $marginInfos[0];
1378 1378
 						$line->marge_tx			= $marginInfos[1];
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 
1970 1970
 			if (!$error) {
1971 1971
 				$this->status = self::STATUS_DRAFT;
1972
-				$this->statut = self::STATUS_DRAFT;	// deprecated
1972
+				$this->statut = self::STATUS_DRAFT; // deprecated
1973 1973
 				$this->db->commit();
1974 1974
 				return 1;
1975 1975
 			} else {
@@ -2388,7 +2388,7 @@  discard block
 block discarded – undo
2388 2388
 		$this->note_public = 'This is a comment (public)';
2389 2389
 		$this->note_private = 'This is a comment (private)';
2390 2390
 		// Lines
2391
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
2391
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
2392 2392
 		$xnbp = 0;
2393 2393
 		while ($xnbp < $nbp) {
2394 2394
 			$line = new SupplierProposalLine($this->db);
@@ -2480,7 +2480,7 @@  discard block
 block discarded – undo
2480 2480
 		if (getDolGlobalString('SUPPLIER_PROPOSAL_ADDON')) {
2481 2481
 			$mybool = false;
2482 2482
 
2483
-			$file = getDolGlobalString('SUPPLIER_PROPOSAL_ADDON') . ".php";
2483
+			$file = getDolGlobalString('SUPPLIER_PROPOSAL_ADDON').".php";
2484 2484
 			$classname = getDolGlobalString('SUPPLIER_PROPOSAL_ADDON');
2485 2485
 
2486 2486
 			// Include file with class
@@ -2648,7 +2648,7 @@  discard block
 block discarded – undo
2648 2648
 			}
2649 2649
 		}
2650 2650
 		global $action;
2651
-		$hookmanager->initHooks(array($this->element . 'dao'));
2651
+		$hookmanager->initHooks(array($this->element.'dao'));
2652 2652
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
2653 2653
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
2654 2654
 		if ($reshook > 0) {
@@ -2764,7 +2764,7 @@  discard block
 block discarded – undo
2764 2764
 		$outputlangs->load("products");
2765 2765
 
2766 2766
 		if (!dol_strlen($modele)) {
2767
-			$modele = '';	// On supplier documents, template can be empty( no doc generated in this case)
2767
+			$modele = ''; // On supplier documents, template can be empty( no doc generated in this case)
2768 2768
 
2769 2769
 			if ($this->model_pdf) {
2770 2770
 				$modele = $this->model_pdf;
@@ -3333,8 +3333,8 @@  discard block
 block discarded – undo
3333 3333
 		$sql .= " ".(float) price2num($this->localtax2_tx).",";
3334 3334
 		$sql .= " '".$this->db->escape($this->localtax1_type)."',";
3335 3335
 		$sql .= " '".$this->db->escape($this->localtax2_type)."',";
3336
-		$sql .= " ".(float) price2num($this->subprice, 'MU') .",";
3337
-		$sql .= " ".(float) price2num($this->subprice_ttc, 'MU') .",";
3336
+		$sql .= " ".(float) price2num($this->subprice, 'MU').",";
3337
+		$sql .= " ".(float) price2num($this->subprice_ttc, 'MU').",";
3338 3338
 		$sql .= " ".((float) $this->remise_percent).",";
3339 3339
 		$sql .= " ".(isset($this->info_bits) ? ((int) $this->info_bits) : "null").",";
3340 3340
 		$sql .= " ".(float) price2num($this->total_ht, 'MT').",";
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +267 added lines, -267 removed lines patch added patch discarded remove patch
@@ -43,24 +43,24 @@  discard block
 block discarded – undo
43 43
 
44 44
 // Load Dolibarr environment
45 45
 require '../../main.inc.php';
46
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php';
50
-require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
51
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
52
-require_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php';
53
-require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
54
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
55
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
56
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
46
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
50
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
51
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
52
+require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php';
53
+require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
54
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
55
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
56
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
57 57
 if (isModEnabled('project')) {
58
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
59
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
58
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
59
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
60 60
 }
61 61
 
62 62
 if (isModEnabled('variants')) {
63
-	require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php';
63
+	require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
64 64
 }
65 65
 
66 66
 /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 $cancel = GETPOST('cancel', 'alpha');
93 93
 $origin = GETPOST('origin', 'alpha');
94 94
 $originid = GETPOSTINT('originid');
95
-$renewal = GETPOST('renewal');	// for contract renewal
95
+$renewal = GETPOST('renewal'); // for contract renewal
96 96
 $confirm = GETPOST('confirm', 'alpha');
97 97
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
98 98
 $lineid = GETPOSTINT('lineid');
@@ -177,34 +177,34 @@  discard block
 block discarded – undo
177 177
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
178 178
 }
179 179
 if (empty($reshook)) {
180
-	$backurlforlist = DOL_URL_ROOT . '/comm/propal/list.php';
180
+	$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';
181 181
 
182 182
 	if (empty($backtopage) || ($cancel && empty($id))) {
183 183
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
184 184
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
185 185
 				$backtopage = $backurlforlist;
186 186
 			} else {
187
-				$backtopage = DOL_URL_ROOT . '/comm/propal/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
187
+				$backtopage = DOL_URL_ROOT.'/comm/propal/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
188 188
 			}
189 189
 		}
190 190
 	}
191 191
 
192 192
 	if ($cancel) {
193 193
 		if (!empty($backtopageforcancel)) {
194
-			header("Location: " . $backtopageforcancel);
194
+			header("Location: ".$backtopageforcancel);
195 195
 			exit;
196 196
 		} elseif (!empty($backtopage)) {
197
-			header("Location: " . $backtopage);
197
+			header("Location: ".$backtopage);
198 198
 			exit;
199 199
 		}
200 200
 		$action = '';
201 201
 	}
202 202
 
203
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
203
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
204 204
 
205
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
205
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
206 206
 
207
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
207
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
208 208
 	// Action clone object
209 209
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
210 210
 		if (!($socid > 0)) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 							$object->delivery_date = $date_delivery;
239 239
 							foreach ($object->lines as $line) {
240 240
 								if (isset($line->date_start)) {
241
-									$line->date_start +=  $difference;
241
+									$line->date_start += $difference;
242 242
 								}
243 243
 								if (isset($line->date_end)) {
244 244
 									$line->date_end += $difference;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 						setEventMessages('', $warningMsgLineList, 'warnings');
267 267
 					}
268 268
 
269
-					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
269
+					header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
270 270
 					exit();
271 271
 				} else {
272 272
 					if (count($object->errors) > 0) {
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		// Cancel proposal
281 281
 		$result = $object->setCancel($user);
282 282
 		if ($result > 0) {
283
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
283
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
284 284
 			exit();
285 285
 		} else {
286 286
 			$langs->load("errors");
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		// Delete proposal
291 291
 		$result = $object->delete($user);
292 292
 		if ($result > 0) {
293
-			header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1');
293
+			header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1');
294 294
 			exit();
295 295
 		} else {
296 296
 			$langs->load("errors");
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 			$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
323 323
 		}
324 324
 
325
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
325
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
326 326
 		exit();
327 327
 	} elseif ($action == 'confirm_delete_subtotalline' && $confirm == 'yes' && $usercancreate) {
328 328
 		// Delete line
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 				$result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
353 353
 			}
354 354
 			if ($result >= 0) {
355
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
355
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
356 356
 				exit();
357 357
 			}
358 358
 		} else {
@@ -621,13 +621,13 @@  discard block
 block discarded – undo
621 621
 
622 622
 					$id = $object->create($user);
623 623
 					if ($id > 0) {
624
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
624
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
625 625
 
626 626
 						$classname = ucfirst($subelement);
627 627
 						$srcobject = new $classname($db);
628
-						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';  // Can be other class, but CommonObject is too generic
628
+						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic
629 629
 
630
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
630
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
631 631
 						$result = $srcobject->fetch($object->origin_id);
632 632
 
633 633
 						if ($result > 0) {
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 
693 693
 								$tva_tx = $lines[$i]->tva_tx;
694 694
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
695
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
695
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
696 696
 								}
697 697
 
698 698
 								$result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_options, $lines[$i]->fk_unit);
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 							}
777 777
 						}
778 778
 
779
-						header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
779
+						header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
780 780
 						exit();
781 781
 					} else {
782 782
 						$db->rollback();
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 					$error++;
825 825
 				} else {
826 826
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
827
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
827
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
828 828
 				}
829 829
 
830 830
 				$deposit = null;
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 					!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
836 836
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
837 837
 				) {
838
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
838
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
839 839
 
840 840
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
841 841
 					$forceFields = array();
@@ -848,10 +848,10 @@  discard block
 block discarded – undo
848 848
 
849 849
 					if ($deposit) {
850 850
 						setEventMessage('DepositGenerated');
851
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
851
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
852 852
 					} else {
853 853
 						$error++;
854
-						setEventMessages("Failed to create down payment - " . $object->error, $object->errors, 'errors');
854
+						setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
855 855
 					}
856 856
 				}
857 857
 
@@ -876,12 +876,12 @@  discard block
 block discarded – undo
876 876
 					}
877 877
 
878 878
 					if ($locationTarget) {
879
-						header('Location: ' . $locationTarget);
879
+						header('Location: '.$locationTarget);
880 880
 						exit;
881 881
 					}
882 882
 				} else {
883 883
 					$object->status = $oldstatus;
884
-					$object->statut = $oldstatus;	// deprecated
884
+					$object->statut = $oldstatus; // deprecated
885 885
 
886 886
 					$db->rollback();
887 887
 					$action = '';
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
 				setEventMessages($object->error, $object->errors, 'errors');
901 901
 				$error++;
902 902
 			} else {
903
-				$object->statut = $newstatus;	// deprecated
903
+				$object->statut = $newstatus; // deprecated
904 904
 				$object->status = $newstatus;
905 905
 			}
906 906
 
@@ -918,13 +918,13 @@  discard block
 block discarded – undo
918 918
 
919 919
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
920 920
 			if ($fromElement == 'commande') {
921
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
921
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
922 922
 				$lineClassName = 'OrderLine';
923 923
 			} elseif ($fromElement == 'propal') {
924
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
924
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
925 925
 				$lineClassName = 'PropaleLigne';
926 926
 			} elseif ($fromElement == 'facture') {
927
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
927
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
928 928
 				$lineClassName = 'FactureLigne';
929 929
 			} else {
930 930
 				$lineClassName = null;
@@ -991,14 +991,14 @@  discard block
 block discarded – undo
991 991
 		$object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount);
992 992
 	}
993 993
 
994
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
994
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
995 995
 
996 996
 	// Actions to send emails
997 997
 	$actiontypecode = 'AC_OTH_AUTO';
998 998
 	$triggersendname = 'PROPAL_SENTBYMAIL';
999 999
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
1000
-	$trackid = 'pro' . $object->id;
1001
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
1000
+	$trackid = 'pro'.$object->id;
1001
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
1002 1002
 
1003 1003
 
1004 1004
 	// Go back to draft
@@ -1067,7 +1067,7 @@  discard block
 block discarded – undo
1067 1067
 			}
1068 1068
 			$tvatx = $line->tva_tx;
1069 1069
 			if (!empty($line->vat_src_code)) {
1070
-				$tvatx .= ' (' . $line->vat_src_code . ')';
1070
+				$tvatx .= ' ('.$line->vat_src_code.')';
1071 1071
 			}
1072 1072
 			$result = $object->updateline($line->id, $line->subprice, $line->qty, (float) $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
1073 1073
 			$object->lines[$key] = $object->line;
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 			if ($prod->price_min > $subprice) {
1086 1086
 				$price_subprice  = price($subprice, 0, $outlangs, 1, -1, -1, 'auto');
1087 1087
 				$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1088
-				setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1088
+				setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1089 1089
 			}
1090 1090
 			// Manage $line->subprice and $line->multicurrency_subprice
1091 1091
 			if ($line->subprice <> 0) {
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
 		} else {
1156 1156
 			setEventMessages($object->error, $object->errors, 'errors');
1157 1157
 		}
1158
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1158
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1159 1159
 		exit();
1160 1160
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
1161 1161
 		// Handling adding a new subtotal line for subtotals module
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 		} else {
1208 1208
 			setEventMessages($object->error, $object->errors, 'errors');
1209 1209
 		}
1210
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1210
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1211 1211
 		exit();
1212 1212
 	} elseif (
1213 1213
 		$action == 'addline' && !GETPOST('submitforalllines', 'alpha')
@@ -1252,8 +1252,8 @@  discard block
 block discarded – undo
1252 1252
 
1253 1253
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1254 1254
 
1255
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1256
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1255
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1256
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1257 1257
 		if (empty($remise_percent)) {
1258 1258
 			$remise_percent = 0;
1259 1259
 		}
@@ -1265,7 +1265,7 @@  discard block
 block discarded – undo
1265 1265
 		if (is_array($extralabelsline)) {
1266 1266
 			// Get extra fields
1267 1267
 			foreach ($extralabelsline as $key => $value) {
1268
-				unset($_POST["options_" . $key]);
1268
+				unset($_POST["options_".$key]);
1269 1269
 			}
1270 1270
 		}
1271 1271
 
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
 
1338 1338
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1339 1339
 					// If price per customer
1340
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1340
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1341 1341
 					$prodcustprice = new ProductCustomerPrice($db);
1342 1342
 					$filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id);
1343 1343
 
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 					}
1402 1402
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1403 1403
 					// If price per customer
1404
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1404
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1405 1405
 
1406 1406
 					$prodcustprice = new ProductCustomerPrice($db);
1407 1407
 
@@ -1548,23 +1548,23 @@  discard block
 block discarded – undo
1548 1548
 							$outputlangs->load('products');
1549 1549
 						}
1550 1550
 						if (!empty($prod->customcode)) {
1551
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1551
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1552 1552
 						}
1553 1553
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1554 1554
 							$tmptxt .= ' - ';
1555 1555
 						}
1556 1556
 						if (!empty($prod->country_code)) {
1557
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1557
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1558 1558
 						}
1559 1559
 					} else {
1560 1560
 						if (!empty($prod->customcode)) {
1561
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1561
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1562 1562
 						}
1563 1563
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1564 1564
 							$tmptxt .= ' - ';
1565 1565
 						}
1566 1566
 						if (!empty($prod->country_code)) {
1567
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1567
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1568 1568
 						}
1569 1569
 					}
1570 1570
 					$tmptxt .= ')';
@@ -1603,11 +1603,11 @@  discard block
 block discarded – undo
1603 1603
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
1604 1604
 
1605 1605
 			// Margin
1606
-			$fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1607
-			$buyingprice = price2num((GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1606
+			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1607
+			$buyingprice = price2num((GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1608 1608
 
1609
-			$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'));
1610
-			$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'));
1609
+			$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'));
1610
+			$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'));
1611 1611
 
1612 1612
 			// Prepare a price equivalent for minimum price check
1613 1613
 			$pu_equivalent = $pu_ht;
@@ -1738,7 +1738,7 @@  discard block
 block discarded – undo
1738 1738
 				if ($prod->price_min > $line->subprice) {
1739 1739
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
1740 1740
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1741
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1741
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1742 1742
 				} else {
1743 1743
 					setEventMessages($prod->error, $prod->errors, 'errors');
1744 1744
 				}
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
 		$pu_ttc = price2num(GETPOST('price_ttc'), '', 2);
1877 1877
 
1878 1878
 		// Add buying price
1879
-		$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
1879
+		$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
1880 1880
 		$buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value
1881 1881
 
1882 1882
 		$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2);
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
 		if (is_array($extralabelsline)) {
1924 1924
 			// Get extra fields
1925 1925
 			foreach ($extralabelsline as $key => $value) {
1926
-				unset($_POST["options_" . $key]);
1926
+				unset($_POST["options_".$key]);
1927 1927
 			}
1928 1928
 		}
1929 1929
 
@@ -2055,7 +2055,7 @@  discard block
 block discarded – undo
2055 2055
 			}
2056 2056
 		}
2057 2057
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
2058
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
2058
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
2059 2059
 		exit();
2060 2060
 	} elseif ($action == 'classin' && $usercancreate) {
2061 2061
 		// Set project
@@ -2069,8 +2069,8 @@  discard block
 block discarded – undo
2069 2069
 	} elseif ($action == 'setconditions' && $usercancreate) {
2070 2070
 		// Terms of payment
2071 2071
 		$sql = "SELECT code ";
2072
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
2073
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
2072
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
2073
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
2074 2074
 		$result = $db->query($sql);
2075 2075
 		if ($result) {
2076 2076
 			$obj = $db->fetch_object($result);
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
 			}
2136 2136
 
2137 2137
 			if ($result >= 0) {
2138
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2138
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2139 2139
 				exit();
2140 2140
 			} else {
2141 2141
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2158,7 +2158,7 @@  discard block
 block discarded – undo
2158 2158
 			$result = $object->delete_contact($lineid);
2159 2159
 
2160 2160
 			if ($result >= 0) {
2161
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2161
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2162 2162
 				exit();
2163 2163
 			} else {
2164 2164
 				dol_print_error($db);
@@ -2169,7 +2169,7 @@  discard block
 block discarded – undo
2169 2169
 	// Actions to build doc
2170 2170
 	$upload_dir = !empty($conf->propal->multidir_output[$object->entity]) ? $conf->propal->multidir_output[$object->entity] : $conf->propal->dir_output;
2171 2171
 	$permissiontoadd = $usercancreate;
2172
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2172
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2173 2173
 }
2174 2174
 
2175 2175
 
@@ -2186,7 +2186,7 @@  discard block
 block discarded – undo
2186 2186
 	$formproject = new FormProjets($db);
2187 2187
 }
2188 2188
 
2189
-$title = $object->ref . " - " . $langs->trans('Card');
2189
+$title = $object->ref." - ".$langs->trans('Card');
2190 2190
 if ($action == 'create') {
2191 2191
 	$title = $langs->trans("NewPropal");
2192 2192
 }
@@ -2252,11 +2252,11 @@  discard block
 block discarded – undo
2252 2252
 				$element = $subelement = 'expedition';
2253 2253
 			}
2254 2254
 
2255
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2255
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2256 2256
 
2257 2257
 			$classname = ucfirst($subelement);
2258 2258
 			$objectsrc = new $classname($db);
2259
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
2259
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
2260 2260
 			$objectsrc->fetch($originid);
2261 2261
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
2262 2262
 				$objectsrc->fetch_lines();
@@ -2270,7 +2270,7 @@  discard block
 block discarded – undo
2270 2270
 
2271 2271
 			$cond_reglement_id  = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
2272 2272
 			$mode_reglement_id  = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
2273
-			$warehouse_id      = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
2273
+			$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
2274 2274
 
2275 2275
 			// Replicate extrafields
2276 2276
 			$objectsrc->fetch_optionals();
@@ -2331,19 +2331,19 @@  discard block
 block discarded – undo
2331 2331
 		}
2332 2332
 	}
2333 2333
 
2334
-	print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2335
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2334
+	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2335
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2336 2336
 	print '<input type="hidden" name="action" value="add">';
2337
-	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
2338
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2337
+	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
2338
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2339 2339
 	if ($origin != 'project' && $originid) {
2340
-		print '<input type="hidden" name="origin" value="' . $origin . '">';
2341
-		print '<input type="hidden" name="originid" value="' . $originid . '">';
2340
+		print '<input type="hidden" name="origin" value="'.$origin.'">';
2341
+		print '<input type="hidden" name="originid" value="'.$originid.'">';
2342 2342
 		if ($origin == 'contrat' && !empty($renewal)) {
2343
-			print '<input type="hidden" name="renewal" value="' . $renewal . '">';
2343
+			print '<input type="hidden" name="renewal" value="'.$renewal.'">';
2344 2344
 		}
2345 2345
 	} elseif ($origin == 'project' && !empty($projectid)) {
2346
-		print '<input type="hidden" name="projectid" value="' . $projectid . '">';
2346
+		print '<input type="hidden" name="projectid" value="'.$projectid.'">';
2347 2347
 	}
2348 2348
 
2349 2349
 	print dol_get_fiche_head();
@@ -2356,22 +2356,22 @@  discard block
 block discarded – undo
2356 2356
 		print '<table class="border centpercent">';
2357 2357
 
2358 2358
 		// Reference
2359
-		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td class="valuefieldcreate">' . $langs->trans("Draft") . '</td></tr>';
2359
+		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td class="valuefieldcreate">'.$langs->trans("Draft").'</td></tr>';
2360 2360
 
2361 2361
 		// Ref customer
2362
-		print '<tr class="field_ref_client"><td class="titlefieldcreate">' . $langs->trans('RefCustomer') . '</td><td class="valuefieldcreate">';
2363
-		print '<input type="text" name="ref_client" value="' . (!empty($ref_client) ? $ref_client : GETPOST('ref_client')) . '"></td>';
2362
+		print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
2363
+		print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>';
2364 2364
 		print '</tr>';
2365 2365
 
2366 2366
 		// Third party
2367 2367
 		print '<tr class="field_socid">';
2368
-		print '<td class="titlefieldcreate fieldrequired">' . $langs->trans('Customer') . '</td>';
2368
+		print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>';
2369 2369
 		$shipping_method_id = 0;
2370 2370
 		$warehouse_id = 0;
2371 2371
 		if ($socid > 0) {
2372 2372
 			print '<td class="valuefieldcreate">';
2373 2373
 			print $soc->getNomUrl(1, 'customer');
2374
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2374
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2375 2375
 			print '</td>';
2376 2376
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2377 2377
 				$shipping_method_id = $soc->shipping_method_id;
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
 		} else {
2381 2381
 			print '<td class="valuefieldcreate">';
2382 2382
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2383
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2383
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2384 2384
 			// reload page to retrieve customer information
2385 2385
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2386 2386
 				print '<script>
@@ -2396,63 +2396,63 @@  discard block
 block discarded – undo
2396 2396
 				});
2397 2397
 				</script>';
2398 2398
 			}
2399
-			print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>';
2399
+			print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
2400 2400
 			print '</td>';
2401 2401
 		}
2402
-		print '</tr>' . "\n";
2402
+		print '</tr>'."\n";
2403 2403
 
2404 2404
 		if ($socid > 0) {
2405 2405
 			// Contacts (ask contact only if thirdparty already defined).
2406
-			print '<tr class="field_contactid"><td class="titlefieldcreate">' . $langs->trans("DefaultContact") . '</td><td class="valuefieldcreate">';
2406
+			print '<tr class="field_contactid"><td class="titlefieldcreate">'.$langs->trans("DefaultContact").'</td><td class="valuefieldcreate">';
2407 2407
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2408 2408
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300 widthcentpercentminusx');
2409 2409
 			print $form->select_contact($soc->id, $contactid, 'contactid', 1, '', '', 1, 'maxwidth300 widthcentpercentminusx', true);
2410 2410
 			print '</td></tr>';
2411 2411
 
2412 2412
 			// Third party discounts info line
2413
-			print '<tr class="field_discount_info"><td class="titlefieldcreate">' . $langs->trans('Discounts') . '</td><td class="valuefieldcreate">';
2413
+			print '<tr class="field_discount_info"><td class="titlefieldcreate">'.$langs->trans('Discounts').'</td><td class="valuefieldcreate">';
2414 2414
 
2415 2415
 			$absolute_discount = $soc->getAvailableDiscounts();
2416 2416
 
2417 2417
 			$thirdparty = $soc;
2418 2418
 			$discount_type = 0;
2419
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2420
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2419
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2420
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2421 2421
 			print '</td></tr>';
2422 2422
 		}
2423 2423
 
2424 2424
 		$newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');
2425 2425
 		// Date
2426
-		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">' . $langs->trans('DatePropal') . '</td><td class="valuefieldcreate">';
2426
+		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
2427 2427
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2428 2428
 		print $form->selectDate($newdatepropal ? $newdatepropal : $datepropal, '', 0, 0, 0, "addprop", 1, 1);
2429 2429
 		print '</td></tr>';
2430 2430
 
2431 2431
 		// Validaty duration
2432
-		print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td class="valuefieldcreate">' . img_picto('', 'clock', 'class="pictofixedwidth"') . '<input name="duree_validite" class="width50" value="' . (GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')) . '"> ' . $langs->trans("days") . '</td></tr>';
2432
+		print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">'.$langs->trans("ValidityDuration").'</td><td class="valuefieldcreate">'.img_picto('', 'clock', 'class="pictofixedwidth"').'<input name="duree_validite" class="width50" value="'.(GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')).'"> '.$langs->trans("days").'</td></tr>';
2433 2433
 
2434 2434
 		// Terms of payment
2435
-		print '<tr class="field_cond_reglement_id"><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2435
+		print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2436 2436
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2437 2437
 		// at last resort we take the payment term id which may be filled by default values set (if not getpostisset)
2438 2438
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent);
2439 2439
 		print '</td></tr>';
2440 2440
 
2441 2441
 		// Mode of payment
2442
-		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">' . $langs->trans('PaymentMode') . '</td><td class="valuefieldcreate">';
2442
+		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
2443 2443
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2444 2444
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2445 2445
 		print '</td></tr>';
2446 2446
 
2447 2447
 		// Bank Account
2448 2448
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) {
2449
-			print '<tr class="field_fk_account"><td class="titlefieldcreate">' . $langs->trans('BankAccount') . '</td><td class="valuefieldcreate">';
2450
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2449
+			print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
2450
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2451 2451
 			print '</td></tr>';
2452 2452
 		}
2453 2453
 
2454 2454
 		// Source / Channel - What trigger creation
2455
-		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">' . $langs->trans('Source') . '</td><td class="valuefieldcreate">';
2455
+		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">'.$langs->trans('Source').'</td><td class="valuefieldcreate">';
2456 2456
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2457 2457
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
2458 2458
 		print '</td></tr>';
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2463 2463
 				$shipping_method_id = $soc->shipping_method_id;
2464 2464
 			}
2465
-			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">' . $langs->trans('SendingMethod') . '</td><td class="valuefieldcreate">';
2465
+			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">';
2466 2466
 			print img_picto('', 'dolly', 'class="pictofixedwidth"');
2467 2467
 			$form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2468 2468
 			print '</td></tr>';
@@ -2471,17 +2471,17 @@  discard block
 block discarded – undo
2471 2471
 		$formproduct = null;
2472 2472
 		// Warehouse
2473 2473
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
2474
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2474
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2475 2475
 			$formproduct = new FormProduct($db);
2476
-			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">' . $langs->trans('Warehouse') . '</td><td class="valuefieldcreate">';
2477
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2476
+			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
2477
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2478 2478
 			print '</td></tr>';
2479 2479
 		}
2480 2480
 
2481 2481
 		// Delivery delay
2482
-		print '<tr class="field_availability_id"><td class="titlefieldcreate">' . $langs->trans('AvailabilityPeriod');
2482
+		print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
2483 2483
 		if (isModEnabled('order')) {
2484
-			print ' (' . $langs->trans('AfterOrder') . ')';
2484
+			print ' ('.$langs->trans('AfterOrder').')';
2485 2485
 		}
2486 2486
 		print '</td><td class="valuefieldcreate">';
2487 2487
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
@@ -2489,7 +2489,7 @@  discard block
 block discarded – undo
2489 2489
 		print '</td></tr>';
2490 2490
 
2491 2491
 		// Delivery date (or manufacturing)
2492
-		print '<tr class="field_date_livraison"><td class="titlefieldcreate">' . $langs->trans("DeliveryDate") . '</td>';
2492
+		print '<tr class="field_date_livraison"><td class="titlefieldcreate">'.$langs->trans("DeliveryDate").'</td>';
2493 2493
 		print '<td class="valuefieldcreate">';
2494 2494
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2495 2495
 		if (is_numeric(getDolGlobalString('DATE_LIVRAISON_WEEK_DELAY'))) {	// If value set to 0 or a num, not empty
@@ -2497,7 +2497,7 @@  discard block
 block discarded – undo
2497 2497
 			$syear = date("Y", $tmpdte);
2498 2498
 			$smonth = date("m", $tmpdte);
2499 2499
 			$sday = date("d", $tmpdte);
2500
-			print $form->selectDate($syear . "-" . $smonth . "-" . $sday, 'date_livraison', 0, 0, 0, "addprop");
2500
+			print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
2501 2501
 		} else {
2502 2502
 			$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
2503 2503
 			print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
@@ -2508,9 +2508,9 @@  discard block
 block discarded – undo
2508 2508
 		if (isModEnabled('project') && is_object($formproject)) {
2509 2509
 			$langs->load("projects");
2510 2510
 			print '<tr class="field_projectid">';
2511
-			print '<td class="titlefieldcreate">' . $langs->trans("Project") . '</td><td class="valuefieldcreate">';
2512
-			print img_picto('', 'project', 'class="pictofixedwidth"') . $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2513
-			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 paddingleft" title="' . $langs->trans("AddProject") . '"></span></a>';
2511
+			print '<td class="titlefieldcreate">'.$langs->trans("Project").'</td><td class="valuefieldcreate">';
2512
+			print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2513
+			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 paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
2514 2514
 			print '</td>';
2515 2515
 			print '</tr>';
2516 2516
 		}
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
 		// Incoterms
2519 2519
 		if (isModEnabled('incoterm')) {
2520 2520
 			print '<tr class="field_incoterm_id">';
2521
-			print '<td class="titlefieldcreate"><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1) . '</label></td>';
2521
+			print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
2522 2522
 			print '<td  class="valuefieldcreate maxwidthonsmartphone">';
2523 2523
 			print img_picto('', 'incoterm', 'class="pictofixedwidth"');
2524 2524
 			print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
 
2528 2528
 		// Template to use by default
2529 2529
 		print '<tr class="field_model">';
2530
-		print '<td class="titlefieldcreate">' . $langs->trans("DefaultModel") . '</td>';
2530
+		print '<td class="titlefieldcreate">'.$langs->trans("DefaultModel").'</td>';
2531 2531
 		print '<td class="valuefieldcreate">';
2532 2532
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
2533 2533
 		$liste = ModelePDFPropales::liste_modeles($db);
@@ -2538,15 +2538,15 @@  discard block
 block discarded – undo
2538 2538
 		// Multicurrency
2539 2539
 		if (isModEnabled("multicurrency")) {
2540 2540
 			print '<tr class="field_currency">';
2541
-			print '<td class="titlefieldcreate">' . $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0) . '</td>';
2541
+			print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
2542 2542
 			print '<td class="valuefieldcreate maxwidthonsmartphone">';
2543
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2543
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2544 2544
 			print '</td></tr>';
2545 2545
 		}
2546 2546
 
2547 2547
 		// Public note
2548 2548
 		print '<tr class="field_note_public">';
2549
-		print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>';
2549
+		print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>';
2550 2550
 		print '<td class="valuefieldcreate">';
2551 2551
 		$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : (getDolGlobalString('PROPALE_ADDON_NOTE_PUBLIC_DEFAULT') ? $conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT : null)), 'restricthtml');
2552 2552
 		$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2555,7 +2555,7 @@  discard block
 block discarded – undo
2555 2555
 		// Private note
2556 2556
 		if (empty($user->socid)) {
2557 2557
 			print '<tr class="field_note_private">';
2558
-			print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePrivate') . '</td>';
2558
+			print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePrivate').'</td>';
2559 2559
 			print '<td class="valuefieldcreate">';
2560 2560
 			$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null));
2561 2561
 			$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2565,7 +2565,7 @@  discard block
 block discarded – undo
2565 2565
 		}
2566 2566
 
2567 2567
 		// Other attributes
2568
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
2568
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
2569 2569
 
2570 2570
 		// Lines from source
2571 2571
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
@@ -2577,13 +2577,13 @@  discard block
 block discarded – undo
2577 2577
 				$objectsrc->update_price(1, 'auto', 1);
2578 2578
 			}
2579 2579
 
2580
-			print "\n<!-- " . $classname . " info -->";
2580
+			print "\n<!-- ".$classname." info -->";
2581 2581
 			print "\n";
2582
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2583
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2584
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2585
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2586
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2582
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2583
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2584
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2585
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2586
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2587 2587
 
2588 2588
 			$newclassname = $classname;
2589 2589
 			if ($newclassname == 'Propal') {
@@ -2596,22 +2596,22 @@  discard block
 block discarded – undo
2596 2596
 				$newclassname = 'Intervention';
2597 2597
 			}
2598 2598
 
2599
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2600
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
2601
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2599
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2600
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
2601
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2602 2602
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1
2603
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2603
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2604 2604
 			}
2605 2605
 
2606 2606
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2
2607
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2607
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2608 2608
 			}
2609
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2609
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2610 2610
 
2611 2611
 			if (isModEnabled("multicurrency")) {
2612
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2613
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2614
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2612
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2613
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2614
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2615 2615
 			}
2616 2616
 		}
2617 2617
 
@@ -2632,16 +2632,16 @@  discard block
 block discarded – undo
2632 2632
 			// For backward compatibility
2633 2633
 			print '<tr>';
2634 2634
 			print '<td><input type="radio" name="createmode" value="copy"></td>';
2635
-			print '<td>' . $langs->trans("CopyPropalFrom") . ' </td>';
2635
+			print '<td>'.$langs->trans("CopyPropalFrom").' </td>';
2636 2636
 			print '<td>';
2637 2637
 			$liste_propal = array();
2638 2638
 			$liste_propal[0] = '';
2639 2639
 
2640 2640
 			$sql = "SELECT p.rowid as id, p.ref, s.nom";
2641
-			$sql .= " FROM " . MAIN_DB_PREFIX . "propal p";
2642
-			$sql .= ", " . MAIN_DB_PREFIX . "societe s";
2641
+			$sql .= " FROM ".MAIN_DB_PREFIX."propal p";
2642
+			$sql .= ", ".MAIN_DB_PREFIX."societe s";
2643 2643
 			$sql .= " WHERE s.rowid = p.fk_soc";
2644
-			$sql .= " AND p.entity IN (" . getEntity('propal') . ")";
2644
+			$sql .= " AND p.entity IN (".getEntity('propal').")";
2645 2645
 			$sql .= " AND p.fk_statut <> 0";
2646 2646
 			$sql .= " ORDER BY Id";
2647 2647
 
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
 				$i = 0;
2652 2652
 				while ($i < $num) {
2653 2653
 					$row = $db->fetch_row($resql);
2654
-					$propalRefAndSocName = $row[1] . " - " . $row[2];
2654
+					$propalRefAndSocName = $row[1]." - ".$row[2];
2655 2655
 					$liste_propal[$row[0]] = $propalRefAndSocName;
2656 2656
 					$i++;
2657 2657
 				}
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
 			print '</td></tr>';
2663 2663
 
2664 2664
 			print '<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>';
2665
-			print '<td valign="top" colspan="2">' . $langs->trans("CreateEmptyPropal") . '</td></tr>';
2665
+			print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
2666 2666
 			print '</table>';
2667 2667
 		}
2668 2668
 	}
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
 			$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date);
2723 2723
 		}
2724 2724
 		// Incomplete payment. We ask if reason = discount or other
2725
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600);
2725
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600);
2726 2726
 	}
2727 2727
 
2728 2728
 	// Subtotal line form
@@ -2742,9 +2742,9 @@  discard block
 block discarded – undo
2742 2742
 		//Form to close proposal (signed or not)
2743 2743
 		$formquestion = array();
2744 2744
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2745
-			$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">' . $langs->trans("CloseAs") . '</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2745
+			$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2746 2746
 		}
2747
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2747
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2748 2748
 
2749 2749
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2750 2750
 			// This is a hidden option:
@@ -2754,7 +2754,7 @@  discard block
 block discarded – undo
2754 2754
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2755 2755
 
2756 2756
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2757
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2757
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2758 2758
 
2759 2759
 				$object->fetchObjectLinked();
2760 2760
 
@@ -2838,7 +2838,7 @@  discard block
 block discarded – undo
2838 2838
 						'type' => 'onecolumn',
2839 2839
 						'value' => '
2840 2840
 							<script>
2841
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2841
+								let signedValue = ' . $object::STATUS_SIGNED.';
2842 2842
 
2843 2843
 								$(document).ready(function() {
2844 2844
 									$("[name=generate_deposit]").change(function () {
@@ -2878,7 +2878,7 @@  discard block
 block discarded – undo
2878 2878
 		}
2879 2879
 
2880 2880
 		if (isModEnabled('notification')) {
2881
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2881
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2882 2882
 			$notify = new Notify($db);
2883 2883
 			$formquestion = array_merge($formquestion, array(
2884 2884
 				array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
@@ -2886,22 +2886,22 @@  discard block
 block discarded – undo
2886 2886
 		}
2887 2887
 
2888 2888
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2889
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2889
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2890 2890
 		} else {
2891
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2891
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2892 2892
 		}
2893 2893
 	} elseif ($action == 'cancel') {
2894 2894
 		// Confirm cancel
2895
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1);
2895
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1);
2896 2896
 	} elseif ($action == 'delete') {
2897 2897
 		// Confirm delete
2898
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
2898
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
2899 2899
 	} elseif ($action == 'reopen') {
2900 2900
 		// Confirm reopen
2901
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2901
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2902 2902
 	} elseif ($action == 'ask_deleteline') {
2903 2903
 		// Confirmation delete product/service line
2904
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2904
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2905 2905
 	} elseif ($action == 'ask_subtotal_deleteline') {
2906 2906
 		// Confirmation de la suppression d'une ligne subtotal
2907 2907
 		$langs->load("subtotals");
@@ -2912,7 +2912,7 @@  discard block
 block discarded – undo
2912 2912
 			$title = "DeleteTitleLine";
2913 2913
 			$question = "ConfirmDeleteTitleLine";
2914 2914
 		}
2915
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2915
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2916 2916
 	} elseif ($action == 'validate') {
2917 2917
 		// Confirm validate proposal
2918 2918
 		$error = 0;
@@ -2931,7 +2931,7 @@  discard block
 block discarded – undo
2931 2931
 
2932 2932
 		$text = $langs->trans('ConfirmValidateProp', $numref);
2933 2933
 		if (isModEnabled('notification')) {
2934
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2934
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2935 2935
 			$notify = new Notify($db);
2936 2936
 			$text .= '<br>';
2937 2937
 			$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
 		$nbMandated = 0;
2942 2942
 		foreach ($object->lines as $line) {
2943 2943
 			$res = $line->fetch_product();
2944
-			if ($res  > 0) {
2944
+			if ($res > 0) {
2945 2945
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2946 2946
 					$nbMandated++;
2947 2947
 					break;
@@ -2953,12 +2953,12 @@  discard block
 block discarded – undo
2953 2953
 				setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2954 2954
 				$error++;
2955 2955
 			} else {
2956
-				$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2956
+				$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2957 2957
 			}
2958 2958
 		}
2959 2959
 
2960 2960
 		if (!$error) {
2961
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240);
2961
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240);
2962 2962
 		}
2963 2963
 	}
2964 2964
 
@@ -2977,16 +2977,16 @@  discard block
 block discarded – undo
2977 2977
 
2978 2978
 	// Proposal card
2979 2979
 
2980
-	$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2980
+	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2981 2981
 
2982 2982
 	$morehtmlref = '<div class="refidno">';
2983 2983
 	// Ref customer
2984 2984
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2985
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string' . (isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2985
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2986 2986
 	// Thirdparty
2987
-	$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
2987
+	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2988 2988
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
2989
-		$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?socid=' . $soc->id . '&search_societe=' . urlencode($soc->name) . '">' . $langs->trans("OtherProposals") . '</a>)';
2989
+		$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
2990 2990
 	}
2991 2991
 	// Project
2992 2992
 	if (isModEnabled('project')) {
@@ -2995,16 +2995,16 @@  discard block
 block discarded – undo
2995 2995
 		if ($usercancreate) {
2996 2996
 			$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
2997 2997
 			if ($action != 'classify') {
2998
-				$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
2998
+				$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
2999 2999
 			}
3000
-			$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');
3000
+			$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');
3001 3001
 		} else {
3002 3002
 			if (!empty($object->fk_project)) {
3003 3003
 				$proj = new Project($db);
3004 3004
 				$proj->fetch($object->fk_project);
3005 3005
 				$morehtmlref .= $proj->getNomUrl(1);
3006 3006
 				if ($proj->title) {
3007
-					$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
3007
+					$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
3008 3008
 				}
3009 3009
 			}
3010 3010
 		}
@@ -3034,7 +3034,7 @@  discard block
 block discarded – undo
3034 3034
 			$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3035 3035
 		}
3036 3036
 
3037
-		print '<tr><td class="titlefieldmax45">' . $langs->trans('Discounts') . '</td><td>';
3037
+		print '<tr><td class="titlefieldmax45">'.$langs->trans('Discounts').'</td><td>';
3038 3038
 
3039 3039
 		$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3040 3040
 		$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3045,8 +3045,8 @@  discard block
 block discarded – undo
3045 3045
 
3046 3046
 		$thirdparty = $soc;
3047 3047
 		$discount_type = 0;
3048
-		$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3049
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3048
+		$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3049
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3050 3050
 
3051 3051
 		print '</td></tr>';
3052 3052
 
@@ -3065,12 +3065,12 @@  discard block
 block discarded – undo
3065 3065
 		print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable);
3066 3066
 		print '</td><td class="valuefield">';
3067 3067
 		if ($action == 'editdate' && $usercancreate && $caneditfield) {
3068
-			print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3069
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3068
+			print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3069
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3070 3070
 			print '<input type="hidden" name="action" value="setdate">';
3071
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3071
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3072 3072
 			print $form->selectDate($object->date, 're', 0, 0, 0, "editdate");
3073
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3073
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3074 3074
 			print '</form>';
3075 3075
 		} else {
3076 3076
 			if ($object->date) {
@@ -3088,17 +3088,17 @@  discard block
 block discarded – undo
3088 3088
 		print $langs->trans('DateEndPropal');
3089 3089
 		print '</td>';
3090 3090
 		if ($action != 'editecheance' && $usercancreate && $caneditfield) {
3091
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
3091
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editecheance&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
3092 3092
 		}
3093 3093
 		print '</tr></table>';
3094 3094
 		print '</td><td class="valuefield">';
3095 3095
 		if ($action == 'editecheance' && $usercancreate && $caneditfield) {
3096
-			print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3097
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3096
+			print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3097
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3098 3098
 			print '<input type="hidden" name="action" value="setecheance">';
3099
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3099
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3100 3100
 			print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance");
3101
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3101
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3102 3102
 			print '</form>';
3103 3103
 		} else {
3104 3104
 			if (!empty($object->fin_validite)) {
@@ -3119,14 +3119,14 @@  discard block
 block discarded – undo
3119 3119
 		print $langs->trans('PaymentConditionsShort');
3120 3120
 		print '</td>';
3121 3121
 		if ($action != 'editconditions' && $usercancreate && $caneditfield) {
3122
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
3122
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>';
3123 3123
 		}
3124 3124
 		print '</tr></table>';
3125 3125
 		print '</td><td class="valuefield">';
3126 3126
 		if ($action == 'editconditions' && $usercancreate && $caneditfield) {
3127
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3127
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3128 3128
 		} else {
3129
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3129
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3130 3130
 		}
3131 3131
 		print '</td>';
3132 3132
 		print '</tr>';
@@ -3138,14 +3138,14 @@  discard block
 block discarded – undo
3138 3138
 		print $langs->trans('PaymentMode');
3139 3139
 		print '</td>';
3140 3140
 		if ($action != 'editmode' && $usercancreate && $caneditfield) {
3141
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
3141
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
3142 3142
 		}
3143 3143
 		print '</tr></table>';
3144 3144
 		print '</td><td class="valuefieldcreate">';
3145 3145
 		if ($action == 'editmode' && $usercancreate && $caneditfield) {
3146
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3146
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3147 3147
 		} else {
3148
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3148
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3149 3149
 		}
3150 3150
 		print '</td></tr>';
3151 3151
 
@@ -3162,20 +3162,20 @@  discard block
 block discarded – undo
3162 3162
 		print '<tr class="fielddeliverydelay"><td>';
3163 3163
 		print '<table class="nobordernopadding centpercent"><tr><td>';
3164 3164
 		if (isModEnabled('order')) {
3165
-			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod') . ' (' . $langs->trans('AfterOrder') . ')');
3165
+			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
3166 3166
 		} else {
3167 3167
 			print $langs->trans('AvailabilityPeriod');
3168 3168
 		}
3169 3169
 		print '</td>';
3170 3170
 		if ($action != 'editavailability' && $usercancreate && $caneditfield) {
3171
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
3171
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editavailability&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'</a></td>';
3172 3172
 		}
3173 3173
 		print '</tr></table>';
3174 3174
 		print '</td><td class="valuefield">';
3175 3175
 		if ($action == 'editavailability' && $usercancreate && $caneditfield) {
3176
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3176
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3177 3177
 		} else {
3178
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3178
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3179 3179
 		}
3180 3180
 
3181 3181
 		print '</td>';
@@ -3188,14 +3188,14 @@  discard block
 block discarded – undo
3188 3188
 			print $langs->trans('SendingMethod');
3189 3189
 			print '</td>';
3190 3190
 			if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
3191
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editshippingmethod&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetShippingMode'), 1) . '</a></td>';
3191
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
3192 3192
 			}
3193 3193
 			print '</tr></table>';
3194 3194
 			print '</td><td class="valuefield">';
3195 3195
 			if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) {
3196
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3196
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3197 3197
 			} else {
3198
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3198
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3199 3199
 			}
3200 3200
 			print '</td>';
3201 3201
 			print '</tr>';
@@ -3204,16 +3204,16 @@  discard block
 block discarded – undo
3204 3204
 		// Warehouse
3205 3205
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
3206 3206
 			$langs->load('stocks');
3207
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3207
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3208 3208
 			$formproduct = new FormProduct($db);
3209 3209
 			print '<tr class="field_warehouse_id"><td>';
3210 3210
 			$editenable = $usercancreate;
3211 3211
 			print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
3212 3212
 			print '</td><td class="valuefieldcreate">';
3213 3213
 			if ($action == 'editwarehouse') {
3214
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3214
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3215 3215
 			} else {
3216
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3216
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3217 3217
 			}
3218 3218
 			print '</td>';
3219 3219
 			print '</tr>';
@@ -3225,14 +3225,14 @@  discard block
 block discarded – undo
3225 3225
 		print $langs->trans('Source');
3226 3226
 		print '</td>';
3227 3227
 		if ($action != 'editdemandreason' && $usercancreate) {
3228
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
3228
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'</a></td>';
3229 3229
 		}
3230 3230
 		print '</tr></table>';
3231 3231
 		print '</td><td class="valuefield">';
3232 3232
 		if ($action == 'editdemandreason' && $usercancreate) {
3233
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3233
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3234 3234
 		} else {
3235
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3235
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3236 3236
 		}
3237 3237
 		print '</td>';
3238 3238
 		print '</tr>';
@@ -3244,7 +3244,7 @@  discard block
 block discarded – undo
3244 3244
 			print '</td><td class="valuefield">';
3245 3245
 			$arrayoutstandingbills = $soc->getOutstandingBills();
3246 3246
 			print($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : '');
3247
-			print price($arrayoutstandingbills['opened']) . ' / ';
3247
+			print price($arrayoutstandingbills['opened']).' / ';
3248 3248
 			print price($soc->outstanding_limit, 0, $langs, 1, -1, -1, $conf->currency);
3249 3249
 			print '</td>';
3250 3250
 			print '</tr>';
@@ -3257,14 +3257,14 @@  discard block
 block discarded – undo
3257 3257
 			print $langs->trans('BankAccount');
3258 3258
 			print '</td>';
3259 3259
 			if ($action != 'editbankaccount' && $usercancreate) {
3260
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>';
3260
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
3261 3261
 			}
3262 3262
 			print '</tr></table>';
3263 3263
 			print '</td><td class="valuefield">';
3264 3264
 			if ($action == 'editbankaccount') {
3265
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3265
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3266 3266
 			} else {
3267
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3267
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3268 3268
 			}
3269 3269
 			print '</td>';
3270 3270
 			print '</tr>';
@@ -3275,13 +3275,13 @@  discard block
 block discarded – undo
3275 3275
 			$totalWeight = isset($tmparray['weight']) ? $tmparray['weight'] : 0;
3276 3276
 			$totalVolume = isset($tmparray['volume']) ? $tmparray['volume'] : 0;
3277 3277
 			if ($totalWeight) {
3278
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3278
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3279 3279
 				print '<td class="valuefield">';
3280 3280
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'), 1);
3281 3281
 				print '</td></tr>';
3282 3282
 			}
3283 3283
 			if ($totalVolume) {
3284
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3284
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3285 3285
 				print '<td class="valuefield">';
3286 3286
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'), 1);
3287 3287
 				print '</td></tr>';
@@ -3295,7 +3295,7 @@  discard block
 block discarded – undo
3295 3295
 			print $langs->trans('IncotermLabel');
3296 3296
 			print '<td><td class="right">';
3297 3297
 			if ($action != 'editincoterm' && $usercancreate && $caneditfield) {
3298
-				print '<a class="editfielda" href="' . DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>';
3298
+				print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
3299 3299
 			} else {
3300 3300
 				print '&nbsp;';
3301 3301
 			}
@@ -3303,7 +3303,7 @@  discard block
 block discarded – undo
3303 3303
 			print '</td>';
3304 3304
 			print '<td class="valuefield">';
3305 3305
 			if ($action == 'editincoterm' && $usercancreate && $caneditfield) {
3306
-				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3306
+				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3307 3307
 			} else {
3308 3308
 				print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3309 3309
 			}
@@ -3311,7 +3311,7 @@  discard block
 block discarded – undo
3311 3311
 		}
3312 3312
 
3313 3313
 		// Other attributes
3314
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3314
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3315 3315
 
3316 3316
 		print '</table>';
3317 3317
 
@@ -3321,53 +3321,53 @@  discard block
 block discarded – undo
3321 3321
 
3322 3322
 		print '<table class="border tableforfield centpercent">';
3323 3323
 
3324
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3324
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3325 3325
 
3326 3326
 		print '<tr>';
3327
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3328
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3327
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3328
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3329 3329
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3330
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3330
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3331 3331
 		}
3332 3332
 		print '</tr>';
3333 3333
 
3334 3334
 		print '<tr>';
3335
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
3336
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3335
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
3336
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3337 3337
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3338
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3338
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3339 3339
 		}
3340 3340
 		print '</tr>';
3341 3341
 
3342 3342
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3343 3343
 			print '<tr>';
3344
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3345
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3344
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3345
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3346 3346
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3347 3347
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3348 3348
 
3349
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3349
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3350 3350
 			}
3351 3351
 			print '</tr>';
3352 3352
 		}
3353 3353
 
3354 3354
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3355 3355
 			print '<tr>';
3356
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3357
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3356
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3357
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3358 3358
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3359 3359
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3360 3360
 
3361
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3361
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3362 3362
 			}
3363 3363
 			print '</tr>';
3364 3364
 		}
3365 3365
 
3366 3366
 		print '<tr>';
3367
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3368
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3367
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3368
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3369 3369
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3370
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3370
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3371 3371
 		}
3372 3372
 		print '</tr>';
3373 3373
 
@@ -3386,13 +3386,13 @@  discard block
 block discarded – undo
3386 3386
 		if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3387 3387
 			$blocname = 'contacts';
3388 3388
 			$title = $langs->trans('ContactsAddresses');
3389
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3389
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3390 3390
 		}
3391 3391
 
3392 3392
 		if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3393 3393
 			$blocname = 'notes';
3394 3394
 			$title = $langs->trans('Notes');
3395
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3395
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3396 3396
 		}
3397 3397
 
3398 3398
 		/*
@@ -3407,20 +3407,20 @@  discard block
 block discarded – undo
3407 3407
 		global $inputalsopricewithtax;
3408 3408
 		$inputalsopricewithtax = 1;
3409 3409
 
3410
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3411
-		<input type="hidden" name="token" value="' . newToken() . '">
3412
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3410
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3411
+		<input type="hidden" name="token" value="' . newToken().'">
3412
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3413 3413
 		<input type="hidden" name="mode" value="">
3414 3414
 		<input type="hidden" name="page_y" value="">
3415
-		<input type="hidden" name="backtopage" value="' . $backtopage . '">
3416
-		<input type="hidden" name="id" value="' . $object->id . '">
3415
+		<input type="hidden" name="backtopage" value="' . $backtopage.'">
3416
+		<input type="hidden" name="id" value="' . $object->id.'">
3417 3417
 		';
3418 3418
 
3419 3419
 		if (!empty($conf->use_javascript_ajax) && $object->status == Propal::STATUS_DRAFT) {
3420 3420
 			if (isModEnabled('subtotals')) {
3421
-				include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3421
+				include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3422 3422
 			} else {
3423
-				include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3423
+				include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3424 3424
 			}
3425 3425
 		}
3426 3426
 
@@ -3475,7 +3475,7 @@  discard block
 block discarded – undo
3475 3475
 		if (empty($reshook)) {
3476 3476
 			if ($action != 'editline') {
3477 3477
 				// Subtotal
3478
-				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3478
+				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3479 3479
 					$langs->load('subtotals');
3480 3480
 
3481 3481
 					$url_button = array();
@@ -3485,7 +3485,7 @@  discard block
 block discarded – undo
3485 3485
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3486 3486
 						'perm' => (bool) $usercancreate,
3487 3487
 						'label' => $langs->trans('AddTitleLine'),
3488
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3488
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3489 3489
 					);
3490 3490
 
3491 3491
 					$url_button[] = array(
@@ -3493,7 +3493,7 @@  discard block
 block discarded – undo
3493 3493
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3494 3494
 						'perm' => (bool) $usercancreate,
3495 3495
 						'label' => $langs->trans('AddSubtotalLine'),
3496
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3496
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3497 3497
 					);
3498 3498
 
3499 3499
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
@@ -3504,9 +3504,9 @@  discard block
 block discarded – undo
3504 3504
 					|| ($object->status == Propal::STATUS_DRAFT && getDolGlobalString('PROPAL_ENABLE_NEGATIVE') && count($object->lines) > 0)
3505 3505
 				) {
3506 3506
 					if ($usercanvalidate) {
3507
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate&token=' . newToken() . '">' . (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')) . '</a>';
3507
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken().'">'.(!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')).'</a>';
3508 3508
 					} else {
3509
-						print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans('Validate') . '</a>';
3509
+						print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>';
3510 3510
 					}
3511 3511
 				}
3512 3512
 				// Create event
@@ -3516,23 +3516,23 @@  discard block
 block discarded – undo
3516 3516
 				}*/
3517 3517
 				// Edit
3518 3518
 				if ($object->status == Propal::STATUS_VALIDATED && $usercancreate) {
3519
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif&token=' . newToken() . '">' . $langs->trans('Modify') . '</a>';
3519
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').'</a>';
3520 3520
 				}
3521 3521
 
3522 3522
 				// ReOpen
3523 3523
 				if (((getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && $object->status == Propal::STATUS_NOTSIGNED) || (!getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && ($object->status == Propal::STATUS_SIGNED || $object->status == Propal::STATUS_NOTSIGNED || $object->status == Propal::STATUS_BILLED || $object->status == Propal::STATUS_CANCELED)))) {
3524 3524
 					if ($usercanreopen) {
3525
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen') . '"';
3526
-						print '>' . $langs->trans('ReOpen') . '</a>';
3525
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen').'"';
3526
+						print '>'.$langs->trans('ReOpen').'</a>';
3527 3527
 					} else {
3528
-						print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ReOpen") . '</a>';
3528
+						print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ReOpen").'</a>';
3529 3529
 					}
3530 3530
 				}
3531 3531
 
3532 3532
 				// Send
3533 3533
 				if (empty($user->socid)) {
3534 3534
 					if ($object->status == Propal::STATUS_VALIDATED || $object->status == Propal::STATUS_SIGNED || getDolGlobalString('PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS')) {
3535
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '', $usercansend);
3535
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend);
3536 3536
 					}
3537 3537
 				}
3538 3538
 
@@ -3544,7 +3544,7 @@  discard block
 block discarded – undo
3544 3544
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3545 3545
 					'perm' => $usercancreateorder,
3546 3546
 					'label' => 'AddOrder',
3547
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3547
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3548 3548
 				);
3549 3549
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3550 3550
 					if ($usercancreateorder) {
@@ -3559,7 +3559,7 @@  discard block
 block discarded – undo
3559 3559
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3560 3560
 						'perm' => $usercancreatepurchaseorder,
3561 3561
 						'label' => 'AddPurchaseOrder',
3562
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3562
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3563 3563
 					);
3564 3564
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3565 3565
 						if ($usercancreatepurchaseorder) {
@@ -3574,7 +3574,7 @@  discard block
 block discarded – undo
3574 3574
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3575 3575
 					'perm' => $usercancreateintervention,
3576 3576
 					'label' => 'AddIntervention',
3577
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3577
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3578 3578
 				);
3579 3579
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3580 3580
 					if ($usercancreateintervention) {
@@ -3589,7 +3589,7 @@  discard block
 block discarded – undo
3589 3589
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3590 3590
 					'perm' => $usercancreatecontract,
3591 3591
 					'label' => 'AddContract',
3592
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3592
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3593 3593
 				);
3594 3594
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3595 3595
 					$langs->load("contracts");
@@ -3606,7 +3606,7 @@  discard block
 block discarded – undo
3606 3606
 						'enabled' => isModEnabled('invoice'),
3607 3607
 						'perm' => $usercancreateinvoice,
3608 3608
 						'label' => 'CreateBill',
3609
-						'url' => '/compta/facture/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3609
+						'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3610 3610
 					];
3611 3611
 					/*if (isModEnabled('invoice') && $usercancreateinvoice) {
3612 3612
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
@@ -3615,7 +3615,7 @@  discard block
 block discarded – undo
3615 3615
 
3616 3616
 				$actionButtonsParameters = [
3617 3617
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3618
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3618
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3619 3619
 				];
3620 3620
 
3621 3621
 				if ($numlines > 0) {
@@ -3628,9 +3628,9 @@  discard block
 block discarded – undo
3628 3628
 					$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
3629 3629
 					if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) {
3630 3630
 						if ($usercanclose) {
3631
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&token=' . newToken() . '&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a>';
3631
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
3632 3632
 						} else {
3633
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ClassifyBilled") . '</a>';
3633
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ClassifyBilled").'</a>';
3634 3634
 						}
3635 3635
 					}
3636 3636
 				}
@@ -3639,33 +3639,33 @@  discard block
 block discarded – undo
3639 3639
 					// Close as accepted/refused
3640 3640
 					if ($object->status == Propal::STATUS_VALIDATED) {
3641 3641
 						if ($usercanclose) {
3642
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3643
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3642
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3643
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3644 3644
 						} else {
3645
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '"';
3646
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3645
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
3646
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3647 3647
 						}
3648 3648
 					}
3649 3649
 				} else {
3650 3650
 					// Set not signed (close)
3651 3651
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3652
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token=' . newToken() . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3653
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3652
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3653
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3654 3654
 					}
3655 3655
 				}
3656 3656
 
3657 3657
 				// Cancel propal
3658 3658
 				if ($object->status > Propal::STATUS_DRAFT && $usercanclose) {
3659
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelPropal") . '</a>';
3659
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelPropal").'</a>';
3660 3660
 				}
3661 3661
 
3662 3662
 				// Clone
3663 3663
 				if ($usercancreate) {
3664
-					print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken() . '&object=' . $object->element . '">' . $langs->trans("ToClone") . '</a>';
3664
+					print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object='.$object->element.'">'.$langs->trans("ToClone").'</a>';
3665 3665
 				}
3666 3666
 
3667 3667
 				// Delete
3668
-				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $usercandelete);
3668
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
3669 3669
 			}
3670 3670
 		}
3671 3671
 
@@ -3684,8 +3684,8 @@  discard block
 block discarded – undo
3684 3684
 		 * Generated documents
3685 3685
 		 */
3686 3686
 		$objref = dol_sanitizeFileName($object->ref);
3687
-		$filedir = $conf->propal->multidir_output[$object->entity] . "/" . dol_sanitizeFileName($object->ref);
3688
-		$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3687
+		$filedir = $conf->propal->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
3688
+		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3689 3689
 		$genallowed = $usercanread;
3690 3690
 		$delallowed = $usercancreate;
3691 3691
 
@@ -3708,19 +3708,19 @@  discard block
 block discarded – undo
3708 3708
 
3709 3709
 		if ($object->status != Propal::STATUS_DRAFT && $useonlinesignature) {
3710 3710
 			print '<br><!-- Link to sign -->';
3711
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
3712
-			print showOnlineSignatureUrl('proposal', $object->ref, $object) . '<br>';
3711
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
3712
+			print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
3713 3713
 		}
3714 3714
 
3715 3715
 		print '</div><div class="fichehalfright">';
3716 3716
 
3717 3717
 		$MAXEVENT = 10;
3718 3718
 
3719
-		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id);
3720
-		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id);
3719
+		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id);
3720
+		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id);
3721 3721
 
3722 3722
 		// List of actions on element
3723
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3723
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3724 3724
 		$formactions = new FormActions($db);
3725 3725
 		$somethingshown = $formactions->showactions($object, 'propal', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3726 3726
 
@@ -3731,9 +3731,9 @@  discard block
 block discarded – undo
3731 3731
 	$modelmail = 'propal_send';
3732 3732
 	$defaulttopic = 'SendPropalRef';
3733 3733
 	$diroutput = $conf->propal->multidir_output[$object->entity];
3734
-	$trackid = 'pro' . $object->id;
3734
+	$trackid = 'pro'.$object->id;
3735 3735
 
3736
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3736
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3737 3737
 }
3738 3738
 
3739 3739
 // End of page
Please login to merge, or discard this patch.
htdocs/comm/action/class/actioncomm.class.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -588,8 +588,8 @@  discard block
 block discarded – undo
588 588
 		$sql .= "ip";
589 589
 		$sql .= ") VALUES (";
590 590
 		$sql .= "'(PROV)', ";
591
-		$sql .= "'".$this->db->idate($now)."', ";	// date creation
592
-		$sql .= "'".$this->db->idate($this->datep)."', ";	// date start event
591
+		$sql .= "'".$this->db->idate($now)."', "; // date creation
592
+		$sql .= "'".$this->db->idate($this->datep)."', "; // date start event
593 593
 		$sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", ";
594 594
 		$sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape((string) $this->durationp)."'" : "null").", "; // deprecated
595 595
 		$sql .= (isset($this->type_id) ? $this->type_id : "null").",";
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 						$resql = $this->db->query($sql);
664 664
 						if (!$resql) {
665 665
 							$error++;
666
-							dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR);
666
+							dol_syslog('Error to process userassigned: '.$this->db->lasterror(), LOG_ERR);
667 667
 							$this->errors[] = $this->db->lasterror();
668 668
 						} else {
669 669
 							$already_inserted[$val['id']] = true;
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 						$resql = $this->db->query($sql);
689 689
 						if (!$resql) {
690 690
 							$error++;
691
-							dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
691
+							dol_syslog('Error to process socpeopleassigned: '.$this->db->lasterror(), LOG_ERR);
692 692
 							$this->errors[] = $this->db->lasterror();
693 693
 						} else {
694 694
 							$already_inserted[$id] = true;
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 		$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm";
1204 1204
 		$sql .= " SET percent = '".$this->db->escape((string) $this->percentage)."'";
1205 1205
 		$sql .= ", fk_action = ".(int) $this->type_id;
1206
-		$sql .= ", code = " . ($code ? "'".$this->db->escape($code)."'" : "null");
1206
+		$sql .= ", code = ".($code ? "'".$this->db->escape($code)."'" : "null");
1207 1207
 		$sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null");
1208 1208
 		$sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null');
1209 1209
 		$sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null');
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 		$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
1363 1363
 		// Fields from hook
1364 1364
 		$parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype);
1365
-		$reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters);    // Note that $action and $object may have been modified by hook
1365
+		$reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook
1366 1366
 		if (!empty($hookmanager->resPrint)) {
1367 1367
 			$sql .= $hookmanager->resPrint;
1368 1368
 		}
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 		}
1392 1392
 		// Fields where hook
1393 1393
 		$parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype);
1394
-		$reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters);    // Note that $action and $object may have been modified by hook
1394
+		$reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook
1395 1395
 		if (!empty($hookmanager->resPrint)) {
1396 1396
 			$sql .= $hookmanager->resPrint;
1397 1397
 		}
@@ -1468,7 +1468,7 @@  discard block
 block discarded – undo
1468 1468
 
1469 1469
 		$resql = $this->db->query($sql);
1470 1470
 		if ($resql) {
1471
-			$response = null;  // Ensure the variable is defined
1471
+			$response = null; // Ensure the variable is defined
1472 1472
 			if (empty($load_state_board)) {
1473 1473
 				$agenda_static = new ActionComm($this->db);
1474 1474
 				$response = new WorkboardResponse();
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
 
1708 1708
 		// show categories for this record only in ajax to not overload lists
1709 1709
 		if (isModEnabled('category') && !$nofetch) {
1710
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1710
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1711 1711
 			if (empty($form)) {
1712 1712
 				include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
1713 1713
 				$form = new Form($this->db);
@@ -2569,7 +2569,7 @@  discard block
 block discarded – undo
2569 2569
 	 */
2570 2570
 	public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id)
2571 2571
 	{
2572
-		$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'actioncomm SET fk_element = ' . ((int) $dest_id) . ' WHERE elementtype="product" AND fk_element = '.((int) $origin_id);
2572
+		$sql = 'UPDATE '.MAIN_DB_PREFIX.'actioncomm SET fk_element = '.((int) $dest_id).' WHERE elementtype="product" AND fk_element = '.((int) $origin_id);
2573 2573
 		// using $dbs, not $this->db because function is static
2574 2574
 		if (!$dbs->query($sql)) {
2575 2575
 			//$this->errors = $dbs->lasterror();
@@ -2693,7 +2693,7 @@  discard block
 block discarded – undo
2693 2693
 		//Select all action comm reminders
2694 2694
 		$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
2695 2695
 		$sql .= " WHERE typeremind = 'email'";
2696
-		$sql .= " AND status = 0";	// 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2696
+		$sql .= " AND status = 0"; // 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2697 2697
 		$sql .= " AND dateremind <= '".$this->db->idate($now)."'";
2698 2698
 		$sql .= " AND entity IN (".getEntity('actioncomm').")";
2699 2699
 		$sql .= $this->db->order("dateremind", "ASC");
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
 		if ($resql) {
2703 2703
 			require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
2704 2704
 			$formmail = new FormMail($this->db);
2705
-			$to = null;  // Ensure 'to' is defined for static analysis
2705
+			$to = null; // Ensure 'to' is defined for static analysis
2706 2706
 
2707 2707
 			while ($obj = $this->db->fetch_object($resql)) {
2708 2708
 				$res = $actionCommReminder->fetch($obj->id);
@@ -2740,11 +2740,11 @@  discard block
 block discarded – undo
2740 2740
 							if (!empty($recipient->email)) {
2741 2741
 								$to = $recipient->email;
2742 2742
 							} else {
2743
-								$errormesg = "Failed to send remind to user id=" . $actionCommReminder->fk_user . ". No email defined for user.";
2743
+								$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
2744 2744
 								$error++;
2745 2745
 							}
2746 2746
 						} else {
2747
-							$errormesg = "Failed to load recipient with user id=" . $actionCommReminder->fk_user;
2747
+							$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
2748 2748
 							$error++;
2749 2749
 						}
2750 2750
 
@@ -2766,7 +2766,7 @@  discard block
 block discarded – undo
2766 2766
 							if ($cMailFile->sendfile()) {
2767 2767
 								$nbMailSend++;
2768 2768
 							} else {
2769
-								$errormesg = 'Failed to send email to: ' . $to . ' ' . $cMailFile->error . implode(',', $cMailFile->errors);
2769
+								$errormesg = 'Failed to send email to: '.$to.' '.$cMailFile->error.implode(',', $cMailFile->errors);
2770 2770
 								$error++;
2771 2771
 							}
2772 2772
 						}
@@ -2870,7 +2870,7 @@  discard block
 block discarded – undo
2870 2870
 		//Select all action comm reminders
2871 2871
 		$sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
2872 2872
 		$sql .= " WHERE typeremind = 'sms'";
2873
-		$sql .= " AND status = 0";	// 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2873
+		$sql .= " AND status = 0"; // 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors.
2874 2874
 		$sql .= " AND dateremind <= '".$this->db->idate($now)."'";
2875 2875
 		$sql .= " AND entity IN (".getEntity('actioncomm').")";
2876 2876
 		$sql .= $this->db->order("dateremind", "ASC");
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
 		if ($resql) {
2880 2880
 			require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
2881 2881
 			$formmail = new FormMail($this->db);
2882
-			$to = null;  // Ensure 'to' is defined for static analysis
2882
+			$to = null; // Ensure 'to' is defined for static analysis
2883 2883
 
2884 2884
 			while ($obj = $this->db->fetch_object($resql)) {
2885 2885
 				$res = $actionCommReminder->fetch($obj->id);
@@ -2917,11 +2917,11 @@  discard block
 block discarded – undo
2917 2917
 							if (!empty($recipient->user_mobile)) {
2918 2918
 								$to = $recipient->user_mobile;
2919 2919
 							} else {
2920
-								$errormesg = "Failed to send remind to user id=" . $actionCommReminder->fk_user . ". No email defined for user.";
2920
+								$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
2921 2921
 								$error++;
2922 2922
 							}
2923 2923
 						} else {
2924
-							$errormesg = "Failed to load recipient with user id=" . $actionCommReminder->fk_user;
2924
+							$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
2925 2925
 							$error++;
2926 2926
 						}
2927 2927
 
@@ -2943,7 +2943,7 @@  discard block
 block discarded – undo
2943 2943
 							if ($CSMSFile->sendfile()) {
2944 2944
 								$nbSmsSent++;
2945 2945
 							} else {
2946
-								$errormesg = 'Failed to send email to: ' . $to . ' ' . $CSMSFile->error . implode(',', $CSMSFile->errors);
2946
+								$errormesg = 'Failed to send email to: '.$to.' '.$CSMSFile->error.implode(',', $CSMSFile->errors);
2947 2947
 								$error++;
2948 2948
 							}
2949 2949
 						}
Please login to merge, or discard this patch.
htdocs/commande/card.php 1 patch
Spacing   +281 added lines, -281 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');
@@ -435,13 +435,13 @@  discard block
 block discarded – undo
435 435
 					$object_id = $object->create($user);
436 436
 
437 437
 					if ($object_id > 0) {
438
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
438
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
439 439
 
440 440
 						$classname = ucfirst($subelement);
441 441
 						$srcobject = new $classname($db);
442 442
 						'@phan-var-force Commande|Propal|Contrat $srcobject';
443 443
 
444
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
444
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
445 445
 						$result = $srcobject->fetch($object->origin_id);
446 446
 						if ($result > 0) {
447 447
 							$lines = $srcobject->lines;
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
 								$tva_tx = $lines[$i]->tva_tx;
494 494
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
495
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
495
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
496 496
 								}
497 497
 
498 498
 								$result = $object->addline(
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 			// End of object creation, we show it
621 621
 			if ($object_id > 0 && !$error) {
622 622
 				$db->commit();
623
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object_id);
623
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object_id);
624 624
 				exit();
625 625
 			} else {
626 626
 				$db->rollback();
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 			}
797 797
 			$tvatx = $line->tva_tx;
798 798
 			if (!empty($line->vat_src_code)) {
799
-				$tvatx .= ' (' . $line->vat_src_code . ')';
799
+				$tvatx .= ' ('.$line->vat_src_code.')';
800 800
 			}
801 801
 			$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);
802 802
 		}
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 				if ($prod->price_min > $line->subprice) {
827 827
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
828 828
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
829
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
829
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
830 830
 				} else {
831 831
 					setEventMessages($prod->error, $prod->errors, 'errors');
832 832
 				}
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		} else {
902 902
 			setEventMessages($object->error, $object->errors, 'errors');
903 903
 		}
904
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
904
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
905 905
 		exit();
906 906
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
907 907
 		// Handling adding a new subtotal line for subtotals module
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 		} else {
954 954
 			setEventMessages($object->error, $object->errors, 'errors');
955 955
 		}
956
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
956
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
957 957
 		exit();
958 958
 	} elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && $usercancreate) {		// Add a new line
959 959
 		$langs->load('errors');
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 		$pu_ht = '';
971 971
 		$pu_ttc = '';
972 972
 		$pu_ht_devise = '';
973
-		$pu_ttc_devise  = '';
973
+		$pu_ttc_devise = '';
974 974
 
975 975
 		if (GETPOST('price_ht') !== '') {
976 976
 			$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
@@ -999,9 +999,9 @@  discard block
 block discarded – undo
999 999
 
1000 1000
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1001 1001
 
1002
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1002
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1003 1003
 
1004
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1004
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1005 1005
 		if (empty($remise_percent)) {
1006 1006
 			$remise_percent = 0;
1007 1007
 		}
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
 		if (is_array($extralabelsline)) {
1014 1014
 			// Get extra fields
1015 1015
 			foreach ($extralabelsline as $key => $value) {
1016
-				unset($_POST["options_" . $key]);
1016
+				unset($_POST["options_".$key]);
1017 1017
 			}
1018 1018
 		}
1019 1019
 
@@ -1058,8 +1058,8 @@  discard block
 block discarded – undo
1058 1058
 
1059 1059
 		if (!$error && ($qty >= 0) && (!empty($line_desc) || (!empty($idprod) && $idprod > 0))) {
1060 1060
 			// Clean parameters
1061
-			$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'));
1062
-			$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'));
1061
+			$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'));
1062
+			$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'));
1063 1063
 			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
1064 1064
 
1065 1065
 			$price_min = $price_min_ttc = 0;
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 
1090 1090
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1091 1091
 					// If price per customer
1092
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1092
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1093 1093
 
1094 1094
 					$prodcustprice = new ProductCustomerPrice($db);
1095 1095
 
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 									$price_base_type = $custprice_line->price_base_type;
1112 1112
 									$tva_tx = $custprice_line->tva_tx;
1113 1113
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', (string) $tva_tx)) {
1114
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
1114
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
1115 1115
 									}
1116 1116
 									$tva_npr = $custprice_line->recuperableonly;
1117 1117
 									if (empty($tva_tx)) {
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 					}
1159 1159
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1160 1160
 					// If price per customer
1161
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1161
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1162 1162
 
1163 1163
 					$prodcustprice = new ProductCustomerPrice($db);
1164 1164
 
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
 									$price_base_type = $custprice_line->price_base_type;
1178 1178
 									$tva_tx = $custprice_line->tva_tx;
1179 1179
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
1180
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
1180
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
1181 1181
 									}
1182 1182
 									$tva_npr = $custprice_line->recuperableonly;
1183 1183
 									if (empty($tva_tx)) {
@@ -1301,23 +1301,23 @@  discard block
 block discarded – undo
1301 1301
 							$outputlangs->load('products');
1302 1302
 						}
1303 1303
 						if (!empty($prod->customcode)) {
1304
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1304
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1305 1305
 						}
1306 1306
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1307 1307
 							$tmptxt .= ' - ';
1308 1308
 						}
1309 1309
 						if (!empty($prod->country_code)) {
1310
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1310
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1311 1311
 						}
1312 1312
 					} else {
1313 1313
 						if (!empty($prod->customcode)) {
1314
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1314
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1315 1315
 						}
1316 1316
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1317 1317
 							$tmptxt .= ' - ';
1318 1318
 						}
1319 1319
 						if (!empty($prod->country_code)) {
1320
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1320
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1321 1321
 						}
1322 1322
 					}
1323 1323
 					$tmptxt .= ')';
@@ -1356,8 +1356,8 @@  discard block
 block discarded – undo
1356 1356
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
1357 1357
 
1358 1358
 			// Margin
1359
-			$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
1360
-			$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
1359
+			$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
1360
+			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
1361 1361
 
1362 1362
 			// Prepare a price equivalent for minimum price check
1363 1363
 			$pu_equivalent = $pu_ht;
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
 		 */
1602 1602
 
1603 1603
 		// Add buying price
1604
-		$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
+		$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
1605 1605
 		$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value
1606 1606
 
1607 1607
 		// Extrafields Lines
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 		// Unset extrafield POST Data
1611 1611
 		if (is_array($extralabelsline)) {
1612 1612
 			foreach ($extralabelsline as $key => $value) {
1613
-				unset($_POST["options_" . $key]);
1613
+				unset($_POST["options_".$key]);
1614 1614
 			}
1615 1615
 		}
1616 1616
 
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 			}
1754 1754
 		}
1755 1755
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
1756
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
1756
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
1757 1757
 		exit();
1758 1758
 	} elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) {
1759 1759
 		$idwarehouse = GETPOSTINT('idwarehouse');
@@ -1790,7 +1790,7 @@  discard block
 block discarded – undo
1790 1790
 					GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
1791 1791
 					&& isModEnabled('invoice') && $user->hasRight('facture', 'creer')
1792 1792
 				) {
1793
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1793
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1794 1794
 
1795 1795
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
1796 1796
 					$forceFields = array();
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 
1804 1804
 					if ($deposit) {
1805 1805
 						setEventMessage('DepositGenerated');
1806
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
1806
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
1807 1807
 					} else {
1808 1808
 						$error++;
1809 1809
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
 				}
1812 1812
 
1813 1813
 				// Define output language
1814
-				if (! $error) {
1814
+				if (!$error) {
1815 1815
 					$db->commit();
1816 1816
 
1817 1817
 					if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
 					}
1840 1840
 
1841 1841
 					if ($locationTarget) {
1842
-						header('Location: ' . $locationTarget);
1842
+						header('Location: '.$locationTarget);
1843 1843
 						exit;
1844 1844
 					}
1845 1845
 				} else {
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
 	}
1931 1931
 
1932 1932
 	if ($action == 'update_extras' && $permissiontoeditextra) {
1933
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
1933
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
1934 1934
 
1935 1935
 		$attribute_name = GETPOST('attribute', 'aZ09');
1936 1936
 
@@ -1966,13 +1966,13 @@  discard block
 block discarded – undo
1966 1966
 
1967 1967
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
1968 1968
 			if ($fromElement == 'commande') {
1969
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
1969
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
1970 1970
 				$lineClassName = 'OrderLine';
1971 1971
 			} elseif ($fromElement == 'propal') {
1972
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
1972
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
1973 1973
 				$lineClassName = 'PropaleLigne';
1974 1974
 			} elseif ($fromElement == 'facture') {
1975
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
1975
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
1976 1976
 				$lineClassName = 'FactureLigne';
1977 1977
 			}
1978 1978
 			$nextRang = count($object->lines) + 1;
@@ -2032,19 +2032,19 @@  discard block
 block discarded – undo
2032 2032
 	}
2033 2033
 
2034 2034
 	// Actions when printing a doc from card
2035
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
2035
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
2036 2036
 
2037 2037
 	// Actions to build doc
2038 2038
 	$upload_dir = !empty($conf->commande->multidir_output[$object->entity]) ? $conf->commande->multidir_output[$object->entity] : $conf->commande->dir_output;
2039 2039
 	$permissiontoadd = $usercancreate;
2040
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2040
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2041 2041
 
2042 2042
 	// Actions to send emails
2043 2043
 	$triggersendname = 'ORDER_SENTBYMAIL';
2044 2044
 	$paramname = 'id';
2045 2045
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
2046
-	$trackid = 'ord' . $object->id;
2047
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
2046
+	$trackid = 'ord'.$object->id;
2047
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
2048 2048
 
2049 2049
 
2050 2050
 	if (!$error && getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB') && $usercancreate) {
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 			}
2057 2057
 
2058 2058
 			if ($result >= 0) {
2059
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2059
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2060 2060
 				exit();
2061 2061
 			} else {
2062 2062
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2078,7 +2078,7 @@  discard block
 block discarded – undo
2078 2078
 			$result = $object->delete_contact($lineid);
2079 2079
 
2080 2080
 			if ($result >= 0) {
2081
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2081
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2082 2082
 				exit();
2083 2083
 			} else {
2084 2084
 				dol_print_error($db);
@@ -2092,7 +2092,7 @@  discard block
 block discarded – undo
2092 2092
  *	View
2093 2093
  */
2094 2094
 
2095
-$title = $object->ref . " - " . $langs->trans('Card');
2095
+$title = $object->ref." - ".$langs->trans('Card');
2096 2096
 if ($action == 'create') {
2097 2097
 	$title = $langs->trans("NewOrder");
2098 2098
 }
@@ -2165,11 +2165,11 @@  discard block
 block discarded – undo
2165 2165
 				$element = $subelement = 'contrat';
2166 2166
 			}
2167 2167
 
2168
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2168
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2169 2169
 
2170 2170
 			$classname = ucfirst($subelement);
2171 2171
 			$objectsrc = new $classname($db);
2172
-			'@phan-var-force Commande|Propal|Contrat $objectsrc';  // Can possibly be other class but CommonObject is too general
2172
+			'@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general
2173 2173
 			$objectsrc->fetch($originid);
2174 2174
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
2175 2175
 				$objectsrc->fetch_lines();
@@ -2263,16 +2263,16 @@  discard block
 block discarded – undo
2263 2263
 		}
2264 2264
 	}
2265 2265
 
2266
-	print '<form name="crea_commande" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2267
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2266
+	print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2267
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2268 2268
 	print '<input type="hidden" name="action" value="add">';
2269
-	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
2270
-	print '<input type="hidden" name="remise_percent" value="' . $soc->remise_percent . '">';
2271
-	print '<input type="hidden" name="origin" value="' . $origin . '">';
2272
-	print '<input type="hidden" name="originid" value="' . $originid . '">';
2273
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2269
+	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
2270
+	print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
2271
+	print '<input type="hidden" name="origin" value="'.$origin.'">';
2272
+	print '<input type="hidden" name="originid" value="'.$originid.'">';
2273
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2274 2274
 	if (!empty($currency_tx)) {
2275
-		print '<input type="hidden" name="originmulticurrency_tx" value="' . $currency_tx . '">';
2275
+		print '<input type="hidden" name="originmulticurrency_tx" value="'.$currency_tx.'">';
2276 2276
 	}
2277 2277
 
2278 2278
 	print dol_get_fiche_head([]);
@@ -2285,29 +2285,29 @@  discard block
 block discarded – undo
2285 2285
 		print '<table class="border centpercent">';
2286 2286
 
2287 2287
 		// Reference
2288
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td>' . $langs->trans("Draft") . '</td></tr>';
2288
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans("Draft").'</td></tr>';
2289 2289
 
2290 2290
 		// Reference client
2291
-		print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td>';
2291
+		print '<tr><td>'.$langs->trans('RefCustomer').'</td><td>';
2292 2292
 		if (getDolGlobalString('MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER') && !empty($origin) && !empty($originid)) {
2293
-			print '<input type="text" name="ref_client" value="' . $ref_client . '"></td>';
2293
+			print '<input type="text" name="ref_client" value="'.$ref_client.'"></td>';
2294 2294
 		} else {
2295
-			print '<input type="text" name="ref_client" value="' . GETPOST('ref_client') . '"></td>';
2295
+			print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
2296 2296
 		}
2297 2297
 		print '</tr>';
2298 2298
 
2299 2299
 		// Thirdparty
2300 2300
 		print '<tr>';
2301
-		print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
2301
+		print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
2302 2302
 		if ($socid > 0) {
2303 2303
 			print '<td>';
2304 2304
 			print $soc->getNomUrl(1, 'customer');
2305
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2305
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2306 2306
 			print '</td>';
2307 2307
 		} else {
2308 2308
 			print '<td class="valuefieldcreate">';
2309 2309
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2310
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
2310
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
2311 2311
 			// reload page to retrieve customer information
2312 2312
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2313 2313
 				print '<script>
@@ -2323,17 +2323,17 @@  discard block
 block discarded – undo
2323 2323
 				});
2324 2324
 				</script>';
2325 2325
 			}
2326
-			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>';
2326
+			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>';
2327 2327
 			print '</td>';
2328 2328
 		}
2329
-		print '</tr>' . "\n";
2329
+		print '</tr>'."\n";
2330 2330
 
2331 2331
 		// Contact of order
2332 2332
 		if ($socid > 0) {
2333 2333
 			// Contacts (ask contact only if thirdparty already defined).
2334 2334
 			// print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
2335 2335
 			print "<tr><td>";
2336
-			print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_" . $type_contact_code));
2336
+			print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_".$type_contact_code));
2337 2337
 			print '</td><td>';
2338 2338
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2339 2339
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx');
@@ -2341,26 +2341,26 @@  discard block
 block discarded – undo
2341 2341
 			print '</td></tr>';
2342 2342
 
2343 2343
 			// Ligne info remises tiers
2344
-			print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
2344
+			print '<tr><td>'.$langs->trans('Discounts').'</td><td>';
2345 2345
 
2346 2346
 			$absolute_discount = $soc->getAvailableDiscounts();
2347 2347
 
2348 2348
 			$thirdparty = $soc;
2349 2349
 			$discount_type = 0;
2350
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2351
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2350
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2351
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2352 2352
 
2353 2353
 			print '</td></tr>';
2354 2354
 		}
2355 2355
 
2356 2356
 		// Date
2357
-		print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td>';
2357
+		print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
2358 2358
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2359 2359
 		print $form->selectDate('', 're', 0, 0, 0, "crea_commande", 1, 1); // Always autofill date with current date
2360 2360
 		print '</td></tr>';
2361 2361
 
2362 2362
 		// Date delivery planned
2363
-		print '<tr><td>' . $langs->trans("DateDeliveryPlanned") . '</td>';
2363
+		print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
2364 2364
 		print '<td colspan="3">';
2365 2365
 		$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date);
2366 2366
 		print img_picto('', 'action', 'class="pictofixedwidth"');
@@ -2369,33 +2369,33 @@  discard block
 block discarded – undo
2369 2369
 		print '</tr>';
2370 2370
 
2371 2371
 		// Delivery delay
2372
-		print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td>';
2372
+		print '<tr class="fielddeliverydelay"><td>'.$langs->trans('AvailabilityPeriod').'</td><td>';
2373 2373
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
2374 2374
 		$form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOST('availability_id') : $availability_id), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2375 2375
 		print '</td></tr>';
2376 2376
 
2377 2377
 		// Terms of payment
2378
-		print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2378
+		print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2379 2379
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2380 2380
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', (float) $deposit_percent);
2381 2381
 		print '</td></tr>';
2382 2382
 
2383 2383
 		// Payment mode
2384
-		print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td>';
2384
+		print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
2385 2385
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2386 2386
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2387 2387
 		print '</td></tr>';
2388 2388
 
2389 2389
 		// Bank Account
2390 2390
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) {
2391
-			print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
2392
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2391
+			print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
2392
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2393 2393
 			print '</td></tr>';
2394 2394
 		}
2395 2395
 
2396 2396
 		// Shipping Method
2397 2397
 		if (isModEnabled('shipping')) {
2398
-			print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>';
2398
+			print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
2399 2399
 			print img_picto('', 'object_dolly', 'class="pictofixedwidth"');
2400 2400
 			$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');
2401 2401
 			print '</td></tr>';
@@ -2403,15 +2403,15 @@  discard block
 block discarded – undo
2403 2403
 
2404 2404
 		// Warehouse
2405 2405
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
2406
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2406
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2407 2407
 			$formproduct = new FormProduct($db);
2408
-			print '<tr><td>' . $langs->trans('Warehouse') . '</td><td>';
2409
-			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');
2408
+			print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
2409
+			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');
2410 2410
 			print '</td></tr>';
2411 2411
 		}
2412 2412
 
2413 2413
 		// Source / Channel - What trigger creation
2414
-		print '<tr><td>' . $langs->trans('Source') . '</td><td>';
2414
+		print '<tr><td>'.$langs->trans('Source').'</td><td>';
2415 2415
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2416 2416
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2417 2417
 		print '</td></tr>';
@@ -2422,9 +2422,9 @@  discard block
 block discarded – undo
2422 2422
 		if (isModEnabled('project')) {
2423 2423
 			$langs->load("projects");
2424 2424
 			print '<tr>';
2425
-			print '<td>' . $langs->trans("Project") . '</td><td>';
2426
-			print img_picto('', 'project', 'class="pictofixedwidth"') . $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2427
-			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
+			print '<td>'.$langs->trans("Project").'</td><td>';
2426
+			print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2427
+			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>';
2428 2428
 			print '</td>';
2429 2429
 			print '</tr>';
2430 2430
 		}
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
 		// Incoterms
2433 2433
 		if (isModEnabled('incoterm')) {
2434 2434
 			print '<tr>';
2435
-			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>';
2435
+			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>';
2436 2436
 			print '<td class="maxwidthonsmartphone">';
2437 2437
 			$incoterm_id = GETPOST('incoterm_id');
2438 2438
 			$location_incoterms = GETPOST('location_incoterms');
@@ -2448,7 +2448,7 @@  discard block
 block discarded – undo
2448 2448
 		// Other attributes
2449 2449
 		$parameters = array();
2450 2450
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
2451
-			$parameters['objectsrc'] =  $objectsrc;
2451
+			$parameters['objectsrc'] = $objectsrc;
2452 2452
 		}
2453 2453
 		$parameters['socid'] = $socid;
2454 2454
 
@@ -2469,9 +2469,9 @@  discard block
 block discarded – undo
2469 2469
 		}
2470 2470
 
2471 2471
 		// Template to use by default
2472
-		print '<tr><td>' . $langs->trans('DefaultModel') . '</td>';
2472
+		print '<tr><td>'.$langs->trans('DefaultModel').'</td>';
2473 2473
 		print '<td>';
2474
-		include_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php';
2474
+		include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
2475 2475
 		$liste = ModelePDFCommandes::liste_modeles($db);
2476 2476
 		$preselected = getDolGlobalString('COMMANDE_ADDON_PDF');
2477 2477
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
@@ -2481,22 +2481,22 @@  discard block
 block discarded – undo
2481 2481
 		// Multicurrency
2482 2482
 		if (isModEnabled("multicurrency")) {
2483 2483
 			print '<tr>';
2484
-			print '<td>' . $form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0) . '</td>';
2484
+			print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>';
2485 2485
 			print '<td class="maxwidthonsmartphone">';
2486
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2486
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2487 2487
 			print '</td></tr>';
2488 2488
 		}
2489 2489
 
2490 2490
 		// Categories
2491 2491
 		if (!empty($conf->categorie->enabled)) {
2492
-			print '<tr><td>' . $langs->trans("Categories") . '</td><td colspan="3">';
2492
+			print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
2493 2493
 			print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
2494 2494
 			print "</td></tr>";
2495 2495
 		}
2496 2496
 
2497 2497
 		// Note public
2498 2498
 		print '<tr>';
2499
-		print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
2499
+		print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
2500 2500
 		print '<td>';
2501 2501
 
2502 2502
 		$doleditor = new DolEditor('note_public', (string) $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2507,7 +2507,7 @@  discard block
 block discarded – undo
2507 2507
 		// Note private
2508 2508
 		if (empty($user->socid)) {
2509 2509
 			print '<tr>';
2510
-			print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
2510
+			print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
2511 2511
 			print '<td>';
2512 2512
 
2513 2513
 			$doleditor = new DolEditor('note_private', (string) $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2525,13 +2525,13 @@  discard block
 block discarded – undo
2525 2525
 				$objectsrc->update_price(1);
2526 2526
 			}
2527 2527
 
2528
-			print "\n<!-- " . $classname . " info -->";
2528
+			print "\n<!-- ".$classname." info -->";
2529 2529
 			print "\n";
2530
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2531
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2532
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2533
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2534
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2530
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2531
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2532
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2533
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2534
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2535 2535
 
2536 2536
 			switch ($classname) {
2537 2537
 				case 'Propal':
@@ -2550,25 +2550,25 @@  discard block
 block discarded – undo
2550 2550
 					$newclassname = $classname;
2551 2551
 			}
2552 2552
 
2553
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2553
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2554 2554
 
2555 2555
 			// Amount
2556
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht) . '</td></tr>';
2557
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva) . "</td></tr>";
2556
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>';
2557
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>";
2558 2558
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1 RE
2559
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1) . "</td></tr>";
2559
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>";
2560 2560
 			}
2561 2561
 
2562 2562
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2 IRPF
2563
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2) . "</td></tr>";
2563
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>";
2564 2564
 			}
2565 2565
 
2566
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc) . "</td></tr>";
2566
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>";
2567 2567
 
2568 2568
 			if (isModEnabled("multicurrency")) {
2569
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2570
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2571
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2569
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2570
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2571
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2572 2572
 			}
2573 2573
 		}
2574 2574
 
@@ -2619,7 +2619,7 @@  discard block
 block discarded – undo
2619 2619
 
2620 2620
 		// Confirmation to delete
2621 2621
 		if ($action == 'delete') {
2622
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
2622
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
2623 2623
 		}
2624 2624
 
2625 2625
 		// Confirmation of validation
@@ -2638,7 +2638,7 @@  discard block
 block discarded – undo
2638 2638
 
2639 2639
 			$text = $langs->trans('ConfirmValidateOrder', $numref);
2640 2640
 			if (isModEnabled('notification')) {
2641
-				require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2641
+				require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2642 2642
 				$notify = new Notify($db);
2643 2643
 				$text .= '<br>';
2644 2644
 				$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid, $object);
@@ -2654,7 +2654,7 @@  discard block
 block discarded – undo
2654 2654
 			$formquestion = array();
2655 2655
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2656 2656
 				$langs->load("stocks");
2657
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2657
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2658 2658
 				$formproduct = new FormProduct($db);
2659 2659
 				$forcecombo = 0;
2660 2660
 				if ($conf->browser->name == 'ie') {
@@ -2672,7 +2672,7 @@  discard block
 block discarded – undo
2672 2672
 			$nbMandated = 0;
2673 2673
 			foreach ($object->lines as $line) {
2674 2674
 				$res = $line->fetch_product();
2675
-				if ($res  > 0) {
2675
+				if ($res > 0) {
2676 2676
 					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2677 2677
 						$nbMandated++;
2678 2678
 						break;
@@ -2684,7 +2684,7 @@  discard block
 block discarded – undo
2684 2684
 					setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2685 2685
 					$error++;
2686 2686
 				} else {
2687
-					$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2687
+					$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2688 2688
 				}
2689 2689
 			}
2690 2690
 
@@ -2696,7 +2696,7 @@  discard block
 block discarded – undo
2696 2696
 				$deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2697 2697
 
2698 2698
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2699
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2699
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2700 2700
 
2701 2701
 					$object->fetchObjectLinked();
2702 2702
 
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
 			}
2801 2801
 
2802 2802
 			if (!$error) {
2803
-				$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240);
2803
+				$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240);
2804 2804
 			}
2805 2805
 		}
2806 2806
 
@@ -2817,7 +2817,7 @@  discard block
 block discarded – undo
2817 2817
 			$formquestion = array();
2818 2818
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2819 2819
 				$langs->load("stocks");
2820
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2820
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2821 2821
 				$formproduct = new FormProduct($db);
2822 2822
 				$forcecombo = 0;
2823 2823
 				if ($conf->browser->name == 'ie') {
@@ -2831,12 +2831,12 @@  discard block
 block discarded – undo
2831 2831
 				);
2832 2832
 			}
2833 2833
 
2834
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
2834
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
2835 2835
 		}
2836 2836
 
2837 2837
 		// Confirmation of closing
2838 2838
 		if ($action == 'shipped') {
2839
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
2839
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
2840 2840
 		}
2841 2841
 
2842 2842
 		// Confirmation of cancellation
@@ -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') {
@@ -2866,12 +2866,12 @@  discard block
 block discarded – undo
2866 2866
 				);
2867 2867
 			}
2868 2868
 
2869
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1);
2869
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1);
2870 2870
 		}
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
@@ -2894,7 +2894,7 @@  discard block
 block discarded – undo
2894 2894
 			$formquestion = array(
2895 2895
 				array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, array(), 0, 'maxwidth300'))
2896 2896
 			);
2897
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
2897
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
2898 2898
 		}
2899 2899
 
2900 2900
 		// Subtotal line form
@@ -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
 			}
@@ -2982,20 +2982,20 @@  discard block
 block discarded – undo
2982 2982
 				print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo'));
2983 2983
 				print '</td>';
2984 2984
 				if ($action != 'editposinfo' && $usercancreate) {
2985
-					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
+					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>';
2986 2986
 				}
2987 2987
 				print '</tr></table>';
2988 2988
 				print '</td><td class="valuefield fieldname_type">';
2989
-				print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" name="formposinfo">';
2989
+				print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="formposinfo">';
2990 2990
 				print '<input type="hidden" name="action" value="setposinfo">';
2991
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
2991
+				print '<input type="hidden" name="token" value="'.newToken().'">';
2992 2992
 				if ($action == 'editposinfo') {
2993
-					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="' . $langs->trans("POSModule") . '" value="' . $object->module_source . '"> ';
2994
-					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="' . $langs->trans("Terminal") . '" value="' . $object->pos_source . '">';
2995
-					print '<input type="submit" class="button" name="submitposinfo" value="' . $langs->trans("Submit") . '">';
2993
+					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="'.$langs->trans("POSModule").'" value="'.$object->module_source.'"> ';
2994
+					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="'.$langs->trans("Terminal").'" value="'.$object->pos_source.'">';
2995
+					print '<input type="submit" class="button" name="submitposinfo" value="'.$langs->trans("Submit").'">';
2996 2996
 				} else {
2997 2997
 					if ($object->module_source) {
2998
-						print '<span class="opacitymediumbycolor paddingleft">' . dolPrintHTML(ucfirst($object->module_source) . ' - ' . $langs->transnoentitiesnoconv("Terminal") . ' ' . $object->pos_source) . '</span>';
2998
+						print '<span class="opacitymediumbycolor paddingleft">'.dolPrintHTML(ucfirst($object->module_source).' - '.$langs->transnoentitiesnoconv("Terminal").' '.$object->pos_source).'</span>';
2999 2999
 					}
3000 3000
 				}
3001 3001
 				print '</form>';
@@ -3008,7 +3008,7 @@  discard block
 block discarded – undo
3008 3008
 				print $langs->trans('OutstandingBill');
3009 3009
 				print '</td><td class="valuefield">';
3010 3010
 				$arrayoutstandingbills = $soc->getOutstandingBills();
3011
-				print price($arrayoutstandingbills['opened']) . ' / ';
3011
+				print price($arrayoutstandingbills['opened']).' / ';
3012 3012
 				print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency);
3013 3013
 				print '</td>';
3014 3014
 				print '</tr>';
@@ -3023,11 +3023,11 @@  discard block
 block discarded – undo
3023 3023
 				$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3024 3024
 			}
3025 3025
 
3026
-			$addrelativediscount = '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditRelativeDiscounts") . '</a>';
3027
-			$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
3028
-			$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
3026
+			$addrelativediscount = '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditRelativeDiscounts").'</a>';
3027
+			$addabsolutediscount = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditGlobalDiscounts").'</a>';
3028
+			$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>';
3029 3029
 
3030
-			print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td class="valuefield">';
3030
+			print '<tr><td class="titlefield">'.$langs->trans('Discounts').'</td><td class="valuefield">';
3031 3031
 
3032 3032
 			$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3033 3033
 			$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3036,8 +3036,8 @@  discard block
 block discarded – undo
3036 3036
 
3037 3037
 			$thirdparty = $soc;
3038 3038
 			$discount_type = 0;
3039
-			$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3040
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3039
+			$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3040
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3041 3041
 
3042 3042
 			print '</td></tr>';
3043 3043
 
@@ -3047,17 +3047,17 @@  discard block
 block discarded – undo
3047 3047
 			print $form->editfieldkey("Date", 'date', '', $object, (int) $editenable);
3048 3048
 			print '</td><td class="valuefield">';
3049 3049
 			if ($action == 'editdate') {
3050
-				print '<form name="setdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3051
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3050
+				print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3051
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3052 3052
 				print '<input type="hidden" name="action" value="setdate">';
3053
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3053
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3054 3054
 				print $form->selectDate($object->date, 'order_', 0, 0, 0, "setdate");
3055
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3055
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3056 3056
 				print '</form>';
3057 3057
 			} else {
3058 3058
 				print $object->date ? dol_print_date($object->date, 'day') : '&nbsp;';
3059 3059
 				if ($object->hasDelay() && empty($object->delivery_date)) {	// If there is a delivery date planned, warning should be on this date
3060
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3060
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3061 3061
 				}
3062 3062
 			}
3063 3063
 			print '</td>';
@@ -3069,17 +3069,17 @@  discard block
 block discarded – undo
3069 3069
 			print $form->editfieldkey("DateDeliveryPlanned", 'date_livraison', '', $object, (int) $editenable);
3070 3070
 			print '</td><td class="valuefield">';
3071 3071
 			if ($action == 'editdate_livraison') {
3072
-				print '<form name="setdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3073
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3072
+				print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3073
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3074 3074
 				print '<input type="hidden" name="action" value="setdate_livraison">';
3075
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3075
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3076 3076
 				print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
3077
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3077
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3078 3078
 				print '</form>';
3079 3079
 			} else {
3080 3080
 				print $object->delivery_date ? dol_print_date($object->delivery_date, 'dayhour') : '&nbsp;';
3081 3081
 				if ($object->hasDelay() && !empty($object->delivery_date)) {
3082
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3082
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3083 3083
 				}
3084 3084
 			}
3085 3085
 			print '</td>';
@@ -3091,9 +3091,9 @@  discard block
 block discarded – undo
3091 3091
 			print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, (int) $editenable);
3092 3092
 			print '</td><td class="valuefield">';
3093 3093
 			if ($action == 'editavailability') {
3094
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3094
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3095 3095
 			} else {
3096
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3096
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3097 3097
 			}
3098 3098
 			print '</td></tr>';
3099 3099
 
@@ -3104,9 +3104,9 @@  discard block
 block discarded – undo
3104 3104
 				print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, (int) $editenable);
3105 3105
 				print '</td><td class="valuefield">';
3106 3106
 				if ($action == 'editshippingmethod') {
3107
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3107
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3108 3108
 				} else {
3109
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3109
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3110 3110
 				}
3111 3111
 				print '</td>';
3112 3112
 				print '</tr>';
@@ -3115,16 +3115,16 @@  discard block
 block discarded – undo
3115 3115
 			// Warehouse
3116 3116
 			if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
3117 3117
 				$langs->load('stocks');
3118
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3118
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3119 3119
 				$formproduct = new FormProduct($db);
3120 3120
 				print '<tr><td>';
3121 3121
 				$editenable = $usercancreate;
3122 3122
 				print $form->editfieldkey("Warehouse", 'warehouse', '', $object, (int) $editenable);
3123 3123
 				print '</td><td class="valuefield">';
3124 3124
 				if ($action == 'editwarehouse') {
3125
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3125
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3126 3126
 				} else {
3127
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3127
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3128 3128
 				}
3129 3129
 				print '</td>';
3130 3130
 				print '</tr>';
@@ -3136,9 +3136,9 @@  discard block
 block discarded – undo
3136 3136
 			print $form->editfieldkey("Source", 'demandreason', '', $object, (int) $editenable);
3137 3137
 			print '</td><td class="valuefield">';
3138 3138
 			if ($action == 'editdemandreason') {
3139
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3139
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3140 3140
 			} else {
3141
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3141
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3142 3142
 			}
3143 3143
 			print '</td></tr>';
3144 3144
 
@@ -3148,9 +3148,9 @@  discard block
 block discarded – undo
3148 3148
 			print $form->editfieldkey("PaymentConditionsShort", 'conditions', '', $object, (int) $editenable);
3149 3149
 			print '</td><td class="valuefield">';
3150 3150
 			if ($action == 'editconditions') {
3151
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3151
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3152 3152
 			} else {
3153
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3153
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3154 3154
 			}
3155 3155
 			print '</td>';
3156 3156
 
@@ -3162,9 +3162,9 @@  discard block
 block discarded – undo
3162 3162
 			print $form->editfieldkey("PaymentMode", 'mode', '', $object, (int) $editenable);
3163 3163
 			print '</td><td class="valuefield">';
3164 3164
 			if ($action == 'editmode') {
3165
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3165
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3166 3166
 			} else {
3167
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3167
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3168 3168
 			}
3169 3169
 			print '</td></tr>';
3170 3170
 
@@ -3186,13 +3186,13 @@  discard block
 block discarded – undo
3186 3186
 			$totalWeight = $tmparray['weight'];
3187 3187
 			$totalVolume = $tmparray['volume'];
3188 3188
 			if ($totalWeight) {
3189
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3189
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3190 3190
 				print '<td class="valuefield">';
3191 3191
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
3192 3192
 				print '</td></tr>';
3193 3193
 			}
3194 3194
 			if ($totalVolume) {
3195
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3195
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3196 3196
 				print '<td class="valuefield">';
3197 3197
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no');
3198 3198
 				print '</td></tr>';
@@ -3210,7 +3210,7 @@  discard block
 block discarded – undo
3210 3210
 				if ($action != 'editincoterm') {
3211 3211
 					print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3212 3212
 				} else {
3213
-					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
+					print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3214 3214
 				}
3215 3215
 				print '</td></tr>';
3216 3216
 			}
@@ -3222,9 +3222,9 @@  discard block
 block discarded – undo
3222 3222
 				print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, (int) $editenable);
3223 3223
 				print '</td><td class="valuefield">';
3224 3224
 				if ($action == 'editbankaccount') {
3225
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3225
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3226 3226
 				} else {
3227
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3227
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3228 3228
 				}
3229 3229
 				print '</td>';
3230 3230
 				print '</tr>';
@@ -3237,7 +3237,7 @@  discard block
 block discarded – undo
3237 3237
 				print $langs->trans("Categories");
3238 3238
 				print '<td><td class="right">';
3239 3239
 				if ($usercancreate) {
3240
-					print '<a class="editfielda" href="' . DOL_URL_ROOT . '/commande/card.php?id=' . $object->id . '&action=edittags&token=' . newToken() . '">' . img_edit() . '</a>';
3240
+					print '<a class="editfielda" href="'.DOL_URL_ROOT.'/commande/card.php?id='.$object->id.'&action=edittags&token='.newToken().'">'.img_edit().'</a>';
3241 3241
 				} else {
3242 3242
 					print '&nbsp;';
3243 3243
 				}
@@ -3245,11 +3245,11 @@  discard block
 block discarded – undo
3245 3245
 				print '</td>';
3246 3246
 				print '<td>';
3247 3247
 				if ($action == 'edittags') {
3248
-					print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
3248
+					print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
3249 3249
 					print '<input type="hidden" name="action" value="settags">';
3250
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
3250
+					print '<input type="hidden" name="token" value="'.newToken().'">';
3251 3251
 					print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
3252
-					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
3252
+					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
3253 3253
 					print '</form>';
3254 3254
 				} else {
3255 3255
 					print $form->showCategories($object->id, Categorie::TYPE_ORDER, 1);
@@ -3258,7 +3258,7 @@  discard block
 block discarded – undo
3258 3258
 			}
3259 3259
 
3260 3260
 			// Other attributes
3261
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3261
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3262 3262
 
3263 3263
 			print '</table>';
3264 3264
 
@@ -3268,40 +3268,40 @@  discard block
 block discarded – undo
3268 3268
 
3269 3269
 			print '<table class="border tableforfield centpercent">';
3270 3270
 
3271
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3271
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3272 3272
 
3273 3273
 			$alert = '';
3274 3274
 			if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) {
3275
-				$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
3275
+				$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
3276 3276
 			}
3277 3277
 
3278 3278
 			print '<tr>';
3279
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3280
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3279
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3280
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3281 3281
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3282 3282
 				// Multicurrency Amount HT
3283
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3283
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3284 3284
 			}
3285 3285
 			print '</tr>';
3286 3286
 
3287 3287
 			print '<tr>';
3288
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
3289
-			print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3288
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
3289
+			print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3290 3290
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3291 3291
 				// Multicurrency Amount VAT
3292
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3292
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3293 3293
 			}
3294 3294
 			print '</tr>';
3295 3295
 
3296 3296
 			// Amount Local Taxes
3297 3297
 			if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3298 3298
 				print '<tr>';
3299
-				print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3300
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3299
+				print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3300
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3301 3301
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3302 3302
 					$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3303 3303
 
3304
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3304
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3305 3305
 				}
3306 3306
 				print '</tr>';
3307 3307
 			}
@@ -3309,24 +3309,24 @@  discard block
 block discarded – undo
3309 3309
 			// Amount Local Taxes
3310 3310
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3311 3311
 				print '<tr>';
3312
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3313
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3312
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3313
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3314 3314
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3315 3315
 					$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3316 3316
 
3317
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3317
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3318 3318
 				}
3319 3319
 				print '</tr>';
3320 3320
 			}
3321 3321
 
3322 3322
 			print '<tr>';
3323
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3324
-			print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
3323
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3324
+			print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
3325 3325
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3326 3326
 				// Multicurrency Amount TTC
3327
-				print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
3327
+				print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
3328 3328
 			}
3329
-			print '</tr>' . "\n";
3329
+			print '</tr>'."\n";
3330 3330
 
3331 3331
 			print '</table>';
3332 3332
 
@@ -3347,13 +3347,13 @@  discard block
 block discarded – undo
3347 3347
 			if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3348 3348
 				$blocname = 'contacts';
3349 3349
 				$title = $langs->trans('ContactsAddresses');
3350
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3350
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3351 3351
 			}
3352 3352
 
3353 3353
 			if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3354 3354
 				$blocname = 'notes';
3355 3355
 				$title = $langs->trans('Notes');
3356
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3356
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3357 3357
 			}
3358 3358
 
3359 3359
 			/*
@@ -3368,20 +3368,20 @@  discard block
 block discarded – undo
3368 3368
 			global $inputalsopricewithtax;
3369 3369
 			$inputalsopricewithtax = 1;
3370 3370
 
3371
-			print '<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3372
-			<input type="hidden" name="token" value="' . newToken() . '">
3373
-			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3371
+			print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3372
+			<input type="hidden" name="token" value="' . newToken().'">
3373
+			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3374 3374
 			<input type="hidden" name="mode" value="">
3375 3375
 			<input type="hidden" name="page_y" value="">
3376
-			<input type="hidden" name="id" value="' . $object->id . '">
3377
-			<input type="hidden" name="backtopage" value="' . $backtopage . '">
3376
+			<input type="hidden" name="id" value="' . $object->id.'">
3377
+			<input type="hidden" name="backtopage" value="' . $backtopage.'">
3378 3378
 				';
3379 3379
 
3380 3380
 			if (!empty($conf->use_javascript_ajax) && $object->status == Commande::STATUS_DRAFT) {
3381 3381
 				if (isModEnabled('subtotals')) {
3382
-					include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3382
+					include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3383 3383
 				} else {
3384
-					include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3384
+					include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3385 3385
 				}
3386 3386
 			}
3387 3387
 
@@ -3436,22 +3436,22 @@  discard block
 block discarded – undo
3436 3436
 
3437 3437
 				// Reopen a closed order
3438 3438
 				if (($object->status == Commande::STATUS_CLOSED || $object->status == Commande::STATUS_CANCELED) && $usercancreate && (!$object->billed || !getDolGlobalInt('ORDER_DONT_REOPEN_BILLED'))) {
3439
-					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"] . '?action=reopen&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3439
+					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
3440 3440
 				}
3441 3441
 
3442 3442
 				// Send
3443 3443
 				if (empty($user->socid)) {
3444 3444
 					if ($object->status > Commande::STATUS_DRAFT || getDolGlobalString('COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS')) {
3445 3445
 						if ($usercansend) {
3446
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '');
3446
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3447 3447
 						} else {
3448
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'] . '#', '', false);
3448
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
3449 3449
 						}
3450 3450
 					}
3451 3451
 				}
3452 3452
 
3453 3453
 				// Subtotal
3454
-				if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3454
+				if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3455 3455
 					$langs->load('subtotals');
3456 3456
 
3457 3457
 					$url_button = array();
@@ -3461,7 +3461,7 @@  discard block
 block discarded – undo
3461 3461
 						'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
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),
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('contrat') && ($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,9 +3639,9 @@  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] . '/' . $objref;
3644
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3642
+			$relativepath = $objref.'/'.$objref.'.pdf';
3643
+			$filedir = $conf->commande->multidir_output[$object->entity].'/'.$objref;
3644
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3645 3645
 			$genallowed = $usercanread;
3646 3646
 			$delallowed = $usercancreate;
3647 3647
 			print $formfile->showdocuments('commande', $objref, $filedir, $urlsource, $genallowed, (int) $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang, '', $object);
@@ -3664,7 +3664,7 @@  discard block
 block discarded – undo
3664 3664
 
3665 3665
 			// Show online payment link
3666 3666
 			// The list can be complete by the hook 'doValidatePayment' executed inside getValidOnlinePaymentMethods()
3667
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3667
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3668 3668
 			$validpaymentmethod = getValidOnlinePaymentMethods('');
3669 3669
 			$useonlinepayment = count($validpaymentmethod);
3670 3670
 
@@ -3673,8 +3673,8 @@  discard block
 block discarded – undo
3673 3673
 			}
3674 3674
 			if ($object->status != Commande::STATUS_DRAFT && $useonlinepayment) {
3675 3675
 				print '<br><!-- Link to pay -->';
3676
-				require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3677
-				print showOnlinePaymentUrl('order', $object->ref) . '<br>';
3676
+				require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3677
+				print showOnlinePaymentUrl('order', $object->ref).'<br>';
3678 3678
 			}
3679 3679
 
3680 3680
 			print '</div><div class="fichehalfright">';
@@ -3682,11 +3682,11 @@  discard block
 block discarded – undo
3682 3682
 			$MAXEVENT = 10;
3683 3683
 
3684 3684
 			//button to go to messaging from the events box
3685
-			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/commande/messaging.php?id=' . $object->id);
3686
-			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/commande/agenda.php?id=' . $object->id);
3685
+			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/commande/messaging.php?id='.$object->id);
3686
+			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id);
3687 3687
 
3688 3688
 			// List of actions on element
3689
-			include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3689
+			include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3690 3690
 			$formactions = new FormActions($db);
3691 3691
 			$somethingshown = $formactions->showactions($object, 'order', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3692 3692
 
@@ -3697,9 +3697,9 @@  discard block
 block discarded – undo
3697 3697
 		$modelmail = 'order_send';
3698 3698
 		$defaulttopic = 'SendOrderRef';
3699 3699
 		$diroutput = getMultidirOutput($object);
3700
-		$trackid = 'ord' . $object->id;
3700
+		$trackid = 'ord'.$object->id;
3701 3701
 
3702
-		include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3702
+		include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3703 3703
 	}
3704 3704
 }
3705 3705
 
Please login to merge, or discard this patch.
htdocs/fourn/class/fournisseur.facture.class.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	/**
232 232
 	 * @var int ID
233 233
 	 */
234
-	public $fk_account;		// default bank account
234
+	public $fk_account; // default bank account
235 235
 
236 236
 	/**
237 237
 	 * @var int Transport mode id
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		if ($this->fac_rec > 0) {
440 440
 			$this->fk_fac_rec_source = $this->fac_rec;
441 441
 
442
-			require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
442
+			require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php';
443 443
 			$_facrec = new FactureFournisseurRec($this->db);
444 444
 			$result = $_facrec->fetch($this->fac_rec);
445 445
 			$result = $_facrec->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); // This load $_facrec->linkedObjectsIds
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 			$this->location_incoterms = $_facrec->location_incoterms;
475 475
 
476 476
 			// Clean parameters
477
-			if (! $this->type) {
477
+			if (!$this->type) {
478 478
 				$this->type = self::TYPE_STANDARD;
479 479
 			}
480 480
 			$this->note_public = trim($this->note_public);
@@ -483,11 +483,11 @@  discard block
 block discarded – undo
483 483
 
484 484
 			$this->array_options = $_facrec->array_options;
485 485
 
486
-			if (! $this->mode_reglement_id) {
486
+			if (!$this->mode_reglement_id) {
487 487
 				$this->mode_reglement_id = 0;
488 488
 			}
489 489
 			$this->status = self::STATUS_DRAFT;
490
-			$this->statut = self::STATUS_DRAFT;	// deprecated
490
+			$this->statut = self::STATUS_DRAFT; // deprecated
491 491
 
492 492
 			$this->linked_objects = $_facrec->linkedObjectsIds;
493 493
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 
498 498
 			// For recurring invoices, update date and number of last generation of recurring template invoice, before inserting new invoice
499 499
 			if ($_facrec->frequency > 0) {
500
-				$this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1));
500
+				$this->ref_supplier = trim($this->ref_supplier.'_'.($_facrec->nb_gen_done + 1));
501 501
 				dol_syslog("This is a recurring invoice so we set date_last_gen and next date_when");
502 502
 				if (empty($_facrec->date_when)) {
503 503
 					$_facrec->date_when = $now;
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 			/*
734 734
 			 * Insert lines of template invoices
735 735
 			 */
736
-			if (! $error && $this->fac_rec > 0 && $_facrec instanceof FactureFournisseurRec) {
736
+			if (!$error && $this->fac_rec > 0 && $_facrec instanceof FactureFournisseurRec) {
737 737
 				foreach ($_facrec->lines as $i => $val) {
738 738
 					$product_type = $_facrec->lines[$i]->product_type;
739 739
 					if ($_facrec->lines[$i]->fk_product) {
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 					$localtax1_tx=get_localtax($tva_tx,1,$soc,$mysoc,$tva_npr);
750 750
 					$localtax2_tx=get_localtax($tva_tx,2,$soc,$mysoc,$tva_npr);
751 751
 					*/
752
-					$tva_tx = $_facrec->lines[$i]->tva_tx . ($_facrec->lines[$i]->vat_src_code ? '(' . $_facrec->lines[$i]->vat_src_code . ')' : '');
752
+					$tva_tx = $_facrec->lines[$i]->tva_tx.($_facrec->lines[$i]->vat_src_code ? '('.$_facrec->lines[$i]->vat_src_code.')' : '');
753 753
 					$tva_npr = $_facrec->lines[$i]->info_bits;
754 754
 					if (empty($tva_tx)) {
755 755
 						$tva_npr = 0;
@@ -762,8 +762,8 @@  discard block
 block discarded – undo
762 762
 					$buyprice = empty($_facrec->lines[$i]->buyprice) ? 0 : $_facrec->lines[$i]->buyprice;
763 763
 
764 764
 					// If buyprice not defined from template invoice, we try to guess the best value
765
-					if (! $buyprice && $_facrec->lines[$i]->fk_product > 0) {
766
-						require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
765
+					if (!$buyprice && $_facrec->lines[$i]->fk_product > 0) {
766
+						require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
767 767
 						$producttmp = new ProductFournisseur($this->db);
768 768
 						$producttmp->fetch($_facrec->lines[$i]->fk_product);
769 769
 
@@ -949,14 +949,14 @@  discard block
 block discarded – undo
949 949
 				$this->id = $obj->rowid;
950 950
 				$this->ref = $obj->ref ? $obj->ref : $obj->rowid; // We take rowid if ref is empty for backward compatibility
951 951
 
952
-				$this->ref_supplier         = $obj->ref_supplier;
953
-				$this->ref_ext			    = $obj->ref_ext;
954
-				$this->entity				= $obj->entity;
952
+				$this->ref_supplier = $obj->ref_supplier;
953
+				$this->ref_ext = $obj->ref_ext;
954
+				$this->entity = $obj->entity;
955 955
 				$this->type					= empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
956
-				$this->subtype				= (int) $obj->subtype;
956
+				$this->subtype = (int) $obj->subtype;
957 957
 				$this->socid				= $obj->fk_soc;
958 958
 				$this->date					= $this->db->jdate($obj->datef);
959
-				$this->date_creation		= $this->db->jdate($obj->datec);
959
+				$this->date_creation = $this->db->jdate($obj->datec);
960 960
 				$this->datec				= $this->db->jdate($obj->datec);
961 961
 				$this->date_modification    = $this->db->jdate($obj->datem);
962 962
 				$this->tms                  = $this->db->jdate($obj->datem);
@@ -972,14 +972,14 @@  discard block
 block discarded – undo
972 972
 				$this->total_tva			= $obj->total_tva;
973 973
 				$this->total_ttc			= $obj->total_ttc;
974 974
 				$this->status				= $obj->status;
975
-				$this->statut				= $obj->status;	// For backward compatibility
976
-				$this->fk_statut			= $obj->status;	// For backward compatibility
975
+				$this->statut				= $obj->status; // For backward compatibility
976
+				$this->fk_statut			= $obj->status; // For backward compatibility
977 977
 				$this->user_creation_id     = $obj->fk_user_author;
978
-				$this->author				= $obj->fk_user_author;	// deprecated
978
+				$this->author				= $obj->fk_user_author; // deprecated
979 979
 				$this->user_validation_id   = $obj->fk_user_valid;
980 980
 				$this->fk_user_valid        = $obj->fk_user_valid;
981 981
 				$this->fk_facture_source	= $obj->fk_facture_source;
982
-				$this->vat_reverse_charge	= empty($obj->vat_reverse_charge) ? 0 : 1;
982
+				$this->vat_reverse_charge = empty($obj->vat_reverse_charge) ? 0 : 1;
983 983
 				$this->fk_fac_rec_source	= $obj->fk_fac_rec_source;
984 984
 				$this->fk_project           = $obj->fk_project;
985 985
 				$this->cond_reglement_id	= $obj->fk_cond_reglement;
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
 
1016 1016
 				$this->extraparams = isset($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array();
1017 1017
 
1018
-				$this->socid  = $obj->socid;
1018
+				$this->socid = $obj->socid;
1019 1019
 
1020 1020
 				// Retrieve all extrafield
1021 1021
 				// fetch optionals attributes and labels
@@ -1084,22 +1084,22 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
 					$line->product_ref      = $obj->product_ref;
1086 1086
 					$line->ref              = $obj->product_ref;
1087
-					$line->ref_supplier		= $obj->ref_supplier;
1087
+					$line->ref_supplier = $obj->ref_supplier;
1088 1088
 					$line->libelle			= $obj->label;
1089 1089
 					$line->label  			= $obj->label;
1090 1090
 					$line->product_barcode  = $obj->product_barcode;
1091 1091
 					$line->product_desc		= $obj->product_desc;
1092 1092
 					$line->subprice         = $obj->pu_ht;
1093
-					$line->pu_ht            = $obj->pu_ht;	// deprecated
1093
+					$line->pu_ht            = $obj->pu_ht; // deprecated
1094 1094
 					$line->subprice_ttc		= $obj->pu_ttc;
1095
-					$line->pu_ttc			= $obj->pu_ttc;	// deprcated
1095
+					$line->pu_ttc			= $obj->pu_ttc; // deprcated
1096 1096
 					$line->vat_src_code     = $obj->vat_src_code;
1097 1097
 					$line->tva_tx			= $obj->tva_tx;
1098 1098
 					$line->localtax1_tx		= $obj->localtax1_tx;
1099 1099
 					$line->localtax2_tx		= $obj->localtax2_tx;
1100 1100
 					$line->localtax1_type	= $obj->localtax1_type;
1101 1101
 					$line->localtax2_type	= $obj->localtax2_type;
1102
-					$line->qty				= $obj->qty;
1102
+					$line->qty = $obj->qty;
1103 1103
 					$line->remise_percent   = $obj->remise_percent;
1104 1104
 					$line->fk_remise_except = $obj->fk_remise_except;
1105 1105
 					//$line->tva			= $obj->total_tva; // deprecated
@@ -1191,10 +1191,10 @@  discard block
 block discarded – undo
1191 1191
 		}
1192 1192
 		if (isset($this->paid)) {
1193 1193
 			$this->paid = (int) (bool) $this->paid;
1194
-			$this->paye = $this->paid;	// deprecated
1194
+			$this->paye = $this->paid; // deprecated
1195 1195
 		} elseif (isset($this->paye)) {
1196 1196
 			$this->paid = (int) (bool) $this->paye;
1197
-			$this->paye = $this->paid;	// deprecared
1197
+			$this->paye = $this->paid; // deprecared
1198 1198
 		}
1199 1199
 		if (isset($this->close_code)) {
1200 1200
 			$this->close_code = trim($this->close_code);
@@ -2491,9 +2491,9 @@  discard block
 block discarded – undo
2491 2491
 		$line->qty = ($this->type == self::TYPE_CREDIT_NOTE ? abs((float) $qty) : (float) $qty); // For credit note, quantity is always positive and unit price negative
2492 2492
 
2493 2493
 		$line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs((float) $pu_ht) : (float) $pu_ht); // For credit note, unit price always negative, always positive otherwise
2494
-		$line->pu_ht = $line->subprice;  // deprecated
2494
+		$line->pu_ht = $line->subprice; // deprecated
2495 2495
 		$line->subprice_ttc = ($this->type == self::TYPE_CREDIT_NOTE ? -abs((float) $pu_ttc) : (float) $pu_ttc); // For credit note, unit price always negative, always positive otherwise
2496
-		$line->pu_ttc = $line->subprice_ttc;  // deprecated
2496
+		$line->pu_ttc = $line->subprice_ttc; // deprecated
2497 2497
 
2498 2498
 		$line->remise_percent = $remise_percent;
2499 2499
 		$line->ref_supplier = $ref_supplier;
@@ -2777,7 +2777,7 @@  discard block
 block discarded – undo
2777 2777
 
2778 2778
 			while ($obj = $this->db->fetch_object($resql)) {
2779 2779
 				$facturestatic->date_echeance = $this->db->jdate($obj->datefin);
2780
-				$facturestatic->statut = $obj->status;	// For backward compatibility
2780
+				$facturestatic->statut = $obj->status; // For backward compatibility
2781 2781
 				$facturestatic->status = $obj->status;
2782 2782
 
2783 2783
 				$response->nbtodo++;
@@ -2990,7 +2990,7 @@  discard block
 block discarded – undo
2990 2990
 			}
2991 2991
 		}
2992 2992
 		global $action;
2993
-		$hookmanager->initHooks(array($this->element . 'dao'));
2993
+		$hookmanager->initHooks(array($this->element.'dao'));
2994 2994
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
2995 2995
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
2996 2996
 		if ($reshook > 0) {
@@ -3037,7 +3037,7 @@  discard block
 block discarded – undo
3037 3037
 
3038 3038
 		$mybool = false;
3039 3039
 
3040
-		$file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER') . ".php";
3040
+		$file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER').".php";
3041 3041
 		$classname = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER');
3042 3042
 
3043 3043
 		// Include file with class
@@ -3124,7 +3124,7 @@  discard block
 block discarded – undo
3124 3124
 		$xnbp = 0;
3125 3125
 		if (empty($option) || $option != 'nolines') {
3126 3126
 			// Lines
3127
-			$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
3127
+			$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
3128 3128
 			while ($xnbp < $nbp) {
3129 3129
 				$line = new SupplierInvoiceLine($this->db);
3130 3130
 				$line->desc = $langs->trans("Description")." ".$xnbp;
@@ -3227,15 +3227,15 @@  discard block
 block discarded – undo
3227 3227
 		// Load source object
3228 3228
 		$object->fetch($fromid);
3229 3229
 		$object->id = 0;
3230
-		$object->statut = self::STATUS_DRAFT;	// For backward compatibility
3230
+		$object->statut = self::STATUS_DRAFT; // For backward compatibility
3231 3231
 		$object->status = self::STATUS_DRAFT;
3232 3232
 
3233 3233
 		$object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor
3234 3234
 
3235 3235
 		// Clear fields
3236 3236
 		$object->ref_supplier       = (empty($this->ref_supplier) ? $langs->trans("CopyOf").' '.$object->ref_supplier : $this->ref_supplier);
3237
-		$object->author             = $user->id;  // FIXME? user_validation_id is replacement for author
3238
-		$object->user_validation_id = 0;  // FIXME?  user_validation_id is replacement for author
3237
+		$object->author             = $user->id; // FIXME? user_validation_id is replacement for author
3238
+		$object->user_validation_id = 0; // FIXME?  user_validation_id is replacement for author
3239 3239
 		$object->fk_facture_source  = 0;
3240 3240
 		$object->date_creation      = '';
3241 3241
 		$object->date_validation    = '';
@@ -3540,14 +3540,14 @@  discard block
 block discarded – undo
3540 3540
 		if (!empty($paymentmode) && $paymentmode != 'all') {
3541 3541
 			$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
3542 3542
 		}
3543
-		$sql .= " WHERE f.paye = 0";	// Only unpaid
3544
-		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED;	// Only validated status
3543
+		$sql .= " WHERE f.paye = 0"; // Only unpaid
3544
+		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status
3545 3545
 		if ($datetouse == 'invoicedate') {
3546 3546
 			$sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'";
3547 3547
 		} else {
3548 3548
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
3549 3549
 		}
3550
-		$sql .= " AND f.entity IN (".getEntity('supplier_invoice', 0).")";	// One batch process only one company (no sharing)
3550
+		$sql .= " AND f.entity IN (".getEntity('supplier_invoice', 0).")"; // One batch process only one company (no sharing)
3551 3551
 		if (!empty($paymentmode) && $paymentmode != 'all') {
3552 3552
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
3553 3553
 		}
@@ -3768,7 +3768,7 @@  discard block
 block discarded – undo
3768 3768
 								$actioncomm->create($user);
3769 3769
 							}
3770 3770
 
3771
-							$this->db->commit();	// We always commit
3771
+							$this->db->commit(); // We always commit
3772 3772
 						}
3773 3773
 
3774 3774
 						if ($errormesg) {
Please login to merge, or discard this patch.
htdocs/fourn/commande/card.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 $action = GETPOST('action', 'alpha');
92 92
 $confirm = GETPOST('confirm', 'alpha');
93 93
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'purchaseordercard'; // To manage different context of search
94
-$cancel    = GETPOST('cancel', 'alpha');
94
+$cancel = GETPOST('cancel', 'alpha');
95 95
 $backtopage = GETPOST('backtopage', 'alpha');
96 96
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
97 97
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 $result = restrictedArea($user, 'fournisseur', $object, 'commande_fournisseur', 'commande', 'fk_soc', 'rowid', $isdraft);
155 155
 
156 156
 // Common permissions
157
-$usercanread	= ($user->hasRight("fournisseur", "commande", "lire") || $user->hasRight("supplier_order", "lire"));
157
+$usercanread = ($user->hasRight("fournisseur", "commande", "lire") || $user->hasRight("supplier_order", "lire"));
158 158
 $usercancreate	= ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer"));
159 159
 $usercandelete	= (($user->hasRight("fournisseur", "commande", "supprimer") || $user->hasRight("supplier_order", "supprimer")) || ($usercancreate && isset($object->status) && $object->status == $object::STATUS_DRAFT));
160 160
 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 $usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_order_advance", "validate")));
163 163
 
164 164
 // Additional area permissions
165
-$usercanapprove			= $user->hasRight("fournisseur", "commande", "approuver");
166
-$usercanapprovesecond	= $user->hasRight("fournisseur", "commande", "approve2");
167
-$usercanorder			= $user->hasRight("fournisseur", "commande", "commander");
165
+$usercanapprove = $user->hasRight("fournisseur", "commande", "approuver");
166
+$usercanapprovesecond = $user->hasRight("fournisseur", "commande", "approve2");
167
+$usercanorder = $user->hasRight("fournisseur", "commande", "commander");
168 168
 if (!isModEnabled('reception')) {
169 169
 	$usercanreceive = $user->hasRight("fournisseur", "commande", "receptionner");
170 170
 } else {
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 
174 174
 // Permissions for includes
175 175
 $permissionnote		= $usercancreate; // Used by the include of actions_setnotes.inc.php
176
-$permissiondellink	= $usercancreate; // Used by the include of actions_dellink.inc.php
177
-$permissiontoedit	= $usercancreate; // Used by the include of actions_lineupdown.inc.php
176
+$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
177
+$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php
178 178
 $permissiontoadd	= $usercancreate; // Used by the include of actions_addupdatedelete.inc.php
179 179
 $permissiontoeditextra = $permissiontoadd;
180 180
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 			$idprod = GETPOSTINT('idprod');
434 434
 		}
435 435
 
436
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
436
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
437 437
 
438 438
 		$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
439 439
 		$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'), 'CU', 2);
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 				// Get vat rate
563 563
 				$tva_npr = 0;
564 564
 				if (!GETPOSTISSET('tva_tx')) {	// If vat rate not provided from the form (the form has the priority)
565
-					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha');	// can be an id of price, or -1, -2, -99 or 'idprod_...'
565
+					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...'
566 566
 					if (is_numeric($tmpidprodfournprice) && (int) $tmpidprodfournprice > 0) {
567 567
 						$tmpidprodfournprice = (int) $tmpidprodfournprice;
568 568
 					} else {
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 			$result = $object->delete($user);
1164 1164
 			if ($result > 0) {
1165 1165
 				$db->commit();
1166
-				header("Location: " . DOL_URL_ROOT . '/fourn/commande/list.php?restore_lastsearch_values=1');
1166
+				header("Location: ".DOL_URL_ROOT.'/fourn/commande/list.php?restore_lastsearch_values=1');
1167 1167
 				exit;
1168 1168
 			} else {
1169 1169
 				$db->rollback();
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
 
1259 1259
 
1260 1260
 	if ($action == 'update_extras' && $permissiontoeditextra) {
1261
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
1261
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
1262 1262
 
1263 1263
 		$attribute_name = GETPOST('attribute', 'aZ09');
1264 1264
 
@@ -1664,12 +1664,12 @@  discard block
 block discarded – undo
1664 1664
 			$cond_reglement_id	= (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
1665 1665
 			$mode_reglement_id	= (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
1666 1666
 			$fk_account         = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
1667
-			$availability_id	= (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0));
1667
+			$availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0));
1668 1668
 			$shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0));
1669 1669
 			$demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0));
1670 1670
 			//$remise_percent		= (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0));
1671 1671
 			//$remise_absolue		= (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
1672
-			$dateinvoice		= getDolGlobalString('MAIN_AUTOFILL_DATE') ? '' : -1;
1672
+			$dateinvoice = getDolGlobalString('MAIN_AUTOFILL_DATE') ? '' : -1;
1673 1673
 
1674 1674
 			$datelivraison = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '');
1675 1675
 
@@ -1714,7 +1714,7 @@  discard block
 block discarded – undo
1714 1714
 	print '<input type="hidden" name="remise_percent" value="'.(empty($soc->remise_supplier_percent) ? '' : $soc->remise_supplier_percent).'">';
1715 1715
 	print '<input type="hidden" name="origin" value="'.$origin.'">';
1716 1716
 	print '<input type="hidden" name="originid" value="'.$originid.'">';
1717
-	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
1717
+	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
1718 1718
 	if ($backtopage) {
1719 1719
 		print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
1720 1720
 	}
@@ -1787,7 +1787,7 @@  discard block
 block discarded – undo
1787 1787
 		// Payment term
1788 1788
 		print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
1789 1789
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
1790
-		print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') &&  GETPOST('cond_reglement_id') != 0) ? GETPOSTINT('cond_reglement_id') : $cond_reglement_id, 'cond_reglement_id', -1, 1);
1790
+		print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOSTINT('cond_reglement_id') : $cond_reglement_id, 'cond_reglement_id', -1, 1);
1791 1791
 		print '</td></tr>';
1792 1792
 
1793 1793
 		// Payment mode
@@ -2086,7 +2086,7 @@  discard block
 block discarded – undo
2086 2086
 				'morecss' => 'minwidth300'
2087 2087
 			)
2088 2088
 		);
2089
-		$formconfirm  = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1);
2089
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1);
2090 2090
 	}
2091 2091
 
2092 2092
 	// Confirmation of cancellation
@@ -2155,7 +2155,7 @@  discard block
 block discarded – undo
2155 2155
 	$morehtmlref = '<div class="refidno">';
2156 2156
 	// Ref supplier
2157 2157
 	$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, (int) $usercancreate, 'string', '', 0, 1);
2158
-	$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2158
+	$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2159 2159
 	// Thirdparty
2160 2160
 	$morehtmlref .= '<br>';
2161 2161
 	if (getDolGlobalString('MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER') && !empty($usercancreate) && $action == 'edit_thirdparty') {
@@ -2420,40 +2420,40 @@  discard block
 block discarded – undo
2420 2420
 
2421 2421
 		print '<tr>';
2422 2422
 		// Amount HT
2423
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2424
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2423
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2424
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2425 2425
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2426 2426
 			// Multicurrency Amount HT
2427
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2427
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2428 2428
 		}
2429 2429
 		print '</tr>';
2430 2430
 
2431 2431
 		print '<tr>';
2432 2432
 		// Amount VAT
2433
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
2434
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2433
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
2434
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2435 2435
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2436 2436
 			// Multicurrency Amount VAT
2437
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2437
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2438 2438
 		}
2439 2439
 		print '</tr>';
2440 2440
 
2441 2441
 		// Amount Local Taxes
2442 2442
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2443 2443
 			print '<tr>';
2444
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2445
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2444
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2445
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2446 2446
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2447
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2447
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2448 2448
 			}
2449 2449
 			print '</tr>';
2450 2450
 
2451 2451
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2452 2452
 				print '<tr>';
2453
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2454
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2453
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2454
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2455 2455
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2456
-					print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2456
+					print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2457 2457
 				}
2458 2458
 				print '</tr>';
2459 2459
 			}
@@ -2461,16 +2461,16 @@  discard block
 block discarded – undo
2461 2461
 
2462 2462
 		$alert = '';
2463 2463
 		if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->supplier_order_min_amount) {
2464
-			$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->supplier_order_min_amount));
2464
+			$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount));
2465 2465
 		}
2466 2466
 
2467 2467
 		print '<tr>';
2468 2468
 		// Amount TTC
2469
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
2470
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . $alert . '</td>';
2469
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
2470
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).$alert.'</td>';
2471 2471
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2472 2472
 			// Multicurrency Amount TTC
2473
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2473
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2474 2474
 		}
2475 2475
 		print '</tr>';
2476 2476
 
Please login to merge, or discard this patch.