@@ -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++; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
171 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
172 | 172 | /** |
173 | 173 | * List all price expressions |
174 | 174 | * |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function list_price_expression() |
178 | 178 | { |
179 | - // phpcs:enable |
|
179 | + // phpcs:enable |
|
180 | 180 | $sql = "SELECT rowid, title, expression"; |
181 | 181 | $sql .= " FROM " . $this->db->prefix() . $this->table_element; |
182 | 182 | $sql .= " ORDER BY title"; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | |
206 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
206 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
207 | 207 | /** |
208 | 208 | * Returns any existing rowid with specified title |
209 | 209 | * |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function find_title($title) |
214 | 214 | { |
215 | - // phpcs:enable |
|
215 | + // phpcs:enable |
|
216 | 216 | $sql = "SELECT rowid"; |
217 | 217 | $sql .= " FROM " . $this->db->prefix() . $this->table_element; |
218 | 218 | $sql .= " WHERE title = '" . $this->db->escape($title) . "'"; |
@@ -256,7 +256,7 @@ |
||
256 | 256 | $sql .= " " . (empty($this->localtax2_type) ? "'0'" : "'" . $this->db->escape($this->localtax2_type) . "'") . ","; |
257 | 257 | $sql .= " " . (!isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx)) . ","; |
258 | 258 | $sql .= " " . ((int) $user->id) . ","; |
259 | - $sql .= " " . (!isset($this->price_label) ? 'NULL' : "'" . $this->db->escape($this->price_label) . "'") . ","; |
|
259 | + $sql .= " " . (!isset($this->price_label) ? 'NULL' : "'" . $this->db->escape($this->price_label) . "'") . ","; |
|
260 | 260 | $sql .= " " . (!isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'"); |
261 | 261 | $sql .= ")"; |
262 | 262 |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | 'skip_batch' => &$skip_batch, |
220 | 220 | 'id_product_batch' => &$id_product_batch |
221 | 221 | ); |
222 | - $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
222 | + $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
223 | 223 | |
224 | 224 | if ($reshook < 0) { |
225 | 225 | if (!empty($hookmanager->resPrint)) { |
@@ -708,8 +708,8 @@ discard block |
||
708 | 708 | $this->price = $obj->price; |
709 | 709 | $this->fk_user_author = $obj->fk_user_author; |
710 | 710 | $this->label = $obj->label; |
711 | - $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
712 | - $this->origintype = $obj->origin_type; // For backward compatibility |
|
711 | + $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
712 | + $this->origintype = $obj->origin_type; // For backward compatibility |
|
713 | 713 | $this->origin_id = $obj->origin_id; |
714 | 714 | $this->origin_type = $obj->origin_type; |
715 | 715 | $this->inventorycode = $obj->inventorycode; |
@@ -944,8 +944,8 @@ discard block |
||
944 | 944 | } else { // product_batch record not found |
945 | 945 | $pdluo->fk_product_stock = $vfk_product_stock; |
946 | 946 | $pdluo->qty = $qty; |
947 | - $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
948 | - $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
947 | + $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
948 | + $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
949 | 949 | $pdluo->batch = $vbatchnumber; |
950 | 950 | |
951 | 951 | $result = $pdluo->create($user, 1); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $this->db = $db; |
167 | 167 | } |
168 | 168 | |
169 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
169 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
170 | 170 | /** |
171 | 171 | * Add a movement of stock (in one direction only). |
172 | 172 | * This is the lowest level method to record a stock change. There is no control if warehouse is open or not. |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0, $disablestockchangeforsubproduct = 0, $donotcleanemptylines = 0, $force_update_batch = false) |
198 | 198 | { |
199 | - // phpcs:enable |
|
199 | + // phpcs:enable |
|
200 | 200 | global $conf, $langs; |
201 | 201 | |
202 | 202 | |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | return $result; |
966 | 966 | } |
967 | 967 | |
968 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
968 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
969 | 969 | /** |
970 | 970 | * Return Url link of origin object |
971 | 971 | * |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | */ |
976 | 976 | public function get_origin($origin_id, $origin_type) |
977 | 977 | { |
978 | - // phpcs:enable |
|
978 | + // phpcs:enable |
|
979 | 979 | $origin = ''; |
980 | 980 | |
981 | 981 | switch ($origin_type) { |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | return $this->LibStatut($mode); |
1189 | 1189 | } |
1190 | 1190 | |
1191 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1191 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1192 | 1192 | /** |
1193 | 1193 | * Return the label of the status |
1194 | 1194 | * |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | */ |
1198 | 1198 | public function LibStatut($mode = 0) |
1199 | 1199 | { |
1200 | - // phpcs:enable |
|
1200 | + // phpcs:enable |
|
1201 | 1201 | global $langs; |
1202 | 1202 | |
1203 | 1203 | if ($mode == 0 || $mode == 1) { |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | return $this->LibStatut($this->status, $mode); |
649 | 649 | } |
650 | 650 | |
651 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
651 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
652 | 652 | /** |
653 | 653 | * Return the status |
654 | 654 | * |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | */ |
659 | 659 | public static function LibStatut($status, $mode = 0) |
660 | 660 | { |
661 | - // phpcs:enable |
|
661 | + // phpcs:enable |
|
662 | 662 | global $langs; |
663 | 663 | |
664 | 664 | $labelStatus = array(); |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public $picto = 'inventory'; |
66 | 66 | |
67 | - const STATUS_DRAFT = 0; // Draft |
|
68 | - const STATUS_VALIDATED = 1; // Inventory is in process |
|
69 | - const STATUS_RECORDED = 2; // Inventory is finisged. Stock movement has been recorded. |
|
70 | - const STATUS_CANCELED = 9; // Canceled |
|
67 | + const STATUS_DRAFT = 0; // Draft |
|
68 | + const STATUS_VALIDATED = 1; // Inventory is in process |
|
69 | + const STATUS_RECORDED = 2; // Inventory is finisged. Stock movement has been recorded. |
|
70 | + const STATUS_CANCELED = 9; // Canceled |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Warehouse', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'index' => 1, 'help' => 'InventoryForASpecificWarehouse', 'picto' => 'stock', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'), |
108 | 108 | 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php', 'label' => 'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible' => 1, 'enabled' => 1, 'position' => 32, 'index' => 1, 'help' => 'InventoryForASpecificProduct', 'picto' => 'product', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'), |
109 | 109 | 'categories_product' => array('type' => 'chkbxlst:categorie:label:rowid::type=0:0:', 'label' => 'OrProductsWithCategories', 'visible' => 3, 'enabled' => 1, 'position' => 33, 'help' => '', 'picto' => 'category', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx'), |
110 | - 'date_inventory' => array('type' => 'date', 'label' => 'DateValue', 'visible' => 1, 'enabled' => '$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position' => 35, 'csslist' => 'nowraponall'), // This date is not used so disabled by default. |
|
110 | + 'date_inventory' => array('type' => 'date', 'label' => 'DateValue', 'visible' => 1, 'enabled' => '$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position' => 35, 'csslist' => 'nowraponall'), // This date is not used so disabled by default. |
|
111 | 111 | 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500, 'csslist' => 'nowraponall'), |
112 | 112 | 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501, 'csslist' => 'nowraponall'), |
113 | 113 | 'date_validation' => array('type' => 'datetime', 'label' => 'DateValidation', 'visible' => -2, 'enabled' => 1, 'position' => 502, 'csslist' => 'nowraponall'), |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | return 1; |
559 | 559 | } |
560 | 560 | |
561 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
561 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
562 | 562 | /** |
563 | 563 | * Update next_update into database |
564 | 564 | * |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | */ |
570 | 570 | public function update_next_update($next_update, $user = null, $notrigger = 0) |
571 | 571 | { |
572 | - // phpcs:enable |
|
572 | + // phpcs:enable |
|
573 | 573 | $error = 0; |
574 | 574 | |
575 | 575 | $this->next_update = $next_update; |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | } |
604 | 604 | } |
605 | 605 | |
606 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
606 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
607 | 607 | /** |
608 | 608 | * Update last_status into database |
609 | 609 | * |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | */ |
615 | 615 | public function update_status($last_status, $user = null, $notrigger = 0) |
616 | 616 | { |
617 | - // phpcs:enable |
|
617 | + // phpcs:enable |
|
618 | 618 | $error = 0; |
619 | 619 | |
620 | 620 | $this->last_status = $last_status; |