update shift only if sales completed
This commit is contained in:
@@ -34,15 +34,6 @@ class Origami::VoidController < BaseOrigamiController
|
||||
sale.sale_status = 'void'
|
||||
sale.save
|
||||
|
||||
# No Need
|
||||
# bookings = sale.bookings
|
||||
# bookings.each do |booking|
|
||||
# orders = booking.orders
|
||||
# orders.each do |order|
|
||||
# # order.status = 'void'
|
||||
# end
|
||||
# end
|
||||
|
||||
if table = sale.booking.dining_facility
|
||||
unless table.current_bookings.exists?
|
||||
table.update_attributes(status: 'available')
|
||||
@@ -59,20 +50,10 @@ class Origami::VoidController < BaseOrigamiController
|
||||
sale_audit = SaleAudit.record_audit_for_edit(sale_id,current_user.name, action_by,remark,"SALEVOID" )
|
||||
|
||||
# For Print
|
||||
|
||||
member_info = nil
|
||||
rebate_amount = nil
|
||||
current_balance = nil
|
||||
|
||||
# For Cashier by Zone
|
||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
if bookings.count > 1
|
||||
# for Multiple Booking
|
||||
if bookings[0].dining_facility_id.to_i>0
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
end
|
||||
end
|
||||
|
||||
if bookings[0].dining_facility_id.to_i > 0
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
@@ -81,17 +62,6 @@ class Origami::VoidController < BaseOrigamiController
|
||||
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||
end
|
||||
|
||||
|
||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||
# get printer info
|
||||
# print_settings = PrintSetting.find_by_unique_code('ReceiptBillPdf') # SaleItemsPdf
|
||||
#
|
||||
# if !print_settings.nil?
|
||||
# unique_code = 'ReceiptBillPdf'
|
||||
# elsif
|
||||
# unique_code = 'ReceiptBillStarPdf'
|
||||
# end
|
||||
|
||||
customer= Customer.find(sale.customer_id)
|
||||
|
||||
#shop detail
|
||||
|
||||
Reference in New Issue
Block a user