Completed
Branch develop (5490af)
by
unknown
26:53
created
htdocs/categories/photos.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 $type = $object->type;
71 71
 if (is_numeric($type)) {
72
-	$type = array_search($type, $object->MAP_ID);	// For backward compatibility
72
+	$type = array_search($type, $object->MAP_ID); // For backward compatibility
73 73
 }
74 74
 
75 75
 $upload_dir = $conf->categorie->multidir_output[$object->entity ?? $conf->entity];
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
  * Actions
85 85
  */
86 86
 
87
-$parameters = array('id' => $id,  'label' => $label, 'confirm' => $confirm, 'type' => $type, 'uploaddir' => $upload_dir, 'sendfile' => (GETPOST("sendit") ? true : false));
87
+$parameters = array('id' => $id, 'label' => $label, 'confirm' => $confirm, 'type' => $type, 'uploaddir' => $upload_dir, 'sendfile' => (GETPOST("sendit") ? true : false));
88 88
 // Note that $action and $object may be modified by some hooks
89 89
 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
90 90
 if ($reshook < 0) {
Please login to merge, or discard this patch.
htdocs/core/ajax/onlineSign.php 1 patch
Spacing   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 if (!defined('NOBROWSERNOTIF')) {
50 50
 	define('NOBROWSERNOTIF', '1');
51 51
 }
52
-$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));	// Keep $_GET and $_POST here. GETPOST not yet defined.
52
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); // Keep $_GET and $_POST here. GETPOST not yet defined.
53 53
 if (is_numeric($entity)) {
54 54
 	define("DOLENTITY", $entity);
55 55
 }
56 56
 include '../../main.inc.php';
