Merge branch 'master' into fresh-flow

Conflicts:
	app/assets/stylesheets/bootstrap_and_overrides.css.less
This commit is contained in:
wvengen 2013-12-18 17:03:26 +01:00
commit 2b511ee559
96 changed files with 1389 additions and 1556 deletions

View file

@ -3,6 +3,7 @@ rvm:
- 1.9.3
services:
- redis-server
env: COVERALLS=1
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

17
CHANGELOG.md Normal file
View file

@ -0,0 +1,17 @@
# Foodsoft 3.2.0
(16 December 2013)
It's been a year since the previous release. Much has changed. Big changes have been:
* Translations to English, Dutch and French.
* Improved usability of delivery creation.
* The possibility to extend foodsoft with plugins (the wiki is now optional).
* Article search in the ordering screen.
* Foodcoops can choose to use full names and emails instead of nicknames.
* Foodcoops that don't use prepaid can set their minimum ordergroup balance below zero.
* Group and article PDFs now show articles ordered but not received in grey.
* Upgrade to Rails 3.
When you upgrade, be sure to review `config/app_config.yml.SAMPLE`. When you're running multiple foodcoops from a single installation, check your rake invocations as the syntax is now: `rake multicoops:run TASK=db:migrate`.
# Foodsoft 3.1.1
(20 July 2012)

10
Gemfile
View file

@ -65,15 +65,15 @@ group :development do
gem 'quiet_assets'
# Deploy with Capistrano
gem 'capistrano', '2.13.5'
gem 'capistrano-ext'
gem 'capistrano', '2.13.5', require: false
gem 'capistrano-ext', require: false
#gem 'common_deploy', require: false, path: '../../common_deploy' # pending foodcoops/foodsoft#34, git: 'git://github.com/fsmanuel/common_deploy.git'
# Avoid having content-length warnings
gem 'thin'
end
group :development, :test do
gem 'ruby-prof'
gem 'ruby-prof', require: false
end
group :test do
@ -84,10 +84,12 @@ group :test do
# webkit and poltergeist don't seem to work yet
gem 'selenium-webdriver'
gem 'database_cleaner'
gem 'simplecov', require: false
# need to include rspec components before i18n-spec or rake fails in test environment
gem 'rspec-core'
gem 'rspec-expectations'
gem 'rspec-rerun'
gem 'i18n-spec'
# code coverage
gem 'simplecov', require: false
gem 'coveralls', require: false
end

View file

@ -30,12 +30,12 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.2)
actionmailer (3.2.15)
actionpack (= 3.2.15)
actionmailer (3.2.16)
actionpack (= 3.2.16)
mail (~> 2.5.4)
actionpack (3.2.15)
activemodel (= 3.2.15)
activesupport (= 3.2.15)
actionpack (3.2.16)
activemodel (= 3.2.16)
activesupport (= 3.2.16)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
@ -43,21 +43,21 @@ GEM
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.15)
activesupport (= 3.2.15)
activemodel (3.2.16)
activesupport (= 3.2.16)
builder (~> 3.0.0)
activerecord (3.2.15)
activemodel (= 3.2.15)
activesupport (= 3.2.15)
activerecord (3.2.16)
activemodel (= 3.2.16)
activesupport (= 3.2.16)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.15)
activemodel (= 3.2.15)
activesupport (= 3.2.15)
activesupport (3.2.15)
activeresource (3.2.16)
activemodel (= 3.2.16)
activesupport (= 3.2.16)
activesupport (3.2.16)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
acts_as_tree (1.4.0)
acts_as_tree (1.5.0)
activerecord (>= 3.0.0)
afm (0.2.0)
arel (3.0.3)
@ -66,7 +66,7 @@ GEM
erubis (>= 2.6.6)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bootstrap-datepicker-rails (1.1.1.9)
bootstrap-datepicker-rails (1.1.1.10)
railties (>= 3.0)
builder (3.0.4)
bullet (4.7.1)
@ -80,7 +80,7 @@ GEM
net-ssh-gateway (>= 1.1.0)
capistrano-ext (1.2.1)
capistrano (>= 1.0.0)
capybara (2.1.0)
capybara (2.2.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
@ -102,11 +102,17 @@ GEM
execjs
coffee-script-source (1.6.3)
commonjs (0.2.7)
coveralls (0.7.0)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
daemons (1.1.9)
database_cleaner (1.2.0)
debug_inspector (0.0.2)
diff-lcs (1.2.5)
docile (1.1.0)
docile (1.1.1)
erubis (2.7.0)
eventmachine (1.0.3)
exception_notification (4.0.1)
@ -135,7 +141,7 @@ GEM
hashery (2.1.1)
highline (1.6.20)
hike (1.2.3)
i18n (0.6.5)
i18n (0.6.9)
i18n-spec (0.4.0)
iso
inherited_resources (1.4.1)
@ -148,7 +154,7 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
kaminari (0.14.1)
kaminari (0.15.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
less (2.4.0)
@ -157,7 +163,6 @@ GEM
actionpack (>= 3.1)
less (~> 2.4.0)
libv8 (3.16.14.3)
lockfile (2.1.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
@ -175,7 +180,7 @@ GEM
activerecord (~> 3.1)
activesupport (~> 3.1)
polyamorous (~> 0.5.0)
mime-types (1.25)
mime-types (1.25.1)
mini_portile (0.5.2)
mono_logger (1.1.0)
multi_json (1.8.2)
@ -187,7 +192,7 @@ GEM
net-ssh (2.7.0)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
nokogiri (1.6.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
pdf-reader (1.3.3)
Ascii85 (~> 1.0.0)
@ -198,9 +203,11 @@ GEM
polyamorous (0.5.0)
activerecord (~> 3.0)
polyglot (0.3.3)
prawn (0.12.0)
pdf-reader (>= 0.9.0)
ttfunk (~> 1.0.2)
prawn (0.13.0)
afm
pdf-reader (~> 1.2)
ruby-rc4
ttfunk (~> 1.0.3)
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
rack (1.4.5)
@ -212,14 +219,14 @@ GEM
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.15)
actionmailer (= 3.2.15)
actionpack (= 3.2.15)
activerecord (= 3.2.15)
activeresource (= 3.2.15)
activesupport (= 3.2.15)
rails (3.2.16)
actionmailer (= 3.2.16)
actionpack (= 3.2.16)
activerecord (= 3.2.16)
activeresource (= 3.2.16)
activesupport (= 3.2.16)
bundler (~> 1.0)
railties (= 3.2.15)
railties (= 3.2.16)
rails-assets-listjs (0.2.0.beta.4)
railties (>= 3.1)
rails-i18n (3.0.0)
@ -227,9 +234,9 @@ GEM
rails (>= 3.0.0, < 4.0.0)
rails-settings-cached (0.2.4)
rails (>= 3.0.0)
railties (3.2.15)
actionpack (= 3.2.15)
activesupport (= 3.2.15)
railties (3.2.16)
actionpack (= 3.2.16)
activesupport (= 3.2.16)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
@ -238,7 +245,7 @@ GEM
rdoc (3.12.2)
json (~> 1.4)
redis (3.0.6)
redis-namespace (1.3.2)
redis-namespace (1.4.1)
redis (~> 3.0.4)
ref (1.0.5)
responders (1.0.0)
@ -249,6 +256,8 @@ GEM
redis-namespace (~> 1.2)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
@ -266,32 +275,31 @@ GEM
rspec-mocks (~> 2.14.0)
rspec-rerun (0.1.3)
rspec (>= 2.11.0)
ruby-prof (0.13.0)
ruby-prof (0.13.1)
ruby-rc4 (0.1.5)
rubyzip (1.0.0)
rubyzip (1.1.0)
sass (3.2.12)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
select2-rails (3.5.1)
select2-rails (3.5.2)
thor (~> 0.14)
selenium-webdriver (2.37.0)
selenium-webdriver (2.39.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip (~> 1.0.0)
rubyzip (~> 1.0)
websocket (~> 1.0.4)
simple-navigation (3.11.0)
activesupport (>= 2.3.2)
simple-navigation-bootstrap (1.0.0)
railties (>= 3.1)
simple-navigation (>= 3.7.0)
simple_form (2.1.0)
simple_form (2.1.1)
actionpack (~> 3.0)
activemodel (~> 3.0)
simplecov (0.8.1)
simplecov (0.8.2)
docile (~> 1.1.0)
lockfile (>= 2.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
@ -308,6 +316,8 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.8)
term-ansicolor (1.2.2)
tins (~> 0.8)
therubyracer (0.12.0)
libv8 (~> 3.16.14.0)
ref
@ -317,6 +327,7 @@ GEM
rack (>= 1.0.0)
thor (0.18.1)
tilt (1.4.1)
tins (0.13.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
@ -327,14 +338,14 @@ GEM
rails (>= 3.1)
railties (>= 3.1)
tzinfo (0.3.38)
uglifier (2.3.1)
uglifier (2.3.3)
execjs (>= 0.3.0)
json (>= 1.8.0)
uniform_notifier (1.4.0)
vegas (0.1.11)
rack (>= 1.0.0)
websocket (1.0.7)
whenever (0.8.4)
whenever (0.9.0)
activesupport (>= 2.3.4)
chronic (>= 0.6.3)
wikicloth (0.8.0)
@ -359,6 +370,7 @@ DEPENDENCIES
client_side_validations
client_side_validations-simple_form
coffee-rails (~> 3.2.1)
coveralls
daemons
database_cleaner
exception_notification

View file

@ -1 +1 @@
3.1.1
3.2.0

View file

@ -105,6 +105,10 @@ table {
background-color: @tableBackgroundAccent;
}
td.main_info {
font-weight: bold;
}
tr.selected td {
background-color: @successBackground;
}
@ -269,3 +273,44 @@ i.package {
.input-nano {
width: 30px;
}
// get rid of extra space on bottom of dialog with form
.modal form {
margin: 0;
}
// multiple-column layout in forms (landscape tablet and wider only)
@media (min-width: 768px) {
.form-horizontal .fold-line {
.control-group {
float: left;
}
.control-group + .control-group {
.control-label {
width: auto;
margin: 0 10px;
}
.controls {
float: left;
margin-left: 0;
}
// fix margin somehow off
// XXX there must be a better way
margin-bottom: 0;
.help-block {
margin-top: 0;
margin-bottom: 20px;
}
}
.control-group:last-child {
float: none;
.controls {
float: none;
}
}
}
}
// allow to have indicator text instead of input with same markup
.control-text {
margin-top: 5px;
}

View file

@ -50,57 +50,22 @@ class DeliveriesController < ApplicationController
redirect_to supplier_deliveries_url(@supplier)
end
# three possibilites to fill a new_stock_article form
# (1) start from blank or use params
def new_stock_article
@stock_article = @supplier.stock_articles.build(params[:stock_article])
render :layout => false
end
# (2) StockArticle as template
def copy_stock_article
@stock_article = StockArticle.find(params[:old_stock_article_id]).dup
render :layout => false
end
# (3) non-stock Article as template
def derive_stock_article
@stock_article = Article.find(params[:old_article_id]).becomes(StockArticle).dup
render :layout => false
end
def create_stock_article
@stock_article = StockArticle.new(params[:stock_article])
if @stock_article.valid? and @stock_article.save
render :layout => false
else
render :action => 'new_stock_article', :layout => false
end
end
def edit_stock_article
@stock_article = StockArticle.find(params[:stock_article_id])
render :layout => false
end
def update_stock_article
@stock_article = StockArticle.find(params[:stock_article][:id])
if @stock_article.update_attributes(params[:stock_article])
render :layout => false
else
render :action => 'edit_stock_article', :layout => false
end
end
def add_stock_change
@stock_change = StockChange.new
@stock_change.stock_article = StockArticle.find(params[:stock_article_id])
render :layout => false
end
def form_on_stock_article_create # See publish/subscribe design pattern in /doc.
@stock_article = StockArticle.find(params[:id])
render :layout => false
end
def form_on_stock_article_update # See publish/subscribe design pattern in /doc.
@stock_article = StockArticle.find(params[:id])
render :layout => false
end
end

View file

@ -5,29 +5,61 @@ class StockitController < ApplicationController
order('suppliers.name, article_categories.name, articles.name')
end
def index_on_stock_article_create # See publish/subscribe design pattern in /doc.
@stock_article = StockArticle.find(params[:id])
render :layout => false
end
def index_on_stock_article_update # See publish/subscribe design pattern in /doc.
@stock_article = StockArticle.find(params[:id])
render :layout => false
end
# three possibilites to fill a new_stock_article form
# (1) start from blank or use params
def new
@stock_article = StockArticle.new
@stock_article = StockArticle.new(params[:stock_article])
render :layout => false
end
# (2) StockArticle as template
def copy
@stock_article = StockArticle.find(params[:stock_article_id]).dup
render :layout => false
end
# (3) non-stock Article as template
def derive
@stock_article = Article.find(params[:old_article_id]).becomes(StockArticle).dup
render :layout => false
end
def create
@stock_article = StockArticle.new(params[:stock_article])
if @stock_article.save
redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_create.notice')
if @stock_article.valid? and @stock_article.save
render :layout => false
else
render :action => 'new'
render :action => 'new', :layout => false
end
end
def edit
@stock_article = StockArticle.find(params[:id])
render :layout => false
end
def update
@stock_article = StockArticle.find(params[:id])
if @stock_article.update_attributes(params[:stock_article])
redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_update.notice')
render :layout => false
else
render :action => 'edit'
render :action => 'edit', :layout => false
end
end
@ -36,9 +68,15 @@ class StockitController < ApplicationController
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC')
end
def show_on_stock_article_update # See publish/subscribe design pattern in /doc.
@stock_article = StockArticle.find(params[:id])
render :layout => false
end
def destroy
@article = StockArticle.find(params[:id])
@article.mark_as_deleted
@stock_article = StockArticle.find(params[:id])
@stock_article.mark_as_deleted
render :layout => false
rescue => error
render :partial => "destroy_fail", :layout => false,

View file

@ -84,8 +84,8 @@ module ApplicationHelper
i18nopts = options.select {|a| !['short'].include?(a) }
s = model.human_attribute_name(attribute, i18nopts)
if options[:short]
sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({defaults: ''}))
s = raw "<abbr title='#{s}'>#{sshort}</abbr>" unless sshort.empty?
sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({fallback: true, default: ''}))
s = raw "<abbr title='#{s}'>#{sshort}</abbr>" unless sshort.blank?
end
s
end

View file

@ -25,13 +25,4 @@ module DeliveriesHelper
return output.html_safe
end
def stock_article_price_hint(stock_article)
t('simple_form.hints.stock_article.edit_stock_article.price',
:stock_article_copy_link => link_to(t('.copy_stock_article'),
copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => stock_article.id),
:remote => true
)
)
end
end

View file

@ -7,13 +7,20 @@ module GroupOrdersHelper
}.join("\n")
end
def link_to_ordering(order, options = {})
path = if group_order = order.group_order(current_user.ordergroup)
# Returns a link to the page where a group_order can be edited.
# If the option :show is true, the link is for showing the group_order.
def link_to_ordering(order, options = {}, &block)
group_order = order.group_order(current_user.ordergroup)
path = if options[:show] and group_order
group_order_path(group_order)
elsif group_order
edit_group_order_path(group_order, :order_id => order.id)
else
new_group_order_path(:order_id => order.id)
end
link_to order.name, path, options
options.delete(:show)
name = block_given? ? capture(&block) : order.name
path ? link_to(name, path, options) : name
end
# Return css class names for order result table

View file

@ -7,11 +7,20 @@ module StockitHelper
def link_to_stock_change_reason(stock_change)
if stock_change.delivery_id
link_to t('.delivery'), supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery)
link_to Delivery.model_name.human, supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery)
elsif stock_change.order_id
link_to t('.order'), order_path(stock_change.order)
link_to Order.model_name.human, order_path(stock_change.order)
elsif stock_change.stock_taking_id
link_to t('.stock_taking'), stock_taking_path(stock_change.stock_taking)
link_to StockTaking.model_name.human, stock_taking_path(stock_change.stock_taking)
end
end
def stock_article_price_hint(stock_article)
t('simple_form.hints.stock_article.edit_stock_article.price',
:stock_article_copy_link => link_to(t('.copy_stock_article'),
stock_article_copy_path(stock_article),
:remote => true
)
)
end
end

View file

@ -13,4 +13,8 @@ module TasksHelper
title: I18n.t('helpers.tasks.required_users', :count => task.still_required_users)
end
end
def task_title(task)
I18n.t('helpers.tasks.task_title', name: task.name, duration: task.duration)
end
end

View file

@ -26,6 +26,11 @@ class Ordergroup < Group
User.natural_order.all.reject { |u| (users.include?(u) || u.ordergroup) }
end
# the most recent order this ordergroup was participating in
def last_order
orders.order('orders.starts DESC').first
end
def value_of_open_orders(exclude = nil)
group_orders.in_open_orders.reject{|go| go == exclude}.collect(&:price).sum
end

View file

