luca-jp 0.18.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/luca-jp +2 -3
- data/lib/luca/jp/aoiro.rb +0 -4
- data/lib/luca/jp/chihouzei.rb +1 -1
- data/lib/luca/jp/common.rb +1 -1
- data/lib/luca/jp/uchiwake.rb +2 -1
- data/lib/luca/jp/urikake.rb +15 -16
- data/lib/luca/jp/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b480588d30ad8662d44c2ab3f2c0575fa91250b2b24928d4ccc089f1fee34f48
|
4
|
+
data.tar.gz: 3843a90218ddccc9969d80ec955783a799e3095b6a1a01abe870632a3831f356
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a87556ce0b2da2c016624df23efa9e73d00816e0682713596841426d95be8a13b256e6b6ae848b3e6ef16ac10ef9b0e6763b964f6f2cf5a8f14057a6bb52add
|
7
|
+
data.tar.gz: f3dd2de0bc8686bc7643ade70cb584a1e8e5e3d3c9c6019249e8cbcff07ee85c36ac65465df408bc7cb82611624201988f3b42c277ee392128f961238206c1cb
|
data/exe/luca-jp
CHANGED
@@ -37,14 +37,14 @@ class LucaCmd
|
|
37
37
|
puts JSON.dump(accounts)
|
38
38
|
else
|
39
39
|
Luca::Jp::Util.eltax_config('reports').each do |report|
|
40
|
-
File.open("chihouzei-#{report['jichitai_code']}#{report['jimusho_code']}.xml", 'w') { |f| f.puts(Luca::Jp::Chihouzei.range(*auto_range(args, params)).kani(report))}
|
40
|
+
File.open("chihouzei-#{report['jichitai_code']}#{report['jimusho_code']}.xml", 'w') { |f| f.puts(Luca::Jp::Chihouzei.range(*auto_range(args, params)).kani(report, ext_config: ext_config))}
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.urikake(args, params)
|
46
46
|
date = "#{args[0]}-#{args[1]}-1"
|
47
|
-
Luca::Jp::Urikake.new(date).report(params[:
|
47
|
+
Luca::Jp::Urikake.new(date).report(params[:encode])
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.auto_range(args, params)
|
@@ -111,7 +111,6 @@ when 'c', /chihou?zei/
|
|
111
111
|
when /urikake/
|
112
112
|
OptionParser.new do |opt|
|
113
113
|
opt.banner = 'Usage: luca-jp urikake [options] yyyy mm'
|
114
|
-
opt.on('--total VAL', '売掛金総額') { |v| params[:total] = v&.to_i }
|
115
114
|
opt.on('--utf8', 'UTF-8でファイル生成') { |_v| params[:encode] = 'UTF-8' }
|
116
115
|
args = opt.parse!(ARGV)
|
117
116
|
LucaCmd.check_dir('invoices', ext_conf: EXT_CONF) do
|
data/lib/luca/jp/aoiro.rb
CHANGED
data/lib/luca/jp/chihouzei.rb
CHANGED
@@ -40,7 +40,7 @@ module Luca
|
|
40
40
|
@地方特別法人事業税中間納付 = prepaid_tax('1854', @jimusho_name)
|
41
41
|
@所得割中間納付 = prepaid_tax('1855', @jimusho_name)
|
42
42
|
@法人税割中間納付 = prepaid_tax(
|
43
|
-
@report_category == 'city' ? '185D' :'1859',
|
43
|
+
@report_category == 'city' ? '185D' : '1859',
|
44
44
|
@jimusho_name
|
45
45
|
)
|
46
46
|
@均等割中間納付 = prepaid_tax(
|
data/lib/luca/jp/common.rb
CHANGED
@@ -132,7 +132,7 @@ module Luca
|
|
132
132
|
期末資本準備金 = LucaSupport::Code.readable(@bs_data.dig('9131')||0)
|
133
133
|
|
134
134
|
([
|
135
|
-
(
|
135
|
+
([寄付金算定所得, 0].max * 2.5 / 100).floor,
|
136
136
|
([期末資本金, 期末資本準備金].compact.sum * 2.5 / 1000).floor
|
137
137
|
].compact.sum / 4).floor
|
138
138
|
end
|
data/lib/luca/jp/uchiwake.rb
CHANGED
@@ -41,10 +41,11 @@ 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 if v.nil? || v <= 0
|
45
44
|
|
46
45
|
inc = debit_amount(k, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
|
47
46
|
dec = credit_amount(k, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
|
47
|
+
next if v.nil? || (v <= 0 && inc <= 0 && dec <= 0)
|
48
|
+
|
48
49
|
h[k] = {
|
49
50
|
name: self.class.dict.dig(k)[:label],
|
50
51
|
amount: readable(v),
|
data/lib/luca/jp/urikake.rb
CHANGED
@@ -11,38 +11,37 @@ module Luca
|
|
11
11
|
class Urikake < LucaDeal::Invoice
|
12
12
|
@dirname = 'invoices'
|
13
13
|
|
14
|
-
def report(
|
14
|
+
def report(encoding = nil)
|
15
15
|
listed_amount = 0
|
16
16
|
encoding ||= 'SJIS'
|
17
|
+
customers, total = list
|
17
18
|
str = CSV.generate(String.new, headers: false, col_sep: ',', encoding: encoding) do |f|
|
18
|
-
|
19
|
-
amount = readable(
|
19
|
+
customers.map do |c|
|
20
|
+
amount = readable(c['unsettled'])
|
20
21
|
listed_amount += amount
|
21
|
-
f << ['3', '0', '売掛金',
|
22
|
+
f << ['3', '0', '売掛金', c['customer'], c['address'], amount, nil ]
|
22
23
|
end
|
23
|
-
if total
|
24
|
+
if total - listed_amount > 0
|
24
25
|
f << ['3', '0', '売掛金', 'その他', nil, total - listed_amount, nil ]
|
25
|
-
f << ['3', '1', nil, nil, nil, total, nil ]
|
26
|
-
else
|
27
|
-
f << ['3', '1', nil, nil, nil, listed_amount, nil ]
|
28
26
|
end
|
27
|
+
f << ['3', '1', nil, nil, nil, total, nil ]
|
29
28
|
end
|
30
29
|
File.open('HOI030_3.0.csv', 'w') { |f| f.write(str) }
|
31
30
|
end
|
32
31
|
|
33
32
|
def list
|
34
|
-
|
35
|
-
.
|
36
|
-
.sort_by { |invoice| invoice.dig('subtotal', 0, 'items') }
|
33
|
+
customers = self.class.report(@date, detail: true)
|
34
|
+
.sort_by { |customer| customer['unsettled'] }
|
37
35
|
.reverse
|
36
|
+
total = customers.inject(0) { |sum, customer| sum + customer['unsettled'] }
|
38
37
|
|
39
|
-
reports =
|
40
|
-
return reports if reports.length >= 5
|
38
|
+
reports = customers.filter { |customer| 500_000 <= customer['unsettled'] }
|
39
|
+
return [reports, total] if reports.length >= 5
|
41
40
|
|
42
|
-
additional =
|
43
|
-
.filter { |
|
41
|
+
additional = customers
|
42
|
+
.filter { |customer| 500_000 > customer['unsettled'] }
|
44
43
|
.take(5 - reports.length)
|
45
|
-
reports.concat(additional)
|
44
|
+
[reports.concat(additional), total]
|
46
45
|
end
|
47
46
|
end
|
48
47
|
end
|
data/lib/luca/jp/version.rb
CHANGED
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.18.
|
4
|
+
version: 0.18.1
|
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-04-
|
11
|
+
date: 2024-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucabook
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.5.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: lucadeal
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.5.5
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.5.5
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: lucasalary
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|