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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6cc66f4a8bcc5ca7fb1e2a86c6ba57d1ff75d01dec530835ad671386ca2409a
4
- data.tar.gz: d13133523464f63818b5acea123472f9ab736ba50c6bba4f93ec1cc3924246d7
3
+ metadata.gz: ae8447c45fbe2f8aaccaec12694b8af64aeb55e7cd4931945e13dd29ac10216a
4
+ data.tar.gz: e0af5bed2bbe93f37496678a89a7c6d238c1533afbd5da14f3ae4a245cb55b3d
5
5
  SHA512:
6
- metadata.gz: fdb7baa012b6110695687435f830eb64f930a88025284494ba509ec76d27f6f3bc906ff5cd8ea936869b4f339fa2a7854ee456534ec4e2c63eec4bfe876e794d
7
- data.tar.gz: 5b49a82f52825781ad3c5e7db1bfcb45be9ef2e0c4f93040d3d368bfa8e6da5b4048eb97550c947c154646c277c4496d3c50e1f4ec9d23604a15f73ddf754bb5
6
+ metadata.gz: 3a663a3c36383cdc6739358f590ad643e75c506cf64e3b386bd752a42b416035cb0ea3593649935a395631586e59b7bb6290443f0179210cd1999542d6b03153
7
+ data.tar.gz: e808c7acd78d2dc81daefbb5c2d36003a78e12d067426e7dc641aba889b20267e5fa10e17584ec4e6b2ad76025006840429ea04c6a18a61db31f340e91cf01b1
@@ -31,7 +31,8 @@ module LucaBook #:nodoc:
31
31
  # codes = (debit_code + credit_code).uniq
32
32
  codes = nil
33
33
 
34
- create_record(nil, date, codes) { |f| f.write journal2csv(d) }
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
- open_records(@dirname, parts[0], parts[1], codes, 'w') { |f, _path| f.write journal2csv(d) }
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.
@@ -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.CONST.config.dig('mail', 'from')
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.CONST.pjdir).deliver
136
+ LucaSupport::Mail.new(mail, LucaSupport::CONST.pjdir).deliver
137
137
  end
138
138
 
139
139
  def bs(level = 3, legal: false)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaBook
4
- VERSION = '0.5.4'
4
+ VERSION = '0.5.7'
5
5
  end
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
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: 2024-04-11 00:00:00.000000000 Z
11
+ date: 2025-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucarecord