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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fb62153eeb269bd03c7b39b09742eae6a861d32
4
- data.tar.gz: 67e032fb51aa2be9d634cbf8759a70b7cc1965ed
3
+ metadata.gz: 5fa36dc83857acb7b08a9809dcda1553665bba03
4
+ data.tar.gz: b4f5efc333eb10a4a9661deb3b7957ccdcb6d4b9
5
5
  SHA512:
6
- metadata.gz: 491249a982193eecb15d80fc61da96b4b87dc6fdb194b1d37f83684b175df6a8f70c970b7df685d5efaaddcd319763a095aa9dfc4e53b88f0368a91a034f411f
7
- data.tar.gz: 224a735d55669453c63d5228a8d942cc3a63d1508d5b050bd41e06b327a020550f63e1264ec11ab529b0d24690a2029053da7a220b35854b26e9acb25cb30cbf
6
+ metadata.gz: 7cf9e78e2a833a0b109951e05e77049944bb5f8295ab64669199dfaa5ecf901b5b58e34622d3265aa8d90920c9620f272e79a80b5be23e01efce241f9ed7da2e
7
+ data.tar.gz: cd0da076bad58681957f120fdbedac36f8e5dc169ac8976554b175ce8af821cafd623eed6a61715fc3c0d3d51123cc624d0716ed3f0b828cea2200fc3ee71060
data/CHANGELOG.md CHANGED
@@ -317,3 +317,7 @@
317
317
  ## v0.13.0
318
318
 
319
319
  * Refactor on product fields
320
+
321
+ ## v0.13.1
322
+
323
+ * Bugfix on product stocks
@@ -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.code) }.map(&:quantity).sum
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.code }.map(&:quantity).sum
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.code) }.map(&:available).sum
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.code }.map(&:available).sum
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.code) }.map(&:reserved).sum
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.code }.map(&:reserved).sum
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
@@ -1,3 +1,3 @@
1
1
  module Xsys
2
- VERSION = "0.13.0"
2
+ VERSION = "0.13.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick