From f8a34e7489b366c3ccd4d0e44604277edcd2e743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 21:04:19 +0200 Subject: [PATCH] phpdoc (#30209) * phpdoc * phpdoc * phpdoc * phpdoc --- htdocs/commande/class/commande.class.php | 13 +++++++++---- htdocs/commande/index.php | 6 +++--- htdocs/delivery/class/delivery.class.php | 21 ++++++++++++--------- htdocs/expedition/index.php | 5 +++-- htdocs/mrp/class/api_mos.class.php | 15 ++++++++------- htdocs/mrp/class/mo.class.php | 6 ++++-- 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 290dd95235c..4952b0dfd50 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -190,19 +190,19 @@ class Commande extends CommonOrder public $demand_reason_code; /** - * @var int Date of order + * @var null|int|'' Date of order */ public $date; /** - * @var int Date of order + * @var null|int|'' Date of order * @deprecated * @see $date */ public $date_commande; /** - * @var int Date expected of shipment (date of start of shipment, not the reception that occurs some days after) + * @var null|int|'' Date expected of shipment (date of start of shipment, not the reception that occurs some days after) */ public $delivery_date; @@ -363,7 +363,12 @@ class Commande extends CommonOrder * Shipment on process */ const STATUS_SHIPMENTONPROCESS = 2; // We set this status when a shipment is validated - const STATUS_ACCEPTED = 2; // For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. + + /** + * For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. + * @deprecated + */ + const STATUS_ACCEPTED = 2; /** * Closed (Sent, billed or not) diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 115e7a7726c..7644aaae322 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -344,7 +344,7 @@ if (isModEnabled('order')) { } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; - $sql .= " AND c.fk_statut = ".((int) Commande::STATUS_ACCEPTED); + $sql .= " AND c.fk_statut = ".((int) Commande::STATUS_SHIPMENTONPROCESS); if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } @@ -360,7 +360,7 @@ if (isModEnabled('order')) { print '
'; print ''; print ''; - print ''; + print ''; if ($num) { $i = 0; diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 8894b2ff420..1d5aad2ee74 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -6,8 +6,8 @@ * Copyright (C) 2011-2023 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2023-2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -89,12 +89,12 @@ class Delivery extends CommonObject public $ref_customer; /** - * @var integer|string Date really received + * @var int|'' Date really received */ public $date_delivery; /** - * @var integer|string date_valid + * @var int|'' date_valid */ public $date_valid; @@ -103,6 +103,9 @@ class Delivery extends CommonObject */ public $model_pdf; + /** + * @var int ID of order + */ public $commande_id; /** @@ -355,7 +358,7 @@ class Delivery extends CommonObject $this->label_incoterms = $obj->label_incoterms; $this->db->free($result); - if ($this->statut == 0) { + if ($this->status == 0) { $this->draft = 1; } @@ -509,7 +512,7 @@ class Delivery extends CommonObject // Set new ref and current status if (!$error) { $this->ref = $numref; - $this->statut = 1; + $this->status = 1; } dol_syslog(get_class($this)."::valid ok"); @@ -650,7 +653,7 @@ class Delivery extends CommonObject */ public function deleteLine($lineid) { - if ($this->statut == 0) { + if ($this->status == 0) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."commandedet"; $sql .= " WHERE rowid = ".((int) $lineid); @@ -912,7 +915,7 @@ class Delivery extends CommonObject */ public function getLibStatut($mode = 0) { - return $this->LibStatut($this->statut, $mode); + return $this->LibStatut($this->status, $mode); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -996,7 +999,7 @@ class Delivery extends CommonObject $line->fk_product = reset($prodids); $line->qty_asked = 10; $line->qty_shipped = 9; - $line->ref = 'REFPROD'; + $line->product_ref = 'REFPROD'; $line->label = 'Specimen'; $line->description = 'Description'; $line->price = 100; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 7ad70bc9359..79448398029 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -216,7 +217,7 @@ if (!$user->hasRight('societe', 'client', 'voir')) { } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('order').")"; -$sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_ACCEPTED.")"; +$sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_SHIPMENTONPROCESS.")"; if ($socid > 0) { $sql .= " AND c.fk_soc = ".((int) $socid); } @@ -236,7 +237,7 @@ if ($resql) { print ''; print ''; diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 5dc781d6110..52129d6ea2c 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2019 Maxime Kohlhaas +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2019 Maxime Kohlhaas * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -412,7 +413,7 @@ class Mos extends DolibarrApi $moline->fk_product = $value["objectid"]; $moline->fk_warehouse = $value["fk_warehouse"]; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'toproduce'; $moline->fk_mrp_production = ""; $moline->fk_stock_movement = $idstockmove; @@ -431,7 +432,7 @@ class Mos extends DolibarrApi $moline->fk_product = $value["objectid"]; $moline->fk_warehouse = $value["fk_warehouse"]; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'toconsume'; $moline->fk_mrp_production = ""; $moline->fk_stock_movement = $idstockmove; @@ -457,7 +458,7 @@ class Mos extends DolibarrApi $moline->fk_product = $value["objectid"]; $moline->fk_warehouse = $value["fk_warehouse"]; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; if ($arrayname == "arraytoconsume") { $moline->role = 'consumed'; } else { @@ -528,7 +529,7 @@ class Mos extends DolibarrApi $moline->fk_product = $line->fk_product; $moline->fk_warehouse = $line->fk_warehouse; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'consumed'; $moline->fk_mrp_production = $line->id; $moline->fk_stock_movement = $idstockmove; @@ -588,7 +589,7 @@ class Mos extends DolibarrApi $moline->fk_product = $line->fk_product; $moline->fk_warehouse = $line->fk_warehouse; $moline->qty = $qtytoprocess; - $moline->batch = $tmpproduct->status_batch; + $moline->batch = (string) $tmpproduct->status_batch; $moline->role = 'produced'; $moline->fk_mrp_production = $line->id; $moline->fk_stock_movement = $idstockmove; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 38ab5e1d7b3..42e94c80cbe 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -2092,12 +2092,14 @@ class MoLine extends CommonObjectLine public $qty_frozen; public $disable_stock_change; public $efficiency; + + /** + * @var string batch reference + */ public $batch; public $role; public $fk_mrp_production; public $fk_stock_movement; - public $fk_user_creat; - public $fk_user_modif; public $import_key; public $fk_parent_line; public $fk_unit;
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$langs->trans("OnProcessOrders").' '.$num.'
'.$langs->trans("OrdersToProcess").' '; - print ''; + print ''; print ''.$num.''; print ''; print '