Merge branch 'master' into fix-closed-group_order-totals

Conflicts:
	db/schema.rb
This commit is contained in:
wvengen 2013-09-18 18:14:07 +02:00
commit ebb22ccb53
137 changed files with 4484 additions and 1507 deletions

1
.gitignore vendored
View file

@ -16,3 +16,4 @@ doc/app/
Capfile Capfile
config/deploy.rb config/deploy.rb
config/deploy/* config/deploy/*
.localeapp

14
.travis.yml Normal file
View file

@ -0,0 +1,14 @@
language: ruby
rvm:
- 1.9.3
services:
- redis-server
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
before_script:
- "bundle exec rake foodsoft:setup:stock_config"
- "mysql -e 'create database foodsoft_test;'"
- 'printf "test:\n adapter: mysql2\n database: foodsoft_test\n username: travis\n encoding: utf8\n" >config/database.yml'
- 'bundle exec rake db:schema:load RAILS_ENV=test'
script: bundle exec rake spec

31
Gemfile
View file

@ -17,6 +17,8 @@ group :assets do
end end
gem 'jquery-rails' gem 'jquery-rails'
gem 'select2-rails'
gem 'bootstrap-datepicker-rails'
gem 'mysql2' gem 'mysql2'
@ -35,7 +37,7 @@ gem 'simple-navigation-bootstrap'
gem 'meta_search' gem 'meta_search'
gem 'acts_as_versioned', git: 'git://github.com/technoweenie/acts_as_versioned.git' # Use this instead of rubygem gem 'acts_as_versioned', git: 'git://github.com/technoweenie/acts_as_versioned.git' # Use this instead of rubygem
gem 'acts_as_tree' gem 'acts_as_tree'
gem 'acts_as_configurable', git: 'git://github.com/bwalding/acts_as_configurable.git' gem "rails-settings-cached", "0.2.4"
gem 'resque' gem 'resque'
gem 'whenever', require: false # For defining cronjobs, see config/schedule.rb gem 'whenever', require: false # For defining cronjobs, see config/schedule.rb
@ -50,11 +52,8 @@ group :development do
# Better error output # Better error output
gem 'better_errors' gem 'better_errors'
gem 'binding_of_caller' gem 'binding_of_caller'
# gem "rails-i18n-debug"
# Re-enable rails benchmarker/profiler
gem 'ruby-prof'
gem 'test-unit'
# Get infos when not using proper eager loading # Get infos when not using proper eager loading
gem 'bullet' gem 'bullet'
@ -68,3 +67,23 @@ group :development do
# Avoid having content-length warnings # Avoid having content-length warnings
gem 'thin' gem 'thin'
end end
group :development, :test do
gem 'ruby-prof'
end
group :test do
gem 'rspec-rails'
gem 'factory_girl_rails', '~> 4.0'
gem 'faker'
# version requirements to avoid problem http://stackoverflow.com/questions/18114544
gem 'capybara', '~> 2.1.0'
# webkit and poltergeist don't seem to work yet
gem 'selenium-webdriver', '~> 2.35.1'
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 'i18n-spec'
end

View file

@ -4,13 +4,6 @@ GIT
specs: specs:
localize_input (0.1.0) localize_input (0.1.0)
GIT
remote: git://github.com/bwalding/acts_as_configurable.git
revision: cdf6f6f979019275b523d10684b748f08e2dd8e8
specs:
acts_as_configurable (0.0.1)
rake
GIT GIT
remote: git://github.com/technoweenie/acts_as_versioned.git remote: git://github.com/technoweenie/acts_as_versioned.git
revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b
@ -56,6 +49,8 @@ GEM
coderay (>= 1.0.0) coderay (>= 1.0.0)
erubis (>= 2.7.0) erubis (>= 2.7.0)
binding_of_caller (0.6.8) binding_of_caller (0.6.8)
bootstrap-datepicker-rails (1.1.1.1)
railties (>= 3.0)
builder (3.0.4) builder (3.0.4)
bullet (4.3.0) bullet (4.3.0)
uniform_notifier uniform_notifier
@ -67,6 +62,14 @@ GEM
net-ssh-gateway (>= 1.1.0) net-ssh-gateway (>= 1.1.0)
capistrano-ext (1.2.1) capistrano-ext (1.2.1)
capistrano (>= 1.0.0) capistrano (>= 1.0.0)
capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
chronic (0.9.0) chronic (0.9.0)
client_side_validations (3.1.4) client_side_validations (3.1.4)
coderay (1.0.8) coderay (1.0.8)
@ -79,6 +82,8 @@ GEM
coffee-script-source (1.3.3) coffee-script-source (1.3.3)
commonjs (0.2.6) commonjs (0.2.6)
daemons (1.1.9) daemons (1.1.9)
database_cleaner (0.7.1)
diff-lcs (1.2.4)
erubis (2.7.0) erubis (2.7.0)
eventmachine (1.0.3) eventmachine (1.0.3)
exception_notification (2.6.1) exception_notification (2.6.1)
@ -86,6 +91,14 @@ GEM
execjs (1.4.0) execjs (1.4.0)
multi_json (~> 1.0) multi_json (~> 1.0)
expression_parser (0.9.0) expression_parser (0.9.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
faker (1.1.2)
i18n (~> 0.5)
ffi (1.9.0)
haml (3.1.7) haml (3.1.7)
haml-rails (0.3.5) haml-rails (0.3.5)
actionpack (>= 3.1, < 4.1) actionpack (>= 3.1, < 4.1)
@ -95,11 +108,15 @@ GEM
has_scope (0.5.1) has_scope (0.5.1)
hashery (2.0.1) hashery (2.0.1)
highline (1.6.19) highline (1.6.19)
hike (1.2.1) hike (1.2.3)
i18n (0.6.1) i18n (0.6.1)
i18n-spec (0.4.0)
iso
inherited_resources (1.3.1) inherited_resources (1.3.1)
has_scope (~> 0.5.0) has_scope (~> 0.5.0)
responders (~> 0.6) responders (~> 0.6)
iso (0.2.0)
i18n
journey (1.0.4) journey (1.0.4)
jquery-rails (2.1.3) jquery-rails (2.1.3)
railties (>= 3.1.0, < 5.0) railties (>= 3.1.0, < 5.0)
@ -133,8 +150,9 @@ GEM
activesupport (~> 3.1) activesupport (~> 3.1)
polyamorous (~> 0.5.0) polyamorous (~> 0.5.0)
mime-types (1.21) mime-types (1.21)
mini_portile (0.5.1)
mono_logger (1.1.0) mono_logger (1.1.0)
multi_json (1.7.3) multi_json (1.7.9)
mysql2 (0.3.11) mysql2 (0.3.11)
net-scp (1.1.1) net-scp (1.1.1)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
@ -143,6 +161,8 @@ GEM
net-ssh (2.6.7) net-ssh (2.6.7)
net-ssh-gateway (1.2.0) net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
pdf-reader (1.2.0) pdf-reader (1.2.0)
Ascii85 (~> 1.0.0) Ascii85 (~> 1.0.0)
hashery (~> 2.0) hashery (~> 2.0)
@ -172,6 +192,8 @@ GEM
activesupport (= 3.2.13) activesupport (= 3.2.13)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.13) railties (= 3.2.13)
rails-settings-cached (0.2.4)
rails (>= 3.0.0)
railties (3.2.13) railties (3.2.13)
actionpack (= 3.2.13) actionpack (= 3.2.13)
activesupport (= 3.2.13) activesupport (= 3.2.13)
@ -183,7 +205,7 @@ GEM
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
redis (3.0.4) redis (3.0.4)
redis-namespace (1.3.0) redis-namespace (1.3.1)
redis (~> 3.0.0) redis (~> 3.0.0)
responders (0.9.3) responders (0.9.3)
railties (~> 3.1) railties (~> 3.1)
@ -193,20 +215,44 @@ GEM
redis-namespace (~> 1.2) redis-namespace (~> 1.2)
sinatra (>= 0.9.2) sinatra (>= 0.9.2)
vegas (~> 0.1.2) vegas (~> 0.1.2)
ruby-prof (0.11.2) rspec-core (2.14.2)
rspec-expectations (2.14.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.1)
rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
ruby-prof (0.13.0)
ruby-rc4 (0.1.5) ruby-rc4 (0.1.5)
rubyzip (0.9.9)
sass (3.2.1) sass (3.2.1)
sass-rails (3.2.5) sass-rails (3.2.5)
railties (~> 3.2.0) railties (~> 3.2.0)
sass (>= 3.1.10) sass (>= 3.1.10)
tilt (~> 1.3) tilt (~> 1.3)
select2-rails (3.4.2)
sass-rails
thor (~> 0.14)
selenium-webdriver (2.35.1)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip (< 1.0.0)
websocket (~> 1.0.4)
simple-navigation (3.9.0) simple-navigation (3.9.0)
activesupport (>= 2.3.2) activesupport (>= 2.3.2)
simple-navigation-bootstrap (0.0.4) simple-navigation-bootstrap (0.0.4)
simple-navigation (>= 3.7.0) simple-navigation (>= 3.7.0)
simple_form (2.0.3) simple_form (2.1.0)
actionpack (~> 3.0) actionpack (~> 3.0)
activemodel (~> 3.0) activemodel (~> 3.0)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
sinatra (1.3.6) sinatra (1.3.6)
rack (~> 1.4) rack (~> 1.4)
rack-protection (~> 1.3) rack-protection (~> 1.3)
@ -220,7 +266,6 @@ GEM
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6) sqlite3 (1.3.6)
test-unit (2.5.3)
therubyracer (0.10.2) therubyracer (0.10.2)
libv8 (~> 3.3.10) libv8 (~> 3.3.10)
thin (1.5.1) thin (1.5.1)
@ -245,30 +290,38 @@ GEM
uniform_notifier (1.1.1) uniform_notifier (1.1.1)
vegas (0.1.11) vegas (0.1.11)
rack (>= 1.0.0) rack (>= 1.0.0)
websocket (1.0.7)
whenever (0.8.1) whenever (0.8.1)
activesupport (>= 2.3.4) activesupport (>= 2.3.4)
chronic (>= 0.6.3) chronic (>= 0.6.3)
wikicloth (0.8.0) wikicloth (0.8.0)
builder builder
expression_parser expression_parser
xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
acts_as_configurable!
acts_as_tree acts_as_tree
acts_as_versioned! acts_as_versioned!
better_errors better_errors
binding_of_caller binding_of_caller
bootstrap-datepicker-rails
bullet bullet
capistrano (= 2.13.5) capistrano (= 2.13.5)
capistrano-ext capistrano-ext
capybara (~> 2.1.0)
client_side_validations client_side_validations
coffee-rails (~> 3.2.1) coffee-rails (~> 3.2.1)
daemons daemons
database_cleaner
exception_notification exception_notification
factory_girl_rails (~> 4.0)
faker
haml-rails haml-rails
i18n-spec
inherited_resources inherited_resources
jquery-rails jquery-rails
kaminari kaminari
@ -279,14 +332,20 @@ DEPENDENCIES
prawn prawn
quiet_assets quiet_assets
rails (~> 3.2.9) rails (~> 3.2.9)
rails-settings-cached (= 0.2.4)
resque resque
rspec-core
rspec-expectations
rspec-rails
ruby-prof ruby-prof
sass-rails (~> 3.2.3) sass-rails (~> 3.2.3)
select2-rails
selenium-webdriver (~> 2.35.1)
simple-navigation simple-navigation
simple-navigation-bootstrap simple-navigation-bootstrap
simple_form simple_form
simplecov
sqlite3 sqlite3
test-unit
therubyracer therubyracer
thin thin
twitter-bootstrap-rails twitter-bootstrap-rails

View file

@ -1,10 +1,6 @@
Important
--------
We changed the branch structure. The rails3 branch is now master. But you can safely send pull requests to rails3. It'll remain there for a couple of weeks.
FoodSoft FoodSoft
========= =========
[![Build Status](https://travis-ci.org/foodcoops/foodsoft.png?branch=tests-rspec)](https://travis-ci.org/foodcoops/foodsoft)
[![Code Climate](https://codeclimate.com/github/foodcoops/foodsoft.png)](https://codeclimate.com/github/foodcoops/foodsoft) [![Code Climate](https://codeclimate.com/github/foodcoops/foodsoft.png)](https://codeclimate.com/github/foodcoops/foodsoft)
[![Dependency Status](https://gemnasium.com/foodcoops/foodsoft.png)](https://gemnasium.com/foodcoops/foodsoft) [![Dependency Status](https://gemnasium.com/foodcoops/foodsoft.png)](https://gemnasium.com/foodcoops/foodsoft)

View file

@ -1,14 +1,17 @@
//= require jquery //= require jquery
//= require jquery-ui //= require jquery-ui
//= require jquery_ujs //= require jquery_ujs
//= require select2
//= require twitter/bootstrap //= require twitter/bootstrap
//= require jquery.tokeninput //= require jquery.tokeninput
//= require bootstrap-datepicker //= require bootstrap-datepicker/core
//= require bootstrap-datepicker.de //= require bootstrap-datepicker/locales/bootstrap-datepicker.de
//= require bootstrap-datepicker/locales/bootstrap-datepicker.nl
//= require jquery.observe_field //= require jquery.observe_field
//= require rails.validations //= require rails.validations
//= require_self //= require_self
//= require ordering //= require ordering
//= require stupidtable
// allow touch devices to work on click events // allow touch devices to work on click events
// http://stackoverflow.com/a/16221066 // http://stackoverflow.com/a/16221066
@ -112,9 +115,16 @@ $(function() {
}); });
// Use bootstrap datepicker for dateinput // Use bootstrap datepicker for dateinput
$('.datepicker').datepicker({format: 'yyyy-mm-dd', weekStart: 1, language: 'de'}); $('.datepicker').datepicker({format: 'yyyy-mm-dd', language: I18n.locale});
// See stupidtable.js for initialization of local table sorting
}); });
// retrigger last local table sorting
function updateSort(table) {
$('.sorting-asc, .sorting-desc', table).toggleClass('.sorting-asc .sorting-desc')
.removeData('sort-dir').trigger('click'); // CAUTION: removing data field of plugin
}
// gives the row an yellow background // gives the row an yellow background
function highlightRow(checkbox) { function highlightRow(checkbox) {

View file

@ -10,6 +10,7 @@ var groupBalance = 0; // available group money
var currencySeparator = "."; // default decimal separator var currencySeparator = "."; // default decimal separator
var currencyPrecision = 2; // default digits behind comma var currencyPrecision = 2; // default digits behind comma
var currencyUnit = "€"; // default currency var currencyUnit = "€"; // default currency
var minimumBalance = 0; // minimum group balance for the order to be succesful
var toleranceIsCostly = true; // default tolerance behaviour var toleranceIsCostly = true; // default tolerance behaviour
var isStockit = false; // Wheter the order is from stock oder normal supplier var isStockit = false; // Wheter the order is from stock oder normal supplier
@ -40,6 +41,10 @@ function setGroupBalance(amount) {
groupBalance = amount; groupBalance = amount;
} }
function setMinimumBalance(amount) {
minimumBalance = amount;
}
function addData(orderArticleId, itemPrice, itemUnit, itemSubtotal, itemQuantityOthers, itemToleranceOthers, allocated, available) { function addData(orderArticleId, itemPrice, itemUnit, itemSubtotal, itemQuantityOthers, itemToleranceOthers, allocated, available) {
var i = orderArticleId; var i = orderArticleId;
price[i] = itemPrice; price[i] = itemPrice;
@ -159,7 +164,7 @@ function updateBalance() {
$('#total_balance').val(asMoney(balance)); $('#total_balance').val(asMoney(balance));
// determine bgcolor and submit button state according to balance // determine bgcolor and submit button state according to balance
var bgcolor = ''; var bgcolor = '';
if (balance < 0) { if (balance < minimumBalance) {
bgcolor = '#FF0000'; bgcolor = '#FF0000';
$('#submit_button').attr('disabled', 'disabled') $('#submit_button').attr('disabled', 'disabled')
} else { } else {

View file

@ -0,0 +1,186 @@
// Stupid jQuery table plugin.
// Call on a table
// sortFns: Sort functions for your datatypes.
(function($) {
$.fn.stupidtable = function(sortFns) {
return this.each(function() {
var $table = $(this);
sortFns = sortFns || {};
// ==================================================== //
// Utility functions //
// ==================================================== //
// Merge sort functions with some default sort functions.
sortFns = $.extend({}, {
"int": function(a, b) {
return parseInt(a, 10) - parseInt(b, 10);
},
"float": function(a, b) {
return parseFloat(a) - parseFloat(b);
},
"string": function(a, b) {
if (a < b) return -1;
if (a > b) return +1;
return 0;
},
"string-ins": function(a, b) {
a = a.toLowerCase();
b = b.toLowerCase();
if (a < b) return -1;
if (a > b) return +1;
return 0;
}
}, sortFns);
// Return the resulting indexes of a sort so we can apply
// this result elsewhere. This returns an array of index numbers.
// return[0] = x means "arr's 0th element is now at x"
var sort_map = function(arr, sort_function, reverse_column) {
var map = [];
var index = 0;
if (reverse_column) {
for (var i = arr.length-1; i >= 0; i--) {
map.push(i);
}
}
else {
var sorted = arr.slice(0).sort(sort_function);
for (var i=0; i<arr.length; i++) {
index = $.inArray(arr[i], sorted);
// If this index is already in the map, look for the next index.
// This handles the case of duplicate entries.
while ($.inArray(index, map) != -1) {
index++;
}
map.push(index);
}
}
return map;
};
// Apply a sort map to the array.
var apply_sort_map = function(arr, map) {
var clone = arr.slice(0),
newIndex = 0;
for (var i=0; i<map.length; i++) {
newIndex = map[i];
clone[newIndex] = arr[i];
}
return clone;
};
// ==================================================== //
// Begin execution! //
// ==================================================== //
// Do sorting when THs are clicked
$table.on("click", "th", function() {
var trs = $table.children("tbody").children("tr");
var $this = $(this);
var th_index = 0;
var dir = $.fn.stupidtable.dir;
$table.find("th").slice(0, $this.index()).each(function() {
var cols = $(this).attr("colspan") || 1;
th_index += parseInt(cols,10);
});
// Determine (and/or reverse) sorting direction, default `asc`
var sort_dir = $this.data("sort-dir") === dir.ASC ? dir.DESC : dir.ASC;
// Choose appropriate sorting function. If we're sorting descending, check
// for a `data-sort-desc` attribute.
if ( sort_dir == dir.DESC )
var type = $this.data("sort-desc") || $this.data("sort") || null;
else
var type = $this.data("sort") || null;
// Prevent sorting if no type defined
if (type === null) {
return;
}
// Trigger `beforetablesort` event that calling scripts can hook into;
// pass parameters for sorted column index and sorting direction
$table.trigger("beforetablesort", {column: th_index, direction: sort_dir});
// More reliable method of forcing a redraw
$table.css("display");
// Run sorting asynchronously on a timout to force browser redraw after
// `beforetablesort` callback. Also avoids locking up the browser too much.
setTimeout(function() {
// Gather the elements for this column
var column = [];
var sortMethod = sortFns[type];
// Push either the value of the `data-order-by` attribute if specified
// or just the text() value in this column to column[] for comparison.
trs.each(function(index,tr) {
var $e = $(tr).children().eq(th_index);
var sort_val = $e.data("sort-value");
var order_by = typeof(sort_val) !== "undefined" ? sort_val : $e.text();
column.push(order_by);
});
// Create the sort map. This column having a sort-dir implies it was
// the last column sorted. As long as no data-sort-desc is specified,
// we're free to just reverse the column.
var reverse_column = !!$this.data("sort-dir") && !$this.data("sort-desc");
var theMap = sort_map(column, sortMethod, reverse_column);
// Reset siblings
$table.find("th").data("sort-dir", null).removeClass("sorting-desc sorting-asc");
$this.data("sort-dir", sort_dir).addClass("sorting-"+sort_dir);
// Replace the content of tbody with the sortedTRs. Strangely (and
// conveniently!) enough, .append accomplishes this for us.
var sortedTRs = $(apply_sort_map(trs, theMap));
$table.children("tbody").append(sortedTRs);
// Trigger `aftertablesort` event. Similar to `beforetablesort`
$table.trigger("aftertablesort", {column: th_index, direction: sort_dir});
// More reliable method of forcing a redraw
$table.css("display");
}, 10);
});
});
};
// Enum containing sorting directions
$.fn.stupidtable.dir = {ASC: "asc", DESC: "desc"};
})(jQuery);
////////////////////////////////////////////////////////////////////////////////
//
// own additions for automatic initialization of table sorting
//
////////////////////////////////////////////////////////////////////////////////
$(function() {
var stupidtables = $('table.stupidtable');
if(stupidtables.length) {
// Add pseudo links just for matching foodsoft style
$('th[data-sort]', stupidtables).wrapInner('<a href="#" class="stupidlink"></a>');
$('.stupidlink', stupidtables).on('click', function(e) {e.preventDefault();});
// Init stupidtable sorting
stupidtables.stupidtable();
// Update class of sort link after sort to match foodsoft style
stupidtables.on('aftertablesort', function(e, data) {
// Ignore data and use the updated classes in DOM
var stupidthead = $('thead', this);
$('a.stupidlink', stupidthead).removeClass('sortup sortdown');
$('th.sorting-asc a.stupidlink', stupidthead).addClass('sortup');
$('th.sorting-desc a.stupidlink', stupidthead).addClass('sortdown');
});
// Sort tables with a default sort
$('.default-sort', stupidtables).trigger('click');
}
});

View file

@ -1,4 +1,6 @@
/* /*
*= require bootstrap_and_overrides *= require bootstrap_and_overrides
*= require select2
*= require token-input-bootstrappy *= require token-input-bootstrappy
*= require bootstrap-datepicker
*/ */

