amelioration(export.chorus): integre le cadre budgetaire en pus des champs ej

This commit is contained in:
Martin 2023-11-02 16:00:28 +01:00
parent 362b072c6c
commit c7d5bf8dc7
2 changed files with 22 additions and 0 deletions

View file

@ -1228,6 +1228,13 @@ class Dossier < ApplicationRecord
columns << ['Entreprise raison sociale', etablissement&.entreprise_raison_sociale] columns << ['Entreprise raison sociale', etablissement&.entreprise_raison_sociale]
end end
if procedure.chorusable? && procedure.chorus.complete?
columns += [
['Domaine Fonctionnel', procedure.chorus_configuration.domaine_fonctionnel.code],
['Referentiel De Programmation', procedure.chorus_configuration.referentiel_de_programmation.code],
['Centre De Coup', procedure.chorus_configuration.centre_de_coup.code]
]
end
columns += [ columns += [
['Archivé', :archived], ['Archivé', :archived],
['État du dossier', Dossier.human_attribute_name("state.#{state}")], ['État du dossier', Dossier.human_attribute_name("state.#{state}")],

View file

@ -141,6 +141,21 @@ describe ProcedureExportService do
end end
it { expect(dossiers_sheet.data.first.size).to eq(nominal_headers.size) } it { expect(dossiers_sheet.data.first.size).to eq(nominal_headers.size) }
end end
context 'with procedure chorus' do
let(:procedure) { create(:procedure, :published, :for_individual, :filled_chorus, :with_all_champs) }
let!(:dossier) { create(:dossier, :en_instruction, :with_populated_champs, procedure: procedure) }
it 'includes chorus headers' do
expected_headers = [
'Domaine Fonctionnel',
'Referentiel De Programmation',
'Centre De Coup'
]
expect(dossiers_sheet.headers).to match_array(nominal_headers)
end
end
end end
describe 'Etablissement sheet' do describe 'Etablissement sheet' do