Add way to prevent "case" entries for inventory adjustment batch
This commit is contained in:
parent
57c2a7981f
commit
54bfafdbfe
4 changed files with 80 additions and 30 deletions
|
@ -9,14 +9,20 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function assert_quantity() {
|
||||
% if allow_cases:
|
||||
if ($('#cases').val() && parseFloat($('#cases').val())) {
|
||||
return true;
|
||||
}
|
||||
% endif
|
||||
if ($('#units').val() && parseFloat($('#units').val())) {
|
||||
return true;
|
||||
}
|
||||
alert("Please provide case and/or unit quantity");
|
||||
% if allow_cases:
|
||||
$('#cases').select().focus();
|
||||
% else:
|
||||
$('#units').select().focus();
|
||||
% endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -24,7 +30,9 @@
|
|||
$('#product-info p').text(msg);
|
||||
$('#product-info img').hide();
|
||||
$('#upc').focus().select();
|
||||
% if allow_cases:
|
||||
$('.field-wrapper.cases input').prop('disabled', true);
|
||||
% endif
|
||||
$('.field-wrapper.units input').prop('disabled', true);
|
||||
$('.buttons button').button('disable');
|
||||
}
|
||||
|
@ -65,7 +73,9 @@
|
|||
$('#product-info .warning').hide();
|
||||
$('.product-fields').hide();
|
||||
// $('.receiving-fields').hide();
|
||||
% if allow_cases:
|
||||
$('.field-wrapper.cases input').prop('disabled', true);
|
||||
% endif
|
||||
$('.field-wrapper.units input').prop('disabled', true);
|
||||
$('.buttons button').button('disable');
|
||||
return true;
|
||||
|
@ -102,13 +112,19 @@
|
|||
$('.product-fields').show();
|
||||
}
|
||||
$('#product-info .warning.notordered').show();
|
||||
% if allow_cases:
|
||||
$('.field-wrapper.cases input').prop('disabled', false);
|
||||
% endif
|
||||
$('.field-wrapper.units input').prop('disabled', false);
|
||||
$('.buttons button').button('enable');
|
||||
if (data.product.type2) {
|
||||
$('#units').focus().select();
|
||||
} else {
|
||||
% if allow_cases:
|
||||
$('#cases').focus().select();
|
||||
% else:
|
||||
$('#units').focus().select();
|
||||
% endif
|
||||
}
|
||||
|
||||
// TODO: this is maybe useful if "new products" may be added via inventory batch
|
||||
|
@ -147,7 +163,9 @@
|
|||
});
|
||||
|
||||
$('#upc').focus();
|
||||
% if allow_cases:
|
||||
$('.field-wrapper.cases input').prop('disabled', true);
|
||||
% endif
|
||||
$('.field-wrapper.units input').prop('disabled', true);
|
||||
$('.buttons button').button('disable');
|
||||
|
||||
|
@ -232,10 +250,12 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="field-wrapper cases">
|
||||
<label for="cases">Cases</label>
|
||||
<div class="field">${h.text('cases', autocomplete='off')}</div>
|
||||
</div>
|
||||
% if allow_cases:
|
||||
<div class="field-wrapper cases">
|
||||
<label for="cases">Cases</label>
|
||||
<div class="field">${h.text('cases', autocomplete='off')}</div>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<div class="field-wrapper units">
|
||||
<label for="units">Units</label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue