From 6f4cc3afffde36a13618458ffda72e6104624f36 Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 30 Aug 2023 12:20:39 +0200 Subject: =?UTF-8?q?section=20client=20=C3=A0=20part,=20section=20modif=20e?= =?UTF-8?q?n=20cours,=20bug=20dans=20Dates,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/DevisFactures.php | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src/model/DevisFactures.php') diff --git a/src/model/DevisFactures.php b/src/model/DevisFactures.php index c9b7d18..5769842 100644 --- a/src/model/DevisFactures.php +++ b/src/model/DevisFactures.php @@ -22,12 +22,42 @@ class DevisFactures extends Model protected $validite_devis; protected $signature_devis; - //~ use ModelChildren; - public function __construct(string $table) { $this->table = $table; // deux tables séparées devis et factures } + public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this) + { + $champs_communs = [ + "Tâches:" => $this->taches, + "PC:" => $this->machine, + "OS:" => $this->OS, + "Données:" => $this->donnees, + "Clés de licences:" => $this->cles_licences, + "Total Main d'oeuvre:" => $this->total_main_d_oeuvre, + "Pièces" => $this->pieces, + "Total des pièces" => $this->total_pieces, + "Déplacement" => $this->deplacement, + "Total HT" => $this->total_HT]; + + if($this->table === 'factures') + { + return ["Numéro facture:" => $this->ID] + $champs_communs; + } + elseif($this->table === 'devis') + { + $champs_devis = [ + "Delai de livraison" => $this->delai_livraison, + "Durée de validité" => $this->validite_devis, + "Devis signé?" => $this->signature_devis]; + + return ["Numéro devis:" => $this->ID] + $champs_communs + $champs_devis; + } + else + { + return []; + } + } // setters public function setIDPresta(int $value) -- cgit v1.2.3