bugs fix for crm
This commit is contained in:
@@ -10,7 +10,7 @@ class Customer < ApplicationRecord
|
||||
validates :contact_no, uniqueness: true, numericality: true
|
||||
validates :email, uniqueness: true,format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }
|
||||
validates :card_no, uniqueness: true
|
||||
validates :paypar_account_no, uniqueness: true
|
||||
# validates :paypar_account_no, uniqueness: true
|
||||
|
||||
paginates_per 50
|
||||
|
||||
|
||||
@@ -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 =[]
|
||||
|
||||
Reference in New Issue
Block a user