Skip to content

Commit

Permalink
filter supplier for closed orders
Browse files Browse the repository at this point in the history
  • Loading branch information
mjavurek committed Mar 23, 2021
1 parent 69732cc commit 196c12b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
36 changes: 23 additions & 13 deletions app/views/finance/balancing/_orders.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
- 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 +21,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')
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ de:
name: Lieferantin
no_closed_orders: Derzeit gibt es keine beendeten Bestellungen.
state: Status
show_all: (alle anzeigen)
summary:
changed: Daten wurden verändert!
duration: von %{starts} bis %{ends}
Expand Down
20 changes: 19 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ en:
ordergroup: Ordergroup
user: Entered by
financial_transaction_class:
ignore_for_account_balance: Ignore for account balance
name: Name
financial_transaction_type:
bank_account: Bank Account
Expand Down Expand Up @@ -603,6 +604,7 @@ en:
use_boxfill: When enabled, near end of an order, members are only able to change their order when increases the total amount ordered. This helps to fill any remaining boxes. You still need to set a box-fill date for the orders.
use_iban: When enabled, supplier and user provide an additonal field for storing the international bank account number.
use_nick: Show and use nicknames instead of real names. When enabling this, please check that each user has a nickname.
use_self_service: When enabled, members are able to use selected balancing functions on their own.
webstats_tracking_code: Tracking code for web analytics (like Piwik or Google analytics). Leave empty for no tracking.
keys:
applepear_url: Apple system help URL
Expand Down Expand Up @@ -660,6 +662,7 @@ en:
use_boxfill: Box-fill phase
use_iban: Use IBAN
use_nick: Use nicknames
use_self_service: Use self service
webstats_tracking_code: Tracking code
tabs:
applications: Apps
Expand Down Expand Up @@ -824,6 +827,7 @@ en:
name: Supplier
no_closed_orders: At the moment there are no closed orders.
state: State
show_all: (show all)
summary:
changed: Data was changed!
duration: From %{starts} till %{ends}
Expand Down Expand Up @@ -1146,6 +1150,7 @@ en:
since: "(member for %{when})"
title: "%{user}"
reference_calculator:
transaction_types_headline: Purpose
placeholder: Please enter the amounts you want to tranfser in every field first, to see the reference you should use for that transaction.
text0: Please transfer
text1: with the reference
Expand Down Expand Up @@ -1291,6 +1296,18 @@ en:
Kind regards from %{foodcoop}.
order_received:
subject: 'Order delivery registered: %{name}'
text0: |
Dear %{ordergroup},
the order for "%{order}" has been received.
abundant_articles: Received too much
scarce_articles: Received too little
article_details: |
o %{name}:
-- Ordered: %{ordered} x %{unit}
-- Received: %{received} x %{unit}
order_result_supplier:
subject: New order for %{name}
text: |
Expand Down Expand Up @@ -1336,7 +1353,7 @@ en:
text1: |
In order to choose a new password follow this link: %{link}
This link works only once and expires on %{expires}.
You can always use "Forgot password?" to get an new link.
You can always use "Forgot password?" to get a new link.
Kind regards from %{foodcoop}.
Expand Down Expand Up @@ -1627,6 +1644,7 @@ en:
notify:
negative_balance: Inform me when my ordergroup has a negative balance.
order_finished: Inform me about my order result (when the order is closed).
order_received: Inform me about delivery details (after order has been received).
upcoming_tasks: Remind me of upcoming tasks.
profile:
email_is_public: Email is visible for other members.
Expand Down

0 comments on commit 196c12b

Please sign in to comment.