View file

@ -31,10 +31,6 @@ body {
// Example: // Example:
// @linkColor: #ff0000; // @linkColor: #ff0000;
// Bootstrap datepicker
@import "datepicker";
// Custom styles // Custom styles
// Fix empty dd tags in horizontal dl, see https://github.com/twitter/bootstrap/issues/4062 // Fix empty dd tags in horizontal dl, see https://github.com/twitter/bootstrap/issues/4062
@ -42,6 +38,22 @@ body {
dd { .clearfix(); } dd { .clearfix(); }
} }
// Do not use additional margin for input in table
.form-horizontal .control-group.control-group-intable,
.form-horizontal .controls.controls-intable {
margin: 0;
}
// Light tooltips without empty space below tables
.tooltip-inner {
color: #000;
background-color: rgb(245,245,245);
border: 1px solid #ccc;
}
.tooltip-inner .table {
margin-bottom: 0;
}
@mainRedColor: #ED0606; @mainRedColor: #ED0606;
.logo { .logo {
@ -208,3 +220,21 @@ tr.unavailable {
dt { width: 160px; } dt { width: 160px; }
dd { margin-left: 170px; } dd { margin-left: 170px; }
} }
.settings {
.settings-group {
margin-bottom: 10px;
.control-label {
margin: 5px 0 0 0;
}
}
.control-group {
margin-bottom: 5px;
}
.control-group.h_wrapper {
margin-bottom: 5px;
}
.control-group.select {
margin-bottom: 15px
}
}

View file

@ -1,10 +1,13 @@
# encoding: utf-8 # encoding: utf-8
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
include Foodsoft::ControllerExtensions::Locale
helper_method :available_locales
protect_from_forgery protect_from_forgery
before_filter :select_language, :select_foodcoop, :authenticate, :store_controller, :items_per_page, :set_redirect_to before_filter :select_foodcoop, :authenticate, :store_controller, :items_per_page, :set_redirect_to
after_filter :remove_controller after_filter :remove_controller
# Returns the controller handling the current request. # Returns the controller handling the current request.
def self.current def self.current
Thread.current[:application_controller] Thread.current[:application_controller]
@ -26,7 +29,7 @@ class ApplicationController < ActionController::Base
redirect_to login_url, :alert => 'Access denied!' redirect_to login_url, :alert => 'Access denied!'
end end
private private
def authenticate(role = 'any') def authenticate(role = 'any')
# Attempt to retrieve authenticated user from controller instance or session... # Attempt to retrieve authenticated user from controller instance or session...
@ -141,9 +144,5 @@ class ApplicationController < ActionController::Base
def default_url_options(options = {}) def default_url_options(options = {})
{foodcoop: FoodsoftConfig.scope} {foodcoop: FoodsoftConfig.scope}
end end
# Used to prevent accidently switching to :en in production mode.
def select_language
I18n.locale = :de
end
end end

View file

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

View file

@ -5,43 +5,25 @@ class DeliveriesController < ApplicationController
def index def index
@deliveries = @supplier.deliveries.all :order => 'delivered_on DESC' @deliveries = @supplier.deliveries.all :order => 'delivered_on DESC'
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @deliveries }
end
end end
def show def show
@delivery = Delivery.find(params[:id]) @delivery = Delivery.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @delivery }
end
end end
def new def new
@delivery = @supplier.deliveries.build @delivery = @supplier.deliveries.build
@delivery.delivered_on = Date.today #TODO: move to model/database
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @delivery }
end
end end
def create def create
@delivery = Delivery.new(params[:delivery]) @delivery = Delivery.new(params[:delivery])
respond_to do |format| if @delivery.save
if @delivery.save flash[:notice] = I18n.t('deliveries.create.notice')
flash[:notice] = I18n.t('deliveries.create.notice') redirect_to [@supplier, @delivery]
format.html { redirect_to([@supplier,@delivery]) } else
format.xml { render :xml => @delivery, :status => :created, :location => @delivery } render :action => "new"
else
format.html { render :action => "new" }
format.xml { render :xml => @delivery.errors, :status => :unprocessable_entity }
end
end end
end end
@ -52,15 +34,11 @@ class DeliveriesController < ApplicationController
def update def update
@delivery = Delivery.find(params[:id]) @delivery = Delivery.find(params[:id])
respond_to do |format| if @delivery.update_attributes(params[:delivery])
if @delivery.update_attributes(params[:delivery]) flash[:notice] = I18n.t('deliveries.update.notice')
flash[:notice] = I18n.t('deliveries.update.notice') redirect_to [@supplier,@delivery]
format.html { redirect_to([@supplier,@delivery]) } else
format.xml { head :ok } render :action => "edit"
else
format.html { render :action => "edit" }
format.xml { render :xml => @delivery.errors, :status => :unprocessable_entity }
end
end end
end end
@ -69,40 +47,60 @@ class DeliveriesController < ApplicationController
@delivery.destroy @delivery.destroy
flash[:notice] = I18n.t('deliveries.destroy.notice') flash[:notice] = I18n.t('deliveries.destroy.notice')
respond_to do |format| redirect_to supplier_deliveries_url(@supplier)
format.html { redirect_to(supplier_deliveries_url(@supplier)) } end
format.xml { head :ok }
# 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
end end
def add_stock_article def edit_stock_article
article = @supplier.stock_articles.build(params[:stock_article]) @stock_article = StockArticle.find(params[:stock_article_id])
render :update do |page| render :layout => false
if article.save end
logger.debug "new StockArticle: #{article.id}"
page.insert_html :bottom, 'stock_changes', :partial => 'stock_change',
:locals => {:stock_change => article.stock_changes.build, :supplier => @supplier}
page.replace_html 'new_stock_article', :partial => 'stock_article_form', def update_stock_article
:locals => {:stock_article => @supplier.stock_articles.build} @stock_article = StockArticle.find(params[:stock_article][:id])
else
page.replace_html 'new_stock_article', :partial => 'stock_article_form', if @stock_article.update_attributes(params[:stock_article])
:locals => {:stock_article => article} render :layout => false
end else
render :action => 'edit_stock_article', :layout => false
end end
end end
def add_stock_change def add_stock_change
@stock_change = StockChange.new
@stock_change.stock_article = StockArticle.find(params[:stock_article_id])
render :layout => false render :layout => false
end end
def fill_new_stock_article_form
article = Article.find(params[:article_id])
@supplier = article.supplier
stock_article = @supplier.stock_articles.build(
article.attributes.reject { |attr| attr == ('id' || 'type')}
)
render :partial => 'stock_article_form', :locals => {:stock_article => stock_article}
end
end end

View file

@ -65,7 +65,13 @@ class Finance::GroupOrderArticlesController < ApplicationController
def destroy def destroy
group_order_article = GroupOrderArticle.find(params[:id]) group_order_article = GroupOrderArticle.find(params[:id])
group_order_article.destroy # only destroy if quantity and tolerance was zero already, so that we don't
# lose what the user ordered, if any
if group_order_article.quantity > 0 or group_order_article.tolerance >0
group_order_article.update_attribute(:result, 0)
else
group_order_article.destroy
end
update_summaries(group_order_article) update_summaries(group_order_article)
@order_article = group_order_article.order_article @order_article = group_order_article.order_article

View file

@ -42,6 +42,14 @@ class Finance::OrderArticlesController < ApplicationController
def destroy def destroy
@order_article = OrderArticle.find(params[:id]) @order_article = OrderArticle.find(params[:id])
@order_article.destroy # only destroy if there are no associated GroupOrders; if we would, the requested
# quantity and tolerance would be gone. Instead of destroying, we set all result
# quantities to zero.
if @order_article.group_order_articles.count == 0
@order_article.destroy
else
@order_article.group_order_articles.each { |goa| goa.update_attribute(:result, 0) }
@order_article.update_results!
end
end end
end end

View file

@ -16,6 +16,7 @@ class HomeController < ApplicationController
def update_profile def update_profile
if @current_user.update_attributes(params[:user]) if @current_user.update_attributes(params[:user])
session[:locale] = @current_user.locale
redirect_to my_profile_url, notice: I18n.t('home.changes_saved') redirect_to my_profile_url, notice: I18n.t('home.changes_saved')
else else
render :profile render :profile

View file

@ -58,6 +58,7 @@ class LoginController < ApplicationController
if @user.save if @user.save
Membership.new(:user => @user, :group => @invite.group).save! Membership.new(:user => @user, :group => @invite.group).save!
@invite.destroy @invite.destroy
session[:locale] = @user.locale
redirect_to login_url, notice: I18n.t('login.controller.accept_invitation.notice') redirect_to login_url, notice: I18n.t('login.controller.accept_invitation.notice')
end end
end end

View file

@ -11,6 +11,8 @@ class SessionsController < ApplicationController
if user if user
session[:user_id] = user.id session[:user_id] = user.id
session[:scope] = FoodsoftConfig.scope # Save scope in session to not allow switching between foodcoops with one account session[:scope] = FoodsoftConfig.scope # Save scope in session to not allow switching between foodcoops with one account
session[:locale] = user.locale
if session[:return_to].present? if session[:return_to].present?
redirect_to_url = session[:return_to] redirect_to_url = session[:return_to]
session[:return_to] = nil session[:return_to] = nil

View file

@ -55,4 +55,9 @@ class StockitController < ApplicationController
render :partial => 'form', :locals => {:stock_article => stock_article} render :partial => 'form', :locals => {:stock_article => stock_article}
end end
def history
@stock_article = StockArticle.undeleted.find(params[:stock_article_id])
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC').each {|s| s.readonly!}
end
end end

View file

@ -18,7 +18,7 @@ class SuppliersController < ApplicationController
def new def new
if params[:shared_supplier_id] if params[:shared_supplier_id]
shared_supplier = SharedSupplier.find(params[:shared_supplier_id]) shared_supplier = SharedSupplier.find(params[:shared_supplier_id])
@supplier = shared_supplier.build_supplier(shared_supplier.autofill_attributes) @supplier = shared_supplier.suppliers.new(shared_supplier.autofill_attributes)
else else
@supplier = Supplier.new @supplier = Supplier.new
end end

View file

@ -18,6 +18,9 @@ class TasksController < ApplicationController
def create def create
@task = Task.new(params[:task]) @task = Task.new(params[:task])
if params[:periodic]
@task.periodic_task_group = PeriodicTaskGroup.new
end
if @task.save if @task.save
redirect_to tasks_url, :notice => I18n.t('tasks.create.notice') redirect_to tasks_url, :notice => I18n.t('tasks.create.notice')
else else
@ -32,13 +35,20 @@ class TasksController < ApplicationController
def edit def edit
@task = Task.find(params[:id]) @task = Task.find(params[:id])
@task.current_user_id = current_user.id @task.current_user_id = current_user.id
if @task.periodic?
flash.now[:alert] = I18n.t('tasks.edit.warning_periodic').html_safe
end
end end
def update def update
@task = Task.find(params[:id]) @task = Task.find(params[:id])
was_periodic = @task.periodic?
@task.attributes=(params[:task]) @task.attributes=(params[:task])
if @task.errors.empty? && @task.save if @task.errors.empty? && @task.save
flash[:notice] = I18n.t('tasks.update.notice') flash[:notice] = I18n.t('tasks.update.notice')
if was_periodic and not @task.periodic?
flash[:notice] = I18n.t('tasks.update.notice_converted')
end
if @task.workgroup if @task.workgroup
redirect_to workgroup_tasks_url(workgroup_id: @task.workgroup_id) redirect_to workgroup_tasks_url(workgroup_id: @task.workgroup_id)
else else
@ -53,7 +63,12 @@ class TasksController < ApplicationController
task = Task.find(params[:id]) task = Task.find(params[:id])
# Save user_ids to update apple statistics after destroy # Save user_ids to update apple statistics after destroy
user_ids = task.user_ids user_ids = task.user_ids
task.destroy if params[:periodic]
task.periodic_task_group.exclude_tasks_before(task)
task.periodic_task_group.destroy
else
task.destroy
end
task.update_ordergroup_stats(user_ids) task.update_ordergroup_stats(user_ids)
redirect_to tasks_url, :notice => I18n.t('tasks.destroy.notice') redirect_to tasks_url, :notice => I18n.t('tasks.destroy.notice')

View file

@ -12,20 +12,29 @@ class OrderByArticles < OrderPdf
def body def body
@order.order_articles.ordered.each do |order_article| @order.order_articles.ordered.each do |order_article|
text "#{order_article.article.name} (#{order_article.article.unit} | #{order_article.price.unit_quantity.to_s} | #{number_with_precision(order_article.price.fc_price, precision: 2)})",
style: :bold, size: 10
rows = [] rows = []
rows << I18n.t('documents.order_by_articles.rows') dimrows = []
for goa in order_article.group_order_articles for goa in order_article.group_order_articles.ordered
rows << [goa.group_order.ordergroup.name, rows << [goa.group_order.ordergroup.name,
"#{goa.quantity} + #{goa.tolerance}",
goa.result, goa.result,
number_with_precision(order_article.price.fc_price * goa.result, precision: 2)] number_with_precision(order_article.price.fc_price * goa.result, precision: 2)]
dimrows << rows.length if goa.result == 0
end end
next if rows.length == 0
rows.unshift I18n.t('documents.order_by_articles.rows') # table header
table rows, column_widths: [200,40,40], cell_style: {size: 8, overflow: :shrink_to_fit} do |table| text "#{order_article.article.name} (#{order_article.article.unit} | #{order_article.price.unit_quantity.to_s} | #{number_with_precision(order_article.price.fc_price, precision: 2)})",
table.columns(1..2).align = :right style: :bold, size: 10
table rows, cell_style: {size: 8, overflow: :shrink_to_fit} do |table|
table.column(0).width = 200
table.columns(1..3).align = :right
table.column(2).font_style = :bold
table.cells.border_width = 1 table.cells.border_width = 1
table.cells.border_color = '666666' table.cells.border_color = '666666'
table.rows(0).border_bottom_width = 2
# dim rows which were ordered but not received
dimrows.each { |ri| table.row(ri).text_color = '999999' }
end end
move_down 10 move_down 10
end end

View file

