bugs fix for crm

This commit is contained in:
Yan
2017-08-01 11:50:41 +06:30
parent 4f84676547
commit fa901806d4
5 changed files with 16 additions and 14 deletions

View File

@@ -390,11 +390,14 @@ class SalePayment < ApplicationRecord
total_percentage = 0
type_arr = []
response["membership_campaign_data"].each do |a|
data = {:type => a["rules_type"], :percentage => a["change_unit"].to_i * a["base_unit"].to_i}
total_percentage = total_percentage + a["change_unit"].to_i * a["base_unit"].to_i
type_arr.push(data)
# Check for present response fields
if response["membership_campaign_data"].present?
response["membership_campaign_data"].each do |a|
data = {:type => a["rules_type"], :percentage => a["change_unit"].to_i * a["base_unit"].to_i}
total_percentage = total_percentage + a["change_unit"].to_i * a["base_unit"].to_i
type_arr.push(data)
end
end
rebate_arr =[]