invoicing 0.2.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -0
  3. data/README.md +57 -0
  4. data/Rakefile +16 -37
  5. data/lib/invoicing.rb +20 -10
  6. data/lib/invoicing/cached_record.rb +9 -6
  7. data/lib/invoicing/class_info.rb +34 -34
  8. data/lib/invoicing/connection_adapter_ext.rb +4 -4
  9. data/lib/invoicing/countries/uk.rb +6 -6
  10. data/lib/invoicing/currency_value.rb +39 -32
  11. data/lib/invoicing/find_subclasses.rb +40 -15
  12. data/lib/invoicing/ledger_item.rb +166 -145
  13. data/lib/invoicing/ledger_item/pdf_generator.rb +108 -0
  14. data/lib/invoicing/ledger_item/render_html.rb +76 -73
  15. data/lib/invoicing/ledger_item/render_ubl.rb +37 -35
  16. data/lib/invoicing/line_item.rb +43 -38
  17. data/lib/invoicing/price.rb +1 -1
  18. data/lib/invoicing/tax_rate.rb +3 -6
  19. data/lib/invoicing/taxable.rb +37 -32
  20. data/lib/invoicing/time_dependent.rb +40 -40
  21. data/lib/invoicing/version.rb +4 -4
  22. data/lib/rails/generators/invoicing/invoicing_generator.rb +14 -0
  23. data/lib/rails/generators/invoicing/ledger_item/ledger_item_generator.rb +17 -0
  24. data/lib/rails/generators/invoicing/ledger_item/templates/migration.rb +25 -0
  25. data/lib/rails/generators/invoicing/ledger_item/templates/model.rb +5 -0
  26. data/lib/rails/generators/invoicing/line_item/line_item_generator.rb +17 -0
  27. data/lib/rails/generators/invoicing/line_item/templates/migration.rb +20 -0
  28. data/lib/rails/generators/invoicing/line_item/templates/model.rb +5 -0
  29. data/lib/rails/generators/invoicing/tax_rate/tax_rate_generator.rb +17 -0
  30. data/lib/rails/generators/invoicing/tax_rate/templates/migration.rb +14 -0
  31. data/lib/rails/generators/invoicing/tax_rate/templates/model.rb +3 -0
  32. metadata +110 -153
  33. data.tar.gz.sig +0 -1
  34. data/History.txt +0 -31
  35. data/Manifest.txt +0 -62
  36. data/PostInstall.txt +0 -10
  37. data/README.rdoc +0 -58
  38. data/script/console +0 -10
  39. data/script/destroy +0 -14
  40. data/script/generate +0 -14
  41. data/tasks/rcov.rake +0 -4
  42. data/test/cached_record_test.rb +0 -100
  43. data/test/class_info_test.rb +0 -253
  44. data/test/connection_adapter_ext_test.rb +0 -79
  45. data/test/currency_value_test.rb +0 -209
  46. data/test/find_subclasses_test.rb +0 -120
  47. data/test/fixtures/README +0 -7
  48. data/test/fixtures/cached_record.sql +0 -22
  49. data/test/fixtures/class_info.sql +0 -28
  50. data/test/fixtures/currency_value.sql +0 -29
  51. data/test/fixtures/find_subclasses.sql +0 -43
  52. data/test/fixtures/ledger_item.sql +0 -39
  53. data/test/fixtures/line_item.sql +0 -33
  54. data/test/fixtures/price.sql +0 -4
  55. data/test/fixtures/tax_rate.sql +0 -4
  56. data/test/fixtures/taxable.sql +0 -14
  57. data/test/fixtures/time_dependent.sql +0 -35
  58. data/test/ledger_item_test.rb +0 -444
  59. data/test/line_item_test.rb +0 -139
  60. data/test/models/README +0 -4
  61. data/test/models/test_subclass_in_another_file.rb +0 -3
  62. data/test/models/test_subclass_not_in_database.rb +0 -6
  63. data/test/price_test.rb +0 -9
  64. data/test/ref-output/creditnote3.html +0 -82
  65. data/test/ref-output/creditnote3.xml +0 -89
  66. data/test/ref-output/invoice1.html +0 -93
  67. data/test/ref-output/invoice1.xml +0 -111
  68. data/test/ref-output/invoice2.html +0 -86
  69. data/test/ref-output/invoice2.xml +0 -98
  70. data/test/ref-output/invoice_null.html +0 -36
  71. data/test/render_html_test.rb +0 -70
  72. data/test/render_ubl_test.rb +0 -44
  73. data/test/setup.rb +0 -37
  74. data/test/tax_rate_test.rb +0 -9
  75. data/test/taxable_test.rb +0 -180
  76. data/test/test_helper.rb +0 -72
  77. data/test/time_dependent_test.rb +0 -180
  78. metadata.gz.sig +0 -4
@@ -1,3 +1,5 @@
1
+ require "active_support/concern"
2
+
1
3
  module Invoicing
2
4
  # == Time-dependent value objects
3
5
  #
@@ -63,11 +65,11 @@ module Invoicing
63
65
  # +----+-------+---------------+------------+---------------------+---------------------+----------------+
64
66
  # | id | value | description | is_default | valid_from | valid_until | replaced_by_id |
65
67
  # +----+-------+---------------+------------+---------------------+---------------------+----------------+
66
- # | 1 | 0.175 | Standard rate | 1 | 1991-04-01 00:00:00 | 2008-12-01 00:00:00 | 4 |
68
+ # | 1 | 0.175 | Standard rate | 1 | 1991-04-01 00:00:00 | 2008-12-01 00:00:00 | 4 |
67
69
  # | 2 | 0.05 | Reduced rate | 0 | 1991-04-01 00:00:00 | NULL | NULL |
68
70
  # | 3 | 0.0 | Zero rate | 0 | 1991-04-01 00:00:00 | NULL | NULL |
69
- # | 4 | 0.15 | Standard rate | 1 | 2008-12-01 00:00:00 | 2010-01-01 00:00:00 | 5 |
70
- # | 5 | 0.175 | Standard rate | 1 | 2010-01-01 00:00:00 | NULL | NULL |
71
+ # | 4 | 0.15 | Standard rate | 1 | 2008-12-01 00:00:00 | 2010-01-01 00:00:00 | 5 |
72
+ # | 5 | 0.175 | Standard rate | 1 | 2010-01-01 00:00:00 | NULL | NULL |
71
73
  # +----+-------+---------------+------------+---------------------+---------------------+----------------+
72
74
  #
73
75
  # Graphically, this may be illustrated as:
@@ -154,6 +156,7 @@ module Invoicing
154
156
  # Apart from these requirements, a +TimeDependent+ object is a normal model object, and you may
155
157
  # give it whatever extra metadata you want, and make references to it from any other model object.
156
158
  module TimeDependent
159
+ extend ActiveSupport::Concern
157
160
 
158
161
  module ActMethods
159
162
  # Identifies the current model object as a +TimeDependent+ object, and creates all the
@@ -174,11 +177,11 @@ module Invoicing
174
177
  # belongs_to :referral_program
175
178
  # named_scope :for_referral_program, lambda { |p| { :conditions => { :referral_program_id => p.id } } }
176
179
  # end
177
- #
180
+ #
178
181
  # reseller_program = ReferralProgram.find(1)
179
182
  # current_commission = CommissionRate.for_referral_program(reseller_program).default_record_now
180
183
  # puts "Earn #{current_commission.rate} per cent commission as a reseller..."
181
- #
184
+ #
182
185
  # changes = current_commission.changes_until(1.year.from_now)
183
186
  # for next_commission in changes
184
187
  # message = next_commission.nil? ? "Discontinued as of" : "Changing to #{next_commission.rate} per cent on"
@@ -187,17 +190,14 @@ module Invoicing
187
190
  # end
188
191
  #
189
192
  def acts_as_time_dependent(*args)
190
- # Activate CachedRecord first, because ClassInfo#initialize expects the cache to be ready
191
- acts_as_cached_record(*args)
192
-
193
193
  Invoicing::ClassInfo.acts_as(Invoicing::TimeDependent, self, args)
194
-
194
+
195
195
  # Create replaced_by association if it doesn't exist yet
196
196
  replaced_by_id = time_dependent_class_info.method(:replaced_by_id)
197
197
  unless respond_to? :replaced_by
198
- belongs_to :replaced_by, :class_name => class_name, :foreign_key => replaced_by_id
198
+ belongs_to :replaced_by, :class_name => self, :foreign_key => replaced_by_id
199
199
  end
200
-
200
+
201
201
  # Create value_at and value_now method aliases
202
202
  value_method = time_dependent_class_info.method(:value).to_s
203
203
  if value_method != 'value'
@@ -213,7 +213,7 @@ module Invoicing
213
213
  end # acts_as_time_dependent
214
214
  end # module ActMethods
215
215
 
216
-
216
+
217
217
  module ClassMethods
218
218
  # Returns a list of records which are valid at some point during a particular date/time
219
219
  # range. If there is a change of rate during this time interval, and one rate replaces
@@ -230,28 +230,28 @@ module Invoicing
230
230
  # valid but will become valid within the next month, for example.
231
231
  def valid_records_during(not_before, not_after)
232
232
  info = time_dependent_class_info
233
-
233
+
234
234
  # List of all records whose validity period intersects the selected period
235
- valid_records = cached_record_list.select do |record|
235
+ valid_records = all.select do |record|
236
236
  valid_from = info.get(record, :valid_from)
237
237
  valid_until = info.get(record, :valid_until)
238
238
  has_taken_effect = (valid_from < not_after) # N.B. less than
239
239
  not_yet_expired = (valid_until == nil) || (valid_until > not_before)
240
240
  has_taken_effect && not_yet_expired
241
241
  end
242
-
242
+
243
243
  # Select only those which do not have a predecessor which is also valid
244
244
  valid_records.select do |record|
245
245
  record.predecessors.empty? || (valid_records & record.predecessors).empty?
246
246
  end
247
247
  end
248
-
248
+
249
249
  # Returns the list of all records which are valid at one particular point in time.
250
250
  # If you need to consider a period of time rather than a point in time, use
251
251
  # +valid_records_during+.
252
252
  def valid_records_at(point_in_time)
253
253
  info = time_dependent_class_info
254
- cached_record_list.select do |record|
254
+ all.select do |record|
255
255
  valid_from = info.get(record, :valid_from)
256
256
  valid_until = info.get(record, :valid_until)
257
257
  has_taken_effect = (valid_from <= point_in_time) # N.B. less than or equals
@@ -259,7 +259,7 @@ module Invoicing
259
259
  has_taken_effect && not_yet_expired
260
260
  end
261
261
  end
262
-
262
+
263
263
  # Returns the default record which is valid at a particular point in time.
264
264
  # If there is no record marked as default, nil is returned; if there are
265
265
  # multiple records marked as default, results are undefined.
@@ -268,12 +268,12 @@ module Invoicing
268
268
  info = time_dependent_class_info
269
269
  valid_records_at(point_in_time).select{|record| info.get(record, :is_default)}.first
270
270
  end
271
-
271
+
272
272
  # Returns the default record which is valid at the current moment.
273
273
  def default_record_now
274
274
  default_record_at(Time.now)
275
275
  end
276
-
276
+
277
277
  # Finds the default record for a particular +point_in_time+ (using +default_record_at+),
278
278
  # then returns the value of that record's +value+ column. If +value+ was renamed to
279
279
  # +another_method_name+ (option to +acts_as_time_dependent+), then
@@ -281,7 +281,7 @@ module Invoicing
281
281
  def default_value_at(point_in_time)
282
282
  time_dependent_class_info.get(default_record_at(point_in_time), :value)
283
283
  end
284
-
284
+
285
285
  # Finds the current default record (like +default_record_now+),
286
286
  # then returns the value of that record's +value+ column. If +value+ was renamed to
287
287
  # +another_method_name+ (option to +acts_as_time_dependent+), then
@@ -289,7 +289,7 @@ module Invoicing
289
289
  def default_value_now
290
290
  default_value_at(Time.now)
291
291
  end
292
-
292
+
293
293
  end # module ClassMethods
294
294
 
295
295
  # Returns a list of objects of the same type as this object, which refer to this object
@@ -298,7 +298,7 @@ module Invoicing
298
298
  def predecessors
299
299
  time_dependent_class_info.predecessors(self)
300
300
  end
301
-
301
+
302
302
  # Translates this record into its replacement for a given point in time, if necessary/possible.
303
303
  #
304
304
  # * If this record is still valid at the given date/time, this method just returns self.
@@ -311,7 +311,7 @@ module Invoicing
311
311
  def record_at(point_in_time)
312
312
  valid_from = time_dependent_class_info.get(self, :valid_from)
313
313
  valid_until = time_dependent_class_info.get(self, :valid_until)
314
-
314
+
315
315
  if valid_from > point_in_time
316
316
  (predecessors.size == 1) ? predecessors[0].record_at(point_in_time) : nil
317
317
  elsif valid_until.nil? || (valid_until > point_in_time)
@@ -322,13 +322,13 @@ module Invoicing
322
322
  replaced_by.record_at(point_in_time)
323
323
  end
324
324
  end
325
-
325
+
326
326
  # Returns self if this record is currently valid, otherwise its past or future replacement
327
327
  # (see +record_at+). If there is no valid replacement, nil is returned.
328
328
  def record_now
329
329
  record_at Time.now
330
330
  end
331
-
331
+
332
332
  # Finds this record's replacement for a given point in time (see +record_at+), then returns
333
333
  # the value in its +value+ column. If +value+ was renamed to +another_method_name+ (option to
334
334
  # +acts_as_time_dependent+), then +another_method_name_at+ is defined as an alias for +value_at+.
@@ -342,7 +342,7 @@ module Invoicing
342
342
  def value_now
343
343
  value_at Time.now
344
344
  end
345
-
345
+
346
346
  # Examines the replacement chain from this record into the future, during the period
347
347
  # starting with this record's +valid_from+ and ending at +point_in_time+.
348
348
  # If this record stays valid until after +point_in_time+, an empty list is returned.
@@ -361,27 +361,27 @@ module Invoicing
361
361
  end
362
362
  changes
363
363
  end
364
-
365
-
364
+
365
+
366
366
  # Stores state in the ActiveRecord class object
367
367
  class ClassInfo < Invoicing::ClassInfo::Base #:nodoc:
368
-
369
- def initialize(model_class, previous_info, args)
370
- super
368
+ def predecessors(record)
371
369
  # @predecessors is a hash of an ID pointing to the list of all objects which have that ID
372
370
  # as replaced_by_id value
373
- @predecessors = {}
374
- for record in model_class.cached_record_list
371
+ @predecessors ||= fetch_predecessors
372
+ @predecessors[get(record, :id)] || []
373
+ end
374
+
375
+ def fetch_predecessors
376
+ _predecessors = {}
377
+ for record in model_class.all
375
378
  id = get(record, :replaced_by_id)
376
379
  unless id.nil?
377
- @predecessors[id] ||= []
378
- @predecessors[id] << record
380
+ _predecessors[id] ||= []
381
+ _predecessors[id] << record
379
382
  end
380
383
  end
381
- end
382
-
383
- def predecessors(record)
384
- @predecessors[get(record, :id)] || []
384
+ _predecessors
385
385
  end
386
386
  end # class ClassInfo
387
387
  end # module TimeDependent
@@ -1,10 +1,10 @@
1
1
  module Invoicing
2
2
  module Version
3
- MAJOR = 0
4
- MINOR = 2
5
- BUILD = 1
3
+ MAJOR = 1
4
+ MINOR = 0
5
+ BUILD = 0
6
6
 
7
- def to_a
7
+ def to_a
8
8
  [MAJOR, MINOR, BUILD]
9
9
  end
10
10
 
@@ -0,0 +1,14 @@
1
+ module Invoicing
2
+ module Generators
3
+ class ModelsGenerator < Rails::Generators::Base
4
+ desc "Generates models for ledger and taxable items"
5
+ namespace "invoicing"
6
+
7
+ def create_models
8
+ invoke "invoicing:tax_rate", ["tax_rate"]
9
+ invoke "invoicing:ledger_item", ["ledger_item"]
10
+ invoke "invoicing:line_item", ["line_item"]
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ require 'rails/generators/active_record'
2
+
3
+ module Invoicing
4
+ module Generators
5
+ class LedgerItemGenerator < ActiveRecord::Generators::Base
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ def copy_migrations
9
+ migration_template "migration.rb", "db/migrate/create_invoicing_ledger_items.rb"
10
+ end
11
+
12
+ def copy_models
13
+ template "model.rb", "app/models/invoicing_ledger_item.rb"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ class CreateInvoicingLedgerItems < ActiveRecord::Migration
2
+ def change
3
+ create_table :invoicing_ledger_items do |t|
4
+ t.references :sender
5
+ t.references :recipient
6
+
7
+ t.string :type
8
+ t.datetime :issue_date
9
+ t.string :currency, limit: 3, null: false
10
+ t.decimal :total_amount, precision: 20, scale: 4
11
+ t.decimal :tax_amount, precision: 20, scale: 4
12
+ t.string :status, limit: 20
13
+
14
+ # These are optional fields, can be specified via options.
15
+ t.string :identifier, limit: 50
16
+ t.string :description
17
+ t.datetime :period_start
18
+ t.datetime :period_end
19
+ t.string :uuid, limit: 40
20
+ t.datetime :due_date
21
+
22
+ t.timestamps
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,5 @@
1
+ class InvoicingLedgerItem < ActiveRecord::Base
2
+ acts_as_ledger_item
3
+
4
+ has_many :line_items, class_name: 'InvoicingLineItem', foreign_key: :ledger_item_id
5
+ end
@@ -0,0 +1,17 @@
1
+ require 'rails/generators/active_record'
2
+
3
+ module Invoicing
4
+ module Generators
5
+ class LineItemGenerator < ActiveRecord::Generators::Base
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ def copy_migrations
9
+ migration_template "migration.rb", "db/migrate/create_invoicing_line_items.rb"
10
+ end
11
+
12
+ def copy_models
13
+ template "model.rb", "app/models/invoicing_line_item.rb"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,20 @@
1
+ class CreateInvoicingLineItems < ActiveRecord::Migration
2
+ def change
3
+ create_table :invoicing_line_items do |t|
4
+ t.references :ledger_item
5
+
6
+ t.string :type
7
+ t.decimal :net_amount, precision: 20, scale: 4
8
+ t.decimal :tax_amount, precision: 20, scale: 4
9
+
10
+ # These are optional fields, can be specified via options.
11
+ t.string :description
12
+ t.string :uuid, limit: 40
13
+ t.datetime :tax_point
14
+ t.decimal :quantity, precision: 20, scale: 4
15
+ t.integer :creator_id
16
+
17
+ t.timestamps
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ class InvoicingLineItem < ActiveRecord::Base
2
+ acts_as_line_item
3
+
4
+ belongs_to :ledger_item, class_name: 'InvoicingLedgerItem'
5
+ end
@@ -0,0 +1,17 @@
1
+ require 'rails/generators/active_record'
2
+
3
+ module Invoicing
4
+ module Generators
5
+ class TaxRateGenerator < ActiveRecord::Generators::Base
6
+ source_root File.expand_path("../templates", __FILE__)
7
+
8
+ def copy_migration_file
9
+ migration_template "migration.rb", "db/migrate/create_invoicing_tax_rates.rb"
10
+ end
11
+
12
+ def copy_model
13
+ template "model.rb", "app/models/invoicing_tax_rate.rb"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ class CreateInvoicingTaxRates < ActiveRecord::Migration
2
+ def change
3
+ create_table :invoicing_tax_rates do |t|
4
+ t.string :description
5
+ t.decimal :rate, precision: 20, scale: 4
6
+ t.datetime :valid_from, null: false
7
+ t.datetime :valid_until
8
+ t.integer :replaced_by_id
9
+ t.boolean :is_default
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ class InvoicingTaxRate < ActiveRecord::Base
2
+ acts_as_tax_rate
3
+ end
metadata CHANGED
@@ -1,95 +1,98 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: invoicing
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Martin Kleppmann
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDQjCCAiqgAwIBAgIBADANBgkqhkiG9w0BAQUFADBHMRIwEAYDVQQDDAlydWJ5
14
- Zm9yZ2UxHDAaBgoJkiaJk/IsZAEZFgxlcHRjb21wdXRpbmcxEzARBgoJkiaJk/Is
15
- ZAEZFgNjb20wHhcNMDkwNDE0MTkwMTIwWhcNMTAwNDE0MTkwMTIwWjBHMRIwEAYD
16
- VQQDDAlydWJ5Zm9yZ2UxHDAaBgoJkiaJk/IsZAEZFgxlcHRjb21wdXRpbmcxEzAR
17
- BgoJkiaJk/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
18
- AQDTglrdKabHepgLjgzM1Z52ABCZZ/xsBbn+4pE2jm7aGj2c0fZ+5Uhg0/MfyKsz
19
- g3jEFjj0GeNFW7l1sHJYf8mTrdCyAuaymyB2LcLwPtte7/3daAWcs6wAJR8nm9xa
20
- CzoeAFjCLcbhZazNBURMizj1z9eTArxhpfpNw4uSIExxNRoykeiFGZ4iq5Getj5x
21
- B/JNTdxM7m2KLx+3YKp2LsV0NLL7hRp6zZ6KW1NTWt1mQ58SjDUiRhThfxPfVpCA
22
- NI3O+ikDERJWo+nLMUNAZXiB6iMimgUNIUm462tbrumloEjQ/wJE6veGyCRS4jfq
23
- Ldnuf6CKFRIxhb9QaN+cu0lLAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQD
24
- AgSwMB0GA1UdDgQWBBRR5pYhCiPVxI3rYNDwFcCSqOUGOTANBgkqhkiG9w0BAQUF
25
- AAOCAQEAnrM8+tf8f5y8icgcWErHTZZ6oInZxbH8DbAbJ9zIdD/u2o8agzykc/ub
26
- Kza0RLJoINt0f1Bb6hzIja82EPeEEQKgR6BJAwPZlxZLGYBTyZeZRy3PJ8IjQ9Zk
27
- Fl6OOjmxFfjgF0UGvFHPYUJaNtN8kPs2lyZYmmUrf7qF0n6nwShnVkYePUlvyW0i
28
- kqloUNEB5PbHhEwmSTSYOseqm2l2rOAgN3aKVzNFWiMjzZn8OwYaETtD83yB9zlK
29
- hqnkWqtTW1V1mEZRyNIx71QdrsaovPQhIKp0bMFUwntYXklVKqxYGHebwt//Gb++
30
- jT4Qh3sYJbvqWGFAQcuOIf4spvpNiA==
31
- -----END CERTIFICATE-----
32
-
33
- date: 2009-08-26 00:00:00 +01:00
34
- default_executable:
35
- dependencies:
36
- - !ruby/object:Gem::Dependency
37
- name: activerecord
38
- type: :runtime
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
10
+ cert_chain: []
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
42
17
  - - ">="
43
- - !ruby/object:Gem::Version
44
- version: 2.1.0
45
- version:
46
- - !ruby/object:Gem::Dependency
47
- name: builder
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.13
48
20
  type: :runtime
49
- version_requirement:
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.13
27
+ - !ruby/object:Gem::Dependency
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: flexmock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
52
45
  - - ">="
53
- - !ruby/object:Gem::Version
54
- version: "2.0"
55
- version:
56
- - !ruby/object:Gem::Dependency
57
- name: newgem
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
58
48
  type: :development
59
- version_requirement:
60
- version_requirements: !ruby/object:Gem::Requirement
61
- requirements:
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: uuid
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
62
73
  - - ">="
63
- - !ruby/object:Gem::Version
64
- version: 1.3.0
65
- version:
66
- - !ruby/object:Gem::Dependency
67
- name: hoe
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
68
76
  type: :development
69
- version_requirement:
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
72
80
  - - ">="
73
- - !ruby/object:Gem::Version
74
- version: 2.3.2
75
- version:
76
- description: This is a framework for generating and displaying invoices (ideal for commercial Rails apps). It allows for flexible business logic; provides tools for tax handling, commission calculation etc. It aims to be both developer-friendly and accountant-friendly. The Ruby Invoicing Framework is based on {ActiveRecord}[http://api.rubyonrails.org/classes/ActiveRecord/Base.html]. Please see {the website}[http://ept.github.com/invoicing/] for an introduction to using Invoicing, and check the {API reference}[http://invoicing.rubyforge.org/doc/] for in-depth details.
77
- email:
78
- - rubyforge@eptcomputing.com
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: |
84
+ This is a framework for generating and displaying invoices (ideal for commercial
85
+ Rails apps). It allows for flexible business logic; provides tools for tax
86
+ handling, commission calculation etc. It aims to be both developer-friendly
87
+ and accountant-friendly.
88
+ email:
89
+ - "@martinkl"
79
90
  executables: []
80
-
81
91
  extensions: []
82
-
83
- extra_rdoc_files:
84
- - History.txt
85
- - Manifest.txt
86
- - PostInstall.txt
87
- files:
88
- - History.txt
92
+ extra_rdoc_files: []
93
+ files:
89
94
  - LICENSE
90
- - Manifest.txt
91
- - PostInstall.txt
92
- - README.rdoc
95
+ - README.md
93
96
  - Rakefile
94
97
  - lib/invoicing.rb
95
98
  - lib/invoicing/cached_record.rb
@@ -99,6 +102,7 @@ files:
99
102
  - lib/invoicing/currency_value.rb
100
103
  - lib/invoicing/find_subclasses.rb
101
104
  - lib/invoicing/ledger_item.rb
105
+ - lib/invoicing/ledger_item/pdf_generator.rb
102
106
  - lib/invoicing/ledger_item/render_html.rb
103
107
  - lib/invoicing/ledger_item/render_ubl.rb
104
108
  - lib/invoicing/line_item.rb
@@ -107,84 +111,37 @@ files:
107
111
  - lib/invoicing/taxable.rb
108
112
  - lib/invoicing/time_dependent.rb
109
113
  - lib/invoicing/version.rb
110
- - script/console
111
- - script/destroy
112
- - script/generate
113
- - tasks/rcov.rake
114
- - test/cached_record_test.rb
115
- - test/class_info_test.rb
116
- - test/connection_adapter_ext_test.rb
117
- - test/currency_value_test.rb
118
- - test/find_subclasses_test.rb
119
- - test/fixtures/README
120
- - test/fixtures/cached_record.sql
121
- - test/fixtures/class_info.sql
122
- - test/fixtures/currency_value.sql
123
- - test/fixtures/find_subclasses.sql
124
- - test/fixtures/ledger_item.sql
125
- - test/fixtures/line_item.sql
126
- - test/fixtures/price.sql
127
- - test/fixtures/tax_rate.sql
128
- - test/fixtures/taxable.sql
129
- - test/fixtures/time_dependent.sql
130
- - test/ledger_item_test.rb
131
- - test/line_item_test.rb
132
- - test/models/README
133
- - test/models/test_subclass_in_another_file.rb
134
- - test/models/test_subclass_not_in_database.rb
135
- - test/price_test.rb
136
- - test/ref-output/creditnote3.html
137
- - test/ref-output/creditnote3.xml
138
- - test/ref-output/invoice1.html
139
- - test/ref-output/invoice1.xml
140
- - test/ref-output/invoice2.html
141
- - test/ref-output/invoice2.xml
142
- - test/ref-output/invoice_null.html
143
- - test/render_html_test.rb
144
- - test/render_ubl_test.rb
145
- - test/setup.rb
146
- - test/tax_rate_test.rb
147
- - test/taxable_test.rb
148
- - test/test_helper.rb
149
- - test/time_dependent_test.rb
150
- has_rdoc: true
151
- homepage:
152
- post_install_message: PostInstall.txt
153
- rdoc_options:
154
- - --main
155
- - README.txt
156
- require_paths:
114
+ - lib/rails/generators/invoicing/invoicing_generator.rb
115
+ - lib/rails/generators/invoicing/ledger_item/ledger_item_generator.rb
116
+ - lib/rails/generators/invoicing/ledger_item/templates/migration.rb
117
+ - lib/rails/generators/invoicing/ledger_item/templates/model.rb
118
+ - lib/rails/generators/invoicing/line_item/line_item_generator.rb
119
+ - lib/rails/generators/invoicing/line_item/templates/migration.rb
120
+ - lib/rails/generators/invoicing/line_item/templates/model.rb
121
+ - lib/rails/generators/invoicing/tax_rate/tax_rate_generator.rb
122
+ - lib/rails/generators/invoicing/tax_rate/templates/migration.rb
123
+ - lib/rails/generators/invoicing/tax_rate/templates/model.rb
124
+ homepage: http://ept.github.com/invoicing
125
+ licenses: []
126
+ metadata: {}
127
+ post_install_message:
128
+ rdoc_options: []
129
+ require_paths:
157
130
  - lib
158
- required_ruby_version: !ruby/object:Gem::Requirement
159
- requirements:
131
+ required_ruby_version: !ruby/object:Gem::Requirement
132
+ requirements:
160
133
  - - ">="
161
- - !ruby/object:Gem::Version
162
- version: "0"
163
- version:
164
- required_rubygems_version: !ruby/object:Gem::Requirement
165
- requirements:
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
166
138
  - - ">="
167
- - !ruby/object:Gem::Version
168
- version: "0"
169
- version:
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
170
141
  requirements: []
171
-
172
- rubyforge_project: invoicing
173
- rubygems_version: 1.3.1
142
+ rubyforge_project:
143
+ rubygems_version: 2.2.0.rc.1
174
144
  signing_key:
175
- specification_version: 2
176
- summary: This is a framework for generating and displaying invoices (ideal for commercial Rails apps). It allows for flexible business logic; provides tools for tax handling, commission calculation etc. It aims to be both developer-friendly and accountant-friendly.
177
- test_files:
178
- - test/cached_record_test.rb
179
- - test/class_info_test.rb
180
- - test/connection_adapter_ext_test.rb
181
- - test/currency_value_test.rb
182
- - test/find_subclasses_test.rb
183
- - test/ledger_item_test.rb
184
- - test/line_item_test.rb
185
- - test/price_test.rb
186
- - test/render_html_test.rb
187
- - test/render_ubl_test.rb
188
- - test/tax_rate_test.rb
189
- - test/taxable_test.rb
190
- - test/time_dependent_test.rb
145
+ specification_version: 4
146
+ summary: Ruby Invoicing Framework
147
+ test_files: []