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
File without changes
|
@@ -5,14 +5,14 @@
|
|
5
5
|
# below each fixture, per the syntax in the comments below
|
6
6
|
#
|
7
7
|
one:
|
8
|
-
|
8
|
+
bill: one
|
9
9
|
value_cents: 100
|
10
10
|
value_currency: USD
|
11
11
|
payment_type: one
|
12
12
|
type: Billing::PaymentWithType
|
13
13
|
|
14
14
|
two:
|
15
|
-
|
15
|
+
bill: one
|
16
16
|
value_cents: 200
|
17
17
|
value_currency: USD
|
18
18
|
payment_type: one
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Billing
|
4
|
+
class BillTest < ActiveSupport::TestCase
|
5
|
+
setup do
|
6
|
+
@bill = billing_bills(:one)
|
7
|
+
@bill.charges.each(&:save!) #update values
|
8
|
+
@bill.save! # force summary calculation
|
9
|
+
end
|
10
|
+
|
11
|
+
test "summaries" do
|
12
|
+
assert_equal '4 USD'.to_money, @bill.charges_sum
|
13
|
+
assert_equal '5 USD'.to_money, @bill.surcharges_sum
|
14
|
+
assert_equal '0 USD'.to_money, @bill.discounts_sum
|
15
|
+
assert_equal '3 USD'.to_money, @bill.payments_sum
|
16
|
+
assert_equal '8 USD'.to_money, @bill.total
|
17
|
+
assert_equal '-5 USD'.to_money, @bill.balance
|
18
|
+
end
|
19
|
+
|
20
|
+
test "charge" do
|
21
|
+
charge = @bill.charge 3
|
22
|
+
assert_difference "@bill.charges.count" do
|
23
|
+
assert @bill.save!
|
24
|
+
end
|
25
|
+
assert charge.persisted?
|
26
|
+
assert_equal '14 USD'.to_money, @bill.total # ((1+1) + 2 + 3) + 100%
|
27
|
+
end
|
28
|
+
|
29
|
+
test "discount" do
|
30
|
+
discount = @bill.modify(-1.00, charge: billing_charges(:two))
|
31
|
+
c = billing_charges(:two)
|
32
|
+
assert_difference "@bill.modifiers.count" do
|
33
|
+
assert @bill.save
|
34
|
+
end
|
35
|
+
assert discount.try(:persisted?)
|
36
|
+
p @bill.discounts_sum
|
37
|
+
p @bill.surcharges_sum
|
38
|
+
assert_equal '6 USD'.to_money, @bill.total # ((1+1) + (2-1)) + 100%
|
39
|
+
end
|
40
|
+
=begin
|
41
|
+
test "surcharge" do
|
42
|
+
surcharge = @bill.modify(1.00, charge: billing_charges(:two))
|
43
|
+
assert surcharge.try(:persisted?)
|
44
|
+
assert_equal '8 USD'.to_money, @bill.total
|
45
|
+
end
|
46
|
+
|
47
|
+
test "pay" do
|
48
|
+
payment = @bill.pay billing_payment_types(:one)
|
49
|
+
assert @bill.balance.zero?, @bill.errors.full_messages.join(', ')
|
50
|
+
assert_equal '7 USD'.to_money, @bill.payments_sum
|
51
|
+
end
|
52
|
+
|
53
|
+
test "validate positive total" do
|
54
|
+
assert @bill.save
|
55
|
+
@bill.modify(-500)
|
56
|
+
assert @bill.errors.messages[:total]
|
57
|
+
assert_raise ActiveRecord::RecordInvalid do
|
58
|
+
@bill.save!
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
test "bill with payments should have origin" do
|
63
|
+
assert @bill.origin
|
64
|
+
assert @bill.payments.any?
|
65
|
+
@bill.origin = nil
|
66
|
+
assert_equal false, @bill.save
|
67
|
+
assert @bill.errors.messages[:origin]
|
68
|
+
end
|
69
|
+
|
70
|
+
test "autofin" do
|
71
|
+
assert @bill.pay billing_payment_types(:one)
|
72
|
+
assert @bill.finalized_at
|
73
|
+
end
|
74
|
+
=end
|
75
|
+
end
|
76
|
+
end
|
@@ -6,12 +6,19 @@ module Billing
|
|
6
6
|
@charge = billing_charges(:one)
|
7
7
|
end
|
8
8
|
|
9
|
-
test "
|
10
|
-
assert_equal Billing::Charge.
|
11
|
-
assert_equal Billing::Charge.
|
12
|
-
assert_equal Billing::Charge.
|
13
|
-
assert_equal Billing::Charge.
|
14
|
-
assert_equal Billing::Charge.
|
9
|
+
test "wild class method" do
|
10
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild(1)).price, '1 USD'.to_money
|
11
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild("1")).price, '1 USD'.to_money
|
12
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild("1EUR")).price, '1 EUR'.to_money
|
13
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild('1', price_currency: 'EUR')).price, '1 EUR'.to_money
|
14
|
+
assert_equal Billing::Charge.new(Billing::Charge.wild(price: 10, price_currency: 'EUR')).price, '10 EUR'.to_money
|
15
|
+
end
|
16
|
+
|
17
|
+
test "string protocol" do
|
18
|
+
charge = Billing::Charge.new Billing::Charge.wild("2.5*3.5##{billing_plus(:one).id}@#{billing_tax_groups(:one).id}+1.5%/Umbrella")
|
19
|
+
assert_equal charge.price, '3.5 USD'.to_money
|
20
|
+
assert_equal charge.name, 'Umbrella'
|
21
|
+
#p charge
|
15
22
|
end
|
16
23
|
end
|
17
24
|
end
|
@@ -22,10 +22,10 @@ module Billing
|
|
22
22
|
assert mod.errors[:charge]
|
23
23
|
end
|
24
24
|
|
25
|
-
test "allow only one global
|
25
|
+
test "allow only one global bill modifier" do
|
26
26
|
mod = billing_modifiers(:two).dup
|
27
27
|
assert_equal false, mod.save
|
28
|
-
assert mod.errors[:
|
28
|
+
assert mod.errors[:bill]
|
29
29
|
end
|
30
30
|
|
31
31
|
end
|
@@ -4,7 +4,7 @@ module Billing
|
|
4
4
|
class PaymentTest < ActiveSupport::TestCase
|
5
5
|
setup do
|
6
6
|
@payment = billing_payments(:one)
|
7
|
-
@
|
7
|
+
@bill = @payment.bill
|
8
8
|
end
|
9
9
|
|
10
10
|
# test "args_to_attributes class method" do
|
@@ -16,27 +16,27 @@ module Billing
|
|
16
16
|
# end
|
17
17
|
|
18
18
|
test "create" do
|
19
|
-
assert_equal 'Billing::PaymentWithType', @
|
20
|
-
assert @
|
19
|
+
assert_equal 'Billing::PaymentWithType', @bill.origin_payment_model
|
20
|
+
assert @bill.payments.create(type: 'Billing::PaymentWithType', value: 1, payment_type_id: @payment.payment_type_id).persisted?, "Can't create payment"
|
21
21
|
end
|
22
22
|
|
23
|
-
test "should be instance of
|
24
|
-
payment = @
|
23
|
+
test "should be instance of bill's origin_payment_model" do
|
24
|
+
payment = @bill.payments.new(type: 'Billing::Payment', value: 1, payment_type_id: @payment.payment_type_id)
|
25
25
|
assert !payment.save
|
26
|
-
assert payment.errors.messages[:
|
26
|
+
assert payment.errors.messages[:bill]
|
27
27
|
end
|
28
28
|
|
29
|
-
test "should have same fiscal flag as other
|
30
|
-
payment = @
|
29
|
+
test "should have same fiscal flag as other bill payments" do
|
30
|
+
payment = @bill.payments.new(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:fiscal).id)
|
31
31
|
assert !payment.save
|
32
|
-
assert payment.errors.messages[:
|
32
|
+
assert payment.errors.messages[:bill]
|
33
33
|
end
|
34
34
|
|
35
35
|
test "should be single cash payments" do
|
36
|
-
@
|
37
|
-
payment = @
|
36
|
+
@bill.payments.create!(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:cash).id)
|
37
|
+
payment = @bill.payments.new(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:cash).id)
|
38
38
|
assert !payment.save
|
39
|
-
assert payment.errors.messages[:
|
39
|
+
assert payment.errors.messages[:bill]
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: billing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4c
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Vangelov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description: Provides billing
|
69
|
+
description: Provides billing for an ActiveRecord model
|
70
70
|
email:
|
71
71
|
- email@data.bg
|
72
72
|
executables: []
|
@@ -76,26 +76,7 @@ files:
|
|
76
76
|
- MIT-LICENSE
|
77
77
|
- README.rdoc
|
78
78
|
- Rakefile
|
79
|
-
- app/
|
80
|
-
- app/assets/javascripts/billing/application.js
|
81
|
-
- app/assets/javascripts/billing/charges.js
|
82
|
-
- app/assets/javascripts/billing/modifiers.js
|
83
|
-
- app/assets/stylesheets/billing/accounts.css
|
84
|
-
- app/assets/stylesheets/billing/application.css
|
85
|
-
- app/assets/stylesheets/billing/charges.css
|
86
|
-
- app/assets/stylesheets/billing/modifiers.css
|
87
|
-
- app/assets/stylesheets/billing/payments.css
|
88
|
-
- app/controllers/billing/accounts_controller.rb
|
89
|
-
- app/controllers/billing/application_controller.rb
|
90
|
-
- app/controllers/billing/charges_controller.rb
|
91
|
-
- app/controllers/billing/modifiers_controller.rb
|
92
|
-
- app/controllers/billing/payments_controller.rb
|
93
|
-
- app/helpers/billing/accounts_helper.rb
|
94
|
-
- app/helpers/billing/application_helper.rb
|
95
|
-
- app/helpers/billing/charges_helper.rb
|
96
|
-
- app/helpers/billing/modifiers_helper.rb
|
97
|
-
- app/helpers/billing/payments_helper.rb
|
98
|
-
- app/models/billing/account.rb
|
79
|
+
- app/models/billing/bill.rb
|
99
80
|
- app/models/billing/charge.rb
|
100
81
|
- app/models/billing/department.rb
|
101
82
|
- app/models/billing/modifier.rb
|
@@ -113,15 +94,9 @@ files:
|
|
113
94
|
- app/models/billing/report.rb
|
114
95
|
- app/models/billing/tax_group.rb
|
115
96
|
- app/models/billing/version.rb
|
116
|
-
- app/models/concerns/billing/
|
117
|
-
- app/
|
118
|
-
-
|
119
|
-
- app/views/billing/accounts/show.html.erb
|
120
|
-
- app/views/billing/application/index.html.erb
|
121
|
-
- app/views/billing/charges/new.html.erb
|
122
|
-
- app/views/billing/modifiers/new.html.erb
|
123
|
-
- app/views/billing/payments/new.html.erb
|
124
|
-
- app/views/layouts/billing/application.html.erb
|
97
|
+
- app/models/concerns/billing/bill_item.rb
|
98
|
+
- app/models/concerns/billing/bill_text_parser.rb
|
99
|
+
- config/initializers/money.rb
|
125
100
|
- config/initializers/paper_trail.rb
|
126
101
|
- config/routes.rb
|
127
102
|
- db/migrate/20140717180443_create_billing_accounts.rb
|
@@ -168,19 +143,17 @@ files:
|
|
168
143
|
- db/migrate/20140729083408_add_number_to_billing_account.rb
|
169
144
|
- db/migrate/20140729180849_add_deleted_at_to_billing_modifier.rb
|
170
145
|
- db/migrate/20140729182146_add_deleted_at_to_billing_account.rb
|
146
|
+
- db/migrate/20140803073707_rename_billing_account_to_bill.rb
|
147
|
+
- db/migrate/20140804065726_add_qty_to_billing_charge.rb
|
148
|
+
- db/migrate/20140804070517_add_tax_ratio_to_billing_charge.rb
|
171
149
|
- lib/billing.rb
|
172
150
|
- lib/billing/billable.rb
|
173
151
|
- lib/billing/engine.rb
|
174
|
-
- lib/billing/mapping.rb
|
175
|
-
- lib/billing/routes.rb
|
176
152
|
- lib/billing/version.rb
|
153
|
+
- lib/collection_proxy_wild.rb
|
177
154
|
- lib/tasks/billing.rake
|
178
155
|
- lib/tasks/billing_tasks.rake
|
179
156
|
- test/billing_test.rb
|
180
|
-
- test/controllers/billing/accounts_controller_test.rb
|
181
|
-
- test/controllers/billing/charges_controller_test.rb
|
182
|
-
- test/controllers/billing/modifiers_controller_test.rb
|
183
|
-
- test/controllers/billing/payments_controller_test.rb
|
184
157
|
- test/dummy/README.rdoc
|
185
158
|
- test/dummy/Rakefile
|
186
159
|
- test/dummy/app/assets/javascripts/application.js
|
@@ -249,7 +222,7 @@ files:
|
|
249
222
|
- test/dummy/tmp/cache/assets/test/sprockets/efaa0abeb4ad44b0ef8df996631f3997
|
250
223
|
- test/dummy/tmp/cache/assets/test/sprockets/f393277b28dd79320611f18a379dbea7
|
251
224
|
- test/dummy/tmp/cache/assets/test/sprockets/fbf1489a0c3d66a329f070c10cd77a03
|
252
|
-
- test/fixtures/billing/
|
225
|
+
- test/fixtures/billing/bills.yml
|
253
226
|
- test/fixtures/billing/charges.yml
|
254
227
|
- test/fixtures/billing/departments.yml
|
255
228
|
- test/fixtures/billing/modifiers.yml
|
@@ -261,12 +234,7 @@ files:
|
|
261
234
|
- test/fixtures/billing/profiles.yml
|
262
235
|
- test/fixtures/billing/tax_groups.yml
|
263
236
|
- test/fixtures/profiles.yml
|
264
|
-
- test/
|
265
|
-
- test/helpers/billing/charges_helper_test.rb
|
266
|
-
- test/helpers/billing/modifiers_helper_test.rb
|
267
|
-
- test/helpers/billing/payments_helper_test.rb
|
268
|
-
- test/integration/navigation_test.rb
|
269
|
-
- test/models/billing/account_test.rb
|
237
|
+
- test/models/billing/bill_test.rb
|
270
238
|
- test/models/billing/charge_test.rb
|
271
239
|
- test/models/billing/department_test.rb
|
272
240
|
- test/models/billing/modifier_test.rb
|
@@ -308,19 +276,15 @@ test_files:
|
|
308
276
|
- test/fixtures/billing/origins.yml
|
309
277
|
- test/fixtures/billing/plus.yml
|
310
278
|
- test/fixtures/billing/payments.yml
|
279
|
+
- test/fixtures/billing/bills.yml
|
311
280
|
- test/fixtures/billing/charges.yml
|
312
281
|
- test/fixtures/billing/departments.yml
|
313
282
|
- test/fixtures/billing/modifiers.yml
|
314
283
|
- test/fixtures/billing/profiles.yml
|
315
284
|
- test/fixtures/billing/operators.yml
|
316
|
-
- test/fixtures/billing/accounts.yml
|
317
285
|
- test/fixtures/billing/tax_groups.yml
|
318
286
|
- test/fixtures/profiles.yml
|
319
287
|
- test/test_helper.rb
|
320
|
-
- test/controllers/billing/payments_controller_test.rb
|
321
|
-
- test/controllers/billing/modifiers_controller_test.rb
|
322
|
-
- test/controllers/billing/accounts_controller_test.rb
|
323
|
-
- test/controllers/billing/charges_controller_test.rb
|
324
288
|
- test/dummy/tmp/cache/assets/test/sprockets/6d34e4addaf3495d1d96306d164feb97
|
325
289
|
- test/dummy/tmp/cache/assets/test/sprockets/efaa0abeb4ad44b0ef8df996631f3997
|
326
290
|
- test/dummy/tmp/cache/assets/test/sprockets/e62907e54633a2adb53c33c1f59b79bf
|
@@ -389,14 +353,9 @@ test_files:
|
|
389
353
|
- test/dummy/public/404.html
|
390
354
|
- test/dummy/public/422.html
|
391
355
|
- test/dummy/Rakefile
|
392
|
-
- test/helpers/billing/accounts_helper_test.rb
|
393
|
-
- test/helpers/billing/payments_helper_test.rb
|
394
|
-
- test/helpers/billing/modifiers_helper_test.rb
|
395
|
-
- test/helpers/billing/charges_helper_test.rb
|
396
|
-
- test/integration/navigation_test.rb
|
397
356
|
- test/models/billing/tax_group_test.rb
|
398
|
-
- test/models/billing/account_test.rb
|
399
357
|
- test/models/billing/plu_test.rb
|
358
|
+
- test/models/billing/bill_test.rb
|
400
359
|
- test/models/billing/department_test.rb
|
401
360
|
- test/models/billing/payment_test.rb
|
402
361
|
- test/models/billing/operator_test.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
-
* file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require_dependency "billing/application_controller"
|
2
|
-
|
3
|
-
module Billing
|
4
|
-
class AccountsController < ApplicationController
|
5
|
-
before_action :set_account, except: [:index, :new, :create]
|
6
|
-
|
7
|
-
def index
|
8
|
-
@accounts = billable.billing_accounts
|
9
|
-
end
|
10
|
-
|
11
|
-
def new
|
12
|
-
@account = billable.billing_accounts.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def create
|
16
|
-
@account = billable.billing_accounts.new
|
17
|
-
if @account.save
|
18
|
-
redirect_to @account
|
19
|
-
else
|
20
|
-
render action: :new
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
def set_account
|
26
|
-
@account = billable.billing_accounts.find(params[:id])
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|