2013-12-30 13:09:49 +01:00
|
|
|
- content_for :javascript do
|
|
|
|
:javascript
|
|
|
|
$(function() {
|
|
|
|
// Subscribe to database changes.
|
|
|
|
// See publish/subscribe design pattern in /doc.
|
2014-01-23 16:17:16 +01:00
|
|
|
$(document).on('OrderArticle#update GroupOrderArticle#create GroupOrderArticle#update', function(e) {
|
2013-12-30 13:09:49 +01:00
|
|
|
$.ajax({
|
|
|
|
url: '#{new_on_order_article_update_finance_order_path(@order)}',
|
|
|
|
type: 'get',
|
|
|
|
data: {order_article_id: e.order_article_id},
|
|
|
|
contentType: 'application/json; charset=UTF-8'
|
|
|
|
});
|
|
|
|
});
|
2013-12-31 13:25:29 +01:00
|
|
|
|
|
|
|
$(document).on('OrderArticle#create', function(e) {
|
|
|
|
$.ajax({
|
|
|
|
url: '#{new_on_order_article_create_finance_order_path(@order)}',
|
|
|
|
type: 'get',
|
|
|
|
data: {order_article_id: e.order_article_id},
|
|
|
|
contentType: 'application/json; charset=UTF-8'
|
|
|
|
});
|
|
|
|
});
|
2013-12-30 13:09:49 +01:00
|
|
|
});
|
2014-01-23 16:17:16 +01:00
|
|
|
= render 'shared/articles_by/common', order: @order
|
2013-12-30 13:09:49 +01:00
|
|
|
|
2013-02-10 09:05:20 +01:00
|
|
|
- title t('.title', name: @order.name)
|
2009-01-10 22:22:16 +01:00
|
|
|
|
2012-11-10 16:44:05 +01:00
|
|
|
- content_for :sidebar do
|
|
|
|
.well.well-small
|
2013-02-10 09:05:20 +01:00
|
|
|
%h3= t('.summary')
|
2012-11-10 16:44:05 +01:00
|
|
|
#summary= render 'summary', order: @order
|
2009-02-06 16:26:35 +01:00
|
|
|
|
2012-11-10 16:44:05 +01:00
|
|
|
.well.well-small
|
2013-02-10 09:05:20 +01:00
|
|
|
%h3= t('.invoice')
|
2012-11-10 16:44:05 +01:00
|
|
|
#invoice= render 'invoice', invoice: @order.invoice
|
2009-01-29 21:28:22 +01:00
|
|
|
|
2012-11-10 16:44:05 +01:00
|
|
|
.well.well-small
|
2013-02-10 09:05:20 +01:00
|
|
|
%h3= t('.notes_and_journal')
|
2009-01-06 11:49:19 +01:00
|
|
|
#note
|
2013-07-26 18:34:03 +02:00
|
|
|
- unless @order.note.blank?
|
2009-01-06 11:49:19 +01:00
|
|
|
= simple_format @order.note
|
|
|
|
- else
|
2013-02-10 09:05:20 +01:00
|
|
|
%p= t('.comment_on_transaction')
|
|
|
|
= link_to t('.edit_note'), edit_note_finance_order_path(@order), remote: true
|
2012-11-10 16:44:05 +01:00
|
|
|
|
|
|
|
.well.well-small
|
2013-02-10 09:05:20 +01:00
|
|
|
%h3= t('.comments')
|
2013-03-12 12:34:05 +01:00
|
|
|
#comments= render :partial => 'shared/comments', locals: {comments: @order.comments.includes(:user)}
|
2012-11-10 16:44:05 +01:00
|
|
|
|
2012-11-12 13:13:01 +01:00
|
|
|
- content_for :actionbar do
|
2014-03-21 10:51:22 +01:00
|
|
|
- unless @order.invoice or @order.stockit?
|
|
|
|
= link_to t('.create_invoice'), new_finance_invoice_path(:order_id => @order, :supplier_id => @order.supplier),
|
|
|
|
class: 'btn'
|
2012-11-12 13:13:01 +01:00
|
|
|
.btn-group
|
|
|
|
- unless @order.closed?
|
2017-10-10 18:20:54 +02:00
|
|
|
- if FoodsoftConfig[:charge_members_manually]
|
|
|
|
= link_to t('.confirm_order'), close_direct_finance_order_path(@order), class: 'btn btn-primary', method: :patch
|
|
|
|
- else
|
|
|
|
= link_to t('.confirm_order'), confirm_finance_order_path(@order), class: 'btn btn-primary'
|
|
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
|
|
|
%li= link_to t('.confirm_order'), confirm_finance_order_path(@order)
|
|
|
|
%li= link_to t('.close_direct'), close_direct_finance_order_path(@order), method: :patch,
|
|
|
|
data: {confirm: t('.close_direct_confirm')}
|
2012-11-10 16:44:05 +01:00
|
|
|
|
2014-06-21 11:27:51 +02:00
|
|
|
#editOrderNav.btn-group
|
2012-11-12 13:13:01 +01:00
|
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
2013-02-10 09:05:20 +01:00
|
|
|
= t('.view_options')
|
2012-11-12 13:13:01 +01:00
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
2013-02-10 09:05:20 +01:00
|
|
|
%li= link_to t('.edit_order'), new_finance_order_path(order_id: @order.id, view: 'edit_results'),
|
2012-11-12 13:13:01 +01:00
|
|
|
remote: true
|
2013-02-10 09:05:20 +01:00
|
|
|
%li= link_to t('.groups_overview'), new_finance_order_path(order_id: @order.id, view: 'groups_overview'),
|
2012-11-12 13:13:01 +01:00
|
|
|
remote: true
|
2013-02-10 09:05:20 +01:00
|
|
|
%li= link_to t('.articles_overview'), new_finance_order_path(order_id: @order.id, view: 'articles_overview'),
|
2012-11-12 13:13:01 +01:00
|
|
|
remote: true
|
2012-11-10 16:44:05 +01:00
|
|
|
|
|
|
|
%section#results
|
|
|
|
= render 'edit_results_by_articles'
|
2013-03-21 22:08:09 +01:00
|
|
|
%p= link_to_top
|