merge with master

This commit is contained in:
Yan
2018-01-09 16:40:45 +06:30
91 changed files with 2666 additions and 744 deletions

View File

@@ -6,7 +6,11 @@ class Origami::VoidController < BaseOrigamiController
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(sale_id, sale.sale_items,0)
end
# update count for shift sale
if(sale.sale_status == "completed")
if sale.shift_sale_id != nil
@@ -21,7 +25,7 @@ class Origami::VoidController < BaseOrigamiController
shift.save
end
end
sale.payment_status = 'void'
sale.sale_status = 'void'
sale.save
@@ -38,12 +42,14 @@ class Origami::VoidController < BaseOrigamiController
table_avaliable = true
table = sale.bookings[0].dining_facility
table.bookings.each do |booking|
if booking.sale.sale_status == 'new'
table_avaliable = false
if !booking.sale.nil?
if booking.sale.sale_status == 'new'
table_avaliable = false
end
end
end
if table_avaliable == true
if table_avaliable
table.status = 'available'
table.save
end