Merge branch 'master' into license
This commit is contained in:
@@ -46,7 +46,7 @@ class DiningCharge < ApplicationRecord
|
||||
# no time rounding block
|
||||
return result.to_i, DiningCharge.check_rounding(chargesObj, solid_price, roundingblock)
|
||||
else
|
||||
solid_price += roundingblock * chargesObj.time_rounding_block_price
|
||||
solid_price += (roundingblock * chargesObj.time_rounding_block_price)
|
||||
return result.to_i, DiningCharge.check_rounding(chargesObj, solid_price, roundingblock)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ class MenuItem < ApplicationRecord
|
||||
has_many :menu_item_sets
|
||||
has_many :item_sets, through: :menu_item_sets
|
||||
|
||||
validates_presence_of :name, :type, :min_qty, :taxable
|
||||
validates_presence_of :name, :type, :min_qty, :taxable,:account_id
|
||||
|
||||
default_scope { order('item_code asc') }
|
||||
|
||||
@@ -53,13 +53,12 @@ class MenuItem < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.deleteRecursive(menu_item)
|
||||
|
||||
# find the sub menu item of current item
|
||||
sub_menu_items = MenuItem.where("menu_item_id=?",menu_item.id)
|
||||
sub_menu_items = MenuItem.where("id=?",menu_item.id)
|
||||
if sub_menu_items.length != 0
|
||||
sub_menu_items.each do |subitem|
|
||||
if deleteRecursive(subitem)
|
||||
end
|
||||
# if deleteRecursive(subitem)
|
||||
# end
|
||||
end
|
||||
# find the instances of current menu item
|
||||
instances = MenuItemInstance.where("menu_item_id=?",menu_item.id)
|
||||
|
||||
Reference in New Issue
Block a user