xsys 0.9.0 → 0.9.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 +15 -3
- 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: ba0ed8e06d0390b2da29f01fd6af69677b123c70
|
4
|
+
data.tar.gz: 3aa26e50d0c682db13ff74f50a12ef543206ca42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81ae479fa53d757ce71ad80eea21f82d02e05d767a4a31dfa9ecb35cc208b76dd57bf6116f5257c09a03d9c2a95f55a52f815431774de32cf0afaf88c39c66f
|
7
|
+
data.tar.gz: 57ae303fb3642dda5ee305281c790e6cb98c0aaa3c75e24dadd202b8ecceef84be4604e4b42c0cedd3c4fcbf0cfde251951e8076dfe39347d47669b334ee4c70
|
data/CHANGELOG.md
CHANGED
data/lib/xsys/model/product.rb
CHANGED
@@ -81,10 +81,22 @@ module Xsys
|
|
81
81
|
}.map(&:quantity).sum
|
82
82
|
end
|
83
83
|
|
84
|
-
def stock_at(shop_code)
|
85
|
-
stocks.find { |s|
|
84
|
+
def stock_at(shop_code, options={})
|
85
|
+
stock = stocks.find { |s|
|
86
86
|
s.shop_code.to_s.upcase == shop_code.to_s.upcase
|
87
|
-
}
|
87
|
+
}
|
88
|
+
|
89
|
+
if options[:skip_exhibition]
|
90
|
+
if !stock.shop_has_exhibition
|
91
|
+
stock.quantity
|
92
|
+
elsif stock.quantity > 0
|
93
|
+
(stock.quantity - 1)
|
94
|
+
else
|
95
|
+
stock.quantity
|
96
|
+
end
|
97
|
+
else
|
98
|
+
stock.quantity
|
99
|
+
end
|
88
100
|
end
|
89
101
|
|
90
102
|
def price_date_for_list(price_list_id)
|
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.9.
|
4
|
+
version: 0.9.1
|
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-09-
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|