fix fax txt table
This commit is contained in:
parent
d375572358
commit
5349add890
1 changed files with 2 additions and 6 deletions
|
@ -16,14 +16,10 @@ class OrderTxt
|
||||||
text += "****** " + I18n.t('orders.fax.to_address') + "\n\n"
|
text += "****** " + I18n.t('orders.fax.to_address') + "\n\n"
|
||||||
text += "#{FoodsoftConfig[:name]}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\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.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
|
# now display all ordered articles
|
||||||
@order.order_articles.ordered.includes([:article, :article_price]).each do |oa|
|
@order.order_articles.ordered.includes([:article, :article_price]).each do |oa|
|
||||||
number = oa.article.order_number
|
text += "%8s %8d %s\n"%[oa.article.order_number, oa.units_to_order.to_i, oa.article.name]
|
||||||
(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"
|
|
||||||
end
|
end
|
||||||
text
|
text
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue