Resolve merge conflicts

This commit is contained in:
Julius Rapp 2013-07-07 14:58:57 +02:00
commit a5565b436f
18 changed files with 72 additions and 880 deletions

View file

@ -32,7 +32,7 @@ class ArticlesController < ApplicationController
end
def new
@article = @supplier.articles.build(:tax => 7.0)
@article = @supplier.articles.build(:tax => FoodsoftConfig[:tax_default])
render :layout => false
end
@ -145,19 +145,22 @@ class ArticlesController < ApplicationController
begin
@articles = Array.new
articles, outlisted_articles = FoodsoftFile::parse(params[:articles]["file"])
no_category = ArticleCategory.new
articles.each do |row|
# fallback to Others category
category = (ArticleCategory.find_by_name(row[:category]) or no_category)
# creates a new article and price
article = Article.new( :name => row[:name],
:note => row[:note],
:manufacturer => row[:manufacturer],
:origin => row[:origin],
:unit => row[:unit],
:article_category => ArticleCategory.find_by_name(row[:category]),
:article_category => category,
:price => row[:price],
:unit_quantity => row[:unit_quantity],
:order_number => row[:number],
:deposit => row[:deposit],
:tax => row[:tax])
:tax => (row[:tax] or FoodsoftConfig[:tax_default]))
# stop parsing, when an article isn't valid
unless article.valid?
raise I18n.t('articles.controller.error_parse', :msg => article.errors.full_messages.join(", "), :line => (articles.index(row) + 2).to_s)

View file

@ -77,7 +77,7 @@ class GroupOrdersController < ApplicationController
@order = Order.find((params[:order_id] || params[:group_order][:order_id]),
:include => [:supplier, :order_articles])
unless @order.open?
flash[:notice] = I18n.t('group_orders.error_closed')
flash[:notice] = I18n.t('group_orders.errors.closed')
redirect_to :action => 'index'
end
end