@ -14,7 +14,11 @@ class StockArticle < Article
# Check for unclosed orders and substract its ordered quantity
def quantity_available
quantity - OrderArticle.where(article_id: id).
quantity - quantity_ordered
end
def quantity_ordered
OrderArticle.where(article_id: id).
joins(:order).where("orders.state = 'open' OR orders.state = 'finished'").sum(:units_to_order)
end

View file

@ -28,6 +28,7 @@ class User < ActiveRecord::Base
validates_presence_of :password, :on => :create
validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
validates_uniqueness_of :email, :case_sensitive => false
validates_presence_of :first_name # for simple_form validations
validates_length_of :first_name, :in => 2..50
validates_confirmation_of :password
validates_length_of :password, :in => 5..25, :allow_blank => true

View file

@ -4,11 +4,11 @@
%table.table.table-striped
%thead
%tr
%th= t '.name'
%th= t '.contact'
%th= t '.address'
%th= t '.members'
%th= t 'admin.actions'
%th= heading_helper Ordergroup, :name
%th= heading_helper Ordergroup, :contact
%th= heading_helper Ordergroup, :contact_address
%th= heading_helper Ordergroup, :user_tokens
%th= t 'ui.actions'
%tbody
- for ordergroup in @ordergroups
%tr{:class => cycle('even','odd', :name => 'groups')}

View file

@ -5,12 +5,12 @@
%thead
%tr
- if FoodsoftConfig[:use_nick]
%th= t '.login'
%th= t '.name'
%th= t '.email'
%th= heading_helper User, :nick
%th= heading_helper User, :name
%th= heading_helper User, :email
%th= t 'admin.access_to'
%th= t '.last_login'
%th(colspan="2")= t 'admin.actions'
%th= heading_helper User, :last_login
%th(colspan="2")= t 'ui.actions'
%tbody
- for user in @users
%tr

View file

@ -7,13 +7,13 @@
%p= t '.member_since', time: distance_of_time_in_words(Time.now, @user.created_on)
%dl
- if FoodsoftConfig[:use_nick]
%dt= t '.nick'
%dt= heading_helper User, :nick
%dd= @user.nick
%dt= t '.name'
%dt= heading_helper User, :name
%dd= h @user.name
%dt= t '.email'
%dt= heading_helper User, :email
%dd= @user.email
%dt= t '.phone'
%dt= heading_helper User, :phone
%dd= @user.phone
%dt= t 'admin.access_to'
%dd= format_roles(@user)

View file

@ -7,7 +7,7 @@
%th= t '.name'
%th= t '.members'
%th= t 'admin.access_to'
%th= t 'admin.actions'
%th= t 'ui.actions'
%tbody
- for workgroup in @workgroups
%tr

View file

@ -3,24 +3,55 @@
= f.hidden_field :supplier_id
.modal-header
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
%h3= t '.title'
%h3= @article.new_record? ? t('.title_new') : t('.title_edit')
.modal-body
= f.input :availability
= f.input :name
= f.input :origin
= f.input :manufacturer
= f.input :unit
.fold-line
= f.input :unit_quantity, label: Article.human_attribute_name(:unit),
input_html: {class: 'input-mini', title: Article.human_attribute_name(:unit_quantity)}
= f.input :unit, label: '&times;'.html_safe,
input_html: {class: 'input-mini', title: Article.human_attribute_name(:unit)}
= f.input :note
= f.association :article_category
/ TODO labels
= f.input :price
= f.input :unit_quantity
= f.input :order_number
= f.input :tax, :wrapper => :append do
= f.input_field :tax
.fold-line
= f.input :price do
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= f.input_field :price, class: 'input-mini'
= f.input :tax do
.input-append
= f.input_field :tax, class: 'input-mini'
%span.add-on %
= f.input :deposit
.fold-line
= f.input :deposit do
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= f.input_field :deposit, class: 'input-mini'
.control-group
%label.control-label{for: 'article_fc_price'}
= Article.human_attribute_name(:fc_price)
.controls.control-text#article_fc_price
= number_to_currency(@article.fc_price) rescue nil
= f.input :origin
= f.input :manufacturer
= f.input :order_number
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= f.submit class: 'btn btn-primary'
:javascript
var form = $('form.edit_article, form.new_article');
$('#article_price, #article_tax, #article_deposit', form).on('change keyup', function() {
var price = parseFloat($('#article_price', form).val());
var tax = parseFloat($('#article_tax', form).val());
var deposit = parseFloat($('#article_deposit', form).val());
// Article#gross_price and Article#fc_price
var gross_price = (price + deposit) * (tax / 100 + 1);
var fc_price = gross_price * (#{FoodsoftConfig[:price_markup].to_f} / 100 + 1);
$('#article_fc_price').html($.isNumeric(fc_price) ? I18n.l("currency", fc_price) : '&#133;');
});

View file

@ -42,9 +42,9 @@
}
if('new' == selectedArticle.id) {
$.ajax({
url: '#{new_stock_article_supplier_deliveries_path(@supplier)}',
url: '#{new_stock_article_path}',
type: 'get',
data: {stock_article: {name: selectedArticle.text}},
data: {stock_article: {name: selectedArticle.text, supplier_id: #{@supplier.id}}},
contentType: 'application/json; charset=UTF-8'
});
$('#new_stock_article').select2('data', null);
@ -52,7 +52,7 @@
}
if('' != selectedArticle.id) {
$.ajax({
url: '#{derive_stock_article_supplier_deliveries_path(@supplier)}',
url: '#{derive_stock_articles_path}',
type: 'get',
data: {old_article_id: selectedArticle.id},
contentType: 'application/json; charset=UTF-8'
@ -61,6 +61,26 @@
return true;
}
});
// Subscribe to database changes.
// See publish/subscribe design pattern in /doc.
$(document).on('StockArticle#create', function(e) {
$.ajax({
url: '#{form_on_stock_article_create_supplier_deliveries_path(@supplier)}',
type: 'get',
data: {id: e.stock_article_id},
contentType: 'application/json; charset=UTF-8'
});
});
$(document).on('StockArticle#update', function(e) {
$.ajax({
url: '#{form_on_stock_article_update_supplier_deliveries_path(@supplier)}',
type: 'get',
data: {id: e.stock_article_id},
contentType: 'application/json; charset=UTF-8'
});
});
});
function mark_article_for_delivery(stock_article_id) {
@ -87,16 +107,16 @@
%table#stock_articles_for_adding.table.table-hover.stupidtable
%thead
%tr
%th.default-sort{:data => {:sort => 'string'}}= t '.article'
%th= t '.price'
%th= t '.unit'
%th= t '.category'
%th= t '.actions'
%th.default-sort{:data => {:sort => 'string'}}= Article.model_name.human
%th= heading_helper StockArticle, :price
%th= heading_helper StockArticle, :unit
%th= heading_helper StockArticle, :article_category
%th= t 'ui.actions'
%tfoot
%tr
%th{:colspan => 5}
- if articles_for_select2(@supplier).empty?
= link_to t('.create_stock_article'), new_stock_article_supplier_deliveries_path(@supplier), :remote => true, :class => 'btn'
= link_to t('.create_stock_article'), new_stock_article_path, :remote => true, :class => 'btn'
- else
%input#new_stock_article{:style => 'width: 500px;'}
%tbody
@ -107,11 +127,11 @@
%table.table#stock_changes.stupidtable
%thead
%tr
%th.default-sort{:data => {:sort => 'string'}}= t '.article'
%th= t '.price'
%th= t '.unit'
%th= t '.quantity'
%th= t '.actions'
%th.default-sort{:data => {:sort => 'string'}}= Article.model_name.human
%th= heading_helper StockArticle, :price
%th= heading_helper StockArticle, :unit
%th= heading_helper GroupOrderArticle, :quantity # quantity to order, although technically this will be a StockChange
%th= t 'ui.actions'
%tbody
= f.simple_fields_for :stock_changes do |stock_change_form|
= render :partial => 'stock_change_fields', :locals => {:f => stock_change_form}

View file

@ -1,11 +1,13 @@
- css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( false )
- disable_delivery_action = ( @delivery and @delivery.includes_article? article )
- css_class = ( disable_delivery_action ) ? ( 'unavailable' ) : ( false )
- deliver_button_disabled = ( disable_delivery_action ) ? ( 'disabled' ) : ( false )
%tr{:id => "stock_article_#{article.id}", :class => css_class}
%td= article.name
%td{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => article})}}= number_to_currency article.price
%td= article.unit
%td= article.article_category.name
%td
= link_to t('.action_edit'), edit_stock_article_supplier_deliveries_path(@supplier, :stock_article_id => article.id), remote: true, class: 'btn btn-mini'
= link_to t('.action_other_price'), copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => article.id), remote: true, class: 'btn btn-mini'
- deliver_button_disabled = ( @delivery and @delivery.includes_article? article ) ? ( 'disabled' ) : ( false )
= link_to t('.action_edit'), edit_stock_article_path(article), remote: true, class: 'btn btn-mini'
= link_to t('.action_other_price'), stock_article_copy_path(article), remote: true, class: 'btn btn-mini'
= link_to t('.action_add_to_delivery'), add_stock_change_supplier_deliveries_path(@supplier, :stock_article_id => article.id), :method => :post, remote: true, class: 'button-add-stock-change btn btn-mini btn-primary', disabled: deliver_button_disabled

View file

@ -1,23 +0,0 @@
- url = ( stock_article.new_record? ) ? ( create_stock_article_supplier_deliveries_path(@supplier) ) : ( update_stock_article_supplier_deliveries_path(@supplier) )
= simple_form_for stock_article, url: url, remote: true, validate: true do |f|
= f.association :supplier, :as => :hidden
= f.hidden_field :id unless stock_article.new_record?
.modal-header
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
%h3= t 'activerecord.models.stock_article'
.modal-body
= f.input :name
= f.input :unit
= f.input :note
- if stock_article.new_record?
= f.input :price
= f.input :tax, :wrapper => :append do
= f.input_field :tax
%span.add-on %
= f.input :deposit
- else
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article)
= f.association :article_category
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= f.submit :class => 'btn btn-primary', 'data-disable-with' => t('ui.please_wait')

View file

@ -1,5 +0,0 @@
$('#modalContainer').html(
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
);
$('#modalContainer').modal();

View file

@ -1,16 +0,0 @@
$('div.container-fluid').prepend(
'<%= j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.notice', :name => @stock_article.name)})) %>'
);
(function() {
$('#stock_articles_for_adding tr').removeClass('success');
var stock_article_for_adding = $(
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>'
).addClass('success');
$('#stock_articles_for_adding tbody').append(stock_article_for_adding);
updateSort('#stock_articles_for_adding');
})();
$('#modalContainer').modal('hide');

View file

@ -1,5 +0,0 @@
$('#modalContainer').html(
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
);
$('#modalContainer').modal();

View file

@ -1,5 +0,0 @@
$('#modalContainer').html(
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
);
$('#modalContainer').modal();

View file

@ -0,0 +1,31 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function(w) {
$('#stock_articles_for_adding tr').removeClass('success');
if(<%= @supplier.id != @stock_article.supplier.id %>) {
// the stock_article does _NOT_ belong to the current supplier
var try_again = w.confirm('<%= j(
t('deliveries.form.confirm_foreign_supplier_reedit', :name => @stock_article.name)
) %>');
if(try_again) {
$.ajax({
url: '<%= j edit_stock_article_path(@stock_article) %>',
type: 'get',
contentType: 'application/json; charset=UTF-8'
});
}
return false;
}
// the stock_article _DOES_ belong to the current supplier
var stock_article_for_adding = $(
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>'
).addClass('success');
$('#stock_articles_for_adding tbody').append(stock_article_for_adding);
updateSort('#stock_articles_for_adding');
})(window);

View file

@ -0,0 +1,47 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function(w) {
// update entry in stock_article table
$('#stock_articles_for_adding tr').removeClass('success');
$('#stock_article_<%= @stock_article.id %>').remove();
if(<%= @supplier.id != @stock_article.supplier.id %>) {
// the stock_article does _NOT_ belong to the current supplier
var try_again = w.confirm('<%= j(
t('deliveries.form.confirm_foreign_supplier_reedit', :name => @stock_article.name)
) %>');
if(try_again) {
$.ajax({
url: '<%= j edit_stock_article_path(@stock_article) %>',
type: 'get',
contentType: 'application/json; charset=UTF-8'
});
}
}
else {
// the stock_article _DOES_ belong to the current supplier
var stock_article_for_adding = $(
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>'
).addClass('success');
$('#stock_articles_for_adding tbody').append(stock_article_for_adding);
updateSort('#stock_articles_for_adding');
}
mark_article_for_delivery(<%= @stock_article.id %>);
// update entry in stock_changes table
$('#stock_changes tr').removeClass('success');
var stock_change_entry = $('#stock_change_stock_article_<%= @stock_article.id %>');
$('.stock_article_name', stock_change_entry).text('<%= j(@stock_article.name) %>');
$('.unit', stock_change_entry).text('<%= j(@stock_article.unit) %>');
stock_change_entry.addClass('success');
updateSort('#stock_changes');
})(window);

View file

@ -1,5 +0,0 @@
$('#modalContainer').html(
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
);
$('#modalContainer').modal();

View file

@ -17,10 +17,10 @@
%table.table.table-striped(style="width:500px")
%thead
%tr
%th= t '.article'
%th= t '.unit'
%th.numeric= t '.amount'
%th.numeric= t '.price'
%th= Article.model_name.human
%th= heading_helper StockArticle, :unit
%th.numeric= heading_helper GroupOrderArticle, :quantity # quantity to order, although technically this will be a StockChange
%th.numeric= heading_helper Article, :price
%th.numeric= t '.sum'
%tbody
- total_net, total_gross = 0,0

View file

@ -1,32 +0,0 @@
$('div.container-fluid').prepend(
'<%= j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.notice', :name => @stock_article.name)})) %>'
);
(function() {
// update entry in stock_article table
$('#stock_articles_for_adding tr').removeClass('success');
var stock_article_for_adding = $(
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article, :delivery => @delivery})) %>'
).addClass('success');
$('#stock_article_<%= @stock_article.id %>').replaceWith(stock_article_for_adding);
updateSort('#stock_articles_for_adding');
mark_article_for_delivery(<%= @stock_article.id %>);
// update entry in stock_changes table
$('#stock_changes tr').removeClass('success');
var stock_change_entry = $('#stock_change_stock_article_<%= @stock_article.id %>');
$('.stock_article_name', stock_change_entry).text('<%= j(@stock_article.name) %>');
$('.unit', stock_change_entry).text('<%= j(@stock_article.unit) %>');
stock_change_entry.addClass('success');
updateSort('#stock_changes');
})();
$('#modalContainer').modal('hide');

View file

@ -1,14 +1,14 @@
%table.ordered-articles.table.table-striped
%thead
%tr
%th= sort_link_helper t('.article'), "name"
%th= sort_link_helper t('.number'), "order_number"
%th= sort_link_helper Article.model_name.human, "name"
%th= sort_link_helper Article.human_attribute_name(:order_number_short), "order_number"
%th= t('.amount')
%th= t('.amount_per_unit')
%th= heading_helper Article, :units
%th= t('.net')
%th= t('.gross')
%th= t('.tax')
%th= t('.refund')
%th= heading_helper Article, :tax
%th= heading_helper Article, :deposit
%th{:colspan => "2"}
= link_to t('.add_article'), new_finance_order_order_article_path(@order), remote: true,
class: 'btn btn-small'

View file

@ -3,7 +3,7 @@
%thead
%tr
%td
%td{:style => "width:8em"}= t('.group')
%td{:style => "width:8em"}= Ordergroup.model_name.human
%td= t('.units')
%td= t('.total')
%td{:colspan => "3",:style => "width:14em"}

View file

@ -5,7 +5,7 @@
= order_article.units_to_order
- unless order_article.ordered_quantities_equal_to_group_orders?
%span{:style => "color:red;font-weight: bold"} !
%td= order_article.price.unit_quantity.to_s + ' * ' + order_article.article.unit.to_s
%td #{order_article.price.unit_quantity} &times; #{order_article.article.unit}
%td
= number_to_currency(order_article.price.price, :unit => "")
:plain
@ -16,7 +16,7 @@
:plain
/
= number_to_currency(order_article.total_gross_price, :unit => "")
%td= order_article.price.tax
%td #{order_article.price.tax}%
%td= order_article.price.deposit
%td
= link_to t('ui.edit'), edit_finance_order_order_article_path(order_article.order, order_article), remote: true,

View file

@ -4,10 +4,10 @@
%table.table.table-striped
%thead
%tr
%td= sort_link_helper t('.date'), "date"
%td= t('.who')
%td= sort_link_helper t('.note'), "note"
%td= sort_link_helper t('.amount'), "amount"
%th= sort_link_helper heading_helper(FinancialTransaction, :created_on), "date"
%th= heading_helper FinancialTransaction, :user
%th= sort_link_helper heading_helper(FinancialTransaction, :note), "note"
%th= sort_link_helper heading_helper(FinancialTransaction, :amount), "amount"
%tbody
- @financial_transactions.each do |t|
%tr

View file

@ -21,13 +21,13 @@
= form_tag finance_create_transaction_collection_path do
%p
%b= t('.note')
%b= heading_helper FinancialTransaction, :note
= text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required'
%p
%table#ordergroups{:style => "width:20em"}
%tr
%th= t('.ordergroup')
%th= t('.amount')
%th= heading_helper FinancialTransaction, :ordergroup
%th= heading_helper FinancialTransaction, :amount
= render :partial => 'ordergroup', :collection => [1, 2, 3]
%p
= link_to t('.new_ordergroup'), '#', 'data-add-transaction' => true, class: 'btn'

View file

@ -5,7 +5,7 @@
%h3= t('.amount_change_for', article: @order_article.article.name)
.modal-body
= form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] }
= form.input :result, hint: I18n.t('.result_hint', unit: @order_article.article.unit)
= form.input :result, hint: I18n.t('finance.group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix?
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= form.submit t('ui.save'), class: 'btn btn-primary'

View file

@ -8,9 +8,9 @@
%table.table.table-striped
%thead
%tr
%th= t('.date')
%th.numeric= t('.amount')
%th= t('.supplier')
%th= heading_helper Invoice, :date
%th.numeric= heading_helper Invoice, :amount
%th= heading_helper Invoice, :supplier
%th
%tbody
- for invoice in @unpaid_invoices
@ -26,10 +26,10 @@
%table.table.table-striped
%thead
%tr
%th= t('.date')
%th= t('.group')
%th= t('.note')
%th.numeric= t('.amount')
%th= heading_helper FinancialTransaction, :created_on
%th= heading_helper FinancialTransaction, :ordergroup
%th= heading_helper FinancialTransaction, :note
%th.numeric= heading_helper FinancialTransaction, :amount
%tbody
- @financial_transactions.each do |ft|
%tr
@ -45,8 +45,8 @@
%table.table.table-striped
%thead
%tr
%th= t('.supplier')
%th= t('.end')
%th= heading_helper Order, :name
%th= t '.end'
%th.numeric= t('.amount_fc')
%th
%tbody
@ -55,6 +55,6 @@
%td= order.name
%td= format_date(order.ends)
%td.numeric= number_to_currency(order.sum(:fc))
%td= link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini'
%td= link_to t('finance.balancing.orders.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini'
- else
= t('.everything_cleared')

View file

@ -23,7 +23,7 @@
%td= format_date invoice.date
%td= format_date invoice.paid_on
%td= number_to_currency invoice.amount
%td= link_to t('.delivery'), [invoice.supplier,invoice.delivery] if invoice.delivery
%td= link_to Delivery.model_name.human, [invoice.supplier,invoice.delivery] if invoice.delivery
%td= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order
%td= truncate(invoice.note)
%td= link_to t('ui.edit'), edit_finance_invoice_path(invoice), class: 'btn btn-mini'

View file

@ -3,7 +3,7 @@
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
%h3= t '.title'
.modal-body
= form.input :article_id, as: :select, collection: new_order_articles_collection
= form.input :article_id, as: :select, collection: new_order_articles_collection, :label => Article.model_name.human # Why do we need the label?
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= form.submit class: 'btn btn-primary'

View file

@ -4,9 +4,9 @@
%table.table.table-striped
%thead
%tr
%th= sort_link_helper t('.name'), "name", :per_page => @per_page
%th= t '.contact'
%th.numeric= sort_link_helper t('.account_balance'), "account_balance", :per_page => @per_page
%th= sort_link_helper heading_helper(Ordergroup, :name), "name", :per_page => @per_page
%th= heading_helper Ordergroup, :contact
%th.numeric= sort_link_helper heading_helper(Ordergroup, :account_balance), "account_balance", :per_page => @per_page
%th
%tbody
- for ordergroup in @ordergroups

View file

@ -5,15 +5,15 @@
%table.table.table-striped
%thead
%tr
%th= t '.name'
%th= t '.user'
%th= t '.last_ordered'
%th= heading_helper Ordergroup, :name
%th= heading_helper Ordergroup, :user_tokens
%th= heading_helper Ordergroup, :last_order
%tbody
- for ordergroup in @ordergroups
%tr
%td= ordergroup.name
%td=h ordergroup.users.collect { |u| show_user(u) }.join(", ")
%td= format_date ordergroup.orders.order('orders.starts DESC').first.try(:starts)
%td= format_date ordergroup.last_order.try(:starts)
%td= link_to_new_message(message_params: {group_id: ordergroup.id})

View file

@ -27,22 +27,23 @@
%h2= @order.name
%dl.dl-horizontal
- unless @order.note.blank?
%dt= t '.note'
%dt= heading_helper Order, :note
%dd= @order.note
%dt= t '.created_by'
%dt= heading_helper Order, :created_by
%dd= show_user_link(@order.created_by)
%dt= t '.ending'
%dt= heading_helper Order, :ends
%dd= format_time(@order.ends)
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
%dt= t '.min_quantity'
%dt= heading_helper Supplier, :min_order_quantity, short: true
%dd= @order.supplier.min_order_quantity
%dt= t '.sum_amount'
%dd= number_to_currency @order.sum
%dt= t '.last_update'
- unless @group_order.new_record?
%dt= heading_helper GroupOrder, :updated_by
%dd
= show_user(@group_order.updated_by) if @group_order.updated_by
= show_user(@group_order.updated_by)
(#{format_time(@group_order.updated_on)})
%dt= t '.funds'
%dt= heading_helper Ordergroup, :available_funds
%dd= number_to_currency(@ordering_data[:available_funds])
.well.pull-right
@ -65,20 +66,20 @@
%table.table.table-hover
%thead
%tr
%th= t '.name'
%th= heading_helper Article, :name
- if @order.stockit?
%th{style: 'width:120px'}= t '.supplier'
%th{style: 'width:120px'}= heading_helper StockArticle, :supplier
%th{style: "width:13px;"}
%th{style: "width:4.5em;"}= t '.price'
%th{style: "width:4.5em;"}= t '.unit'
%th{style: "width:4.5em;"}= heading_helper Article, :unit
- unless @order.stockit?
%th{style: "width:70px;"}= t '.unit_missing'
%th#col_required= t '.amount'
%th#col_tolerance= t '.tolerance'
%th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true
%th#col_required= heading_helper GroupOrderArticle, :quantity
%th#col_tolerance= heading_helper GroupOrderArticle, :tolerance
- else
%th(style="width:20px")= t '.available'
%th#col_required= t '.amount'
%th{style: "width:15px;"}= t '.sum'
%th(style="width:20px")= heading_helper StockArticle, :available
%th#col_required= heading_helper GroupOrderArticle, :quantity
%th{style: "width:15px;"}= heading_helper GroupOrderArticle, :total_price
%tbody.list
- @order.articles_grouped_by_category.each do |category, order_articles|
%tr.list-heading.article-category
@ -132,11 +133,11 @@
%span{id: "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance]
%br/
.pull-left
#{t '.manufacturer'}: #{order_article.article.manufacturer}
#{heading_helper Article, :manufacturer}: #{order_article.article.manufacturer}
%br/
#{t '.units'}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
#{heading_helper Article, :units}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
%br/
#{t '.note'}: #{order_article.article.note}
#{heading_helper Article, :note}: #{order_article.article.note}
%br/
#order-footer
#info-box
@ -147,7 +148,7 @@
%td.currency
%span#total_price= number_to_currency(@group_order.price)
%tr
%td= t('.available_funds') + ':'
%td= heading_helper(Ordergroup, :available_funds) + ':'
%td.currency= number_to_currency(@ordering_data[:available_funds])
%tr
%td= t('.new_funds') + ':'

View file

@ -1,9 +1,9 @@
%table.table.table-striped
%thead
%tr
%th= t '.supplier'
%th= t '.ending'
%th= t '.sum'
%th= heading_helper Order, :name
%th= heading_helper Order, :ends
%th= heading_helper GroupOrder, :price
%tbody
- for order in orders
- group_order = order.group_order(@ordergroup) # Get GroupOrder if possible

View file

@ -6,22 +6,22 @@
%h2= t '.funds.title'
%table.table.table-striped
%tr
%td= t('.funds.account_balance') + ':'
%td= heading_helper Ordergroup, :account_balance
%td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance)
%tr
%td= '- ' + t('.funds.open_orders') + ':'
%td= '- ' + t('.funds.open_orders')
%td.numeric= number_to_currency(@ordergroup.value_of_open_orders)
%tr
%td= '- ' + t('.funds.finished_orders') + ':'
%td= '- ' + t('.funds.finished_orders')
%td.numeric= number_to_currency(@ordergroup.value_of_finished_orders)
%tr
%th= t('.funds.available_funds') + ':'
%th= heading_helper Ordergroup, :available_funds
%th.numeric= number_to_currency(@ordergroup.get_available_funds)
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
// finished orders
- unless Order.finished.empty?
- unless Order.finished_not_closed.empty?
%section
%h2= t '.finished_orders.title'
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}

View file

@ -1,88 +0,0 @@
- content_for :head do
= render 'data'
= render :partial => 'order_head'
- form_tag(:action => 'saveOrder', :id => @order) do
.single_column{:style => "clear:both;margin-bottom:7em;"}
.box_title
%h2= t '.title'
.column_content
%table#order.list
%thead
%tr
%th= t 'group_orders.form.name'
%th{:style => "width:13px;"}
%th{:style => "width:4.5em;"}= t 'group_orders.form.price'
%th{:style => "width:4.5em;"}= t 'group_orders.form.unit'
%th{:style => "width:70px;"}= t 'group_orders.form.unit_missing'
%th#col_required= t 'group_orders.form.amount'
- if not @order.stockit?
%th#col_tolerance= t 'group_orders.form.tolerance'
%th{:style => "width:15px;"}= t 'group_orders.form.sum'
%tbody
- total = 0
- i = 0
- @articles_grouped_by_category.each do |category, order_articles|
%tr{:style => "background-color:#EFEFEF"}
%td{:style => "text-align:left"}
%b= h category
%td{:colspan => "9"}
- order_articles.each do |order_article|
- if FoodsoftConfig[:tolerance_is_costly]
- article_total = @price[i] * (@tolerance[i] + @quantity[i])
- else
- article_total = @price[i] * @quantity[i]
- total += article_total
%tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"}
%td.name= order_article.article.name
%td= h order_article.article.origin
%td= number_to_currency(@price[i])
%td= order_article.article.unit
%td
%span{:id => "missing_units_#{i}"}
- if @order.stockit?
- order_article.article.quantity_available
- else
- missing_units = @unit[i] - (((@quantity[i] + @others_quantity[i]) % @unit[i]) + @tolerance[i] + @others_tolerance[i])
- missing_units < 0 ? 0 : missing_units
%td.quantity
%input{:id => "q_#{i}", :name => "ordered[#{order_article.id}][quantity]", :size => "2", :type => "hidden", :value => @quantity[i]}/
%span.used{:id => "q_used_#{i}"}= @used_quantity[i]
+
%span.unused{:id => "q_unused_#{i}"}= @quantity[i] - @used_quantity[i]
= button_to_function('+', "increaseQuantity(#{i})")
= button_to_function('-', "decreaseQuantity(#{i})")
- unless @order.stockit?
%td.tolerance
%input{:id => "t_#{i}", :name => "ordered[#{order_article.id}][tolerance]", :size => "2", :type => "hidden", :value => @tolerance[i]}/
- if (@unit[i] > 1)
%span.used{:id => "t_used_#{i}"}= @used_tolerance[i]
+
%span.unused{:id => "t_unused_#{i}"}= @tolerance[i] - @used_tolerance[i]
= button_to_function('+', "increaseTolerance(#{i})")
= button_to_function('-', "decreaseTolerance(#{i})")
%td{:id => "td_price_#{i}", :style => "text-align:right; padding-right:10px; width:4em"}
%span{:id => "price_#{i}_display"}= number_to_currency(article_total, :unit => "")
.article-info
%h3= order_article.article.name
.right
= t('group_orders.form.units_full') + ':'
%span{:id => "units_#{i}"}= order_article.units_to_order
%br/
= t('group_orders.form.total_units') + ':'
%span{:id => "q_total_#{i}"}= @quantity[i] + @others_quantity[i]
%br/
= t('group_orders.form.total_tolerance') + ':'
%span{:id => "t_total_#{i}"}= @tolerance[i] + @others_tolerance[i]
%br/
.left
#{t 'group_orders.form.manufacturer'}: #{order_article.article.manufacturer}
%br/
#{t 'group_orders.form.units'}: #{@order.stockit? ? order_article.article.quantity_available : @unit[i]} * #{h order_article.article.unit}
%br/
#{t 'group_orders.form.note'}: #{order_article.article.note}
%br/
- i = i + 1
= render "order_footer", :total => total

View file

@ -9,21 +9,22 @@
.well
// Order summary
%dl.dl-horizontal
%dt= t '.supplier'
%dt= heading_helper Order, :name
%dd= @order.name
%dt= t '.note'
%dt= heading_helper Order, :note
%dd= @order.note
%dt= t '.ending'
%dt= heading_helper Order, :ends
%dd= format_time(@order.ends)
%dt= t '.order_sum'
%dt= heading_helper GroupOrder, :price
%dd
- if @group_order
= number_to_currency(@group_order.price)
- else
= t '.not_ordered'
- if @order.closed?
%p= t '.closed_by', user: show_user(@order.updated_by)
= link_to t('.comment'), "#comments"
%dt= heading_helper Order, :closed_by
%dd= show_user_link @order.updated_by
%p= link_to t('.comment'), "#comments"
// Article box
%section
@ -35,8 +36,8 @@
%table.table.table-hover
%thead
%tr
%th{style: "width:40%"}= t '.articles.name'
%th= t '.articles.units'
%th{style: "width:40%"}= heading_helper Article, :name
%th= heading_helper Article, :units
%th= t '.articles.unit_price'
%th
%abbr{title: t('.articles.ordered_title')}= t '.articles.ordered'
@ -46,7 +47,7 @@
= t '.articles.order_open'
- else
= t '.articles.order_not_open'
%th= t '.articles.total_price'
%th= heading_helper GroupOrderArticle, :total_price
%tbody
- for category_name, order_articles in @order.articles_grouped_by_category
%tr.article-category
@ -61,7 +62,7 @@
%td{style: "width:40%"}
= oa.article.name
- unless oa.article.note.blank?
= image_tag("lamp_grey.png", {alt: "Notiz anzeigen", size: "15x16", border: "0", onmouseover: "$('note_#{oa.id}').show();", onmouseout: "$('note_#{oa.id}').hide();"})
= image_tag("lamp_grey.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#note_#{oa.id}').show();", onmouseout: "$('#note_#{oa.id}').hide();"})
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
%td= number_to_currency(oa.price.fc_price)
%td
@ -73,7 +74,7 @@
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
%td{colspan: "6"}=h oa.article.note
%tr{class: cycle('even', 'odd', name: 'articles')}
%th{colspan: "5"}= t '.articles.sum'
%th{colspan: "5"}= heading_helper GroupOrder, :price
%th= number_to_currency(@group_order.price)
%br/
= link_to_top

View file

@ -50,10 +50,10 @@
%h3= t '.my_ordergroup.transactions.title'
%table.table.table-striped
%tr
%th= t '.my_ordergroup.transactions.when'
%th= t '.my_ordergroup.transactions.where'
%th= t '.my_ordergroup.transactions.note'
%th= t '.my_ordergroup.transactions.amount'
%th= heading_helper FinancialTransaction, :created_on
%th= heading_helper FinancialTransaction, :user
%th= heading_helper FinancialTransaction, :note
%th= heading_helper FinancialTransaction, :amount
- for ft in current_user.ordergroup.financial_transactions.limit(5).order('created_on DESC')
%tr
%td= format_time(ft.created_on)

View file

@ -7,10 +7,10 @@
- unless @ordergroup.description.blank?
%p= @ordergroup.description
%p
%b= Ordergroup.human_attribute_name(:available_funds) + ':'
%b= heading_helper(Ordergroup, :available_funds) + ':'
= number_to_currency(@ordergroup.get_available_funds())
%p
%b= Ordergroup.human_attribute_name(:user_tokens) + ':'
%b= heading_helper(Ordergroup, :user_tokens) + ':'
= @ordergroup.memberships.map{|m| show_user m.user}.join(', ')
= link_to t('.invite'), new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary'
.span8

View file

@ -7,10 +7,6 @@
%title= [t('layouts.foodsoft'), yield(:title)].join(" - ")
= csrf_meta_tags
= stylesheet_link_tag "application", :media => "all"
%link(href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144")
%link(href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114")
%link(href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72")
%link(href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed")
//%link(href="images/favicon.ico" rel="shortcut icon")
= yield(:head)

View file

@ -1,8 +1,8 @@
%table.table.table-hover
%thead
%tr
%th= t '.name'
%th= t '.unit_quantity'
%th= heading_helper Article, :name
%th= heading_helper Article, :unit_quantity
%th= t '.prices'
%th= t '.units_ordered'
- unless order.stockit?

View file

@ -11,14 +11,14 @@
%table.table.table-hover#articleList
%tr
%th= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' }
%th= t '.name'
%th= t '.note'
%th= heading_helper Article, :name
%th= heading_helper Article, :note
- if @order.stockit?
%th= t '.stockit'
- else
%th= t '.origin'
%th= t '.supplier'
%th= t '.unit_quantity'
%th= heading_helper Article, :origin
%th= heading_helper Article, :manufacturer
%th= heading_helper Article, :unit_quantity
%th= t '.prices'
- for category_name, articles in @order.articles_for_ordering
%tr.article-category

View file

@ -2,10 +2,10 @@
%table.table.table-striped
%thead
%tr
%th= sort_link_helper t('.supplier'), "supplier"
%th= t '.start'
%th= sort_link_helper t('.ending'), "ends"
%th= t '.status'
%th= sort_link_helper heading_helper(Order, :supplier), "supplier"
%th= heading_helper Order, :starts
%th= sort_link_helper heading_helper(Order, :ends), "ends"
%th= heading_helper Order, :status
%th{:colspan => "2"}
%tbody
- @orders.each do |order|

View file

@ -15,9 +15,9 @@
%table.table.table-striped
%thead
%tr
%th= t '.supplier'
%th= t '.ending'
%th= t '.note'
%th= heading_helper Order, :name
%th= heading_helper Order, :ends
%th= heading_helper Order, :note
%th{colspan: "2"}
%tbody
- for order in @open_orders

View file

@ -7,16 +7,16 @@
// Order summary
.well
%dl.dl-horizontal
%dt= t '.supplier'
%dt= heading_helper(Order, :name) + ':'
%dd= @order.name
- if @note.present?
%dt= t '.note'
%dt= heading_helper(Order, :note) + ':'
%dd= @order.note
%dt= t '.created_by'
%dt= heading_helper(Order, :created_by) + ':'
%dd= show_user_link(@order.created_by)
%dt= t '.begin'
%dt= heading_helper(Order, :starts) + ':'
%dd= format_time(@order.starts)
%dt= t '.ending'
%dt= heading_helper(Order, :ends) + ':'
%dd= format_time(@order.ends)
%dt= t '.group_orders'
%dd #{@order.group_orders.count} (#{@order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')})

View file

@ -1,7 +1,7 @@
%table.table.table-hover
%thead
%tr
%th{:style => "width:40%"}= t '.name'
%th{:style => "width:40%"}= heading_helper Article, :name
%th
%acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered'
%th
@ -10,7 +10,7 @@
%acronym{:title => t('.fc_price_desc')}= t '.fc_price'
%th
%acronym{:title => t('.unit_quantity_desc')}= t '.unit_quantity'
%th= t '.unit'
%th= heading_helper Article, :unit
%th= t '.price'
- for group_order in order.group_orders.ordered

View file

@ -1,14 +1,14 @@
%dl
%dt= t('.description') + ':'
%dt= heading_helper(Ordergroup, :description) + ':'
%dd=h group.description
- if group.is_a?(Ordergroup) and (@current_user.role_admin? or @current_user.role_finance?)
%dt= t('.contact') + ':'
%dt= heading_helper(Ordergroup, :contact) + ':'
%dd=h group.contact
%dt= t('.address') + ':'
%dt= heading_helper(Ordergroup, :contact_address) + ':'
%dd= link_to_gmaps group.contact_address
%dt= t('.access') + ':'
%dd= format_roles(group)
%dt= t('.members') + ':'
%dt= heading_helper(Ordergroup, :user_tokens) + ':'
%dd
- members = group.users
= "(#{members.size})"

View file

@ -7,10 +7,10 @@
%table.table.table-striped
%thead
%tr
%th= t '.supplier'
%th= t '.ending'
%th= heading_helper Order, :name
%th= heading_helper Order, :ends
%th= t '.who_ordered'
%th= t '.total'
%th.numeric= heading_helper GroupOrder, :price
%tbody
- total = 0
- Order.open.each do |order|
@ -20,7 +20,9 @@
- if group_order = order.group_order(ordergroup)
- total += group_order.price
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
%td.numeric= number_to_currency(group_order.price)
%td.numeric
= link_to_ordering(order, show: true) do
= number_to_currency(group_order.price)
- else
%td{:colspan => 2}
- if total > 0

View file

@ -1,7 +1,8 @@
%p
= simple_fields_for "stock_taking[stock_change_attributes][]", stock_change do |form|
= form.hidden_field :stock_article_id
= "Menge (#{stock_change.stock_article.quantity_available})"
= t '.amount'
(#{stock_change.stock_article.quantity_available})
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
%span{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_change.stock_article})}}
%b= stock_change.stock_article.name

View file

@ -1,9 +1,12 @@
= simple_form_for stock_article, :validate => true do |f|
= simple_form_for stock_article, remote: true, :validate => true do |f|
.modal-header
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
%h3= title
.modal-body
= f.association :supplier
= f.input :name
= f.input :unit
= f.input :note
- if stock_article.new_record?
= f.input :price
= f.input :tax, :wrapper => :append do
@ -11,8 +14,8 @@
%span.add-on %
= f.input :deposit
- else
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => t('.price_hint')
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article).html_safe
= f.association :article_category
.form-actions
= f.submit class: 'btn'
= link_to t('ui.or_cancel'), stock_articles_path
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= f.submit :class => 'btn btn-primary', 'data-disable-with' => t('ui.please_wait')

View file

@ -0,0 +1,14 @@
%tr{:class => stock_article_classes(stock_article), :id => "stockArticle-#{stock_article.id}"}
%td= link_to stock_article.name, stock_article
%td= stock_article.quantity
%td= stock_article.quantity_ordered
%td.main_info= stock_article.quantity_available
%td= stock_article.unit
%td= stock_article.price
%td= number_to_percentage stock_article.tax
%td= link_to stock_article.supplier.name, stock_article.supplier
%td= stock_article.article_category.name
%td
= link_to t('ui.edit'), edit_stock_article_path(stock_article), remote: true, class: 'btn btn-mini'
= link_to t('ui.delete'), stock_article, :method => :delete, :confirm => t('.confirm_delete', :name => stock_article.name),
class: 'btn btn-mini btn-danger', :remote => true

View file

@ -0,0 +1,26 @@
#stockArticleDetails
%dl.dl-horizontal
%dt= heading_helper(StockArticle, :supplier)
%dd= link_to stock_article.supplier.name, stock_article.supplier
%dt= heading_helper(StockArticle, :name)
%dd= stock_article.name
%dt= heading_helper(StockArticle, :unit)
%dd= stock_article.unit
%dt= heading_helper(StockArticle, :price)
%dd= number_to_currency stock_article.price
%dt= heading_helper(StockArticle, :tax)
%dd= number_to_percentage stock_article.tax
%dt= heading_helper(StockArticle, :deposit)
%dd= number_to_currency stock_article.deposit
%dt= heading_helper(StockArticle, :fc_price)
%dd= number_to_currency stock_article.fc_price
%dt= heading_helper(StockArticle, :article_category)
%dd= stock_article.article_category.name
%dt= heading_helper(StockArticle, :note)
%dd= stock_article.note
%dt= heading_helper(StockArticle, :quantity)
%dd= stock_article.quantity
%dt= heading_helper(StockArticle, :quantity_available)
%dd= stock_article.quantity_available
.form-actions
= link_to t('ui.edit'), edit_stock_article_path(stock_article), remote: true, class: 'btn'

View file

@ -0,0 +1,9 @@
$('#modalContainer').html('<%= j(render(
:partial => "form",
:locals => {
:title => t('.title'),
:stock_article => @stock_article
}
)) %>');
$('#modalContainer').modal();

View file

@ -0,0 +1,15 @@
$('div.container-fluid').prepend('<%= j(render(
:partial => 'shared/alert_success',
:locals => {
:alert_message => t('.notice', :name => @stock_article.name)
}
)) %>');
// Publish database changes.
// See publish/subscribe design pattern in /doc.
$(document).trigger({
type: 'StockArticle#create',
stock_article_id: <%= @stock_article.id %>
});
$('#modalContainer').modal('hide');

View file

@ -0,0 +1,9 @@
$('#modalContainer').html('<%= j(render(
:partial => "form",
:locals => {
:title => t('.title'),
:stock_article => @stock_article
}
)) %>');
$('#modalContainer').modal();

View file

@ -0,0 +1,13 @@
$('div.container-fluid').prepend('<%= j(render(
:partial => 'shared/alert_success',
:locals => {
:alert_message => t('.notice', :name => @stock_article.name)
}
)) %>');
// Publish database changes.
// See publish/subscribe design pattern in /doc.
$(document).trigger({
type: 'StockArticle#destroy',
stock_article_id: <%= @stock_article.id %>
});

View file

@ -1,8 +0,0 @@
-# please polish the following line if you know how, same in partial _destroy_fail
var successDiv = $('<div class="alert fade in alert-success"><a class="close" data-dismiss="alert" href="#">#{escape_javascript(t('ui.marks.close').html_safe)}</a></div>');
successDiv.append(document.createTextNode('#{escape_javascript(t('.notice', name: @article.name))}'));
$('div.container-fluid').prepend(successDiv);
$('#stockArticle-#{@article.id}').remove();
-# WARNING: Do not use a simple .fadeOut() above, because it conflicts with the show/hide function of unavailable articles.

View file

@ -1,3 +0,0 @@
- title t('.title')
= render :partial => 'form', :locals => {:stock_article => @stock_article}

View file

@ -0,0 +1,9 @@
$('#modalContainer').html('<%= j(render(
:partial => "form",
:locals => {
:title => t('.title'),
:stock_article => @stock_article
}
)) %>');
$('#modalContainer').modal();

View file

@ -3,6 +3,30 @@
:javascript
$(function() {
$('tr.unavailable').hide();
// Subscribe to database changes.
// See publish/subscribe design pattern in /doc.
$(document).on('StockArticle#create', function(e) {
$.ajax({
url: '#{index_on_stock_article_create_stock_articles_path}',
type: 'get',
data: {id: e.stock_article_id},
contentType: 'application/json; charset=UTF-8'
});
});
$(document).on('StockArticle#destroy', function(e) {
$('#stockArticle-' + e.stock_article_id).remove();
});
$(document).on('StockArticle#update', function(e) {
$.ajax({
url: '#{index_on_stock_article_update_stock_articles_path}',
type: 'get',
data: {id: e.stock_article_id},
contentType: 'application/json; charset=UTF-8'
});
});
})
.well.well-small
@ -17,7 +41,7 @@
.btn-group
= link_to_if @current_user.role_orders?, t('.order_online'), new_order_path(supplier_id: 0),
class: 'btn', class: 'btn btn-primary'
= link_to t('.new_stock_article'), new_stock_article_path, class: 'btn'
= link_to t('.new_stock_article'), new_stock_article_path, remote: true, class: 'btn'
= link_to t('.new_stock_taking'), new_stock_taking_path, class: 'btn'
= link_to t('.show_stock_takings'), stock_takings_path, class: 'btn'
@ -32,32 +56,19 @@
%table.table.table-hover#articles
%thead
%tr
%th= t '.article.article'
%th= t '.article.stock'
%th= t '.article.ordered'
%th= t '.article.available'
%th= t '.article.unit'
%th= t '.article.price'
%th= t '.article.vat'
%th= t '.article.supplier'
%th= t '.article.category'
%th= Article.model_name.human
%th= heading_helper StockArticle, :quantity
%th= heading_helper StockArticle, :quantity_ordered
%th= heading_helper StockArticle, :available
%th= heading_helper StockArticle, :unit
%th= heading_helper StockArticle, :price
%th= heading_helper StockArticle, :tax
%th= heading_helper StockArticle, :supplier
%th= heading_helper StockArticle, :article_category
%th
%tbody
- for article in @stock_articles
%tr{:class => stock_article_classes(article), :id => "stockArticle-#{article.id}"}
%td= link_to article.name, article
%td= article.quantity
%td= article.quantity - article.quantity_available
%th= article.quantity_available
%td= article.unit
%td= article.price
%td= number_to_percentage article.tax
%td= link_to article.supplier.name, article.supplier
%td= article.article_category.name
%td
= link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini'
= link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'),
class: 'btn btn-mini btn-danger', :remote => true
%tbody#articles-tbody
- for stock_article in @stock_articles
= render :partial => 'stock_article', :locals => {:stock_article => stock_article}
%p
= t '.stock_worth'
= number_to_currency StockArticle.stock_value

View file

@ -0,0 +1,14 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function() {
$('#articles-tbody tr').removeClass('success');
var stock_article_row = $('<%= j(render(
:partial => 'stock_article',
:locals => {
:stock_article => @stock_article
}
)) %>').addClass('success');
$('#articles-tbody').prepend(stock_article_row);
})();

View file

@ -0,0 +1,14 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function() {
$('#articles-tbody tr').removeClass('success');
var stock_article_row = $('<%= j(render(
:partial => 'stock_article',
:locals => {
:stock_article => @stock_article
}
)) %>').addClass('success');
$('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
})();

View file

@ -1,22 +0,0 @@
- title t('.title')
- content_for :head do
:javascript
$(function() {
$('#article_search').autocomplete({
source: '#{articles_search_stock_articles_path}',
select: function(e, ui) {
alert(ui.item.value);
//location.href = '#{nil}' + ui.item.value;
}
});
})
/
TODO: Fix this
%p
= t '.search_text'
= text_field_tag 'article_search'
#stock_article_form
= render :partial => 'form', :locals => {:stock_article => @stock_article}

View file

@ -0,0 +1,9 @@
$('#modalContainer').html('<%= j(render(
:partial => "form",
:locals => {
:title => t('.title'),
:stock_article => @stock_article
}
)) %>');
$('#modalContainer').modal();

View file

@ -1,32 +1,22 @@
- title @stock_article.name
- content_for :javascript do
:javascript
$(function() {
// Subscribe to database changes.
// See publish/subscribe design pattern in /doc.
$(document).on('StockArticle#update', function(e) {
$.ajax({
url: '#{show_on_stock_article_update_stock_articles_path}',
type: 'get',
data: {id: e.stock_article_id},
contentType: 'application/json; charset=UTF-8'
});
});
});
.row-fluid
.span6
%dl.dl-horizontal
%dt= StockArticle.human_attribute_name 'supplier'
%dd= link_to @stock_article.supplier.name, @stock_article.supplier
%dt= StockArticle.human_attribute_name 'name'
%dd= @stock_article.name
%dt= StockArticle.human_attribute_name 'unit'
%dd= @stock_article.unit
%dt= StockArticle.human_attribute_name 'price'
%dd= number_to_currency @stock_article.price
%dt= StockArticle.human_attribute_name 'tax'
%dd= number_to_percentage @stock_article.tax
%dt= StockArticle.human_attribute_name 'deposit'
%dd= number_to_currency @stock_article.deposit
%dt= StockArticle.human_attribute_name 'fc_price'
%dd= number_to_currency @stock_article.fc_price
%dt= StockArticle.human_attribute_name 'article_category'
%dd= @stock_article.article_category.name
%dt= StockArticle.human_attribute_name 'note'
%dd= @stock_article.note
%dt= StockArticle.human_attribute_name 'quantity'
%dd= @stock_article.quantity
%dt= StockArticle.human_attribute_name 'quantity_available'
%dd= @stock_article.quantity_available
.form-actions
= link_to t('ui.edit'), edit_stock_article_path(@stock_article), class: 'btn'
= render :partial => 'stock_article_details', :locals => {:stock_article => @stock_article}
.span6
%h2= t('.stock_changes')

View file

@ -0,0 +1,13 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function() {
var stock_article_details = $('<%= j(render(
:partial => 'stock_article_details',
:locals => {
:stock_article => @stock_article
}
)) %>');
$('#stockArticleDetails').replaceWith(stock_article_details);
$('h1').first().text('<%= j(@stock_article.name) %>');
})();

View file

@ -0,0 +1,15 @@
$('div.container-fluid').prepend('<%= j(render(
:partial => 'shared/alert_success',
:locals => {
:alert_message => t('.notice', :name => @stock_article.name)
}
)) %>');
// Publish database changes.
// See publish/subscribe design pattern in /doc.
$(document).trigger({
type: 'StockArticle#update',
stock_article_id: <%= @stock_article.id %>
});
$('#modalContainer').modal('hide');

View file

@ -5,13 +5,13 @@
%table.table.table-striped
%thead
%tr
%th= t '.due_date'
%th= t '.task'
%th= t '.who'
%th= heading_helper Task, :due_date
%th= heading_helper Task, :name
%th= heading_helper Task, :user_list
%th
%tbody
- @tasks.each do |task|
%tr
%td= task.due_date unless task.due_date.nil?
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task)
%td= link_to task_title(task), task_path(task)
%td= task_assignments task

View file

@ -1,9 +1,9 @@
%table.table.table-striped
%thead
%tr
%th= t '.due_date'
%th= heading_helper Task, :due_date
%th
%th= t '.task'
%th= heading_helper Task, :name
%th{:colspan => '2'}
= t '.who'
%small= t '.who_hint'
@ -15,7 +15,7 @@
%td
- if task.periodic?
%i.icon-repeat{title: t('tasks.repeated')}
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task)
%td= link_to task_title(task), task_path(task)
%td
= task_assignments task
= highlighted_required_users task

