xsys 0.17.2 → 0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/xsys/model/product.rb +6 -0
- data/lib/xsys/model/product_price_list.rb +2 -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: 0ad1dd277d86afbc29ebcbf561cd2fcdafbaa6f4
|
4
|
+
data.tar.gz: 83145c7efe388cfee27f9d1fd89ce450fe1aaff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75660be0f746edefd62a84b38866b8ca55bb0670420787bb4a2af82c9d522310784055e9edd79b1cc70452a17382be8f8cb7904eeaa3dcfbae899a7a39eb9bc4
|
7
|
+
data.tar.gz: cb3c74b03b9a66f67c24759cce4121a7b95a3f03f46858c6f39020f58ef2db15c34735b6e993c42a8fede27ed6249c432c98a5dfc2e645388bc2069311a0164e
|
data/CHANGELOG.md
CHANGED
data/lib/xsys/model/product.rb
CHANGED
@@ -116,6 +116,12 @@ module Xsys
|
|
116
116
|
}.try(:markup) || BigDecimal.new('0.0')
|
117
117
|
end
|
118
118
|
|
119
|
+
def taxed_price_with_list(price_list_id)
|
120
|
+
prices.find { |p|
|
121
|
+
p.price_list_id.to_i == price_list_id.to_i
|
122
|
+
}.try(:taxed_price) || BigDecimal.new('0.0')
|
123
|
+
end
|
124
|
+
|
119
125
|
def total_price_with_list(price_list_id)
|
120
126
|
prices.find { |p|
|
121
127
|
p.price_list_id.to_i == price_list_id.to_i
|
@@ -2,7 +2,7 @@ module Xsys
|
|
2
2
|
module Model
|
3
3
|
class ProductPriceList
|
4
4
|
def self.attr_list
|
5
|
-
[:product_id, :product_name, :price_list_id, :total_price,
|
5
|
+
[:product_id, :product_name, :price_list_id, :taxed_price, :total_price,
|
6
6
|
:markup, :price_update_date, :price_update_time]
|
7
7
|
end
|
8
8
|
|
@@ -11,7 +11,7 @@ module Xsys
|
|
11
11
|
def initialize(attributes={})
|
12
12
|
time_fields = ['price_update_time']
|
13
13
|
date_fields = ['price_update_date']
|
14
|
-
decimal_fields = ['total_price']
|
14
|
+
decimal_fields = ['total_price', 'taxed_price', 'markup']
|
15
15
|
|
16
16
|
attributes.each do |k, v|
|
17
17
|
if time_fields.include?(k.to_s)
|
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.
|
4
|
+
version: '0.18'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias Hick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|