update conflix split pull

This commit is contained in:
Aung Myo
2018-02-28 17:04:35 +06:30
52 changed files with 2027 additions and 437 deletions

View File

@@ -90,14 +90,17 @@ class Origami::HomeController < BaseOrigamiController
# @assigned_order_items.push({item.order_items_id => assigned_order_items.assigned_order_item_id})
# end
end
accounts = @customer.tax_profiles
puts accounts.to_json
puts "sssssssssss"
puts @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
@account_arr = Array.new
if @customer.tax_profiles
accounts = @customer.tax_profiles
puts accounts.to_json
puts "sssssssssss"
puts @customer.tax_profiles
@account_arr =[]
accounts.each do |acc|
account = TaxProfile.find(acc)
@account_arr.push(account)
end
end
end
end

View File

@@ -58,7 +58,7 @@ class Origami::RoomsController < BaseOrigamiController
@room.bookings.active.each do |booking|
if booking.sale_id.nil? && booking.booking_status != 'moved'
@order_items = Array.new
@assigned_order_items = Array.new
# @assigned_order_items = Array.new
booking.booking_orders.each do |booking_order|
order = Order.find(booking_order.order_id)
@customer = order.customer
@@ -79,10 +79,10 @@ class Origami::RoomsController < BaseOrigamiController
item.set_menu_items = arr_instance_item_sets
end
@order_items.push(item)
assigned_order_items = AssignedOrderItem.find_by_item_code_and_instance_code_and_order_id(item.item_code,item.item_instance_code,item.order_id)
if !assigned_order_items.nil?
@assigned_order_items.push({item.order_items_id => assigned_order_items.assigned_order_item_id})
end
# assigned_order_items = AssignedOrderItem.find_by_item_code_and_instance_code_and_order_id(item.item_code,item.item_instance_code,item.order_id)
# if !assigned_order_items.nil?
# @assigned_order_items.push({item.order_items_id => assigned_order_items.assigned_order_item_id})
# end
end
end
end

View File

@@ -61,7 +61,21 @@ class Origami::ShiftsController < BaseOrigamiController
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
close_cashier_pdf = Lookup.collection_of("print_settings")
unique_code = "CloseCashierPdf"
if !close_cashier_pdf.empty?
close_cashier_pdf.each do |close_cashier|
if close_cashier[0] == 'CloseCashierCustomisePdf'
if close_cashier[1] == '1'
unique_code="CloseCashierCustomisePdf"
else
unique_code="CloseCashierPdf"
end
end
end
end
shop_details = Shop.find(1)
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
@@ -73,12 +87,16 @@ class Origami::ShiftsController < BaseOrigamiController
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
@total_dinein = ShiftSale.get_total_dinein(@shift).total_dinein_amount
@total_takeway = ShiftSale.get_total_takeway(@shift).total_takeway_amount
@total_other_charges = ShiftSale.get_total_other_charges(@shift).total_other_charges_amount
# get printer info
print_settings = PrintSetting.find_by_unique_code(unique_code)
#byebug
printer = Printer::CashierStationPrinter.new(print_settings)
printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges)
end
end
Employee.logout(session[:session_token])
@@ -102,8 +120,7 @@ class Origami::ShiftsController < BaseOrigamiController
# Calculate price_by_accounts
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
end
end

View File

@@ -147,15 +147,15 @@ class Origami::SplitBillController < BaseOrigamiController
end
end
# puts order_id
# puts order_ids.count
# puts order_id_count
# puts order_items.count
# puts order_item_count
puts order_id
puts order_ids.count
puts order_id_count
puts order_items.count
puts order_item_count
if !order_id.nil?
if order_id_count > 1
# puts "order_id_count > 1"
puts "order_id_count > 1"
updated_order_id = Array.new
order_ids.each do |odr_id|
@@ -165,8 +165,8 @@ class Origami::SplitBillController < BaseOrigamiController
end
end
# puts "updated_order_id"
# puts updated_order_id
puts "updated_order_id"
puts updated_order_id
if !updated_order_id.empty?
order_ids.each do |odr_id|
@@ -195,7 +195,7 @@ class Origami::SplitBillController < BaseOrigamiController
end
end
# puts new_order_status
puts new_order_status
if new_order_status
BookingOrder.find_by_order_id(odr_id).delete
@@ -223,7 +223,7 @@ class Origami::SplitBillController < BaseOrigamiController
end
end
else
# puts "order_id_count < 1"
puts "order_id_count < 1"
new_order_status = true
order_items.each do |order_item|
orderItem = OrderItem.find_by_order_id(order_id)
@@ -236,7 +236,7 @@ class Origami::SplitBillController < BaseOrigamiController
end
end
# puts new_order_status
puts new_order_status
if new_order_status
BookingOrder.find_by_order_id(order_id).delete
@@ -266,7 +266,9 @@ class Origami::SplitBillController < BaseOrigamiController
end
end
else
if order_ids.count == 1 && order_id_count > 0 && order_item_count == 1
# puts order_ids
if order_ids.count == 1 && order_id_count == 0 && order_item_count == 1
BookingOrder.find_by_order_id(order_ids[0]).delete
BookingOrder.create({:booking_id => booking.booking_id, :order_id => order_ids[0]})
order_items.each do |order_item|
update_order_item(order_ids[0], order_item)