accounts and discount updated
This commit is contained in:
@@ -19,6 +19,8 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
|
||||
if Sale.exists?(sale_id)
|
||||
sale = Sale.find(sale_id)
|
||||
table_id = sale.bookings[0].dining_facility_id
|
||||
table_type = DiningFacility.find(table_id).type
|
||||
sale.total_discount = overall_discount.to_f
|
||||
sale.total_amount = sub_total.to_f
|
||||
sale.grand_total = (sub_total.to_f - overall_discount.to_f) + sale.total_tax;
|
||||
@@ -44,7 +46,10 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
sale_item.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
dining = {:table_id => table_id, :table_type => table_type }
|
||||
render :json => dining.to_json
|
||||
end
|
||||
|
||||
#discount for selected order
|
||||
|
||||
Reference in New Issue
Block a user