diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 362f1d65..fdf4a46a 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -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 @@ -160,7 +160,7 @@ class ArticlesController < ApplicationController :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) diff --git a/config/app_config.yml.SAMPLE b/config/app_config.yml.SAMPLE index 2436577f..50f1d63b 100644 --- a/config/app_config.yml.SAMPLE +++ b/config/app_config.yml.SAMPLE @@ -37,6 +37,9 @@ default: &defaults # price markup in percent price_markup: 2.0 + # default vat percentage for new articles + tax_default: 7.0 + # tolerance order option: If set to false, article tolerance values do not count # for total article price as long as the order is not finished. tolerance_is_costly: false