Completed
Branch develop (e15c9a)
by
unknown
24:07
created
htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$this->watermark = '';
129 129
 
130 130
 		if ($mysoc === null) {
131
-			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR);
131
+			dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR);
132 132
 			return;
133 133
 		}
134 134
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			}
277 277
 
278 278
 			if ($dir === null) {
279
-				dol_syslog(get_class($this).'::'.__METHOD__."Target directory should not be null.". getCallerInfoString(), LOG_ERR);
279
+				dol_syslog(get_class($this).'::'.__METHOD__."Target directory should not be null.".getCallerInfoString(), LOG_ERR);
280 280
 				$this->error = $langs->transnoentities("ErrorCanNotCreateDir", "Null dir");
281 281
 				return 0;
282 282
 			}
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 							$bg_color = colorStringToArray(getDolGlobalString("SUBTOTAL_BACK_COLOR_LEVEL_".abs($object->lines[$i]->qty)));
665 665
 							$pdf->SetFillColor($bg_color[0], $bg_color[1], $bg_color[2]);
666 666
 							$pdf->SetXY($pdf->GetX(), $curY);
667
-							$pdf->MultiCell($this->page_largeur - $this->marge_droite  - $this->marge_gauche, 6, '', 0, '', true);
667
+							$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 6, '', 0, '', true);
668 668
 							$previous_align = array();
669 669
 							$previous_align['align'] = $this->cols['desc']['content']['align'];
670 670
 							if ($object->lines[$i]->qty < 0) {
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
 
924 924
 				// Add number of pages in footer
925 925
 				if (method_exists($pdf, 'AliasNbPages')) {
926
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
926
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
927 927
 				}
928 928
 
929 929
 				// Add terms to sale
@@ -1814,7 +1814,7 @@  discard block
 block discarded – undo
1814 1814
 				$carac_client_name = '';
1815 1815
 			}
1816 1816
 
1817
-			$mode =  'target';
1817
+			$mode = 'target';
1818 1818
 			$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object);
1819 1819
 
1820 1820
 			// Show recipient
@@ -1869,7 +1869,7 @@  discard block
 block discarded – undo
1869 1869
 				if (!empty($carac_client_shipping)) {
1870 1870
 					$posy += $hautcadre;
1871 1871
 
1872
-					$hautcadre -= 10;	// Height for the shipping address does not need to be as high as main box
1872
+					$hautcadre -= 10; // Height for the shipping address does not need to be as high as main box
1873 1873
 
1874 1874
 					// Show shipping frame
1875 1875
 					$pdf->SetXY($posx + 2, $posy - 5);
Please login to merge, or discard this patch.
htdocs/core/modules/facture/doc/pdf_sponge.modules.php 1 patch
Spacing   +16 added lines, -16 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])) {
364 364
 						$logodir = $conf->mycompany->multidir_output[$object->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
 					}
@@ -1000,11 +1000,11 @@  discard block
 block discarded – undo
1000 1000
 					if (!isset($this->tva[$vatrate])) {
1001 1001
 						$this->tva[$vatrate] = 0;
1002 1002
 					}
1003
-					$this->tva[$vatrate] += $tvaligne;    // ->tva is abandoned, we use now ->tva_array that is more complete
1003
+					$this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete
1004 1004
 					$vatcode = $object->lines[$i]->vat_src_code;
1005 1005
 					if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
1006 1006
 						if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) {
1007
-							$this->tva_array[$vatrate . ($vatcode ? ' (' . $vatcode . ')' : '')]['tot_ht'] = 0;
1007
+							$this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'] = 0;
1008 1008
 						}
1009 1009
 						$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);
1010 1010
 					} else {
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
 				// Add number of pages in footer
1116 1116
 				if (method_exists($pdf, 'AliasNbPages')) {
1117
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
1117
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
1118 1118
 				}
1119 1119
 				// Add terms to sale
1120 1120
 				if (!empty($mysoc->termsofsale) && getDolGlobalInt('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 			foreach ($this->tva_array as $tvakey => $tvaval) {
1369 1369
 				$pdf->SetFont('', '', $default_font_size - 2);
1370 1370
 				$pdf->SetXY($this->marge_gauche, $posy);
1371
-				$titre = round((float) $tvakey, 2) . "%";
1371
+				$titre = round((float) $tvakey, 2)."%";
1372 1372
 				$pdf->MultiCell(25, 4, $titre, 0, 'L');
1373 1373
 
1374 1374
 				$pdf->SetFont('', '', $default_font_size - 2);
@@ -1409,8 +1409,8 @@  discard block
 block discarded – undo
1409 1409
 			$posy = $pdf->GetY() + 4;
1410 1410
 		}
1411 1411
 
1412
-		$posxval = 52;	// Position of values of properties shown on left side
1413
-		$posxend = 110;	// End of x for text on left side
1412
+		$posxval = 52; // Position of values of properties shown on left side
1413
+		$posxend = 110; // End of x for text on left side
1414 1414
 		if ($this->page_largeur < 210) { // To work with US executive format
1415 1415
 			$posxend -= 10;
1416 1416
 		}
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 
1441 1441
 			$pdf->SetFont('', '', $default_font_size - 2);
1442 1442
 			$pdf->SetXY($posxval, $posy);
1443
-			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
1443
+			$categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
1444 1444
 			$pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L');
1445 1445
 
1446 1446
 			$posy = $pdf->GetY() + 3; // for 2 lines
@@ -1618,7 +1618,7 @@  discard block
 block discarded – undo
1618 1618
 						include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php';
1619 1619
 						$invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type);
1620 1620
 
1621
-						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1621
+						$pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false);
1622 1622
 					}
1623 1623
 				}
1624 1624
 			}
@@ -2240,7 +2240,7 @@  discard block
 block discarded – undo
2240 2240
 		if (empty($hidetop)) {
2241 2241
 			// Show category of operations
2242 2242
 			if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) {
2243
-				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation);
2243
+				$categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation);
2244 2244
 				$pdf->SetXY($this->marge_gauche, $tab_top - 4);
2245 2245
 				$pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations);
2246 2246
 			}
@@ -2356,7 +2356,7 @@  discard block
 block discarded – undo
2356 2356
 		}
2357 2357
 		if ($this->situationinvoice) {
2358 2358
 			$outputlangs->loadLangs(array("other"));
2359
-			$title = $outputlangs->transnoentities("PDFInvoiceSituation") . " " . $outputlangs->transnoentities("NumberingShort") . $object->situation_counter . " -";
2359
+			$title = $outputlangs->transnoentities("PDFInvoiceSituation")." ".$outputlangs->transnoentities("NumberingShort").$object->situation_counter." -";
2360 2360
 		}
2361 2361
 		if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
2362 2362
 			$title .= ' - ';
@@ -2646,7 +2646,7 @@  discard block
 block discarded – undo
2646 2646
 				if (!empty($carac_client_shipping)) {
2647 2647
 					$posy += $hautcadre;
2648 2648
 
2649
-					$hautcadre -= 10;	// Height for the shipping address does not need to be as high as main box
2649
+					$hautcadre -= 10; // Height for the shipping address does not need to be as high as main box
2650 2650
 
2651 2651
 					// Show shipping frame
2652 2652
 					$pdf->SetXY($posx + 2, $posy - 5);
Please login to merge, or discard this patch.
htdocs/core/modules/propale/doc/pdf_cyan.modules.php 1 patch
Spacing   +4 added lines, -4 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])) {
308 308
 						$logodir = $conf->mycompany->multidir_output[$object->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
 
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 							$bg_color = colorStringToArray(getDolGlobalString("SUBTOTAL_BACK_COLOR_LEVEL_".abs($object->lines[$i]->qty)));
665 665
 							$pdf->SetFillColor($bg_color[0], $bg_color[1], $bg_color[2]);
666 666
 							$pdf->SetXY($pdf->GetX(), $curY);
667
-							$pdf->MultiCell($this->page_largeur - $this->marge_droite  - $this->marge_gauche, 6, '', 0, '', true);
667
+							$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 6, '', 0, '', true);
668 668
 							$previous_align = array();
669 669
 							$previous_align['align'] = $this->cols['desc']['content']['align'];
670 670
 							if ($object->lines[$i]->qty < 0) {
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
 
950 950
 				// Add number of pages in footer
951 951
 				if (method_exists($pdf, 'AliasNbPages')) {
952
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
952
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
953 953
 				}
954 954
 
955 955
 				// Add terms to sale
Please login to merge, or discard this patch.
htdocs/commande/list.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 $search_deliverymonth = '';
167 167
 $search_deliveryyear = '';
168 168
 
169
-$search_import_key  = trim(GETPOST("search_import_key", "alpha"));
169
+$search_import_key = trim(GETPOST("search_import_key", "alpha"));
170 170
 
171 171
 $diroutputmassaction = $conf->order->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
172 172
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	'typent.code' => array('label' => "ThirdPartyType", 'checked' => (string) $checkedtypetiers, 'position' => 55),
234 234
 	'c.date_commande' => array('label' => "OrderDateShort", 'checked' => '1', 'position' => 60, 'csslist' => 'nowraponall'),
235 235
 	'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => '1', 'enabled' => (string) (int) !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65, 'csslist' => 'nowraponall'),
236
-	'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => '-1', 'position' => 66 , 'enabled' => (string) (int) isModEnabled("shipping")),
236
+	'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => '-1', 'position' => 66, 'enabled' => (string) (int) isModEnabled("shipping")),
237 237
 	'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => '-1', 'position' => 67),
238 238
 	'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => '-1', 'position' => 68),
239 239
 	'c.fk_input_reason' => array('label' => "Origin", 'checked' => '-1', 'position' => 69),
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	'c.date_cloture' => array('label' => "DateClosing", 'checked' => '0', 'position' => 130),
259 259
 	'c.note_public' => array('label' => 'NotePublic', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 135, 'searchall' => 1),
260 260
 	'c.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 140),
261
-	'shippable' => array('label' => "Shippable", 'checked' => '1','enabled' => (string) (int) (isModEnabled("shipping")), 'position' => 990),
261
+	'shippable' => array('label' => "Shippable", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled("shipping")), 'position' => 990),
262 262
 	'c.facture' => array('label' => "Billed", 'checked' => '1', 'enabled' => (string) (int) (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995),
263 263
 	'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'visible' => -2, 'position' => 999),
264 264
 	'c.fk_statut' => array('label' => "Status", 'checked' => '1', 'position' => 1000)
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 				}
455 455
 
456 456
 				if (empty($objecttmp->note_public)) {
457
-					$objecttmp->note_public =  $langs->transnoentities("Orders");
457
+					$objecttmp->note_public = $langs->transnoentities("Orders");
458 458
 				}
459 459
 
460 460
 				$datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 			$db->rollback();
780 780
 
781 781
 			$action = 'create';
782
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
782
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
783 783
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
784 784
 			if (!empty($errors)) {
785 785
 				setEventMessages(null, $errors, 'errors');
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 			if ($searchCategoryOrderOperator == 0) {
1164 1164
 				$searchCategoryOrderSqlList[] = " EXISTS (SELECT ck.fk_order FROM ".MAIN_DB_PREFIX."categorie_order as ck WHERE c.rowid = ck.fk_order AND ck.fk_categorie = ".((int) $searchCategoryOrder).")";
1165 1165
 			} else {
1166
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryOrder);
1166
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryOrder);
1167 1167
 			}
1168 1168
 		}
1169 1169
 	}
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 			if ($searchCategoryCustomerOperator == 0) {
1195 1195
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).")";
1196 1196
 			} else {
1197
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
1197
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
1198 1198
 			}
1199 1199
 		}
1200 1200
 	}
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 			if ($searchCategoryProductOperator == 0) {
1225 1225
 				$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
1226 1226
 			} else {
1227
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
1227
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct);
1228 1228
 			}
1229 1229
 		}
1230 1230
 	}
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
 }
1708 1708
 
1709 1709
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1710
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
1710
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
1711 1711
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
1712 1712
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1713 1713
 
@@ -2926,15 +2926,15 @@  discard block
 block discarded – undo
2926 2926
 			if (!empty($show_shippable_command) && isModEnabled('stock')) {
2927 2927
 				$text_icon = '';
2928 2928
 				if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
2929
-					$generic_commande->getLinesArray(); 	// Load array ->lines
2930
-					$generic_commande->loadExpeditions();	// Load array ->expeditions
2929
+					$generic_commande->getLinesArray(); // Load array ->lines
2930
+					$generic_commande->loadExpeditions(); // Load array ->expeditions
2931 2931
 
2932 2932
 					$numlines = count($generic_commande->lines); // Loop on each line of order
2933 2933
 					for ($lig = 0; $lig < $numlines; $lig++) {
2934 2934
 						$orderLine = $generic_commande->lines[$lig];
2935 2935
 						'@phan-var-force OrderLine $orderLine';
2936 2936
 						if (isset($generic_commande->expeditions[$orderLine->id])) {
2937
-							$reliquat =  $orderLine->qty - $generic_commande->expeditions[$orderLine->id];
2937
+							$reliquat = $orderLine->qty - $generic_commande->expeditions[$orderLine->id];
2938 2938
 						} else {
2939 2939
 							$reliquat = $orderLine->qty;
2940 2940
 						}
Please login to merge, or discard this patch.
htdocs/compta/facture/list.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 $search_product_category = GETPOST('search_product_category', 'intcomma');
179 179
 $search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha');
180 180
 $search_fk_fac_rec_source = GETPOST('search_fk_fac_rec_source', 'int');
181
-$search_import_key  = trim(GETPOST("search_import_key", "alpha"));
181
+$search_import_key = trim(GETPOST("search_import_key", "alpha"));
182 182
 
183 183
 $search_option = GETPOST('search_option');
184 184
 if ($search_option == 'late') {
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
 // --------------------------------------------------------------------
736 736
 $sql = 'SELECT';
737 737
 if ($search_all) {
738
-	$sql = 'SELECT DISTINCT';	// Because of link to llx_facturedet
738
+	$sql = 'SELECT DISTINCT'; // Because of link to llx_facturedet
739 739
 }
740 740
 $sql .= ' f.rowid as id, f.ref, f.ref_client, f.fk_soc, f.type, f.subtype, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total_ht, f.total_tva, f.total_ttc,';
741 741
 $sql .= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 	$sql .= natural_search('facrec.titre', $search_fac_rec_source_title);
990 990
 }
991 991
 if ($search_fk_fac_rec_source) {
992
-	$sql .= ' AND f.fk_fac_rec_source = ' . (int) $search_fk_fac_rec_source;
992
+	$sql .= ' AND f.fk_fac_rec_source = '.(int) $search_fk_fac_rec_source;
993 993
 }
994 994
 if ($search_import_key) {
995 995
 	$sql .= natural_search("s.import_key", $search_import_key);
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 			if ($searchCategoryInvoiceOperator == 0) {
1024 1024
 				$searchCategoryInvoiceSqlList[] = " EXISTS (SELECT ck.fk_invoice FROM ".MAIN_DB_PREFIX."categorie_invoice as ck WHERE f.rowid = ck.fk_invoice AND ck.fk_categorie = ".((int) $searchCategoryInvoice).")";
1025 1025
 			} else {
1026
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryInvoice);
1026
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryInvoice);
1027 1027
 			}
1028 1028
 		}
1029 1029
 	}
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 			if ($searchCategoryProductOperator == 0) {
1055 1055
 				$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
1056 1056
 			} else {
1057
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
1057
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct);
1058 1058
 			}
1059 1059
 		}
1060 1060
 	}
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
 			if ($searchCategoryCustomerOperator == 0) {
1085 1085
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
1086 1086
 			} else {
1087
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
1087
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
1088 1088
 			}
1089 1089
 		}
1090 1090
 	}
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 	$param .= '&search_fac_rec_source_title='.urlencode($search_fac_rec_source_title);
1372 1372
 }
1373 1373
 if ($search_fk_fac_rec_source) {
1374
-	$param .= '&search_fk_fac_rec_source=' . (int) $search_fk_fac_rec_source;
1374
+	$param .= '&search_fk_fac_rec_source='.(int) $search_fk_fac_rec_source;
1375 1375
 }
1376 1376
 if ($search_import_key != '') {
1377 1377
 	$param .= '&search_import_key='.urlencode($search_import_key);
@@ -2168,7 +2168,7 @@  discard block
 block discarded – undo
2168 2168
 
2169 2169
 		$facturestatic->id = $obj->id;
2170 2170
 		$facturestatic->ref = $obj->ref;
2171
-		$facturestatic->ref_client = $obj->ref_client;		// deprecated
2171
+		$facturestatic->ref_client = $obj->ref_client; // deprecated
2172 2172
 		$facturestatic->ref_customer = $obj->ref_client;
2173 2173
 		$facturestatic->type = $obj->type;
2174 2174
 		$facturestatic->subtype = $obj->subtype;
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
 		$facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht;
2181 2181
 		$facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat;
2182 2182
 		$facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
2183
-		$facturestatic->statut = $obj->fk_statut;	// deprecated
2183
+		$facturestatic->statut = $obj->fk_statut; // deprecated
2184 2184
 		$facturestatic->status = $obj->fk_statut;
2185 2185
 		$facturestatic->close_code = $obj->close_code;
2186 2186
 		$facturestatic->total_ttc = $obj->total_ttc;
Please login to merge, or discard this patch.
htdocs/compta/prelevement/class/bonprelevement.class.php 1 patch
Spacing   +452 added lines, -452 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
  * \brief      File of withdrawal receipts class
30 30
  */
31 31
 
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
34
-require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
36
-require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
37
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/salaries/class/salary.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/salaries/class/paymentsalary.class.php';
41
-require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
42
-require_once DOL_DOCUMENT_ROOT . '/user/class/userbankaccount.class.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
34
+require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
37
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
41
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php';
43 43
 
44 44
 
45 45
 /**
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 
150 150
 	const STATUS_DRAFT = 0;
151 151
 	const STATUS_TRANSFERED = 1;
152
-	const STATUS_CREDITED = 2;		// STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
153
-	const STATUS_DEBITED = 2;		// STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
152
+	const STATUS_CREDITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
153
+	const STATUS_DEBITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
154 154
 
155 155
 
156 156
 	/**
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
 		if ($result == 0) {
341 341
 			if ($line_id > 0) {
342
-				$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement (";
342
+				$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement (";
343 343
 				if ($type != 'bank-transfer') {
344 344
 					$sql .= "fk_facture";
345 345
 				} else {
@@ -352,24 +352,24 @@  discard block
 block discarded – undo
352 352
 				$sql .= ",fk_prelevement_lignes";
353 353
 				$sql .= ") VALUES (";
354 354
 				$sql .= ((int) $invoice_id);
355
-				$sql .= ", " . ((int) $line_id);
355
+				$sql .= ", ".((int) $line_id);
356 356
 				$sql .= ")";
357 357
 
358 358
 				if ($this->db->query($sql)) {
359 359
 					$result = 0;
360 360
 				} else {
361 361
 					$result = -1;
362
-					$this->errors[] = get_class($this) . "::AddFacture " . $this->db->lasterror;
363
-					dol_syslog(get_class($this) . "::AddFacture Error $result");
362
+					$this->errors[] = get_class($this)."::AddFacture ".$this->db->lasterror;
363
+					dol_syslog(get_class($this)."::AddFacture Error $result");
364 364
 				}
365 365
 			} else {
366 366
 				$result = -2;
367
-				$this->errors[] = get_class($this) . "::AddFacture linedid Empty";
368
-				dol_syslog(get_class($this) . "::AddFacture Error $result");
367
+				$this->errors[] = get_class($this)."::AddFacture linedid Empty";
368
+				dol_syslog(get_class($this)."::AddFacture Error $result");
369 369
 			}
370 370
 		} else {
371 371
 			$result = -3;
372
-			dol_syslog(get_class($this) . "::AddFacture Error $result");
372
+			dol_syslog(get_class($this)."::AddFacture Error $result");
373 373
 		}
374 374
 
375 375
 		return $result;
@@ -392,23 +392,23 @@  discard block
 block discarded – undo
392 392
 	public function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key, $sourcetype = '')
393 393
 	{
394 394
 		$result = -1;
395
-		$concat = 0;	// ??? what is this for. Seems not used.
395
+		$concat = 0; // ??? what is this for. Seems not used.
396 396
 
397 397
 		if ($concat == 1) {
398 398
 			/*
399 399
 			 * We aggregate the lines
400 400
 			 */
401 401
 			$sql = "SELECT rowid";
402
-			$sql .= " FROM  " . MAIN_DB_PREFIX . "prelevement_lignes";
403
-			$sql .= " WHERE fk_prelevement_bons = " . ((int) $this->id);
402
+			$sql .= " FROM  ".MAIN_DB_PREFIX."prelevement_lignes";
403
+			$sql .= " WHERE fk_prelevement_bons = ".((int) $this->id);
404 404
 			if ($sourcetype == 'salary') {
405
-				$sql .= " AND fk_soc = " . ((int) $client_id);
405
+				$sql .= " AND fk_soc = ".((int) $client_id);
406 406
 			} else {
407
-				$sql .= " AND fk_user = " . ((int) $client_id);
407
+				$sql .= " AND fk_user = ".((int) $client_id);
408 408
 			}
409
-			$sql .= " AND code_banque = '" . $this->db->escape($code_banque) . "'";
410
-			$sql .= " AND code_guichet = '" . $this->db->escape($code_guichet) . "'";
411
-			$sql .= " AND number = '" . $this->db->escape($number) . "'";
409
+			$sql .= " AND code_banque = '".$this->db->escape($code_banque)."'";
410
+			$sql .= " AND code_guichet = '".$this->db->escape($code_guichet)."'";
411
+			$sql .= " AND number = '".$this->db->escape($number)."'";
412 412
 
413 413
 			$resql = $this->db->query($sql);
414 414
 			if ($resql) {
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 			/*
421 421
 			 * No aggregate
422 422
 			 */
423
-			$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_lignes (";
423
+			$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes (";
424 424
 			$sql .= "fk_prelevement_bons";
425 425
 			$sql .= ", fk_soc";
426 426
 			$sql .= ", client_nom";
@@ -432,21 +432,21 @@  discard block
 block discarded – undo
432 432
 			$sql .= ($sourcetype == 'salary' ? ", fk_user" : "");
433 433
 			$sql .= ") VALUES (";
434 434
 			$sql .= $this->id;
435
-			$sql .= ", " . (($sourcetype != 'salary') ? ((int) $client_id) : "0");	// fk_soc can't be null
436
-			$sql .= ", '" . $this->db->escape($client_nom) . "'";
437
-			$sql .= ", " . ((float) price2num($amount));
438
-			$sql .= ", '" . $this->db->escape($code_banque) . "'";
439
-			$sql .= ", '" . $this->db->escape($code_guichet) . "'";
440
-			$sql .= ", '" . $this->db->escape($number) . "'";
441
-			$sql .= ", '" . $this->db->escape($number_key) . "'";
442
-			$sql .= (($sourcetype == 'salary') ? ", " . ((int) $client_id) : '');
435
+			$sql .= ", ".(($sourcetype != 'salary') ? ((int) $client_id) : "0"); // fk_soc can't be null
436
+			$sql .= ", '".$this->db->escape($client_nom)."'";
437
+			$sql .= ", ".((float) price2num($amount));
438
+			$sql .= ", '".$this->db->escape($code_banque)."'";
439
+			$sql .= ", '".$this->db->escape($code_guichet)."'";
440
+			$sql .= ", '".$this->db->escape($number)."'";
441
+			$sql .= ", '".$this->db->escape($number_key)."'";
442
+			$sql .= (($sourcetype == 'salary') ? ", ".((int) $client_id) : '');
443 443
 			$sql .= ")";
444 444
 			if ($this->db->query($sql)) {
445
-				$line_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "prelevement_lignes");
445
+				$line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes");
446 446
 				$result = 0;
447 447
 			} else {
448
-				$this->errors[] = get_class($this) . "::addline Error -2 " . $this->db->lasterror;
449
-				dol_syslog(get_class($this) . "::addline Error -2");
448
+				$this->errors[] = get_class($this)."::addline Error -2 ".$this->db->lasterror;
449
+				dol_syslog(get_class($this)."::addline Error -2");
450 450
 				$result = -2;
451 451
 			}
452 452
 		}
@@ -489,15 +489,15 @@  discard block
 block discarded – undo
489 489
 		$sql .= ", p.type";
490 490
 		$sql .= ", p.fk_bank_account";
491 491
 		$sql .= ", p.statut as status";
492
-		$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as p";
493
-		$sql .= " WHERE p.entity IN (" . getEntity('invoice') . ")";
492
+		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
493
+		$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
494 494
 		if ($rowid > 0) {
495
-			$sql .= " AND p.rowid = " . ((int) $rowid);
495
+			$sql .= " AND p.rowid = ".((int) $rowid);
496 496
 		} else {
497
-			$sql .= " AND p.ref = '" . $this->db->escape($ref) . "'";
497
+			$sql .= " AND p.ref = '".$this->db->escape($ref)."'";
498 498
 		}
499 499
 
500
-		dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
500
+		dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
501 501
 		$result = $this->db->query($sql);
502 502
 		if ($result) {
503 503
 			if ($this->db->num_rows($result)) {
@@ -523,13 +523,13 @@  discard block
 block discarded – undo
523 523
 				if (empty($this->status)) {		// Value is sometimes null in database
524 524
 					$this->status = 0;
525 525
 				}
526
-				$this->statut         = $this->status; // For backward compatibility
526
+				$this->statut = $this->status; // For backward compatibility
527 527
 
528 528
 				$this->fetched = 1;
529 529
 
530 530
 				return 1;
531 531
 			} else {
532
-				dol_syslog(get_class($this) . "::Fetch no record found");
532
+				dol_syslog(get_class($this)."::Fetch no record found");
533 533
 				return 0;
534 534
 			}
535 535
 		} else {
@@ -570,19 +570,19 @@  discard block
 block discarded – undo
570 570
 			if ($date < $this->date_trans) {
571 571
 				$langs->load("errors");
572 572
 				$this->error = $langs->trans('ErrorDateOfMovementLowerThanDateOfFileTransmission');
573
-				dol_syslog("bon-prelevment::set_infocredit 1027 " . $this->error);
573
+				dol_syslog("bon-prelevment::set_infocredit 1027 ".$this->error);
574 574
 				return -1027;
575 575
 			}
576 576
 
577 577
 			$this->db->begin();
578 578
 
579
-			$sql = " UPDATE " . MAIN_DB_PREFIX . "prelevement_bons";
580
-			$sql .= " SET fk_user_credit = " . ((int) $user->id);
581
-			$sql .= ", statut = " . self::STATUS_CREDITED;
582
-			$sql .= ", date_credit = '" . $this->db->idate($date) . "'";
583
-			$sql .= " WHERE rowid = " . ((int) $this->id);
584
-			$sql .= " AND entity = " . ((int) $conf->entity);
585
-			$sql .= " AND statut = " . self::STATUS_TRANSFERED;
579
+			$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_bons";
580
+			$sql .= " SET fk_user_credit = ".((int) $user->id);
581
+			$sql .= ", statut = ".self::STATUS_CREDITED;
582
+			$sql .= ", date_credit = '".$this->db->idate($date)."'";
583
+			$sql .= " WHERE rowid = ".((int) $this->id);
584
+			$sql .= " AND entity = ".((int) $conf->entity);
585
+			$sql .= " AND statut = ".self::STATUS_TRANSFERED;
586 586
 
587 587
 			$resql = $this->db->query($sql);
588 588
 			if ($resql) {
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 						$error++;
697 697
 						$this->error = $paiement->error;
698 698
 						$this->errors = $paiement->errors;
699
-						dol_syslog(get_class($this) . "::set_infocredit AddPayment Error " . $this->error);
699
+						dol_syslog(get_class($this)."::set_infocredit AddPayment Error ".$this->error);
700 700
 					} else {
701 701
 						if ($this->type == 'bank-transfer') {
702 702
 							if ($type == 'salary') {
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 						} else {
712 712
 							$modeforaddpayment = 'payment';
713 713
 							$labelforaddpayment = '(CustomerInvoicePayment)';
714
-							$addbankurl = 'direct-debit';	// = 'directdebit'
714
+							$addbankurl = 'direct-debit'; // = 'directdebit'
715 715
 						}
716 716
 
717 717
 
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 							$error++;
727 727
 							$this->error = $paiement->error;
728 728
 							$this->errors = $paiement->errors;
729
-							dol_syslog(get_class($this) . "::set_infocredit AddPaymentToBank Error " . $this->error);
729
+							dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error);
730 730
 						}
731 731
 					}
732 732
 				}
@@ -734,24 +734,24 @@  discard block
 block discarded – undo
734 734
 				// Update withdrawal line
735 735
 				// TODO: Translate to ligneprelevement.class.php
736 736
 				if (!$error) {
737
-					$sql = " UPDATE " . MAIN_DB_PREFIX . "prelevement_lignes";
737
+					$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes";
738 738
 					$sql .= " SET statut = 2";
739
-					$sql .= " WHERE fk_prelevement_bons = " . ((int) $this->id);
739
+					$sql .= " WHERE fk_prelevement_bons = ".((int) $this->id);
740 740
 
741 741
 					if (!$this->db->query($sql)) {
742
-						dol_syslog(get_class($this) . "::set_infocredit Update lines Error");
742
+						dol_syslog(get_class($this)."::set_infocredit Update lines Error");
743 743
 						$error++;
744 744
 					}
745 745
 				}
746 746
 			} else {
747 747
 				$this->error = $this->db->lasterror();
748
-				dol_syslog(get_class($this) . "::set_infocredit Update Bons Error");
748
+				dol_syslog(get_class($this)."::set_infocredit Update Bons Error");
749 749
 				$error++;
750 750
 			}
751 751
 
752 752
 			// End of procedure
753 753
 			if ($error == 0) {
754
-				$this->date_credit = $date;		// date credit or debit
754
+				$this->date_credit = $date; // date credit or debit
755 755
 				$this->statut = self::STATUS_CREDITED;
756 756
 				$this->status = self::STATUS_CREDITED;
757 757
 
@@ -782,17 +782,17 @@  discard block
 block discarded – undo
782 782
 
783 783
 		$error = 0;
784 784
 
785
-		dol_syslog(get_class($this) . "::set_infotrans Start", LOG_INFO);
785
+		dol_syslog(get_class($this)."::set_infotrans Start", LOG_INFO);
786 786
 
787 787
 		if ($this->db->begin()) {
788
-			$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons ";
789
-			$sql .= " SET fk_user_trans = " . $user->id;
790
-			$sql .= " , date_trans = '" . $this->db->idate($date) . "'";
791
-			$sql .= " , method_trans = " . ((int) $method);
792
-			$sql .= " , statut = " . self::STATUS_TRANSFERED;
793
-			$sql .= " WHERE rowid = " . ((int) $this->id);
794
-			$sql .= " AND entity = " . ((int) $conf->entity);
795
-			$sql .= " AND statut = " . self::STATUS_DRAFT;
788
+			$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons ";
789
+			$sql .= " SET fk_user_trans = ".$user->id;
790
+			$sql .= " , date_trans = '".$this->db->idate($date)."'";
791
+			$sql .= " , method_trans = ".((int) $method);
792
+			$sql .= " , statut = ".self::STATUS_TRANSFERED;
793
+			$sql .= " WHERE rowid = ".((int) $this->id);
794
+			$sql .= " AND entity = ".((int) $conf->entity);
795
+			$sql .= " AND statut = ".self::STATUS_DRAFT;
796 796
 
797 797
 			if ($this->db->query($sql)) {
798 798
 				$this->method_trans = $method;
@@ -817,12 +817,12 @@  discard block
 block discarded – undo
817 817
 				return 0;
818 818
 			} else {
819 819
 				$this->db->rollback();
820
-				dol_syslog(get_class($this) . "::set_infotrans ROLLBACK", LOG_ERR);
820
+				dol_syslog(get_class($this)."::set_infotrans ROLLBACK", LOG_ERR);
821 821
 
822 822
 				return -1;
823 823
 			}
824 824
 		} else {
825
-			dol_syslog(get_class($this) . "::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT);
825
+			dol_syslog(get_class($this)."::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT);
826 826
 			return -2;
827 827
 		}
828 828
 	}
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 
842 842
 		$arr = array();
843 843
 
844
-		dol_syslog(get_class($this) . "::getListInvoices");
844
+		dol_syslog(get_class($this)."::getListInvoices");
845 845
 
846 846
 		// Returns all invoices presented within same order
847 847
 		$sql = "SELECT ";
@@ -857,13 +857,13 @@  discard block
 block discarded – undo
857 857
 		if ($amounts) {
858 858
 			$sql .= ", SUM(pl.amount)";
859 859
 		}
860
-		$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as pb,";
861
-		$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
862
-		$sql .= " " . MAIN_DB_PREFIX . "prelevement as p";
860
+		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as pb,";
861
+		$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
862
+		$sql .= " ".MAIN_DB_PREFIX."prelevement as p";
863 863
 		$sql .= " WHERE p.fk_prelevement_lignes = pl.rowid";
864 864
 		$sql .= " AND pl.fk_prelevement_bons = pb.rowid";
865
-		$sql .= " AND pb.rowid = " . ((int) $this->id);
866
-		$sql .= " AND pb.entity = " . ((int) $conf->entity);
865
+		$sql .= " AND pb.rowid = ".((int) $this->id);
866
+		$sql .= " AND pb.entity = ".((int) $conf->entity);
867 867
 		if ($amounts) {
868 868
 			if ($this->type == 'bank-transfer') {
869 869
 				if ($type == 'salary') {
@@ -917,17 +917,17 @@  discard block
 block discarded – undo
917 917
 		$sql = "SELECT sum(pd.amount) as nb";
918 918
 		if ($type !== 'salary') {
919 919
 			if ($mode != 'bank-transfer') {
920
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f,";
920
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
921 921
 			} else {
922
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f,";
922
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
923 923
 			}
924 924
 		} else {
925
-			$sql .= " FROM " . MAIN_DB_PREFIX . "salary as s,";
925
+			$sql .= " FROM ".MAIN_DB_PREFIX."salary as s,";
926 926
 		}
927
-		$sql .= " " . MAIN_DB_PREFIX . "prelevement_demande as pd";
928
-		$sql .= ($type !== 'salary' ? " WHERE f.entity IN (" . getEntity('invoice') . ")" : " WHERE s.entity IN (" . getEntity('salary') . ")");
927
+		$sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pd";
928
+		$sql .= ($type !== 'salary' ? " WHERE f.entity IN (".getEntity('invoice').")" : " WHERE s.entity IN (".getEntity('salary').")");
929 929
 		if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) {
930
-			$sql .= ($type !== 'salary' ? " AND f.fk_statut = " . Facture::STATUS_VALIDATED : " AND s.paye = " . Salary::STATUS_UNPAID);
930
+			$sql .= ($type !== 'salary' ? " AND f.fk_statut = ".Facture::STATUS_VALIDATED : " AND s.paye = ".Salary::STATUS_UNPAID);
931 931
 		}
932 932
 		if ($type !== 'salary') {
933 933
 			if ($mode != 'bank-transfer') {
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 			return $obj->nb;
953 953
 		} else {
954 954
 			$error = 1;
955
-			dol_syslog(get_class($this) . "::SommeAPrelever Erreur -1");
955
+			dol_syslog(get_class($this)."::SommeAPrelever Erreur -1");
956 956
 			dol_syslog($this->db->error());
957 957
 
958 958
 			return -1;
@@ -988,26 +988,26 @@  discard block
 block discarded – undo
988 988
 		// phpcs:enable
989 989
 		if ($forsalary == 1) {
990 990
 			$sql = "SELECT count(s.rowid) as nb";
991
-			$sql .= " FROM " . MAIN_DB_PREFIX . "salary as s";
991
+			$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
992 992
 		} else {
993 993
 			$sql = "SELECT count(f.rowid) as nb";
994 994
 
995 995
 			if ($type == 'bank-transfer') {
996
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
996
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
997 997
 			} else {
998
-				$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
998
+				$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
999 999
 			}
1000 1000
 		}
1001
-		$sql .= ", " . MAIN_DB_PREFIX . "prelevement_demande as pd";
1001
+		$sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pd";
1002 1002
 		if ($forsalary == 1) {
1003
-			$sql .= " WHERE s.entity IN (" . getEntity('invoice') . ")";
1003
+			$sql .= " WHERE s.entity IN (".getEntity('invoice').")";
1004 1004
 			if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) {
1005 1005
 				$sql .= " AND s.paye = 0";
1006 1006
 			}
1007 1007
 		} else {
1008
-			$sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")";
1008
+			$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
1009 1009
 			if (!getDolGlobalString('WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS')) {
1010
-				$sql .= " AND f.fk_statut = " . Facture::STATUS_VALIDATED;
1010
+				$sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
1011 1011
 			}
1012 1012
 		}
1013 1013
 		if ($forsalary == 1) {
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 			$sql .= " AND s.paye = 0";
1028 1028
 		}
1029 1029
 
1030
-		dol_syslog(get_class($this) . "::NbFactureAPrelever");
1030
+		dol_syslog(get_class($this)."::NbFactureAPrelever");
1031 1031
 		$resql = $this->db->query($sql);
1032 1032
 
1033 1033
 		if ($resql) {
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 
1037 1037
 			return $obj->nb;
1038 1038
 		} else {
1039
-			$this->error = get_class($this) . "::NbFactureAPrelever Erreur -1 sql=" . $this->db->error();
1039
+			$this->error = get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error();
1040 1040
 			return -1;
1041 1041
 		}
1042 1042
 	}
@@ -1068,10 +1068,10 @@  discard block
 block discarded – undo
1068 1068
 		// phpcs:enable
1069 1069
 		global $conf, $langs, $user;
1070 1070
 
1071
-		dol_syslog(__METHOD__ . " Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format." type=".$type." did=".$did." fk_bank_account=".$fk_bank_account." sourcetype=".$sourcetype, LOG_DEBUG);
1071
+		dol_syslog(__METHOD__." Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format." type=".$type." did=".$did." fk_bank_account=".$fk_bank_account." sourcetype=".$sourcetype, LOG_DEBUG);
1072 1072
 
1073
-		require_once DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php";
1074
-		require_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php";
1073
+		require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
1074
+		require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
1075 1075
 
1076 1076
 		// Check params
1077 1077
 		if ($type != 'bank-transfer') {
@@ -1105,14 +1105,14 @@  discard block
 block discarded – undo
1105 1105
 		// Check if there is an iban associated to the bank transfer request or if we take the default
1106 1106
 		if ($did > 0) {
1107 1107
 			$sql = "SELECT pd.fk_societe_rib";
1108
-			$sql .= " FROM " . $this->db->prefix() . "prelevement_demande as pd";
1108
+			$sql .= " FROM ".$this->db->prefix()."prelevement_demande as pd";
1109 1109
 			$sql .= " WHERE pd.rowid = ".((int) $did);
1110 1110
 
1111 1111
 			$resql = $this->db->query($sql);
1112 1112
 
1113 1113
 			if (!$resql) {
1114 1114
 				$this->error = $this->db->lasterror();
1115
-				dol_syslog(__METHOD__ . " Read fk_societe_rib error " . $this->db->lasterror(), LOG_ERR);
1115
+				dol_syslog(__METHOD__." Read fk_societe_rib error ".$this->db->lasterror(), LOG_ERR);
1116 1116
 				return -1;
1117 1117
 			}
1118 1118
 
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
 			if ($obj) {
1121 1121
 				$thirdpartyBANId = $obj->fk_societe_rib;
1122 1122
 
1123
-				dol_syslog(__METHOD__ . " Found an BAN ID to use: ".$thirdpartyBANId);
1123
+				dol_syslog(__METHOD__." Found an BAN ID to use: ".$thirdpartyBANId);
1124 1124
 			}
1125 1125
 
1126 1126
 			$this->db->free($resql);
@@ -1146,10 +1146,10 @@  discard block
 block discarded – undo
1146 1146
 		$factures_errors = array();
1147 1147
 
1148 1148
 		if (!$error) {
1149
-			dol_syslog(__METHOD__ . " Read invoices for did=" . ((int) $did), LOG_DEBUG);
1149
+			dol_syslog(__METHOD__." Read invoices for did=".((int) $did), LOG_DEBUG);
1150 1150
 
1151 1151
 			$sql = "SELECT f.rowid, pd.rowid as pfdrowid";
1152
-			$sql .= ", f.".$this->db->sanitize($socOrUser);		// fk_soc or fk_user
1152
+			$sql .= ", f.".$this->db->sanitize($socOrUser); // fk_soc or fk_user
1153 1153
 			$sql .= ", pd.code_banque, pd.code_guichet, pd.number, pd.cle_rib";
1154 1154
 			$sql .= ", pd.amount";
1155 1155
 			if ($sourcetype != 'salary') {
@@ -1159,13 +1159,13 @@  discard block
 block discarded – undo
1159 1159
 				$sql .= ", CONCAT(s.firstname,' ',s.lastname) as name";
1160 1160
 				$sql .= ", f.ref, sr.bic, sr.iban_prefix, 'FRST' as frstrecur";
1161 1161
 			}
1162
-			$sql .= " FROM " . $this->db->prefix() . $sqlTable . " as f";	// f is salary, facture or facture_fourn
1163
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "prelevement_demande as pd ON f.rowid = pd.fk_".$this->db->sanitize($sqlTable);
1164
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser)." as s ON s.rowid = f.".$this->db->sanitize($socOrUser);
1165
-			$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser."_rib")." as sr ON s.rowid = sr.".$this->db->sanitize($socOrUser);
1162
+			$sql .= " FROM ".$this->db->prefix().$sqlTable." as f"; // f is salary, facture or facture_fourn
1163
+			$sql .= " LEFT JOIN ".$this->db->prefix()."prelevement_demande as pd ON f.rowid = pd.fk_".$this->db->sanitize($sqlTable);
1164
+			$sql .= " LEFT JOIN ".$this->db->prefix().$this->db->sanitize($societeOrUser)." as s ON s.rowid = f.".$this->db->sanitize($socOrUser);
1165
+			$sql .= " LEFT JOIN ".$this->db->prefix().$this->db->sanitize($societeOrUser."_rib")." as sr ON s.rowid = sr.".$this->db->sanitize($socOrUser);
1166 1166
 			if ($sourcetype != 'salary') {
1167 1167
 				if (!empty($thirdpartyBANId)) {
1168
-					$sql .= " AND sr.rowid = " . ((int) $thirdpartyBANId);
1168
+					$sql .= " AND sr.rowid = ".((int) $thirdpartyBANId);
1169 1169
 				} else {
1170 1170
 					$sql .= " AND sr.default_rib = 1";
1171 1171
 				}
@@ -1185,10 +1185,10 @@  discard block
 block discarded – undo
1185 1185
 			$sql .= " AND pd.traite = 0";
1186 1186
 			$sql .= " AND pd.ext_payment_id IS NULL";
1187 1187
 			if ($sourcetype != 'salary') {
1188
-				$sql .= " AND sr.type = 'ban'";		// TODO Add AND sr.type = 'ban' for users too
1188
+				$sql .= " AND sr.type = 'ban'"; // TODO Add AND sr.type = 'ban' for users too
1189 1189
 			}
1190 1190
 			if ($did > 0) {
1191
-				$sql .= " AND pd.rowid = " . ((int) $did);
1191
+				$sql .= " AND pd.rowid = ".((int) $did);
1192 1192
 			}
1193 1193
 
1194 1194
 			$resql = $this->db->query($sql);
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 				$i = 0;
1198 1198
 
1199 1199
 				while ($i < $num) {
1200
-					$row = $this->db->fetch_row($resql);	// TODO Replace with fetch_object()
1200
+					$row = $this->db->fetch_row($resql); // TODO Replace with fetch_object()
1201 1201
 					'@phan-var-force array<int<0,12>,string> $row';
1202 1202
 
1203 1203
 					// All fields: 0=rowid, 1=pfdrowid, 2=$socOrUser, 3=code_banque, 4=code_guichet, 5=number, 6=key, 7=amount, 8=name, 9=ref, 10=bic, 11=iban, 12=frstrecur
@@ -1208,35 +1208,35 @@  discard block
 block discarded – undo
1208 1208
 
1209 1209
 					if ($row[7] == 0) {
1210 1210
 						$error++;
1211
-						dol_syslog(__METHOD__ . " Read invoices/salary error Found a null amount", LOG_ERR);
1212
-						$this->invoice_in_error[$row[0]] = "Error for invoice or salary id " . $row[0] . ", found a null amount";
1211
+						dol_syslog(__METHOD__." Read invoices/salary error Found a null amount", LOG_ERR);
1212
+						$this->invoice_in_error[$row[0]] = "Error for invoice or salary id ".$row[0].", found a null amount";
1213 1213
 						break;
1214 1214
 					}
1215 1215
 					$i++;
1216 1216
 				}
1217 1217
 
1218 1218
 				$this->db->free($resql);
1219
-				dol_syslog(__METHOD__ . " Read invoices/salary, " . $i . " invoices/salary to withdraw", LOG_DEBUG);
1219
+				dol_syslog(__METHOD__." Read invoices/salary, ".$i." invoices/salary to withdraw", LOG_DEBUG);
1220 1220
 			} else {
1221 1221
 				$this->error = $this->db->lasterror();
1222
-				dol_syslog(__METHOD__ . " Read invoices/salary error " . $this->db->lasterror(), LOG_ERR);
1222
+				dol_syslog(__METHOD__." Read invoices/salary error ".$this->db->lasterror(), LOG_ERR);
1223 1223
 				return -1;
1224 1224
 			}
1225 1225
 		}
1226 1226
 
1227 1227
 		if (!$error) {
1228 1228
 			// Make some checks
1229
-			require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1230
-			require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
1231
-			require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
1232
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
1229
+			require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1230
+			require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
1231
+			require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
1232
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
1233 1233
 
1234 1234
 			$tmpsoc = new Societe($this->db);
1235 1235
 			$tmpuser = new User($this->db);
1236 1236
 
1237 1237
 			// Check BAN
1238 1238
 			$i = 0;
1239
-			dol_syslog(__METHOD__ . " Check BAN for each invoices or salary", LOG_DEBUG);
1239
+			dol_syslog(__METHOD__." Check BAN for each invoices or salary", LOG_DEBUG);
1240 1240
 
1241 1241
 			if (count($factures) > 0) {
1242 1242
 				foreach ($factures as $key => $fac) {
@@ -1267,31 +1267,31 @@  discard block
 block discarded – undo
1267 1267
 							if ($type != 'bank-transfer') {
1268 1268
 								$tmpsoc->id = (int) $fac[2];
1269 1269
 								$tmpsoc->name = $fac[8];
1270
-								$invoice_url = "<a href='" . DOL_URL_ROOT . '/compta/facture/card.php?facid=' . $fac[0] . "'>" . $fac[9] . "</a>";
1271
-								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1272
-								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1270
+								$invoice_url = "<a href='".DOL_URL_ROOT.'/compta/facture/card.php?facid='.$fac[0]."'>".$fac[9]."</a>";
1271
+								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1272
+								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1273 1273
 								$error++;
1274 1274
 							}
1275 1275
 							if ($type == 'bank-transfer' && $sourcetype != 'salary') {
1276 1276
 								$tmpsoc->id = (int) $fac[2];
1277 1277
 								$tmpsoc->name = $fac[8];
1278
-								$invoice_url = "<a href='" . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $fac[0] . "'>" . $fac[9] . "</a>";
1279
-								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1280
-								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice " . $invoice_url . " for thirdparty " . $tmpsoc->getNomUrl(0);
1278
+								$invoice_url = "<a href='".DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$fac[0]."'>".$fac[9]."</a>";
1279
+								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1280
+								$this->thirdparty_in_error[$tmpsoc->id] = "Error on default bank number IBAN/BIC for invoice ".$invoice_url." for thirdparty ".$tmpsoc->getNomUrl(0);
1281 1281
 								$error++;
1282 1282
 							}
1283 1283
 							if ($type == 'bank-transfer' && $sourcetype == 'salary') {
1284 1284
 								$tmpuser->id = (int) $fac[2];
1285 1285
 								$tmpuser->firstname = $fac[8];
1286
-								$salary_url = "<a href='" . DOL_URL_ROOT . '/salaries/card.php?id=' . $fac[0] . "'>" . $fac[0] . "</a>";
1287
-								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for salary " . $salary_url . " for employee " . $tmpuser->getNomUrl(0);
1288
-								$this->thirdparty_in_error[$tmpuser->id] = "Error on default bank number IBAN/BIC for salary " . $salary_url . " for employee " . $tmpuser->getNomUrl(0);
1286
+								$salary_url = "<a href='".DOL_URL_ROOT.'/salaries/card.php?id='.$fac[0]."'>".$fac[0]."</a>";
1287
+								$this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for salary ".$salary_url." for employee ".$tmpuser->getNomUrl(0);
1288
+								$this->thirdparty_in_error[$tmpuser->id] = "Error on default bank number IBAN/BIC for salary ".$salary_url." for employee ".$tmpuser->getNomUrl(0);
1289 1289
 								$error++;
1290 1290
 							}
1291
-							dol_syslog(__METHOD__ . " Check BAN Error on default bank number IBAN/BIC reported by verif(): " . implode(', ', $fac), LOG_WARNING);
1291
+							dol_syslog(__METHOD__." Check BAN Error on default bank number IBAN/BIC reported by verif(): ".implode(', ', $fac), LOG_WARNING);
1292 1292
 						}
1293 1293
 					} else {
1294
-						dol_syslog(__METHOD__ . " Check BAN Failed to read company", LOG_WARNING);
1294
+						dol_syslog(__METHOD__." Check BAN Failed to read company", LOG_WARNING);
1295 1295
 					}
1296 1296
 					/*
1297 1297
 					} else {
@@ -1300,14 +1300,14 @@  discard block
 block discarded – undo
1300 1300
 					*/
1301 1301
 				}
1302 1302
 			} else {
1303
-				dol_syslog(__METHOD__ . " Check BAN No invoice to process", LOG_WARNING);
1303
+				dol_syslog(__METHOD__." Check BAN No invoice to process", LOG_WARNING);
1304 1304
 			}
1305 1305
 		}
1306 1306
 
1307 1307
 		$ok = 0;
1308 1308
 
1309 1309
 		// Withdraw invoices in factures_prev array
1310
-		$out = count($factures_prev) . " invoices or salaries will be included.";
1310
+		$out = count($factures_prev)." invoices or salaries will be included.";
1311 1311
 		//print $out."\n";
1312 1312
 		dol_syslog($out);
1313 1313
 
@@ -1341,32 +1341,32 @@  discard block
 block discarded – undo
1341 1341
 			 * Process order generation
1342 1342
 			 */
1343 1343
 			if (!$error) {
1344
-				$ref = substr($year, -2) . $month;
1344
+				$ref = substr($year, -2).$month;
1345 1345
 
1346 1346
 				// Get next free number for the ref of bon prelevement
1347
-				$sql = "SELECT substring(ref from char_length(ref) - 1)";	// To extract "YYMMXX" from "TYYMMXX"
1348
-				$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons";
1349
-				$sql .= " WHERE ref LIKE '_" . $this->db->escape($ref) . "%'";
1350
-				$sql .= " AND entity = " . ((int) $conf->entity);
1347
+				$sql = "SELECT substring(ref from char_length(ref) - 1)"; // To extract "YYMMXX" from "TYYMMXX"
1348
+				$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons";
1349
+				$sql .= " WHERE ref LIKE '_".$this->db->escape($ref)."%'";
1350
+				$sql .= " AND entity = ".((int) $conf->entity);
1351 1351
 				$sql .= " ORDER BY ref DESC LIMIT 1";
1352 1352
 
1353
-				dol_syslog(get_class($this) . " get next free number", LOG_DEBUG);
1353
+				dol_syslog(get_class($this)." get next free number", LOG_DEBUG);
1354 1354
 				$resql = $this->db->query($sql);
1355 1355
 
1356 1356
 				if ($resql) {
1357 1357
 					$row = $this->db->fetch_row($resql);
1358 1358
 
1359 1359
 					// Build the new ref
1360
-					$ref = "T" . $ref . sprintf("%02d", (intval($row[0]) + 1));
1360
+					$ref = "T".$ref.sprintf("%02d", (intval($row[0]) + 1));
1361 1361
 
1362 1362
 					// $conf->abc->dir_output may be:
1363 1363
 					// /home/ldestailleur/git/dolibarr_15.0/documents/abc/
1364 1364
 					// or
1365 1365
 					// /home/ldestailleur/git/dolibarr_15.0/documents/X/abc with X >= 2 with multicompany.
1366 1366
 					if ($type != 'bank-transfer') {
1367
-						$dir = $conf->prelevement->dir_output . '/receipts';
1367
+						$dir = $conf->prelevement->dir_output.'/receipts';
1368 1368
 					} else {
1369
-						$dir = $conf->paymentbybanktransfer->dir_output . '/receipts';
1369
+						$dir = $conf->paymentbybanktransfer->dir_output.'/receipts';
1370 1370
 					}
1371 1371
 					if (!is_dir($dir)) {
1372 1372
 						dol_mkdir($dir);
@@ -1374,41 +1374,41 @@  discard block
 block discarded – undo
1374 1374
 
1375 1375
 					if (isModEnabled('multicompany')) {
1376 1376
 						$labelentity = $conf->entity;
1377
-						$this->filename = $dir . '/' . $ref . '-' . $labelentity . '.xml';
1377
+						$this->filename = $dir.'/'.$ref.'-'.$labelentity.'.xml';
1378 1378
 					} else {
1379
-						$this->filename = $dir . '/' . $ref . '.xml';
1379
+						$this->filename = $dir.'/'.$ref.'.xml';
1380 1380
 					}
1381 1381
 
1382 1382
 					// Create withdraw order in database
1383
-					$sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_bons (";
1383
+					$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
1384 1384
 					$sql .= "ref, entity, datec, type, fk_bank_account";
1385 1385
 					$sql .= ") VALUES (";
1386
-					$sql .= "'" . $this->db->escape($ref) . "'";
1387
-					$sql .= ", " . ((int) $conf->entity);
1388
-					$sql .= ", '" . $this->db->idate($now) . "'";
1389
-					$sql .= ", '" . ($type == 'bank-transfer' ? 'bank-transfer' : 'debit-order') . "'";
1390
-					$sql .= ", " . ((int) $fk_bank_account);
1386
+					$sql .= "'".$this->db->escape($ref)."'";
1387
+					$sql .= ", ".((int) $conf->entity);
1388
+					$sql .= ", '".$this->db->idate($now)."'";
1389
+					$sql .= ", '".($type == 'bank-transfer' ? 'bank-transfer' : 'debit-order')."'";
1390
+					$sql .= ", ".((int) $fk_bank_account);
1391 1391
 					$sql .= ")";
1392 1392
 
1393 1393
 					$resql = $this->db->query($sql);
1394 1394
 
1395 1395
 
1396 1396
 					if ($resql) {
1397
-						$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "prelevement_bons");
1397
+						$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
1398 1398
 						$this->id = $prev_id;
1399 1399
 						$this->ref = $ref;
1400 1400
 					} else {
1401 1401
 						$error++;
1402
-						dol_syslog(__METHOD__ . " Create withdraw receipt " . $this->db->lasterror(), LOG_ERR);
1402
+						dol_syslog(__METHOD__." Create withdraw receipt ".$this->db->lasterror(), LOG_ERR);
1403 1403
 					}
1404 1404
 				} else {
1405 1405
 					$error++;
1406
-					dol_syslog(__METHOD__ . " Get last withdraw receipt " . $this->db->lasterror(), LOG_ERR);
1406
+					dol_syslog(__METHOD__." Get last withdraw receipt ".$this->db->lasterror(), LOG_ERR);
1407 1407
 				}
1408 1408
 			}
1409 1409
 
1410 1410
 			if (!$error) {
1411
-				dol_syslog(__METHOD__ . " Now loop on each document to insert them in llx_prelevement_demande");
1411
+				dol_syslog(__METHOD__." Now loop on each document to insert them in llx_prelevement_demande");
1412 1412
 
1413 1413
 				// Add lines for the bon
1414 1414
 				if (count($factures_prev) > 0) {
@@ -1437,17 +1437,17 @@  discard block
 block discarded – undo
1437 1437
 						}
1438 1438
 
1439 1439
 						// Update invoice requests as done
1440
-						$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_demande";
1440
+						$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande";
1441 1441
 						$sql .= " SET traite = 1";
1442
-						$sql .= ", date_traite = '" . $this->db->idate($now) . "'";
1443
-						$sql .= ", fk_prelevement_bons = " . ((int) $this->id);
1444
-						$sql .= " WHERE rowid = " . ((int) $fac[1]);
1442
+						$sql .= ", date_traite = '".$this->db->idate($now)."'";
1443
+						$sql .= ", fk_prelevement_bons = ".((int) $this->id);
1444
+						$sql .= " WHERE rowid = ".((int) $fac[1]);
1445 1445
 
1446 1446
 						$resql = $this->db->query($sql);
1447 1447
 						if (!$resql) {
1448 1448
 							$error++;
1449 1449
 							$this->errors[] = $this->db->lasterror();
1450
-							dol_syslog(__METHOD__ . " Update Error=" . $this->db->lasterror(), LOG_ERR);
1450
+							dol_syslog(__METHOD__." Update Error=".$this->db->lasterror(), LOG_ERR);
1451 1451
 						}
1452 1452
 					}
1453 1453
 				}
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
 				 * Create file of type='direct-debit' for direct debit order or type='bank-transfer' for credit transfer into a XML file
1459 1459
 				 */
1460 1460
 
1461
-				dol_syslog(__METHOD__ . " Init direct debit or credit transfer file for " . count($factures_prev) . " invoices", LOG_DEBUG);
1461
+				dol_syslog(__METHOD__." Init direct debit or credit transfer file for ".count($factures_prev)." invoices", LOG_DEBUG);
1462 1462
 
1463 1463
 				if (count($factures_prev) > 0) {
1464 1464
 					$this->date_echeance = $datetimeprev;
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
 						$this->emetteur_iban               = $account->iban;
1475 1475
 						$this->emetteur_bic                = $account->bic;
1476 1476
 
1477
-						$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics);	// Example "FR78ZZZ123456"
1477
+						$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Example "FR78ZZZ123456"
1478 1478
 
1479 1479
 						$this->raison_sociale = $account->owner_name;
1480 1480
 					}
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 						$error++;
1494 1494
 					}
1495 1495
 				}
1496
-				dol_syslog(__METHOD__ . " Bank order file has been generated under filename " . $this->filename, LOG_DEBUG);
1496
+				dol_syslog(__METHOD__." Bank order file has been generated under filename ".$this->filename, LOG_DEBUG);
1497 1497
 			}
