Completed
Branch develop (6fc0a8)
by
unknown
16:53
created
htdocs/expensereport/card.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 if (!empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH)) {
74 74
 	if (empty($date_start)) {
75
-		$date_start = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'),  1, (int) dol_print_date(dol_now(), '%Y'));
75
+		$date_start = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), 1, (int) dol_print_date(dol_now(), '%Y'));
76 76
 	}
77 77
 
78 78
 	if (empty($date_end)) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 }
151 151
 $result = restrictedArea($user, 'expensereport', $object->id, 'expensereport');
152 152
 
153
-$permissiontoadd = $user->rights->expensereport->creer;	// Used by the include of actions_dellink.inc.php
153
+$permissiontoadd = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php
154 154
 
155 155
 
156 156
 /*
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
 			if ($overlappingExpenseReportID > 0) {
302 302
 				$error++;
303
-				setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'. $langs->trans('ShowTrip').'</a>', null, 'errors');
303
+				setEventMessages($langs->trans("ErrorDoubleDeclaration").' <a href="'.$_SERVER['PHP_SELF'].'?id='.$overlappingExpenseReportID.'">'.$langs->trans('ShowTrip').'</a>', null, 'errors');
304 304
 				$action = 'create';
305 305
 			}
306 306
 		}
@@ -2310,7 +2310,7 @@  discard block
 block discarded – undo
2310 2310
 							}
2311 2311
 						}
2312 2312
 
2313
-						$tredited = 'tredited';	// Case the addfile and linkto file is used for edit (used by following tpl)
2313
+						$tredited = 'tredited'; // Case the addfile and linkto file is used for edit (used by following tpl)
2314 2314
 						include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
2315 2315
 						include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
2316 2316
 
@@ -2365,7 +2365,7 @@  discard block
 block discarded – undo
2365 2365
 
2366 2366
 						// Quantity
2367 2367
 						print '<td class="right">';
2368
-						print '<input type="text" min="0" class="input_qty right maxwidth50"  name="qty" value="'.dol_escape_htmltag($line->qty).'" />';  // We must be able to enter decimal qty
2368
+						print '<input type="text" min="0" class="input_qty right maxwidth50"  name="qty" value="'.dol_escape_htmltag($line->qty).'" />'; // We must be able to enter decimal qty
2369 2369
 						print '</td>';
2370 2370
 
2371 2371
 						//print '<td class="right">'.$langs->trans('AmountHT').'</td>';
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
 				print '</script>'."\n";
2471 2471
 				print '</td></tr>';
2472 2472
 
2473
-				$tredited = '';	// Case the addfile and linkto file is used for edit (used by following tpl)
2473
+				$tredited = ''; // Case the addfile and linkto file is used for edit (used by following tpl)
2474 2474
 				include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php';
2475 2475
 				include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php';
2476 2476
 
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
 				});
2591 2591
 			';
2592 2592
 
2593
-			if (! empty($conf->global->MAIN_USE_EXPENSE_IK)) {
2593
+			if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
2594 2594
 				print '
2595 2595
 
2596 2596
                 /* unit price coef calculation */
Please login to merge, or discard this patch.
htdocs/expensereport/ajax/ajaxik.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,21 +68,21 @@
 block discarded – undo
68 68
 
69 69
 
70 70
 if (empty($fk_expense) || $fk_expense < 0) {
71
-	$rep->errorMessage =   $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense');
71
+	$rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense');
72 72
 } elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) {
73
-	$rep->errorMessage =  $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat');
73
+	$rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat');
74 74
 
75 75
 	$rep->response_status = 'error';
76 76
 } else {
77 77
 	// @see ndfp.class.php:3576 (method: compute_total_km)
78 78
 	$expense = new ExpenseReport($db);
79 79
 	if ($expense->fetch($fk_expense) <= 0) {
80
-		$rep->errorMessage =  $langs->transnoentitiesnoconv('ErrorRecordNotFound');
80
+		$rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound');
81 81
 		$rep->response_status = 'error';
82 82
 	} else {
83 83
 		$userauthor = new User($db);
84 84
 		if ($userauthor->fetch($expense->fk_user_author) <= 0) {
85
-			$rep->errorMessage =  $langs->transnoentitiesnoconv('ErrorRecordNotFound');
85
+			$rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound');
86 86
 			$rep->response_status = 'error';
87 87
 		} else {
88 88
 			$expense = new ExpenseReport($db);
Please login to merge, or discard this patch.
htdocs/bom/tpl/objectline_edit.tpl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,21 +129,21 @@
 block discarded – undo
129 129
 	if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
130 130
 		$coldisplay++;
131 131
 		print '<td class="nobottom nowrap linecolunit right">';
132
-		print  $formproduct->selectMeasuringUnits("fk_unit",  '',  (($line->fk_unit) ? $line->fk_unit : ''),  0,  0);
132
+		print  $formproduct->selectMeasuringUnits("fk_unit", '', (($line->fk_unit) ? $line->fk_unit : ''), 0, 0);
133 133
 		print '</td>';
134 134
 	}
135 135
 
136 136
 	$coldisplay++;
137
-	print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOSTISSET("qty_frozen") ? (GETPOST('qty_frozen', 'int') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')) . '>';
137
+	print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOSTISSET("qty_frozen") ? (GETPOST('qty_frozen', 'int') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')).'>';
138 138
 	print '</td>';
139 139
 
140 140
 	$coldisplay++;
141
-	print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOSTISSET('disablestockchange') ? (GETPOST("disable_stock_change", 'int') ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')) . '">';
141
+	print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOSTISSET('disablestockchange') ? (GETPOST("disable_stock_change", 'int') ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')).'">';
142 142
 	print '</td>';
143 143
 
144 144
 	$coldisplay++;
145 145
 	print '<td class="nobottom nowrap linecollost right">';
146
-	print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . $line->efficiency . '"></td>';
146
+	print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
147 147
 
148 148
 	$coldisplay++;
149 149
 	print '<td class="nobottom nowrap linecolcostprice right">';
Please login to merge, or discard this patch.
htdocs/bom/tpl/objectline_view.tpl.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 }
68 68
 
69 69
 // add html5 elements
70
-if ($filtertype == 1) $domData  = ' data-element="'.$line->element.'service"';
71
-else $domData  = ' data-element="'.$line->element.'"';
70
+if ($filtertype == 1) $domData = ' data-element="'.$line->element.'service"';
71
+else $domData = ' data-element="'.$line->element.'"';
72 72
 
73 73
 $domData .= ' data-id="'.$line->id.'"';
74 74
 $domData .= ' data-qty="'.$line->qty.'"';
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 if ($filtertype != 1) {
129 129
 	if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
130 130
 		print '<td class="linecoluseunit nowrap left">';
131
-		$label = measuringUnitString($line->fk_unit, '',  '', 1);
131
+		$label = measuringUnitString($line->fk_unit, '', '', 1);
132 132
 		if ($label !== '') {
133 133
 			print $langs->trans($label);
134 134
 		}
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 // Select of all the sub-BOM lines
240 240
 // From this pont to the end of the file, we only take care of sub-BOM lines
241 241
 $sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl';
242
-$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id;
242
+$sql .= ' WHERE fk_bom ='.(int) $tmpbom->id;
243 243
 $resql = $object->db->query($sql);
244 244
 
245 245
 if ($resql) {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 		if (!empty($sub_bom->id)) {
310 310
 			$sub_bom->calculateCosts();
311 311
 			print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
312
-			$total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
312
+			$total_cost += $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
313 313
 		} elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) {
314 314
 			//Convert qty to hour
315 315
 			$unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1);
@@ -323,24 +323,24 @@  discard block
 block discarded – undo
323 323
 		} elseif ($sub_bom_product->cost_price > 0) {
324 324
 			print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'">';
325 325
 			print '<span class="amount">'.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
326
-			$total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;
326
+			$total_cost += $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;
327 327
 		} elseif ($sub_bom_product->pmp > 0) {	// PMP if cost price isn't defined
328 328
 			print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'">';
329 329
 			print '<span class="amount">'.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
330
-			$total_cost.= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty;
330
+			$total_cost .= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty;
331 331
 		} else {	// Minimum purchase price if cost price and PMP aren't defined
332 332
 			$sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
333
-			$sql_supplier_price.= ' WHERE fk_product = '. (int) $sub_bom_product->id;
333
+			$sql_supplier_price .= ' WHERE fk_product = '.(int) $sub_bom_product->id;
334 334
 			$resql_supplier_price = $object->db->query($sql_supplier_price);
335 335
 			if ($resql_supplier_price) {
336 336
 				$obj = $object->db->fetch_object($resql_supplier_price);
337 337
 				if (!empty($obj->qty) && !empty($sub_bom_line->qty) && !empty($line->qty)) {
338
-					$line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty;
338
+					$line_cost = $obj->min_price / $obj->qty * $sub_bom_line->qty * $line->qty;
339 339
 				} else {
340 340
 					$line_cost = $obj->min_price;
341 341
 				}
342 342
 				print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price2num($line_cost, 'MT').'</span></td>';
343
-				$total_cost+= $line_cost;
343
+				$total_cost += $line_cost;
344 344
 			}
345 345
 		}
346 346
 
Please login to merge, or discard this patch.
htdocs/bom/bom_card.php 1 patch
Braces   +18 added lines, -8 removed lines patch added patch discarded remove patch
@@ -176,8 +176,12 @@  discard block
 block discarded – undo
176 176
 		if (!empty($idprod) && isModEnabled('workstation')) {
177 177
 			$product = new Product($db);
178 178
 			$res = $product->fetch($idprod);
179
-			if ($res > 0 && $product->type == Product::TYPE_SERVICE) $fk_default_workstation = $product->fk_default_workstation;
180
-			if (empty($fk_unit)) $fk_unit = $product->fk_unit;
179
+			if ($res > 0 && $product->type == Product::TYPE_SERVICE) {
180
+				$fk_default_workstation = $product->fk_default_workstation;
181
+			}
182
+			if (empty($fk_unit)) {
183
+				$fk_unit = $product->fk_unit;
184
+			}
181 185
 		}
182 186
 
183 187
 		if ($qty == '') {
@@ -615,9 +619,12 @@  discard block
 block discarded – undo
615 619
 
616 620
 				$parameters = array();
617 621
 				$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
618
-				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
619
-				if (empty($reshook))
620
-					$object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
622
+				if ($reshook < 0) {
623
+					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
624
+				}
625
+				if (empty($reshook)) {
626
+									$object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
627
+				}
621 628
 			}
622 629
 		}
623 630
 
@@ -662,9 +669,12 @@  discard block
 block discarded – undo
662 669
 				// Add services form
663 670
 				$parameters = array();
664 671
 				$reshook = $hookmanager->executeHooks('formAddObjectServiceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
665
-				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
666
-				if (empty($reshook))
667
-					$object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
672
+				if ($reshook < 0) {
673
+					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
674
+				}
675
+				if (empty($reshook)) {
676
+									$object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
677
+				}
668 678
 			}
669 679
 		}
670 680
 	}
Please login to merge, or discard this patch.
htdocs/bom/class/bom.class.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -781,7 +781,9 @@  discard block
 block discarded – undo
781 781
 			$line->import_key = $import_key;
782 782
 			$line->position = $rankToUse;
783 783
 
784
-			if (!empty($fk_unit)) $line->fk_unit = $fk_unit;
784
+			if (!empty($fk_unit)) {
785
+				$line->fk_unit = $fk_unit;
786
+			}
785 787
 
786 788
 
787 789
 			if (is_array($array_options) && count($array_options) > 0) {
@@ -1475,8 +1477,9 @@  discard block
 block discarded – undo
1475 1477
 						$workstation = new Workstation($this->db);
1476 1478
 						$res = $workstation->fetch($tmpproduct->fk_default_workstation);
1477 1479
 
1478
-						if ($res > 0) $line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
1479
-						else {
1480
+						if ($res > 0) {
1481
+							$line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
1482
+						} else {
1480 1483
 							$this->error = $workstation->error;
1481 1484
 								return -3;
1482 1485
 						}
@@ -1540,7 +1543,9 @@  discard block
 block discarded – undo
1540 1543
 		if (!empty($this->lines)) {
1541 1544
 			foreach ($this->lines as $line) {
1542 1545
 				if (!empty($line->childBom)) {
1543
-					foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty);
1546
+					foreach ($line->childBom as $childBom) {
1547
+						$childBom->getNetNeeds($TNetNeeds, $line->qty*$qty);
1548
+					}
1544 1549
 				} else {
1545 1550
 					if (empty($TNetNeeds[$line->fk_product])) {
1546 1551
 						$TNetNeeds[$line->fk_product] = 0;
@@ -1595,7 +1600,9 @@  discard block
 block discarded – undo
1595 1600
 			return;
1596 1601
 		}
1597 1602
 
1598
-		if (empty($bom_id)) $bom_id=$this->id;
1603
+		if (empty($bom_id)) {
1604
+			$bom_id=$this->id;
1605
+		}
1599 1606
 
1600 1607
 		$sql = 'SELECT l.fk_bom, b.label
1601 1608
 				FROM '.MAIN_DB_PREFIX.'bom_bomline l
Please login to merge, or discard this patch.
htdocs/mrp/mo_production.php 2 patches
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		$also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0);
133 133
 		$result = $object->cancel($user, 0, $also_cancel_consumed_and_produced_lines);
134 134
 		if ($result > 0) {
135
-			header("Location: " . dol_buildpath('/mrp/mo_card.php?id=' . $object->id, 1));
135
+			header("Location: ".dol_buildpath('/mrp/mo_card.php?id='.$object->id, 1));
136 136
 			exit;
137 137
 		} else {
138 138
 			$action = '';
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		$also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0);
143 143
 		$result = $object->delete($user, 0, $also_cancel_consumed_and_produced_lines);
144 144
 		if ($result > 0) {
145
-			header("Location: " . $backurlforlist);
145
+			header("Location: ".$backurlforlist);
146 146
 			exit;
147 147
 		} else {
148 148
 			$action = '';
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 				'value' => empty($conf->global->MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT) ? 0 : 1
578 578
 			),
579 579
 		);
580
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CancelMo'), $langs->trans('ConfirmCancelMo'), 'confirm_cancel', $formquestion, 0, 1);
580
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CancelMo'), $langs->trans('ConfirmCancelMo'), 'confirm_cancel', $formquestion, 0, 1);
581 581
 	}
582 582
 
583 583
 	// Call Hook formConfirm
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 		// Qty
815 815
 		print '<td class="right">'.$langs->trans("Qty").'</td>';
816 816
 		// Unit
817
-		if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">' . $langs->trans("Unit") . '</td>';
817
+		if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">'.$langs->trans("Unit").'</td>';
818 818
 		// Cost price
819 819
 		if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
820 820
 			print '<td class="right">'.$langs->trans("UnitCost").'</td>';
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
 
911 911
 		// Lines to consume
912 912
 
913
-		$bomcostupdated = 0;	// We will recalculate the unitary cost to produce a product using the real "products to consume into MO"
913
+		$bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO"
914 914
 
915 915
 		if (!empty($object->lines)) {
916 916
 			$nblinetoconsume = 0;
@@ -941,8 +941,8 @@  discard block
 block discarded – undo
941 941
 								$costprice = 0;
942 942
 							}
943 943
 						}
944
-						$linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT');	// price for line for all quantities
945
-						$bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU');	// same but with full accuracy
944
+						$linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities
945
+						$bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy
946 946
 					}
947 947
 
948 948
 					$bomcostupdated = price2num($bomcostupdated, 'MU');
@@ -962,23 +962,23 @@  discard block
 block discarded – undo
962 962
 								$alreadyconsumed += $line2['qty'];
963 963
 							}
964 964
 						}
965
-						$suffix = '_' . $line->id;
966
-						print '<!-- Line to dispatch ' . $suffix . ' -->' . "\n";
965
+						$suffix = '_'.$line->id;
966
+						print '<!-- Line to dispatch '.$suffix.' -->'."\n";
967 967
 						// hidden fields for js function
968
-						print '<input id="qty_ordered' . $suffix . '" type="hidden" value="' . $line->qty . '">';
968
+						print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$line->qty.'">';
969 969
 						// Duration - Time spent
970
-						print '<input id="qty_dispatched' . $suffix . '" type="hidden" value="' . $alreadyconsumed . '">';
970
+						print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyconsumed.'">';
971 971
 						print '<tr>';
972
-						print '<input name="lineid" type="hidden" value="' . $line->id . '">';
972
+						print '<input name="lineid" type="hidden" value="'.$line->id.'">';
973 973
 
974 974
 						// Product
975
-						print '<td>' . $tmpproduct->getNomUrl(1);
976
-						print '<br><div class="opacitymedium small tdoverflowmax150" title="' . dol_escape_htmltag($tmpproduct->label) . '">' . $tmpproduct->label . '</span>';
975
+						print '<td>'.$tmpproduct->getNomUrl(1);
976
+						print '<br><div class="opacitymedium small tdoverflowmax150" title="'.dol_escape_htmltag($tmpproduct->label).'">'.$tmpproduct->label.'</span>';
977 977
 						print '</td>';
978 978
 
979 979
 						// Qty
980 980
 						print '<td class="right nowraponall">';
981
-						print '<input name="qty_lineProduce" type="number" value="'. $line->qty.'" width="25px">';
981
+						print '<input name="qty_lineProduce" type="number" value="'.$line->qty.'" width="25px">';
982 982
 						print '</td>';
983 983
 						// Unit
984 984
 						if ($conf->global->PRODUCT_USE_UNITS) {
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 						}
989 989
 						// Qty consumed
990 990
 						print '<td class="right">';
991
-						print ' ' . price2num($alreadyconsumed, 'MS');
991
+						print ' '.price2num($alreadyconsumed, 'MS');
992 992
 						print '</td>';
993 993
 						// Entrepot
994 994
 						print '<td class="right">';
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 						if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
999 999
 							print img_warning($langs->trans('StockTooLow')).' ';
1000 1000
 						}
1001
-						print '<span class="left">'. $tmpproduct->stock_reel  .' </span>';
1001
+						print '<span class="left">'.$tmpproduct->stock_reel.' </span>';
1002 1002
 						print '</td>';
1003 1003
 						// Batch
1004 1004
 						print '<td class="right">';
@@ -1006,8 +1006,8 @@  discard block
 block discarded – undo
1006 1006
 
1007 1007
 						// Action delete line
1008 1008
 						print '<td>';
1009
-						print '<input type="submit" class="button buttongen button-add" name="save" value="' . $langs->trans("Edit") . '">';
1010
-						print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
1009
+						print '<input type="submit" class="button buttongen button-add" name="save" value="'.$langs->trans("Edit").'">';
1010
+						print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
1011 1011
 						print '</td>';
1012 1012
 
1013 1013
 						// Action delete line
@@ -1017,28 +1017,28 @@  discard block
 block discarded – undo
1017 1017
 						print '<td></td>';
1018 1018
 						print '</tr>';
