Merge branch 'master' into updated-gems
Conflicts: Gemfile Gemfile.lock
This commit is contained in:
commit
bdce1b5872
64 changed files with 1039 additions and 472 deletions
|
|
@ -1,4 +1,4 @@
|
|||
- title 'Artikel mit externer Datenbank synchronisieren'
|
||||
- title t('.title')
|
||||
|
||||
= form_tag update_synchronized_supplier_articles_path(@supplier) do
|
||||
%h2= t '.outlist.title'
|
||||
|
|
@ -19,9 +19,8 @@
|
|||
%h2= t '.update.title'
|
||||
%p
|
||||
%i
|
||||
%b= @updated_articles.size
|
||||
= t '.update.update_msg'
|
||||
= t('.update.body').html_safe
|
||||
= t '.update.update_msg', count: @updated_articles.size
|
||||
= t '.update.body'
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
|
|
|
|||
|
|
@ -5,21 +5,19 @@
|
|||
|
||||
$('#stock_changes tr').removeClass('success');
|
||||
|
||||
var quantity = w.prompt('<%= j(t('.how_many_units', :unit => @stock_change.stock_article.unit, :name => @stock_change.stock_article.name)) %>');
|
||||
if(null === quantity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var stock_change = $(
|
||||
'<%= j(render(:partial => 'stock_change', :locals => {:stock_change => @stock_change})) %>'
|
||||
).addClass('success');
|
||||
enablePriceTooltips(stock_change);
|
||||
$('input.stock-change-quantity', stock_change).val(quantity);
|
||||
|
||||
$('#stock_changes').append(stock_change);
|
||||
mark_article_for_delivery(<%= @stock_change.stock_article.id %>);
|
||||
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? %>
|
||||
if(null === quantity) {
|
||||
stock_change.remove();
|
||||
mark_article_for_delivery(<%= @stock_change.stock_article.id %>);
|
||||
return false;
|
||||
}
|
||||
$('input.stock-change-quantity', stock_change).val(quantity);
|
||||
|
||||
})(window);
|
||||
|
|
|
|||
|
|
@ -7,12 +7,17 @@
|
|||
setMinimumBalance(#{FoodsoftConfig[:minimum_balance] or 0});
|
||||
setToleranceBehaviour(#{FoodsoftConfig[:tolerance_is_costly]});
|
||||
setStockit(#{@order.stockit?});
|
||||
// create List for search-feature (using list.js, http://listjs.com)
|
||||
var listjsResetPlugin = ['reset', {highlightClass: 'btn-primary'}];
|
||||
var listjsDelayPlugin = ['delay', {delayedSearchTime: 500}];
|
||||
new List(document.body, { valueNames: ['name'], engine: 'unlist', plugins: [listjsResetPlugin, listjsDelayPlugin] });
|
||||
});
|
||||
|
||||
- title t('.title'), false
|
||||
|
||||
.row-fluid
|
||||
.well.pull-left
|
||||
%button{type: "button", class: "close", data: {dismiss: 'alert'}}= '×'.html_safe
|
||||
%h2= @order.name
|
||||
%dl.dl-horizontal
|
||||
- unless @order.note.blank?
|
||||
|
|
@ -35,8 +40,17 @@
|
|||
%dd= number_to_currency(@ordering_data[:available_funds])
|
||||
|
||||
.well.pull-right
|
||||
%button{type: "button", class: "close", data: {dismiss: 'alert'}}= '×'.html_safe
|
||||
= render 'switch_order', current_order: @order
|
||||
|
||||
.row-fluid
|
||||
.well.clear
|
||||
.form-search
|
||||
.input-append
|
||||
= text_field_tag :article, params[:article], placeholder: t('.search_article'), class: 'search-query delayed-search resettable'
|
||||
%button.add-on.btn.reset-search{:type => :button, :title => t('.reset_article_search')}
|
||||
%i.icon.icon-remove
|
||||
|
||||
= form_for @group_order do |f|
|
||||
= f.hidden_field :lock_version
|
||||
= f.hidden_field :order_id
|
||||
|
|
@ -59,9 +73,9 @@
|
|||
%th(style="width:20px")= t '.available'
|
||||
%th#col_required= t '.amount'
|
||||
%th{style: "width:15px;"}= t '.sum'
|
||||
%tbody
|
||||
%tbody.list
|
||||
- @order.articles_grouped_by_category.each do |category, order_articles|
|
||||
%tr.article-category
|
||||
%tr.list-heading.article-category
|
||||
%td
|
||||
= category
|
||||
%i.icon-tag
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@
|
|||
= form.hidden_field :group_id
|
||||
= form.input :email
|
||||
= form.submit t('.action')
|
||||
= link_to t('.back'), :back
|
||||
= link_to t('ui.or_cancel'), :back
|
||||
|
|
|
|||
|
|
@ -27,10 +27,14 @@
|
|||
= category_name
|
||||
%i.icon-tag
|
||||
- for article in articles
|
||||
/ check if the article is selected
|
||||
- included = @order.article_ids.include?(article.id)
|
||||
- included_class = included ? ' selected' : ''
|
||||
%tr{:class => included_class, :id => article.id.to_s }
|
||||
/ check if the article is selected or has an error
|
||||
- included = @order.article_ids.include?(article.id.to_s)
|
||||
- row_class = ''
|
||||
- if included
|
||||
- row_class = 'selected'
|
||||
- elsif @order.erroneous_article_ids.include?(article.id)
|
||||
- row_class = 'error'
|
||||
%tr{class: row_class, id: article.id}
|
||||
%td= check_box_tag "order[article_ids][]", article.id, included, :id => "checkbox_#{article.id}"
|
||||
%td.click-me{'data-check-this' => "#checkbox_#{article.id}"}= article.name
|
||||
%td=h truncate article.note, :length => 25
|
||||
|
|
@ -52,3 +56,7 @@
|
|||
.form-actions
|
||||
= f.submit class: 'btn'
|
||||
= link_to t('ui.or_cancel'), orders_path
|
||||
- unless @order.erroneous_article_ids.empty?
|
||||
|
||||
= check_box_tag 'order[ignore_warnings]'
|
||||
= t '.ignore_warnings'
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
%thead
|
||||
%tr
|
||||
%th{:style => 'width:70%'}= t '.ordergroup'
|
||||
%th= t '.ordered'
|
||||
%th= t '.received'
|
||||
%th
|
||||
%acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered'
|
||||
%th
|
||||
%acronym{:title => t('shared.articles.received_desc')}= t 'shared.articles.received'
|
||||
%th= t '.price'
|
||||
|
||||
- for order_article in order.order_articles.ordered.all(:include => [:article, :article_price])
|
||||
|
|
@ -13,8 +15,8 @@
|
|||
= order_article.article.name
|
||||
= "(#{order_article.article.unit} | #{order_article.price.unit_quantity} | #{number_to_currency(order_article.price.gross_price)})"
|
||||
%tbody
|
||||
- for goa in order_article.group_order_articles
|
||||
%tr{:class => cycle('even', 'odd', :name => 'groups')}
|
||||
- for goa in order_article.group_order_articles.ordered
|
||||
%tr{:class => [cycle('even', 'odd', :name => 'groups'), if goa.result == 0 then 'unavailable' end]}
|
||||
%td{:style => "width:70%"}=h goa.group_order.ordergroup.name
|
||||
%td= "#{goa.quantity} + #{goa.tolerance}"
|
||||
%td
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
%tr
|
||||
%th{:style => "width:40%"}= t '.name'
|
||||
%th
|
||||
%acronym{:title => t('.units_desc')}= t '.units'
|
||||
%acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered'
|
||||
%th
|
||||
%acronym{:title => t('shared.articles.received_desc')}= t 'shared.articles.received'
|
||||
%th
|
||||
%acronym{:title => t('.fc_price_desc')}= t '.fc_price'
|
||||
%th
|
||||
|
|
@ -11,10 +13,10 @@
|
|||
%th= t '.unit'
|
||||
%th= t '.price'
|
||||
|
||||
- for group_order in order.group_orders.all
|
||||
- for group_order in order.group_orders.ordered
|
||||
%thead
|
||||
%tr
|
||||
%th{:colspan => "6"}
|
||||
%th{:colspan => "7"}
|
||||
%h4= group_order.ordergroup.name
|
||||
%tbody
|
||||
- total = 0
|
||||
|
|
@ -22,17 +24,19 @@
|
|||
- fc_price = goa.order_article.price.fc_price
|
||||
- subTotal = fc_price * goa.result
|
||||
- total += subTotal
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles')}
|
||||
%tr{:class => [cycle('even', 'odd', :name => 'articles'), if goa.result == 0 then 'unavailable' end]}
|
||||
%td{:style => "width:40%"}=h goa.order_article.article.name
|
||||
%td= goa.result
|
||||
%td= "#{goa.quantity} + #{goa.tolerance}"
|
||||
%td
|
||||
%b= goa.result
|
||||
%td= number_to_currency(fc_price)
|
||||
%td= goa.order_article.price.unit_quantity
|
||||
%td= goa.order_article.article.unit
|
||||
%td= number_to_currency(subTotal)
|
||||
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles')}
|
||||
%th{:colspan => "5"} Summe
|
||||
%th{:colspan => "6"} Summe
|
||||
%th= number_to_currency(total)
|
||||
%tr
|
||||
%th(colspan="6")
|
||||
%th(colspan="7")
|
||||
- reset_cycle("articles")
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@
|
|||
= form.hidden_field :stock_article_id
|
||||
= "Menge (#{stock_change.stock_article.quantity_available})"
|
||||
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
|
||||
%b= stock_change.stock_article.name
|
||||
= "(#{number_to_currency(stock_change.stock_article.price)} / #{stock_change.stock_article.unit})"
|
||||
%span{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_change.stock_article})}}
|
||||
%b= stock_change.stock_article.name
|
||||
= "(#{number_to_currency(stock_change.stock_article.price)} / #{stock_change.stock_article.unit})"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
- title t('.title')
|
||||
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
$(function() {
|
||||
enablePriceTooltips();
|
||||
});
|
||||
|
||||
function enablePriceTooltips(context) {
|
||||
$('[data-toggle~="tooltip"]', context).tooltip({
|
||||
animation: false,
|
||||
html: true,
|
||||
placement: 'left',
|
||||
container: 'body'
|
||||
});
|
||||
}
|
||||
|
||||
- content_for :sidebar do
|
||||
%p
|
||||
%i= t('.text_deviations', inv_link: link_to(t('.temp_inventory'), stock_articles_path)).html_safe
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
- title t('.stock_changes', :article_name => @stock_article.name)
|
||||
|
||||
%table.table.table-hover#stock_changes
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.datetime'
|
||||
%th= t '.reason'
|
||||
%th= t '.change_quantity'
|
||||
%th= t '.new_quantity'
|
||||
%tbody
|
||||
- reversed_history = @stock_article.quantity_history.reverse
|
||||
- @stock_changes.each_with_index do |stock_change, index|
|
||||
%tr
|
||||
%td= l stock_change.created_at
|
||||
%td= link_to_stock_change_reason(stock_change)
|
||||
%td= stock_change.quantity
|
||||
%td= reversed_history[index]
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
%tbody
|
||||
- for article in @stock_articles
|
||||
%tr{:class => stock_article_classes(article), :id => "stockArticle-#{article.id}"}
|
||||
%td=h article.name
|
||||
%td= link_to article.name, article
|
||||
%td= article.quantity
|
||||
%td= article.quantity - article.quantity_available
|
||||
%th= article.quantity_available
|
||||
|
|
@ -56,7 +56,6 @@
|
|||
%td= article.article_category.name
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini'
|
||||
= link_to t('ui.history'), stock_article_history_path(article), class: 'btn btn-mini'
|
||||
= link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'),
|
||||
class: 'btn btn-mini btn-danger', :remote => true
|
||||
%p
|
||||
|
|
|
|||
47
app/views/stockit/show.html.haml
Normal file
47
app/views/stockit/show.html.haml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
- title @stock_article.name
|
||||
|
||||
.row-fluid
|
||||
.span6
|
||||
%dl.dl-horizontal
|
||||
%dt= StockArticle.human_attribute_name 'supplier'
|
||||
%dd= link_to @stock_article.supplier.name, @stock_article.supplier
|
||||
%dt= StockArticle.human_attribute_name 'name'
|
||||
%dd= @stock_article.name
|
||||
%dt= StockArticle.human_attribute_name 'unit'
|
||||
%dd= @stock_article.unit
|
||||
%dt= StockArticle.human_attribute_name 'price'
|
||||
%dd= number_to_currency @stock_article.price
|
||||
%dt= StockArticle.human_attribute_name 'tax'
|
||||
%dd= number_to_percentage @stock_article.tax
|
||||
%dt= StockArticle.human_attribute_name 'deposit'
|
||||
%dd= number_to_currency @stock_article.deposit
|
||||
%dt= StockArticle.human_attribute_name 'fc_price'
|
||||
%dd= number_to_currency @stock_article.fc_price
|
||||
%dt= StockArticle.human_attribute_name 'article_category'
|
||||
%dd= @stock_article.article_category.name
|
||||
%dt= StockArticle.human_attribute_name 'note'
|
||||
%dd= @stock_article.note
|
||||
%dt= StockArticle.human_attribute_name 'quantity'
|
||||
%dd= @stock_article.quantity
|
||||
%dt= StockArticle.human_attribute_name 'quantity_available'
|
||||
%dd= @stock_article.quantity_available
|
||||
.form-actions
|
||||
= link_to t('ui.edit'), edit_stock_article_path(@stock_article), class: 'btn'
|
||||
|
||||
.span6
|
||||
%h2= t('.stock_changes')
|
||||
%table.table.table-hover#stock_changes
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.datetime'
|
||||
%th= t '.reason'
|
||||
%th= t '.change_quantity'
|
||||
%th= t '.new_quantity'
|
||||
%tbody
|
||||
- reversed_history = @stock_article.quantity_history.reverse
|
||||
- @stock_changes.each_with_index do |stock_change, index|
|
||||
%tr
|
||||
%td= l stock_change.created_at
|
||||
%td= link_to_stock_change_reason(stock_change)
|
||||
%td= stock_change.quantity
|
||||
%td= reversed_history[index]
|
||||
Loading…
Add table
Add a link
Reference in a new issue