billing 0.0.4b → 0.0.4c
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/app/models/billing/{account.rb → bill.rb} +34 -28
- data/app/models/billing/charge.rb +25 -11
- data/app/models/billing/modifier.rb +5 -5
- data/app/models/billing/origin.rb +2 -2
- data/app/models/billing/payment.rb +6 -10
- data/app/models/billing/payment_with_type.rb +1 -1
- data/app/models/billing/report.rb +13 -11
- data/app/models/concerns/billing/{account_item.rb → bill_item.rb} +5 -6
- data/app/models/concerns/billing/bill_text_parser.rb +18 -0
- data/config/initializers/money.rb +67 -0
- data/config/routes.rb +1 -6
- data/db/migrate/20140803073707_rename_billing_account_to_bill.rb +8 -0
- data/db/migrate/20140804065726_add_qty_to_billing_charge.rb +5 -0
- data/db/migrate/20140804070517_add_tax_ratio_to_billing_charge.rb +5 -0
- data/lib/billing.rb +0 -2
- data/lib/billing/billable.rb +3 -3
- data/lib/billing/engine.rb +3 -0
- data/lib/billing/version.rb +1 -1
- data/lib/collection_proxy_wild.rb +9 -0
- data/test/dummy/config/routes.rb +1 -3
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +18 -16
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +4810 -0
- data/test/dummy/log/test.log +64325 -0
- data/test/fixtures/billing/{accounts.yml → bills.yml} +0 -0
- data/test/fixtures/billing/charges.yml +2 -2
- data/test/fixtures/billing/modifiers.yml +2 -2
- data/test/fixtures/billing/payments.yml +2 -2
- data/test/models/billing/bill_test.rb +76 -0
- data/test/models/billing/charge_test.rb +13 -6
- data/test/models/billing/modifier_test.rb +2 -2
- data/test/models/billing/payment_test.rb +12 -12
- metadata +15 -56
- data/app/assets/javascripts/billing/accounts.js +0 -2
- data/app/assets/javascripts/billing/application.js +0 -13
- data/app/assets/javascripts/billing/charges.js +0 -2
- data/app/assets/javascripts/billing/modifiers.js +0 -2
- data/app/assets/stylesheets/billing/accounts.css +0 -4
- data/app/assets/stylesheets/billing/application.css +0 -15
- data/app/assets/stylesheets/billing/charges.css +0 -4
- data/app/assets/stylesheets/billing/modifiers.css +0 -4
- data/app/assets/stylesheets/billing/payments.css +0 -4
- data/app/controllers/billing/accounts_controller.rb +0 -29
- data/app/controllers/billing/application_controller.rb +0 -22
- data/app/controllers/billing/charges_controller.rb +0 -29
- data/app/controllers/billing/modifiers_controller.rb +0 -29
- data/app/controllers/billing/payments_controller.rb +0 -29
- data/app/helpers/billing/accounts_helper.rb +0 -4
- data/app/helpers/billing/application_helper.rb +0 -4
- data/app/helpers/billing/charges_helper.rb +0 -4
- data/app/helpers/billing/modifiers_helper.rb +0 -4
- data/app/helpers/billing/payments_helper.rb +0 -4
- data/app/views/billing/accounts/index.html.erb +0 -7
- data/app/views/billing/accounts/new.html.erb +0 -8
- data/app/views/billing/accounts/show.html.erb +0 -29
- data/app/views/billing/application/index.html.erb +0 -3
- data/app/views/billing/charges/new.html.erb +0 -12
- data/app/views/billing/modifiers/new.html.erb +0 -18
- data/app/views/billing/payments/new.html.erb +0 -11
- data/app/views/layouts/billing/application.html.erb +0 -14
- data/lib/billing/mapping.rb +0 -32
- data/lib/billing/routes.rb +0 -16
- data/test/controllers/billing/accounts_controller_test.rb +0 -19
- data/test/controllers/billing/charges_controller_test.rb +0 -16
- data/test/controllers/billing/modifiers_controller_test.rb +0 -16
- data/test/controllers/billing/payments_controller_test.rb +0 -16
- data/test/helpers/billing/accounts_helper_test.rb +0 -6
- data/test/helpers/billing/charges_helper_test.rb +0 -6
- data/test/helpers/billing/modifiers_helper_test.rb +0 -6
- data/test/helpers/billing/payments_helper_test.rb +0 -6
- data/test/integration/navigation_test.rb +0 -10
- data/test/models/billing/account_test.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f51a39d7e8dc5cadc3f1bbacc4db572251326332
|
4
|
+
data.tar.gz: 4ce5c7237f1ca1feedf1ac81dcbae83cbcc79325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00864e10f3eb01c9a771972dd05481ba46ffb8bc4268c1f2aaf742cecc87a2a52c16a9d8e00251a903eb573a15b1653c5dc73f73ae023cc5d40f0f8c45a7ec79
|
7
|
+
data.tar.gz: 4c82fd8ae9adfde0925522873f38721fb5a68d946960256708398d82c4c2423dbd356c7b95f4ab43069761cc3c54ffd7db99c04384b34334a0e6c8ae62928b34
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Billing
|
2
|
-
class
|
2
|
+
class Bill < ActiveRecord::Base
|
3
3
|
acts_as_paranoid if respond_to?(:acts_as_paranoid)
|
4
4
|
has_paper_trail class_name: 'Billing::Version' if respond_to?(:has_paper_trail)
|
5
5
|
|
@@ -11,11 +11,11 @@ module Billing
|
|
11
11
|
monetize :balance_cents
|
12
12
|
|
13
13
|
belongs_to :billable, polymorphic: true
|
14
|
-
has_many :charges, inverse_of: :
|
15
|
-
has_many :modifiers, inverse_of: :
|
16
|
-
has_many :payments, inverse_of: :
|
17
|
-
belongs_to :origin, inverse_of: :
|
18
|
-
belongs_to :report, inverse_of: :
|
14
|
+
has_many :charges, inverse_of: :bill, dependent: :destroy
|
15
|
+
has_many :modifiers, inverse_of: :bill, dependent: :destroy
|
16
|
+
has_many :payments, inverse_of: :bill, dependent: :restrict_with_error
|
17
|
+
belongs_to :origin, inverse_of: :bills
|
18
|
+
belongs_to :report, inverse_of: :bills
|
19
19
|
|
20
20
|
if defined? Extface
|
21
21
|
belongs_to :extface_job, class_name: 'Extface::Job'
|
@@ -28,11 +28,14 @@ module Billing
|
|
28
28
|
scope :unpaid, -> { where(arel_table[:balance_cents].lt(0)) }
|
29
29
|
scope :open, -> { where.not(balance_cents: 0) }
|
30
30
|
scope :partially_paid, -> { where.not( payments_sum_cents: 0, balance_cents: 0 ) }
|
31
|
+
scope :for_report, -> { where(balance_cents: 0 ,report_id: nil) }
|
31
32
|
|
32
|
-
before_validation
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
before_validation do
|
34
|
+
update_sumaries
|
35
|
+
self.origin = payments.first.try(:origin) unless origin.present? or payments.many?
|
36
|
+
end
|
37
|
+
before_create do
|
38
|
+
self.number = "#{billable.id}:#{billable.billing_bills.count}"
|
36
39
|
self.name = "B:#{number}" if name.nil?
|
37
40
|
end
|
38
41
|
before_save :perform_autofin, if: :becomes_paid?
|
@@ -45,18 +48,15 @@ module Billing
|
|
45
48
|
:payments_of_diff_fiscalization?, :multiple_cash_payments?, if: :has_payments?
|
46
49
|
|
47
50
|
def charge(*args)
|
48
|
-
|
49
|
-
c if c.save
|
51
|
+
charges.wild *args
|
50
52
|
end
|
51
53
|
|
52
54
|
def modify(*args)
|
53
|
-
|
54
|
-
m if m.save
|
55
|
+
modifiers.wild *args
|
55
56
|
end
|
56
57
|
|
57
58
|
def pay(*args)
|
58
|
-
|
59
|
-
p if p.save
|
59
|
+
payments.wild *args
|
60
60
|
end
|
61
61
|
|
62
62
|
def modifier_items
|
@@ -91,24 +91,29 @@ module Billing
|
|
91
91
|
|
92
92
|
private
|
93
93
|
def calculate_modifiers
|
94
|
+
charges_a = charges.to_a
|
94
95
|
@modifier_items = ModifierItems.new.tap() do |items|
|
95
|
-
modifiers.each do |
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
96
|
+
modifiers.select{ |m| m.charge.present? }.each do |charge_modifier|
|
97
|
+
charge = charges_a.find{ |c| c == charge_modifier.charge }
|
98
|
+
mod_value = charge_modifier.percent_ratio.nil? ? charge_modifier.fixed_value : (charge_modifier.charge.price * charge_modifier.percent_ratio)
|
99
|
+
p mod_value
|
100
|
+
charge.value = charge.price + mod_value
|
101
|
+
#p charge.value
|
102
|
+
#p "-"
|
103
|
+
items << Charge.new(price: mod_value, chargable: charge)
|
104
|
+
end
|
105
|
+
modifiers.select{ |m| m.charge.nil? }.each do |global_modifier|
|
106
|
+
items << Charge.new(price: global_modifier.percent_ratio.nil? ? global_modifier.fixed_value : (charges_a.sum(&:value).to_money * global_modifier.percent_ratio))
|
102
107
|
end
|
103
108
|
end
|
104
109
|
end
|
105
110
|
def update_sumaries
|
106
|
-
self.charges_sum = charges.to_a.sum(&:price).to_money
|
107
111
|
calculate_modifiers
|
108
|
-
self.
|
109
|
-
self.
|
110
|
-
self.
|
111
|
-
self.
|
112
|
+
self.charges_sum = charges.to_a.sum(0.to_money, &:value).to_money
|
113
|
+
self.discounts_sum = @modifier_items.discounts.sum(0.to_money, &:price).to_money
|
114
|
+
self.surcharges_sum = @modifier_items.surcharges.sum(0.to_money, &:price).to_money
|
115
|
+
self.payments_sum = payments.to_a.sum(0.to_money, &:value).to_money
|
116
|
+
self.total = charges.to_a.sum(0.to_money, &:price) + surcharges_sum + discounts_sum
|
112
117
|
self.balance = payments_sum - total
|
113
118
|
end
|
114
119
|
|
@@ -141,5 +146,6 @@ module Billing
|
|
141
146
|
def fiscalizable?
|
142
147
|
payments.select(&:fiscal?).any?
|
143
148
|
end
|
149
|
+
|
144
150
|
end
|
145
151
|
end
|
@@ -1,34 +1,48 @@
|
|
1
1
|
module Billing
|
2
2
|
class Charge < ActiveRecord::Base
|
3
|
-
include
|
4
|
-
|
3
|
+
include BillItem
|
4
|
+
|
5
|
+
attr_accessor :tax_group, :plu, :department
|
6
|
+
|
7
|
+
belongs_to :bill, inverse_of: :charges, validate: true
|
5
8
|
belongs_to :chargable, polymorphic: true
|
6
9
|
belongs_to :origin, inverse_of: :charges
|
7
10
|
has_one :modifier, inverse_of: :charge
|
8
11
|
|
9
|
-
monetize :price_cents
|
12
|
+
monetize :price_cents, with_model_currency: :price_currency
|
10
13
|
monetize :value_cents
|
11
14
|
|
12
|
-
delegate :paid?, to: :
|
15
|
+
delegate :paid?, to: :bill
|
13
16
|
|
14
|
-
scope :unpaid, -> { joins(:
|
15
|
-
scope :paid, -> { joins(:
|
17
|
+
scope :unpaid, -> { joins(:bill).where.not(billing_bills: { balance_cents: 0}) }
|
18
|
+
scope :paid, -> { joins(:bill).where(billing_bills: { balance_cents: 0}) }
|
16
19
|
scope :in_period, lambda {|from, to| where(revenue_at: from..to) }
|
17
20
|
|
18
21
|
validates_presence_of :price
|
19
22
|
validates_numericality_of :value, greater_than_or_equal_to: 0
|
20
23
|
|
21
|
-
|
22
|
-
self.value = price unless modifier.present? #
|
24
|
+
after_initialize do
|
25
|
+
self.value = price #unless modifier.present? #bill validation will update modified value
|
23
26
|
end
|
24
27
|
|
25
28
|
class << self
|
26
|
-
|
29
|
+
include Billing::BillTextParser
|
30
|
+
def wild_args(*args)
|
27
31
|
case when args.blank? || args.first.is_a?(Hash) then
|
28
|
-
{}.merge(*args)
|
32
|
+
return {}.merge(*args)
|
33
|
+
when args.size == 1 && args.first.is_a?(String) then
|
34
|
+
if match = args.shift.match(/(\d+[.,]\d+\*|\d+\*|)(\d+[.,]\d+[A-Z]*|\d+[A-Z]*|)(#\d+|)(@\d+|)([+-]\d+[.,]\d+\%?|[+-]\d+\%?|)(\/\S+|)/)
|
35
|
+
qty_s, price_s, plu_s, tax_group_s, mod_s, text = match.captures
|
36
|
+
return {
|
37
|
+
qty: parse_qty(qty_s),
|
38
|
+
price: price_s.to_money,
|
39
|
+
plu: parse_plu(plu_s),
|
40
|
+
name: parse_text(text)
|
41
|
+
}
|
42
|
+
end
|
29
43
|
else
|
30
44
|
h = { price: args.shift.to_money }
|
31
|
-
args.any? ? h.merge(*args) : h
|
45
|
+
return args.any? ? h.merge(*args) : h
|
32
46
|
end
|
33
47
|
end
|
34
48
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module Billing
|
2
2
|
class Modifier < ActiveRecord::Base
|
3
|
-
include
|
4
|
-
belongs_to :
|
3
|
+
include BillItem
|
4
|
+
belongs_to :bill, inverse_of: :modifiers, validate: true
|
5
5
|
belongs_to :charge, inverse_of: :modifier
|
6
6
|
monetize :fixed_value_cents
|
7
7
|
|
8
8
|
validate :percent_or_value
|
9
|
-
validates_uniqueness_of :charge, scope: :
|
10
|
-
validates_uniqueness_of :
|
9
|
+
validates_uniqueness_of :charge, scope: :bill_id, allow_nil: true
|
10
|
+
validates_uniqueness_of :bill, scope: :charge_id
|
11
11
|
|
12
12
|
private
|
13
13
|
def percent_or_value
|
@@ -16,7 +16,7 @@ module Billing
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class << self
|
19
|
-
def
|
19
|
+
def wild_args(*args)
|
20
20
|
case when args.blank? || args.first.kind_of?(Hash) then
|
21
21
|
{}.merge(*args)
|
22
22
|
when args.first.kind_of?(String) then
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Billing
|
2
2
|
class Origin < ActiveRecord::Base
|
3
|
-
has_many :
|
3
|
+
has_many :bills, inverse_of: :origin
|
4
4
|
has_many :charges, inverse_of: :origin
|
5
|
-
has_many :payments, through: :
|
5
|
+
has_many :payments, through: :bills
|
6
6
|
if defined? Extface
|
7
7
|
belongs_to :fiscal_device, ->(o) { where( extfaceable_id: o.master_id ) }, class_name: 'Extface::Device'
|
8
8
|
end
|
@@ -5,32 +5,28 @@ module Billing
|
|
5
5
|
PAYPAL_EXPRESS = 'Billing::PaypalExpress'.freeze
|
6
6
|
PAYMENT_MODELS = [PAYMENT_WITH_TYPE, PAYMENT_EXTERNAL, PAYPAL_EXPRESS].freeze
|
7
7
|
|
8
|
-
include
|
8
|
+
include BillItem
|
9
9
|
|
10
10
|
attr_writer :origin
|
11
11
|
attr_accessor :origin_id
|
12
12
|
monetize :value_cents
|
13
13
|
|
14
|
-
belongs_to :
|
14
|
+
belongs_to :bill, inverse_of: :payments, validate: true
|
15
15
|
|
16
16
|
scope :in_period, lambda {|from, to| where(created_at: from..to) }
|
17
|
-
scope :for_report, -> { joins(:
|
17
|
+
scope :for_report, -> { joins(:bill).where(billing_bills: { balance_cents: 0 ,report_id: nil }) }
|
18
18
|
|
19
19
|
if defined? Extface
|
20
20
|
belongs_to :extface_job, class_name: 'Extface::Job'
|
21
21
|
end
|
22
22
|
|
23
|
-
delegate :billable, to: :
|
23
|
+
delegate :billable, to: :bill
|
24
24
|
|
25
25
|
validates_numericality_of :value, greater_than_or_equal_to: 0
|
26
26
|
validates :type, inclusion: { in: PAYMENT_MODELS }
|
27
27
|
|
28
28
|
after_initialize on: :create do
|
29
|
-
self.value = -
|
30
|
-
end
|
31
|
-
|
32
|
-
before_validation do
|
33
|
-
account.origin = origin unless account.origin and account.payments.many?
|
29
|
+
self.value = -bill.try(:balance) if value.zero?
|
34
30
|
end
|
35
31
|
|
36
32
|
def fiscal?; false; end
|
@@ -43,7 +39,7 @@ module Billing
|
|
43
39
|
|
44
40
|
private
|
45
41
|
class << self
|
46
|
-
def
|
42
|
+
def wild_args(*args)
|
47
43
|
h = {}
|
48
44
|
case when args.blank? || args.first.kind_of?(Hash) then
|
49
45
|
args.blank? ? h : h.merge(*args)
|
@@ -7,22 +7,24 @@ module Billing
|
|
7
7
|
|
8
8
|
has_paper_trail class_name: 'Billing::Version'
|
9
9
|
belongs_to :origin, inverse_of: :reports
|
10
|
-
has_many :
|
10
|
+
has_many :bills, inverse_of: :report, autosave: true
|
11
11
|
belongs_to :extface_job, class_name: 'Extface::Job'
|
12
|
-
has_many :payments, through: :
|
12
|
+
has_many :payments, through: :bills
|
13
13
|
|
14
14
|
monetize :payments_sum_cents
|
15
15
|
monetize :payments_cash_cents
|
16
16
|
monetize :payments_fiscal_cents
|
17
17
|
|
18
18
|
validates_presence_of :origin
|
19
|
-
validates_absence_of :
|
19
|
+
validates_absence_of :partially_paid_bills?
|
20
20
|
validates :f_operation, inclusion: { in: F_OPERATIONS }, allow_nil: true
|
21
21
|
validates_presence_of :f_period_from, :f_period_to, if: :fiscal_period_report?
|
22
22
|
|
23
|
-
before_validation :
|
23
|
+
before_validation :set_report_to_bills
|
24
24
|
before_create :update_summary
|
25
25
|
|
26
|
+
scope :in_period, lambda {|from, to| where(created_at: from..to) }
|
27
|
+
|
26
28
|
|
27
29
|
def fiscalization
|
28
30
|
if origin.fiscal_device.present?
|
@@ -37,14 +39,14 @@ module Billing
|
|
37
39
|
f_operation == FISCAL_PERIOD_REPORT
|
38
40
|
end
|
39
41
|
|
40
|
-
def
|
41
|
-
self.
|
42
|
+
def set_report_to_bills
|
43
|
+
self.bills << origin.bills.for_report if zeroing?
|
42
44
|
end
|
43
45
|
|
44
46
|
def update_summary
|
45
|
-
self.payments_sum =
|
46
|
-
self.payments_cash = payments.select{ |p| p.try(:cash?) }.sum(Money.new(0, 'USD'), &:value)
|
47
|
-
self.payments_fiscal = payments.select{ |p| p.try(:fiscal?) }.sum(Money.new(0, 'USD'), &:value)
|
47
|
+
self.payments_sum = bills.to_a.sum(Money.new(0, 'USD'), &:payments_sum)
|
48
|
+
self.payments_cash = bills.collect(&:payments).flatten.select{ |p| p.try(:cash?) }.sum(Money.new(0, 'USD'), &:value)
|
49
|
+
self.payments_fiscal = bills.collect(&:payments).flatten.select{ |p| p.try(:fiscal?) }.sum(Money.new(0, 'USD'), &:value)
|
48
50
|
perform_fiscal_job
|
49
51
|
end
|
50
52
|
|
@@ -59,8 +61,8 @@ module Billing
|
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
62
|
-
def
|
63
|
-
|
64
|
+
def partially_paid_bills?
|
65
|
+
bills.partially_paid.any?
|
64
66
|
end
|
65
67
|
end
|
66
68
|
end
|
@@ -1,17 +1,16 @@
|
|
1
1
|
module Billing
|
2
|
-
module
|
2
|
+
module BillItem
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
6
|
acts_as_paranoid if respond_to?(:acts_as_paranoid)
|
7
7
|
has_paper_trail class_name: 'Billing::Version' if respond_to?(:has_paper_trail)
|
8
8
|
|
9
|
-
delegate :save, to: :
|
10
|
-
delegate :origins, :payment_types, to: :
|
9
|
+
delegate :save, to: :bill, prefix: :bill
|
10
|
+
delegate :origins, :payment_types, to: :bill
|
11
11
|
|
12
|
-
after_save :
|
13
|
-
|
14
|
-
validates_presence_of :account
|
12
|
+
after_save :bill_save
|
13
|
+
after_destroy :bill_save
|
15
14
|
end
|
16
15
|
|
17
16
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# encoding : utf-8
|
2
|
+
|
3
|
+
MoneyRails.configure do |config|
|
4
|
+
|
5
|
+
# To set the default currency
|
6
|
+
#
|
7
|
+
# config.default_currency = :usd
|
8
|
+
|
9
|
+
# Set default bank object
|
10
|
+
#
|
11
|
+
# Example:
|
12
|
+
# config.default_bank = EuCentralBank.new
|
13
|
+
|
14
|
+
# Add exchange rates to current money bank object.
|
15
|
+
# (The conversion rate refers to one direction only)
|
16
|
+
#
|
17
|
+
# Example:
|
18
|
+
# config.add_rate "USD", "CAD", 1.24515
|
19
|
+
# config.add_rate "CAD", "USD", 0.803115
|
20
|
+
|
21
|
+
# To handle the inclusion of validations for monetized fields
|
22
|
+
# The default value is true
|
23
|
+
#
|
24
|
+
# config.include_validations = true
|
25
|
+
|
26
|
+
# Default ActiveRecord migration configuration values for columns:
|
27
|
+
#
|
28
|
+
# config.amount_column = { prefix: '', # column name prefix
|
29
|
+
# postfix: '_cents', # column name postfix
|
30
|
+
# column_name: nil, # full column name (overrides prefix, postfix and accessor name)
|
31
|
+
# type: :integer, # column type
|
32
|
+
# present: true, # column will be created
|
33
|
+
# null: false, # other options will be treated as column options
|
34
|
+
# default: 0
|
35
|
+
# }
|
36
|
+
#
|
37
|
+
# config.currency_column = { prefix: '',
|
38
|
+
# postfix: '_currency',
|
39
|
+
# column_name: nil,
|
40
|
+
# type: :string,
|
41
|
+
# present: true,
|
42
|
+
# null: false,
|
43
|
+
# default: 'USD'
|
44
|
+
# }
|
45
|
+
|
46
|
+
# Register a custom currency
|
47
|
+
#
|
48
|
+
# Example:
|
49
|
+
# config.register_currency = {
|
50
|
+
# :priority => 1,
|
51
|
+
# :iso_code => "EU4",
|
52
|
+
# :name => "Euro with subunit of 4 digits",
|
53
|
+
# :symbol => "€",
|
54
|
+
# :symbol_first => true,
|
55
|
+
# :subunit => "Subcent",
|
56
|
+
# :subunit_to_unit => 10000,
|
57
|
+
# :thousands_separator => ".",
|
58
|
+
# :decimal_mark => ","
|
59
|
+
# }
|
60
|
+
|
61
|
+
# Set money formatted output globally.
|
62
|
+
# Default value is nil meaning "ignore this option".
|
63
|
+
# Options are nil, true, false.
|
64
|
+
#
|
65
|
+
# config.no_cents_if_whole = nil
|
66
|
+
# config.symbol = nil
|
67
|
+
end
|