lucabook 0.5.2 → 0.5.3
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/exe/luca-book +3 -2
- data/lib/luca_book/accumulator.rb +26 -3
- data/lib/luca_book/setup.rb +1 -1
- data/lib/luca_book/templates/dict-jp.tsv +9 -2
- data/lib/luca_book/util.rb +2 -2
- data/lib/luca_book/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33c275cc53bc4538109f607fcfac3cb8ae5014863037c58ff6a74903cf6dc862
|
4
|
+
data.tar.gz: 6b51180e7d5501cc94d030859ff4ad12508fc1aa68a848f5d78e89bf06f1a2c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2d2db06519f28374a632f9ec8e697af1e52cb73f46042cb1b14ab3404441cc3fe3395c59d39cb4b50dad1d571f5a4cec8f1824d864ea00a6958ee832f10b12c
|
7
|
+
data.tar.gz: 45e5306fdd26e9fa9a2e3850a4674cbe552a5a612e3b57f98319d3e0d67687bfd6a2bf3c3dffc0bba5722ceadef3b3fb43a2846faa281d02eeaee66c97cadff0
|
data/exe/luca-book
CHANGED
@@ -27,9 +27,9 @@ class LucaCmd
|
|
27
27
|
params[:col_order] = %w(date diff balance counter_code note code id no)
|
28
28
|
if params['code']
|
29
29
|
if params['headers']
|
30
|
-
render(LucaBook::ListByHeader.term(*args, code: params['code'], header: params['headers']).list_by_code, params)
|
30
|
+
render(LucaBook::ListByHeader.term(*parse_range_args(args, params), code: params['code'], header: params['headers']).list_by_code, params)
|
31
31
|
else
|
32
|
-
render(LucaBook::List.term(*args, code: params['code'], recursive: params[:recursive]).list_by_code(params[:recursive]), params)
|
32
|
+
render(LucaBook::List.term(*parse_range_args(args, params), code: params['code'], recursive: params[:recursive]).list_by_code(params[:recursive]), params)
|
33
33
|
end
|
34
34
|
elsif params['render']
|
35
35
|
puts LucaBook::List.term(*args).render_html(params['render'])
|
@@ -195,6 +195,7 @@ when /journals?/, 'j'
|
|
195
195
|
opt.on('-c', '--code VAL', 'filter with code or label') { |v| params['code'] = v }
|
196
196
|
opt.on('-r', '--recursive', 'include subaccounts') { |_v| params[:recursive] = true }
|
197
197
|
opt.on('--customer', 'categorize by x-customer header') { |_v| params['headers'] = 'x-customer' }
|
198
|
+
opt.on('--fy', 'adjust start date to Financial Year') { |_v| params[:financialyear] = true }
|
198
199
|
opt.on('-n VAL', 'report count') { |v| params[:n] = v.to_i }
|
199
200
|
opt.on('--nu', 'show table in nushell') { |_v| params[:output] = 'nu' }
|
200
201
|
opt.on('--explore', 'explore table in nushell') { |_v| params[:output] = 'explore' }
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'luca_book/util'
|
4
|
+
require 'luca_support/code'
|
4
5
|
require 'luca_support/const'
|
5
6
|
|
6
7
|
module LucaBook
|
@@ -79,7 +80,21 @@ module LucaBook
|
|
79
80
|
def gross(start_year, start_month, end_year = nil, end_month = nil, code: nil, date_range: nil, rows: 4, recursive: false, header: nil)
|
80
81
|
if ! date_range.nil?
|
81
82
|
raise if date_range.class != Range
|
82
|
-
|
83
|
+
|
84
|
+
start_year = date_range.first.year
|
85
|
+
start_month = date_range.first.month
|
86
|
+
end_year = date_range.last.year
|
87
|
+
end_month = date_range.last.month
|
88
|
+
date_bound = {
|
89
|
+
start: {
|
90
|
+
month: "#{start_year}#{LucaSupport::Code.encode_month(start_month)}",
|
91
|
+
day: LucaSupport::Code.encode_date(date_range.first)
|
92
|
+
},
|
93
|
+
end: {
|
94
|
+
month: "#{end_year}#{LucaSupport::Code.encode_month(end_month)}",
|
95
|
+
day: LucaSupport::Code.encode_date(date_range.last)
|
96
|
+
}
|
97
|
+
}
|
83
98
|
end
|
84
99
|
scan_headers = header&.map { |k, v|
|
85
100
|
[:customer, :editor].include?(k) ? [ "x-#{k.to_s}", v ] : nil
|
@@ -108,7 +123,15 @@ module LucaBook
|
|
108
123
|
end
|
109
124
|
end
|
110
125
|
end
|
111
|
-
enm.each do |f,
|
126
|
+
enm.each do |f, path|
|
127
|
+
if date_bound
|
128
|
+
if path[0] == date_bound[:start][:month]
|
129
|
+
next if path[1][0] < date_bound[:start][:day]
|
130
|
+
elsif path[0] == date_bound[:end][:month]
|
131
|
+
next if path[1][0] > date_bound[:end][:day]
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
112
135
|
CSV.new(f, headers: false, col_sep: "\t", encoding: 'UTF-8')
|
113
136
|
.each_with_index do |row, i|
|
114
137
|
break if i >= rows
|
@@ -183,7 +206,7 @@ module LucaBook
|
|
183
206
|
# Override LucaRecord::IO.load_data
|
184
207
|
#
|
185
208
|
def load_data(io, path = nil)
|
186
|
-
io
|
209
|
+
[io, path]
|
187
210
|
end
|
188
211
|
end
|
189
212
|
|
data/lib/luca_book/setup.rb
CHANGED
@@ -38,7 +38,7 @@ module LucaBook
|
|
38
38
|
csv << ['code', 'label', 'balance']
|
39
39
|
csv << ['_date', '2020-1-1']
|
40
40
|
CSV.open("#{__dir__}/templates/#{dict}", 'r', col_sep: "\t", encoding: 'UTF-8').each do |row|
|
41
|
-
csv << row if /^[1-9]/.match(row[0])
|
41
|
+
csv << row[0, 1] if /^[1-9]/.match(row[0])
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -41,8 +41,11 @@ code label xbrl_id consumption_tax income_tax
|
|
41
41
|
1858 仮払地方税付加価値割
|
42
42
|
1859 仮払地方税法人税割
|
43
43
|
185A 仮払地方税均等割
|
44
|
-
185B 仮払消費税
|
44
|
+
185B 仮払消費税
|
45
45
|
185C 仮払地方消費税
|
46
|
+
185D 仮払市民税法人税割
|
47
|
+
185E 仮払市民税均等割
|
48
|
+
185F 仮払所得税
|
46
49
|
30 固定資産 jpfr-t-cte:NoncurrentAssets
|
47
50
|
31 有形固定資産 jpfr-t-cte:PropertyPlantAndEquipment
|
48
51
|
311 建物 jpfr-t-cte:Buildings
|
@@ -164,7 +167,9 @@ C1S 支払報酬 jpfr-t-cte:CompensationsSGA
|
|
164
167
|
C1T 研修費 jpfr-etax-t-cte:RecruitmentEducationExpense
|
165
168
|
C1U 採用費
|
166
169
|
C1V 業務委託費
|
167
|
-
C1W 会議費
|
170
|
+
C1W 会議費 jpfr-etax-t-cte:ConventionExpense
|
171
|
+
C1X 寄付金 jpfr-etax-t-cte:Donation
|
172
|
+
C1X1 指定寄付金
|
168
173
|
CA 営業利益 jpfr-t-cte:OperatingIncome
|
169
174
|
D0 営業外収益 jpfr-t-cte:NonOperatingIncome
|
170
175
|
D11 受取利息 jpfr-t-cte:InterestIncomeNOI
|
@@ -195,4 +200,6 @@ H111 法人税
|
|
195
200
|
H112 都道府県住民税
|
196
201
|
H113 市町村住民税
|
197
202
|
H114 地方事業税
|
203
|
+
H115 所得税税額控除
|
204
|
+
H116 外国税
|
198
205
|
HA 当期利益 jpfr-t-cte:NetIncome
|
data/lib/luca_book/util.rb
CHANGED
@@ -15,7 +15,7 @@ module LucaBook
|
|
15
15
|
[d - c, { debit: d, credit: c }]
|
16
16
|
end
|
17
17
|
|
18
|
-
# items assumed
|
18
|
+
# items assumed:
|
19
19
|
# [{ code: '113', amount: 1000 }, ... ]
|
20
20
|
#
|
21
21
|
def diff_by_code(items, code)
|
@@ -48,7 +48,7 @@ module LucaBook
|
|
48
48
|
start_month = LucaSupport::CONST.config['fy_start']
|
49
49
|
start_year = date.month >= start_month ? date.year : date.year - 1
|
50
50
|
@start_date = Date.new(start_year, start_month, 1)
|
51
|
-
@end_date =
|
51
|
+
@end_date = @start_date.next_year.prev_day
|
52
52
|
@end_date = [to, @end_date].min if to
|
53
53
|
[@start_date, @end_date]
|
54
54
|
end
|
data/lib/luca_book/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucabook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucarecord
|