Refactoring of delivery-workflow. Added ability to add stock_changes after creating a delivery.
This commit is contained in:
parent
43fc7b06f8
commit
a8e35bd421
7 changed files with 66 additions and 101 deletions
|
|
@ -1,42 +1,3 @@
|
|||
- title "Neue Lieferung von #{@supplier.name}"
|
||||
|
||||
.left_column
|
||||
- form_for([@supplier,@delivery]) do |f|
|
||||
.box_title
|
||||
%h2 Lieferung anlegen
|
||||
.column_content
|
||||
= f.error_messages
|
||||
= f.hidden_field :supplier_id
|
||||
%p
|
||||
%b= f.label :delivered_on
|
||||
= f.date_select :delivered_on
|
||||
%h2 Lagerartikel des Lieferanten
|
||||
#stock_changes
|
||||
= render :partial => 'stock_change', :collection => @delivery.stock_changes
|
||||
%p
|
||||
= f.submit "Lieferung anlegen"
|
||||
|
||||
.right_column{:style => "width:35em;"}
|
||||
.box_title
|
||||
%h2 Neuen Lagerartikel anlegen
|
||||
.column_content
|
||||
%p
|
||||
:javascript
|
||||
function fillNewStockArticle(text, li) {
|
||||
new Ajax.Updater('stock_article_form', '/deliveries/fill_new_stock_article_form', {
|
||||
method: 'get',
|
||||
parameters: {article_id: li.id}
|
||||
});
|
||||
}
|
||||
Suche nach Artikeln aus dem
|
||||
%i= @supplier.name
|
||||
Katalog:
|
||||
= text_field_with_auto_complete :article, :name, {}, |
|
||||
{:url => {:controller => 'stockit', :action => 'auto_complete_for_article_name', :supplier_id => @supplier.id}, |
|
||||
:after_update_element => 'fillNewStockArticle', :method => :get} |
|
||||
%hr/
|
||||
#stock_article_form
|
||||
= render :partial => 'stock_article_form', :locals => {:stock_article => @supplier.stock_articles.build}
|
||||
|
||||
%p{:style => "clear:both"}
|
||||
= link_to 'Zurück', supplier_deliveries_path(@supplier)
|
||||
= render :partial => 'form'
|
||||
Loading…
Add table
Add a link
Reference in a new issue