First try making tolerance not costly.
A new configuration setting was introduced: tolerance_is_costly If set to false, article tolerance values do not count for total article price as long as the order is not finished. This reduces the negative effect on using tolerance for the user.
This commit is contained in:
parent
c7e37fc7b2
commit
0adce9d54c
4 changed files with 38 additions and 9 deletions
|
|
@ -8,6 +8,7 @@
|
|||
var modified = false // indicates if anything has been clicked on this page
|
||||
var groupBalance = 0; // available group money
|
||||
var decimalSeparator = "."; // default decimal separator
|
||||
var toleranceIsCostly = true; // default tolerance behaviour
|
||||
|
||||
// Article data arrays:
|
||||
var price = new Array();
|
||||
|
|
@ -22,6 +23,10 @@ function setDecimalSeparator(character) {
|
|||
decimalSeparator = character;
|
||||
}
|
||||
|
||||
function setToleranceBehaviour(value) {
|
||||
toleranceIsCostly = value;
|
||||
}
|
||||
|
||||
function setGroupBalance(amount) {
|
||||
groupBalance = amount;
|
||||
}
|
||||
|
|
@ -98,7 +103,11 @@ function update(item, quantity, tolerance) {
|
|||
}
|
||||
|
||||
// update total price
|
||||
itemTotal[item] = price[item] * (Number(quantity) + Number(tolerance));
|
||||
if(toleranceIsCostly == true) {
|
||||
itemTotal[item] = price[item] * (Number(quantity) + Number(tolerance));
|
||||
} else {
|
||||
itemTotal[item] = price[item] * (Number(quantity));
|
||||
}
|
||||
$('price_' + item + '_display').update(asMoney(itemTotal[item]));
|
||||
|
||||
// update balance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue