Completed
Branch develop (544b14)
by
unknown
25:55
created
htdocs/projet/class/api_projects.class.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 
23 23
 use Luracast\Restler\RestException;
24 24
 
25
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
26
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
25
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
26
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
27 27
 
28 28
 /**
29 29
  * API class for projects
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		}
86 86
 
87 87
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
88
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
88
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
89 89
 		}
90 90
 
91 91
 		$this->project->fetchObjectLinked();
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		}
117 117
 
118 118
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
119
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
119
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
120 120
 		}
121 121
 
122 122
 		$this->project->fetchObjectLinked();
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		}
148 148
 
149 149
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
150
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
150
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
151 151
 		}
152 152
 
153 153
 		$this->project->fetchObjectLinked();
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		}
179 179
 
180 180
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
181
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
181
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
182 182
 		}
183 183
 
184 184
 		$this->project->fetchObjectLinked();
@@ -221,34 +221,34 @@  discard block
 block discarded – undo
221 221
 		}
222 222
 
223 223
 		$sql = "SELECT t.rowid";
224
-		$sql .= " FROM " . MAIN_DB_PREFIX . "projet as t";
225
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe AS s ON (s.rowid = t.fk_soc)";
226
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_extrafields AS ef ON ef.fk_object = t.rowid";	// So we will be able to filter on extrafields
224
+		$sql .= " FROM ".MAIN_DB_PREFIX."projet as t";
225
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe AS s ON (s.rowid = t.fk_soc)";
226
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields
227 227
 		if ($category > 0) {
228
-			$sql .= ", " . MAIN_DB_PREFIX . "categorie_project as c";
228
+			$sql .= ", ".MAIN_DB_PREFIX."categorie_project as c";
229 229
 		}
230
-		$sql .= ' WHERE t.entity IN (' . getEntity('project') . ')';
230
+		$sql .= ' WHERE t.entity IN ('.getEntity('project').')';
231 231
 		if ($socids) {
232
-			$sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socids) . ")";
232
+			$sql .= " AND t.fk_soc IN (".$this->db->sanitize($socids).")";
233 233
 		}
234 234
 		// Search on sale representative
235 235
 		if ($search_sale && $search_sale != '-1') {
236 236
 			if ($search_sale == -2) {
237
-				$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc)";
237
+				$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc)";
238 238
 			} elseif ($search_sale > 0) {
239
-				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
239
+				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
240 240
 			}
241 241
 		}
242 242
 		// Select projects of given category
243 243
 		if ($category > 0) {
244
-			$sql .= " AND c.fk_categorie = " . ((int) $category) . " AND c.fk_project = t.rowid ";
244
+			$sql .= " AND c.fk_categorie = ".((int) $category)." AND c.fk_project = t.rowid ";
245 245
 		}
246 246
 		// Add sql filters
247 247
 		if ($sqlfilters) {
248 248
 			$errormessage = '';
249 249
 			$sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage);
250 250
 			if ($errormessage) {
251
-				throw new RestException(400, 'Error when validating parameter sqlfilters -> ' . $errormessage);
251
+				throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
252 252
 			}
253 253
 		}
254 254
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 				$i++;
282 282
 			}
283 283
 		} else {
284
-			throw new RestException(503, 'Error when retrieve project list : ' . $this->db->lasterror());
284
+			throw new RestException(503, 'Error when retrieve project list : '.$this->db->lasterror());
285 285
 		}
286 286
 
287 287
 		//if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit)
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 
350 350
 			$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
351 351
 			foreach ($dirmodels as $reldir) {
352
-				$file = dol_buildpath($reldir . "core/modules/project/" . $modele . '.php', 0);
352
+				$file = dol_buildpath($reldir."core/modules/project/".$modele.'.php', 0);
353 353
 				if (file_exists($file)) {
354 354
 					$filefound = 1;
355 355
 					$classname = $modele;
@@ -357,16 +357,16 @@  discard block
 block discarded – undo
357 357
 				}
358 358
 			}
359 359
 			if ($filefound && !empty($classname)) {
360
-				$result = dol_include_once($reldir . "core/modules/project/" . $modele . '.php');
360
+				$result = dol_include_once($reldir."core/modules/project/".$modele.'.php');
361 361
 				if ($result !== false && class_exists($classname)) {
362 362
 					$modProject = new $classname();
363 363
 					'@phan-var-force ModeleNumRefProjects $modProject';
364 364
 					$defaultref = $modProject->getNextValue(null, $this->project);
365 365
 				} else {
366
-					dol_syslog("Failed to include module file or invalid classname: " . $reldir . "core/modules/project/" . $modele . '.php', LOG_ERR);
366
+					dol_syslog("Failed to include module file or invalid classname: ".$reldir."core/modules/project/".$modele.'.php', LOG_ERR);
367 367
 				}
368 368
 			} else {
369
-				dol_syslog("Module file not found or classname is empty: " . $modele, LOG_ERR);
369
+				dol_syslog("Module file not found or classname is empty: ".$modele, LOG_ERR);
370 370
 			}
371 371
 
372 372
 			if (is_numeric($defaultref) && $defaultref <= 0) {
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 			}
375 375
 
376 376
 			if (empty($defaultref)) {
377
-				$defaultref = 'PJ' . dol_print_date(dol_now(), 'dayrfc');
377
+				$defaultref = 'PJ'.dol_print_date(dol_now(), 'dayrfc');
378 378
 			}
379 379
 
380 380
 			$this->project->ref = $defaultref;
@@ -417,12 +417,12 @@  discard block
 block discarded – undo
417 417
 		}
418 418
 
419 419
 		if (!DolibarrApi::_checkAccessToResource('ficheinter', $this->project->id)) {
420
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
420
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
421 421
 		}
422 422
 
423 423
 		$result = $this->project->add_contact($fk_socpeople, $type_contact, $source, $notrigger);
424 424
 		if ($result < 0) {
425
-			throw new RestException(500, 'Error : ' . $this->project->error);
425
+			throw new RestException(500, 'Error : '.$this->project->error);
426 426
 		}
427 427
 
428 428
 		return $this->_cleanObjectDatas($this->project);
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		}
456 456
 
457 457
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
458
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
458
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
459 459
 		}
460 460
 		foreach (array('internal', 'external') as $source) {
461 461
 			$contacts = $this->project->liste_contact(-1, $source);
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 		}
496 496
 
497 497
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
498
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
498
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
499 499
 		}
500 500
 		$this->project->getLinesArray(DolibarrApiAccess::$user);
501 501
 		$result = array();
@@ -535,10 +535,10 @@  discard block
 block discarded – undo
535 535
 		}
536 536
 
537 537
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
538
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
538
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
539 539
 		}
540 540
 
541
-		require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
541
+		require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
542 542
 		$taskstatic = new Task($this->db);
543 543
 		$userp = DolibarrApiAccess::$user;
544 544
 		if ($userid > 0) {
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 		}
714 714
 
715 715
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
716
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
716
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
717 717
 		}
718 718
 		foreach ($request_data as $field => $value) {
719 719
 			if ($field == 'id') {
@@ -761,11 +761,11 @@  discard block
 block discarded – undo
761 761
 		}
762 762
 
763 763
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
764
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
764
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
765 765
 		}
766 766
 
767 767
 		if (!$this->project->delete(DolibarrApiAccess::$user)) {
768
-			throw new RestException(500, 'Error when delete project : ' . $this->project->error);
768
+			throw new RestException(500, 'Error when delete project : '.$this->project->error);
769 769
 		}
770 770
 
771 771
 		return array(
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 		}
810 810
 
811 811
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
812
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
812
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
813 813
 		}
814 814
 
815 815
 		$result = $this->project->setValid(DolibarrApiAccess::$user, $notrigger);
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 			throw new RestException(304, 'Error nothing done. May be object is already validated');
818 818
 		}
819 819
 		if ($result < 0) {
820
-			throw new RestException(500, 'Error when validating Project: ' . $this->project->error);
820
+			throw new RestException(500, 'Error when validating Project: '.$this->project->error);
821 821
 		}
822 822
 
823 823
 		return array(
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
 		}
1045 1045
 
1046 1046
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
1047
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
1047
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
1048 1048
 		}
1049 1049
 
1050 1050
 		$contacts = $this->project->liste_contact(-1, 'external', 0, $type);
@@ -1086,13 +1086,13 @@  discard block
 block discarded – undo
1086 1086
 		}
1087 1087
 
1088 1088
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
1089
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
1089
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
1090 1090
 		}
1091 1091
 
1092 1092
 		// Ajouter le contact au projet
1093 1093
 		$result = $this->project->add_contact($fk_socpeople, $type_contact, $source, $notrigger);
1094 1094
 		if ($result <= 0) {
1095
-			throw new RestException(500, 'Error : ' . $this->project->error . 'result :' . $result);
1095
+			throw new RestException(500, 'Error : '.$this->project->error.'result :'.$result);
1096 1096
 		}
1097 1097
 
1098 1098
 		// Si demandé, ajouter le contact aux tâches
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
 		}
1142 1142
 
1143 1143
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
1144
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
1144
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
1145 1145
 		}
1146 1146
 
1147 1147
 		foreach (array('internal', 'external') as $source) {
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 		}
1184 1184
 
1185 1185
 		if (!DolibarrApi::_checkAccessToResource('project', $this->project->id)) {
1186
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
1186
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
1187 1187
 		}
1188 1188
 
1189 1189
 
Please login to merge, or discard this patch.
htdocs/projet/class/api_tasks.class.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 
22 22
 use Luracast\Restler\RestException;
23 23
 
24
-require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
25
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
24
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
25
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
26 26
 
27 27
 
28 28
 /**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		}
81 81
 
82 82
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
83
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
83
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
84 84
 		}
85 85
 
86 86
 		if ($includetimespent == 1) {
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
 		}
131 131
 
132 132
 		$sql = "SELECT t.rowid";
133
-		$sql .= " FROM " . MAIN_DB_PREFIX . "projet_task AS t";
134
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_task_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
135
-		$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "projet AS p ON p.rowid = t.fk_projet";
136
-		$sql .= ' WHERE t.entity IN (' . getEntity('project') . ')';
133
+		$sql .= " FROM ".MAIN_DB_PREFIX."projet_task AS t";
134
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
135
+		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."projet AS p ON p.rowid = t.fk_projet";
136
+		$sql .= ' WHERE t.entity IN ('.getEntity('project').')';
137 137
 		if ($socids) {
138
-			$sql .= " AND t.fk_soc IN (" . $this->db->sanitize((string) $socids) . ")";
138
+			$sql .= " AND t.fk_soc IN (".$this->db->sanitize((string) $socids).")";
139 139
 		}
140 140
 		// Search on sale representative
141 141
 		if ($search_sale && $search_sale != '-1') {
142 142
 			if ($search_sale == -2) {
143
-				$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
143
+				$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
144 144
 			} elseif ($search_sale > 0) {
145
-				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")";
145
+				$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
146 146
 			}
147 147
 		}
148 148
 		// Add sql filters
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			$errormessage = '';
151 151
 			$sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage);
152 152
 			if ($errormessage) {
153
-				throw new RestException(400, 'Error when validating parameter sqlfilters -> ' . $errormessage);
153
+				throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
154 154
 			}
155 155
 		}
156 156
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				$i++;
181 181
 			}
182 182
 		} else {
183
-			throw new RestException(503, 'Error when retrieve task list : ' . $this->db->lasterror());
183
+			throw new RestException(503, 'Error when retrieve task list : '.$this->db->lasterror());
184 184
 		}
185 185
 
186 186
 		return $obj_ret;
@@ -239,16 +239,16 @@  discard block
 block discarded – undo
239 239
 				}
240 240
 			}
241 241
 			if ($filefound && !empty($classname)) {
242
-				$result = dol_include_once($reldir . "core/modules/project/task/" . $modele . '.php');
242
+				$result = dol_include_once($reldir."core/modules/project/task/".$modele.'.php');
243 243
 				if ($result !== false && class_exists($classname)) {
244 244
 					$modTask = new $classname();
245 245
 					'@phan-var-force ModeleNumRefTask $modTask';
246 246
 					$defaultref = $modTask->getNextValue(null, $this->task);
247 247
 				} else {
248
-					dol_syslog("Failed to include module file or invalid classname: " . $reldir . "core/modules/project/task/" . $modele . '.php', LOG_ERR);
248
+					dol_syslog("Failed to include module file or invalid classname: ".$reldir."core/modules/project/task/".$modele.'.php', LOG_ERR);
249 249
 				}
250 250
 			} else {
251
-				dol_syslog("Module file not found or classname is empty: " . $modele, LOG_ERR);
251
+				dol_syslog("Module file not found or classname is empty: ".$modele, LOG_ERR);
252 252
 			}
253 253
 
254 254
 			if (is_numeric($defaultref) && $defaultref <= 0) {
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 			}
257 257
 
258 258
 			if (empty($defaultref)) {
259
-				$defaultref = 'TK' . dol_print_date(dol_now(), 'dayrfc');
259
+				$defaultref = 'TK'.dol_print_date(dol_now(), 'dayrfc');
260 260
 			}
261 261
 
262 262
 			$this->task->ref = $defaultref;
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		}
290 290
 
291 291
 		if (!DolibarrApi::_checkAccessToResource('tasks', $this->task->id)) {
292
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
292
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
293 293
 		}
294 294
 		$this->task->fetchTimeSpentOnTask();
295 295
 		$result = array();
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 		}
325 325
 
326 326
 		if (!DolibarrApi::_checkAccessToResource('tasks', $this->task->id)) {
327
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
327
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
328 328
 		}
329 329
 
330 330
 		$usert = DolibarrApiAccess::$user;
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 		}
498 498
 
499 499
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
500
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
500
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
501 501
 		}
502 502
 		foreach ($request_data as $field => $value) {
503 503
 			if ($field == 'id') {
@@ -546,11 +546,11 @@  discard block
 block discarded – undo
546 546
 		}
547 547
 
548 548
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
549
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
549
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
550 550
 		}
551 551
 
552 552
 		if ($this->task->delete(DolibarrApiAccess::$user) <= 0) {
553
-			throw new RestException(500, 'Error when delete task : ' . $this->task->error);
553
+			throw new RestException(500, 'Error when delete task : '.$this->task->error);
554 554
 		}
555 555
 
556 556
 		return array(
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 		}
594 594
 
595 595
 		if (!DolibarrApi::_checkAccessToResource('project', $this->task->fk_project)) {
596
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
596
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
597 597
 		}
598 598
 
599 599
 		$uid = $user_id;
@@ -609,14 +609,14 @@  discard block
 block discarded – undo
609 609
 		$this->task->timespent_fk_user  = $uid;
610 610
 		$this->task->timespent_note     = $note;
611 611
 		if (!empty($this->task->progress))
612
-			$this->task->progress  		= $progress;
612
+			$this->task->progress = $progress;
613 613
 
614 614
 		$result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0);
615 615
 		if ($result == 0) {
616 616
 			throw new RestException(304, 'Error nothing done. May be object is already validated');
617 617
 		}
618 618
 		if ($result < 0) {
619
-			throw new RestException(500, 'Error when adding time: ' . $this->task->error);
619
+			throw new RestException(500, 'Error when adding time: '.$this->task->error);
620 620
 		}
621 621
 
622 622
 		return array(
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 		$this->timespentRecordChecks($id, $timespent_id);
655 655
 
656 656
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
657
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
657
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
658 658
 		}
659 659
 
660 660
 		$newdate = dol_stringtotime($date, 1);
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 			throw new RestException(304, 'Error nothing done.');
671 671
 		}
672 672
 		if ($result < 0) {
673
-			throw new RestException(500, 'Error when updating time spent: ' . $this->task->error);
673
+			throw new RestException(500, 'Error when updating time spent: '.$this->task->error);
674 674
 		}
675 675
 
676 676
 		return array(
@@ -701,11 +701,11 @@  discard block
 block discarded – undo
701 701
 		$this->timespentRecordChecks($id, $timespent_id);
702 702
 
703 703
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
704
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
704
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
705 705
 		}
706 706
 
707 707
 		if ($this->task->delTimeSpent(DolibarrApiAccess::$user, 0) < 0) {
708
-			throw new RestException(500, 'Error when deleting time spent: ' . $this->task->error);
708
+			throw new RestException(500, 'Error when deleting time spent: '.$this->task->error);
709 709
 		}
710 710
 
711 711
 		return array(
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 		}
839 839
 
840 840
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
841
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
841
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
842 842
 		}
843 843
 
844 844
 		$contacts = $this->task->liste_contact(-1, 'external', 0, $type);
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 
847 847
 		$contacts = array_merge($contacts, $socpeoples);
848 848
 
849
-		return $contacts;	// Return array
849
+		return $contacts; // Return array
850 850
 	}
851 851
 
852 852
 	/**
@@ -879,12 +879,12 @@  discard block
 block discarded – undo
879 879
 		}
880 880
 
881 881
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
882
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
882
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
883 883
 		}
884 884
 
885 885
 		$result = $this->task->add_contact($fk_socpeople, $type_contact, $source, $notrigger);
886 886
 		if ($result <= 0) {
887
-			throw new RestException(500, 'Error : ' . $this->task->error);
887
+			throw new RestException(500, 'Error : '.$this->task->error);
888 888
 		}
889 889
 
890 890
 		$result = $this->task->fetch($id);
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
 		}
923 923
 
924 924
 		if (!DolibarrApi::_checkAccessToResource('task', $this->task->id)) {
925
-			throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
925
+			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
926 926
 		}
927 927
 
928 928
 		foreach (array('internal', 'external') as $source) {
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 }
92 92
 
93 93
 // General $Variables
94
-$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid'));    // For backward compatibility
94
+$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
95 95
 $ref = GETPOST('ref', 'alpha');
96 96
 $socid = GETPOSTINT('socid');
97 97
 $action = GETPOST('action', 'aZ09');
98 98
 $confirm = GETPOST('confirm', 'alpha');
99 99
 $cancel = GETPOST('cancel', 'alpha');
100
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
101
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
100
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
101
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
102 102
 $lineid = GETPOSTINT('lineid');
103 103
 $userid = GETPOSTINT('userid');
104 104
 $search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 					setEventMessages('', $warningMsgLineList, 'warnings');
275 275
 				}
276 276
 
277
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
277
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result);
278 278
 				exit();
279 279
 			} else {
280 280
 				$langs->load("errors");
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 		// Validation
400 400
 		$object->fetch($id);
401 401
 
402
-		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) &&	// empty should not happened, but when it occurs, the test save life
402
+		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life
403 403
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')								// If option enabled, we force invoice date
404 404
 		) {
405 405
 			$object->date = dol_now();
@@ -841,8 +841,8 @@  discard block
 block discarded – undo
841 841
 			// We check if invoice has payments
842 842
 			$totalpaid = 0;
843 843
 			$sql = 'SELECT pf.amount';
844
-			$sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiement_facture as pf';
845
-			$sql .= ' WHERE pf.fk_facture = ' . ((int) $object->id);
844
+			$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
845
+			$sql .= ' WHERE pf.fk_facture = '.((int) $object->id);
846 846
 
847 847
 			$result = $db->query($sql);
848 848
 			if ($result) {
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 					$tempTva->datev = $object->date;
919 919
 					$tempTva->datep = $object->date;
920 920
 					$tempTva->amount = $amount;
921
-					$tempTva->label = $langs->trans('WithholdingTax') . ' - ' . $object->ref;
921
+					$tempTva->label = $langs->trans('WithholdingTax').' - '.$object->ref;
922 922
 					//$tempTva->paye = 1;
923 923
 					$valid = $tempTva->getIdForLabel($tempTva->label);
924 924
 					if (!$valid) {
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 				if ($result < 0) {
947 947
 					setEventMessages($object->error, $object->errors, 'errors');
948 948
 				} else {
949
-					$object->fetch($object->id);	// Reload properties
949
+					$object->fetch($object->id); // Reload properties
950 950
 				}
951 951
 			}
952 952
 		} else {
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
 			if ($result < 0) {
963 963
 				setEventMessages($object->error, $object->errors, 'errors');
964 964
 			} else {
965
-				$object->fetch($object->id);	// Reload properties
965
+				$object->fetch($object->id); // Reload properties
966 966
 			}
967 967
 		} else {
968 968
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 					// Set invoice as paid
1164 1164
 					$result = $object->setPaid($user);
1165 1165
 					if ($result >= 0) {
1166
-						$object->fetch($object->id);	// Reload properties
1166
+						$object->fetch($object->id); // Reload properties
1167 1167
 						$db->commit();
1168 1168
 					} else {
1169 1169
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1214,7 +1214,7 @@  discard block
 block discarded – undo
1214 1214
 			$error++;
1215 1215
 		}
1216 1216
 
1217
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1217
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1218 1218
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
1219 1219
 
1220 1220
 		// Replacement invoice
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1247 1247
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1248 1248
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1249
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1249
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1250 1250
 				$object->fk_project			= GETPOSTINT('projectid');
1251 1251
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1252 1252
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
@@ -1307,9 +1307,9 @@  discard block
 block discarded – undo
1307 1307
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1308 1308
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1309 1309
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1310
-				$object->model_pdf          = GETPOST('model');
1310
+				$object->model_pdf = GETPOST('model');
1311 1311
 				$object->fk_project			= GETPOSTINT('projectid');
1312
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1312
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1313 1313
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1314 1314
 				$object->fk_account         = GETPOSTINT('fk_account');
1315 1315
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1637 1637
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1638 1638
 				$object->ref_client			= GETPOST('ref_client');
1639
-				$object->ref_customer		= GETPOST('ref_client');
1639
+				$object->ref_customer = GETPOST('ref_client');
1640 1640
 				$object->model_pdf          = GETPOST('model');
1641 1641
 				$object->fk_project			= GETPOSTINT('projectid');
1642 1642
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1700,7 +1700,7 @@  discard block
 block discarded – undo
1700 1700
 						$element = $subelement = 'expedition';
1701 1701
 					}
1702 1702
 
1703
-					$object->origin = $origin;		// deprecated
1703
+					$object->origin = $origin; // deprecated
1704 1704
 					$object->origin_type = $origin;
1705 1705
 					$object->origin_id = $originid;
1706 1706
 
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
 						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines");
1736 1736
 						$result = $srcobject->fetch($object->origin_id);
1737 1737
 
1738
-						$i = -1;  // Ensure initialised for static analysis, but with invalid idx.
1738
+						$i = -1; // Ensure initialised for static analysis, but with invalid idx.
1739 1739
 						// If deposit invoice - down payment with 1 line (fixed amount or percent)
1740 1740
 						if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) {
1741 1741
 							// Define the array $amountdeposit
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
 				if (!empty($origin) && !empty($originid)) {
2161 2161
 					include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
2162 2162
 
2163
-					$object->origin = $origin;		// deprecated
2163
+					$object->origin = $origin; // deprecated
2164 2164
 					$object->origin_type = $origin;
2165 2165
 					$object->origin_id = $originid;
2166 2166
 
@@ -2186,7 +2186,7 @@  discard block
 block discarded – undo
2186 2186
 						$line->fk_prev_id = $line->id;
2187 2187
 						$line->fetch_optionals();
2188 2188
 						if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) {
2189
-							$line->situation_percent = 0;  // New situation percent must be 0 (No cumulative)
2189
+							$line->situation_percent = 0; // New situation percent must be 0 (No cumulative)
2190 2190
 						} else {
2191 2191
 							$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
2192 2192
 						}
@@ -2303,7 +2303,7 @@  discard block
 block discarded – undo
2303 2303
 		} else {
2304 2304
 			$db->rollback();
2305 2305
 			$action = 'create';
2306
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
2306
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
2307 2307
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
2308 2308
 			setEventMessages($object->error, $object->errors, 'errors');
2309 2309
 		}
@@ -2769,7 +2769,7 @@  discard block
 block discarded – undo
2769 2769
 			 */
2770 2770
 
2771 2771
 			// Margin
2772
-			$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
2772
+			$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
2773 2773
 			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
2774 2774
 
2775 2775
 
@@ -2905,7 +2905,7 @@  discard block
 block discarded – undo
2905 2905
 				if ($prod->price_min > $line->subprice) {
2906 2906
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
2907 2907
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
2908
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
2908
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
2909 2909
 				} else {
2910 2910
 					setEventMessages($prod->error, $prod->errors, 'errors');
2911 2911
 				}
@@ -3056,7 +3056,7 @@  discard block
 block discarded – undo
3056 3056
 		$localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty);
3057 3057
 
3058 3058
 		// Add buying price
3059
-		$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
3059
+		$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
3060 3060
 		$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value
3061 3061
 
3062 3062
 		// Prepare a price equivalent for minimum price check
@@ -3099,7 +3099,7 @@  discard block
 block discarded – undo
3099 3099
 		// Define special_code for special lines
3100 3100
 		$special_code = GETPOSTINT('special_code');
3101 3101
 		if ($special_code == 3) {
3102
-			$special_code = 0;	// Options should not exists on invoices
3102
+			$special_code = 0; // Options should not exists on invoices
3103 3103
 		}
3104 3104
 
3105 3105
 		$line = new FactureLigne($db);
