update db index

This commit is contained in:
Aung Myo
2018-07-04 18:08:15 +06:30
parent bdd20f727e
commit 4f9a4e2984
7 changed files with 49 additions and 47 deletions

View File

@@ -53,12 +53,15 @@ class Origami::ShiftsController < BaseOrigamiController
cashier_terminal.save
#add shift_sale_id to card_settle_trans
card_settle_trans = CardSettleTran.select('id').where(['shift_sale_id IS NULL and status IS NOT NULL'])
bank_integration = Lookup.find_by_lookup_type('bank_integration')
if !bank_integration.nil?
card_settle_trans = CardSettleTran.select('id').where(['shift_sale_id IS NULL and status IS NOT NULL'])
card_settle_trans.each do |data|
card_sett_trans = CardSettleTran.find(data.id)
card_sett_trans.shift_sale_id = @shift.id
card_sett_trans.save()
card_settle_trans.each do |data|
card_sett_trans = CardSettleTran.find(data.id)
card_sett_trans.shift_sale_id = @shift.id
card_sett_trans.save()
end
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
@@ -77,7 +80,7 @@ class Origami::ShiftsController < BaseOrigamiController
end
end
end
shop_details = Shop.find(1)
shop_details = shop_detail
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')