Completed
Branch develop (b84bc6)
by
unknown
23:49
created
htdocs/compta/facture/card.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 }
92 92
 
93 93
 // General $Variables
94
-$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid'));    // For backward compatibility
94
+$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
95 95
 $ref = GETPOST('ref', 'alpha');
96 96
 $socid = GETPOSTINT('socid');
97 97
 $action = GETPOST('action', 'aZ09');
98 98
 $confirm = GETPOST('confirm', 'alpha');
99 99
 $cancel = GETPOST('cancel', 'alpha');
100
-$backtopage = GETPOST('backtopage', 'alpha');					// if not set, a default page will be used
101
-$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');	// if not set, $backtopage will be used
100
+$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used
101
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used
102 102
 $lineid = GETPOSTINT('lineid');
103 103
 $userid = GETPOSTINT('userid');
104 104
 $search_ref = GETPOST('sf_ref', 'alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 					setEventMessages('', $warningMsgLineList, 'warnings');
273 273
 				}
274 274
 
275
-				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
275
+				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result);
276 276
 				exit();
277 277
 			} else {
278 278
 				$langs->load("errors");
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 		// Validation
364 364
 		$object->fetch($id);
365 365
 
366
-		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) &&	// empty should not happened, but when it occurs, the test save life
366
+		if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life
367 367
 			getDolGlobalString('FAC_FORCE_DATE_VALIDATION')								// If option enabled, we force invoice date
368 368
 		) {
369 369
 			$object->date = dol_now();
@@ -783,8 +783,8 @@  discard block
 block discarded – undo
783 783
 			// We check if invoice has payments
784 784
 			$totalpaid = 0;
785 785
 			$sql = 'SELECT pf.amount';
786
-			$sql .= ' FROM ' . MAIN_DB_PREFIX . 'paiement_facture as pf';
787
-			$sql .= ' WHERE pf.fk_facture = ' . ((int) $object->id);
786
+			$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
787
+			$sql .= ' WHERE pf.fk_facture = '.((int) $object->id);
788 788
 
789 789
 			$result = $db->query($sql);
790 790
 			if ($result) {
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
 			if ($result < 0) {
854 854
 				setEventMessages($object->error, $object->errors, 'errors');
855 855
 			} else {
856
-				$object->fetch($object->id);	// Reload properties
856
+				$object->fetch($object->id); // Reload properties
857 857
 			}
858 858
 		} else {
859 859
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 			if ($result < 0) {
869 869
 				setEventMessages($object->error, $object->errors, 'errors');
870 870
 			} else {
871
-				$object->fetch($object->id);	// Reload properties
871
+				$object->fetch($object->id); // Reload properties
872 872
 			}
873 873
 		} else {
874 874
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
 					// Set invoice as paid
1048 1048
 					$result = $object->setPaid($user);
1049 1049
 					if ($result >= 0) {
1050
-						$object->fetch($object->id);	// Reload properties
1050
+						$object->fetch($object->id); // Reload properties
1051 1051
 						$db->commit();
1052 1052
 					} else {
1053 1053
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 			$error++;
1098 1098
 		}
1099 1099
 
1100
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1100
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1101 1101
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
1102 1102
 
1103 1103
 		// Replacement invoice
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1130 1130
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1131 1131
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1132
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1132
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1133 1133
 				$object->fk_project			= GETPOSTINT('projectid');
1134 1134
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1135 1135
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
@@ -1190,9 +1190,9 @@  discard block
 block discarded – undo
1190 1190
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1191 1191
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1192 1192
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1193
-				$object->model_pdf          = GETPOST('model');
1193
+				$object->model_pdf = GETPOST('model');
1194 1194
 				$object->fk_project			= GETPOSTINT('projectid');
1195
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1195
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1196 1196
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1197 1197
 				$object->fk_account         = GETPOSTINT('fk_account');
1198 1198
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1516 1516
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1517 1517
 				$object->ref_client			= GETPOST('ref_client');
1518
-				$object->ref_customer		= GETPOST('ref_client');
1518
+				$object->ref_customer = GETPOST('ref_client');
1519 1519
 				$object->model_pdf          = GETPOST('model');
1520 1520
 				$object->fk_project			= GETPOSTINT('projectid');
1521 1521
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
 						$element = $subelement = 'expedition';
1580 1580
 					}
1581 1581
 
1582
-					$object->origin = $origin;		// deprecated
1582
+					$object->origin = $origin; // deprecated
1583 1583
 					$object->origin_type = $origin;
1584 1584
 					$object->origin_id = $originid;
1585 1585
 
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
 						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines or deposit lines");
1615 1615
 						$result = $srcobject->fetch($object->origin_id);
1616 1616
 
1617
-						$i = -1;  // Ensure initialised for static analysis, but with invalid idx.
1617
+						$i = -1; // Ensure initialised for static analysis, but with invalid idx.
1618 1618
 						// If deposit invoice - down payment with 1 line (fixed amount or percent)
1619 1619
 						if (GETPOST('type') == Facture::TYPE_DEPOSIT && in_array($typeamount, array('amount', 'variable'))) {
1620 1620
 							// Define the array $amountdeposit
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
 				if (!empty($origin) && !empty($originid)) {
2018 2018
 					include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
2019 2019
 
2020
-					$object->origin = $origin;		// deprecated
2020
+					$object->origin = $origin; // deprecated
2021 2021
 					$object->origin_type = $origin;
2022 2022
 					$object->origin_id = $originid;
2023 2023
 
@@ -2043,7 +2043,7 @@  discard block
 block discarded – undo
2043 2043
 						$line->fk_prev_id = $line->id;
2044 2044
 						$line->fetch_optionals();
2045 2045
 						if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) {
2046
-							$line->situation_percent = 0;  // New situation percent must be 0 (No cumulative)
2046
+							$line->situation_percent = 0; // New situation percent must be 0 (No cumulative)
2047 2047
 						} else {
2048 2048
 							$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
2049 2049
 						}
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
 		} else {
2161 2161
 			$db->rollback();
2162 2162
 			$action = 'create';
2163
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
2163
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
2164 2164
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
2165 2165
 			setEventMessages($object->error, $object->errors, 'errors');
2166 2166
 		}
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 			 */
2514 2514
 
2515 2515
 			// Margin
2516
-			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : '');				// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2516
+			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2517 2517
 			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
2518 2518
 
2519 2519
 
@@ -2646,7 +2646,7 @@  discard block
 block discarded – undo
2646 2646
 				if ($prod->price_min > $line->subprice) {
2647 2647
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
2648 2648
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
2649
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
2649
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
2650 2650
 				} else {
2651 2651
 					setEventMessages($prod->error, $prod->errors, 'errors');
2652 2652
 				}
@@ -2712,7 +2712,7 @@  discard block
 block discarded – undo
2712 2712
 		$localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty);
2713 2713
 
2714 2714
 		// Add buying price
2715
-		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : '');				// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2715
+		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
2716 2716
 		$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value
2717 2717
 
2718 2718
 		// Prepare a price equivalent for minimum price check
@@ -2755,7 +2755,7 @@  discard block
 block discarded – undo
2755 2755
 		// Define special_code for special lines
2756 2756
 		$special_code = GETPOSTINT('special_code');
2757 2757
 		if ($special_code == 3) {
2758
-			$special_code = 0;	// Options should not exists on invoices
2758
+			$special_code = 0; // Options should not exists on invoices
2759 2759
 		}
2760 2760
 
2761 2761
 		$line = new FactureLigne($db);
@@ -3202,7 +3202,7 @@  discard block
 block discarded – undo
3202 3202
 
3203 3203
 
3204 3204
 	if ($action == 'update_extras' && $permissiontoeditextra) {
3205
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
3205
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
3206 3206
 
3207 3207
 		$attribute_name = GETPOST('attribute', 'aZ09');
3208 3208
 
@@ -3320,7 +3320,7 @@  discard block
 block discarded – undo
3320 3320
 	$fk_account = GETPOSTINT('fk_account');
3321 3321
 
3322 3322
 	// Load objectsrc
3323
-	$objectsrc = null;  // Initialise
3323
+	$objectsrc = null; // Initialise
3324 3324
 	//$remise_absolue = 0;
3325 3325
 	if (!empty($origin) && !empty($originid)) {
3326 3326
 		// Parse element/subelement (ex: project_task)
@@ -3331,7 +3331,7 @@  discard block
 block discarded – undo
3331 3331
 			$subelement = $regs[2];
3332 3332
 		}
3333 3333
 
3334
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
3334
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
3335 3335
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver');
3336 3336
 
3337 3337
 		if ($element == 'project') {
@@ -3409,8 +3409,8 @@  discard block
 block discarded – undo
3409 3409
 				$fk_account         = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
3410 3410
 
3411 3411
 				if (isModEnabled('multicurrency')) {
3412
-					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3413
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3412
+					$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3413
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3414 3414
 				}
3415 3415
 
3416 3416
 				//Replicate extrafields
@@ -3503,7 +3503,7 @@  discard block
 block discarded – undo
3503 3503
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3504 3504
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3505 3505
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3506
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
3506
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
3507 3507
 	if ($soc->id > 0) {
3508 3508
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3509 3509
 	}
@@ -3685,7 +3685,7 @@  discard block
 block discarded – undo
3685 3685
 			print $form->selectarray('typestandard', $arraylist, GETPOST('typestandard', 'aZ09'), 0, 0, 0, '', 1);
3686 3686
 			print '</td>';*/
3687 3687
 			if (!getDolGlobalInt('INVOICE_DEPOSIT_INVOICE_ONLY_SAME_LINES')) {
3688
-				print '<span class="opacitymedium marginleftonly">' . $langs->trans('PercentOfOriginalObject') . '</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="' . (GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%') . '"/>';
3688
+				print '<span class="opacitymedium marginleftonly">'.$langs->trans('PercentOfOriginalObject').'</span>:<input class="right" placeholder="100%" type="text" id="valuestandardinvoice" name="valuestandardinvoice" size="3" value="'.(GETPOSTISSET('valuestandardinvoice') ? GETPOST('valuestandardinvoice', 'alpha') : '100%').'"/>';
3689 3689
 			}
3690 3690
 		}
3691 3691
 		print '</div></div>'."\n";
@@ -4038,8 +4038,8 @@  discard block
 block discarded – undo
4038 4038
 		if ($socid > 0) {
4039 4039
 			print '<tr><td>'.$langs->trans('DiscountStillRemaining').'</td><td colspan="2">';
4040 4040
 
4041
-			$thirdparty = $soc;	// used by object_discounts.tpl.php
4042
-			$discount_type = 0;	// used by object_discounts.tpl.php
4041
+			$thirdparty = $soc; // used by object_discounts.tpl.php
4042
+			$discount_type = 0; // used by object_discounts.tpl.php
4043 4043
 			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
4044 4044
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
4045 4045
 
@@ -4080,7 +4080,7 @@  discard block
 block discarded – undo
4080 4080
 			if (empty($retained_warranty)) {
4081 4081
 				if ($objectsrc !== null && property_exists($objectsrc, 'retained_warranty') && !empty($objectsrc->retained_warranty)) { // use previous situation value
4082 4082
 					// Facture->retained_warranty  (does not exist on Expedition)
4083
-					$retained_warranty = $objectsrc->retained_warranty;  // @phan-suppress-current-line PhanUndeclaredProperty
4083
+					$retained_warranty = $objectsrc->retained_warranty; // @phan-suppress-current-line PhanUndeclaredProperty
4084 4084
 				}
4085 4085
 			}
4086 4086
 			$retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT');
@@ -4575,7 +4575,7 @@  discard block
 block discarded – undo
4575 4575
 		$nbMandated = 0;
4576 4576
 		foreach ($object->lines as $line) {
4577 4577
 			$res = $line->fetch_product();
4578
-			if ($res  > 0) {
4578
+			if ($res > 0) {
4579 4579
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4580 4580
 					$nbMandated++;
4581 4581
 					break;
@@ -4792,7 +4792,7 @@  discard block
 block discarded – undo
4792 4792
 	}
4793 4793
 	// Ref customer
4794 4794
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string', '', 0, 1);
4795
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4795
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, (int) $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4796 4796
 	// Thirdparty
4797 4797
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
4798 4798
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -5222,45 +5222,45 @@  discard block
 block discarded – undo
5222 5222
 		}
5223 5223
 		print '<tr>';
5224 5224
 		// Amount HT
5225
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
5226
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5225
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
5226
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5227 5227
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5228 5228
 			// Multicurrency Amount HT
5229
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5229
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5230 5230
 		}
5231 5231
 		print '</tr>';
5232 5232
 
5233 5233
 		print '<tr>';
5234 5234
 		// Amount VAT
5235
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
5236
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5235
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
5236
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5237 5237
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5238 5238
 			// Multicurrency Amount VAT
5239
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5239
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5240 5240
 		}
5241 5241
 		print '</tr>';
5242 5242
 
5243 5243
 		// Amount Local Taxes
5244 5244
 		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
5245 5245
 			print '<tr>';
5246
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
5247
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5246
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
5247
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5248 5248
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5249 5249
 				$object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
5250 5250
 
5251
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5251
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5252 5252
 			}
5253 5253
 			print '</tr>';
5254 5254
 		}
5255 5255
 
5256 5256
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
5257 5257
 			print '<tr>';
5258
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
5259
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5258
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
5259
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5260 5260
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5261 5261
 				$object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
5262 5262
 
5263
-				print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5263
+				print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5264 5264
 			}
5265 5265
 			print '</tr>';
5266 5266
 		}
@@ -5320,11 +5320,11 @@  discard block
 block discarded – undo
5320 5320
 
5321 5321
 		print '<tr>';
5322 5322
 		// Amount TTC
5323
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
5324
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
5323
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
5324
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
5325 5325
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
5326 5326
 			// Multicurrency Amount TTC
5327
-			print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
5327
+			print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5328 5328
 		}
5329 5329
 		print '</tr>';
5330 5330
 
@@ -5954,10 +5954,10 @@  discard block
 block discarded – undo
5954 5954
 						if (!$objectidnext && $object->is_last_in_cycle()) {
5955 5955
 							if ($usercanunvalidate) {
5956 5956
 								unset($params['attr']['title']);
5957
-								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', true, $params);
5957
+								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', true, $params);
5958 5958
 							} else {
5959 5959
 								$params['attr']['title'] = $langs->trans('NotEnoughPermissions');
5960
-								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif&token=' . newToken(), '', false, $params);
5960
+								print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', false, $params);
5961 5961
 							}
5962 5962
 						} elseif (!$object->is_last_in_cycle()) {
5963 5963
 							$params['attr']['title'] = $langs->trans('NotLastInCycle');
@@ -5998,7 +5998,7 @@  discard block
 block discarded – undo
5998 5998
 					$langs->load("contracts");
5999 5999
 
6000 6000
 					if ($usercancreatecontract) {
6001
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
6001
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
6002 6002
 					}
6003 6003
 				}
6004 6004
 			}
@@ -6224,7 +6224,7 @@  discard block
 block discarded – undo
6224 6224
 			if ($usercandelete || ($usercancreate && $isErasable == 1)) {	// isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
6225 6225
 				$enableDelete = false;
6226 6226
 				$deleteHref = '#';
6227
-				if ($isErasable > 0 && ! $objectidnext) {
6227
+				if ($isErasable > 0 && !$objectidnext) {
6228 6228
 					$deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken();
6229 6229
 					$enableDelete = true;
6230 6230
 				}
Please login to merge, or discard this patch.
htdocs/product/stock/list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 				$search[$key.'_dtend'] = '';
184 184
 			}
185 185
 		}
186
-		$search['status'] = '';		// To remove when statut and status are merged
187
-		$search_status = '';		// To remove when statut and status are merged
186
+		$search['status'] = ''; // To remove when statut and status are merged
187
+		$search_status = ''; // To remove when statut and status are merged
188 188
 		$toselect = array();
189 189
 		$search_array_options = array();
190 190
 		$search_category_list = array();
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c_dep ON c_dep.rowid = t.fk_departement";
255 255
 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk_pays";
256 256
 if ($separatedPMP) {
257
-	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as pa ON pa.fk_product = p.rowid AND pa.fk_product = ps.fk_product AND pa.entity = ". (int) $conf->entity;
257
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as pa ON pa.fk_product = p.rowid AND pa.fk_product = ps.fk_product AND pa.entity = ".(int) $conf->entity;
258 258
 }
259 259
 $sql .= " WHERE t.entity IN (".getEntity('stock').")";
260 260
 foreach ($search as $key => $val) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 			if ($searchCategoryWarehouseOperator == 0) {
307 307
 				$searchCategoryWarehouseSqlList[] = " EXISTS (SELECT ck.fk_warehouse FROM ".MAIN_DB_PREFIX."categorie_warehouse as ck WHERE t.rowid = ck.fk_warehouse AND ck.fk_categorie = ".((int) $searchCategoryWarehouse).")";
308 308
 			} else {
309
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryWarehouse);
309
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryWarehouse);
310 310
 			}
311 311
 		}
312 312
 	}
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
461 461
 );
462 462
 //if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
463
-if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
463
+if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
464 464
 	$arrayofmassactions = array();
465 465
 }
466 466
 if (isModEnabled('category') && $user->hasRight('stock', 'creer')) {
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 }
536 536
 
537 537
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
538
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
538
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
539 539
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
540 540
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
541 541
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
652 652
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
653 653
 	}
654
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
654
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
655 655
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
656 656
 		print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
657 657
 		$totalarray['nbfield']++;
Please login to merge, or discard this patch.
htdocs/takepos/index.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 $arrayofcss = array('/takepos/css/pos.css.php', '/takepos/css/colorbox.css');
132 132
 
133 133
 if (getDolGlobalInt('TAKEPOS_COLOR_THEME') == 1) {
134
-	$arrayofcss[] =  '/takepos/css/colorful.css';
134
+	$arrayofcss[] = '/takepos/css/colorful.css';
135 135
 }
136 136
 
137 137
 
138 138
 // Title
139 139
 $title = 'TakePOS - Dolibarr '.DOL_VERSION;
140 140
 if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
141
-	$title = 'TakePOS - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
141
+	$title = 'TakePOS - '.getDolGlobalString('MAIN_APPLICATION_TITLE');
142 142
 }
143 143
 $head = '<meta name="apple-mobile-web-app-title" content="TakePOS"/>
144 144
 <meta name="apple-mobile-web-app-capable" content="yes">
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 		limit = maxproduct - 1;
361 361
 	}
362 362
 	// Only show products for sale (tosell=1)
363
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) {
363
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) {
364 364
 		console.log("Call ajax.php (in LoadProducts) to get Products of category "+currentcat+" then loop on result to fill image thumbs");
365 365
 		//console.log(data);
366 366
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 	var nb_cat_shown = $('.div5 div.wrapper2[data-iscat=1]').length;
483 483
 	var offset = <?php echo($MAXPRODUCT - 2); ?> * pageproducts - nb_cat_shown;
484 484
 	// Only show products for sale (tosell=1)
485
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken();?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) {
485
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getProducts&token=<?php echo newToken(); ?>&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) {
486 486
 		console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat);
487 487
 
488 488
 		if (typeof (data[0]) == "undefined" && moreorless=="more"){ // Return if no more pages
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 function ChangeThirdparty(idcustomer) {
575 575
 	 console.log("ChangeThirdparty");
576 576
 		// Call page list.php to change customer
577
-		$("#poslines").load("<?php echo DOL_URL_ROOT ?>/societe/list.php?action=change&token=<?php echo newToken();?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
577
+		$("#poslines").load("<?php echo DOL_URL_ROOT ?>/societe/list.php?action=change&token=<?php echo newToken(); ?>&type=t&contextpage=poslist&idcustomer="+idcustomer+"&place="+place+"", function() {
578 578
 		});
579 579
 
580 580
 	ClearSearch(false);
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 
683 683
 	console.log("New with place = <?php echo $place; ?>, js place="+place+", invoiceid="+invoiceid);
684 684
 
685
-	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken();?>&id='+invoiceid, function(data) {
685
+	$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&token=<?php echo newToken(); ?>&id='+invoiceid, function(data) {
686 686
 		var r;
687 687
 
688 688
 		if (parseInt(data['paye']) === 1) {
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
 			pageproducts = 0;
756 756
 			jQuery(".wrapper2 .catwatermark").hide();
757 757
 			var nbsearchresults = 0;
758
-			$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken();?>&search_term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
758
+			$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&token=<?php echo newToken(); ?>&search_term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) {
759 759
 				for (i = 0; i < <?php echo $MAXPRODUCT ?>; i++) {
760 760
 					if (typeof (data[i]) == "undefined") {
761 761
 						$("#prowatermark" + i).html("");
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 				}
851 851
 				else {
852 852
 					$("#prodiv<?php echo $MAXPRODUCT - 2; ?> span").show();
853
-					var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2;?>));
853
+					var search_start_less = Math.max(0, parseInt(search_start) - parseInt(<?php echo $MAXPRODUCT - 2; ?>));
854 854
 					$("#search_start_less").val(search_start_less);
855 855
 				}
856 856
 				if (nbsearchresults != <?php echo $MAXPRODUCT - 2; ?>) {
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 				}
859 859
 				else {
860 860
 					$("#prodiv<?php echo $MAXPRODUCT - 1; ?> span").show();
861
-					var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2;?>);
861
+					var search_start_more = parseInt(search_start) + parseInt(<?php echo $MAXPRODUCT - 2; ?>);
862 862
 					$("#search_start_more").val(search_start_more);
863 863
 				}
864 864
 			});
