Class: ArticlesCsv

Inherits:
RenderCSV show all
Includes:
ApplicationHelper
Defined in:
lib/articles_csv.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#base_errors, #bootstrap_flash_patched, #close_button, #expand, #foodcoop_css_path, #foodcoop_css_tag, #format_currency, #format_date, #format_datetime, #format_datetime_timespec, #format_roles, #format_time, #heading_helper, #icon, #items_per_page, #link_to_gmaps, #link_to_top, #pagination_links_remote, #remote_link_to, #show_title?, #show_user, #show_user_link, #sort_link_helper, #tab_is_active?, #title, #truncate, #weekday

Methods included from PathHelper

#finance_group_transactions_path

Methods inherited from RenderCSV

#initialize, #number_to_currency, #save_tmp, #to_csv

Constructor Details

This class inherits a constructor from RenderCSV

Instance Method Details

#dataObject


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/articles_csv.rb', line 23

def data
  @object.each do |o|
    yield [
      '',
      o.order_number,
      o.name,
      o.note,
      o.manufacturer,
      o.origin,
      o.unit,
      o.price,
      o.tax,
      o.deposit,
      o.unit_quantity,
      '',
      '',
      o..try(:name),
    ]
  end
end

#headerObject


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/articles_csv.rb', line 4

def header
  [
    '',
    Article.human_attribute_name(:order_number),
    Article.human_attribute_name(:name),
    Article.human_attribute_name(:note),
    Article.human_attribute_name(:manufacturer),
    Article.human_attribute_name(:origin),
    Article.human_attribute_name(:unit),
    Article.human_attribute_name(:price),
    Article.human_attribute_name(:tax),
    Article.human_attribute_name(:deposit),
    Article.human_attribute_name(:unit_quantity),
    '',
    '',
    Article.human_attribute_name(:article_category),
  ]
end