2012-10-17 20:45:52 +02:00
|
|
|
- content_for :javascript do
|
2011-05-27 14:09:01 +02:00
|
|
|
:javascript
|
|
|
|
$(function() {
|
|
|
|
$('.destroy_stock_change').live('click', function() {
|
|
|
|
$(this).prev('input').val('1').parent().hide();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.remove_new_stock_change').live('click', function() {
|
|
|
|
$(this).parent().remove();
|
|
|
|
return false;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
2013-01-26 15:57:29 +01:00
|
|
|
= simple_form_for [@supplier, @delivery], validate: true do |f|
|
|
|
|
= f.hidden_field :supplier_id
|
|
|
|
#stock_changes
|
|
|
|
= f.fields_for :stock_changes do |stock_change_form|
|
2009-05-17 16:11:39 +02:00
|
|
|
%p
|
2013-01-26 15:57:29 +01:00
|
|
|
= stock_change_form.select :stock_article_id, stock_articles_for_select(@supplier)
|
|
|
|
Menge
|
|
|
|
= stock_change_form.text_field :quantity, size: 5, autocomplete: 'off'
|
|
|
|
= stock_change_form.hidden_field :_destroy
|
|
|
|
= link_to "Artikel aus Lieferung entfernen", "#", class: 'destroy_stock_change'
|
|
|
|
%p
|
|
|
|
= link_to "Lagerartikel der Lieferung hinzufügen", {action: 'add_stock_change', supplier_id: @supplier.id}, remote: true
|
|
|
|
%p
|
|
|
|
%small
|
|
|
|
Ist ein Artikel noch nicht in der Lagerverwaltung, muss er erst
|
|
|
|
#{link_to("neu angelegt", new_stock_article_path)} werden.
|
|
|
|
%hr/
|
|
|
|
= f.input :delivered_on, as: :date_picker
|
|
|
|
= f.input :note, input_html: {size: '35x4'}
|
|
|
|
.form-actions
|
|
|
|
= f.submit class: 'btn btn-primary'
|
|
|
|
= link_to "oder abbrechen", supplier_deliveries_path(@supplier)
|
2009-05-17 16:11:39 +02:00
|
|
|
|
2013-01-26 15:57:29 +01:00
|
|
|
/
|
|
|
|
TODO: Fix this!!
|
2012-10-17 20:45:52 +02:00
|
|
|
.span6
|
2009-05-17 16:11:39 +02:00
|
|
|
%h2 Neuen Lagerartikel anlegen
|
|
|
|
%p
|
|
|
|
Suche nach Artikeln aus dem
|
|
|
|
%i= @supplier.name
|
|
|
|
Katalog:
|
2011-05-27 14:09:01 +02:00
|
|
|
= text_field_tag 'article_name'
|
2009-05-17 16:11:39 +02:00
|
|
|
%hr/
|
|
|
|
#stock_article_form
|
2012-10-17 20:45:52 +02:00
|
|
|
= render 'stock_article_form', stock_article: @supplier.stock_articles.build
|