Completed
Branch develop (072594)
by
unknown
23:56
created
htdocs/accountancy/admin/fiscalyear.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
 			$fiscalyearstatic->label = $obj->label;
185 185
 			$fiscalyearstatic->date_start = $obj->date_start;
186 186
 			$fiscalyearstatic->date_end = $obj->date_end;
187
-			$fiscalyearstatic->statut = $obj->status;	// deprecated
187
+			$fiscalyearstatic->statut = $obj->status; // deprecated
188 188
 			$fiscalyearstatic->status = $obj->status;
189 189
 
190 190
 			print '<tr class="oddeven">';
Please login to merge, or discard this patch.
htdocs/expedition/ajax/interface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
 			}
99 99
 			$sell_by_date_formatted = '';
100 100
 			if ($is_sell_by_enabled && !empty($obj->sellby)) {
101
-				$sell_by_date_formatted =  dol_print_date($db->jdate($obj->sellby), 'day');
101
+				$sell_by_date_formatted = dol_print_date($db->jdate($obj->sellby), 'day');
102 102
 			}
103 103
 
104 104
 			// set qty
Please login to merge, or discard this patch.
htdocs/expedition/card.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1513,7 +1513,7 @@  discard block
 block discarded – undo
1513 1513
 										$tooltipClass = ' classfortooltip';
1514 1514
 										$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1515 1515
 									} else {
1516
-										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ;
1516
+										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1517 1517
 									}
1518 1518
 									$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1519 1519
 
@@ -1764,7 +1764,7 @@  discard block
 block discarded – undo
1764 1764
 											$tooltipClass = ' classfortooltip';
1765 1765
 											$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1766 1766
 										} else {
1767
-											$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ;
1767
+											$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1768 1768
 										}
1769 1769
 										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1770 1770
 
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
 								}
1834 1834
 								print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled ? ' '.$disabled : '').'> ';
1835 1835
 								if (empty($disabled) && !getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER')) {
1836
-									print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">';
1836
+									print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">';
1837 1837
 								}
1838 1838
 							} elseif ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) {
1839 1839
 								$disabled = '';
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
 								}
1846 1846
 								print '<input class="qtyl right" name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$quantityToBeDelivered.'"'.($disabled ? ' '.$disabled : '').'> ';
1847 1847
 								if (empty($disabled) && !getDolGlobalInt('STOCK_DISALLOW_NEGATIVE_TRANSFER')) {
1848
-									print '<input name="ent1' . $indiceAsked . '_' . $subj . '" type="hidden" value="' . $warehouse_selected_id . '">';
1848
+									print '<input name="ent1'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$warehouse_selected_id.'">';
1849 1849
 								}
1850 1850
 							} else {
1851 1851
 								print $langs->trans("NA");
@@ -1915,7 +1915,7 @@  discard block
 block discarded – undo
1915 1915
 		}
1916 1916
 	}
1917 1917
 } elseif ($object->id > 0) {
1918
-	'@phan-var-force Expedition $object';  // Need to force it (type overridden earlier)
1918
+	'@phan-var-force Expedition $object'; // Need to force it (type overridden earlier)
1919 1919
 
1920 1920
 	// Edit and view mode
1921 1921
 
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
 	$morehtmlref = '<div class="refidno">';
2028 2028
 	// Ref customer shipment
2029 2029
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1);
2030
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2030
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2031 2031
 	// Thirdparty
2032 2032
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
2033 2033
 	// Project
@@ -2720,7 +2720,7 @@  discard block
 block discarded – undo
2720 2720
 								} else {
2721 2721
 									$child_product = $conf->cache['product'][$child_product_id];
2722 2722
 								}
2723
-								$child_product_label = $child_product->ref . ' ' . $child_product->label;
2723
+								$child_product_label = $child_product->ref.' '.$child_product->label;
2724 2724
 
2725 2725
 								// get warehouse from cache