1498 1498
 
1499 1499
 
@@ -1501,15 +1501,15 @@  discard block
 block discarded – undo
1501 1501
 			 * Update total defined after generation of file
1502 1502
 			 */
1503 1503
 			if (!$error) {
1504
-				$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons";
1505
-				$sql .= " SET amount = " . price2num($this->total);
1506
-				$sql .= " WHERE rowid = " . ((int) $this->id);
1507
-				$sql .= " AND entity = " . ((int) $conf->entity);
1504
+				$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons";
1505
+				$sql .= " SET amount = ".price2num($this->total);
1506
+				$sql .= " WHERE rowid = ".((int) $this->id);
1507
+				$sql .= " AND entity = ".((int) $conf->entity);
1508 1508
 				$resql = $this->db->query($sql);
1509 1509
 
1510 1510
 				if (!$resql) {
1511 1511
 					$error++;
1512
-					dol_syslog(__METHOD__ . " Error update total: " . $this->db->error(), LOG_ERR);
1512
+					dol_syslog(__METHOD__." Error update total: ".$this->db->error(), LOG_ERR);
1513 1513
 				}
1514 1514
 			}
1515 1515
 
@@ -1529,7 +1529,7 @@  discard block
 block discarded – undo
1529 1529
 
1530 1530
 			if (!$error) {
1531 1531
 				$this->db->commit();
1532
-				return count($factures_prev);	// The error of failed lines are into $this->invoice_in_error and $this->thirdparty_in_error
1532
+				return count($factures_prev); // The error of failed lines are into $this->invoice_in_error and $this->thirdparty_in_error
1533 1533
 			} else {
1534 1534
 				$this->db->rollback();
1535 1535
 				return -1;
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 		}
1569 1569
 
1570 1570
 		if (!$error) {
1571
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement WHERE fk_prelevement_lignes IN (SELECT rowid FROM " . MAIN_DB_PREFIX . "prelevement_lignes WHERE fk_prelevement_bons = " . ((int) $this->id) . ")";
1571
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id).")";
1572 1572
 			$resql1 = $this->db->query($sql);
1573 1573
 			if (!$resql1) {
1574 1574
 				dol_print_error($this->db);
@@ -1576,7 +1576,7 @@  discard block
 block discarded – undo
1576 1576
 		}
1577 1577
 
