add dashboard settings and customer create

This commit is contained in:
phyusin
2018-07-13 18:00:49 +06:30
parent 0096c1479d
commit 4783e35942
17 changed files with 106 additions and 45 deletions

View File

@@ -43,6 +43,19 @@ class Crm::CustomersController < BaseCrmController
@filter = filter
#for create customer on/off
@create_flag = true
lookup_customer = Lookup.collection_of('customer_settings')
if !lookup_customer.empty?
lookup_customer.each do |create_setting|
if create_setting[0].downcase == "create"
if create_setting[1] == '0' && current_login_employee.role == 'cashier'
@create_flag = false
end
end
end
end
# if flash["errors"]
# @crm_customer.valid?
# end
@@ -197,7 +210,7 @@ class Crm::CustomersController < BaseCrmController
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page], notice: 'Customer was successfully created.' + response["message"]}
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' + response["message"] }
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' }
end
end
else