update rebate and update api

This commit is contained in:
Aung Myo
2017-11-14 18:30:57 +06:30
parent f927d99807
commit 28dbb75774
8 changed files with 39 additions and 32 deletions

View File

@@ -199,7 +199,7 @@ class Origami::DiscountsController < BaseOrigamiController
auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10)
rescue HTTParty::Error
response = {"status": false, "message": "Can't open membership server " }
@@ -215,7 +215,8 @@ class Origami::DiscountsController < BaseOrigamiController
else
response = {"status": false, "message": "You have no selected discount item" }
end
puts "discount"
puts response.to_json
# Re-calc All Amount in Sale
if response["status"] == true
discount_amount = response["discount_earned"]
@@ -229,7 +230,7 @@ class Origami::DiscountsController < BaseOrigamiController
else
result = {:status=> response["message"],:title=>"Alert", :table_id => table_id,:table_type => table_type }
end
render :json => result.to_json
end #end Is Card Payment

View File

@@ -81,7 +81,7 @@ class Origami::PaymentsController < BaseOrigamiController
# get member information
rebate = MembershipSetting.find_by_rebate(1)
if customer.membership_id != nil && rebate
member_info = Customer.get_member_account(customer)
member_info = Customer.get_member_account(customer)
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
end
@@ -127,8 +127,9 @@ class Origami::PaymentsController < BaseOrigamiController
# get member information
if @customer.membership_id != nil && rebate
response = Customer.get_member_account(@customer)
puts response.to_json
if response["status"]==true
response["data"].each do |res|
response["account_data"].each do |res|
if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount"
@balance += res["balance"]
# @accountable_type = res["accountable_type"]

View File

@@ -45,7 +45,7 @@ class Origami::VoucherController < BaseOrigamiController
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
'Accept' => 'application/json; version=2'
}, :timeout => 10
)
rescue Net::OpenTimeout