Merge branch 'r-1902001-01' into foodcourt

This commit is contained in:
Thein Lin Kyaw
2020-07-11 04:00:55 +06:30
99 changed files with 2085 additions and 1781 deletions

View File

@@ -87,6 +87,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
def current_shift_order_count
@current_shift = ShiftSale.current_shift
status = ['completed', 'void']
@pending_sales = Sale.where('shift_sale_id = ? AND sale_status NOT IN (?)', @current_shift.id, status)
@pending_orders = Sale.pending_order('food_court')
@occupied_table = @pending_sales.length + @pending_orders.length
@@ -97,10 +98,10 @@ class Foodcourt::OrdersController < BaseFoodcourtController
@cashier_type = "food_court"
today = DateTime.now
day = Date.today.wday
@menus = []
@menu = []
if params[:id].include? "BKI"
@table_id = nil
@table = nil
@@ -266,7 +267,7 @@ class Foodcourt::OrdersController < BaseFoodcourtController
if ["quick_service", "food_court"].include? order.source
redirect_to "/foodcourt/sale/#{sale_data.sale_id}/food_court/payment#"
end
#
#
end
def completed

View File

@@ -69,8 +69,6 @@ class Foodcourt::ShiftsController < BaseFoodcourtController
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# if !close_cashier_print[0].nil?
# @close_cashier_print = close_cashier_print[0][1]
# end
@@ -112,6 +110,7 @@ class Foodcourt::ShiftsController < BaseFoodcourtController
@total_takeway = ShiftSale.get_total_takeway(@shift).total_takeway_amount
@total_other_charges = ShiftSale.get_total_other_charges(@shift).total_other_charges_amount
@total_credit_payments = ShiftSale.get_shift_sales_with_credit_payment(shift_id).total_credit_payments
@payment_methods = PaymentMethodSetting.where("is_active='1'").pluck("payment_method")
# get printer info
print_settings = PrintSetting.find_by_unique_code(unique_code)
@@ -125,7 +124,7 @@ class Foodcourt::ShiftsController < BaseFoodcourtController
end
find_close_cashier_print = Lookup.collection_of('close_cashier_print')
if find_close_cashier_print[0][1].to_i > 0
printer.print_close_cashier(print_settings,cashier_terminal,@shift, @sale_items, @total_other_charges_info, shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments,"foocourt")
printer.print_close_cashier(print_settings,cashier_terminal,@shift, @sale_items, @total_other_charges_info, shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments,@payment_methods,"foodcourt")
end
end
end

View File

@@ -8,11 +8,6 @@ class Foodcourt::VoidController < BaseFoodcourtController
access_code = params[:access_code]
if Sale.exists?(sale_id)
sale = Sale.find_by_sale_id(sale_id)
if sale.discount_type == "member_discount"
sale.update_attributes(total_discount: 0)
sale.compute_by_sale_items(0, nil, order_source)
end
# update count for shift sale
if(sale.sale_status == "completed")
if sale.shift_sale_id != nil
@@ -28,6 +23,11 @@ class Foodcourt::VoidController < BaseFoodcourtController
end
end
if sale.discount_type == "member_discount"
sale.update_attributes(total_discount: 0)
sale.compute_by_sale_items(0, nil, order_source)
end
sale.rounding_adjustment = 0.0
sale.payment_status = 'void'
sale.sale_status = 'void'