@ -12,12 +12,10 @@ class OrderByGroups < OrderPdf
def body def body
# Start rendering # Start rendering
@order.group_orders.each do |group_order| @order.group_orders.ordered.each do |group_order|
text group_order.ordergroup.name, size: 9, style: :bold
total = 0 total = 0
rows = [] rows = []
rows << I18n.t('documents.order_by_groups.rows') # Table Header dimrows = []
group_order_articles = group_order.group_order_articles.ordered group_order_articles = group_order.group_order_articles.ordered
group_order_articles.each do |goa| group_order_articles.each do |goa|
@ -25,15 +23,20 @@ class OrderByGroups < OrderPdf
sub_total = price * goa.result sub_total = price * goa.result
total += sub_total total += sub_total
rows << [goa.order_article.article.name, rows << [goa.order_article.article.name,
"#{goa.quantity} + #{goa.tolerance}",
goa.result, goa.result,
number_with_precision(price, precision: 2), number_with_precision(price, precision: 2),
goa.order_article.price.unit_quantity, goa.order_article.price.unit_quantity,
goa.order_article.article.unit, goa.order_article.article.unit,
number_with_precision(sub_total, precision: 2)] number_with_precision(sub_total, precision: 2)]
dimrows << rows.length if goa.result == 0
end end
rows << [ I18n.t('documents.order_by_groups.sum'), nil, nil, nil, nil, number_with_precision(total, precision: 2)] next if rows.length == 0
rows << [ I18n.t('documents.order_by_groups.sum'), nil, nil, nil, nil, nil, number_with_precision(total, precision: 2)]
rows.unshift I18n.t('documents.order_by_groups.rows') # Table Header
table rows, column_widths: [250,50,50,50,50,50], cell_style: {size: 8, overflow: :shrink_to_fit} do |table| text group_order.ordergroup.name, size: 9, style: :bold
table rows, width: 500, cell_style: {size: 8, overflow: :shrink_to_fit} do |table|
# borders # borders
table.cells.borders = [] table.cells.borders = []
table.row(0).borders = [:bottom] table.row(0).borders = [:bottom]
@ -41,8 +44,14 @@ class OrderByGroups < OrderPdf
table.cells.border_width = 1 table.cells.border_width = 1
table.cells.border_color = '666666' table.cells.border_color = '666666'
table.columns(1..3).align = :right table.column(0).width = 240
table.columns(5).align = :right table.column(2).font_style = :bold
table.columns(1..4).align = :right
table.column(6).align = :right
table.column(6).font_style = :bold
# dim rows which were ordered but not received
dimrows.each { |ri| table.row(ri).text_color = '999999' }
end end
move_down 15 move_down 15

View file

@ -20,11 +20,17 @@ class OrderFax < OrderPdf
move_down 5 move_down 5
text "#{contact[:zip_code]} #{contact[:city]}", size: 9, align: :right text "#{contact[:zip_code]} #{contact[:city]}", size: 9, align: :right
move_down 5 move_down 5
text "#{I18n.t('simple_form.labels.supplier.customer_number')}: #{@order.supplier.try(:customer_number)}", size: 9, align: :right unless @order.supplier.try(:customer_number).blank?
move_down 5 text "#{I18n.t('simple_form.labels.supplier.customer_number')}: #{@order.supplier[:customer_number]}", size: 9, align: :right
text "#{I18n.t('simple_form.labels.supplier.phone')}: #{contact[:phone]}", size: 9, align: :right move_down 5
move_down 5 end
text "#{I18n.t('simple_form.labels.supplier.email')}: #{contact[:email]}", size: 9, align: :right unless contact[:phone].blank?
text "#{I18n.t('simple_form.labels.supplier.phone')}: #{contact[:phone]}", size: 9, align: :right
move_down 5
end
unless contact[:email].blank?
text "#{I18n.t('simple_form.labels.supplier.email')}: #{contact[:email]}", size: 9, align: :right
end
end end
# Recipient # Recipient
@ -32,8 +38,10 @@ class OrderFax < OrderPdf
text @order.name text @order.name
move_down 5 move_down 5
text @order.supplier.try(:address).to_s text @order.supplier.try(:address).to_s
move_down 5 unless @order.supplier.try(:fax).blank?
text "#{I18n.t('simple_form.labels.supplier.fax')}: #{@order.supplier.try(:fax)}" move_down 5
text "#{I18n.t('simple_form.labels.supplier.fax')}: #{@order.supplier[:fax]}"
end
end end
move_down 5 move_down 5
@ -42,25 +50,37 @@ class OrderFax < OrderPdf
move_down 10 move_down 10
text "#{I18n.t('simple_form.labels.delivery.delivered_on')}:" text "#{I18n.t('simple_form.labels.delivery.delivered_on')}:"
move_down 10 move_down 10
text "#{I18n.t('simple_form.labels.supplier.contact_person')}: #{@order.supplier.try(:contact_person)}" unless @order.supplier.try(:contact_person).blank?
move_down 10 text "#{I18n.t('simple_form.labels.supplier.contact_person')}: #{@order.supplier[:contact_person]}"
move_down 10
end
# Articles # Articles
total = 0
data = [I18n.t('documents.order_fax.rows')] data = [I18n.t('documents.order_fax.rows')]
data += @order.order_articles.ordered.all(include: :article).collect do |a| data += @order.order_articles.ordered.all(include: :article).collect do |a|
subtotal = a.units_to_order * a.price.unit_quantity * a.price.price
total += subtotal
[a.article.order_number, [a.article.order_number,
a.units_to_order, a.units_to_order,
a.article.name, a.article.name,
a.price.unit_quantity, a.price.unit_quantity,
a.article.unit, a.article.unit,
a.price.price] number_to_currency(a.price.price),
number_to_currency(subtotal)]
end end
data << [I18n.t('documents.order_fax.total'), nil, nil, nil, nil, nil, number_to_currency(total)]
table data, cell_style: {size: 8, overflow: :shrink_to_fit} do |table| table data, cell_style: {size: 8, overflow: :shrink_to_fit} do |table|
table.header = true
table.cells.border_width = 1 table.cells.border_width = 1
table.cells.border_color = '666666' table.cells.border_color = '666666'
table.row(0).border_bottom_width = 2
table.columns(1).align = :right table.columns(1).align = :right
table.columns(3..5).align = :right table.columns(3..6).align = :right
table.row(data.length-1).columns(0..5).borders = [:top, :bottom]
table.row(data.length-1).columns(0).borders = [:top, :bottom, :left]
table.row(data.length-1).border_top_width = 2
end end
#font_size: 8, #font_size: 8,
#vertical_padding: 3, #vertical_padding: 3,

View file

@ -158,5 +158,13 @@ module ApplicationHelper
end end
flash_messages.join("\n").html_safe flash_messages.join("\n").html_safe
end end
# render base errors in a form after failed validation
# http://railsapps.github.io/twitter-bootstrap-rails.html
def base_errors resource
return '' if (resource.errors.empty?) or (resource.errors[:base].empty?)
messages = resource.errors[:base].map { |msg| content_tag(:li, msg) }.join
render :partial => 'shared/base_errors', :locals => {:error_messages => messages}
end
end end

View file

@ -1,5 +1,5 @@
module DeliveriesHelper module DeliveriesHelper
def link_to_invoice(delivery) def link_to_invoice(delivery)
if delivery.invoice if delivery.invoice
link_to number_to_currency(delivery.invoice.amount), [:finance, delivery.invoice], link_to number_to_currency(delivery.invoice.amount), [:finance, delivery.invoice],
@ -9,9 +9,29 @@ module DeliveriesHelper
class: 'btn btn-mini' class: 'btn btn-mini'
end end
end end
def stock_articles_for_select(supplier) def articles_for_select2(supplier)
supplier.stock_articles.undeleted.reorder('articles.name ASC').map {|a| ["#{a.name} (#{number_to_currency a.price}/#{a.unit})", a.id] } supplier.articles.undeleted.reorder('articles.name ASC').map {|a| {:id => a.id, :text => "#{a.name} (#{number_to_currency a.price}/#{a.unit})"} }
end end
def stock_articles_for_table(supplier)
supplier.stock_articles.undeleted.reorder('articles.name ASC')
end
def stock_change_remove_link(stock_change_form)
return link_to t('.remove_article'), "#", :class => 'remove_new_stock_change btn btn-small' if stock_change_form.object.new_record?
output = stock_change_form.hidden_field :_destroy
output += link_to t('.remove_article'), "#", :class => 'destroy_stock_change btn btn-small'
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 end

View file

@ -4,7 +4,7 @@ module Finance::OrderArticlesHelper
if @order.stockit? if @order.stockit?
StockArticle.order('articles.name') StockArticle.order('articles.name')
else else
@order.supplier.articles.order('articles.name') @order.supplier.articles.undeleted.order('articles.name')
end end
end end
end end

View file

@ -4,4 +4,14 @@ module StockitHelper
class_names << "unavailable" if article.quantity_available <= 0 class_names << "unavailable" if article.quantity_available <= 0
class_names.join(" ") class_names.join(" ")
end end
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)
elsif stock_change.order_id
link_to t('.order'), order_path(stock_change.order)
elsif stock_change.stock_taking_id
link_to t('.stock_taking'), stock_taking_path(stock_change.stock_taking)
end
end
end end

View file

@ -0,0 +1,6 @@
module SuppliersHelper
def associated_supplier_names(shared_supplier)
"(#{shared_supplier.suppliers.map(&:name).join(', ')})"
end
end

View file

@ -2,11 +2,15 @@ class Delivery < ActiveRecord::Base
belongs_to :supplier belongs_to :supplier
has_one :invoice has_one :invoice
has_many :stock_changes, :dependent => :destroy has_many :stock_changes,
:dependent => :destroy,
:include => 'stock_article',
:order => 'articles.name ASC'
scope :recent, :order => 'created_at DESC', :limit => 10 scope :recent, :order => 'created_at DESC', :limit => 10
validates_presence_of :supplier_id validates_presence_of :supplier_id, :delivered_on
validate :stock_articles_must_be_unique
accepts_nested_attributes_for :stock_changes, :allow_destroy => :true accepts_nested_attributes_for :stock_changes, :allow_destroy => :true
@ -15,6 +19,18 @@ class Delivery < ActiveRecord::Base
stock_changes.build(attributes) unless attributes[:quantity].to_i == 0 stock_changes.build(attributes) unless attributes[:quantity].to_i == 0
end end
end end
def includes_article?(article)
self.stock_changes.map{|stock_change| stock_change.stock_article.id}.include? article.id
end
protected
def stock_articles_must_be_unique
unless stock_changes.reject{|sc| sc.marked_for_destruction?}.map {|sc| sc.stock_article.id}.uniq!.nil?
errors.add(:base, I18n.t('model.delivery.each_stock_article_must_be_unique'))
end
end
end end

View file

@ -17,6 +17,8 @@ class GroupOrder < ActiveRecord::Base
scope :in_open_orders, joins(:order).merge(Order.open) scope :in_open_orders, joins(:order).merge(Order.open)
scope :in_finished_orders, joins(:order).merge(Order.finished_not_closed) scope :in_finished_orders, joins(:order).merge(Order.finished_not_closed)
scope :ordered, :include => :ordergroup, :order => 'groups.name'
# Generate some data for the javascript methods in ordering view # Generate some data for the javascript methods in ordering view
def load_data def load_data
data = {} data = {}

View file

@ -14,7 +14,7 @@ class GroupOrderArticle < ActiveRecord::Base
validates_inclusion_of :tolerance, :in => 0..99 validates_inclusion_of :tolerance, :in => 0..99
validates_uniqueness_of :order_article_id, :scope => :group_order_id # just once an article per group order validates_uniqueness_of :order_article_id, :scope => :group_order_id # just once an article per group order
scope :ordered, :conditions => 'result > 0' scope :ordered, :conditions => 'group_order_articles.result > 0 OR group_order_articles.quantity > 0 OR group_order_articles.tolerance > 0', :include => {:group_order => :ordergroup}, :order => 'groups.name'
localize_input_of :result localize_input_of :result

View file

@ -108,13 +108,13 @@ class Ordergroup < Group
# Make sure, the name is uniq, add usefull message if uniq group is already deleted # Make sure, the name is uniq, add usefull message if uniq group is already deleted
def uniqueness_of_name def uniqueness_of_name
id = new_record? ? nil : self.id group = Ordergroup.where('groups.name = ?', name)
group = Ordergroup.where('groups.id != ? AND groups.name = ?', id, name).first group = group.where('groups.id != ?', self.id) unless new_record?
if group.present? if group.exists?
message = group.deleted? ? :taken_with_deleted : :taken message = group.first.deleted? ? :taken_with_deleted : :taken
errors.add :name, message errors.add :name, message
end end
end end
end end

View file

@ -0,0 +1,29 @@
class PeriodicTaskGroup < ActiveRecord::Base
has_many :tasks, dependent: :destroy
PeriodDays = 7
def has_next_task?
return false if tasks.empty?
return false if tasks.first.due_date.nil?
return true
end
def create_next_task
template_task = tasks.first
self.next_task_date ||= template_task.due_date + PeriodDays
next_task = template_task.dup
next_task.due_date = next_task_date
next_task.save
self.next_task_date += PeriodDays
self.save
end
def exclude_tasks_before(task)
tasks.where("due_date < '#{task.due_date}'").each do |t|
t.update_attribute(:periodic_task_group, nil)
end
end
end

View file

