diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index f034aa57..5397c7f0 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -208,19 +208,7 @@ class Origami::PaymentsController < BaseOrigamiController render json: JSON.generate({:status => saleObj.rebate_status, :message => "Can't Rebate coz of Sever Error ", :filename => filename, :receipt_no => sale_receipt_no, :printer_name => printer_name}) - if params[:type] == "quick_service" - booking = Booking.find_by_sale_id(sale_id) - if booking.dining_facility_id.to_i>0 - table_id = booking.dining_facility_id - else - table_id = 0 - end - - booking.booking_orders.each do |order| - Order.pay_process_order_queue(order.order_id,table_id) - end - # end - end + #end end end diff --git a/app/models/inventory_definition.rb b/app/models/inventory_definition.rb index 91823068..4634ff73 100755 --- a/app/models/inventory_definition.rb +++ b/app/models/inventory_definition.rb @@ -12,7 +12,7 @@ class InventoryDefinition < ApplicationRecord end def self.find_product_in_inventory(item) - product = InventoryDefinition.find_by_item_code(item.product_code) + product = InventoryDefinition.find_by_item_code(item.item_instance_code) if product.nil? return false, nil else @@ -21,7 +21,7 @@ class InventoryDefinition < ApplicationRecord end def self.check_balance(item,inventory_definition) # item => saleItemOBj - stock = StockJournal.where('item_code=?', item.product_code).order('created_at desc').take + stock = StockJournal.where('item_code=?', item.item_instance_code).order('created_at desc').take unless stock.nil? modify_balance(item, stock, inventory_definition) else diff --git a/app/models/stock_journal.rb b/app/models/stock_journal.rb index f2904b13..fa4bd285 100755 --- a/app/models/stock_journal.rb +++ b/app/models/stock_journal.rb @@ -8,7 +8,7 @@ class StockJournal < ApplicationRecord balance = calculate_balance(balance, item.qty) journal = StockJournal.new - journal.item_code = item.product_code + journal.item_code = item.item_instance_code journal.inventory_definition_id = inventory_definition.id journal.debit = item.qty journal.balance = balance