shop code

This commit is contained in:
Myat Zin Wai Maw
2019-11-22 18:24:02 +06:30
parent 5a3f328789
commit d1ab2c194d
106 changed files with 834 additions and 895 deletions

View File

@@ -33,9 +33,9 @@ class ProductCommission < ApplicationRecord
product_commission.save
end
def self.edit_product_commission(saleItemObj)
def self.edit_product_commission(saleItemObj,shop_code)
menu_item = MenuItem.find_by_item_code(saleItemObj.product_code)
commission = Commission.where('product_code = ? AND is_active = ?', menu_item.id, true).take
commission = Commission.where("shop_code='#{shop_code}' and product_code = ? AND is_active = ?", menu_item.id, true).take
product_commission = ProductCommission.where('sale_item_id = ?', saleItemObj.id).take
if !product_commission.nil?