rock_books 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebc94a9d98f612b4c8c13ed48739004619b4bc4d82d484314f50001d6ee784b6
4
- data.tar.gz: c565f0945fbecc80f4af87afc67f57a9d73e293e95f096a02c1bdbcc2e7a1afb
3
+ metadata.gz: ba9e80afcb8f6644e9fa3cc629a4cac6d723843d1609bab54641c77b779fba89
4
+ data.tar.gz: db3b9f6979da2408202715737fedf5f69b55d44657622364706d7597eac827bf
5
5
  SHA512:
6
- metadata.gz: 514102c4e924ee1890a3f0233b7584c63e9a988595e562b7387e2ed696e41ffffd3b48e72fd939442edeef5a146fd473bb9fe0ea2e657d3b3d57bedc748d8472
7
- data.tar.gz: 67b889a280ed577daa98358b4a927d83bf9339a35d8e9106aa3127776a6028bda7108a55cd7ee3c4164217e8213728c4d742be44b55317e583d7d604151f1a48
6
+ metadata.gz: de4ffe3cbf12789ffa874565e7e60299290e3cc8888a41a2756f0ef7b405152997286f2d4a0b9dd2c00aeb75afc8d2bb10245ae7e747492b14c9da4393948d79
7
+ data.tar.gz: c19a5de4f323c6d50a6a684f87b38e3f12dab1cc55accbeed9ec8560521f02932bf8b6b8788069807496d37e4ff3c6d89056fc16cfcddf87f1c14d1af8e002da
@@ -1,3 +1,11 @@
1
+ ### v0.9.0
2
+
3
+ * Center generated index.html's content.
4
+ * Improve report headings.
5
+ * Fix index.html hyperlinks to resource (receipts, invoices, statements, worksheets) directories.
6
+ * Fix cases where split journal entries were not included in the journal report.
7
+
8
+
1
9
  ### v0.8.0
2
10
 
3
11
  * Add metadata to PDF and HTML reports
@@ -38,7 +46,7 @@ using the prawn gem for PDF and simple ERB templating for HTML.
38
46
  * Add receipt hyperlinks to HTML output.
39
47
 
40
48
 
41
- ## v0.4.0
49
+ ### v0.4.0
42
50
 
43
51
  * Sort unused receipts alphanumerically.
44
52
  * Add 'x' receipts option for reporting both missing and unused receipts.
@@ -46,7 +54,7 @@ using the prawn gem for PDF and simple ERB templating for HTML.
46
54
  * Improve Receipts report.
47
55
 
48
56
 
49
- ## v0.3.0
57
+ ### v0.3.0
50
58
 
51
59
  * Added ability to report unused receipts.
52
60
  * Errors now include more context information.
@@ -54,12 +62,12 @@ using the prawn gem for PDF and simple ERB templating for HTML.
54
62
  * Change license from MIT to Apache 2.
55
63
 
56
64
 
57
- ## v0.2.1
65
+ ### v0.2.1
58
66
 
59
67
  * Add help text to readme.
60
68
 
61
69
 
62
- ## v0.2.0
70
+ ### v0.2.0
63
71
 
64
72
  * Add instruction manual, modify readme.
65
73
  * Overhaul generated index.html.
@@ -67,18 +75,18 @@ using the prawn gem for PDF and simple ERB templating for HTML.
67
75
  * Add validation of transaction dates to ensure within configured date range.
68
76
  * Make report hash / OpenStruct keys consistently symbols.
69
77
 
70
- ## v0.1.6
78
+ ### v0.1.6
71
79
 
72
80
  * Fixed PDF output; PDF files were corrupt because cupsfilter starting sending
73
81
  output to stderr at some point.
74
82
 
75
83
 
76
- ## v0.1.4, v0.1.5
84
+ ### v0.1.4, v0.1.5
77
85
 
78
86
  * Intermediate unsatisfactory fixes, these versions were published but yanked.
79
87
 
80
88
 
81
- ## v0.1.3
89
+ ### v0.1.3
82
90
 
83
91
  * Report output now goes to separate txt, html, and pdf subdirectories.
84
92
  * Add vendor.yml to exclude generated report files from language reporting.
@@ -93,17 +101,17 @@ output to stderr at some point.
93
101
  * Add 'from_string' methods to Journal and ChartOfAccounts.
94
102
 
95
103
 
96
- ## v0.1.2
104
+ ### v0.1.2
97
105
 
98
106
  * Improve error message when the needed directories do not exist.
99
107
 
100
108
 
101
- ## v0.1.1
109
+ ### v0.1.1
102
110
 
103
111
  * Fix startup error.
104
112
 
105
113
 
106
- ## v0.1.0
114
+ ### v0.1.0
107
115
 
108
116
  * First release.
109
117
 
@@ -19,7 +19,9 @@ class BsIsSectionData
19
19
  totals = journals_acct_totals.select { |code, _amount| codes.include?(code) }
20
20
  need_to_reverse_sign = %i{liability equity income}.include?(type)
21
21
  if need_to_reverse_sign
22
- totals.keys.each { |code| totals[code] = -totals[code] }
22
+ totals.keys.each do |code|
23
+ totals[code] = -totals[code] unless totals[code] == 0.0
24
+ end
23
25
  end
24
26
  totals
25
27
  end
@@ -25,6 +25,7 @@ class JournalData
25
25
  name: journal.chart_of_accounts.name_for_code(journal.account_code),
26
26
  title: journal.title,
27
27
  short_name: journal.short_name,
28
+ debit_or_credit: journal.debit_or_credit,
28
29
  start_date: context.chart_of_accounts.start_date,
29
30
  end_date: context.chart_of_accounts.end_date,
30
31
  entries: entries,
@@ -112,7 +112,9 @@ module TextReportHelper
112
112
 
113
113
  # e.g. "Generated at 2021-01-09 18:22:18 by RockBooks version 0.7.1"
114
114
  def generation_info_display_string
115
- "Reports Generated at #{DateTime.now.strftime('%Y-%m-%d %H:%M:%S')} by RockBooks version #{RockBooks::VERSION}"
115
+ now = Time.now
116
+ timestamp = "#{now} (#{now.utc})"
117
+ center("Generated at #{timestamp}") + "\n" + center("by RockBooks version #{RockBooks::VERSION}")
116
118
  end
117
119
 
118
120
 
@@ -130,7 +132,7 @@ module TextReportHelper
130
132
  fn_format_multidoc_entry: method(:format_multidoc_entry),
131
133
  fn_section_heading: method(:section_heading),
132
134
  fn_total_with_ok_or_discrepancy: method(:total_with_ok_or_discrepancy),
133
- generated: "Generated at #{DateTime.now.strftime('%Y-%m-%d %H:%M:%S')} by RockBooks version #{RockBooks::VERSION}",
135
+ generated: generation_info_display_string,
134
136
  line_item_format_string: line_item_format_string,
135
137
  short_name_format_string: SHORT_NAME_FORMAT_STRING,
136
138
  start_date: start_date,
@@ -19,7 +19,9 @@ module RockBooks
19
19
  end
20
20
 
21
21
  def generate
22
- ErbHelper.render_hashes('html/index.html.erb', data, template_presentation_context)
22
+ webized_generate_message_lines = template_presentation_context[:generated].split("\n")
23
+ presentation_context = template_presentation_context.merge( { generated: webized_generate_message_lines})
24
+ ErbHelper.render_hashes('html/index.html.erb', data, presentation_context)
23
25
  end
24
26
  end
25
27
  end
@@ -24,18 +24,25 @@ class JournalReport
24
24
  end
25
25
 
26
26
 
27
+ private def format_date_and_account_amount(date, acct_amount)
28
+ "#{date} #{format_acct_amount(acct_amount)}\n"
29
+ end
30
+
31
+
27
32
  private def format_entry_first_acct_amount(entry)
28
- entry.date.to_s \
29
- + ' ' \
30
- + format_acct_amount(entry.acct_amounts.last) \
31
- + "\n"
33
+ format_date_and_account_amount(entry.date, entry.acct_amounts.first)
34
+ end
35
+
36
+
37
+ private def format_entry_last_acct_amount(entry)
38
+ format_date_and_account_amount(entry.date, entry.acct_amounts.last)
32
39
  end
33
40
 
34
41
 
35
42
  # Formats an entry like this, with entry description added on additional line(s) if it exists:
36
43
  # 2018-05-21 $120.00 701 Office Supplies
37
44
  private def format_entry_no_split(entry)
38
- output = format_entry_first_acct_amount(entry)
45
+ output = format_entry_last_acct_amount(entry)
39
46
 
40
47
  if entry.description && entry.description.length > 0
41
48
  output += entry.description
@@ -48,7 +55,8 @@ class JournalReport
48
55
  # 2018-05-21 $120.00 95.00 701 Office Supplies
49
56
  # 25.00 751 Gift to Customer
50
57
  private def format_entry_with_split(entry)
51
- output = format_entry_first_acct_amount(entry)
58
+ output = StringIO.new
59
+ output << format_entry_first_acct_amount(entry)
52
60
  indent = ' ' * 12
53
61
 
54
62
  entry.acct_amounts[1..-1].each do |acct_amount|
@@ -58,6 +66,8 @@ class JournalReport
58
66
  if entry.description && entry.description.length > 0
59
67
  output << entry.description
60
68
  end
69
+
70
+ output.string
61
71
  end
62
72
 
63
73
 
@@ -15,6 +15,13 @@
15
15
  padding: 36px;
16
16
  background-color: #88c1f7;
17
17
  color: #01182d;
18
+ max-width: 1024px;
19
+ float: none !important;
20
+ margin: 0 auto !important;
21
+ }
22
+
23
+ .top_heading {
24
+ text-align: center;
18
25
  }
19
26
 
