Last active
December 15, 2015 06:59
-
-
Save airspeed/5220389 to your computer and use it in GitHub Desktop.
Erstellt eine CSV-Darstellung aller Rechnungen im Status :m2.
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
def report_per_status(status) | |
include ActionView::Helpers::NumberHelper | |
m2list = Invoice.where(:state => status.to_s) | |
m2list.each do |r| | |
puts r.invoice_number + ";" + I18n.l(r.created_at.to_date) + ";" + number_with_precision(r.order_cart.final_amount) + ";5,00" | |
end | |
end | |
# usage report_per_status(:m2) | |
def ink_report | |
include ActionView::Helpers::NumberHelper | |
Invoice.where(:state => 'ink').order(:customer_id).each do |r| | |
puts r.customer_id.to_s + ";" + r.invoice_number + ";" + I18n.l(r.created_at.to_date) + ";" + number_with_precision(r.order_cart.final_amount) | |
end | |
end | |
# usage ink_report | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment