Add color marking to items in group orders that have missing items
This commit is contained in:
parent
f049da7573
commit
75967bad22
5 changed files with 40 additions and 4 deletions
|
|
@ -118,11 +118,25 @@ function update(item, quantity, tolerance) {
|
|||
$('#price_' + item + '_display').html(I18n.l("currency", itemTotal[item]));
|
||||
|
||||
// update missing units
|
||||
var missing_units = unit[item] - (((quantityOthers[item] + Number(quantity)) % unit[item]) + Number(tolerance) + toleranceOthers[item])
|
||||
if (missing_units < 0 || missing_units == unit[item]) {
|
||||
var missing_units = unit[item] - (((quantityOthers[item] + Number(quantity)) % unit[item]) + Number(tolerance) + toleranceOthers[item]),
|
||||
missing_units_css = '';
|
||||
if (missing_units < 0) {
|
||||
missing_units = 0;
|
||||
missing_units_css = '';
|
||||
} else if (missing_units == unit[item]) {
|
||||
missing_units = 0;
|
||||
missing_units_css = 'missing-none';
|
||||
} else if (missing_units == 1) {
|
||||
missing_units_css = 'missing-few';
|
||||
} else {
|
||||
missing_units_css = 'missing-many';
|
||||
}
|
||||
$('#missing_units_' + item).html(String(missing_units));
|
||||
$('#missing_units_' + item)
|
||||
.html(String(missing_units))
|
||||
.closest('tr')
|
||||
.removeClass('missing-many missing-few missing-none')
|
||||
.addClass(missing_units_css);
|
||||
|
||||
|
||||
// update balance
|
||||
updateBalance();
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@
|
|||
*= require token-input-bootstrappy
|
||||
*= require bootstrap-datepicker
|
||||
*= require list.unlist
|
||||
*= require list.missing
|
||||
*= require recurring_select
|
||||
*/
|
||||
|
|
|
|||
11
app/assets/stylesheets/list.missing.css
Normal file
11
app/assets/stylesheets/list.missing.css
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.list .missing-many td, .list .missing-many:hover td {
|
||||
background-color: #ebbebe;
|
||||
}
|
||||
|
||||
.list .missing-few td, .list .missing-few:hover td {
|
||||
background-color: #ffee75;
|
||||
}
|
||||
|
||||
.list .missing-none td, .list .missing-none:hover td {
|
||||
background-color: #cff5be;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue