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:
Martin 2023-03-06 16:27:33 +01:00 committed by mfo
parent 401ead47f0
commit 5e24c0e19a

View file

@ -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