2019-05-01 19:33:33 +02:00
|
|
|
- content_for :javascript do
|
|
|
|
:javascript
|
|
|
|
$(function() {
|
|
|
|
// 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],
|
|
|
|
// make large pages work too (as we don't have paging - articles may disappear!)
|
|
|
|
page: 10000,
|
|
|
|
indexAsync: true
|
|
|
|
});
|
|
|
|
$('input').keydown(function(event){
|
|
|
|
if(event.keyCode == 13) {
|
|
|
|
event.preventDefault();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-10 16:44:05 +01:00
|
|
|
%table.ordered-articles.table.table-striped
|
2009-01-06 11:49:19 +01:00
|
|
|
%thead
|
|
|
|
%tr
|
2019-05-01 19:33:33 +02:00
|
|
|
%th
|
|
|
|
.input-append
|
|
|
|
= text_field_tag :article, params[:article], placeholder: (heading_helper Article, :name), class: 'delayed-search resettable search-query'
|
|
|
|
%th= heading_helper Article, :order_number
|
2013-02-10 09:05:20 +01:00
|
|
|
%th= t('.amount')
|
2014-01-03 12:42:36 +01:00
|
|
|
%th= heading_helper Article, :unit
|
2013-02-10 09:05:20 +01:00
|
|
|
%th= t('.net')
|
|
|
|
%th= t('.gross')
|
2013-12-12 00:13:19 +01:00
|
|
|
%th= heading_helper Article, :tax
|
|
|
|
%th= heading_helper Article, :deposit
|
2009-01-06 11:49:19 +01:00
|
|
|
%th{:colspan => "2"}
|
2023-10-13 19:03:55 +02:00
|
|
|
- unless order.closed?
|
2020-03-19 00:22:20 +01:00
|
|
|
.btn-group
|
2023-10-13 19:03:55 +02:00
|
|
|
= link_to t('.add_article'), new_order_order_article_path(order), remote: true,
|
2020-03-19 00:22:20 +01:00
|
|
|
class: 'btn btn-small'
|
|
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn btn-small dropdown-toggle' do
|
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
2023-10-13 19:03:55 +02:00
|
|
|
%li= link_to t('.add_article'), new_order_order_article_path(order), remote: true
|
|
|
|
%li= link_to t('.edit_transport'), edit_transport_finance_order_path(order), remote: true
|
2019-05-01 19:33:33 +02:00
|
|
|
%tbody.list#result_table
|
2023-10-13 19:03:55 +02:00
|
|
|
- for order_article in articles.select { |oa| oa.units > 0 }
|
2019-05-01 19:33:33 +02:00
|
|
|
= render :partial => "order_article_result", :locals => {:order_article => order_article}
|
|
|
|
|
|
|
|
%tr
|
|
|
|
%td{ colspan: 10 } The following were not ordered
|
|
|
|
|
2023-10-13 19:03:55 +02:00
|
|
|
- for order_article in articles.select { |oa| oa.units == 0 }
|
2009-01-29 21:28:22 +01:00
|
|
|
= render :partial => "order_article_result", :locals => {:order_article => order_article}
|
2020-03-19 00:22:20 +01:00
|
|
|
|
2023-10-13 19:03:55 +02:00
|
|
|
- if order.transport
|
2020-03-19 00:22:20 +01:00
|
|
|
%tr
|
|
|
|
%td{ colspan: 5 }= heading_helper Order, :transport
|
2023-10-13 19:03:55 +02:00
|
|
|
%td{ colspan: 3, data: {value: order.transport} }= number_to_currency(order.transport)
|
|
|
|
%td= link_to t('ui.edit'), edit_transport_finance_order_path(order), remote: true,
|
2020-03-19 00:22:20 +01:00
|
|
|
class: 'btn btn-mini' unless order_article.order.closed?
|