add volunteer nationality and 2nd nationality to excel sheet

parent 04183f30
......@@ -10,6 +10,10 @@ wb.add_worksheet(name: 'Freiwillige') do |sheet|
'PLZ',
'Ort',
'Geburtsdatum',
'ISO Alpha2 Nationalität',
'Nationalität',
'ISO Alpha2 Zweite Nationalität',
'Zweite Nationalität',
'ID Prozess',
'Prozess',
'Anzahl begleitungen',
......@@ -32,91 +36,103 @@ wb.add_worksheet(name: 'Freiwillige') do |sheet|
sheet.add_row(columns, style: header_style, height: 25)
volunteers.each do |volunteer|
data = [
volunteer.id, # 'id',
volunteer.salutation, # 'ID Anrede',
t("salutation.#{volunteer.salutation}"), # 'Anrede',
volunteer.gender, # 'ID Geschlecht',
volunteer.gender_t, # 'Geschlecht',
volunteer.contact.last_name, # 'Nachname',
volunteer.contact.first_name, # 'Vorname',
volunteer.contact.postal_code, # 'PLZ',
volunteer.contact.city, # 'Ort',
volunteer.birth_year, # 'Geburtsdatum',
Volunteer.acceptances[volunteer.acceptance], # 'ID Prozess',
volunteer.acceptance_t, # 'Prozess',
volunteer.assignments.count, # 'Anzahl begleitungen',
volunteer.group_assignments.count, # 'Anzahl Gruppenangebote',
volunteer.waive, # 'Spesenverzicht',
volunteer.intro_course, # 'Einführungskurs besucht',
volunteer.created_at, # 'Erstellt am'
volunteer.undecided_at, # 'Anmeldedatum',
volunteer.invited_at, # 'Eingeladen am',
volunteer.accepted_at, # 'Akzeptiert am',
volunteer.rejected_at, # 'Abgelehnt am',
volunteer.resigned_at, # 'Beendet am',
'', # 'Einsatz',
volunteer.active_inactive_key, # 'ID Status'
t("state.#{volunteer.active_inactive_key}"), # 'Status',
volunteer.external, # 'Intern/Extern',
zeit # 'Zeit'
volunteer.id, # 'id',
volunteer.salutation, # 'ID Anrede',
t("salutation.#{volunteer.salutation}"), # 'Anrede',
volunteer.gender, # 'ID Geschlecht',
volunteer.gender_t, # 'Geschlecht',
volunteer.contact.last_name, # 'Nachname',
volunteer.contact.first_name, # 'Vorname',
volunteer.contact.postal_code, # 'PLZ',
volunteer.contact.city, # 'Ort',
volunteer.birth_year, # 'Geburtsdatum',
volunteer.nationality, # 'ISO Alpha2 Nationalität',
nationality_name(volunteer.nationality), # 'Nationalität',
volunteer.additional_nationality, # 'ISO Alpha2 Zweite Nationalität',
nationality_name(volunteer.additional_nationality), # 'Zweite Nationalität',
Volunteer.acceptances[volunteer.acceptance], # 'ID Prozess',
volunteer.acceptance_t, # 'Prozess',
volunteer.assignments.count, # 'Anzahl begleitungen',
volunteer.group_assignments.count, # 'Anzahl Gruppenangebote',
volunteer.waive, # 'Spesenverzicht',
volunteer.intro_course, # 'Einführungskurs besucht',
volunteer.created_at, # 'Erstellt am'
volunteer.undecided_at, # 'Anmeldedatum',
volunteer.invited_at, # 'Eingeladen am',
volunteer.accepted_at, # 'Akzeptiert am',
volunteer.rejected_at, # 'Abgelehnt am',
volunteer.resigned_at, # 'Beendet am',
'', # 'Einsatz',
volunteer.active_inactive_key, # 'ID Status'
t("state.#{volunteer.active_inactive_key}"), # 'Status',
volunteer.external, # 'Intern/Extern',
zeit # 'Zeit'
]
types = [
:integer, # 'id',
nil, # 'ID Anrede',
nil, # 'Anrede',
nil, # 'ID Geschlecht',
nil, # 'Geschlecht',
nil, # 'Nachname',
nil, # 'Vorname',
nil, # 'PLZ',
nil, # 'Ort',
nil, # 'Geburtsdatum',
:integer, # 'ID Prozess',
nil, # 'Prozess',
:integer, # 'Anzahl begleitungen',
:integer, # 'Anzahl Gruppenangebote',
nil, # 'Spesenverzicht',
nil, # 'Einführungskurs besucht',
:time, # 'Erstellt am'
:time, # 'Anmeldedatum',
:time, # 'Eingeladen am',
:time, # 'Akzeptiert am',
:time, # 'Abgelehnt am',
:time, # 'Beendet am',
nil, # 'Einsatz',
nil, # 'ID Status'
nil, # 'Status',
nil, # 'Intern/Extern',
:time # 'Zeit'
:integer, # 'id',
nil, # 'ID Anrede',
nil, # 'Anrede',
nil, # 'ID Geschlecht',
nil, # 'Geschlecht',
nil, # 'Nachname',
nil, # 'Vorname',
nil, # 'PLZ',
nil, # 'Ort',
nil, # 'Geburtsdatum',
nil, # 'ISO Alpha2 Nationalität',
nil, # 'Nationalität',
nil, # 'ISO Alpha2 Zweite Nationalität',
nil, # 'Zweite Nationalität',
:integer, # 'ID Prozess',
nil, # 'Prozess',
:integer, # 'Anzahl begleitungen',
:integer, # 'Anzahl Gruppenangebote',
nil, # 'Spesenverzicht',
nil, # 'Einführungskurs besucht',
:time, # 'Erstellt am'
:time, # 'Anmeldedatum',
:time, # 'Eingeladen am',
:time, # 'Akzeptiert am',
:time, # 'Abgelehnt am',
:time, # 'Beendet am',
nil, # 'Einsatz',
nil, # 'ID Status'
nil, # 'Status',
nil, # 'Intern/Extern',
:time # 'Zeit'
]
style = [
std_style, # 'id',
std_style, # 'ID Anrede',
std_style, # 'Anrede',
std_style, # 'ID Geschlecht',
std_style, # 'Geschlecht',
std_style, # 'Nachname',
std_style, # 'Vorname',
std_style, # 'PLZ',
std_style, # 'Ort',
date_style, # 'Geburtsdatum',
std_style, # 'ID Prozess',
std_style, # 'Prozess',
std_style, # 'Anzahl begleitungen',
std_style, # 'Anzahl Gruppenangebote',
std_style, # 'Spesenverzicht',
std_style, # 'Einführungskurs besucht',
std_style, # 'id',
std_style, # 'ID Anrede',
std_style, # 'Anrede',
std_style, # 'ID Geschlecht',
std_style, # 'Geschlecht',
std_style, # 'Nachname',
std_style, # 'Vorname',
std_style, # 'PLZ',
std_style, # 'Ort',
date_style, # 'Geburtsdatum',
std_style, # 'ISO Alpha2 Nationalität',
std_style, # 'Nationalität',
std_style, # 'ISO Alpha2 Zweite Nationalität',
std_style, # 'Zweite Nationalität',
std_style, # 'ID Prozess',
std_style, # 'Prozess',
std_style, # 'Anzahl begleitungen',
std_style, # 'Anzahl Gruppenangebote',
std_style, # 'Spesenverzicht',
std_style, # 'Einführungskurs besucht',
date_time_style, # 'Erstellt am'
date_time_style, # 'Anmeldedatum',
date_time_style, # 'Eingeladen am',
date_time_style, # 'Akzeptiert am',
date_time_style, # 'Abgelehnt am',
date_time_style, # 'Beendet am',
std_style, # 'Einsatz',
std_style, # 'ID Status'
std_style, # 'Status',
std_style, # 'Intern/Extern',
date_time_style # 'Zeit'
std_style, # 'Einsatz',
std_style, # 'ID Status'
std_style, # 'Status',
std_style, # 'Intern/Extern',
date_time_style # 'Zeit'
]
sheet.add_row(data, types: types, style: style)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment