check customer

This commit is contained in:
phyusin
2018-04-09 16:59:59 +06:30
parent 4b19afd948
commit 57be26be77
2 changed files with 19 additions and 20 deletions

View File

@@ -352,6 +352,23 @@ class Customer < ApplicationRecord
end
#new customer for doemal
def self.addCustomer(params)
customer = Customer.new
customer.name = params[:name]
customer.email = params[:email]
customer.contact_no = params[:contact_no]
customer.gender = params[:gender]
customer.address = params[:address]
customer.date_of_birth = Time.parse(params[:date_of_birth]).strftime("%Y-%m-%d")
customer.membership_id = params[:membership_id]
customer.customer_type = "Takeaway"
customer.tax_profiles = ["2"]
customer.save
return customer
end
WALKIN = "CUS-000000000001"
TAKEAWAY = "CUS-000000000002"