Completed
Branch develop (5c36b5)
by
unknown
18:18
created
htdocs/accountancy/expensereport/card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
 /*
89 89
  * View
90 90
  */
91
-$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables';
91
+$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables';
92 92
 
93 93
 llxHeader("", $langs->trans('FicheVentilation'), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-expensereport page-card');
94 94
 
Please login to merge, or discard this patch.
htdocs/accountancy/journal/sellsjournal.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
141 141
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
142 142
 if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
143
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
143
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
144 144
 }
145 145
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
146 146
 $sql .= " JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
147 147
 $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
148 148
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
149
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
149
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
150 150
 }
151 151
 $parameters = array();
152 152
 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
 		//$compta_revenuestamp = getDolGlobalString('ACCOUNTING_REVENUESTAMP_SOLD_ACCOUNT', 'NotDefined');
223 223
 
224
-		$tax_id = $obj->tva_tx . ($obj->vat_src_code ? ' (' . $obj->vat_src_code . ')' : '');
224
+		$tax_id = $obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '');
225 225
 		if (array_key_exists($tax_id, $vatdata_cache)) {
226 226
 			$vatdata = $vatdata_cache[$tax_id];
227 227
 		} else {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 		// Move a part of the retained warrenty into the account of warranty
300 300
 		if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY') && $obj->retained_warranty > 0) {
301
-			$retained_warranty = (float) price2num($total_ttc * $obj->retained_warranty / 100, 'MT');	// Calculate the amount of warrenty for this line (using the percent value)
301
+			$retained_warranty = (float) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value)
302 302
 			$tabwarranty[$obj->rowid][$compta_soc] += $retained_warranty;
303 303
 			$total_ttc -= $retained_warranty;
304 304
 		}
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 					$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY');
490 490
 					$bookkeeping->label_compte = $accountingaccountcustomerwarranty->label;
491 491
 
492
-					$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Retainedwarranty");
492
+					$bookkeeping->label_operation = dol_trunc($companystatic->name, 16).' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty");
493 493
 					$bookkeeping->montant = $mt;
494 494
 					$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
495 495
 					$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 					}
568 568
 				} else {
569 569
 					if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
570
-						require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
570
+						require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php';
571 571
 						$lettering_static = new Lettering($db);
572 572
 
573 573
 						$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id));
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 		// Product / Service
580 580
 		if (!$errorforline) {
581 581
 			foreach ($tabht[$key] as $k => $mt) {
582
-				$resultfetch = $accountingaccount->fetch(null, $k, true);	// TODO Use a cache
582
+				$resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache
583 583
 				$label_account = $accountingaccount->label;
584 584
 
585 585
 				// get compte id and label
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 
656 656
 				foreach ($arrayofvat[$key] as $k => $mt) {
657 657
 					if ($mt) {
658
-						$accountingaccount->fetch(null, $k, true);	// TODO Use a cache for label
658
+						$accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
659 659
 						$label_account = $accountingaccount->label;
660 660
 
661 661
 						$bookkeeping = new BookKeeping($db);
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 			if (isset($tabrevenuestamp[$key]) && is_array($tabrevenuestamp[$key])) {
717 717
 				foreach ($tabrevenuestamp[$key] as $k => $mt) {
718 718
 					if ($mt) {
719
-						$accountingaccount->fetch(null, $k, true);    // TODO Use a cache for label
719
+						$accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
720 720
 						$label_account = $accountingaccount->label;
721 721
 
722 722
 						$bookkeeping = new BookKeeping($db);
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
 						$bookkeeping->numero_compte = $k;
736 736
 						$bookkeeping->label_compte = $label_account;
737 737
 
738
-						$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("RevenueStamp");
738
+						$bookkeeping->label_operation = dol_trunc($companystatic->name, 16).' - '.$invoicestatic->ref.' - '.$langs->trans("RevenueStamp");
739 739
 						$bookkeeping->montant = $mt;
740 740
 						$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
741 741
 						$bookkeeping->debit = ($mt < 0) ? -$mt : 0;
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 	foreach ($tabfac as $key => $val) {
838 838
 		$companystatic->id = $tabcompany[$key]['id'];
839 839
 		$companystatic->name = $tabcompany[$key]['name'];
840
-		$companystatic->code_compta = $tabcompany[$key]['code_compta'];				// deprecated
840
+		$companystatic->code_compta = $tabcompany[$key]['code_compta']; // deprecated
841 841
 		$companystatic->code_compta_client = $tabcompany[$key]['code_compta'];
842 842
 		$companystatic->code_client = $tabcompany[$key]['code_client'];
843 843
 		$companystatic->client = 3;
@@ -982,7 +982,7 @@  discard block
 block discarded – undo
982 982
 
983 983
 if (empty($action) || $action == 'view') {
984 984
 	$title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1);
985
-	$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
985
+	$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
986 986
 	llxHeader('', dol_string_nohtmltag($title), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-generation page-sellsjournal');
987 987
 
988 988
 	$nom = $title;
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
 	}
1026 1026
 
1027 1027
 	// Button to write into Ledger
1028
-	$acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['','-1']);
1028
+	$acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['', '-1']);
1029 1029
 	if ($acctCustomerNotConfigured) {
1030 1030
 		print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
1031 1031
 		$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
@@ -1159,13 +1159,13 @@  discard block
 block discarded – undo
1159 1159
 			foreach ($tabwarranty[$key] as $k => $mt) {
1160 1160
 				print '<tr class="oddeven">';
1161 1161
 				print "<!-- Thirdparty warranty -->";
1162
-				print "<td>" . $date . "</td>";
1163
-				print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
1162
+				print "<td>".$date."</td>";
1163
+				print "<td>".$invoicestatic->getNomUrl(1)."</td>";
1164 1164
 				// Account
1165 1165
 				print "<td>";
1166 1166
 				$accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY'));
1167 1167
 				if (($accountoshow == "") || $accountoshow == 'NotDefined') {
1168
-					print '<span class="error">' . $langs->trans("MainAccountForRetainedWarrantyNotDefined") . '</span>';
1168
+					print '<span class="error">'.$langs->trans("MainAccountForRetainedWarrantyNotDefined").'</span>';
1169 1169
 				} else {
1170 1170
 					print $accountoshow;
1171 1171
 				}
@@ -1174,14 +1174,14 @@  discard block
 block discarded – undo
1174 1174
 				print "<td>";
1175 1175
 				$accountoshow = length_accounta($k);
1176 1176
 				if (($accountoshow == "") || $accountoshow == 'NotDefined') {
1177
-					print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>';
1177
+					print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
1178 1178
 				} else {
1179 1179
 					print $accountoshow;
1180 1180
 				}
1181 1181
 				print '</td>';
1182
-				print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Retainedwarranty") . "</td>";
1183
-				print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>";
1184
-				print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>";
1182
+				print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty")."</td>";
1183
+				print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
1184
+				print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
1185 1185
 				print "</tr>";
1186 1186
 			}
1187 1187
 		}
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
 					print length_accounta($tabcompany[$key]['code_compta']);
1244 1244
 				}
1245 1245
 			} elseif (($accountoshow == "") || $accountoshow == 'NotDefined') {
1246
-				print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>';
1246
+				print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
1247 1247
 			}
1248 1248
 			print '</td>';
1249 1249
 			$companystatic->id = $tabcompany[$key]['id'];
@@ -1307,13 +1307,13 @@  discard block
 block discarded – undo
1307 1307
 			foreach ($tabrevenuestamp[$key] as $k => $mt) {
1308 1308
 				print '<tr class="oddeven">';
1309 1309
 				print "<!-- Thirdparty revenuestamp -->";
1310
-				print "<td>" . $date . "</td>";
1311
-				print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
1310
+				print "<td>".$date."</td>";
1311
+				print "<td>".$invoicestatic->getNomUrl(1)."</td>";
1312 1312
 				// Account
1313 1313
 				print "<td>";
1314 1314
 				$accountoshow = length_accountg($k);
1315 1315
 				if (($accountoshow == "") || $accountoshow == 'NotDefined') {
1316
-					print '<span class="error">' . $langs->trans("MainAccountForRevenueStampSaleNotDefined") . '</span>';
1316
+					print '<span class="error">'.$langs->trans("MainAccountForRevenueStampSaleNotDefined").'</span>';
1317 1317
 				} else {
1318 1318
 					print $accountoshow;
1319 1319
 				}
@@ -1321,9 +1321,9 @@  discard block
 block discarded – undo
1321 1321
 				// Subledger account
1322 1322
 				print "<td>";
1323 1323
 				print '</td>';
1324
-				print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("RevenueStamp") . "</td>";
1325
-				print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>";
1326
-				print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>";
1324
+				print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("RevenueStamp")."</td>";
1325
+				print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
1326
+				print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
1327 1327
 				print "</tr>";
1328 1328
 			}
1329 1329
 		}
Please login to merge, or discard this patch.
htdocs/accountancy/journal/variousjournal.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 		$filename = 'journal';
144 144
 		$type_export = 'journal';
145 145
 
146
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
146
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
147 147
 		include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
148 148
 
149 149
 		print $result;
@@ -155,15 +155,15 @@  discard block
 block discarded – undo
155 155
 
156 156
 // Must reload data, so we make a redirect
157 157
 if ($reload) {
158
-	$param = 'id_journal=' . $id_journal;
159
-	$param .= '&date_startday=' . $date_startday;
160
-	$param .= '&date_startmonth=' . $date_startmonth;
161
-	$param .= '&date_startyear=' . $date_startyear;
162
-	$param .= '&date_endday=' . $date_endday;
163
-	$param .= '&date_endmonth=' . $date_endmonth;
164
-	$param .= '&date_endyear=' . $date_endyear;
165
-	$param .= '&in_bookkeeping=' . $in_bookkeeping;
166
-	header("Location: " . $_SERVER['PHP_SELF'] . ($param ? '?' . $param : ''));
158
+	$param = 'id_journal='.$id_journal;
159
+	$param .= '&date_startday='.$date_startday;
160
+	$param .= '&date_startmonth='.$date_startmonth;
161
+	$param .= '&date_startyear='.$date_startyear;
162
+	$param .= '&date_endday='.$date_endday;
163
+	$param .= '&date_endmonth='.$date_endmonth;
164
+	$param .= '&date_endyear='.$date_endyear;
165
+	$param .= '&in_bookkeeping='.$in_bookkeeping;
166
+	header("Location: ".$_SERVER['PHP_SELF'].($param ? '?'.$param : ''));
167 167
 	exit;
168 168
 }
169 169
 
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 	$account_accounting_not_defined = false;
196 196
 }
197 197
 
198
-$title = $langs->trans("GenerationOfAccountingEntries") . ' - ' . $object->getNomUrl(0, 2, 1, '', 1);
199
-$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
198
+$title = $langs->trans("GenerationOfAccountingEntries").' - '.$object->getNomUrl(0, 2, 1, '', 1);
199
+$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
200 200
 llxHeader('', dol_string_nohtmltag($title), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-generation page-variousjournal');
201 201
 
202 202
 $nom = $title;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 $periodlink = '';
205 205
 $exportlink = '';
206 206
 $builddate = dol_now();
207
-$description = $langs->trans("DescJournalOnlyBindedVisible") . '<br>';
207
+$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
208 208
 if ($object->nature == 2 || $object->nature == 3) {
209 209
 	if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
210 210
 		$description .= $langs->trans("DepositsAreNotIncluded");
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 }
218 218
 
219 219
 $listofchoices = array('notyet' => $langs->trans("NotYetInGeneralLedger"), 'already' => $langs->trans("AlreadyInGeneralLedger"));
220
-$period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0);
221
-$period .= ' -  ' . $langs->trans("JournalizationInLedgerStatus") . ' ' . $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
220
+$period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0);
221
+$period .= ' -  '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
222 222
 
223
-$varlink = 'id_journal=' . $id_journal;
223
+$varlink = 'id_journal='.$id_journal;
224 224
 
225 225
 journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
226 226
 
@@ -246,16 +246,16 @@  discard block
 block discarded – undo
246 246
 if ($object->nature == 4) { // Bank journal
247 247
 	// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
248 248
 	$sql = "SELECT COUNT(rowid) as nb";
249
-	$sql .= " FROM " . MAIN_DB_PREFIX . "bank_account";
250
-	$sql .= " WHERE entity = " . (int) $conf->entity;
249
+	$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
250
+	$sql .= " WHERE entity = ".(int) $conf->entity;
251 251
 	$sql .= " AND fk_accountancy_journal IS NULL";
252 252
 	$sql .= " AND clos=0";
253 253
 	$resql = $db->query($sql);
254 254
 	if ($resql) {
255 255
 		$obj = $db->fetch_object($resql);
256 256
 		if ($obj->nb > 0) {
257
-			print '<br>' . img_warning() . ' ' . $langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
258
-			print ' : ' . $langs->trans("AccountancyAreaDescBank", 9, '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("BankAccounts") . '</strong>');
257
+			print '<br>'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
258
+			print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>');
259 259
 		}
260 260
 	} else {
261 261
 		dol_print_error($db);
@@ -264,21 +264,21 @@  discard block
 block discarded – undo
264 264
 
265 265
 // Button to write into Ledger
266 266
 if ($some_mandatory_steps_of_setup_were_not_done) {
267
-	print '<br><div class="warning">' . img_warning() . ' ' . $langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
268
-	print ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("MenuDefaultAccounts") . '</strong>');
267
+	print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
268
+	print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
269 269
 	print '</div>';
270 270
 }
271 271
 print '<br><div class="tabsAction tabsActionNoBottom centerimp">';
272 272
 if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL') && $in_bookkeeping == 'notyet') {
273
-	print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
273
+	print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
274 274
 }
275 275
 if ($account_accounting_not_defined) {
276
-	print '<input type="button" class="butActionRefused classfortooltip" title="' . dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")) . '" value="' . $langs->trans("WriteBookKeeping") . '" />';
276
+	print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
277 277
 } else {
278 278
 	if ($in_bookkeeping == 'notyet') {
279
-		print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
279
+		print '<input type="button" class="butAction" name="writebookkeeping" value="'.$langs->trans("WriteBookKeeping").'" onclick="writebookkeeping();" />';
280 280
 	} else {
281
-		print '<a href="#" class="butActionRefused classfortooltip" name="writebookkeeping">' . $langs->trans("WriteBookKeeping") . '</a>';
281
+		print '<a href="#" class="butActionRefused classfortooltip" name="writebookkeeping">'.$langs->trans("WriteBookKeeping").'</a>';
282 282
 	}
283 283
 }
284 284
 print '</div>';
@@ -316,16 +316,16 @@  discard block
 block discarded – undo
316 316
 print '<div class="div-table-responsive">';
317 317
 print '<table class="noborder centpercent">';
318 318
 print '<tr class="liste_titre">';
319
-print '<td>' . $langs->trans("Date") . '</td>';
320
-print '<td>' . $langs->trans("Piece") . ' (' . $object_label . ')</td>';
321
-print '<td>' . $langs->trans("AccountAccounting") . '</td>';
322
-print '<td>' . $langs->trans("SubledgerAccount") . '</td>';
323
-print '<td>' . $langs->trans("LabelOperation") . '</td>';
319
+print '<td>'.$langs->trans("Date").'</td>';
320
+print '<td>'.$langs->trans("Piece").' ('.$object_label.')</td>';
321
+print '<td>'.$langs->trans("AccountAccounting").'</td>';
322
+print '<td>'.$langs->trans("SubledgerAccount").'</td>';
323
+print '<td>'.$langs->trans("LabelOperation").'</td>';
324 324
 if ($object->nature == 4) {
325
-	print '<td class="center">' . $langs->trans("PaymentMode") . '</td>';
325
+	print '<td class="center">'.$langs->trans("PaymentMode").'</td>';
326 326
 } // bank
327
-print '<td class="right">' . $langs->trans("AccountingDebit") . '</td>';
328
-print '<td class="right">' . $langs->trans("AccountingCredit") . '</td>';
327
+print '<td class="right">'.$langs->trans("AccountingDebit").'</td>';
328
+print '<td class="right">'.$langs->trans("AccountingCredit").'</td>';
329 329
 print "</tr>\n";
330 330
 
331 331
 if (is_array($journal_data) && !empty($journal_data)) {
@@ -333,16 +333,16 @@  discard block
 block discarded – undo
333 333
 		foreach ($element['blocks'] as $lines) {
334 334
 			foreach ($lines as $line) {
335 335
 				print '<tr class="oddeven">';
336
-				print '<td>' . $line['date'] . '</td>';
337
-				print '<td>' . $line['piece'] . '</td>';
338
-				print '<td>' . $line['account_accounting'] . '</td>';
339
-				print '<td>' . $line['subledger_account'] . '</td>';
340
-				print '<td>' . $line['label_operation'] . '</td>';
336
+				print '<td>'.$line['date'].'</td>';
337
+				print '<td>'.$line['piece'].'</td>';
338
+				print '<td>'.$line['account_accounting'].'</td>';
339
+				print '<td>'.$line['subledger_account'].'</td>';
340
+				print '<td>'.$line['label_operation'].'</td>';
341 341
 				if ($object->nature == 4) {
342
-					print '<td class="center">' . $line['payment_mode'] . '</td>';
342
+					print '<td class="center">'.$line['payment_mode'].'</td>';
343 343
 				}
344
-				print '<td class="right nowraponall">' . $line['debit'] . '</td>';
345
-				print '<td class="right nowraponall">' . $line['credit'] . '</td>';
344
+				print '<td class="right nowraponall">'.$line['debit'].'</td>';
345
+				print '<td class="right nowraponall">'.$line['credit'].'</td>';
346 346
 				print '</tr>';
347 347
 
348 348
 				$i++;
Please login to merge, or discard this patch.
htdocs/accountancy/journal/purchasesjournal.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as fd";
138 138
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
139 139
 if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
140
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
140
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
141 141
 }
142 142
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
143 143
 $sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
144 144
 $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
145 145
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
146 146
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
147
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
147
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity);
148 148
 }
149 149
 $parameters = array();
150 150
 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	$cpttva = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
201 201
 	$rcctva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined');
202 202
 	$rcdtva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined');
203
-	$country_code_in_EEC = getCountriesInEEC();		// This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
203
+	$country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
204 204
 
205 205
 	$i = 0;
206 206
 	while ($i < $num) {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			}
219 219
 		}
220 220
 
221
-		$tax_id = $obj->tva_tx . ($obj->vat_src_code ? ' (' . $obj->vat_src_code . ')' : '');
221
+		$tax_id = $obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '');
222 222
 		if (array_key_exists($tax_id, $vatdata_cache)) {
223 223
 			$vatdata = $vatdata_cache[$tax_id];
224 224
 		} else {
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 		// VAT Reverse charge
269 269
 		if (($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) && $obj->vat_reverse_charge == 1 && in_array($obj->country_code, $country_code_in_EEC)) {
270
-			$rcvatdata = getTaxesFromId($obj->product_buy_vat . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : ''), $mysoc, $mysoc, 0);
270
+			$rcvatdata = getTaxesFromId($obj->product_buy_vat.($obj->product_buy_default_vat_code ? ' ('.$obj->product_buy_default_vat_code.')' : ''), $mysoc, $mysoc, 0);
271 271
 			$rcc_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva);
272 272
 			$rcd_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva);
273 273
 			$rcc_compta_localtax1 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 			$rcc_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva);
276 276
 			$rcd_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva);
277 277
 			if (price2num($obj->product_buy_vat) || !empty($obj->product_buy_default_vat_code)) {
278
-				$vat_key = vatrate($obj->product_buy_vat) . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : '');
278
+				$vat_key = vatrate($obj->product_buy_vat).($obj->product_buy_default_vat_code ? ' ('.$obj->product_buy_default_vat_code.')' : '');
279 279
 				$val_value = $vat_key;
280 280
 				$def_tva[$obj->rowid][$rcc_compta_tva][$vat_key] = $val_value;
281 281
 				$def_tva[$obj->rowid][$rcd_compta_tva][$vat_key] = $val_value;
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     fk_facture_fourn,
368 368
     COUNT(fd.rowid) as nb
369 369
 FROM
370
-    " . MAIN_DB_PREFIX . "facture_fourn_det as fd
370
+    " . MAIN_DB_PREFIX."facture_fourn_det as fd
371 371
 WHERE
372 372
     fd.product_type <= 2
373 373
     AND fd.fk_code_ventilation <= 0
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 					}
495 495
 				} else {
496 496
 					if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
497
-						require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
497
+						require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php';
498 498
 						$lettering_static = new Lettering($db);
499 499
 
500 500
 						$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id));
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 		// Product / Service
507 507
 		if (!$errorforline) {
508 508
 			foreach ($tabht[$key] as $k => $mt) {
509
-				$resultfetch = $accountingaccount->fetch(null, $k, true);	// TODO Use a cache
509
+				$resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache
510 510
 				$label_account = $accountingaccount->label;
511 511
 
512 512
 				// get compte id and label
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
 				foreach ($arrayofvat[$key] as $k => $mt) {
608 608
 					if ($mt) {
609
-						$accountingaccount->fetch(null, $k, true);		// TODO Use a cache for label
609
+						$accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
610 610
 						$label_account = $accountingaccount->label;
611 611
 
612 612
 						$bookkeeping = new BookKeeping($db);
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 
922 922
 if (empty($action) || $action == 'view') {
923 923
 	$title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1);
924
-	$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
924
+	$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
925 925
 	llxHeader('', dol_string_nohtmltag($title), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-generation page-purchasesjournal');
926 926
 
927 927
 	$nom = $title;
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 	}
965 965
 
966 966
 	// Button to write into Ledger
967
-	$acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['','-1']);
967
+	$acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['', '-1']);
968 968
 	if ($acctSupplierNotConfigured) {
969 969
 		print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
970 970
 		$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 					print length_accounta($tabcompany[$key]['code_compta']);
1152 1152
 				}
1153 1153
 			} elseif (($accountoshow == "") || $accountoshow == 'NotDefined') {
1154
-				print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>';
1154
+				print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
1155 1155
 			}
1156 1156
 			print '</td>';
1157 1157
 			$companystatic->id = $tabcompany[$key]['id'];
Please login to merge, or discard this patch.
htdocs/accountancy/journal/bankjournal.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
155 155
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid";
156 156
 if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
157
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = " . ((int) $conf->entity);
157
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = ".((int) $conf->entity);
158 158
 }
159 159
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
160 160
 $sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal);
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 			// Line into bank account
668 668
 			foreach ($tabbq[$key] as $k => $mt) {
669 669
 				if ($mt) {
670
-					$accountingaccount->fetch(null, $k, true);	// $k is accounting bank account. TODO We should use a cache here to avoid this fetch
670
+					$accountingaccount->fetch(null, $k, true); // $k is accounting bank account. TODO We should use a cache here to avoid this fetch
671 671
 					$account_label = $accountingaccount->label;
672 672
 
673 673
 					$reflabel = '';
@@ -783,43 +783,43 @@  discard block
 block discarded – undo
783 783
 						} elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) {   // If payment is payment of social contribution
784 784
 							$bookkeeping->subledger_account = '';
785 785
 							$bookkeeping->subledger_label = '';
786
-							$accountingaccount->fetch(null, $k, true);	// TODO Use a cache
786
+							$accountingaccount->fetch(null, $k, true); // TODO Use a cache
787 787
 							$bookkeeping->numero_compte = $k;
788 788
 							$bookkeeping->label_compte = $accountingaccount->label;
789 789
 						} elseif ($tabtype[$key] == 'payment_vat') {
790 790
 							$bookkeeping->subledger_account = '';
791 791
 							$bookkeeping->subledger_label = '';
792
-							$accountingaccount->fetch(null, $k, true);		// TODO Use a cache
792
+							$accountingaccount->fetch(null, $k, true); // TODO Use a cache
793 793
 							$bookkeeping->numero_compte = $k;
794 794
 							$bookkeeping->label_compte = $accountingaccount->label;
795 795
 						} elseif ($tabtype[$key] == 'payment_donation') {
796 796
 							$bookkeeping->subledger_account = '';
797 797
 							$bookkeeping->subledger_label = '';
798
-							$accountingaccount->fetch(null, $k, true);		// TODO Use a cache
798
+							$accountingaccount->fetch(null, $k, true); // TODO Use a cache
799 799
 							$bookkeeping->numero_compte = $k;
800 800
 							$bookkeeping->label_compte = $accountingaccount->label;
801 801
 						} elseif ($tabtype[$key] == 'member') {
802 802
 							$bookkeeping->subledger_account = '';
803 803
 							$bookkeeping->subledger_label = '';
804
-							$accountingaccount->fetch(null, $k, true);		// TODO Use a cache
804
+							$accountingaccount->fetch(null, $k, true); // TODO Use a cache
805 805
 							$bookkeeping->numero_compte = $k;
806 806
 							$bookkeeping->label_compte = $accountingaccount->label;
807 807
 						} elseif ($tabtype[$key] == 'payment_loan') {
808 808
 							$bookkeeping->subledger_account = '';
809 809
 							$bookkeeping->subledger_label = '';
810
-							$accountingaccount->fetch(null, $k, true);		// TODO Use a cache
810
+							$accountingaccount->fetch(null, $k, true); // TODO Use a cache
811 811
 							$bookkeeping->numero_compte = $k;
812 812
 							$bookkeeping->label_compte = $accountingaccount->label;
813 813
 						} elseif ($tabtype[$key] == 'payment_various') {
814 814
 							$bookkeeping->subledger_account = $k;
815 815
 							$bookkeeping->subledger_label = $tabcompany[$key]['name'];
816
-							$accountingaccount->fetch(null, $tabpay[$key]["account_various"], true);	// TODO Use a cache
816
+							$accountingaccount->fetch(null, $tabpay[$key]["account_various"], true); // TODO Use a cache
817 817
 							$bookkeeping->numero_compte = $tabpay[$key]["account_various"];
818 818
 							$bookkeeping->label_compte = $accountingaccount->label;
819 819
 						} elseif ($tabtype[$key] == 'banktransfert') {
820 820
 							$bookkeeping->subledger_account = '';
821 821
 							$bookkeeping->subledger_label = '';
822
-							$accountingaccount->fetch(null, $k, true);		// TODO Use a cache
822
+							$accountingaccount->fetch(null, $k, true); // TODO Use a cache
823 823
 							$bookkeeping->numero_compte = $k;
824 824
 							$bookkeeping->label_compte = $accountingaccount->label;
825 825
 						} else {
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 							}
851 851
 						} else {
852 852
 							if ($lettering && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
853
-								require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
853
+								require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php';
854 854
 								$lettering_static = new Lettering($db);
855 855
 								$nb_lettering = $lettering_static->bookkeepingLetteringAll(array($bookkeeping->id));
856 856
 							}
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 	$variousstatic = new PaymentVarious($db);
1090 1090
 
1091 1091
 	$title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1);
1092
-	$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
1092
+	$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
1093 1093
 	llxHeader('', dol_string_nohtmltag($title), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-generation page-bankjournal');
1094 1094
 
1095 1095
 	$nom = $title;
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 		1 => $langs->trans("TransfertAllBankLines"),
1113 1113
 		2 => $langs->trans("TransfertOnlyConciliatedBankLine")
1114 1114
 	);
1115
-	$moreoptions = [ "BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)];
1115
+	$moreoptions = ["BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)];
1116 1116
 
1117 1117
 	journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink, $moreoptions);
1118 1118
 
@@ -1274,7 +1274,7 @@  discard block
 block discarded – undo
1274 1274
 
1275 1275
 				// Label operation
1276 1276
 				print '<td>';
1277
-				print $reflabel;	// This is already html escaped content
1277
+				print $reflabel; // This is already html escaped content
1278 1278
 				print "</td>";
1279 1279
 
1280 1280
 				print '<td class="center">'.$val["type_payment"]."</td>";
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
 						}
1368 1368
 					}
1369 1369
 					print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">';
1370
-					print $accounttoshow;	// This is a HTML string
1370
+					print $accounttoshow; // This is a HTML string
1371 1371
 					print "</td>";
1372 1372
 
1373 1373
 					// Subledger account
@@ -1396,7 +1396,7 @@  discard block
 block discarded – undo
1396 1396
 						}
1397 1397
 					}
1398 1398
 					print '<td class="maxwidth300">';
1399
-					print $accounttoshowsubledger;	// This is a html string
1399
+					print $accounttoshowsubledger; // This is a html string
1400 1400
 					print "</td>";
1401 1401
 
1402 1402
 					print "<td>".$reflabel."</td>";
Please login to merge, or discard this patch.
htdocs/accountancy/journal/expensereportsjournal.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
 				foreach ($arrayofvat[$key] as $k => $mt) {
385 385
 					if ($mt) {
386
-						$accountingaccount->fetch(null, $k, true);	// TODO Use a cache for label
386
+						$accountingaccount->fetch(null, $k, true); // TODO Use a cache for label
387 387
 						$account_label = $accountingaccount->label;
388 388
 
389 389
 						// get compte id and label
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 
557 557
 if (empty($action) || $action == 'view') {
558 558
 	$title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1);
559
-	$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
559
+	$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#G&eacute;n&eacute;ration_des_&eacute;critures_en_comptabilit&eacute;';
560 560
 	llxHeader('', dol_string_nohtmltag($title), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-generation page-expensereportsjournal');
561 561
 
562 562
 	$nom = $title;
Please login to merge, or discard this patch.
htdocs/core/class/commonobject.class.php 1 patch
Spacing   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 	 *
475 475
 	 * Note: cond_reglement can not be aliased to cond_reglement!!!
476 476
 	 */
477
-	private $cond_reglement;  // Private to call DolDeprecationHandler
477
+	private $cond_reglement; // Private to call DolDeprecationHandler
478 478
 	/**
479 479
 	 * @var int|string Internal to detect deprecated access
480 480
 	 */
481
-	protected $depr_cond_reglement;  // Internal value for deprecation
481
+	protected $depr_cond_reglement; // Internal value for deprecation
482 482
 
483 483
 	/**
484 484
 	 * @var int 		Delivery address ID
@@ -535,12 +535,12 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * @var float Multicurrency total localta1
537 537
 	 */
538
-	public $multicurrency_total_localtax1;	// not in database
538
+	public $multicurrency_total_localtax1; // not in database
539 539
 
540 540
 	/**
541 541
 	 * @var float Multicurrency total localtax2
542 542
 	 */
543
-	public $multicurrency_total_localtax2;	// not in database
543
+	public $multicurrency_total_localtax2; // not in database
544 544
 
545 545
 	/**
546 546
 	 * @var string
@@ -1025,17 +1025,17 @@  discard block
 block discarded – undo
1025 1025
 				}
1026 1026
 				$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
1027 1027
 				if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
1028
-					$data[$key] = '<br><b><u>'. $labelextra . '</u></b>';
1028
+					$data[$key] = '<br><b><u>'.$labelextra.'</u></b>';
1029 1029
 				} else {
1030
-					$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
1031
-					$data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
1030
+					$value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]);
1031
+					$data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element);
1032 1032
 					$count++;
1033 1033
 				}
1034 1034
 			}
1035 1035
 			$data['closedivextra'] = '</div>';
1036 1036
 		}
1037 1037
 
1038
-		$hookmanager->initHooks(array($this->element . 'dao'));
1038
+		$hookmanager->initHooks(array($this->element.'dao'));
1039 1039
 		$parameters = array(
1040 1040
 			'tooltipcontentarray' => &$data,
1041 1041
 			'params' => $params,
@@ -1526,7 +1526,7 @@  discard block
 block discarded – undo
1526 1526
 		if ($source == 'external' || $source == 'thirdparty') {
1527 1527
 			$sql .= " AND tc.source = 'external'";
1528 1528
 			if ($status >= 0) {
1529
-				$sql .= " AND t.statut = ".((int) $status);	// t is llx_socpeople
1529
+				$sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople
1530 1530
 			}
1531 1531
 		}
1532 1532
 		$sql .= " AND tc.active = 1";
@@ -1910,7 +1910,7 @@  discard block
 block discarded – undo
1910 1910
 		}
1911 1911
 
1912 1912
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element;
1913
-		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'";	// no escapeforlike here
1913
+		$sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here
1914 1914
 		$sql .= " LIMIT 1";
1915 1915
 
1916 1916
 		$query = $this->db->query($sql);
@@ -2202,9 +2202,9 @@  discard block
 block discarded – undo
2202 2202
 
2203 2203
 		$oldvalue = null;
2204 2204
 		if ($trigkey) {
2205
-			$sql = "SELECT " . $field;
2206
-			$sql .= " FROM " . MAIN_DB_PREFIX . $table;
2207
-			$sql .= " WHERE " . $id_field . " = " . ((int) $id);
2205
+			$sql = "SELECT ".$field;
2206
+			$sql .= " FROM ".MAIN_DB_PREFIX.$table;
2207
+			$sql .= " WHERE ".$id_field." = ".((int) $id);
2208 2208
 
2209 2209
 			$resql = $this->db->query($sql);
2210 2210
 			if ($resql) {
@@ -2583,7 +2583,7 @@  discard block
 block discarded – undo
2583 2583
 		// Triggers
2584 2584
 		if (!$error && !$notrigger) {
2585 2585
 			// Call triggers
2586
-			$result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user);
2586
+			$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
2587 2587
 			if ($result < 0) {
2588 2588
 				$error++;
2589 2589
 			} //Do also here what you must do to rollback action if trigger fail
@@ -2949,7 +2949,7 @@  discard block
 block discarded – undo
2949 2949
 			$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
2950 2950
 			$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
2951 2951
 			if (in_array($this->table_element, array('propal', 'commande', 'societe'))) {
2952
-				$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2952
+				$sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
2953 2953
 			}
2954 2954
 			$sql .= ' WHERE rowid='.((int) $this->id);
2955 2955
 
@@ -3297,10 +3297,10 @@  discard block
 block discarded – undo
3297 3297
 		$sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line;
3298 3298
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3299 3299
 		if (!$renum) {
3300
-			$sql .= " AND " . $fieldposition . " = 0";
3300
+			$sql .= " AND ".$fieldposition." = 0";
3301 3301
 		}
3302 3302
 		if ($renum) {
3303
-			$sql .= " AND " . $fieldposition . " <> 0";
3303
+			$sql .= " AND ".$fieldposition." <> 0";
3304 3304
 		}
3305 3305
 
3306 3306
 		dol_syslog(get_class($this)."::line_order", LOG_DEBUG);
@@ -3321,7 +3321,7 @@  discard block
 block discarded – undo
3321 3321
 			if ($fk_parent_line) {
3322 3322
 				$sql .= ' AND fk_parent_line IS NULL';
3323 3323
 			}
3324
-			$sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder;
3324
+			$sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder;
3325 3325
 
3326 3326
 			dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG);
3327 3327
 			$resql = $this->db->query($sql);
@@ -3372,7 +3372,7 @@  discard block
 block discarded – undo
3372 3372
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3373 3373
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3374 3374
 		$sql .= ' AND fk_parent_line = '.((int) $id);
3375
-		$sql .= " ORDER BY " . $fieldposition . " ASC";
3375
+		$sql .= " ORDER BY ".$fieldposition." ASC";
3376 3376
 
3377 3377
 		dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG);
3378 3378
 		$resql = $this->db->query($sql);
@@ -3495,7 +3495,7 @@  discard block
 block discarded – undo
3495 3495
 
3496 3496
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3497 3497
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3498
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1));
3498
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang - 1));
3499 3499
 			if ($this->db->query($sql)) {
3500 3500
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1));
3501 3501
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3526,7 +3526,7 @@  discard block
 block discarded – undo
3526 3526
 
3527 3527
 			$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang);
3528 3528
 			$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3529
-			$sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1));
3529
+			$sql .= " AND ".$fieldposition." = ".((int) ($rang + 1));
3530 3530
 			if ($this->db->query($sql)) {
3531 3531
 				$sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1));
3532 3532
 				$sql .= ' WHERE rowid = '.((int) $rowid);
@@ -3552,7 +3552,7 @@  discard block
 block discarded – undo
3552 3552
 			$fieldposition = 'position';
3553 3553
 		}
3554 3554
 
3555
-		$sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line;
3555
+		$sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line;
3556 3556
 		$sql .= " WHERE rowid = ".((int) $rowid);
3557 3557
 
3558 3558
 		dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG);
@@ -3580,7 +3580,7 @@  discard block
 block discarded – undo
3580 3580
 
3581 3581
 		$sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line;
3582 3582
 		$sql .= " WHERE ".$this->fk_element." = ".((int) $this->id);
3583
-		$sql .= " AND " . $fieldposition . " = ".((int) $rang);
3583
+		$sql .= " AND ".$fieldposition." = ".((int) $rang);
3584 3584
 		$resql = $this->db->query($sql);
3585 3585
 		if ($resql) {
3586 3586
 			$row = $this->db->fetch_row($resql);
@@ -3698,7 +3698,7 @@  discard block
 block discarded – undo
3698 3698
 			$newsuffix = '';
3699 3699
 		}
3700 3700
 		if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) {
3701
-			$fieldusermod =  "fk_user_mod";
3701
+			$fieldusermod = "fk_user_mod";
3702 3702
 		} elseif ($this->table_element == 'ecm_files') {
3703 3703
 			$fieldusermod = "fk_user_m";
3704 3704
 		} else {
@@ -3740,7 +3740,7 @@  discard block
 block discarded – undo
3740 3740
 						$trigger_name = 'EXPENSE_REPORT_MODIFY';
3741 3741
 						break;
3742 3742
 					default:
3743
-						$trigger_name = strtoupper($this->element) . '_MODIFY';
3743
+						$trigger_name = strtoupper($this->element).'_MODIFY';
3744 3744
 				}
3745 3745
 				$ret = $this->call_trigger($trigger_name, $user);
3746 3746
 				if ($ret < 0) {
@@ -4119,19 +4119,19 @@  discard block
 block discarded – undo
4119 4119
 		$this->db->begin();
4120 4120
 		$error = 0;
4121 4121
 
4122
-		$sql = "INSERT INTO " . $this->db->prefix() . "element_element (";
4122
+		$sql = "INSERT INTO ".$this->db->prefix()."element_element (";
4123 4123
 		$sql .= "fk_source";
4124 4124
 		$sql .= ", sourcetype";
4125 4125
 		$sql .= ", fk_target";
4126 4126
 		$sql .= ", targettype";
4127 4127
 		$sql .= ") VALUES (";
4128 4128
 		$sql .= ((int) $origin_id);
4129
-		$sql .= ", '" . $this->db->escape($origin) . "'";
4130
-		$sql .= ", " . ((int) $this->id);
4131
-		$sql .= ", '" . $this->db->escape($targettype) . "'";
4129
+		$sql .= ", '".$this->db->escape($origin)."'";
4130
+		$sql .= ", ".((int) $this->id);
4131
+		$sql .= ", '".$this->db->escape($targettype)."'";
4132 4132
 		$sql .= ")";
4133 4133
 
4134
-		dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
4134
+		dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
4135 4135
 		if ($this->db->query($sql)) {
4136 4136
 			if (!$notrigger) {
4137 4137
 				// Call trigger
@@ -4383,20 +4383,20 @@  discard block
 block discarded – undo
4383 4383
 		$this->db->begin();
4384 4384
 		$error = 0;
4385 4385
 
4386
-		$sql = "UPDATE " . $this->db->prefix() . "element_element SET ";
4386
+		$sql = "UPDATE ".$this->db->prefix()."element_element SET ";
4387 4387
 		if ($updatesource) {
4388
-			$sql .= "fk_source = " . ((int) $sourceid);
4389
-			$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
4390
-			$sql .= " WHERE fk_target = " . ((int) $this->id);
4391
-			$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
4388
+			$sql .= "fk_source = ".((int) $sourceid);
4389
+			$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
4390
+			$sql .= " WHERE fk_target = ".((int) $this->id);
4391
+			$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
4392 4392
 		} elseif ($updatetarget) {
4393
-			$sql .= "fk_target = " . ((int) $targetid);
4394
-			$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
4395
-			$sql .= " WHERE fk_source = " . ((int) $this->id);
4396
-			$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4393
+			$sql .= "fk_target = ".((int) $targetid);
4394
+			$sql .= ", targettype = '".$this->db->escape($targettype)."'";
4395
+			$sql .= " WHERE fk_source = ".((int) $this->id);
4396
+			$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
4397 4397
 		}
4398 4398
 
4399
-		dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
4399
+		dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
4400 4400
 		if ($this->db->query($sql)) {
4401 4401
 			if (!$notrigger) {
4402 4402
 				// Call trigger
@@ -4472,25 +4472,25 @@  discard block
 block discarded – undo
4472 4472
 		}
4473 4473
 
4474 4474
 		if (!$error) {
4475
-			$sql = "DELETE FROM " . $this->db->prefix() . "element_element";
4475
+			$sql = "DELETE FROM ".$this->db->prefix()."element_element";
4476 4476
 			$sql .= " WHERE";
4477 4477
 			if ($rowid > 0) {
4478
-				$sql .= " rowid = " . ((int) $rowid);
4478
+				$sql .= " rowid = ".((int) $rowid);
4479 4479
 			} else {
4480 4480
 				if ($deletesource) {
4481
-					$sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
4482
-					$sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'";
4481
+					$sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'";
4482
+					$sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'";
4483 4483
 				} elseif ($deletetarget) {
4484
-					$sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'";
4485
-					$sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
4484
+					$sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'";
4485
+					$sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'";
4486 4486
 				} else {
4487
-					$sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
4487
+					$sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')";
4488 4488
 					$sql .= " OR";
4489
-					$sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')";
4489
+					$sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')";
4490 4490
 				}
4491 4491
 			}
4492 4492
 
4493
-			dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
4493
+			dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
4494 4494
 			if (!$this->db->query($sql)) {
4495 4495
 				$this->error = $this->db->lasterror();
4496 4496
 				$this->errors[] = $this->error;
@@ -4655,14 +4655,14 @@  discard block
 block discarded – undo
4655 4655
 			$sql .= ", date_validation = '".$this->db->idate(dol_now())."'";
4656 4656
 		}
4657 4657
 		$sql .= " WHERE rowid = ".((int) $elementId);
4658
-		$sql .= " AND ".$fieldstatus." <> ".((int) $status);	// We avoid update if status already correct
4658
+		$sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct
4659 4659
 
4660 4660
 		dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
4661 4661
 		$resql = $this->db->query($sql);
4662 4662
 		if ($resql) {
4663 4663
 			$error = 0;
4664 4664
 
4665
-			$nb_rows_affected = $this->db->affected_rows($resql);	// should be 1 or 0 if status was already correct
4665
+			$nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct
4666 4666
 
4667 4667
 			if ($nb_rows_affected > 0) {
4668 4668
 				if (empty($trigkey)) {
@@ -4707,7 +4707,7 @@  discard block
 block discarded – undo
4707 4707
 					if ($fieldstatus == 'tosell') {
4708 4708
 						$this->status = $status;
4709 4709
 					} elseif ($fieldstatus == 'tobuy') {
4710
-						$this->status_buy = $status;	// @phpstan-ignore-line
4710
+						$this->status_buy = $status; // @phpstan-ignore-line
4711 4711
 					} else {
4712 4712
 						$this->status = $status;
4713 4713
 					}
@@ -4815,7 +4815,7 @@  discard block
 block discarded – undo
4815 4815
 			return -1;
4816 4816
 		}
4817 4817
 
4818
-		$arraytoscan = $this->childtables;		// array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4818
+		$arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...)
4819 4819
 		// For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...)
4820 4820
 		$tmparray = array_keys($this->childtables);
4821 4821
 		if (is_numeric($tmparray[0])) {
@@ -5889,7 +5889,7 @@  discard block
 block discarded – undo
5889 5889
 			$setsharekey = false;
5890 5890
 			if ($this->element == 'propal' || $this->element == 'proposal') {
5891 5891
 				if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) {
5892
-					$setsharekey = true;	// feature to make online signature is not set or set to on (default)
5892
+					$setsharekey = true; // feature to make online signature is not set or set to on (default)
5893 5893
 				}
5894 5894
 				if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) {
5895 5895
 					$setsharekey = true;
@@ -5947,7 +5947,7 @@  discard block
 block discarded – undo
5947 5947
 				$ecmfile->gen_or_uploaded = 'generated';
5948 5948
 				$ecmfile->description = ''; // indexed content
5949 5949
 				$ecmfile->keywords = ''; // keyword content
5950
-				$ecmfile->src_object_type = $this->table_element;	// $this->table_name is 'myobject' or 'mymodule_myobject'.
5950
+				$ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
5951 5951
 				$ecmfile->src_object_id   = $this->id;
5952 5952
 
5953 5953
 				$result = $ecmfile->create($user);
@@ -5999,7 +5999,7 @@  discard block
 block discarded – undo
5999 5999
 			$maxwidthmini = $tmparraysize['maxwidthmini'];
6000 6000
 			$maxheightmini = $tmparraysize['maxheightmini'];
6001 6001
 			//$quality = $tmparraysize['quality'];
6002
-			$quality = 50;	// For thumbs, we force quality to 50
6002
+			$quality = 50; // For thumbs, we force quality to 50
6003 6003
 
6004 6004
 			// Create small thumbs for company (Ratio is near 16/9)
6005 6005
 			// Used on logon for example
@@ -6099,8 +6099,8 @@  discard block
 block discarded – undo
6099 6099
 		// phpcs:enable
6100 6100
 		global $langs, $conf;
6101 6101
 
6102
-		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) {
6103
-			dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.');
6102
+		if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) {
6103
+			dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.');
6104 6104
 			exit;
6105 6105
 		}
6106 6106
 		if (!is_object($langs)) {	// If lang was not defined, we set it. It is required by run_triggers().
@@ -6292,7 +6292,7 @@  discard block
 block discarded – undo
6292 6292
 		$savDisableCompute = $conf->disable_compute;
6293 6293
 		$conf->disable_compute = 1;
6294 6294
 
6295
-		$ret = $this->fetch($id);	/* @phpstan-ignore-line */
6295
+		$ret = $this->fetch($id); /* @phpstan-ignore-line */
6296 6296
 
6297 6297
 		$conf->disable_compute = $savDisableCompute;
6298 6298
 
@@ -6354,7 +6354,7 @@  discard block
 block discarded – undo
6354 6354
 		if (is_array($optionsArray) && count($optionsArray) > 0) {
6355 6355
 			$sql = "SELECT rowid";
6356 6356
 			foreach ($optionsArray as $name => $label) {
6357
-				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
6357
+				if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) {
6358 6358
 					$sql .= ", ".$name;
6359 6359
 				}
6360 6360
 				// use geo sql fonction to read as text
@@ -6407,7 +6407,7 @@  discard block
 block discarded – undo
6407 6407
 					 **/
6408 6408
 					if (is_array($extrafields->attributes[$this->table_element]['label'])) {
6409 6409
 						foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
6410
-							$this->array_options['options_' . $key] = null;
6410
+							$this->array_options['options_'.$key] = null;
6411 6411
 						}
6412 6412
 					}
6413 6413
 				}
@@ -6419,9 +6419,9 @@  discard block
 block discarded – undo
6419 6419
 						if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
6420 6420
 							//var_dump($conf->disable_compute);
6421 6421
 							if (empty($conf->disable_compute)) {
6422
-								global $objectoffield;        // We set a global variable to $objectoffield so
6423
-								$objectoffield = $this;        // we can use it inside computed formula
6424
-								$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6422
+								global $objectoffield; // We set a global variable to $objectoffield so
6423
+								$objectoffield = $this; // we can use it inside computed formula
6424
+								$this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
6425 6425
 							}
6426 6426
 						}
6427 6427
 					}
