diff --git a/lib/order_txt.rb b/lib/order_txt.rb index 1c949377..f14035ad 100644 --- a/lib/order_txt.rb +++ b/lib/order_txt.rb @@ -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