luca-jp 0.2.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,18 +41,23 @@ module Luca #:nodoc:
41
41
 
42
42
  @有価証券 = @bs_data.each.with_object({}) do |(k, v), h|
43
43
  next unless account_codes.include?(k.to_s)
44
- next unless readable(v || 0) > 0
44
+ next if v.nil? || v <= 0
45
45
 
46
+ inc = debit_amount(k, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
47
+ dec = credit_amount(k, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
46
48
  h[k] = {
47
49
  name: self.class.dict.dig(k)[:label],
48
- amount: readable(v)
50
+ amount: readable(v),
51
+ diff: readable(inc - dec)
49
52
  }
53
+ STDERR.puts "勘定科目内訳書(有価証券)異動の追記が必要: #{h[k][:name]}" unless (inc - dec).zero?
54
+
50
55
  metadata = uchiwake_account_config(k).first
51
56
  if metadata && metadata['name']
52
57
  h[k][:name] = metadata['name'][0..9] if metadata['name']
53
58
  h[k][:security_purpose] = metadata['security_purpose']
54
59
  h[k][:security_genre] = metadata['security_genre']
55
- h[k][:security_units] = metadata['security_units']
60
+ h[k][:security_units] = (h[k][:amount].nil? || h[k][:amount].zero?) ? 0 : metadata['security_units']
56
61
  h[k][:note] = metadata['note']
57
62
  end
58
63
  h[k][:security_purpose] ||= 'その他' if /^332/.match(k.to_s)
data/lib/luca/jp/util.rb CHANGED
@@ -89,6 +89,23 @@ module Luca
89
89
  def eltax_config(key)
90
90
  config.dig('jp', 'eltax', key)
91
91
  end
92
+
93
+ def tokyo23?
94
+ @report_category == '23ku'
95
+ end
96
+
97
+ def 期首期末残高(code)
98
+ pre = readable(@start_balance.dig(code))
99
+ post = readable(@bs_data.dig(code))
100
+ [readable(pre), readable(post)]
101
+ end
102
+
103
+ def 純資産期中増減(code)
104
+ inc = credit_amount(code, @start_date.year, @start_date.month, @end_date.year, @end_date.month)
105
+ dec = debit_amount(code, @start_date.year, @start_date.month, @end_date.year, @end_date.month)
106
+
107
+ [readable(dec), readable(inc)]
108
+ end
92
109
  end
93
110
  end
94
111
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Luca
4
4
  module Jp
5
- VERSION = '0.2.3'
5
+ VERSION = '0.9.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luca-jp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuma Takahiro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucabook
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: 12.3.3
69
69
  description: 'JP tax extension for Luca
70
70
 
71
- '
71
+ '
72
72
  email:
73
73
  - co.chuma@gmail.com
74
74
  executables:
@@ -124,7 +124,7 @@ licenses:
124
124
  metadata:
125
125
  homepage_uri: https://github.com/chumaltd/luca-jp/tree/main
126
126
  source_code_uri: https://github.com/chumaltd/luca-jp/tree/main
127
- post_install_message:
127
+ post_install_message:
128
128
  rdoc_options: []
129
129
  require_paths:
130
130
  - lib
@@ -139,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.2.3
143
- signing_key:
142
+ rubygems_version: 3.2.5
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: JP tax extension for Luca
146
146
  test_files: []