xsys 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/xsys/model/product.rb +6 -6
- data/lib/xsys/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fa36dc83857acb7b08a9809dcda1553665bba03
|
4
|
+
data.tar.gz: b4f5efc333eb10a4a9661deb3b7957ccdcb6d4b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cf9e78e2a833a0b109951e05e77049944bb5f8295ab64669199dfaa5ecf901b5b58e34622d3265aa8d90920c9620f272e79a80b5be23e01efce241f9ed7da2e
|
7
|
+
data.tar.gz: cd0da076bad58681957f120fdbedac36f8e5dc169ac8976554b175ce8af821cafd623eed6a61715fc3c0d3d51123cc624d0716ed3f0b828cea2200fc3ee71060
|
data/CHANGELOG.md
CHANGED
data/lib/xsys/model/product.rb
CHANGED
@@ -44,9 +44,9 @@ module Xsys
|
|
44
44
|
if shop_code_or_array.nil?
|
45
45
|
stocks.map(&:quantity).sum
|
46
46
|
elsif shop_code_or_array.is_a?(Array)
|
47
|
-
stocks.find_all { |s| shop_code_or_array.include?(s.
|
47
|
+
stocks.find_all { |s| shop_code_or_array.include?(s.shop_code) }.map(&:quantity).sum
|
48
48
|
elsif shop_code_or_array.is_a?(String)
|
49
|
-
stocks.find_all { |s| shop_code_or_array.upcase == s.
|
49
|
+
stocks.find_all { |s| shop_code_or_array.upcase == s.shop_code }.map(&:quantity).sum
|
50
50
|
else
|
51
51
|
raise 'invalid input!'
|
52
52
|
end
|
@@ -56,9 +56,9 @@ module Xsys
|
|
56
56
|
if shop_code_or_array.nil?
|
57
57
|
stocks.map(&:available).sum
|
58
58
|
elsif shop_code_or_array.is_a?(Array)
|
59
|
-
stocks.find_all { |s| shop_code_or_array.include?(s.
|
59
|
+
stocks.find_all { |s| shop_code_or_array.include?(s.shop_code) }.map(&:available).sum
|
60
60
|
elsif shop_code_or_array.is_a?(String)
|
61
|
-
stocks.find_all { |s| shop_code_or_array.upcase == s.
|
61
|
+
stocks.find_all { |s| shop_code_or_array.upcase == s.shop_code }.map(&:available).sum
|
62
62
|
else
|
63
63
|
raise 'invalid input!'
|
64
64
|
end
|
@@ -68,9 +68,9 @@ module Xsys
|
|
68
68
|
if shop_code_or_array.nil?
|
69
69
|
stocks.map(&:reserved).sum
|
70
70
|
elsif shop_code_or_array.is_a?(Array)
|
71
|
-
stocks.find_all { |s| shop_code_or_array.include?(s.
|
71
|
+
stocks.find_all { |s| shop_code_or_array.include?(s.shop_code) }.map(&:reserved).sum
|
72
72
|
elsif shop_code_or_array.is_a?(String)
|
73
|
-
stocks.find_all { |s| shop_code_or_array.upcase == s.
|
73
|
+
stocks.find_all { |s| shop_code_or_array.upcase == s.shop_code }.map(&:reserved).sum
|
74
74
|
else
|
75
75
|
raise 'invalid input!'
|
76
76
|
end
|
data/lib/xsys/version.rb
CHANGED