bugs fix for crm
This commit is contained in:
@@ -68,7 +68,6 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
# POST /crm/customers
|
# POST /crm/customers
|
||||||
# POST /crm/customers.json
|
# POST /crm/customers.json
|
||||||
def create
|
def create
|
||||||
|
|
||||||
@crm_customers = Customer.new(customer_params)
|
@crm_customers = Customer.new(customer_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Customer < ApplicationRecord
|
|||||||
validates :contact_no, uniqueness: true, numericality: true
|
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 :email, uniqueness: true,format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }
|
||||||
validates :card_no, uniqueness: true
|
validates :card_no, uniqueness: true
|
||||||
validates :paypar_account_no, uniqueness: true
|
# validates :paypar_account_no, uniqueness: true
|
||||||
|
|
||||||
paginates_per 50
|
paginates_per 50
|
||||||
|
|
||||||
|
|||||||
@@ -390,11 +390,14 @@ class SalePayment < ApplicationRecord
|
|||||||
total_percentage = 0
|
total_percentage = 0
|
||||||
|
|
||||||
type_arr = []
|
type_arr = []
|
||||||
response["membership_campaign_data"].each do |a|
|
# Check for present response fields
|
||||||
data = {:type => a["rules_type"], :percentage => a["change_unit"].to_i * a["base_unit"].to_i}
|
if response["membership_campaign_data"].present?
|
||||||
total_percentage = total_percentage + a["change_unit"].to_i * a["base_unit"].to_i
|
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)
|
type_arr.push(data)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
rebate_arr =[]
|
rebate_arr =[]
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
str.gsub!('["', '')
|
str.gsub!('["', '')
|
||||||
str.gsub!('"]', '') %>
|
str.gsub!('"]', '') %>
|
||||||
<span class="help-block" style="margin-top:-6px"><%= str %></span>
|
<span class="help-block" style="margin-top:-6px"><%= str %></span>
|
||||||
<% end -%>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
str.gsub!('["', '')
|
str.gsub!('["', '')
|
||||||
str.gsub!('"]', '') %>
|
str.gsub!('"]', '') %>
|
||||||
<span class="help-block" style="margin-top:-6px"><%= str %></span>
|
<span class="help-block" style="margin-top:-6px"><%= str %></span>
|
||||||
<% end -%>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
str.gsub!('["', '')
|
str.gsub!('["', '')
|
||||||
str.gsub!('"]', '') %>
|
str.gsub!('"]', '') %>
|
||||||
<span class="help-block" style="margin-top:-6px"><%= str %></span>
|
<span class="help-block" style="margin-top:-6px"><%= str %></span>
|
||||||
<% end -%>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ menu_category1 = MenuCategory.create({menu: menu, name: "Gyoza", alt_name: "Gyoz
|
|||||||
# Gyoza dumpling soup with Udon
|
# Gyoza dumpling soup with Udon
|
||||||
menu_category1_menu_item21 = SimpleMenuItem.create({name: "Gyoza dumpling soup with Udon", alt_name: "Gyoza dumpling soup with Udon",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food })
|
menu_category1_menu_item21 = SimpleMenuItem.create({name: "Gyoza dumpling soup with Udon", alt_name: "Gyoza dumpling soup with Udon",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food })
|
||||||
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item21, price:3000.0, is_on_promotion:false}])
|
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item21, price:3000.0, is_on_promotion:false}])
|
||||||
# Gyoza dumpling soup with Udon
|
# # Gyoza dumpling soup with Udon
|
||||||
menu_category1_menu_item21 = SimpleMenuItem.create({name: "Gyoza dumpling soup with Udon", alt_name: "Gyoza dumpling soup with Udon",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food })
|
# menu_category1_menu_item21 = SimpleMenuItem.create({name: "Gyoza dumpling soup with Udon", alt_name: "Gyoza dumpling soup with Udon",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food })
|
||||||
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item21, price:3000.0, is_on_promotion:false}])
|
# menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item21, price:3000.0, is_on_promotion:false}])
|
||||||
# Gyoza dumpling soup
|
# Gyoza dumpling soup
|
||||||
menu_category1_menu_item22 = SimpleMenuItem.create({name: "Gyoza dumpling soup", alt_name: "Gyoza dumpling soup",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food })
|
menu_category1_menu_item22 = SimpleMenuItem.create({name: "Gyoza dumpling soup", alt_name: "Gyoza dumpling soup",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food })
|
||||||
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item22, price:2500.0, is_on_promotion:false}])
|
menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item22, price:2500.0, is_on_promotion:false}])
|
||||||
|
|||||||
Reference in New Issue
Block a user