Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supplier filters #863

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions app/views/finance/balancing/_orders.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
- title " "+t('.for')+" "+Supplier.find(params[:supplier_id]).name if params.has_key?(:supplier_id)
- unless @orders.empty?
- content_for :actionbar do
.btn-group
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
= t '.name'
%span.caret
%ul.dropdown-menu
%li= link_to t('.show_all'), "?"
- Supplier.undeleted.order(:name).each do |supplier|
%li= link_to supplier.name, "?" + {:supplier_id => supplier.id}.to_query
- if Order.finished.count > 20
= items_per_page
= pagination_links_remote @orders
Expand All @@ -12,18 +22,19 @@
%th
%tbody
- @orders.each do |order|
%tr{:class => cycle("even","odd", :name => "order")}
%td= link_to truncate(order.name), new_finance_order_path(order_id: order.id)
%td=h format_time(order.ends) unless order.ends.nil?
%td= order.closed? ? t('.cleared', amount: number_to_currency(order.foodcoop_result)) : t('.ended')
%td= show_user(order.updated_by)
%td
- unless order.closed?
- if current_user.role_orders?
- unless order.stockit?
= link_to t('orders.index.action_receive'), receive_order_path(order), class: 'btn btn-small'
- else
= link_to t('orders.index.action_receive'), '#', class: 'btn btn-small disabled'
= link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-small btn-primary'
- if !params.has_key?(:supplier_id) || order.supplier.id.to_s == params[:supplier_id]
%tr{:class => cycle("even","odd", :name => "order")}
%td= link_to truncate(order.name), new_finance_order_path(order_id: order.id)
%td=h format_time(order.ends) unless order.ends.nil?
%td= order.closed? ? t('.cleared', amount: number_to_currency(order.foodcoop_result)) : t('.ended')
%td= show_user(order.updated_by)
%td
- unless order.closed?
- if current_user.role_orders?
- unless order.stockit?
= link_to t('orders.index.action_receive'), receive_order_path(order), class: 'btn btn-small'
- else
= link_to t('orders.index.action_receive'), '#', class: 'btn btn-small disabled'
= link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-small btn-primary'
- else
%i= t('.no_closed_orders')
2 changes: 2 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,8 @@ de:
name: Lieferantin
no_closed_orders: Derzeit gibt es keine beendeten Bestellungen.
state: Status
show_all: (alle anzeigen)
for: für
summary:
changed: Daten wurden verändert!
duration: von %{starts} bis %{ends}
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ en:
name: Supplier
no_closed_orders: At the moment there are no closed orders.
state: State
show_all: (show all)
for: for
summary:
changed: Data was changed!
duration: From %{starts} till %{ends}
Expand Down