accounts and discount updated

This commit is contained in:
Yan
2017-06-23 17:05:08 +06:30
parent 55c8ab80da
commit 3a0e26b2ea
14 changed files with 114 additions and 59 deletions

View File

@@ -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