1578 1578
 		if (!$error) {
1579
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement_lignes WHERE fk_prelevement_bons = " . ((int) $this->id);
1579
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".((int) $this->id);
1580 1580
 			$resql2 = $this->db->query($sql);
1581 1581
 			if (!$resql2) {
1582 1582
 				dol_print_error($this->db);
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
 		}
1585 1585
 
1586 1586
 		if (!$error) {
1587
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . "prelevement_bons WHERE rowid = " . ((int) $this->id);
1587
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = ".((int) $this->id);
1588 1588
 			$resql3 = $this->db->query($sql);
1589 1589
 			if (!$resql3) {
1590 1590
 				dol_print_error($this->db);
@@ -1592,7 +1592,7 @@  discard block
 block discarded – undo
1592 1592
 		}
1593 1593
 
1594 1594
 		if (!$error) {
1595
-			$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = " . ((int) $this->id);
1595
+			$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = ".((int) $this->id);
1596 1596
 			$resql4 = $this->db->query($sql);
1597 1597
 			if (!$resql4) {
1598 1598
 				dol_print_error($this->db);
@@ -1634,22 +1634,22 @@  discard block
 block discarded – undo
1634 1634
 			$labeltoshow = 'PaymentByBankTransfer';
1635 1635
 		}
1636 1636
 
1637
-		$label = img_picto('', $this->picto) . ' <u>' . $langs->trans($labeltoshow) . '</u> ' . $this->getLibStatut(5);
1637
+		$label = img_picto('', $this->picto).' <u>'.$langs->trans($labeltoshow).'</u> '.$this->getLibStatut(5);
1638 1638
 		$label .= '<br>';
1639
-		$label .= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
1639
+		$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
1640 1640
 		if (isset($this->amount)) {
1641
-			$label .= '<br><b>' . $langs->trans("Amount") . ":</b> " . price($this->amount);
1641
+			$label .= '<br><b>'.$langs->trans("Amount").":</b> ".price($this->amount);
1642 1642
 		}
1643 1643
 		if (isset($this->date_trans)) {
1644
-			$label .= '<br><b>' . $langs->trans("TransData") . ":</b> " . dol_print_date($this->date_trans, 'dayhour', 'tzuserrel');
1644
+			$label .= '<br><b>'.$langs->trans("TransData").":</b> ".dol_print_date($this->date_trans, 'dayhour', 'tzuserrel');
1645 1645
 		}
1646 1646
 		/*if (isset($this->date_credit)) {
1647 1647
 			$label .= '<br><b>'.$langs->trans("TransData").":</b> ".dol_print_date($this->date_credit, 'dayhour', 'tzuserrel');
1648 1648
 		}*/
1649 1649
 
1650
-		$url = DOL_URL_ROOT . '/compta/prelevement/card.php?id=' . $this->id;
1650
+		$url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;
1651 1651
 		if (!empty($this->type) && $this->type == 'bank-transfer') {
1652
-			$url = DOL_URL_ROOT . '/compta/prelevement/card.php?id=' . $this->id;
1652
+			$url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;
1653 1653
 		}
1654 1654
 
1655 1655
 		if ($option != 'nolink') {
@@ -1667,21 +1667,21 @@  discard block
 block discarded – undo
1667 1667
 		if (empty($notooltip)) {
1668 1668
 			if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
1669 1669
 				$label = $langs->trans("ShowMyObject");
1670
-				$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
1670
+				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
1671 1671
 			}
1672
-			$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
1673
-			$linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"';
1672
+			$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
1673
+			$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
1674 1674
 		} else {
1675
-			$linkclose = ($morecss ? ' class="' . $morecss . '"' : '');
1675
+			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
1676 1676
 		}
1677 1677
 
1678
-		$linkstart = '<a href="' . $url . '"';
1679
-		$linkstart .= $linkclose . '>';
1678
+		$linkstart = '<a href="'.$url.'"';
1679
+		$linkstart .= $linkclose.'>';
1680 1680
 		$linkend = '</a>';
1681 1681
 
1682 1682
 		$result .= $linkstart;
1683 1683
 		if ($withpicto) {
1684
-			$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
1684
+			$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
1685 1685
 		}
1686 1686
 		if ($withpicto != 2) {
1687 1687
 			$result .= $this->ref;
@@ -1710,8 +1710,8 @@  discard block
 block discarded – undo
1710 1710
 	 */
1711 1711
 	public function deleteNotificationById($rowid)
1712 1712
 	{
1713
-		$sql = "DELETE FROM " . MAIN_DB_PREFIX . "notify_def";
1714
-		$sql .= " WHERE rowid = " . ((int) $rowid);
1713
+		$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
1714
+		$sql .= " WHERE rowid = ".((int) $rowid);
1715 1715
 
1716 1716
 		if ($this->db->query($sql)) {
1717 1717
 			return 0;
@@ -1735,8 +1735,8 @@  discard block
 block discarded – undo
1735 1735
 			$userid = $user;
1736 1736
 		}
1737 1737
 
1738
-		$sql = "DELETE FROM " . MAIN_DB_PREFIX . "notify_def";
1739
-		$sql .= " WHERE fk_user=" . ((int) $userid) . " AND fk_action='" . $this->db->escape($action) . "'";
1738
+		$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
1739
+		$sql .= " WHERE fk_user=".((int) $userid)." AND fk_action='".$this->db->escape($action)."'";
1740 1740
 
1741 1741
 		if ($this->db->query($sql)) {
1742 1742
 			return 0;
@@ -1768,15 +1768,15 @@  discard block
 block discarded – undo
1768 1768
 		if ($this->deleteNotification($user, $action) == 0) {
1769 1769
 			$now = dol_now();
1770 1770
 
1771
-			$sql = "INSERT INTO " . MAIN_DB_PREFIX . "notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)";
1772
-			$sql .= " VALUES ('" . $this->db->idate($now) . "', " . ((int) $userid) . ", 'NULL', 'NULL', '" . $this->db->escape($action) . "')";
1771
+			$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)";
1772
+			$sql .= " VALUES ('".$this->db->idate($now)."', ".((int) $userid).", 'NULL', 'NULL', '".$this->db->escape($action)."')";
1773 1773
 
1774
-			dol_syslog("adnotiff: " . $sql);
1774
+			dol_syslog("adnotiff: ".$sql);
1775 1775
 			if ($this->db->query($sql)) {
1776 1776
 				$result = 0;
1777 1777
 			} else {
1778 1778
 				$result = -1;
1779
-				dol_syslog(get_class($this) . "::addNotification Error $result");
1779
+				dol_syslog(get_class($this)."::addNotification Error $result");
1780 1780
 			}
1781 1781
 		}
1782 1782
 
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 
1813 1813
 		$result = 0;
1814 1814
 
1815
-		dol_syslog(get_class($this) . "::generate build file=" . $this->filename . " type=" . $type);
1815
+		dol_syslog(get_class($this)."::generate build file=".$this->filename." type=".$type);
1816 1816
 
1817 1817
 		$this->file = fopen($this->filename, "w");
1818 1818
 		if ($this->file == false) {
@@ -1858,20 +1858,20 @@  discard block
 block discarded – undo
1858 1858
 				$sql .= " f.ref as reffac, p.fk_facture as idfac,";
1859 1859
 				$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum";
1860 1860
 				$sql .= " FROM";
1861
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
1862
-				$sql .= " " . MAIN_DB_PREFIX . "facture as f,";
1863
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement as p,";
1864
-				$sql .= " " . MAIN_DB_PREFIX . "societe as soc,";
1865
-				$sql .= " " . MAIN_DB_PREFIX . "c_country as c,";
1866
-				$sql .= " " . MAIN_DB_PREFIX . "societe_rib as rib";
1867
-				$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
1861
+				$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
1862
+				$sql .= " ".MAIN_DB_PREFIX."facture as f,";
1863
+				$sql .= " ".MAIN_DB_PREFIX."prelevement as p,";
1864
+				$sql .= " ".MAIN_DB_PREFIX."societe as soc,";
1865
+				$sql .= " ".MAIN_DB_PREFIX."c_country as c,";
1866
+				$sql .= " ".MAIN_DB_PREFIX."societe_rib as rib";
1867
+				$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
1868 1868
 				$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
1869 1869
 				$sql .= " AND p.fk_facture = f.rowid";
1870 1870
 				$sql .= " AND f.fk_soc = soc.rowid";
1871 1871
 				$sql .= " AND soc.fk_pays = c.rowid";
1872 1872
 				$sql .= " AND rib.fk_soc = f.fk_soc";
1873 1873
 				if (!empty($thirdpartyBANId)) {
1874
-					$sql .= " AND rib.rowid = " . ((int) $thirdpartyBANId);
1874
+					$sql .= " AND rib.rowid = ".((int) $thirdpartyBANId);
1875 1875
 				} else {
1876 1876
 					$sql .= " AND rib.default_rib = 1";
1877 1877
 				}
@@ -1906,7 +1906,7 @@  discard block
 block discarded – undo
1906 1906
 					$nbtotalDrctDbtTxInf = $i;
1907 1907
 				} else {
1908 1908
 					$this->error = $this->db->lasterror();
1909
-					fwrite($this->file, 'ERROR DEBITOR ' . $sql . $CrLf); // DEBITOR = Customers
1909
+					fwrite($this->file, 'ERROR DEBITOR '.$sql.$CrLf); // DEBITOR = Customers
1910 1910
 					$result = -2;
1911 1911
 				}
1912 1912
 
@@ -1923,26 +1923,26 @@  discard block
 block discarded – undo
1923 1923
 				 * SECTION CREATION SEPA FILE - ISO200022
1924 1924
 				 */
1925 1925
 				// SEPA File Header
1926
-				fwrite($this->file, '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>' . $CrLf);
1927
-				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . $CrLf);
1928
-				fwrite($this->file, '	<CstmrDrctDbtInitn>' . $CrLf);
1926
+				fwrite($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf);
1927
+				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'.$CrLf);
1928
+				fwrite($this->file, '	<CstmrDrctDbtInitn>'.$CrLf);
1929 1929
 				// SEPA Group header
1930
-				fwrite($this->file, '		<GrpHdr>' . $CrLf);
1931
-				fwrite($this->file, '			<MsgId>' . ('DOL/' . $dateTime_YMD . '/DD' . $this->id) . '</MsgId>' . $CrLf);
1932
-				fwrite($this->file, '			<CreDtTm>' . $dateTime_ECMA . '</CreDtTm>' . $CrLf);
1933
-				fwrite($this->file, '			<NbOfTxs>' . $i . '</NbOfTxs>' . $CrLf);
1934
-				fwrite($this->file, '			<CtrlSum>' . $this->total . '</CtrlSum>' . $CrLf);
1935
-				fwrite($this->file, '			<InitgPty>' . $CrLf);
1936
-				fwrite($this->file, '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf);
1937
-				fwrite($this->file, '				<Id>' . $CrLf);
1938
-				fwrite($this->file, '				    <PrvtId>' . $CrLf);
1939
-				fwrite($this->file, '					<Othr>' . $CrLf);
1940
-				fwrite($this->file, '						<Id>' . $this->emetteur_ics . '</Id>' . $CrLf);
1941
-				fwrite($this->file, '					</Othr>' . $CrLf);
1942
-				fwrite($this->file, '				    </PrvtId>' . $CrLf);
1943
-				fwrite($this->file, '				</Id>' . $CrLf);
1944
-				fwrite($this->file, '			</InitgPty>' . $CrLf);
1945
-				fwrite($this->file, '		</GrpHdr>' . $CrLf);
1930
+				fwrite($this->file, '		<GrpHdr>'.$CrLf);
1931
+				fwrite($this->file, '			<MsgId>'.('DOL/'.$dateTime_YMD.'/DD'.$this->id).'</MsgId>'.$CrLf);
1932
+				fwrite($this->file, '			<CreDtTm>'.$dateTime_ECMA.'</CreDtTm>'.$CrLf);
1933
+				fwrite($this->file, '			<NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
1934
+				fwrite($this->file, '			<CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
1935
+				fwrite($this->file, '			<InitgPty>'.$CrLf);
1936
+				fwrite($this->file, '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf);
1937
+				fwrite($this->file, '				<Id>'.$CrLf);
1938
+				fwrite($this->file, '				    <PrvtId>'.$CrLf);
1939
+				fwrite($this->file, '					<Othr>'.$CrLf);
1940
+				fwrite($this->file, '						<Id>'.$this->emetteur_ics.'</Id>'.$CrLf);
1941
+				fwrite($this->file, '					</Othr>'.$CrLf);
1942
+				fwrite($this->file, '				    </PrvtId>'.$CrLf);
1943
+				fwrite($this->file, '				</Id>'.$CrLf);
1944
+				fwrite($this->file, '			</InitgPty>'.$CrLf);
1945
+				fwrite($this->file, '		</GrpHdr>'.$CrLf);
1946 1946
 				// SEPA File Emetteur
1947 1947
 				if ($result != -2) {
1948 1948
 					fwrite($this->file, $fileEmetteurSection);
@@ -1952,9 +1952,9 @@  discard block
 block discarded – undo
1952 1952
 					fwrite($this->file, $fileDebiteurSection);
1953 1953
 				}
1954 1954
 				// SEPA FILE FOOTER
1955
-				fwrite($this->file, '		</PmtInf>' . $CrLf);
1956
-				fwrite($this->file, '	</CstmrDrctDbtInitn>' . $CrLf);
1957
-				fwrite($this->file, '</Document>' . $CrLf);
1955
+				fwrite($this->file, '		</PmtInf>'.$CrLf);
1956
+				fwrite($this->file, '	</CstmrDrctDbtInitn>'.$CrLf);
1957
+				fwrite($this->file, '</Document>'.$CrLf);
1958 1958
 			} else {
1959 1959
 				/**
1960 1960
 				 * SECTION CREATION FICHIER SEPA - CREDIT TRANSFER
@@ -1986,13 +1986,13 @@  discard block
 block discarded – undo
1986 1986
 					$sql .= " s.ref as reffac, p.fk_salary as idfac,";
1987 1987
 					$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, '' as rum, '' as date_rum";
1988 1988
 					$sql .= " FROM";
1989
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
1990
-					$sql .= " " . MAIN_DB_PREFIX . "salary as s,";
1991
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement as p,";
1992
-					$sql .= " " . MAIN_DB_PREFIX . "user as u";
1993
-					$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON u.fk_country = c.rowid,";
1994
-					$sql .= " " . MAIN_DB_PREFIX . "user_rib as rib";
1995
-					$sql .= " WHERE pl.fk_prelevement_bons=" . ((int) $this->id);
1989
+					$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
1990
+					$sql .= " ".MAIN_DB_PREFIX."salary as s,";
1991
+					$sql .= " ".MAIN_DB_PREFIX."prelevement as p,";
1992
+					$sql .= " ".MAIN_DB_PREFIX."user as u";
1993
+					$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON u.fk_country = c.rowid,";
1994
+					$sql .= " ".MAIN_DB_PREFIX."user_rib as rib";
1995
+					$sql .= " WHERE pl.fk_prelevement_bons=".((int) $this->id);
1996 1996
 					$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
1997 1997
 					$sql .= " AND p.fk_salary = s.rowid";
1998 1998
 					$sql .= " AND s.fk_user = u.rowid";
@@ -2003,19 +2003,19 @@  discard block
 block discarded – undo
2003 2003
 					$sql .= " f.ref as reffac, f.ref_supplier as fac_ref_supplier, p.fk_facture_fourn as idfac,";
2004 2004
 					$sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum";
2005 2005
 					$sql .= " FROM";
2006
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
2007
-					$sql .= " " . MAIN_DB_PREFIX . "facture_fourn as f,";
2008
-					$sql .= " " . MAIN_DB_PREFIX . "prelevement as p,";
2009
-					$sql .= " " . MAIN_DB_PREFIX . "societe as soc";
2010
-					$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON soc.fk_pays = c.rowid,";
2011
-					$sql .= " " . MAIN_DB_PREFIX . "societe_rib as rib";
2012
-					$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
2006
+					$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
2007
+					$sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,";
2008
+					$sql .= " ".MAIN_DB_PREFIX."prelevement as p,";
2009
+					$sql .= " ".MAIN_DB_PREFIX."societe as soc";
2010
+					$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON soc.fk_pays = c.rowid,";
2011
+					$sql .= " ".MAIN_DB_PREFIX."societe_rib as rib";
2012
+					$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
2013 2013
 					$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
2014 2014
 					$sql .= " AND p.fk_facture_fourn = f.rowid";
2015 2015
 					$sql .= " AND f.fk_soc = soc.rowid";
2016 2016
 					$sql .= " AND rib.fk_soc = f.fk_soc";
2017 2017
 					if (!empty($thirdpartyBANId)) {
2018
-						$sql .= " AND rib.rowid = " . ((int) $thirdpartyBANId);
2018
+						$sql .= " AND rib.rowid = ".((int) $thirdpartyBANId);
2019 2019
 					} else {
2020 2020
 						$sql .= " AND rib.default_rib = 1";
2021 2021
 					}
@@ -2043,7 +2043,7 @@  discard block
 block discarded – undo
2043 2043
 						$iban = dolDecrypt($obj->iban);
2044 2044
 						$refobj = $obj->reffac;
2045 2045
 						if (empty($refobj) && !empty($forsalary)) {	// If ref of salary not defined, we force a value
2046
-							$refobj = "SAL" . $obj->idfac;
2046
+							$refobj = "SAL".$obj->idfac;
2047 2047
 						}
2048 2048
 
2049 2049
 						$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $refobj, $obj->idfac, $iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier);
@@ -2054,7 +2054,7 @@  discard block
 block discarded – undo
2054 2054
 					$nbtotalDrctDbtTxInf = $i;
2055 2055
 				} else {
2056 2056
 					$this->error = $this->db->lasterror();
2057
-					fwrite($this->file, 'ERROR CREDITOR ' . $sql . $CrLf); // CREDITORS = Suppliers
2057
+					fwrite($this->file, 'ERROR CREDITOR '.$sql.$CrLf); // CREDITORS = Suppliers
2058 2058
 					$result = -2;
2059 2059
 				}
2060 2060
 				// Define $fileEmetteurSection. Start of block PmtInf. Will contains all $nbtotalDrctDbtTxInf
@@ -2070,26 +2070,26 @@  discard block
 block discarded – undo
2070 2070
 				 * SECTION CREATION SEPA FILE - CREDIT TRANSFER - ISO200022
2071 2071
 				 */
2072 2072
 				// SEPA File Header
2073
-				fwrite($this->file, '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . '>' . $CrLf);
2074
-				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . $CrLf);
2075
-				fwrite($this->file, '	<CstmrCdtTrfInitn>' . $CrLf);
2073
+				fwrite($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf);
2074
+				fwrite($this->file, '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'.$CrLf);
2075
+				fwrite($this->file, '	<CstmrCdtTrfInitn>'.$CrLf);
2076 2076
 				// SEPA Group header
2077
-				fwrite($this->file, '		<GrpHdr>' . $CrLf);
2078
-				fwrite($this->file, '			<MsgId>' . ('DOL/' . $dateTime_YMD . '/CT' . $this->id) . '</MsgId>' . $CrLf);
2079
-				fwrite($this->file, '			<CreDtTm>' . $dateTime_ECMA . '</CreDtTm>' . $CrLf);
2080
-				fwrite($this->file, '			<NbOfTxs>' . $i . '</NbOfTxs>' . $CrLf);
2081
-				fwrite($this->file, '			<CtrlSum>' . $this->total . '</CtrlSum>' . $CrLf);
2082
-				fwrite($this->file, '			<InitgPty>' . $CrLf);
2083
-				fwrite($this->file, '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf);
2084
-				fwrite($this->file, '				<Id>' . $CrLf);
2085
-				fwrite($this->file, '				    <PrvtId>' . $CrLf);
2086
-				fwrite($this->file, '					<Othr>' . $CrLf);
2087
-				fwrite($this->file, '						<Id>' . $this->emetteur_ics . '</Id>' . $CrLf);
2088
-				fwrite($this->file, '					</Othr>' . $CrLf);
2089
-				fwrite($this->file, '				    </PrvtId>' . $CrLf);
2090
-				fwrite($this->file, '				</Id>' . $CrLf);
2091
-				fwrite($this->file, '			</InitgPty>' . $CrLf);
2092
-				fwrite($this->file, '		</GrpHdr>' . $CrLf);
2077
+				fwrite($this->file, '		<GrpHdr>'.$CrLf);
2078
+				fwrite($this->file, '			<MsgId>'.('DOL/'.$dateTime_YMD.'/CT'.$this->id).'</MsgId>'.$CrLf);
2079
+				fwrite($this->file, '			<CreDtTm>'.$dateTime_ECMA.'</CreDtTm>'.$CrLf);
2080
+				fwrite($this->file, '			<NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
2081
+				fwrite($this->file, '			<CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
2082
+				fwrite($this->file, '			<InitgPty>'.$CrLf);
2083
+				fwrite($this->file, '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf);
2084
+				fwrite($this->file, '				<Id>'.$CrLf);
2085
+				fwrite($this->file, '				    <PrvtId>'.$CrLf);
2086
+				fwrite($this->file, '					<Othr>'.$CrLf);
2087
+				fwrite($this->file, '						<Id>'.$this->emetteur_ics.'</Id>'.$CrLf);
2088
+				fwrite($this->file, '					</Othr>'.$CrLf);
2089
+				fwrite($this->file, '				    </PrvtId>'.$CrLf);
2090
+				fwrite($this->file, '				</Id>'.$CrLf);
2091
+				fwrite($this->file, '			</InitgPty>'.$CrLf);
2092
+				fwrite($this->file, '		</GrpHdr>'.$CrLf);
2093 2093
 				// SEPA File Emetteur (mycompany)
2094 2094
 				if ($result != -2) {
2095 2095
 					fwrite($this->file, $fileEmetteurSection);
@@ -2099,9 +2099,9 @@  discard block
 block discarded – undo
2099 2099
 					fwrite($this->file, $fileCrediteurSection);
2100 2100
 				}
2101 2101
 				// SEPA FILE FOOTER
2102
-				fwrite($this->file, '		</PmtInf>' . $CrLf);
2103
-				fwrite($this->file, '	</CstmrCdtTrfInitn>' . $CrLf);
2104
-				fwrite($this->file, '</Document>' . $CrLf);
2102
+				fwrite($this->file, '		</PmtInf>'.$CrLf);
2103
+				fwrite($this->file, '	</CstmrCdtTrfInitn>'.$CrLf);
2104
+				fwrite($this->file, '</Document>'.$CrLf);
2105 2105
 			}
2106 2106
 		}
2107 2107
 
@@ -2110,10 +2110,10 @@  discard block
 block discarded – undo
2110 2110
 			if ($type != 'bank-transfer') {
2111 2111
 				$sql = "SELECT pl.amount";
2112 2112
 				$sql .= " FROM";
2113
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
2114
-				$sql .= " " . MAIN_DB_PREFIX . "facture as f,";
2115
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement as p";
2116
-				$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
2113
+				$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
2114
+				$sql .= " ".MAIN_DB_PREFIX."facture as f,";
2115
+				$sql .= " ".MAIN_DB_PREFIX."prelevement as p";
2116
+				$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
2117 2117
 				$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
2118 2118
 				$sql .= " AND p.fk_facture = f.rowid";
2119 2119
 
@@ -2136,10 +2136,10 @@  discard block
 block discarded – undo
2136 2136
 			} else {
2137 2137
 				$sql = "SELECT pl.amount";
2138 2138
 				$sql .= " FROM";
2139
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement_lignes as pl,";
2140
-				$sql .= " " . MAIN_DB_PREFIX . "facture_fourn as f,";
2141
-				$sql .= " " . MAIN_DB_PREFIX . "prelevement as p";
2142
-				$sql .= " WHERE pl.fk_prelevement_bons = " . ((int) $this->id);
2139
+				$sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
2140
+				$sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,";
2141
+				$sql .= " ".MAIN_DB_PREFIX."prelevement as p";
2142
+				$sql .= " WHERE pl.fk_prelevement_bons = ".((int) $this->id);
2143 2143
 				$sql .= " AND pl.rowid = p.fk_prelevement_lignes";
2144 2144
 				$sql .= " AND p.fk_facture_fourn = f.rowid";
2145 2145
 				// Lines
@@ -2188,7 +2188,7 @@  discard block
 block discarded – undo
2188 2188
 		$pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation)
2189 2189
 
2190 2190
 		// 3 char + '-' + 12 + '-' + id + '-' + code 		Must be lower than 32.
2191
-		return $pre . '-' . dol_print_date($row_datec, 'dayhourlogsmall') . '-' . dol_trunc($row_drum . ($row_code_client ? '-' . $row_code_client : ''), 13, 'right', 'UTF-8', 1);
2191
+		return $pre.'-'.dol_print_date($row_datec, 'dayhourlogsmall').'-'.dol_trunc($row_drum.($row_code_client ? '-'.$row_code_client : ''), 13, 'right', 'UTF-8', 1);
2192 2192
 	}
2193 2193
 
2194 2194
 
@@ -2227,11 +2227,11 @@  discard block
 block discarded – undo
2227 2227
 
2228 2228
 		// Raison Sociale Destinataire C2
2229 2229
 
2230
-		fwrite($this->file, substr(strtoupper($client_nom) . "                         ", 0, 24));
2230
+		fwrite($this->file, substr(strtoupper($client_nom)."                         ", 0, 24));
2231 2231
 
2232 2232
 		// Address optional D1
2233 2233
 		$address = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => ""));
2234
-		fwrite($this->file, substr($address . "                         ", 0, 24));
2234
+		fwrite($this->file, substr($address."                         ", 0, 24));
2235 2235
 
2236 2236
 		// Zone Reservee D2
2237 2237
 
@@ -2243,17 +2243,17 @@  discard block
 block discarded – undo
2243 2243
 
2244 2244
 		// Numero de compte D4
2245 2245
 
2246
-		fwrite($this->file, substr("000000000000000" . $rib_number, -11));
2246
+		fwrite($this->file, substr("000000000000000".$rib_number, -11));
2247 2247
 
2248 2248
 		// Zone E Montant
2249 2249
 
2250 2250
 		$montant = (round($amount, 2) * 100);
2251 2251
 
2252
-		fwrite($this->file, substr("000000000000000" . $montant, -16));
2252
+		fwrite($this->file, substr("000000000000000".$montant, -16));
2253 2253
 
2254 2254
 		// Label F
2255 2255
 
2256
-		fwrite($this->file, substr("*_" . $ref . "_RDVnet" . $rowid . "                               ", 0, 31));
2256
+		fwrite($this->file, substr("*_".$ref."_RDVnet".$rowid."                               ", 0, 31));
2257 2257
 
2258 2258
 		// Code etablissement G1
2259 2259
 
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
 			$row_somme = round((float) $row_somme, 2);
2305 2305
 		}
2306 2306
 
2307
-		include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
2307
+		include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
2308 2308
 
2309 2309
 		$CrLf = "\n";
2310 2310
 		$Rowing = sprintf("%010d", $row_idfac);
@@ -2319,46 +2319,46 @@  discard block
 block discarded – undo
2319 2319
 		if ($type != 'bank-transfer') {
2320 2320
 			// SEPA Paiement Information of buyer for Direct Debit
2321 2321
 			$XML_DEBITOR = '';
2322
-			$XML_DEBITOR .= '			<DrctDbtTxInf>' . $CrLf;
2323
-			$XML_DEBITOR .= '				<PmtId>' . $CrLf;
2322
+			$XML_DEBITOR .= '			<DrctDbtTxInf>'.$CrLf;
2323
+			$XML_DEBITOR .= '				<PmtId>'.$CrLf;
2324 2324
 			// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
2325
-			$XML_DEBITOR .= '					<EndToEndId>' . ((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-' . dol_trunc($row_idfac . '-' . $row_ref, 20, 'right', 'UTF-8', 1)) . '-' . $Rowing) . '</EndToEndId>' . $CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2326
-			$XML_DEBITOR .= '				</PmtId>' . $CrLf;
2327
-			$XML_DEBITOR .= '				<InstdAmt Ccy="EUR">' . $row_somme . '</InstdAmt>' . $CrLf;
2328
-			$XML_DEBITOR .= '				<DrctDbtTx>' . $CrLf;
2329
-			$XML_DEBITOR .= '					<MndtRltdInf>' . $CrLf;
2330
-			$XML_DEBITOR .= '						<MndtId>' . $Rum . '</MndtId>' . $CrLf;
2331
-			$XML_DEBITOR .= '						<DtOfSgntr>' . $DtOfSgntr . '</DtOfSgntr>' . $CrLf;
2332
-			$XML_DEBITOR .= '						<AmdmntInd>false</AmdmntInd>' . $CrLf;
2333
-			$XML_DEBITOR .= '					</MndtRltdInf>' . $CrLf;
2334
-			$XML_DEBITOR .= '				</DrctDbtTx>' . $CrLf;
2335
-			$XML_DEBITOR .= '				<DbtrAgt>' . $CrLf;
2336
-			$XML_DEBITOR .= '					<FinInstnId>' . $CrLf;
2325
+			$XML_DEBITOR .= '					<EndToEndId>'.((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2326
+			$XML_DEBITOR .= '				</PmtId>'.$CrLf;
2327
+			$XML_DEBITOR .= '				<InstdAmt Ccy="EUR">'.$row_somme.'</InstdAmt>'.$CrLf;
2328
+			$XML_DEBITOR .= '				<DrctDbtTx>'.$CrLf;
2329
+			$XML_DEBITOR .= '					<MndtRltdInf>'.$CrLf;
2330
+			$XML_DEBITOR .= '						<MndtId>'.$Rum.'</MndtId>'.$CrLf;
2331
+			$XML_DEBITOR .= '						<DtOfSgntr>'.$DtOfSgntr.'</DtOfSgntr>'.$CrLf;
2332
+			$XML_DEBITOR .= '						<AmdmntInd>false</AmdmntInd>'.$CrLf;
2333
+			$XML_DEBITOR .= '					</MndtRltdInf>'.$CrLf;
2334
+			$XML_DEBITOR .= '				</DrctDbtTx>'.$CrLf;
2335
+			$XML_DEBITOR .= '				<DbtrAgt>'.$CrLf;
2336
+			$XML_DEBITOR .= '					<FinInstnId>'.$CrLf;
2337 2337
 			if (getDolGlobalInt('WITHDRAWAL_WITHOUT_BIC') == 0) {
2338
-				$XML_DEBITOR .= '						<BIC>' . $row_bic . '</BIC>' . $CrLf;
2338
+				$XML_DEBITOR .= '						<BIC>'.$row_bic.'</BIC>'.$CrLf;
2339 2339
 			}
2340
-			$XML_DEBITOR .= '					</FinInstnId>' . $CrLf;
2341
-			$XML_DEBITOR .= '				</DbtrAgt>' . $CrLf;
2342
-			$XML_DEBITOR .= '				<Dbtr>' . $CrLf;
2343
-			$XML_DEBITOR .= '					<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))) . '</Nm>' . $CrLf;
2344
-			$XML_DEBITOR .= '					<PstlAdr>' . $CrLf;
2345
-			$XML_DEBITOR .= '						<Ctry>' . $row_country_code . '</Ctry>' . $CrLf;
2340
+			$XML_DEBITOR .= '					</FinInstnId>'.$CrLf;
2341
+			$XML_DEBITOR .= '				</DbtrAgt>'.$CrLf;
2342
+			$XML_DEBITOR .= '				<Dbtr>'.$CrLf;
2343
+			$XML_DEBITOR .= '					<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf;
2344
+			$XML_DEBITOR .= '					<PstlAdr>'.$CrLf;
2345
+			$XML_DEBITOR .= '						<Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
2346 2346
 			$addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => ""));
2347
-			$addressline2 = strtr($row_zip . (($row_zip && $row_town) ? ' ' : '') . (string) $row_town, array(chr(13) => ", ", chr(10) => ""));
2347
+			$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : '').(string) $row_town, array(chr(13) => ", ", chr(10) => ""));
2348 2348
 			if (trim($addressline1)) {
2349
-				$XML_DEBITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2349
+				$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2350 2350
 			}
2351 2351
 			if (trim($addressline2)) {
2352
-				$XML_DEBITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2352
+				$XML_DEBITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2353 2353
 			}
2354
-			$XML_DEBITOR .= '					</PstlAdr>' . $CrLf;
2355
-			$XML_DEBITOR .= '				</Dbtr>' . $CrLf;
2356
-			$XML_DEBITOR .= '				<DbtrAcct>' . $CrLf;
2357
-			$XML_DEBITOR .= '					<Id>' . $CrLf;
2358
-			$XML_DEBITOR .= '						<IBAN>' . preg_replace('/\s/', '', $row_iban) . '</IBAN>' . $CrLf;
2359
-			$XML_DEBITOR .= '					</Id>' . $CrLf;
2360
-			$XML_DEBITOR .= '				</DbtrAcct>' . $CrLf;
2361
-			$XML_DEBITOR .= '				<RmtInf>' . $CrLf;
2354
+			$XML_DEBITOR .= '					</PstlAdr>'.$CrLf;
2355
+			$XML_DEBITOR .= '				</Dbtr>'.$CrLf;
2356
+			$XML_DEBITOR .= '				<DbtrAcct>'.$CrLf;
2357
+			$XML_DEBITOR .= '					<Id>'.$CrLf;
2358
+			$XML_DEBITOR .= '						<IBAN>'.preg_replace('/\s/', '', $row_iban).'</IBAN>'.$CrLf;
2359
+			$XML_DEBITOR .= '					</Id>'.$CrLf;
2360
+			$XML_DEBITOR .= '				</DbtrAcct>'.$CrLf;
2361
+			$XML_DEBITOR .= '				<RmtInf>'.$CrLf;
2362 2362
 
2363 2363
 			// Structured data for Belgium
2364 2364
 			if (getDolGlobalString('INVOICE_PAYMENT_ENABLE_STRUCTURED_COMMUNICATION') && $mysoc->country_code == 'BE') {
@@ -2368,24 +2368,24 @@  discard block
 block discarded – undo
2368 2368
 				$invoicestatic->fetch($row_idfac);
2369 2369
 
2370 2370
 				$invoicePaymentKey = dolBECalculateStructuredCommunication($invoicestatic->ref, $invoicestatic->type);
2371
-				$XML_DEBITOR .= '					<strd>' . $invoicePaymentKey . '</strd>' . $CrLf;
2371
+				$XML_DEBITOR .= '					<strd>'.$invoicePaymentKey.'</strd>'.$CrLf;
2372 2372
 			} else {
2373 2373
 				// A string with some information on payment - 140 max
2374
-				$XML_DEBITOR .= '					<Ustrd>' . getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstuctured data - 140 max
2374
+				$XML_DEBITOR .= '					<Ustrd>'.getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))).'</Ustrd>'.$CrLf; // Free unstuctured data - 140 max
2375 2375
 			}
2376
-			$XML_DEBITOR .= '				</RmtInf>' . $CrLf;
2377
-			$XML_DEBITOR .= '			</DrctDbtTxInf>' . $CrLf;
2376
+			$XML_DEBITOR .= '				</RmtInf>'.$CrLf;
2377
+			$XML_DEBITOR .= '			</DrctDbtTxInf>'.$CrLf;
2378 2378
 			return $XML_DEBITOR;
2379 2379
 		} else {
2380 2380
 			// SEPA Payment Information of seller for Credit Transfer
2381 2381
 			$XML_CREDITOR = '';
2382
-			$XML_CREDITOR .= '			<CdtTrfTxInf>' . $CrLf;
2383
-			$XML_CREDITOR .= '				<PmtId>' . $CrLf;
2382
+			$XML_CREDITOR .= '			<CdtTrfTxInf>'.$CrLf;
2383
+			$XML_CREDITOR .= '				<PmtId>'.$CrLf;
2384 2384
 			// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
2385
-			$XML_CREDITOR .= '					<EndToEndId>' . ((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? getDolGlobalString("PRELEVEMENT_END_TO_END") : ('CT-' . dol_trunc($row_idfac . '-' . $row_ref, 20, 'right', 'UTF-8', 1)) . '-' . $Rowing) . '</EndToEndId>' . $CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2386
-			$XML_CREDITOR .= '				</PmtId>' . $CrLf;
2385
+			$XML_CREDITOR .= '					<EndToEndId>'.((getDolGlobalString('PRELEVEMENT_END_TO_END') != "") ? getDolGlobalString("PRELEVEMENT_END_TO_END") : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20, 'right', 'UTF-8', 1)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
2386
+			$XML_CREDITOR .= '				</PmtId>'.$CrLf;
2387 2387
 			if (!empty($this->sepa_xml_pti_in_ctti)) {
2388
-				$XML_CREDITOR .= '				<PmtTpInf>' . $CrLf;
2388
+				$XML_CREDITOR .= '				<PmtTpInf>'.$CrLf;
2389 2389
 
2390 2390
 				// Can be 'NORM' for normal or 'HIGH' for high priority level
2391 2391
 				if (getDolGlobalString('PAYMENTBYBANKTRANSFER_FORCE_HIGH_PRIORITY')) {
@@ -2397,18 +2397,18 @@  discard block
 block discarded – undo
2397 2397
 				// Set $categoryPurpose: CORE, TREA, SUPP, ...
2398 2398
 				$categoryPurpose = getDolGlobalString('PAYMENTBYBANKTRANSFER_CUSTOM_CATEGORY_PURPOSE', 'CORE');
2399 2399
 
2400
-				$XML_CREDITOR .= '					<InstrPrty>' . $instrprty . '</InstrPrty>' . $CrLf;
2401
-				$XML_CREDITOR .= '					<SvcLvl>' . $CrLf;
2402
-				$XML_CREDITOR .= '						<Cd>SEPA</Cd>' . $CrLf;
2403
-				$XML_CREDITOR .= '					</SvcLvl>' . $CrLf;
2404
-				$XML_CREDITOR .= '					<CtgyPurp>' . $CrLf;
2405
-				$XML_CREDITOR .= '						<Cd>' . $categoryPurpose . '</Cd>' . $CrLf;
2406
-				$XML_CREDITOR .= '					</CtgyPurp>' . $CrLf;
2407
-				$XML_CREDITOR .= '				</PmtTpInf>' . $CrLf;
2400
+				$XML_CREDITOR .= '					<InstrPrty>'.$instrprty.'</InstrPrty>'.$CrLf;
2401
+				$XML_CREDITOR .= '					<SvcLvl>'.$CrLf;
2402
+				$XML_CREDITOR .= '						<Cd>SEPA</Cd>'.$CrLf;
2403
+				$XML_CREDITOR .= '					</SvcLvl>'.$CrLf;
2404
+				$XML_CREDITOR .= '					<CtgyPurp>'.$CrLf;
2405
+				$XML_CREDITOR .= '						<Cd>'.$categoryPurpose.'</Cd>'.$CrLf;
2406
+				$XML_CREDITOR .= '					</CtgyPurp>'.$CrLf;
2407
+				$XML_CREDITOR .= '				</PmtTpInf>'.$CrLf;
2408 2408
 			}
2409
-			$XML_CREDITOR .= '				<Amt>' . $CrLf;
2409
+			$XML_CREDITOR .= '				<Amt>'.$CrLf;
2410 2410
 			$XML_CREDITOR .= '				<InstdAmt Ccy="EUR">'.round((float) $row_somme, 2).'</InstdAmt>'.$CrLf;
2411
-			$XML_CREDITOR .= '				</Amt>' . $CrLf;
2411
+			$XML_CREDITOR .= '				</Amt>'.$CrLf;
2412 2412
 			/*
2413 2413
 			 $XML_CREDITOR .= '				<DrctDbtTx>'.$CrLf;
2414 2414
 			 $XML_CREDITOR .= '					<MndtRltdInf>'.$CrLf;
@@ -2419,35 +2419,35 @@  discard block
 block discarded – undo
2419 2419
 			 $XML_CREDITOR .= '				</DrctDbtTx>'.$CrLf;
2420 2420
 			 */
2421 2421
 			//$XML_CREDITOR .= '				<ChrgBr>SLEV</ChrgBr>'.$CrLf;
2422
-			$XML_CREDITOR .= '				<CdtrAgt>' . $CrLf;
2423
-			$XML_CREDITOR .= '					<FinInstnId>' . $CrLf;
2424
-			$XML_CREDITOR .= '						<BIC>' . $row_bic . '</BIC>' . $CrLf;
2425
-			$XML_CREDITOR .= '					</FinInstnId>' . $CrLf;
2426
-			$XML_CREDITOR .= '				</CdtrAgt>' . $CrLf;
2427
-			$XML_CREDITOR .= '				<Cdtr>' . $CrLf;
2428
-			$XML_CREDITOR .= '					<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))) . '</Nm>' . $CrLf;
2429
-			$XML_CREDITOR .= '					<PstlAdr>' . $CrLf;
2430
-			$XML_CREDITOR .= '						<Ctry>' . $row_country_code . '</Ctry>' . $CrLf;
2422
+			$XML_CREDITOR .= '				<CdtrAgt>'.$CrLf;
2423
+			$XML_CREDITOR .= '					<FinInstnId>'.$CrLf;
2424
+			$XML_CREDITOR .= '						<BIC>'.$row_bic.'</BIC>'.$CrLf;
2425
+			$XML_CREDITOR .= '					</FinInstnId>'.$CrLf;
2426
+			$XML_CREDITOR .= '				</CdtrAgt>'.$CrLf;
2427
+			$XML_CREDITOR .= '				<Cdtr>'.$CrLf;
2428
+			$XML_CREDITOR .= '					<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf;
2429
+			$XML_CREDITOR .= '					<PstlAdr>'.$CrLf;
2430
+			$XML_CREDITOR .= '						<Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
2431 2431
 			$addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => ""));
2432
-			$addressline2 = strtr($row_zip . (($row_zip && $row_town) ? ' ' : '') . (string) $row_town, array(chr(13) => ", ", chr(10) => ""));
2432
+			$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : '').(string) $row_town, array(chr(13) => ", ", chr(10) => ""));
2433 2433
 			if (trim($addressline1)) {
2434
-				$XML_CREDITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2434
+				$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2435 2435
 			}
2436 2436
 			if (trim($addressline2)) {
2437
-				$XML_CREDITOR .= '						<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2437
+				$XML_CREDITOR .= '						<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2438 2438
 			}
2439
-			$XML_CREDITOR .= '					</PstlAdr>' . $CrLf;
2440
-			$XML_CREDITOR .= '				</Cdtr>' . $CrLf;
2441
-			$XML_CREDITOR .= '				<CdtrAcct>' . $CrLf;
2442
-			$XML_CREDITOR .= '					<Id>' . $CrLf;
2443
-			$XML_CREDITOR .= '						<IBAN>' . preg_replace('/\s/', '', $row_iban) . '</IBAN>' . $CrLf;
2444
-			$XML_CREDITOR .= '					</Id>' . $CrLf;
2445
-			$XML_CREDITOR .= '				</CdtrAcct>' . $CrLf;
2446
-			$XML_CREDITOR .= '				<RmtInf>' . $CrLf;
2439
+			$XML_CREDITOR .= '					</PstlAdr>'.$CrLf;
2440
+			$XML_CREDITOR .= '				</Cdtr>'.$CrLf;
2441
+			$XML_CREDITOR .= '				<CdtrAcct>'.$CrLf;
2442
+			$XML_CREDITOR .= '					<Id>'.$CrLf;
2443
+			$XML_CREDITOR .= '						<IBAN>'.preg_replace('/\s/', '', $row_iban).'</IBAN>'.$CrLf;
2444
+			$XML_CREDITOR .= '					</Id>'.$CrLf;
2445
+			$XML_CREDITOR .= '				</CdtrAcct>'.$CrLf;
2446
+			$XML_CREDITOR .= '				<RmtInf>'.$CrLf;
2447 2447
 			// A string with some information on payment - 140 max
2448
-			$XML_CREDITOR .= '					<Ustrd>' . getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref . ($row_comment ? ' - ' . $row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))) . '</Ustrd>' . $CrLf; // Free unstructured data - 140 max
2449
-			$XML_CREDITOR .= '				</RmtInf>' . $CrLf;
2450
-			$XML_CREDITOR .= '			</CdtTrfTxInf>' . $CrLf;
2448
+			$XML_CREDITOR .= '					<Ustrd>'.getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))).'</Ustrd>'.$CrLf; // Free unstructured data - 140 max
2449
+			$XML_CREDITOR .= '				</RmtInf>'.$CrLf;
2450
+			$XML_CREDITOR .= '			</CdtTrfTxInf>'.$CrLf;
2451 2451
 			return $XML_CREDITOR;
2452 2452
 		}
2453 2453
 	}
@@ -2480,11 +2480,11 @@  discard block
 block discarded – undo
2480 2480
 
2481 2481
 		// Raison Sociale C2
2482 2482
 
2483
-		fwrite($this->file, substr($this->raison_sociale . "                           ", 0, 24));
2483
+		fwrite($this->file, substr($this->raison_sociale."                           ", 0, 24));
2484 2484
 
2485 2485
 		// Ref of thirdparty on 7 characters
2486 2486
 
2487
-		fwrite($this->file, substr($this->reference_remise . "                           ", 0, 7));
2487
+		fwrite($this->file, substr($this->reference_remise."                           ", 0, 7));
2488 2488
 
2489 2489
 		// Zone Reservee D1-2
2490 2490
 
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
 
2503 2503
 		// Numero de compte D4
2504 2504
 
2505
-		fwrite($this->file, substr("000000000000000" . $this->emetteur_numero_compte, -11));
2505
+		fwrite($this->file, substr("000000000000000".$this->emetteur_numero_compte, -11));
2506 2506
 
2507 2507
 		// Zone Reservee E
2508 2508
 
@@ -2564,15 +2564,15 @@  discard block
 block discarded – undo
2564 2564
 			$this->emetteur_iban = $account->iban;
2565 2565
 			$this->emetteur_bic = $account->bic;
2566 2566
 
2567
-			$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics);  // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
2567
+			$this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456";
2568 2568
 
2569 2569
 			$this->raison_sociale = $account->owner_name;
2570 2570
 		}
2571 2571
 
2572 2572
 		// Get pending payments
2573 2573
 		$sql = "SELECT rowid, ref";
2574
-		$sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_bons as pb";
2575
-		$sql .= " WHERE pb.rowid = " . ((int) $this->id);
2574
+		$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as pb";
2575
+		$sql .= " WHERE pb.rowid = ".((int) $this->id);
2576 2576
 
2577 2577
 		$resql = $this->db->query($sql);
2578 2578
 		if ($resql) {
@@ -2590,45 +2590,45 @@  discard block
 block discarded – undo
2590 2590
 			if ($type != 'bank-transfer') {
2591 2591
 				// SEPA Paiement Information of my company for Direct Debit
2592 2592
 				$XML_SEPA_INFO = '';
2593
-				$XML_SEPA_INFO .= '		<PmtInf>' . $CrLf;
2594
-				$XML_SEPA_INFO .= '			<PmtInfId>' . ('DOL/' . $dateTime_YMD . '/DD' . $IdBon . '-' . $RefBon) . '</PmtInfId>' . $CrLf;
2595
-				$XML_SEPA_INFO .= '			<PmtMtd>DD</PmtMtd>' . $CrLf;
2596
-				$XML_SEPA_INFO .= '			<NbOfTxs>' . $nombre . '</NbOfTxs>' . $CrLf;
2597
-				$XML_SEPA_INFO .= '			<CtrlSum>' . $total . '</CtrlSum>' . $CrLf;
2598
-				$XML_SEPA_INFO .= '			<PmtTpInf>' . $CrLf;
2599
-				$XML_SEPA_INFO .= '				<SvcLvl>' . $CrLf;
2600
-				$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>' . $CrLf;
2601
-				$XML_SEPA_INFO .= '				</SvcLvl>' . $CrLf;
2602
-				$XML_SEPA_INFO .= '				<LclInstrm>' . $CrLf;
2603
-				$XML_SEPA_INFO .= '					<Cd>' . $localInstrument . '</Cd>' . $CrLf;
2604
-				$XML_SEPA_INFO .= '				</LclInstrm>' . $CrLf;
2605
-				$XML_SEPA_INFO .= '				<SeqTp>' . $format . '</SeqTp>' . $CrLf;
2606
-				$XML_SEPA_INFO .= '			</PmtTpInf>' . $CrLf;
2607
-				$XML_SEPA_INFO .= '			<ReqdColltnDt>' . $dateTime_ETAD . '</ReqdColltnDt>' . $CrLf;
2608
-				$XML_SEPA_INFO .= '			<Cdtr>' . $CrLf;
2609
-				$XML_SEPA_INFO .= '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf;
2610
-				$XML_SEPA_INFO .= '				<PstlAdr>' . $CrLf;
2611
-				$XML_SEPA_INFO .= '					<Ctry>' . $country[1] . '</Ctry>' . $CrLf;
2593
+				$XML_SEPA_INFO .= '		<PmtInf>'.$CrLf;
2594
+				$XML_SEPA_INFO .= '			<PmtInfId>'.('DOL/'.$dateTime_YMD.'/DD'.$IdBon.'-'.$RefBon).'</PmtInfId>'.$CrLf;
2595
+				$XML_SEPA_INFO .= '			<PmtMtd>DD</PmtMtd>'.$CrLf;
2596
+				$XML_SEPA_INFO .= '			<NbOfTxs>'.$nombre.'</NbOfTxs>'.$CrLf;
2597
+				$XML_SEPA_INFO .= '			<CtrlSum>'.$total.'</CtrlSum>'.$CrLf;
2598
+				$XML_SEPA_INFO .= '			<PmtTpInf>'.$CrLf;
2599
+				$XML_SEPA_INFO .= '				<SvcLvl>'.$CrLf;
2600
+				$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>'.$CrLf;
2601
+				$XML_SEPA_INFO .= '				</SvcLvl>'.$CrLf;
2602
+				$XML_SEPA_INFO .= '				<LclInstrm>'.$CrLf;
2603
+				$XML_SEPA_INFO .= '					<Cd>'.$localInstrument.'</Cd>'.$CrLf;
2604
+				$XML_SEPA_INFO .= '				</LclInstrm>'.$CrLf;
2605
+				$XML_SEPA_INFO .= '				<SeqTp>'.$format.'</SeqTp>'.$CrLf;
2606
+				$XML_SEPA_INFO .= '			</PmtTpInf>'.$CrLf;
2607
+				$XML_SEPA_INFO .= '			<ReqdColltnDt>'.$dateTime_ETAD.'</ReqdColltnDt>'.$CrLf;
2608
+				$XML_SEPA_INFO .= '			<Cdtr>'.$CrLf;
2609
+				$XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2610
+				$XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
2611
+				$XML_SEPA_INFO .= '					<Ctry>'.$country[1].'</Ctry>'.$CrLf;
2612 2612
 				$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => ""));