20
27
  h2 {
@@ -32,10 +39,16 @@
32
39
 
33
40
  <body>
34
41
 
35
- <h1><%= entity %></h1>
36
- <h1><%= accounting_period %></h1>
37
- <p class="muted"><%= generated %></p>
38
- <!-- <p class="muted">Reports Generated at <%#= DateTime.now.strftime('%Y-%m-%d %H:%M:%S') %> by RockBooks version <%#=RockBooks::VERSION %></p>-->
42
+ <h1 class="top_heading"><%= entity %></h1>
43
+ <h1 class="top_heading">Financial Statements, Reports, and Source Data</h1>
44
+ <h1 class="top_heading"><%= accounting_period %></h1>
45
+ <br />
46
+ <br />
47
+ <h4 class="top_heading"><%= generated[0] %></h4>
48
+ <h4 class="top_heading"><%= generated[1] %> (<a href="https://github.com/keithrbennett/rock_books">https://github.com/keithrbennett/rock_books</a>)</h4>
49
+ <h4 class="top_heading">Open Source Software Provided by <a href="https://www.bbs-software.com/">Bennett Business Solutions, Inc.</a></h4>
50
+ <br />
51
+ <br />
39
52
 
40
53
  <h2>Financial Statements</h2>
41
54
  <div id="financial-statements">
@@ -48,9 +61,10 @@
48
61
  <div id="supporting-documents" style="display: inline ">
49
62
  <%
50
63
  subdir_link = ->(name, caption) do
51
- dir_name = File.expand_path(File.join(Dir.pwd, name))
52
- if Dir.exist?(dir_name)
53
- %Q{<a href=#{dir_name} class="btn btn-primary">#{caption}</a>}
64
+ link_dir_name = File.join('..', '..', name)
65
+ test_dir_name = name
66
+ if Dir.exist?(test_dir_name)
67
+ %Q{<a href=#{link_dir_name} class="btn btn-primary">#{caption}</a>}
54
68
  end
55
69
  end
56
70
  %>
@@ -1,6 +1,7 @@
1
1
  <%= banner_line %>
2
2
  <%= fn_center.(entity || 'Unspecified Entity') %>
3
3
  <%= fn_center.("Balance Sheet for Period Ending #{end_date}") %>
4
+
4
5
  <%= fn_center.(generated) %>
5
6
  <%= banner_line %>
6
7
 
@@ -1,6 +1,7 @@
1
1
  <%= banner_line %>
2
2
  <%= fn_center.(entity || 'Unspecified Entity') %>
3
3
  <%= fn_center.("Income Statement -- #{accounting_period}") %>
4
+
4
5
  <%= fn_center.(generated) %>
5
6
  <%= banner_line %>
6
7
 
@@ -2,12 +2,15 @@
2
2
  <%= fn_center.(entity || 'Unspecified Entity') %>
3
3
  <%= fn_center.(title) %>
4
4
  <%= fn_center.(accounting_period) %>
5
+
5
6
  <% if code && name -%>
6
7
  <%= fn_center.("Account: #{name} (#{code})") %>
7
8
  <% end -%>
8
9
  <% if short_name -%>
9
10
  <%= fn_center.("Journal Short Name: #{short_name}") %>
11
+ <%= fn_center.("Amounts shown are #{debit_or_credit}s to specified accounts (negate for #{short_name})") %>
10
12
  <% end -%>
13
+
11
14
  <%= fn_center.(generated) %>
12
15
  <%= banner_line %>
13
16
 
@@ -2,6 +2,7 @@
2
2
  <%= fn_center.(entity || 'Unspecified Entity') %>
3
3
  <%= fn_center.('Multi Document Transaction Report by Account') %>
4
4
  <%= fn_center.(accounting_period) %>
5
+
5
6
  <%= fn_center.(generated) %>
6
7
 
7
8
  <%= fn_center.('Source Documents') %>
@@ -2,6 +2,7 @@
2
2
  <%= fn_center.(entity || 'Unspecified Entity') %>
3
3
  <%= fn_center.('Multi Document Transaction Report') %>
4
4
  <%= fn_center.(accounting_period) %>
5
+
5
6
  <%= fn_center.(generated) %>
6
7
 
7
8
  <%= fn_center.('Source Documents') %>
@@ -5,6 +5,7 @@ end -%>
5
5
  <%= fn_center.(entity || 'Unspecified Entity') %>
6
6
  <%= fn_center.('Receipts Report') %>
7
7
  <%= fn_center.(accounting_period) %>
8
+
8
9
  <%= fn_center.(generated) %>
9
10
  <%= banner_line %>
10
11
 
@@ -3,6 +3,7 @@
3
3
  <%= fn_center.("Transactions for Account #{account_string}") %>
4
4
  <%= fn_center.(sprintf("Total: %.2f", total)) %>
5
5
  <%= fn_center.(accounting_period) %>
6
+
6
7
  <%= fn_center.(generated) %>
7
8
  <%= banner_line %>
8
9
 
@@ -1,4 +1,4 @@
1
1
  module RockBooks
2
- VERSION = '0.8.0'
2
+ VERSION = '0.9.0'
3
3
  PROJECT_URL = 'https://github.com/keithrbennett/rock_books'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_books
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Bennett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-10 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print