Refactor keypad widget for mobile receiving

logic for this is now held in common
This commit is contained in:
Lance Edgar 2017-07-11 21:05:26 -05:00
parent 32d256932e
commit 8a5dbc33a7
2 changed files with 13 additions and 39 deletions

View file

@ -192,10 +192,10 @@ $(document).on('change', 'fieldset.receiving-mode input[name="mode"]', function(
// handle receiving action buttons
$(document).on('click', '.receiving-actions button', function() {
var action = $(this).data('action');
var form = $('form.receiving-update');
var uom = form.find('[name="receiving-uom"]:checked').val();
var form = $(this).parents('form:first');
var uom = form.find('[name="keypad-uom"]:checked').val();
var mode = form.find('[name="mode"]:checked').val();
var qty = form.find('.receiving-quantity').text();
var qty = form.find('.keypad-quantity').text();
if (action == 'add' || action == 'subtract') {
if (qty != '0') {
if (action == 'subtract') {