2726 2726
 								if (!isset($conf->cache['warehouse'][$warehouse_id])) {
@@ -2888,7 +2888,7 @@  discard block
 block discarded – undo
2888 2888
 				 || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'shipping_advance', 'validate'))) {
2889 2889
 					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, '');
2890 2890
 				} else {
2891
-					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2891
+					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2892 2892
 				}
2893 2893
 			}
2894 2894
 
@@ -2910,7 +2910,7 @@  discard block
 block discarded – undo
2910 2910
 					if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('expedition', 'shipping_advance', 'send')) {
2911 2911
 						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
2912 2912
 					} else {
2913
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2913
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2914 2914
 					}
2915 2915
 				}
2916 2916
 			}
Please login to merge, or discard this patch.
htdocs/expedition/class/expedition.class.php 2 patches
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 		if (getDolGlobalString('EXPEDITION_ADDON_NUMBER')) {
367 367
 			$mybool = false;
368 368
 
369
-			$file = getDolGlobalString('EXPEDITION_ADDON_NUMBER') . ".php";
369
+			$file = getDolGlobalString('EXPEDITION_ADDON_NUMBER').".php";
370 370
 			$classname = getDolGlobalString('EXPEDITION_ADDON_NUMBER');
371 371
 
372 372
 			// Include file with class
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 									$line_id = $this->create_line($warehouse_id, 0, $product_child_qty, $line->rang, $line->array_options, $parent_line_id, $product_child_id);
620 620
 									if ($line_id <= 0) {
621 621
 										$error++;
622
-										dol_syslog(__METHOD__ . ' : ' . $this->errorsToString(), LOG_ERR);
622
+										dol_syslog(__METHOD__.' : '.$this->errorsToString(), LOG_ERR);
623 623
 										break;
624 624
 									}
625 625
 
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 				$this->ref_ext		    = $obj->ref_ext;
855 855
 				$this->status               = $obj->fk_statut;
856 856
 				$this->statut               = $this->status; // Deprecated
857
-				$this->signed_status		= $obj->signed_status;
857
+				$this->signed_status = $obj->signed_status;
858 858
 				$this->user_author_id       = $obj->fk_user_author;
859 859
 				$this->fk_user_author       = $obj->fk_user_author;
860 860
 				$this->date_creation        = $this->db->jdate($obj->date_creation);
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 		// If product need a batch number, we should not have called this function but addline_batch instead.
1225 1225
 		// If this happen, we may have a bug in card.php page
1226 1226
 		if (isModEnabled('productbatch') && !empty($line->fk_product) && !empty($orderline->product_tobatch)) {
1227
-			$this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$line->fk_product;	//
1227
+			$this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$line->fk_product; //
1228 1228
 			return -4;
1229 1229
 		}
1230 1230
 
@@ -1855,14 +1855,14 @@  discard block
 block discarded – undo
1855 1855
 						$this->db->commit();
1856 1856
 
1857 1857
 						// Delete record into ECM index (Note that delete is also done when deleting files with the dol_delete_dir_recursive
1858
-						$this->deleteEcmFiles(0);	 // Deleting files physically is done later with the dol_delete_dir_recursive
1859
-						$this->deleteEcmFiles(1);	 // Deleting files physically is done later with the dol_delete_dir_recursive
1858
+						$this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
1859
+						$this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive
1860 1860
 
1861 1861
 						// We delete PDFs
1862 1862
 						$ref = dol_sanitizeFileName($this->ref);
1863 1863
 						if (!empty($conf->expedition->dir_output)) {
1864
-							$dir = $conf->expedition->dir_output . '/sending/' . $ref;
1865
-							$file = $dir . '/' . $ref . '.pdf';
1864
+							$dir = $conf->expedition->dir_output.'/sending/'.$ref;
1865
+							$file = $dir.'/'.$ref.'.pdf';
1866 1866
 							if (file_exists($file)) {
1867 1867
 								if (!dol_delete_file($file)) {
1868 1868
 									return 0;
@@ -1926,7 +1926,7 @@  discard block
 block discarded – undo
1926 1926
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product";
1927 1927
 		$sql .= " WHERE ed.fk_expedition = ".((int) $this->id);
1928 1928
 		$sql .= " AND ed.fk_elementdet = cd.rowid";
1929
-		$sql .= " ORDER BY cd.rang, ed.fk_elementdet";		// We need after a break on fk_elementdet but when there is no break on fk_elementdet, cd.rang is same so we can add it as first order criteria.
1929
+		$sql .= " ORDER BY cd.rang, ed.fk_elementdet"; // We need after a break on fk_elementdet but when there is no break on fk_elementdet, cd.rang is same so we can add it as first order criteria.
1930 1930
 
1931 1931
 		dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
1932 1932
 		$resql = $this->db->query($sql);
@@ -1960,9 +1960,9 @@  discard block
 block discarded – undo
1960 1960
 					$line->entrepot_id = 0; // entrepod_id in details_entrepot
1961 1961
 					$line->qty_shipped += $obj->qty_shipped;
1962 1962
 				} else {
1963
-					$line = new ExpeditionLigne($this->db);		// new group to start
1964
-					$line->entrepot_id = $obj->fk_entrepot;	// this is a property of a shipment line
1965
-					$line->qty_shipped = $obj->qty_shipped;	// this is a property of a shipment line
1963
+					$line = new ExpeditionLigne($this->db); // new group to start
1964
+					$line->entrepot_id = $obj->fk_entrepot; // this is a property of a shipment line
1965
+					$line->qty_shipped = $obj->qty_shipped; // this is a property of a shipment line
1966 1966
 				}
1967 1967
 
1968 1968
 				$detail_entrepot              = new stdClass();
@@ -1975,13 +1975,13 @@  discard block
 block discarded – undo
1975 1975
 				$line->rowid            = $obj->line_id; // TODO deprecated
1976 1976
 				$line->id               = $obj->line_id;
1977 1977
 
1978
-				$line->fk_origin = 'orderline';	// TODO deprecated, we already have element_type that can be use to guess type of line
1978
+				$line->fk_origin = 'orderline'; // TODO deprecated, we already have element_type that can be use to guess type of line
1979 1979
 
1980
-				$line->fk_element 		= $obj->fk_element;
1981
-				$line->origin_id 		= $obj->fk_element;
1982
-				$line->fk_elementdet 	= $obj->fk_elementdet;
1983
-				$line->origin_line_id 	= $obj->fk_elementdet;
1984
-				$line->element_type 	= $obj->element_type;
1980
+				$line->fk_element = $obj->fk_element;
1981
+				$line->origin_id = $obj->fk_element;
1982
+				$line->fk_elementdet = $obj->fk_elementdet;
1983
+				$line->origin_line_id = $obj->fk_elementdet;
1984
+				$line->element_type = $obj->element_type;
1985 1985
 
1986 1986
 				$line->fk_expedition    = $this->id; // id of parent
1987 1987
 
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
 		}
2274 2274
 		$result .= $linkend;
2275 2275
 		global $action;
2276
-		$hookmanager->initHooks(array($this->element . 'dao'));
2276
+		$hookmanager->initHooks(array($this->element.'dao'));
2277 2277
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
2278 2278
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
2279 2279
 		if ($reshook > 0) {
@@ -2322,9 +2322,9 @@  discard block
 block discarded – undo
2322 2322
 			$statusType = 'status9';
2323 2323
 		}
2324 2324
 
2325
-		$signed_label = ' (' . $this->getLibSignedStatus() . ')';
2326
-		$status_label = $this->signed_status ? $labelStatus . $signed_label : $labelStatus;
2327
-		$status_label_short = $this->signed_status ? $labelStatusShort . $signed_label : $labelStatusShort;
2325
+		$signed_label = ' ('.$this->getLibSignedStatus().')';
2326
+		$status_label = $this->signed_status ? $labelStatus.$signed_label : $labelStatus;
2327
+		$status_label_short = $this->signed_status ? $labelStatusShort.$signed_label : $labelStatusShort;
2328 2328
 
2329 2329
 		return dolGetStatus($status_label, $status_label_short, '', $statusType, $mode);
2330 2330
 	}
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
 		$this->note_private = 'Private note';
2412 2412
 		$this->note_public = 'Public note';
2413 2413
 
2414
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
2414
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
2415 2415
 		$xnbp = 0;
2416 2416
 		while ($xnbp < $nbp) {
2417 2417
 			$line = new ExpeditionLigne($this->db);
@@ -2423,7 +2423,7 @@  discard block
 block discarded – undo
2423 2423
 			$line->fk_product = $this->commande->lines[$xnbp]->fk_product;
2424 2424
 
2425 2425
 			$line->weight = 1.123456;
2426
-			$line->weight_units = 0;		// kg
2426
+			$line->weight_units = 0; // kg
2427 2427
 
2428 2428
 			$line->volume = 2.34567;
2429 2429
 			$line->volume_unit = 0;
@@ -2641,12 +2641,12 @@  discard block
 block discarded – undo
2641 2641
 				if ($shipments_match_order) {
2642 2642
 					dol_syslog("Qty for the ".count($order->lines)." lines of the origin order is same than qty for lines in the shipment we close (shipments_match_order is true), with new status Expedition::STATUS_CLOSED=".self::STATUS_CLOSED.', so we close order');
2643 2643
 					// We close the order
2644
-					$order->cloture($user);		// Note this may also create an invoice if module workflow ask it
2644
+					$order->cloture($user); // Note this may also create an invoice if module workflow ask it
2645 2645
 				}
2646 2646
 			}
2647 2647
 
2648
-			$this->statut = self::STATUS_CLOSED;	// Will be revert to STATUS_VALIDATED at end if there is a rollback
2649
-			$this->status = self::STATUS_CLOSED;	// Will be revert to STATUS_VALIDATED at end if there is a rollback
2648
+			$this->statut = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback
2649
+			$this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback
2650 2650
 
2651 2651
 			// If stock increment is done on closing
2652 2652
 			if (!$error && isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) {
@@ -2694,7 +2694,7 @@  discard block
 block discarded – undo
2694 2694
 
2695 2695
 		$error = 0;
2696 2696
 
2697
-		require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php';
2697
+		require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
2698 2698
 
2699 2699
 		$langs->load("agenda");
2700 2700
 
@@ -2705,14 +2705,14 @@  discard block
 block discarded – undo
2705 2705
 		$sql .= ", cd.subprice";
2706 2706
 		$sql .= ", edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock";
2707 2707
 		$sql .= ", e.ref";
2708
-		$sql .= " FROM " . $this->db->prefix() . "expeditiondet as ed";
2709
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "commandedet as cd ON cd.rowid = ed.fk_elementdet";
2710
-		$sql .= " LEFT JOIN " . $this->db->prefix() . "expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
2711
-		$sql .= " INNER JOIN " . $this->db->prefix() . "expedition as e ON ed.fk_expedition = e.rowid";
2712
-		$sql .= " WHERE ed.fk_expedition = " . ((int) $this->id);
2708
+		$sql .= " FROM ".$this->db->prefix()."expeditiondet as ed";
2709
+		$sql .= " LEFT JOIN ".$this->db->prefix()."commandedet as cd ON cd.rowid = ed.fk_elementdet";
2710
+		$sql .= " LEFT JOIN ".$this->db->prefix()."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
2711
+		$sql .= " INNER JOIN ".$this->db->prefix()."expedition as e ON ed.fk_expedition = e.rowid";
2712
+		$sql .= " WHERE ed.fk_expedition = ".((int) $this->id);
2713 2713
 		//$sql .= " AND cd.rowid = ed.fk_elementdet";
2714 2714
 
2715
-		dol_syslog(get_class($this) . "::valid select details", LOG_DEBUG);
2715
+		dol_syslog(get_class($this)."::valid select details", LOG_DEBUG);
2716 2716
 		$resql = $this->db->query($sql);
2717 2717
 		if ($resql) {
2718 2718
 			$cpt = $this->db->num_rows($resql);
@@ -2726,7 +2726,7 @@  discard block
 block discarded – undo
2726 2726
 				if ($qty <= 0 || ($qty < 0 && !getDolGlobalInt('SHIPMENT_ALLOW_NEGATIVE_QTY'))) {
2727 2727
 					continue;
2728 2728
 				}
2729
-				dol_syslog(get_class($this) . "::valid movement index " . $i . " ed.rowid=" . $obj->edid . " edb.rowid=" . $obj->edbrowid);
2729
+				dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->edid." edb.rowid=".$obj->edbrowid);
2730 2730
 
2731 2731
 				$mouvS = new MouvementStock($this->db);
2732 2732
 				$mouvS->origin = &$this;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -544,7 +544,9 @@
 block discarded – undo
544 544
 								if ($line_id <= 0) {
545 545
 									$error++;
546 546
 								}
547
-								if (isset($kits_list[$line->fk_product])) $kits_id_cached[$line->fk_product] = $line_id;
547
+								if (isset($kits_list[$line->fk_product])) {
548
+									$kits_id_cached[$line->fk_product] = $line_id;
549
+								}
548 550
 							} else {    // with batch management
549 551
 								if ($this->create_line_batch($line, $line->array_options) <= 0) {
550 552
 									$error++;
Please login to merge, or discard this patch.
htdocs/expedition/class/expeditionligne.class.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @var int
70 70
 	 * @deprecated
71 71
 	 */
72
-	public $line_id;	// deprecated
72
+	public $line_id; // deprecated
73 73
 
74 74
 	/**
75 75
 	 * @var int ID	Duplicate of origin_id (using origin_id is better)
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @var string
109 109
 	 * @deprecated	Use instead origin_type = element_type to guess the line of origin of the shipment line.
110 110
 	 */
111
-	public $fk_origin;			// Example: 'orderline'
111
+	public $fk_origin; // Example: 'orderline'
112 112
 
113 113
 	/**
114 114
 	 * @var int Id of shipment
@@ -465,17 +465,17 @@  discard block
 block discarded – undo
465 465
 	{
466 466
 		if ($line_id > 0) {
467 467
 			// find all child
468
-			$sql  = "SELECT ed.rowid as child_line_id";
468
+			$sql = "SELECT ed.rowid as child_line_id";
469 469
 			if ($mode == 1) {
470 470
 				$sql .= ", ed.fk_product";
471 471
 				$sql .= ", ed.fk_parent";
472
-				$sql .= ", " . $this->db->ifsql('eb.rowid IS NULL', 'ed.qty', 'eb.qty') . " as qty";
473
-				$sql .= ", " . $this->db->ifsql('eb.rowid IS NULL', 'ed.fk_entrepot', 'eb.fk_warehouse') . " as fk_warehouse";
472
+				$sql .= ", ".$this->db->ifsql('eb.rowid IS NULL', 'ed.qty', 'eb.qty')." as qty";
473
+				$sql .= ", ".$this->db->ifsql('eb.rowid IS NULL', 'ed.fk_entrepot', 'eb.fk_warehouse')." as fk_warehouse";
474 474
 				$sql .= ", eb.batch, eb.eatby, eb.sellby";
475 475
 			}
476
-			$sql .= " FROM " . $this->db->prefix() . $this->table_element . " as ed";
477
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "expeditiondet_batch as eb ON eb.fk_expeditiondet = " . ((int) $line_id);
478
-			$sql .= " WHERE ed.fk_parent = " . ((int) $line_id);
476
+			$sql .= " FROM ".$this->db->prefix().$this->table_element." as ed";
477
+			$sql .= " LEFT JOIN ".$this->db->prefix()."expeditiondet_batch as eb ON eb.fk_expeditiondet = ".((int) $line_id);
478
+			$sql .= " WHERE ed.fk_parent = ".((int) $line_id);
479 479
 			$sql .= $this->db->order('ed.fk_product,ed.rowid', 'ASC,ASC');
480 480
 
481 481
 			$resql = $this->db->query($sql);
@@ -540,19 +540,19 @@  discard block
 block discarded – undo
540 540
 					foreach ($child_line_id_arr as $child_line_id) {
541 541
 						// delete batch expedition line
542 542
 						if (isModEnabled('productbatch')) {
543
-							$sql = "DELETE FROM " . $this->db->prefix() . "expeditiondet_batch";
544
-							$sql .= " WHERE fk_expeditiondet = " . ((int) $child_line_id);
543
+							$sql = "DELETE FROM ".$this->db->prefix()."expeditiondet_batch";
544
+							$sql .= " WHERE fk_expeditiondet = ".((int) $child_line_id);
545 545
 							if (!$this->db->query($sql)) {
546 546
 								$error++;
547
-								$this->errors[] = $this->db->lasterror() . " - sql=$sql";
547
+								$this->errors[] = $this->db->lasterror()." - sql=$sql";
548 548
 							}
549 549
 						}
550 550
 
551
-						$sql = "DELETE FROM " . $this->db->prefix() . "expeditiondet";
552
-						$sql .= " WHERE rowid = " . ((int) $child_line_id);
551
+						$sql = "DELETE FROM ".$this->db->prefix()."expeditiondet";
552
+						$sql .= " WHERE rowid = ".((int) $child_line_id);
553 553
 						if (!$this->db->query($sql)) {
554 554
 							$error++;
555
-							$this->errors[] = $this->db->lasterror() . " - sql=$sql";
555
+							$this->errors[] = $this->db->lasterror()." - sql=$sql";
556 556
 						}
557 557
 
558 558
 						if ($error) {
Please login to merge, or discard this patch.
htdocs/expedition/dispatch.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 							$sql .= " JOIN ".$db->prefix()."product_stock as ps";
194 194
 							$sql .= " ON ps.rowid = pb.fk_product_stock";
195 195
 							$sql .= " WHERE pb.batch = '".$db->escape($lot)."'";
196
-							$sql .= " AND ps.fk_product = ".((int) $prod_id) ;
197
-							$sql .= " AND ps.fk_entrepot = ".((int) $warehouse_id) ;
196
+							$sql .= " AND ps.fk_product = ".((int) $prod_id);
197
+							$sql .= " AND ps.fk_entrepot = ".((int) $warehouse_id);
198 198
 
199 199
 							$resql = $db->query($sql);
200 200
 							if ($resql) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 						$qtystart = 0;
222 222
 
223 223
 						if ($idline > 0) {
224
-							$result = $expeditiondispatch->fetch($idline);	// get line from llx_expeditiondet
224
+							$result = $expeditiondispatch->fetch($idline); // get line from llx_expeditiondet
225 225
 							if ($result < 0) {
226 226
 								setEventMessages($expeditiondispatch->error, $expeditiondispatch->errors, 'errors');
227 227
 								$error++;
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 llxHeader('', $title, $help_url, '', 0, 0, $morejs, '', '', 'mod-expedition page-card_dispatch');
402 402
 
403 403
 if ($object->id > 0 || !empty($object->ref)) {
404
-	$lines = $object->lines;	// This is an array of detail of line, on line per source order line found intolines[]->fk_elementdet, then each line may have sub data
404
+	$lines = $object->lines; // This is an array of detail of line, on line per source order line found intolines[]->fk_elementdet, then each line may have sub data
405 405
 	//var_dump($lines[0]->fk_elementdet); exit;
406 406
 
407 407
 	$num_prod = count($lines);
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
 	// Ref customer shipment
461 461
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1);
462
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
462
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
463 463
 
464 464
 	// Thirdparty
465 465
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 	print '<center>';
551 551
 
552 552
 	print '<br>';
553
-	$disabled = 0;	// This is used to disable or not the bulk selection of target warehouse. No reason to have it disabled so forced to 0.
553
+	$disabled = 0; // This is used to disable or not the bulk selection of target warehouse. No reason to have it disabled so forced to 0.
554 554
 
555 555
 	if ($object->status == Expedition::STATUS_DRAFT) {
556 556
 		require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 				}
660 660
 				print '<td class="right">'.$langs->trans("QtyOrdered").'</td>';
661 661
 				if ($object->status == Expedition::STATUS_DRAFT) {
662
-					print '<td class="right">'.$langs->trans("QtyToShip");	// Qty to dispatch (sum for all lines of batch detail if there is)
662
+					print '<td class="right">'.$langs->trans("QtyToShip"); // Qty to dispatch (sum for all lines of batch detail if there is)
663 663
 				} else {
664 664
 					print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>';
665 665
 				}
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 						if ($resultsql) {
813 813
 							$numd = $db->num_rows($resultsql);
814 814
 							while ($obj_exp = $db->fetch_object($resultsql)) {
815
-								$suffix = "_" . $j . "_" . $i;
815
+								$suffix = "_".$j."_".$i;
816 816
 
817 817
 								$productChildrenNb = 0;
818 818
 								$expedition_line_child_list = array();
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 														}
916 916
 														$db->free($resql_child);
917 917
 													}
918
-													$line_obj->html_label = str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $child_level) . "&rarr;" . $child_product->getNomUrl(1);
918
+													$line_obj->html_label = str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $child_level)."&rarr;".$child_product->getNomUrl(1);
919 919
 													$expedition_line_child_list[] = $line_obj;
920 920
 												}
921 921
 												$child_level++;
@@ -986,16 +986,16 @@  discard block
 block discarded – undo
986 986
 
987 987
 										print '</tr>';
988 988
 
989
-										print '<!-- line for batch ' . $numline . ' -->';
990
-										print '<tr class="oddeven autoresettr" name="' . $type . '-' . $suffix . '" data-remove="clear">';
989
+										print '<!-- line for batch '.$numline.' -->';
990
+										print '<tr class="oddeven autoresettr" name="'.$type.'-'.$suffix.'" data-remove="clear">';
991 991
 										print '<td>';
992
-										print '<input id="fk_commandedet' . $suffix . '" name="fk_commandedet' . $suffix . '" type="hidden" value="' . $objp->rowid . '">';
993
-										print '<input id="idline' . $suffix . '" name="idline' . $suffix . '" type="hidden" value="' . $objd->rowid . '">';
994
-										print '<input id="fk_parent' . $suffix . '" name="fk_parent' . $suffix . '" type="hidden" value="' . $objd->fk_parent . '">';
995
-										print '<input name="productbatch' . $suffix . '" type="hidden" value="' . $objd->fk_product . '">';
992
+										print '<input id="fk_commandedet'.$suffix.'" name="fk_commandedet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">';
993
+										print '<input id="idline'.$suffix.'" name="idline'.$suffix.'" type="hidden" value="'.$objd->rowid.'">';
994
+										print '<input id="fk_parent'.$suffix.'" name="fk_parent'.$suffix.'" type="hidden" value="'.$objd->fk_parent.'">';
995
+										print '<input name="productbatch'.$suffix.'" type="hidden" value="'.$objd->fk_product.'">';
996 996
 
997 997
 										print '<!-- This is a U.P. (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
998
-										print '<input class="maxwidth75" name="pu' . $suffix . '" type="hidden" value="' . price2num($up_ht_disc, 'MU') . '">';
998
+										print '<input class="maxwidth75" name="pu'.$suffix.'" type="hidden" value="'.price2num($up_ht_disc, 'MU').'">';
999 999
 										if (!empty($objd->html_label)) {
1000 1000
 											print $objd->html_label;
1001 1001
 										}
Please login to merge, or discard this patch.