Add initial support for receiving truck dump batch via mobile
i.e. just the initial truck dump, but secondary invoice batches are not yet supported. also this maybe breaks other things..we'll see
This commit is contained in:
parent
b515331e48
commit
9ed501a8cc
9 changed files with 214 additions and 62 deletions
|
@ -56,10 +56,12 @@
|
|||
// when user clicks autocomplete result, hide search etc.
|
||||
this.ul.on('click', 'li', function() {
|
||||
var $li = $(this);
|
||||
var uuid = $li.data('uuid');
|
||||
that.search.hide();
|
||||
that.hidden_field.val($li.data('uuid'));
|
||||
that.hidden_field.val(uuid);
|
||||
that.button.text($li.text()).show();
|
||||
that.ul.hide();
|
||||
that.element.trigger('autocompleteitemselected', uuid);
|
||||
});
|
||||
|
||||
// when user clicks "change" button, show search etc.
|
||||
|
@ -69,6 +71,7 @@
|
|||
that.hidden_field.val('');
|
||||
that.search.show();
|
||||
that.text_field.focus();
|
||||
that.element.trigger('autocompleteitemcleared');
|
||||
});
|
||||
|
||||
}
|
||||
|
|
34
tailbone/static/js/tailbone.mobile.receiving.js
Normal file
34
tailbone/static/js/tailbone.mobile.receiving.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
/************************************************************
|
||||
*
|
||||
* tailbone.mobile.receiving.js
|
||||
*
|
||||
* Global logic for mobile receiving feature
|
||||
*
|
||||
************************************************************/
|
||||
|
||||
|
||||
// TODO: this is really just for receiving; should change form name?
|
||||
$(document).on('autocompleteitemselected', 'form[name="new-purchasing-batch"] .vendor', function(event, uuid) {
|
||||
$('#new-receiving-types').show();
|
||||
});
|
||||
|
||||
|
||||
// TODO: this is really just for receiving; should change form name?
|
||||
$(document).on('autocompleteitemcleared', 'form[name="new-purchasing-batch"] .vendor', function(event) {
|
||||
$('#new-receiving-types').hide();
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', 'form[name="new-purchasing-batch"] #receive-truck-dump', function() {
|
||||
var form = $(this).parents('form');
|
||||
form.find('input[name="workflow"]').val('truck_dump');
|
||||
form.submit();
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', 'form.receiving-update #delete-receiving-row', function() {
|
||||
var form = $(this).parents('form');
|
||||
form.find('input[name="delete_row"]').val('true');
|
||||
form.submit();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue