Add "quick receive all" support for mobile receiving

i.e. quick receive button can now receive all/remainder of the ordered qty
This commit is contained in:
Lance Edgar 2018-08-16 22:21:58 -05:00
parent d4b2cf9943
commit 56392ccdd0
3 changed files with 39 additions and 6 deletions

View file

@ -74,10 +74,11 @@ $(document).on('click', 'form.receiving-update .receiving-actions button', funct
$(document).on('click', 'form.receiving-update .quick-receive', function() {
var form = $(this).parents('form:first');
form.find('[name="mode"]').val('received');
var quantity = $(this).data('quantity');
if ($(this).data('uom') == 'CS') {
form.find('[name="cases"]').val('1');
form.find('[name="cases"]').val(quantity);
} else {
form.find('[name="units"]').val('1');
form.find('[name="units"]').val(quantity);
}
form.find('input[name="quick_receive"]').val('true');
form.submit();