correction mineures (format de cellules, précision)

This commit is contained in:
Jean-Marie Place 2021-08-13 11:53:42 +02:00
parent 6da8f6288b
commit 69527b7855
2 changed files with 13 additions and 12 deletions

View File

@ -176,7 +176,7 @@ def excel_make_style(
bgcolor -- la couleur de fond
halign -- alignement horizontal ("left", "right", "center")
valign -- alignement vertical ("top", "bottom", "center")
format_number -- formattage du contenu ("general", "@", ...)
format_number -- formattage du contenu ("General", "@", ...)
font_name -- police
size -- taille de police
"""
@ -201,7 +201,7 @@ def excel_make_style(
}[valign]
style["alignment"] = al
if format_number is None:
style["format_number"] = "general"
style["format_number"] = "General"
else:
style["format_number"] = format_number
return style
@ -448,7 +448,7 @@ def excel_feuille_saisie(e, titreannee, description, lines):
}
style_notes = {
"font": font_bold,
"number_format": "general",
"number_format": "General",
"fill": fill_light_yellow,
"border": border_top,
}

View File

@ -162,8 +162,10 @@ def feuille_preparation_jury(context, formsemestre_id, REQUEST):
style_moy = sco_excel.excel_make_style(
bold=True, halign="center", bgcolor=sco_excel.COLORS.LIGHT_YELLOW
)
style_note = sco_excel.excel_make_style(halign="right")
style_note_bold = sco_excel.excel_make_style(halign="right", bold=True)
style_note = sco_excel.excel_make_style(halign="right", format_number="General")
style_note_bold = sco_excel.excel_make_style(
halign="right", bold=True, format_number="General"
)
# Première ligne
ws.append_single_cell_row(
@ -247,7 +249,7 @@ def feuille_preparation_jury(context, formsemestre_id, REQUEST):
for ue_acro in ue_prev_codes:
cells.append(
ws.make_cell(
prev_moy_ue.get(ue_acro, {}).get(etudid, ""), style_note
fmt(prev_moy_ue.get(ue_acro, {}).get(etudid, "")), style_note
)
)
co += 1
@ -255,25 +257,24 @@ def feuille_preparation_jury(context, formsemestre_id, REQUEST):
ws.make_cell(fmt(prev_moy.get(etudid, "")), style_bold)
) # moy gen prev
cells.append(
ws.make_cell(prev_code.get(etudid, ""), style_moy)
ws.make_cell(fmt(prev_code.get(etudid, "")), style_moy)
) # decision prev
co += 2
for ue_acro in ue_codes:
cells.append(
ws.make_cell(moy_ue.get(ue_acro, {}).get(etudid, ""), style_note)
ws.make_cell(fmt(moy_ue.get(ue_acro, {}).get(etudid, "")), style_note)
)
co += 1
cells.append(ws.make_cell(moy.get(etudid, ""), style_note_bold)) # moy gen
cells.append(ws.make_cell(fmt(moy.get(etudid, "")), style_note_bold)) # moy gen
co += 1
if moy_inter:
cells.append(ws.make_cell(moy_inter.get(etudid, ""), style_note))
cells.append(ws.make_cell(fmt(moy_inter.get(etudid, "")), style_note))
cells.append(ws.make_cell(str(nbabs.get(etudid, "")), style_center))
cells.append(ws.make_cell(str(nbabsjust.get(etudid, "")), style_center))
if code:
cells.append(ws.make_cell(code.get(etudid, ""), style_moy))
if autorisations.get(etudid, ""):
cells.append(ws.make_row(autorisations.get(etudid, ""), style_center))
cells.append(ws.make_cell(autorisations.get(etudid, ""), style_moy))
# l.append(assidu.get(etudid, ''))
ws.append_row(cells)
i += 1