From a4d88fd1913758cc95b395eefcf5e9d730450382 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 23 Dec 2023 10:00:24 +0100 Subject: =?UTF-8?q?devis=20payant,=20cr=C3=A9er=20devis=20depuis=20facture?= =?UTF-8?q?,=20changement=20dans=20getIDsByIdClient(),=20suppression=20d?= =?UTF-8?q?=C3=A9pendance=20paquet=20latex=20"ulem",=20(string)=20dans=20s?= =?UTF-8?q?etTelephone()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/DevisFactures.php | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'src/model/DevisFactures.php') diff --git a/src/model/DevisFactures.php b/src/model/DevisFactures.php index 259690b..7c31f13 100644 --- a/src/model/DevisFactures.php +++ b/src/model/DevisFactures.php @@ -17,6 +17,7 @@ class DevisFactures extends Model protected $pieces; protected $total_pieces; protected $deplacement; + protected $prix_devis; protected $total_HT; protected $delai_livraison; protected $validite_devis; @@ -26,6 +27,7 @@ class DevisFactures extends Model { $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) { $taches = ["Tâches:" => $this->taches]; @@ -60,7 +62,8 @@ class DevisFactures extends Model return []; } } - public function set(string $entry, string $input) + + public function set(string $entry, string $input) // trouve la bonne méthode { switch($entry) { @@ -91,6 +94,9 @@ class DevisFactures extends Model case "Déplacement:": $this->setDeplacement($input); break; + case "Prix du devis:": + $this->setPrixDevis($input); + break; case "Total HT:": $this->setTotalHT($input); break; @@ -142,11 +148,6 @@ class DevisFactures extends Model $this->cles_licences = $value; return($this); } - //~ public function setTemps(string $value) - //~ { - //~ $this->temps = $value; - //~ return($this); - //~ } public function setTotalMainDOeuvre($value) { $value = str_replace(',', '.', $value); @@ -176,6 +177,12 @@ class DevisFactures extends Model $this->total_HT = (float) $value; return($this); } + public function setPrixDevis($value) + { + $value = str_replace(',', '.', $value); + $this->prix_devis = (float) $value; + return($this); + } public function setDelaiLivraison(string $value) { $this->delai_livraison = $value; @@ -192,6 +199,19 @@ class DevisFactures extends Model return($this); } + // création d'une facture à partir d'un devis + public function hydrateReceiptWithQuotation($ReceiptDetails) + { + $ReceiptDetails->hydrate([ + 'taches' => $this->taches, + 'total_main_d_oeuvre' => $this->total_main_d_oeuvre, + 'pieces' => $this->pieces, + 'total_pieces' => $this->total_pieces, + 'deplacement' => $this->deplacement, + 'total_HT' => $this->total_HT + ]); + } + //~ public function newRow(array $input) //~ { //~ if($this->table === 'devis') // comme la table 'factures' avec deux champs en plus -- cgit v1.2.3