Add remove list needs payment functionality
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user