Add remove list needs payment functionality

This commit is contained in:
2014-09-01 10:45:11 +02:00
parent f76c883bb9
commit ef7c242018
10 changed files with 46 additions and 3 deletions
+10 -3
View File
@@ -66,7 +66,7 @@ class SupplierController < ApplicationController
ho[:list_id] = order.list_id
list_total += ho[:total_amount]
h[:orders] << ho
end
end
h[:total_amount] = list_total.round(2)
render json: h, layout: 'tablet'
end
@@ -87,7 +87,7 @@ class SupplierController < ApplicationController
hl = list.with_info_as_json
grand_total += hl[:total_amount]
h[:lists] << hl
end
end
h[:total_amount] = grand_total.round(2)
render json: h, layout: 'tablet'
end
@@ -101,13 +101,20 @@ class SupplierController < ApplicationController
render nothing: true
end
# POST /orders/1/is_helped
# POST /supplier/mark_list_as_helped
def mark_list_as_helped
@list = List.find_by_supplier_id_and_id(current_supplier.id, params[:list_id])
@list.is_helped!
render nothing: true
end
#POST /supplier/remove_list_needs_payment
def remove_list_needs_payment
@list = List.find_by_supplier_id_and_id(current_supplier.id, params[:list_id])
@list.remove_needs_payment!
render nothing: true
end
# POST /orders/1/is_being_processed
def mark_order_in_process
@order = Order.find_by_supplier_id_and_id!(current_supplier.id, params[:order_id])