update query data for origami
This commit is contained in:
@@ -28,7 +28,7 @@ class Api::OrdersController < Api::ApiController
|
||||
@order = Order.new
|
||||
@order.source = params[:order_source]
|
||||
@order.order_type = params[:order_type]
|
||||
@order.customer_id = params[:customer_id]
|
||||
@order.customer_id = params[:customer_id] == ""? "CUS-000000000001" : params[:customer_id] # for no customer id from mobile
|
||||
@order.items = params[:order_items]
|
||||
@order.guest = params[:guest_info]
|
||||
@order.table_id = params[:table_id]
|
||||
|
||||
@@ -4,7 +4,7 @@ class Crm::CustomersController < ApplicationController
|
||||
# GET /crm/customers
|
||||
# GET /crm/customers.json
|
||||
def index
|
||||
@crm_customers = Crm::Customer.all
|
||||
@crm_customers = Customer.all
|
||||
end
|
||||
|
||||
# GET /crm/customers/1
|
||||
@@ -14,7 +14,7 @@ class Crm::CustomersController < ApplicationController
|
||||
|
||||
# GET /crm/customers/new
|
||||
def new
|
||||
@crm_customer = Crm::Customer.new
|
||||
@crm_customer = Customer.new
|
||||
end
|
||||
|
||||
# GET /crm/customers/1/edit
|
||||
@@ -24,7 +24,7 @@ class Crm::CustomersController < ApplicationController
|
||||
# POST /crm/customers
|
||||
# POST /crm/customers.json
|
||||
def create
|
||||
@crm_customer = Crm::Customer.new(crm_customer_params)
|
||||
@crm_customer = Customer.new(crm_customer_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @crm_customer.save
|
||||
@@ -64,7 +64,7 @@ class Crm::CustomersController < ApplicationController
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_crm_customer
|
||||
@crm_customer = Crm::Customer.find(params[:id])
|
||||
@crm_customer = Customer.find(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
|
||||
@@ -35,15 +35,15 @@ class Oqs::HomeController < BaseOqsController
|
||||
|
||||
# Query for OQS with status
|
||||
def queue_items_query(status)
|
||||
AssignedOrderItem.select("assigned_order_items.id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at")
|
||||
.joins("join order_queue_process_by_zones as oqpz ON oqpz.order_queue_station_id = assigned_order_items.order_queue_station_id
|
||||
left join dining_facilities as df on df.zone_id = oqpz.zone_id
|
||||
left join order_queue_stations as oqs ON oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join orders as od ON od.id = assigned_order_items.order_id
|
||||
left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
left join order_items as odt ON odt.item_code = assigned_order_items.item_code
|
||||
left join customers as cus ON cus.id = od.customer_id")
|
||||
left join customers as cus ON cus.customer_id = od.customer_id")
|
||||
.where("assigned_order_items.delivery_status = #{status}")
|
||||
.group("assigned_order_items.id")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
.order("odt.item_name DESC")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@ class Oqs::PrintController < ApplicationController
|
||||
def print
|
||||
unique_code="OrderItemPdf"
|
||||
assigned_item_id=params[:id]
|
||||
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where('id='+assigned_item_id)
|
||||
assigned_order_item=AssignedOrderItem.select("order_id, item_code").where('assigned_order_item_id='+assigned_item_id)
|
||||
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||
@@ -13,4 +13,19 @@ class Oqs::PrintController < ApplicationController
|
||||
assigned_item.print_status=true
|
||||
assigned_item.save
|
||||
end
|
||||
|
||||
def print_order_summary
|
||||
unique_code="OrderSummaryPdf"
|
||||
assigned_item_id=params[:id]
|
||||
assigned_order_item=AssignedOrderItem.select("order_id").where('assigned_order_item_id='+assigned_item_id)
|
||||
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||
order_queue_printer.print_order_summary(print_settings,assigned_order_item[0].order_id)
|
||||
|
||||
# update print status when complete click
|
||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_item.print_status=true
|
||||
assigned_item.save
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,13 +3,15 @@ class Origami::RequestBillsController < BaseOrigamiController
|
||||
@sale = Sale.new
|
||||
|
||||
booking_id = params[:id]
|
||||
check_booking = Booking.find_by_id(booking_id)
|
||||
check_booking = Booking.find_by_booking_id(booking_id)
|
||||
if check_booking.sale_id.nil?
|
||||
#check if it doesn't exist
|
||||
@status = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee.name)
|
||||
@sale_data = Sale.find_by_id(check_booking.sale_id)
|
||||
@sale_data = Sale.find_by_sale_id(check_booking.sale_id)
|
||||
@sale_items = SaleItem.where("sale_id=?",check_booking.sale_id)
|
||||
else
|
||||
@sale_data = Sale.find_by_sale_id(check_booking.sale_id)
|
||||
@sale_items = SaleItem.where("sale_id=?",check_booking.sale_id)
|
||||
|
||||
end
|
||||
|
||||
unique_code="ReceiptBillPdf"
|
||||
@@ -21,4 +23,5 @@ class Origami::RequestBillsController < BaseOrigamiController
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -41,7 +41,7 @@ class Settings::MenuItemInstancesController < ApplicationController
|
||||
category = MenuCategory.find(catID.menu_category_id)
|
||||
respond_to do |format|
|
||||
if @settings_menu_item_instances.save
|
||||
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes]
|
||||
@settings_menu_item_instances.item_attributes = params[:menu_item_instance][:item_attributes].reject(&:blank?)
|
||||
@settings_menu_item_instances.save
|
||||
format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully created.' }
|
||||
format.json { render :show, status: :created, location: @settings_menu_item_instances }
|
||||
|
||||
Reference in New Issue
Block a user