keepr 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7dfe416636ebe5a292bb6a49c43e8d1ffcec6be4711d14b3baaa7099f6efe48
4
- data.tar.gz: 78691b1440c14e91497710e486b7fb3504f16ac6449900d930af39dbf427b872
3
+ metadata.gz: 52559eefe26a6b165210c72a477351e559f0b936bd098880f134991a981490ce
4
+ data.tar.gz: 448a874a9a03197c51e9df977c523539eb552881cf83a7ff3ddfd37be887d41a
5
5
  SHA512:
6
- metadata.gz: c5995815889beabb1bd25798c906fad998641775276d047089a1028485a72effe2fb9e5dca8a96de249d8dcd3a035073d10a0518259199b71b350c34c9d30d52
7
- data.tar.gz: 2c6d8b7498e8d6abc21547a5f979da6d96c87328966de102aebcb8afdf139954cf1721ee45d46c3e9b582da4b541fba55b710fd8239ce2ee0fe57c7915a94dda
6
+ metadata.gz: 621ee808cd1ff8e361e7d00e3a67690a24befdbe40b6e35757aee1b260eb9141e155e99f2a4707614b612e5a19c32c2a0d29e8ae042546f49cf7f81525a874c5
7
+ data.tar.gz: 86c1dc8d10841836a66db76393d379b2b57c9d623effcf32e63ba18ee481199ce7b97a2a0736b90100f3c7d0e3d64b7e1a2ddbdd61cd909f53810fba77f04ec8
@@ -0,0 +1,38 @@
1
+ name: Test
2
+
3
+ on: [ push, pull_request ]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby: ['3.0', '3.1', '3.2']
13
+ rails: ['6.1', '7.0', '7.1']
14
+
15
+ name: Test against Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Setup System
21
+ run: sudo apt-get install libsqlite3-dev
22
+
23
+ - name: Setup Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+
28
+ - name: Install gems
29
+ env:
30
+ MATRIX_RAILS_VERSION: ${{ matrix.rails }}
31
+ run: |
32
+ export BUNDLE_GEMFILE="${GITHUB_WORKSPACE}/ci/Gemfile-rails-${MATRIX_RAILS_VERSION}"
33
+ bundle install --jobs 4 --retry 3
34
+
35
+ - name: RSpec
36
+ env:
37
+ COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
38
+ run: bundle exec rake
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2019 Georg Ledermann
1
+ Copyright (c) 2013-2023 Georg Ledermann <georg@ledermann.dev>
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -2,25 +2,25 @@
2
2
 
3
3
  This Ruby gem provides a double entry accounting system for use in any Rails application. It stores all the data via ActiveRecord in the SQL database.
4
4
 
5
- [![Build Status](https://travis-ci.org/ledermann/keepr.svg?branch=master)](https://travis-ci.org/ledermann/keepr)
5
+ [![Build Status](https://github.com/ledermann/keepr/workflows/Test/badge.svg?branch=master)](https://github.com/ledermann/keepr/actions)
6
6
  [![Code Climate](https://codeclimate.com/github/ledermann/keepr/badges/gpa.svg)](https://codeclimate.com/github/ledermann/keepr)
7
- [![Coverage Status](https://coveralls.io/repos/ledermann/keepr/badge.svg?branch=master)](https://coveralls.io/r/ledermann/keepr?branch=master)
7
+ [![Coverage Status](https://coveralls.io/repos/github/ledermann/keepr/badge.svg?branch=master)](https://coveralls.io/github/ledermann/keepr?branch=master)
8
8
 
9
9
  ## Features
10
10
 
11
- * Journal entries with two or more postings
11
+ * Journal entries with two or more postings follow the [Double Entry](https://www.accountingcoach.com/blog/what-is-the-double-entry-system) principle
12
12
  * Accounts (including subaccounts and groups)
13
- * Tax
14
- * Cost center
15
- * Balance sheet
16
- * Profit and loss statement
17
- * DATEV export
13
+ * Taxes
14
+ * Cost centers
15
+ * Balance sheets
16
+ * Profit and loss statements
17
+ * DATEV exports
18
18
 
19
19
 
20
20
  ## Dependencies
21
21
 
22
- * Ruby 2.5+
23
- * Rails 4.2+ (including Rails 6.0)
22
+ * Ruby 3.0+
23
+ * Rails 6.1+ (including Rails 7.1)
24
24
 
25
25
 
26
26
  ## Installation
@@ -38,9 +38,92 @@ Or install it yourself as:
38
38
  $ gem install keepr
39
39
 
40
40
 
41
+ ## Getting started
42
+
43
+ After installation run the following:
44
+
45
+ rails g keepr:migration
46
+ rails db:migrate
47
+
48
+ This will create the database migration files and add new models.
49
+
41
50
  ## Usage
51
+ ### Account
52
+ All accounting entries are stored inside "accounts", per standard accounting
53
+ principles. To create an account, use the following format:
54
+
55
+ Keepr::Account.create!(number: 27, name: 'Software', kind: :asset)
56
+
57
+ "kind" is one of following values:
58
+
59
+ [asset liability revenue expense forward debtor creditor]
60
+
61
+ Accounts can have "child" accounts. All entries posted in a child account will
62
+ be shown in the "parent" account as well. To create a child account:
63
+
64
+ account_1400 = Keepr::Account.create!(number: 1400, name: 'Software', kind: :expense)
65
+ account_14001 = Keepr::Account.create!(number: 14001, name: 'Rails', parent: account_1400 , kind: :expense)
66
+
67
+ Accounts can be organised inside of groups:
68
+
69
+ group = Keepr::Group.create!(is_result: true, target: :liability, name: 'foo')
70
+ Keepr::Account.create!(number: 100, name: 'Trade payable', kind: :liability, keepr_group: group)
71
+
72
+ Groups also allow a parent/child hierarchy:
73
+
74
+ parent_group = Keepr::Group.create!(is_result: true, target: :liability, name: 'foo')
75
+ child_group = parent_group.children.create! name: 'Bar'
76
+
77
+ ### Journal
78
+
79
+
80
+ Simple journal:
81
+
82
+ simple_journal = Keepr::Journal.create keepr_postings_attributes: [
83
+ { keepr_account: account_1000, amount: 100.99, side: 'debit' },
84
+ { keepr_account: account_1200, amount: 100.99, side: 'credit' }
85
+ ]
86
+
87
+
88
+ Complex journal:
89
+
90
+ complex_journal = Keepr::Journal.create keepr_postings_attributes: [
91
+ { keepr_account: account_4920, amount: 8.40, side: 'debit' },
92
+ { keepr_account: account_1576, amount: 1.60, side: 'debit' },
93
+ { keepr_account: account_1600, amount: 10.00, side: 'credit' }
94
+ ]
95
+
96
+ Entries can be locked for changing data:
97
+
98
+ simple_journal.update! permanent: true
99
+
100
+
101
+ ### Account balance
102
+ We can get an account balance as follows:
103
+
104
+ account_1000.balance
105
+
106
+ account_1000.balance(Date.today)
107
+
108
+ account_1000.balance(Date.yesterday...Date.today)
109
+
110
+ ### Tax account
111
+
112
+ // Create Tax account
113
+ Keepr::Account.create! number: 1776, name: 'Umsatzsteuer 19%', kind: :asset
114
+
115
+ tax = Keepr::Tax.create! name: 'USt19',
116
+ description: 'Umsatzsteuer 19%',
117
+ value: 19.0,
118
+ keepr_account: tax_account
119
+
120
+ // Create a sale account that links to the tax account
121
+ account = Keepr::Account.new number: 8400,
122
+ name: 'Erlöse 19% USt',
123
+ kind: :revenue,
124
+ keepr_tax: tax
125
+
42
126
 
43
- TODO: Write usage instructions here
44
127
 
45
128
 
46
129
  ## Contributing
@@ -64,4 +147,4 @@ TODO: Write usage instructions here
64
147
  * https://github.com/bigfleet/accountable
65
148
 
66
149
 
67
- Copyright (c) 2013-2019 [Georg Ledermann](http://www.georg-ledermann.de), released under the MIT license
150
+ Copyright (c) 2013-2023 [Georg Ledermann](https://ledermann.dev), released under the MIT license
@@ -1,12 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'activerecord', '~> 6.0.0'
3
+ gem 'activerecord', '~> 6.1.0'
4
4
  gem 'ancestry', '>= 3.1.0'
5
5
  gem 'sqlite3', "~> 1.4"
6
6
  gem 'rake'
7
7
  gem 'rspec'
8
8
  gem 'simplecov'
9
- gem 'coveralls'
9
+ gem 'coveralls_reborn'
10
10
  gem 'database_cleaner'
11
11
  gem 'factory_bot'
12
12
  gem 'datev'
@@ -1,12 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'activerecord', '~> 4.2.11'
3
+ gem 'activerecord', '~> 7.0.0'
4
4
  gem 'ancestry', '>= 3.1.0'
5
- gem 'sqlite3', '~> 1.3.6'
5
+ gem 'sqlite3', "~> 1.4"
6
6
  gem 'rake'
7
7
  gem 'rspec'
8
8
  gem 'simplecov'
9
- gem 'coveralls'
9
+ gem 'coveralls_reborn'
10
10
  gem 'database_cleaner'
11
11
  gem 'factory_bot'
12
12
  gem 'datev'
@@ -1,12 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'activerecord', '~> 5.0.7'
3
+ gem 'activerecord', '~> 7.1.0'
4
4
  gem 'ancestry', '>= 3.1.0'
5
- gem 'sqlite3', '~> 1.3.6'
5
+ gem 'sqlite3', "~> 1.4"
6
6
  gem 'rake'
7
7
  gem 'rspec'
8
8
  gem 'simplecov'
9
- gem 'coveralls'
9
+ gem 'coveralls_reborn'
10
10
  gem 'database_cleaner'
11
11
  gem 'factory_bot'
12
12
  gem 'datev'
data/keepr.gemspec CHANGED
@@ -8,24 +8,24 @@ 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 = 'mail@georg-ledermann.de'
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'
15
15
  spec.license = 'MIT'
16
- spec.required_ruby_version = '>= 2.5'
16
+ spec.required_ruby_version = '>= 3.0'
17
17
 
18
18
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_dependency 'activerecord', '>= 4.2'
23
+ spec.add_dependency 'activerecord', '>= 6.1'
24
24
  spec.add_dependency 'ancestry', '>= 3.1.0'
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_reborn'
29
29
  spec.add_development_dependency 'database_cleaner'
30
30
  spec.add_development_dependency 'factory_bot'
31
31
  spec.add_development_dependency 'rake'
@@ -15,11 +15,22 @@ module Keepr
15
15
  end
16
16
 
17
17
  def self.next_migration_number(dirname)
18
- if ActiveRecord::Base.timestamped_migrations
18
+ if timestamped_migrations?
19
19
  Time.now.utc.strftime('%Y%m%d%H%M%S')
20
20
  else
21
21
  format('%.3d', (current_migration_number(dirname) + 1))
22
22
  end
23
23
  end
24
+
25
+ def self.timestamped_migrations?
26
+ (
27
+ ActiveRecord::Base.respond_to?(:timestamped_migrations) &&
28
+ ActiveRecord::Base.timestamped_migrations
29
+ ) ||
30
+ (
31
+ ActiveRecord.respond_to?(:timestamped_migrations) &&
32
+ ActiveRecord.timestamped_migrations
33
+ )
34
+ end
24
35
  end
25
36
  end
@@ -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
@@ -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 = 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 == 'Jahresüberschuss/Jahresfehlbetrag'
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
data/lib/keepr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Keepr
4
- VERSION = '0.6.0'
4
+ VERSION = '0.8.0'
5
5
  end
@@ -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.6.0
4
+ version: 0.8.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-08-06 00:00:00.000000000 Z
11
+ date: 2023-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '6.1'
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: '4.2'
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ancestry
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: coveralls
70
+ name: coveralls_reborn
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -165,22 +165,20 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  description: Double entry bookkeeping with Rails
168
- email: mail@georg-ledermann.de
168
+ email: georg@ledermann.dev
169
169
  executables: []
170
170
  extensions: []
171
171
  extra_rdoc_files: []
172
172
  files:
173
+ - ".github/workflows/main.yml"
173
174
  - ".gitignore"
174
- - ".travis.yml"
175
175
  - Gemfile
176
176
  - LICENSE.txt
177
177
  - README.md
178
178
  - Rakefile
179
- - ci/Gemfile-rails-4-2
180
- - ci/Gemfile-rails-5-0
181
- - ci/Gemfile-rails-5-1
182
- - ci/Gemfile-rails-5-2
183
- - ci/Gemfile-rails-6-0
179
+ - ci/Gemfile-rails-6.1
180
+ - ci/Gemfile-rails-7.0
181
+ - ci/Gemfile-rails-7.1
184
182
  - keepr.gemspec
185
183
  - lib/generators/keepr/migration/migration_generator.rb
186
184
  - lib/generators/keepr/migration/templates/migration.rb
@@ -192,9 +190,15 @@ files:
192
190
  - lib/keepr/cost_center.rb
193
191
  - lib/keepr/group.rb
194
192
  - 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
193
+ - lib/keepr/groups_creator/de/asset.txt
194
+ - lib/keepr/groups_creator/de/liability.txt
195
+ - lib/keepr/groups_creator/de/profit_and_loss.txt
196
+ - lib/keepr/groups_creator/en/asset.txt
197
+ - lib/keepr/groups_creator/en/liability.txt
198
+ - lib/keepr/groups_creator/en/profit_and_loss.txt
199
+ - lib/keepr/groups_creator/es/asset.txt
200
+ - lib/keepr/groups_creator/es/liability.txt
201
+ - lib/keepr/groups_creator/es/profit_and_loss.txt
198
202
  - lib/keepr/journal.rb
199
203
  - lib/keepr/journal_export.rb
200
204
  - lib/keepr/posting.rb
@@ -233,14 +237,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
233
237
  requirements:
234
238
  - - ">="
235
239
  - !ruby/object:Gem::Version
236
- version: '2.5'
240
+ version: '3.0'
237
241
  required_rubygems_version: !ruby/object:Gem::Requirement
238
242
  requirements:
239
243
  - - ">="
240
244
  - !ruby/object:Gem::Version
241
245
  version: '0'
242
246
  requirements: []
243
- rubygems_version: 3.1.4
247
+ rubygems_version: 3.5.1
244
248
  signing_key:
245
249
  specification_version: 4
246
250
  summary: Some basic ActiveRecord models to build a double entry bookkeeping application
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- os: linux
2
- dist: xenial
3
- language: ruby
4
- rvm:
5
- - 2.5.8
6
- - 2.6.6
7
- - 2.7.1
8
- gemfile:
9
- - ci/Gemfile-rails-4-2
10
- - ci/Gemfile-rails-5-0
11
- - ci/Gemfile-rails-5-1
12
- - ci/Gemfile-rails-5-2
13
- - ci/Gemfile-rails-6-0
14
- matrix:
15
- exclude:
16
- - rvm: 2.7.1
17
- gemfile: ci/Gemfile-rails-4-2
18
- script:
19
- - bundle exec rake
20
- before_install:
21
- - gem update bundler
data/ci/Gemfile-rails-5-1 DELETED
@@ -1,12 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'activerecord', '~> 5.1.7'
4
- gem 'ancestry', '>= 3.1.0'
5
- gem "sqlite3", "~> 1.3", ">= 1.3.6"
6
- gem 'rake'
7
- gem 'rspec'
8
- gem 'simplecov'
9
- gem 'coveralls'
10
- gem 'database_cleaner'
11
- gem 'factory_bot'
12
- gem 'datev'
data/ci/Gemfile-rails-5-2 DELETED
@@ -1,12 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'activerecord', '~> 5.2.3'
4
- gem 'ancestry', '>= 3.1.0'
5
- gem "sqlite3", "~> 1.3", ">= 1.3.6"
6
- gem 'rake'
7
- gem 'rspec'
8
- gem 'simplecov'
9
- gem 'coveralls'
10
- gem 'database_cleaner'
11
- gem 'factory_bot'
12
- gem 'datev'