5b309d3d51
When there are many suppliers to be able to select them for invoices, the menu for creating new orders gets unclear.
68 lines
2.7 KiB
Text
68 lines
2.7 KiB
Text
- title t('.title')
|
|
|
|
- content_for :actionbar do
|
|
.btn-group
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn btn-primary dropdown-toggle' do
|
|
= t '.new_order'
|
|
%span.caret
|
|
%ul.dropdown-menu
|
|
- Supplier.where(id: Article.undeleted.select(:supplier_id).distinct).order('suppliers.name ASC').each do |supplier|
|
|
%li= link_to supplier.name, new_order_path(supplier_id: supplier.id), tabindex: -1
|
|
|
|
.well
|
|
- if not @open_orders.empty?
|
|
%h2= t '.orders_open'
|
|
- elsif not @finished_orders.empty?
|
|
%h2= t '.orders_finished'
|
|
- else
|
|
= t '.no_open_or_finished_orders'
|
|
- unless @open_orders.empty? and @finished_orders.empty?
|
|
%table.table.table-striped
|
|
%thead
|
|
%tr
|
|
%th= heading_helper Order, :name
|
|
%th= heading_helper Order, :ends
|
|
%th= heading_helper Order, :note
|
|
%th{colspan: "2"}
|
|
%tbody
|
|
- unless @open_orders.empty?
|
|
- for order in @open_orders
|
|
- tr_class = " active" if order.expired?
|
|
%tr{class: tr_class}
|
|
%td= order.name
|
|
%td= format_time(order.ends) unless order.ends.nil?
|
|
%td= truncate(order.note)
|
|
%td= link_to t('.action_end'), finish_order_path(order),
|
|
data: {confirm: t('.confirm_end', order: order.name)}, method: :post,
|
|
class: 'btn btn-small btn-success'
|
|
|
|
%td
|
|
= link_to t('ui.edit'), edit_order_path(order), class: 'btn btn-small'
|
|
= link_to t('ui.show'), order, class: 'btn btn-small'
|
|
= link_to t('ui.delete'), order, data: {confirm: t('.confirm_delete')}, method: :delete,
|
|
class: 'btn btn-small btn-danger'
|
|
|
|
- unless @finished_orders.empty?
|
|
- unless @open_orders.empty?
|
|
%tr
|
|
%td{colspan: 6}
|
|
%h2= t '.orders_finished'
|
|
- for order in @finished_orders
|
|
%tr
|
|
%td= order.name
|
|
%td= format_time(order.ends)
|
|
%td= truncate(order.note)
|
|
%td
|
|
- unless order.stockit?
|
|
-# TODO btn-success class only if not received before
|
|
= link_to t('.action_receive'), receive_order_path(order), class: 'btn btn-small btn-success'
|
|
|
|
%td
|
|
= link_to t('ui.edit'), '#', class: 'btn btn-small disabled', tabindex: -1
|
|
= link_to t('ui.show'), order, class: 'btn btn-small'
|
|
= link_to t('ui.delete'), order, data: {confirm: t('.confirm_delete')}, method: :delete,
|
|
class: 'btn btn-small btn-danger'
|
|
|
|
%h2= t '.orders_settled'
|
|
#orders_table
|
|
= render partial: 'orders'
|