update lookup

This commit is contained in:
Aung Myo
2017-07-31 17:33:06 +06:30
parent bc5a7d01f7
commit b3c77fc28c
6 changed files with 32 additions and 22 deletions

View File

@@ -400,10 +400,8 @@ class SalePayment < ApplicationRecord
rebate_arr =[]
campaign_method.each do |a|
data = {:type => a[:type], :amount => a[:amount]}
puts data
type_arr.each do |si|
if si[:type] == a[:type]
puts "steeeeeeeeeeeee"
amount = (redeem_amount / total_percentage)*si[:percentage]
actual = a[:amount] - amount
data[:amount] = actual
@@ -413,7 +411,7 @@ class SalePayment < ApplicationRecord
rebate_arr.push(data)
end
total_amount = rebate_prices - payparcost - overall_dis
if credit == 1
@@ -454,7 +452,6 @@ class SalePayment < ApplicationRecord
response = { "status": false, "message": "Can't connect server"}
end
return response
end
else
response = { "status": "no_member", "message": "Not membership"}