Separate columns for article price and unit in delivery form

This commit is contained in:
Julius 2013-07-08 22:19:27 +02:00
parent a6228bdcf2
commit f76b9da1e9
6 changed files with 10 additions and 6 deletions

View file

@ -104,6 +104,7 @@
%th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}} %th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}}
= t '.article' = t '.article'
%th= t '.price' %th= t '.price'
%th= t '.unit'
%th= t '.category' %th= t '.category'
%th= t '.actions' %th= t '.actions'
%tbody %tbody
@ -117,6 +118,7 @@
%th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}} %th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}}
= t '.article' = t '.article'
%th= t '.price' %th= t '.price'
%th= t '.unit'
%th= t '.quantity' %th= t '.quantity'
%th= t '.actions' %th= t '.actions'
%tbody %tbody

View file

@ -1,7 +1,8 @@
- css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( false ) - css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( false )
%tr{:id => "stock_article_#{article.id}", :class => css_class} %tr{:id => "stock_article_#{article.id}", :class => css_class}
%td.sort-by-name= article.name %td.sort-by-name= article.name
%td{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => article})}} #{number_to_currency article.price}/#{article.unit} %td{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => article})}}= number_to_currency article.price
%td= article.unit
%td.sort-by-category= article.article_category.name %td.sort-by-category= article.article_category.name
%td %td
= link_to t('.action_edit'), edit_stock_article_supplier_deliveries_path(@supplier, :stock_article_id => article.id), remote: true, class: 'btn btn-mini' = link_to t('.action_edit'), edit_stock_article_supplier_deliveries_path(@supplier, :stock_article_id => article.id), remote: true, class: 'btn btn-mini'

View file

@ -4,6 +4,7 @@
%td.sort-by-name %td.sort-by-name
%span.stock_article_name= stock_change.stock_article.name %span.stock_article_name= stock_change.stock_article.name
= f.association :stock_article, :as => :hidden = f.association :stock_article, :as => :hidden
%td.price-per-unit{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_article})}} #{number_to_currency stock_article.price}/#{stock_change.stock_article.unit} %td.price{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_article})}}= number_to_currency stock_article.price
%td.unit= stock_change.stock_article.unit
%td= f.input :quantity, :wrapper => :intable, :input_html => {:class => 'stock-change-quantity', :autocomplete => :off} %td= f.input :quantity, :wrapper => :intable, :input_html => {:class => 'stock-change-quantity', :autocomplete => :off}
%td= stock_change_remove_link f %td= stock_change_remove_link f

View file

@ -23,9 +23,7 @@ $('div.container-fluid').prepend(
var stock_change_entry = $('#stock_change_stock_article_<%= @stock_article.id %>'); var stock_change_entry = $('#stock_change_stock_article_<%= @stock_article.id %>');
$('.stock_article_name', stock_change_entry).text('<%= j(@stock_article.name) %>'); $('.stock_article_name', stock_change_entry).text('<%= j(@stock_article.name) %>');
$('.price-per-unit', stock_change_entry).text( $('.unit', stock_change_entry).text('<%= j(number_to_currency(@stock_article.unit)) %>');
'<%= "#{j(number_to_currency(@stock_article.price))}/#{j(number_to_currency(@stock_article.unit))}" %>'
);
stock_change_entry.addClass('success'); stock_change_entry.addClass('success');

View file

@ -434,11 +434,12 @@ de:
category: Kategorie category: Kategorie
create_from_blank: Ohne Vorlage anlegen create_from_blank: Ohne Vorlage anlegen
create_stock_article: Lagerartikel anlegen create_stock_article: Lagerartikel anlegen
price: Preis (netto) price: Nettopreis
quantity: Menge quantity: Menge
title_fill_quantities: 2. Liefermenge angeben title_fill_quantities: 2. Liefermenge angeben
title_finish_delivery: 3. Lieferung abschließen title_finish_delivery: 3. Lieferung abschließen
title_select_stock_articles: 1. Lagerartikel auswählen title_select_stock_articles: 1. Lagerartikel auswählen
unit: Einheit
index: index:
confirm_delete: Bist Du sicher? confirm_delete: Bist Du sicher?
new_delivery: Neue Lieferung für %{supplier} anlegen new_delivery: Neue Lieferung für %{supplier} anlegen

View file

@ -441,6 +441,7 @@ en:
title_fill_quantities: 2. Set delivery quantities title_fill_quantities: 2. Set delivery quantities
title_finish_delivery: 3. Finish delivery title_finish_delivery: 3. Finish delivery
title_select_stock_articles: 1. Select stock articles title_select_stock_articles: 1. Select stock articles
unit: Unit
index: index:
confirm_delete: Are you sure? confirm_delete: Are you sure?
new_delivery: ! 'Create new delivery for %{supplier} ' new_delivery: ! 'Create new delivery for %{supplier} '