2013-09-10 10:27:13 +02:00
|
|
|
- title t('.title', article_count: StockArticle.available.count)
|
2012-10-29 18:28:17 +01:00
|
|
|
- content_for :javascript do
|
2011-05-27 14:09:01 +02:00
|
|
|
:javascript
|
|
|
|
$(function() {
|
|
|
|
$('tr.unavailable').hide();
|
2013-12-07 11:20:03 +01:00
|
|
|
|
|
|
|
// Subscribe to database changes.
|
|
|
|
// See publish/subscribe design pattern in /doc.
|
|
|
|
$(document).on('StockArticle#create', function(e) {
|
|
|
|
$.ajax({
|
|
|
|
url: '#{index_on_stock_article_create_stock_articles_path}',
|
|
|
|
type: 'get',
|
|
|
|
data: {id: e.stock_article_id},
|
|
|
|
contentType: 'application/json; charset=UTF-8'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).on('StockArticle#destroy', function(e) {
|
|
|
|
$('#stockArticle-' + e.stock_article_id).remove();
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).on('StockArticle#update', function(e) {
|
|
|
|
$.ajax({
|
|
|
|
url: '#{index_on_stock_article_update_stock_articles_path}',
|
|
|
|
type: 'get',
|
|
|
|
data: {id: e.stock_article_id},
|
|
|
|
contentType: 'application/json; charset=UTF-8'
|
|
|
|
});
|
|
|
|
});
|
2011-05-27 14:09:01 +02:00
|
|
|
})
|
2012-10-29 18:28:17 +01:00
|
|
|
|
|
|
|
.well.well-small
|
|
|
|
.btn-toolbar
|
|
|
|
.btn-group.pull-right
|
|
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
2013-02-11 11:19:26 +01:00
|
|
|
= t '.view_options'
|
2012-10-29 18:28:17 +01:00
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
2013-02-11 11:19:26 +01:00
|
|
|
%li= link_to t('.toggle_unavailable'), "#", 'data-toggle-this' => 'tr.unavailable', tabindex: -1
|
2009-10-17 20:33:36 +02:00
|
|
|
|
2012-10-29 18:28:17 +01:00
|
|
|
.btn-group
|
2020-08-13 16:23:01 +02:00
|
|
|
= link_to_if @current_user.role_orders?, t('.order_online'), new_order_path(supplier_id: nil),
|
2013-01-26 15:57:29 +01:00
|
|
|
class: 'btn', class: 'btn btn-primary'
|
2013-12-07 11:20:03 +01:00
|
|
|
= link_to t('.new_stock_article'), new_stock_article_path, remote: true, class: 'btn'
|
2013-02-11 11:19:26 +01:00
|
|
|
= link_to t('.new_stock_taking'), new_stock_taking_path, class: 'btn'
|
|
|
|
= link_to t('.show_stock_takings'), stock_takings_path, class: 'btn'
|
2009-10-17 20:33:36 +02:00
|
|
|
|
2012-10-29 18:28:17 +01:00
|
|
|
.btn-group
|
|
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
2013-02-11 11:19:26 +01:00
|
|
|
= t '.new_delivery'
|
2012-10-29 18:28:17 +01:00
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
2020-04-10 23:59:06 +02:00
|
|
|
- Supplier.order(:name).each do |supplier|
|
2012-10-29 18:28:17 +01:00
|
|
|
%li= link_to supplier.name, new_supplier_delivery_path(supplier), tabindex: -1
|
2009-02-11 18:09:04 +01:00
|
|
|
|
2012-10-29 18:28:17 +01:00
|
|
|
%table.table.table-hover#articles
|
|
|
|
%thead
|
|
|
|
%tr
|
2013-12-06 22:43:36 +01:00
|
|
|
%th= Article.model_name.human
|
|
|
|
%th= heading_helper StockArticle, :quantity
|
|
|
|
%th= heading_helper StockArticle, :quantity_ordered
|
|
|
|
%th= heading_helper StockArticle, :available
|
|
|
|
%th= heading_helper StockArticle, :unit
|
|
|
|
%th= heading_helper StockArticle, :price
|
|
|
|
%th= heading_helper StockArticle, :tax
|
|
|
|
%th= heading_helper StockArticle, :supplier
|
|
|
|
%th= heading_helper StockArticle, :article_category
|
2012-10-29 18:28:17 +01:00
|
|
|
%th
|
2013-12-07 11:20:03 +01:00
|
|
|
%tbody#articles-tbody
|
|
|
|
- for stock_article in @stock_articles
|
|
|
|
= render :partial => 'stock_article', :locals => {:stock_article => stock_article}
|
2012-10-29 18:28:17 +01:00
|
|
|
%p
|
2013-02-11 11:19:26 +01:00
|
|
|
= t '.stock_worth'
|
2012-10-29 18:28:17 +01:00
|
|
|
= number_to_currency StockArticle.stock_value
|
|
|
|
|
|
2013-02-11 11:19:26 +01:00
|
|
|
=t '.stock_count'
|
2012-10-29 18:28:17 +01:00
|
|
|
= StockArticle.available.count
|
2009-02-11 18:09:04 +01:00
|
|
|
|