From 42865a975a125e0610f8e2a0409fbfb84453bf73 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 20 Oct 2023 02:20:26 +0200 Subject: [PATCH] Fix some code smell (#26277) * Fix some code smell * Update commande.class.php --------- Co-authored-by: Hystepik Co-authored-by: Laurent Destailleur --- .../accountancy/class/bookkeeping.class.php | 10 ++++++++ htdocs/api/class/api_documents.class.php | 8 +++--- htdocs/comm/propal/class/propal.class.php | 5 ++++ htdocs/commande/class/commande.class.php | 8 +++--- .../class/bonprelevement.class.php | 2 ++ .../class/ligneprelevement.class.php | 25 +++++++++++++++++++ 6 files changed, 50 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index adb296924af..634e4f54f83 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -169,6 +169,16 @@ class BookKeeping extends CommonObject */ public $piece_num; + /** + * @var BookKeepingLine[] Movement line array + */ + public $linesmvt = array(); + + /** + * @var BookKeepingLine[] export line array + */ + public $linesexport = array(); + /** * @var integer|string date of movement validated & lock */ diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index dbbc6ea9dd8..fc304315494 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -255,15 +255,15 @@ class Documents extends DolibarrApi } elseif ($modulepart == 'expedition' || $modulepart == 'shipment') { require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php'; - $this->shipment = new Expedition($this->db); - $result = $this->shipment->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); + $tmpobject = new Expedition($this->db); + $result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file))); if (!$result) { throw new RestException(404, 'Shipment not found'); } - $templateused = $doctemplate ? $doctemplate : $this->shipment->model_pdf; - $result = $this->shipment->generateDocument($templateused, $outputlangs, $hidedetails, $hidedesc, $hideref); + $templateused = $doctemplate ? $doctemplate : $tmpobject->model_pdf; + $result = $tmpobject->generateDocument($templateused, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { throw new RestException(500, 'Error generating document missing doctemplate parameter'); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 12bed14e4c3..74afddfb44d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -265,6 +265,11 @@ class Propal extends CommonObject */ public $availability_code; + /** + * @var string availabilty label + */ + public $availability; + public $duree_validite; public $demand_reason_id; // id diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 772fc2dad8e..de0abc819de 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -130,6 +130,10 @@ class Commande extends CommonOrder */ public $billed; + /** + * @var string Limit date payment + */ + public $date_lim_reglement; /** * @var string Condition payment code */ @@ -220,10 +224,6 @@ class Commande extends CommonOrder */ public $remise_percent; - public $remise_absolue; - public $info_bits; - public $rang; - public $special_code; public $source; // Order mode. How we received order (by phone, by email, ...) /** diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index ad87cbfd25f..8fbda48208e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -80,6 +80,8 @@ class BonPrelevement extends CommonObject public $factures = array(); + public $methodes_trans = array(); + public $invoice_in_error = array(); public $thirdparty_in_error = array(); diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 71194ef4020..36758d310c2 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -36,6 +36,31 @@ class LignePrelevement */ public $id; + /** + * @var float Amount + */ + public $amount; + + /** + * @var int Socid + */ + public $socid; + + /** + * @var int Status of the line + */ + public $statut; + + /** + * @var string Ref of bon + */ + public $bon_ref; + + /** + * @var int ID of bon + */ + public $bon_rowid; + /** * @var DoliDB Database handler. */