6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/iiko/warehouse.rb', line 6
def self.ingredients(data = nil)
validate_arguments(data)
goods = data[:goods]
goods.['ingredients'] = goods..length
gh = goods.
goods_map = {}
goods.data.each do |item|
goods_map[item[gh['NUM']]] = item
end
ttk = data[:ttk]
th = ttk.
ttk.data.each do |ingredient|
goods_map[ingredient[th['PRODUCT_CODE']]][gh['ingredients']] ||= []
goods_map[ingredient[th['PRODUCT_CODE']]][gh['ingredients']].push(ingredient)
end
end
|