View file

@ -13,6 +13,6 @@
%section
%h3
= group.name
%small= link_to t('.show_group_tasks'), workgroup_tasks_path(group)
%small= link_to t('.show_group_tasks'), workgroup_tasks_path(workgroup_id: group)
= render 'list', tasks: tasks
= link_to_top

View file

@ -3,22 +3,22 @@
%section
%dl.dl-horizontal
%dt= Task.human_attribute_name(:name)
%dt= heading_helper Task, :name
%dd= @task.name
- if @task.description.present?
%dt= Task.human_attribute_name(:description)
%dt= heading_helper Task, :description
%dd= simple_format(@task.description)
- if @task.due_date.present?
%dt= Task.human_attribute_name(:due_date)
%dt= heading_helper Task, :due_date
%dd
= format_date(@task.due_date)
- if @task.periodic?
%i.icon-repeat{title: t('tasks.repeated')}
%dt= Task.human_attribute_name(:duration)
%dt= heading_helper Task, :duration
%dd= t('.hours', count: @task.duration)
%dt= Task.human_attribute_name(:user_list)
%dt= heading_helper Task, :user_list
%dd= task_assignments(@task)
%dt= Task.human_attribute_name(:workgroup)
%dt= heading_helper Task, :workgroup
%dd
- if @task.workgroup
= link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id)

View file

@ -2,6 +2,10 @@ require File.expand_path('../boot', __FILE__)
require 'rails/all'
# need to include this before requiring some other gems
# http://stackoverflow.com/questions/20361428
I18n.enforce_available_locales = true
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))

View file

@ -7,7 +7,7 @@ de:
availability_short: verf.
deposit: Pfand
fc_price: Endpreis
fc_price_short:
fc_price_short: FC-Preis
fc_share: FoodCoop-Aufschlag
fc_share_short: FC-Aufschlag
gross_price: Bruttopreis
@ -15,6 +15,7 @@ de:
name: Name
note: Notiz
order_number: Bestellnummer
order_number_short: Nr.
origin: Herkunft
price: Nettopreis
supplier: Lieferantin
@ -22,6 +23,7 @@ de:
unit: Einheit
unit_quantity: Gebindegröße
unit_quantity_short: GebGr
units: Gebinde
article_category:
description: Beschreibung
name: Name
@ -31,10 +33,19 @@ de:
supplier: Lieferantin
financial_transaction:
amount: Betrag
created_on: Datum
note: Notiz
ordergroup: Bestellgruppe
user: Eingetragen von
group_order:
price: Bestellsumme
updated_by: Zuletzt bestellt
group_order_article:
ordergroup_id: Bestellgruppe
quantity: Menge
result: Menge
tolerance: Toleranz
total_price: Summe
invoice:
amount: Betrag
date: Rechnungsdatum
@ -54,20 +65,30 @@ de:
sent_to_all: An alle Mitglieder schicken
subject: Betreff
order:
closed_by: Abgerechnet von
created_by: Erstellt von
ends: Endet am
name: Lieferant
note: Notiz
starts: Läuft vom
status: Status
order_article:
missing_units: Fehlende Einheiten
missing_units_short: Fehlende
units_to_order: Menge
update_current_price: Globalen Preis aktualisieren
order_comment:
text: Kommentiere diese Bestellung ...
ordergroup:
account_balance: Kontostand
available_funds: Verfügbares Guthaben
contact: Kontakt
contact_address: Adresse
contact_person: Kontaktperson
contact_phone: Telefon
description: Beschreibung
ignore_apple_restriction: Bestellstop bei zu wenig Äpfeln ignorieren
last_order: Zuletst bestellt
name: Name
user_tokens: Mitglieder
page:
@ -75,10 +96,12 @@ de:
parent_id: Oberseite
title: Titel
stock_article:
available: Verfügbar
price: Nettopreis
quantity: Lagerbestand
quantity: im Lager
quantity_available: Verfügbarer Bestand
supplier: Lieferant
quantity_available_short: Verf.
quantity_ordered: Davon bestellt
stock_taking:
date: Datum
note: Notiz
@ -92,6 +115,7 @@ de:
fax: FAX
is_subscribed: abonniert?
min_order_quantity: Mindestbestellmenge
min_order_quantity_short:
name: Name
note: Notiz
order_howto: Howto Bestellen
@ -103,13 +127,14 @@ de:
done: Erledigt?
due_date: Wann erledigen?
duration: Dauer
name: Name
name: Aufgabe
required_users: Anzahl
user_list: Verantwortliche
user_list: Verantwortlichen
workgroup: Arbeitsgruppe
user:
email: Email
first_name: Vorname
last_login: Letzter login
last_name: Nachname
name: Name
nick: Benutzername
@ -156,7 +181,6 @@ de:
workgroup: Arbeitsgruppe
admin:
access_to: Zugriff auf
actions: Aktionen
base:
index:
all_ordergroups: Alle Bestellgruppen
@ -194,11 +218,6 @@ de:
workgroup: Arbeitsgruppe
new:
title: Bestellgruppe anlegen
ordergroups:
address: Adresse
contact: Kontakt
members: Mitglieder
name: Name
show:
confirm: Bist Du sicher?
edit: Gruppe/Mitglieder bearbeiten
@ -217,20 +236,11 @@ de:
title: Neue Benutzerin anlegen
show:
confirm: Willst du %{user} wirklich rausschmeißen?
email: Email
groupabos: Gruppenabos
member_since: Mitglied seit %{time}
name: Name
nick: Nick
person: Person
phone: Telefon
preference: Einstellungen
send_message: Nachricht senden
users:
email: Email
last_login: Letzter login
login: Login
name: Name
workgroups:
destroy:
error: ! 'Arbeitsgruppe konnte nicht gelöscht werden: %{error}'
@ -258,8 +268,8 @@ de:
name: Name
application:
controller:
error_authn:
error_denied:
error_authn: Anmeldung erforderlich!
error_denied: Kein Zugriff!
error_members_only: Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!
article_categories:
create:
@ -318,17 +328,9 @@ de:
submit: Alle Artikel aktualisieren
title: Alle Artikel von %{supplier} bearbeiten
warning: Achtung, alle Artikel werden aktualisiert!
edit_all_table:
available_desc: verfügbar
available_short: verf.
order_number_desc: Bestellnummer
order_number_short: Best.Nr.
price_desc: Netto!
price_short: Preis
unit_quantity_desc: Gebindegröße
unit_quantity_short: GebGr
form:
title: Neuen Artikel einfügen
title_edit: Artikel bearbeiten
title_new: Neuen Artikel einfügen
import_search_results:
action_import: importieren
already_imported: schon importiert
@ -354,7 +356,7 @@ de:
error_nosel: Du hast keine Artikel ausgewählt
parse_upload:
body: <p><i>Bitte überprufe die engelesenen Artikel.</i></p> <p><i>Achtung, momentan gibt es keine Überprüfung auf doppelte Artikel.</i></p>
title:
title: Artikel hochladen
sync:
outlist:
alert_used: Achtung, %{article} wird gerade in einer laufenden Bestellung verwendet. Bitte erst Bestellung anpassen.
@ -383,24 +385,17 @@ de:
how_many_units: Wie viele Einheiten (%{unit}) des Artikels »%{name}« liefern?
create:
notice: Lieferung wurde erstellt. Bitte nicht vergessen die Rechnung anzulegen!
create_stock_article:
notice: Neuer Lagerartikel »%{name}« gespeichert.
destroy:
notice: Lieferung wurde gelöscht.
edit:
title: Lieferung bearbeiten
form:
actions: Optionen
article: Artikel
category: Kategorie
confirm_foreign_supplier_reedit: Der Lagerartikel »%{name}« wurde erfolgreich gespeichert. Er gehört jedoch nicht zu dem Lieferanten dieser Lieferung. Möchtest Du diesen Lagerartikel erneut bearbeiten?
create_from_blank: Ohne Vorlage anlegen
create_stock_article: Lagerartikel anlegen
price: Nettopreis
quantity: Menge
title_fill_quantities: 2. Liefermenge angeben
title_finish_delivery: 3. Lieferung abschließen
title_select_stock_articles: 1. Lagerartikel auswählen
unit: Einheit
index:
confirm_delete: Bist Du sicher?
new_delivery: Neue Lieferung für %{supplier} anlegen
@ -410,29 +405,21 @@ de:
new:
title: Neue Lieferung von %{supplier}
show:
amount: Menge
article: Artikel
price: Nettopreis
sum: Summe
sum_diff: Brutto - bereinigter Rechnungsbetrag
sum_gross: Bruttosumme
sum_net: Nettosumme
title: Lieferung anzeigen
title_articles: Artikel
unit: Einheit
stock_article_for_adding:
action_add_to_delivery: Liefern
action_edit: Bearbeiten
action_other_price: Kopieren
stock_article_form:
copy_stock_article: Lagerartikel kopieren
stock_change_fields:
remove_article: Artikel aus Lieferung entfernen
suppliers_overview: Lieferantenübersicht
update:
notice: Lieferung wurde aktualisiert.
update_stock_article:
notice: Lagerartikel »%{name}« aktualisiert.
documents:
order_by_articles:
filename: Bestellung %{name}-%{date} - Artikelsortierung
@ -494,26 +481,20 @@ de:
alert: ! 'Ein Fehler ist beim Abrechnen aufgetreten: %{message}'
notice: Bestellung wurde erfolgreich abgerechnet, die Kontostände aktualisiert.
close_direct:
alert: ! 'Bestellung kann nicht geschlossen werden: %{message}'
notice: Bestellung wurde geschlossen.
alert: ! 'Bestellung kann nicht abgerechnet werden: %{message}'
notice: Bestellung wurde abgerechnet.
confirm:
clear: Abschließen
first_paragraph: ! 'Wenn die Bestellung abgeschlossen wird, werden ebenfalls alle Gruppenkonten aktualisiert.<br />Die Konten werden wie folgt belastet:'
clear: Abrechnen
first_paragraph: ! 'Wenn die Bestellung abgerechnet wird, werden ebenfalls alle Gruppenkonten aktualisiert.<br />Die Konten werden wie folgt belastet:'
or_cancel: oder zurück zur Abrechnung
title: Bestellung abrechnen
edit_results_by_articles:
add_article: Artikel hinzufügen
amount: Menge
amount_per_unit: GebGr * Einheit
article: Artikel
gross: Brutto
net: Netto
number: Nr.
refund: Pfand
tax: MwSt
group_order_articles:
add_group: Gruppe hinzufügen
group: Gruppe
total: Gesamtpreis
total_fc: Summe (FC-Preis)
units: Einheiten
@ -534,7 +515,7 @@ de:
articles_overview: Artikelübersicht
comment_on_transaction: Hier kannst Du deine Abrechnung kommentieren
comments: Kommentare
confirm_order: Bestellung abschließen
confirm_order: Bestellung abrechnen
create_invoice: Rechnung anlegen
edit_note: Notiz bearbeiten
edit_order: Bestellung bearbeiten
@ -549,8 +530,8 @@ de:
orders:
clear: abrechnen
cleared: abgerechnet (%{amount})
close: direkt schließen
confirm: Wirklich die Bestellung schließen setzen?
close: direkt abrechnen
confirm: Wirklich die Bestellung abrechnen?
end: Ende
ended: beendet
last_edited_by: Zuletzt bearbeitet von
@ -588,38 +569,24 @@ de:
paragraph: Hier kannst du der Bestellgruppe <b>%{name}</b> Geld gutschreiben/abziehen.
title: Neue Transaktion
new_collection:
amount: Betrag
new_ordergroup: Weitere Bestellgruppe hinzufügen
note: Notiz
ordergroup: Bestellgruppe
save: Transaktionen speichern
sidebar: Hier kannst Du mehrere Konten gleichzeitig aktualsieren. Z.B. alle Überweisungen der Bestellgruppen aus einem Kontoauszug.
title: Mehrere Konten aktualisieren
ordergroup:
remove: Entfernen
remove_group: Gruppe enfernen
transactions:
amount: Betrag
date: Datum
note: Notiz
who: Wer
group_order_articles:
form:
amount_change_for: Mengenänderung für %{article}
result_hint: ! 'Einheit: %{unit}'
index:
amount: Betrag
amount_fc: Betrag(FC)
clear: Abrechnen
date: Datum
end: Ende
everything_cleared: Super, alles schon abgerechnet...
group: Gruppe
last_transactions: Letzte Überweisungen
note: Notiz
open_transactions: Noch nicht abgerechnet
show_all: alle anzeigen
supplier: Lieferantin
title: Finanzbereich
unpaid_invoices: Unbezahlte Rechnungen
invoices:
@ -630,7 +597,6 @@ de:
title: Rechnungen
invoices:
confirm_delete: Bist Du sicher?
delivery: Lieferung
linked: Diese Rechnung ist mit %{what_link} verknüpft.
linked_delivery: einer Lieferung
linked_order: einer Bestellung
@ -652,10 +618,7 @@ de:
search_placeholder: Suchen ...
title: Konten verwalten
ordergroups:
account_balance: Kontostand
account_statement: Kontoauszug
contact: Kontakt
name: Name
new_transaction: Neue Transaktion
update:
notice: Rechnung wurde aktualisiert.
@ -666,10 +629,6 @@ de:
only_active: Nur aktive
only_active_desc: (mindestens einmal in den letzten 3 Monaten bestellt)
title: Bestellgruppen
ordergroups:
last_ordered: zuletzt bestellt
name: Name
user: Mitglieder
users:
index:
body: <p>Hier kannst Du den Mitgliedern Deiner Foodcoop eine Nachricht schreiben.</p> <p>Damit Deine Kontaktdaten einzusehen sind, musst Du sie unter %{profile_link} freigeben.</p>
@ -705,30 +664,14 @@ de:
notfound: Fehlerhafte URL, das ist nicht Deine Bestellung.
form:
action_save: Bestellung speichern
amount: Menge
available: Verfügbar
available_funds: Verfügbares Guthaben
created_by: Erstellt von
ending: Ende
funds: Guthaben
last_update: Zuletzt bestellt
manufacturer: Hersteller
min_quantity: Mindestbestellmenge
name: Name
new_funds: Neuer Kontostand
note: Notiz
price: Preis
reset_article_search: Suche zurücksetzen
search_article: Artikel suchen...
sum: Summe
sum_amount: ! 'Gesamtbestellmenge bisher:'
supplier: Lieferant
sum_amount: Gesamtbestellmenge bisher
title: Bestellen
tolerance: Toleranz
total_sum_amount: Gesamtbetrag
total_tolerance: Gesamt-Toleranz
unit: Einheit
unit_missing: Fehlende Einheiten
units: Gebinde
units_full: Volle Gebinde
units_total: Gesamt-Einheiten
@ -740,8 +683,6 @@ de:
title: Nicht abgerechnete Bestellungen
total_sum: Gesamtsumme
funds:
account_balance: Kontostand
available_funds: verfügbares Guthaben
finished_orders: nicht abgerechnete Bestellungen
open_orders: Laufende Bestellungen
title: Guthaben
@ -750,14 +691,9 @@ de:
not_enough_apples: Um zu Bestellen brauchst Du mindestends %{stop_ordering_under} Äpfel. Momentan hat Deine Bestellgruppe aber nur %{apples} Äpfel.
order:
title: Artikel
orders:
ending: Ende
sum: Summe
supplier: Lieferantin
show:
articles:
edit_order: Bestellung anpassen
name: Name
not_ordered_msg: Du hast noch nicht bestellt
order_closed_msg: Die Bestellung is leider schon zu Ende. Beim nächsten mal früher aufstehen...
order_nopen_title: Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen
@ -767,21 +703,14 @@ de:
ordered: Bestellt
ordered_title: Menge + Toleranz
show_hide: Zeige/Verstecke nicht bestellte Artikel
sum: Summe
show_note: Notiz zeigen
title: Artikelübersicht
total_price: Gesamtpreis
unit_price: Einzelpreis
units: Gebinde
closed_by: Abgerechnet von %{user}
comment: Kommentare lesen/schreiben
comments:
title: Kommentare
ending: Ende
not_ordered: Du hast nicht bestellt.
note: Notiz
order_sum: Bestellsumme
sum: Summe
supplier: Lieferantin
title: Dein Bestellergebnis für %{order}
switch_order:
remaining: noch %{remaining}
@ -815,6 +744,7 @@ de:
create: Nachricht verschicken
tasks:
required_users: Es fehlen %{count} Mitstreiterinnen!
task_title: ! '%{name} (%{duration}h)'
home:
apple_bar:
desc: ! 'Abgebildet ist das Verhältnis von erledigten Aufgaben zu dem Bestellvolumen Deiner Bestellgruppe im Vergleich zum Durchschnitt in der Foodcoop. Konkret: Pro %{amount} Bestellsumme solltest Du eine Aufgabe machen!'
@ -832,12 +762,8 @@ de:
last_update: Letzte Aktualisiering ist %{when} her
title: Meine Bestellgruppe
transactions:
amount: Betrag
note: Notiz
title: Letzte Transaktionen
view: Kontoauszug anzeigen
when: Wann
where: Wer
ordergroup:
title: Engagement Deiner Bestellgruppe
tasks_move:
@ -1155,10 +1081,8 @@ de:
orders:
articles:
article_count: ! 'Bestellte Artikel:'
name: Name
prices: Netto-/Bruttopreis
prices_sum: ! 'Summe (Netto/Brutto-Preise):'
unit_quantity: Gebinde
units_full: Volle Gebinde
units_ordered: Bestellte Einheiten
create:
@ -1177,26 +1101,18 @@ de:
notice: Die Bestellung wurde beendet.
form:
ignore_warnings: Warnungen ignorieren
name: Name
note: Notiz
origin: Herkunft
prices: Price (netto/FC)
select_all: Alle auswählen
stockit: Verfügbar
supplier: Hersteller
title: Artikel
unit_quantity: Gebinde
index:
action_end: Beenden
confirm_delete: Willst Du wirklich die Bestellung löschen?
confirm_end: Willst Du wirklich die Bestellung %{order} beenden? Es gibt kein zurück.
ended_orders: Beendete Bestellungen
ending: Ende
new_order: Neue Bestellung anlegen
no_open_orders: Derzeit gibt es keine laufende Bestellungen.
note: Notiz
open_orders: Laufende Bestellungen
supplier: Lieferantin
title: Bestellungen verwalten
model:
error_closed: Bestellung wurde schon abgerechnet
@ -1208,17 +1124,11 @@ de:
warning_ordered_stock: ! 'Warnung: Die rot markierten Artikel wurden in der laufenden Lagerbestellung bereits bestellt bzw. gekauft. Wenn Du sie hier abwählst, werden alle bestehenden Bestellungen bzw. Käufe dieses Artikels gelöscht und nicht abgerechnet!'
new:
title: Neue Bestellung anlegen
orders:
ending: Ende
start: Start
status: Status
supplier: Lieferantin
show:
action_end: Beenden!
amounts: ! 'Netto/Bruttosumme:'
articles: Artikelübersicht
articles_ordered: ! 'Bestellte Artikel:'
begin: ! 'Beginn:'
comments:
title: Kommentare
comments_link: Kommentare
@ -1226,7 +1136,6 @@ de:
confirm_end: ! 'Willst Du wirklich die Bestellung %{order} beenden?
Es gibt kein zurück.'
created_by: ! 'Erstellt von:'
download:
article_pdf: Artikel PDF
download_file: Download file
@ -1235,12 +1144,9 @@ de:
group_pdf: Gruppen PDF
matrix_pdf: Matrix PDF
title: Download
ending: ! 'Ende:'
group_orders: ! 'Gruppenbestellungen:'
note: ! 'Notiz:'
sort_article: Sortiert nach Artikeln
sort_group: Sortiert nach Gruppen
supplier: ! 'Lieferantin:'
title: ! 'Bestellung: %{name}'
warn_not_closed: Achtung, Bestellung wurde noch nicht abgerechnet.
state:
@ -1332,29 +1238,23 @@ de:
shared:
articles:
ordered: Bestellt
ordered_desc:
ordered_desc: Anzahl der Artikel die durch das Mitglied bestellt wurden (Menge + Toleranz)
received: Bekommen
received_desc:
received_desc: Anzahl der Artikel die ein Mitglied erhält
articles_by_articles:
ordergroup: Bestellgruppe
price: Gesamtpreis
articles_by_groups:
fc_price: FC-Preis
fc_price_desc: Preis incl. MwSt, Pfand und Foodcoop-Aufschlag
name: Name
price: Gesamtpreis
unit: Einheit
unit_quantity: GebGr
unit_quantity_desc: Gebindegröße
group:
access: Zugriff auf
activated: aktiviert
address: Adresse
apple_limit: Äpfel-Bestellbeschränkung
contact: Kontakt
deactivated: deaktiviert
description: Beschreibung
members: Mitglieder
no_weekly_job: kein wöchentlicher Job definiert
weekly_job: Wöchentlicher Job
group_form_fields:
@ -1363,12 +1263,9 @@ de:
title: Wöchentliche Jobs
user_not_found: Keine Nutzerin gefunden
open_orders:
ending: Ende
no_open_orders: Derzeit gibt es keine laufenden Bestellungen
not_enough_apples: Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können!
supplier: Lieferantin
title: Laufende Bestellungen
total: Summe
total_sum: Gesamtsumme
who_ordered: Wer hat bestellt?
workgroup_members:
@ -1385,7 +1282,7 @@ de:
units_to_order: Wenn Du die Gesamtanzahl gelieferter Gebinde änderst, musst Du auch die individuelle Anzahl der einzelnen Bestellgruppen anpassen, indem Du auf den Artikelnamen klickst. Sie werden nicht automatisch neuberechnet und andernfalls werden den Bestellgruppen Artikel in Rechnung gestellt, die nicht geliefert wurden!
update_current_price: Ändert auch den Preis für aktuelle Bestellungen
stock_article:
copy_stock_article:
copy:
name: Bitte ändern
edit_stock_article:
price: <ul><li>Preisänderung gesperrt.</li><li>Bei Bedarf %{stock_article_copy_link}.</li></ul>
@ -1433,6 +1330,7 @@ de:
new_inventory: Neue Inventur anlegen
title: Inventurübersicht
new:
amount: Menge
create: anlegen
stock_articles: Lagerartikel
temp_inventory: vorläufigen Lagerbestand
@ -1458,23 +1356,18 @@ de:
stockit:
check:
not_empty: ! '%{name} kann nicht gelöscht werden. Der Lagerbestand ist nicht null.'
copy:
title: Lagerartikel kopieren
create:
notice: Neuer Lagerartikel »%{name}« gespeichert.
destroy:
notice: Artikel %{name} gelöscht.
edit:
title: Lagerartikel bearbeiten
form:
copy_stock_article: Lagerartikel kopieren
price_hint: Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden.
index:
article:
article: Artikel
available: verfügbar
category: Kategorie
ordered: davon bestellt
price: Preis
stock: im Lager
supplier: Lieferantin
unit: Einheit
vat: MwSt
confirm_delete: Bist Du sicher?
new_delivery: Neue Lieferung ..
new_stock_article: Neuen Lagerartikel anlegen
@ -1492,16 +1385,13 @@ de:
show:
change_quantity: Veränderung
datetime: Zeitpunkt
delivery: Lieferung
new_quantity: Neuer Bestand
order: Bestellung
reason: Ereignis
stock_changes: Verlauf des Lagerbestands
stock_taking: Inventur
stock_create:
notice: Lagerartikel wurde gespeichert.
stock_update:
notice: Lagerartikel wurde gespeichert.
stock_article:
confirm_delete:
update:
notice: Lagerartikel »%{name}« aktualisiert.
suppliers:
create:
notice: Lieferant wurde erstellt
@ -1538,11 +1428,6 @@ de:
notice: Du hast die Aufgabe übernommen
archive:
title: Aufgabenarchiv
archive_tasks:
due_date: Fälligkeitsdatum
task: Betreff
task_format: ! '%{name} (%{duration}h)'
who: Verantwortliche Menschen
create:
notice: Aufgabe wurde erstellt
destroy:
@ -1566,11 +1451,8 @@ de:
accept_task: Aufgabe übernehmen
done: Erledigt
done_q: Erledigt?
due_date: Fälligkeit
mark_done: Aufgabe als erledigt markieren
reject_task: Aufgabe ablehnen
task: Betreff
task_format: ! '%{name} (%{duration}h)'
who: Wer machts?
who_hint: (Wie viele werden noch benötigt?)
nav:
@ -1607,6 +1489,7 @@ de:
title: Aufgaben für %{workgroup}
title_all: Alle Aufgaben der Gruppe
ui:
actions: Aktionen
close: Schließen
delete: Löschen
edit: Bearbeiten

View file

@ -15,6 +15,7 @@ en:
name: Name
note: Note
order_number: Order number
order_number_short: Nr.
origin: Origin
price: Price (net)
supplier: Supplier
@ -22,6 +23,7 @@ en:
unit: Unit
unit_quantity: Unit quantity
unit_quantity_short: U.Q.
units: Units
article_category:
description: Description
name: Name
@ -30,11 +32,20 @@ en:
note: Note
supplier: Supplier
financial_transaction:
amount: amount
note: note
amount: Amount
created_on: Date
note: Note
ordergroup: Ordergroup
user: Entered by
group_order:
price: Order sum
updated_by: Last ordered by
group_order_article:
ordergroup_id: Ordergroup
quantity: Amount
result: Amount
tolerance: Tolerance
total_price: Sum
invoice:
amount: Amount
date: Billing date
@ -54,20 +65,30 @@ en:
sent_to_all: Send to all members
subject: Subject
order:
closed_by: Settled by
created_by: Created by
ends: Ends at
name: Supplier
note: Note
starts: Starts at
status: Status
order_article:
missing_units: Missing units
missing_units_short: Missing
units_to_order: Amount of units
update_current_price: Globally update current price
order_comment:
text: Add comment to this order ...
ordergroup:
account_balance: Account balance
available_funds: Available credit
contact: Contact
contact_address: Address
contact_person: Contact person
contact_phone: Phone
description: Description
ignore_apple_restriction: Ignore order stop by apple points restriction
last_order: Last order
name: Name
user_tokens: Members
page:
@ -75,10 +96,12 @@ en:
parent_id: Parent page
title: Title
stock_article:
available: Available
price: Price
quantity: Quantity
quantity: In stock
quantity_available: Available quantity
supplier: Supplier
quantity_available_short: Avail.
quantity_ordered: Ordered
stock_taking:
date: Date
note: Note
@ -92,6 +115,7 @@ en:
fax: Fax
is_subscribed: subscribed?
min_order_quantity: Minimum order quantity
min_order_quantity_short: Min. quantity
name: Name
note: Note
order_howto: How to order
@ -103,13 +127,14 @@ en:
done: Done?
due_date: Due date
duration: Duration
name: Name
name: Activity
required_users: People required
user_list: Responsible user
user_list: Responsible users
workgroup: Workgroup
user:
email: Email
first_name: First name
last_login: Last login
last_name: Last name
name: Name
nick: Username
@ -156,7 +181,6 @@ en:
workgroup: Workgroup
admin:
access_to: access to
actions: Actions
base:
index:
all_ordergroups: All ordergroups
@ -194,11 +218,6 @@ en:
workgroup: workgroup
new:
title: Create ordergroup
ordergroups:
address: Address
contact: Contact
members: Members
name: Name
show:
confirm: Are you sure?
edit: Edit group/members
@ -217,20 +236,11 @@ en:
title: Create new user
show:
confirm: Do you really want to kick out %{user}?
email: Email
groupabos: Group subscriptions
member_since: Member since %{time}
name: Name
nick: Nick
person: Person
phone: Phone
preference: Preferences
send_message: Send message
users:
email: email
last_login: last login
login: login
name: name
workgroups:
destroy:
error: ! 'Workgroup could not be deleted: %{error}'
@ -318,17 +328,9 @@ en:
submit: Update all articles
title: Edit all articles from %{supplier}
warning: ! 'Warning: all articles will be updated!'
edit_all_table:
available_desc: available
available_short: avail
order_number_desc: Order number
order_number_short: Ordernr.
price_desc: Net price
price_short: Price
unit_quantity_desc: Unit quantity
unit_quantity_short: Quantity
form:
title: Add new article
title_edit: Edit article
title_new: Add new article
import_search_results:
action_import: import
already_imported: already imported
@ -385,24 +387,17 @@ en:
how_many_units: ! 'How many units (%{unit}) to deliver? Stock article name: %{name}.'
create:
notice: Delivery was created. Please dont forget to create invoice!
create_stock_article:
notice: The new stock article "%{name}" was saved.
destroy:
notice: Delivery was deleted.
edit:
title: Edit delivery
form:
actions: Tasks
article: Article
category: Category
confirm_foreign_supplier_reedit: The stock article %{name} was successfully saved. However, it belongs to a different supplier than this delivery. Would you like to edit the stock article again?
create_from_blank: Create new article
create_stock_article: Create stock article
price: Netprice
quantity: Quantity
title_fill_quantities: 2. Set delivery quantities
title_finish_delivery: 3. Finish delivery
title_select_stock_articles: 1. Select stock articles
unit: Unit
index:
confirm_delete: Are you sure?
new_delivery: ! 'Create new delivery for %{supplier} '
@ -412,29 +407,21 @@ en:
new:
title: New delivery from %{supplier}
show:
amount: Amount
article: Article
price: Netprice
sum: Sum
sum_diff: Gross - adjusted invoice ammount
sum_diff: Gross - adjusted invoice amount
sum_gross: Gross sum
sum_net: Net sum
title: Show delivery
title_articles: Article
unit: Unit
title_articles: Articles
stock_article_for_adding:
action_add_to_delivery: Add to delivery
action_edit: Edit
action_other_price: Copy
stock_article_form:
copy_stock_article: Copy stock article
stock_change_fields:
remove_article: Remove article from delivery
suppliers_overview: Supplier overview
update:
notice: Delivery was updated.
update_stock_article:
notice: The stock article "%{name}" was updated.
documents:
order_by_articles:
filename: Order %{name}-%{date} - by articles
@ -451,7 +438,7 @@ en:
- Ordered
- Received
- Price
- Unit quantity
- Unit Q.
- Unit
- Sum
sum: Sum
@ -496,28 +483,22 @@ en:
balancing:
close:
alert: ! 'An error occured while accounting: %{message}'
notice: Order was accounted succesfully, the balance of the account was updated.
notice: Order was settled succesfully, the balance of the account was updated.
close_direct:
alert: ! 'Order can not be closed: %{message}'
notice: Order was closed.
alert: ! 'Order can not be settled: %{message}'
notice: Order was settled.
confirm:
clear: Close
first_paragraph: ! 'When the order is closed, all group accounts will be updated.<br />The accounts will be charged as follows:'
clear: Settle
first_paragraph: ! 'When the order is settled, all group accounts will be updated.<br />The accounts will be charged as follows:'
or_cancel: or back to accounting
title: Settle order
edit_results_by_articles:
add_article: Add article
amount: Amount
amount_per_unit: Unit quantity * Unit
article: Article
gross: Gross
net: Net
number: Nr.
refund: Deposit
tax: Tax
group_order_articles:
add_group: Add group
group: Group
total: Total costs
total_fc: Sum (FC-price)
units: Units
@ -538,7 +519,7 @@ en:
articles_overview: Overview of articles
comment_on_transaction: Here you can add a comment to your accounting.
comments: Comments
confirm_order: Close order
confirm_order: Settle order
create_invoice: Create invoice
edit_note: Edit note
edit_order: Edit order
@ -553,8 +534,8 @@ en:
orders:
clear: accounting
cleared: accounted (%{amount})
close: close directly
confirm: Do you really want to fully close the order?
close: settle directly
confirm: Do you really want to settle the order?
end: End
ended: closed
last_edited_by: Last edited by
@ -593,38 +574,24 @@ en:
paragraph: Here you can credit and debit money for the order group <b>%{name}</b>.
title: New transaction
new_collection:
amount: Amount
new_ordergroup: Add new order group
note: Note
ordergroup: Order group
save: Save transaction
sidebar: Here you can update more accounts at the same time. For example all transfers of the order group from one account statement
sidebar: Here you can update more accounts at the same time. For example all transfers of the order group from one account statement.
title: Updating more accounts
ordergroup:
remove: Remove
remove_group: Remove group
transactions:
amount: Amount
date: Date
note: Note
who: Who
group_order_articles:
form:
amount_change_for: Change amount for %{article}
result_hint: ! 'Unit: %{unit}'
index:
amount: Amount
amount_fc: Amount(FC)
clear: To account
date: Date
end: End
everything_cleared: Great, everything is accounted...
group: Group
last_transactions: Recent transactions
note: Note
open_transactions: Unsettled orders
show_all: show all
supplier: Supplier
title: Finances
unpaid_invoices: Unpaid invoices
invoices:
@ -635,7 +602,6 @@ en:
title: Invoices
invoices:
confirm_delete: Are you sure?
delivery: Delivery
linked: This invoice is linked to %{what_link}.
linked_delivery: a delivery
linked_order: an order
@ -657,10 +623,7 @@ en:
search_placeholder: Search ...
title: Manage accounts
ordergroups:
account_balance: Account balance
account_statement: Account statement
contact: Contact
name: Name
new_transaction: New transaction
receive:
add_article:
@ -680,10 +643,6 @@ en:
only_active: Only active groups
only_active_desc: (have placed order at least once in the last 3 months)
title: Ordergroups
ordergroups:
last_ordered: Last ordered
name: Name
user: Users
users:
index:
body: <p>Here you can write a message to the members of your Foodcoop.</p> <p>You have to approve in your %{profile_link} that your contact details are visible.</p>
@ -719,30 +678,14 @@ en:
notfound: Incorrect URL, this is not your order.
form:
action_save: Save order
amount: Amount
available: Available
available_funds: Available credits
created_by: Created by
ending: End
funds: Credit
last_update: Last ordered
manufacturer: Manufacturer
min_quantity: Minimum quantity
name: Name
new_funds: New account balance
note: Note
price: Price
reset_article_search: Reset search
search_article: Search for article...
sum: Sum
search_article: Search for articles...
sum_amount: Current amount
supplier: Supplier
title: Orders
tolerance: Tolerance
total_sum_amount: Total amount
total_tolerance: Total tolerance
unit: Unit
unit_missing: Missing units
units: Units
units_full: Filled units
units_total: Total units
@ -754,9 +697,7 @@ en:
title: Unsettled orders
total_sum: Total sum
funds:
account_balance: Account balance
available_funds: Available credit
finished_orders: unsettled orders
finished_orders: Unsettled orders
open_orders: Current orders
title: Credit
title: Orders overview
@ -764,14 +705,9 @@ en:
not_enough_apples: You need at least %{stop_ordering_under} apples to order. Currently your order group has only %{apples} apples.
order:
title: Articles
orders:
ending: End
sum: Sum
supplier: Suppliers
show:
articles:
edit_order: Edit order
name: Name
not_ordered_msg: You didnt place an order yet
order_closed_msg: Sorry, this order is closed.
order_nopen_title: Considering current orders of all groups
@ -781,21 +717,14 @@ en:
ordered: Ordered
ordered_title: Amount + tolerance
show_hide: Show/hide articles not ordered
sum: Sum
show_note: Show note
title: Article overview
total_price: Total price
unit_price: Unit price
units: Units
closed_by: Settled by %{user}
comment: Comment
comments:
title: Comments
ending: End
not_ordered: You didnt order.
note: Note
order_sum: Order sum
sum: Sum
supplier: Suppliers
title: Your order result for %{order}
switch_order:
remaining: ! '%{remaining} remaining'
@ -829,6 +758,7 @@ en:
create: send message
tasks:
required_users: ! '%{count} members are still needed!'
task_title: ! '%{name} (%{duration}h)'
home:
apple_bar:
desc: ! 'This shows the proportion of completed tasks to the volume of orders for your ordergroup in comparison to the average of the Foodcoop. In practice: for every %{amount} of total orders, you should execute a task!'
@ -843,15 +773,11 @@ en:
view_all: See all messages
my_ordergroup:
funds: ! '| Available Credit:'
last_update: Last Update was %{when} ago
last_update: Last update was %{when} ago
title: My ordergroup
transactions:
amount: Amount
note: Note
title: Last Transactions
view: Show account statement
when: When
where: Who
ordergroup:
title: Engagement of your ordergroup
tasks_move:
@ -885,7 +811,7 @@ en:
admin: Administration
finances:
accounts: Update accounts
settle: To account orders
settle: Account orders
title: Finances
foodcoop: Foodcoop
members: Members
@ -1169,10 +1095,8 @@ en:
orders:
articles:
article_count: ! 'Ordered articles:'
name: Name
prices: Net/gross price
prices_sum: ! 'Sum (net/gross price):'
unit_quantity: Unit quantity
units_full: Full units
units_ordered: Units ordered
create:
@ -1191,26 +1115,18 @@ en:
notice: The order has been closed.
form:
ignore_warnings: Ignore warnings
name: Name
note: Note
origin: Origin
prices: Prices (net/FC)
select_all: Select all
stockit: In stock
supplier: Producer
title: Article
unit_quantity: Unit quantity
index:
action_end: Close
confirm_delete: Do you really want to delete the order?
confirm_end: Do you really want to close the order %{order}? There is no going back.
ended_orders: Closed orders
ending: End
new_order: Create new order
no_open_orders: There are currently no open orders.
note: Note
open_orders: Current orders
supplier: Supplier
title: Manage orders
model:
error_closed: Order was already settled
@ -1218,21 +1134,15 @@ en:
error_starts_before_ends: must be after the start date (or remain empty)
notice_close: ! 'Order: %{name}, until %{ends}'
stock: Stock
warning_ordered: ! 'Warning: Articles marked red have already been ordered within this open order. If you uncheck them here, all existing orders of these articles will be deleted.'
warning_ordered: ! 'Warning: articles marked red have already been ordered within this open order. If you uncheck them here, all existing orders of these articles will be deleted.'
warning_ordered_stock: ! 'Warning: Articles marked red have already been ordered/purchased within this open stock order. If you uncheck them here, all existing orders/purchases of these articles will be deleted and it will not be accounted for them.'
new:
title: Create new order
orders:
ending: End
start: Start
status: Status
supplier: Supplier
show:
action_end: Close!
amounts: ! 'Net/gross sum:'
articles: Article overview
articles_ordered: ! 'Ordered articles:'
begin: ! 'Begin:'
comments:
title: Comments
comments_link: Comments
@ -1240,7 +1150,6 @@ en:
confirm_end: ! 'Do you really want to close the order %{order}?
There is no going back.'
created_by: ! 'Created by:'
download:
article_pdf: Article PDF
download_file: Download file
@ -1249,12 +1158,9 @@ en:
group_pdf: Group PDF
matrix_pdf: Matrix PDF
title: Download
ending: ! 'End:'
group_orders: ! 'Group orders:'
note: ! 'Note:'
sort_article: Sorted in articles
sort_group: Sorted in groups
supplier: ! 'Supplier:'
title: ! 'Order: %{name}'
warn_not_closed: Warning, order is not yet settled.
state:
@ -1269,7 +1175,7 @@ en:
recent_changes: Recent changes
search:
action: Search
placeholder: Page title ..
placeholder: Page title ...
site_map: Sitemap
title: All Wiki pages
title_list: List of pages
@ -1355,20 +1261,14 @@ en:
articles_by_groups:
fc_price: FC-Price
fc_price_desc: Price including taxes, deposit and Foodcoop-charge
name: Name
price: Total price
unit: Unit
unit_quantity: Lot quantity
unit_quantity_desc: How many units per lot.
group:
access: Access to
activated: activated
address: Address
apple_limit: Apple points order limit
contact: Contact
deactivated: deactivated
description: Description
members: Members
no_weekly_job: No weekly job defined
weekly_job: Weekly job
group_form_fields:
@ -1377,12 +1277,9 @@ en:
title: Weekly jobs
user_not_found: No user found
open_orders:
ending: Ending
no_open_orders: There are no current orders
not_enough_apples: Attention your order group has too few apple points to place an order!
supplier: Supplier
title: Current orders
total: Sum
total_sum: Total sum
who_ordered: Who ordered?
workgroup_members:
@ -1392,19 +1289,19 @@ en:
default_message: Errors were found. Please check the form.
hints:
article:
unit: ! 'For example: KG or 1L or 500g'
unit: e.g. KG or 1L or 500g
message:
private: Message doesnt show in Foodsoft mail inbox
order_article:
units_to_order: If you change the total amount of delivered units, you also have to change individual group amounts by clicking on the article name. They will not be automatically recalculated and so ordergroups may be accounted for articles that were not delivered!
update_current_price: Also update the price of the current order
stock_article:
copy_stock_article:
copy:
name: Please modify
edit_stock_article:
price: <ul><li>Price changes are forbidden.</li><li>If necessary, %{stock_article_copy_link}.</li></ul>
supplier:
min_order_quantity: The minimum amount which has to be orderd will be shown during the order process and should motivate ordering
min_order_quantity: The minimum amount which has to be ordered will be shown during the order process and should motivate ordering
task:
duration: How long will the task take, 1-3 hours
required_users: How many users will be needed in total?
@ -1447,6 +1344,7 @@ en:
new_inventory: Create new inventory
title: Inventory overview
new:
amount: Amount
create: create
stock_articles: Stock articles
temp_inventory: temporary inventory
@ -1472,25 +1370,20 @@ en:
stockit:
check:
not_empty: ! '%{name} could not be deleted, the inventory is not zero.'
copy:
title: Copy stock article
create:
notice: New stock article "%{name}" was created.
destroy:
notice: Article %{name} was deleted.
edit:
title: Edit stock articles
form:
copy_stock_article: copy stock article
price_hint: To avoid choas, it is not possible to edit the prices of already added stock articles until further notice.
index:
article:
article: Article
available: available
category: Category
ordered: ordered
price: Price
stock: In stock
supplier: Supplier
unit: Unit
vat: VAT
confirm_delete: Are you sure you want to delete?
new_delivery: New delivery ..
new_delivery: New delivery ...
new_stock_article: Add new stock article
new_stock_taking: Add inventory
order_online: Put stock order online
@ -1506,16 +1399,13 @@ en:
show:
change_quantity: Change
datetime: Time
delivery: Delivery
new_quantity: New quantity
order: Order
reason: Reason
stock_changes: Stock quantity changes
stock_taking: Inventory
stock_create:
notice: Stock article was created.
stock_update:
notice: Stock article was saved.
stock_article:
confirm_delete: Are you sure you want to delete the stock article %{name}?
update:
notice: Stock article %{name} was saved.
suppliers:
create:
notice: Supplier was created
@ -1552,11 +1442,6 @@ en:
notice: You have accepted the task
archive:
title: Task archive
archive_tasks:
due_date: Due date
task: Subject
task_format: ! '%{name} (%{duration}h)'
who: People in charge
create:
notice: Task has been created
destroy:
@ -1580,11 +1465,8 @@ en:
accept_task: Accept task
done: Done
done_q: Done?
due_date: Due date
mark_done: Mark task as done
reject_task: Reject task
task: subject
task_format: ! '%{name} (%{duration}h)'
who: Who is doing it?
who_hint: (How much are still needed?)
nav:
@ -1621,6 +1503,7 @@ en:
title: Tasks for %{workgroup}
title_all: All group tasks
ui:
actions: Actions
close: Close
delete: Delete
edit: Edit

