Improve delivery workflow; introduce sortable tables; use js.erb for deliveries
This commit is contained in:
parent
49cfa9aded
commit
65f61e09d5
18 changed files with 357 additions and 105 deletions
20
app/views/deliveries/add_stock_change.js.erb
Normal file
20
app/views/deliveries/add_stock_change.js.erb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
if(!is_article_unavailable_for_delivery(<%= @stock_change.stock_article.id %>)) {
|
||||
<%# would be easier to return in the opposite case, but how? %>
|
||||
|
||||
mark_article_unavailable_for_delivery(<%= @stock_change.stock_article.id %>);
|
||||
|
||||
(function(w) {
|
||||
$('#stock_changes tr').removeClass('success');
|
||||
|
||||
var stock_change = $(
|
||||
'<%= j(render(:partial => 'stock_change', :locals => {:stock_change => @stock_change})) %>'
|
||||
).addClass('success');
|
||||
|
||||
$('#stock_changes').append(stock_change);
|
||||
updateSort('#stock_changes');
|
||||
|
||||
var quantity = w.prompt('<%= j(t('.how_many_units', :unit => @stock_change.stock_article.unit, :name => @stock_change.stock_article.name)) %>'); <%# how to properly escape here? %>
|
||||
$('input.stock-change-quantity', stock_change).val(quantity);
|
||||
})(window);
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue