diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index ec826416..c67fece5 100644 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -60,6 +60,7 @@ class Origami::CustomersController < BaseOrigamiController id = params[:sale_id][0,3] customer_id = params[:customer_id] + customer = Customer.find(customer_id) # Check and find with card no # if(!customer_id.include? "CUS") @@ -74,7 +75,7 @@ class Origami::CustomersController < BaseOrigamiController status = sale.update_attributes(customer_id: customer_id) sale.sale_orders.each do |sale_order| order = Order.find(sale_order.order_id) - status = order.update_attributes(customer_id: customer_id) + status = order.update_attributes(customer_id: customer_id,order_type:customer.customer_type) end else @booking = BookingOrder.find_by_order_id(params[:sale_id]) @@ -82,7 +83,7 @@ class Origami::CustomersController < BaseOrigamiController @orders.each do |bo| order = Order.find(bo.order_id) - status = order.update_attributes(customer_id: customer_id) + status = order.update_attributes(customer_id: customer_id,order_type:customer.customer_type) end end diff --git a/app/models/sale.rb b/app/models/sale.rb index 9f4ae9f7..1e47af6f 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -91,7 +91,7 @@ class Sale < ApplicationRecord add_item(item) end - # link_order_sale(order.id) + link_order_sale(order.id) end self.save! diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 81e14467..824618e6 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -1,16 +1,19 @@ +
<%= form_tag oqs_root_path, :method => :get do %> -
- -
+
+ +
-
- -
-<% end %> +
+ +
+ + <% end %>
+
diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index e3193a98..05094504 100644 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -109,7 +109,7 @@ <%if current_login_employee.role == "cashier" && @shop.quick_sale_summary == true%> - + <%end%>