57
-require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
57
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
58 58
 /**
59 59
  * @var Conf $conf
60 60
  * @var DoliDB $db
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 $signature = GETPOST('signaturebase64');
69 69
 $ref = GETPOST('ref', 'aZ09');
70
-$mode = GETPOST('mode', 'aZ09');    // 'proposal', ...
70
+$mode = GETPOST('mode', 'aZ09'); // 'proposal', ...
71 71
 $SECUREKEY = GETPOST("securekey"); // Secure key
72 72
 $online_sign_name = GETPOST("onlinesignname");
73 73
 
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 	$securekeyseed = getDolGlobalString(strtoupper($type).'_ONLINE_SIGNATURE_SECURITY_TOKEN');
89 89
 }
90 90
 
91
-if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed . $type . $ref . (!isModEnabled('multicompany') ? '' : $entity), $SECUREKEY, '0')) {
92
-	httponly_accessforbidden('Bad value for securitykey. Value provided ' . dol_escape_htmltag($SECUREKEY) . ' does not match expected value for ref=' . dol_escape_htmltag($ref), 403);
91
+if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $entity), $SECUREKEY, '0')) {
92
+	httponly_accessforbidden('Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref), 403);
93 93
 }
94 94
 
95 95
 // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
@@ -116,29 +116,29 @@  discard block
 block discarded – undo
116 116
 		$data = base64_decode($signature);
117 117
 
118 118
 		if ($mode == "propale" || $mode == 'proposal') {
119
-			require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
120
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
119
+			require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
120
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
121 121
 			$object = new Propal($db);
122 122
 			$object->fetch(0, $ref);
123 123
 
124 124
 			$upload_dir = !empty($conf->propal->multidir_output[$object->entity ?? $conf->entity]) ? $conf->propal->multidir_output[$object->entity ?? $conf->entity] : $conf->propal->dir_output;
125
-			$upload_dir .= '/' . dol_sanitizeFileName($object->ref) . '/';
125
+			$upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/';
126 126
 
127
-			$default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
128
-			$default_font = pdf_getPDFFont($langs);    // Must be after pdf_getInstance
127
+			$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
128
+			$default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance
129 129
 			$langs->loadLangs(array("main", "companies"));
130 130
 
131 131
 			$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
132
-			$filename = "signatures/" . $date . "_signature.png";
133
-			if (!is_dir($upload_dir . "signatures/")) {
134
-				if (!dol_mkdir($upload_dir . "signatures/")) {
135
-					$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
132
+			$filename = "signatures/".$date."_signature.png";
133
+			if (!is_dir($upload_dir."signatures/")) {
134
+				if (!dol_mkdir($upload_dir."signatures/")) {
135
+					$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
136 136
 					$error++;
137 137
 				}
138 138
 			}
139 139
 
140 140
 			if (!$error) {
141
-				$return = file_put_contents($upload_dir . $filename, $data);
141
+				$return = file_put_contents($upload_dir.$filename, $data);
142 142
 				if ($return == false) {
143 143
 					$error++;
144 144
 					$response = 'Error file_put_content: failed to create signature file.';
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
 			if (!$error) {
149 149
 				// Defined modele of doc
150 150
 				$last_main_doc_file = $object->last_main_doc;
151
-				$directdownloadlink = $object->getLastMainDocLink('proposal');    // url to download the $object->last_main_doc
151
+				$directdownloadlink = $object->getLastMainDocLink('proposal'); // url to download the $object->last_main_doc
152 152
 
153 153
 				if (preg_match('/\.pdf/i', $last_main_doc_file)) {
154 154
 					$ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME); // Retrieves the name of external or internal PDF
155 155
 					$ref_pdf = preg_replace('/_signed-(\d+)/', '', $ref_pdf);
156 156
 
157
-					$newpdffilename = $upload_dir . $ref_pdf . "_signed-" . $date . ".pdf";
158
-					$sourcefile = $upload_dir . $ref_pdf . ".pdf";
157
+					$newpdffilename = $upload_dir.$ref_pdf."_signed-".$date.".pdf";
158
+					$sourcefile = $upload_dir.$ref_pdf.".pdf";
159 159
 
160 160
 					if (dol_is_file($sourcefile)) {
161 161
 						$parameters = array('sourcefile' => $sourcefile, 'newpdffilename' => $newpdffilename);
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
 							}
179 179
 
180 180
 							//$pdf->Open();
181
-							$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
181
+							$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
182 182
 
183 183
 							$param = array();
184 184
 							$param['online_sign_name'] = $online_sign_name;
185
-							$param['pathtoimage'] = $upload_dir . $filename;
185
+							$param['pathtoimage'] = $upload_dir.$filename;
186 186
 
187 187
 							$propalsignonspecificpage = getDolGlobalInt("PROPAL_SIGNATURE_ON_SPECIFIC_PAGE");
188 188
 
189
-							$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
189
+							$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
190 190
 							for ($i = 1; $i < ($pagecount + 1); $i++) {
191 191
 								try {
192 192
 									$tppl = $pdf->importPage($i);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 										dolPrintSignatureImage($pdf, $langs, $param);
231 231
 									}
232 232
 								} catch (Exception $e) {
233
-									dol_syslog("Error when manipulating the PDF " . $sourcefile . " by onlineSign: " . $e->getMessage(), LOG_ERR);
233
+									dol_syslog("Error when manipulating the PDF ".$sourcefile." by onlineSign: ".$e->getMessage(), LOG_ERR);
234 234
 									$response = $e->getMessage();
235 235
 									$error++;
236 236
 								}
@@ -279,14 +279,14 @@  discard block
 block discarded – undo
279 279
 
280 280
 				$online_sign_ip = getUserRemoteIP();
281 281
 
282
-				$sql = "UPDATE " . MAIN_DB_PREFIX . "propal";
283
-				$sql .= " SET fk_statut = " . ((int) $object::STATUS_SIGNED) . ", note_private = '" . $db->escape($object->note_private) . "',";
284
-				$sql .= " date_signature = '" . $db->idate(dol_now()) . "',";
285
-				$sql .= " online_sign_ip = '" . $db->escape($online_sign_ip) . "'";
282
+				$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
283
+				$sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$db->escape($object->note_private)."',";
284
+				$sql .= " date_signature = '".$db->idate(dol_now())."',";
285
+				$sql .= " online_sign_ip = '".$db->escape($online_sign_ip)."'";
286 286
 				if ($online_sign_name) {
287
-					$sql .= ", online_sign_name = '" . $db->escape($online_sign_name) . "'";
287
+					$sql .= ", online_sign_name = '".$db->escape($online_sign_name)."'";
288 288
 				}
289
-				$sql .= " WHERE rowid = " . ((int) $object->id);
289
+				$sql .= " WHERE rowid = ".((int) $object->id);
290 290
 
291 291
 				dol_syslog(__FILE__, LOG_DEBUG);
292 292
 				$resql = $db->query($sql);
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 						$result = $object->call_trigger('PROPAL_CLOSE_SIGNED', $user);
306 306
 						if ($result < 0) {
307 307
 							$error++;
308
-							$response = "error in trigger " . $object->error;
308
+							$response = "error in trigger ".$object->error;
309 309
 						} else {
310 310
 							$soc = new Societe($db);
311 311
 							$soc->id = $object->socid;
@@ -334,25 +334,25 @@  discard block
 block discarded – undo
334 334
 				}
335 335
 			}
336 336
 		} elseif ($mode == 'contract') {
337
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
338
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
337
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
338
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
339 339
 			$object = new Contrat($db);
340 340
 			$object->fetch(0, $ref);
341 341
 
342 342
 			$upload_dir = !empty($conf->contrat->multidir_output[$object->entity ?? $conf->entity]) ? $conf->contrat->multidir_output[$object->entity ?? $conf->entity] : $conf->contrat->dir_output;
343
-			$upload_dir .= '/' . dol_sanitizeFileName($object->ref) . '/';
343
+			$upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/';
344 344
 
345 345
 			$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
346
-			$filename = "signatures/" . $date . "_signature.png";
347
-			if (!is_dir($upload_dir . "signatures/")) {
348
-				if (!dol_mkdir($upload_dir . "signatures/")) {
349
-					$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
346
+			$filename = "signatures/".$date."_signature.png";
347
+			if (!is_dir($upload_dir."signatures/")) {
348
+				if (!dol_mkdir($upload_dir."signatures/")) {
349
+					$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
350 350
 					$error++;
351 351
 				}
352 352
 			}
353 353
 
354 354
 			if (!$error) {
355
-				$return = file_put_contents($upload_dir . $filename, $data);
355
+				$return = file_put_contents($upload_dir.$filename, $data);
356 356
 				if ($return == false) {
357 357
 					$error++;
358 358
 					$response = 'Error file_put_content: failed to create signature file.';
@@ -362,13 +362,13 @@  discard block
 block discarded – undo
362 362
 			if (!$error) {
363 363
 				// Defined modele of doc
364 364
 				$last_main_doc_file = $object->last_main_doc;
365
-				$directdownloadlink = $object->getLastMainDocLink('contrat');    // url to download the $object->last_main_doc
365
+				$directdownloadlink = $object->getLastMainDocLink('contrat'); // url to download the $object->last_main_doc
366 366
 
367 367
 				if (preg_match('/\.pdf/i', $last_main_doc_file)) {
368 368
 					$ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME); // Retrieves the name of external or internal PDF
369 369
 
370
-					$newpdffilename = $upload_dir . $ref_pdf . "_signed-" . $date . ".pdf";
371
-					$sourcefile = $upload_dir . $ref_pdf . ".pdf";
370
+					$newpdffilename = $upload_dir.$ref_pdf."_signed-".$date.".pdf";
371
+					$sourcefile = $upload_dir.$ref_pdf.".pdf";
372 372
 
373 373
 					if (dol_is_file($sourcefile)) {
374 374
 						$parameters = array('sourcefile' => $sourcefile, 'newpdffilename' => $newpdffilename);
@@ -391,13 +391,13 @@  discard block
 block discarded – undo
391 391
 							}
392 392
 
393 393
 							//$pdf->Open();
394
-							$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
394
+							$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
395 395
 
396 396
 							$param = array();
397 397
 							$param['online_sign_name'] = $online_sign_name;
398
-							$param['pathtoimage'] = $upload_dir . $filename;
398
+							$param['pathtoimage'] = $upload_dir.$filename;
399 399
 
400
-							$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
400
+							$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
401 401
 							for ($i = 1; $i < ($pagecount + 1); $i++) {
402 402
 								try {
403 403
 									$tppl = $pdf->importPage($i);
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 										dolPrintSignatureImage($pdf, $langs, $param);
429 429
 									}
430 430
 								} catch (Exception $e) {
431
-									dol_syslog("Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
431
+									dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR);
432 432
 									$response = $e->getMessage();
433 433
 									$error++;
434 434
 								}
@@ -466,8 +466,8 @@  discard block
 block discarded – undo
466 466
 				$object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_SIGNED_RECEIVER_ONLINE'], 0, 'CONTRACT_MODIFY');
467 467
 			}
468 468
 		} elseif ($mode == 'fichinter') {
469
-			require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
470
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
469
+			require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
470
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
471 471
 			$object = new Fichinter($db);
472 472
 			$object->fetch(0, $ref);
473 473
 
@@ -476,20 +476,20 @@  discard block
 block discarded – undo
476 476
 
477 477
 			$langs->loadLangs(array("main", "companies"));
478 478
 
479
-			$default_font_size = pdf_getPDFFontSize($langs);	// Must be after pdf_getInstance
480
-			$default_font = pdf_getPDFFont($langs);	// Must be
479
+			$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
480
+			$default_font = pdf_getPDFFont($langs); // Must be
481 481
 
482 482
 			$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
483
-			$filename = "signatures/" . $date . "_signature.png";
484
-			if (!is_dir($upload_dir . "signatures/")) {
485
-				if (!dol_mkdir($upload_dir . "signatures/")) {
486
-					$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
483
+			$filename = "signatures/".$date."_signature.png";
484
+			if (!is_dir($upload_dir."signatures/")) {
485
+				if (!dol_mkdir($upload_dir."signatures/")) {
486
+					$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
487 487
 					$error++;
488 488
 				}
489 489
 			}
490 490
 
491 491
 			if (!$error) {
492
-				$return = file_put_contents($upload_dir . $filename, $data);
492
+				$return = file_put_contents($upload_dir.$filename, $data);
493 493
 				if ($return == false) {
494 494
 					$error++;
495 495
 					$response = 'Error file_put_content: failed to create signature file.';
@@ -499,13 +499,13 @@  discard block
 block discarded – undo
499 499
 			if (!$error) {
500 500
 				// Defined modele of doc
501 501
 				$last_main_doc_file = $object->last_main_doc;
502
-				$directdownloadlink = $object->getLastMainDocLink('fichinter');    // url to download the $object->last_main_doc
502
+				$directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc
503 503
 
504 504
 				if (preg_match('/\.pdf/i', $last_main_doc_file)) {
505 505
 					$ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME); // Retrieves the name of external or internal PDF
506 506
 
507
-					$newpdffilename = $upload_dir . $ref_pdf . "_signed-" . $date . ".pdf";
508
-					$sourcefile = $upload_dir . $ref_pdf . ".pdf";
507
+					$newpdffilename = $upload_dir.$ref_pdf."_signed-".$date.".pdf";
508
+					$sourcefile = $upload_dir.$ref_pdf.".pdf";
509 509
 
510 510
 					if (dol_is_file($sourcefile)) {
511 511
 						$parameters = array('sourcefile' => $sourcefile, 'newpdffilename' => $newpdffilename);
@@ -528,13 +528,13 @@  discard block
 block discarded – undo
528 528
 							}
529 529
 
530 530
 							//$pdf->Open();
531
-							$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
531
+							$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
532 532
 
533 533
 							$param = array();
534 534
 							$param['online_sign_name'] = $online_sign_name;
535
-							$param['pathtoimage'] = $upload_dir . $filename;
535
+							$param['pathtoimage'] = $upload_dir.$filename;
536 536
 
537
-							$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
537
+							$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
538 538
 							for ($i = 1; $i < ($pagecount + 1); $i++) {
539 539
 								try {
540 540
 									$tppl = $pdf->importPage($i);
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 										dolPrintSignatureImage($pdf, $langs, $param);
566 566
 									}
567 567
 								} catch (Exception $e) {
568
-									dol_syslog("Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
568
+									dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR);
569 569
 									$response = $e->getMessage();
570 570
 									$error++;
571 571
 								}
@@ -604,39 +604,39 @@  discard block
 block discarded – undo
604 604
 			}
605 605
 		} elseif ($mode == "societe_rib") {
606 606
 			$langs->load('withdrawals');
607
-			require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
608
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
607
+			require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
608
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
609 609
 			$modelpath = "core/modules/bank/doc/";
610 610
 			$object = new CompanyBankAccount($db);
611 611
 			$object->fetch(0, $ref);
612 612
 			if (!empty($object->id)) {
613 613
 				$object->fetch_thirdparty();
614 614
 
615
-				$upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity] . '/' . dol_sanitizeFileName((string) $object->thirdparty->id) . '/';
615
+				$upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity].'/'.dol_sanitizeFileName((string) $object->thirdparty->id).'/';
616 616
 
617
-				$default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
618
-				$default_font = pdf_getPDFFont($langs);    // Must be after pdf_getInstance
617
+				$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
618
+				$default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance
619 619
 				$langs->loadLangs(array("main", "companies"));
620 620
 
621 621
 				$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
622
-				$filename = "signatures/" . $date . "_signature.png";
623
-				if (!dol_is_dir($upload_dir . "signatures/")) {
624
-					if (!dol_mkdir($upload_dir . "signatures/")) {
625
-						$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
622
+				$filename = "signatures/".$date."_signature.png";
623
+				if (!dol_is_dir($upload_dir."signatures/")) {
624
+					if (!dol_mkdir($upload_dir."signatures/")) {
625
+						$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
626 626
 						$error++;
627 627
 					}
628 628
 				}
629
-				if (!dol_is_writable($upload_dir . "signatures/")) {
630
-					$response = "Error directory " . $upload_dir . "signatures/ is not writable";
629
+				if (!dol_is_writable($upload_dir."signatures/")) {
630
+					$response = "Error directory ".$upload_dir."signatures/ is not writable";
631 631
 					$error++;
632 632
 				}
633 633
 				if (!dol_is_writable(DOL_DATA_ROOT.'/admin/temp/')) {	// This is used by TCPDF as working directory
634
-					$response = "Error directory " . DOL_DATA_ROOT."/admin/temp/ is not writable";
634
+					$response = "Error directory ".DOL_DATA_ROOT."/admin/temp/ is not writable";
635 635
 					$error++;
636 636
 				}
637 637
 
638 638
 				if (!$error) {
639
-					$return = file_put_contents($upload_dir . $filename, $data);
639
+					$return = file_put_contents($upload_dir.$filename, $data);
640 640
 					if ($return == false) {
641 641
 						$error++;
642 642
 						$response = 'Error file_put_content: failed to create signature file.';
@@ -647,14 +647,14 @@  discard block
 block discarded – undo
647 647
 					// Defined modele of doc
648 648
 					$last_main_doc_file = $object->last_main_doc;
649 649
 					$last_modelpdf = $object->model_pdf;
650
-					$directdownloadlink = $object->getLastMainDocLink('company');    // url to download the $object->last_main_doc
650
+					$directdownloadlink = $object->getLastMainDocLink('company'); // url to download the $object->last_main_doc
651 651
 
652 652
 					if (preg_match('/\.pdf/i', $last_main_doc_file)) {
653 653
 						$sourcefile = '';
654 654
 						$newpdffilename = '';
655 655
 						if ($last_modelpdf == 'sepamandate') {
656
-							$newpdffilename = $upload_dir . $langs->transnoentitiesnoconv("SepaMandateShort") . ' ' . dol_sanitizeFileName($object->ref) . "-" . dol_sanitizeFileName($object->rum) . "_signed-" . $date . ".pdf";
657
-							$sourcefile = $upload_dir . $langs->transnoentitiesnoconv("SepaMandateShort") . ' ' . dol_sanitizeFileName($object->ref) . "-" . dol_sanitizeFileName($object->rum) . ".pdf";
656
+							$newpdffilename = $upload_dir.$langs->transnoentitiesnoconv("SepaMandateShort").' '.dol_sanitizeFileName($object->ref)."-".dol_sanitizeFileName($object->rum)."_signed-".$date.".pdf";
657
+							$sourcefile = $upload_dir.$langs->transnoentitiesnoconv("SepaMandateShort").' '.dol_sanitizeFileName($object->ref)."-".dol_sanitizeFileName($object->rum).".pdf";
658 658
 						}
659 659
 						if (dol_is_file($sourcefile)) {
660 660
 							$parameters = array('sourcefile' => $sourcefile, 'newpdffilename' => $newpdffilename);
@@ -677,9 +677,9 @@  discard block
 block discarded – undo
677 677
 								}
678 678
 
679 679
 								//$pdf->Open();
680
-								$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
680
+								$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
681 681
 
682
-								$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
682
+								$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
683 683
 								for ($i = 1; $i < ($pagecount + 1); $i++) {
684 684
 									try {
685 685
 										$tppl = $pdf->importPage($i);
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 										$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
688 688
 										$pdf->useTemplate($tppl);
689 689
 									} catch (Exception $e) {
690
-										dol_syslog("Error when manipulating the PDF " . $sourcefile . " by onlineSign: " . $e->getMessage(), LOG_ERR);
690
+										dol_syslog("Error when manipulating the PDF ".$sourcefile." by onlineSign: ".$e->getMessage(), LOG_ERR);
691 691
 										$response = $e->getMessage();
692 692
 										$error++;
693 693
 									}
@@ -703,18 +703,18 @@  discard block
 block discarded – undo
703 703
 									$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
704 704
 								}
705 705
 								foreach ($dirmodels as $reldir) {
706
-									$file = "pdf_" . $last_modelpdf . ".modules.php";
706
+									$file = "pdf_".$last_modelpdf.".modules.php";
707 707
 									// On vérifie l'emplacement du modele
708
-									$file = dol_buildpath($reldir . $modelpath . $file, 0);
708
+									$file = dol_buildpath($reldir.$modelpath.$file, 0);
709 709
 									if (file_exists($file)) {
710 710
 										$filefound = $file;
711
-										$classname = 'pdf_' . $last_modelpdf;
711
+										$classname = 'pdf_'.$last_modelpdf;
712 712
 										break;
713 713
 									}
714 714
 								}
715 715
 
716 716
 								if ($filefound === '') {
717
-									$response = $langs->trans("Error") . ' Failed to load doc generator with modelpaths=' . $modelpath . ' - modele=' . $last_modelpdf;
717
+									$response = $langs->trans("Error").' Failed to load doc generator with modelpaths='.$modelpath.' - modele='.$last_modelpdf;
718 718
 									dol_syslog($response, LOG_ERR);
719 719
 									$error++;
720 720
 								}
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 									$param = array();
740 740
 									$param['online_sign_name'] = $online_sign_name;
741
-									$param['pathtoimage'] = $upload_dir . $filename;
741
+									$param['pathtoimage'] = $upload_dir.$filename;
742 742
 
743 743
 									// A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF
744 744
 									// TODO Get position of box from PDF template
@@ -774,16 +774,16 @@  discard block
 block discarded – undo
774 774
 
775 775
 				$online_sign_ip = getUserRemoteIP();
776 776
 
777
-				$sql = "UPDATE " . MAIN_DB_PREFIX . $object->table_element;
777
+				$sql = "UPDATE ".MAIN_DB_PREFIX.$object->table_element;
778 778
 				$sql .= " SET ";
779
-				$sql .= " date_signature = '" . $db->idate(dol_now()) . "',";
780
-				$sql .= " online_sign_ip = '" . $db->escape($online_sign_ip) . "'";
779
+				$sql .= " date_signature = '".$db->idate(dol_now())."',";
780
+				$sql .= " online_sign_ip = '".$db->escape($online_sign_ip)."'";
781 781
 				if ($online_sign_name) {
782
-					$sql .= ", online_sign_name = '" . $db->escape($online_sign_name) . "'";
782
+					$sql .= ", online_sign_name = '".$db->escape($online_sign_name)."'";
783 783
 				}
784 784
 				//$sql .= ", last_main_doc = '" . $db->escape($object->element'..') . "'";
785 785
 
786
-				$sql .= " WHERE rowid = " . ((int) $object->id);
786
+				$sql .= " WHERE rowid = ".((int) $object->id);
787 787
 
788 788
 				dol_syslog(__FILE__, LOG_DEBUG);
789 789
 				$resql = $db->query($sql);
@@ -809,8 +809,8 @@  discard block
 block discarded – undo
809 809
 				}
810 810
 			}
811 811
 		} elseif ($mode == 'expedition') {
812
-			require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
813
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
812
+			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
813
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
814 814
 
815 815
 			$object = new Expedition($db);
816 816
 			$object->fetch(0, $ref);
@@ -820,20 +820,20 @@  discard block
 block discarded – undo
820 820
 
821 821
 			$langs->loadLangs(array("main", "companies"));
822 822
 
823
-			$default_font_size = pdf_getPDFFontSize($langs);	// Must be after pdf_getInstance
824
-			$default_font = pdf_getPDFFont($langs);	// Must be
823
+			$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
824
+			$default_font = pdf_getPDFFont($langs); // Must be
825 825
 
826 826
 			$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
827
-			$filename = "signatures/" . $date . "_signature.png";
828
-			if (!is_dir($upload_dir . "signatures/")) {
829
-				if (!dol_mkdir($upload_dir . "signatures/")) {
830
-					$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
827
+			$filename = "signatures/".$date."_signature.png";
828
+			if (!is_dir($upload_dir."signatures/")) {
829
+				if (!dol_mkdir($upload_dir."signatures/")) {
830
+					$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
831 831
 					$error++;
832 832
 				}
833 833
 			}
834 834
 
835 835
 			if (!$error) {
836
-				$return = file_put_contents($upload_dir . $filename, $data);
836
+				$return = file_put_contents($upload_dir.$filename, $data);
837 837
 				if ($return == false) {
838 838
 					$error++;
839 839
 					$response = 'Error file_put_content: failed to create signature file.';
@@ -846,17 +846,17 @@  discard block
 block discarded – undo
846 846
 				if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) {
847 847
 					// It seems document has never been generated, or was generated and then deleted.
848 848
 					// So we try to regenerate it with its default template.
849
-					$defaulttemplate = '';		// We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used.
849
+					$defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used.
850 850
 					$object->generateDocument($defaulttemplate, $langs);
851 851
 				}
852 852
 				$last_main_doc_file = $object->last_main_doc;
853
-				$directdownloadlink = $object->getLastMainDocLink('expedition');    // url to download the $object->last_main_doc
853
+				$directdownloadlink = $object->getLastMainDocLink('expedition'); // url to download the $object->last_main_doc
854 854
 
855 855
 				if (preg_match('/\.pdf/i', $last_main_doc_file)) {
856 856
 					$ref_pdf = pathinfo($last_main_doc_file, PATHINFO_FILENAME); // Retrieves the name of external or internal PDF
857 857
 
858
-					$newpdffilename = $upload_dir . $ref_pdf . "_signed-" . $date . ".pdf";
859
-					$sourcefile = $upload_dir . $ref_pdf . ".pdf";
858
+					$newpdffilename = $upload_dir.$ref_pdf."_signed-".$date.".pdf";
859
+					$sourcefile = $upload_dir.$ref_pdf.".pdf";
860 860
 
861 861
 					if (dol_is_file($sourcefile)) {
862 862
 						$parameters = array('sourcefile' => $sourcefile, 'newpdffilename' => $newpdffilename);
@@ -879,13 +879,13 @@  discard block
 block discarded – undo
879 879
 							}
880 880
 
881 881
 							//$pdf->Open();
882
-							$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
882
+							$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
883 883
 
884 884
 							$param = array();
885 885
 							$param['online_sign_name'] = $online_sign_name;
886
-							$param['pathtoimage'] = $upload_dir . $filename;
886
+							$param['pathtoimage'] = $upload_dir.$filename;
887 887
 
888
-							$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
888
+							$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
889 889
 							for ($i = 1; $i < ($pagecount + 1); $i++) {
890 890
 								try {
891 891
 									$tppl = $pdf->importPage($i);
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
 										dolPrintSignatureImage($pdf, $langs, $param);
905 905
 									}
906 906
 								} catch (Exception $e) {
907
-									dol_syslog("Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
907
+									dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR);
908 908
 									$response = $e->getMessage();
909 909
 									$error++;
910 910
 								}
@@ -965,8 +965,8 @@  discard block
 block discarded – undo
965 965
  */
