Skip to content

Commit

Permalink
order articles by number then name in fax+receive
Browse files Browse the repository at this point in the history
This makes it easier to enter the receive screen from an order pdf print
with received amounts.

Conflicts:
	app/documents/order_fax.rb
  • Loading branch information
wvengen committed Aug 19, 2014
1 parent fd8b9ac commit e61c3c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def finish
def receive
@order = Order.find(params[:id])
unless request.post?
@order_articles = @order.order_articles.ordered.includes(:article)
@order_articles = @order.order_articles.ordered.includes(:article).order('articles.order_number, articles.name')
else
s = update_order_amounts
flash[:notice] = (s ? I18n.t('orders.receive.notice', :msg => s) : I18n.t('orders.receive.notice_none'))
Expand Down
2 changes: 1 addition & 1 deletion app/documents/order_fax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def body
# Articles
total = 0
data = [I18n.t('documents.order_fax.rows')]
data += @order.order_articles.ordered.includes(:article).collect do |a|
data += @order.order_articles.ordered.includes(:article).order('articles.order_number, articles.name').collect do |a|
subtotal = a.units_to_order * a.price.unit_quantity * a.price.price
total += subtotal
[a.article.order_number,
Expand Down
2 changes: 1 addition & 1 deletion app/views/orders/_edit_amounts.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
%thead
%tr
%th.sort{:data => {:sort => 'string'}}= heading_helper Article, :order_number, short: true
%th.default-sort.sort{:data => {:sort => 'string'}}= heading_helper Article, :name
%th.sort{:data => {:sort => 'string'}}= heading_helper Article, :name
%th= heading_helper Article, :unit
%th= heading_helper Article, :price
%th= heading_helper OrderArticle, :quantity, short: true
Expand Down

0 comments on commit e61c3c9

Please sign in to comment.