diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 9648a246..cc00984d 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -70,8 +70,8 @@ class Crm::CustomersController < BaseCrmController # GET /crm/customers/1 # GET /crm/customers/1.json def show - @orders = Order.where("customer_id=?", params[:id]) - @sales = Sale.where("customer_id=?", params[:id]) + @orders = Order.where("customer_id=?", params[:id]).limit(20) + @sales = Sale.where("customer_id=?", params[:id]).limit(20) if @orders @order_items = [] diff --git a/app/controllers/origami/order_reservation_controller.rb b/app/controllers/origami/order_reservation_controller.rb index f4f993d5..81f38324 100644 --- a/app/controllers/origami/order_reservation_controller.rb +++ b/app/controllers/origami/order_reservation_controller.rb @@ -97,7 +97,7 @@ class Origami::OrderReservationController < BaseOrigamiController end def get_order_info - order_reservation = OrderReservation.where("status = 'new' OR status='accepted' OR status='send_to_kitchen' OR status = 'ready_to_delivery'").count() + order_reservation = OrderReservation.where("status = 'new'").count() render :json => order_reservation end diff --git a/app/models/booking.rb b/app/models/booking.rb index 8ba89bd2..46c098b7 100755 --- a/app/models/booking.rb +++ b/app/models/booking.rb @@ -57,7 +57,7 @@ class Booking < ApplicationRecord joins(" LEFT JOIN dining_facilities df ON df.id=bookings.dining_facility_id") .where("booking_id LIKE ? OR checkin_by LIKE ? OR booking_status LIKE? OR checkout_by LIKE? OR sale_id ='#{filter}' OR df.name LIKE ?","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%") end - + .order("sale_id DESC") end private diff --git a/app/models/customer.rb b/app/models/customer.rb index a88f79c0..55a41722 100755 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -336,7 +336,7 @@ class Customer < ApplicationRecord def self.search(search) if search # find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"]) - where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ? OR paypar_account_no ='#{search}'", "%#{search}%", "%#{search}%", "%#{search}%",) + where("name LIKE ? OR customer_type OR contact_no LIKE ? OR card_no LIKE ? OR DATE_FORMAT(date_of_birth,'%Y-%m-%d') LIKE ? OR nrc_no LIKE ? OR gender LIKE ? OR paypar_account_no ='#{search}'", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%") else find(:all) end diff --git a/app/models/sale.rb b/app/models/sale.rb index 6c55c7b7..4890aadf 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -734,7 +734,7 @@ class Sale < ApplicationRecord where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}' and shift_sale_id = ?","%#{filter}%","%#{filter}%",shift.id) end end - + .order("sale_id DESC") end def self.search_credit_sales(customer,filter,from,to,order_source="") diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index c2e0aff4..ef5c76ba 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -90,6 +90,31 @@ <% end %> + +
| <%= t("views.right_panel.detail.sr_no") %> | +<%= t :customer %> <%= t("views.right_panel.detail.type") %> | <%= t("views.right_panel.detail.name") %> | <%= t("views.right_panel.detail.card_no") %> | <%= t("views.right_panel.detail.membership_type") %> | @@ -80,6 +81,7 @@ - <% end %> +<%= crm_customer.customer_type rescue '-' %> | <%= crm_customer.name %> | <%= crm_customer.card_no rescue '-' %> |
@@ -214,6 +216,31 @@
<% end %>
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+ <%= f.file_field :image_path, :class => "img-thumbnail" %>
+
+ @@ -251,31 +278,6 @@ <%= f.input :address, :class => "form-control address" %>
-
-
-
-
-
-
-
-
-
-
-
-
- <%= f.file_field :image_path, :class => "img-thumbnail" %>
-
-
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 2c30cb50..a1f18e30 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -500,6 +500,7 @@ en:
transaction_fee: "Transaction Fee"
checked_by: "Checked By"
order_source: "Order Source"
+ paymal_transactions: "Paymal Transactions"
code_txt: "code "
charge_txt: "charge"
diff --git a/config/locales/mm.yml b/config/locales/mm.yml
index 7360c35f..3af2d40a 100644
--- a/config/locales/mm.yml
+++ b/config/locales/mm.yml
@@ -494,6 +494,7 @@ mm:
transaction_fee: "Transaction Fee"
checked_by: "Checked By"
order_source: "Order Source"
+ paymal_transactions: "Paymal Transactions"
code_txt: "ကုတ်ဒ် "
charge_txt: "ကောက်ခံသည်"
|
|---|