@ -7,8 +7,8 @@ class SharedArticle < ActiveRecord::Base
belongs_to :shared_supplier, :foreign_key => :supplier_id belongs_to :shared_supplier, :foreign_key => :supplier_id
def build_new_article def build_new_article(supplier)
shared_supplier.supplier.articles.build( supplier.articles.build(
:name => name, :name => name,
:unit => unit, :unit => unit,
:note => note, :note => note,

View file

@ -5,7 +5,7 @@ class SharedSupplier < ActiveRecord::Base
# set correct table_name in external DB # set correct table_name in external DB
self.table_name = 'suppliers' self.table_name = 'suppliers'
has_one :supplier has_many :suppliers
has_many :shared_articles, :foreign_key => :supplier_id has_many :shared_articles, :foreign_key => :supplier_id
# These set of attributes are used to autofill attributes of new supplier, # These set of attributes are used to autofill attributes of new supplier,

View file

@ -17,6 +17,10 @@ class StockArticle < Article
quantity - OrderArticle.where(article_id: id). quantity - OrderArticle.where(article_id: id).
joins(:order).where("orders.state = 'open' OR orders.state = 'finished'").sum(:units_to_order) joins(:order).where("orders.state = 'open' OR orders.state = 'finished'").sum(:units_to_order)
end end
def quantity_history
stock_changes.reorder('stock_changes.created_at ASC').map{|s| s.quantity}.cumulative_sum
end
def self.stock_value def self.stock_value
available.collect { |a| a.quantity * a.gross_price }.sum available.collect { |a| a.quantity * a.gross_price }.sum

View file

@ -1,6 +1,7 @@
class StockChange < ActiveRecord::Base class StockChange < ActiveRecord::Base
belongs_to :delivery belongs_to :delivery
belongs_to :order belongs_to :order
belongs_to :stock_taking
belongs_to :stock_article belongs_to :stock_article
validates_presence_of :stock_article_id, :quantity validates_presence_of :stock_article_id, :quantity

View file

@ -13,11 +13,9 @@ class Supplier < ActiveRecord::Base
:delivery_days, :order_howto, :note, :shared_supplier_id, :min_order_quantity :delivery_days, :order_howto, :note, :shared_supplier_id, :min_order_quantity
validates :name, :presence => true, :length => { :in => 4..30 } validates :name, :presence => true, :length => { :in => 4..30 }
validates :phone, :presence => true, :length => { :in => 8..20 } validates :phone, :presence => true, :length => { :in => 8..25 }
validates :address, :presence => true, :length => { :in => 8..50 } validates :address, :presence => true, :length => { :in => 8..50 }
validates_length_of :order_howto, :note, maximum: 250 validates_length_of :order_howto, :note, maximum: 250
validates_length_of :phone, :in => 8..20
validates_length_of :address, :in => 8..50
validate :uniqueness_of_name validate :uniqueness_of_name
scope :undeleted, -> { where(deleted_at: nil) } scope :undeleted, -> { where(deleted_at: nil) }
@ -82,10 +80,10 @@ class Supplier < ActiveRecord::Base
# Make sure, the name is uniq, add usefull message if uniq group is already deleted # Make sure, the name is uniq, add usefull message if uniq group is already deleted
def uniqueness_of_name def uniqueness_of_name
id = new_record? ? nil : self.id supplier = Supplier.where('suppliers.name = ?', name)
supplier = Supplier.where('suppliers.id != ? AND suppliers.name = ?', id, name).first supplier = supplier.where('suppliers.id != ?', self.id) unless new_record?
if supplier.present? if supplier.exists?
message = supplier.deleted? ? :taken_with_deleted : :taken message = supplier.first.deleted? ? :taken_with_deleted : :taken
errors.add :name, message errors.add :name, message
end end
end end

View file

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
class Task < ActiveRecord::Base class Task < ActiveRecord::Base
has_many :assignments, :dependent => :destroy has_many :assignments, :dependent => :destroy
has_many :users, :through => :assignments has_many :users, :through => :assignments
belongs_to :workgroup belongs_to :workgroup
belongs_to :periodic_task_group
scope :non_group, where(workgroup_id: nil, done: false) scope :non_group, where(workgroup_id: nil, done: false)
scope :done, where(done: true) scope :done, where(done: true)
@ -16,7 +18,9 @@ class Task < ActiveRecord::Base
validates :required_users, :presence => true validates :required_users, :presence => true
validates_numericality_of :duration, :required_users, :only_integer => true, :greater_than => 0 validates_numericality_of :duration, :required_users, :only_integer => true, :greater_than => 0
validates_length_of :description, maximum: 250 validates_length_of :description, maximum: 250
validates :done, exclusion: { in: [true] }, if: :periodic?, on: :create
before_save :exclude_from_periodic_task_group, if: :changed?, unless: :new_record?
after_save :update_ordergroup_stats after_save :update_ordergroup_stats
# Find all tasks, for which the current user should be responsible # Find all tasks, for which the current user should be responsible
@ -46,6 +50,10 @@ class Task < ActiveRecord::Base
end end
end end
def periodic?
not periodic_task_group.nil?
end
def is_assigned?(user) def is_assigned?(user)
self.assignments.detect {|ass| ass.user_id == user.id } self.assignments.detect {|ass| ass.user_id == user.id }
end end
@ -100,5 +108,10 @@ class Task < ActiveRecord::Base
def update_ordergroup_stats(user_ids = self.user_ids) def update_ordergroup_stats(user_ids = self.user_ids)
Ordergroup.joins(:users).where(users: {id: user_ids}).each(&:update_stats!) Ordergroup.joins(:users).where(users: {id: user_ids}).each(&:update_stats!)
end end
def exclude_from_periodic_task_group
self.periodic_task_group = nil
true
end
end end

View file

@ -3,6 +3,7 @@
require 'digest/sha1' require 'digest/sha1'
# specific user rights through memberships (see Group) # specific user rights through memberships (see Group)
class User < ActiveRecord::Base class User < ActiveRecord::Base
include RailsSettings::Extend
#TODO: acts_as_paraniod ?? #TODO: acts_as_paraniod ??
has_many :memberships, :dependent => :destroy has_many :memberships, :dependent => :destroy
@ -19,8 +20,11 @@ class User < ActiveRecord::Base
has_many :pages, :foreign_key => 'updated_by' has_many :pages, :foreign_key => 'updated_by'
has_many :created_orders, :class_name => 'Order', :foreign_key => 'created_by_user_id', :dependent => :nullify has_many :created_orders, :class_name => 'Order', :foreign_key => 'created_by_user_id', :dependent => :nullify
attr_accessor :password, :setting_attributes attr_accessor :password, :settings_attributes
# makes the current_user (logged-in-user) available in models
cattr_accessor :current_user
validates_presence_of :nick, :email validates_presence_of :nick, :email
validates_presence_of :password, :on => :create validates_presence_of :password, :on => :create
validates_length_of :nick, :in => 2..25 validates_length_of :nick, :in => 2..25
@ -32,53 +36,37 @@ class User < ActiveRecord::Base
validates_length_of :password, :in => 5..25, :allow_blank => true validates_length_of :password, :in => 5..25, :allow_blank => true
before_validation :set_password before_validation :set_password
after_save :update_settings after_initialize do
settings.defaults['profile'] = { 'language' => I18n.default_locale } unless settings.profile
# Adds support for configuration settings (through "settings" attribute). settings.defaults['messages'] = { 'send_as_email' => true } unless settings.messages
acts_as_configurable settings.defaults['notify'] = { 'upcoming_tasks' => true } unless settings.notify
# makes the current_user (logged-in-user) available in models
cattr_accessor :current_user
# User settings keys
# returns the User-settings and the translated description
def self.setting_keys
{
"notify.orderFinished" => I18n.t('model.user.notify.order_finished'),
"notify.negativeBalance" => I18n.t('model.user.notify.negative_balance'),
"notify.upcoming_tasks" => I18n.t('model.user.notify.upcoming_tasks'),
"messages.sendAsEmail" => I18n.t('model.user.notify.send_as_email'),
"profile.phoneIsPublic" => I18n.t('model.user.notify.phone_is_public'),
"profile.emailIsPublic" => I18n.t('model.user.notify.email_is_public'),
"profile.nameIsPublic" => I18n.t('model.user.notify.name_is_public')
}
end end
# retuns the default setting for a NEW user
# for old records nil will returned after_save do
# TODO: integrate default behaviour in acts_as_configurable plugin return if settings_attributes.nil?
def settings_default(setting) settings_attributes.each do |key, value|
# define a default for the settings value.each do |k, v|
defaults = { case v
"messages.sendAsEmail" => true, when '1'
"notify.upcoming_tasks" => true value[k] = true
} when '0'
return true if self.new_record? && defaults[setting] value[k] = false
end end
def update_settings
unless setting_attributes.nil?
for setting in User::setting_keys.keys
self.settings[setting] = setting_attributes[setting] && setting_attributes[setting] == '1' ? '1' : nil
end end
self.settings.merge!(key, value)
end end
end end
def locale
settings.profile['language']
end
def name def name
[first_name, last_name].join(" ") [first_name, last_name].join(" ")
end end
def receive_email? def receive_email?
settings['messages.sendAsEmail'] == "1" && email.present? settings.messages['send_as_email'] && email.present?
end end
# Sets the user's password. It will be stored encrypted along with a random salt. # Sets the user's password. It will be stored encrypted along with a random salt.

View file

@ -3,54 +3,12 @@ class Workgroup < Group
has_many :tasks has_many :tasks
# returns all non-finished tasks # returns all non-finished tasks
has_many :open_tasks, :class_name => 'Task', :conditions => ['done = ?', false], :order => 'due_date ASC' has_many :open_tasks, :class_name => 'Task', :conditions => ['done = ?', false], order: 'due_date ASC, name ASC'
validates_uniqueness_of :name validates_uniqueness_of :name
validates_presence_of :task_name, :weekday, :task_required_users, :next_weekly_tasks_number,
:if => :weekly_task
validates_numericality_of :next_weekly_tasks_number, :greater_than => 0, :less_than => 21, :only_integer => true,
:if => :weekly_task
validates_length_of :task_description, maximum: 250
validate :last_admin_on_earth, :on => :update validate :last_admin_on_earth, :on => :update
before_destroy :check_last_admin_group before_destroy :check_last_admin_group
def self.weekdays
days = I18n.t('date.day_names')
(0..days.length-1).map {|i| [days[i], i.to_s]}
end
# Returns an Array with date-objects to represent the next weekly-tasks
def next_weekly_tasks
# our system starts from 0 (sunday) to 6 (saturday)
# get difference between groups weekday and now
diff = self.weekday - Time.now.wday
if diff >= 0
# weektask is in current week
nextTask = diff.day.from_now
else
# weektask is in the next week
nextTask = (diff + 7).day.from_now
end
# now generate the Array
nextTasks = Array.new
next_weekly_tasks_number.times do
nextTasks << nextTask.to_date
nextTask = 1.week.from_now(nextTask)
end
return nextTasks
end
def task_attributes(date)
{
:name => task_name,
:description => task_description,
:due_date => date,
:required_users => task_required_users,
:duration => task_duration,
:weekly => true
}
end
protected protected
# Check before destroy a group, if this is the last group with admin role # Check before destroy a group, if this is the last group with admin role

View file

@ -20,10 +20,10 @@
.well .well
%h4= t '.preference' %h4= t '.preference'
%table.table %table.table
- for setting in User::setting_keys.keys - @user.settings.profile.each do |key, setting|
%tr %tr
%td= User::setting_keys[setting] %td= t("simple_form.labels.settings.profile.#{key}")
%td= @user.settings[setting] == '1' ? t('simple_form.yes') : t('simple_form.no') %td= (setting != true and setting != false) ? setting : (setting === true ? t('simple_form.yes') : t('simple_form.no'))
.span3 .span3
.well .well
%h4= t '.groupabos' %h4= t '.groupabos'

View file

@ -19,7 +19,9 @@
- @articles.each_with_index do |article, index| - @articles.each_with_index do |article, index|
= fields_for "articles[#{article.id || index}]", article do |form| = fields_for "articles[#{article.id || index}]", article do |form|
%tr %tr
%td= form.check_box 'availability' %td
= yield form # allow to add hidden fields to form
= form.check_box 'availability'
%td= form.text_field 'name', class: 'input-medium' %td= form.text_field 'name', class: 'input-medium'
%td= form.text_field 'unit', class: 'input-mini' %td= form.text_field 'unit', class: 'input-mini'
%td= form.text_field 'price', class: 'input-mini' %td= form.text_field 'price', class: 'input-mini'

View file

@ -2,7 +2,9 @@
%p= t('.body').html_safe %p= t('.body').html_safe
= form_tag(create_from_upload_supplier_articles_path(@supplier)) do = form_tag(create_from_upload_supplier_articles_path(@supplier)) do
= render 'edit_all_table' = render layout: 'edit_all_table' do |form|
= form.hidden_field :manufacturer
= form.hidden_field :origin
.form-actions .form-actions
= submit_tag t('.submit', supplier: @supplier.name), class: 'btn btn-primary' = submit_tag t('.submit', supplier: @supplier.name), class: 'btn btn-primary'
= link_to t('ui.or_cancel'), upload_supplier_articles_path(@supplier) = link_to t('ui.or_cancel'), upload_supplier_articles_path(@supplier)

View file

@ -1,45 +1,134 @@
- content_for :javascript do - content_for :javascript do
:javascript :javascript
$(function() { $(function() {
$('.destroy_stock_change').live('click', function() { $('#stock_changes').on('click', '.destroy_stock_change', function() {
$(this).prev('input').val('1').parent().hide(); $(this).prev('input').val('1'); // check for destruction
var stock_change = $(this).closest('tr');
stock_change.hide(); // do not remove (to ensure destruction)
stock_change.removeAttr('id'); // remove id to allow re-adding
mark_article_for_delivery( stock_change.data('id') );
return false; return false;
}); });
$('.remove_new_stock_change').live('click', function() { $('#stock_changes').on('click', '.remove_new_stock_change', function() {
$(this).parent().remove(); var stock_change = $(this).closest('tr');
stock_change.remove();
mark_article_for_delivery( stock_change.data('id') );
return false; return false;
}) })
$('#new_stock_article').removeAttr('disabled').select2({
placeholder: '#{t '.create_stock_article'}',
data: #{articles_for_select2(@supplier).to_json},
createSearchChoice: function(term) {
return {
id: 'new',
text: term
};
},
formatResult: function(result, container, query, escapeMarkup) {
if(result.id == 'new') {
return result.text + ' (#{t '.create_from_blank'})';
}
var markup=[];
Select2.util.markMatch(result.text, query.term, markup, escapeMarkup);
return markup.join("");
}
}).on('change', function(e) {
var selectedArticle = $(e.currentTarget).select2('data');
if(!selectedArticle) {
return false;
}
if('new' == selectedArticle.id) {
$.ajax({
url: '#{new_stock_article_supplier_deliveries_path(@supplier)}',
type: 'get',
data: {stock_article: {name: selectedArticle.text}},
contentType: 'application/json; charset=UTF-8'
});
$('#new_stock_article').select2('data', null);
return true;
}
if('' != selectedArticle.id) {
$.ajax({
url: '#{derive_stock_article_supplier_deliveries_path(@supplier)}',
type: 'get',
data: {old_article_id: selectedArticle.id},
contentType: 'application/json; charset=UTF-8'
});
$('#new_stock_article').select2('data', null);
return true;
}
});
enablePriceTooltips();
}); });
function mark_article_for_delivery(stock_article_id) {
var articleTr = $('#stock_article_' + stock_article_id);
if( is_article_available_for_delivery(stock_article_id) ) {
articleTr.removeClass('unavailable');
$('.button-add-stock-change', articleTr).removeAttr('disabled');
}
else {
articleTr.addClass('unavailable');
$('.button-add-stock-change', articleTr).attr('disabled', 'disabled');
}
}
function is_article_available_for_delivery(stock_article_id) {
return ( 0 == $('#stock_change_stock_article_' + stock_article_id).length );
}
function enablePriceTooltips(context) {
$('[data-toggle~="tooltip"]', context).tooltip({
animation: false,
html: true,
placement: 'left'
});
}
= simple_form_for [@supplier, @delivery], validate: true do |f| = simple_form_for [@supplier, @delivery], validate: true do |f|
= f.hidden_field :supplier_id = f.error_notification
#stock_changes = base_errors f.object
= f.fields_for :stock_changes do |stock_change_form| = f.association :supplier, :as => :hidden
%p
= stock_change_form.select :stock_article_id, stock_articles_for_select(@supplier) %h2= t '.title_select_stock_articles'
Menge %table#stock_articles_for_adding.table.table-hover.stupidtable
= stock_change_form.text_field :quantity, size: 5, autocomplete: 'off' %thead
= stock_change_form.hidden_field :_destroy %tr
= link_to t('.remove_article'), "#", class: 'destroy_stock_change' %th.default-sort{:data => {:sort => 'string'}}= t '.article'
%p %th= t '.price'
= link_to t('.add_article'), {action: 'add_stock_change', supplier_id: @supplier.id}, remote: true %th= t '.unit'
%p %th= t '.category'
%small= t('.note_new_article', new_link: link_to(t('.note_new_article_link'), new_stock_article_path)).html_safe %th= t '.actions'
%hr/ %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'
- else
%input#new_stock_article{:style => 'width: 500px;'}
%tbody
- for article in stock_articles_for_table(@supplier)
= render :partial => 'stock_article_for_adding', :locals => {:article => article}
%h2= t '.title_fill_quantities'
%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'
%tbody
= f.simple_fields_for :stock_changes do |stock_change_form|
= render :partial => 'stock_change_fields', :locals => {:f => stock_change_form}
%h2= t '.title_finish_delivery'
= f.input :delivered_on, as: :date_picker = f.input :delivered_on, as: :date_picker
= f.input :note, input_html: {size: '35x4'} = f.input :note, input_html: {size: '35x4'}
.form-actions .form-actions
= f.submit class: 'btn btn-primary' = f.submit class: 'btn btn-primary'
= link_to t('ui.or_cancel'), supplier_deliveries_path(@supplier) = link_to t('ui.or_cancel'), supplier_deliveries_path(@supplier)
/
TODO: Fix this!!
.span6
%h2= t '.new_article.title'
%p
= t('.new_article.search', supplier: @supplier.name).html_safe + ': '
= text_field_tag 'article_name'
%hr/
#stock_article_form
= render 'stock_article_form', stock_article: @supplier.stock_articles.build

View file

@ -0,0 +1,11 @@
- css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( 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_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,14 +1,23 @@
= simple_form_for stock_article, url: add_stock_article_supplier_deliveries_path(@supplier), remote: true, - url = ( stock_article.new_record? ) ? ( create_stock_article_supplier_deliveries_path(@supplier) ) : ( update_stock_article_supplier_deliveries_path(@supplier) )
validate: true do |f| = simple_form_for stock_article, url: url, remote: true, validate: true do |f|
= f.hidden_field :supplier_id = f.association :supplier, :as => :hidden
= f.input :name = f.hidden_field :id unless stock_article.new_record?
= f.input :unit .modal-header
= f.input :note = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
= f.input :price %h3= t 'activerecord.models.stock_article'
= f.input :tax, :wrapper => :append do .modal-body
= f.input_field :tax = f.input :name
%span.add-on % = f.input :unit
-# untested, because this view is currently not included (?) = f.input :note
= f.input :deposit - if stock_article.new_record?
= f.association :article_category = f.input :price
= f.submit class: 'btn' = 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,6 +1,6 @@
%p - if stock_change.stock_article.new_record?
= fields_for "delivery[new_stock_changes][]", stock_change do |form| = simple_fields_for "delivery[new_stock_changes_new_stock_article][]", stock_change do |f|
= form.select :stock_article_id, stock_articles_for_select(supplier) = render :partial => 'stock_change_fields', :locals => {:f => f}
Menge - else
= form.text_field :quantity, :size => 5, :autocomplete => 'off' = simple_fields_for "delivery[new_stock_changes][]", stock_change do |f|
= link_to t('.remove_article'), "#", :class => 'remove_new_stock_change' = render :partial => 'stock_change_fields', :locals => {:f => f}

View file

@ -0,0 +1,10 @@
- stock_change = f.object
- stock_article = stock_change.stock_article
%tr{:id => "stock_change_stock_article_#{stock_article.id}", :data => {:id => stock_article.id}}
%td
%span.stock_article_name= stock_change.stock_article.name
= f.association :stock_article, :as => :hidden
%td.price{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_article})}}= number_to_currency stock_article.price
%td.unit= stock_change.stock_article.unit
%td= f.input :quantity, :wrapper => :intable, :input_html => {:class => 'stock-change-quantity', :autocomplete => :off}
%td= stock_change_remove_link f

View file

@ -0,0 +1,25 @@
(function(w) {
if(!is_article_available_for_delivery(<%= @stock_change.stock_article.id %>)) {
return false;
}
$('#stock_changes tr').removeClass('success');
var stock_change = $(
'<%= j(render(:partial => 'stock_change', :locals => {:stock_change => @stock_change})) %>'
).addClass('success');
enablePriceTooltips(stock_change);
$('#stock_changes').append(stock_change);
mark_article_for_delivery(<%= @stock_change.stock_article.id %>);
updateSort('#stock_changes');
var quantity = w.prompt('<%= j(t('.how_many_units', :unit => @stock_change.stock_article.unit, :name => @stock_change.stock_article.name)) %>'); <%# how to properly escape here? %>
if(null === quantity) {
stock_change.remove();
mark_article_for_delivery(<%= @stock_change.stock_article.id %>);
return false;
}
$('input.stock-change-quantity', stock_change).val(quantity);
})(window);

View file

@ -1 +0,0 @@
$('#stock_changes').append('#{escape_javascript(render(:partial => 'stock_change', :locals => {:stock_change => StockChange.new, :supplier => @supplier}))}');

View file

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

View file

@ -0,0 +1,17 @@
$('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');
enablePriceTooltips(stock_article_for_adding);
$('#stock_articles_for_adding tbody').append(stock_article_for_adding);
updateSort('#stock_articles_for_adding');
})();
$('#modalContainer').modal('hide');

View file

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

View file

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

View file

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

View file

