Improve support for "receive from scratch" workflow, esp. for mobile

also try harder to make certain aspects easier to enable/disable via handler,
e.g. whether cases should be allowed as quantity input, or expired credits
should be a thing etc.
This commit is contained in:
Lance Edgar 2018-07-17 19:55:15 -05:00
parent a34a42d2b2
commit d8b45db331
13 changed files with 330 additions and 149 deletions

View file

@ -27,9 +27,9 @@ $(document).on('click', 'form[name="new-purchasing-batch"] #receive-truck-dump',
});
$(document).on('click', 'form.receiving-update #delete-receiving-row', function() {
$(document).on('click', 'form[name="new-purchasing-batch"] #receive-from-scratch', function() {
var form = $(this).parents('form');
form.find('input[name="delete_row"]').val('true');
form.find('input[name="workflow"]').val('from_scratch');
form.submit();
});
@ -68,11 +68,15 @@ $(document).on('click', 'form.receiving-update .receiving-actions button', funct
});
// quick-receive (1 CS)
$(document).on('click', 'form.receiving-update .receive-one-case', function() {
// quick-receive (1 case or unit)
$(document).on('click', 'form.receiving-update .quick-receive', function() {
var form = $(this).parents('form:first');
form.find('[name="mode"]').val('received');
form.find('[name="cases"]').val('1');
if ($(this).data('uom') == 'CS') {
form.find('[name="cases"]').val('1');
} else {
form.find('[name="units"]').val('1');
}
form.find('input[name="quick_receive"]').val('true');
form.submit();
});