@@ -955,14 +955,14 @@  discard block
 block discarded – undo
955 955
 
956 956
 function TakeposPrintingOrder(){
957 957
 	console.log("TakeposPrintingOrder");
958
-	$("#poslines").load("invoice.php?action=order&token=<?php echo newToken();?>&place="+place, function() {
958
+	$("#poslines").load("invoice.php?action=order&token=<?php echo newToken(); ?>&place="+place, function() {
959 959
 		//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
960 960
 	});
961 961
 }
962 962
 
963 963
 function TakeposPrintingTemp(){
964 964
 	console.log("TakeposPrintingTemp");
965
-	$("#poslines").load("invoice.php?action=temp&token=<?php echo newToken();?>&place="+place, function() {
965
+	$("#poslines").load("invoice.php?action=temp&token=<?php echo newToken(); ?>&place="+place, function() {
966 966
 		//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
967 967
 	});
968 968
 }
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 }
985 985
 
986 986
 function DolibarrOpenDrawer() {
987
-	console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken();?>&term=<?php print urlencode(empty($_SESSION["takeposterminal"]) ? '' : $_SESSION["takeposterminal"]); ?>");
987
+	console.log("DolibarrOpenDrawer call ajax url /takepos/ajax/ajax.php?action=opendrawer&token=<?php echo newToken(); ?>&term=<?php print urlencode(empty($_SESSION["takeposterminal"]) ? '' : $_SESSION["takeposterminal"]); ?>");
988 988
 	$.ajax({
989 989
 		type: "GET",
990 990
 		data: { token: '<?php echo currentToken(); ?>' },
@@ -1334,8 +1334,8 @@  discard block
 block discarded – undo
1334 1334
 
1335 1335
 // TakePOS setup check
1336 1336
 if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) {
1337
-	$sql = "SELECT code, libelle FROM " . MAIN_DB_PREFIX . "c_paiement";
1338
-	$sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")";
1337
+	$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement";
1338
+	$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
1339 1339
 	$sql .= " AND active = 1";
1340 1340
 	$sql .= " ORDER BY libelle";
1341 1341
 
@@ -1351,7 +1351,7 @@  discard block
 block discarded – undo
1351 1351
 				$paycode = 'CHEQUE';
1352 1352
 			}
1353 1353
 
1354
-			$constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
1354
+			$constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
1355 1355
 			//var_dump($constantforkey.' '.getDolGlobalInt($constantforkey));
1356 1356
 			if (getDolGlobalInt($constantforkey) > 0) {
1357 1357
 				array_push($paiementsModes, $obj);
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
 		$menus[$r++] = array('title' => '<span class="far fa-building paddingrightonly"></span><div class="trunc">'.$langs->trans("Customer").'</div>', 'action' => 'Customer();');
1394 1394
 	}
1395 1395
 }
1396
-if (! getDolGlobalString('TAKEPOS_HIDE_HISTORY')) {
1396
+if (!getDolGlobalString('TAKEPOS_HIDE_HISTORY')) {
1397 1397
 	$menus[$r++] = array('title' => '<span class="fa fa-history paddingrightonly"></span><div class="trunc">'.$langs->trans("History").'</div>', 'action' => 'History();');
1398 1398
 }
1399 1399
 $menus[$r++] = array('title' => '<span class="fa fa-cube paddingrightonly"></span><div class="trunc">'.$langs->trans("FreeZone").'</div>', 'action' => 'FreeZone();');
Please login to merge, or discard this patch.
htdocs/core/class/commoninvoice.class.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -119,15 +119,15 @@  discard block
 block discarded – undo
119 119
 	/**
120 120
 	 * @var float
121 121
 	 */
122
-	public $totalpaid;			// duplicate with sumpayed
122
+	public $totalpaid; // duplicate with sumpayed
123 123
 	/**
124 124
 	 * @var int|float
125 125
 	 */
126
-	public $totaldeposits;		// duplicate with sumdeposit
126
+	public $totaldeposits; // duplicate with sumdeposit
127 127
 	/**
128 128
 	 * @var int|float
129 129
 	 */
130
-	public $totalcreditnotes;	// duplicate with sumcreditnote
130
+	public $totalcreditnotes; // duplicate with sumcreditnote
131 131
 
132 132
 	/**
133 133
 	 * @var int|float
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	const CLOSECODE_DISCOUNTVAT = 'discount_vat'; // Abandoned remain - escompte
280 280
 	const CLOSECODE_BADDEBT = 'badcustomer'; // Abandoned remain - bad customer
281 281
 	const CLOSECODE_BANKCHARGE = 'bankcharge'; // Abandoned remain - bank charge
282
-	const CLOSECODE_WITHHOLDINGTAX = 'withholdingtax';	// Abandoned remain - source tax
282
+	const CLOSECODE_WITHHOLDINGTAX = 'withholdingtax'; // Abandoned remain - source tax
283 283
 	const CLOSECODE_OTHER = 'other'; // Abandoned remain - other
284 284
 
285 285
 	const CLOSECODE_ABANDONED = 'abandon'; // Abandoned - other
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 	public function getListOfPayments($filtertype = '', $multicurrency = 0, $mode = 0)
576 576
 	{
577 577
 		$retarray = array();
578
-		$this->error = '';	// By default no error, list can be empty.
578
+		$this->error = ''; // By default no error, list can be empty.
579 579
 
580 580
 		$table = 'paiement_facture';
581 581
 		$table2 = 'paiement';
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 
596 596
 		// List of payments
597 597
 		if (empty($mode) || $mode == 1) {
598
-			$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3 . $field4;
598
+			$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3.$field4;
599 599
 			$sql .= " FROM ".$this->db->prefix().$table." as pf, ".$this->db->prefix().$table2." as p, ".$this->db->prefix()."c_paiement as t";
600 600
 			$sql .= " WHERE pf.".$field." = ".((int) $this->id);
601 601
 			$sql .= " AND pf.".$field2." = p.rowid";
@@ -853,12 +853,12 @@  discard block
 block discarded – undo
853 853
 	{
854 854
 		$subtypeLabel = '';
855 855
 		if ($table === 'facture' || $table === 'facture_fourn') {
856
-			$sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f";
857
-			$sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid";
856
+			$sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f";
857
+			$sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid";
858 858
 			$sql .= " WHERE f.ref = '".$this->db->escape($this->ref)."'";
859 859
 		} elseif ($table === 'facture_rec' || $table === 'facture_fourn_rec') {
860
-			$sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f";
861
-			$sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid";
860
+			$sql = "SELECT s.label FROM ".$this->db->prefix().$table." AS f";
861
+			$sql .= " INNER JOIN ".$this->db->prefix()."c_invoice_subtype AS s ON f.subtype = s.rowid";
862 862
 			$sql .= " WHERE f.titre = '".$this->db->escape($this->title)."'";
863 863
 		} else {
864 864
 			return -1;
@@ -890,11 +890,11 @@  discard block
 block discarded – undo
890 890
 		$effs = array();
891 891
 
892 892
 		$sql = "SELECT rowid, code, label as label";
893
-		$sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype';
893
+		$sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype';
894 894
 		$sql .= " WHERE active = 1 AND fk_country = ".((int) $mysoc->country_id)." AND entity IN(".getEntity('c_invoice_subtype').")";
895 895
 		$sql .= " ORDER by rowid, code";
896 896
 
897
-		dol_syslog(get_class($this) . '::getArrayOfInvoiceSubtypes', LOG_DEBUG);
897
+		dol_syslog(get_class($this).'::getArrayOfInvoiceSubtypes', LOG_DEBUG);
898 898
 		$resql = $this->db->query($sql);
899 899
 		if ($resql) {
900 900
 			$num = $this->db->num_rows($resql);
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 		if ($this->status > self::STATUS_DRAFT && $this->paye == 0) {
1334 1334
 			// Get the default payment mode for BAN payment of the third party
1335 1335
 			require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
1336
-			$bac = new CompanyBankAccount($this->db);	// Table societe_rib
1336
+			$bac = new CompanyBankAccount($this->db); // Table societe_rib
1337 1337
 			$result = $bac->fetch(0, '', $this->socid, 1, 'ban');
1338 1338
 			if ($result <= 0 || empty($bac->id)) {
1339 1339
 				$this->error = $langs->trans("ThirdpartyHasNoDefaultBanAccount");
@@ -1347,16 +1347,16 @@  discard block
 block discarded – undo
1347 1347
 			$sql .= " FROM ".$this->db->prefix()."prelevement_demande";
1348 1348
 			$sql .= " WHERE rowid = ".((int) $did);
1349 1349
 			if ($type != 'bank-transfer' && $type != 'credit-transfer') {
1350
-				$sql .= " AND fk_facture = ".((int) $this->id);				// Add a protection to not pay another invoice than current one
1350
+				$sql .= " AND fk_facture = ".((int) $this->id); // Add a protection to not pay another invoice than current one
1351 1351
 			}
1352 1352
 			if ($type != 'direct-debit') {
1353 1353
 				if ($sourcetype == 'salary') {
1354
-					$sql .= " AND fk_salary = ".((int) $this->id);			// Add a protection to not pay another salary than current one
1354
+					$sql .= " AND fk_salary = ".((int) $this->id); // Add a protection to not pay another salary than current one
1355 1355
 				} else {
1356
-					$sql .= " AND fk_facture_fourn = ".((int) $this->id);	// Add a protection to not pay another invoice than current one
1356
+					$sql .= " AND fk_facture_fourn = ".((int) $this->id); // Add a protection to not pay another invoice than current one
1357 1357
 				}
1358 1358
 			}
1359
-			$sql .= " AND traite = 0";	// To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0)
1359
+			$sql .= " AND traite = 0"; // To not process payment request that were already converted into a direct debit or credit transfer order (Note: fk_prelevement_bons is also empty when traite = 0)
1360 1360
 
1361 1361
 			dol_syslog(get_class($this)."::makeStripeSepaRequest load requests to process", LOG_DEBUG);
1362 1362
 			$resql = $this->db->query($sql);
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 
1373 1373
 				if (is_numeric($amount) && $amount != 0) {
1374 1374
 					require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php';
1375
-					$companypaymentmode = new CompanyPaymentMode($this->db);	// table societe_rib
1375
+					$companypaymentmode = new CompanyPaymentMode($this->db); // table societe_rib
1376 1376
 					$companypaymentmode->fetch($bac->id);
1377 1377
 
1378 1378
 					$this->stripechargedone = 0;
@@ -1382,11 +1382,11 @@  discard block
 block discarded – undo
1382 1382
 
1383 1383
 					$currency = $conf->currency;
1384 1384
 
1385
-					$errorforinvoice = 0;     // We reset the $errorforinvoice at each invoice loop
1385
+					$errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop
1386 1386
 
1387 1387
 					$this->fetch_thirdparty();
1388 1388
 
1389
-					dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=" . $this->thirdparty->id . ", thirdparty_name=" . $this->thirdparty->name . " ban id=" . $bac->id, LOG_DEBUG);
1389
+					dol_syslog("makeStripeSepaRequest Process payment request amount=".$amount." thirdparty_id=".$this->thirdparty->id.", thirdparty_name=".$this->thirdparty->name." ban id=".$bac->id, LOG_DEBUG);
1390 1390
 
1391 1391
 					//$alreadypayed = $this->getSommePaiement();
1392 1392
 					//$amount_credit_notes_included = $this->getSumCreditNotesUsed();
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 						$amountstripe *= 100;
1402 1402
 					}
1403 1403
 
1404
-					$fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');		// Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr.
1404
+					$fk_bank_account = getDolGlobalInt('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'); // Bank account used for SEPA direct debit or credit transfer. Must be the Stripe account in Dolibarr.
1405 1405
 					if (!($fk_bank_account > 0)) {
1406 1406
 						$error++;
1407 1407
 						$errorforinvoice++;
@@ -1462,44 +1462,44 @@  discard block
 block discarded – undo
1462 1462
 								}
1463 1463
 
1464 1464
 								//var_dump($companypaymentmode);
1465
-								dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG);
1465
+								dol_syslog("makeStripeSepaRequest We will try to pay with companypaymentmodeid=".$companypaymentmode->id." stripe_card_ref=".$companypaymentmode->stripe_card_ref." mode=".$companypaymentmode->status, LOG_DEBUG);
1466 1466
 
1467 1467
 								$thirdparty = new Societe($this->db);
1468 1468
 								$resultthirdparty = $thirdparty->fetch($this->socid);
1469 1469
 
1470
-								include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php';        // This include the include of htdocs/stripe/config.php
1470
+								include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php
1471 1471
 								// So it inits or erases the $stripearrayofkeysbyenv
1472 1472
 								$stripe = new Stripe($this->db);
1473 1473
 
1474 1474
 								if (empty($savstripearrayofkeysbyenv)) {
1475 1475
 									$savstripearrayofkeysbyenv = $stripearrayofkeysbyenv;
1476 1476
 								}
1477
-								dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']);
1477
+								dol_syslog("makeStripeSepaRequest Current Stripe environment is ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key']);
1478 1478
 								dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is ".$savstripearrayofkeysbyenv[$servicestatus]['publishable_key']);
1479 1479
 
1480 1480
 								$foundalternativestripeaccount = '';
1481 1481
 
1482 1482
 								// Force stripe to another value (by default this value is empty)
1483
-								if (! empty($forcestripe)) {
1483
+								if (!empty($forcestripe)) {
1484 1484
 									dol_syslog("makeStripeSepaRequest A dedicated stripe account was forced, so we switch to it.");
1485 1485
 
1486 1486
 									$tmparray = explode('@', $forcestripe);
1487
-									if (! empty($tmparray[1])) {
1487
+									if (!empty($tmparray[1])) {
1488 1488
 										$tmparray2 = explode(':', $tmparray[1]);
1489
-										if (! empty($tmparray2[1])) {
1489
+										if (!empty($tmparray2[1])) {
1490 1490
 											$stripearrayofkeysbyenv[$servicestatus]["publishable_key"] = $tmparray2[0];
1491 1491
 											$stripearrayofkeysbyenv[$servicestatus]["secret_key"] = $tmparray2[1];
1492 1492
 
1493 1493
 											$stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus];
1494 1494
 											\Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
1495 1495
 
1496
-											$foundalternativestripeaccount = $tmparray[0];    // Store the customer id
1496
+											$foundalternativestripeaccount = $tmparray[0]; // Store the customer id
1497 1497
 
1498 1498
 											dol_syslog("makeStripeSepaRequest We use now customer=".$foundalternativestripeaccount." publishable_key=".$stripearrayofkeys['publishable_key'], LOG_DEBUG);
1499 1499
 										}
1500 1500
 									}
1501 1501
 
1502
-									if (! $foundalternativestripeaccount) {
1502
+									if (!$foundalternativestripeaccount) {
1503 1503
 										$stripearrayofkeysbyenv = $savstripearrayofkeysbyenv;
1504 1504
 
1505 1505
 										$stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus];
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
 									dol_syslog("makeStripeSepaRequest No dedicated Stripe Account requested, so we use global one, so ".$stripearrayofkeys['publishable_key'], LOG_DEBUG);
1515 1515
 								}
1516 1516
 
1517
-								$stripeacc = $stripe->getStripeAccount($service, $this->socid);								// Get Stripe OAuth connect account if it exists (no network access here)
1517
+								$stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here)
1518 1518
 
1519 1519
 								if ($foundalternativestripeaccount) {
1520 1520
 									if (empty($stripeacc)) {				// If the Stripe connect account not set, we use common API usage
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 									}
1525 1525
 								} else {
1526 1526
 									$customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0);
1527
-									if (empty($customer) && ! empty($stripe->error)) {
1527
+									if (empty($customer) && !empty($stripe->error)) {
1528 1528
 										$this->error = $stripe->error;
1529 1529
 										$this->errors[] = $this->error;
1530 1530
 									}
@@ -1553,15 +1553,15 @@  discard block
 block discarded – undo
1553 1553
 										}
1554 1554
 
1555 1555
 										if ($stripecard) {  // Can be src_... (for sepa) or pm_... (new card mode). Note that card_... (old card mode) should not happen here.
1556
-											$FULLTAG = 'DID='.$did.'-INV=' . $this->id . '-CUS=' . $thirdparty->id;
1557
-											$description = 'Stripe payment from makeStripeSepaRequest: ' . $FULLTAG . ' did='.$did.' ref=' . $this->ref;
1556
+											$FULLTAG = 'DID='.$did.'-INV='.$this->id.'-CUS='.$thirdparty->id;
1557
+											$description = 'Stripe payment from makeStripeSepaRequest: '.$FULLTAG.' did='.$did.' ref='.$this->ref;
1558 1558
 
1559 1559
 											$stripefailurecode = '';
1560 1560
 											$stripefailuremessage = '';
1561 1561
 											$stripefailuredeclinecode = '';
1562 1562
 
1563 1563
 											// Using new SCA method
1564
-											dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG);
1564
+											dol_syslog("* Create payment on SEPA ".$stripecard->id.", amounttopay=".$amounttopay.", amountstripe=".$amountstripe.", FULLTAG=".$FULLTAG, LOG_DEBUG);
1565 1565
 
1566 1566
 											// Create payment intent and charge payment (confirmnow = true)
1567 1567
 											$paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $this, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1, 1, $did);
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
 												$charge->failure_message = $stripe->error;
1583 1583
 												$charge->failure_declinecode = $stripe->declinecode;
1584 1584
 												$stripefailurecode = $stripe->code;
1585
-												$stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL;
1585
+												$stripefailuremessage = 'Action required. Contact the support at '; // . $conf->global->SELLYOURSAAS_MAIN_EMAIL;
1586 1586
 												$stripefailuredeclinecode = $stripe->declinecode;
1587 1587
 											} else {
1588 1588
 												dol_syslog(var_export($paymentintent, true), LOG_DEBUG);
@@ -1603,7 +1603,7 @@  discard block
 block discarded – undo
1603 1603
 
1604 1604
 											// Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
1605 1605
 											if (empty($charge) || $charge->status == 'failed') {
1606
-												dol_syslog('Failed to charge payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING);
1606
+												dol_syslog('Failed to charge payment mode '.$stripecard->id.' stripefailurecode='.$stripefailurecode.' stripefailuremessage='.$stripefailuremessage.' stripefailuredeclinecode='.$stripefailuredeclinecode, LOG_WARNING);
1607 1607
 
1608 1608
 												// Save a stripe payment was in error
1609 1609
 												$this->stripechargeerror++;
@@ -1616,8 +1616,8 @@  discard block
 block discarded – undo
1616 1616
 														$errauthenticationmessage = $langs->trans("ErrSCAAuthentication");
1617 1617
 														$errmsg = $errauthenticationmessage;
1618 1618
 													} elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) {
1619
-														$errmsg .= ': ' . $charge->failure_code;
1620
-														$errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message;
1619
+														$errmsg .= ': '.$charge->failure_code;
1620
+														$errmsg .= ($charge->failure_message ? ' - ' : '').' '.$charge->failure_message;
1621 1621
 														if (empty($stripefailurecode)) {
1622 1622
 															$stripefailurecode = $charge->failure_code;
1623 1623
 														}
@@ -1625,8 +1625,8 @@  discard block
 block discarded – undo
1625 1625
 															$stripefailuremessage = $charge->failure_message;
1626 1626
 														}
1627 1627
 													} else {
1628
-														$errmsg .= ': failure_code=' . $charge->failure_code;
1629
-														$errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message;
1628
+														$errmsg .= ': failure_code='.$charge->failure_code;
1629
+														$errmsg .= ($charge->failure_message ? ' - ' : '').' failure_message='.$charge->failure_message;
1630 1630
 														if (empty($stripefailurecode)) {
1631 1631
 															$stripefailurecode = $charge->failure_code;
1632 1632
 														}
@@ -1635,26 +1635,26 @@  discard block
 block discarded – undo
1635 1635
 														}
1636 1636
 													}
1637 1637
 												} else {
1638
-													$errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage;
1639
-													$errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : '');
1638
+													$errmsg .= ': '.$stripefailurecode.' - '.$stripefailuremessage;
1639
+													$errmsg .= ($stripefailuredeclinecode ? ' - '.$stripefailuredeclinecode : '');
1640 1640
 												}
1641 1641
 
1642
-												$description = 'Stripe payment ERROR from makeStripeSepaRequest: ' . $FULLTAG;
1643
-												$postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')';
1642
+												$description = 'Stripe payment ERROR from makeStripeSepaRequest: '.$FULLTAG;
1643
+												$postactionmessages[] = $errmsg.' ('.$stripearrayofkeys['publishable_key'].')';
1644 1644
 
1645 1645
 												$this->error = $errmsg;
1646 1646
 												$this->errors[] = $this->error;
1647 1647
 											} else {
1648 1648
 												dol_syslog('Successfuly request '.$type.' '.$stripecard->id);
1649 1649
 
1650
-												$postactionmessages[] = 'Success to request '.$type.' (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')';
1650
+												$postactionmessages[] = 'Success to request '.$type.' ('.$charge->id.' with '.$stripearrayofkeys['publishable_key'].')';
1651 1651
 
1652 1652
 												// Save a stripe payment was done in real life so later we will be able to force a commit on recorded payments
1653 1653
 												// even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit.
1654 1654
 												$this->stripechargedone++;
1655 1655
 
1656 1656
 												// Default description used for label of event. Will be overwrite by another value later.
1657
-												$description = 'Stripe payment request OK (' . $charge->id . ') from makeStripeSepaRequest: ' . $FULLTAG;
1657
+												$description = 'Stripe payment request OK ('.$charge->id.') from makeStripeSepaRequest: '.$FULLTAG;
1658 1658
 											}
1659 1659
 
1660 1660
 											$object = $this;
@@ -1663,8 +1663,8 @@  discard block
 block discarded – undo
1663 1663
 											if (empty($charge) || $charge->status == 'failed') {
1664 1664
 												$actioncode = 'PAYMENT_STRIPE_KO';
1665 1665
 												$extraparams = $stripefailurecode;
1666
-												$extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage;
1667
-												$extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode;
1666
+												$extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '').$stripefailuremessage;
1667
+												$extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '').$stripefailuredeclinecode;
1668 1668
 											} else {
1669 1669
 												$actioncode = 'PAYMENT_STRIPE_OK';
1670 1670
 												$extraparams = array();
@@ -1672,15 +1672,15 @@  discard block
 block discarded – undo
1672 1672
 										} else {
1673 1673
 											$error++;
1674 1674
 											$errorforinvoice++;
1675
-											dol_syslog("No ban payment method found for this stripe customer " . $customer->id, LOG_WARNING);
1675
+											dol_syslog("No ban payment method found for this stripe customer ".$customer->id, LOG_WARNING);
1676 1676
 
1677
-											$this->error = 'Failed to get direct debit payment method for stripe customer = ' . $customer->id;
1677
+											$this->error = 'Failed to get direct debit payment method for stripe customer = '.$customer->id;
1678 1678
 											$this->errors[] = $this->error;
1679 1679
 
1680 1680
 											$description = 'Failed to find or use the payment mode - no ban defined for the thirdparty account';
1681 1681
 											$stripefailurecode = 'BADPAYMENTMODE';
1682 1682
 											$stripefailuremessage = 'Failed to find or use the payment mode - no ban defined for the thirdparty account';
1683
-											$postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')';
1683
+											$postactionmessages[] = $description.' ('.$stripearrayofkeys['publishable_key'].')';
1684 1684
 
1685 1685
 											$object = $this;
1686 1686
 
@@ -1700,12 +1700,12 @@  discard block
 block discarded – undo
1700 1700
 									}
1701 1701
 								} else {	// Else of the   if ($resultthirdparty > 0 && ! empty($customer)) {
1702 1702
 									if ($resultthirdparty <= 0) {
1703
-										dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING);
1704
-										$this->error = 'Failed to load Stripe account for thirdparty_id = ' . $thirdparty->id;
1703
+										dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = '.$thirdparty->id, LOG_WARNING);
1704
+										$this->error = 'Failed to load Stripe account for thirdparty_id = '.$thirdparty->id;
1705 1705
 										$this->errors[] = $this->error;
1706 1706
 									} else { // $customer stripe not found
1707
-										dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING);
1708
-										$this->error = 'Failed to get Stripe account id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'];
1707
+										dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING);
1708
+										$this->error = 'Failed to get Stripe account id for thirdparty_id = '.$thirdparty->id." in mode ".$servicestatus." in Stripe env ".$stripearrayofkeysbyenv[$servicestatus]['publishable_key'];
1709 1709
 										$this->errors[] = $this->error;
1710 1710
 									}
1711 1711
 									$error++;
@@ -1723,24 +1723,24 @@  discard block
 block discarded – undo
1723 1723
 								}
1724 1724
 
1725 1725
 								if ($description) {
1726
-									dol_syslog("* Record event for credit transfer or direct debit request result - " . $description);
1726
+									dol_syslog("* Record event for credit transfer or direct debit request result - ".$description);
1727 1727
 									require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
1728 1728
 
1729 1729
 									// Insert record of payment (success or error)
1730 1730
 									$actioncomm = new ActionComm($this->db);
1731 1731
 
1732
-									$actioncomm->type_code = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
1733
-									$actioncomm->code = 'AC_' . $actioncode;
1732
+									$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
1733
+									$actioncomm->code = 'AC_'.$actioncode;
1734 1734
 									$actioncomm->label = $description;
1735 1735
 									$actioncomm->note_private = implode(",\n", $postactionmessages);
1736 1736
 									$actioncomm->fk_project = $this->fk_project;
1737 1737
 									$actioncomm->datep = $now;
1738 1738
 									$actioncomm->datef = $now;
1739
-									$actioncomm->percentage = -1;   // Not applicable
1739
+									$actioncomm->percentage = -1; // Not applicable
1740 1740
 									$actioncomm->socid = $thirdparty->id;
1741 1741
 									$actioncomm->contactid = 0;
1742
-									$actioncomm->authorid = $user->id;   // User saving action
1743
-									$actioncomm->userownerid = $user->id;	// Owner of action
1742
+									$actioncomm->authorid = $user->id; // User saving action
1743
+									$actioncomm->userownerid = $user->id; // Owner of action
1744 1744
 									// Fields when action is a real email (content is already into note)
1745 1745
 									/*$actioncomm->email_msgid = $object->email_msgid;
1746 1746
 									 $actioncomm->email_from  = $object->email_from;
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 									$actioncomm->fk_element = $this->id;
1754 1754
 									$actioncomm->elementid = $this->id;
1755 1755
 									$actioncomm->elementtype = $this->element;
1756
-									$actioncomm->extraparams = $extraparams;		// Can be null, empty string or array()
1756
+									$actioncomm->extraparams = $extraparams; // Can be null, empty string or array()
1757 1757
 
1758 1758
 									$actioncomm->create($user);
1759 1759
 								}
@@ -1763,15 +1763,15 @@  discard block
 block discarded – undo
1763 1763
 							} catch (Exception $e) {
1764 1764
 								$error++;
1765 1765
 								$errorforinvoice++;
1766
-								dol_syslog('Error ' . $e->getMessage(), LOG_ERR);
1767
-								$this->error = 'Error ' . $e->getMessage();
1766
+								dol_syslog('Error '.$e->getMessage(), LOG_ERR);
1767
+								$this->error = 'Error '.$e->getMessage();
1768 1768
 								$this->errors[] = $this->error;
1769 1769
 							}
1770 1770
 						} else {	// If remain to pay is null
1771 1771
 							$error++;
1772 1772
 							$errorforinvoice++;
1773
-							dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING);
1774
-							$this->error = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?";
1773
+							dol_syslog("Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?", LOG_WARNING);
1774
+							$this->error = "Remain to pay is null for the invoice ".$this->id." ".$this->ref.". Why is the invoice not classified 'Paid' ?";
1775 1775
 							$this->errors[] = $this->error;
1776 1776
 						}
1777 1777
 					}
@@ -1880,10 +1880,10 @@  discard block
 block discarded – undo
1880 1880
 
1881 1881
 		// Add the standard elements to the QR code
1882 1882
 		$lines = [
1883
-			'BCD',  // Service Tag (optional)
1884
-			'002',  // Version (optional)
1885
-			'1',	// Character set (optional)
1886
-			'SCT',  // Identification (optional)
1883
+			'BCD', // Service Tag (optional)
1884
+			'002', // Version (optional)
1885
+			'1', // Character set (optional)
1886
+			'SCT', // Identification (optional)
1887 1887
 		];
1888 1888
 
1889 1889
 		// Add the bank account information
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
 		}
1906 1906
 
1907 1907
 		// Add the amount and reference
1908
-		$lines[] = 'EUR' . $totalTTCString; // Amount (optional)
1908
+		$lines[] = 'EUR'.$totalTTCString; // Amount (optional)
1909 1909
 		$lines[] = ''; // Purpose (optional)
1910 1910
 		$lines[] = ''; // Payment reference (optional)
1911 1911
 		$lines[] = $this->ref; // Remittance Information (optional)
@@ -1963,10 +1963,10 @@  discard block
 block discarded – undo
1963 1963
 		$s .= pack('C1', 3).pack('C1', strlen($datestring)).$datestring;
1964 1964
 		$s .= pack('C1', 4).pack('C1', strlen($pricewithtaxstring)).$pricewithtaxstring;
1965 1965
 		$s .= pack('C1', 5).pack('C1', strlen($pricetaxstring)).$pricetaxstring;
1966
-		$s .= '';					// Hash of xml invoice
1967
-		$s .= '';					// ecda signature
1968
-		$s .= '';					// ecda public key
1969
-		$s .= '';					// ecda signature of public key stamp
1966
+		$s .= ''; // Hash of xml invoice
1967
+		$s .= ''; // ecda signature
1968
+		$s .= ''; // ecda public key
1969
+		$s .= ''; // ecda signature of public key stamp
1970 1970
 
1971 1971
 		$s = base64_encode($s);
1972 1972
 
@@ -2034,8 +2034,8 @@  discard block
 block discarded – undo
2034 2034
 			$s .= "S\n";
2035 2035
 			$s .= dol_trunc($bankaccount->owner_name, 70, 'right', 'UTF-8', 1)."\n";
2036 2036
 			$addresslinearray = explode("\n", $bankaccount->owner_address);
2037
-			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n";		// address line 1
2038
-			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n";		// address line 2
2037
+			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
2038
+			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
2039 2039
 			/*$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
2040 2040
 			$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
2041 2041
 			$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/
@@ -2043,8 +2043,8 @@  discard block
 block discarded – undo
2043 2043
 			$s .= "S\n";
2044 2044
 			$s .= dol_trunc((string) $mysoc->name, 70, 'right', 'UTF-8', 1)."\n";
2045 2045
 			$addresslinearray = explode("\n", $mysoc->address);
2046
-			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n";		// address line 1
2047
-			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n";		// address line 2
2046
+			$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
2047
+			$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
2048 2048
 			$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
2049 2049
 			$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
2050 2050
 			$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";
@@ -2064,14 +2064,14 @@  discard block
 block discarded – undo
2064 2064
 		$s .= "S\n";
2065 2065
 		$s .= dol_trunc((string) $this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n";
2066 2066
 		$addresslinearray = explode("\n", $this->thirdparty->address);
2067
-		$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n";		// address line 1
2068
-		$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n";		// address line 2
2067
+		$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
2068
+		$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
2069 2069
 		$s .= dol_trunc($this->thirdparty->zip, 16, 'right', 'UTF-8', 1)."\n";
2070 2070
 		$s .= dol_trunc($this->thirdparty->town, 35, 'right', 'UTF-8', 1)."\n";
2071 2071
 		$s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n";
2072 2072
 		// ID of payment
2073
-		$s .= "NON\n";			// NON or QRR
2074
-		$s .= "\n";				// QR Code reference if previous field is QRR
2073
+		$s .= "NON\n"; // NON or QRR
2074
+		$s .= "\n"; // QR Code reference if previous field is QRR
2075 2075
 		// Free text
2076 2076
 		if ($complementaryinfo) {
2077 2077
 			$s .= $complementaryinfo."\n";
Please login to merge, or discard this patch.
htdocs/fourn/commande/list.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 $search_date_order_endday = GETPOSTINT('search_date_order_endday');
79 79
 $search_date_order_endmonth = GETPOSTINT('search_date_order_endmonth');
80 80
 $search_date_order_endyear = GETPOSTINT('search_date_order_endyear');
81
-$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear);	// Use tzserver
81
+$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver
82 82
 $search_date_order_end = dol_mktime(23, 59, 59, $search_date_order_endmonth, $search_date_order_endday, $search_date_order_endyear);
83 83
 
84 84
 $search_date_delivery_startday = GETPOSTINT('search_date_delivery_startday');
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 $search_date_delivery_endday = GETPOSTINT('search_date_delivery_endday');
88 88
 $search_date_delivery_endmonth = GETPOSTINT('search_date_delivery_endmonth');
89 89
 $search_date_delivery_endyear = GETPOSTINT('search_date_delivery_endyear');
90
-$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);	// Use tzserver
90
+$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver
91 91
 $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
92 92
 
93 93
 $search_date_valid_startday = GETPOSTINT('search_date_valid_startday');
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 $search_date_valid_endday = GETPOSTINT('search_date_valid_endday');
97 97
 $search_date_valid_endmonth = GETPOSTINT('search_date_valid_endmonth');
98 98
 $search_date_valid_endyear = GETPOSTINT('search_date_valid_endyear');
99
-$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear);	// Use tzserver
99
+$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver
100 100
 $search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear);
101 101
 
102 102
 $search_date_approve_startday = GETPOSTINT('search_date_approve_startday');
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 $search_date_approve_endday = GETPOSTINT('search_date_approve_endday');
106 106
 $search_date_approve_endmonth = GETPOSTINT('search_date_approve_endmonth');
107 107
 $search_date_approve_endyear = GETPOSTINT('search_date_approve_endyear');
108
-$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear);	// Use tzserver
108
+$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver
109 109
 $search_date_approve_end = dol_mktime(23, 59, 59, $search_date_approve_endmonth, $search_date_approve_endday, $search_date_approve_endyear);
110 110
 
111 111
 $search_all = trim(GETPOST('search_all', 'alphanohtml'));
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 
453 453
 			if ($objecttmp->id > 0) {
454 454
 				if (empty($objecttmp->note_public)) {
455
-					$objecttmp->note_public =  $langs->transnoentities("Orders");
455
+					$objecttmp->note_public = $langs->transnoentities("Orders");
456 456
 				}
457 457
 
458 458
 				$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
@@ -774,8 +774,8 @@  discard block
 block discarded – undo
774 774
 		} else {
775 775
 			$db->rollback();
776 776
 			$action = 'create';
777
-			$_GET["origin"] = $_POST["origin"];		// Keep this ?
778
-			$_GET["originid"] = $_POST["originid"];	// Keep this ?
777
+			$_GET["origin"] = $_POST["origin"]; // Keep this ?
778
+			$_GET["originid"] = $_POST["originid"]; // Keep this ?
779 779
 			setEventMessages("Error", null, 'errors');
780 780
 			$error++;
781 781
 		}
@@ -942,9 +942,9 @@  discard block
 block discarded – undo
942 942
 if ($search_user > 0) {
943 943
 	$sql .= " AND EXISTS (";
944 944
 	$sql .= " SELECT ec.rowid ";
945
-	$sql .= " FROM " . MAIN_DB_PREFIX . "element_contact as ec";
946
-	$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc ON tc.rowid = ec.fk_c_type_contact";
947
-	$sql .= " WHERE ec.element_id = cf.rowid AND ec.fk_socpeople = " . ((int) $search_user);
945
+	$sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec";
946
+	$sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc ON tc.rowid = ec.fk_c_type_contact";
947
+	$sql .= " WHERE ec.element_id = cf.rowid AND ec.fk_socpeople = ".((int) $search_user);
948 948
 	$sql .= " AND tc.element = 'order_supplier' AND tc.source = 'internal'";
949 949
 	$sql .= ")";
950 950
 }
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 			if ($searchCategoryProductOperator == 0) {
997 997
 				$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
998 998
 			} else {
999
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
999
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct);
1000 1000
 			}
1001 1001
 		}
1002 1002
 	}
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 
1280 1280
 	$topicmail = "SendOrderRef";
1281 1281
 	$modelmail = "order_supplier_send";
1282
-	$objecttmp = new CommandeFournisseur($db);	// in case $object is not the good object
1282
+	$objecttmp = new CommandeFournisseur($db); // in case $object is not the good object
1283 1283
 	$trackid = 'sord'.$object->id;
1284 1284
 	include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
1285 1285
 
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 	}
1362 1362
 	// alert on late date
1363 1363
 	$moreforfilter .= '<div class="divsearchfield">';
1364
-	$moreforfilter .= $langs->trans('Alert').' <input type="checkbox" name="search_option" value="'.(($search_status == '3,4') ? 'recv_late' : 'late').'"'.((array_search($search_option, array('late','recv_late')) !== false) ? ' checked' : '').'>';
1364
+	$moreforfilter .= $langs->trans('Alert').' <input type="checkbox" name="search_option" value="'.(($search_status == '3,4') ? 'recv_late' : 'late').'"'.((array_search($search_option, array('late', 'recv_late')) !== false) ? ' checked' : '').'>';
1365 1365
 	$moreforfilter .= '</div>';
1366 1366
 	$parameters = array();
1367 1367
 	$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
Please login to merge, or discard this patch.
htdocs/public/payment/paymentko.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 if (empty($doactionsthenredirect)) {
265 265
 	$head = '';
266 266
 	if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) {
267
-		$head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
267
+		$head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
268 268
 	}
269 269
 
270 270
 	$conf->dol_hide_topmenu = 1;
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 	}
315 315
 	if (getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT')) {
316 316
 		print '<div class="backimagepublicpayment">';
317
-		print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="' . getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">';
317
+		print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="'.getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">';
318 318
 		print '</div>';
319 319
 	}
320 320
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 	// Redirect to an error page
360 360
 	// Paymentko page must be created for the specific website
361 361
 	if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) {
362
-		$ext_urlko = $ws_virtuelhost . '/paymentko.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG;
362
+		$ext_urlko = $ws_virtuelhost.'/paymentko.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG;
363 363
 	} else {
364 364
 		$ext_urlko = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG;
365 365
 	}
Please login to merge, or discard this patch.
htdocs/public/payment/paymentok.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
 $paramcreditor = 'ONLINE_PAYMENT_CREDITOR';
151 151
 $paramcreditorlong = 'ONLINE_PAYMENT_CREDITOR_'.$suffix;
152 152
 if (getDolGlobalString($paramcreditorlong)) {
153
-	$creditor = getDolGlobalString($paramcreditorlong);	// use label long of the seller to show
153
+	$creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show
154 154
 } elseif (getDolGlobalString($paramcreditor)) {
155
-	$creditor = getDolGlobalString($paramcreditor);		// use label short of the seller to show
155
+	$creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show
156 156
 }
157 157
 
158 158
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
 $head = '';
212 212
 if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) {
213
-	$head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
213
+	$head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('ONLINE_PAYMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n";
214 214
 }
215 215
 
216 216
 $conf->dol_hide_topmenu = 1;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	}
271 271
 	if (getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT')) {
272 272
 		print '<div class="backimagepublicpayment">';
273
-		print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="' . getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">';
273
+		print '<img id="idMAIN_IMAGE_PUBLIC_PAYMENT" src="'.getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT').'">';
274 274
 		print '</div>';
275 275
 	}
276 276
 
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
 		// Get on url call
289 289
 		$onlinetoken        = $PAYPALTOKEN;
290 290
 		$fulltag            = $FULLTAG;
291
-		$payerID 			= !empty($PAYPALPAYERID) ? $PAYPALPAYERID : '';
291
+		$payerID = !empty($PAYPALPAYERID) ? $PAYPALPAYERID : '';
292 292
 		// Set by newpayment.php
293 293
 		$ipaddress          = $_SESSION['ipaddress'];
294 294
 		$currencyCodeType   = $_SESSION['currencyCodeType'];
295 295
 		$FinalPaymentAmt    = $_SESSION["FinalPaymentAmt"];
296
-		$paymentType        = $_SESSION['PaymentType'];			// Value can be 'Mark', 'Sole', 'Sale' for example
296
+		$paymentType        = $_SESSION['PaymentType']; // Value can be 'Mark', 'Sole', 'Sale' for example
297 297
 
298 298
 		dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment');
299 299
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 }
408 408
 
409 409
 if (empty($TRANSACTIONID)) {
410
-	$TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' : $_SESSION['TRANSACTIONID'];	// pi_... or ch_...
410
+	$TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' : $_SESSION['TRANSACTIONID']; // pi_... or ch_...
411 411
 	if (empty($TRANSACTIONID) && GETPOST('payment_intent', 'alphanohtml')) {
412 412
 		// For the case we use STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 2
413 413
 		$TRANSACTIONID = GETPOST('payment_intent', 'alphanohtml');
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 				if (empty($adht->caneditamount)) {	// If we didn't allow members to choose their membership amount (if the amount is allowed in edit mode, no need to check)
503 503
 					if ($object->status == $object::STATUS_DRAFT) {		// If the member is not yet validated, we check that the amount is the same as expected.
504 504
 						$typeid = $object->typeid;
505
-						$amountbytype = $adht->amountByType(1);		// Load the array of amount per type
505
+						$amountbytype = $adht->amountByType(1); // Load the array of amount per type
506 506
 
507 507
 						// Set amount for the subscription:
508 508
 						// - First check the amount of the member type.
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 				if (getDolGlobalInt('MEMBER_MIN_AMOUNT')) {
533 533
 					if ($FinalPaymentAmt < getDolGlobalInt('MEMBER_MIN_AMOUNT')) {
534 534
 						$error++;
535
-						$errmsg = 'Value of FinalPayment ('.$FinalPaymentAmt.') is lower than the minimum allowed (' . getDolGlobalString('MEMBER_MIN_AMOUNT').'). May be a hack to try to pay a different amount ?';
535
+						$errmsg = 'Value of FinalPayment ('.$FinalPaymentAmt.') is lower than the minimum allowed ('.getDolGlobalString('MEMBER_MIN_AMOUNT').'). May be a hack to try to pay a different amount ?';
536 536
 						$postactionmessages[] = $errmsg;
537 537
 						$ispostactionok = -1;
538 538
 						dol_syslog("Failed to validate member (amount propagated from payment page is lower than allowed minimum): ".$errmsg, LOG_ERR, 0, '_payment');
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 					dol_syslog("Failed to validate member (bad currency check): ".$errmsg, LOG_ERR, 0, '_payment');
549 549
 				}
550 550
 
551
-				if (! $error) {
551
+				if (!$error) {
552 552
 					// We validate the member (no effect if it is already validated)
553 553
 					$result = ($object->status == $object::STATUS_EXCLUDED) ? -1 : $object->validate($user); // if membre is excluded (status == -2) the new validation is not possible
554 554
 					if ($result < 0 || empty($object->datevalid)) {
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
 						$thirdparty = new Societe($db);
719 719
 						$thirdparty->fetch($thirdparty_id);
720 720
 
721
-						include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';	// This also set $stripearrayofkeysbyenv
721
+						include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; // This also set $stripearrayofkeysbyenv
722 722
 						$stripe = new Stripe($db);
723 723
 						//$stripeacc = $stripe->getStripeAccount($service);		Already defined previously
724 724
 
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 
734 734
 								if (preg_match('/^pi_/', $TRANSACTIONID)) {
735 735
 									// This may throw an error if not found.
736
-									$chpi = \Stripe\PaymentIntent::retrieve($TRANSACTIONID);	// payment_intent (pi_...)
736
+									$chpi = \Stripe\PaymentIntent::retrieve($TRANSACTIONID); // payment_intent (pi_...)
737 737
 								} else {
738 738
 									// This throw an error if not found
739 739
 									$chpi = \Stripe\Charge::retrieve($TRANSACTIONID); // old method, contains the charge id (ch_...)
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 				// Create external user
793 793
 				if (getDolGlobalString('ADHERENT_CREATE_EXTERNAL_USER_LOGIN')) {
794 794
 					$nuser = new User($db);
795
-					$tmpuser = dol_clone($object, 0);		// $object is type Adherent
795
+					$tmpuser = dol_clone($object, 0); // $object is type Adherent
796 796
 
797 797
 					// Check if a user login already exists for this member or not
798 798
 					$found = 0;
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
 				$paiement->paiementid   = $paymentTypeId;
958 958
 				$paiement->num_payment = '';
959 959
 				$paiement->note_public  = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
960
-				$paiement->ext_payment_id = $TRANSACTIONID;		// TODO LDR May be we should store py_... instead of pi_... but we started with pi_... so we continue.
960
+				$paiement->ext_payment_id = $TRANSACTIONID; // TODO LDR May be we should store py_... instead of pi_... but we started with pi_... so we continue.
961 961
 				//$paiement->ext_payment_id = $TRANSACTIONID.':'.$customer->id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key'];	// TODO LDR It would be better if we could store this. Do we have customer->id and publishable_key ?
962 962
 				$paiement->ext_payment_site = $service;
963 963
 
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
 			$ispostactionok = -1;
1030 1030
 		}
1031 1031
 	} elseif (array_key_exists('ORD', $tmptag) && $tmptag['ORD'] > 0) {
1032
-		include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
1032
+		include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
1033 1033
 		$object = new Commande($db);
1034 1034
 		$result = $object->fetch((int) $tmptag['ORD']);
1035 1035
 		if ($result) {
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
 			// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
1069 1069
 			if (isModEnabled('invoice')) {
1070 1070
 				if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
1071
-					include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1071
+					include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1072 1072
 					$invoice = new Facture($db);
1073 1073
 					$result = $invoice->createFromOrder($object, $user);
1074 1074
 					if ($result > 0) {
@@ -1080,12 +1080,12 @@  discard block
 block discarded – undo
1080 1080
 							// TODO Send a warning email.
1081 1081
 						}
1082 1082
 
1083
-						$object->classifyBilled($user);		// The invoice has been create from the order so total is the same, so we can classify order to billed (even if payment may be partial).
1083
+						$object->classifyBilled($user); // The invoice has been create from the order so total is the same, so we can classify order to billed (even if payment may be partial).
1084 1084
 
1085
-						$invoice->validate($user);			// This may re-classify all linked orders to billed (done previously) if amount of invoice is ok by triggers, depending on the workflow module setup.
1085
+						$invoice->validate($user); // This may re-classify all linked orders to billed (done previously) if amount of invoice is ok by triggers, depending on the workflow module setup.
1086 1086
 
1087 1087
 						// Creation of payment line (warning: if amount has been modified on page, the payment may be partial)
1088
-						include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
1088
+						include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
1089 1089
 						$paiement = new Paiement($db);
1090 1090
 						$paiement->datepaye = $now;
1091 1091
 						if ($currencyCodeType == $conf->currency) {
@@ -1099,14 +1099,14 @@  discard block
 block discarded – undo
1099 1099
 						}
1100 1100
 						$paiement->paiementid = $paymentTypeId;
1101 1101
 						$paiement->num_payment = '';
1102
-						$paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress;
1103
-						$paiement->ext_payment_id = $TRANSACTIONID;		// pi_... for Stripe, ...
1104
-						$paiement->ext_payment_site = $service;			// 'StripeLive' or 'Stripe', or ...
1102
+						$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
1103
+						$paiement->ext_payment_id = $TRANSACTIONID; // pi_... for Stripe, ...
1104
+						$paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ...
1105 1105
 
1106 1106
 						if (!$error) {
1107 1107
 							$paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents
1108 1108
 							if ($paiement_id < 0) {
1109
-								$postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors);
1109
+								$postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors);
1110 1110
 								$ispostactionok = -1;
1111 1111
 								$error++;
1112 1112
 							} else {
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
 								}
1144 1144
 								$result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
1145 1145
 								if ($result < 0) {
1146
-									$postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors);
1146
+									$postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors);
1147 1147
 									$ispostactionok = -1;
1148 1148
 									$error++;
1149 1149
 								} else {
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 									$ispostactionok = 1;
1152 1152
 								}
1153 1153
 							} else {
1154
-								$postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.';
1154
+								$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
1155 1155
 								$ispostactionok = -1;
1156 1156
 								$error++;
1157 1157
 							}
@@ -1163,11 +1163,11 @@  discard block
 block discarded – undo
1163 1163
 							$db->rollback();
1164 1164
 						}
1165 1165
 					} else {
1166
-						$postactionmessages[] = 'Failed to create invoice form order ' . $tmptag['ORD'] . '.';
1166
+						$postactionmessages[] = 'Failed to create invoice form order '.$tmptag['ORD'].'.';
1167 1167
 						$ispostactionok = -1;
1168 1168
 					}
1169 1169
 				} else {
1170
-					$postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type id" (' . $paymentTypeId . ') to record the payment of order ' . $tmptag['ORD'] . '. May be payment was already recorded.';
1170
+					$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type id" ('.$paymentTypeId.') to record the payment of order '.$tmptag['ORD'].'. May be payment was already recorded.';
1171 1171
 					$ispostactionok = -1;
1172 1172
 				}
1173 1173
 			} else {
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 				$ispostactionok = -1;
1176 1176
 			}
1177 1177
 		} else {
1178
-			$postactionmessages[] = 'Order paid ' . $tmptag['ORD'] . ' was not found';
1178
+			$postactionmessages[] = 'Order paid '.$tmptag['ORD'].' was not found';
1179 1179
 			$ispostactionok = -1;
1180 1180
 		}
1181 1181
 	} elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) {
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
 				$paiement->datep = $now;
1233 1233
 				$paiement->paymenttype = $paymentTypeId;
1234 1234
 				$paiement->num_payment = '';
1235
-				$paiement->note_public  = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
1235
+				$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
1236 1236
 				$paiement->ext_payment_id = $TRANSACTIONID;
1237 1237
 				$paiement->ext_payment_site = $service;
1238 1238
 
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 		require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
1314 1314
 		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1315 1315
 		$object = new Facture($db);
1316
-		$result = $object->fetch((int) $ref);  // @phan-suppress-curren-line PhanPluginSuspiciousParamPosition
1316
+		$result = $object->fetch((int) $ref); // @phan-suppress-curren-line PhanPluginSuspiciousParamPosition
1317 1317
 		if ($result) {
1318 1318
 			$paymentTypeId = 0;
1319 1319
 			if ($paymentmethod == 'paybox') {
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
 						$db->rollback();
1450 1450
 					}
1451 1451
 
1452
-					if (! $error) {
1452
+					if (!$error) {
1453 1453
 						// Sending mail
1454 1454
 						$thirdparty = new Societe($db);
1455 1455
 						$resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc);
@@ -1467,7 +1467,7 @@  discard block
 block discarded – undo
1467 1467
 							// Get email content from template
1468 1468
 							$arraydefaultmessage = null;
1469 1469
 
1470
-							$idoftemplatetouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT');	// Email to send for Event organization registration
1470
+							$idoftemplatetouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'); // Email to send for Event organization registration
1471 1471
 
1472 1472
 							if (!empty($idoftemplatetouse)) {
1473 1473
 								$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $idoftemplatetouse, 1, '');
@@ -1544,7 +1544,7 @@  discard block
 block discarded – undo
1544 1544
 		require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
1545 1545
 		include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1546 1546
 		$object = new Facture($db);
1547
-		$result = $object->fetch((int) $ref);  // @phan-suppress-current-line PhanPluginSuspiciousParamPosition
1547
+		$result = $object->fetch((int) $ref); // @phan-suppress-current-line PhanPluginSuspiciousParamPosition
1548 1548
 		if ($result) {
1549 1549
 			$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
1550 1550
 
@@ -1672,7 +1672,7 @@  discard block
 block discarded – undo
1672 1672
 							if ($resultboothupdate < 0) {
1673 1673
 								// Finding the third party by getting the invoice
1674 1674
 								$invoice = new Facture($db);
1675
-								$resultinvoice = $invoice->fetch((int) $ref);  // @phan-suppress-current-line PhanPluginSuspiciousParamPosition
1675
+								$resultinvoice = $invoice->fetch((int) $ref); // @phan-suppress-current-line PhanPluginSuspiciousParamPosition
1676 1676
 								if ($resultinvoice < 0) {
1677 1677
 									$postactionmessages[] = 'Could not find the associated invoice.';
1678 1678
 									$ispostactionok = -1;
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
 										// Get email content from template
1697 1697
 										$arraydefaultmessage = null;
1698 1698
 
1699
-										$idoftemplatetouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH');	// Email sent after registration for a Booth
1699
+										$idoftemplatetouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'); // Email sent after registration for a Booth
1700 1700
 
1701 1701
 										if (!empty($idoftemplatetouse)) {
1702 1702
 											$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $idoftemplatetouse, 1, '');
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 			$ispostactionok = -1;
1753 1753
 		}
1754 1754
 	} elseif (array_key_exists('CON', $tmptag) && $tmptag['CON'] > 0) {
1755
-		include_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
1755
+		include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
1756 1756
 		$object = new Contrat($db);
1757 1757
 		$result = $object->fetch((int) $tmptag['CON']);
1758 1758
 		if ($result) {
@@ -1790,14 +1790,14 @@  discard block
 block discarded – undo
1790 1790
 			// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
1791 1791
 			if (isModEnabled('invoice')) {
1792 1792
 				if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
1793
-					include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1793
+					include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1794 1794
 					$invoice = new Facture($db);
1795 1795
 					$result = $invoice->createFromContract($object, $user, array((int) $contract_lines));
1796 1796
 					if ($result > 0) {
1797 1797
 						// $object->classifyBilled($user);
1798 1798
 						$invoice->validate($user);
1799 1799
 						// Creation of payment line
1800
-						include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
1800
+						include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
1801 1801
 						$paiement = new Paiement($db);
1802 1802
 						$paiement->datepaye = $now;
1803 1803
 						if ($currencyCodeType == $conf->currency) {
@@ -1811,14 +1811,14 @@  discard block
 block discarded – undo
1811 1811
 						}
1812 1812
 						$paiement->paiementid = $paymentTypeId;
1813 1813
 						$paiement->num_payment = '';
1814
-						$paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress;
1815
-						$paiement->ext_payment_id = $TRANSACTIONID;		// pi_... for Stripe, ...
1816
-						$paiement->ext_payment_site = $service;			// 'StripeLive' or 'Stripe', or ...
1814
+						$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
1815
+						$paiement->ext_payment_id = $TRANSACTIONID; // pi_... for Stripe, ...
1816
+						$paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ...
1817 1817
 
1818 1818
 						if (!$error) {
1819 1819
 							$paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents
1820 1820
 							if ($paiement_id < 0) {
1821
-								$postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors);
1821
+								$postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors);
1822 1822
 								$ispostactionok = -1;
1823 1823
 								$error++;
1824 1824
 							} else {
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
 								}
1856 1856
 								$result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
1857 1857
 								if ($result < 0) {
1858
-									$postactionmessages[] = $paiement->error . ' ' . implode("<br>\n", $paiement->errors);
1858
+									$postactionmessages[] = $paiement->error.' '.implode("<br>\n", $paiement->errors);
1859 1859
 									$ispostactionok = -1;
1860 1860
 									$error++;
1861 1861
 								} else {
@@ -1863,7 +1863,7 @@  discard block
 block discarded – undo
1863 1863
 									$ispostactionok = 1;
1864 1864
 								}
1865 1865
 							} else {
1866
-								$postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.';
1866
+								$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
1867 1867
 								$ispostactionok = -1;
1868 1868
 								$error++;
1869 1869
 							}
@@ -1875,15 +1875,15 @@  discard block
 block discarded – undo
1875 1875
 							$db->rollback();
1876 1876
 						}
1877 1877
 					} else {
1878
-						$msg = 'Failed to create invoice form contract ' . $tmptag['CON'];
1878
+						$msg = 'Failed to create invoice form contract '.$tmptag['CON'];
1879 1879
 						if (!empty($tmptag['COL'])) {
1880
-							$msg .= ' and col '. $tmptag['COL'] .'.';
1880
+							$msg .= ' and col '.$tmptag['COL'].'.';
1881 1881
 						}
1882 1882
 						$postactionmessages[] = $msg;
1883 1883
 						$ispostactionok = -1;
1884 1884
 					}
1885 1885
 				} else {
1886
-					$postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type id" (' . $paymentTypeId . ') to record the payment of contract ' . $tmptag['CON'] .'. Maybe payment was already recorded.';
1886
+					$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type id" ('.$paymentTypeId.') to record the payment of contract '.$tmptag['CON'].'. Maybe payment was already recorded.';
1887 1887
 					$ispostactionok = -1;
1888 1888
 				}
1889 1889
 			} else {
@@ -1891,9 +1891,9 @@  discard block
 block discarded – undo
1891 1891
 				$ispostactionok = -1;
1892 1892
 			}
1893 1893
 		} else {
1894
-			$msg = 'Contract paid ' . $tmptag['CON'] . ' was not found';
1894
+			$msg = 'Contract paid '.$tmptag['CON'].' was not found';
1895 1895
 			if (!empty($tmptag['COL'])) {
1896
-				$msg .= ' for col '.$tmptag['COL'] .'.';
1896
+				$msg .= ' for col '.$tmptag['COL'].'.';
1897 1897
 			}
1898 1898
 			$postactionmessages[] = $msg;
1899 1899
 			$ispostactionok = -1;
@@ -1912,7 +1912,7 @@  discard block
 block discarded – undo
1912 1912
 	// Set by newpayment.php
1913 1913
 	$currencyCodeType   = empty($_SESSION['currencyCodeType']) ? '' : $_SESSION['currencyCodeType'];
1914 1914
 	$FinalPaymentAmt    = empty($_SESSION["FinalPaymentAmt"]) ? '' : $_SESSION["FinalPaymentAmt"];
1915
-	$paymentType        = empty($_SESSION['PaymentType']) ? '' : $_SESSION['PaymentType'];	// Seems used by paypal only
1915
+	$paymentType        = empty($_SESSION['PaymentType']) ? '' : $_SESSION['PaymentType']; // Seems used by paypal only
1916 1916
 
1917 1917
 	if (is_object($object) && method_exists($object, 'call_trigger')) {
1918 1918
 		'@phan-var-force CommonObject $object';
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
 		// Redirect to a success page
2167 2167
 		// Paymentok page must be created for the specific website
2168 2168
 		if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) {
2169
-			$ext_urlok = $ws_virtuelhost . '/paymentok.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG;
2169
+			$ext_urlok = $ws_virtuelhost.'/paymentok.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG;
2170 2170
 		} else {
2171 2171
 			$ext_urlok = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentok&fulltag='.$FULLTAG;
2172 2172
 		}
@@ -2186,7 +2186,7 @@  discard block
 block discarded – undo
2186 2186
 		// Redirect to an error page
2187 2187
 		// Paymentko page must be created for the specific website
2188 2188
 		if (!defined('USEDOLIBARRSERVER') && !empty($ws_virtuelhost)) {
2189
-			$ext_urlko = $ws_virtuelhost . '/paymentko.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG;
2189
+			$ext_urlko = $ws_virtuelhost.'/paymentko.php?paymentsessionkey='.urlencode($randomseckey).'&fulltag='.$FULLTAG;
2190 2190
 		} else {
2191 2191
 			$ext_urlko = DOL_URL_ROOT.'/public/website/index.php?paymentsessionkey='.urlencode($randomseckey).'&website='.urlencode($ws).'&pageref=paymentko&fulltag='.$FULLTAG;
2192 2192
 		}
Please login to merge, or discard this patch.