vesr 0.8.0 → 0.8.1

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.
@@ -69,7 +69,7 @@ class EsrRecord < ActiveRecord::Base
69
69
  end
70
70
 
71
71
  # Invoices
72
- before_create :assign_invoice, :create_esr_booking
72
+ before_create :assign_invoice, :build_esr_booking
73
73
 
74
74
  private
75
75
  def evaluate_bad
@@ -125,7 +125,7 @@ class EsrRecord < ActiveRecord::Base
125
125
  BankAccount.find_by_esr_id(client_id)
126
126
  end
127
127
 
128
- def create_esr_booking
128
+ def build_esr_booking
129
129
  if invoice
130
130
  esr_booking = invoice.bookings.build
131
131
  else
@@ -153,10 +153,16 @@ module Prawn
153
153
  reference_code.reverse.gsub(/(.....)/, '\1 ').reverse
154
154
  end
155
155
 
156
+ # Formats an account number for ESR
157
+ #
158
+ # Account numbers for ESR should have the following format:
159
+ # XXYYYYYYZ, where the number of digits is fixed. We support
160
+ # providing the number in the format XX-YYYY-Z which is more
161
+ # common in written communication.
156
162
  def esr9_format_account_id(account_id)
157
163
  (pre, main, post) = account_id.split('-')
158
164
 
159
- sprintf('%02i%06i%1i', pre, main, post)
165
+ sprintf('%02i%06i%1i', pre.to_i, main.to_i, post.to_i)
160
166
  end
161
167
  end
162
168
  end
data/lib/vesr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vesr
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vesr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
5
- prerelease: false
4
+ hash: 61
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek
@@ -16,8 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-12-06 00:00:00 +01:00
20
- default_executable:
19
+ date: 2012-01-03 00:00:00 Z
21
20
  dependencies: []
22
21
 
23
22
  description: VESR provides support for ESR number calculations and gives ready to use Rails components.
@@ -53,7 +52,6 @@ files:
53
52
  - lib/vesr/version.rb
54
53
  - README.rdoc
55
54
  - LICENSE.txt
56
- has_rdoc: true
57
55
  homepage: https://github.com/raskhadafi/vesr
58
56
  licenses:
59
57
  - MIT
@@ -83,9 +81,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
81
  requirements: []
84
82
 
85
83
  rubyforge_project:
86
- rubygems_version: 1.3.7
84
+ rubygems_version: 1.8.10
87
85
  signing_key:
88
86
  specification_version: 3
89
87
  summary: VESR invoice support library.
90
88
  test_files: []
91
89
 
90
+ has_rdoc: