@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | $object->fields = dol_sort_array($object->fields, 'position'); |
317 | 317 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
318 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
318 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
319 | 319 | |
320 | 320 | // Security check |
321 | 321 | if ($search_type == '0') { |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | if (isModEnabled('category') && $user->hasRight($rightskey, 'creer')) { |
864 | 864 | $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"') . $langs->trans("AffectTag"); |
865 | 865 | } |
866 | -if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_extrafields', 'preupdateprice'))) { |
|
866 | +if (in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'edit_extrafields', 'preupdateprice'))) { |
|
867 | 867 | $arrayofmassactions = array(); |
868 | 868 | } |
869 | 869 | if ($user->hasRight($rightskey, 'supprimer')) { |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | } |
977 | 977 | |
978 | 978 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
979 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
979 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
980 | 980 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
981 | 981 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
982 | 982 | |
@@ -1948,10 +1948,10 @@ discard block |
||
1948 | 1948 | |
1949 | 1949 | // Multiprices |
1950 | 1950 | if (getDolGlobalString('PRODUIT_MULTIPRICES')) { |
1951 | - if (! isset($productpricescache)) { |
|
1951 | + if (!isset($productpricescache)) { |
|
1952 | 1952 | $productpricescache = array(); |
1953 | 1953 | } |
1954 | - if (! isset($productpricescache[$obj->rowid])) { |
|
1954 | + if (!isset($productpricescache[$obj->rowid])) { |
|
1955 | 1955 | $productpricescache[$obj->rowid] = array(); |
1956 | 1956 | } |
1957 | 1957 |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public $price; |
148 | 148 | |
149 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
149 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
150 | 150 | |
151 | 151 | /** |
152 | 152 | * Selling price with tax |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public $price_ttc; |
157 | 157 | |
158 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
158 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
159 | 159 | |
160 | 160 | /** |
161 | 161 | * Minimum price net |
@@ -408,20 +408,20 @@ discard block |
||
408 | 408 | |
409 | 409 | //! Metric of products |
410 | 410 | public $weight; |
411 | - public $weight_units; // scale -3, 0, 3, 6 |
|
411 | + public $weight_units; // scale -3, 0, 3, 6 |
|
412 | 412 | public $length; |
413 | - public $length_units; // scale -3, 0, 3, 6 |
|
413 | + public $length_units; // scale -3, 0, 3, 6 |
|
414 | 414 | public $width; |
415 | - public $width_units; // scale -3, 0, 3, 6 |
|
415 | + public $width_units; // scale -3, 0, 3, 6 |
|
416 | 416 | public $height; |
417 | - public $height_units; // scale -3, 0, 3, 6 |
|
417 | + public $height_units; // scale -3, 0, 3, 6 |
|
418 | 418 | public $surface; |
419 | - public $surface_units; // scale -3, 0, 3, 6 |
|
419 | + public $surface_units; // scale -3, 0, 3, 6 |
|
420 | 420 | public $volume; |
421 | - public $volume_units; // scale -3, 0, 3, 6 |
|
421 | + public $volume_units; // scale -3, 0, 3, 6 |
|
422 | 422 | |
423 | 423 | public $net_measure; |
424 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
424 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
425 | 425 | |
426 | 426 | public $accountancy_code_sell; |
427 | 427 | public $accountancy_code_sell_intra; |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
634 | 634 | //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
635 | 635 | //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
636 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
636 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
637 | 637 | ); |
638 | 638 | |
639 | 639 | /** |
@@ -1957,7 +1957,7 @@ discard block |
||
1957 | 1957 | */ |
1958 | 1958 | private function getArrayForPriceCompare($level = 0) |
1959 | 1959 | { |
1960 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
1960 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
1961 | 1961 | |
1962 | 1962 | foreach ($testExit as $field) { |
1963 | 1963 | if (!isset($this->$field)) { |
@@ -2601,8 +2601,8 @@ discard block |
||
2601 | 2601 | |
2602 | 2602 | //For MultiCompany |
2603 | 2603 | //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
2604 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2605 | - $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2604 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
2605 | + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
2606 | 2606 | $visibleWarehousesEntities = $conf->entity; |
2607 | 2607 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
2608 | 2608 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
@@ -2795,15 +2795,15 @@ discard block |
||
2795 | 2795 | $sql .= " WHERE entity IN (" . getEntity('productprice') . ")"; |
2796 | 2796 | $sql .= " AND price_level=" . ((int) $i); |
2797 | 2797 | $sql .= " AND fk_product = " . ((int) $this->id); |
2798 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
2799 | - $sql .= " LIMIT 1"; // Only the first one |
|
2798 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
2799 | + $sql .= " LIMIT 1"; // Only the first one |
|
2800 | 2800 | $resql = $this->db->query($sql); |
2801 | 2801 | if ($resql) { |
2802 | 2802 | $result = $this->db->fetch_array($resql); |
2803 | 2803 | |
2804 | 2804 | $this->multiprices[$i] = $result ? $result["price"] : null; |
2805 | 2805 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
2806 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
2806 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
2807 | 2807 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
2808 | 2808 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
2809 | 2809 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -3028,7 +3028,7 @@ discard block |
||
3028 | 3028 | $obj = $this->db->fetch_object($result); |
3029 | 3029 | $this->stats_mo['customers_' . $role] = $obj->nb_customers ? $obj->nb_customers : 0; |
3030 | 3030 | $this->stats_mo['nb_' . $role] = $obj->nb ? $obj->nb : 0; |
3031 | - $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3031 | + $this->stats_mo['qty_' . $role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
3032 | 3032 | } else { |
3033 | 3033 | $this->error = $this->db->error(); |
3034 | 3034 | $error++; |
@@ -4534,7 +4534,7 @@ discard block |
||
4534 | 4534 | //Addition of a product with the highest rank +1 |
4535 | 4535 | $sql = "INSERT INTO " . $this->db->prefix() . "product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
4536 | 4536 | $sql .= " VALUES (" . ((int) $id_pere) . ", " . ((int) $id_fils) . ", " . price2num($qty, 'MS') . ", " . ((int) $incdec) . ", " . ((int) $rank) . ")"; |
4537 | - if (! $this->db->query($sql)) { |
|
4537 | + if (!$this->db->query($sql)) { |
|
4538 | 4538 | dol_print_error($this->db); |
4539 | 4539 | return -1; |
4540 | 4540 | } else { |
@@ -4655,7 +4655,7 @@ discard block |
||
4655 | 4655 | $sql = "UPDATE " . $this->db->prefix() . "product_association"; |
4656 | 4656 | $sql .= " SET rang = " . ((int) $cpt); |
4657 | 4657 | $sql .= " WHERE rowid = " . ((int) $objrank->rowid); |
4658 | - if (! $this->db->query($sql)) { |
|
4658 | + if (!$this->db->query($sql)) { |
|
4659 | 4659 | dol_print_error($this->db); |
4660 | 4660 | return -1; |
4661 | 4661 | } |
@@ -6722,7 +6722,7 @@ discard block |
||
6722 | 6722 | */ |
6723 | 6723 | public function getKanbanView($option = '', $arraydata = null) |
6724 | 6724 | { |
6725 | - global $langs,$conf; |
|
6725 | + global $langs, $conf; |
|
6726 | 6726 | |
6727 | 6727 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
6728 | 6728 |
@@ -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 | } |
@@ -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 |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | //this query will return total products with the filters given |
235 | - $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
235 | + $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
236 | 236 | |
237 | 237 | $sql .= $this->db->order($sortfield, $sortorder); |
238 | 238 | if ($limit) { |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | if (getDolGlobalString('PRODUIT_MULTIPRICES')) { |
331 | 331 | $key_max = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); |
332 | - for ($key = 1; $key <= $key_max ; $key++) { |
|
332 | + for ($key = 1; $key <= $key_max; $key++) { |
|
333 | 333 | $newvat = $this->product->multiprices_tva_tx[$key]; |
334 | 334 | $newnpr = 0; |
335 | 335 | $newvatsrccode = $this->product->default_vat_code; |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | |
463 | 463 | if ($result > 0 && getDolGlobalString('PRODUIT_MULTIPRICES')) { |
464 | 464 | $key_max = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'); |
465 | - for ($key = 1; $key <= $key_max ; $key++) { |
|
465 | + for ($key = 1; $key <= $key_max; $key++) { |
|
466 | 466 | $pricemodified = false; |
467 | 467 | if ($this->product->multiprices_base_type[$key] != $oldproduct->multiprices_base_type[$key]) { |
468 | 468 | $pricemodified = true; |
@@ -444,7 +444,7 @@ |
||
444 | 444 | |
445 | 445 | $unitline = price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MU'); |
446 | 446 | $totalline = price2num($value['nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise), 'MT'); |
447 | - $total += $totalline; |
|
447 | + $total += $totalline; |
|
448 | 448 | |
449 | 449 | print '<td class="right nowraponall">'; |
450 | 450 | print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'] . 'x ' : '') . '<span class="amount">' . price($unitline, 0, '', 0, 0, -1, $conf->currency)) . '</span>'; |
@@ -227,7 +227,7 @@ |
||
227 | 227 | $i = 0; |
228 | 228 | $fail = 0; |
229 | 229 | $orders = array(); |
230 | - $suppliersid = array_keys($suppliers); // array of ids of suppliers |
|
230 | + $suppliersid = array_keys($suppliers); // array of ids of suppliers |
|
231 | 231 | foreach ($suppliers as $supplier) { |
232 | 232 | $order = new CommandeFournisseur($db); |
233 | 233 |
@@ -579,7 +579,7 @@ |
||
579 | 579 | $maxfilesizearray = getMaxFileSizeArray(); |
580 | 580 | $maxmin = $maxfilesizearray['maxmin']; |
581 | 581 | if ($maxmin > 0) { |
582 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
582 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
583 | 583 | } |
584 | 584 | print '<input type="file" name="userfile" size="20" maxlength="80"> '; |
585 | 585 | $out = (!getDolGlobalString('MAIN_UPLOAD_DOC') ? ' disabled' : ''); |
@@ -1294,7 +1294,7 @@ |
||
1294 | 1294 | $pse = new ProductStockEntrepot($db); |
1295 | 1295 | $lines = $pse->fetchAll($id); |
1296 | 1296 | |
1297 | - $visibleWarehouseEntities = explode(',', getEntity('stock')); // For MultiCompany compatibility |
|
1297 | + $visibleWarehouseEntities = explode(',', getEntity('stock')); // For MultiCompany compatibility |
|
1298 | 1298 | |
1299 | 1299 | if (!empty($lines)) { |
1300 | 1300 | $var = false; |