@@ -3553,7 +3553,7 @@  discard block
 block discarded – undo
3553 3553
 
3554 3554
 
3555 3555
 	if ($action == 'update_extras' && $permissiontoeditextra) {
3556
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
3556
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
3557 3557
 
3558 3558
 		$attribute_name = GETPOST('attribute', 'aZ09');
3559 3559
 
@@ -3670,7 +3670,7 @@  discard block
 block discarded – undo
3670 3670
 	$fk_account = GETPOSTINT('fk_account');
3671 3671
 
3672 3672
 	// Load objectsrc
3673
-	$objectsrc = null;  // Initialise
3673
+	$objectsrc = null; // Initialise
3674 3674
 	//$remise_absolue = 0;
3675 3675
 	if (!empty($origin) && !empty($originid)) {
3676 3676
 		// Parse element/subelement (ex: project_task)
@@ -3681,7 +3681,7 @@  discard block
 block discarded – undo
3681 3681
 			$subelement = $regs[2];
3682 3682
 		}
3683 3683
 
3684
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
3684
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
3685 3685
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
3686 3686
 
3687 3687
 		if ($element == 'project') {
@@ -3761,8 +3761,8 @@  discard block
 block discarded – undo
3761 3761
 				$fk_account        = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
3762 3762
 
3763 3763
 				if (isModEnabled('multicurrency')) {
3764
-					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3765
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3764
+					$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3765
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3766 3766
 				}
3767 3767
 
3768 3768
 				// replicate input reason
@@ -3862,7 +3862,7 @@  discard block
 block discarded – undo
3862 3862
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3863 3863
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3864 3864
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3865
-	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
3865
+	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
3866 3866
 	if ($soc->id > 0) {
3867 3867
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3868 3868
 	}
@@ -4051,7 +4051,7 @@  discard block
 block discarded – undo
4051 4051
 			print $form->selectarray('typestandard', $arraylist, GETPOST('typestandard', 'aZ09'), 0, 0, 0, '', 1);
4052 4052
 			print '</td>';*/
4053 4053
 			if (!getDolGlobalInt('INVOICE_DEPOSIT_INVOICE_ONLY_SAME_LINES')) {
4054
-				print '<span class="opacitymedium marginleftonly">' . $langs->trans('PercentOfOriginalObject') . '</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="' . (GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%') . '"/>';
4054
+				print '<span class="opacitymedium marginleftonly">'.$langs->trans('PercentOfOriginalObject').'</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="'.(GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%').'"/>';
4055 4055
 			}
4056 4056
 		}
4057 4057
 		print '</div></div>'."\n";
@@ -4405,8 +4405,8 @@  discard block
 block discarded – undo
4405 4405
 		if ($socid > 0) {
4406 4406
 			print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">';
4407 4407
 
4408
-			$thirdparty = $soc;	// used by object_discounts.tpl.php
4409
-			$discount_type = 0;	// used by object_discounts.tpl.php
4408
+			$thirdparty = $soc; // used by object_discounts.tpl.php
4409
+			$discount_type = 0; // used by object_discounts.tpl.php
4410 4410
 			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
4411 4411
 
4412 4412
 			// loading object_discounts.tpl.php from module core/tpl if exists
@@ -4466,7 +4466,7 @@  discard block
 block discarded – undo
4466 4466
 			if (empty($retained_warranty)) {
4467 4467
 				if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value
4468 4468
 					// Facture->retained_warranty  (does not exist on Expedition)
4469
-					$retained_warranty = $objectsrc->retained_warranty;  // @phan-suppress-current-line PhanUndeclaredProperty
4469
+					$retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty
4470 4470
 				}
4471 4471
 			}
4472 4472
 			$retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT');
@@ -4975,7 +4975,7 @@  discard block
 block discarded – undo
4975 4975
 		$nbMandated = 0;
4976 4976
 		foreach ($object->lines as $line) {
4977 4977
 			$res = $line->fetch_product();
4978
-			if ($res  > 0) {
4978
+			if ($res > 0) {
4979 4979
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4980 4980
 					$nbMandated++;
4981 4981
 					break;
@@ -5218,7 +5218,7 @@  discard block
 block discarded – undo
5218 5218
 	}
5219 5219
 	// Ref customer
5220 5220
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string', '', 0, 1);
5221
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
5221
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
5222 5222
 	// Thirdparty
5223 5223
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
5224 5224
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -5350,7 +5350,7 @@  discard block
 block discarded – undo
5350 5350
 			print '</td><td class="valuefield fieldname_type">';
5351 5351
 			print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="formposinfo">';
5352 5352
 			print '<input type="hidden" name="action" value="setposinfo">';
5353
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
5353
+			print '<input type="hidden" name="token" value="'.newToken().'">';
5354 5354
 			if ($action == 'editposinfo') {
5355 5355
 				print '<input type="text" class="maxwidth150" name="posmodule" placeholder="'.$langs->trans("POSModule").'" value="'.$object->module_source.'"> ';
5356 5356
 				print '<input type="text" class="maxwidth100" name="posterminal" placeholder="'.$langs->trans("Terminal").'" value="'.$object->pos_source.'">';
@@ -5713,45 +5713,45 @@  discard block
 block discarded – undo
5713 5713
 		}
5714 5714
 		print '<tr>';
5715 5715
 		// Amount HT
5716
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
5717
-		print '<td class="nowraponall amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5716
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
5717
+		print '<td class="nowraponall amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5718 5718
 		if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
5719 5719
 			// Multicurrency Amount HT
5720
-			print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5720
+			print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5721 5721
 		}
5722 5722
 		print '</tr>';
5723 5723
 
5724 5724
 		print '<tr>';
5725 5725
 		// Amount VAT
5726
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
5727
-		print '<td class="nowraponall amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5726
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
5727
+		print '<td class="nowraponall amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5728 5728
 		if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
5729 5729
 			// Multicurrency Amount VAT
5730
-			print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5730
+			print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5731 5731
 		}
5732 5732
 		print '</tr>';
5733 5733
 
5734 5734
 		// Amount Local Taxes
5735 5735
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
5736 5736
 			print '<tr>';
5737
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
5738
-			print '<td class="nowraponall amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5737
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
5738
+			print '<td class="nowraponall amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5739 5739
 			if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
5740 5740
 				$object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
5741 5741
 
5742
-				print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5742
+				print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5743 5743
 			}
5744 5744
 			print '</tr>';
5745 5745
 		}
5746 5746
 
5747 5747
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
5748 5748
 			print '<tr>';
5749
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
5750
-			print '<td class="nowraponall amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5749
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
5750
+			print '<td class="nowraponall amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5751 5751
 			if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
5752 5752
 				$object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
5753 5753
 
5754
-				print '<td class="nowraponall amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5754
+				print '<td class="nowraponall amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5755 5755
 			}
5756 5756
 			print '</tr>';
5757 5757
 		}
@@ -5811,11 +5811,11 @@  discard block
 block discarded – undo
5811 5811
 
5812 5812
 		print '<tr>';
5813 5813
 		// Amount TTC
5814
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
5815
-		print '<td class="nowraponall amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5814
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
5815
+		print '<td class="nowraponall amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5816 5816
 		if (isModEnabled("multicurrency") && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
5817 5817
 			// Multicurrency Amount TTC
5818
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5818
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5819 5819
 		}
5820 5820
 		print '</tr>';
5821 5821
 
@@ -6109,7 +6109,7 @@  discard block
 block discarded – undo
6109 6109
 		if ($object->type != Facture::TYPE_CREDIT_NOTE) {
6110 6110
 			// Total already paid
6111 6111
 			print '<tr>';
6112
-			print '<td colspan="'.($nbcols+1).'" class="right">';
6112
+			print '<td colspan="'.($nbcols + 1).'" class="right">';
6113 6113
 			print '<span class="opacitymedium">';
6114 6114
 			if ($object->type != Facture::TYPE_DEPOSIT) {
6115 6115
 				print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
@@ -6191,7 +6191,7 @@  discard block
 block discarded – undo
6191 6191
 			// Partially paid or abandoned 'badcustomer'
6192 6192
 			if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') {
6193 6193
 				print '<tr>';
6194
-				print '<td colspan="'.($nbcols+1).'" class="nowrap right">';
6194
+				print '<td colspan="'.($nbcols + 1).'" class="nowrap right">';
6195 6195
 				print '<span class="opacitymedium">';
6196 6196
 				print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1);
6197 6197
 				print '</span>';
@@ -6206,7 +6206,7 @@  discard block
 block discarded – undo
6206 6206
 			// Partially paid or abandoned 'product_returned'
6207 6207
 			if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
6208 6208
 				print '<tr>';
6209
-				print '<td colspan="'.($nbcols+1).'" class="nowrap right">';
6209
+				print '<td colspan="'.($nbcols + 1).'" class="nowrap right">';
6210 6210
 				print '<span class="opacitymedium">';
6211 6211
 				print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1);