1019 1019
 					} else {
1020
-						$suffix = '_' . $line->id;
1021
-						print '<!-- Line to dispatch ' . $suffix . ' -->' . "\n";
1020
+						$suffix = '_'.$line->id;
1021
+						print '<!-- Line to dispatch '.$suffix.' -->'."\n";
1022 1022
 						// hidden fields for js function
1023
-						print '<input id="qty_ordered' . $suffix . '" type="hidden" value="' . $line->qty . '">';
1024
-						print '<input id="qty_dispatched' . $suffix . '" type="hidden" value="' . $alreadyconsumed . '">';
1023
+						print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$line->qty.'">';
1024
+						print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyconsumed.'">';
1025 1025
 
1026
-						print '<tr data-line-id="' . $line->id . '">';
1026
+						print '<tr data-line-id="'.$line->id.'">';
1027 1027
 						// Product
1028
-						print '<td>' . $tmpproduct->getNomUrl(1);
1029
-						print '<br><div class="opacitymedium small tdoverflowmax150" title="' . dol_escape_htmltag($tmpproduct->label) . '">' . $tmpproduct->label . '</div>';
1028
+						print '<td>'.$tmpproduct->getNomUrl(1);
1029
+						print '<br><div class="opacitymedium small tdoverflowmax150" title="'.dol_escape_htmltag($tmpproduct->label).'">'.$tmpproduct->label.'</div>';
1030 1030
 						print '</td>';
1031 1031
 						// Qty
1032 1032
 						print '<td class="right nowraponall">';
1033 1033
 						$help = '';
1034 1034
 						$picto = 'help';
1035 1035
 						if ($line->qty_frozen) {
1036
-							$help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("QuantityFrozen") . '</strong>: ' . yn(1) . ' (' . $langs->trans("QuantityConsumedInvariable") . ')';
1037
-							print $form->textwithpicto('', $help, -1, 'lock') . ' ';
1036
+							$help = ($help ? '<br>' : '').'<strong>'.$langs->trans("QuantityFrozen").'</strong>: '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')';
1037
+							print $form->textwithpicto('', $help, -1, 'lock').' ';
1038 1038
 						}
1039 1039
 						if ($line->disable_stock_change) {
1040
-							$help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("DisableStockChange") . '</strong>: ' . yn(1) . ' (' . (($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")) . ')';
1041
-							print $form->textwithpicto('', $help, -1, 'help') . ' ';
1040
+							$help = ($help ? '<br>' : '').'<strong>'.$langs->trans("DisableStockChange").'</strong>: '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')';
1041
+							print $form->textwithpicto('', $help, -1, 'help').' ';
1042 1042
 						}
1043 1043
 						print price2num($line->qty, 'MS');
1044 1044
 						print '</td>';
@@ -1059,9 +1059,9 @@  discard block
 block discarded – undo
1059 1059
 						if ($alreadyconsumed) {
1060 1060
 							print '<script>';
1061 1061
 							print 'jQuery(document).ready(function() {
1062
-								jQuery("#expandtoproduce' . $line->id . '").click(function() {
1063
-									console.log("Expand mrp_production line ' . $line->id . '");
1064
-									jQuery(".expanddetail' . $line->id . '").toggle();';
1062
+								jQuery("#expandtoproduce' . $line->id.'").click(function() {
1063
+									console.log("Expand mrp_production line ' . $line->id.'");
1064
+									jQuery(".expanddetail' . $line->id.'").toggle();';
1065 1065
 							if ($nblinetoconsume == $nblinetoconsumecursor) {    // If it is the last line
1066 1066
 								print 'if (jQuery("#tablelines").hasClass("nobottom")) { jQuery("#tablelines").removeClass("nobottom"); } else { jQuery("#tablelines").addClass("nobottom"); }';
1067 1067
 							}
@@ -1070,9 +1070,9 @@  discard block
 block discarded – undo
1070 1070
 							});';
1071 1071
 							print '</script>';
1072 1072
 							if (empty($conf->use_javascript_ajax)) {
1073
-								print '<a href="' . $_SERVER["PHP_SELF"] . '?collapse=' . $collapse . ',' . $line->id . '">';
1073
+								print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">';
1074 1074
 							}
1075
-							print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce' . $line->id . '"');
1075
+							print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"');
1076 1076
 							if (empty($conf->use_javascript_ajax)) {
1077 1077
 								print '</a>';
1078 1078
 							}
@@ -1081,12 +1081,12 @@  discard block
 block discarded – undo
1081 1081
 								print '<script>jQuery("#tablelines").removeClass("nobottom");</script>';
1082 1082
 							}
1083 1083
 						}
1084
-						print ' ' . price2num($alreadyconsumed, 'MS');
1084
+						print ' '.price2num($alreadyconsumed, 'MS');
1085 1085
 						print '</td>';
1086 1086
 						// Warehouse
1087 1087
 						print '<td>';
1088 1088
 						if (!empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE) && $tmpwarehouse->id > 0) {
1089
-							print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label;
1089
+							print img_picto('', $tmpwarehouse->picto)." ".$tmpwarehouse->label;
1090 1090
 						}
1091 1091
 						print '</td>';
1092 1092
 						// Stock
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
 							print '<td class="nowraponall right">';
1095 1095
 							if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $tmpproduct->type != Product::TYPE_SERVICE) {
1096 1096
 								if (!$line->disable_stock_change && $tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
1097
-									print img_warning($langs->trans('StockTooLow')) . ' ';
1097
+									print img_warning($langs->trans('StockTooLow')).' ';
1098 1098
 								}
1099 1099
 								if (empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE) || empty($tmpwarehouse->id)) {
1100 1100
 									print price2num($tmpproduct->stock_reel, 'MS'); // Available
@@ -1124,9 +1124,9 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
 						// Action Edit line
1126 1126
 						if ($object->status == Mo::STATUS_DRAFT) {
1127
-							$href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line->id);
1127
+							$href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=editline&token='.newToken().'&lineid='.((int) $line->id);
1128 1128
 							print '<td class="center">';
1129
-							print '<a class="reposition" href="' . $href . '">';
1129
+							print '<a class="reposition" href="'.$href.'">';
1130 1130
 							print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit');
1131 1131
 							print '</a>';
1132 1132
 							print '</td>';
@@ -1134,9 +1134,9 @@  discard block
 block discarded – undo
1134 1134
 
1135 1135
 						// Action delete line
1136 1136
 						if ($permissiontodelete) {
1137
-							$href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=deleteline&token=' . newToken() . '&lineid=' . ((int) $line->id);
1137
+							$href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id);
1138 1138
 							print '<td class="center">';
1139
-							print '<a class="reposition" href="' . $href . '">';
1139
+							print '<a class="reposition" href="'.$href.'">';
1140 1140
 							print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete');
1141 1141
 							print '</a>';
1142 1142
 							print '</td>';
@@ -1199,9 +1199,9 @@  discard block
 block discarded – undo
1199 1199
 
1200 1200
 						// Action Edit line
1201 1201
 						if ($object->status == Mo::STATUS_DRAFT) {
1202
-							$href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line->id);
1202
+							$href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=editline&token='.newToken().'&lineid='.((int) $line->id);
1203 1203
 							print '<td class="center">';
1204
-							print '<a class="reposition" href="' . $href . '">';
1204
+							print '<a class="reposition" href="'.$href.'">';
1205 1205
 							print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit');
1206 1206
 							print '</a>';
1207 1207
 							print '</td>';
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
 						print '<input type="hidden" name="product-'.$line->id.'-'.$i.'" value="'.$line->fk_product.'">';
1242 1242
 
1243 1243
 						// Qty
1244
-						print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-' . $line->id . '-' . $i . '" name="qty-' . $line->id . '-' . $i . '" value="' . $preselected . '" ' . $disable . '></td>';
1244
+						print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-'.$line->id.'-'.$i.'" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'" '.$disable.'></td>';
1245 1245
 
1246 1246
 						// Unit
1247 1247
 						if ($conf->global->PRODUCT_USE_UNITS)  print '<td></td>';
@@ -1742,7 +1742,7 @@  discard block
 block discarded – undo
1742 1742
 
1743 1743
 					$.ajax({
1744 1744
 						type: "POST",
1745
-						url: "<?php echo DOL_URL_ROOT . '/mrp/ajax/interface.php'; ?>",
1745
+						url: "<?php echo DOL_URL_ROOT.'/mrp/ajax/interface.php'; ?>",
1746 1746
 						data: {
1747 1747
 							action: "updateselectbatchbywarehouse",
1748 1748
 							permissiontoproduce: <?php echo $permissiontoproduce ?>,
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 
1804 1804
 					$.ajax({
1805 1805
 						type: "POST",
1806
-						url: "<?php echo DOL_URL_ROOT . '/mrp/ajax/interface.php'; ?>",
1806
+						url: "<?php echo DOL_URL_ROOT.'/mrp/ajax/interface.php'; ?>",
1807 1807
 						data: {
1808 1808
 							action: "updateselectwarehousebybatch",
1809 1809
 							permissiontoproduce: <?php echo $permissiontoproduce ?>,
Please login to merge, or discard this patch.
Braces   +28 added lines, -9 removed lines patch added patch discarded remove patch
@@ -203,7 +203,9 @@  discard block
 block discarded – undo
203 203
 				$moline->fk_default_workstation = $tmpproduct->fk_default_workstation;
204 204
 			}
205 205
 			$moline->disable_stock_change = ($tmpproduct->type == Product::TYPE_SERVICE ? 1 : 0);
206
-			if ($conf->global->PRODUCT_USE_UNITS) $moline->fk_unit = $tmpproduct->fk_unit;
206
+			if ($conf->global->PRODUCT_USE_UNITS) {
207
+				$moline->fk_unit = $tmpproduct->fk_unit;
208
+			}
207 209
 		}
208 210
 
209 211
 		$resultline = $moline->create($user, false); // Never use triggers here
@@ -814,7 +816,9 @@  discard block
 block discarded – undo
814 816
 		// Qty
815 817
 		print '<td class="right">'.$langs->trans("Qty").'</td>';
816 818
 		// Unit
817
-		if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">' . $langs->trans("Unit") . '</td>';
819
+		if ($conf->global->PRODUCT_USE_UNITS) {
820
+			print '<td class="right">' . $langs->trans("Unit") . '</td>';
821
+		}
818 822
 		// Cost price
819 823
 		if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
820 824
 			print '<td class="right">'.$langs->trans("UnitCost").'</td>';
@@ -1244,7 +1248,9 @@  discard block
 block discarded – undo
1244 1248
 						print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-' . $line->id . '-' . $i . '" name="qty-' . $line->id . '-' . $i . '" value="' . $preselected . '" ' . $disable . '></td>';
1245 1249
 
1246 1250
 						// Unit
1247
-						if ($conf->global->PRODUCT_USE_UNITS)  print '<td></td>';
1251
+						if ($conf->global->PRODUCT_USE_UNITS) {
1252
+							print '<td></td>';
1253
+						}
1248 1254
 
1249 1255
 						// Cost
1250 1256
 						if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
@@ -1367,7 +1373,9 @@  discard block
 block discarded – undo
1367 1373
 		// Qty
1368 1374
 		print '<td class="right">'.$langs->trans("Qty").'</td>';
1369 1375
 		/// Unit
1370
-		if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">'.$langs->trans("Unit").'</td>';
1376
+		if ($conf->global->PRODUCT_USE_UNITS) {
1377
+			print '<td class="right">'.$langs->trans("Unit").'</td>';
1378
+		}
1371 1379
 		// Cost price
1372 1380
 		if ($permissiontoupdatecost) {
1373 1381
 			if (empty($bomcostupdated)) {
@@ -1418,7 +1426,9 @@  discard block
 block discarded – undo
1418 1426
 			// Qty
1419 1427
 			print '<td class="right"><input type="text" name="qtytoadd" value="1" class="width50 right"></td>';
1420 1428
 			//Unit
1421
-			if ($conf->global->PRODUCT_USE_UNITS) print '<td></td>';
1429
+			if ($conf->global->PRODUCT_USE_UNITS) {
1430
+				print '<td></td>';
1431
+			}
1422 1432
 			// Cost price
1423 1433
 			if ($permissiontoupdatecost) {
1424 1434
 				print '<td></td>';
@@ -1483,7 +1493,9 @@  discard block
 block discarded – undo
1483 1493
 					// Qty
1484 1494
 					print '<td class="right">'.$line->qty.'</td>';
1485 1495
 					// Unit
1486
-					if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">'.measuringUnitString($line->fk_unit, '', '', 1).'</td>';
1496
+					if ($conf->global->PRODUCT_USE_UNITS) {
1497
+						print '<td class="right">'.measuringUnitString($line->fk_unit, '', '', 1).'</td>';
1498
+					}
1487 1499
 					// Cost price
1488 1500
 					if ($permissiontoupdatecost) {
1489 1501
 						// Defined $manufacturingcost
@@ -1580,7 +1592,9 @@  discard block
 block discarded – undo
1580 1592
 						// Qty
1581 1593
 						print '<td></td>';
1582 1594
 						// Unit
1583
-						if ($conf->global->PRODUCT_USE_UNITS) print '<td></td>';
1595
+						if ($conf->global->PRODUCT_USE_UNITS) {
1596
+							print '<td></td>';
1597
+						}
1584 1598
 						// Cost price
1585 1599
 						if ($permissiontoupdatecost) {
1586 1600
 							print '<td></td>';
@@ -1631,7 +1645,9 @@  discard block
 block discarded – undo
1631 1645
 						// Qty
1632 1646
 						print '<td class="right"><input type="text" class="width50 right" id="qtytoproduce-'.$line->id.'-'.$i.'" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
1633 1647
 						//Unit
1634
-						if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right"></td>';
1648
+						if ($conf->global->PRODUCT_USE_UNITS) {
1649
+							print '<td class="right"></td>';
1650
+						}
1635 1651
 						// Cost
1636 1652
 						if ($permissiontoupdatecost) {
1637 1653
 							// Defined $manufacturingcost
@@ -1688,7 +1704,10 @@  discard block
 block discarded – undo
1688 1704
 								print '</td>';
1689 1705
 
1690 1706
 								print '<td align="right"  class="splitall">';
1691
-								if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" onClick="addDispatchLine('.$line->id.', \'batch\', \'alltoproduce\')"'); //
1707
+								if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) {
1708
+									print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" onClick="addDispatchLine('.$line->id.', \'batch\', \'alltoproduce\')"');
1709
+								}
1710
+								//
1692 1711
 								print '</td>';
1693 1712
 							} else {
1694 1713
 								print '<td></td>';
Please login to merge, or discard this patch.
htdocs/mrp/class/mo.class.php 1 patch
Braces   +35 added lines, -12 removed lines patch added patch discarded remove patch
@@ -738,7 +738,9 @@  discard block
 block discarded – undo
738 738
 							$moline->fk_mo = $this->id;
739 739
 							$moline->origin_id = $line->id;
740 740
 							$moline->origin_type = 'bomline';
741
-							if (!empty($line->fk_unit)) $moline->fk_unit = $line->fk_unit;
741
+							if (!empty($line->fk_unit)) {
742
+								$moline->fk_unit = $line->fk_unit;
743
+							}
742 744
 							if ($line->qty_frozen) {
743 745
 								$moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce
744 746
 							} else {
@@ -754,7 +756,9 @@  discard block
 block discarded – undo
754 756
 								$moline->position = $line->position;
755 757
 								$moline->qty_frozen = $line->qty_frozen;
756 758
 								$moline->disable_stock_change = $line->disable_stock_change;
757
-								if (!empty($line->fk_default_workstation)) $moline->fk_default_workstation = $line->fk_default_workstation;
759
+								if (!empty($line->fk_default_workstation)) {
760
+									$moline->fk_default_workstation = $line->fk_default_workstation;
761
+								}
758 762
 
759 763
 								$resultline = $moline->create($user, false); // Never use triggers here
760 764
 								if ($resultline <= 0) {
@@ -791,7 +795,9 @@  discard block
 block discarded – undo
791 795
 	{
792 796
 		$error = 0;
793 797
 
794
-		if ($this->status != self::STATUS_DRAFT) return 1;
798
+		if ($this->status != self::STATUS_DRAFT) {
799
+			return 1;
800
+		}
795 801
 
796 802
 		$this->db->begin();
797 803
 
@@ -804,14 +810,18 @@  discard block
 block discarded – undo
804 810
 				while ($obj = $this->db->fetch_object($resql)) {
805 811
 					$moLine = new MoLine($this->db);
806 812
 					$res = $moLine->fetch($obj->rowid);
807
-					if (!$res) $error++;
813
+					if (!$res) {
814
+						$error++;
815
+					}
808 816
 
809 817
 					if ($moLine->role == 'toconsume' || $moLine->role == 'toproduce') {
810 818
 						if (empty($moLine->qty_frozen)) {
811 819
 							$qty = $newQty * $moLine->qty / $oldQty;
812 820
 							$moLine->qty = price2num($qty * (!empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and efficiency
813 821
 							$res = $moLine->update($user);
814
-							if (!$res) $error++;
822
+							if (!$res) {
823
+								$error++;
824
+							}
815 825
 						}
816 826
 					}
817 827
 				}
@@ -1576,7 +1586,9 @@  discard block
 block discarded – undo
1576 1586
 		$objectline = new MoLine($this->db);
1577 1587
 
1578 1588
 		$TFilters = array('customsql'=>'fk_mo = '.((int) $this->id));
1579
-		if (!empty($rolefilter)) $TFilters['role'] = $rolefilter;
1589
+		if (!empty($rolefilter)) {
1590
+			$TFilters['role'] = $rolefilter;
1591
+		}
1580 1592
 		$result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters);
1581 1593
 
1582 1594
 		if (is_numeric($result)) {
@@ -1816,8 +1828,11 @@  discard block
 block discarded – undo
1816 1828
 				while ($obj = $this->db->fetch_object($resql)) {
1817 1829
 					$MoChild = new Mo($this->db);
1818 1830
 					$res = $MoChild->fetch($obj->rowid);
1819
-					if ($res > 0) $TMoChilds[$MoChild->id] = $MoChild;
1820
-					else $error++;
1831
+					if ($res > 0) {
1832
+						$TMoChilds[$MoChild->id] = $MoChild;
1833
+					} else {
1834
+						$error++;
1835
+					}
1821 1836
 				}
1822 1837
 			}
1823 1838
 		} else {
@@ -1839,16 +1854,22 @@  discard block
 block discarded – undo
1839 1854
 	 */
1840 1855
 	public function getAllMoChilds($depth = 0)
1841 1856
 	{
1842
-		if ($depth > 1000) return -1;
1857
+		if ($depth > 1000) {
1858
+			return -1;
1859
+		}
1843 1860
 
1844 1861
 		$TMoChilds = array();
1845 1862
 		$error = 0;
1846 1863
 
1847 1864
 		$childMoList = $this->getMoChilds();
1848 1865
 
1849
-		if ($childMoList == -1) return -1;
1866
+		if ($childMoList == -1) {
1867
+			return -1;
1868
+		}
1850 1869
 
1851
-		foreach ($childMoList as $childMo) $TMoChilds[$childMo->id] = $childMo;
1870
+		foreach ($childMoList as $childMo) {
1871
+			$TMoChilds[$childMo->id] = $childMo;
1872
+		}
1852 1873
 
1853 1874
 		foreach ($childMoList as $childMo) {
1854 1875
 			$childMoChildren = $childMo->getAllMoChilds($depth + 1);
@@ -1891,7 +1912,9 @@  discard block
 block discarded – undo
1891 1912
 			if ($this->db->num_rows($resql) > 0) {
1892 1913
 				$obj = $this->db->fetch_object($resql);
1893 1914
 				$res = $MoParent->fetch($obj->id_moparent);
1894
-				if ($res < 0) $error++;
1915
+				if ($res < 0) {
1916
+					$error++;
1917
+				}
1895 1918
 			} else {
1896 1919
 				return 0;
1897 1920
 			}
Please login to merge, or discard this patch.
htdocs/compta/bank/class/account.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * Address of the bank account
180 180
 	 * @var string
181 181
 	 */
182
-	public $domiciliation;		// deprecated, use now address
182
+	public $domiciliation; // deprecated, use now address
183 183
 	public $address;
184 184
 	public $state_id;
185 185
 	public $state_code;
@@ -460,13 +460,13 @@  discard block
 block discarded – undo
460 460
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
461 461
 		$sql .= "fk_bank";
462 462
 		$sql .= ", url_id";
463
-		$sql .= ", url";		// deprecated
463
+		$sql .= ", url"; // deprecated
464 464
 		$sql .= ", label";
465 465
 		$sql .= ", type";
466 466
 		$sql .= ") VALUES (";
467 467
 		$sql .= " ".((int) $line_id);
468 468
 		$sql .= ", ".((int) $url_id);
469
-		$sql .= ", '".$this->db->escape($url)."'";		// dperecated
469
+		$sql .= ", '".$this->db->escape($url)."'"; // dperecated
470 470
 		$sql .= ", '".$this->db->escape($label)."'";
471 471
 		$sql .= ", '".$this->db->escape($type)."'";
472 472
 		$sql .= ")";
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 
1076 1076
 				$this->date_creation  = $this->db->jdate($obj->date_creation);
1077 1077
 				$this->date_modification = $this->db->jdate($obj->date_modification);
1078
-				$this->date_update    = $this->date_modification;	// For compatibility
1078
+				$this->date_update    = $this->date_modification; // For compatibility
1079 1079
 
1080 1080
 				$this->ics           = $obj->ics;
1081 1081
 				$this->ics_transfer  = $obj->ics_transfer;
@@ -1448,9 +1448,9 @@  discard block
 block discarded – undo
1448 1448
 		}
1449 1449
 		// show categories for this record only in ajax to not overload lists
1450 1450
 		if (isModEnabled('categorie') && !$nofetch) {
1451
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1451
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1452 1452
 			$form = new Form($this->db);
1453
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1);
1453
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1);
1454 1454
 		}
1455 1455
 
1456 1456
 		return $datas;
@@ -1518,7 +1518,7 @@  discard block
 block discarded – undo
1518 1518
 				$label = $langs->trans("BankAccount");
1519 1519
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
1520 1520
 			}
1521
-			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' :  ' title="tocomplete"');
1521
+			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
1522 1522
 			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
1523 1523
 		} else {
1524 1524
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 			$this->error = 'SwiftNotValid';
1575 1575
 		}
1576 1576
 
1577
-		if (! $error) {
1577
+		if (!$error) {
1578 1578
 			return 1;
1579 1579
 		} else {
1580 1580
 			return 0;
@@ -1953,8 +1953,8 @@  discard block
 block discarded – undo
1953 1953
 	 */
1954 1954
 	public $datev;
1955 1955
 
1956
-	public $amount;					/* Amount of payment in the bank account currency */
1957
-	public $amount_main_currency;	/* Amount in the currency of company if bank account use another currency */
1956
+	public $amount; /* Amount of payment in the bank account currency */
1957
+	public $amount_main_currency; /* Amount in the currency of company if bank account use another currency */
1958 1958
 
1959 1959
 	/**
1960 1960
 	 * @var int ID
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
 
2347 2347
 		// Check statement field
2348 2348
 		if (!empty($conf->global->BANK_STATEMENT_REGEX_RULE)) {
2349
-			if (!preg_match('/' . getDolGlobalString('BANK_STATEMENT_REGEX_RULE').'/', $this->num_releve)) {
2349
+			if (!preg_match('/'.getDolGlobalString('BANK_STATEMENT_REGEX_RULE').'/', $this->num_releve)) {
2350 2350
 				$this->errors[] = $langs->trans("ErrorBankStatementNameMustFollowRegex", $conf->global->BANK_STATEMENT_REGEX_RULE);
2351 2351
 				return -1;
2352 2352
 			}
Please login to merge, or discard this patch.