@@ -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 |
@@ -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 |
@@ -1942,7 +1942,7 @@ discard block |
||
1942 | 1942 | return array('stock_warehouses' => $stockData); |
1943 | 1943 | } |
1944 | 1944 | |
1945 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
1945 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
1946 | 1946 | /** |
1947 | 1947 | * Clean sensible object datas |
1948 | 1948 | * |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | */ |
1952 | 1952 | protected function _cleanObjectDatas($object) |
1953 | 1953 | { |
1954 | - // phpcs:enable |
|
1954 | + // phpcs:enable |
|
1955 | 1955 | $object = parent::_cleanObjectDatas($object); |
1956 | 1956 | |
1957 | 1957 | unset($object->statut); |
@@ -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; |
@@ -467,13 +467,23 @@ |
||
467 | 467 | if ($this->product->multiprices_base_type[$key] != $oldproduct->multiprices_base_type[$key]) { |
468 | 468 | $pricemodified = true; |
469 | 469 | } else { |
470 | - if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) $pricemodified = true; |
|
470 | + if ($this->product->multiprices_tva_tx[$key] != $oldproduct->multiprices_tva_tx[$key]) { |
|
471 | + $pricemodified = true; |
|
472 | + } |
|
471 | 473 | if ($this->product->multiprices_base_type[$key] == 'TTC') { |
472 | - if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) $pricemodified = true; |
|
473 | - if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) $pricemodified = true; |
|
474 | + if ($this->product->multiprices_ttc[$key] != $oldproduct->multiprices_ttc[$key]) { |
|
475 | + $pricemodified = true; |
|
476 | + } |
|
477 | + if ($this->product->multiprices_min_ttc[$key] != $oldproduct->multiprices_min_ttc[$key]) { |
|
478 | + $pricemodified = true; |
|
479 | + } |
|
474 | 480 | } else { |
475 | - if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) $pricemodified = true; |
|
476 | - if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) $pricemodified = true; |
|
481 | + if ($this->product->multiprices[$key] != $oldproduct->multiprices[$key]) { |
|
482 | + $pricemodified = true; |
|
483 | + } |
|
484 | + if ($this->product->multiprices_min[$key] != $oldproduct->multiprices[$key]) { |
|
485 | + $pricemodified = true; |
|
486 | + } |
|
477 | 487 | } |
478 | 488 | } |
479 | 489 | if ($pricemodified && $result > 0) { |
@@ -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; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | // Get parameters |
35 | 35 | $id = GETPOSTINT('id'); |
36 | -$ref = GETPOST('ref', 'alpha'); |
|
36 | +$ref = GETPOST('ref', 'alpha'); |
|
37 | 37 | $action = GETPOST('action', 'aZ09'); |
38 | 38 | |
39 | 39 | // Initialize technical objects |