summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2023-02-25 17:30:20 +0100
committerpolo <ordipolo@gmx.fr>2023-02-25 17:30:20 +0100
commitb9c74de6d12ef40ab4baf67303ab22a10fcd5b32 (patch)
treedea294f55810471ca2165811515dcd3c8d0e006e /src/model
parent9d8133643773912d54fb0c7d86ef04e6acffa8c9 (diff)
downloadAppliGestionPHP-b9c74de6d12ef40ab4baf67303ab22a10fcd5b32.zip
document locations, correction de pas mal de problèmes
Diffstat (limited to 'src/model')
-rw-r--r--src/model/Locations.php5
-rw-r--r--src/model/Model.php6
-rw-r--r--src/model/Prestations.php2
-rw-r--r--src/model/StructTablesDB.php2
4 files changed, 7 insertions, 8 deletions
diff --git a/src/model/Locations.php b/src/model/Locations.php
index 8ebf757..149c1f1 100644
--- a/src/model/Locations.php
+++ b/src/model/Locations.php
@@ -54,10 +54,9 @@ class Locations extends Model
54 $this->etat_des_lieux_fin = $value; 54 $this->etat_des_lieux_fin = $value;
55 return($this); 55 return($this);
56 } 56 }
57 public function setDureeLocation($value) 57 public function setDureeLocation(string $value)
58 { 58 {
59 $value = str_replace(',', '.', $value); 59 $this->duree_location = $value;
60 $this->duree_location = (float) $value;
61 return($this); 60 return($this);
62 } 61 }
63 public function setLoyerMensuel($value) 62 public function setLoyerMensuel($value)
diff --git a/src/model/Model.php b/src/model/Model.php
index 6a7907c..9039aa6 100644
--- a/src/model/Model.php
+++ b/src/model/Model.php
@@ -7,11 +7,11 @@ abstract class Model extends DB
7 protected $table; // <= enfant 7 protected $table; // <= enfant
8 //static protected $tableStructure; 8 //static protected $tableStructure;
9 9
10 public function __construct() // à surcharger 10 //~ public function __construct() // à surcharger
11 { 11 //~ {
12 //~ $this->table = strtolower(__CLASS__); 12 //~ $this->table = strtolower(__CLASS__);
13 //~ echo "TABLE = " . $this->table . "\n"; 13 //~ echo "TABLE = " . $this->table . "\n";
14 } 14 //~ }
15 15
16 // getters 16 // getters
17 public function getTable(): string 17 public function getTable(): string
diff --git a/src/model/Prestations.php b/src/model/Prestations.php
index ddd785b..2011dbe 100644
--- a/src/model/Prestations.php
+++ b/src/model/Prestations.php
@@ -95,7 +95,7 @@ class Prestations extends Model
95 // on récupère un tableau contenant toutes les prestations d'un client tous types confondus (devis, facture, cesu, location, enregistrement sans vente) 95 // on récupère un tableau contenant toutes les prestations d'un client tous types confondus (devis, facture, cesu, location, enregistrement sans vente)
96 $combientieme_fois = count($this->find(['ID_client' => $this->ID_client])) + 1; 96 $combientieme_fois = count($this->find(['ID_client' => $this->ID_client])) + 1;
97 97
98 $array_code = [$Date->getYear(), $Date->getMonth(), $Date->getDay(), $code_client, $combientieme_fois]; 98 $array_code = [$Date->getYear(), $Date->getMonth(), $Date->getDay(), $code_client, $this->type_presta, $combientieme_fois];
99 $this->code_presta = implode('-', $array_code); 99 $this->code_presta = implode('-', $array_code);
100 } 100 }
101} 101}
diff --git a/src/model/StructTablesDB.php b/src/model/StructTablesDB.php
index 32ae92d..b1e3c7a 100644
--- a/src/model/StructTablesDB.php
+++ b/src/model/StructTablesDB.php
@@ -14,7 +14,7 @@ class StructTablesDB
14 'devis' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'taches' => 'TEXT', 'total_main_d_oeuvre' => 'REAL', 'pieces' => 'TEXT', 'total_pieces' => 'REAL', 'deplacement' => 'REAL', 'total_HT' => 'REAL', 'delai_livraison' => 'TEXT', 'validite_devis' => 'TEXT', 'signature_devis' => 'TEXT'], 14 'devis' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'taches' => 'TEXT', 'total_main_d_oeuvre' => 'REAL', 'pieces' => 'TEXT', 'total_pieces' => 'REAL', 'deplacement' => 'REAL', 'total_HT' => 'REAL', 'delai_livraison' => 'TEXT', 'validite_devis' => 'TEXT', 'signature_devis' => 'TEXT'],
15 'factures' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'taches' => 'TEXT', 'machine' => 'TEXT', 'OS' => 'TEXT', 'donnees' => 'TEXT', 'cles_licences' => 'TEXT', 'total_main_d_oeuvre' => 'REAL', 'pieces' => 'TEXT', 'total_pieces' => 'REAL', 'deplacement' => 'REAL', 'total_HT' => 'REAL'], 15 'factures' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'taches' => 'TEXT', 'machine' => 'TEXT', 'OS' => 'TEXT', 'donnees' => 'TEXT', 'cles_licences' => 'TEXT', 'total_main_d_oeuvre' => 'REAL', 'pieces' => 'TEXT', 'total_pieces' => 'REAL', 'deplacement' => 'REAL', 'total_HT' => 'REAL'],
16 'cesu' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'taches' => 'TEXT', 'duree_travail' => 'TEXT', 'salaire' => 'REAL'], 16 'cesu' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'taches' => 'TEXT', 'duree_travail' => 'TEXT', 'salaire' => 'REAL'],
17 'locations' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'designation' => 'TEXT', 'modele_description' => 'TEXT', 'valeur' => 'REAL', 'etat_des_lieux_debut' => 'TEXT', 'etat_des_lieux_fin' => 'TEXT', 'duree_location' => 'INTEGER', 'loyer_mensuel' => 'REAL', 'loyers_payes' => 'INTEGER', 'caution' => 'INTEGER'] 17 'locations' => ['ID' => 'INTEGER', 'ID_presta' => 'INTEGER', 'designation' => 'TEXT', 'modele_description' => 'TEXT', 'valeur' => 'REAL', 'etat_des_lieux_debut' => 'TEXT', 'etat_des_lieux_fin' => 'TEXT', 'duree_location' => 'TEXT', 'loyer_mensuel' => 'REAL', 'loyers_payes' => 'INTEGER', 'caution' => 'INTEGER']
18 ]; 18 ];
19 19
20 // les types de variables de sqlite sont peu nombreux et autorisent un typage automatique 20 // les types de variables de sqlite sont peu nombreux et autorisent un typage automatique