@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | $sql = "SELECT t.rowid"; |
244 | 244 | $sql .= " FROM " . MAIN_DB_PREFIX . "projet as t"; |
245 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
245 | + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
246 | 246 | if ($category > 0) { |
247 | 247 | $sql .= ", " . MAIN_DB_PREFIX . "categorie_project as c"; |
248 | 248 | } |
@@ -255,12 +255,12 @@ discard block |
||
255 | 255 | if ($search_sale == -2) { |
256 | 256 | $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc)"; |
257 | 257 | } elseif ($search_sale > 0) { |
258 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = " . ((int)$search_sale) . ")"; |
|
258 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . "societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = " . ((int) $search_sale) . ")"; |
|
259 | 259 | } |
260 | 260 | } |
261 | 261 | // Select projects of given category |
262 | 262 | if ($category > 0) { |
263 | - $sql .= " AND c.fk_categorie = " . ((int)$category) . " AND c.fk_project = t.rowid "; |
|
263 | + $sql .= " AND c.fk_categorie = " . ((int) $category) . " AND c.fk_project = t.rowid "; |
|
264 | 264 | } |
265 | 265 | // Add sql filters |
266 | 266 | if ($sqlfilters) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | } |
228 | 228 | |
229 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
229 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
230 | 230 | /** |
231 | 231 | * Load object in memory from the database |
232 | 232 | * |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function fetch_by_product($product_id, $lang = '') |
238 | 238 | { |
239 | - // phpcs:enable |
|
239 | + // phpcs:enable |
|
240 | 240 | global $langs, $conf; |
241 | 241 | |
242 | 242 | $sql = "SELECT"; |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | } |
405 | 405 | } |
406 | 406 | |
407 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
407 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
408 | 408 | /** |
409 | 409 | * Delete object in database |
410 | 410 | * |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | */ |
417 | 417 | public function delete_by_product($user, $product_id, $lang_id = '', $notrigger = 0) |
418 | 418 | { |
419 | - // phpcs:enable |
|
419 | + // phpcs:enable |
|
420 | 420 | global $conf, $langs; |
421 | 421 | $error = 0; |
422 | 422 | |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | } |
453 | 453 | } |
454 | 454 | |
455 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
455 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
456 | 456 | /** |
457 | 457 | * Delete object in database |
458 | 458 | * |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | */ |
462 | 462 | public function delete_by_file($user) |
463 | 463 | { |
464 | - // phpcs:enable |
|
464 | + // phpcs:enable |
|
465 | 465 | global $conf, $langs; |
466 | 466 | $error = 0; |
467 | 467 |
@@ -158,7 +158,7 @@ |
||
158 | 158 | )); |
159 | 159 | |
160 | 160 | // Retrieve all extrafields if not already not know (should not happen) |
161 | - if (! is_object($extrafields)) { |
|
161 | + if (!is_object($extrafields)) { |
|
162 | 162 | $extrafields = new ExtraFields($this->db); |
163 | 163 | $extrafields->fetch_name_optionals_label($product->table_element); |
164 | 164 | } |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | } |
599 | 599 | |
600 | 600 | |
601 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
601 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
602 | 602 | /** |
603 | 603 | * Return list of all warehouses |
604 | 604 | * |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | */ |
608 | 608 | public function list_array($status = 1) |
609 | 609 | { |
610 | - // phpcs:enable |
|
610 | + // phpcs:enable |
|
611 | 611 | $liste = array(); |
612 | 612 | |
613 | 613 | $sql = "SELECT rowid, ref as label"; |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | return $liste; |
630 | 630 | } |
631 | 631 | |
632 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
632 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
633 | 633 | /** |
634 | 634 | * Return number of unique different product into a warehouse |
635 | 635 | * |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | */ |
638 | 638 | public function nb_different_products() |
639 | 639 | { |
640 | - // phpcs:enable |
|
640 | + // phpcs:enable |
|
641 | 641 | $ret = array(); |
642 | 642 | |
643 | 643 | $sql = "SELECT count(distinct p.rowid) as nb"; |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | return $ret; |
661 | 661 | } |
662 | 662 | |
663 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
663 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
664 | 664 | /** |
665 | 665 | * Return stock and value of warehosue |
666 | 666 | * |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | public function nb_products() |
670 | 670 | { |
671 | 671 | global $conf; |
672 | - // phpcs:enable |
|
672 | + // phpcs:enable |
|
673 | 673 | $ret = array(); |
674 | 674 | |
675 | 675 | //For MultiCompany PMP per entity |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | return $this->LibStatut($this->statut, $mode); |
720 | 720 | } |
721 | 721 | |
722 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
722 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
723 | 723 | /** |
724 | 724 | * Return label of a given status |
725 | 725 | * |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | */ |
730 | 730 | public function LibStatut($status, $mode = 0) |
731 | 731 | { |
732 | - // phpcs:enable |
|
732 | + // phpcs:enable |
|
733 | 733 | global $langs; |
734 | 734 | |
735 | 735 | $statusType = 'status5'; |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | return 1; |
904 | 904 | } |
905 | 905 | |
906 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
906 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
907 | 907 | /** |
908 | 908 | * Return full path to current warehouse |
909 | 909 | * |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | */ |
912 | 912 | public function get_full_arbo() |
913 | 913 | { |
914 | - // phpcs:enable |
|
914 | + // phpcs:enable |
|
915 | 915 | $TArbo = array($this->label); |
916 | 916 | |
917 | 917 | $protection = 100; // We limit depth of warehouses to 100 |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | return implode(' >> ', array_reverse($TArbo)); |
945 | 945 | } |
946 | 946 | |
947 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
947 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
948 | 948 | /** |
949 | 949 | * Return array of children warehouses ids from $id warehouse (recursive function) |
950 | 950 | * |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | */ |
955 | 955 | public function get_children_warehouses($id, &$TChildWarehouses) |
956 | 956 | { |
957 | - // phpcs:enable |
|
957 | + // phpcs:enable |
|
958 | 958 | |
959 | 959 | $sql = "SELECT rowid |
960 | 960 | FROM " . $this->db->prefix() . "entrepot |
@@ -166,7 +166,7 @@ |
||
166 | 166 | /** |
167 | 167 | * Warehouse open and any operations are allowed, but warehouse is not included into calculation of stock. |
168 | 168 | */ |
169 | - const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
169 | + const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
170 | 170 | |
171 | 171 | |
172 | 172 |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | return $this->LibStatut($this->status, $mode); |
726 | 726 | } |
727 | 727 | |
728 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
728 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
729 | 729 | /** |
730 | 730 | * Return the status |
731 | 731 | * |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | */ |
736 | 736 | public function LibStatut($status, $mode = 0) |
737 | 737 | { |
738 | - // phpcs:enable |
|
738 | + // phpcs:enable |
|
739 | 739 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
740 | 740 | global $langs; |
741 | 741 | //$langs->load("buypricehistory@buypricehistory"); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
236 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
236 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
237 | 237 | /** |
238 | 238 | * Return full path to current warehouse in $tab (recursive function) |
239 | 239 | * |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | private function get_parent_path($tab, $final_label = '') |
245 | 245 | { |
246 | - //phpcs:enable |
|
246 | + //phpcs:enable |
|
247 | 247 | if (empty($final_label)) { |
248 | 248 | $final_label = $tab['label']; |
249 | 249 | } |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | } |
525 | 525 | } |
526 | 526 | |
527 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
527 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
528 | 528 | /** |
529 | 529 | * Output a combo box with list of units |
530 | 530 | * Currently the units are not define in the DB |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | */ |
540 | 540 | public function select_measuring_units($name = 'measuring_units', $measuring_style = '', $selected = '0', $adddefault = 0, $mode = 0) |
541 | 541 | { |
542 | - //phpcs:enable |
|
542 | + //phpcs:enable |
|
543 | 543 | print $this->selectMeasuringUnits($name, $measuring_style, $selected, $adddefault, $mode); |
544 | 544 | } |
545 | 545 |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | public $fk_product; |
59 | 59 | |
60 | 60 | // Properties of the lot |
61 | - public $lotid; // ID in table of the details of properties of each lots |
|
61 | + public $lotid; // ID in table of the details of properties of each lots |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * @var int|string |
65 | 65 | * @deprecated |
66 | 66 | */ |
67 | - public $sellby = ''; // dlc |
|
67 | + public $sellby = ''; // dlc |
|
68 | 68 | /** |
69 | 69 | * @var int|string |
70 | 70 | * @deprecated |
71 | 71 | */ |
72 | - public $eatby = ''; // dmd/dluo |
|
72 | + public $eatby = ''; // dmd/dluo |
|
73 | 73 | |
74 | 74 | |
75 | 75 | /** |
@@ -103,15 +103,15 @@ discard block |
||
103 | 103 | // Insert request |
104 | 104 | $sql = "INSERT INTO " . $this->db->prefix() . "product_batch ("; |
105 | 105 | $sql .= "fk_product_stock,"; |
106 | - $sql .= "sellby,"; // no more used |
|
107 | - $sql .= "eatby,"; // no more used |
|
106 | + $sql .= "sellby,"; // no more used |
|
107 | + $sql .= "eatby,"; // no more used |
|
108 | 108 | $sql .= "batch,"; |
109 | 109 | $sql .= "qty,"; |
110 | 110 | $sql .= "import_key"; |
111 | 111 | $sql .= ") VALUES ("; |
112 | 112 | $sql .= " " . (!isset($this->fk_product_stock) ? 'NULL' : $this->fk_product_stock) . ","; |
113 | - $sql .= " " . (!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'" . $this->db->idate($this->sellby) . "'") . ","; // no more used |
|
114 | - $sql .= " " . (!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'" . $this->db->idate($this->eatby) . "'") . ","; // no more used |
|
113 | + $sql .= " " . (!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'" . $this->db->idate($this->sellby) . "'") . ","; // no more used |
|
114 | + $sql .= " " . (!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'" . $this->db->idate($this->eatby) . "'") . ","; // no more used |
|
115 | 115 | $sql .= " " . (!isset($this->batch) ? 'NULL' : "'" . $this->db->escape($this->batch) . "'") . ","; |
116 | 116 | $sql .= " " . (!isset($this->qty) ? 'NULL' : $this->qty) . ","; |
117 | 117 | $sql .= " " . (!isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'"); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $sql .= " pl.eatby,"; |
163 | 163 | $sql .= " pl.sellby"; |
164 | 164 | $sql .= " FROM " . $this->db->prefix() . "product_batch as t"; |
165 | - $sql .= " INNER JOIN " . $this->db->prefix() . "product_stock w on t.fk_product_stock = w.rowid"; // llx_product_stock is a parent table so this link does NOT generate duplicate record |
|
165 | + $sql .= " INNER JOIN " . $this->db->prefix() . "product_stock w on t.fk_product_stock = w.rowid"; // llx_product_stock is a parent table so this link does NOT generate duplicate record |
|
166 | 166 | $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lot as pl on pl.fk_product = w.fk_product and pl.batch = t.batch"; |
167 | 167 | $sql .= " WHERE t.rowid = " . ((int) $id); |
168 | 168 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | $this->tms = $this->db->jdate($obj->tms); |
432 | 432 | $this->fk_product_stock = $obj->fk_product_stock; |
433 | 433 | $this->sellby = $this->db->jdate($obj->sellby); // deprecated. do no tuse this data. |
434 | - $this->eatby = $this->db->jdate($obj->eatby); // deprecated. do not use this data. |
|
434 | + $this->eatby = $this->db->jdate($obj->eatby); // deprecated. do not use this data. |
|
435 | 435 | $this->batch = $obj->batch; |
436 | 436 | $this->qty = $obj->qty; |
437 | 437 | $this->import_key = $obj->import_key; |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | if ($fk_product > 0) { |
531 | 531 | // Some properties of the lot |
532 | - $tmp->lotid = $obj->lotid; // ID in table of the details of properties of each lots |
|
532 | + $tmp->lotid = $obj->lotid; // ID in table of the details of properties of each lots |
|
533 | 533 | $tmp->sellby = $dbs->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby); |
534 | 534 | $tmp->eatby = $dbs->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby); |
535 | 535 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | return $this->LibStatut($this->status, $mode); |
548 | 548 | } |
549 | 549 | |
550 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
550 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
551 | 551 | /** |
552 | 552 | * Renvoi le libelle d'un status donne |
553 | 553 | * |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | */ |
558 | 558 | public function LibStatut($status, $mode = 0) |
559 | 559 | { |
560 | - // phpcs:enable |
|
560 | + // phpcs:enable |
|
561 | 561 | global $langs; |
562 | 562 | |
563 | 563 | if ($mode == 0) { |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | return $this->LibStatut(0, $mode); |
1063 | 1063 | } |
1064 | 1064 | |
1065 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1065 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1066 | 1066 | /** |
1067 | 1067 | * Return label of a given status |
1068 | 1068 | * |
@@ -1072,7 +1072,7 @@ discard block |
||
1072 | 1072 | */ |
1073 | 1073 | public function LibStatut($status, $mode = 0) |
1074 | 1074 | { |
1075 | - // phpcs:enable |
|
1075 | + // phpcs:enable |
|
1076 | 1076 | //global $langs; |
1077 | 1077 | |
1078 | 1078 | //$langs->load('stocks'); |
@@ -1030,7 +1030,7 @@ |
||
1030 | 1030 | $obj = $this->db->fetch_object($result); |
1031 | 1031 | $this->stats_mo['customers_' . $role] = $obj->nb_customers ? $obj->nb_customers : 0; |
1032 | 1032 | $this->stats_mo['nb_' . $role] = $obj->nb ? $obj->nb : 0; |
1033 | - $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
1033 | + $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
1034 | 1034 | } else { |
1035 | 1035 | $this->error = $this->db->error(); |
1036 | 1036 | $error++; |