Created
March 28, 2018 11:35
-
-
Save kubicek/76cb0f1d1d0ce019871f769a2e2ffe87 to your computer and use it in GitHub Desktop.
export urad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datum;darce;penize;bup;popis_bup;poznamka;jmeno;prijmeni;titul_pred;titul_za;narozeni;ic;firma;ulice;psc;obec | |
<%- @donations=Donation.where("received_on > ? AND received_on < ?","#{params[:year].to_i-1}-12-31", "#{params[:year].to_i+1}-01-01") -%> | |
<%- @donations.where(donor_type: 'juristic').order(created_at: :desc).each do |d| -%> | |
<%= [l(d.received_on).gsub(/ /,''),'P',d.amount,0,'','','','','','','',d.ic,d.name,d.street,d.zip.gsub(/ /,''),d.city.strip].join(';') %> | |
<%- end -%> | |
<%- @donations.where.not(donor_type: 'juristic').order(created_at: :desc).each do |d| -%> | |
<%- jmeno, prijmeni = d.name.match(/(([Ii]ng|[Bb]c|M[UV]Dr|Mgr|PharmDr)\.? *)*(.*)/)[3].gsub(/, (MBA|DiS|Ph.?D|CSc|MUDr).?/,'').gsub(/;/,'').split(' ',2) -%> | |
<%- if d.date_of_birth<Date.parse('2001-01-01') -%> | |
<%= [l(d.received_on).gsub(/ /,''),'F',d.amount,0,'','',jmeno,prijmeni,'','',l(d.date_of_birth).gsub(/ /,''),'','',d.street,d.zip.gsub(/ /,''),d.city.strip].join(';') %> | |
<%- end -%> | |
<%- end -%> | |
<%- @donations=NonMonetaryDonation.where("agreement_received_on > ? AND agreement_received_on < ?","#{params[:year].to_i-1}-12-31", "#{params[:year].to_i+1}-01-01") -%> | |
<%- @donations.where(donor_type: 'juristic').order(created_at: :desc).each do |d| -%> | |
<%= [l(d.agreement_received_on).gsub(/ /,''),'P',0,d.amount,d.description,'','','','','','',d.ic.gsub(/ /,''),raw(d.name),d.street,d.zip.gsub(/ /,''),d.city.strip].join(';').html_safe %> | |
<%- end -%> | |
<%- @donations.where.not(donor_type: 'juristic').order(created_at: :desc).each do |d| -%> | |
<%- jmeno, prijmeni = d.name.match(/(([Ii]ng|[Bb]c|M[UV]Dr|Mgr|PharmDr)\.? *)*(.*)/)[3].gsub(/, (MBA|DiS|Ph.?D|CSc|MUDr).?/,'').gsub(/;/,'').split(' ',2) -%> | |
<%= [l(d.agreement_received_on).gsub(/ /,''),'F',0,d.amount,d.description,'',jmeno,prijmeni,'','',l(d.date_of_birth).gsub(/ /,''),'','',d.street,d.zip.gsub(/ /,''),d.city.strip].join(';').html_safe %> | |
<%- end -%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment