update discount

This commit is contained in:
Aung Myo
2017-07-11 18:38:55 +06:30
parent 600e8e47f4
commit 3f8a5f8ef2

View File

@@ -159,7 +159,7 @@ class Origami::DiscountsController < BaseOrigamiController
campaign_type_id: campaign_type_id,
receipt_no: receipt_no,
merchant_uid:merchant_uid,
discount_method:arr,
discount_method:arr.to_json,
total_sale_transaction_amount: sale.grand_total,
auth_token:auth_token}.to_json,
:headers => {
@@ -179,6 +179,8 @@ class Origami::DiscountsController < BaseOrigamiController
rescue SocketError
response = { status: false, message: "Can't open membership server "}
end
puts "sssssssss"
puts response.to_json
table_id = sale.bookings[0].dining_facility_id
table_type = DiningFacility.find(table_id).type
@@ -186,7 +188,6 @@ class Origami::DiscountsController < BaseOrigamiController
# Re-calc All Amount in Sale
if response["status"] == true
sale.compute_by_sale_items(sale_id, sale.sale_items, response["discount_earned"])
end
result = {:status=> "Success", :table_id => table_id,:table_type => table_type }
# if response["status"] == false