Second part of admin-namespace-reorder. Also renamed OrderGroup into Ordergroup. More view-sharing between groups is neccessary.
This commit is contained in:
parent
2d5dc03b90
commit
fadc951208
83 changed files with 410 additions and 518 deletions
|
|
@ -98,11 +98,11 @@ class Finance::BalancingController < ApplicationController
|
|||
end
|
||||
|
||||
# Creates a new GroupOrderArticleResult
|
||||
# If the the chosen OrderGroup hasn't ordered yet, a GroupOrderResult will created
|
||||
# If the the chosen Ordergroup hasn't ordered yet, a GroupOrderResult will created
|
||||
def createGroupResult
|
||||
@result = GroupOrderArticleResult.new(params[:group_order_article_result])
|
||||
order = @result.order_article_result.order
|
||||
orderGroup = OrderGroup.find(params[:group_order_article_result][:group_order_result_id])
|
||||
orderGroup = Ordergroup.find(params[:group_order_article_result][:group_order_result_id])
|
||||
# creates a new GroupOrderResult if necessary
|
||||
unless @result.group_order_result = GroupOrderResult.find(:first,
|
||||
:conditions => ["group_order_results.group_name = ? AND group_order_results.order_id = ?", orderGroup.name, order.id ])
|
||||
|
|
@ -208,12 +208,12 @@ class Finance::BalancingController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# before the order will booked, a view lists all OrderGroups and its order_prices
|
||||
# before the order will booked, a view lists all Ordergroups and its order_prices
|
||||
def confirm
|
||||
@order = Order.find(params[:id])
|
||||
end
|
||||
|
||||
# Balances the Order, Update of the OrderGroup.account_balances
|
||||
# Balances the Order, Update of the Ordergroup.account_balances
|
||||
def close
|
||||
@order = Order.find(params[:id])
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ class Finance::TransactionsController < ApplicationController
|
|||
|
||||
conditions = "name LIKE '%#{params[:query]}%'" unless params[:query].nil?
|
||||
|
||||
@total = OrderGroup.count(:conditions => conditions)
|
||||
@groups = OrderGroup.paginate :conditions => conditions, :page => params[:page], :per_page => @per_page, :order => sort
|
||||
@total = Ordergroup.count(:conditions => conditions)
|
||||
@groups = Ordergroup.paginate :conditions => conditions, :page => params[:page], :per_page => @per_page, :order => sort
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
@ -36,7 +36,7 @@ class Finance::TransactionsController < ApplicationController
|
|||
end
|
||||
|
||||
def list
|
||||
@group = OrderGroup.find(params[:id])
|
||||
@group = Ordergroup.find(params[:id])
|
||||
|
||||
if params['sort']
|
||||
sort = case params['sort']
|
||||
|
|
@ -69,12 +69,12 @@ class Finance::TransactionsController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
@group = OrderGroup.find(params[:id])
|
||||
@group = Ordergroup.find(params[:id])
|
||||
@financial_transaction = @group.financial_transactions.build
|
||||
end
|
||||
|
||||
def create
|
||||
@group = OrderGroup.find(params[:financial_transaction][:order_group_id])
|
||||
@group = Ordergroup.find(params[:financial_transaction][:ordergroup_id])
|
||||
amount = params[:financial_transaction][:amount]
|
||||
note = params[:financial_transaction][:note]
|
||||
begin
|
||||
|
|
@ -97,7 +97,7 @@ class Finance::TransactionsController < ApplicationController
|
|||
params[:financial_transactions].each do |trans|
|
||||
# ignore empty amount fields ...
|
||||
unless trans[:amount].blank?
|
||||
OrderGroup.find(trans[:order_group_id]).addFinancialTransaction trans[:amount], note, @current_user
|
||||
Ordergroup.find(trans[:ordergroup_id]).addFinancialTransaction trans[:amount], note, @current_user
|
||||
end
|
||||
end
|
||||
flash[:notice] = 'Saved all transactions successfully'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue