africompta 1.9.10 → 1.9.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -1
- data/Gemfile.lock +14 -8
- data/africompta.gemspec +3 -2
- data/bin/afri_compta.rb +119 -0
- data/bin/africompta.sh +23 -0
- data/config.yaml.default +19 -0
- data/lib/africompta.rb +7 -1
- data/lib/africompta/acaccess.rb +54 -68
- data/lib/africompta/acqooxview.rb +10 -10
- data/lib/africompta/entities/account.rb +120 -116
- data/lib/africompta/entities/config_base.rb +9 -0
- data/lib/africompta/entities/remote.rb +240 -6
- data/lib/africompta/entities/report.rb +136 -0
- data/lib/africompta/entities/users.rb +18 -6
- data/lib/africompta/views/compta/admin.rb +135 -0
- data/lib/africompta/views/compta/check.rb +245 -0
- data/lib/africompta/views/compta/edit_accounts.rb +138 -0
- data/lib/africompta/views/compta/edit_movements.rb +167 -0
- data/lib/africompta/views/compta/remotes.rb +23 -0
- data/lib/africompta/views/compta/tabs.rb +9 -0
- data/lib/africompta/views/compta/users.rb +23 -0
- data/lib/africompta/views/report/compta_executive.rb +221 -0
- data/lib/africompta/views/report/compta_flat.rb +79 -0
- data/lib/africompta/views/report/tabs.rb +7 -2
- data/po/afri_compta-ar.po +2356 -0
- data/po/afri_compta-en.po +2253 -0
- data/po/afri_compta-fr.po +4345 -0
- data/test/ac_account.rb +176 -0
- data/{Test → test}/ac_africompta.rb +0 -0
- data/{Test → test}/ac_big.rb +0 -0
- data/test/ac_merge.rb +177 -0
- data/{Test → test}/ac_movement.rb +14 -1
- data/{Test → test}/ac_sqlite.rb +0 -0
- data/{Test → test}/config_test.yaml +1 -6
- data/test/other.conf +1 -0
- data/test/other.rb +18 -0
- data/test/test.conf +1 -0
- data/{Test → test}/test.rb +7 -14
- metadata +63 -18
- data/Test/ac_account.rb +0 -128
- data/lib/africompta/africompta.rb +0 -83
- data/lib/africompta/views/edit/movement.rb +0 -8
- data/lib/africompta/views/edit/tabs.rb +0 -8
- data/lib/africompta/views/report/annual.rb +0 -3
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: africompta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Gasser
|
@@ -16,21 +16,37 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.9.
|
19
|
+
version: 1.9.11
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.9.
|
26
|
+
version: 1.9.11
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: prawn
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.0
|
27
41
|
description: |-
|
28
42
|
With this module you can have a simple accounting-system.
|
29
43
|
It is based on http://github.com/ineiti/QooxView and adds Entities to handle
|
30
44
|
accounts and movements. For the standalone counterpart (which uses the same database),
|
31
45
|
see http://github.com/ineiti/AfriCompta_client .
|
32
46
|
email: ineiti@linusetviviane.ch
|
33
|
-
executables:
|
47
|
+
executables:
|
48
|
+
- afri_compta.rb
|
49
|
+
- africompta.sh
|
34
50
|
extensions: []
|
35
51
|
extra_rdoc_files: []
|
36
52
|
files:
|
@@ -38,29 +54,46 @@ files:
|
|
38
54
|
- Gemfile
|
39
55
|
- Gemfile.lock
|
40
56
|
- TODO
|
41
|
-
- Test/ac_account.rb
|
42
|
-
- Test/ac_africompta.rb
|
43
|
-
- Test/ac_big.rb
|
44
|
-
- Test/ac_movement.rb
|
45
|
-
- Test/ac_sqlite.rb
|
46
|
-
- Test/config_test.yaml
|
47
|
-
- Test/db.testGestion
|
48
|
-
- Test/test.rb
|
49
57
|
- VERSION
|
50
58
|
- africompta.gemspec
|
59
|
+
- bin/afri_compta.rb
|
60
|
+
- bin/africompta.sh
|
61
|
+
- config.yaml.default
|
51
62
|
- lib/africompta.rb
|
52
63
|
- lib/africompta/acaccess.rb
|
53
64
|
- lib/africompta/acqooxview.rb
|
54
|
-
- lib/africompta/africompta.rb
|
55
65
|
- lib/africompta/entities/account.rb
|
56
66
|
- lib/africompta/entities/acschemas.rb
|
67
|
+
- lib/africompta/entities/config_base.rb
|
57
68
|
- lib/africompta/entities/movement.rb
|
58
69
|
- lib/africompta/entities/remote.rb
|
70
|
+
- lib/africompta/entities/report.rb
|
59
71
|
- lib/africompta/entities/users.rb
|
60
|
-
- lib/africompta/views/
|
61
|
-
- lib/africompta/views/
|
62
|
-
- lib/africompta/views/
|
72
|
+
- lib/africompta/views/compta/admin.rb
|
73
|
+
- lib/africompta/views/compta/check.rb
|
74
|
+
- lib/africompta/views/compta/edit_accounts.rb
|
75
|
+
- lib/africompta/views/compta/edit_movements.rb
|
76
|
+
- lib/africompta/views/compta/remotes.rb
|
77
|
+
- lib/africompta/views/compta/tabs.rb
|
78
|
+
- lib/africompta/views/compta/users.rb
|
79
|
+
- lib/africompta/views/report/compta_executive.rb
|
80
|
+
- lib/africompta/views/report/compta_flat.rb
|
63
81
|
- lib/africompta/views/report/tabs.rb
|
82
|
+
- po/afri_compta-ar.po
|
83
|
+
- po/afri_compta-en.po
|
84
|
+
- po/afri_compta-fr.po
|
85
|
+
- test/ac_account.rb
|
86
|
+
- test/ac_africompta.rb
|
87
|
+
- test/ac_big.rb
|
88
|
+
- test/ac_merge.rb
|
89
|
+
- test/ac_movement.rb
|
90
|
+
- test/ac_sqlite.rb
|
91
|
+
- test/config_test.yaml
|
92
|
+
- test/db.testGestion
|
93
|
+
- test/other.conf
|
94
|
+
- test/other.rb
|
95
|
+
- test/test.conf
|
96
|
+
- test/test.rb
|
64
97
|
homepage: https://github.com/ineiti/AfriCompta
|
65
98
|
licenses:
|
66
99
|
- GPLv3
|
@@ -81,8 +114,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
114
|
version: '0'
|
82
115
|
requirements: []
|
83
116
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.6.11
|
85
118
|
signing_key:
|
86
119
|
specification_version: 4
|
87
120
|
summary: Africompta-module for QooxView
|
88
|
-
test_files:
|
121
|
+
test_files:
|
122
|
+
- test/ac_account.rb
|
123
|
+
- test/ac_africompta.rb
|
124
|
+
- test/ac_big.rb
|
125
|
+
- test/ac_merge.rb
|
126
|
+
- test/ac_movement.rb
|
127
|
+
- test/ac_sqlite.rb
|
128
|
+
- test/config_test.yaml
|
129
|
+
- test/db.testGestion
|
130
|
+
- test/other.conf
|
131
|
+
- test/other.rb
|
132
|
+
- test/test.conf
|
133
|
+
- test/test.rb
|
data/Test/ac_account.rb
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
|
3
|
-
class TC_Account < Test::Unit::TestCase
|
4
|
-
def setup
|
5
|
-
dputs(1){ 'Setting up new data'
|
6
|
-
}
|
7
|
-
Entities.delete_all_data()
|
8
|
-
|
9
|
-
dputs(2){ 'Resetting SQLite'
|
10
|
-
}
|
11
|
-
SQLite.dbs_close_all
|
12
|
-
FileUtils.cp( 'db.testGestion', 'data/compta.db')
|
13
|
-
SQLite.dbs_open_load_migrate
|
14
|
-
|
15
|
-
dputs(2){ 'And searching for some accounts'
|
16
|
-
}
|
17
|
-
@root = Accounts.match_by_name('Root')
|
18
|
-
@cash = Accounts.match_by_name('Cash')
|
19
|
-
@lending = Accounts.match_by_name('Lending')
|
20
|
-
@income = Accounts.match_by_name('Income')
|
21
|
-
@outcome = Accounts.match_by_name('Outcome')
|
22
|
-
@local = Users.match_by_name( 'local' )
|
23
|
-
|
24
|
-
@user_1 = Users.create( 'user1', '', 'pass')
|
25
|
-
@user_2 = Users.create( 'user2', '', 'pass')
|
26
|
-
end
|
27
|
-
|
28
|
-
def teardown
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_path
|
32
|
-
assert_equal 'Root::Cash', @cash.path
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_del_account
|
36
|
-
AccountRoot.accounts.each{|a|
|
37
|
-
dputs(1){"Found root-account #{a.inspect}"}
|
38
|
-
a.get_tree{|t|
|
39
|
-
dputs(1){
|
40
|
-
"#{t.path} - #{t.deleted.inspect}"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
assert_equal false, @root.delete, @root.inspect
|
45
|
-
assert_equal false, @income.delete
|
46
|
-
old_index = @lending.rev_index
|
47
|
-
assert_equal true, @lending.delete
|
48
|
-
assert_operator old_index, :<, @lending.rev_index
|
49
|
-
|
50
|
-
Accounts.create_path('Root::Cash::Foo', '')
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_account_root
|
54
|
-
Accounts.create_path('Root::Archive')
|
55
|
-
assert_equal nil, AccountRoot.archive
|
56
|
-
|
57
|
-
Accounts.create_path('Archive')
|
58
|
-
assert_not_equal nil, AccountRoot.archive
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_clean
|
62
|
-
Accounts.create_path('Test')
|
63
|
-
Accounts.dump
|
64
|
-
count_mov, bad_mov, count_acc, bad_acc = AccountRoot.clean
|
65
|
-
assert_equal [ 4, 0, 19, 1 ],
|
66
|
-
[ count_mov, bad_mov, count_acc, bad_acc ]
|
67
|
-
|
68
|
-
Accounts.dump
|
69
|
-
count_mov, bad_mov, count_acc, bad_acc = AccountRoot.clean
|
70
|
-
assert_equal [ 4, 0, 19, 0 ],
|
71
|
-
[ count_mov, bad_mov, count_acc, bad_acc ]
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_merge_two_users
|
75
|
-
@user_1.update_all
|
76
|
-
@u1 = {'user' => 'user1', 'pass' => 'pass'}
|
77
|
-
@user_2.update_all
|
78
|
-
@u2 = {'user' => 'user2', 'pass' => 'pass'}
|
79
|
-
|
80
|
-
a_id = ACaccess.post( 'account_get_id', @u1.merge( 'account' => 'Root') )
|
81
|
-
assert_equal '1', a_id
|
82
|
-
|
83
|
-
assert_equal '', ACaccess.get('accounts_get/user1,pass')
|
84
|
-
assert_equal '', ACaccess.get('accounts_get/user2,pass')
|
85
|
-
end
|
86
|
-
|
87
|
-
def test_merge_account_delete
|
88
|
-
test_merge_two_users
|
89
|
-
|
90
|
-
@lending.delete
|
91
|
-
dputs(3){@lending.inspect}
|
92
|
-
ACaccess.post( 'account_put', @u1.merge( 'account' => @lending.to_s ) )
|
93
|
-
assert_equal '', ACaccess.get('accounts_get/user1,pass')
|
94
|
-
assert_equal @lending.to_s, ACaccess.get('accounts_get/user2,pass').chomp
|
95
|
-
end
|
96
|
-
|
97
|
-
def test_merge_account_change
|
98
|
-
test_merge_two_users
|
99
|
-
|
100
|
-
@lending.name = 'Lendings'
|
101
|
-
@lending.new_index
|
102
|
-
dputs(3){@lending.inspect}
|
103
|
-
ACaccess.post( 'account_put', @u1.merge( 'account' => @lending.to_s ) )
|
104
|
-
assert_equal '', ACaccess.get('accounts_get/user1,pass')
|
105
|
-
assert_equal @lending.to_s, ACaccess.get('accounts_get/user2,pass').chomp
|
106
|
-
|
107
|
-
assert_equal 1, @lending.account_id
|
108
|
-
end
|
109
|
-
|
110
|
-
def test_print_pdf
|
111
|
-
@root.print_pdf( 'test.pdf', true )
|
112
|
-
end
|
113
|
-
|
114
|
-
def test_get_archives
|
115
|
-
(2011..2014).each{|y|
|
116
|
-
Movements.create( '', Date.new(y), 1000, @income, @cash )
|
117
|
-
}
|
118
|
-
Movements.create( '', Date.new(2013, 3, 3), 1000, @outcome, @cash )
|
119
|
-
Accounts.archive( 1, 2014 )
|
120
|
-
|
121
|
-
assert_equal %w(Archive::2011::Income Archive::2012::Income Archive::2013::Income),
|
122
|
-
Accounts.get_by_path('Root::Income').get_archives.collect{|a|
|
123
|
-
a.path }.sort
|
124
|
-
assert_equal %w(Archive::2012::Outcome Archive::2013::Outcome),
|
125
|
-
Accounts.get_by_path('Root::Outcome').get_archives.collect{|a|
|
126
|
-
a.path }.sort
|
127
|
-
end
|
128
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -I../QooxView -wKU
|
2
|
-
|
3
|
-
DEBUG_LVL=5
|
4
|
-
VERSION_AFRICOMPTA='1.9.8'
|
5
|
-
require 'fileutils'
|
6
|
-
|
7
|
-
AFRICOMPTA_DIR=File.dirname(__FILE__)
|
8
|
-
CONFIG_FILE='config.yaml'
|
9
|
-
if not FileTest.exists? CONFIG_FILE
|
10
|
-
puts "Config-file doesn't exist"
|
11
|
-
print 'Do you want me to copy a standard one? [Y/n] '
|
12
|
-
if gets.chomp.downcase != 'n'
|
13
|
-
FileUtils.cp 'config.yaml.default', 'config.yaml'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
begin
|
18
|
-
require 'qooxview'
|
19
|
-
require 'africompta/acqooxview'
|
20
|
-
rescue Exception => e
|
21
|
-
puts e.inspect
|
22
|
-
puts e.to_s
|
23
|
-
puts e.backtrace
|
24
|
-
|
25
|
-
dputs( 0 ){ "#{e.inspect}" }
|
26
|
-
dputs( 0 ){ "#{e.to_s}" }
|
27
|
-
puts e.backtrace
|
28
|
-
|
29
|
-
puts "Couldn't start AfriCompta - perhaps missing libraries?"
|
30
|
-
exit
|
31
|
-
end
|
32
|
-
|
33
|
-
Welcome.nologin
|
34
|
-
QooxView::init( 'entities', 'views')
|
35
|
-
|
36
|
-
# Autosave every 2 minutes
|
37
|
-
if ConfigBase.autosave == %w(true)
|
38
|
-
$autosave = Thread.new{
|
39
|
-
loop {
|
40
|
-
sleep 2 * 60
|
41
|
-
Entities.save_all
|
42
|
-
}
|
43
|
-
}
|
44
|
-
end
|
45
|
-
|
46
|
-
trap('SIGINT') {
|
47
|
-
throw :ctrl_c
|
48
|
-
}
|
49
|
-
|
50
|
-
$profiling = get_config( nil, :profiling )
|
51
|
-
catch :ctrl_c do
|
52
|
-
begin
|
53
|
-
webrick_port = get_config( 3302, :Webrick, :port )
|
54
|
-
dputs(2){"Starting at port #{webrick_port}" }
|
55
|
-
if $profiling
|
56
|
-
require 'rubygems'
|
57
|
-
require 'perftools'
|
58
|
-
PerfTools::CpuProfiler.start("/tmp/#{$profiling}") do
|
59
|
-
QooxView::startWeb webrick_port
|
60
|
-
end
|
61
|
-
else
|
62
|
-
QooxView::startWeb webrick_port
|
63
|
-
end
|
64
|
-
rescue Exception => e
|
65
|
-
dputs( 0 ){ "#{e.inspect}" }
|
66
|
-
dputs( 0 ){ "#{e.to_s}" }
|
67
|
-
puts e.backtrace
|
68
|
-
dputs( 0 ){ 'Saving all' }
|
69
|
-
Entities.save_all
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
if get_config( true, :autosave )
|
74
|
-
$autosave.kill
|
75
|
-
end
|
76
|
-
|
77
|
-
if $profiling
|
78
|
-
puts "Now run the following:
|
79
|
-
pprof.rb --pdf /tmp/#{$profiling} > /tmp/#{$profiling}.pdf
|
80
|
-
open /tmp/#{$profiling}.pdf
|
81
|
-
CPUPROFILE_FREQUENCY=500
|
82
|
-
"
|
83
|
-
end
|