correctif(dossier.export.pdf): l'export au format pdf d'un dossier ayant un champ de type repetition contenant un titre est bien sous-sectionné
This commit is contained in:
parent
401ead47f0
commit
5e24c0e19a
1 changed files with 9 additions and 4 deletions
|
@ -22,14 +22,19 @@ module DossierSectionsConcern
|
|||
|
||||
def index_for_section_header(champ)
|
||||
champs = champ.private? ? champs_private : champs_public
|
||||
|
||||
index = 1
|
||||
champs.each do |c|
|
||||
if c.repetition?
|
||||
index_in_repetition = c.rows.flatten.filter { _1.stable_id == champ.stable_id }.find_index(champ)
|
||||
return "#{index}.#{index_in_repetition + 1}" if index_in_repetition
|
||||
else
|
||||
return index if c.stable_id == champ.stable_id
|
||||
next unless c.visible?
|
||||
|
||||
index += 1 if c.type_de_champ.header_section?
|
||||
end
|
||||
end
|
||||
index
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue