xsys 0.6.1 → 0.6.2
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 +19 -2
- data/lib/xsys/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd364aa2e5cb7fcd974198879cb7ad2d9be8c64d
|
4
|
+
data.tar.gz: c2502fa76e91033154a332cd3b2393488fe6504c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3655bc63371d03bf0bbf2e1547393891c84ac73ab94198cfaef166332b8314f14c04316181fc553ef788f858f674243d154d93d9d751bd32477eb52b2cfe2aa9
|
7
|
+
data.tar.gz: 605fb8b8c0706a52f268d77463767f808a050c63da6281caa90f90e0f38fb4e3d848f72c0a54ea9057a9420a29f0329a2d5ae66478e911d35fc300db994ef449
|
data/CHANGELOG.md
CHANGED
data/lib/xsys/model/product.rb
CHANGED
@@ -39,8 +39,25 @@ module Xsys
|
|
39
39
|
}
|
40
40
|
end
|
41
41
|
|
42
|
-
def sellable_stocks_quantity
|
43
|
-
|
42
|
+
def sellable_stocks_quantity(options={})
|
43
|
+
result = 0
|
44
|
+
online_shop_codes = ['OL']
|
45
|
+
|
46
|
+
sellable_stocks.each do |stock|
|
47
|
+
if options[:skip_exhibition]
|
48
|
+
if online_shop_codes.include?(stock.shop_code)
|
49
|
+
result += stock.quantity
|
50
|
+
elsif stock.quantity > 0
|
51
|
+
result += (stock.quantity - 1)
|
52
|
+
else
|
53
|
+
result += stock.quantity
|
54
|
+
end
|
55
|
+
else
|
56
|
+
result += stock.quantity
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
result
|
44
61
|
end
|
45
62
|
|
46
63
|
def service_stocks
|
data/lib/xsys/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias Hick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|