1 # -=- encoding: utf-8 -=-
3 from django
.db
import models
4 from datamaster_modeles
.models
import Pays
, Implantation
16 class Employe(models
.Model
):
18 id = models
.IntegerField(primary_key
=True)
19 nom
= models
.CharField(max_length
=255)
20 prenom
= models
.CharField(max_length
=255)
21 nationalite
= models
.ForeignKey('datamaster_modeles.Pays', to_field
='code', related_name
='nationalite', db_column
='nationalite')
22 date_naissance
= models
.DateField(null
=True, blank
=True)
24 genre
= models
.CharField(max_length
=1, choices
=GENRE_CHOICES
, null
=True, blank
=True)
25 situation_famille
= models
.CharField(max_length
=1, choices
=SITUATION_CHOICES
, null
=True, blank
=True)
26 date_entree
= models
.DateField(null
=True, blank
=True) #devrait pas être là
28 tel_domicile
= models
.CharField(max_length
=255, null
=True, blank
=True)
29 tel_cellulaire
= models
.CharField(max_length
=255, null
=True, blank
=True)
30 adresse
= models
.CharField(max_length
=255, null
=True, blank
=True)
31 no_rue
= models
.CharField(max_length
=255, null
=True, blank
=True)
32 ville
= models
.CharField(max_length
=255, null
=True, blank
=True)
33 province
= models
.CharField(max_length
=255, null
=True, blank
=True)
34 code_postal
= models
.CharField(max_length
=255, null
=True, blank
=True)
35 pays
= models
.ForeignKey('datamaster_modeles.Pays', to_field
='code', null
=True, blank
=True, related_name
='pays', db_column
='pays')
37 date_creation
= models
.DateField(auto_now_add
=True)
38 date_maj
= models
.DateField(auto_now
=True)
39 commentaire
= models
.TextField(null
=True, blank
=True)
41 TYPE_DOSSIER_CHOICES
= (
46 class Dossier(models
.Model
):
48 id = models
.IntegerField(primary_key
=True)
49 code
= models
.CharField(max_length
=10, unique
=True)
50 employe
= models
.ForeignKey('Employe', db_column
='employe')
52 poste1
= models
.ForeignKey('Poste', db_column
='poste1', related_name
='poste1')
53 implantation1
= models
.ForeignKey('datamaster_modeles.Implantation', db_column
='implantation1', related_name
='implantation1')
54 complement1
= models
.TextField(null
=True, blank
=True)
55 responsable_implantation1
= models
.IntegerField()
56 poste2
= models
.ForeignKey('Poste', db_column
='poste2', related_name
='poste2', blank
=True, null
=True)
57 implantation2
= models
.ForeignKey('datamaster_modeles.Implantation', db_column
='implantation2', related_name
='implantation2')
58 complement2
= models
.TextField(null
=True, blank
=True)
59 responsable_implantation2
= models
.IntegerField()
61 service
= models
.ForeignKey('Service', db_column
='service')
62 responsable
= models
.ForeignKey('Employe', db_column
='responsable', related_name
='responsable')
63 remplacement_de
= models
.ForeignKey('Employe', db_column
='remplacement_de', related_name
='remplacement_de')
64 type = models
.CharField(max_length
=1, choices
=TYPE_DOSSIER_CHOICES
)
65 statut
= models
.ForeignKey('Statut', db_column
='statut')
66 organisme_bstg
= models
.ForeignKey('OrganismeBstg', db_column
='organisme_bstg')
68 classement
= models
.ForeignKey('Classement', db_column
='classement')
69 regime_travail
= models
.IntegerField()
71 mandat_date_debut
= models
.DateField()
72 mandat_date_fin
= models
.DateField()
74 contrat_date_debut
= models
.DateField()
75 contrat_date_fin
= models
.DateField()
76 type_contrat
= models
.ForeignKey('TypeContrat', db_column
='type_contrat')
78 date_creation
= models
.DateField(auto_now_add
=True)
79 date_maj
= models
.DateField(auto_now
=True)
80 commentaire
= models
.TextField(null
=True, blank
=True)
82 LIEN_PARENTE_CHOICES
= (
83 ('Conjoint', 'Conjoint'),
84 ('Conjointe', 'Conjointe'),
89 class AyantDroit(models
.Model
):
91 id = models
.IntegerField(primary_key
=True)
92 nom
= models
.CharField(max_length
=255)
93 prenom
= models
.CharField(max_length
=255)
95 employe
= models
.ForeignKey('Employe', db_column
='employe', related_name
='employe')
96 lien_parente
= models
.CharField(max_length
=10, choices
=LIEN_PARENTE_CHOICES
, null
=True, blank
=True)
98 commentaire
= models
.TextField(null
=True, blank
=True)
99 actif
= models
.BooleanField()
102 class Remuneration(models
.Model
):
104 id = models
.IntegerField(primary_key
=True)
105 dossier
= models
.ForeignKey('Dossier', db_column
='dossier')
106 type = models
.ForeignKey('TypeRemuneration', db_column
='type')
107 type_revalorisation
= models
.ForeignKey('TypeRevalorisation', db_column
='type_revalorisation')
108 montant
= models
.FloatField()
109 devise
= models
.ForeignKey('Devise', to_field
='code', db_column
='devise')
110 date_effective
= models
.DateField()
111 pourcentage
= models
.IntegerField()
113 date_creation
= models
.DateField(auto_now_add
=True)
114 user_creation
= models
.IntegerField() #User ou employé
115 desactivation
= models
.BooleanField() #
116 date_desactivation
= models
.DateField()
117 user_desactivation
= models
.IntegerField() #User ou employé
118 annule
= models
.BooleanField()
119 date_annule
= models
.DateField()
120 user_annule
= models
.IntegerField() #User ou employé
122 class FamilleEmploi(models
.Model
):
124 id = models
.IntegerField(primary_key
=True)
125 nom
= models
.CharField(max_length
=255)
127 actif
= models
.BooleanField()
129 class TypePoste(models
.Model
):
131 id = models
.IntegerField(primary_key
=True)
132 nom
= models
.CharField(max_length
=255)
133 nom_feminin
= models
.CharField(max_length
=255)
134 description
= models
.CharField(max_length
=255)
135 is_responsable
= models
.BooleanField()
136 famille_emploi
= models
.ForeignKey('FamilleEmploi', db_column
='famille_emploi')
138 date_modification
= models
.DateField(auto_now
=True)
139 actif
= models
.BooleanField()
141 TYPE_PAIEMENT_CHOICES
= (
142 ('Régulier', 'Régulier'),
143 ('Ponctuel', 'Ponctuel'),
146 NATURE_REMUNERATION_CHOICES
= (
147 ('Accessoire', 'Accessoire'),
148 ('Charges', 'Charges'),
149 ('Indemnité', 'Indemnité'),
151 ('Traitement', 'Traitement'),
154 class TypeRemuneration(models
.Model
):
156 id = models
.IntegerField(primary_key
=True)
157 nom
= models
.CharField(max_length
=255)
158 type_paiement
= models
.CharField(max_length
=30, choices
=TYPE_PAIEMENT_CHOICES
)
159 nature_remuneration
= models
.CharField(max_length
=30, choices
=NATURE_REMUNERATION_CHOICES
)
161 actif
= models
.BooleanField()
163 class TypeRevalorisation(models
.Model
):
165 id = models
.IntegerField(primary_key
=True)
166 nom
= models
.CharField(max_length
=255)
168 actif
= models
.BooleanField()
170 PROPORTION_CHOICES
= (
175 class Poste(models
.Model
):
177 id = models
.IntegerField(primary_key
=True)
178 implantation
= models
.ForeignKey('datamaster_modeles.Implantation', db_column
='implantation')
179 type_poste
= models
.ForeignKey('TypePoste', db_column
='type_poste')
180 proportion
= models
.CharField(max_length
=10, choices
=PROPORTION_CHOICES
)
181 #(sert à quoi?) renommer "regime_travail" ou autre? convertir data en % (data * 100; ex: 1 = 100%)
183 date_modification
= models
.DateField(auto_now
=True)
184 actif
= models
.BooleanField()
186 class Service(models
.Model
):
188 id = models
.IntegerField(primary_key
=True)
189 nom
= models
.CharField(max_length
=255)
191 actif
= models
.BooleanField()
193 TYPE_ORGANISME_CHOICES
= (
194 ('MAD', 'Mise à disposition'),
195 ('DET', 'Détachement'),
198 class OrganismeBstg(models
.Model
):
200 id = models
.IntegerField(primary_key
=True)
201 nom
= models
.CharField(max_length
=255)
202 type = models
.CharField(max_length
=10, choices
=TYPE_ORGANISME_CHOICES
)
204 actif
= models
.BooleanField()
206 CONTRAT_CATEGORIE_CHOICES
= (
210 class Statut(models
.Model
):
212 id = models
.IntegerField(primary_key
=True)
213 code
= models
.CharField(max_length
=25, unique
=True)
214 nom
= models
.CharField(max_length
=255)
215 type_contrat_categorie
= models
.CharField(max_length
=10, choices
=CONTRAT_CATEGORIE_CHOICES
)
216 #CHOICES A, C (veut dire quoi?) voir TypeContrat.categorie
218 actif
= models
.BooleanField()
220 TYPE_CLASSEMENT_CHOICES
= (
224 class Classement(models
.Model
):
226 id = models
.IntegerField(primary_key
=True)
227 type = models
.CharField(max_length
=10, choices
=TYPE_CLASSEMENT_CHOICES
)
228 echelon
= models
.IntegerField()
229 degre
= models
.IntegerField()
230 coefficient
= models
.FloatField()
232 commentaire
= models
.TextField(null
=True, blank
=True)
233 date_modification
= models
.DateField(auto_now
=True)
234 actif
= models
.BooleanField()
236 class ValeurPoint(models
.Model
):
238 id = models
.IntegerField(primary_key
=True)
239 valeur
= models
.FloatField()
240 implantation
= models
.ForeignKey('datamaster_modeles.Implantation', db_column
='implantation')
242 annee
= models
.IntegerField()
244 class TauxChange(models
.Model
):
246 id = models
.IntegerField(primary_key
=True)
247 devise
= models
.ForeignKey('Devise', to_field
='code', db_column
='devise')
248 annee
= models
.IntegerField()
249 taux
= models
.FloatField()
251 implantation
= models
.ForeignKey('datamaster_modeles.Implantation', db_column
='implantation')
253 class Devise(models
.Model
):
254 id = models
.IntegerField(primary_key
=True)
255 code
= models
.CharField(max_length
=10, unique
=True)
256 nom
= models
.CharField(max_length
=255)
258 class TypeContrat(models
.Model
):
260 id = models
.IntegerField(primary_key
=True)
261 nom
= models
.CharField(max_length
=255)
262 nom_long
= models
.CharField(max_length
=255) #description
263 categorie
= models
.CharField(max_length
=10, choices
=CONTRAT_CATEGORIE_CHOICES
)
265 actif
= models
.BooleanField()