966 966
 function dolPrintSignatureImage(TCPDF $pdf, $langs, $params)
967 967
 {
968
-	$default_font_size = pdf_getPDFFontSize($langs);	// Must be after pdf_getInstance
969
-	$default_font = pdf_getPDFFont($langs);	// Must be
968
+	$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
969
+	$default_font = pdf_getPDFFont($langs); // Must be
970 970
 	$xforimgstart = $params['xforimgstart'];
971 971
 	$yforimgstart = $params['yforimgstart'];
972 972
 	$wforimg = $params['wforimg'];
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 	$pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4) - 4);
975 975
 	$pdf->SetFont($default_font, '', $default_font_size - 1);
976 976
 	$pdf->SetTextColor(80, 80, 80);
977
-	$pdf->MultiCell($wforimg, 4, $langs->trans("Signature") . ': ' . dol_print_date(dol_now(), "day", false, $langs, true). ' - '.$params['online_sign_name'], 0, 'L');
977
+	$pdf->MultiCell($wforimg, 4, $langs->trans("Signature").': '.dol_print_date(dol_now(), "day", false, $langs, true).' - '.$params['online_sign_name'], 0, 'L');
978 978
 	//$pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4));
979 979
 	//$pdf->MultiCell($wforimg, 4, $langs->trans("Lastname") . ': ' . $online_sign_name, 0, 'L');
980 980
 
Please login to merge, or discard this patch.
htdocs/core/tpl/objectline_edit.tpl.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 		if (!$multicurrency_upinctax) {
285 285
 			$multicurrency_upinctax = price2num($line->multicurrency_subprice * (1 + ($line->tva_tx / 100)), 'MU'); // One tax
286 286
 		}
287
-		print '<td class="right"><input rel="'.$object->multicurrency_tx.'" type="text" class="flat right width50" id="multicurrency_price_ttc" name="multicurrency_price_ttc" value="'. ($multicurrency_upinctax ? $multicurrency_upinctax : price($line->multicurrency_subprice)).'" /></td>';
287
+		print '<td class="right"><input rel="'.$object->multicurrency_tx.'" type="text" class="flat right width50" id="multicurrency_price_ttc" name="multicurrency_price_ttc" value="'.($multicurrency_upinctax ? $multicurrency_upinctax : price($line->multicurrency_subprice)).'" /></td>';
288 288
 	}
289 289
 	?>
290 290
 	<td class="right">
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
 			print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="'.$fieldv.'" name="progress">%</td>';
352 352
 		} else {
353
-			print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="' . (GETPOSTISSET('progress') ? GETPOST('progress') : $line->situation_percent) . '" name="progress">%</td>';
353
+			print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="'.(GETPOSTISSET('progress') ? GETPOST('progress') : $line->situation_percent).'" name="progress">%</td>';
354 354
 		}
355 355
 		$coldisplay++;
356 356
 		print '<td></td>';
@@ -451,37 +451,37 @@  discard block
 block discarded – undo
451 451
 	}
452 452
 	if (!$line->date_start) {
453 453
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR') != '') {
454
-			print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
454
+			print 'jQuery("#date_starthour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
455 455
 		}
456 456
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN') != '') {
457
-			print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
457
+			print 'jQuery("#date_startmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
458 458
 		}
459 459
 
460 460
 		$res = 1;
461 461
 		if (!is_object($line->product)) {
462
-			$res = $line->fetch_product();		// fetch product to know its type and allow isMandatoryperiod()
462
+			$res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod()
463 463
 		}
464 464
 		if ($res > 0) {
465 465
 			if ($line->product->isMandatoryPeriod() && $line->product->isService()) {
466
-				print  'jQuery("#date_start").addClass("inputmandatory");';	// Do not add tag "required", this block the cancel action when value not set
466
+				print  'jQuery("#date_start").addClass("inputmandatory");'; // Do not add tag "required", this block the cancel action when value not set
467 467
 			}
468 468
 		}
469 469
 	}
470 470
 	if (!$line->date_end) {
471 471
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR') != '') {
472
-			print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
472
+			print 'jQuery("#date_endhour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
473 473
 		}
474 474
 		if (getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN') != '') {
475
-			print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
475
+			print 'jQuery("#date_endmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
476 476
 		}
477 477
 
478 478
 		$res = 1;
479 479
 		if (!is_object($line->product)) {
480
-			$res = $line->fetch_product();		// fetch product to know its type and allow isMandatoryperiod()
480
+			$res = $line->fetch_product(); // fetch product to know its type and allow isMandatoryperiod()
481 481
 		}
482
-		if ($res  > 0) {
482
+		if ($res > 0) {
483 483
 			if ($line->product->isMandatoryperiod() && $line->product->isService()) {
484
-				print  'jQuery("#date_end").addClass("inputmandatory");';	// Do not add tag "required", this block the cancel action when value not set
484
+				print  'jQuery("#date_end").addClass("inputmandatory");'; // Do not add tag "required", this block the cancel action when value not set
485 485
 			}
486 486
 		}
487 487
 	}
Please login to merge, or discard this patch.
htdocs/core/modules/facture/doc/pdf_sponge.modules.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		$this->watermark = '';
161 161
 
162 162
 		if ($mysoc === null) {
163
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
163
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
164 164
 			return;
165 165
 		}
166 166
 
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 					if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) {
364 364
 						$logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity];
365 365
 					}
366
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
366
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
367 367
 					$tplidx = $pdf->importPage(1);
368 368
 				}
369 369
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 				// $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher
461 461
 
462 462
 				// $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks)
463
-				$this->tab_top = 90 + $top_shift + $shipp_shift;		// top_shift is an addition for linked objects or addons (0 in most cases)
463
+				$this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases)
464 464
 				$this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
465 465
 
466 466
 				// You can add more thing under header here, if you increase $extra_under_address_shift too.
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 							$bg_color = colorStringToArray(getDolGlobalString("SUBTOTAL_BACK_COLOR_LEVEL_".abs($object->lines[$i]->qty)));
808 808
 							$pdf->SetFillColor($bg_color[0], $bg_color[1], $bg_color[2]);
809 809
 							$pdf->SetXY($pdf->GetX(), $curY);
810
-							$pdf->MultiCell($this->page_largeur - $this->marge_droite  - $this->marge_gauche, 6, '', 0, '', true);
810
+							$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 6, '', 0, '', true);
811 811
 							$previous_align = array();
812 812
 							$previous_align['align'] = $this->cols['desc']['content']['align'];
813 813
 							if ($object->lines[$i]->qty < 0) {
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
 								$extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs);
911 911
 								$this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue);
912 912
 
913
-								$this->setAfterColsLinePositionsData('options_' . $extrafieldColKey, $pdf->GetY(), $pdf->getPage());
913
+								$this->setAfterColsLinePositionsData('options_'.$extrafieldColKey, $pdf->GetY(), $pdf->getPage());
914 914
 							}
915 915
 						}
916 916
 					}
@@ -989,11 +989,11 @@  discard block
 block discarded – undo
989 989
 					if (!isset($this->tva[$vatrate])) {
990 990
 						$this->tva[$vatrate] = 0;
991 991
 					}
992
-					$this->tva[$vatrate] += $tvaligne;    // ->tva is abandoned, we use now ->tva_array that is more complete
992
+					$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
993 993
 					$vatcode = $object->lines[$i]->vat_src_code;
994 994
 					if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
995 995
 						if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) {
996
-							$this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0;
996
+							$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0;
997 997
 						}
998 998
 						$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht);
999 999
 					} else {
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
 				// Add number of pages in footer
1105 1105
 				if (method_exists($pdf, 'AliasNbPages')) {
1106
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
1106
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
1107 1107
 				}
1108 1108
 				// Add terms to sale
1109 1109
 				if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
@@ -1357,7 +1357,7 @@  discard block
 block discarded – undo
1357 1357
 			foreach ($this->tva_array as $tvakey => $tvaval) {
1358 1358
 				$pdf->SetFont('', '', $default_font_size - 2);
1359 1359
 				$pdf->SetXY($this->marge_gauche, $posy);
1360
-				$titre = round((float) $tvakey, 2) . "%";
1360
+				$titre = round((float) $tvakey, 2)."%";
1361 1361
 				$pdf->MultiCell(25, 4, $titre, 0, 'L');
1362 1362
 
1363 1363
 				$pdf->SetFont('', '', $default_font_size - 2);
@@ -1398,8 +1398,8 @@  discard block
 block discarded – undo
1398 1398
 			$posy = $pdf->GetY() + 4;
1399 1399
 		}
1400 1400
 
1401
-		$posxval = 52;	// Position of values of properties shown on left side
1402
-		$posxend = 110;	// End of x for text on left side
1401
+		$posxval = 52; // Position of values of properties shown on left side
1402
+		$posxend = 110; // End of x for text on left side
1403 1403
 		if ($this->page_largeur < 210) { // To work with US executive format
1404 1404
 			$posxend -= 10;
1405 1405
 		}
@@ -1408,13 +1408,13 @@  discard block
 block discarded – undo
1408 1408
 		if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) {
1409 1409
 			// All customer previous invoices
1410 1410
 			$sql = "SELECT f.rowid, f.datef, f.total_ttc";
1411
-			$sql.= " FROM " . MAIN_DB_PREFIX . "facture as f";
1412
-			$sql.= " WHERE f.fk_soc = " . ((int) $object->socid);
1413
-			$sql.= " AND f.entity IN (" . getEntity('invoice') . ")";
1414
-			$sql.= " AND f.datef <= '" . $this->db->idate($object->date) . "'";
1415
-			$sql.= " AND f.rowid < " . ((int) $object->id);
1416
-			$sql.= " AND f.fk_statut > 0";
1417
-			$sql.= " ORDER BY f.datef ASC";
1411
+			$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
1412
+			$sql .= " WHERE f.fk_soc = ".((int) $object->socid);
1413
+			$sql .= " AND f.entity IN (".getEntity('invoice').")";
1414
+			$sql .= " AND f.datef <= '".$this->db->idate($object->date)."'";
1415
+			$sql .= " AND f.rowid < ".((int) $object->id);
1416
+			$sql .= " AND f.fk_statut > 0";
1417
+			$sql .= " ORDER BY f.datef ASC";
1418 1418
 
1419 1419
 			$old_balance = 0;
1420 1420
 			$invoices = array();
@@ -1429,12 +1429,12 @@  discard block
 block discarded – undo
1429 1429
 
1430 1430
 			// All payments before current date
1431 1431
 			$sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount";
1432
-			$sql_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf";
1433
-			$sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement";
1434
-			$sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture";
1435
-			$sql_payments.= " WHERE f.fk_soc = " . ((int) $object->socid);
1436
-			$sql_payments.= " AND p.datep < '" . $this->db->idate($object->date) . "'";
1437
-			$sql_payments.= " ORDER BY p.datep ASC";
1432
+			$sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf";
1433
+			$sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
1434
+			$sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture";
1435
+			$sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid);
1436
+			$sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'";
1437
+			$sql_payments .= " ORDER BY p.datep ASC";
1438 1438
 
1439 1439
 			$total_payments = 0;
1440 1440
 			$resql_payments = $this->db->query($sql_payments);
@@ -1447,11 +1447,11 @@  discard block
 block discarded – undo
1447 1447
 
1448 1448
 			// Payments made on current invoice date (including current invoice)
1449 1449
 			$sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount";
1450
-			$sql_current_date_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf";
1451
-			$sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement";
1452
-			$sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture";
1453
-			$sql_current_date_payments.= " WHERE f.fk_soc = " . ((int) $object->socid);
1454
-			$sql_current_date_payments.= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')";
1450
+			$sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf";
1451
+			$sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
1452
+			$sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture";
1453
+			$sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid);
1454
+			$sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')";
1455 1455
 
1456 1456
 			$current_date_payments = 0;
1457 1457
 			$resql_current_date = $this->db->query($sql_current_date_payments);
@@ -1475,7 +1475,7 @@  discard block
 block discarded – undo
1475 1475
 			$pdf->MultiCell($posxval - $this->marge_gauche + 8, 4, $titre, 0, 'L', true);
1476 1476
 
1477 1477
 			$pdf->SetFont('', '', $default_font_size - 2);
1478
-			$pdf->SetXY($posxval+8, $posy);
1478
+			$pdf->SetXY($posxval + 8, $posy);
1479 1479
 			$titre = $outputlangs->transnoentities("NewBalance").' : '.price($new_balance);
1480 1480
 			$pdf->MultiCell($posxend - $posxval - 8, 4, $titre, 0, 'L', true);
1481 1481
 
@@ -1507,7 +1507,7 @@  discard block
 block discarded – undo
1507 1507
 
1508 1508
 			$pdf->SetFont('', '', $default_font_size - 2);
1509 1509
 			$pdf->SetXY($posxval, $posy);
1510
-			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
1510
+			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
1511 1511
 			$pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L');
1512 1512
 
1513 1513
 			$posy = $pdf->GetY() + 3; // for 2 lines
@@ -1685,7 +1685,7 @@  discard block
 block discarded – undo
1685 1685
 						include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
1686 1686
 						$invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type);
1687 1687
 
1688
-						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1688
+						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1689 1689
 					}
1690 1690
 				}
1691 1691
 			}
@@ -2371,7 +2371,7 @@  discard block
 block discarded – undo
2371 2371
 		if (empty($hidetop)) {
2372 2372
 			// Show category of operations
2373 2373
 			if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) {
2374
-				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
2374
+				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
2375 2375
 				$pdf->SetXY($this->marge_gauche, $tab_top - 4);
2376 2376
 				$pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations);
2377 2377
 			}
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
 		}
2488 2488
 		if ($this->situationinvoice) {
2489 2489
 			$outputlangs->loadLangs(array("other"));
2490
-			$title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -";
2490
+			$title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -";
2491 2491
 		}
2492 2492
 		if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
2493 2493
 			$title .= ' - ';
@@ -2777,7 +2777,7 @@  discard block
 block discarded – undo
