xsys 0.8.2 → 0.8.3

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: 8018bf5b172fe5c8cbe5d76acedd8d458e72c003
4
- data.tar.gz: 6405ee602e2fd1b49e7244eacbf62907af0fd255
3
+ metadata.gz: 354c6868131f12429bcc0244cfaa2ee8b838524d
4
+ data.tar.gz: 32325a7f29a36bc77db20dfaa8e3774f814d8c08
5
5
  SHA512:
6
- metadata.gz: 47a7ce450c7589a85469e13025416d4a9bc3cc86c1cac86b5e0a2f0b26da540e2e72e246116e25c8c7e10f0e97da9c9ce2a704fc491d141ea7e22f5a93a38876
7
- data.tar.gz: 0f9ff110369dbe9e538ae1bb5a74c9123b519c5fd4aed7fccd19c5170cfdb8d877eb4946e58237c01775174bcdf2dfaa6b9a1120d11863e5072674b95cd314d3
6
+ metadata.gz: 7993470512059218d0542e336d57b60fccae75282cafd5df9c1b68d228f04a61f9ac647f5b6099e0e2af4709194838a724408d2ea734e5a72fa6389570603596
7
+ data.tar.gz: b2ee1ce7167f8cb136cb0384c155c10cfc8c4ba8e9240cd9802c8d138e68431941e2744defaf43bbeff74b19e41ec31cec4180058a9fd651265ef23239a91567
data/CHANGELOG.md CHANGED
@@ -249,3 +249,7 @@
249
249
  ## v0.8.2
250
250
 
251
251
  * Bugfixes updating product
252
+
253
+ ## v0.8.3
254
+
255
+ * Added attributes to stocks
@@ -34,20 +34,15 @@ module Xsys
34
34
  end
35
35
 
36
36
  def sellable_stocks
37
- stocks.find_all { |s|
38
- !['SER', 'EXT'].include?(s.shop_code)
39
- }
37
+ stocks.find_all { |s| !s.shop_service }
40
38
  end
41
39
 
42
40
  def sellable_stocks_quantity(options={})
43
41
  result = 0
44
- online_shop_codes = ['OL']
45
- deposit_shop_codes = ['ADM']
46
- no_exhibition_shop_codes = online_shop_codes + deposit_shop_codes
47
42
 
48
43
  sellable_stocks.each do |stock|
49
44
  if options[:skip_exhibition]
50
- if no_exhibition_shop_codes.include?(stock.shop_code)
45
+ if stock.shop_has_exhibition
51
46
  result += stock.quantity
52
47
  elsif stock.quantity > 0
53
48
  result += (stock.quantity - 1)
@@ -63,9 +58,7 @@ module Xsys
63
58
  end
64
59
 
65
60
  def service_stocks
66
- stocks.find_all { |s|
67
- ['SER', 'EXT'].include?(s.shop_code)
68
- }
61
+ stocks.find_all { |s| s.shop_service }
69
62
  end
70
63
 
71
64
  def service_stocks_quantity
@@ -2,7 +2,7 @@ module Xsys
2
2
  module Model
3
3
  class Stock
4
4
  def self.attr_list
5
- [:shop_code, :quantity]
5
+ [:shop_code, :quantity, :shop_has_exhibition, :shop_service]
6
6
  end
7
7
 
8
8
  attr_reader *attr_list
data/lib/xsys/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xsys
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler