update pay without existing invoice in salepayment.rb

This commit is contained in:
Aung Myo
2017-07-21 17:52:38 +06:30
parent c5dbbea76d
commit 8852bc0449
2 changed files with 7 additions and 7 deletions

View File

@@ -34,10 +34,6 @@ class Origami::ShiftsController < BaseOrigamiController
shift_obj = ShiftSale.where('id =?',@shift.id)
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
puts @sale_taxes.to_a
puts @sale_taxes
puts @sale_taxes.to_json
puts "taxxxxxxxxxxxx"
# get printer info
print_settings=PrintSetting.find_by_unique_code(unique_code)

View File

@@ -321,10 +321,14 @@ class SalePayment < ApplicationRecord
bookings = table.bookings
bookings.each do |tablebooking|
if tablebooking.booking_status != 'moved'
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
if tablebooking.sale_id
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
status = false
end
else
status = false
end
end
end
end
end
if status
table.status = "available"