Merge branch 'master' into stock_article_quantity_history

This commit is contained in:
Julius 2013-07-11 19:23:52 +02:00
commit 620686fa46
4 changed files with 12 additions and 2 deletions

View File

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

View File

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

View File

@ -4,6 +4,7 @@
#{data_to_js(@ordering_data)}
setGroupBalance(#{@ordering_data[:available_funds]});
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]});
setStockit(#{@order.stockit?});
});

View File

@ -48,6 +48,10 @@ default: &defaults
# Comment out this option to activate this restriction
# 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_sender: foodsoft@foodcoop.test