Candidate_update
This commit is contained in:
commit
3340fa2368
7 changed files with 21 additions and 14 deletions
|
|
@ -399,6 +399,7 @@ class HPImportView(ImportViewBase):
|
|||
'NOMPERSO_DIP': 'public',
|
||||
'TOTAL': 'period',
|
||||
}
|
||||
|
||||
# Mapping between klass field and imputation
|
||||
account_categories = {
|
||||
'ASAFE': 'ASAFE',
|
||||
|
|
@ -438,14 +439,15 @@ class HPImportView(ImportViewBase):
|
|||
}
|
||||
|
||||
obj, created = Course.objects.get_or_create(
|
||||
teacher=defaults['teacher'],
|
||||
subject=defaults['subject'],
|
||||
public=defaults['public'])
|
||||
teacher = defaults['teacher'],
|
||||
subject = defaults['subject'],
|
||||
public = defaults['public'])
|
||||
|
||||
period = int(float(line['TOTAL']))
|
||||
if created:
|
||||
obj.period = period
|
||||
obj_created += 1
|
||||
|
||||
for k, v in self.account_categories.items():
|
||||
if k in obj.public:
|
||||
obj.imputation = v
|
||||
|
|
@ -553,6 +555,12 @@ EXPORT_FIELDS = [
|
|||
('Courriel contact - copie', None),
|
||||
]
|
||||
|
||||
IMPUTATIONS_EXPORT_FIELDS = [
|
||||
'Nom', 'Prénom', 'Report passé', 'Ens', 'Discipline', \
|
||||
'Accomp.', 'Discipline', 'Total payé', 'Indice', 'Taux', 'Report futur', \
|
||||
'ASA', 'ASSC', 'ASE', 'MP', 'EDEpe', 'EDEps', 'EDS', 'CAS-FPP', 'Direction'
|
||||
]
|
||||
|
||||
|
||||
NON_ATTR_EXPORT_FIELDS = [
|
||||
('Filière', 'period__section__name'),
|
||||
|
|
@ -660,13 +668,6 @@ def stages_export(request, scope=None):
|
|||
return response
|
||||
|
||||
|
||||
IMPUTATIONS_EXPORT_FIELDS = [
|
||||
'Nom', 'Prénom', 'Report passé', 'Ens', 'Discipline',
|
||||
'Accomp.', 'Discipline', 'Total payé', 'Indice', 'Taux', 'Report futur',
|
||||
'ASA', 'ASSC', 'ASE', 'MP', 'EDEpe', 'EDEps', 'EDS', 'CAS_FPP', 'Direction'
|
||||
]
|
||||
|
||||
|
||||
def imputations_export(request):
|
||||
wb = Workbook()
|
||||
ws = wb.active
|
||||
|
|
@ -690,6 +691,7 @@ def imputations_export(request):
|
|||
ws.cell(row=row_idx, column=9).value = 'Charge globale'
|
||||
ws.cell(row=row_idx, column=10).value = '{0:.2f}'.format(activities['tot_paye']/21.50)
|
||||
ws.cell(row=row_idx, column=11).value = teacher.next_report
|
||||
|
||||
col_idx = 12
|
||||
for k, v in imputations.items():
|
||||
ws.cell(row=row_idx, column=col_idx).value = v
|
||||
|
|
@ -860,4 +862,5 @@ def ortra_export(request):
|
|||
response = HttpResponse(save_virtual_workbook(wb), content_type=openxml_contenttype)
|
||||
response['Content-Disposition'] = 'attachment; filename=%s%s.xlsx' % (
|
||||
'ortra_export_', date.strftime(date.today(), '%Y-%m-%d'))
|
||||
return response
|
||||
return response
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue