diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index e0667a83..8c3d7cc4 100755
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -82,6 +82,7 @@ class HomeController < ApplicationController
@sale_data = Array.new
@total_payment_methods = Sale.total_payment_methods(today)
+
@total_payment_methods.each do |payment|
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb"
pay = Sale.payment_sale('card', today)
@@ -92,7 +93,6 @@ class HomeController < ApplicationController
end
end
@summ_sale = Sale.summary_sale_receipt(today)
- p @summ_sale
@total_customer = Sale.total_customer(today)
@total_dinein = Sale.total_dinein(today)
@total_takeaway = Sale.total_takeaway(today)
diff --git a/app/models/sale.rb b/app/models/sale.rb
index 83d49309..efe63e12 100755
--- a/app/models/sale.rb
+++ b/app/models/sale.rb
@@ -988,7 +988,7 @@ end
end
def self.total_payment_methods(today)
- query = Sale.select("sp.payment_method")
+ query = Sale.select("distinct sp.payment_method")
.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ?',today)
.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
end
@@ -996,7 +996,7 @@ end
def self.payment_sale(payment_method, today)
query = Sale.joins("JOIN sale_payments as sp ON sp.sale_id = sales.sale_id")
if payment_method == 'card'
- query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb"',today)
+ query = query.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb")',today)
else
query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today)
end
diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb
index 218a7f66..2359ad57 100755
--- a/app/views/crm/customers/_new_form.html.erb
+++ b/app/views/crm/customers/_new_form.html.erb
@@ -5,16 +5,16 @@
-
">
@@ -60,7 +60,7 @@
<% str="[\"#{msg['contact_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
- <%= str %>
+ <%= str %>
<% end %>
@@ -71,7 +71,7 @@
<% str="[\"#{msg['email']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
- <%= str %>
+ <%= str %>
<% end %>
@@ -111,7 +111,7 @@
<% str="[\"#{msg['card_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 bf98b80e..168afe28 100755
--- a/app/views/crm/customers/index.html.erb
+++ b/app/views/crm/customers/index.html.erb
@@ -88,22 +88,18 @@
-
-
-
-
- <%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
-
-
+
+
+ <%= render 'new_form', crm_customer: @crm_customer, taxes: @taxes %>
-
+
diff --git a/app/views/origami/in_duties/assign_in_duty.html.erb b/app/views/origami/in_duties/assign_in_duty.html.erb
index 16e32dc7..f24b16d9 100755
--- a/app/views/origami/in_duties/assign_in_duty.html.erb
+++ b/app/views/origami/in_duties/assign_in_duty.html.erb
@@ -4,31 +4,34 @@
<%= simple_form_for([:origami,@in_duty]) do |f| %>
- <%= f.error_notification %>
-
-
- Dining Name:
- <%= @table.name %>
-
-
-
- Commissioner Name:
- <%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %>
- In time
- <%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
- Out time
- <%= f.text_field :out_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
-
-
+
+
+ <%= f.error_notification %>
+
+ Dining Name:
+ <%= @table.name %>
+
+
+
+ Commissioner Name:
+ <%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %>
+ In time
+ <%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
+ Out time
+ <%= f.text_field :out_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
+
+
+
+
<% end %>