@ -0,0 +1,33 @@
$('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');
enablePriceTooltips(stock_article_for_adding);
$('#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

@ -12,7 +12,7 @@
.well.well-small .well.well-small
%h3= t('.notes_and_journal') %h3= t('.notes_and_journal')
#note #note
- unless @order.note.empty? - unless @order.note.blank?
= simple_format @order.note = simple_format @order.note
- else - else
%p= t('.comment_on_transaction') %p= t('.comment_on_transaction')

View file

@ -5,7 +5,7 @@
%thead %thead
%tr %tr
%th= sort_link_helper t('.name'), "name", :per_page => @per_page %th= sort_link_helper t('.name'), "name", :per_page => @per_page
%th Kontakt %th= t '.contact'
%th.numeric= sort_link_helper t('.account_balance'), "account_balance", :per_page => @per_page %th.numeric= sort_link_helper t('.account_balance'), "account_balance", :per_page => @per_page
%th %th
%tbody %tbody
@ -17,4 +17,4 @@
%td %td
= link_to t('.new_transaction'), new_finance_ordergroup_transaction_path(ordergroup), class: 'btn btn-mini' = link_to t('.new_transaction'), new_finance_ordergroup_transaction_path(ordergroup), class: 'btn btn-mini'
= link_to t('.account_statement'), finance_ordergroup_transactions_path(ordergroup), class: 'btn btn-mini' = link_to t('.account_statement'), finance_ordergroup_transactions_path(ordergroup), class: 'btn btn-mini'

View file

@ -14,9 +14,9 @@
- for user in @users - for user in @users
%tr %tr
%td= user.nick %td= user.nick
%td= user.name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1' %td= user.name if @current_user.role_admin? || user.settings.profile["name_is_public"]
%td= user.email if @current_user.role_admin? || user.settings["profile.emailIsPublic"] == '1' %td= user.email if @current_user.role_admin? || user.settings.profile["email_is_public"]
%td= user.phone if @current_user.role_admin? || user.settings["profile.phoneIsPublic"] == '1' %td= user.phone if @current_user.role_admin? || user.settings.profile["phone_is_public"]
%td= user.ordergroup_name %td= user.ordergroup_name
%td= user.workgroups.collect(&:name).join(', ') %td= user.workgroups.collect(&:name).join(', ')
%td= link_to_new_message(message_params: {mail_to: user.id}) %td= link_to_new_message(message_params: {mail_to: user.id})

View file

@ -4,6 +4,7 @@
#{data_to_js(@ordering_data)} #{data_to_js(@ordering_data)}
setGroupBalance(#{@ordering_data[:available_funds]}); setGroupBalance(#{@ordering_data[:available_funds]});
setCurrencyFormat("#{t('number.currency.format.separator')}", #{t('number.currency.format.precision')}, "#{t('number.currency.format.unit')}"); setCurrencyFormat("#{t('number.currency.format.separator')}", #{t('number.currency.format.precision')}, "#{t('number.currency.format.unit')}");
setMinimumBalance(#{FoodsoftConfig[:minimum_balance] or 0});
setToleranceBehaviour(#{FoodsoftConfig[:tolerance_is_costly]}); setToleranceBehaviour(#{FoodsoftConfig[:tolerance_is_costly]});
setStockit(#{@order.stockit?}); setStockit(#{@order.stockit?});
}); });

View file

@ -22,5 +22,7 @@
Javascripts Javascripts
\================================================== \==================================================
/ Placed at the end of the document so the pages load faster / Placed at the end of the document so the pages load faster
:javascript
I18n = {locale: '#{j(I18n.locale.to_s)}'}
= javascript_include_tag "application" = javascript_include_tag "application"
= yield(:javascript) = yield(:javascript)

View file

@ -45,26 +45,6 @@
= f.label :role_orders = f.label :role_orders
%br/ %br/
= f.check_box :role_orders = f.check_box :role_orders
%p
= f.label :weekly_task
%br/
= f.check_box :weekly_task
%p
= f.label :weekday
%br/
= f.text_field :weekday
%p
= f.label :task_name
%br/
= f.text_field :task_name
%p
= f.label :task_description
%br/
= f.text_field :task_description
%p
= f.label :task_required_users
%br/
= f.text_field :task_required_users
%p %p
= f.label :deleted_at = f.label :deleted_at
%br/ %br/

View file

@ -12,11 +12,6 @@
%th Role Article Meta %th Role Article Meta
%th Role Finance %th Role Finance
%th Role Orders %th Role Orders
%th Weekly Task
%th Weekday
%th Task Name
%th Task Description
%th Task Required Users
%th Deleted At %th Deleted At
%th Contact Person %th Contact Person
%th Contact Phone %th Contact Phone
@ -34,11 +29,6 @@
%td= h ordergroup.role_article_meta %td= h ordergroup.role_article_meta
%td= h ordergroup.role_finance %td= h ordergroup.role_finance
%td= h ordergroup.role_orders %td= h ordergroup.role_orders
%td= h ordergroup.weekly_task
%td= h ordergroup.weekday
%td= h ordergroup.task_name
%td= h ordergroup.task_description
%td= h ordergroup.task_required_users
%td= h ordergroup.deleted_at %td= h ordergroup.deleted_at
%td= h ordergroup.contact_person %td= h ordergroup.contact_person
%td= h ordergroup.contact_phone %td= h ordergroup.contact_phone

View file

@ -29,7 +29,10 @@
- if order.stockit? - if order.stockit?
%td= units %td= units
- else - else
%td= "#{order_article.quantity} + #{order_article.tolerance}" if unit_quantity > 1 - if unit_quantity > 1 or order_article.tolerance > 0
%td= "#{order_article.quantity} + #{order_article.tolerance}"
- else
%td= "#{order_article.quantity}"
%td= units %td= units
%p %p
= t '.prices_sum' = t '.prices_sum'

View file

@ -56,7 +56,7 @@
%pre %pre
* #{t '.help.list_item_1'} * #{t '.help.list_item_1'}
%pre %pre
** #{t '.help_list_item_2'} ** #{t '.help.list_item_2'}
%tr %tr
%td= t '.help.ordered_list' %td= t '.help.ordered_list'
%td %td

View file

@ -0,0 +1,5 @@
.alert.fade.in.alert-success
%a.close{:href => '#', :data => {:dismiss => 'alert'}}
= t('ui.marks.close').html_safe
= t('ui.marks.success').html_safe
= alert_message

View file

@ -0,0 +1,17 @@
%table.table.table-condensed
%tr
%th= t 'activerecord.attributes.article.price'
%td.numeric= number_to_currency article.price
%tr
%th= t 'activerecord.attributes.article.deposit'
%td.numeric= number_to_currency article.deposit
%tr
%th= t 'activerecord.attributes.article.tax'
%td.numeric= number_to_percentage article.tax
- unless article.fc_price == article.gross_price
%tr
%th= t 'activerecord.attributes.article.fc_share'
%td.numeric= number_to_currency(article.fc_price-article.gross_price)
%tr
%th= t 'activerecord.attributes.article.fc_price'
%td.numeric= number_to_currency article.fc_price

View file

@ -2,8 +2,10 @@
%thead %thead
%tr %tr
%th{:style => 'width:70%'}= t '.ordergroup' %th{:style => 'width:70%'}= t '.ordergroup'
%th= t '.ordered' %th
%th= t '.received' %acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered'
%th
%acronym{:title => t('shared.articles.received_desc')}= t 'shared.articles.received'
%th= t '.price' %th= t '.price'
- for order_article in order.order_articles.ordered.all(:include => [:article, :article_price]) - for order_article in order.order_articles.ordered.all(:include => [:article, :article_price])
@ -13,8 +15,8 @@
= order_article.article.name = order_article.article.name
= "(#{order_article.article.unit} | #{order_article.price.unit_quantity} | #{number_to_currency(order_article.price.gross_price)})" = "(#{order_article.article.unit} | #{order_article.price.unit_quantity} | #{number_to_currency(order_article.price.gross_price)})"
%tbody %tbody
- for goa in order_article.group_order_articles - for goa in order_article.group_order_articles.ordered
%tr{:class => cycle('even', 'odd', :name => 'groups')} %tr{:class => [cycle('even', 'odd', :name => 'groups'), if goa.result == 0 then 'unavailable' end]}
%td{:style => "width:70%"}=h goa.group_order.ordergroup.name %td{:style => "width:70%"}=h goa.group_order.ordergroup.name
%td= "#{goa.quantity} + #{goa.tolerance}" %td= "#{goa.quantity} + #{goa.tolerance}"
%td %td

View file

@ -3,7 +3,9 @@
%tr %tr
%th{:style => "width:40%"}= t '.name' %th{:style => "width:40%"}= t '.name'
%th %th
%acronym{:title => t('.units_desc')}= t '.units' %acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered'
%th
%acronym{:title => t('shared.articles.received_desc')}= t 'shared.articles.received'
%th %th
%acronym{:title => t('.fc_price_desc')}= t '.fc_price' %acronym{:title => t('.fc_price_desc')}= t '.fc_price'
%th %th
@ -11,10 +13,10 @@
%th= t '.unit' %th= t '.unit'
%th= t '.price' %th= t '.price'
- for group_order in order.group_orders.all - for group_order in order.group_orders.ordered
%thead %thead
%tr %tr
%th{:colspan => "6"} %th{:colspan => "7"}
%h4= group_order.ordergroup.name %h4= group_order.ordergroup.name
%tbody %tbody
- total = 0 - total = 0
@ -22,17 +24,19 @@
- fc_price = goa.order_article.price.fc_price - fc_price = goa.order_article.price.fc_price
- subTotal = fc_price * goa.result - subTotal = fc_price * goa.result
- total += subTotal - total += subTotal
%tr{:class => cycle('even', 'odd', :name => 'articles')} %tr{:class => [cycle('even', 'odd', :name => 'articles'), if goa.result == 0 then 'unavailable' end]}
%td{:style => "width:40%"}=h goa.order_article.article.name %td{:style => "width:40%"}=h goa.order_article.article.name
%td= goa.result %td= "#{goa.quantity} + #{goa.tolerance}"
%td
%b= goa.result
%td= number_to_currency(fc_price) %td= number_to_currency(fc_price)
%td= goa.order_article.price.unit_quantity %td= goa.order_article.price.unit_quantity
%td= goa.order_article.article.unit %td= goa.order_article.article.unit
%td= number_to_currency(subTotal) %td= number_to_currency(subTotal)
%tr{:class => cycle('even', 'odd', :name => 'articles')} %tr{:class => cycle('even', 'odd', :name => 'articles')}
%th{:colspan => "5"} Summe %th{:colspan => "6"} Summe
%th= number_to_currency(total) %th= number_to_currency(total)
%tr %tr
%th(colspan="6") %th(colspan="7")
- reset_cycle("articles") - reset_cycle("articles")

View file

@ -0,0 +1,5 @@
.alert.alert-error.alert-block
%a.close{:href => '#', :data => {:dismiss => 'alert'}}
= t('ui.marks.close').html_safe
%ul
= error_messages.html_safe

View file

@ -13,13 +13,6 @@
- members = group.users - members = group.users
= "(#{members.size})" = "(#{members.size})"
= members.collect(&:nick).join(", ") = members.collect(&:nick).join(", ")
- if group.is_a?(Workgroup) - unless group.is_a?(Workgroup)
%dt= t('.weekly_job') + ':'
%dd
- if group.weekly_task
=h "#{group.task_name} am #{weekday(group.weekday)}"
- else
= t '.no_weekly_job'
- else
%dt= t '.apple_limit' %dt= t '.apple_limit'
%dd= group.ignore_apple_restriction ? t('.deactivated') : t('.activated') %dd= group.ignore_apple_restriction ? t('.deactivated') : t('.activated')

View file

@ -3,17 +3,6 @@
= yield = yield
- if f.object.is_a?(Workgroup)
%h3= t '.title'
= f.input :weekly_task
#weekly_task_fields
= f.input :weekday, as: :select, collection: Workgroup.weekdays
= f.input :task_name
= f.input :task_required_users
= f.input :task_duration, :as => :select, :collection => (1..3)
= f.input :task_description, as: :text, input_html: {rows: 5}
= f.input :next_weekly_tasks_number
= f.input :user_tokens, :as => :string, = f.input :user_tokens, :as => :string,
:input_html => { 'data-pre' => f.object.users.map { |u| u.token_attributes }.to_json } :input_html => { 'data-pre' => f.object.users.map { |u| u.token_attributes }.to_json }

View file

@ -5,11 +5,31 @@
= f.input :phone = f.input :phone
= f.input :password, :required => f.object.new_record? = f.input :password, :required => f.object.new_record?
= f.input :password_confirmation = f.input :password_confirmation
.control-group
.controls = f.simple_fields_for :settings_attributes do |s|
- for setting in User::setting_keys.keys = s.simple_fields_for :profile, defaults: { inline_label: true } do |profile|
%label.checkbox{:for => "user[setting_attributes][#{setting}]"} = profile.input 'language', as: :select, collection: available_locales, required: false, selected: f.object.settings.profile['language']
= hidden_field_tag "user[setting_attributes][#{setting}]", '0'
= check_box_tag "user[setting_attributes][#{setting}]", '1', .settings
f.object.settings[setting] == '1' || f.object.settings_default(setting) .settings-group
= User::setting_keys[setting] = s.simple_fields_for :profile, defaults: { inline_label: true } do |profile|
%div{class: 'control-group h_wrapper'}
%h5{class: 'controls'}
= t 'simple_form.labels.settings.settings_group.privacy'
= profile.input 'phone_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['phone_is_public'] }
= profile.input 'email_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['email_is_public'] }
= profile.input 'name_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['name_is_public'] }
.settings-group
%div{class: 'control-group'}
%h5{class: 'controls'}
= t 'simple_form.labels.settings.settings_group.messages'
= s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages|
= messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] }
= s.simple_fields_for :notify, defaults: { inline_label: true, label: false } do |notify|
= notify.input 'order_finished', as: :boolean, input_html: { checked: f.object.settings.notify['order_finished'] }
= notify.input 'negative_balance', as: :boolean, input_html: { checked: f.object.settings.notify['negative_balance'] }
= notify.input 'upcoming_tasks', as: :boolean, input_html: { checked: f.object.settings.notify['upcoming_tasks'] }

View file

@ -4,4 +4,4 @@
= f.input :date = f.input :date
= f.input :note = f.input :note
= f.submit = f.submit
= link_to t('ui.cancel'), stock_takings_path = link_to t('ui.or_cancel'), stock_takings_path

View file

@ -14,4 +14,4 @@
= render :partial => 'stock_change', :collection => @stock_taking.stock_changes = render :partial => 'stock_change', :collection => @stock_taking.stock_changes
.form-actions .form-actions
= f.submit class: 'btn' = f.submit class: 'btn'
= link_to t('ui.cancel'), stock_takings_path = link_to t('ui.or_cancel'), stock_takings_path

View file

