lucabook 0.5.4 → 0.5.7
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/lib/luca_book/journal.rb +4 -2
- data/lib/luca_book/state.rb +2 -2
- data/lib/luca_book/util.rb +7 -0
- 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: ae8447c45fbe2f8aaccaec12694b8af64aeb55e7cd4931945e13dd29ac10216a
|
4
|
+
data.tar.gz: e0af5bed2bbe93f37496678a89a7c6d238c1533afbd5da14f3ae4a245cb55b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a663a3c36383cdc6739358f590ad643e75c506cf64e3b386bd752a42b416035cb0ea3593649935a395631586e59b7bb6290443f0179210cd1999542d6b03153
|
7
|
+
data.tar.gz: e808c7acd78d2dc81daefbb5c2d36003a78e12d067426e7dc641aba889b20267e5fa10e17584ec4e6b2ad76025006840429ea04c6a18a61db31f340e91cf01b1
|
data/lib/luca_book/journal.rb
CHANGED
@@ -31,7 +31,8 @@ module LucaBook #:nodoc:
|
|
31
31
|
# codes = (debit_code + credit_code).uniq
|
32
32
|
codes = nil
|
33
33
|
|
34
|
-
|
34
|
+
serialized = journal2csv(d)
|
35
|
+
create_record(nil, date, codes) { |f| f.write serialized }
|
35
36
|
end
|
36
37
|
|
37
38
|
# update journal with hash.
|
@@ -46,7 +47,8 @@ module LucaBook #:nodoc:
|
|
46
47
|
raise 'invalid ID' if parts.length != 2
|
47
48
|
|
48
49
|
codes = nil
|
49
|
-
|
50
|
+
serialized = journal2csv(d)
|
51
|
+
open_records(@dirname, parts[0], parts[1], codes, 'w') { |f, _path| f.write serialized }
|
50
52
|
end
|
51
53
|
|
52
54
|
# Convert journal object to TSV format.
|
data/lib/luca_book/state.rb
CHANGED
@@ -130,10 +130,10 @@ module LucaBook
|
|
130
130
|
@bs = bs
|
131
131
|
|
132
132
|
mail = Mail.new
|
133
|
-
mail.to = LucaSupport::CONST.config.dig('mail', 'preview') || LucaSupport
|
133
|
+
mail.to = LucaSupport::CONST.config.dig('mail', 'preview') || LucaSupport::CONST.config.dig('mail', 'from')
|
134
134
|
mail.subject = 'Financial Report available'
|
135
135
|
mail.html_part = Mail::Part.new(body: render_erb(search_template('monthly-report.html.erb')), content_type: 'text/html; charset=UTF-8')
|
136
|
-
LucaSupport::Mail.new(mail, LucaSupport
|
136
|
+
LucaSupport::Mail.new(mail, LucaSupport::CONST.pjdir).deliver
|
137
137
|
end
|
138
138
|
|
139
139
|
def bs(level = 3, legal: false)
|
data/lib/luca_book/util.rb
CHANGED
@@ -52,5 +52,12 @@ module LucaBook
|
|
52
52
|
@end_date = [to, @end_date].min if to
|
53
53
|
[@start_date, @end_date]
|
54
54
|
end
|
55
|
+
|
56
|
+
def previous_fy(date = nil)
|
57
|
+
current_start, current_end = current_fy(date)
|
58
|
+
@start_date = current_start.prev_year
|
59
|
+
@end_date = current_start.prev_day
|
60
|
+
[@start_date, @end_date]
|
61
|
+
end
|
55
62
|
end
|
56
63
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucarecord
|