@@ -6602,7 +6602,7 @@  discard block
 block discarded – undo
6602 6602
 										// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
6603 6603
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6604 6604
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6605
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6605
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6606 6606
 											} else {
6607 6607
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6608 6608
 											}
@@ -6613,7 +6613,7 @@  discard block
 block discarded – undo
6613 6613
 										// If value has changed
6614 6614
 										if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
6615 6615
 											if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) {
6616
-												$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6616
+												$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6617 6617
 											} else {
6618 6618
 												$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6619 6619
 											}
@@ -6625,7 +6625,7 @@  discard block
 block discarded – undo
6625 6625
 									//var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]);
6626 6626
 									// If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value
6627 6627
 									if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) {	// dolibarr reversible encryption
6628
-										$new_array_options[$key] = dolEncrypt($this->array_options[$key]);	// warning, must be called when on the master
6628
+										$new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master
6629 6629
 									} else {
6630 6630
 										$new_array_options[$key] = $this->array_options[$key]; // Value is kept
6631 6631
 									}
@@ -7050,7 +7050,7 @@  discard block
 block discarded – undo
7050 7050
 								if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) {	// If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update.
7051 7051
 									if ($algo == 'dolcrypt') {	// dolibarr reversible encryption
7052 7052
 										if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {
7053
-											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7053
+											$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7054 7054
 										} else {
7055 7055
 											$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7056 7056
 										}
@@ -7070,7 +7070,7 @@  discard block
 block discarded – undo
7070 7070
 								}
7071 7071
 							} else {
7072 7072
 								if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) {	// dolibarr reversible encryption
7073
-									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]);	// warning, must be called when on the master
7073
+									$new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master
7074 7074
 								} else {
7075 7075
 									$new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept
7076 7076
 								}
@@ -7583,7 +7583,7 @@  discard block
 block discarded – undo
7583 7583
 			if (is_array($param['options'])) {
7584 7584
 				$param_list = array_keys($param['options']);
7585 7585
 				$InfoFieldList = explode(":", $param_list[0], 5);
7586
-				if (! empty($InfoFieldList[4])) {
7586
+				if (!empty($InfoFieldList[4])) {
7587 7587
 					$pos = 0;
7588 7588
 					$parenthesisopen = 0;
7589 7589
 					while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) {
@@ -7644,8 +7644,8 @@  discard block
 block discarded – undo
7644 7644
 					}
7645 7645
 
7646 7646
 					$sqlwhere = '';
7647
-					$sql = "SELECT " . $keyList;
7648
-					$sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0];
7647
+					$sql = "SELECT ".$keyList;
7648
+					$sql .= " FROM ".$this->db->prefix().$InfoFieldList[0];
7649 7649
 					if (!empty($InfoFieldList[4])) {
7650 7650
 						// can use SELECT request
7651 7651
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7662,18 +7662,18 @@  discard block
 block discarded – undo
7662 7662
 						// We have to join on extrafield table
7663 7663
 						$errstr = '';
7664 7664
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7665
-							$sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra";
7666
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2];
7667
-							$sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7665
+							$sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra";
7666
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2];
7667
+							$sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7668 7668
 						} else {
7669
-							$sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7669
+							$sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1);
7670 7670
 						}
7671 7671
 					} else {
7672 7672
 						$sqlwhere .= ' WHERE 1=1';
7673 7673
 					}
7674 7674
 					// Some tables may have field, some other not. For the moment we disable it.
7675 7675
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7676
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7676
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7677 7677
 					}
7678 7678
 					$sql .= $sqlwhere;
7679 7679
 					//print $sql;
@@ -7685,7 +7685,7 @@  discard block
 block discarded – undo
7685 7685
 						$sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label));
7686 7686
 					}
7687 7687
 
7688
-					dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
7688
+					dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
7689 7689
 					$resql = $this->db->query($sql);
7690 7690
 					if ($resql) {
7691 7691
 						$out .= '<option value="0">&nbsp;</option>';
@@ -7701,7 +7701,7 @@  discard block
 block discarded – undo
7701 7701
 							if (count($fields_label) > 1) {
7702 7702
 								$notrans = true;
7703 7703
 								foreach ($fields_label as $field_toshow) {
7704
-									$labeltoshow .= $obj->$field_toshow . ' ';
7704
+									$labeltoshow .= $obj->$field_toshow.' ';
7705 7705
 								}
7706 7706
 							} else {
7707 7707
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7712,12 +7712,12 @@  discard block
 block discarded – undo
7712 7712
 								foreach ($fields_label as $field_toshow) {
7713 7713
 									$translabel = $langs->trans($obj->$field_toshow);
7714 7714
 									if ($translabel != $obj->$field_toshow) {
7715
-										$labeltoshow = dol_trunc($translabel) . ' ';
7715
+										$labeltoshow = dol_trunc($translabel).' ';
7716 7716
 									} else {
7717
-										$labeltoshow = dol_trunc($obj->$field_toshow) . ' ';
7717
+										$labeltoshow = dol_trunc($obj->$field_toshow).' ';
7718 7718
 									}
7719 7719
 								}
7720
-								$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7720
+								$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7721 7721
 							} else {
7722 7722
 								if (!$notrans) {
7723 7723
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
@@ -7731,34 +7731,34 @@  discard block
 block discarded – undo
7731 7731
 									$labeltoshow = '(not defined)';
7732 7732
 								}
7733 7733
 								if ($value == $obj->rowid) {
7734
-									$out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
7734
+									$out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
7735 7735
 								}
7736 7736
 
7737 7737
 								if (!empty($InfoFieldList[3]) && $parentField) {
7738
-									$parent = $parentName . ':' . $obj->{$parentField};
7738
+									$parent = $parentName.':'.$obj->{$parentField};
7739 7739
 									$isDependList = 1;
7740 7740
 								}
7741 7741
 
7742
-								$out .= '<option value="' . $obj->rowid . '"';
7742
+								$out .= '<option value="'.$obj->rowid.'"';
7743 7743
 								$out .= ($value == $obj->rowid ? ' selected' : '');
7744
-								$out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
7745
-								$out .= '>' . $labeltoshow . '</option>';
7744
+								$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
7745
+								$out .= '>'.$labeltoshow.'</option>';
7746 7746
 							}
7747 7747
 
7748 7748
 							$i++;
7749 7749
 						}
7750 7750
 						$this->db->free($resql);
7751 7751
 					} else {
7752
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7752
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7753 7753
 					}
7754 7754
 				} else {
7755 7755
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7756 7756
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7757 7757
 					$out .= '<option value="0">&nbsp;</option>';
7758 7758
 					foreach ($data as $data_key => $data_value) {
7759
-						$out .= '<option value="' . $data_key . '"';
7759
+						$out .= '<option value="'.$data_key.'"';
7760 7760
 						$out .= ($value == $data_key ? ' selected' : '');
7761
-						$out .= '>' . $data_value . '</option>';
7761
+						$out .= '>'.$data_value.'</option>';
7762 7762
 					}
7763 7763
 				}
7764 7764
 			}
@@ -7825,8 +7825,8 @@  discard block
 block discarded – undo
7825 7825
 					}
7826 7826
 
7827 7827
 					$sqlwhere = '';
7828
-					$sql = "SELECT " . $keyList;
7829
-					$sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0];
7828
+					$sql = "SELECT ".$keyList;
7829
+					$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
7830 7830
 					if (!empty($InfoFieldList[4])) {
7831 7831
 						// can use SELECT request
7832 7832
 						if (strpos($InfoFieldList[4], '$SEL$') !== false) {
@@ -7842,23 +7842,23 @@  discard block
 block discarded – undo
7842 7842
 
7843 7843
 						// We have to join on extrafield table
7844 7844
 						if (strpos($InfoFieldList[4], 'extra') !== false) {
7845
-							$sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra';
7846
-							$sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4];
7845
+							$sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra';
7846
+							$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
7847 7847
 						} else {
7848
-							$sqlwhere .= " WHERE " . $InfoFieldList[4];
7848
+							$sqlwhere .= " WHERE ".$InfoFieldList[4];
7849 7849
 						}
7850 7850
 					} else {
7851 7851
 						$sqlwhere .= ' WHERE 1=1';
7852 7852
 					}
7853 7853
 					// Some tables may have field, some other not. For the moment we disable it.
7854 7854
 					if (in_array($InfoFieldList[0], array('tablewithentity'))) {
7855
-						$sqlwhere .= " AND entity = " . ((int) $conf->entity);
7855
+						$sqlwhere .= " AND entity = ".((int) $conf->entity);
7856 7856
 					}
7857 7857
 					// $sql.=preg_replace('/^ AND /','',$sqlwhere);
7858 7858
 					// print $sql;
7859 7859
 
7860 7860
 					$sql .= $sqlwhere;
7861
-					dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG);
7861
+					dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG);
7862 7862
 					$resql = $this->db->query($sql);
7863 7863
 					if ($resql) {
7864 7864
 						$num = $this->db->num_rows($resql);
@@ -7876,7 +7876,7 @@  discard block
 block discarded – undo
7876 7876
 							if (count($fields_label) > 1) {
7877 7877
 								$notrans = true;
7878 7878
 								foreach ($fields_label as $field_toshow) {
7879
-									$labeltoshow .= $obj->$field_toshow . ' ';
7879
+									$labeltoshow .= $obj->$field_toshow.' ';
7880 7880
 								}
7881 7881
 							} else {
7882 7882
 								$labeltoshow = $obj->{$InfoFieldList[1]};
@@ -7887,9 +7887,9 @@  discard block
 block discarded – undo
7887 7887
 								foreach ($fields_label as $field_toshow) {
7888 7888
 									$translabel = $langs->trans($obj->$field_toshow);
7889 7889
 									if ($translabel != $obj->$field_toshow) {
7890
-										$labeltoshow = dol_trunc($translabel, 18) . ' ';
7890
+										$labeltoshow = dol_trunc($translabel, 18).' ';
7891 7891
 									} else {
7892
-										$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
7892
+										$labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
7893 7893
 									}
7894 7894
 								}
7895 7895
 
@@ -7912,7 +7912,7 @@  discard block
 block discarded – undo
7912 7912
 								}
7913 7913
 
7914 7914
 								if (!empty($InfoFieldList[3]) && $parentField) {
7915
-									$parent = $parentName . ':' . $obj->{$parentField};
7915
+									$parent = $parentName.':'.$obj->{$parentField};
7916 7916
 									$isDependList = 1;
7917 7917
 								}
7918 7918
 
@@ -7923,14 +7923,14 @@  discard block
 block discarded – undo
7923 7923
 						}
7924 7924
 						$this->db->free($resql);
7925 7925
 
7926
-						$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7926
+						$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7927 7927
 					} else {
7928
-						print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>';
7928
+						print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>';
7929 7929
 					}
7930 7930
 				} else {
7931 7931
 					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
7932 7932
 					$data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1);
7933
-					$out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7933
+					$out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%');
7934 7934
 				}
7935 7935
 			}
7936 7936
 		} elseif ($type == 'link') {
@@ -8157,7 +8157,7 @@  discard block
 block discarded – undo
8157 8157
 			$value = $this->getLibStatut(3);
8158 8158
 		} elseif ($type == 'date') {
8159 8159
 			if (!empty($value)) {
8160
-				$value = dol_print_date($value, 'day');	// We suppose dates without time are always gmt (storage of course + output)
8160
+				$value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output)
8161 8161
 			} else {
8162 8162
 				$value = '';
8163 8163
 			}
@@ -8202,7 +8202,7 @@  discard block
 block discarded – undo
8202 8202
 			$value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : '';
8203 8203
 			if (strpos($value, "|") !== false) {
8204 8204
 				$value = $langs->trans(explode('|', $value)[0]);
8205
-			} elseif (! is_numeric($value)) {
8205
+			} elseif (!is_numeric($value)) {
8206 8206
 				$value = $langs->trans($value);
8207 8207
 			}
8208 8208
 		} elseif ($type == 'sellist') {
@@ -8264,9 +8264,9 @@  discard block
 block discarded – undo
8264 8264
 									$translabel = $langs->trans($obj->$field_toshow);
8265 8265
 								}
8266 8266
 								if ($translabel != $field_toshow) {
8267
-									$value .= dol_trunc($translabel, 18) . ' ';
8267
+									$value .= dol_trunc($translabel, 18).' ';
8268 8268
 								} else {
8269
-									$value .= $obj->$field_toshow . ' ';
8269
+									$value .= $obj->$field_toshow.' ';
8270 8270
 								}
8271 8271
 							}
8272 8272
 						} else {
@@ -8282,7 +8282,7 @@  discard block
 block discarded – undo
8282 8282
 						}
8283 8283
 					}
8284 8284
 				} else {
8285
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8285
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8286 8286
 
8287 8287
 					$toprint = array();
8288 8288
 					$obj = $this->db->fetch_object($resql);
@@ -8290,7 +8290,7 @@  discard block
 block discarded – undo
8290 8290
 					$c->fetch($obj->rowid);
8291 8291
 					$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8292 8292
 					foreach ($ways as $way) {
8293
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8293
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8294 8294
 					}
8295 8295
 					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8296 8296
 				}
@@ -8306,11 +8306,11 @@  discard block
 block discarded – undo
8306 8306
 				$toprint = array();
8307 8307
 				foreach ($value_arr as $keyval => $valueval) {
8308 8308
 					if (!empty($valueval)) {
8309
-						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>';
8309
+						$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
8310 8310
 					}
8311 8311
 				}
8312 8312
 				if (!empty($toprint)) {
8313
-					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
8313
+					$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
8314 8314
 				}
8315 8315
 			}
8316 8316
 		} elseif ($type == 'chkbxlst') {
@@ -8365,9 +8365,9 @@  discard block
 block discarded – undo
8365 8365
 										$translabel = $langs->trans($obj->$field_toshow);
8366 8366
 									}
8367 8367
 									if ($translabel != $field_toshow) {
8368
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8368
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8369 8369
 									} else {
8370
-										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>';
8370
+										$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
8371 8371
 									}
8372 8372
 								}
8373 8373
 							} else {
@@ -8376,15 +8376,15 @@  discard block
 block discarded – undo
8376 8376
 									$translabel = $langs->trans($obj->{$InfoFieldList[1]});
8377 8377
 								}
8378 8378
 								if ($translabel != $obj->{$InfoFieldList[1]}) {
8379
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>';
8379
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
8380 8380
 								} else {
8381
-									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>';
8381
+									$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
8382 8382
 								}
8383 8383
 							}
8384 8384
 						}
8385 8385
 					}
8386 8386
 				} else {
8387
-					require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
8387
+					require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
8388 8388
 
8389 8389
 					$toprint = array();
8390 8390
 					while ($obj = $this->db->fetch_object($resql)) {
@@ -8393,7 +8393,7 @@  discard block
 block discarded – undo
8393 8393
 							$c->fetch($obj->rowid);
8394 8394
 							$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
8395 8395
 							foreach ($ways as $way) {
8396
-								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
8396
+								$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
8397 8397
 							}
8398 8398
 						}
8399 8399
 					}
@@ -8546,7 +8546,7 @@  discard block
 block discarded – undo
8546 8546
 		global $langs;
8547 8547
 
8548 8548
 		if (!class_exists('Validate')) {
8549
-			require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php';
8549
+			require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php';
8550 8550
 		}
8551 8551
 
8552 8552
 		$this->clearFieldError($fieldKey);
@@ -8778,7 +8778,7 @@  discard block
 block discarded – undo
8778 8778
 				$out .= "\n";
8779 8779
 
8780 8780
 				$nbofextrafieldsshown = 0;
8781
-				$e = 0;	// var to manage the modulo (odd/even)
8781
+				$e = 0; // var to manage the modulo (odd/even)
8782 8782
 
8783 8783
 				$lastseparatorkeyfound = '';
8784 8784
 				$extrafields_collapse_num = '';
@@ -9868,7 +9868,7 @@  discard block
 block discarded – undo
9868 9868
 						continue;
9869 9869
 					}
9870 9870
 				}
9871
-				$keys_with_alias[] = $alias . '.' . $fieldname;
9871
+				$keys_with_alias[] = $alias.'.'.$fieldname;
9872 9872
 			}
9873 9873
 			return implode(',', $keys_with_alias);
9874 9874
 		} else {
@@ -10003,7 +10003,7 @@  discard block
 block discarded – undo
10003 10003
 		if (!$error) {
10004 10004
 			$sql = "INSERT INTO ".$this->db->prefix().$this->table_element;
10005 10005
 			$sql .= " (".implode(", ", $keys).')';
10006
-			$sql .= " VALUES (".implode(", ", $values).")";		// $values can contains 'abc' or 123
10006
+			$sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123
10007 10007
 
10008 10008
 			$res = $this->db->query($sql);
10009 10009
 			if (!$res) {
@@ -10300,7 +10300,7 @@  discard block
 block discarded – undo
10300 10300
 
10301 10301
 		// Update extrafield
10302 10302
 		if (!$error) {
10303
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
10303
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
10304 10304
 			if ($result < 0) {
10305 10305
 				$error++;
10306 10306
 			}
@@ -10502,12 +10502,12 @@  discard block
 block discarded – undo
10502 10502
 				$error++;
10503 10503
 			} else {
10504 10504
 				while ($obj = $this->db->fetch_object($resql)) {
10505
-					$result = $this->fetch($obj->rowid);	// @phpstan-ignore-line
10505
+					$result = $this->fetch($obj->rowid); // @phpstan-ignore-line
10506 10506
 					if ($result < 0) {
10507 10507
 						$error++;
10508 10508
 						$this->errors[] = $this->error;
10509 10509
 					} else {
10510
-						$result = $this->delete($user);	// @phpstan-ignore-line
10510
+						$result = $this->delete($user); // @phpstan-ignore-line
10511 10511
 						if ($result < 0) {
10512 10512
 							$error++;
10513 10513
 							$this->errors[] = $this->error;
@@ -10723,7 +10723,7 @@  discard block
 block discarded – undo
10723 10723
 		);
10724 10724
 		foreach ($fields as $key => $value) {
10725 10725
 			if (array_key_exists($key, $this->fields)) {
10726
-				$this->{$key} = $value;		// @phpstan-ignore-line
10726
+				$this->{$key} = $value; // @phpstan-ignore-line
10727 10727
 			}
10728 10728
 		}
10729 10729
 
Please login to merge, or discard this patch.