@ -4,11 +4,5 @@ var successDiv = $('<div class="alert fade in alert-success"><a class="close" da
successDiv.append(document.createTextNode('#{escape_javascript(t('.notice', name: @article.name))}')); successDiv.append(document.createTextNode('#{escape_javascript(t('.notice', name: @article.name))}'));
$('div.container-fluid').prepend(successDiv); $('div.container-fluid').prepend(successDiv);
-# WARNING: If you try to use the escape j(...) here, an error occurs:
-# Ein Fehler ist aufgetreten: undefined method `gsub' for 50:Fixnum
-# However, it should work without without escaping.
-# Note that article names which are purely numeric, e.g. 12345, are escaped correctly (see above).
$('#stockArticle-#{@article.id}').remove(); $('#stockArticle-#{@article.id}').remove();
-# WARNING: Do not use a simple .fadeOut() above, because it conflicts with the show/hide function of unavailable articles. -# WARNING: Do not use a simple .fadeOut() above, because it conflicts with the show/hide function of unavailable articles.

View file

@ -0,0 +1,17 @@
- title t('.stock_changes', :article_name => @stock_article.name)
%table.table.table-hover#stock_changes
%thead
%tr
%th= t '.datetime'
%th= t '.reason'
%th= t '.change_quantity'
%th= t '.new_quantity'
%tbody
- reversed_history = @stock_article.quantity_history.reverse
- @stock_changes.each_with_index do |stock_change, index|
%tr
%td= l stock_change.created_at
%td= link_to_stock_change_reason(stock_change)
%td= stock_change.quantity
%td= reversed_history[index]

View file

@ -1,4 +1,4 @@
- title "Lager (#{StockArticle.available.count})" - title t('.title', article_count: StockArticle.available.count)
- content_for :javascript do - content_for :javascript do
:javascript :javascript
$(function() { $(function() {
@ -56,6 +56,7 @@
%td= article.article_category.name %td= article.article_category.name
%td %td
= link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini' = link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini'
= link_to t('ui.history'), stock_article_history_path(article), class: 'btn btn-mini'
= link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'), = link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'),
class: 'btn btn-mini btn-danger', :remote => true class: 'btn btn-mini btn-danger', :remote => true
%p %p

View file

@ -17,7 +17,9 @@
%td= shared_supplier.note %td= shared_supplier.note
%td= shared_supplier.delivery_days %td= shared_supplier.delivery_days
%td %td
- if shared_supplier.supplier - if shared_supplier.suppliers.any?
%i.icon-ok %i.icon-ok
= associated_supplier_names(shared_supplier)
= link_to t('.subscribe_again'), new_supplier_path(:shared_supplier_id => shared_supplier), class: 'btn'
- else - else
= link_to t('.subscribe'), new_supplier_path(:shared_supplier_id => shared_supplier), class: 'btn' = link_to t('.subscribe'), new_supplier_path(:shared_supplier_id => shared_supplier), class: 'btn'

View file

@ -25,5 +25,7 @@
= f.input :due_date, as: :date_picker = f.input :due_date, as: :date_picker
= f.input :done = f.input :done
.form-actions .form-actions
= f.submit class: 'btn' = f.submit class: 'btn btn-primary'
- if @task.new_record?
= f.submit t('.submit.periodic'), name: 'periodic', class: 'btn'
= link_to t('ui.or_cancel'), :back = link_to t('ui.or_cancel'), :back

View file

@ -2,6 +2,7 @@
%thead %thead
%tr %tr
%th= t '.due_date' %th= t '.due_date'
%th
%th= t '.task' %th= t '.task'
%th{:colspan => '2'} %th{:colspan => '2'}
= t '.who' = t '.who'
@ -11,6 +12,9 @@
- done = task.done ? " done" : "" - done = task.done ? " done" : ""
%tr{:class => done } %tr{:class => done }
%td= format_date(task.due_date) unless task.due_date.nil? %td= format_date(task.due_date) unless task.due_date.nil?
%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 t('.task_format', name: task.name, duration: task.duration), task_path(task)
%td %td
= task_assignments task = task_assignments task

View file

@ -4,7 +4,7 @@
- content_for :sidebar do - content_for :sidebar do
.well.well-small .well.well-small
%ul.nav.nav-list %ul.nav.nav-list
%li.nav-header Seiten %li.nav-header= t '.pages'
%li= link_to t('.my_tasks'), user_tasks_path %li= link_to t('.my_tasks'), user_tasks_path
%li= link_to t('.all_tasks'), tasks_path %li= link_to t('.all_tasks'), tasks_path
%li= link_to t('.archive'), archive_tasks_path %li= link_to t('.archive'), archive_tasks_path

View file

@ -10,7 +10,10 @@
%dd= simple_format(@task.description) %dd= simple_format(@task.description)
- if @task.due_date.present? - if @task.due_date.present?
%dt= t '.due_date' %dt= t '.due_date'
%dd= format_date(@task.due_date) %dd
= format_date(@task.due_date)
- if @task.periodic?
%i.icon-repeat{title: t('tasks.repeated')}
%dt= t 'simple_form.labels.task.duration' %dt= t 'simple_form.labels.task.duration'
%dd= t('.hours', count: @task.duration) %dd= t('.hours', count: @task.duration)
%dt= t 'simple_form.labels.task.user_list' %dt= t 'simple_form.labels.task.user_list'
@ -29,3 +32,6 @@
= link_to t('ui.edit'), edit_task_path(@task), class: 'btn' = link_to t('ui.edit'), edit_task_path(@task), class: 'btn'
= link_to t('ui.delete'), task_path(@task), :method => :delete, :confirm => "Die Aufgabe wirklich löschen?", = link_to t('ui.delete'), task_path(@task), :method => :delete, :confirm => "Die Aufgabe wirklich löschen?",
class: 'btn btn-danger' class: 'btn btn-danger'
- if @task.periodic?
= link_to t('.delete_group'), task_path(@task, periodic: true), method: :delete,
confirm: t('.confirm_delete_group'), class: 'btn btn-danger'

View file

@ -1,4 +1,4 @@
- title "Meine Aufgaben" - title t('.title')
= render 'nav' = render 'nav'
- unless @unaccepted_tasks.empty? - unless @unaccepted_tasks.empty?

View file

@ -1,16 +1,6 @@
- title t('.title', workgroup: @group.name) - title t('.title', workgroup: @group.name)
= render 'nav' = render 'nav'
%section.well
%h3= t '.weekly.title'
- if @group.weekly_task
= t('.weekly.desc', weekday: weekday(@group.weekday), task: @group.task_name).html_safe
- else
= t('.weekly.empty').html_safe
- if @current_user.member_of?(@group) or @current_user.role_admin?
= link_to t('.weekly.edit'), edit_foodcoop_workgroup_path(@group), class: 'btn'
%section %section
%h3= t '.title_all' %h3= t '.title_all'
= render 'list', tasks: @group.open_tasks = render 'list', tasks: @group.open_tasks

View file

@ -45,26 +45,6 @@
= f.label :role_orders = f.label :role_orders
%br/ %br/
= f.check_box :role_orders = f.check_box :role_orders
%p
= f.label :weekly_task
%br/
= f.check_box :weekly_task
%p
= f.label :weekday
%br/
= f.text_field :weekday
%p
= f.label :task_name
%br/
= f.text_field :task_name
%p
= f.label :task_description
%br/
= f.text_field :task_description
%p
= f.label :task_required_users
%br/
= f.text_field :task_required_users
%p %p
= f.label :deleted_at = f.label :deleted_at
%br/ %br/

View file

@ -12,11 +12,6 @@
%th Role Article Meta %th Role Article Meta
%th Role Finance %th Role Finance
%th Role Orders %th Role Orders
%th Weekly Task
%th Weekday
%th Task Name
%th Task Description
%th Task Required Users
%th Deleted At %th Deleted At
%th Contact Person %th Contact Person
%th Contact Phone %th Contact Phone
@ -34,11 +29,6 @@
%td= h workgroup.role_article_meta %td= h workgroup.role_article_meta
%td= h workgroup.role_finance %td= h workgroup.role_finance
%td= h workgroup.role_orders %td= h workgroup.role_orders
%td= h workgroup.weekly_task
%td= h workgroup.weekday
%td= h workgroup.task_name
%td= h workgroup.task_description
%td= h workgroup.task_required_users
%td= h workgroup.deleted_at %td= h workgroup.deleted_at
%td= h workgroup.contact_person %td= h workgroup.contact_person
%td= h workgroup.contact_phone %td= h workgroup.contact_phone

View file

@ -18,7 +18,7 @@ class UserNotifier
Order.find(order_id).group_orders.each do |group_order| Order.find(order_id).group_orders.each do |group_order|
group_order.ordergroup.users.each do |user| group_order.ordergroup.users.each do |user|
begin begin
Mailer.order_result(user, group_order).deliver if user.settings["notify.orderFinished"] == '1' Mailer.order_result(user, group_order).deliver if user.settings.notify["order_finished"]
rescue rescue
Rails.logger.warn "Can't deliver mail to #{user.email}" Rails.logger.warn "Can't deliver mail to #{user.email}"
end end
@ -34,7 +34,7 @@ class UserNotifier
Ordergroup.find(ordergroup_id).users.each do |user| Ordergroup.find(ordergroup_id).users.each do |user|
begin begin
Mailer.negative_balance(user, transaction).deliver if user.settings["notify.negativeBalance"] == '1' Mailer.negative_balance(user, transaction).deliver if user.settings.notify["negative_balance"]
rescue rescue
Rails.logger.warn "Can't deliver mail to #{user.email}" Rails.logger.warn "Can't deliver mail to #{user.email}"
end end

View file

@ -37,6 +37,9 @@ default: &defaults
# price markup in percent # price markup in percent
price_markup: 2.0 price_markup: 2.0
# default vat percentage for new articles
tax_default: 7.0
# tolerance order option: If set to false, article tolerance values do not count # tolerance order option: If set to false, article tolerance values do not count
# for total article price as long as the order is not finished. # for total article price as long as the order is not finished.
tolerance_is_costly: false tolerance_is_costly: false
@ -45,6 +48,10 @@ default: &defaults
# Comment out this option to activate this restriction # Comment out this option to activate this restriction
# stop_ordering_under: 75 # stop_ordering_under: 75
# ordergroups can only order when their balance is higher than or equal to this
# not fully enforced right now, since the check is only client-side
# minimum_balance: 0
# email address to be used as sender # email address to be used as sender
email_sender: foodsoft@foodcoop.test email_sender: foodsoft@foodcoop.test

View file

@ -31,7 +31,7 @@ module Foodsoft
# Internationalization. # Internationalization.
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
config.i18n.default_locale = :de config.i18n.default_locale = :en
# Configure the default encoding used in templates for Ruby 1.9. # Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8" config.encoding = "utf-8"

View file

@ -9,4 +9,11 @@ class String
string string
end end
end end
end end
class Array
def cumulative_sum
csum = 0
self.map{|val| csum += val}
end
end

View file

@ -36,7 +36,18 @@ SimpleForm.setup do |config|
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' } input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
end end
end end
# Do not use the label in tables
config.wrappers :intable, :tag => 'div', :class => 'control-group control-group-intable', :error_class => 'error' do |b|
b.use :html5
b.use :placeholder
b.wrapper :tag => 'div', :class => 'controls controls-intable' do |ba|
ba.use :input
ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
end
end
# Wrappers for forms and inputs using the Twitter Bootstrap toolkit. # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
# Check the Bootstrap docs (http://twitter.github.com/bootstrap) # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
# to learn about the different styles for forms and inputs, # to learn about the different styles for forms and inputs,

View file

@ -39,6 +39,8 @@ de:
article_category: Kategorie article_category: Kategorie
availability: Artikel ist verfügbar? availability: Artikel ist verfügbar?
deposit: Pfand deposit: Pfand
fc_price: Endpreis
fc_share: FC-Aufschlag
gross_price: Bruttopreis gross_price: Bruttopreis
price: Nettopreis price: Nettopreis
tax: MwSt tax: MwSt
@ -81,6 +83,11 @@ de:
too_long: ist zu lang (nicht mehr als %{count} Zeichen) too_long: ist zu lang (nicht mehr als %{count} Zeichen)
too_short: ist zu kurz (nicht weniger als %{count} Zeichen) too_short: ist zu kurz (nicht weniger als %{count} Zeichen)
wrong_length: hat die falsche Länge (muss genau %{count} Zeichen haben) wrong_length: hat die falsche Länge (muss genau %{count} Zeichen haben)
models:
task:
attributes:
done:
exclusion: erledigte Aufgaben können nicht wöchentlich wiederholt werden
template: template:
body: ! 'Bitte überprüfen Sie die folgenden Felder:' body: ! 'Bitte überprüfen Sie die folgenden Felder:'
header: header:
@ -416,20 +423,28 @@ de:
second: Sekunden second: Sekunden
year: Jahr year: Jahr
deliveries: deliveries:
add_stock_change:
how_many_units: Wie viele Einheiten (%{unit}) des Artikels »%{name}« liefern?
create: create:
notice: Lieferung wurde erstellt. Bitte nicht vergessen die Rechnung anzulegen! notice: Lieferung wurde erstellt. Bitte nicht vergessen die Rechnung anzulegen!
create_stock_article:
notice: Neuer Lagerartikel »%{name}« gespeichert.
destroy: destroy:
notice: Lieferung wurde gelöscht. notice: Lieferung wurde gelöscht.
edit: edit:
title: Lieferung bearbeiten title: Lieferung bearbeiten
form: form:
add_article: Lagerartikel der Lieferung hinzufügen actions: Optionen
new_article: article: Artikel
search: Suche nach Artikeln aus dem <i>%{supplier}</i> Katalog category: Kategorie
title: Neuen Lagerartikel anlegen create_from_blank: Ohne Vorlage anlegen
note_new_article: Ist ein Artikel noch nicht in der Lagerverwaltung, muss er erst %{new_link} werden. create_stock_article: Lagerartikel anlegen
note_new_article_link: neu angelegt price: Nettopreis
remove_article: Artikel aus Lieferung entfernen 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: index:
confirm_delete: Bist Du sicher? confirm_delete: Bist Du sicher?
new_delivery: Neue Lieferung für %{supplier} anlegen new_delivery: Neue Lieferung für %{supplier} anlegen
@ -449,24 +464,34 @@ de:
title: Lieferung anzeigen title: Lieferung anzeigen
title_articles: Artikel title_articles: Artikel
unit: Einheit unit: Einheit
stock_change: 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 remove_article: Artikel aus Lieferung entfernen
suppliers_overview: Lieferantenübersicht suppliers_overview: Lieferantenübersicht
update: update:
notice: Lieferung wurde aktualisiert. notice: Lieferung wurde aktualisiert.
update_stock_article:
notice: Lagerartikel »%{name}« aktualisiert.
documents: documents:
order_by_articles: order_by_articles:
filename: Bestellung %{name}-%{date} - Artikelsortierung filename: Bestellung %{name}-%{date} - Artikelsortierung
rows: rows:
- Bestellgruppe - Bestellgruppe
- Menge - Bestellt
- Bekommen
- Preis - Preis
title: ! 'Artikelsortierung der Bestellung: %{name}, beendet am %{date}' title: ! 'Artikelsortierung der Bestellung: %{name}, beendet am %{date}'
order_by_groups: order_by_groups:
filename: Bestellung %{name}-%{date} - Gruppensortierung filename: Bestellung %{name}-%{date} - Gruppensortierung
rows: rows:
- Artikel - Artikel
- Menge - Bestellt
- Bekommen
- Preis - Preis
- GebGr - GebGr
- Einheit - Einheit
@ -482,6 +507,8 @@ de:
- Gebinde - Gebinde
- Einheit - Einheit
- Preis/Einheit - Preis/Einheit
- Summe
total: Gesamtpreis
order_matrix: order_matrix:
filename: Bestellung %{name}-%{date} - Sortiermatrix filename: Bestellung %{name}-%{date} - Sortiermatrix
heading: Artikelübersicht heading: Artikelübersicht
@ -696,6 +723,7 @@ de:
ordergroups: ordergroups:
account_balance: Kontostand account_balance: Kontostand
account_statement: Kontoauszug account_statement: Kontoauszug
contact: Kontakt
name: Name name: Name
new_transaction: Neue Transaktion new_transaction: Neue Transaktion
update: update:
@ -1146,6 +1174,8 @@ de:
subject: ! 'Betreff:' subject: ! 'Betreff:'
title: Nachricht anzeigen title: Nachricht anzeigen
model: model:
delivery:
each_stock_article_must_be_unique: Lieferung darf jeden Lagerartikel höchstens einmal auflisten.
membership: membership:
no_admin_delete: Mitgliedschaft kann nicht beendet werden. Du bist die letzte Administratorin no_admin_delete: Mitgliedschaft kann nicht beendet werden. Du bist die letzte Administratorin
order_article: order_article:
@ -1154,14 +1184,6 @@ de:
redirect: Weiterleiting auf [[%{title}]]... redirect: Weiterleiting auf [[%{title}]]...
user: user:
no_ordergroup: keine Bestellgruppe no_ordergroup: keine Bestellgruppe
notify:
email_is_public: E-Mail ist für Mitglieder sichtbar
name_is_public: Name ist für Mitglieder sichtbar
negative_balance: Informiere mich, falls meine Bestellgruppe ins Minus rutscht.
order_finished: Informier mich über meine Bestellergebnisse (nach Ende der Bestellung).
phone_is_public: Telefon ist für Mitglieder sichtbar
send_as_email: Bekomme Nachrichten als Emails.
upcoming_tasks: Erinnere mich an anstehende Aufgaben.
navigation: navigation:
admin: admin:
home: Übersicht home: Übersicht
@ -1423,7 +1445,7 @@ de:
sessions: sessions:
logged_in: Angemeldet! logged_in: Angemeldet!
logged_out: Abgemeldet! logged_out: Abgemeldet!
login_invalid: login_invalid: Ungültiger Benutzername oder Passwort
new: new:
forgot_password: Passwort vergessen? forgot_password: Passwort vergessen?
login: Anmelden login: Anmelden
@ -1509,6 +1531,10 @@ de:
units_to_order: Anzahl gelieferter Gebinde units_to_order: Anzahl gelieferter Gebinde
update_current_price: Ändert auch den Preis für aktuelle Bestellungen update_current_price: Ändert auch den Preis für aktuelle Bestellungen
stock_article: stock_article:
copy_stock_article:
name: Bitte ändern
edit_stock_article:
price: <ul><li>Preisänderung gesperrt.</li><li>Bei Bedarf %{stock_article_copy_link}.</li></ul>
supplier: supplier:
supplier: supplier:
min_order_quantity: Die Mindestbestellmenge wird während der Bestellung angezeigt und soll motivieren min_order_quantity: Die Mindestbestellmenge wird während der Bestellung angezeigt und soll motivieren
@ -1581,9 +1607,25 @@ de:
contact_person: Kontaktperson contact_person: Kontaktperson
contact_phone: Telefon contact_phone: Telefon
ignore_apple_restriction: Bestellstop bei zu wenig Äpfeln ignorieren ignore_apple_restriction: Bestellstop bei zu wenig Äpfeln ignorieren
name: Name
page: page:
body: Inhalt body: Inhalt
parent_id: Oberseite parent_id: Oberseite
settings:
messages:
send_as_email: Bekomme Nachrichten als Emails.
notify:
negative_balance: Informiere mich, falls meine Bestellgruppe ins Minus rutscht.
order_finished: Informier mich über meine Bestellergebnisse (nach Ende der Bestellung).
upcoming_tasks: Erinnere mich an anstehende Aufgaben.
profile:
email_is_public: E-Mail ist für Mitglieder sichtbar.
language: Sprache
name_is_public: Name ist für Mitglieder sichtbar.
phone_is_public: Telefon ist für Mitglieder sichtbar.
settings_group:
messages: Nachrichten
privacy: Privatsphäre
stock_article: stock_article:
supplier: Lieferant supplier: Lieferant
supplier: supplier:
@ -1626,13 +1668,15 @@ de:
role_finance: Finanzen role_finance: Finanzen
role_orders: Bestellverwaltung role_orders: Bestellverwaltung
role_suppliers: Lieferanten role_suppliers: Lieferanten
task_description: Beschreibung
task_duration: Vor. Dauer in Stunden
task_name: Name für Job
task_required_users: Benötige Verantwortliche
weekday: Wochentag
weekly_task: Monatlichen Job definieren?
'no': Nein 'no': Nein
options:
settings:
profile:
language:
de: Deutsch
en: English
fr: Französisch
nl: Niederländisch
required: required:
mark: ! '*' mark: ! '*'
text: benötigt text: benötigt
@ -1677,6 +1721,15 @@ de:
title: Lagerartikel bearbeiten title: Lagerartikel bearbeiten
form: form:
price_hint: Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden. price_hint: Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden.
history:
change_quantity: Veränderung
datetime: Zeitpunkt
delivery: Lieferung
new_quantity: Neuer Bestand
order: Bestellung
reason: Ereignis
stock_changes: Verlauf anzeigen für »%{article_name}«
stock_taking: Inventur
index: index:
article: article:
article: Artikel article: Artikel
@ -1696,6 +1749,7 @@ de:
show_stock_takings: Inventurübersicht show_stock_takings: Inventurübersicht
stock_count: ! 'Artikelanzahl:' stock_count: ! 'Artikelanzahl:'
stock_worth: ! 'Aktueller Lagerwert:' stock_worth: ! 'Aktueller Lagerwert:'
title: Lager (%{article_count})
toggle_unavailable: Nicht verfügbare Artikel zeigen/verstecken toggle_unavailable: Nicht verfügbare Artikel zeigen/verstecken
view_options: Ansichtsoptionen view_options: Ansichtsoptionen
new: new:
@ -1726,6 +1780,7 @@ de:
shared_suppliers: shared_suppliers:
body: <p>Hier werden die Lieferantinnen der externen Datenbank angezeigt.</p> <p>Ihr könnt externe Lieferantinnen importieren, indem ihr sie einfach abonniert. (siehe unten)</p> <p>Damit wird eine neue Lieferantin angelegt und mit der externen Datenbank verknüpft.</p> body: <p>Hier werden die Lieferantinnen der externen Datenbank angezeigt.</p> <p>Ihr könnt externe Lieferantinnen importieren, indem ihr sie einfach abonniert. (siehe unten)</p> <p>Damit wird eine neue Lieferantin angelegt und mit der externen Datenbank verknüpft.</p>
subscribe: abonnieren subscribe: abonnieren
subscribe_again: erneut abonnieren
supplier: Lieferantin supplier: Lieferantin
title: Externe Listen title: Externe Listen
show: show:
@ -1756,12 +1811,15 @@ de:
notice: Aufgabe wurde gelöscht notice: Aufgabe wurde gelöscht
edit: edit:
title: Aufgabe bearbeiten title: Aufgabe bearbeiten
warning_periodic: <strong>Warnung:</strong> Diese Aufgabe ist Teil einer Gruppe von <em>wöchentlichen Aufgaben</em>. Beim Speichern wird sie aus der Gruppe ausgeschlossen und in eine <em>gewöhnliche Aufgabe</em> umgewandelt.
error_not_found: Keine Arbeitsgruppe gefunden error_not_found: Keine Arbeitsgruppe gefunden
form: form:
search: search:
hint: Nach Nutzerin suchen hint: Nach Nutzerin suchen
noresult: Keine Nutzerin gefunden noresult: Keine Nutzerin gefunden
placeholder: Suche ... placeholder: Suche ...
submit:
periodic: Wöchentliche Aufgabe speichern
index: index:
show_group_tasks: Gruppenaufgaben anzeigen show_group_tasks: Gruppenaufgaben anzeigen
title: Aufgaben title: Aufgaben
@ -1783,12 +1841,16 @@ de:
group_tasks: Gruppenaufgaben group_tasks: Gruppenaufgaben
my_tasks: Meine Aufgaben my_tasks: Meine Aufgaben
new_task: Neue Aufgabe erstellen new_task: Neue Aufgabe erstellen
pages: Seiten
new: new:
title: Neue Aufgabe erstellen title: Neue Aufgabe erstellen
repeated: Aufgabe wird wöchentlich wiederholt
set_done: set_done:
notice: Aufgabenstatus wurde aktualisiert notice: Aufgabenstatus wurde aktualisiert
show: show:
accept_task: Aufgabe übernehmen accept_task: Aufgabe übernehmen
confirm_delete_group: Diese und alle folgenden wöchentlichen Aufgaben wirklich löschen?
delete_group: Aufgabe und folgende löschen
due_date: Fälligkeitsdatum due_date: Fälligkeitsdatum
hours: ! '%{count}h' hours: ! '%{count}h'
mark_done: Als erledigt markieren mark_done: Als erledigt markieren
@ -1796,6 +1858,7 @@ de:
title: Aufgabe anzeigen title: Aufgabe anzeigen
update: update:
notice: Aufgabe wurde aktualisiert notice: Aufgabe wurde aktualisiert
notice_converted: Aufgabe wurde aktualisiert und in eine gewöhnliche Aufgabe umgewandelt
user: user:
more: Nichts zu tun? %{tasks_link} gibt es bestimmt Arbeit more: Nichts zu tun? %{tasks_link} gibt es bestimmt Arbeit
tasks_link: Hier tasks_link: Hier
@ -1805,11 +1868,6 @@ de:
workgroup: workgroup:
title: Aufgaben für %{workgroup} title: Aufgaben für %{workgroup}
title_all: Alle Aufgaben der Gruppe title_all: Alle Aufgaben der Gruppe
weekly:
desc: ! '<p>Jeden <b>%{weekday}</b> hat diese Arbeitsgruppe folgenden Job: <b>%{task}</b></p> <p>Die Wochenaufgaben werden von der Foodsoft automatisch erstellt. Eintragen müsst Ihr Euch aber selber.</p>'
edit: Wöchentliche Aufgaben anpassen
empty: Noch keine Wochenaufgaben angelegt.
title: Wöchentliche Aufgaben
time: time:
am: vormittags am: vormittags
formats: formats:
@ -1821,9 +1879,12 @@ de:
close: Schließen close: Schließen
delete: Löschen delete: Löschen
edit: Bearbeiten edit: Bearbeiten
history: Verlauf anzeigen
marks: marks:
close: ! '&times;' close: ! '&times;'
success: <i class="icon icon-ok"></i>
or_cancel: oder abbrechen or_cancel: oder abbrechen
please_wait: Bitte warten...
save: Speichern save: Speichern
show: Anzeigen show: Anzeigen
views: views:

View file

@ -39,6 +39,8 @@ en:
article_category: article category article_category: article category
availability: Is article available? availability: Is article available?
deposit: deposit deposit: deposit
fc_price: FC price
fc_share: FC share
gross_price: gross price gross_price: gross price
price: price price: price
tax: VAT tax: VAT
@ -81,6 +83,11 @@ en:
too_long: is too long (no more than %{count} characters) too_long: is too long (no more than %{count} characters)
too_short: is too short (use more than %{count} characters) too_short: is too short (use more than %{count} characters)
wrong_length: is the wrong length (has to have exactly %{count} characters) wrong_length: is the wrong length (has to have exactly %{count} characters)
models:
task:
attributes:
done:
exclusion: finished tasks may not be repeated weekly
template: template:
body: ! 'Please check the following fields:' body: ! 'Please check the following fields:'
header: header:
@ -229,7 +236,7 @@ en:
option_available: Make articles available option_available: Make articles available
option_delete: Delete article option_delete: Delete article
option_not_available: Make articles unavailable option_not_available: Make articles unavailable
option_select: Choose special offer ... option_select: Select action ...
price_netto: Price price_netto: Price
unit_quantity_desc: Unit quantity unit_quantity_desc: Unit quantity
unit_quantity_short: Quantity unit_quantity_short: Quantity
@ -307,7 +314,7 @@ en:
title: Synchronize articles with external database title: Synchronize articles with external database
unit_quantity_short: unit quantity unit_quantity_short: unit quantity
update: update:
body: ! '<p><i>Every article is shown twice. The old values are gray and contain the current values.</i></p> body: ! '<p><i>Every article is shown twice. The old values are gray and the text fields contain the current values.</i></p>
<p><i>Differences with the old articles are marked yellow.</i></p>' <p><i>Differences with the old articles are marked yellow.</i></p>'
title: Update ... title: Update ...
@ -418,20 +425,28 @@ en:
second: seconds second: seconds
year: years year: years
deliveries: deliveries:
add_stock_change:
how_many_units: ! 'How many units (%{unit}) to deliver? Stock article name: %{name}.'
create: create:
notice: Delivery was created. Please dont forget to create invoice! notice: Delivery was created. Please dont forget to create invoice!
create_stock_article:
notice: The new stock article »%{name}« was saved.
destroy: destroy:
notice: Delivery was deleted. notice: Delivery was deleted.
edit: edit:
title: Edit suppliers title: Edit delivery
form: form:
add_article: Add stock article to delivery actions: Tasks
new_article: article: Article
search: Search for articles in the <i>%{supplier}</i> catalogue category: Category
title: Create new stock article create_from_blank: Create new article
note_new_article: When an article is not yet in the inventory, you have to %{new_link} it first. create_stock_article: Create stock article
note_new_article_link: create price: Netprice
remove_article: Remove article from delivery 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: index:
confirm_delete: Are you sure? confirm_delete: Are you sure?
new_delivery: ! 'Create new delivery for %{supplier} ' new_delivery: ! 'Create new delivery for %{supplier} '
@ -451,26 +466,36 @@ en:
title: Show delivery title: Show delivery
title_articles: Article title_articles: Article
unit: Unit unit: Unit
stock_change: stock_article_for_adding:
remove_article: Remove articles from delivery 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 suppliers_overview: Supplier overview
update: update:
notice: Delivery was updated. notice: Delivery was updated.
update_stock_article:
notice: The stock article »%{name}« was updated.
documents: documents:
order_by_articles: order_by_articles:
filename: Order %{name}-%{date} - by articles filename: Order %{name}-%{date} - by articles
rows: rows:
- Order group - Order group
- Amount - Ordered
- Received
- Price - Price
title: ! 'Order sorted by articles: %{name}, closed at %{date}' title: ! 'Order sorted by articles: %{name}, closed at %{date}'
order_by_groups: order_by_groups:
filename: Order %{name}-%{date} - by group filename: Order %{name}-%{date} - by group
rows: rows:
- Article - Article
- Amount - Ordered
- Received
- Price - Price
- Unit Quantity - Unit quantity
- Unit - Unit
- Sum - Sum
sum: Sum sum: Sum
@ -481,20 +506,24 @@ en:
- Order Number - Order Number
- Amount - Amount
- Name - Name
- Barrel - Unit quantity
- Unit - Unit
- Price/Unit - Price/Unit
- Subtotal
total: Total
order_matrix: order_matrix:
filename: Order %{name}-%{date} - sorting matrix filename: Order %{name}-%{date} - sorting matrix
heading: Article overview heading: Article overview
rows: rows:
- Article - Article
- Unit - Unit
- Barrel - Unit quantity
- FC-Price - FC-Price
- Amount - Amount
title: ! 'Order sorting matrix: %{name}, closed at %{date}' title: ! 'Order sorting matrix: %{name}, closed at %{date}'
total: ! '%{count} articles in total' total:
one: One article in total
other: ! '%{count} articles in total'
errors: errors:
format: ! '%{attribute} %{message}' format: ! '%{attribute} %{message}'
general: A problem has occured. general: A problem has occured.
@ -698,6 +727,7 @@ en:
ordergroups: ordergroups:
account_balance: Account balance account_balance: Account balance
account_statement: Account statement account_statement: Account statement
contact: Contact
name: Name name: Name
new_transaction: New transaction new_transaction: New transaction
update: update:
@ -1148,6 +1178,8 @@ en:
subject: ! 'Subject:' subject: ! 'Subject:'
title: Show message title: Show message
model: model:
delivery:
each_stock_article_must_be_unique: Each stock article must not be listed more than once.
membership: membership:
no_admin_delete: Membership can not be withdrawn as you are the last administrator. no_admin_delete: Membership can not be withdrawn as you are the last administrator.
order_article: order_article:
@ -1156,14 +1188,6 @@ en:
redirect: Redirect to [[%{title}]]... redirect: Redirect to [[%{title}]]...
user: user:
no_ordergroup: no order group no_ordergroup: no order group
notify:
email_is_public: Email is visible for other members.
name_is_public: Name is visible for other members.
negative_balance: inform me when by order group has a negative balance.
order_finished: Inform me about my order result (when the order is closed).
phone_is_public: Phone number is visible for other members.
send_as_email: Receive messages as emails.
upcoming_tasks: Remind me of upcoming tasks.
navigation: navigation:
admin: admin:
home: Overview home: Overview
@ -1435,10 +1459,15 @@ en:
title: Foodsoft login title: Foodsoft login
user: User user: User
shared: shared:
articles:
ordered: Ordered
ordered_desc: Number of articles as ordered by member (amount + tolerance)
received: Received
received_desc: Number of articles that (will be) received by member
articles_by_articles: articles_by_articles:
ordered: Ordered (Amount + Tolerance)
ordergroup: Ordergroup ordergroup: Ordergroup
price: Total price price: Total price
ordered: Ordered (Amount + Tolerance)
received: Received received: Received
articles_by_groups: articles_by_groups:
fc_price: FC-Price fc_price: FC-Price
@ -1511,6 +1540,10 @@ en:
units_to_order: Amount of delivered units units_to_order: Amount of delivered units
update_current_price: Also update the price of the current order update_current_price: Also update the price of the current order
stock_article: stock_article:
copy_stock_article:
name: Please modify
edit_stock_article:
price: <ul><li>Price changes are forbidden.</li><li>If necessary, %{stock_article_copy_link}.</li></ul>
supplier: supplier:
supplier: 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 orderd will be shown during the order process and should motivate ordering
@ -1583,9 +1616,25 @@ en:
contact_person: Contact person contact_person: Contact person
contact_phone: Phone contact_phone: Phone
ignore_apple_restriction: Ignore order stop by apple points restriction ignore_apple_restriction: Ignore order stop by apple points restriction
name: Name
page: page:
body: Body body: Body
parent_id: Parent page parent_id: Parent page
settings:
messages:
send_as_email: Receive messages as emails.
notify:
negative_balance: Inform me when my order group has a negative balance.
order_finished: Inform me about my order result (when the order is closed).
upcoming_tasks: Remind me of upcoming tasks.
profile:
email_is_public: Email is visible for other members.
language: Language
name_is_public: Name is visible for other members.
phone_is_public: Phone number is visible for other members.
settings_group:
messages: Messages
privacy: Privacy
stock_article: stock_article:
supplier: Supplier supplier: Supplier
supplier: supplier:
@ -1628,13 +1677,15 @@ en:
role_finance: Finances role_finance: Finances
role_orders: Order management role_orders: Order management
role_suppliers: Suppliers role_suppliers: Suppliers
task_description: Description
task_duration: Duration in hours
task_name: Task name
task_required_users: People required
weekday: Weekday
weekly_task: Define monthly task?
'no': 'No' 'no': 'No'
options:
settings:
profile:
language:
de: German
en: English
fr: French
nl: Dutch
required: required:
mark: ! '*' mark: ! '*'
text: required text: required
@ -1679,6 +1730,15 @@ en:
title: Edit stock articles title: Edit stock articles
form: form:
price_hint: To avoid choas, it is not possible to edit the prices of already added stock articles until further notice. price_hint: To avoid choas, it is not possible to edit the prices of already added stock articles until further notice.
history:
change_quantity: Change
datetime: Time
delivery: Delivery
new_quantity: New quantity
order: Order
reason: Reason
stock_changes: Stock quantity changes of %{article_name}
stock_taking: Inventory
index: index:
article: article:
article: Article article: Article
@ -1698,6 +1758,7 @@ en:
show_stock_takings: Inventory overview show_stock_takings: Inventory overview
stock_count: ! 'Number of articles:' stock_count: ! 'Number of articles:'
stock_worth: ! 'Current stock value:' stock_worth: ! 'Current stock value:'
title: Stock (%{article_count})
toggle_unavailable: Show/hide unavailable articles toggle_unavailable: Show/hide unavailable articles
view_options: View options view_options: View options
new: new:
@ -1728,6 +1789,7 @@ en:
shared_suppliers: shared_suppliers:
body: <p>Suppliers of the external database are displayed here.</p> <p>You can import external suppliers by subscribing (see below).</p> <p>A new supplier will be created and connected to the external database.</p> body: <p>Suppliers of the external database are displayed here.</p> <p>You can import external suppliers by subscribing (see below).</p> <p>A new supplier will be created and connected to the external database.</p>
subscribe: Subscribe subscribe: Subscribe
subscribe_again: Subscribe again
supplier: Supplier supplier: Supplier
title: External lists title: External lists
show: show:
@ -1758,12 +1820,15 @@ en:
notice: Task has been deleted notice: Task has been deleted
edit: edit:
title: Edit task title: Edit task
warning_periodic: <strong>Warning:</strong> This task is part of a group of <em>weekly tasks</em>. When saving it will be excluded from the group and it will be converted to a <em>regular task</em>.
error_not_found: No workgroup found error_not_found: No workgroup found
form: form:
search: search:
hint: Search for user hint: Search for user
noresult: No user found noresult: No user found
placeholder: Search ... placeholder: Search ...
submit:
periodic: Save weekly task
index: index:
show_group_tasks: Show group tasks show_group_tasks: Show group tasks
title: Tasks title: Tasks
@ -1785,12 +1850,16 @@ en:
group_tasks: Group tasks group_tasks: Group tasks
my_tasks: My tasks my_tasks: My tasks
new_task: Create new task new_task: Create new task
pages: Pages
new: new:
title: Create new tasks title: Create new tasks
repeated: Task is repeated weekly
set_done: set_done:
notice: The state of the task has been updated notice: The state of the task has been updated
show: show:
accept_task: Accept task accept_task: Accept task
confirm_delete_group: Really delete this and all subsequent tasks?
delete_group: Delete task and subsequent
due_date: Due date due_date: Due date
hours: ! '%{count}h' hours: ! '%{count}h'
mark_done: Mark task as done mark_done: Mark task as done
@ -1798,6 +1867,7 @@ en:
title: Show task title: Show task
update: update:
notice: Task has been updated notice: Task has been updated
notice_converted: Task has been updated and was converted to a regular task
user: user:
more: Nothing to do? %{tasks_link} are tasks for sure. more: Nothing to do? %{tasks_link} are tasks for sure.
tasks_link: Here tasks_link: Here
@ -1807,11 +1877,6 @@ en:
workgroup: workgroup:
title: Tasks for %{workgroup} title: Tasks for %{workgroup}
title_all: All group tasks title_all: All group tasks
weekly:
desc: ! '<p>Every <b>%{weekday}</b> this workgroup has the following job: <b>%{task}</b></p> <p>The weektask has been created by Foodsoft automatically. You still have to sign up for it yourself.</p>'
edit: Edit weekly tasks
empty: No weekly tasks created yet.
title: Weekly tasks
time: time:
am: morning am: morning
formats: formats:
@ -1823,9 +1888,12 @@ en:
close: Close close: Close
delete: Delete delete: Delete
edit: Edit edit: Edit
history: Show history
marks: marks:
close: ! '&times;' close: ! '&times;'
success: <i class="icon icon-ok"></i>
or_cancel: or cancel or_cancel: or cancel
please_wait: Please wait...
save: Save save: Save
show: Show show: Show
views: views:

1919
config/locales/fr.yml Normal file

File diff suppressed because it is too large Load diff

View file

@ -39,6 +39,8 @@ nl:
article_category: categorie article_category: categorie
availability: Artikel leverbaar? availability: Artikel leverbaar?
deposit: statiegeld deposit: statiegeld
fc_price: prijs foodcoop
fc_share: marge foodcoop
gross_price: bruto prijs gross_price: bruto prijs
price: netto prijs price: netto prijs
tax: BTW tax: BTW
@ -81,6 +83,11 @@ nl:
too_long: is te lang (niet meer dan %{count} tekens) too_long: is te lang (niet meer dan %{count} tekens)
too_short: is te kort (niet minder dan %{count} tekens) too_short: is te kort (niet minder dan %{count} tekens)
wrong_length: heeft de verkeerde lengte (moet precies %{count} tekens zijn) wrong_length: heeft de verkeerde lengte (moet precies %{count} tekens zijn)
models:
task:
attributes:
done:
exclusion: gedane taken kunnen niet herhaald worden
template: template:
body: ! 'Controleer de volgende velden:' body: ! 'Controleer de volgende velden:'
header: header:
@ -138,7 +145,7 @@ nl:
first_paragraph: Hier kun je %{url} toevoegen, bewerken en verwijderen. first_paragraph: Hier kun je %{url} toevoegen, bewerken en verwijderen.
new_ordergroup: Nieuw huishouden toevoegen new_ordergroup: Nieuw huishouden toevoegen
new_ordergroups: nieuwe huishoudens new_ordergroups: nieuwe huishoudens
second_paragraph: second_paragraph: ! 'Bedenk het <em>onderscheid tussen werkgroep en huishouden</em>: een huishouden heeft een rekening en kan bestellen. in een <em>%{url}</em> (bijv. sorteergroep) werken leden samen om taken te vervullen. Leden kunnen slechts lid zijn van éen huishouden, maar van meerdere werkgroepen.'
title: Huishoudens title: Huishoudens
workgroup: werkgroep workgroup: werkgroep
new: new:
@ -256,7 +263,7 @@ nl:
notice: Alle artikelen en prijzen zijn bijgewerkt. notice: Alle artikelen en prijzen zijn bijgewerkt.
destroy_active_article: destroy_active_article:
drop: verwijderen drop: verwijderen
note: note: ! '%{article} is deel van een lopende bestelling en kan niet verwijderd worden. Het artikel graag eerst uit de bestelling(en) %{drop_link}.'
edit_all: edit_all:
note: ! 'Verplichte velden zijn: Naam, eenheid, (netto) prijs en bestellingsnummer.' note: ! 'Verplichte velden zijn: Naam, eenheid, (netto) prijs en bestellingsnummer.'
submit: Alle artikelen bijwerken submit: Alle artikelen bijwerken
@ -265,10 +272,10 @@ nl:
edit_all_table: edit_all_table:
available_desc: beschikbaar available_desc: beschikbaar
available_short: besch. available_short: besch.
order_number_desc: bestelnummer order_number_desc: Bestelnummer
order_number_short: best.nr. order_number_short: Best.nr.
price_desc: netto prijs price_desc: Netto prijs
price_short: prijs price_short: Prijs
unit_quantity_desc: Groothandelsverpakkingsgrootte unit_quantity_desc: Groothandelsverpakkingsgrootte
unit_quantity_short: Gr.Eenh. unit_quantity_short: Gr.Eenh.
form: form:
@ -305,11 +312,13 @@ nl:
price_short: prijs price_short: prijs
submit: Alle wissen/bijwerken submit: Alle wissen/bijwerken
title: Artikelen met externe database synchroniseren title: Artikelen met externe database synchroniseren
unit_quantity_short: unit_quantity_short: Gr.Eenh.
update: update:
body: body: ! '<p><i>Ieder artikel wordt tweemaal getoond. De oude waarden zijn grijs, en de tekstvelden bevatten de huidige waarden.</i></p>
title:
update_msg: <p><i>Verschillen met de oude artikelen zijn geel gemarkeerd.</i></p>'
title: Bijwerken ...
update_msg: ! 'De volgende artikelen moeten bijgewerkt worden: '
upload: upload:
body: body:
fields: fields:
@ -416,20 +425,28 @@ nl:
second: seconden second: seconden
year: jaren year: jaren
deliveries: deliveries:
add_stock_change:
how_many_units:
create: create:
notice: notice:
create_stock_article:
notice:
destroy: destroy:
notice: notice:
edit: edit:
title: title:
form: form:
add_article: actions:
new_article: article:
search: category:
title: create_from_blank:
note_new_article: create_stock_article:
note_new_article_link: price:
remove_article: quantity:
title_fill_quantities:
title_finish_delivery:
title_select_stock_articles:
unit:
index: index:
confirm_delete: confirm_delete:
new_delivery: new_delivery:
@ -449,66 +466,99 @@ nl:
title: title:
title_articles: title_articles:
unit: unit:
stock_change: stock_article_for_adding:
action_add_to_delivery:
action_edit:
action_other_price:
stock_article_form:
copy_stock_article:
stock_change_fields:
remove_article: remove_article:
suppliers_overview: suppliers_overview:
update: update:
notice: notice:
update_stock_article:
notice:
documents: documents:
order_by_articles: order_by_articles:
filename: filename: Bestelling %{name}-%{date} - Artikellijst
rows: rows:
title: - Huishouden
- Hoeveelheid
- Prijs
title: ! 'Artikellijst van bestelling: %{name}, gesloten op %{date}'
order_by_groups: order_by_groups:
filename: filename: Bestelling %{name}-%{date} - Huishoudenslijst
rows: rows:
sum: - Artikel
title: - Hoeveelheid
- Prijs
- Gr.Eenh.
- Eenheid
- Som
sum: Som
title: ! 'Huishoudenslijst van bestelling: %{name}, gesloten op %{date}'
order_fax: order_fax:
filename: filename: Bestelling %{name}-%{date} - Fax
rows: rows:
total: Totaal
order_matrix: order_matrix:
filename: filename: Bestelling %{name}-%{date} - Sorteermatrix
heading: heading: Artikeloverzicht
rows: rows:
title: - Artikel
total: - Eenheid
- Gr.Eenh.
- Foodcoop-prijs
- Aantal
title: ! 'Sorteermatrix van bestelling: %{name}, gesloten op %{date}'
total:
one: In totaal éen artikel
other: In totaal %{count} artikelen
errors: errors:
format: format: ! '%{attribute} %{message}'
general: general: Er is een probleem opgetreden.
general_again: general_again: Er is een fout opgetreden. Probeer het opnieuw.
general_msg: general_msg: ! 'Er is een probleem opgetreden: %{msg}'
messages: messages:
accepted: accepted: moet geaccepteerd worden
blank: blank: moet ingevuld worden
confirmation: confirmation: komt niet overeen met de bevestiging
empty: empty: moet ingevuld worden
equal_to: equal_to: moet precies %{count} zijn
even: even: moet even zijn
exclusion: exclusion: moet even zijn
greater_than: greater_than: moet groter dan %{count} zijn
greater_than_or_equal_to: greater_than_or_equal_to: moet groter dan of gelijk zijn aan %{count}
inclusion: inclusion: geen geldige waarde
invalid: invalid: is ongeldig
less_than: less_than: moet kleiner dan %{count} zijn
less_than_or_equal_to: less_than_or_equal_to: moet groter of gelijk aan %{count} zijn
not_a_number: not_a_number: is geen getal
not_an_integer: not_an_integer: moet een geheel getal zijn
odd: odd: moet oneven zijn
record_invalid: record_invalid:
taken: taken: is al in gebruik
taken_with_deleted: taken_with_deleted: is al in gebruik (verwijderde groep)
too_long: too_long:
too_short: one: is te lang (niet meer dan éen teken)
wrong_length: other: is te lang (niet meer dan %{count} tekens)
too_short:
one: is te kort (niet minder dan éen teken)
other: is te kort (niet minder dan %{count} tekens)
wrong_length:
one: heeft de verkeerde lengte (moet precies éen zijn)
other: heeft de verkeerde lengte (moet precies %{count} tekens hebben)
template: template:
body: body: ! 'Controleer alsjeblieft de volgende velden:'
header: header:
one: ! 'Kon %{model} niet opslaan: éen fout gevonden.'
other: ! 'Kon %{model} niet opslaan: %{count} fouten gevonden.'
feedback: feedback:
create: create:
notice: notice: Bericht verstuurd. Vriendelijk bedankt!
new: new:
first_paragraph: first_paragraph: Probleem gevonden? Voorstel? Idee? Verbeterpunt? We horen graag je feedback.
second_paragraph: second_paragraph:
send: send:
title: title:
@ -542,7 +592,7 @@ nl:
total_fc: Som (FC-prijs) total_fc: Som (FC-prijs)
units: Eenheden units: Eenheden
index: index:
title: Gesloten orders title: Gesloten bestellingen
invoice: invoice:
edit: Factuur bewerken edit: Factuur bewerken
invoice_amount: ! 'Factuurbedrag:' invoice_amount: ! 'Factuurbedrag:'
@ -573,8 +623,8 @@ nl:
orders: orders:
clear: afrekenen clear: afrekenen
cleared: afgerekend (%{amount}) cleared: afgerekend (%{amount})
close: direct afsluiten close: direct afrekenen
confirm: Weet je zeker dat de je bestelling wilt afsluiten? confirm: Weet je zeker dat de je bestelling wilt afrekenen?
end: Einde end: Einde
ended: gesloten ended: gesloten
last_edited_by: Laatst aangepast door last_edited_by: Laatst aangepast door
@ -673,7 +723,8 @@ nl:
title: Tegoeden beheren title: Tegoeden beheren
ordergroups: ordergroups:
account_balance: Tegoed account_balance: Tegoed
account_statement: account_statement: Rekeningafschrift
contact:
name: Naam name: Naam
new_transaction: Nieuwe transactie new_transaction: Nieuwe transactie
update: update:
@ -681,31 +732,31 @@ nl:
foodcoop: foodcoop:
ordergroups: ordergroups:
index: index:
name: name: Naam ...
only_active: only_active: Alleen actieve
only_active_desc: only_active_desc: (minstens eenmaal in de laatste 3 maanden besteld)
title: title: Huishoudens
ordergroups: ordergroups:
last_ordered: last_ordered: laatste besteld
name: name: Naam
user: user: Leden
users: users:
index: index:
body: body: <p>Hier kun je leden van deze foodcoop een bericht sturen.</p> <p>Om je eigen contactgegevens te laten zien, moet je die vrijgeven op %{profile_link}.</p>
ph_name: ph_name: Naam ...
ph_ordergroup: ph_ordergroup: Huishouden ...
profile_link: profile_link: Instellingen
title: title: Leden
workgroups: workgroups:
edit: edit:
invite_link: invite_link: hier
invite_new: invite_new: Nieuwe leden kun je %{invite_link} uitnodigen.
title: title: Groep bewerken
index: index:
body: body: <p>De groep kan alleen aangepast worden door leden ervan.<br/> Als je lid wilt worden van een groep, stuur dan een bericht aan een van de leden.</p>
title: title: Werkgroepen
workgroup: workgroup:
edit: edit: Groep bewerken
show_tasks: show_tasks:
group_orders: group_orders:
archive: archive:
@ -755,9 +806,9 @@ nl:
title: Afgerekende bestellingen title: Afgerekende bestellingen
finished_orders: finished_orders:
title: Niet afgerekende bestellingen title: Niet afgerekende bestellingen
total_sum: total_sum: Totaal
funds: funds:
account_balance: account_balance: Tegoed
available_funds: available_funds:
finished_orders: niet afgerekende bestellingen finished_orders: niet afgerekende bestellingen
open_orders: Lopende bestellingen open_orders: Lopende bestellingen
@ -853,12 +904,12 @@ nl:
last_update: last_update:
title: title:
transactions: transactions:
amount: amount: Bedrag
note: note: Notitie
title: title: Laatste transacties
view: view: Rekeningafschrift tonen
when: when: Wanneer
where: where: Wie
ordergroup: ordergroup:
title: title:
tasks_move: tasks_move:
@ -894,7 +945,7 @@ nl:
start_nav: start_nav:
admin: admin:
finances: finances:
accounts: accounts: Tegoeden bijwerken
settle: settle:
title: Financiën title: Financiën
foodcoop: Foodcoop foodcoop: Foodcoop
@ -1039,6 +1090,8 @@ nl:
subject: subject:
title: title:
model: model:
delivery:
each_stock_article_must_be_unique:
membership: membership:
no_admin_delete: no_admin_delete:
order_article: order_article:
@ -1047,14 +1100,6 @@ nl:
redirect: redirect:
user: user:
no_ordergroup: no_ordergroup:
notify:
email_is_public:
name_is_public:
negative_balance:
order_finished: Informeer me over mijn bestelresultaat (wanneer de bestelling gesloten wordt).
phone_is_public:
send_as_email:
upcoming_tasks:
navigation: navigation:
admin: admin:
home: Overzicht home: Overzicht
@ -1092,7 +1137,7 @@ nl:
number: number:
currency: currency:
format: format:
delimiter: ! ',' delimiter: ! ' '
format: ! '%n %u' format: ! '%n %u'
precision: 2 precision: 2
separator: ! ',' separator: ! ','
@ -1400,6 +1445,10 @@ nl:
units_to_order: units_to_order:
update_current_price: update_current_price:
stock_article: stock_article:
copy_stock_article:
name:
edit_stock_article:
price:
supplier: supplier:
supplier: supplier:
min_order_quantity: min_order_quantity:
@ -1425,7 +1474,7 @@ nl:
description: Omschrijving description: Omschrijving
email: Email email: Email
note: Notitie note: Notitie
order_number: Order nummer order_number: Bestelnummer
ordergroup: Huishouden ordergroup: Huishouden
password: Wachtwoord password: Wachtwoord
password_confirmation: Wachtwoord herhalen password_confirmation: Wachtwoord herhalen
@ -1450,7 +1499,7 @@ nl:
note: Notitie note: Notitie
number: Nummer number: Nummer
order: Bestelling order: Bestelling
paid_on: Betaalt op paid_on: Betaald op
supplier: Leverancier supplier: Leverancier
message: message:
body: body:
@ -1472,9 +1521,25 @@ nl:
contact_person: Contactpersoon contact_person: Contactpersoon
contact_phone: Telefoon contact_phone: Telefoon
ignore_apple_restriction: ignore_apple_restriction:
name:
page: page:
body: body:
parent_id: parent_id:
settings:
messages:
send_as_email: Berichten als emails ontvangen.
notify:
negative_balance: Informeer me wanneer mijn huishouden een negatief saldo krijgt.
order_finished: Informeer me over mijn bestelresultaat (wanneer de bestelling gesloten wordt).
upcoming_tasks: Herinner me aan aankomende taken.
profile:
email_is_public: E-mail is zichtbaar voor andere leden.
language: Taal
name_is_public: Naam is zichtbaar voor andere leden.
phone_is_public: Telefoonnummer is zichtbaar voor andere leden.
settings_group:
messages: Berichten
privacy: Privacy
stock_article: stock_article:
supplier: supplier:
supplier: supplier:
@ -1513,17 +1578,19 @@ nl:
workgroup: workgroup:
next_weekly_tasks_number: next_weekly_tasks_number:
role_admin: role_admin:
role_article_meta: role_article_meta: Artikelbestand
role_finance: role_finance: Financiën
role_orders: role_orders:
role_suppliers: role_suppliers: Leveranciers
task_description:
task_duration:
task_name:
task_required_users:
weekday:
weekly_task:
'no': Nee 'no': Nee
options:
settings:
profile:
language:
de: Duits
en: Engels
fr: Frans
nl: Nederlands
required: required:
mark: ! '*' mark: ! '*'
text: verplicht text: verplicht
@ -1568,6 +1635,15 @@ nl:
title: title:
form: form:
price_hint: price_hint:
history:
change_quantity:
datetime:
delivery:
new_quantity:
order:
reason:
stock_changes:
stock_taking:
index: index:
article: article:
article: article:
@ -1587,6 +1663,7 @@ nl:
show_stock_takings: show_stock_takings:
stock_count: stock_count:
stock_worth: stock_worth:
title:
toggle_unavailable: toggle_unavailable:
view_options: view_options:
new: new:
@ -1617,6 +1694,7 @@ nl:
shared_suppliers: shared_suppliers:
body: body:
subscribe: subscribe:
subscribe_again:
supplier: supplier:
title: title:
show: show:
@ -1647,12 +1725,15 @@ nl:
notice: notice:
edit: edit:
title: title:
warning_periodic:
error_not_found: error_not_found:
form: form:
search: search:
hint: hint:
noresult: noresult:
placeholder: placeholder:
submit:
periodic:
index: index:
show_group_tasks: show_group_tasks:
title: title:
@ -1674,12 +1755,16 @@ nl:
group_tasks: group_tasks:
my_tasks: my_tasks:
new_task: new_task:
pages:
new: new:
title: title:
repeated:
set_done: set_done:
notice: notice:
show: show:
accept_task: accept_task:
confirm_delete_group:
delete_group:
due_date: due_date:
hours: hours:
mark_done: mark_done:
@ -1687,6 +1772,7 @@ nl:
title: title:
update: update:
notice: notice:
notice_converted:
user: user:
more: more:
tasks_link: tasks_link:
@ -1696,11 +1782,6 @@ nl:
workgroup: workgroup:
title: title:
title_all: title_all:
weekly:
desc:
edit:
empty:
title:
time: time:
am: morgen am: morgen
formats: formats:
@ -1712,9 +1793,12 @@ nl:
close: Sluiten close: Sluiten
delete: Verwijder delete: Verwijder
edit: Bewerk edit: Bewerk
history:
marks: marks:
close: ! '&times;' close: ! '&times;'
success: <i class="icon icon-ok"></i>
or_cancel: of annuleren or_cancel: of annuleren
please_wait: Een moment alstublieft...
save: Opslaan save: Opslaan
show: Tonen show: Tonen
views: views:

View file

@ -8,6 +8,7 @@ Foodsoft::Application.routes.draw do
root :to => redirect("/#{FoodsoftConfig.scope}") root :to => redirect("/#{FoodsoftConfig.scope}")
scope '/:foodcoop' do scope '/:foodcoop' do
# Root path # Root path
@ -96,14 +97,23 @@ Foodsoft::Application.routes.draw do
get :articles_search get :articles_search
get :fill_new_stock_article_form get :fill_new_stock_article_form
end end
get :history
end end
resources :suppliers do resources :suppliers do
get :shared_suppliers, :on => :collection get :shared_suppliers, :on => :collection
resources :deliveries do resources :deliveries do
post :drop_stock_change, :on => :member post :add_stock_change, :on => :collection
post :add_stock_article, :on => :collection
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
end end
resources :articles do resources :articles do
@ -178,7 +188,7 @@ Foodsoft::Application.routes.draw do
############## Feedback ############## Feedback
resource :feedback, :only => [:new, :create], :controller => 'feedback' resource :feedback, :only => [:new, :create], :controller => 'feedback'
############## The rest ############## The rest
resources :users, :only => [:index] resources :users, :only => [:index]

View file

@ -3,13 +3,11 @@
# Upcoming tasks notifier # Upcoming tasks notifier
every :day, :at => '7:20 am' do every :day, :at => '7:20 am' do
rake "multicoops:run foodsoft:notify_upcoming_tasks" rake "multicoops:run TASK=foodsoft:notify_upcoming_tasks"
end end
# Weekly taks # Weekly taks
every :sunday, :at => '7:14 am' do every :sunday, :at => '7:14 am' do
rake "multicoops:run foodsoft:create_upcoming_weekly_tasks" rake "multicoops:run TASK=foodsoft:create_upcoming_periodic_tasks"
rake "multicoops:run foodsoft:notify_users_of_weekly_task" rake "multicoops:run TASK=foodsoft:notify_users_of_weekly_task"
end end

Some files were not shown because too many files have changed in this diff Show more