Add financial_transaction_type to CSV (fixes #578)

This commit is contained in:
Patrick Gansterer 2018-12-18 15:13:57 +01:00
parent d67bbe447f
commit a2188cb6b8
3 changed files with 9 additions and 1 deletions

View file

@ -46,6 +46,8 @@ de:
financial_transaction: financial_transaction:
amount: Betrag amount: Betrag
created_on: Datum created_on: Datum
financial_transaction_class: Finanztransaktionsklasse
financial_transaction_type: Finanztransaktionstyp
note: Notiz note: Notiz
ordergroup: Bestellgruppe ordergroup: Bestellgruppe
user: Eingetragen von user: Eingetragen von

View file

@ -46,6 +46,8 @@ en:
financial_transaction: financial_transaction:
amount: Amount amount: Amount
created_on: Date created_on: Date
financial_transaction_class: Financial transaction class
financial_transaction_type: Financial transaction type
note: Note note: Note
ordergroup: Ordergroup ordergroup: Ordergroup
user: Entered by user: Entered by

View file

@ -9,18 +9,22 @@ class FinancialTransactionsCsv < RenderCSV
FinancialTransaction.human_attribute_name(:ordergroup), FinancialTransaction.human_attribute_name(:ordergroup),
FinancialTransaction.human_attribute_name(:ordergroup), FinancialTransaction.human_attribute_name(:ordergroup),
FinancialTransaction.human_attribute_name(:user), FinancialTransaction.human_attribute_name(:user),
FinancialTransaction.human_attribute_name(:financial_transaction_class),
FinancialTransaction.human_attribute_name(:financial_transaction_type),
FinancialTransaction.human_attribute_name(:note), FinancialTransaction.human_attribute_name(:note),
FinancialTransaction.human_attribute_name(:amount) FinancialTransaction.human_attribute_name(:amount)
] ]
end end
def data def data
@object.includes(:user, :ordergroup).each do |t| @object.includes(:user, :ordergroup, :financial_transaction_type).each do |t|
yield [ yield [
t.created_on, t.created_on,
t.ordergroup_id, t.ordergroup_id,
t.ordergroup.name, t.ordergroup.name,
show_user(t.user), show_user(t.user),
t.financial_transaction_type.financial_transaction_class.name,
t.financial_transaction_type.name,
t.note, t.note,
number_to_currency(t.amount) number_to_currency(t.amount)
] ]