keepr 0.6.0 → 0.7.0
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/.travis.yml +2 -2
- data/LICENSE.txt +1 -1
- data/README.md +2 -2
- data/ci/Gemfile-rails-4-2 +1 -1
- data/ci/Gemfile-rails-5-0 +1 -1
- data/ci/Gemfile-rails-5-1 +1 -1
- data/ci/Gemfile-rails-5-2 +1 -1
- data/ci/Gemfile-rails-6-0 +1 -1
- data/keepr.gemspec +2 -2
- data/lib/keepr/groups_creator.rb +17 -4
- data/lib/keepr/groups_creator/{asset.txt → de/asset.txt} +0 -0
- data/lib/keepr/groups_creator/{liability.txt → de/liability.txt} +0 -0
- data/lib/keepr/groups_creator/{profit_and_loss.txt → de/profit_and_loss.txt} +0 -0
- data/lib/keepr/groups_creator/en/asset.txt +36 -0
- data/lib/keepr/groups_creator/en/liability.txt +28 -0
- data/lib/keepr/groups_creator/en/profit_and_loss.txt +31 -0
- data/lib/keepr/groups_creator/es/asset.txt +36 -0
- data/lib/keepr/groups_creator/es/liability.txt +28 -0
- data/lib/keepr/groups_creator/es/profit_and_loss.txt +31 -0
- data/lib/keepr/version.rb +1 -1
- data/spec/keepr/groups_creator_spec.rb +6 -6
- metadata +16 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2680eedcb47403d6bcbae90de674d208f8a9ab06570b20e122c0c641c42e114
|
4
|
+
data.tar.gz: c33827bf895e0e15ea763a5217eb2efa3ff0f9fa5a48ae74ee4c07750a56ee28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9c5e2703b9ce01a2aed1b29c096ffc879518a10528fb1f31092c6fb5602c7b566eade957974ec381904525c3d3ff455937fbb38f12fa700778b6d9b06d1256f
|
7
|
+
data.tar.gz: bb4d6e29f65dd0fac3d5b3f3ff764511387e543371df91318bf1117b1a8d4aba9bc9dc245ac94b6a07bdf063aa8f5a93ed70322899067306881b3162e1ac4091
|
data/.travis.yml
CHANGED
@@ -4,7 +4,7 @@ language: ruby
|
|
4
4
|
rvm:
|
5
5
|
- 2.5.8
|
6
6
|
- 2.6.6
|
7
|
-
- 2.7.
|
7
|
+
- 2.7.2
|
8
8
|
gemfile:
|
9
9
|
- ci/Gemfile-rails-4-2
|
10
10
|
- ci/Gemfile-rails-5-0
|
@@ -13,7 +13,7 @@ gemfile:
|
|
13
13
|
- ci/Gemfile-rails-6-0
|
14
14
|
matrix:
|
15
15
|
exclude:
|
16
|
-
- rvm: 2.7.
|
16
|
+
- rvm: 2.7.2
|
17
17
|
gemfile: ci/Gemfile-rails-4-2
|
18
18
|
script:
|
19
19
|
- bundle exec rake
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ This Ruby gem provides a double entry accounting system for use in any Rails app
|
|
4
4
|
|
5
5
|
[](https://travis-ci.org/ledermann/keepr)
|
6
6
|
[](https://codeclimate.com/github/ledermann/keepr)
|
7
|
-
[](https://coveralls.io/
|
7
|
+
[](https://coveralls.io/github/ledermann/keepr?branch=master)
|
8
8
|
|
9
9
|
## Features
|
10
10
|
|
@@ -64,4 +64,4 @@ TODO: Write usage instructions here
|
|
64
64
|
* https://github.com/bigfleet/accountable
|
65
65
|
|
66
66
|
|
67
|
-
Copyright (c) 2013-
|
67
|
+
Copyright (c) 2013-2020 [Georg Ledermann](https://ledermann.dev), released under the MIT license
|
data/ci/Gemfile-rails-4-2
CHANGED
data/ci/Gemfile-rails-5-0
CHANGED
data/ci/Gemfile-rails-5-1
CHANGED
data/ci/Gemfile-rails-5-2
CHANGED
data/ci/Gemfile-rails-6-0
CHANGED
data/keepr.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'keepr'
|
9
9
|
spec.version = Keepr::VERSION
|
10
10
|
spec.authors = 'Georg Ledermann'
|
11
|
-
spec.email = '
|
11
|
+
spec.email = 'georg@ledermann.dev'
|
12
12
|
spec.description = 'Double entry bookkeeping with Rails'
|
13
13
|
spec.summary = 'Some basic ActiveRecord models to build a double entry bookkeeping application'
|
14
14
|
spec.homepage = 'https://github.com/ledermann/keepr'
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency 'datev', '>= 0.5.0'
|
26
26
|
|
27
27
|
spec.add_development_dependency 'bundler'
|
28
|
-
spec.add_development_dependency 'coveralls'
|
28
|
+
spec.add_development_dependency 'coveralls', '~> 0.8'
|
29
29
|
spec.add_development_dependency 'database_cleaner'
|
30
30
|
spec.add_development_dependency 'factory_bot'
|
31
31
|
spec.add_development_dependency 'rake'
|
data/lib/keepr/groups_creator.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Keepr::GroupsCreator
|
4
|
-
def initialize(target)
|
4
|
+
def initialize(target, language = :de)
|
5
5
|
raise ArgumentError unless %i[balance profit_and_loss].include?(target)
|
6
|
+
raise ArgumentError unless %i[de es en].include?(language)
|
6
7
|
|
7
|
-
@target
|
8
|
+
@target = target
|
9
|
+
@language = language
|
8
10
|
end
|
9
11
|
|
10
12
|
def run
|
@@ -20,7 +22,7 @@ class Keepr::GroupsCreator
|
|
20
22
|
private
|
21
23
|
|
22
24
|
def load(filename, options)
|
23
|
-
full_filename = File.join(File.dirname(__FILE__), "groups_creator/#{filename}".downcase)
|
25
|
+
full_filename = File.join(File.dirname(__FILE__), "groups_creator/#{@language.to_s}/#{filename}".downcase)
|
24
26
|
lines = File.readlines(full_filename)
|
25
27
|
last_depth = 0
|
26
28
|
parents = []
|
@@ -33,7 +35,7 @@ class Keepr::GroupsCreator
|
|
33
35
|
number, name = line.lstrip.match(/^(.*?)\s(.+)$/).to_a[1..-1]
|
34
36
|
|
35
37
|
attributes = options.merge(name: name, number: number)
|
36
|
-
attributes[:is_result] = true if @target == :balance && name ==
|
38
|
+
attributes[:is_result] = true if @target == :balance && name == annual_surplus
|
37
39
|
|
38
40
|
if depth.zero?
|
39
41
|
parents = []
|
@@ -48,4 +50,15 @@ class Keepr::GroupsCreator
|
|
48
50
|
last_depth = depth
|
49
51
|
end
|
50
52
|
end
|
53
|
+
|
54
|
+
def annual_surplus
|
55
|
+
case @language
|
56
|
+
when :en
|
57
|
+
return 'Annual surplus / annual deficit'
|
58
|
+
when :es
|
59
|
+
return 'Superávit anual / déficit anual'
|
60
|
+
when :de
|
61
|
+
return 'Jahresüberschuss/Jahresfehlbetrag'
|
62
|
+
end
|
63
|
+
end
|
51
64
|
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,36 @@
|
|
1
|
+
A. Fixed assets
|
2
|
+
I. Intangible assets
|
3
|
+
1. Industrial property rights of own creation and similar rights and values
|
4
|
+
2. Concessions acquired in exchange for a fee, industrial property rights and similar rights and values, as well as licenses for said rights and values
|
5
|
+
3. Goodwill
|
6
|
+
4. Advances made
|
7
|
+
II. Tangible assets
|
8
|
+
1. Land, territorial rights and buildings, including buildings on third party land
|
9
|
+
2. technical systems and machines
|
10
|
+
3. other equipment, factory and office equipment
|
11
|
+
4. Advances made and assets under construction
|
12
|
+
III. Financial assets
|
13
|
+
1. Shares in affiliated companies
|
14
|
+
2. Loans to affiliated companies
|
15
|
+
3. Holdings
|
16
|
+
4. Loans to companies with which there is a participation relationship
|
17
|
+
5. Securities held as fixed assets
|
18
|
+
6. other loans
|
19
|
+
B. Current assets
|
20
|
+
I. Inventories
|
21
|
+
1. Raw materials and supplies
|
22
|
+
2. unfinished products, unfinished services
|
23
|
+
3. finished products and goods
|
24
|
+
4. Advances made
|
25
|
+
II. Accounts receivable and other assets
|
26
|
+
1. Accounts receivable for deliveries and services
|
27
|
+
2. Accounts receivable from affiliated companies
|
28
|
+
3. Claims against companies with which there is a participation relationship
|
29
|
+
4. other assets
|
30
|
+
III. Values
|
31
|
+
1. Shares in affiliated companies
|
32
|
+
2. other values
|
33
|
+
IV. Cash on hand, Bundesbank balances, bank balances and checks
|
34
|
+
C. Prepaid Expenses
|
35
|
+
D. Deferred tax assets
|
36
|
+
E. Active asset offset difference
|
@@ -0,0 +1,28 @@
|
|
1
|
+
A. Equity
|
2
|
+
I. Drawn capital
|
3
|
+
II. Capital reserve
|
4
|
+
III. Retained earnings
|
5
|
+
1. Legal reserve
|
6
|
+
2. Reserve for shares of a controlling or majority-owned company
|
7
|
+
3. Legal reserves
|
8
|
+
4. other retained earnings
|
9
|
+
IV. Carry-over profit / carry-over loss
|
10
|
+
V. Annual surplus / deficit
|
11
|
+
B. Provisions
|
12
|
+
1. Provisions for pensions and similar obligations
|
13
|
+
2. Tax provisions
|
14
|
+
3. other provisions
|
15
|
+
C. Liabilities
|
16
|
+
1. Bonds
|
17
|
+
of which convertible
|
18
|
+
2. Liabilities with banks
|
19
|
+
3. Advances received on orders
|
20
|
+
4. Trade accounts payable
|
21
|
+
5. Liabilities for the acceptance of drafted bills of exchange and the issuance of own bills of exchange
|
22
|
+
6. Liabilities with affiliated companies
|
23
|
+
7. Liabilities to companies with which there is a participation relationship
|
24
|
+
8. other liabilities
|
25
|
+
a) of which tax
|
26
|
+
b) of which in the context of social security
|
27
|
+
D. Prepaid expenses
|
28
|
+
E. Deferred tax liabilities
|
@@ -0,0 +1,31 @@
|
|
1
|
+
01. Sales
|
2
|
+
02. Increase or decrease in stocks of finished and unfinished products
|
3
|
+
03. other capitalized own work
|
4
|
+
04. other operating income
|
5
|
+
05. Cost of materials
|
6
|
+
a) Expenses for raw materials, consumables and supplies and for purchased goods
|
7
|
+
b) Expenses for services acquired
|
8
|
+
06. Personnel expenses
|
9
|
+
a) Wages and salaries
|
10
|
+
b) Social security and pension and living expenses.
|
11
|
+
of that for pensions
|
12
|
+
07. Depreciation
|
13
|
+
a) on intangible assets and property, plant and equipment
|
14
|
+
b) of current assets, to the extent that these exceed the usual depreciation in the corporation
|
15
|
+
08. other operating expenses
|
16
|
+
09. Investment income
|
17
|
+
a) of which from affiliated companies
|
18
|
+
10. Income from other securities and loans from financial assets
|
19
|
+
a) of which from affiliated companies
|
20
|
+
11. other similar interest and income
|
21
|
+
a) of which from affiliated companies
|
22
|
+
12. Depreciation of financial assets and securities held as current assets
|
23
|
+
13. Interest and similar expenses
|
24
|
+
of which to affiliated companies
|
25
|
+
14. Results of ordinary business activities
|
26
|
+
15. Extraordinary income
|
27
|
+
16. Extraordinary expenses
|
28
|
+
17. Extraordinary result
|
29
|
+
18. Income and income taxes
|
30
|
+
19. Other taxes
|
31
|
+
20. Annual surplus / annual deficit
|
@@ -0,0 +1,36 @@
|
|
1
|
+
A. Activos fijos
|
2
|
+
I. Activos intangibles
|
3
|
+
1. Derechos de propiedad industrial de creación propia y derechos y valores similares
|
4
|
+
2. Concesiones adquiridas a cambio de un canon, derechos de propiedad industrial y derechos y valores similares, así como licencias sobre dichos derechos y valores
|
5
|
+
3. Fondo de comercio
|
6
|
+
4. Anticipos efectuados
|
7
|
+
II. Activos materiales
|
8
|
+
1. Terrenos, derechos territoriales y edificios, incluidos los edificios en terrenos de terceros
|
9
|
+
2. sistemas técnicos y máquinas
|
10
|
+
3. otros equipos, equipos de fábrica y de oficina
|
11
|
+
4. Anticipos efectuados y activos en construcción
|
12
|
+
III. Activos financieros
|
13
|
+
1. Acciones en empresas afiliadas
|
14
|
+
2. Préstamos a empresas afiliadas
|
15
|
+
3. Explotaciones
|
16
|
+
4. Préstamos a empresas con las que existe relación de participación
|
17
|
+
5. Valores mantenidos como activo fijo
|
18
|
+
6. otros préstamos
|
19
|
+
B. Activo corriente
|
20
|
+
I. Inventarios
|
21
|
+
1. Materias primas y suministros
|
22
|
+
2. productos sin terminar, servicios sin terminar
|
23
|
+
3. productos terminados y mercancías
|
24
|
+
4. Anticipos efectuados
|
25
|
+
II. Cuentas por cobrar y otros activos
|
26
|
+
1. Cuentas por cobrar por entregas y servicios
|
27
|
+
2. Cuentas por cobrar de empresas afiliadas
|
28
|
+
3. Reclamaciones frente a empresas con las que existe relación de participación
|
29
|
+
4. otros activos
|
30
|
+
III. Valores
|
31
|
+
1. Acciones en empresas afiliadas
|
32
|
+
2. otros valores
|
33
|
+
IV. Efectivo en caja, saldos del Bundesbank, saldos bancarios y cheques
|
34
|
+
C. Gastos pagados por adelantado
|
35
|
+
D. Activos por impuestos diferidos
|
36
|
+
E. Diferencia activa de compensación de activos
|
@@ -0,0 +1,28 @@
|
|
1
|
+
A. Equidad
|
2
|
+
I. Capital dibujado
|
3
|
+
II. Reserva de capital
|
4
|
+
III. Ganancias retenidas
|
5
|
+
1. Reserva legal
|
6
|
+
2. Reserva para acciones de una empresa controladora o de propiedad mayoritaria
|
7
|
+
3. Reservas legales
|
8
|
+
4. otras ganancias retenidas
|
9
|
+
IV. Beneficios arrastrados / pérdidas arrastradas
|
10
|
+
V. Superávit / déficit anual
|
11
|
+
B. Provisiones
|
12
|
+
1. Provisiones para pensiones y obligaciones similares
|
13
|
+
2. Disposiciones fiscales
|
14
|
+
3. otras disposiciones
|
15
|
+
C. Pasivos
|
16
|
+
1. Bonos
|
17
|
+
de los cuales convertible
|
18
|
+
2. Pasivos con los bancos
|
19
|
+
3. Anticipos recibidos en pedidos
|
20
|
+
4. Cuentas comerciales por pagar
|
21
|
+
5. Pasivos por la aceptación de letras de cambio giradas y la emisión de letras de cambio propias
|
22
|
+
6. Pasivos con empresas afiliadas
|
23
|
+
7. Pasivos frente a empresas con las que existe relación de participación
|
24
|
+
8. otros pasivos
|
25
|
+
a) de los cuales de impuestos
|
26
|
+
b) de los cuales en el contexto de la seguridad social
|
27
|
+
D. Gastos pagados por adelantado
|
28
|
+
E. Pasivos por impuestos diferidos
|
@@ -0,0 +1,31 @@
|
|
1
|
+
01. Ventas
|
2
|
+
02. Aumento o disminución de existencias de productos terminados y sin terminar
|
3
|
+
03. otro trabajo propio capitalizado
|
4
|
+
04. otros ingresos operativos
|
5
|
+
05. Costo de materiales
|
6
|
+
a) Gastos por materias primas, consumibles y suministros y por bienes adquiridos
|
7
|
+
b) Gastos por servicios adquiridos
|
8
|
+
06. Gastos de personal
|
9
|
+
a) Sueldos y salarios
|
10
|
+
b) Seguridad social y gastos de pensión y manutención.
|
11
|
+
de eso para pensiones
|
12
|
+
07. Depreciación
|
13
|
+
a) sobre activos intangibles y propiedades, planta y equipo
|
14
|
+
b) de los activos corrientes, en la medida en que estos excedan la depreciación habitual en la corporación
|
15
|
+
08. otros gastos operativos
|
16
|
+
09. Ingresos de inversiones
|
17
|
+
a) de los cuales de empresas afiliadas
|
18
|
+
10. Ingresos de otros valores y préstamos de activos financieros
|
19
|
+
a) de los cuales de empresas afiliadas
|
20
|
+
11. otros intereses e ingresos similares
|
21
|
+
a) de los cuales de empresas afiliadas
|
22
|
+
12. Depreciación de activos financieros y valores mantenidos como activo corriente
|
23
|
+
13. Intereses y gastos similares
|
24
|
+
de los cuales a empresas afiliadas
|
25
|
+
14. Resultados de las actividades comerciales ordinarias
|
26
|
+
15. Ingresos extraordinarios
|
27
|
+
16. Gastos extraordinarios
|
28
|
+
17. Resultado extraordinario
|
29
|
+
18. Impuestos sobre la renta y las ganancias
|
30
|
+
19. Otros impuestos
|
31
|
+
20. Superávit anual / déficit anual
|
data/lib/keepr/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Keepr::GroupsCreator do
|
6
|
-
context 'balance groups' do
|
6
|
+
context 'balance groups in german' do
|
7
7
|
before :each do
|
8
8
|
Keepr::GroupsCreator.new(:balance).run
|
9
9
|
end
|
@@ -13,8 +13,8 @@ describe Keepr::GroupsCreator do
|
|
13
13
|
expect(Keepr::Group.asset.count).to eq(36)
|
14
14
|
expect(Keepr::Group.liability.count).to eq(28)
|
15
15
|
|
16
|
-
compare_with_source(Keepr::Group.asset, 'asset.txt')
|
17
|
-
compare_with_source(Keepr::Group.liability, 'liability.txt')
|
16
|
+
compare_with_source(Keepr::Group.asset, 'de', 'asset.txt')
|
17
|
+
compare_with_source(Keepr::Group.liability, 'de', 'liability.txt')
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'should create result group' do
|
@@ -31,14 +31,14 @@ describe Keepr::GroupsCreator do
|
|
31
31
|
expect(Keepr::Group.count).to eq(31)
|
32
32
|
expect(Keepr::Group.profit_and_loss.count).to eq(31)
|
33
33
|
|
34
|
-
compare_with_source(Keepr::Group.profit_and_loss, 'profit_and_loss.txt')
|
34
|
+
compare_with_source(Keepr::Group.profit_and_loss, 'de', 'profit_and_loss.txt')
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
39
39
|
|
40
|
-
def compare_with_source(scope, filename)
|
41
|
-
full_filename = File.join(File.dirname(__FILE__), "../../lib/keepr/groups_creator/#{filename}")
|
40
|
+
def compare_with_source(scope, language, filename)
|
41
|
+
full_filename = File.join(File.dirname(__FILE__), "../../lib/keepr/groups_creator/#{language}/#{filename}")
|
42
42
|
source = File.read(full_filename)
|
43
43
|
|
44
44
|
lines = scope.find_each.map { |g| "#{' ' * g.depth * 2}#{g.number} #{g.name}\n" }.join
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keepr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Ledermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: coveralls
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '0.8'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '0.8'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: database_cleaner
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
description: Double entry bookkeeping with Rails
|
168
|
-
email:
|
168
|
+
email: georg@ledermann.dev
|
169
169
|
executables: []
|
170
170
|
extensions: []
|
171
171
|
extra_rdoc_files: []
|
@@ -192,9 +192,15 @@ files:
|
|
192
192
|
- lib/keepr/cost_center.rb
|
193
193
|
- lib/keepr/group.rb
|
194
194
|
- lib/keepr/groups_creator.rb
|
195
|
-
- lib/keepr/groups_creator/asset.txt
|
196
|
-
- lib/keepr/groups_creator/liability.txt
|
197
|
-
- lib/keepr/groups_creator/profit_and_loss.txt
|
195
|
+
- lib/keepr/groups_creator/de/asset.txt
|
196
|
+
- lib/keepr/groups_creator/de/liability.txt
|
197
|
+
- lib/keepr/groups_creator/de/profit_and_loss.txt
|
198
|
+
- lib/keepr/groups_creator/en/asset.txt
|
199
|
+
- lib/keepr/groups_creator/en/liability.txt
|
200
|
+
- lib/keepr/groups_creator/en/profit_and_loss.txt
|
201
|
+
- lib/keepr/groups_creator/es/asset.txt
|
202
|
+
- lib/keepr/groups_creator/es/liability.txt
|
203
|
+
- lib/keepr/groups_creator/es/profit_and_loss.txt
|
198
204
|
- lib/keepr/journal.rb
|
199
205
|
- lib/keepr/journal_export.rb
|
200
206
|
- lib/keepr/posting.rb
|