rock_books 0.2.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/LICENSE.txt +201 -21
- data/README.md +6 -2
- data/RELEASE_NOTES.md +34 -0
- data/lib/rock_books/cmd_line/command_line_interface.rb +19 -8
- data/lib/rock_books/documents/book_set.rb +4 -130
- data/lib/rock_books/documents/chart_of_accounts.rb +45 -30
- data/lib/rock_books/documents/journal.rb +45 -40
- data/lib/rock_books/helpers/html_helper.rb +29 -0
- data/lib/rock_books/reports/book_set_reporter.rb +200 -0
- data/lib/rock_books/{documents → reports}/index.html.erb +0 -0
- data/lib/rock_books/{documents → reports}/receipts.html.erb +0 -0
- data/lib/rock_books/reports/receipts_report.rb +23 -10
- data/lib/rock_books/reports/report_context.rb +1 -4
- data/lib/rock_books/reports/reporter.rb +1 -1
- data/lib/rock_books/reports/transaction_report.rb +4 -2
- data/lib/rock_books/version.rb +1 -1
- data/rock_books.gemspec +4 -3
- data/sample_data/minimal/rockbooks-reports/html/ck_hsbc_disb.html +40 -0
- data/sample_data/minimal/rockbooks-reports/html/index.html +271 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_accts_rec.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_bank_fees.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_books_refs.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_cc_hsbc_visa.html +74 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_cc_proc.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_ck_hsbc.html +45 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_conf_fees.html +36 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_cowork_fees.html +42 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_govt_fees.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_inet_fees.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_int_exp.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_loan_to_sh.html +47 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_meals_ent.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_misc_exp.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_mktng_exp.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_own_equity.html +35 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_prof_fees.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_repair_maint.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_ret_earn.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_ship_exp.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_sls_cons.html +35 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_sw_exp.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_airfare.html +35 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_autorent.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_gas_etc.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_govt.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_lodging.html +36 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_m_e.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_m_i.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_mileage.html +35 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_misc.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_parking.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_perdiem_mi.html +35 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_taxi.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_trainfare.html +27 -0
- data/sample_data/minimal/rockbooks-reports/html/single-account/acct_tr_unclass.html +27 -0
- data/sample_data/minimal/rockbooks-reports/pdf/all_txns_by_acct.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/all_txns_by_amount.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/all_txns_by_date.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/balance_sheet.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/ck_hsbc_disb.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/general.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/hsbc_visa.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/income_statement.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/receipts.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_accts_rec.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_bank_fees.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_books_refs.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_cc_hsbc_visa.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_cc_proc.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_ck_hsbc.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_conf_fees.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_cowork_fees.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_govt_fees.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_inet_fees.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_insurance.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_int_exp.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_loan_to_sh.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_meals_ent.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_misc_exp.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_mktng_exp.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_own_equity.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_paypal.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_prof_fees.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_repair_maint.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_ret_earn.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_ship_exp.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_sls_cons.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_supplies.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_sw_exp.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_airfare.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_autorent.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_gas_etc.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_govt.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_lodging.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_m_e.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_m_i.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_mileage.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_misc.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_parking.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_perdiem_mi.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_taxi.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_trainfare.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/pdf/single-account/acct_tr_unclass.pdf +0 -0
- data/sample_data/minimal/rockbooks-reports/txt/ck_hsbc_disb.txt +24 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_accts_rec.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_bank_fees.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_books_refs.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_cc_hsbc_visa.txt +58 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_cc_proc.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_ck_hsbc.txt +29 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_conf_fees.txt +20 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_cowork_fees.txt +26 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_govt_fees.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_inet_fees.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_int_exp.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_loan_to_sh.txt +31 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_meals_ent.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_misc_exp.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_mktng_exp.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_own_equity.txt +19 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_prof_fees.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_repair_maint.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_ret_earn.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_ship_exp.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_sls_cons.txt +19 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_sw_exp.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_airfare.txt +19 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_autorent.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_gas_etc.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_govt.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_lodging.txt +20 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_m_e.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_m_i.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_mileage.txt +19 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_misc.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_parking.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_perdiem_mi.txt +19 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_taxi.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_trainfare.txt +11 -0
- data/sample_data/minimal/rockbooks-reports/txt/single-account/acct_tr_unclass.txt +11 -0
- metadata +140 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81be281ee187aa03b43808391235de30c85e05b7983e243a5df887ec6eb12b2b
|
4
|
+
data.tar.gz: 9069620c1ad95d22e35358caa4ed473899c7a897ad741f679047def6b6fee1e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67e7be616f654e5ed67e7f32836b03f56cdfc18821a7d0ee50570aadbb5cb65d0f288d0c4def2999ce2f32b150490e93aa0a6107a1995297b69d178e4ab9de9
|
7
|
+
data.tar.gz: 38819a0cfa909e3171705f11d3151bc2d128d0b946d6a31ff3cb1e6a7278e60670cb820c2fceb8e66be9891891a91dcd317079050675c1b2678b099d26b76676
|
data/.gitignore
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,21 +1,201 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2019 Bennett Business Solutions, Inc.
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -31,6 +31,11 @@ To simplify its implementation, RockBooks assumes some conventions:
|
|
31
31
|
* `statements` - statements from banks, etc.
|
32
32
|
* `worksheets` - spreadsheets, etc., e.g. mileage and per diem calculations
|
33
33
|
|
34
|
+
#### Supported Operating Systems
|
35
|
+
|
36
|
+
At this time, RockBooks is supported only on Mac OS and Linux. (It's really the external tools that is the issue, not the Ruby code.) It should probably work with Windows Subsystem for Linux (WSL) but it hasn't been tested. If you're unsuccessful trying to use RockBooks with WSL, give me as much information as possible and I'll try to resolve the issue.
|
37
|
+
|
38
|
+
If you get an error message saying that an external command is missing, install that command using your system's package manager (e.g. `sudo apt install txt2html`). For `wkhtmltopdf` on Linux, see [https://wkhtmltopdf.org/](https://wkhtmltopdf.org/).
|
34
39
|
|
35
40
|
#### Text Files as Input
|
36
41
|
|
@@ -54,7 +59,7 @@ There is no handling of end of year closings or the like; the entire set of data
|
|
54
59
|
#### RockBooks Help Text
|
55
60
|
|
56
61
|
```
|
57
|
-
Command Line Switches: [rock-books version 0.2.
|
62
|
+
Command Line Switches: [rock-books version 0.2.1 at https://github.com/keithrbennett/rock_books]
|
58
63
|
|
59
64
|
-i input directory specification, default: './rockbooks-inputs'
|
60
65
|
-o output (reports) directory specification, default: './rockbooks-reports'
|
@@ -91,7 +96,6 @@ As a product written by a single developer in his spare time, RockBooks lacks so
|
|
91
96
|
* On the fly data validation
|
92
97
|
* Data entry conveniences such as drop down selection lists for data such as accounts
|
93
98
|
* Fancy reporting and graphing -- however, RockBooks' bringing links to all the entity's documentation and output into a single web page may well be more useful
|
94
|
-
* At this time, RockBooks is only tested on Macs. The input files are plain text files and could be created on any OS, but the validation and report generation might not work. Get in touch with me if you are using a different OS and want to use RockBooks, and are willing and available to test my changes. Linux in particular should be an easy port.
|
95
99
|
|
96
100
|
|
97
101
|
## Installation
|
data/RELEASE_NOTES.md
CHANGED
@@ -1,3 +1,37 @@
|
|
1
|
+
### v0.6.1
|
2
|
+
|
3
|
+
* Linux PDF generation fixed by using wkhtmltopdf instead of cupsfilter.
|
4
|
+
|
5
|
+
### v0.6.0
|
6
|
+
|
7
|
+
* Linux support added!
|
8
|
+
|
9
|
+
### v0.5.0
|
10
|
+
|
11
|
+
* Add receipt hyperlinks to HTML output.
|
12
|
+
|
13
|
+
|
14
|
+
## v0.4.0
|
15
|
+
|
16
|
+
* Sort unused receipts alphanumerically.
|
17
|
+
* Add 'x' receipts option for reporting both missing and unused receipts.
|
18
|
+
* Fix: journals were showing journal account instead of the other account in each transaction.
|
19
|
+
* Improve Receipts report.
|
20
|
+
|
21
|
+
|
22
|
+
## v0.3.0
|
23
|
+
|
24
|
+
* Added ability to report unused receipts.
|
25
|
+
* Errors now include more context information.
|
26
|
+
* Improved chart of accounts validation.
|
27
|
+
* Change license from MIT to Apache 2.
|
28
|
+
|
29
|
+
|
30
|
+
## v0.2.1
|
31
|
+
|
32
|
+
* Add help text to readme.
|
33
|
+
|
34
|
+
|
1
35
|
## v0.2.0
|
2
36
|
|
3
37
|
* Add instruction manual, modify readme.
|
@@ -49,7 +49,7 @@ Command Line Switches: [rock-books version #{RockBooks::VERSI
|
|
49
49
|
|
50
50
|
Commands:
|
51
51
|
|
52
|
-
rec[eipts] - receipts: a/:a all, m/:m missing, e/:e existing
|
52
|
+
rec[eipts] - receipts: a/:a all, m/:m missing, e/:e existing, u/:u unused
|
53
53
|
rep[orts] - return an OpenStruct containing all reports (interactive shell mode only)
|
54
54
|
d[isplay_reports] - display all reports on stdout
|
55
55
|
w[rite_reports] - write all reports to the output directory (see -o option)
|
@@ -317,17 +317,20 @@ When in interactive shell mode:
|
|
317
317
|
raise Error.new("Receipt processing was requested but has been disabled with --no-receipts.")
|
318
318
|
end
|
319
319
|
|
320
|
-
missing, existing = book_set.
|
320
|
+
missing, existing, unused = book_set.missing_existing_unused_receipts
|
321
321
|
|
322
|
-
print_missing = -> { puts "
|
323
|
-
print_existing = -> { puts "
|
322
|
+
print_missing = -> { puts "\n\nMissing Receipts:"; ap missing }
|
323
|
+
print_existing = -> { puts "\n\nExisting Receipts:"; ap existing }
|
324
|
+
print_unused = -> { puts "\n\nUnused Receipts:"; ap unused }
|
324
325
|
|
325
326
|
case options.first.to_s
|
326
327
|
when 'a' # all
|
327
328
|
if run_options.interactive_mode
|
328
|
-
{ missing: missing, existing: existing }
|
329
|
+
{ missing: missing, existing: existing, unused: unused }
|
329
330
|
else
|
330
|
-
print_missing.()
|
331
|
+
print_missing.()
|
332
|
+
print_existing.()
|
333
|
+
print_unused.()
|
331
334
|
end
|
332
335
|
|
333
336
|
when 'm'
|
@@ -336,8 +339,16 @@ When in interactive shell mode:
|
|
336
339
|
when 'e'
|
337
340
|
run_options.interactive_mode ? existing : print_existing.()
|
338
341
|
|
342
|
+
when 'u'
|
343
|
+
run_options.interactive_mode ? unused : print_unused.()
|
344
|
+
|
345
|
+
when 'x'
|
346
|
+
run_options.interactive_mode ? missing : print_missing.()
|
347
|
+
run_options.interactive_mode ? unused : print_unused.()
|
348
|
+
|
339
349
|
else
|
340
|
-
message = "Invalid option for receipts.
|
350
|
+
message = "Invalid option for receipts." + \
|
351
|
+
" Must be 'a' for all, 'm' for missing, 'e' for existing, 'u' for unused, or 'x' for errors (missing/unused)."
|
341
352
|
if run_options.interactive_mode
|
342
353
|
puts message
|
343
354
|
else
|
@@ -347,7 +358,7 @@ When in interactive shell mode:
|
|
347
358
|
end
|
348
359
|
|
349
360
|
def cmd_w
|
350
|
-
|
361
|
+
BookSetReporter.new(book_set, run_options.output_dir, $filter).call
|
351
362
|
nil
|
352
363
|
end
|
353
364
|
|
@@ -1,17 +1,12 @@
|
|
1
1
|
require 'awesome_print'
|
2
|
+
require 'os'
|
2
3
|
|
3
4
|
require_relative 'chart_of_accounts'
|
4
5
|
require_relative 'journal'
|
5
6
|
require_relative '../filters/journal_entry_filters' # for shell mode
|
7
|
+
require_relative '../helpers/html_helper'
|
6
8
|
require_relative '../helpers/parse_helper'
|
7
|
-
require_relative '../reports/
|
8
|
-
require_relative '../reports/income_statement'
|
9
|
-
require_relative '../reports/multidoc_transaction_report'
|
10
|
-
require_relative '../reports/receipts_report'
|
11
|
-
require_relative '../reports/report_context'
|
12
|
-
require_relative '../reports/transaction_report'
|
13
|
-
require_relative '../reports/tx_by_account'
|
14
|
-
require_relative '../reports/tx_one_account'
|
9
|
+
require_relative '../reports/book_set_reporter'
|
15
10
|
|
16
11
|
require 'erb'
|
17
12
|
require 'open3'
|
@@ -28,102 +23,6 @@ module RockBooks
|
|
28
23
|
end
|
29
24
|
|
30
25
|
|
31
|
-
def report_context
|
32
|
-
@report_context ||= ReportContext.new(chart_of_accounts, journals, 80)
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
def all_reports(filter = nil)
|
37
|
-
|
38
|
-
periods_to_underscores = ->(string) { string.gsub('.', '_') }
|
39
|
-
|
40
|
-
context = report_context
|
41
|
-
report_hash = context.journals.each_with_object({}) do |journal, report_hash|
|
42
|
-
key = periods_to_underscores.(journal.short_name).to_sym
|
43
|
-
report_hash[key] = TransactionReport.new(journal, context).call(filter)
|
44
|
-
end
|
45
|
-
report_hash[:all_txns_by_date] = MultidocTransactionReport.new(context).call(filter)
|
46
|
-
report_hash[:all_txns_by_amount] = MultidocTransactionReport.new(context).call(filter, :amount)
|
47
|
-
report_hash[:all_txns_by_acct] = TxByAccount.new(context).call
|
48
|
-
report_hash[:balance_sheet] = BalanceSheet.new(context).call
|
49
|
-
report_hash[:income_statement] = IncomeStatement.new(context).call
|
50
|
-
|
51
|
-
if run_options.do_receipts
|
52
|
-
report_hash[:receipts] = ReceiptsReport.new(context, *missing_and_existing_receipts).call
|
53
|
-
end
|
54
|
-
|
55
|
-
chart_of_accounts.accounts.each do |account|
|
56
|
-
key = ('acct_' + periods_to_underscores.(account.code)).to_sym
|
57
|
-
report = TxOneAccount.new(context, account.code).call
|
58
|
-
report_hash[key] = report
|
59
|
-
end
|
60
|
-
report_hash
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
def run_command(command)
|
65
|
-
puts "\n----\nRunning command: #{command}"
|
66
|
-
stdout, stderr, status = Open3.capture3(command)
|
67
|
-
puts "Status was #{status}."
|
68
|
-
unless stdout.size == 0
|
69
|
-
puts "\nStdout was:\n\n#{stdout}"
|
70
|
-
end
|
71
|
-
unless stderr.size == 0
|
72
|
-
puts "\nStderr was:\n\n#{stderr}"
|
73
|
-
end
|
74
|
-
puts
|
75
|
-
stdout
|
76
|
-
end
|
77
|
-
|
78
|
-
|
79
|
-
def all_reports_to_files(directory = '.', filter = nil)
|
80
|
-
reports = all_reports(filter)
|
81
|
-
|
82
|
-
create_directories = -> do
|
83
|
-
%w(txt pdf html).each do |format|
|
84
|
-
dir = File.join(directory, format, SINGLE_ACCT_SUBDIR)
|
85
|
-
FileUtils.mkdir_p(dir)
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
# "./pdf/short_name.pdf" or "./pdf/single_account/short_name.pdf"
|
90
|
-
build_filespec = ->(directory, short_name, file_format) do
|
91
|
-
fragments = [directory, file_format, "#{short_name}.#{file_format}"]
|
92
|
-
is_acct_report = /^acct_/.match(short_name)
|
93
|
-
if is_acct_report
|
94
|
-
fragments.insert(2, SINGLE_ACCT_SUBDIR)
|
95
|
-
end
|
96
|
-
File.join(*fragments)
|
97
|
-
end
|
98
|
-
|
99
|
-
create_index_html = -> do
|
100
|
-
filespec = build_filespec.(directory, 'index', 'html')
|
101
|
-
File.write(filespec, index_html_content)
|
102
|
-
puts "Created index.html"
|
103
|
-
end
|
104
|
-
|
105
|
-
write_reports = ->do
|
106
|
-
|
107
|
-
reports.each do |short_name, report_text|
|
108
|
-
txt_filespec = build_filespec.(directory, short_name, 'txt')
|
109
|
-
html_filespec = build_filespec.(directory, short_name, 'html')
|
110
|
-
pdf_filespec = build_filespec.(directory, short_name, 'pdf')
|
111
|
-
|
112
|
-
File.write(txt_filespec, report_text)
|
113
|
-
# Use smaller size for the PDF but larger size for the web pages:
|
114
|
-
run_command("textutil -convert html -font 'Courier New Bold' -fontsize 11 #{txt_filespec} -output #{html_filespec}")
|
115
|
-
run_command("cupsfilter #{html_filespec} > #{pdf_filespec}")
|
116
|
-
run_command("textutil -convert html -font 'Courier New Bold' -fontsize 14 #{txt_filespec} -output #{html_filespec}")
|
117
|
-
puts "Created reports in txt, html, and pdf for #{"%-20s" % short_name} at #{File.dirname(txt_filespec)}.\n\n\n"
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
create_directories.()
|
122
|
-
create_index_html.()
|
123
|
-
write_reports.()
|
124
|
-
end
|
125
|
-
|
126
|
-
|
127
26
|
def journal_names
|
128
27
|
journals.map(&:short_name)
|
129
28
|
end
|
@@ -140,31 +39,6 @@ module RockBooks
|
|
140
39
|
@all_entries ||= Journal.entries_in_documents(journals)
|
141
40
|
end
|
142
41
|
|
143
|
-
|
144
|
-
def receipt_full_filespec(receipt_filespec)
|
145
|
-
File.join(run_options.receipt_dir, receipt_filespec)
|
146
|
-
end
|
147
|
-
|
148
|
-
|
149
|
-
def missing_and_existing_receipts
|
150
|
-
missing = []; existing = []
|
151
|
-
all_entries.each do |entry|
|
152
|
-
entry.receipts.each do |receipt|
|
153
|
-
file_exists = File.file?(receipt_full_filespec(receipt))
|
154
|
-
list = (file_exists ? existing : missing)
|
155
|
-
list << { receipt: receipt, journal: entry.doc_short_name }
|
156
|
-
end
|
157
|
-
end
|
158
|
-
[missing, existing]
|
159
|
-
end
|
160
|
-
|
161
|
-
def index_html_content
|
162
|
-
erb_filespec = File.join(File.dirname(__FILE__), 'index.html.erb')
|
163
|
-
erb = ERB.new(File.read(erb_filespec))
|
164
|
-
erb.result_with_hash(
|
165
|
-
journals: journals,
|
166
|
-
chart_of_accounts: chart_of_accounts,
|
167
|
-
run_options: run_options)
|
168
|
-
end
|
169
42
|
end
|
170
43
|
end
|
44
|
+
|