View file

@ -15,6 +15,7 @@ fr:
name: Nom
note: Note
order_number: ! 'Numéro '
order_number_short: Numéro
origin: Lieu de production
price: Prix net
supplier:
@ -22,6 +23,7 @@ fr:
unit: Unité
unit_quantity: Unités par lot
unit_quantity_short:
units: Lots
article_category:
description: Description
name: Nom
@ -30,11 +32,20 @@ fr:
note:
supplier: Fournisseuse_r
financial_transaction:
amount: montant
note: note
amount: Montant
created_on: Date
note: Note
ordergroup: Cellule
user:
group_order:
price: Total de la commande
updated_by: Dernière commande
group_order_article:
ordergroup_id: Cellul
quantity: Quantité
result: Quantité
tolerance:
total_price: Total
invoice:
amount: Montant
date: Date de facturation
@ -54,20 +65,30 @@ fr:
sent_to_all: Envoyer à tous les membres
subject: Sujet
order:
closed_by: Décompté par
created_by: Établi par
ends: Clôture le
name: FournisseurE
note:
starts: Ouverture le
status:
order_article:
missing_units: Unités manquantes
missing_units_short:
units_to_order: Quantité
update_current_price: Mettre à jour le prix global
order_comment:
text: Commenter cette commande...
ordergroup:
account_balance: Crédit initial
available_funds: Crédit disponible
contact: Contact
contact_address: Adresse
contact_person: Personne à contacter
contact_phone: Téléphone
description: Description
ignore_apple_restriction: Pour cette cellule, ne pas bloquer les commandes en cas de manque de glands
last_order: dernière commande
name: Nom
user_tokens: Membres
page:
@ -75,10 +96,12 @@ fr:
parent_id: Page parente
title: Titre
stock_article:
available: Disponible
price: Prix net
quantity:
quantity: en Stock
quantity_available:
supplier: FournisseurE
quantity_available_short:
quantity_ordered: Commandés
stock_taking:
date:
note:
@ -92,6 +115,7 @@ fr:
fax: Fa
is_subscribed: abonné?
min_order_quantity: Quantité minimale à commander
min_order_quantity_short:
name: Nom
note: Note
order_howto: Comment commander
@ -103,13 +127,14 @@ fr:
done: Fait?
due_date: Echéance
duration: Durée
name: Nom
name:
required_users: Nombre de personnes nécessaires
user_list: Responsables inscritEs
workgroup: Équipe
user:
email: Email
first_name: Prénom
last_login: Dernière connection
last_name: Nom de famille
name: Nom
nick: Identifiant
@ -139,24 +164,23 @@ fr:
exclusion: répétition hebdomadaire invalide pour un boulot déjà effectué
models:
article: Article
article_category: la nouvelle catégorie
delivery: le nouveau réapprovisionnement
financial_transaction: la transaction
invoice: la nouvelle facture
article_category: Catégorie
delivery: Réapprovisionnement
financial_transaction: Transaction
invoice: Facture
message: Message
order: la nouvelle commande
order: Commande
order_article: Article à commander
order_comment: un nouveau commentaire
ordergroup: la nouvelle cellule
order_comment: Commentaire
ordergroup: Cellule
stock_article: l'article à stocker
stock_taking: Inventaire
supplier: FournisseusE_r
task: comme nouveau boulot
user: le nouveau membre
workgroup: la nouvelle équipe
task: Boulot
user: Membre
workgroup: Équipe
admin:
access_to: accès à
actions: Actions
base:
index:
all_ordergroups: Toutes les cellules
@ -194,11 +218,6 @@ fr:
workgroup: équipe
new:
title: Définir une nouvelle cellule
ordergroups:
address: Adresse
contact: Contact
members: Membres
name: Nom
show:
confirm: T'es sûrE de ton coup?
edit: Modifier les données sur les cellules et/ou leurs membres
@ -217,20 +236,11 @@ fr:
title: Ajouter unE nouveLLE_eau membre
show:
confirm: Veux-tu vraiment expulser %{user}?
email: Email
groupabos: Participation à des équipes
member_since: Membre depuis %{time}
name: Nom
nick: Identifiant
person: Personne
phone: Numéro de téléphone
preference: Préférences
send_message: Envoyer un message
users:
email: email
last_login: dernière connection
login: identifiant
name: nom
workgroups:
destroy:
error: ! 'Cette équipe n''a pas pu être supprimée: %{error}'
@ -318,17 +328,9 @@ fr:
submit: Mettre à jour tous les articles
title: Modifier tous les articles de %{supplier}
warning: Attention, tous les articles sont en train d'être mis à jour!
edit_all_table:
available_desc: disponible
available_short: disp.
order_number_desc: numéro de commande
order_number_short: n°
price_desc: Prix net
price_short: Prix
unit_quantity_desc: Unités par lot
unit_quantity_short: U/L
form:
title: Ajouter un nouvel article
title_edit:
title_new: Ajouter un nouvel article
import_search_results:
action_import: importer
already_imported: déjà importé
@ -389,24 +391,17 @@ fr:
how_many_units: Combien d unités (%{unit}) de l article %{name} doivent-elles être livrées?
create:
notice: Le réapprovisionnement a bien a été défini. Attention à ne pas oublier de déposer la facture correspondante!
create_stock_article:
notice: L'article "%{name}" a été ajouté au stock.
destroy:
notice: Le réapprovisionnement a été annulé.
edit:
title: Modifier le réapprovisionnement
form:
actions: Options
article: Article
category: Catégorie
confirm_foreign_supplier_reedit:
create_from_blank: Ajouter un nouvel article quelconque
create_stock_article: Ajouter un article au stock
price: Prix net
quantity: Quantité
title_fill_quantities: 2. Définir la quantité à livrer
title_finish_delivery: 3. Clore le réapprovisionnement
title_select_stock_articles: 1. Choisir les articles en stock
unit: Unité
index:
confirm_delete: T'es sûrE de ton coup?
new_delivery: Réapprovisionner le stock par %{supplier}
@ -416,29 +411,21 @@ fr:
new:
title: Réapprovisionner le stock par %{supplier}
show:
amount: Quantité
article: Article
price: Prix net
sum: Prix total
sum_diff: montant brut - montant net
sum_gross: prix total brut
sum_net: prix total net
title: Afficher le réapprovisionnement
title_articles: Article
unit: Unité
title_articles: Articles
stock_article_for_adding:
action_add_to_delivery: Commander
action_edit: Modifier
action_other_price: Copier
stock_article_form:
copy_stock_article: Copier l'article
stock_change_fields:
remove_article: Retirer l'article de cette commande
suppliers_overview: Liste des fournisseusEs_rs
update:
notice: La commande a été actualisée
update_stock_article:
notice: Les données de l'article "%{name}" ont été mises à jour.
documents:
order_by_articles:
filename: Commande %{name}-%{date} - Trier par
@ -518,16 +505,10 @@ fr:
edit_results_by_articles:
add_article: Ajouter un article
amount: Quantité
amount_per_unit: Poids d'un lot
article: Article
gross: Brut
net: Net
number: Numéro
refund: Consigne
tax: TVA
group_order_articles:
add_group: Créer un nouveau groupe
group: Groupe
total: Prix total
total_fc: Prix total (pour la boufcoop)
units: Nombre d'unités
@ -602,38 +583,24 @@ fr:
paragraph: Cet espace permet de rajouter ou d'enlever du crédit à la cellule <b>%{name}</b>.
title: Nouvelle transaction
new_collection:
amount: Montant
new_ordergroup: Créer d'autres cellules
note: Note
ordergroup: Cellule
save: Sauvegarder les transactions
sidebar: ! "Cet espace permet de mettre à jour plusieurs comptes simultanément, \npar exemple pour saisir les versements des cellules sur leurs comptes à partir d'un relevé."
title: Mettre à jour plusieurs comptes
ordergroup:
remove: Supprimer
remove_group: Supprimer cette cellule
transactions:
amount: Montant
date: Date
note: Note
who: Qui?
group_order_articles:
form:
amount_change_for: Modification de la quantité de %{article}
result_hint:
index:
amount: Montant
amount_fc: Montant(boufcoop)
clear: Décompter
date: Date
end: Fin
everything_cleared: Super, tout est a déjà été décompté!
group: Cellule
last_transactions: Dernières transactions
note: Note
open_transactions: à décompter
show_all: tout afficher
supplier: FournisseusE_r
title: Espace trésorerie
unpaid_invoices: Factures à régler
invoices:
@ -644,7 +611,6 @@ fr:
title: Factures
invoices:
confirm_delete: T'es sûrE de ton coup?
delivery: Réapprovisionnement
linked: Cette facture est associée à %{what_link}.
linked_delivery: un réapprovisionnement
linked_order: une commande
@ -666,10 +632,7 @@ fr:
search_placeholder: Rechercher ...
title: Crédits des cellules
ordergroups:
account_balance: Crédit disponible
account_statement: Relevé de compte
contact:
name: Nom
new_transaction: Nouvelle transaction
update:
notice: La facture a été mise à jour.
@ -680,10 +643,6 @@ fr:
only_active: Seulement les cellules en activité
only_active_desc: (ayant commandé au moins une fois au cours des 3 derniers mois)
title: Cellules
ordergroups:
last_ordered: dernière commande
name: Nom
user: Membres
users:
index:
body: ! '<p>Cette page sert à envoyer des messages aux autres membres de la coop.</p>
@ -723,30 +682,14 @@ fr:
notfound: ! ' Mauvaise adresse, ce n''est pas ta commande.'
form:
action_save: Enregistrer ta commande
amount: Quantité
available: Disponible
available_funds: Crédit disponible
created_by: Établi par
ending: Clôture le
funds: Crédit
last_update: Dernière commande
manufacturer: Produit par
min_quantity: Quantité minimale
name: Nom
new_funds: Nouveau solde
note: Note
price: Prix
reset_article_search:
search_article:
sum: Prix total
sum_amount: ! 'Quantité déjà commandée:'
supplier: Fourni par
sum_amount: Quantité déjà commandée
title: Commander
tolerance: Tolérance
total_sum_amount: Montant total
total_tolerance: Tolérance totale
unit: Unité
unit_missing: Unités manquantes
units: Lots
units_full: Lots complet
units_total: Unités déjà commandées
@ -758,8 +701,6 @@ fr:
title: Commandes par encore décomptées
total_sum: Total
funds:
account_balance: Crédit initial
available_funds: Crédit disponible
finished_orders: montant prévu des commandes non décomptées
open_orders: montant des commandes en cours
title: Crédit
@ -770,14 +711,9 @@ fr:
alors que vous n''en avez que %{apples} pour le moment.'
order:
title: Article
orders:
ending: Clôture le
sum: Total
supplier: FournisseusE_r
show:
articles:
edit_order: Modifier ta commande
name: Nom
not_ordered_msg: Tu n'as pas encore commandé
order_closed_msg: Désolé, cette commande a déjà été fermée. Il faudra te réveiller plus tôt la prochaine fois
order_nopen_title: En tenant compte des commandes en cours de toutes les cellules
@ -787,21 +723,14 @@ fr:
ordered: Quantité souhaitée
ordered_title: Quantité + tolérance
show_hide: Montrer/cacher les articles non commandés
sum: Total
show_note:
title: Aperçu des articles
total_price: Prix
unit_price: Prix unitaire
units: Lots
closed_by: Décompté par %{user}
comment: Lire/écrire des commentaire
comments:
title: Commentaire
ending: Clôture le
not_ordered: Tu n'as pas commandé.
note: Note
order_sum: Total de la commande
sum: Total
supplier: Fourni par
title: Ta part de la commande %{order}
switch_order:
remaining: encore %{remaining}
@ -835,6 +764,7 @@ fr:
create: Envoyer un message
tasks:
required_users: Il manque encore %{count} camarades!
task_title: ! '%{name} (%{duration}h)'
home:
apple_bar:
desc: ! 'Ce système de glands sert à comparer la durée du travail collectif auquel ta cellule a contribué (rapportée à la quantité commandée) avec
@ -858,12 +788,8 @@ fr:
last_update: La dernière mise à jour date du %{when}
title: Ta cellule
transactions:
amount: Montant
note: Note
title: Dernière transactions
view: Afficher un relevé de compte
when: Quand?
where: Qui?
ordergroup:
title: Niveau de participation de ta cellule
tasks_move:
@ -1164,10 +1090,8 @@ fr:
orders:
articles:
article_count: ! 'Articles commandés:'
name: Nom
prices: Prix brut/net
prices_sum: ! 'Totaux (des prix bruts/nets):'
unit_quantity: Unités par lots x Lots
units_full: Lots complet
units_ordered: Unités commandées
create:
@ -1186,26 +1110,18 @@ fr:
notice: La commande a été close.
form:
ignore_warnings:
name: Nom
note: Note
origin: Origine
prices: Prix (net/coop)
select_all: Tout sélectionner
stockit: Disponible
supplier: Productrice_teur
title: Article
unit_quantity: Lots
index:
action_end: Terminer
confirm_delete: Vraiment supprimer la commande?
confirm_end: Veux tu vraiment mettre fin à la commande %{order}? Attention, il n'y aura pas d'annulation possible.
ended_orders: Commandes closes
ending: Clôture le
new_order: Définir une nouvelle commande
no_open_orders: Il n'y a aucune commande en cours en ce moment.
note: Note
open_orders: Commandes en cours
supplier: FournisseusE_r
title: Gestion des commandes
model:
error_closed: Cette commande a déjà été décomptée
@ -1217,23 +1133,16 @@ fr:
warning_ordered_stock:
new:
title: Définir une nouvelle commande
orders:
ending: Clôture le
start: Début
status: Statut
supplier: FournisseurE
show:
action_end: Clore!
amounts: ! 'Total net/brut:'
articles: Aperçu des articles
articles_ordered: ! 'Articles commandés:'
begin: ! 'Début:'
comments:
title: Commentaire
comments_link: Commenaire
confirm_delete: Veux-tu vraiment supprimer la commande?
confirm_end: Veux tu vraiment terminer la commande %{order}? Pas d'annulation possible.
created_by: ! 'Créée par:'
download:
article_pdf: Liste des articles en PDF
download_file: Télécharger
@ -1242,12 +1151,9 @@ fr:
group_pdf: Liste des cellules en PDF
matrix_pdf: Matrice de distribution en PDF
title: Télécharger
ending: ! 'Clôture le:'
group_orders: ! 'Commandes des cellules:'
note: ! 'Note:'
sort_article: Trié par article
sort_group: Trié par cellules
supplier: FournisseurE
title: ! 'Commande: %{name}'
warn_not_closed: Attention, cette commande n'a pas encore été décomptée!
state:
@ -1348,20 +1254,14 @@ fr:
articles_by_groups:
fc_price: Prix coop
fc_price_desc: Prix avec TVA, consigne et part de la coop inclus.
name: Nom
price: Prix total
unit: Unité
unit_quantity: U/L
unit_quantity_desc: Unités par lot
group:
access: Accès à
activated: activé
address: Adresse
apple_limit: Minimum de glands
contact: Contact
deactivated: désactivé
description: Description
members: Membre
no_weekly_job: aucun boulot hebdomadaire n'a été défini
weekly_job: Boulot hebdomadaire
group_form_fields:
@ -1370,12 +1270,9 @@ fr:
title: Boulots hebdomadaires
user_not_found: Aucune utilisatrice n'a été trouvée.
open_orders:
ending: Clôture le
no_open_orders: Il n'y a aucune commande en cours en ce moment
not_enough_apples: Désolé, ta cellule n'a pas assez de glands pour pouvoir commander!
supplier: FournisseusE_r
title: Commandes en cours
total: Total
total_sum: Total
who_ordered: Qui a commandé?
workgroup_members:
@ -1392,7 +1289,7 @@ fr:
units_to_order:
update_current_price: Modifie aussi le prix des commandes en cours
stock_article:
copy_stock_article:
copy:
name: Merci de modifier
edit_stock_article:
price: <ul><li>Modification du prix enregistrée. </li><li>Si nécessaire %{stock_article_copy_link}.</li></ul>
@ -1440,6 +1337,7 @@ fr:
new_inventory: Inventorier le stock
title: Aperçu de l'inventaire
new:
amount:
create: ajouter
stock_articles: Articles en stock
temp_inventory: l'inventaire courant
@ -1467,23 +1365,18 @@ fr:
stockit:
check:
not_empty: ! '%{name} ne peut pas être supprimé, car il y en a encore en stock.'
copy:
title: Copier l'article
create:
notice:
destroy:
notice: L'article %{name} a bien été supprimé du stock.
edit:
title: Modifier l'article
form:
copy_stock_article: copier l'article
price_hint: Pour éviter que ça soit le bazar, les prix des articles en stock ne peuvent plus être modifiés.
index:
article:
article: Article
available: disponible
category: Catégorie
ordered: commandés
price: Prix
stock: en Stock
supplier: FournisseusE_r
unit: Unité
vat: TVA
confirm_delete: T'es sûrE de ton coup?
new_delivery: Réapprovisionner le stock...
new_stock_article: Ajouter un article au stock
@ -1501,16 +1394,13 @@ fr:
show:
change_quantity: Modification
datetime: Temps
delivery: Réapprovisionnement
new_quantity: Nouveau stock
order: Commande
reason: Raison
stock_changes: Afficher l'historique
stock_taking: Inventaire
stock_create:
notice: L'article a été sauvegardé.
stock_update:
notice: L'article a été sauvegardé.
stock_article:
confirm_delete:
update:
notice: Les données de l'article "%{name}" ont été mises à jour.
suppliers:
create:
notice: FournisseusE_r misE à jour
@ -1551,11 +1441,6 @@ fr:
notice: Tu as accepté ce boulot
archive:
title: Historique du boulot
archive_tasks:
due_date: Échéance
task: Sujet
task_format: ! '%{name} (%{duration}h)'
who: Personnes en charge
create:
notice: Le boulot a bien été défini.
destroy:
@ -1583,11 +1468,8 @@ fr:
accept_task: Te charger de ce boulot
done: Effectué
done_q: Effectué?
due_date: À faire pour le
mark_done: Marquer ce boulot comme étant effectué
reject_task: Refuser ce boulot
task: Description
task_format: ! '%{name} (%{duration}h)'
who: Qui le fait?
who_hint: (Combien manquent encore?)
nav:
@ -1624,6 +1506,7 @@ fr:
title: Agenda de l'%{workgroup}
title_all: Boulot prévu pour l'équipe
ui:
actions: Actions
close: Fermer
delete: Supprimer
edit: Modifier

