update OQS and cashier

This commit is contained in:
Aung Myo
2017-11-14 09:43:13 +06:30
parent 8db96beca0
commit f1a28d64e1
31 changed files with 378 additions and 171 deletions

View File

@@ -67,7 +67,7 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
@order.guest = params[:guest_info]
@order.table_id = params[:table_id] # this is dining facilities's id
@order.new_booking = true
@order.employee_name = current_login_employee.name
@order.waiters = current_login_employee.name
#Create Table Booking or Room Booking
if !params["booking_id"].nil?
# check booking id is already completed.

View File

@@ -24,6 +24,7 @@ class Origami::HomeController < BaseOrigamiController
@dining.bookings.active.each do |booking|
if booking.sale_id.nil? && booking.booking_status != 'moved'
@order_items = Array.new
booking.booking_orders.each do |booking_order|
order = Order.find(booking_order.order_id)
@@ -31,26 +32,42 @@ class Origami::HomeController < BaseOrigamiController
@obj_order = order
@customer = order.customer
@date = order.created_at
@booking= booking
order.order_items.each do |item|
@order_items.push(item)
end
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
end
end
@status_order = 'order'
else
sale = Sale.find(booking.sale_id)
if sale.sale_status != "completed" && sale.sale_status != 'void'
@sale_array.push(sale)
if @status_order == 'order'
@status_order = 'sale'
end
@booking= booking
@date = sale.created_at
@status_sale = 'sale'
@obj_sale = sale
@customer = sale.customer
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
end
end
end
end
private

View File

@@ -116,6 +116,13 @@ class Origami::PaymentsController < BaseOrigamiController
#get customer amount
@customer = Customer.find(@sale_data.customer_id)
accounts = @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
rebate = MembershipSetting.find_by_rebate(1)
# get member information
if @customer.membership_id != nil && rebate
@@ -136,6 +143,7 @@ class Origami::PaymentsController < BaseOrigamiController
@sale_data.bookings.each do |sbk|
df = DiningFacility.find(sbk.dining_facility_id)
@table_no = df.type + ' ' + df.name
@checkin_time = sbk.checkin_at
break
end

View File

@@ -24,10 +24,12 @@ class Origami::RoomsController < BaseOrigamiController
@order_items = Array.new
booking.booking_orders.each do |booking_order|
order = Order.find(booking_order.order_id)
@customer = order.customer
if (order.status == "new")
@obj_order = order
@customer = order.customer
@date = order.created_at
@booking = booking
order.order_items.each do |item|
@order_items.push(item)
end
@@ -42,6 +44,7 @@ class Origami::RoomsController < BaseOrigamiController
if @status_order == 'order'
@status_order = 'sale'
end
@booking = booking
@date = sale.created_at
@status_sale = 'sale'
@obj_sale = sale