Separate columns for article price and unit in delivery form
This commit is contained in:
parent
a6228bdcf2
commit
f76b9da1e9
6 changed files with 10 additions and 6 deletions
|
|
@ -104,6 +104,7 @@
|
|||
%th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}}
|
||||
= t '.article'
|
||||
%th= t '.price'
|
||||
%th= t '.unit'
|
||||
%th= t '.category'
|
||||
%th= t '.actions'
|
||||
%tbody
|
||||
|
|
@ -117,6 +118,7 @@
|
|||
%th.dom-sort-triggerer.default-sort{:data => {'compare-function' => 'compareText', 'sort-criterion' => 'sort-by-name'}}
|
||||
= t '.article'
|
||||
%th= t '.price'
|
||||
%th= t '.unit'
|
||||
%th= t '.quantity'
|
||||
%th= t '.actions'
|
||||
%tbody
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
- css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( false )
|
||||
%tr{:id => "stock_article_#{article.id}", :class => css_class}
|
||||
%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
|
||||
= link_to t('.action_edit'), edit_stock_article_supplier_deliveries_path(@supplier, :stock_article_id => article.id), remote: true, class: 'btn btn-mini'
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
%td.sort-by-name
|
||||
%span.stock_article_name= stock_change.stock_article.name
|
||||
= 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= stock_change_remove_link f
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ $('div.container-fluid').prepend(
|
|||
|
||||
var stock_change_entry = $('#stock_change_stock_article_<%= @stock_article.id %>');
|
||||
$('.stock_article_name', stock_change_entry).text('<%= j(@stock_article.name) %>');
|
||||
$('.price-per-unit', stock_change_entry).text(
|
||||
'<%= "#{j(number_to_currency(@stock_article.price))}/#{j(number_to_currency(@stock_article.unit))}" %>'
|
||||
);
|
||||
$('.unit', stock_change_entry).text('<%= j(number_to_currency(@stock_article.unit)) %>');
|
||||
|
||||
stock_change_entry.addClass('success');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue