fix fax txt table

This commit is contained in:
wvengen 2014-07-01 10:12:59 +02:00
parent d375572358
commit 5349add890

View file

@ -16,14 +16,10 @@ class OrderTxt
text += "****** " + I18n.t('orders.fax.to_address') + "\n\n"
text += "#{FoodsoftConfig[:name]}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\n\n"
text += "****** " + I18n.t('orders.fax.articles') + "\n\n"
text += I18n.t('orders.fax.number') + " " + I18n.t('orders.fax.amount') + " " + I18n.t('orders.fax.name') + "\n"
text += "%8s %8s %s\n"%[I18n.t('orders.fax.number'), I18n.t('orders.fax.amount'), I18n.t('orders.fax.name')]
# now display all ordered articles
@order.order_articles.ordered.includes([:article, :article_price]).each do |oa|
number = oa.article.order_number
(8 - number.size).times { number += " " }
quantity = oa.units_to_order.to_i.to_s
quantity = " " + quantity if quantity.size < 2
text += "#{number} #{quantity} #{oa.article.name}\n"
text += "%8s %8d %s\n"%[oa.article.order_number, oa.units_to_order.to_i, oa.article.name]
end
text
end