redmine_crm 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redmine_crm/money_helper.rb +7 -8
- data/lib/redmine_crm/version.rb +1 -1
- data/test/money_helper_test.rb +2 -0
- 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: eb4edcbb29e05cd8cfc1107b19cf57c3d20f9d2f
|
4
|
+
data.tar.gz: b38fdf655eabf2265a2148a48e19934bb5889394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ab2ddf4fb0123cbbe857378ae6fd31a0daa6de544c4efda9f2162dfea355ca0931c5b0d34c25d8bb2c929b4dc653d6a1f813f05a80781c68fe566db877a9f3b
|
7
|
+
data.tar.gz: 8a8c3757b763d17b5035685420650934a3d56608932ccb4d70c3250e8c3d83336e6d30a9d21ad850d2c9cd058be18b576278165f03f2a78550046eba3c2166c2
|
@@ -51,15 +51,14 @@ module RedmineCrm
|
|
51
51
|
end.sort{|x, y| x[0] <=> y[0]}
|
52
52
|
end
|
53
53
|
|
54
|
-
def price_to_currency(price, currency=
|
54
|
+
def price_to_currency(price, currency="USD", options={})
|
55
55
|
return '' if price.blank?
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
RedmineCrm::Currency.format(price.to_f, currency)
|
56
|
+
|
57
|
+
currency = "USD" unless currency.is_a?(String)
|
58
|
+
currency = RedmineCrm::Currency.find(currency)
|
59
|
+
|
60
|
+
return RedmineCrm::Currency.format(price.to_f, currency) if currency
|
61
|
+
price.to_s
|
63
62
|
end
|
64
63
|
|
65
64
|
|
data/lib/redmine_crm/version.rb
CHANGED
data/test/money_helper_test.rb
CHANGED
@@ -6,5 +6,7 @@ class MoneyHelperTest < ActiveSupport::TestCase
|
|
6
6
|
def test_price_to_currency
|
7
7
|
assert_equal '$3,265.65', price_to_currency(3265.65, "USD")
|
8
8
|
assert_equal "3.265,65 ₽", price_to_currency(3265.65, "RUB")
|
9
|
+
assert_equal "3200", price_to_currency(3200, "")
|
10
|
+
assert_equal "3200", price_to_currency(3200, "Foo")
|
9
11
|
end
|
10
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_crm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RedmineCRM
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: plugins for Redmine
|
14
14
|
email:
|