6212 6212
 				print '</span>';
@@ -6221,7 +6221,7 @@  discard block
 block discarded – undo
6221 6221
 			// Partially paid or abandoned 'abandoned'
6222 6222
 			if (($object->status == Facture::STATUS_CLOSED || $object->status == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') {
6223 6223
 				print '<tr>';
6224
-				print '<td colspan="'.($nbcols+1).'" class="nowrap right">';
6224
+				print '<td colspan="'.($nbcols + 1).'" class="nowrap right">';
6225 6225
 				$text = $langs->trans("HelpAbandonOther");
6226 6226
 				if ($object->close_note) {
6227 6227
 					$text .= '<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note;
@@ -6241,7 +6241,7 @@  discard block
 block discarded – undo
6241 6241
 
6242 6242
 			// Billed
6243 6243
 			print '<tr>';
6244
-			print '<td colspan="'.($nbcols+1).'" class="right">';
6244
+			print '<td colspan="'.($nbcols + 1).'" class="right">';
6245 6245
 			print '<span class="opacitymedium">';
6246 6246
 			print $langs->trans("Billed");
6247 6247
 			print '</td>';
@@ -6251,7 +6251,7 @@  discard block
 block discarded – undo
6251 6251
 
6252 6252
 			// Remainder to pay
6253 6253
 			print '<tr>';
6254
-			print '<td colspan="'.($nbcols+1).'" class="right">';
6254
+			print '<td colspan="'.($nbcols + 1).'" class="right">';
6255 6255
 			print '<span class="opacitymedium">';
6256 6256
 			print $langs->trans('RemainderToPay');
6257 6257
 			if ($resteapayeraffiche < 0) {
@@ -6266,7 +6266,7 @@  discard block
 block discarded – undo
6266 6266
 			// Remainder to pay Multicurrency
6267 6267
 			if (isModEnabled('multicurrency') && $object->multicurrency_code && ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1)) {
6268 6268
 				print '<tr>';
6269
-				print '<td colspan="'.($nbcols+1).'" class="right">';
6269
+				print '<td colspan="'.($nbcols + 1).'" class="right">';
6270 6270
 				print '<span class="opacitymedium">';
6271 6271
 				print $langs->trans('RemainderToPayMulticurrency');
6272 6272
 				if ($resteapayeraffiche < 0) {
@@ -6294,14 +6294,14 @@  discard block
 block discarded – undo
6294 6294
 				$billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty;
6295 6295
 
6296 6296
 				print '<tr>';
6297
-				print '<td colspan="'.($nbcols+1).'" class="right">'.$langs->trans("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')).' :</td>';
6297
+				print '<td colspan="'.($nbcols + 1).'" class="right">'.$langs->trans("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')).' :</td>';
6298 6298
 				//print '<td></td>';
6299 6299
 				print '<td class="right">'.price($billedWithRetainedWarranty).'</td>';
6300 6300
 				print '</tr>';
6301 6301
 
6302 6302
 				// retained warranty
6303 6303
 				print '<tr>';
6304
-				print '<td colspan="'.($nbcols+1).'" class="right">';
6304
+				print '<td colspan="'.($nbcols + 1).'" class="right">';
6305 6305
 				print $langs->trans("RetainedWarranty").' ('.$object->retained_warranty.'%)';
6306 6306
 				print !empty($object->retained_warranty_date_limit) ? ' '.$langs->trans("ToPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : '';
6307 6307
 				print '</td>';
@@ -6316,7 +6316,7 @@  discard block
 block discarded – undo
6316 6316
 
6317 6317
 			// Total already paid back
6318 6318
 			print '<tr>';
6319
-			print '<td colspan="'.($nbcols+1).'" class="right">';
6319
+			print '<td colspan="'.($nbcols + 1).'" class="right">';
6320 6320
 			print '<span class="opacitymedium">'.$langs->trans('AlreadyPaidBack').'</span>';
6321 6321
 			print '</td>';
6322 6322
 			//print '<td></td>';
@@ -6325,13 +6325,13 @@  discard block
 block discarded – undo
6325 6325
 
6326 6326
 			// Billed
6327 6327
 			print '<tr>';
6328
-			print '<td colspan="'.($nbcols+1).'" class="right"><span class="opacitymedium">'.$langs->trans("Billed").'</span></td>';
6328
+			print '<td colspan="'.($nbcols + 1).'" class="right"><span class="opacitymedium">'.$langs->trans("Billed").'</span></td>';
6329 6329
 			//print '<td></td>';
6330 6330
 			print '<td class="right">'.price($sign * $object->total_ttc).'</td>';
6331 6331
 			print '</tr>';
6332 6332
 
6333 6333
 			// Remainder to pay back
6334
-			print '<tr><td colspan="'.($nbcols+1).'" class="right">';
6334
+			print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
6335 6335
 			print '<span class="opacitymedium">'.$langs->trans('RemainderToPayBack');
6336 6336
 			if ($resteapayeraffiche > 0) {
6337 6337
 				print ' ('.$langs->trans('NegativeIfExcessRefunded').')';
@@ -6347,7 +6347,7 @@  discard block
 block discarded – undo
6347 6347
 			// Remainder to pay back Multicurrency
6348 6348
 			if (isModEnabled('multicurrency') && (($object->multicurrency_code && $object->multicurrency_code != $conf->currency) || $object->multicurrency_tx != 1)) {
6349 6349
 				print '<tr>';
6350
-				print '<td colspan="'.($nbcols+1).'" class="right">';
6350
+				print '<td colspan="'.($nbcols + 1).'" class="right">';
6351 6351
 				print '<span class="opacitymedium">'.$langs->trans('RemainderToPayBackMulticurrency');
6352 6352
 				if ($resteapayeraffiche > 0) {
6353 6353
 					print ' ('.$langs->trans('NegativeIfExcessRefunded').')';
@@ -6455,7 +6455,7 @@  discard block
 block discarded – undo
6455 6455
 			if (isModEnabled('subtotals')) {
6456 6456
 				include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
6457 6457
 			} else {
6458
-				include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
6458
+				include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
6459 6459
 			}
6460 6460
 		}
6461 6461
 
@@ -6518,10 +6518,10 @@  discard block
 block discarded – undo
6518 6518
 						if (!$objectidnext && $object->is_last_in_cycle()) {
6519 6519
 							if ($usercanunvalidate) {
6520 6520
 								unset($params['attr']['title']);
6521
-								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', true, $params);
6521
+								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', true, $params);
6522 6522
 							} else {
6523 6523
 								$params['attr']['title'] = $langs->trans('NotEnoughPermissions');
6524
-								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', false, $params);
6524
+								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', false, $params);
6525 6525
 							}
6526 6526
 						} elseif (!$object->is_last_in_cycle()) {
6527 6527
 							$params['attr']['title'] = $langs->trans('NotLastInCycle');
@@ -6562,7 +6562,7 @@  discard block
 block discarded – undo
6562 6562
 					$langs->load("contracts");
6563 6563
 
6564 6564
 					if ($usercancreatecontract) {
6565
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
6565
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
6566 6566
 					}
6567 6567
 				}
6568 6568
 			}
@@ -6812,7 +6812,7 @@  discard block
 block discarded – undo
6812 6812
 			if ($usercandelete || ($usercancreate && $isErasable == 1)) {	// isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
6813 6813
 				$enableDelete = false;
6814 6814
 				$deleteHref = '#';
6815
-				if ($isErasable > 0 && ! $objectidnext) {
6815
+				if ($isErasable > 0 && !$objectidnext) {
6816 6816
 					$deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken();
6817 6817
 					$enableDelete = true;
6818 6818
 				}
Please login to merge, or discard this patch.
htdocs/fourn/facture/card.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	// Action clone object
205 205
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
206 206
 		$objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid.
207
-		'@phan-var-force FactureFournisseur $objectutil';  // Same object type for cloned object
207
+		'@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object
208 208
 
209 209
 		if (GETPOST('newsupplierref', 'alphanohtml')) {
210 210
 			$objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml');
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 		$db->begin();
800 800
 
801 801
 		$error = 0;
802
-		$tmpproject = 0;  // Ensure a value
802
+		$tmpproject = 0; // Ensure a value
803 803
 
804 804
 		// Fill array 'array_options' with data from add form
805 805
 		$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 			$error++;
808 808
 		}
809 809
 
810
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
810
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
811 811
 		$datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver');
812 812
 		//var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
813 813
 		//var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour'));
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 				$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
847 847
 				$object->socid = GETPOSTINT('socid');
848 848
 				$object->label = GETPOST('label', 'alphanohtml');
849
-				$object->libelle = $object->label;	// deprecated
849
+				$object->libelle = $object->label; // deprecated
850 850
 				$object->date = $dateinvoice;
851 851
 				$object->date_echeance = $datedue;
852 852
 				$object->note_public = GETPOST('note_public', 'restricthtml');
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 				$object->subtype            = GETPOST('subtype', 'alphanohtml');
921 921
 				$object->socid				= GETPOSTINT('socid');
922 922
 				$object->label				= GETPOST('label', 'alphanohtml');
923
-				$object->libelle            = $object->label;  // Deprecated
923
+				$object->libelle            = $object->label; // Deprecated
924 924
 				$object->date               = $dateinvoice;
925 925
 				$object->date_echeance      = $datedue;
926 926
 				$object->note_public        = GETPOST('note_public', 'restricthtml');
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOSTINT('cond_reglement_id'));
1031 1031
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1032 1032
 				$object->fk_account         = GETPOSTINT('fk_account');
1033
-				$object->amount             = (float) price2num(GETPOST('amount'));  // FIXME: FactureFournisseur::$amount is deprecated and not used?
1033
+				$object->amount             = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used?
1034 1034
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
1035 1035
 				//$object->remise_percent		= price2num(GETPOST('remise_percent'), '', 2);
1036 1036
 				$object->fk_incoterms       = GETPOSTINT('incoterm_id');
@@ -1083,28 +1083,28 @@  discard block
 block discarded – undo
1083 1083
 				$tmpproject = GETPOSTINT('projectid');
1084 1084
 
1085 1085
 				// Creation invoice
1086
-				$object->socid				= GETPOSTINT('socid');
1087
-				$object->type				= GETPOST('type', 'alphanohtml');
1088
-				$object->subtype            = GETPOSTINT('subtype');
1089
-				$object->ref				= GETPOST('ref', 'alphanohtml');
1090
-				$object->ref_supplier		= GETPOST('ref_supplier', 'alphanohtml');
1086
+				$object->socid = GETPOSTINT('socid');
1087
+				$object->type = GETPOST('type', 'alphanohtml');
1088
+				$object->subtype = GETPOSTINT('subtype');
1089
+				$object->ref = GETPOST('ref', 'alphanohtml');
1090
+				$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1091 1091
 				$object->socid				= GETPOSTINT('socid');
1092 1092
 				$object->label				= GETPOST('label', 'alphanohtml');
1093
-				$object->libelle			= $object->label;	// deprecated
1094
-				$object->date				= $dateinvoice;
1095
-				$object->date_echeance		= $datedue;
1096
-				$object->note_public		= GETPOST('note_public', 'restricthtml');
1097
-				$object->note_private		= GETPOST('note_private', 'restricthtml');
1093
+				$object->libelle = $object->label; // deprecated
1094
+				$object->date = $dateinvoice;
1095
+				$object->date_echeance = $datedue;
1096
+				$object->note_public = GETPOST('note_public', 'restricthtml');
1097
+				$object->note_private = GETPOST('note_private', 'restricthtml');
1098 1098
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1099 1099
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1100 1100
 				$object->fk_account			= GETPOSTINT('fk_account');
1101 1101
 				$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1102 1102
 				$object->fk_project			= ($tmpproject > 0) ? $tmpproject : null;
1103
-				$object->fk_incoterms		= GETPOSTINT('incoterm_id');
1103
+				$object->fk_incoterms = GETPOSTINT('incoterm_id');
1104 1104
 				$object->location_incoterms	= GETPOST('location_incoterms', 'alpha');
1105 1105
 				$object->multicurrency_code	= GETPOST('multicurrency_code', 'alpha');
1106
-				$object->multicurrency_tx	= GETPOSTFLOAT('originmulticurrency_tx');
1107
-				$object->transport_mode_id	= GETPOSTINT('transport_mode_id');
1106
+				$object->multicurrency_tx = GETPOSTFLOAT('originmulticurrency_tx');
1107
+				$object->transport_mode_id = GETPOSTINT('transport_mode_id');
1108 1108
 
1109 1109
 				// Auto calculation of date due if not filled by user
1110 1110
 				if (empty($object->date_echeance)) {
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 									0,
1318 1318
 									$object->lines[0]->date_start,
1319 1319
 									$object->lines[0]->date_end,
1320
-									array(),  // array_options
1320
+									array(), // array_options
1321 1321
 									0,
1322 1322
 									0,
1323 1323
 									'',
@@ -1466,7 +1466,7 @@  discard block
 block discarded – undo
1466 1466
 		// Edit line
1467 1467
 		$db->begin();
1468 1468
 
1469
-		if (! $object->fetch($id) > 0) {
1469
+		if (!$object->fetch($id) > 0) {
1470 1470
 			dol_print_error($db);
1471 1471
 		}
1472 1472
 		$object->fetch_thirdparty();
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 			$price_ttc_devise = price2num(GETPOST('multicurrency_price_ttc'), 'CU', 2);
1638 1638
 		}
1639 1639
 
1640
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
1640
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1641 1641
 
1642 1642
 		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
1643 1643
 
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
 
1781 1781
 				// Get vat rate
1782 1782
 				if (!GETPOSTISSET('tva_tx')) {	// If vat rate not provided from the form (the form has the priority)
1783
-					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha');	// can be an id of price, or -1, -2, -99 or 'idprod_...'
1783
+					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...'
1784 1784
 					if (is_numeric($tmpidprodfournprice) && (int) $tmpidprodfournprice > 0) {
1785 1785
 						$tmpidprodfournprice = (int) $tmpidprodfournprice;
1786 1786
 					} else {
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
 		}
2063 2063
 	}
2064 2064
 	if ($action == 'update_extras' && $permissiontoeditextra) {
2065
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
2065
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
2066 2066
 
2067 2067
 		$attribute_name = GETPOST('attribute', 'aZ09');
2068 2068
 
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
 // Mode creation
2154 2154
 if ($action == 'create') {
2155 2155
 	$facturestatic = new FactureFournisseur($db);
2156
-	$selectedLines = array();  // Ensure initialised
2156
+	$selectedLines = array(); // Ensure initialised
2157 2157
 
2158 2158
 	print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice');
2159 2159
 
@@ -2171,7 +2171,7 @@  discard block
 block discarded – undo
2171 2171
 		}
2172 2172
 	}
2173 2173
 
2174
-	$objectsrc = null;  // Initialise
2174
+	$objectsrc = null; // Initialise
2175 2175
 	if (!empty($origin) && !empty($originid)) {
2176 2176
 		// Parse element/subelement (ex: project_task)
2177 2177
 		$element = $subelement = $origin;
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2351 2351
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2352 2352
 	print '<input type="hidden" name="action" value="add">';
2353
-	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
2353
+	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
2354 2354
 
2355 2355
 	if (!empty($societe->id) && $societe->id > 0) {
2356 2356
 		print '<input type="hidden" name="socid" value="'.$societe->id.'">'."\n";
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
 
2435 2435
 			$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2436 2436
 			$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r';
2437
-			$sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid;
2437
+			$sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid;
2438 2438
 
2439 2439
 			$resql = $db->query($sql);
2440 2440
 			if ($resql) {
@@ -2501,7 +2501,7 @@  discard block
 block discarded – undo
2501 2501
 			// Deposit - Down payment
2502 2502
 			if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) {
2503 2503
 				print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
2504
-				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
2504
+				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOSTINT('type') == 3 ? ' checked' : '').'> ';
2505 2505
 				print '<script type="text/javascript">
2506 2506
 				jQuery(document).ready(function() {
2507 2507
 					jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
@@ -2571,7 +2571,7 @@  discard block
 block discarded – undo
2571 2571
 					print $form->selectarray('typedeposit', $arraylist, $typedeposit, 0, 0, 0, '', 1);
2572 2572
 					print '</td>';
2573 2573
 					print '<td class="nowrap" style="padding-left: 5px">';
2574
-					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . $valuedeposit . '"/>';
2574
+					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.$valuedeposit.'"/>';
2575 2575
 					print '</td>';
2576 2576
 				}
2577 2577
 				print '</tr></table>';
@@ -2820,8 +2820,8 @@  discard block
 block discarded – undo
2820 2820
 
2821 2821
 		// Vat reverse-charge by default
2822 2822
 		if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2823
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2824
-			print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>';
2823
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2824
+			print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>';
2825 2825
 			// Try to propose to use VAT reverse charge even if the VAT reverse charge is not activated in the supplier card, if this corresponds to the context of use, the activation is proposed
2826 2826
 			if (GETPOSTISSET('vat_reverse_charge')) {  // Check if form was submitted previously
2827 2827
 				$vat_reverse_charge = (GETPOST('vat_reverse_charge', 'alpha') == 'on' || GETPOST('vat_reverse_charge', 'alpha') == '1') ? 1 : 0;
@@ -2831,7 +2831,7 @@  discard block
 block discarded – undo
2831 2831
 				$vat_reverse_charge = 0;
2832 2832
 			}
2833 2833
 
2834
-			print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>';
2834
+			print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>';
2835 2835
 			print '</td></tr>';
2836 2836
 		}
2837 2837
 
@@ -3401,7 +3401,7 @@  discard block
 block discarded – undo
3401 3401
 					$creditnote->fetch($invoiceid);
3402 3402
 					$invoicecredits[] = $creditnote->getNomUrl(1);
3403 3403
 				}
3404
-				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits);
3404
+				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits);
3405 3405
 				print '</span>';
3406 3406
 			}
3407 3407
 			if (isset($objectidnext) && $objectidnext > 0) {
@@ -3548,12 +3548,12 @@  discard block
 block discarded – undo
3548 3548
 					print '<input type="hidden" name="action" value="setvatreversecharge">';
3549 3549
 					print '<input type="hidden" name="token" value="'.newToken().'">';
3550 3550
 
3551
-					print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>';
3551
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>';
3552 3552
 
3553 3553
 					print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
3554 3554
 					print '</form>';
3555 3555
 				} else {
3556
-					print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>';
3556
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>';
3557 3557
 				}
3558 3558
 				print '</td></tr>';
3559 3559
 			}
@@ -3649,15 +3649,15 @@  discard block
 block discarded – undo
3649 3649
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3650 3650
 
3651 3651
 			print '<tr>';
3652
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3653
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3652
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3653
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3654 3654
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3655
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3655
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3656 3656
 			}
3657 3657
 			print '</tr>';
3658 3658
 
3659 3659
 			print '<tr>';
3660
-			print '<td>' . $langs->trans('AmountVAT') . '</td>';
3660
+			print '<td>'.$langs->trans('AmountVAT').'</td>';
3661 3661
 			print '<td class="nowrap amountcard right">';
3662 3662
 			if (GETPOST('calculationrule')) {
3663 3663
 				$calculationrule = GETPOST('calculationrule', 'alpha');
@@ -3671,40 +3671,40 @@  discard block
 block discarded – undo
3671 3671
 			}
3672 3672
 			// Show link for "recalculate"
3673 3673
 			if ($object->getVentilExportCompta() == 0) {
3674
-				$s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>';
3675
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>';
3674
+				$s = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("ReCalculate").' </span>';
3675
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
3676 3676
 				$s .= ' / ';
3677
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>';
3677
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
3678 3678
 				print '<div class="inline-block">';
3679
-				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3679
+				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3680 3680
 				print '&nbsp; &nbsp; &nbsp; &nbsp;';
3681 3681
 				print '</div>';
3682 3682
 			}
3683 3683
 			print '<span class="nowraponall">'.price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency).'</span>';
3684 3684
 			print '</td>';
3685 3685
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3686
-				print '<td class="nowraponall amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3686
+				print '<td class="nowraponall amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3687 3687
 			}
3688 3688
 			print '</tr>';
3689 3689
 
3690 3690
 			if ($societe->localtax1_assuj == "1") { //Localtax1
3691 3691
 				print '<tr>';
3692
-				print '<td>' . $langs->transcountry("AmountLT1", $societe->country_code) . '</td>';
3693
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3692
+				print '<td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>';
3693
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3694 3694
 				print '</tr>';
3695 3695
 			}
3696 3696
 			if ($societe->localtax2_assuj == "1") { //Localtax2
3697 3697
 				print '<tr>';
3698
-				print '<td>' . $langs->transcountry("AmountLT2", $societe->country_code) . '</td>';
3699
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3698
+				print '<td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>';
3699
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3700 3700
 				print '</tr>';
3701 3701
 			}
3702 3702
 
3703 3703
 			print '<tr>';
3704
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3705
-			print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3704
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3705
+			print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3706 3706
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3707
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3707
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3708 3708
 			}
3709 3709
 			print '</tr>';
3710 3710
 
@@ -3859,7 +3859,7 @@  discard block
 block discarded – undo
3859 3859
 
3860 3860
 			if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE) {
3861 3861
 				// Total already paid
3862
-				print '<tr><td colspan="'.($nbcols+1).'" class="right">';
3862
+				print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
3863 3863
 				print '<span class="opacitymedium">';
3864 3864
 				if ($object->type != FactureFournisseur::TYPE_DEPOSIT) {
3865 3865
 					print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
@@ -3925,7 +3925,7 @@  discard block
 block discarded – undo
3925 3925
 
3926 3926
 				// Pay partially 'escompte'
3927 3927
 				if (($object->status == FactureFournisseur::STATUS_CLOSED || $object->status == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
3928
-					print '<tr><td colspan="'.($nbcols+1).'" class="right nowrap">';
3928
+					print '<tr><td colspan="'.($nbcols + 1).'" class="right nowrap">';
3929 3929
 					print '<span class="opacitymedium">';
3930 3930
 					print $form->textwithpicto($langs->trans("Discount"), $langs->trans("HelpEscompte"), - 1);
3931 3931
 					print '</span>';
@@ -3938,7 +3938,7 @@  discard block
 block discarded – undo
3938 3938
 				}
3939 3939
 				// Paye partiellement ou Abandon 'badsupplier'
3940 3940
 				if (($object->status == FactureFournisseur::STATUS_CLOSED || $object->status == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'badsupplier') {
3941
-					print '<tr><td colspan="'.($nbcols+1).'" class="right nowrap">';
3941
+					print '<tr><td colspan="'.($nbcols + 1).'" class="right nowrap">';
3942 3942
 					print '<span class="opacitymedium">';
3943 3943
 					print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1);
3944 3944
 					print '</span>';
@@ -3951,7 +3951,7 @@  discard block
 block discarded – undo
3951 3951
 				}
3952 3952
 				// Paye partiellement ou Abandon 'product_returned'
3953 3953
 				if (($object->status == FactureFournisseur::STATUS_CLOSED || $object->status == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
3954
-					print '<tr><td colspan="'.($nbcols+1).'" class="right nowrap">';
3954
+					print '<tr><td colspan="'.($nbcols + 1).'" class="right nowrap">';
3955 3955
 					print '<span class="opacitymedium">';
3956 3956
 					print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1);
3957 3957
 					print '</span>';
@@ -3964,7 +3964,7 @@  discard block
 block discarded – undo
3964 3964
 				}
3965 3965
 				// Paye partiellement ou Abandon 'abandon'
3966 3966
 				if (($object->status == FactureFournisseur::STATUS_CLOSED || $object->status == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'abandon') {
3967
-					print '<tr><td colspan="'.($nbcols+1).'" class="right nowrap">';
3967
+					print '<tr><td colspan="'.($nbcols + 1).'" class="right nowrap">';
3968 3968
 					$text = $langs->trans("HelpAbandonOther");
3969 3969
 					if ($object->close_note) {
3970 3970
 						$text .= '<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note;
@@ -3982,7 +3982,7 @@  discard block
 block discarded – undo
3982 3982
 				}
3983 3983
 
3984 3984
 				// Billed
3985
-				print '<tr><td colspan="'.($nbcols+1).'" class="right">';
3985
+				print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
3986 3986
 				print '<span class="opacitymedium">';
3987 3987
 				print $langs->trans("Billed");
3988 3988
 				print '</span>';
@@ -3992,7 +3992,7 @@  discard block
 block discarded – undo
3992 3992
 				print '</tr>';
3993 3993
 
3994 3994
 				// Remainder to pay
3995
-				print '<tr><td colspan="'.($nbcols+1).'" class="right">';
3995
+				print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
3996 3996
 				print '<span class="opacitymedium">';
3997 3997
 				print $langs->trans('RemainderToPay');
3998 3998
 				if ($resteapayeraffiche < 0) {
@@ -4006,7 +4006,7 @@  discard block
 block discarded – undo
4006 4006
 
4007 4007
 				// Remainder to pay Multicurrency
4008 4008
 				if (isModEnabled('multicurrency') && (($object->multicurrency_code && $object->multicurrency_code != $conf->currency) || $object->multicurrency_tx != 1)) {
4009
-					print '<tr><td colspan="'.($nbcols+1).'" class="right">';
4009
+					print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
4010 4010
 					print '<span class="opacitymedium">';
4011 4011
 					print $langs->trans('RemainderToPayMulticurrency');
4012 4012
 					if ($resteapayeraffiche < 0) {
@@ -4022,7 +4022,7 @@  discard block
 block discarded – undo
4022 4022
 				$cssforamountpaymentcomplete = 'amountpaymentneutral';
4023 4023
 
4024 4024
 				// Total already paid back
4025
-				print '<tr><td colspan="'.($nbcols+1).'" class="right">';
4025
+				print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
4026 4026
 				print $langs->trans('AlreadyPaidBack');
4027 4027
 				print '</td>';
4028 4028
 				//print '<td></td>';
@@ -4030,13 +4030,13 @@  discard block
 block discarded – undo
4030 4030
 				print '</tr>';
4031 4031
 
4032 4032
 				// Billed
4033
-				print '<tr><td colspan="'.($nbcols+1).'" class="right">'.$langs->trans("Billed").'</td>';
4033
+				print '<tr><td colspan="'.($nbcols + 1).'" class="right">'.$langs->trans("Billed").'</td>';
4034 4034
 				//print '<td></td>';
4035 4035
 				print '<td class="right">'.price($sign * $object->total_ttc).'</td>';
4036 4036
 				print '</tr>';
4037 4037
 
4038 4038
 				// Remainder to pay back
4039
-				print '<tr><td colspan="'.($nbcols+1).'" class="right">';
4039
+				print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
4040 4040
 				print '<span class="opacitymedium">';
4041 4041
 				print $langs->trans('RemainderToPayBack');
4042 4042
 				if ($resteapayeraffiche > 0) {
@@ -4050,7 +4050,7 @@  discard block
 block discarded – undo
4050 4050
 
4051 4051
 				// Remainder to pay back Multicurrency
4052 4052
 				if (isModEnabled('multicurrency') && (($object->multicurrency_code && $object->multicurrency_code != $conf->currency) || $object->multicurrency_tx != 1)) {
4053
-					print '<tr><td colspan="'.($nbcols+1).'" class="right">';
4053
+					print '<tr><td colspan="'.($nbcols + 1).'" class="right">';
4054 4054
 					print '<span class="opacitymedium">';
4055 4055
 					print $langs->trans('RemainderToPayBackMulticurrency');
4056 4056
 					if ($resteapayeraffiche > 0) {
@@ -4288,7 +4288,7 @@  discard block
 block discarded – undo
4288 4288
 				}
4289 4289
 
4290 4290
 				// Clone as predefined / Create template
4291
-				if (($object->type ==  FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4291
+				if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4292 4292
 					if (!$objectidnext && count($object->lines) > 0) {
4293 4293
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
4294 4294
 					}
Please login to merge, or discard this patch.