rock_books 0.8.0 → 0.9.0
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/RELEASE_NOTES.md +18 -10
- data/lib/rock_books/reports/data/bs_is_section_data.rb +3 -1
- data/lib/rock_books/reports/data/journal_data.rb +1 -0
- data/lib/rock_books/reports/helpers/text_report_helper.rb +4 -2
- data/lib/rock_books/reports/index_html_page.rb +3 -1
- data/lib/rock_books/reports/journal_report.rb +16 -6
- data/lib/rock_books/reports/templates/html/index.html.erb +21 -7
- data/lib/rock_books/reports/templates/text/balance_sheet.txt.erb +1 -0
- data/lib/rock_books/reports/templates/text/income_statement.txt.erb +1 -0
- data/lib/rock_books/reports/templates/text/journal.txt.erb +3 -0
- data/lib/rock_books/reports/templates/text/multidoc_txn_by_account_report.txt.erb +1 -0
- data/lib/rock_books/reports/templates/text/multidoc_txn_report.txt.erb +1 -0
- data/lib/rock_books/reports/templates/text/receipts_report.txt.erb +1 -0
- data/lib/rock_books/reports/templates/text/tx_one_account.txt.erb +1 -0
- data/lib/rock_books/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: ba9e80afcb8f6644e9fa3cc629a4cac6d723843d1609bab54641c77b779fba89
|
4
|
+
data.tar.gz: db3b9f6979da2408202715737fedf5f69b55d44657622364706d7597eac827bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de4ffe3cbf12789ffa874565e7e60299290e3cc8888a41a2756f0ef7b405152997286f2d4a0b9dd2c00aeb75afc8d2bb10245ae7e747492b14c9da4393948d79
|
7
|
+
data.tar.gz: c19a5de4f323c6d50a6a684f87b38e3f12dab1cc55accbeed9ec8560521f02932bf8b6b8788069807496d37e4ff3c6d89056fc16cfcddf87f1c14d1af8e002da
|
data/RELEASE_NOTES.md
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
65
|
+
### v0.2.1
|
58
66
|
|
59
67
|
* Add help text to readme.
|
60
68
|
|
61
69
|
|
62
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
104
|
+
### v0.1.2
|
97
105
|
|
98
106
|
* Improve error message when the needed directories do not exist.
|
99
107
|
|
100
108
|
|
101
|
-
|
109
|
+
### v0.1.1
|
102
110
|
|
103
111
|
* Fix startup error.
|
104
112
|
|
105
113
|
|
106
|
-
|
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
|
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
|
-
|
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:
|
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
|
-
|
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.
|
29
|
-
|
30
|
-
|
31
|
-
|
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 =
|
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 =
|
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
|
37
|
-
<
|
38
|
-
|
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
|
-
|
52
|
-
|
53
|
-
|
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
|
%>
|
@@ -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
|
|
data/lib/rock_books/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2021-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|