2613
-				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP . (($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' ' . $configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '') . $configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2613
+				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2614 2614
 				if ($addressline1) {
2615
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2615
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2616 2616
 				}
2617 2617
 				if ($addressline2) {
2618
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2618
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2619 2619
 				}
2620
-				$XML_SEPA_INFO .= '				</PstlAdr>' . $CrLf;
2621
-				$XML_SEPA_INFO .= '			</Cdtr>' . $CrLf;
2622
-				$XML_SEPA_INFO .= '			<CdtrAcct>' . $CrLf;
2623
-				$XML_SEPA_INFO .= '				<Id>' . $CrLf;
2624
-				$XML_SEPA_INFO .= '					<IBAN>' . preg_replace('/\s/', '', $this->emetteur_iban) . '</IBAN>' . $CrLf;
2625
-				$XML_SEPA_INFO .= '				</Id>' . $CrLf;
2626
-				$XML_SEPA_INFO .= '			</CdtrAcct>' . $CrLf;
2627
-				$XML_SEPA_INFO .= '			<CdtrAgt>' . $CrLf;
2628
-				$XML_SEPA_INFO .= '				<FinInstnId>' . $CrLf;
2629
-				$XML_SEPA_INFO .= '					<BIC>' . $this->emetteur_bic . '</BIC>' . $CrLf;
2630
-				$XML_SEPA_INFO .= '				</FinInstnId>' . $CrLf;
2631
-				$XML_SEPA_INFO .= '			</CdtrAgt>' . $CrLf;
2620
+				$XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2621
+				$XML_SEPA_INFO .= '			</Cdtr>'.$CrLf;
2622
+				$XML_SEPA_INFO .= '			<CdtrAcct>'.$CrLf;
2623
+				$XML_SEPA_INFO .= '				<Id>'.$CrLf;
2624
+				$XML_SEPA_INFO .= '					<IBAN>'.preg_replace('/\s/', '', $this->emetteur_iban).'</IBAN>'.$CrLf;
2625
+				$XML_SEPA_INFO .= '				</Id>'.$CrLf;
2626
+				$XML_SEPA_INFO .= '			</CdtrAcct>'.$CrLf;
2627
+				$XML_SEPA_INFO .= '			<CdtrAgt>'.$CrLf;
2628
+				$XML_SEPA_INFO .= '				<FinInstnId>'.$CrLf;
2629
+				$XML_SEPA_INFO .= '					<BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf;
2630
+				$XML_SEPA_INFO .= '				</FinInstnId>'.$CrLf;
2631
+				$XML_SEPA_INFO .= '			</CdtrAgt>'.$CrLf;
2632 2632
 				/* $XML_SEPA_INFO .= '			<UltmtCdtr>'.$CrLf;
2633 2633
 				 $XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2634 2634
 				 $XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
@@ -2637,64 +2637,64 @@  discard block
 block discarded – undo
2637 2637
 				 $XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2638 2638
 				 $XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2639 2639
 				 $XML_SEPA_INFO .= '			</UltmtCdtr>'.$CrLf;*/
2640
-				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>' . $CrLf; // Field "Responsible of fees". Must be SLEV
2641
-				$XML_SEPA_INFO .= '			<CdtrSchmeId>' . $CrLf;
2642
-				$XML_SEPA_INFO .= '				<Id>' . $CrLf;
2643
-				$XML_SEPA_INFO .= '					<PrvtId>' . $CrLf;
2644
-				$XML_SEPA_INFO .= '						<Othr>' . $CrLf;
2645
-				$XML_SEPA_INFO .= '							<Id>' . $this->emetteur_ics . '</Id>' . $CrLf;
2646
-				$XML_SEPA_INFO .= '							<SchmeNm>' . $CrLf;
2647
-				$XML_SEPA_INFO .= '								<Prtry>SEPA</Prtry>' . $CrLf;
2648
-				$XML_SEPA_INFO .= '							</SchmeNm>' . $CrLf;
2649
-				$XML_SEPA_INFO .= '						</Othr>' . $CrLf;
2650
-				$XML_SEPA_INFO .= '					</PrvtId>' . $CrLf;
2651
-				$XML_SEPA_INFO .= '				</Id>' . $CrLf;
2652
-				$XML_SEPA_INFO .= '			</CdtrSchmeId>' . $CrLf;
2640
+				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV
2641
+				$XML_SEPA_INFO .= '			<CdtrSchmeId>'.$CrLf;
2642
+				$XML_SEPA_INFO .= '				<Id>'.$CrLf;
2643
+				$XML_SEPA_INFO .= '					<PrvtId>'.$CrLf;
2644
+				$XML_SEPA_INFO .= '						<Othr>'.$CrLf;
2645
+				$XML_SEPA_INFO .= '							<Id>'.$this->emetteur_ics.'</Id>'.$CrLf;
2646
+				$XML_SEPA_INFO .= '							<SchmeNm>'.$CrLf;
2647
+				$XML_SEPA_INFO .= '								<Prtry>SEPA</Prtry>'.$CrLf;
2648
+				$XML_SEPA_INFO .= '							</SchmeNm>'.$CrLf;
2649
+				$XML_SEPA_INFO .= '						</Othr>'.$CrLf;
2650
+				$XML_SEPA_INFO .= '					</PrvtId>'.$CrLf;
2651
+				$XML_SEPA_INFO .= '				</Id>'.$CrLf;
2652
+				$XML_SEPA_INFO .= '			</CdtrSchmeId>'.$CrLf;
2653 2653
 			} else {
2654 2654
 				// SEPA Paiement Information of my company for Credit Transfer
2655 2655
 				$XML_SEPA_INFO = '';
2656
-				$XML_SEPA_INFO .= '		<PmtInf>' . $CrLf;
2657
-				$XML_SEPA_INFO .= '			<PmtInfId>' . ('DOL/' . $dateTime_YMD . '/CT' . $IdBon . '-' . $RefBon) . '</PmtInfId>' . $CrLf;
2658
-				$XML_SEPA_INFO .= '			<PmtMtd>TRF</PmtMtd>' . $CrLf;
2656
+				$XML_SEPA_INFO .= '		<PmtInf>'.$CrLf;
2657
+				$XML_SEPA_INFO .= '			<PmtInfId>'.('DOL/'.$dateTime_YMD.'/CT'.$IdBon.'-'.$RefBon).'</PmtInfId>'.$CrLf;
2658
+				$XML_SEPA_INFO .= '			<PmtMtd>TRF</PmtMtd>'.$CrLf;
2659 2659
 				//$XML_SEPA_INFO .= '			<BtchBookg>False</BtchBookg>'.$CrLf;
2660
-				$XML_SEPA_INFO .= '			<NbOfTxs>' . $nombre . '</NbOfTxs>' . $CrLf;
2661
-				$XML_SEPA_INFO .= '			<CtrlSum>' . $total . '</CtrlSum>' . $CrLf;
2660
+				$XML_SEPA_INFO .= '			<NbOfTxs>'.$nombre.'</NbOfTxs>'.$CrLf;
2661
+				$XML_SEPA_INFO .= '			<CtrlSum>'.$total.'</CtrlSum>'.$CrLf;
2662 2662
 				if (!empty($this->sepa_xml_pti_in_ctti) && !empty($format)) {	// @TODO Using $format (FRST ou RCUR) in a section for a Credit Transfer looks strange.
2663
-					$XML_SEPA_INFO .= '			<PmtTpInf>' . $CrLf;
2664
-					$XML_SEPA_INFO .= '				<SvcLvl>' . $CrLf;
2665
-					$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>' . $CrLf;
2666
-					$XML_SEPA_INFO .= '				</SvcLvl>' . $CrLf;
2667
-					$XML_SEPA_INFO .= '				<LclInstrm>' . $CrLf;
2668
-					$XML_SEPA_INFO .= '					<Cd>' . $localInstrument . '</Cd>' . $CrLf;
2669
-					$XML_SEPA_INFO .= '				</LclInstrm>' . $CrLf;
2670
-					$XML_SEPA_INFO .= '				<SeqTp>' . $format . '</SeqTp>' . $CrLf;
2671
-					$XML_SEPA_INFO .= '			</PmtTpInf>' . $CrLf;
2663
+					$XML_SEPA_INFO .= '			<PmtTpInf>'.$CrLf;
2664
+					$XML_SEPA_INFO .= '				<SvcLvl>'.$CrLf;
2665
+					$XML_SEPA_INFO .= '					<Cd>SEPA</Cd>'.$CrLf;
2666
+					$XML_SEPA_INFO .= '				</SvcLvl>'.$CrLf;
2667
+					$XML_SEPA_INFO .= '				<LclInstrm>'.$CrLf;
2668
+					$XML_SEPA_INFO .= '					<Cd>'.$localInstrument.'</Cd>'.$CrLf;
2669
+					$XML_SEPA_INFO .= '				</LclInstrm>'.$CrLf;
2670
+					$XML_SEPA_INFO .= '				<SeqTp>'.$format.'</SeqTp>'.$CrLf;
2671
+					$XML_SEPA_INFO .= '			</PmtTpInf>'.$CrLf;
2672 2672
 				}
2673
-				$XML_SEPA_INFO .= '			<ReqdExctnDt>' . dol_print_date($dateTime_ETAD, 'dayrfc') . '</ReqdExctnDt>' . $CrLf;
2674
-				$XML_SEPA_INFO .= '			<Dbtr>' . $CrLf;
2675
-				$XML_SEPA_INFO .= '				<Nm>' . dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))) . '</Nm>' . $CrLf;
2676
-				$XML_SEPA_INFO .= '				<PstlAdr>' . $CrLf;
2677
-				$XML_SEPA_INFO .= '					<Ctry>' . $country[1] . '</Ctry>' . $CrLf;
2673
+				$XML_SEPA_INFO .= '			<ReqdExctnDt>'.dol_print_date($dateTime_ETAD, 'dayrfc').'</ReqdExctnDt>'.$CrLf;
2674
+				$XML_SEPA_INFO .= '			<Dbtr>'.$CrLf;
2675
+				$XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2676
+				$XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
2677
+				$XML_SEPA_INFO .= '					<Ctry>'.$country[1].'</Ctry>'.$CrLf;
2678 2678
 				$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => ""));
2679
-				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP . (($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' ' . $configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '') . $configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2679
+				$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
2680 2680
 				if ($addressline1) {
2681
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2681
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2682 2682
 				}
2683 2683
 				if ($addressline2) {
2684
-					$XML_SEPA_INFO .= '					<AdrLine>' . dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)) . '</AdrLine>' . $CrLf;
2684
+					$XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2685 2685
 				}
2686
-				$XML_SEPA_INFO .= '				</PstlAdr>' . $CrLf;
2687
-				$XML_SEPA_INFO .= '			</Dbtr>' . $CrLf;
2688
-				$XML_SEPA_INFO .= '			<DbtrAcct>' . $CrLf;
2689
-				$XML_SEPA_INFO .= '				<Id>' . $CrLf;
2690
-				$XML_SEPA_INFO .= '					<IBAN>' . preg_replace('/\s/', '', $this->emetteur_iban) . '</IBAN>' . $CrLf;
2691
-				$XML_SEPA_INFO .= '				</Id>' . $CrLf;
2692
-				$XML_SEPA_INFO .= '			</DbtrAcct>' . $CrLf;
2693
-				$XML_SEPA_INFO .= '			<DbtrAgt>' . $CrLf;
2694
-				$XML_SEPA_INFO .= '				<FinInstnId>' . $CrLf;
2695
-				$XML_SEPA_INFO .= '					<BIC>' . $this->emetteur_bic . '</BIC>' . $CrLf;
2696
-				$XML_SEPA_INFO .= '				</FinInstnId>' . $CrLf;
2697
-				$XML_SEPA_INFO .= '			</DbtrAgt>' . $CrLf;
2686
+				$XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2687
+				$XML_SEPA_INFO .= '			</Dbtr>'.$CrLf;
2688
+				$XML_SEPA_INFO .= '			<DbtrAcct>'.$CrLf;
2689
+				$XML_SEPA_INFO .= '				<Id>'.$CrLf;
2690
+				$XML_SEPA_INFO .= '					<IBAN>'.preg_replace('/\s/', '', $this->emetteur_iban).'</IBAN>'.$CrLf;
2691
+				$XML_SEPA_INFO .= '				</Id>'.$CrLf;
2692
+				$XML_SEPA_INFO .= '			</DbtrAcct>'.$CrLf;
2693
+				$XML_SEPA_INFO .= '			<DbtrAgt>'.$CrLf;
2694
+				$XML_SEPA_INFO .= '				<FinInstnId>'.$CrLf;
2695
+				$XML_SEPA_INFO .= '					<BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf;
2696
+				$XML_SEPA_INFO .= '				</FinInstnId>'.$CrLf;
2697
+				$XML_SEPA_INFO .= '			</DbtrAgt>'.$CrLf;
2698 2698
 				/* $XML_SEPA_INFO .= '			<UltmtCdtr>'.$CrLf;
2699 2699
 				 $XML_SEPA_INFO .= '				<Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
2700 2700
 				 $XML_SEPA_INFO .= '				<PstlAdr>'.$CrLf;
@@ -2703,7 +2703,7 @@  discard block
 block discarded – undo
2703 2703
 				 $XML_SEPA_INFO .= '					<AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
2704 2704
 				 $XML_SEPA_INFO .= '				</PstlAdr>'.$CrLf;
2705 2705
 				 $XML_SEPA_INFO .= '			</UltmtCdtr>'.$CrLf;*/
2706
-				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>' . $CrLf; // Field "Responsible of fees". Must be SLEV
2706
+				$XML_SEPA_INFO .= '			<ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV
2707 2707
 				/*$XML_SEPA_INFO .= '			<CdtrSchmeId>'.$CrLf;
2708 2708
 				 $XML_SEPA_INFO .= '				<Id>'.$CrLf;
2709 2709
 				 $XML_SEPA_INFO .= '					<PrvtId>'.$CrLf;
@@ -2718,7 +2718,7 @@  discard block
 block discarded – undo
2718 2718
 				 $XML_SEPA_INFO .= '			</CdtrSchmeId>'.$CrLf;*/
2719 2719
 			}
2720 2720
 		} else {
2721
-			fwrite($this->file, 'INCORRECT EMETTEUR ' . $this->raison_sociale . $CrLf);
2721
+			fwrite($this->file, 'INCORRECT EMETTEUR '.$this->raison_sociale.$CrLf);
2722 2722
 			$XML_SEPA_INFO = '';
2723 2723
 		}
2724 2724
 		return $XML_SEPA_INFO;
@@ -2770,7 +2770,7 @@  discard block
 block discarded – undo
2770 2770
 
2771 2771
 		$montant = ($total * 100);
2772 2772
 
2773
-		fwrite($this->file, substr("000000000000000" . $montant, -16));
2773
+		fwrite($this->file, substr("000000000000000".$montant, -16));
2774 2774
 
2775 2775
 		// Zone Reservee F
2776 2776
 
@@ -2927,18 +2927,18 @@  discard block
 block discarded – undo
2927 2927
 		$return .= img_picto('', $this->picto);
2928 2928
 		$return .= '</span>';
2929 2929
 		$return .= '<div class="info-box-content">';
2930
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . (method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref) . '</span>';
2930
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
2931 2931
 		if ($selected >= 0) {
2932
-			$return .= '<input id="cb' . $this->id . '" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
2932
+			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
2933 2933
 		}
2934 2934
 		if (property_exists($this, 'date_echeance')) {
2935
-			$return .= '<br><span class="opacitymedium">' . $langs->trans("Date") . '</span> : <span class="info-box-label">' . dol_print_date($this->db->jdate($this->date_echeance), 'day') . '</span>';
2935
+			$return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->date_echeance), 'day').'</span>';
2936 2936
 		}
2937 2937
 		if (property_exists($this, 'total')) {
2938
-			$return .= '<br><span class="opacitymedium">' . $langs->trans("Amount") . '</span> : <span class="amount">' . price($this->total) . '</span>';
2938
+			$return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="amount">'.price($this->total).'</span>';
2939 2939
 		}
2940 2940
 		if (method_exists($this, 'LibStatut')) {
2941
-			$return .= '<br><div class="info-box-status">' . $this->getLibStatut(3) . '</div>';
2941
+			$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
2942 2942
 		}
2943 2943
 		$return .= '</div>';
2944 2944
 		$return .= '</div>';
@@ -2959,9 +2959,9 @@  discard block
 block discarded – undo
2959 2959
 			return 0;
2960 2960
 		}
2961 2961
 		if ($id) {
2962
-			$sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "prelevement_lignes";
2963
-			$sql .= " WHERE fk_prelevement_bons = " . ((int) $id);
2964
-			$sql .= " AND fk_soc = 0";	// fk_soc can't be NULL
2962
+			$sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."prelevement_lignes";
2963
+			$sql .= " WHERE fk_prelevement_bons = ".((int) $id);
2964
+			$sql .= " AND fk_soc = 0"; // fk_soc can't be NULL
2965 2965
 			$sql .= " AND fk_user IS NOT NULL";
2966 2966
 
2967 2967
 			$num = 0;
Please login to merge, or discard this patch.