2777 2777
 				if (!empty($carac_client_shipping)) {
2778 2778
 					$posy += $hautcadre;
2779 2779
 
2780
-					$hautcadre -= 10;	// Height for the shipping address does not need to be as high as main box
2780
+					$hautcadre -= 10; // Height for the shipping address does not need to be as high as main box
2781 2781
 
2782 2782
 					// Show shipping frame
2783 2783
 					$pdf->SetXY($posx + 2, $posy - 5);
Please login to merge, or discard this patch.
htdocs/core/modules/facture/doc/pdf_octopus.modules.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * Dolibarr version of the loaded document
79 79
 	 * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental'
80 80
 	 */
81
-	public $version = 'disabled';	// Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2.
81
+	public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2.
82 82
 
83 83
 	/**
84 84
 	 * @var int height for info total
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		}
249 249
 
250 250
 		if ($mysoc === null) {
251
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
251
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
252 252
 			return;
253 253
 		}
254 254
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 			$outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies", "compta"));
299 299
 		}
300 300
 
301
-		if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE &&  !empty($object->situation_cycle_ref)))) {
301
+		if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) {
302 302
 			setEventMessage($langs->trans('WarningsObjectIsNotASituation'), 'warnings');
303 303
 			return 1;
304 304
 		}
@@ -418,15 +418,15 @@  discard block
 block discarded – undo
418 418
 				$pdf->setAutoPageBreak(true, 0);
419 419
 
420 420
 				// compute height for situation invoices
421
-				$this->heightforinfotot = 45;	// Height reserved to output the info and total part and payment part
421
+				$this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part
422 422
 				if (!getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS') && $nbpayments > 0) {
423 423
 					$this->heightforinfotot += 4 * ($nbpayments + 3);
424 424
 				}
425 425
 				if ($nbprevsituation > 0) {
426 426
 					$this->heightforinfotot += 4 * ($nbprevsituation + 3);
427 427
 				}
428
-				$this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5));	// Height reserved to output the free text on last page
429
-				$this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22);	// Height reserved to output the footer (value include bottom margin)
428
+				$this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page
429
+				$this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
430 430
 
431 431
 				if (class_exists('TCPDF')) {
432 432
 					$pdf->setPrintHeader(false);
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 					if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) {
441 441
 						$logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity];
442 442
 					}
443
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
443
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
444 444
 					$this->tplidx = $pdf->importPage(1);
445 445
 				}
446 446
 
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 				// $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher
533 533
 
534 534
 				// $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks)
535
-				$this->tab_top = 90 + $top_shift + $shipp_shift;		// top_shift is an addition for linked objects or addons (0 in most cases)
535
+				$this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases)
536 536
 				$this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
537 537
 
538 538
 				// You can add more thing under header here, if you increase $extra_under_address_shift too.
@@ -1032,11 +1032,11 @@  discard block
 block discarded – undo
1032 1032
 					if (!isset($this->tva[$vatrate])) {
1033 1033
 						$this->tva[$vatrate] = 0;
1034 1034
 					}
1035
-					$this->tva[$vatrate] += $tvaligne;	// ->tva is abandoned, we use now ->tva_array that is more complete
1035
+					$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
1036 1036
 					$vatcode = $object->lines[$i]->vat_src_code;
1037 1037
 					if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
1038 1038
 						if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) {
1039
-							$this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0;
1039
+							$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0;
1040 1040
 						}
1041 1041
 						$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht);
1042 1042
 					} else {
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 				// Pagefoot
1129 1129
 				$this->_pagefoot($pdf, $object, $outputlangs);
1130 1130
 				if (method_exists($pdf, 'AliasNbPages')) {
1131
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
1131
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
1132 1132
 				}
1133 1133
 
1134 1134
 				$this->resumeLastPage($pdf, $object, 0, $tab_top, $outputlangs, $outputlangsbis);
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
 			foreach ($this->tva_array as $tvakey => $tvaval) {
1365 1365
 				$pdf->SetFont('', '', $default_font_size - 2);
1366 1366
 				$pdf->SetXY($this->marge_gauche, $posy);
1367
-				$titre = round((float) $tvakey, 2) . "%";
1367
+				$titre = round((float) $tvakey, 2)."%";
1368 1368
 				$pdf->MultiCell(25, 4, $titre, 0, 'L');
1369 1369
 
1370 1370
 				$pdf->SetFont('', '', $default_font_size - 2);
@@ -1405,8 +1405,8 @@  discard block
 block discarded – undo
1405 1405
 			$posy = $pdf->GetY() + 4;
1406 1406
 		}
1407 1407
 
1408
-		$posxval = 52;	// Position of values of properties shown on left side
1409
-		$posxend = 110;	// End of x for text on left side
1408
+		$posxval = 52; // Position of values of properties shown on left side
1409
+		$posxend = 110; // End of x for text on left side
1410 1410
 		if ($this->page_largeur < 210) { // To work with US executive format
1411 1411
 			$posxend -= 10;
1412 1412
 		}
@@ -1415,13 +1415,13 @@  discard block
 block discarded – undo
1415 1415
 		if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) {
1416 1416
 			// All customer previous invoices
1417 1417
 			$sql = "SELECT f.rowid, f.datef, f.total_ttc";
1418
-			$sql.= " FROM " . MAIN_DB_PREFIX . "facture as f";
1419
-			$sql.= " WHERE f.fk_soc = " . ((int) $object->socid);
1420
-			$sql.= " AND f.entity IN (" . getEntity('invoice') . ")";
1421
-			$sql.= " AND f.datef <= '" . $this->db->idate($object->date) . "'";
1422
-			$sql.= " AND f.rowid < " . ((int) $object->id);
1423
-			$sql.= " AND f.fk_statut > 0";
1424
-			$sql.= " ORDER BY f.datef ASC";
1418
+			$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
1419
+			$sql .= " WHERE f.fk_soc = ".((int) $object->socid);
1420
+			$sql .= " AND f.entity IN (".getEntity('invoice').")";
1421
+			$sql .= " AND f.datef <= '".$this->db->idate($object->date)."'";
1422
+			$sql .= " AND f.rowid < ".((int) $object->id);
1423
+			$sql .= " AND f.fk_statut > 0";
1424
+			$sql .= " ORDER BY f.datef ASC";
1425 1425
 
1426 1426
 			$old_balance = 0;
1427 1427
 			$invoices = array();
@@ -1436,12 +1436,12 @@  discard block
 block discarded – undo
1436 1436
 
1437 1437
 			// All payments before current date
1438 1438
 			$sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount";
1439
-			$sql_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf";
1440
-			$sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement";
1441
-			$sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture";
1442
-			$sql_payments.= " WHERE f.fk_soc = " . ((int) $object->socid);
1443
-			$sql_payments.= " AND p.datep < '" . $this->db->idate($object->date) . "'";
1444
-			$sql_payments.= " ORDER BY p.datep ASC";
1439
+			$sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf";
1440
+			$sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
1441
+			$sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture";
1442
+			$sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid);
1443
+			$sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'";
1444
+			$sql_payments .= " ORDER BY p.datep ASC";
1445 1445
 
1446 1446
 			$total_payments = 0;
1447 1447
 			$resql_payments = $this->db->query($sql_payments);
@@ -1454,11 +1454,11 @@  discard block
 block discarded – undo
1454 1454
 
1455 1455
 			// Payments made on current invoice date (including current invoice)
1456 1456
 			$sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount";
1457
-			$sql_current_date_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf";
1458
-			$sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement";
1459
-			$sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture";
1460
-			$sql_current_date_payments.= " WHERE f.fk_soc = " . ((int) $object->socid);
1461
-			$sql_current_date_payments.= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')";
1457
+			$sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf";
1458
+			$sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
1459
+			$sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture";
1460
+			$sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid);
1461
+			$sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')";
1462 1462
 
1463 1463
 			$current_date_payments = 0;
1464 1464
 			$resql_current_date = $this->db->query($sql_current_date_payments);
@@ -1482,7 +1482,7 @@  discard block
 block discarded – undo
1482 1482
 			$pdf->MultiCell($posxval - $this->marge_gauche + 8, 4, $titre, 0, 'L', true);
1483 1483
 
1484 1484
 			$pdf->SetFont('', '', $default_font_size - 2);
1485
-			$pdf->SetXY($posxval+8, $posy);
1485
+			$pdf->SetXY($posxval + 8, $posy);
1486 1486
 			$titre = $outputlangs->transnoentities("NewBalance").' : '.price($new_balance);
1487 1487
 			$pdf->MultiCell($posxend - $posxval - 8, 4, $titre, 0, 'L', true);
1488 1488
 
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
 
1515 1515
 			$pdf->SetFont('', '', $default_font_size - 2);
1516 1516
 			$pdf->SetXY($posxval, $posy);
1517
-			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
1517
+			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
1518 1518
 			$pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L');
1519 1519
 
1520 1520
 			$posy = $pdf->GetY() + 3; // for 2 lines
@@ -1681,7 +1681,7 @@  discard block
 block discarded – undo
1681 1681
 						include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
1682 1682
 						$invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type);
1683 1683
 
1684
-						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1684
+						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1685 1685
 					}
1686 1686
 				}
1687 1687
 			}
@@ -1852,7 +1852,7 @@  discard block
 block discarded – undo
1852 1852
 						if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
1853 1853
 							$vatrate .= '*';
1854 1854
 						}
1855
-						if (! isset($tvas[$vatrate])) {
1855
+						if (!isset($tvas[$vatrate])) {
1856 1856
 							$tvas[$vatrate] = 0;
1857 1857
 						}
1858 1858
 						$tvas[$vatrate] += $tvaligne;
@@ -2121,7 +2121,7 @@  discard block
 block discarded – undo
2121 2121
 		if (empty($hidetop)) {
2122 2122
 			// Show category of operations
2123 2123
 			if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) {
2124
-				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
2124
+				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
2125 2125
 				$pdf->SetXY($this->marge_gauche, $tab_top - 4);
2126 2126
 				$pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations);
2127 2127
 			}
@@ -2141,7 +2141,7 @@  discard block
 block discarded – undo
2141 2141
 		$pdf->SetFont('', '', $default_font_size - 1);
2142 2142
 
2143 2143
 		// Output Rect
2144
-		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D');	// Rect prend une longueur en 3eme param et 4eme param
2144
+		$this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param
2145 2145
 
2146 2146
 		// situation invoice
2147 2147
 		$pdf->SetFont('', '', $default_font_size - 2);
@@ -2181,7 +2181,7 @@  discard block
 block discarded – undo
2181 2181
 		$pdf->SetFont('', '', $default_font_size - 1);
2182 2182
 
2183 2183
 		if (empty($hidetop)) {
2184
-			$pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);	// line prend une position y en 2eme param et 4eme param
2184
+			$pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param
2185 2185
 		}
2186 2186
 	}
2187 2187
 
@@ -2760,7 +2760,7 @@  discard block
 block discarded – undo
2760 2760
 			'overtitle' => array(
2761 2761
 				'textkey' => 'Chantier', // use lang key is useful in somme case with module
2762 2762
 				'align' => 'C',
2763
-				'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
2763
+				'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
2764 2764
 				'width' => 18
2765 2765
 			),
2766 2766
 		);
@@ -2785,13 +2785,13 @@  discard block
 block discarded – undo
2785 2785
 			),
2786 2786
 			'border-left' => true, // add left line separator
2787 2787
 			'overtitle' => array(
2788
-				'textkey' => 'S'.$derniere_situation->situation_counter . ' - ' . dol_print_date($derniere_situation->date, "%d/%m/%Y"),
2788
+				'textkey' => 'S'.$derniere_situation->situation_counter.' - '.dol_print_date($derniere_situation->date, "%d/%m/%Y"),
2789 2789
 				'align' => 'C',
2790
-				'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2790
+				'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2791 2791
 				'width' => 10 + 15 //current width + amount cell width
2792 2792
 			),
2793 2793
 		);
2794
-		if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) {
2794
+		if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) {
2795 2795
 			$this->cols['prev_progress']['status'] = true;
2796 2796
 		}
2797 2797
 
@@ -2806,7 +2806,7 @@  discard block
 block discarded – undo
2806 2806
 			),
2807 2807
 			'border-left' => true, // add left line separator
2808 2808
 		);
2809
-		if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) {
2809
+		if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) {
2810 2810
 			$this->cols['prev_progress_amount']['status'] = true;
2811 2811
 		}
2812 2812
 
@@ -2821,9 +2821,9 @@  discard block
 block discarded – undo
2821 2821
 			),
2822 2822
 			'border-left' => true, // add left line separator
2823 2823
 			'overtitle' => array(
2824
-				'textkey' => 'S'.$object->situation_counter . ' - ' . dol_print_date($object->date, "%d/%m/%Y"),
2824
+				'textkey' => 'S'.$object->situation_counter.' - '.dol_print_date($object->date, "%d/%m/%Y"),
2825 2825
 				'align' => 'C',
2826
-				'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2826
+				'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left
2827 2827
 				'width' => 10 + 15
2828 2828
 			),
2829 2829
 		);
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 
2948 2948
 		// Output Rect
2949 2949
 		// KEEPTHIS => Affiche les bords extérieurs
2950
-		$this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D');	// Rect prend une longueur en 3eme param et 4eme param
2950
+		$this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param
2951 2951
 
2952 2952
 		$pdf->line($this->posx_cumul_anterieur - 1, $tab_top, $this->posx_cumul_anterieur - 1, $tab_top + $tab_height);
2953 2953
 		if (empty($hidetop)) {
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
 			$pdf->SetXY($this->marge_gauche + 10, $tab_top + 24 + $i);
3005 3005
 			$pdf->MultiCell(80, 2, $outputlangs->transnoentities("TotalHT").' '.$TVatInfo['label'], '', 'L');
3006 3006
 
3007
-			if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
3007
+			if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
3008 3008
 				$pdf->SetXY($this->marge_gauche + 10, $tab_top + 28 + $i);
3009 3009
 				$pdf->MultiCell(80, 2, $outputlangs->transnoentities("VAT").' '.$TVatInfo['label'], '', 'L');
3010 3010
 			} else {
@@ -3068,7 +3068,7 @@  discard block
 block discarded – undo
3068 3068
 				$pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['HT'], 0, '', 1, -1, 2), '', 'R');
3069 3069
 
3070 3070
 				// Total TVA
3071
-				if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
3071
+				if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) {
3072 3072
 					$pdf->SetXY($x, $tab_top + 28 + $i);
3073 3073
 					$pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['TVA'], 0, '', 1, -1, 2), '', 'R');
3074 3074
 				} else {
@@ -3145,7 +3145,7 @@  discard block
 block discarded – undo
3145 3145
 
3146 3146
 		$TDataSituation = array();
3147 3147
 
3148
-		if (! empty($facDerniereSituation)) {
3148
+		if (!empty($facDerniereSituation)) {
3149 3149
 			$TDataSituation['derniere_situation'] = $facDerniereSituation;
3150 3150
 			$TDataSituation['date_derniere_situation'] = $facDerniereSituation->date;
3151 3151
 		}
@@ -3154,9 +3154,9 @@  discard block
 block discarded – undo
3154 3154
 		$retenue_garantie_anterieure = 0;
3155 3155
 		// Init tous les champs à 0
3156 3156
 		$TDataSituation['cumul_anterieur'] = array(
3157
-			'HT' => 0,	//montant HT normal
3158
-			'TVA' => 0,   //montant de la TVA sur le HTnet
3159
-			'TTC' => 0,   //montant TTC (HTnet + TVA)
3157
+			'HT' => 0, //montant HT normal
3158
+			'TVA' => 0, //montant de la TVA sur le HTnet
3159
+			'TTC' => 0, //montant TTC (HTnet + TVA)
3160 3160
 			'retenue_garantie' => 0,
3161 3161
 			'travaux_sup' => 0,
3162 3162
 			'HTnet' => 0, //montant HT
@@ -3186,7 +3186,7 @@  discard block
 block discarded – undo
3186 3186
 					$isFirstSituation = false;
3187 3187
 					if (!empty($l->fk_prev_id)) {
3188 3188
 						$prevSituationPercent = $l->get_prev_progress($previousInvoice->id, true);
3189
-					} elseif (! array_key_exists($i + 1, $TPreviousInvoices)) {
3189
+					} elseif (!array_key_exists($i + 1, $TPreviousInvoices)) {
3190 3190
 						$isFirstSituation = true;
3191 3191
 					}
3192 3192
 
@@ -3196,7 +3196,7 @@  discard block
 block discarded – undo
3196 3196
 
3197 3197
 					//1ere ligne
3198 3198
 					$amounttva = $calc_ht * ($ltvatx / 100);
3199
-					if (! isset($TDataSituation['cumul_anterieur'][$ltvatx])) {
3199
+					if (!isset($TDataSituation['cumul_anterieur'][$ltvatx])) {
3200 3200
 						$TDataSituation['cumul_anterieur'][$ltvatx]['HT'] = $calc_ht;
3201 3201
 						$TDataSituation['cumul_anterieur'][$ltvatx]['TVA'] = $amounttva;
3202 3202
 					} else {
@@ -3208,14 +3208,14 @@  discard block
 block discarded – undo
3208 3208
 					//le grand total de TVA
3209 3209
 					// $TDataSituation['cumul_anterieur']['TVA'] += $amounttva;
3210 3210
 
3211
-					if (empty($l->fk_prev_id) && ! $isFirstSituation) {
3211
+					if (empty($l->fk_prev_id) && !$isFirstSituation) {
3212 3212
 						// TODO: à clarifier, mais pour moi, un facture de situation précédente qui a des progressions à 0% c'est pas logique
3213 3213
 						$TDataSituation['cumul_anterieur']['travaux_sup'] += $calc_ht;
3214 3214
 					}
3215 3215
 				}
3216 3216
 			}
3217 3217
 
3218
-			if (! empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) {
3218
+			if (!empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) {
3219 3219
 				$retenue_garantie_anterieure += $previousInvoice->getRetainedWarrantyAmount();
3220 3220
 			}
3221 3221
 
@@ -3229,7 +3229,7 @@  discard block
 block discarded – undo
3229 3229
 		// print json_encode($facDerniereSituation->lines);exit;
3230 3230
 		$TDataSituation['current'] = $this->btpGetInvoiceAmounts($object->id);
3231 3231
 
3232
-		if (! empty($facDerniereSituation->lines)) {
3232
+		if (!empty($facDerniereSituation->lines)) {
3233 3233
 			$TFacLinesKey = array_keys($facDerniereSituation->lines);
3234 3234
 			$TObjectLinesKey = array_keys($object->lines);
3235 3235
 			$TDiffKey = array_diff($TObjectLinesKey, $TFacLinesKey);
@@ -3441,16 +3441,16 @@  discard block
 block discarded – undo
3441 3441
 		$facDerniereSituation = $TPreviousInvoices[0];
3442 3442
 
3443 3443
 		$ret = array(
3444
-			'HT' => 0,	//montant HT normal
3444
+			'HT' => 0, //montant HT normal
3445 3445
 			'HTnet' => 0, //montant HT
3446
-			'TVA' => 0,   //montant de la TVA sur le HTnet
3447
-			'TTC' => 0,   //montant TTC (HTnet + TVA)
3446
+			'TVA' => 0, //montant de la TVA sur le HTnet
3447
+			'TTC' => 0, //montant TTC (HTnet + TVA)
3448 3448
 			'retenue_garantie' => 0,
3449 3449
 			'travaux_sup' => 0,
3450 3450
 			'total_a_payer' => 0 //montant "a payer" sur la facture
3451 3451
 		);
3452 3452
 
3453
-		if (! empty($facDerniereSituation)) {
3453
+		if (!empty($facDerniereSituation)) {
3454 3454
 			$ret['derniere_situation'] = $facDerniereSituation;
3455 3455
 			$ret['date_derniere_situation'] = $facDerniereSituation->date;
3456 3456
 		}
@@ -3584,7 +3584,7 @@  discard block
 block discarded – undo
3584 3584
 			$label = $outputlangs->transnoentities("SituationInvoiceTotalProposal");
3585 3585
 			$pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', false, 1, $posx, $posy + 1);
3586 3586
 
3587
-			$amount = price($sign * ($total_ht + (! empty($propal->remise) ? $propal->remise : 0)));
3587
+			$amount = price($sign * ($total_ht + (!empty($propal->remise) ? $propal->remise : 0)));
3588 3588
 			$pdf->MultiCell($width2, 3, $amount, 0, 'R', false, 1, $posx + $width, $posy + 1);
3589 3589
 
3590 3590
 			$pdf->SetFont('', '', $default_font_size - 1);
@@ -3627,7 +3627,7 @@  discard block
 block discarded – undo
3627 3627
 
3628 3628
 		$force_to_zero = false;
3629 3629
 
3630
-		$idinv = 0;//count($previousinvoices);
3630
+		$idinv = 0; //count($previousinvoices);
3631 3631
 		while ($idinv < count($previousinvoices)) {
3632 3632
 			$invoice = $previousinvoices[$idinv];
3633 3633
 
@@ -3649,7 +3649,7 @@  discard block
 block discarded – undo
3649 3649
 				$force_to_zero = true;
3650 3650
 			}
3651 3651
 
3652
-			$ref .= ' - '. $invoice->ref;
3652
+			$ref .= ' - '.$invoice->ref;
3653 3653
 			$ref .= ' ('.dol_print_date($invoice->date, "%d/%m/%Y", false, $outputlangs).')';
3654 3654
 			$pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', false);
3655 3655
 
@@ -3680,7 +3680,7 @@  discard block
 block discarded – undo
3680 3680
 				if (($invoice->lines[$i]->info_bits & 0x01) == 0x01) {
3681 3681
 					$vatrate .= '*';
3682 3682
 				}
3683
-				if (! isset($tvas[$vatrate])) {
3683
+				if (!isset($tvas[$vatrate])) {
3684 3684
 					$tvas[$vatrate] = 0;
3685 3685
 				}
3686 3686
 				$tvas[$vatrate] += $tvaligne;
@@ -3858,7 +3858,7 @@  discard block
 block discarded – undo
3858 3858
 						$pdf->SetXY($posx + $width4, $posy + $height * $index + $y);
3859 3859
 						$pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', false);
3860 3860
 						$pdf->SetXY($posx + $width4 * 2, $posy + $height * $index + $y);
3861
-						$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $payment['type']);
3861
+						$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$payment['type']);
3862 3862
 
3863 3863
 						$pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', false);
3864 3864
 						$pdf->SetXY($posx + $width4 * 3, $posy + $height * $index + $y);
@@ -3889,7 +3889,7 @@  discard block
 block discarded – undo
3889 3889
 					$this->_pagehead($pdf, $object, 0, $outputlangs);
3890 3890
 				}
3891 3891
 				$pdf->setPage($pageposafter + 1);
3892
-				$pdf->setPageOrientation('', true, 0);	// The only function to edit the bottom margin of current page to set it.
3892
+				$pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it.
3893 3893
 
3894 3894
 				$posy = $this->tab_top_newpage + 1;
3895 3895
 			} else {
@@ -3921,7 +3921,7 @@  discard block
 block discarded – undo
3921 3921
 
3922 3922
 		$posy += 10;
3923 3923
 
3924
-		$pdf->setPageOrientation('', true, 0);	// The only function to edit the bottom margin of current page to set it.
3924
+		$pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it.
3925 3925
 
3926 3926
 		$pdf->SetTextColor(0, 0, 60);
3927 3927
 		$pdf->SetFont('', '', $default_font_size - 1);
Please login to merge, or discard this patch.
htdocs/core/modules/facture/doc/pdf_crabe.modules.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		$this->situationinvoice = false;
176 176
 
177 177
 		if ($mysoc === null) {
178
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
178
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
179 179
 			return;
180 180
 		}
181 181
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 					if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) {
338 338
 						$logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity];
339 339
 					}
340
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
340
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
341 341
 					$tplidx = $pdf->importPage(1);
342 342
 				}
343 343
 
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 				// $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher
452 452
 
453 453
 				// $tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks)
454
-				$tab_top = 90 + $top_shift;		// top_shift is an addition for linked objects or addons (0 in most cases)
454
+				$tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases)
455 455
 				$tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
456 456
 
457 457
 				// You can add more thing under header here, if you increase $extra_under_address_shift too.
@@ -783,11 +783,11 @@  discard block
 block discarded – undo
783 783
 					if (!isset($this->tva[$vatrate])) {
784 784
 						$this->tva[$vatrate] = 0;
785 785
 					}
786
-					$this->tva[$vatrate] += $tvaligne;	// ->tva is abandoned, we use now ->tva_array that is more complete
786
+					$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
787 787
 					$vatcode = $object->lines[$i]->vat_src_code;
788 788
 					if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
789 789
 						if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) {
790
-							$this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0;
790
+							$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0;
791 791
 						}
792 792
 						$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne, 'tot_ht' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] + $object->lines[$i]->total_ht);
793 793
 					} else {
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 				// Pagefoot
878 878
 				$this->_pagefoot($pdf, $object, $outputlangs, 0, $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs));
879 879
 				if (method_exists($pdf, 'AliasNbPages')) {
880
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
880
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
881 881
 				}
882 882
 
883 883
 				// Add terms to sale
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 			foreach ($this->tva_array as $tvakey => $tvaval) {
1195 1195
 				$pdf->SetFont('', '', $default_font_size - 2);
1196 1196
 				$pdf->SetXY($this->marge_gauche, $posy);
1197
-				$titre = round((float) $tvakey, 2) . "%";
1197
+				$titre = round((float) $tvakey, 2)."%";
1198 1198
 				$pdf->MultiCell(25, 4, $titre, 0, 'L');
1199 1199
 
1200 1200
 				$pdf->SetFont('', '', $default_font_size - 2);
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
 		}
1237 1237
 
1238 1238
 		$posxval = 52;
1239
-		$posxend = 110;	// End of x for text on left side
1239
+		$posxend = 110; // End of x for text on left side
1240 1240
 		if ($this->page_largeur < 210) { // To work with US executive format
1241 1241
 			$posxend -= 10;
1242 1242
 		}
@@ -1245,13 +1245,13 @@  discard block
 block discarded – undo
1245 1245
 		if ($object->status > Facture::STATUS_DRAFT && getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) {
1246 1246
 			// All customer previous invoices
1247 1247
 			$sql = "SELECT f.rowid, f.datef, f.total_ttc";
1248
-			$sql.= " FROM " . MAIN_DB_PREFIX . "facture as f";
1249
-			$sql.= " WHERE f.fk_soc = " . ((int) $object->socid);
1250
-			$sql.= " AND f.entity IN (" . getEntity('invoice') . ")";
1251
-			$sql.= " AND f.datef <= '" . $this->db->idate($object->date) . "'";
1252
-			$sql.= " AND f.rowid < " . ((int) $object->id);
1253
-			$sql.= " AND f.fk_statut > 0";
1254
-			$sql.= " ORDER BY f.datef ASC";
1248
+			$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
1249
+			$sql .= " WHERE f.fk_soc = ".((int) $object->socid);
1250
+			$sql .= " AND f.entity IN (".getEntity('invoice').")";
1251
+			$sql .= " AND f.datef <= '".$this->db->idate($object->date)."'";
1252
+			$sql .= " AND f.rowid < ".((int) $object->id);
1253
+			$sql .= " AND f.fk_statut > 0";
1254
+			$sql .= " ORDER BY f.datef ASC";
1255 1255
 
1256 1256
 			$old_balance = 0;
1257 1257
 			$invoices = array();
@@ -1266,12 +1266,12 @@  discard block
 block discarded – undo
1266 1266
 
1267 1267
 			// All payments before current date
1268 1268
 			$sql_payments = "SELECT p.datep, pf.fk_facture, pf.amount";
1269
-			$sql_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf";
1270
-			$sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement";
1271
-			$sql_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture";
1272
-			$sql_payments.= " WHERE f.fk_soc = " . ((int) $object->socid);
1273
-			$sql_payments.= " AND p.datep < '" . $this->db->idate($object->date) . "'";
1274
-			$sql_payments.= " ORDER BY p.datep ASC";
1269
+			$sql_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf";
1270
+			$sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
1271
+			$sql_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture";
1272
+			$sql_payments .= " WHERE f.fk_soc = ".((int) $object->socid);
1273
+			$sql_payments .= " AND p.datep < '".$this->db->idate($object->date)."'";
1274
+			$sql_payments .= " ORDER BY p.datep ASC";
1275 1275
 
1276 1276
 			$total_payments = 0;
1277 1277
 			$resql_payments = $this->db->query($sql_payments);
@@ -1284,11 +1284,11 @@  discard block
 block discarded – undo
1284 1284
 
1285 1285
 			// Payments made on current invoice date (including current invoice)
1286 1286
 			$sql_current_date_payments = "SELECT p.datep, pf.fk_facture, pf.amount";
1287
-			$sql_current_date_payments.= " FROM " . MAIN_DB_PREFIX . "paiement_facture as pf";
1288
-			$sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as p ON p.rowid = pf.fk_paiement";
1289
-			$sql_current_date_payments.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = pf.fk_facture";
1290
-			$sql_current_date_payments.= " WHERE f.fk_soc = " . ((int) $object->socid);
1291
-			$sql_current_date_payments.= " AND DATE(p.datep) = DATE('" . $this->db->idate($object->date) . "')";
1287
+			$sql_current_date_payments .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf";
1288
+			$sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
1289
+			$sql_current_date_payments .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = pf.fk_facture";
1290
+			$sql_current_date_payments .= " WHERE f.fk_soc = ".((int) $object->socid);
1291
+			$sql_current_date_payments .= " AND DATE(p.datep) = DATE('".$this->db->idate($object->date)."')";
1292 1292
 
1293 1293
 			$current_date_payments = 0;
1294 1294
 			$resql_current_date = $this->db->query($sql_current_date_payments);
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 			$pdf->MultiCell($posxval - $this->marge_gauche + 8, 4, $titre, 0, 'L', true);
1313 1313
 
1314 1314
 			$pdf->SetFont('', '', $default_font_size - 2);
1315
-			$pdf->SetXY($posxval+8, $posy);
1315
+			$pdf->SetXY($posxval + 8, $posy);
1316 1316
 			$titre = $outputlangs->transnoentities("NewBalance").' : '.price($new_balance);
1317 1317
 			$pdf->MultiCell($posxend - $posxval - 8, 4, $titre, 0, 'L', true);
1318 1318
 
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
 			$lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement);
1333 1333
 			$pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L');
1334 1334
 
1335
-			$posy = $pdf->GetY() + 3;	// We need spaces for 2 lines payment conditions
1335
+			$posy = $pdf->GetY() + 3; // We need spaces for 2 lines payment conditions
1336 1336
 		}
1337 1337
 
1338 1338
 		// Show category of operations
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 
1345 1345
 			$pdf->SetFont('', '', $default_font_size - 2);
1346 1346
 			$pdf->SetXY($posxval, $posy);
1347
-			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
1347
+			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
1348 1348
 			$pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L');
1349 1349
 
1350 1350
 			$posy = $pdf->GetY() + 3; // for 2 lines
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
 						include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
1497 1497
 						$invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type);
1498 1498
 
1499
-						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1499
+						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1500 1500
 					}
1501 1501
 				}
1502 1502
 			}
@@ -1952,7 +1952,7 @@  discard block
 block discarded – undo
1952 1952
 		if (empty($hidetop)) {
1953 1953
 			// Show category of operations
1954 1954
 			if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) {
1955
-				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
1955
+				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
1956 1956
 				$pdf->SetXY($this->marge_gauche, $tab_top - 4);
1957 1957
 				$pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations);
1958 1958
 			}
@@ -2121,7 +2121,7 @@  discard block
 block discarded – undo
2121 2121
 		}
2122 2122
 		if ($this->situationinvoice) {
2123 2123
 			$outputlangs->loadLangs(array("other"));
2124
-			$title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -";
2124
+			$title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -";
2125 2125
 		}
2126 2126
 		if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
2127 2127
 			$title .= ' - ';
@@ -2356,7 +2356,7 @@  discard block
 block discarded – undo
2356 2356
 
2357 2357
 			$carac_client_name = is_object($thirdparty) ? pdfBuildThirdpartyName($thirdparty, $outputlangs) : '';
2358 2358
 
2359
-			$mode =  'target';
2359
+			$mode = 'target';
2360 2360
 			$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object);
2361 2361
 
2362 2362
 			// Show recipient
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
 				if (!empty($carac_client_shipping)) {
2412 2412
 					$posy += $hautcadre;
2413 2413
 
2414
-					$hautcadre -= 10;	// Height for the shipping address does not need to be as high as main box
2414
+					$hautcadre -= 10; // Height for the shipping address does not need to be as high as main box
2415 2415
 
2416 2416
 					// Show shipping frame
2417 2417
 					$pdf->SetXY($posx + 2, $posy - 5);
Please login to merge, or discard this patch.
htdocs/core/modules/propale/doc/pdf_azur.modules.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		$this->atleastonediscount = 0;
161 161
 
162 162
 		if ($mysoc === null) {
163
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
163
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
164 164
 			return;
165 165
 		}
166 166
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 					if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) {
330 330
 						$logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity];
331 331
 					}
332
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
332
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
333 333
 					$tplidx = $pdf->importPage(1);
334 334
 				}
335 335
 
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 				// Pied de page
767 767
 				$this->_pagefoot($pdf, $object, $outputlangs);
768 768
 				if (method_exists($pdf, 'AliasNbPages')) {
769
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
769
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
770 770
 				}
771 771
 
772 772
 				// Add terms to sale
@@ -1783,7 +1783,7 @@  discard block
 block discarded – undo
1783 1783
 
1784 1784
 			$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
1785 1785
 
1786
-			$mode =  'target';
1786
+			$mode = 'target';
1787 1787
 			$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object);
1788 1788
 
1789 1789
 			// Show recipient
Please login to merge, or discard this patch.
htdocs/core/modules/propale/doc/pdf_cyan.modules.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$this->atleastonediscount = 0;
136 136
 
137 137
 		if ($mysoc === null) {
138
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
138
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
139 139
 			return;
140 140
 		}
141 141
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 					if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) {
308 308
 						$logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity];
309 309
 					}
310
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
310
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
311 311
 					$tplidx = $pdf->importPage(1);
312 312
 				}
313 313
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 				$heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
349 349
 				//print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
350 350
 
351
-				$save_note_public = $object->note_public;	// Because $object->note_public may be modified by _pagehead() that calls pdf_writeLinkedObjects() that calls ... that modify $object->note_private
351
+				$save_note_public = $object->note_public; // Because $object->note_public may be modified by _pagehead() that calls pdf_writeLinkedObjects() that calls ... that modify $object->note_private
352 352
 
353 353
 				$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs, $outputlangsbis);
354 354
 				$pdf->SetFont('', '', $default_font_size - 1);
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 					}
401 401
 				}
402 402
 
403
-				$object->note_public = $save_note_public;	// Now that we have output the note_public, we can restore it to initial value.
403
+				$object->note_public = $save_note_public; // Now that we have output the note_public, we can restore it to initial value.
404 404
 
405 405
 				// Extrafields in note
406 406
 				$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 							$bg_color = colorStringToArray(getDolGlobalString("SUBTOTAL_BACK_COLOR_LEVEL_".abs($object->lines[$i]->qty)));
669 669
 							$pdf->SetFillColor($bg_color[0], $bg_color[1], $bg_color[2]);
670 670
 							$pdf->SetXY($pdf->GetX(), $curY);
671
-							$pdf->MultiCell($this->page_largeur - $this->marge_droite  - $this->marge_gauche, 6, '', 0, '', true);
671
+							$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 6, '', 0, '', true);
672 672
 							$previous_align = array();
673 673
 							$previous_align['align'] = $this->cols['desc']['content']['align'];
674 674
 							if ($object->lines[$i]->qty < 0) {
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 
954 954
 				// Add number of pages in footer
955 955
 				if (method_exists($pdf, 'AliasNbPages')) {
956
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
956
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
957 957
 				}
958 958
 
959 959
 				// Add terms to sale
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
 		$top_shift = 0;
1861 1861
 		// Show list of linked objects
1862 1862
 		$current_y = $pdf->getY();
1863
-		$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size);	// May modify $object->note_public
1863
+		$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size); // May modify $object->note_public
1864 1864
 		if ($current_y < $pdf->getY()) {
1865 1865
 			$top_shift = $pdf->getY() - $current_y;
1866 1866
 		}
@@ -1993,7 +1993,7 @@  discard block
 block discarded – undo
1993 1993
 				if (!empty($carac_client_shipping)) {
1994 1994
 					$posy += $hautcadre;
1995 1995
 
1996
-					$hautcadre -= 10;	// Height for the shipping address does not need to be as high as main box
1996
+					$hautcadre -= 10; // Height for the shipping address does not need to be as high as main box
1997 1997
 
1998 1998
 					// Show shipping frame
1999 1999
 					$pdf->SetXY($posx + 2, $posy - 5);
Please login to merge, or discard this patch.
htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 		$this->atleastonediscount = 0;
130 130
 
131 131
 		if ($mysoc === null) {
132
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
132
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
133 133
 			return;
134 134
 		}
135 135
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 					if (!empty($conf->mycompany->multidir_output[$object->entity ?? $conf->entity])) {
298 298
 						$logodir = $conf->mycompany->multidir_output[$object->entity ?? $conf->entity];
299 299
 					}
300
-					$pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
300
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
301 301
 					$tplidx = $pdf->importPage(1);
302 302
 				}
303 303
 
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 				// Pagefoot
809 809
 				$this->_pagefoot($pdf, $object, $outputlangs);
810 810
 				if (method_exists($pdf, 'AliasNbPages')) {
811
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
811
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
812 812
 				}
813 813
 
814 814
 				$pdf->Close();
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 	protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
853 853
 	{
854 854
 		global $conf, $mysoc;
855
-		'@phan-var-force Commande|Propal|Facture $object';  // availability_code,... does not exist on Facture.
855
+		'@phan-var-force Commande|Propal|Facture $object'; // availability_code,... does not exist on Facture.
856 856
 
857 857
 		$default_font_size = pdf_getPDFFontSize($outputlangs);
858 858
 
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 			// Show recipient
1450 1450
 			$widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100;
1451 1451
 			if ($this->page_largeur < 210) {
1452
-				$widthrecbox = 84;	// To work with US executive format
1452
+				$widthrecbox = 84; // To work with US executive format
1453 1453
 			}
1454 1454
 			$posy = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
1455 1455
 			$posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
Please login to merge, or discard this patch.