Compare commits
No commits in common. "6058b2f239d67426521894779a49132ec747088a" and "6f7c057a47132d98b17eeb8a08d8bc9a9cea6b56" have entirely different histories.
6058b2f239
...
6f7c057a47
1 changed files with 38 additions and 24 deletions
|
@ -1,7 +1,6 @@
|
||||||
class GroupOrderInvoicePdf < RenderPdf
|
class GroupOrderInvoicePdf < RenderPdf
|
||||||
def filename
|
def filename
|
||||||
ordergroup_name = @options[:ordergroup].name || "OrderGroup"
|
I18n.t('documents.group_order_invoice_pdf.filename', :number => @options[:invoice_number]) + '.pdf'
|
||||||
"#{ordergroup_name}_" + I18n.t('documents.group_order_invoice_pdf.filename', :number => @options[:invoice_number]) + '.pdf'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def title
|
def title
|
||||||
|
@ -103,13 +102,13 @@ class GroupOrderInvoicePdf < RenderPdf
|
||||||
total_gross += goa_total_deposit
|
total_gross += goa_total_deposit
|
||||||
end
|
end
|
||||||
|
|
||||||
table data, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
table data, position: :left, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
||||||
table.header = true
|
table.header = true
|
||||||
table.position = :center
|
table.position = :center
|
||||||
table.cells.border_width = 1
|
table.cells.border_width = 1
|
||||||
table.cells.border_color = '666666'
|
table.cells.border_color = '666666'
|
||||||
|
|
||||||
table.row(0).column(0..4).width = 80
|
table.row(0).column(1).width = 40
|
||||||
table.row(0).border_bottom_width = 2
|
table.row(0).border_bottom_width = 2
|
||||||
table.columns(1).align = :right
|
table.columns(1).align = :right
|
||||||
table.columns(1..6).align = :right
|
table.columns(1..6).align = :right
|
||||||
|
@ -117,25 +116,17 @@ class GroupOrderInvoicePdf < RenderPdf
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
sum = []
|
sum = []
|
||||||
sum << [nil, nil, I18n.t('documents.group_order_invoice_pdf.sum_to_pay_gross'), number_to_currency(total_gross)]
|
sum << [nil, nil, I18n.t('documents.group_order_invoice_pdf.sum_to_pay'), number_to_currency(total_gross)]
|
||||||
# table for sum
|
# table for sum
|
||||||
table sum, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
indent(200) do
|
||||||
table.header = true
|
table sum, position: :center, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
||||||
table.position = :center
|
sum.length.times do |count|
|
||||||
table.cells.border_width = 1
|
table.row(count).columns(0..3).borders = []
|
||||||
table.cells.border_color = '666666'
|
end
|
||||||
table.row(0).columns(2..4).style(align: :bottom)
|
table.row(sum.length - 1).columns(0..2).borders = []
|
||||||
table.row(0).border_bottom_width = 2
|
table.row(sum.length - 1).border_bottom_width = 2
|
||||||
table.row(0..-1).columns(0..1).border_width = 0
|
table.row(sum.length - 1).columns(3).borders = [:bottom]
|
||||||
|
end
|
||||||
table.rows(0..-1).columns(0..4).width = 80
|
|
||||||
table.row(0).column(-1).style(font_style: :bold)
|
|
||||||
table.row(0).column(-2).style(font_style: :bold)
|
|
||||||
table.row(0).column(-1).size = fontsize(10)
|
|
||||||
table.row(0).column(-2).size = fontsize(10)
|
|
||||||
|
|
||||||
table.columns(1).align = :right
|
|
||||||
table.columns(1..6).align = :right
|
|
||||||
end
|
end
|
||||||
|
|
||||||
move_down 25
|
move_down 25
|
||||||
|
@ -226,15 +217,38 @@ class GroupOrderInvoicePdf < RenderPdf
|
||||||
table.columns(1..6).align = :right
|
table.columns(1..6).align = :right
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 4 spalten Netto, MwSt, Brutto
|
||||||
|
# Produkte mit 7% MwSt
|
||||||
|
# Pfand mit 7% MwSt
|
||||||
|
# Produkte mit 19% MwSt
|
||||||
|
# Pfand mit 19% MwSt
|
||||||
|
#
|
||||||
|
# x,x,GESAMT; SUMME
|
||||||
|
|
||||||
sum = [[nil, nil, nil, "Netto", "MwSt", "Brutto"]]
|
sum = [[nil, nil, nil, "Netto", "MwSt", "Brutto"]]
|
||||||
[7, 19].each do |key|
|
[7, 19].each do |key|
|
||||||
sum << [nil, nil, "Produkte mit #{key}%", number_to_currency(tax_hash_net[key]), number_to_currency(tax_hash_gross[key] - tax_hash_net[key]), number_to_currency(tax_hash_gross[key])]
|
sum << [nil, nil, "Produkte mit #{key}%", number_to_currency(tax_hash_net[key]), number_to_currency(tax_hash_gross[key] - tax_hash_net[key]), number_to_currency(tax_hash_gross[key])]
|
||||||
sum << [nil, nil, "Pfand mit #{key}%", number_to_currency(tax_hash_deposit_net[key]), number_to_currency(tax_hash_deposit_gross[key] - tax_hash_deposit_net[key]), number_to_currency(tax_hash_deposit_gross[key])] if separate_deposits
|
sum << [nil, nil, "Pfand mit #{key}%", number_to_currency(tax_hash_deposit_net[key]), number_to_currency(tax_hash_deposit_gross[key] - tax_hash_deposit_net[key]), number_to_currency(tax_hash_deposit_gross[key])] if separate_deposits
|
||||||
end
|
end
|
||||||
|
|
||||||
total_deposit_gross ||= 0
|
total_deposit_gross ||= 0
|
||||||
sum << [nil, nil, nil, nil, I18n.t('documents.group_order_invoice_pdf.sum_to_pay_gross'), number_to_currency(total_gross + total_deposit_gross)]
|
sum << [nil, nil, nil, nil, I18n.t('documents.group_order_invoice_pdf.sum_to_pay_gross'), number_to_currency(total_gross + total_deposit_gross)]
|
||||||
|
# tax_hash_net.each_key.each do |tax|
|
||||||
|
# sum << [nil, nil, nil, nil, I18n.t('documents.group_order_invoice_pdf.tax_included', tax: tax), number_to_currency(tax_hash_gross[tax] - tax_hash_net[tax])]
|
||||||
|
# end
|
||||||
|
# unless marge == 0
|
||||||
|
# sum << [nil, nil, nil, nil, I18n.t('documents.group_order_invoice_pdf.markup_included', marge: marge), number_to_currency(total_gross * marge / 100.0)]
|
||||||
|
# end
|
||||||
|
# end_sum = total_gross * (1 + marge / 100.0)
|
||||||
|
# sum << [nil, nil, nil, nil, I18n.t('documents.group_order_invoice_pdf.sum_to_pay_gross'), number_to_currency(end_sum)]
|
||||||
|
# table for sum
|
||||||
|
# table sum, position: :right, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
||||||
|
# sum.length.times do |count|
|
||||||
|
# table.row(count).columns(0..5).borders = []
|
||||||
|
# end
|
||||||
|
# table.row(sum.length - 1).columns(0..4).borders = []
|
||||||
|
# table.row(sum.length - 1).border_bottom_width = 2
|
||||||
|
# table.row(sum.length - 1).columns(5).borders = [:bottom]
|
||||||
|
# end
|
||||||
move_down 10
|
move_down 10
|
||||||
table sum, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
table sum, cell_style: { size: fontsize(8), overflow: :shrink_to_fit } do |table|
|
||||||
table.header = true
|
table.header = true
|
||||||
|
|
Loading…
Add table
Reference in a new issue