diff options
Diffstat (limited to 'src/model/entities/Devis.php')
| -rw-r--r-- | src/model/entities/Devis.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/model/entities/Devis.php b/src/model/entities/Devis.php index 8518f8e..ce2a043 100644 --- a/src/model/entities/Devis.php +++ b/src/model/entities/Devis.php | |||
| @@ -43,10 +43,8 @@ class Devis | |||
| 43 | 43 | ||
| 44 | public static EntityManager $entityManager; | 44 | public static EntityManager $entityManager; |
| 45 | 45 | ||
| 46 | public function __construct(Prestation $presta = null) | 46 | public function __construct(?Prestation $presta = null){ |
| 47 | { | 47 | if($presta != null){ |
| 48 | if($presta != null) | ||
| 49 | { | ||
| 50 | $this->setPresta($presta); | 48 | $this->setPresta($presta); |
| 51 | } | 49 | } |
| 52 | } | 50 | } |
| @@ -63,7 +61,7 @@ class Devis | |||
| 63 | } | 61 | } |
| 64 | 62 | ||
| 65 | public function getAllWithWindowFields(): array | 63 | public function getAllWithWindowFields(): array |
| 66 | { | 64 | { |
| 67 | //~ $taches = ["Tâches:" => $this->taches]; | 65 | //~ $taches = ["Tâches:" => $this->taches]; |
| 68 | //~ $champs_communs = [ | 66 | //~ $champs_communs = [ |
| 69 | //~ "Total Main d'oeuvre:" => $this->total_main_d_oeuvre, | 67 | //~ "Total Main d'oeuvre:" => $this->total_main_d_oeuvre, |
| @@ -86,7 +84,7 @@ class Devis | |||
| 86 | "Total HT:" => $this->total_HT, | 84 | "Total HT:" => $this->total_HT, |
| 87 | "Delai de livraison:" => $this->delai_livraison, | 85 | "Delai de livraison:" => $this->delai_livraison, |
| 88 | "Durée de validité:" => $this->validite_devis, | 86 | "Durée de validité:" => $this->validite_devis, |
| 89 | "Devis signé:" => $this->signature_devis]; | 87 | "Devis signé:" => $this->signature_devis]; |
| 90 | } | 88 | } |
| 91 | 89 | ||
| 92 | // setters | 90 | // setters |
| @@ -165,7 +163,7 @@ class Devis | |||
| 165 | $this->total_HT = (float) $value; | 163 | $this->total_HT = (float) $value; |
| 166 | return($this); | 164 | return($this); |
| 167 | } | 165 | } |
| 168 | public function setPrixDevis($value) | 166 | public function setPrixDevis(string $value): Devis |
| 169 | { | 167 | { |
| 170 | $value = str_replace(',', '.', $value); | 168 | $value = str_replace(',', '.', $value); |
| 171 | $this->prix_devis = (float) $value; | 169 | $this->prix_devis = (float) $value; |
| @@ -219,8 +217,8 @@ class Devis | |||
| 219 | } | 217 | } |
| 220 | $data_array = explode('|', $answers); // array | 218 | $data_array = explode('|', $answers); // array |
| 221 | 219 | ||
| 222 | $check = false; | 220 | //$check = false; |
| 223 | if(count($data_array) === 9) // facture normale | 221 | if(count($data_array) === 9) // facture normale, "=== 9" = merdique |
| 224 | { | 222 | { |
| 225 | $this->getPresta()->setModePaiement(''); // sécurité, doctrine plante si "null" | 223 | $this->getPresta()->setModePaiement(''); // sécurité, doctrine plante si "null" |
| 226 | $this->setAll($data_array); | 224 | $this->setAll($data_array); |
