diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 367c7a8b..4c9009d5 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -69,7 +69,7 @@ class Crm::CustomersController < BaseCrmController def create @crm_customers = Customer.new(customer_params) - + respond_to do |format| if @crm_customers.save name = customer_params[:name] @@ -78,6 +78,7 @@ class Crm::CustomersController < BaseCrmController dob = customer_params[:date_of_birth] address = customer_params[:address] nrc = customer_params[:nrc_no] + card_no = customer_params[:card_no] member_group_id = params[:member_group_id] if !member_group_id.nil? @@ -88,16 +89,17 @@ class Crm::CustomersController < BaseCrmController url = membership.gateway_url.to_s + memberaction.gateway_url.to_s begin - response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, - dob: dob,address: address,nrc:nrc, - member_group_id: member_group_id, - merchant_uid:merchant_uid,auth_token:auth_token}.to_json, - :headers => { - 'Content-Type' => 'application/json', - 'Accept' => 'application/json' + response = HTTParty.post(url, + :body => {name: name,phone: phone,email: email, + dob: dob,address: address,nrc:nrc,card_no:card_no, + member_group_id: member_group_id, + merchant_uid:merchant_uid,auth_token:auth_token}.to_json, + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json' }, - :timeout => 10 - ) + :timeout => 10 + ) rescue Net::OpenTimeout response = { status: false } end @@ -150,10 +152,12 @@ end dob = customer_params[:date_of_birth] address = customer_params[:address] nrc = customer_params[:nrc_no] + card_no = customer_params[:card_no] id = @crm_customer.membership_id member_group_id = params[:member_group_id] if id.nil? && !member_group_id.nil? + membership = MembershipSetting.find_by_membership_type("paypar_url") memberaction = MembershipAction.find_by_membership_type("create_membership_customer") merchant_uid = memberaction.merchant_account_id.to_s @@ -161,16 +165,17 @@ end url = membership.gateway_url.to_s + memberaction.gateway_url.to_s begin - response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, - dob: dob,address: address,nrc:nrc, - member_group_id: member_group_id, - merchant_uid:merchant_uid,auth_token:auth_token}.to_json, - :headers => { - 'Content-Type' => 'application/json', - 'Accept' => 'application/json' + response = HTTParty.post(url, + :body => { name: name,phone: phone,email: email, + dob: dob,address: address,nrc:nrc, + card_no:card_no,member_group_id: member_group_id, + merchant_uid:merchant_uid,auth_token:auth_token}.to_json, + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json' }, - :timeout => 10 - ) + :timeout => 10 + ) rescue Net::OpenTimeout response = { status: false } end @@ -186,20 +191,22 @@ end end else + membership = MembershipSetting.find_by_membership_type("paypar_url") memberaction = MembershipAction.find_by_membership_type("update_membership_customer") merchant_uid = memberaction.merchant_account_id.to_s auth_token = memberaction.auth_token.to_s url = membership.gateway_url.to_s + memberaction.gateway_url.to_s begin - response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, - dob: dob,address: address,nrc:nrc, - id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, - :headers => { - 'Content-Type' => 'application/json', - 'Accept' => 'application/json' + response = HTTParty.post(url, + :body => {name: name,phone: phone,email: email, + dob: dob,address: address,nrc:nrc,card_no:card_no, + id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json' }, - :timeout => 10 + :timeout => 10 ) rescue Net::OpenTimeout response = { status: false } diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 96e16cf4..5a86ddfb 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -93,10 +93,10 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do - text "Time In: #{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') }", :size => self.item_font_size,:align => :left + text "Time In: #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }", :size => self.item_font_size,:align => :left end bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do - text "Time Out: #{ sale_data.bookings[0].checkout_at.strftime('%I:%M %p') }" , :size => self.item_font_size,:align => :right + text "Time Out: #{ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p') }" , :size => self.item_font_size,:align => :right end move_down 5 diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index eb121c14..d52c0456 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -11,24 +11,20 @@ <% str="[\"#{msg['name']}\"]" str.gsub!('["', '') str.gsub!('"]', '') %> - <%= str %> + <%= str %> <% end -%>

- - - - + + <%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr", :style=>"width: 30px"%> + + <%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs", :style=>"width: 30px"%> + + <%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss", :style=>"width: 30px"%> + + <%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm", :style=>"width: 30px"%>
"> @@ -37,18 +33,16 @@ <% str="[\"#{msg['name']}\"]" str.gsub!('["', '') str.gsub!('"]', '') %> - <%= str %> + <%= str %> <% end -%>

- - + + <%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%> + + <%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%>
@@ -62,7 +56,7 @@ <% str="[\"#{msg['company']}\"]" str.gsub!('["', '') str.gsub!('"]', '') %> - <%= str %> + <%= str %> <% end -%>
"> @@ -72,7 +66,7 @@ <% str="[\"#{msg['contact_no']}\"]" str.gsub!('["', '') str.gsub!('"]', '') %> - <%= str %> + <%= str %> <% end -%>
@@ -83,7 +77,7 @@ <% str="[\"#{msg['contact_no']}\"]" str.gsub!('["', '') str.gsub!('"]', '') %> - <%= str %> + <%= str %> <% end -%> diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index 67dc46f4..a5ce8550 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -152,7 +152,6 @@ $(document).on('click',".customer_tr",function(){ $("#new_customer").attr('class', 'simple_form edit_customer'); var id = "edit_customer_"+customer_id; - alert(id) $("#new_customer").attr('id', id); $(".edit_customer").attr('id', id); diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 0dead477..c6ec25c2 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -55,12 +55,14 @@
+ <% if @response["status"] == true && $response["data"] != "[]"%> <% if @response["status"] == true %> <% end %> + <% end %> diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 0cd7d85b..d1886423 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -88,18 +88,14 @@

- - - - + + <%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr", :style=>"width: 30px"%> + + <%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs", :style=>"width: 30px"%> + + <%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss", :style=>"width: 30px"%> + + <%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm", :style=>"width: 30px"%>
"> @@ -115,12 +111,10 @@

- - + + <%= f.radio_button :gender,"Male", :class => "gender male", :value=>"Male", :style=>"width: 30px"%> + + <%= f.radio_button :gender,"Female", :class => "gender female", :value=>"Female", :style=>"width: 30px"%>
@@ -161,10 +155,10 @@ <%= f.input :address, :class => "form-control col-md-6 address" %>
-
+
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%> @@ -327,16 +321,4 @@ }) -class CreateDiningQueues < ActiveRecord::Migration[5.1] - def change - create_table :dining_queues do |t| - t.string :name - t.string :contact_no - t.string :queue_no - t.string :status - t.references :dining_facility, foreign_key: true - t.timestamps - end - end -end diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 63b7dab4..49269d58 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -129,8 +129,10 @@
- -

Customer : <%= @customer.name %>

+ <%if @customer %> + +

Customer : <%= @customer.name %>

+ <%end%>
@@ -292,7 +294,7 @@ <% end %> - + <% end %>
diff --git a/app/views/origami/orders/show.html.erb b/app/views/origami/orders/show.html.erb index 92ffc7f1..d2c065a1 100644 --- a/app/views/origami/orders/show.html.erb +++ b/app/views/origami/orders/show.html.erb @@ -189,7 +189,7 @@ <% if @sale_status != 'completed' %> <% end %> - +
Membership TransactionsCurrent Balance : <%= @response["data"][0]["balance"]%>
Date Redeem