render csv bidf bilans
This commit is contained in:
parent
b12226c667
commit
22e2c2e133
4 changed files with 21 additions and 0 deletions
|
@ -138,6 +138,15 @@ class Etablissement < ApplicationRecord
|
|||
upload_attestation(url, entreprise_attestation_fiscale)
|
||||
end
|
||||
|
||||
def entreprise_bilans_bdf_to_csv
|
||||
headers = ["bilans"].concat(entreprise_bilans_bdf[0].keys)
|
||||
data = entreprise_bilans_bdf.each_with_index.map do |bilan, i|
|
||||
month = I18n.l(Date.current - (i + 1).year, format: "%m/%Y")
|
||||
[month].concat(bilan.values)
|
||||
end
|
||||
SpreadsheetArchitect.to_csv(headers: headers, data: data)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def dossier_id_for_export
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue