summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/dev.sqlitebin36864 -> 36864 bytes
-rw-r--r--src/model/CESU.php16
-rw-r--r--src/model/DevisFactures.php16
-rw-r--r--src/model/Locations.php40
-rw-r--r--src/sections/3_modify_data.php14
5 files changed, 68 insertions, 18 deletions
diff --git a/data/dev.sqlite b/data/dev.sqlite
index 07c5233..6d55fd5 100644
--- a/data/dev.sqlite
+++ b/data/dev.sqlite
Binary files differ
diff --git a/src/model/CESU.php b/src/model/CESU.php
index a8aa1e8..f6c6630 100644
--- a/src/model/CESU.php
+++ b/src/model/CESU.php
@@ -20,11 +20,25 @@ class CESU extends Model
20 public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this) 20 public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this)
21 { 21 {
22 return [ 22 return [
23 "Numéro CESU:" => $this->ID,
24 "Tâche effectuée:" => $this->taches, 23 "Tâche effectuée:" => $this->taches,
25 "Durée du travail:" => $this->duree_travail, 24 "Durée du travail:" => $this->duree_travail,
26 "Salaire:" => $this->salaire]; 25 "Salaire:" => $this->salaire];
27 } 26 }
27 public function set(string $entry, string $input)
28 {
29 switch($entry)
30 {
31 case "Tâche effectuée:":
32 $this->setTaches($input);
33 break;
34 case "Durée du travail:":
35 $this->setDureeTravail($input);
36 break;
37 case "Salaire:":
38 $this->setSalaire($input);
39 break;
40 }
41 }
28 42
29 // setters 43 // setters
30 public function setIDPresta(int $value) 44 public function setIDPresta(int $value)
diff --git a/src/model/DevisFactures.php b/src/model/DevisFactures.php
index 2a5bf8d..259690b 100644
--- a/src/model/DevisFactures.php
+++ b/src/model/DevisFactures.php
@@ -31,10 +31,10 @@ class DevisFactures extends Model
31 $taches = ["Tâches:" => $this->taches]; 31 $taches = ["Tâches:" => $this->taches];
32 $champs_communs = [ 32 $champs_communs = [
33 "Total Main d'oeuvre:" => $this->total_main_d_oeuvre, 33 "Total Main d'oeuvre:" => $this->total_main_d_oeuvre,
34 "Pièces" => $this->pieces, 34 "Pièces:" => $this->pieces,
35 "Total des pièces" => $this->total_pieces, 35 "Total des pièces:" => $this->total_pieces,
36 "Déplacement" => $this->deplacement, 36 "Déplacement:" => $this->deplacement,
37 "Total HT" => $this->total_HT]; 37 "Total HT:" => $this->total_HT];
38 38
39 if($this->table === 'factures') 39 if($this->table === 'factures')
40 { 40 {
@@ -49,9 +49,9 @@ class DevisFactures extends Model
49 elseif($this->table === 'devis') 49 elseif($this->table === 'devis')
50 { 50 {
51 $champs_devis = [ 51 $champs_devis = [
52 "Delai de livraison" => $this->delai_livraison, 52 "Delai de livraison:" => $this->delai_livraison,
53 "Durée de validité" => $this->validite_devis, 53 "Durée de validité:" => $this->validite_devis,
54 "Devis signé?" => $this->signature_devis]; 54 "Devis signé:" => $this->signature_devis];
55 55
56 return $champs_communs + $champs_devis; 56 return $champs_communs + $champs_devis;
57 } 57 }
@@ -100,7 +100,7 @@ class DevisFactures extends Model
100 case "Durée de validité:": 100 case "Durée de validité:":
101 $this->setValiditedevis($input); 101 $this->setValiditedevis($input);
102 break; 102 break;
103 case "Devis signé?:": 103 case "Devis signé:":
104 $this->setSignatureDevis($input); 104 $this->setSignatureDevis($input);
105 break; 105 break;
106 } 106 }
diff --git a/src/model/Locations.php b/src/model/Locations.php
index e3c9507..ead2727 100644
--- a/src/model/Locations.php
+++ b/src/model/Locations.php
@@ -24,16 +24,48 @@ class Locations extends Model
24 public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this) 24 public function getAllWithWindowFields(): array // différent de Model::getAll() qui retourne get_object_vars($this)
25 { 25 {
26 return [ 26 return [
27 "Numéro location:" => $this->ID,
28 "Désignation:" => $this->designation, 27 "Désignation:" => $this->designation,
29 "Description du modèle:" => $this->modele_description, 28 "Description du modèle:" => $this->modele_description,
30 "Valeur:" => $this->valeur, 29 "Valeur:" => $this->valeur,
31 "État des lieux de début:" => $this->etat_des_lieux_debut, 30 "État des lieux de début:" => $this->etat_des_lieux_debut,
32 "État des lieux de fin:" => $this->etat_des_lieux_fin, 31 "État des lieux de fin:" => $this->etat_des_lieux_fin,
33 "Durée de la location:" => $this->duree_location, 32 "Durée de la location:" => $this->duree_location,
34 "Loyer Mensuel" => $this->loyer_mensuel, 33 "Loyer Mensuel:" => $this->loyer_mensuel,
35 "Loyers Payés" => $this->loyers_payes, 34 "Loyers Payés:" => $this->loyers_payes,
36 "Caution" => $this->caution]; 35 "Caution:" => $this->caution];
36 }
37 public function set(string $entry, string $input)
38 {
39 switch($entry)
40 {
41 case "Désignation:":
42 $this->setDesignation($input);
43 break;
44 case "Description du modèle:":
45 $this->setModeleDescription($input);
46 break;
47 case "Valeur:":
48 $this->setValeur($input);
49 break;
50 case "État des lieux de début:":
51 $this->setEtatDesLieuxDebut($input);
52 break;
53 case "État des lieux de fin:":
54 $this->setEtatDesLieuxFin($input);
55 break;
56 case "Durée de la location:":
57 $this->setDureeLocation($input);
58 break;
59 case "Loyer Mensuel:":
60 $this->setLoyerMensuel($input);
61 break;
62 case "Loyers Payés:":
63 $this->setLoyersPayes($input);
64 break;
65 case "Caution:":
66 $this->setCaution($input);
67 break;
68 }
37 } 69 }
38 70
39 // setters 71 // setters
diff --git a/src/sections/3_modify_data.php b/src/sections/3_modify_data.php
index 71b977a..1f48870 100644
--- a/src/sections/3_modify_data.php
+++ b/src/sections/3_modify_data.php
@@ -153,7 +153,8 @@ function modifyData($Client): array
153 echo "choix: modifier" . $choix_niv3 . "\n"; 153 echo "choix: modifier" . $choix_niv3 . "\n";
154 $ModificationPrestaForm = new ZenityEntry($choix_niv3); 154 $ModificationPrestaForm = new ZenityEntry($choix_niv3);
155 $input = exec($ModificationPrestaForm->get()); 155 $input = exec($ModificationPrestaForm->get());
156 if(is_string($input) && $input != '') 156 //if(is_string($input) && $input != '')
157 if(is_string($input)) // chaine vide autorisée
157 { 158 {
158 $Presta->set($choix_niv3, $input); 159 $Presta->set($choix_niv3, $input);
159 $PrestaDetails->set($choix_niv3, $input); 160 $PrestaDetails->set($choix_niv3, $input);
@@ -163,10 +164,13 @@ function modifyData($Client): array
163 $PrestaDetails->update(); 164 $PrestaDetails->update();
164 165
165 // mettre à jour les documents 166 // mettre à jour les documents
166 $DocumentPresta = Latex::makeInstance($Presta->getTypePresta()); // $type = facture, devis, location 167 if($Presta->getTypePresta() === 'devis' || $Presta->getTypePresta() === 'facture' || $Presta->getTypePresta() === 'location')
167 $DocumentPresta->setData($Client)->setData($Presta)->setData($PrestaDetails); 168 {
168 $DocumentPresta->makeLatex(); 169 $DocumentPresta = Latex::makeInstance($Presta->getTypePresta()); // $type = facture, devis, location
169 makeTexAndPdf($DocumentPresta); 170 $DocumentPresta->setData($Client)->setData($Presta)->setData($PrestaDetails);
171 $DocumentPresta->makeLatex();
172 makeTexAndPdf($DocumentPresta);
173 }
170 } 174 }
171 else 175 else
172 { 176 {