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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b61dade399d2812db5e325657c1d9dee0865a463
4
- data.tar.gz: c94bbdc35a08b99d05dfb61ae970ad849181b348
3
+ metadata.gz: ba0ed8e06d0390b2da29f01fd6af69677b123c70
4
+ data.tar.gz: 3aa26e50d0c682db13ff74f50a12ef543206ca42
5
5
  SHA512:
6
- metadata.gz: 561e90259645f7c8eedf425f22627f7ca49a4af0cde31edcea0f21b4a12a827c420b0cdf21b994ad36fbbaf539f5a07589e714e2aade30848a1faad9e797e822
7
- data.tar.gz: 4270c43a52d82d682e5076555d49592c52a4225d3f2258ec38e2400bc55db06a8b39a6ee01912fc6d1c014312f8968a0d0f350633200e91b1b3d5cac6d670d06
6
+ metadata.gz: a81ae479fa53d757ce71ad80eea21f82d02e05d767a4a31dfa9ecb35cc208b76dd57bf6116f5257c09a03d9c2a95f55a52f815431774de32cf0afaf88c39c66f
7
+ data.tar.gz: 57ae303fb3642dda5ee305281c790e6cb98c0aaa3c75e24dadd202b8ecceef84be4604e4b42c0cedd3c4fcbf0cfde251951e8076dfe39347d47669b334ee4c70
@@ -273,3 +273,7 @@
273
273
  ## v0.9.0
274
274
 
275
275
  * Added brand and model to products
276
+
277
+ ## v0.9.1
278
+
279
+ * Added option to skip exhibition getting stock from a single shop
@@ -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
- }.try(:quantity).to_i
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)
@@ -1,3 +1,3 @@
1
1
  module Xsys
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
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.9.0
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-13 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler