Merge branch 'master' into fresh-flow
Conflicts: app/assets/stylesheets/bootstrap_and_overrides.css.less
This commit is contained in:
commit
2b511ee559
96 changed files with 1389 additions and 1556 deletions
|
|
@ -4,11 +4,11 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.name'
|
||||
%th= t '.contact'
|
||||
%th= t '.address'
|
||||
%th= t '.members'
|
||||
%th= t 'admin.actions'
|
||||
%th= heading_helper Ordergroup, :name
|
||||
%th= heading_helper Ordergroup, :contact
|
||||
%th= heading_helper Ordergroup, :contact_address
|
||||
%th= heading_helper Ordergroup, :user_tokens
|
||||
%th= t 'ui.actions'
|
||||
%tbody
|
||||
- for ordergroup in @ordergroups
|
||||
%tr{:class => cycle('even','odd', :name => 'groups')}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
%thead
|
||||
%tr
|
||||
- if FoodsoftConfig[:use_nick]
|
||||
%th= t '.login'
|
||||
%th= t '.name'
|
||||
%th= t '.email'
|
||||
%th= heading_helper User, :nick
|
||||
%th= heading_helper User, :name
|
||||
%th= heading_helper User, :email
|
||||
%th= t 'admin.access_to'
|
||||
%th= t '.last_login'
|
||||
%th(colspan="2")= t 'admin.actions'
|
||||
%th= heading_helper User, :last_login
|
||||
%th(colspan="2")= t 'ui.actions'
|
||||
%tbody
|
||||
- for user in @users
|
||||
%tr
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
%p= t '.member_since', time: distance_of_time_in_words(Time.now, @user.created_on)
|
||||
%dl
|
||||
- if FoodsoftConfig[:use_nick]
|
||||
%dt= t '.nick'
|
||||
%dt= heading_helper User, :nick
|
||||
%dd= @user.nick
|
||||
%dt= t '.name'
|
||||
%dt= heading_helper User, :name
|
||||
%dd= h @user.name
|
||||
%dt= t '.email'
|
||||
%dt= heading_helper User, :email
|
||||
%dd= @user.email
|
||||
%dt= t '.phone'
|
||||
%dt= heading_helper User, :phone
|
||||
%dd= @user.phone
|
||||
%dt= t 'admin.access_to'
|
||||
%dd= format_roles(@user)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
%th= t '.name'
|
||||
%th= t '.members'
|
||||
%th= t 'admin.access_to'
|
||||
%th= t 'admin.actions'
|
||||
%th= t 'ui.actions'
|
||||
%tbody
|
||||
- for workgroup in @workgroups
|
||||
%tr
|
||||
|
|
|
|||
|
|
@ -3,24 +3,55 @@
|
|||
= f.hidden_field :supplier_id
|
||||
.modal-header
|
||||
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
|
||||
%h3= t '.title'
|
||||
%h3= @article.new_record? ? t('.title_new') : t('.title_edit')
|
||||
.modal-body
|
||||
= f.input :availability
|
||||
= f.input :name
|
||||
= f.input :origin
|
||||
= f.input :manufacturer
|
||||
= f.input :unit
|
||||
.fold-line
|
||||
= f.input :unit_quantity, label: Article.human_attribute_name(:unit),
|
||||
input_html: {class: 'input-mini', title: Article.human_attribute_name(:unit_quantity)}
|
||||
= f.input :unit, label: '×'.html_safe,
|
||||
input_html: {class: 'input-mini', title: Article.human_attribute_name(:unit)}
|
||||
|
||||
= f.input :note
|
||||
= f.association :article_category
|
||||
/ TODO labels
|
||||
|
||||
= f.input :price
|
||||
= f.input :unit_quantity
|
||||
.fold-line
|
||||
= f.input :price do
|
||||
.input-prepend
|
||||
%span.add-on= t 'number.currency.format.unit'
|
||||
= f.input_field :price, class: 'input-mini'
|
||||
= f.input :tax do
|
||||
.input-append
|
||||
= f.input_field :tax, class: 'input-mini'
|
||||
%span.add-on %
|
||||
.fold-line
|
||||
= f.input :deposit do
|
||||
.input-prepend
|
||||
%span.add-on= t 'number.currency.format.unit'
|
||||
= f.input_field :deposit, class: 'input-mini'
|
||||
.control-group
|
||||
%label.control-label{for: 'article_fc_price'}
|
||||
= Article.human_attribute_name(:fc_price)
|
||||
.controls.control-text#article_fc_price
|
||||
= number_to_currency(@article.fc_price) rescue nil
|
||||
|
||||
= f.input :origin
|
||||
= f.input :manufacturer
|
||||
= f.input :order_number
|
||||
= f.input :tax, :wrapper => :append do
|
||||
= f.input_field :tax
|
||||
%span.add-on %
|
||||
= f.input :deposit
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= f.submit class: 'btn btn-primary'
|
||||
|
||||
:javascript
|
||||
var form = $('form.edit_article, form.new_article');
|
||||
$('#article_price, #article_tax, #article_deposit', form).on('change keyup', function() {
|
||||
var price = parseFloat($('#article_price', form).val());
|
||||
var tax = parseFloat($('#article_tax', form).val());
|
||||
var deposit = parseFloat($('#article_deposit', form).val());
|
||||
// Article#gross_price and Article#fc_price
|
||||
var gross_price = (price + deposit) * (tax / 100 + 1);
|
||||
var fc_price = gross_price * (#{FoodsoftConfig[:price_markup].to_f} / 100 + 1);
|
||||
$('#article_fc_price').html($.isNumeric(fc_price) ? I18n.l("currency", fc_price) : '…');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@
|
|||
}
|
||||
if('new' == selectedArticle.id) {
|
||||
$.ajax({
|
||||
url: '#{new_stock_article_supplier_deliveries_path(@supplier)}',
|
||||
url: '#{new_stock_article_path}',
|
||||
type: 'get',
|
||||
data: {stock_article: {name: selectedArticle.text}},
|
||||
data: {stock_article: {name: selectedArticle.text, supplier_id: #{@supplier.id}}},
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
$('#new_stock_article').select2('data', null);
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
}
|
||||
if('' != selectedArticle.id) {
|
||||
$.ajax({
|
||||
url: '#{derive_stock_article_supplier_deliveries_path(@supplier)}',
|
||||
url: '#{derive_stock_articles_path}',
|
||||
type: 'get',
|
||||
data: {old_article_id: selectedArticle.id},
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
|
|
@ -61,6 +61,26 @@
|
|||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// Subscribe to database changes.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
$(document).on('StockArticle#create', function(e) {
|
||||
$.ajax({
|
||||
url: '#{form_on_stock_article_create_supplier_deliveries_path(@supplier)}',
|
||||
type: 'get',
|
||||
data: {id: e.stock_article_id},
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('StockArticle#update', function(e) {
|
||||
$.ajax({
|
||||
url: '#{form_on_stock_article_update_supplier_deliveries_path(@supplier)}',
|
||||
type: 'get',
|
||||
data: {id: e.stock_article_id},
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function mark_article_for_delivery(stock_article_id) {
|
||||
|
|
@ -87,16 +107,16 @@
|
|||
%table#stock_articles_for_adding.table.table-hover.stupidtable
|
||||
%thead
|
||||
%tr
|
||||
%th.default-sort{:data => {:sort => 'string'}}= t '.article'
|
||||
%th= t '.price'
|
||||
%th= t '.unit'
|
||||
%th= t '.category'
|
||||
%th= t '.actions'
|
||||
%th.default-sort{:data => {:sort => 'string'}}= Article.model_name.human
|
||||
%th= heading_helper StockArticle, :price
|
||||
%th= heading_helper StockArticle, :unit
|
||||
%th= heading_helper StockArticle, :article_category
|
||||
%th= t 'ui.actions'
|
||||
%tfoot
|
||||
%tr
|
||||
%th{:colspan => 5}
|
||||
- if articles_for_select2(@supplier).empty?
|
||||
= link_to t('.create_stock_article'), new_stock_article_supplier_deliveries_path(@supplier), :remote => true, :class => 'btn'
|
||||
= link_to t('.create_stock_article'), new_stock_article_path, :remote => true, :class => 'btn'
|
||||
- else
|
||||
%input#new_stock_article{:style => 'width: 500px;'}
|
||||
%tbody
|
||||
|
|
@ -107,11 +127,11 @@
|
|||
%table.table#stock_changes.stupidtable
|
||||
%thead
|
||||
%tr
|
||||
%th.default-sort{:data => {:sort => 'string'}}= t '.article'
|
||||
%th= t '.price'
|
||||
%th= t '.unit'
|
||||
%th= t '.quantity'
|
||||
%th= t '.actions'
|
||||
%th.default-sort{:data => {:sort => 'string'}}= Article.model_name.human
|
||||
%th= heading_helper StockArticle, :price
|
||||
%th= heading_helper StockArticle, :unit
|
||||
%th= heading_helper GroupOrderArticle, :quantity # quantity to order, although technically this will be a StockChange
|
||||
%th= t 'ui.actions'
|
||||
%tbody
|
||||
= f.simple_fields_for :stock_changes do |stock_change_form|
|
||||
= render :partial => 'stock_change_fields', :locals => {:f => stock_change_form}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
- css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( false )
|
||||
- disable_delivery_action = ( @delivery and @delivery.includes_article? article )
|
||||
- css_class = ( disable_delivery_action ) ? ( 'unavailable' ) : ( false )
|
||||
- deliver_button_disabled = ( disable_delivery_action ) ? ( 'disabled' ) : ( false )
|
||||
|
||||
%tr{:id => "stock_article_#{article.id}", :class => css_class}
|
||||
%td= article.name
|
||||
%td{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => article})}}= number_to_currency article.price
|
||||
%td= article.unit
|
||||
%td= 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'
|
||||
= link_to t('.action_other_price'), copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => article.id), remote: true, class: 'btn btn-mini'
|
||||
- deliver_button_disabled = ( @delivery and @delivery.includes_article? article ) ? ( 'disabled' ) : ( false )
|
||||
= link_to t('.action_edit'), edit_stock_article_path(article), remote: true, class: 'btn btn-mini'
|
||||
= link_to t('.action_other_price'), stock_article_copy_path(article), remote: true, class: 'btn btn-mini'
|
||||
= link_to t('.action_add_to_delivery'), add_stock_change_supplier_deliveries_path(@supplier, :stock_article_id => article.id), :method => :post, remote: true, class: 'button-add-stock-change btn btn-mini btn-primary', disabled: deliver_button_disabled
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
- url = ( stock_article.new_record? ) ? ( create_stock_article_supplier_deliveries_path(@supplier) ) : ( update_stock_article_supplier_deliveries_path(@supplier) )
|
||||
= simple_form_for stock_article, url: url, remote: true, validate: true do |f|
|
||||
= f.association :supplier, :as => :hidden
|
||||
= f.hidden_field :id unless stock_article.new_record?
|
||||
.modal-header
|
||||
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
|
||||
%h3= t 'activerecord.models.stock_article'
|
||||
.modal-body
|
||||
= f.input :name
|
||||
= f.input :unit
|
||||
= f.input :note
|
||||
- if stock_article.new_record?
|
||||
= f.input :price
|
||||
= f.input :tax, :wrapper => :append do
|
||||
= f.input_field :tax
|
||||
%span.add-on %
|
||||
= f.input :deposit
|
||||
- else
|
||||
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article)
|
||||
= f.association :article_category
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= f.submit :class => 'btn btn-primary', 'data-disable-with' => t('ui.please_wait')
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
$('#modalContainer').html(
|
||||
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
|
||||
);
|
||||
|
||||
$('#modalContainer').modal();
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
$('div.container-fluid').prepend(
|
||||
'<%= j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.notice', :name => @stock_article.name)})) %>'
|
||||
);
|
||||
|
||||
(function() {
|
||||
$('#stock_articles_for_adding tr').removeClass('success');
|
||||
|
||||
var stock_article_for_adding = $(
|
||||
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>'
|
||||
).addClass('success');
|
||||
|
||||
$('#stock_articles_for_adding tbody').append(stock_article_for_adding);
|
||||
updateSort('#stock_articles_for_adding');
|
||||
})();
|
||||
|
||||
$('#modalContainer').modal('hide');
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
$('#modalContainer').html(
|
||||
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
|
||||
);
|
||||
|
||||
$('#modalContainer').modal();
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
$('#modalContainer').html(
|
||||
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
|
||||
);
|
||||
|
||||
$('#modalContainer').modal();
|
||||
31
app/views/deliveries/form_on_stock_article_create.js.erb
Normal file
31
app/views/deliveries/form_on_stock_article_create.js.erb
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Handle more advanced DOM update after AJAX database manipulation.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
(function(w) {
|
||||
|
||||
$('#stock_articles_for_adding tr').removeClass('success');
|
||||
|
||||
if(<%= @supplier.id != @stock_article.supplier.id %>) {
|
||||
// the stock_article does _NOT_ belong to the current supplier
|
||||
var try_again = w.confirm('<%= j(
|
||||
t('deliveries.form.confirm_foreign_supplier_reedit', :name => @stock_article.name)
|
||||
) %>');
|
||||
|
||||
if(try_again) {
|
||||
$.ajax({
|
||||
url: '<%= j edit_stock_article_path(@stock_article) %>',
|
||||
type: 'get',
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// the stock_article _DOES_ belong to the current supplier
|
||||
var stock_article_for_adding = $(
|
||||
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>'
|
||||
).addClass('success');
|
||||
|
||||
$('#stock_articles_for_adding tbody').append(stock_article_for_adding);
|
||||
updateSort('#stock_articles_for_adding');
|
||||
})(window);
|
||||
47
app/views/deliveries/form_on_stock_article_update.js.erb
Normal file
47
app/views/deliveries/form_on_stock_article_update.js.erb
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// Handle more advanced DOM update after AJAX database manipulation.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
(function(w) {
|
||||
// update entry in stock_article table
|
||||
|
||||
$('#stock_articles_for_adding tr').removeClass('success');
|
||||
|
||||
$('#stock_article_<%= @stock_article.id %>').remove();
|
||||
|
||||
if(<%= @supplier.id != @stock_article.supplier.id %>) {
|
||||
// the stock_article does _NOT_ belong to the current supplier
|
||||
var try_again = w.confirm('<%= j(
|
||||
t('deliveries.form.confirm_foreign_supplier_reedit', :name => @stock_article.name)
|
||||
) %>');
|
||||
|
||||
if(try_again) {
|
||||
$.ajax({
|
||||
url: '<%= j edit_stock_article_path(@stock_article) %>',
|
||||
type: 'get',
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
// the stock_article _DOES_ belong to the current supplier
|
||||
var stock_article_for_adding = $(
|
||||
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>'
|
||||
).addClass('success');
|
||||
|
||||
$('#stock_articles_for_adding tbody').append(stock_article_for_adding);
|
||||
updateSort('#stock_articles_for_adding');
|
||||
}
|
||||
|
||||
mark_article_for_delivery(<%= @stock_article.id %>);
|
||||
|
||||
// update entry in stock_changes table
|
||||
|
||||
$('#stock_changes tr').removeClass('success');
|
||||
|
||||
var stock_change_entry = $('#stock_change_stock_article_<%= @stock_article.id %>');
|
||||
$('.stock_article_name', stock_change_entry).text('<%= j(@stock_article.name) %>');
|
||||
$('.unit', stock_change_entry).text('<%= j(@stock_article.unit) %>');
|
||||
|
||||
stock_change_entry.addClass('success');
|
||||
|
||||
updateSort('#stock_changes');
|
||||
})(window);
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
$('#modalContainer').html(
|
||||
'<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>'
|
||||
);
|
||||
|
||||
$('#modalContainer').modal();
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
%table.table.table-striped(style="width:500px")
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.article'
|
||||
%th= t '.unit'
|
||||
%th.numeric= t '.amount'
|
||||
%th.numeric= t '.price'
|
||||
%th= Article.model_name.human
|
||||
%th= heading_helper StockArticle, :unit
|
||||
%th.numeric= heading_helper GroupOrderArticle, :quantity # quantity to order, although technically this will be a StockChange
|
||||
%th.numeric= heading_helper Article, :price
|
||||
%th.numeric= t '.sum'
|
||||
%tbody
|
||||
- total_net, total_gross = 0,0
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
$('div.container-fluid').prepend(
|
||||
'<%= j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.notice', :name => @stock_article.name)})) %>'
|
||||
);
|
||||
|
||||
(function() {
|
||||
// update entry in stock_article table
|
||||
|
||||
$('#stock_articles_for_adding tr').removeClass('success');
|
||||
|
||||
var stock_article_for_adding = $(
|
||||
'<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article, :delivery => @delivery})) %>'
|
||||
).addClass('success');
|
||||
|
||||
$('#stock_article_<%= @stock_article.id %>').replaceWith(stock_article_for_adding);
|
||||
updateSort('#stock_articles_for_adding');
|
||||
|
||||
mark_article_for_delivery(<%= @stock_article.id %>);
|
||||
|
||||
// update entry in stock_changes table
|
||||
|
||||
$('#stock_changes tr').removeClass('success');
|
||||
|
||||
var stock_change_entry = $('#stock_change_stock_article_<%= @stock_article.id %>');
|
||||
$('.stock_article_name', stock_change_entry).text('<%= j(@stock_article.name) %>');
|
||||
$('.unit', stock_change_entry).text('<%= j(@stock_article.unit) %>');
|
||||
|
||||
stock_change_entry.addClass('success');
|
||||
|
||||
updateSort('#stock_changes');
|
||||
})();
|
||||
|
||||
$('#modalContainer').modal('hide');
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
%table.ordered-articles.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= sort_link_helper t('.article'), "name"
|
||||
%th= sort_link_helper t('.number'), "order_number"
|
||||
%th= sort_link_helper Article.model_name.human, "name"
|
||||
%th= sort_link_helper Article.human_attribute_name(:order_number_short), "order_number"
|
||||
%th= t('.amount')
|
||||
%th= t('.amount_per_unit')
|
||||
%th= heading_helper Article, :units
|
||||
%th= t('.net')
|
||||
%th= t('.gross')
|
||||
%th= t('.tax')
|
||||
%th= t('.refund')
|
||||
%th= heading_helper Article, :tax
|
||||
%th= heading_helper Article, :deposit
|
||||
%th{:colspan => "2"}
|
||||
= link_to t('.add_article'), new_finance_order_order_article_path(@order), remote: true,
|
||||
class: 'btn btn-small'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
%thead
|
||||
%tr
|
||||
%td
|
||||
%td{:style => "width:8em"}= t('.group')
|
||||
%td{:style => "width:8em"}= Ordergroup.model_name.human
|
||||
%td= t('.units')
|
||||
%td= t('.total')
|
||||
%td{:colspan => "3",:style => "width:14em"}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
= order_article.units_to_order
|
||||
- unless order_article.ordered_quantities_equal_to_group_orders?
|
||||
%span{:style => "color:red;font-weight: bold"} !
|
||||
%td= order_article.price.unit_quantity.to_s + ' * ' + order_article.article.unit.to_s
|
||||
%td #{order_article.price.unit_quantity} × #{order_article.article.unit}
|
||||
%td
|
||||
= number_to_currency(order_article.price.price, :unit => "")
|
||||
:plain
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
:plain
|
||||
/
|
||||
= number_to_currency(order_article.total_gross_price, :unit => "")
|
||||
%td= order_article.price.tax
|
||||
%td #{order_article.price.tax}%
|
||||
%td= order_article.price.deposit
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_finance_order_order_article_path(order_article.order, order_article), remote: true,
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%td= sort_link_helper t('.date'), "date"
|
||||
%td= t('.who')
|
||||
%td= sort_link_helper t('.note'), "note"
|
||||
%td= sort_link_helper t('.amount'), "amount"
|
||||
%th= sort_link_helper heading_helper(FinancialTransaction, :created_on), "date"
|
||||
%th= heading_helper FinancialTransaction, :user
|
||||
%th= sort_link_helper heading_helper(FinancialTransaction, :note), "note"
|
||||
%th= sort_link_helper heading_helper(FinancialTransaction, :amount), "amount"
|
||||
%tbody
|
||||
- @financial_transactions.each do |t|
|
||||
%tr
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@
|
|||
|
||||
= form_tag finance_create_transaction_collection_path do
|
||||
%p
|
||||
%b= t('.note')
|
||||
%b= heading_helper FinancialTransaction, :note
|
||||
= text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required'
|
||||
%p
|
||||
%table#ordergroups{:style => "width:20em"}
|
||||
%tr
|
||||
%th= t('.ordergroup')
|
||||
%th= t('.amount')
|
||||
%th= heading_helper FinancialTransaction, :ordergroup
|
||||
%th= heading_helper FinancialTransaction, :amount
|
||||
= render :partial => 'ordergroup', :collection => [1, 2, 3]
|
||||
%p
|
||||
= link_to t('.new_ordergroup'), '#', 'data-add-transaction' => true, class: 'btn'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
%h3= t('.amount_change_for', article: @order_article.article.name)
|
||||
.modal-body
|
||||
= form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] }
|
||||
= form.input :result, hint: I18n.t('.result_hint', unit: @order_article.article.unit)
|
||||
= form.input :result, hint: I18n.t('finance.group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix?
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= form.submit t('ui.save'), class: 'btn btn-primary'
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t('.date')
|
||||
%th.numeric= t('.amount')
|
||||
%th= t('.supplier')
|
||||
%th= heading_helper Invoice, :date
|
||||
%th.numeric= heading_helper Invoice, :amount
|
||||
%th= heading_helper Invoice, :supplier
|
||||
%th
|
||||
%tbody
|
||||
- for invoice in @unpaid_invoices
|
||||
|
|
@ -26,10 +26,10 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t('.date')
|
||||
%th= t('.group')
|
||||
%th= t('.note')
|
||||
%th.numeric= t('.amount')
|
||||
%th= heading_helper FinancialTransaction, :created_on
|
||||
%th= heading_helper FinancialTransaction, :ordergroup
|
||||
%th= heading_helper FinancialTransaction, :note
|
||||
%th.numeric= heading_helper FinancialTransaction, :amount
|
||||
%tbody
|
||||
- @financial_transactions.each do |ft|
|
||||
%tr
|
||||
|
|
@ -45,8 +45,8 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t('.supplier')
|
||||
%th= t('.end')
|
||||
%th= heading_helper Order, :name
|
||||
%th= t '.end'
|
||||
%th.numeric= t('.amount_fc')
|
||||
%th
|
||||
%tbody
|
||||
|
|
@ -55,6 +55,6 @@
|
|||
%td= order.name
|
||||
%td= format_date(order.ends)
|
||||
%td.numeric= number_to_currency(order.sum(:fc))
|
||||
%td= link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini'
|
||||
%td= link_to t('finance.balancing.orders.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini'
|
||||
- else
|
||||
= t('.everything_cleared')
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
%td= format_date invoice.date
|
||||
%td= format_date invoice.paid_on
|
||||
%td= number_to_currency invoice.amount
|
||||
%td= link_to t('.delivery'), [invoice.supplier,invoice.delivery] if invoice.delivery
|
||||
%td= link_to Delivery.model_name.human, [invoice.supplier,invoice.delivery] if invoice.delivery
|
||||
%td= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order
|
||||
%td= truncate(invoice.note)
|
||||
%td= link_to t('ui.edit'), edit_finance_invoice_path(invoice), class: 'btn btn-mini'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
|
||||
%h3= t '.title'
|
||||
.modal-body
|
||||
= form.input :article_id, as: :select, collection: new_order_articles_collection
|
||||
= form.input :article_id, as: :select, collection: new_order_articles_collection, :label => Article.model_name.human # Why do we need the label?
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= form.submit class: 'btn btn-primary'
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= sort_link_helper t('.name'), "name", :per_page => @per_page
|
||||
%th= t '.contact'
|
||||
%th.numeric= sort_link_helper t('.account_balance'), "account_balance", :per_page => @per_page
|
||||
%th= sort_link_helper heading_helper(Ordergroup, :name), "name", :per_page => @per_page
|
||||
%th= heading_helper Ordergroup, :contact
|
||||
%th.numeric= sort_link_helper heading_helper(Ordergroup, :account_balance), "account_balance", :per_page => @per_page
|
||||
%th
|
||||
%tbody
|
||||
- for ordergroup in @ordergroups
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.name'
|
||||
%th= t '.user'
|
||||
%th= t '.last_ordered'
|
||||
%th= heading_helper Ordergroup, :name
|
||||
%th= heading_helper Ordergroup, :user_tokens
|
||||
%th= heading_helper Ordergroup, :last_order
|
||||
|
||||
%tbody
|
||||
- for ordergroup in @ordergroups
|
||||
%tr
|
||||
%td= ordergroup.name
|
||||
%td=h ordergroup.users.collect { |u| show_user(u) }.join(", ")
|
||||
%td= format_date ordergroup.orders.order('orders.starts DESC').first.try(:starts)
|
||||
%td= format_date ordergroup.last_order.try(:starts)
|
||||
%td= link_to_new_message(message_params: {group_id: ordergroup.id})
|
||||
|
||||
|
|
|
|||
|
|
@ -27,22 +27,23 @@
|
|||
%h2= @order.name
|
||||
%dl.dl-horizontal
|
||||
- unless @order.note.blank?
|
||||
%dt= t '.note'
|
||||
%dt= heading_helper Order, :note
|
||||
%dd= @order.note
|
||||
%dt= t '.created_by'
|
||||
%dt= heading_helper Order, :created_by
|
||||
%dd= show_user_link(@order.created_by)
|
||||
%dt= t '.ending'
|
||||
%dt= heading_helper Order, :ends
|
||||
%dd= format_time(@order.ends)
|
||||
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
|
||||
%dt= t '.min_quantity'
|
||||
%dt= heading_helper Supplier, :min_order_quantity, short: true
|
||||
%dd= @order.supplier.min_order_quantity
|
||||
%dt= t '.sum_amount'
|
||||
%dd= number_to_currency @order.sum
|
||||
%dt= t '.last_update'
|
||||
%dd
|
||||
= show_user(@group_order.updated_by) if @group_order.updated_by
|
||||
(#{format_time(@group_order.updated_on)})
|
||||
%dt= t '.funds'
|
||||
- unless @group_order.new_record?
|
||||
%dt= heading_helper GroupOrder, :updated_by
|
||||
%dd
|
||||
= show_user(@group_order.updated_by)
|
||||
(#{format_time(@group_order.updated_on)})
|
||||
%dt= heading_helper Ordergroup, :available_funds
|
||||
%dd= number_to_currency(@ordering_data[:available_funds])
|
||||
|
||||
.well.pull-right
|
||||
|
|
@ -65,20 +66,20 @@
|
|||
%table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.name'
|
||||
%th= heading_helper Article, :name
|
||||
- if @order.stockit?
|
||||
%th{style: 'width:120px'}= t '.supplier'
|
||||
%th{style: 'width:120px'}= heading_helper StockArticle, :supplier
|
||||
%th{style: "width:13px;"}
|
||||
%th{style: "width:4.5em;"}= t '.price'
|
||||
%th{style: "width:4.5em;"}= t '.unit'
|
||||
%th{style: "width:4.5em;"}= heading_helper Article, :unit
|
||||
- unless @order.stockit?
|
||||
%th{style: "width:70px;"}= t '.unit_missing'
|
||||
%th#col_required= t '.amount'
|
||||
%th#col_tolerance= t '.tolerance'
|
||||
%th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true
|
||||
%th#col_required= heading_helper GroupOrderArticle, :quantity
|
||||
%th#col_tolerance= heading_helper GroupOrderArticle, :tolerance
|
||||
- else
|
||||
%th(style="width:20px")= t '.available'
|
||||
%th#col_required= t '.amount'
|
||||
%th{style: "width:15px;"}= t '.sum'
|
||||
%th(style="width:20px")= heading_helper StockArticle, :available
|
||||
%th#col_required= heading_helper GroupOrderArticle, :quantity
|
||||
%th{style: "width:15px;"}= heading_helper GroupOrderArticle, :total_price
|
||||
%tbody.list
|
||||
- @order.articles_grouped_by_category.each do |category, order_articles|
|
||||
%tr.list-heading.article-category
|
||||
|
|
@ -132,11 +133,11 @@
|
|||
%span{id: "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance]
|
||||
%br/
|
||||
.pull-left
|
||||
#{t '.manufacturer'}: #{order_article.article.manufacturer}
|
||||
#{heading_helper Article, :manufacturer}: #{order_article.article.manufacturer}
|
||||
%br/
|
||||
#{t '.units'}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
|
||||
#{heading_helper Article, :units}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
|
||||
%br/
|
||||
#{t '.note'}: #{order_article.article.note}
|
||||
#{heading_helper Article, :note}: #{order_article.article.note}
|
||||
%br/
|
||||
#order-footer
|
||||
#info-box
|
||||
|
|
@ -147,7 +148,7 @@
|
|||
%td.currency
|
||||
%span#total_price= number_to_currency(@group_order.price)
|
||||
%tr
|
||||
%td= t('.available_funds') + ':'
|
||||
%td= heading_helper(Ordergroup, :available_funds) + ':'
|
||||
%td.currency= number_to_currency(@ordering_data[:available_funds])
|
||||
%tr
|
||||
%td= t('.new_funds') + ':'
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.supplier'
|
||||
%th= t '.ending'
|
||||
%th= t '.sum'
|
||||
%th= heading_helper Order, :name
|
||||
%th= heading_helper Order, :ends
|
||||
%th= heading_helper GroupOrder, :price
|
||||
%tbody
|
||||
- for order in orders
|
||||
- group_order = order.group_order(@ordergroup) # Get GroupOrder if possible
|
||||
|
|
|
|||
|
|
@ -6,22 +6,22 @@
|
|||
%h2= t '.funds.title'
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%td= t('.funds.account_balance') + ':'
|
||||
%td= heading_helper Ordergroup, :account_balance
|
||||
%td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance)
|
||||
%tr
|
||||
%td= '- ' + t('.funds.open_orders') + ':'
|
||||
%td= '- ' + t('.funds.open_orders')
|
||||
%td.numeric= number_to_currency(@ordergroup.value_of_open_orders)
|
||||
%tr
|
||||
%td= '- ' + t('.funds.finished_orders') + ':'
|
||||
%td= '- ' + t('.funds.finished_orders')
|
||||
%td.numeric= number_to_currency(@ordergroup.value_of_finished_orders)
|
||||
%tr
|
||||
%th= t('.funds.available_funds') + ':'
|
||||
%th= heading_helper Ordergroup, :available_funds
|
||||
%th.numeric= number_to_currency(@ordergroup.get_available_funds)
|
||||
|
||||
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
|
||||
|
||||
// finished orders
|
||||
- unless Order.finished.empty?
|
||||
- unless Order.finished_not_closed.empty?
|
||||
%section
|
||||
%h2= t '.finished_orders.title'
|
||||
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}
|
||||
|
|
|
|||
|
|
@ -1,88 +0,0 @@
|
|||
- content_for :head do
|
||||
= render 'data'
|
||||
|
||||
= render :partial => 'order_head'
|
||||
|
||||
- form_tag(:action => 'saveOrder', :id => @order) do
|
||||
.single_column{:style => "clear:both;margin-bottom:7em;"}
|
||||
.box_title
|
||||
%h2= t '.title'
|
||||
.column_content
|
||||
%table#order.list
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'group_orders.form.name'
|
||||
%th{:style => "width:13px;"}
|
||||
%th{:style => "width:4.5em;"}= t 'group_orders.form.price'
|
||||
%th{:style => "width:4.5em;"}= t 'group_orders.form.unit'
|
||||
%th{:style => "width:70px;"}= t 'group_orders.form.unit_missing'
|
||||
%th#col_required= t 'group_orders.form.amount'
|
||||
- if not @order.stockit?
|
||||
%th#col_tolerance= t 'group_orders.form.tolerance'
|
||||
%th{:style => "width:15px;"}= t 'group_orders.form.sum'
|
||||
%tbody
|
||||
- total = 0
|
||||
- i = 0
|
||||
- @articles_grouped_by_category.each do |category, order_articles|
|
||||
%tr{:style => "background-color:#EFEFEF"}
|
||||
%td{:style => "text-align:left"}
|
||||
%b= h category
|
||||
%td{:colspan => "9"}
|
||||
- order_articles.each do |order_article|
|
||||
- if FoodsoftConfig[:tolerance_is_costly]
|
||||
- article_total = @price[i] * (@tolerance[i] + @quantity[i])
|
||||
- else
|
||||
- article_total = @price[i] * @quantity[i]
|
||||
- total += article_total
|
||||
%tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"}
|
||||
%td.name= order_article.article.name
|
||||
%td= h order_article.article.origin
|
||||
%td= number_to_currency(@price[i])
|
||||
%td= order_article.article.unit
|
||||
%td
|
||||
%span{:id => "missing_units_#{i}"}
|
||||
- if @order.stockit?
|
||||
- order_article.article.quantity_available
|
||||
- else
|
||||
- missing_units = @unit[i] - (((@quantity[i] + @others_quantity[i]) % @unit[i]) + @tolerance[i] + @others_tolerance[i])
|
||||
- missing_units < 0 ? 0 : missing_units
|
||||
%td.quantity
|
||||
%input{:id => "q_#{i}", :name => "ordered[#{order_article.id}][quantity]", :size => "2", :type => "hidden", :value => @quantity[i]}/
|
||||
%span.used{:id => "q_used_#{i}"}= @used_quantity[i]
|
||||
+
|
||||
%span.unused{:id => "q_unused_#{i}"}= @quantity[i] - @used_quantity[i]
|
||||
= button_to_function('+', "increaseQuantity(#{i})")
|
||||
= button_to_function('-', "decreaseQuantity(#{i})")
|
||||
- unless @order.stockit?
|
||||
%td.tolerance
|
||||
%input{:id => "t_#{i}", :name => "ordered[#{order_article.id}][tolerance]", :size => "2", :type => "hidden", :value => @tolerance[i]}/
|
||||
- if (@unit[i] > 1)
|
||||
%span.used{:id => "t_used_#{i}"}= @used_tolerance[i]
|
||||
+
|
||||
%span.unused{:id => "t_unused_#{i}"}= @tolerance[i] - @used_tolerance[i]
|
||||
= button_to_function('+', "increaseTolerance(#{i})")
|
||||
= button_to_function('-', "decreaseTolerance(#{i})")
|
||||
%td{:id => "td_price_#{i}", :style => "text-align:right; padding-right:10px; width:4em"}
|
||||
%span{:id => "price_#{i}_display"}= number_to_currency(article_total, :unit => "")
|
||||
€
|
||||
.article-info
|
||||
%h3= order_article.article.name
|
||||
.right
|
||||
= t('group_orders.form.units_full') + ':'
|
||||
%span{:id => "units_#{i}"}= order_article.units_to_order
|
||||
%br/
|
||||
= t('group_orders.form.total_units') + ':'
|
||||
%span{:id => "q_total_#{i}"}= @quantity[i] + @others_quantity[i]
|
||||
%br/
|
||||
= t('group_orders.form.total_tolerance') + ':'
|
||||
%span{:id => "t_total_#{i}"}= @tolerance[i] + @others_tolerance[i]
|
||||
%br/
|
||||
.left
|
||||
#{t 'group_orders.form.manufacturer'}: #{order_article.article.manufacturer}
|
||||
%br/
|
||||
#{t 'group_orders.form.units'}: #{@order.stockit? ? order_article.article.quantity_available : @unit[i]} * #{h order_article.article.unit}
|
||||
%br/
|
||||
#{t 'group_orders.form.note'}: #{order_article.article.note}
|
||||
%br/
|
||||
- i = i + 1
|
||||
= render "order_footer", :total => total
|
||||
|
|
@ -9,21 +9,22 @@
|
|||
.well
|
||||
// Order summary
|
||||
%dl.dl-horizontal
|
||||
%dt= t '.supplier'
|
||||
%dt= heading_helper Order, :name
|
||||
%dd= @order.name
|
||||
%dt= t '.note'
|
||||
%dt= heading_helper Order, :note
|
||||
%dd= @order.note
|
||||
%dt= t '.ending'
|
||||
%dt= heading_helper Order, :ends
|
||||
%dd= format_time(@order.ends)
|
||||
%dt= t '.order_sum'
|
||||
%dt= heading_helper GroupOrder, :price
|
||||
%dd
|
||||
- if @group_order
|
||||
= number_to_currency(@group_order.price)
|
||||
- else
|
||||
= t '.not_ordered'
|
||||
- if @order.closed?
|
||||
%p= t '.closed_by', user: show_user(@order.updated_by)
|
||||
= link_to t('.comment'), "#comments"
|
||||
%dt= heading_helper Order, :closed_by
|
||||
%dd= show_user_link @order.updated_by
|
||||
%p= link_to t('.comment'), "#comments"
|
||||
|
||||
// Article box
|
||||
%section
|
||||
|
|
@ -35,8 +36,8 @@
|
|||
%table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th{style: "width:40%"}= t '.articles.name'
|
||||
%th= t '.articles.units'
|
||||
%th{style: "width:40%"}= heading_helper Article, :name
|
||||
%th= heading_helper Article, :units
|
||||
%th= t '.articles.unit_price'
|
||||
%th
|
||||
%abbr{title: t('.articles.ordered_title')}= t '.articles.ordered'
|
||||
|
|
@ -46,7 +47,7 @@
|
|||
= t '.articles.order_open'
|
||||
- else
|
||||
= t '.articles.order_not_open'
|
||||
%th= t '.articles.total_price'
|
||||
%th= heading_helper GroupOrderArticle, :total_price
|
||||
%tbody
|
||||
- for category_name, order_articles in @order.articles_grouped_by_category
|
||||
%tr.article-category
|
||||
|
|
@ -61,7 +62,7 @@
|
|||
%td{style: "width:40%"}
|
||||
= oa.article.name
|
||||
- unless oa.article.note.blank?
|
||||
= image_tag("lamp_grey.png", {alt: "Notiz anzeigen", size: "15x16", border: "0", onmouseover: "$('note_#{oa.id}').show();", onmouseout: "$('note_#{oa.id}').hide();"})
|
||||
= image_tag("lamp_grey.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#note_#{oa.id}').show();", onmouseout: "$('#note_#{oa.id}').hide();"})
|
||||
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
|
||||
%td= number_to_currency(oa.price.fc_price)
|
||||
%td
|
||||
|
|
@ -73,7 +74,7 @@
|
|||
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
|
||||
%td{colspan: "6"}=h oa.article.note
|
||||
%tr{class: cycle('even', 'odd', name: 'articles')}
|
||||
%th{colspan: "5"}= t '.articles.sum'
|
||||
%th{colspan: "5"}= heading_helper GroupOrder, :price
|
||||
%th= number_to_currency(@group_order.price)
|
||||
%br/
|
||||
= link_to_top
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@
|
|||
%h3= t '.my_ordergroup.transactions.title'
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th= t '.my_ordergroup.transactions.when'
|
||||
%th= t '.my_ordergroup.transactions.where'
|
||||
%th= t '.my_ordergroup.transactions.note'
|
||||
%th= t '.my_ordergroup.transactions.amount'
|
||||
%th= heading_helper FinancialTransaction, :created_on
|
||||
%th= heading_helper FinancialTransaction, :user
|
||||
%th= heading_helper FinancialTransaction, :note
|
||||
%th= heading_helper FinancialTransaction, :amount
|
||||
- for ft in current_user.ordergroup.financial_transactions.limit(5).order('created_on DESC')
|
||||
%tr
|
||||
%td= format_time(ft.created_on)
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
- unless @ordergroup.description.blank?
|
||||
%p= @ordergroup.description
|
||||
%p
|
||||
%b= Ordergroup.human_attribute_name(:available_funds) + ':'
|
||||
%b= heading_helper(Ordergroup, :available_funds) + ':'
|
||||
= number_to_currency(@ordergroup.get_available_funds())
|
||||
%p
|
||||
%b= Ordergroup.human_attribute_name(:user_tokens) + ':'
|
||||
%b= heading_helper(Ordergroup, :user_tokens) + ':'
|
||||
= @ordergroup.memberships.map{|m| show_user m.user}.join(', ')
|
||||
= link_to t('.invite'), new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary'
|
||||
.span8
|
||||
|
|
|
|||
|
|
@ -7,10 +7,6 @@
|
|||
%title= [t('layouts.foodsoft'), yield(:title)].join(" - ")
|
||||
= csrf_meta_tags
|
||||
= stylesheet_link_tag "application", :media => "all"
|
||||
%link(href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144")
|
||||
%link(href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114")
|
||||
%link(href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72")
|
||||
%link(href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed")
|
||||
//%link(href="images/favicon.ico" rel="shortcut icon")
|
||||
|
||||
= yield(:head)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
%table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.name'
|
||||
%th= t '.unit_quantity'
|
||||
%th= heading_helper Article, :name
|
||||
%th= heading_helper Article, :unit_quantity
|
||||
%th= t '.prices'
|
||||
%th= t '.units_ordered'
|
||||
- unless order.stockit?
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@
|
|||
%table.table.table-hover#articleList
|
||||
%tr
|
||||
%th= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' }
|
||||
%th= t '.name'
|
||||
%th= t '.note'
|
||||
%th= heading_helper Article, :name
|
||||
%th= heading_helper Article, :note
|
||||
- if @order.stockit?
|
||||
%th= t '.stockit'
|
||||
- else
|
||||
%th= t '.origin'
|
||||
%th= t '.supplier'
|
||||
%th= t '.unit_quantity'
|
||||
%th= heading_helper Article, :origin
|
||||
%th= heading_helper Article, :manufacturer
|
||||
%th= heading_helper Article, :unit_quantity
|
||||
%th= t '.prices'
|
||||
- for category_name, articles in @order.articles_for_ordering
|
||||
%tr.article-category
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= sort_link_helper t('.supplier'), "supplier"
|
||||
%th= t '.start'
|
||||
%th= sort_link_helper t('.ending'), "ends"
|
||||
%th= t '.status'
|
||||
%th= sort_link_helper heading_helper(Order, :supplier), "supplier"
|
||||
%th= heading_helper Order, :starts
|
||||
%th= sort_link_helper heading_helper(Order, :ends), "ends"
|
||||
%th= heading_helper Order, :status
|
||||
%th{:colspan => "2"}
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.supplier'
|
||||
%th= t '.ending'
|
||||
%th= t '.note'
|
||||
%th= heading_helper Order, :name
|
||||
%th= heading_helper Order, :ends
|
||||
%th= heading_helper Order, :note
|
||||
%th{colspan: "2"}
|
||||
%tbody
|
||||
- for order in @open_orders
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
- if @order.finished? and !@order.closed?
|
||||
.alert.alert-warning
|
||||
= t '.warn_not_closed'
|
||||
= t '.warn_not_closed'
|
||||
|
||||
// Order summary
|
||||
.well
|
||||
%dl.dl-horizontal
|
||||
%dt= t '.supplier'
|
||||
%dt= heading_helper(Order, :name) + ':'
|
||||
%dd= @order.name
|
||||
- if @note.present?
|
||||
%dt= t '.note'
|
||||
%dt= heading_helper(Order, :note) + ':'
|
||||
%dd= @order.note
|
||||
%dt= t '.created_by'
|
||||
%dt= heading_helper(Order, :created_by) + ':'
|
||||
%dd= show_user_link(@order.created_by)
|
||||
%dt= t '.begin'
|
||||
%dt= heading_helper(Order, :starts) + ':'
|
||||
%dd= format_time(@order.starts)
|
||||
%dt= t '.ending'
|
||||
%dt= heading_helper(Order, :ends) + ':'
|
||||
%dd= format_time(@order.ends)
|
||||
%dt= t '.group_orders'
|
||||
%dd #{@order.group_orders.count} (#{@order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')})
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
%table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th{:style => "width:40%"}= t '.name'
|
||||
%th{:style => "width:40%"}= heading_helper Article, :name
|
||||
%th
|
||||
%acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered'
|
||||
%th
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
%acronym{:title => t('.fc_price_desc')}= t '.fc_price'
|
||||
%th
|
||||
%acronym{:title => t('.unit_quantity_desc')}= t '.unit_quantity'
|
||||
%th= t '.unit'
|
||||
%th= heading_helper Article, :unit
|
||||
%th= t '.price'
|
||||
|
||||
- for group_order in order.group_orders.ordered
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
%dl
|
||||
%dt= t('.description') + ':'
|
||||
%dt= heading_helper(Ordergroup, :description) + ':'
|
||||
%dd=h group.description
|
||||
- if group.is_a?(Ordergroup) and (@current_user.role_admin? or @current_user.role_finance?)
|
||||
%dt= t('.contact') + ':'
|
||||
%dt= heading_helper(Ordergroup, :contact) + ':'
|
||||
%dd=h group.contact
|
||||
%dt= t('.address') + ':'
|
||||
%dt= heading_helper(Ordergroup, :contact_address) + ':'
|
||||
%dd= link_to_gmaps group.contact_address
|
||||
%dt= t('.access') + ':'
|
||||
%dd= format_roles(group)
|
||||
%dt= t('.members') + ':'
|
||||
%dt= heading_helper(Ordergroup, :user_tokens) + ':'
|
||||
%dd
|
||||
- members = group.users
|
||||
= "(#{members.size})"
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.supplier'
|
||||
%th= t '.ending'
|
||||
%th= heading_helper Order, :name
|
||||
%th= heading_helper Order, :ends
|
||||
%th= t '.who_ordered'
|
||||
%th= t '.total'
|
||||
%th.numeric= heading_helper GroupOrder, :price
|
||||
%tbody
|
||||
- total = 0
|
||||
- Order.open.each do |order|
|
||||
|
|
@ -20,7 +20,9 @@
|
|||
- if group_order = order.group_order(ordergroup)
|
||||
- total += group_order.price
|
||||
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
|
||||
%td.numeric= number_to_currency(group_order.price)
|
||||
%td.numeric
|
||||
= link_to_ordering(order, show: true) do
|
||||
= number_to_currency(group_order.price)
|
||||
- else
|
||||
%td{:colspan => 2}
|
||||
- if total > 0
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
%p
|
||||
= simple_fields_for "stock_taking[stock_change_attributes][]", stock_change do |form|
|
||||
= form.hidden_field :stock_article_id
|
||||
= "Menge (#{stock_change.stock_article.quantity_available})"
|
||||
= t '.amount'
|
||||
(#{stock_change.stock_article.quantity_available})
|
||||
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
|
||||
%span{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_change.stock_article})}}
|
||||
%b= stock_change.stock_article.name
|
||||
|
|
|
|||
|
|
@ -1,18 +1,21 @@
|
|||
= simple_form_for stock_article, :validate => true do |f|
|
||||
= f.association :supplier
|
||||
= f.input :name
|
||||
= f.input :unit
|
||||
= f.input :note
|
||||
|
||||
- if stock_article.new_record?
|
||||
= f.input :price
|
||||
= f.input :tax, :wrapper => :append do
|
||||
= f.input_field :tax
|
||||
%span.add-on %
|
||||
= f.input :deposit
|
||||
- else
|
||||
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => t('.price_hint')
|
||||
= f.association :article_category
|
||||
.form-actions
|
||||
= f.submit class: 'btn'
|
||||
= link_to t('ui.or_cancel'), stock_articles_path
|
||||
= simple_form_for stock_article, remote: true, :validate => true do |f|
|
||||
.modal-header
|
||||
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
|
||||
%h3= title
|
||||
.modal-body
|
||||
= f.association :supplier
|
||||
= f.input :name
|
||||
= f.input :unit
|
||||
= f.input :note
|
||||
- if stock_article.new_record?
|
||||
= f.input :price
|
||||
= f.input :tax, :wrapper => :append do
|
||||
= f.input_field :tax
|
||||
%span.add-on %
|
||||
= f.input :deposit
|
||||
- else
|
||||
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article).html_safe
|
||||
= f.association :article_category
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= f.submit :class => 'btn btn-primary', 'data-disable-with' => t('ui.please_wait')
|
||||
|
|
|
|||
14
app/views/stockit/_stock_article.html.haml
Normal file
14
app/views/stockit/_stock_article.html.haml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
%tr{:class => stock_article_classes(stock_article), :id => "stockArticle-#{stock_article.id}"}
|
||||
%td= link_to stock_article.name, stock_article
|
||||
%td= stock_article.quantity
|
||||
%td= stock_article.quantity_ordered
|
||||
%td.main_info= stock_article.quantity_available
|
||||
%td= stock_article.unit
|
||||
%td= stock_article.price
|
||||
%td= number_to_percentage stock_article.tax
|
||||
%td= link_to stock_article.supplier.name, stock_article.supplier
|
||||
%td= stock_article.article_category.name
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_stock_article_path(stock_article), remote: true, class: 'btn btn-mini'
|
||||
= link_to t('ui.delete'), stock_article, :method => :delete, :confirm => t('.confirm_delete', :name => stock_article.name),
|
||||
class: 'btn btn-mini btn-danger', :remote => true
|
||||
26
app/views/stockit/_stock_article_details.html.haml
Normal file
26
app/views/stockit/_stock_article_details.html.haml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#stockArticleDetails
|
||||
%dl.dl-horizontal
|
||||
%dt= heading_helper(StockArticle, :supplier)
|
||||
%dd= link_to stock_article.supplier.name, stock_article.supplier
|
||||
%dt= heading_helper(StockArticle, :name)
|
||||
%dd= stock_article.name
|
||||
%dt= heading_helper(StockArticle, :unit)
|
||||
%dd= stock_article.unit
|
||||
%dt= heading_helper(StockArticle, :price)
|
||||
%dd= number_to_currency stock_article.price
|
||||
%dt= heading_helper(StockArticle, :tax)
|
||||
%dd= number_to_percentage stock_article.tax
|
||||
%dt= heading_helper(StockArticle, :deposit)
|
||||
%dd= number_to_currency stock_article.deposit
|
||||
%dt= heading_helper(StockArticle, :fc_price)
|
||||
%dd= number_to_currency stock_article.fc_price
|
||||
%dt= heading_helper(StockArticle, :article_category)
|
||||
%dd= stock_article.article_category.name
|
||||
%dt= heading_helper(StockArticle, :note)
|
||||
%dd= stock_article.note
|
||||
%dt= heading_helper(StockArticle, :quantity)
|
||||
%dd= stock_article.quantity
|
||||
%dt= heading_helper(StockArticle, :quantity_available)
|
||||
%dd= stock_article.quantity_available
|
||||
.form-actions
|
||||
= link_to t('ui.edit'), edit_stock_article_path(stock_article), remote: true, class: 'btn'
|
||||
9
app/views/stockit/copy.js.erb
Normal file
9
app/views/stockit/copy.js.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
$('#modalContainer').html('<%= j(render(
|
||||
:partial => "form",
|
||||
:locals => {
|
||||
:title => t('.title'),
|
||||
:stock_article => @stock_article
|
||||
}
|
||||
)) %>');
|
||||
|
||||
$('#modalContainer').modal();
|
||||
15
app/views/stockit/create.js.erb
Normal file
15
app/views/stockit/create.js.erb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
$('div.container-fluid').prepend('<%= j(render(
|
||||
:partial => 'shared/alert_success',
|
||||
:locals => {
|
||||
:alert_message => t('.notice', :name => @stock_article.name)
|
||||
}
|
||||
)) %>');
|
||||
|
||||
// Publish database changes.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
$(document).trigger({
|
||||
type: 'StockArticle#create',
|
||||
stock_article_id: <%= @stock_article.id %>
|
||||
});
|
||||
|
||||
$('#modalContainer').modal('hide');
|
||||
9
app/views/stockit/derive.js.erb
Normal file
9
app/views/stockit/derive.js.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
$('#modalContainer').html('<%= j(render(
|
||||
:partial => "form",
|
||||
:locals => {
|
||||
:title => t('.title'),
|
||||
:stock_article => @stock_article
|
||||
}
|
||||
)) %>');
|
||||
|
||||
$('#modalContainer').modal();
|
||||
13
app/views/stockit/destroy.js.erb
Normal file
13
app/views/stockit/destroy.js.erb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
$('div.container-fluid').prepend('<%= j(render(
|
||||
:partial => 'shared/alert_success',
|
||||
:locals => {
|
||||
:alert_message => t('.notice', :name => @stock_article.name)
|
||||
}
|
||||
)) %>');
|
||||
|
||||
// Publish database changes.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
$(document).trigger({
|
||||
type: 'StockArticle#destroy',
|
||||
stock_article_id: <%= @stock_article.id %>
|
||||
});
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
-# please polish the following line if you know how, same in partial _destroy_fail
|
||||
var successDiv = $('<div class="alert fade in alert-success"><a class="close" data-dismiss="alert" href="#">#{escape_javascript(t('ui.marks.close').html_safe)}</a></div>');
|
||||
|
||||
successDiv.append(document.createTextNode('#{escape_javascript(t('.notice', name: @article.name))}'));
|
||||
$('div.container-fluid').prepend(successDiv);
|
||||
|
||||
$('#stockArticle-#{@article.id}').remove();
|
||||
-# WARNING: Do not use a simple .fadeOut() above, because it conflicts with the show/hide function of unavailable articles.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
- title t('.title')
|
||||
|
||||
= render :partial => 'form', :locals => {:stock_article => @stock_article}
|
||||
9
app/views/stockit/edit.js.erb
Normal file
9
app/views/stockit/edit.js.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
$('#modalContainer').html('<%= j(render(
|
||||
:partial => "form",
|
||||
:locals => {
|
||||
:title => t('.title'),
|
||||
:stock_article => @stock_article
|
||||
}
|
||||
)) %>');
|
||||
|
||||
$('#modalContainer').modal();
|
||||
|
|
@ -3,6 +3,30 @@
|
|||
:javascript
|
||||
$(function() {
|
||||
$('tr.unavailable').hide();
|
||||
|
||||
// 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'
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
.well.well-small
|
||||
|
|
@ -17,7 +41,7 @@
|
|||
.btn-group
|
||||
= link_to_if @current_user.role_orders?, t('.order_online'), new_order_path(supplier_id: 0),
|
||||
class: 'btn', class: 'btn btn-primary'
|
||||
= link_to t('.new_stock_article'), new_stock_article_path, class: 'btn'
|
||||
= link_to t('.new_stock_article'), new_stock_article_path, remote: true, class: 'btn'
|
||||
= link_to t('.new_stock_taking'), new_stock_taking_path, class: 'btn'
|
||||
= link_to t('.show_stock_takings'), stock_takings_path, class: 'btn'
|
||||
|
||||
|
|
@ -32,32 +56,19 @@
|
|||
%table.table.table-hover#articles
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.article.article'
|
||||
%th= t '.article.stock'
|
||||
%th= t '.article.ordered'
|
||||
%th= t '.article.available'
|
||||
%th= t '.article.unit'
|
||||
%th= t '.article.price'
|
||||
%th= t '.article.vat'
|
||||
%th= t '.article.supplier'
|
||||
%th= t '.article.category'
|
||||
%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
|
||||
%th
|
||||
%tbody
|
||||
- for article in @stock_articles
|
||||
%tr{:class => stock_article_classes(article), :id => "stockArticle-#{article.id}"}
|
||||
%td= link_to article.name, article
|
||||
%td= article.quantity
|
||||
%td= article.quantity - article.quantity_available
|
||||
%th= article.quantity_available
|
||||
%td= article.unit
|
||||
%td= article.price
|
||||
%td= number_to_percentage article.tax
|
||||
%td= link_to article.supplier.name, article.supplier
|
||||
%td= article.article_category.name
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_stock_article_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
|
||||
%tbody#articles-tbody
|
||||
- for stock_article in @stock_articles
|
||||
= render :partial => 'stock_article', :locals => {:stock_article => stock_article}
|
||||
%p
|
||||
= t '.stock_worth'
|
||||
= number_to_currency StockArticle.stock_value
|
||||
|
|
|
|||
14
app/views/stockit/index_on_stock_article_create.js.erb
Normal file
14
app/views/stockit/index_on_stock_article_create.js.erb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Handle more advanced DOM update after AJAX database manipulation.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
(function() {
|
||||
$('#articles-tbody tr').removeClass('success');
|
||||
|
||||
var stock_article_row = $('<%= j(render(
|
||||
:partial => 'stock_article',
|
||||
:locals => {
|
||||
:stock_article => @stock_article
|
||||
}
|
||||
)) %>').addClass('success');
|
||||
|
||||
$('#articles-tbody').prepend(stock_article_row);
|
||||
})();
|
||||
14
app/views/stockit/index_on_stock_article_update.js.erb
Normal file
14
app/views/stockit/index_on_stock_article_update.js.erb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Handle more advanced DOM update after AJAX database manipulation.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
(function() {
|
||||
$('#articles-tbody tr').removeClass('success');
|
||||
|
||||
var stock_article_row = $('<%= j(render(
|
||||
:partial => 'stock_article',
|
||||
:locals => {
|
||||
:stock_article => @stock_article
|
||||
}
|
||||
)) %>').addClass('success');
|
||||
|
||||
$('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
|
||||
})();
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
- title t('.title')
|
||||
|
||||
- content_for :head do
|
||||
:javascript
|
||||
$(function() {
|
||||
$('#article_search').autocomplete({
|
||||
source: '#{articles_search_stock_articles_path}',
|
||||
select: function(e, ui) {
|
||||
alert(ui.item.value);
|
||||
//location.href = '#{nil}' + ui.item.value;
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
/
|
||||
TODO: Fix this
|
||||
%p
|
||||
= t '.search_text'
|
||||
= text_field_tag 'article_search'
|
||||
#stock_article_form
|
||||
= render :partial => 'form', :locals => {:stock_article => @stock_article}
|
||||
9
app/views/stockit/new.js.erb
Normal file
9
app/views/stockit/new.js.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
$('#modalContainer').html('<%= j(render(
|
||||
:partial => "form",
|
||||
:locals => {
|
||||
:title => t('.title'),
|
||||
:stock_article => @stock_article
|
||||
}
|
||||
)) %>');
|
||||
|
||||
$('#modalContainer').modal();
|
||||
|
|
@ -1,32 +1,22 @@
|
|||
- title @stock_article.name
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
$(function() {
|
||||
// Subscribe to database changes.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
$(document).on('StockArticle#update', function(e) {
|
||||
$.ajax({
|
||||
url: '#{show_on_stock_article_update_stock_articles_path}',
|
||||
type: 'get',
|
||||
data: {id: e.stock_article_id},
|
||||
contentType: 'application/json; charset=UTF-8'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
.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'
|
||||
= render :partial => 'stock_article_details', :locals => {:stock_article => @stock_article}
|
||||
|
||||
.span6
|
||||
%h2= t('.stock_changes')
|
||||
|
|
|
|||
13
app/views/stockit/show_on_stock_article_update.js.erb
Normal file
13
app/views/stockit/show_on_stock_article_update.js.erb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Handle more advanced DOM update after AJAX database manipulation.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
(function() {
|
||||
var stock_article_details = $('<%= j(render(
|
||||
:partial => 'stock_article_details',
|
||||
:locals => {
|
||||
:stock_article => @stock_article
|
||||
}
|
||||
)) %>');
|
||||
|
||||
$('#stockArticleDetails').replaceWith(stock_article_details);
|
||||
$('h1').first().text('<%= j(@stock_article.name) %>');
|
||||
})();
|
||||
15
app/views/stockit/update.js.erb
Normal file
15
app/views/stockit/update.js.erb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
$('div.container-fluid').prepend('<%= j(render(
|
||||
:partial => 'shared/alert_success',
|
||||
:locals => {
|
||||
:alert_message => t('.notice', :name => @stock_article.name)
|
||||
}
|
||||
)) %>');
|
||||
|
||||
// Publish database changes.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
$(document).trigger({
|
||||
type: 'StockArticle#update',
|
||||
stock_article_id: <%= @stock_article.id %>
|
||||
});
|
||||
|
||||
$('#modalContainer').modal('hide');
|
||||
|
|
@ -5,13 +5,13 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.due_date'
|
||||
%th= t '.task'
|
||||
%th= t '.who'
|
||||
%th= heading_helper Task, :due_date
|
||||
%th= heading_helper Task, :name
|
||||
%th= heading_helper Task, :user_list
|
||||
%th
|
||||
%tbody
|
||||
- @tasks.each do |task|
|
||||
%tr
|
||||
%td= task.due_date unless task.due_date.nil?
|
||||
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task)
|
||||
%td= link_to task_title(task), task_path(task)
|
||||
%td= task_assignments task
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.due_date'
|
||||
%th= heading_helper Task, :due_date
|
||||
%th
|
||||
%th= t '.task'
|
||||
%th= heading_helper Task, :name
|
||||
%th{:colspan => '2'}
|
||||
= t '.who'
|
||||
%small= t '.who_hint'
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
%td
|
||||
- if task.periodic?
|
||||
%i.icon-repeat{title: t('tasks.repeated')}
|
||||
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task)
|
||||
%td= link_to task_title(task), task_path(task)
|
||||
%td
|
||||
= task_assignments task
|
||||
= highlighted_required_users task
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@
|
|||
%section
|
||||
%h3
|
||||
= group.name
|
||||
%small= link_to t('.show_group_tasks'), workgroup_tasks_path(group)
|
||||
%small= link_to t('.show_group_tasks'), workgroup_tasks_path(workgroup_id: group)
|
||||
= render 'list', tasks: tasks
|
||||
= link_to_top
|
||||
|
|
|
|||
|
|
@ -3,22 +3,22 @@
|
|||
|
||||
%section
|
||||
%dl.dl-horizontal
|
||||
%dt= Task.human_attribute_name(:name)
|
||||
%dt= heading_helper Task, :name
|
||||
%dd= @task.name
|
||||
- if @task.description.present?
|
||||
%dt= Task.human_attribute_name(:description)
|
||||
%dt= heading_helper Task, :description
|
||||
%dd= simple_format(@task.description)
|
||||
- if @task.due_date.present?
|
||||
%dt= Task.human_attribute_name(:due_date)
|
||||
%dt= heading_helper Task, :due_date
|
||||
%dd
|
||||
= format_date(@task.due_date)
|
||||
- if @task.periodic?
|
||||
%i.icon-repeat{title: t('tasks.repeated')}
|
||||
%dt= Task.human_attribute_name(:duration)
|
||||
%dt= heading_helper Task, :duration
|
||||
%dd= t('.hours', count: @task.duration)
|
||||
%dt= Task.human_attribute_name(:user_list)
|
||||
%dt= heading_helper Task, :user_list
|
||||
%dd= task_assignments(@task)
|
||||
%dt= Task.human_attribute_name(:workgroup)
|
||||
%dt= heading_helper Task, :workgroup
|
||||
%dd
|
||||
- if @task.workgroup
|
||||
= link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue