projets
/
auf_rh_dae.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date poste import
[auf_rh_dae.git]
/
project
/
legacy
/
management
/
commands
/
rh_import_legacy.py
diff --git
a/project/legacy/management/commands/rh_import_legacy.py
b/project/legacy/management/commands/rh_import_legacy.py
index
0709494
..
728f60f
100644
(file)
--- a/
project/legacy/management/commands/rh_import_legacy.py
+++ b/
project/legacy/management/commands/rh_import_legacy.py
@@
-11,6
+11,14
@@
from django.db.models import Q, Max
from project.legacy import models as legacy
from project.rh import models as rh
from project.legacy import models as legacy
from project.rh import models as rh
+def clean_date(date):
+ if date == '2003-06-31': # date inexistante (dossier 791-1)
+ return '2003-06-30'
+ elif date:
+ return date
+ else:
+ return None
+
class Command(BaseCommand):
help = 'Importe les données du système RH legacy'
class Command(BaseCommand):
help = 'Importe les données du système RH legacy'
@@
-147,6
+155,8
@@
def sync_poste():
if dossiers.count() == 0:
service = None
poste_du_responsable = None
if dossiers.count() == 0:
service = None
poste_du_responsable = None
+ date_debut = None
+ date_fin = None
if dossiers.count() > 0:
if dossiers.count() > 0:
@@
-173,6
+183,10
@@
def sync_poste():
except:
poste_du_responsable = None
except:
poste_du_responsable = None
+ # initialiser les dates du poste avec les dates du dossier
+ date_debut = clean_date(dossier.date_debut_mandat)
+ date_fin = clean_date(dossier.date_fin_mandat)
+
# Créer le poste
rh_poste = rh.Poste.objects.create(
id=poste.id_implantation_postes,
# Créer le poste
rh_poste = rh.Poste.objects.create(
id=poste.id_implantation_postes,
@@
-184,6
+198,8
@@
def sync_poste():
service_id=service,
supprime=False,
responsable_id=poste_du_responsable,
service_id=service,
supprime=False,
responsable_id=poste_du_responsable,
+ date_debut=date_debut,
+ date_fin=date_fin,
)
if service is None and poste.actif in ('0', 0, False):
)
if service is None and poste.actif in ('0', 0, False):
@@
-303,14
+319,6
@@
def sync_typeremuneration():
def sync_dossier():
def sync_dossier():
- def clean_date(date):
- if date == '2003-06-31': # date inexistante (dossier 791-1)
- return '2003-06-30'
- elif date:
- return date
- else:
- return None
-
taux_cache = {}
def get_taux(annee, devise):
taux = taux_cache.get((annee, devise))
taux_cache = {}
def get_taux(annee, devise):
taux = taux_cache.get((annee, devise))