Run rubocop --fix-layout and remove encoding comments
This commit is contained in:
parent
fa63e6e81d
commit
ea2862fdef
283 changed files with 1164 additions and 1969 deletions
|
|
@ -1,13 +1,11 @@
|
|||
# encoding: utf-8
|
||||
class OrderByArticles < OrderPdf
|
||||
|
||||
def filename
|
||||
I18n.t('documents.order_by_articles.filename', :name => order.name, :date => order.ends.to_date) + '.pdf'
|
||||
end
|
||||
|
||||
def title
|
||||
I18n.t('documents.order_by_articles.title', :name => order.name,
|
||||
:date => order.ends.strftime(I18n.t('date.formats.default')))
|
||||
:date => order.ends.strftime(I18n.t('date.formats.default')))
|
||||
end
|
||||
|
||||
def body
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
# encoding: utf-8
|
||||
class OrderByGroups < OrderPdf
|
||||
|
||||
def filename
|
||||
I18n.t('documents.order_by_groups.filename', :name => order.name, :date => order.ends.to_date) + '.pdf'
|
||||
end
|
||||
|
||||
def title
|
||||
I18n.t('documents.order_by_groups.title', :name => order.name,
|
||||
:date => order.ends.strftime(I18n.t('date.formats.default')))
|
||||
:date => order.ends.strftime(I18n.t('date.formats.default')))
|
||||
end
|
||||
|
||||
def body
|
||||
|
|
@ -25,14 +23,15 @@ class OrderByGroups < OrderPdf
|
|||
|
||||
each_group_order_article_for_ordergroup(oa_id) do |goa|
|
||||
dimrows << rows.length if goa.result == 0
|
||||
rows << [goa.order_article.article.name,
|
||||
goa.group_order.order.name,
|
||||
group_order_article_quantity_with_tolerance(goa),
|
||||
group_order_article_result(goa),
|
||||
order_article_price_per_unit(goa.order_article),
|
||||
number_to_currency(goa.total_price)]
|
||||
rows << [goa.order_article.article.name,
|
||||
goa.group_order.order.name,
|
||||
group_order_article_quantity_with_tolerance(goa),
|
||||
group_order_article_result(goa),
|
||||
order_article_price_per_unit(goa.order_article),
|
||||
number_to_currency(goa.total_price)]
|
||||
end
|
||||
next unless rows.length > 1
|
||||
|
||||
rows << [nil, nil, nil, nil, nil, number_to_currency(oa_total)]
|
||||
if has_transport
|
||||
rows << [GroupOrder.human_attribute_name(:transport), nil, nil, nil, nil, number_to_currency(oa_transport)]
|
||||
|
|
@ -64,5 +63,4 @@ class OrderByGroups < OrderPdf
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
# encoding: utf-8
|
||||
class OrderFax < OrderPdf
|
||||
|
||||
BATCH_SIZE = 250
|
||||
|
||||
def filename
|
||||
|
|
@ -15,7 +13,7 @@ class OrderFax < OrderPdf
|
|||
contact = FoodsoftConfig[:contact].symbolize_keys
|
||||
|
||||
# From paragraph
|
||||
bounding_box [margin_box.right-200,margin_box.top], width: 200 do
|
||||
bounding_box [margin_box.right - 200, margin_box.top], width: 200 do
|
||||
text FoodsoftConfig[:name], size: fontsize(9), align: :right
|
||||
move_down 5
|
||||
text contact[:street], size: fontsize(9), align: :right
|
||||
|
|
@ -36,7 +34,7 @@ class OrderFax < OrderPdf
|
|||
end
|
||||
|
||||
# Recipient
|
||||
bounding_box [margin_box.left,margin_box.top-60], width: 200 do
|
||||
bounding_box [margin_box.left, margin_box.top - 60], width: 200 do
|
||||
text order.name
|
||||
move_down 5
|
||||
text order.supplier.try(:address).to_s
|
||||
|
|
@ -72,7 +70,7 @@ class OrderFax < OrderPdf
|
|||
number_to_currency(subtotal)]
|
||||
end
|
||||
data << [I18n.t('documents.order_fax.total'), nil, nil, nil, nil, nil, number_to_currency(total)]
|
||||
table data, cell_style: {size: fontsize(8), overflow: :shrink_to_fit} do |table|
|
||||
table data, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
||||
table.header = true
|
||||
table.cells.border_width = 1
|
||||
table.cells.border_color = '666666'
|
||||
|
|
@ -80,28 +78,27 @@ class OrderFax < OrderPdf
|
|||
table.row(0).border_bottom_width = 2
|
||||
table.columns(1).align = :right
|
||||
table.columns(3..6).align = :right
|
||||
table.row(data.length-1).columns(0..5).borders = [:top, :bottom]
|
||||
table.row(data.length-1).columns(0).borders = [:top, :bottom, :left]
|
||||
table.row(data.length-1).border_top_width = 2
|
||||
table.row(data.length - 1).columns(0..5).borders = [:top, :bottom]
|
||||
table.row(data.length - 1).columns(0).borders = [:top, :bottom, :left]
|
||||
table.row(data.length - 1).border_top_width = 2
|
||||
end
|
||||
#font_size: fontsize(8),
|
||||
#vertical_padding: 3,
|
||||
#border_style: :grid,
|
||||
#headers: ["BestellNr.", "Menge","Name", "Gebinde", "Einheit","Preis/Einheit"],
|
||||
#align: {0 => :left}
|
||||
# font_size: fontsize(8),
|
||||
# vertical_padding: 3,
|
||||
# border_style: :grid,
|
||||
# headers: ["BestellNr.", "Menge","Name", "Gebinde", "Einheit","Preis/Einheit"],
|
||||
# align: {0 => :left}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def order_articles
|
||||
order.order_articles.ordered.
|
||||
joins(:article).
|
||||
order('articles.order_number').order('articles.name').
|
||||
preload(:article, :article_price)
|
||||
order.order_articles.ordered
|
||||
.joins(:article)
|
||||
.order('articles.order_number').order('articles.name')
|
||||
.preload(:article, :article_price)
|
||||
end
|
||||
|
||||
def each_order_article
|
||||
order_articles.find_each_with_order(batch_size: BATCH_SIZE) {|oa| yield oa }
|
||||
order_articles.find_each_with_order(batch_size: BATCH_SIZE) { |oa| yield oa }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
class OrderMatrix < OrderPdf
|
||||
|
||||
HEADER_ROTATE = -30
|
||||
PLACEHOLDER_CHAR = 'X'
|
||||
|
||||
|
|
@ -9,7 +8,7 @@ class OrderMatrix < OrderPdf
|
|||
|
||||
def title
|
||||
I18n.t('documents.order_matrix.title', :name => @order.name,
|
||||
:date => @order.ends.strftime(I18n.t('date.formats.default')))
|
||||
:date => @order.ends.strftime(I18n.t('date.formats.default')))
|
||||
end
|
||||
|
||||
def body
|
||||
|
|
@ -31,7 +30,7 @@ class OrderMatrix < OrderPdf
|
|||
|
||||
order_articles_data.each { |row| row.delete_at 1 } unless @options[:show_supplier]
|
||||
|
||||
name = I18n.t('documents.order_matrix.heading', count: order_articles_data.size-1)
|
||||
name = I18n.t('documents.order_matrix.heading', count: order_articles_data.size - 1)
|
||||
nice_table name, order_articles_data do |table|
|
||||
if @options[:show_supplier]
|
||||
table.column(0).width = bounds.width / 3
|
||||
|
|
@ -82,7 +81,7 @@ class OrderMatrix < OrderPdf
|
|||
rows << row
|
||||
end
|
||||
|
||||
table rows, header: true, cell_style: {overflow: :shrink_to_fit} do |table|
|
||||
table rows, header: true, cell_style: { overflow: :shrink_to_fit } do |table|
|
||||
table.cells.padding = [0, 0, 2, 0]
|
||||
table.cells.borders = [:left]
|
||||
table.cells.border_width = 0.5
|
||||
|
|
@ -95,8 +94,8 @@ class OrderMatrix < OrderPdf
|
|||
table.column(1).align = :right
|
||||
table.column(1).padding = [0, 3, 2, 0]
|
||||
table.column(2..-1).align = :center
|
||||
table.cells[0,0].borders = []
|
||||
table.cells[0,1].borders = []
|
||||
table.cells[0, 0].borders = []
|
||||
table.cells[0, 1].borders = []
|
||||
|
||||
table.column(0).overflow = :truncate
|
||||
table.column(0).width = col_width_0
|
||||
|
|
@ -104,7 +103,7 @@ class OrderMatrix < OrderPdf
|
|||
table.column(2..-1).width = col_width_2
|
||||
|
||||
(0..batch_size).step(5).each do |idx|
|
||||
table.column(2+idx).border_width = 2
|
||||
table.column(2 + idx).border_width = 2
|
||||
end
|
||||
|
||||
table.row_colors = ['dddddd', 'ffffff']
|
||||
|
|
@ -113,5 +112,4 @@ class OrderMatrix < OrderPdf
|
|||
first_page = false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue