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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e47d9c099c2a56ff9067c929ab239ca1c2bccff4
4
- data.tar.gz: d79bdb1125fe66c30433274c34ef42e434d6c87f
3
+ metadata.gz: 0ad1dd277d86afbc29ebcbf561cd2fcdafbaa6f4
4
+ data.tar.gz: 83145c7efe388cfee27f9d1fd89ce450fe1aaff1
5
5
  SHA512:
6
- metadata.gz: 8028b52ed801193c959ff79fd89afa4c52660254d81c4412f0e68e9c5548f80291d5b4ff40768781e163a3b426662196ec8cb21d38f18737a27b06f89043f054
7
- data.tar.gz: 653d48c17f51ec142f6829ac615fe5c3b81cd1d42a55a7ffddf5f7671465ad334127fa16ce0b659f14710ae6abd192dabd4d5f9d7c0e2b08be1440c2cf7c0a66
6
+ metadata.gz: 75660be0f746edefd62a84b38866b8ca55bb0670420787bb4a2af82c9d522310784055e9edd79b1cc70452a17382be8f8cb7904eeaa3dcfbae899a7a39eb9bc4
7
+ data.tar.gz: cb3c74b03b9a66f67c24759cce4121a7b95a3f03f46858c6f39020f58ef2db15c34735b6e993c42a8fede27ed6249c432c98a5dfc2e645388bc2069311a0164e
data/CHANGELOG.md CHANGED
@@ -365,3 +365,7 @@
365
365
  ## v0.17.2
366
366
 
367
367
  * Changed interface for method to calculate taxes for company
368
+
369
+ ## v0.18
370
+
371
+ * Added taxed price attribute in price lists
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Xsys
2
- VERSION = "0.17.2"
2
+ VERSION = "0.18"
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.17.2
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-15 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler