has_accounts 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
data/app/models/bank_account.rb
CHANGED
@@ -1,13 +1,3 @@
|
|
1
1
|
class BankAccount < Account
|
2
2
|
belongs_to :bank
|
3
|
-
|
4
|
-
# Standard methods
|
5
|
-
def to_s(value_range = Date.today, format = :default)
|
6
|
-
case format
|
7
|
-
when :short
|
8
|
-
"#{code}: CHF #{sprintf('%0.2f', saldo(value_range).currency_round)}"
|
9
|
-
else
|
10
|
-
"#{title} (#{code}) #{bank.to_s} #{number}: CHF #{sprintf('%0.2f', saldo(value_range).currency_round)}"
|
11
|
-
end
|
12
|
-
end
|
13
3
|
end
|
@@ -7,22 +7,26 @@ class SetupHasAccountsEngine < ActiveRecord::Migration
|
|
7
7
|
t.datetime "updated_at"
|
8
8
|
end
|
9
9
|
|
10
|
+
add_index "account_types", "name"
|
11
|
+
|
10
12
|
create_table "accounts" do |t|
|
11
13
|
t.string "title", :limit => 100
|
12
14
|
t.integer "parent_id"
|
13
15
|
t.integer "account_type_id"
|
14
16
|
t.integer "number"
|
15
17
|
t.string "code"
|
16
|
-
t.
|
18
|
+
t.string "type"
|
17
19
|
t.integer "holder_id"
|
18
20
|
t.string "holder_type"
|
19
21
|
t.integer "bank_id"
|
20
22
|
t.integer "esr_id"
|
21
|
-
t.
|
23
|
+
t.string "pc_id"
|
22
24
|
t.datetime "created_at"
|
23
25
|
t.datetime "updated_at"
|
26
|
+
t.string "iban"
|
24
27
|
end
|
25
28
|
|
29
|
+
add_index "accounts", ["account_type_id"], :name => "index_accounts_on_account_type_id"
|
26
30
|
add_index "accounts", ["bank_id"], :name => "index_accounts_on_bank_id"
|
27
31
|
add_index "accounts", ["code"], :name => "index_accounts_on_code"
|
28
32
|
add_index "accounts", ["holder_id", "holder_type"], :name => "index_accounts_on_holder_id_and_holder_type"
|
@@ -30,10 +34,14 @@ class SetupHasAccountsEngine < ActiveRecord::Migration
|
|
30
34
|
|
31
35
|
create_table "banks" do |t|
|
32
36
|
t.integer "vcard_id"
|
37
|
+
t.string "swift"
|
38
|
+
t.string "clearing"
|
33
39
|
t.datetime "created_at"
|
34
40
|
t.datetime "updated_at"
|
35
41
|
end
|
36
42
|
|
43
|
+
add_index "banks", :vcard_id
|
44
|
+
|
37
45
|
create_table "bookings" do |t|
|
38
46
|
t.string "title", :limit => 100
|
39
47
|
t.decimal "amount"
|
@@ -50,10 +58,14 @@ class SetupHasAccountsEngine < ActiveRecord::Migration
|
|
50
58
|
t.integer "reference_id"
|
51
59
|
t.string "reference_type"
|
52
60
|
end
|
61
|
+
|
62
|
+
add_index "bookings", ["credit_account_id"], :name => "index_bookings_on_credit_account_id"
|
63
|
+
add_index "bookings", ["debit_account_id"], :name => "index_bookings_on_debit_account_id"
|
64
|
+
add_index "bookings", ["reference_id", "reference_type"], :name => "index_bookings_on_reference_id_and_reference_type"
|
65
|
+
add_index "bookings", ["value_date"], :name => "index_bookings_on_value_date"
|
53
66
|
end
|
54
67
|
|
55
68
|
def self.down
|
56
69
|
drop_table :account_types, :accounts, :banks, :bookings
|
57
70
|
end
|
58
71
|
end
|
59
|
-
|
data/lib/has_accounts/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_accounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 55
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 10
|
9
|
+
- 0
|
10
|
+
version: 0.10.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Simon H\xC3\xBCrlimann (CyT)"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-10 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
requirements: []
|
75
75
|
|
76
76
|
rubyforge_project:
|
77
|
-
rubygems_version: 1.
|
77
|
+
rubygems_version: 1.3.7
|
78
78
|
signing_key:
|
79
79
|
specification_version: 3
|
80
80
|
summary: HasAccounts provides models for financial accounting.
|