File diff suppressed because it is too large Load diff

View file

@ -86,9 +86,14 @@ Foodsoft::Application.routes.draw do
end
resources :stock_articles, :to => 'stockit' do
get :copy
collection do
get :articles_search
get :fill_new_stock_article_form
get :derive
get :index_on_stock_article_create
get :index_on_stock_article_update
get :show_on_stock_article_update
end
end
@ -96,15 +101,12 @@ Foodsoft::Application.routes.draw do
get :shared_suppliers, :on => :collection
resources :deliveries do
post :add_stock_change, :on => :collection
collection do
post :add_stock_change
get :new_stock_article, :on => :collection
get :copy_stock_article, :on => :collection
get :derive_stock_article, :on => :collection
post :create_stock_article, :on => :collection
get :edit_stock_article, :on => :collection
put :update_stock_article, :on => :collection
get :form_on_stock_article_create
get :form_on_stock_article_update
end
end
resources :articles do

View file

@ -13,11 +13,14 @@ Deploy
--------
On your first deploy you should run
bundle exec cap deploy:setup
bundle exec cap deploy:check
Deploy to staging
bundle exec cap deploy
Deploy to production
bundle exec cap production deploy

View file

@ -17,6 +17,9 @@ Getting started
```
git clone https://github.com/foodcoops/foodsoft.git
```
This brings up the bleeding-edge development version, which might contain some
unfinished parts. If you want to be safe, choose the last release:
`git checkout $(git tag -l | grep ^v | sort -rn | head -n1)`
1. Install RVM and Ruby 1.9.3 (if you have not done so before):
```

View file

@ -0,0 +1,40 @@
# Publish/subscribe pattern
## Handling DOM updates after AJAX database manipulation
As an example, let us consider the manipulation (create, update...) of `StockArticles`. This can be done in different views, e.g., `stock_articles/index`, `stock_articles/show` and `deliveries/_form` through modals using AJAX requests. As an advantage of the AJAX technique, the user does not need to reload the entire page. However, (after the update of the `StockArticle` in the database) it is generally required to update the DOM in the current view such that the page properly reacts to the asynchronous actions.
The process can be divided in two steps: **1.** AJAX database manipulation and **2.** DOM updates for the particular view. The crucial point is the coupling of the two steps since the controller for the first step offers the same functionality to all views and does not need to know anything about the current view.
### 1. AJAX database manipulation
**(i)** Example: current view `deliveries/_form` offers a link for the AJAX action `StockArticle#new`. This opens a modal filled with `stock_articles/_form`.
**(ii)** AJAX form post addresses the `StockArticle#create` action which handles the database manipulation.
**(iii)** The database manipulation is finished by the rendering of, e.g., `stock_articles/create.js.erb`. The key task there is to **publish** the database changes by calling `trigger`, i.e.,
$(document).trigger({
type: 'StockArticle#create',
stock_article_id: <%= @stock_article.id %>
});
### 2. DOM updates for the particular view
**(i)** Each view has the opportunity to **subscribe** to particular events of the previous step. A very simple example is the update of the `stock_articles/index` view after `StockArticle#destroy`:
$(document).on('StockArticle#destroy', function(e) {
$('#stockArticle-' + e.stock_article_id).remove();
});
However, in most of the situations you will like to use the full power of the MVC framework in order to read new data from the database and render some partial. Let us consider this slightly more advanced case in the following.
The view `stock_articles/index` could listen (amongst others) to `StockArticle#create` like this:
$(document).on('StockArticle#create', function(e) {
$.ajax({
url: '#{index_on_stock_article_create_stock_articles_path}',
type: 'get',
data: {id: e.stock_article_id},
contentType: 'application/json; charset=UTF-8'
});
});
**(ii)** The action `StockArticles#index_on_stock_article_create` is a special helper action to handle DOM updates of the `stock_articles/index` view after the creation of a new `StockArticle` with the given `id`.

View file

@ -51,7 +51,7 @@ class PagesController < ApplicationController
end
def create
@page = current_user.pages.build(params[:page])
@page = Page.new(params[:page].merge({:user => current_user}))
if params[:preview]
render :action => 'new'

View file

@ -2,7 +2,8 @@ module PagesHelper
include WikiCloth
def wikified_body(body, title = nil)
WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html.html_safe
render_opts = {:locale => I18n.locale} # workaround for wikicloth 0.8.0 https://github.com/nricciar/wikicloth/pull/59
WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html(render_opts).html_safe
end
def link_to_wikipage(page, text = nil)

View file

@ -108,6 +108,9 @@ gem 'localeapp'" >>Gemfile
fi
# TODO add more extensive database seed
# XXX don't use redis for now
echo "Resque.inline = true" >config/initializers/resque.rb
# and push = deploy
git add -A
git commit -q -m "heroku changes for environment ${RAILS_ENV}" -a

View file

@ -1,14 +1,26 @@
# optional test coverage
# needs to be loaded first, e.g. add a require at top of spec_helper
if ENV['COVERAGE']
if ENV['COVERAGE'] or ENV['COVERALLS']
require 'simplecov'
# update coveralls.io on Travis CI
if ENV['COVERALLS']
require 'coveralls'
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
end
# slightly tweaked coverage reporting
def cov_no_plugins(source_file, path)
source_file.filename =~ /#{path}/ and not source_file.filename =~ /\/lib\/foodsoft_.*\//
end
SimpleCov.start do
add_filter '/spec/'
add_filter '/test/'
add_group 'Models', '/app/models/'
add_group 'Controllers', '/app/controllers/'
add_group 'Helpers', '/app/helpers/'
add_group 'Documents', '/app/documents/'
add_group 'Libraries', '/lib/'
add_group 'Models' do |s| cov_no_plugins s, '/app/models/' end
add_group 'Controllers' do |s| cov_no_plugins s, '/app/controllers/' end
add_group 'Helpers' do |s| cov_no_plugins s, '/app/helpers/' end
add_group 'Documents' do |s| cov_no_plugins s, '/app/documents/' end
add_group 'Libraries' do |s| cov_no_plugins s, '/lib/' end
add_group 'Plugins' do |s| s.filename =~ /\/lib\/foodsoft_.*\// end
end
end