| 1 |
-*- mode: org -*- |
| 2 |
beancount: TODO |
| 3 |
* V3 / C++ |
| 4 |
|
| 5 |
- TODO(blais): Setup ASSERT() as a stream. |
| 6 |
- Replace absl/strings/string_view.h to <string_view> |
| 7 |
|
| 8 |
- Contemplate removing Ledger and the beancount::Ledger proto. Do we really need |
| 9 |
both? Measure performance and use cases and eliminate one or the other. |
| 10 |
|
| 11 |
- Establish a distinction between strings and currencies in data type in Python; |
| 12 |
this allows us to process metadata correctly. See this plugin for a use case: |
| 13 |
beancount.plugins.check_commodity |
| 14 |
|
| 15 |
- Review and test pointer ownership and leakage. This parser does not currently |
| 16 |
apply much rigor on reclaiming memory. |
| 17 |
|
| 18 |
- In options `plugin_processing_mode`: |
| 19 |
|
| 20 |
TODO(blais): Make the default include all the core plugins, as PEDANTIC. |
| 21 |
Let that be the default. Make DEFAULT some other name. V3 should include |
| 22 |
all the pedantry by default. |
| 23 |
|
| 24 |
** Reminders |
| 25 |
|
| 26 |
- It would be great to be able to file a reminder of payment directive, and |
| 27 |
somehow for bean-check to warn you to file those when within a certain time |
| 28 |
frame, e.g., 30 days. |
| 29 |
|
| 30 |
|
| 31 |
** For API |
| 32 |
|
| 33 |
- Inventory: Add a function to discard by currency. |
| 34 |
- Inventory: Make it easier to reduce & convert to a single currency. |
| 35 |
|
| 36 |
|
| 37 |
* Priorities |
| 38 |
|
| 39 |
- Fix #145 |
| 40 |
|
| 41 |
booking_full.py: # FIXME: Refactor compute_cost_number() and convert_costspec_to_cost(). |
| 42 |
|
| 43 |
- Start versioning very soon. It's desired by users. |
| 44 |
|
| 45 |
- Pivot report... very useful. I need it. |
| 46 |
- Pull request for Unicode support: https://bitbucket.org/blais/beancount/pull-requests/13/allow-unicode-in-account-names/diff#comment-20233638 |
| 47 |
- Fix #128 |
| 48 |
- Fix #130 |
| 49 |
|
| 50 |
{booking} |
| 51 |
{holding} |
| 52 |
{balance-where} |
| 53 |
{autogroup} |
| 54 |
{review-dcontext} |
| 55 |
{write-intro-doc} |
| 56 |
{commodity-required} |
| 57 |
|
| 58 |
|
| 59 |
* Returns (Revision) |
| 60 |
|
| 61 |
- Fix remaining tests for removal of open/balance entries from segment_periods(). |
| 62 |
|
| 63 |
- Implement per account, with data structures + code to combine them together |
| 64 |
- Trailing windows |
| 65 |
- Rolling windows |
| 66 |
- Calculate pre-tax returns, post-tax returns |
| 67 |
- Output nice debugging information |
| 68 |
- Warn when prices aren't within a certain date interval with their usage |
| 69 |
- Render a graph of the actual values of the assets as well. |
| 70 |
- There should be a separate web application that handles this, no need to |
| 71 |
pre-render everything. |
| 72 |
- You need to merge the external entries when multiple ones occur on the same |
| 73 |
date. |
| 74 |
- Handle the various FIXMEs. |
| 75 |
|
| 76 |
* Settlement Dates (Split & Merge) |
| 77 |
|
| 78 |
In http://furius.ca/beancount/doc/proposal-settlement, I describe the problem |
| 79 |
of merging two half-transactions that occur at different dates, pulled by |
| 80 |
importing from two different accounts into a single one. I also discuss that |
| 81 |
this problem is dual to that of providing a way to input a single transaction |
| 82 |
with legs posting at different dates. These two problems are related and will |
| 83 |
be dealt together by providing additions to the syntax and some plugins as |
| 84 |
well. |
| 85 |
|
| 86 |
- Including the email thread with mharris & redstreet0 in the settlement doc. |
| 87 |
|
| 88 |
- Review all the documentation to convert "transfer account" to "clearing |
| 89 |
account" everywhere; that's the correct name for this idea (thanks Filippo). |
| 90 |
|
| 91 |
- Limbo accounts: Start a document on handling limbo accounts, summarize all |
| 92 |
info from emails. (BTW, these are called "Clearing Accounts"; rename all docs) |
| 93 |
|
| 94 |
- You need to be able to support a single transaction that gets amortized over |
| 95 |
time. |
| 96 |
|
| 97 |
** Dated Postings |
| 98 |
|
| 99 |
- In order to create multiple similar transactions at many dates in one |
| 100 |
syntax' entry, you could allow overriding the date on each posting, e.g.: |
| 101 |
|
| 102 |
2013-04-01 * Blah di bla |
| 103 |
2013-01-01 Grocery 10 USD |
| 104 |
2013-02-01 Grocery 10 USD |
| 105 |
2013-03-01 Grocery 10 USD |
| 106 |
Cash |
| 107 |
|
| 108 |
This would create three transactions, with these dates: |
| 109 |
|
| 110 |
date aux-date |
| 111 |
2013-01-01 2013-04-01 10 / 3.33 |
| 112 |
2013-02-01 2013-04-01 ... |
| 113 |
2013-03-01 2013-04-01 ... |
| 114 |
|
| 115 |
Could be a nice way to make distributed transactions. |
| 116 |
|
| 117 |
- Move 'effective date' to the postings in my input file, using the dated |
| 118 |
postings feature. |
| 119 |
|
| 120 |
- Another idea would be to make @pad able to pad for a percentage of the |
| 121 |
total, so that we're able to use @pad instead of "distribution of expenses" |
| 122 |
entries. |
| 123 |
|
| 124 |
* Exporting Data |
| 125 |
|
| 126 |
Beancount has various reports and export mechanisms, but there remain several |
| 127 |
flaws. I want to address some of these urgently. |
| 128 |
|
| 129 |
- Implement output to XLS as well. |
| 130 |
|
| 131 |
- Complete the export of holdings to a Google Spreadsheet and completely |
| 132 |
replace my usage of Google Finance for intra-day reporting. Part of this |
| 133 |
work should result in the ability to produce a spreadsheet of various |
| 134 |
aggregations of dimensions on each stock, e.g., report intra-day movement in |
| 135 |
small, mid and large cap stock positions separately. |
| 136 |
|
| 137 |
- Idea: Export the Posting table to a Spreadsheet equivalent, as a single list |
| 138 |
of postings, joining transactions by an id column. That should quiet down |
| 139 |
those who think you can do this with a Spreadsheet to try it out for |
| 140 |
themselves. |
| 141 |
|
| 142 |
- Write a script that, given my portfolio of ETFs, will compute the total |
| 143 |
exposure of AMZN (or any other stock contained within the ETF) of the entire |
| 144 |
portfolio value. In other words, sum up the components of individual stocks |
| 145 |
across all ETFs and mutual funds, and reaggregate by those individual |
| 146 |
stocks. I believe that there is much overlap. |
| 147 |
|
| 148 |
* Documentation |
| 149 |
|
| 150 |
I have a number of documents pending to release, some of which for part of the |
| 151 |
Benacount Cookbook which exists to provide guidance on selecting accounts and |
| 152 |
methods to book various things. |
| 153 |
|
| 154 |
Tasks: |
| 155 |
|
| 156 |
- "Introduction to Double-Entry Booking." The most important one is this intro |
| 157 |
doc. I have a very clear idea of how I want to present this, but for some |
| 158 |
reason I've written everything else and left this for last. I had a couple |
| 159 |
of shots at it but never really finished it. This document will also contain |
| 160 |
a section to explain how inventories "work", that is, how amounts posted to |
| 161 |
them are matched against their existing contents. Complete this doc first. |
| 162 |
{write-intro-doc} |
| 163 |
|
| 164 |
- "Cookbook: Taxes." I have a nearly complete cookbook document on booking |
| 165 |
taxes. It's timely [April 2016] and I should try to complete that now for |
| 166 |
this reason. |
| 167 |
|
| 168 |
- "Cookbook: Health Care". I have a nearly complete cookbook document on |
| 169 |
booking health-care costs. Tracking health-case costs in the US has caused |
| 170 |
me headaches occasionally but I've managed to come up with a nice framework |
| 171 |
for doing so. I need to finish this document to share this. (Ideally with |
| 172 |
DEDUC and COPAY legs explanation. Write an accompanying plugin to insert the |
| 173 |
deductible tracking and what-not.) |
| 174 |
|
| 175 |
- "Property sale example." Beancount was begun shortly after buying my first |
| 176 |
real-estate property (a condominium loft in Montreal). Because of this, I |
| 177 |
tracked _all_ related expenses in Beancount and I'd like to build an example |
| 178 |
script which processes my transactions to extract just those and finally |
| 179 |
calculate the precise return on the property, including every single little |
| 180 |
tidbit that was spent on it. My goal is to demonstrate that although at face |
| 181 |
value a profit was made, when you account for all the details you realize |
| 182 |
that the true return is much smaller--even potentially a loss. Part of the |
| 183 |
work here involves ensuring that all the input numbers can be pulled out of |
| 184 |
Beancount directly, without using a spreadsheet. I think that doig this |
| 185 |
might require some custom scripting and I intended for this use case to |
| 186 |
become an example of writing scripts against the Beancount API. |
| 187 |
|
| 188 |
- Write a worked and detailed example of generating automated transactions in |
| 189 |
the Plugins document. |
| 190 |
|
| 191 |
- Make sure this doc is linked from somewhere: |
| 192 |
http://furius.ca/beancount/doc/proposal-rounding |
| 193 |
|
| 194 |
- Create an index page of all the possible reports, from the web page. |
| 195 |
|
| 196 |
- Write more on saving, "Climbing the Capital Mountain." |
| 197 |
|
| 198 |
- Summarize Ledger's --limit --real --virtual --equity, etc. options. |
| 199 |
|
| 200 |
- Write a doc about how conceptually Beancount's data is really just a single |
| 201 |
large joined table of Transactions JOIN Postings with some repeated fields |
| 202 |
for inventory and tags, some data types for Amount and Inventory along with |
| 203 |
accompanying functions to deal with those types. This could really help a |
| 204 |
lot of people understand the framework for extracting data from Beancount. |
| 205 |
|
| 206 |
** Misc Documentation Tasks |
| 207 |
|
| 208 |
- Write a script to automatically convert and upload the docs for the shell |
| 209 |
functions and what-not into a Google Docs that we can open with a web |
| 210 |
browser. Write a script to spit it out in a nice format and upload. |
| 211 |
|
| 212 |
- In the comparison doc: describe how Beancount has asset types |
| 213 |
|
| 214 |
- Comparison w/ Ledger doc: "balance sheet and closing of year" |
| 215 |
|
| 216 |
- Write a document that explains how to convert to and from Ledger and/or |
| 217 |
HLedger. |
| 218 |
|
| 219 |
- Complete "How Inventories Work?" |
| 220 |
|
| 221 |
- Complete intro document on double-entry bookkeepingk." |
| 222 |
- Complete Design Doc |
| 223 |
|
| 224 |
- Change documentation script to try to download to ODT format and then batch |
| 225 |
format to ebook |
| 226 |
|
| 227 |
- You should have a dedicated section of your document that explains how market |
| 228 |
values are reported, that is, via the unrealized gains plugin. Also provide a |
| 229 |
market() function, to value holdings. |
| 230 |
|
| 231 |
- Finally bake a PDF of all GDocs documentation and add a link to it. Should |
| 232 |
be mobile-friendly. |
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
- Merge "Getting Started with Beancount" & "Tutorial & Example" into a single |
| 238 |
document. See comments from: |
| 239 |
https://docs.google.com/document/d/1w5wWVFuPe6H2Aeex8iqCL8YfAO6xNZgzmrnRNlvxJec/ |
| 240 |
|
| 241 |
- Merge "A Comparison of Beancount, Ledger & HLedger" & "Beancount History & |
| 242 |
Credits" documents into one. See comments from: |
| 243 |
https://docs.google.com/document/d/1w5wWVFuPe6H2Aeex8iqCL8YfAO6xNZgzmrnRNlvxJec/ |
| 244 |
|
| 245 |
- Move the "spreadsheet / mint / quicken / quickbooks / gnucash / sql" |
| 246 |
comparison bit out of the "Motivation" document into the "Comparison" document. |
| 247 |
See comments from: |
| 248 |
https://docs.google.com/document/d/1w5wWVFuPe6H2Aeex8iqCL8YfAO6xNZgzmrnRNlvxJec/ |
| 249 |
|
| 250 |
- Make the four extraction methods clear, create a "part" for the four docs. |
| 251 |
|
| 252 |
- Document average cost inventory booking; in doing so, include this example |
| 253 |
from yegle: |
| 254 |
|
| 255 |
"The average cost booking could also be useful in other scenarios. For example, |
| 256 |
when you buy gift card in various discounted price, redeem it to an account, and |
| 257 |
use it later. One can manually recalculate cost-basis like this: |
| 258 |
|
| 259 |
2016-04-15 open Assets:CC |
| 260 |
2016-04-15 open Assets:ITUNES |
| 261 |
2016-04-15 open Expenses:Movie |
| 262 |
|
| 263 |
2016-04-15 * "15% off giftcard" |
| 264 |
Assets:CC -85 USD |
| 265 |
Assets:ITUNES 100 GUSD {2016-04-15, 0.85 USD} |
| 266 |
|
| 267 |
2016-04-16 * "no discount" |
| 268 |
Assets:CC -50 USD |
| 269 |
Assets:ITUNES 50 GUSD {2016-04-16, 1 USD} |
| 270 |
|
| 271 |
2016-04-16 * "recalculate cost basis" |
| 272 |
Assets:ITUNES -50 GUSD {2016-04-16, 1 USD} @1 USD |
| 273 |
Assets:ITUNES -100 GUSD {2016-04-15, 0.85 USD} @0.85 USD |
| 274 |
Assets:ITUNES 150 GUSD {2016-04-16, 0.90 USD} |
| 275 |
|
| 276 |
2016-04-16 * "rent a movie" |
| 277 |
Assets:ITUNES -10 GUSD {2016-04-16, 0.90 USD} |
| 278 |
Expenses:Movie 10 GUSD {2016-04-16, 0.90 USD} |
| 279 |
|
| 280 |
(http://pastie.org/private/fxtirb6nhojyqmhuop9dfq) but it would be good |
| 281 |
to have beancount handle it for me. |
| 282 |
|
| 283 |
This is exactly what I do as well, and had similarly thought it would be a great |
| 284 |
secondary use for average cost booking. It would be good to document this |
| 285 |
somewhere. Perhaps Martin would like it in one of his documents or at Simon's |
| 286 |
plain text accounting site/" |
| 287 |
|
| 288 |
When I write the document on average cost basis, I'll add this example in. |
| 289 |
|
| 290 |
** Auto-Generated Doc |
| 291 |
|
| 292 |
- Integrate submitted work on auto-generating Beancount docs in the Beancount |
| 293 |
source code itself. |
| 294 |
|
| 295 |
- Create a registry of all metadata fields being used in the system, with |
| 296 |
documentation for each, so that it does not end up becoming a mess. |
| 297 |
|
| 298 |
- Create a registry of valid experiment flags. These should be documented in a |
| 299 |
single place as well. This is all easy. How to list the available ones |
| 300 |
(bean-doctor should be able to do this from the registry). |
| 301 |
|
| 302 |
|
| 303 |
** Presentation |
| 304 |
|
| 305 |
I'd should build another couple of presentations on Beancount. I'm thinking of |
| 306 |
making a few videos this time around, something that would be situational and |
| 307 |
educational. |
| 308 |
|
| 309 |
- Use impress.js to built a visualization of the DE method |
| 310 |
|
| 311 |
- Use photos of white board instead of Slides, use post its, maybe a chalk |
| 312 |
board. Do something original. |
| 313 |
|
| 314 |
- Record a video, that's an easy way to explain how this works. |
| 315 |
|
| 316 |
- IDEA!!! Use drawings a-la-ThinkBig or whatever it is. This will be the |
| 317 |
perfect medium for this. Mix it with video. Start writing a detailed script. |
| 318 |
|
| 319 |
- Script 1: Begin with a USB key in hand. "On this 8 GB USB key, I have all of |
| 320 |
8 years history of financial transactions in my life. Every single price |
| 321 |
paid that went recorded into an account it these." |
| 322 |
|
| 323 |
- Script 2: Motivate by speaking of the results, ask "Wouldn't it be great if |
| 324 |
a single system could do all of that?" Explain that the task of inputting |
| 325 |
all the data in a single system is a lot less work than producing all the |
| 326 |
different reports IF you have a unified system. Beancount! |
| 327 |
|
| 328 |
- Slide: 4 methods: bean-web, bean-report, bean-query, write script + plugin |
| 329 |
|
| 330 |
** Padding Documentation Review |
| 331 |
|
| 332 |
Some users have found themselves very confused about the intended usage of the |
| 333 |
Pad directive. Its documentation should be reviewed and improved |
| 334 |
substantially. |
| 335 |
|
| 336 |
- Put this in the docs to explain "pad" |
| 337 |
|
| 338 |
> > Ok, restarted example, let's say you begin |
| 339 |
> > accounting in dec 2013, you'll have this: |
| 340 |
> > |
| 341 |
> > 2010-01-01 open |
| 342 |
> > 2010-01-01 pad |
| 343 |
> > 2013-12-04 balance |
| 344 |
> > 2013-12-08 * ... |
| 345 |
> > 2013-12-11 * ... |
| 346 |
> > 2013-12-17 * ... |
| 347 |
> > |
| 348 |
> > eventually, moving forward, you'll get to 2014: |
| 349 |
> > |
| 350 |
> > 2010-01-01 open |
| 351 |
> > 2010-01-01 pad |
| 352 |
> > 2013-12-04 balance |
| 353 |
> > 2013-12-08 * ... |
| 354 |
> > 2013-12-11 * ... |
| 355 |
> > 2013-12-17 * ... |
| 356 |
> > 2013-12-22 * ... |
| 357 |
> > 2013-12-29 * ... |
| 358 |
> > 2014-01-02 * ... |
| 359 |
> > 2014-12-04 balance |
| 360 |
> > 2014-12-06 * ... |
| 361 |
> > |
| 362 |
> > Allright, now you decide you like this, and you |
| 363 |
> > want to enter statements before you started. |
| 364 |
> > You find your paper statement for november, and |
| 365 |
> > fill in: |
| 366 |
> > |
| 367 |
> > 2010-01-01 open |
| 368 |
> > 2010-01-01 pad |
| 369 |
> > ; here you insert |
| 370 |
> > 2013-11-04 balance |
| 371 |
> > 2013-11-08 * ... |
| 372 |
> > 2013-11-18 * ... |
| 373 |
> > ... |
| 374 |
> > ; this is what was there previously |
| 375 |
> > 2013-12-04 balance |
| 376 |
> > 2013-12-08 * ... |
| 377 |
> > 2013-12-11 * ... |
| 378 |
> > 2013-12-17 * ... |
| 379 |
> > 2013-12-22 * ... |
| 380 |
> > 2013-12-29 * ... |
| 381 |
> > 2014-01-02 * ... |
| 382 |
> > 2014-12-04 balance |
| 383 |
> > 2014-12-06 * ... |
| 384 |
> > |
| 385 |
> > Great. Now, notice how the balance for |
| 386 |
> > 2013-11-04 is probably different than that of |
| 387 |
> > 2013-12-04. If instead of a pad directive you |
| 388 |
> > had added a manual adjustment, you'd have to |
| 389 |
> > change it here. This is the beauty of the pad |
| 390 |
> > directive: it automatically does it for you. |
| 391 |
> > |
| 392 |
> > Now, let's keep going backward in time. You dig |
| 393 |
> > around your records, you find September's |
| 394 |
> > statement, but you cannot find the statement |
| 395 |
> > for October, maybe it's lost, or somewhere |
| 396 |
> > else. Fine! You insert a pad directive to |
| 397 |
> > account for those missing transactions: |
| 398 |
> > |
| 399 |
> > 2010-01-01 open |
| 400 |
> > 2010-01-01 pad |
| 401 |
> > |
| 402 |
> > 2013-09-04 balance |
| 403 |
> > 2013-09-05 * ... |
| 404 |
> > ... september transactions |
| 405 |
> > 2013-09-30 * ... |
| 406 |
> > 2013-10-04 balance |
| 407 |
> > |
| 408 |
> > ; padding for missing October statement, |
| 409 |
> > where is my statement? |
| 410 |
> > 2013-10-04 pad |
| 411 |
> > 2013-11-04 balance |
| 412 |
> > |
| 413 |
> > ... november transactions |
| 414 |
> > 2013-11-08 * ... |
| 415 |
> > 2013-11-18 * ... |
| 416 |
> > ... |
| 417 |
> > 2013-12-04 balance |
| 418 |
> > |
| 419 |
> > 2013-12-08 * ... |
| 420 |
> > 2013-12-11 * ... |
| 421 |
> > 2013-12-17 * ... |
| 422 |
> > 2013-12-22 * ... |
| 423 |
> > 2013-12-29 * ... |
| 424 |
> > 2014-01-02 * ... |
| 425 |
> > 2014-12-04 balance |
| 426 |
> > |
| 427 |
> > 2014-12-06 * ... |
| 428 |
> > |
| 429 |
> > This is the full example. |
| 430 |
|
| 431 |
Improve this bit: |
| 432 |
|
| 433 |
> But the detailed explanation cannot be found. There's only one phrase: ?Think |
| 434 |
> of the Equity account as something from the past that you had to give up in |
| 435 |
> order to obtain the beginning snapshot of the Assets + Liabilities balance.? |
| 436 |
> |
| 437 |
> Great comment. I'll improve this. |
| 438 |
|
| 439 |
More user comments: |
| 440 |
|
| 441 |
> After doing my research, I found about debits and credits, which in Beancount |
| 442 |
> you represent with positive numbers and negative numbers respectively. I |
| 443 |
> found that having a name for each group of accounts helps me to think of them |
| 444 |
> at the same time, e.g. Liabilities+Equity+Income as part of a common thing, |
| 445 |
> instead of having to research each of it independently. |
| 446 |
> In the documentation you start speaking about numbers, then about signs, then |
| 447 |
> about grouping the accounts. Maybe it's better to go top-down and start |
| 448 |
> saying that there are two types of account (usually +, usually -) and then |
| 449 |
> divide each group further. |
| 450 |
> |
| 451 |
> I will change that, thanks for the comment. |
| 452 |
|
| 453 |
** Contributor agreement |
| 454 |
|
| 455 |
* See note at the bottom of: https://github.com/fourier/ztree |
| 456 |
|
| 457 |
Since ztree is a part of GNU ELPA, it is copyrighted by the Free Software |
| 458 |
Foundation, Inc.. Therefore in order to submit nontrivial changes (with total |
| 459 |
amount of lines > 15), one needs to to grant the right to include your works in |
| 460 |
GNU Emacs to the FSF. |
| 461 |
|
| 462 |
For this you need to complete this form, and send it to [email protected]. The FSF |
| 463 |
will send you the assignment contract that both you and the FSF will sign. |
| 464 |
|
| 465 |
For more information one can read here to understand why it is needed. |
| 466 |
|
| 467 |
As soon as the paperwork is done one can contribute to ztree with bigger pull |
| 468 |
requests. Note what pull requests without paperwork done will not be accepted, |
| 469 |
so please notify the maintainer if everything is in place. |
| 470 |
|
| 471 |
- Great example (from Camlistore project link): |
| 472 |
https://cla.developers.google.com/about/google-individual |
| 473 |
|
| 474 |
** Google Docs |
| 475 |
|
| 476 |
- Write a script to download and bake all my PDFs docs in a |
| 477 |
mobile-friendly format. |
| 478 |
|
| 479 |
- I'd like the documentation links to open in "View" mode by default, YET |
| 480 |
still allowing the user to switch to "Suggestion" mode if they want to. See |
| 481 |
project volteface to complete this, this does not have to be a part of |
| 482 |
Beancount, this should be its own presentation project. |
| 483 |
|
| 484 |
* Complete Display Precision Work |
| 485 |
|
| 486 |
Automatically determining the required number of fractional digits to render |
| 487 |
numbers with in reports can be surprisingly more complicated than it appears. |
| 488 |
Statistics on the numbers visible in the input file can be used to figure out |
| 489 |
good default values and options exist to override them. In addition, while |
| 490 |
some numbers should be rendered at their most common precision, other |
| 491 |
numbers--prices and rates--need to be rendered at a higher precision. |
| 492 |
Moreover, numbers rendered from an import tend to be produced with the minimal |
| 493 |
number of fractional digits but to render them nicely we should normalize that |
| 494 |
to the most common precision, while rendering more digits if they are present. |
| 495 |
|
| 496 |
For all the reasons above, at some point I built |
| 497 |
beancount.core.display_context, which provides an accumulator ("context") for |
| 498 |
statistics on precision and a formatter that can be passed around and used by |
| 499 |
the various rendering methods to produce sensible output. |
| 500 |
|
| 501 |
Tasks: |
| 502 |
|
| 503 |
- At the moment, the Formatter objects are defined to render a single |
| 504 |
precision for its numbers; this is problematic, because some of the |
| 505 |
to_string() routines of the core objects print out units, cost and price |
| 506 |
numbers at the same time. The Formattter object needs to be extended to |
| 507 |
support formatting all three. |
| 508 |
|
| 509 |
* Then, the core data structures should be reviewed for correct usage of |
| 510 |
this new, better formatter object. |
| 511 |
|
| 512 |
- When I implemented the display_context, I did not review the entire codebase |
| 513 |
for consistent usage. I'm a bit ashamed to admit that some of the code uses |
| 514 |
it, and some doesn't. It was a bit thorny to implement and after spending |
| 515 |
much time getting it to work right I did not finish converting all the |
| 516 |
existing code to it (I should have). In particular: |
| 517 |
|
| 518 |
* The reports code does not use it everywhere. Review all reports code for |
| 519 |
proper use of DisplayContext. |
| 520 |
|
| 521 |
* bean-web does not use it everywhere. Review all that code. |
| 522 |
|
| 523 |
* The rendering code used by bean-query has a DecimalRenderer object which |
| 524 |
uses its own method for determining the precision should clearly be |
| 525 |
converted to use the DisplayContext instead. |
| 526 |
|
| 527 |
- In beancount.ingest, in order to redner numbers pulled from imported data |
| 528 |
nicely for user review, I need to create a new rendering type of |
| 529 |
max(MAXIMUM, MOST_COMMON) for the DisplayFormatter. This type will always |
| 530 |
render at least the most common number of fractional digits but if required, |
| 531 |
render more fractional digits. I've found over time that this would be the |
| 532 |
most palatable rendering style to produce: learn the precision from the |
| 533 |
Beancount input file but render the full precision found in the imported |
| 534 |
files. |
| 535 |
|
| 536 |
- Make the printer support explicit tolerance syntax. This is crucial for |
| 537 |
round-trip. |
| 538 |
|
| 539 |
- Implement the maximum number of digits by accumulating the largest possible |
| 540 |
sum of all the ABSOLUTE values seen in the file. This should be a good basis |
| 541 |
for compute the maximum width possibly required to render with Align.RIGHT. |
| 542 |
There is currently a bug whereby that's not being computed correctly, the |
| 543 |
current algorithm is insufficient for accumulated balances, there is a |
| 544 |
bug. |
| 545 |
|
| 546 |
- Create a page in the web view that lists the various precision - by |
| 547 |
example - inferred in the global DisplayContext. |
| 548 |
|
| 549 |
- Make setting the precision from bean-example easier (provide a method to |
| 550 |
create that format and update without conversion on the DisplayContext |
| 551 |
itself). |
| 552 |
|
| 553 |
- In the DisplayContext, implement caching of the formatters created to |
| 554 |
increase speed, especially for printing a single entry repeatedly. |
| 555 |
|
| 556 |
- Implement reserved number of digits. |
| 557 |
|
| 558 |
- Add docstrings to DisplayContext. |
| 559 |
|
| 560 |
- In the EntryPrinter(), figure out the maximum width of accounts and set it up. |
| 561 |
- Add a "target num columns" instead of a "min_width_account" to the |
| 562 |
EntryPrinter and figure out the min_width_account automatically from it, |
| 563 |
depending on whether we've got render_weights on or not. Use the longest |
| 564 |
possible number of integral digits required from the DisplayContext in |
| 565 |
order to make this tight. |
| 566 |
|
| 567 |
- Add an option for the DisplayContext to issue a warning if numbers are |
| 568 |
rendered through it that lose some precision. |
| 569 |
|
| 570 |
- Add "display_precision" input file option whereby the user can set the |
| 571 |
precision to be used by each currency. |
| 572 |
|
| 573 |
- This needs to be handled properly, the last column needs to have correct |
| 574 |
precision rendering, using the DisplayContext: |
| 575 |
|
| 576 |
bean-query trans-pricing.beancount 'select account, sum(position), |
| 577 |
cost(sum(position)), convert(cost(sum(position)), "EUR") group by account' |
| 578 |
account sum_position cost_sum_posi convert_cost_sum_position_c_ |
| 579 |
----------------------- --------------------------- ------------- ---------------------------------- |
| 580 |
Assets:Investments:Cash -734.10 USD -734.10 USD -644.2864665613480779357556609 EUR |
| 581 |
Assets:Investments:HDV 10 HDV {73.41 USD} 734.10 USD 644.2864665613480779357556609 EUR |
| 582 |
|
| 583 |
- bean-doctor context does not render all digits... it should render all the |
| 584 |
numbers as represented in memory. Don't round those numbers. |
| 585 |
|
| 586 |
- Review all the reports code and convert it all to render using the |
| 587 |
DisplayContext, make the query output also use it, and review rendering |
| 588 |
precision for cost & prices and maybe find a self-contained solution for |
| 589 |
passing two separate formatters somehow. {review-dcontext} |
| 590 |
|
| 591 |
* Move Much of Core to Plugins |
| 592 |
|
| 593 |
Some of the functionality currently residing in the Beancount core could be |
| 594 |
moved to plugins. For example, processing directories for auto-creating |
| 595 |
document directives should not be part of the core (it's there for historical |
| 596 |
reasons: plugins did not exist at the time). I'd like to do that in order to |
| 597 |
simplify the Beancount core itself. |
| 598 |
|
| 599 |
** Document Directives |
| 600 |
|
| 601 |
Document directives should be moved to their own plugin and numerous |
| 602 |
improvements can be carried out on them. Their association with transactions |
| 603 |
as well as avoiding collisions when creating them autoamtically would all be |
| 604 |
improvements to them. |
| 605 |
|
| 606 |
- Move the document option which seeks document files from directives to a |
| 607 |
plugin. |
| 608 |
|
| 609 |
- IDEA: Create a plugin that will convert "doc:" metadata to a document file, |
| 610 |
that will search for a unique string name in all the filenames and |
| 611 |
associate the filename with this directive via a link or something. |
| 612 |
|
| 613 |
- Write a proposal for implementing a transformation on a specific set of |
| 614 |
transactions, that supports capital gains with commission taken into |
| 615 |
account. |
| 616 |
|
| 617 |
- Can we automatically add a ^LINK to the document directive in order to |
| 618 |
associate a PDF with a document?!? -> For trade tickets. Maybe let the |
| 619 |
modules provide a import_link() function on the associated PDF files? |
| 620 |
(This is related to ^64647f10b2fd) |
| 621 |
|
| 622 |
- Document directives created automatically from directories of files should |
| 623 |
ignore documents already associated via an explicit documents directive; |
| 624 |
just ignore files with the same absolute name. |
| 625 |
|
| 626 |
- Documents found in parent directories don't end up creating a directive |
| 627 |
because we skip them because we only restrict to accounts which have had an |
| 628 |
open declaration... this is probably not what we want, in order to maximize |
| 629 |
the number of documents captured by this. {fa96aa05361d} |
| 630 |
|
| 631 |
- Idea: A link between a transaction to a document can be created by |
| 632 |
associating a document's checksum as the link of the transaction instead of |
| 633 |
a unique filename. If Beancount could associate them - and it could, it has |
| 634 |
access to the document files and the corpus of transactions - the web |
| 635 |
interface could insert a special link between the two. Maybe we could do the |
| 636 |
same thing with the filename as well. |
| 637 |
|
| 638 |
- A better idea to do this would be to allow specifying an explicit document |
| 639 |
directive, and finding document directives from files that are already |
| 640 |
specified should not re-create them. This way you can specify both the |
| 641 |
document and a transaction and use a common link as a natural way to |
| 642 |
associate them, e.g.: |
| 643 |
|
| 644 |
2014-06-20 document Income:US:Employer:GSU "2014-06-20.employer.0000000.pdf" ^ee63c6fc7aa6 |
| 645 |
|
| 646 |
2014-06-20 * "PAYROLL" | "Refund for fractional shares" ^ee63c6fc7aa6 |
| 647 |
... |
| 648 |
... |
| 649 |
|
| 650 |
- Document finding from files should not create documents that have been |
| 651 |
explicitly specified in the ledger. Avoid duplication! This is an important |
| 652 |
fix to make, that will allow both to co-exist together. |
| 653 |
|
| 654 |
- Make document directive accept links, so that explicit documents could be |
| 655 |
associated with specific transactions. |
| 656 |
|
| 657 |
- Generalize the scope of Document directives so that they don't just point to |
| 658 |
filenames, but can hold references to arbitrary document ids. |
| 659 |
* Rename the field from 'filename' to 'document' |
| 660 |
* Make the verification of that field against a filename option, enabled by |
| 661 |
a plugin. |
| 662 |
* Notify bw3443 about this. |
| 663 |
|
| 664 |
- Do we need a dedicated web page for listing all documents? This page could |
| 665 |
include documents without a date, could be rendered as a tree-table, with |
| 666 |
the list of each document in the corresponding account. Maybe that's |
| 667 |
overkill. DK. |
| 668 |
|
| 669 |
*** Old Notes |
| 670 |
|
| 671 |
- You could define some special tags, like 'document', which could |
| 672 |
automatically try to find the corresponding document in the repository and |
| 673 |
insert a link to it in the web page. I already have a managed stash of |
| 674 |
document filenames... something like this: |
| 675 |
|
| 676 |
2014-05-20 * "Invoice from Autodesk" |
| 677 |
#document: 2014-05-20.autodesk.invoice200.pdf |
| 678 |
Income:US:Autodesk -3475.20 USD |
| 679 |
Assets:US:Checking |
| 680 |
|
| 681 |
A document filename that does not get resolved could spit out a warning in |
| 682 |
order to keep the file tidy. This is a nice idea... perhaps nicer than just |
| 683 |
insert entries for documents, an actual link. Not sure if it would make that |
| 684 |
much of a difference though. Something to ponder. |
| 685 |
|
| 686 |
Create a plugin that will convert "doc:" metadata to a document file, that |
| 687 |
will search for a unique string name in all the filenames and associate the |
| 688 |
filename with this directive via a link or something. |
| 689 |
|
| 690 |
** Balance Directives |
| 691 |
|
| 692 |
- Balance checks could also be a plugin. |
| 693 |
|
| 694 |
** Open/Close Directives |
| 695 |
|
| 696 |
- I think if you relax the assumptions about having Open and Close directives |
| 697 |
for all accounts, those could even be moved to a plugin. Without this |
| 698 |
'open_close' plugin, accounts would just get auto-created and no error |
| 699 |
output if they weren't. With the plugin, we would have current strict |
| 700 |
behavior. This means that non-plugin code that requires the full set of |
| 701 |
accounts from a list of entries would not be able to rely anymore on the |
| 702 |
presence of open entries, and so would the validation. |
| 703 |
|
| 704 |
** Pad Directives |
| 705 |
|
| 706 |
- Put all the Pad code into a single file as a plugin, same with Open Close, |
| 707 |
and Balance. Maybe we can organize those codes to be all localized in single |
| 708 |
files, and for many of these features, they can be implemented in |
| 709 |
self-contained plugins with all their codes together! openclose.py, pad.py, |
| 710 |
balance.py, etc. I think even 'event' directives can become those. And maybe |
| 711 |
a good way to disambiguate between ops adn plugins is just this... maybe ops |
| 712 |
is non-plugins, e.g. prices, summarize, etc. |
| 713 |
|
| 714 |
- Pad could be a plugin, definitely. |
| 715 |
|
| 716 |
- You could make the narrations for padding and summarization transactions |
| 717 |
specifiable via options. |
| 718 |
|
| 719 |
** Dynamic Directives / Configurable |
| 720 |
|
| 721 |
- (old notes) I recently teased out that many of the basic functions can be |
| 722 |
implemented as individual stages of transformations on the list of |
| 723 |
directives. This started out as a way to add plugins by adding a custom |
| 724 |
transformation stage, but now I see that if I can make the parser able to |
| 725 |
consume generic syntax that might allow extensions, and to allow these |
| 726 |
plugins to specify new directive types for extensions, I might be able to |
| 727 |
shove a *lot* of the existing functionality into nice isolated plugin |
| 728 |
modules. Even functionality as basic as Balance checks. I'm not going to to |
| 729 |
do this in the first release, but I want to set the stage for it. |
| 730 |
|
| 731 |
- Make the plugins able to register types with the parser... this should |
| 732 |
allow the parser to call back on the plugins to create the appropriate |
| 733 |
types... this means true extensibility throughout! This is a fantastic |
| 734 |
idea... do this after v2 ship. Maybe they get parsed as a special "Unknown" |
| 735 |
directive that accepts a grab-bag of strings and tags and accounts and |
| 736 |
amounts and they get replaced by the plugins; whatever Unknown trickles |
| 737 |
through would generate a warning in the errors. |
| 738 |
|
| 739 |
- It should be possible to make the parser accept unknown directives that |
| 740 |
accept an arbitrary list of accounts and string parameters, like this: |
| 741 |
|
| 742 |
2014-06-01 unknown Assets:US:CreditCard "Something" |
| 743 |
|
| 744 |
|
| 745 |
* Import (Ingest) |
| 746 |
|
| 747 |
In Q1 2016, I converted the entire LedgerHub codebase to a leaner, simpler and |
| 748 |
better set of code under beancount.ingest. I finished all the work to convert |
| 749 |
what was previously there and while I'm quite happy with it, my original ideas |
| 750 |
for what the import code could do went a bit beyond what it currently does. It |
| 751 |
involves a number of small but impactful improvements, such as adding an |
| 752 |
on-disk cache so that repeating slow conversions (e.g., from PDF) would not |
| 753 |
have to be repeated, or to carry out some default cleanup up common input |
| 754 |
files. I also want to add a good CSV importer, and maybe a QIF one. |
| 755 |
|
| 756 |
** CSV Importer |
| 757 |
|
| 758 |
- Separate the concern of the file format and table importers. This is a |
| 759 |
"table importer" which happens to have a CSV container. Similarly, XLSX |
| 760 |
containers are other table importers. Name things appropriately. |
| 761 |
|
| 762 |
- Create a good, default, useful, configurable importer for CSV files. |
| 763 |
|
| 764 |
- Write a CSV file sniffer that automatically infers which columns should |
| 765 |
match which fields. Try to make this smart, e.g., if some column "mostly" |
| 766 |
increases, it would be the balance column. This should be for fun (I don't |
| 767 |
need it). |
| 768 |
|
| 769 |
- Use new CSV downloads to build the importer; start using it. |
| 770 |
|
| 771 |
- The sniffer should support column types: |
| 772 |
|
| 773 |
* Date |
| 774 |
* Description |
| 775 |
* Change |
| 776 |
* Credit |
| 777 |
* Debit |
| 778 |
* Balance |
| 779 |
|
| 780 |
And should tolerance some cross-checking of the balance against the amounts. |
| 781 |
|
| 782 |
** Solve Slowness Problems on Mac |
| 783 |
|
| 784 |
- Trying to bean-extract from LC on Mac takes FOREVER. Debug this thing |
| 785 |
damnit. |
| 786 |
|
| 787 |
- Implement on-disk cache now. |
| 788 |
|
| 789 |
- Implement logging of time take by each importer (verbose switch). In |
| 790 |
find_imports(). Do nice logging. |
| 791 |
|
| 792 |
- Fix ugly importer names from my configuration. |
| 793 |
- Uniformize all directory names from my configuration. |
| 794 |
|
| 795 |
** Auto-Insert |
| 796 |
|
| 797 |
- AWESOME IDEA: Write a script that, given an input file with various sets of |
| 798 |
transactions, will find sections with most similar transactions in a |
| 799 |
destination file (the main file) and automatically insert those transactions |
| 800 |
in the destination file in the right place and run a diff with it. This |
| 801 |
should be part of the import suite. Do this as a post-process to import! |
| 802 |
Maybe use org-mode or other separators as a way to segregate groups of |
| 803 |
transactions. |
| 804 |
|
| 805 |
** Regression Testing Improvements |
| 806 |
|
| 807 |
- Make example and real importers into properly named modules, not package |
| 808 |
__init__.py files and move tests to their own _test.py files, as per usual. |
| 809 |
|
| 810 |
- Improve the regression testing utility function: Allow the _test files to |
| 811 |
source outside of the same directory, but keep it easy to do so as well. |
| 812 |
Some people may want to share their importers yet test on real data too. |
| 813 |
This should be well supported. (For 'beansoup'.) |
| 814 |
|
| 815 |
** Future Features |
| 816 |
|
| 817 |
- When multiple files match (as is the case for the A:CA:R importer) make |
| 818 |
file_one_file() put a copy of the file in each place instead of issuing an |
| 819 |
"Ambiguous accounts from many importers" warning. |
| 820 |
|
| 821 |
- Make beancount.ingest.importers.regexp.RegexpImporterMixin accept a |
| 822 |
"convert" optional argument that would be called by its get_text() method, |
| 823 |
and would allow us not to have to derive in order to support non-text files. |
| 824 |
|
| 825 |
- Implement formatting that's "minimum most-common" and use it on the |
| 826 |
importer's output, it would really improve the output of it, which is |
| 827 |
currently literal, e.g., it just prints what's from the file, at that |
| 828 |
precision. I hate correcting those manually. |
| 829 |
|
| 830 |
- In identify, mark as ambiguous if two handlers match. |
| 831 |
|
| 832 |
- Run directories check on each run of file? Disable with an option. |
| 833 |
|
| 834 |
- Make sure that when an exptest fails it includes the filename of the test |
| 835 |
somewhere in there; it's annoying when it's not present there. |
| 836 |
|
| 837 |
- Printing transactions should use the maximum precision between display |
| 838 |
context and natural. Create a new DisplayContext style, on top of "COMMON" |
| 839 |
and "MAXIMUM", call it something else, perhaps "COMPLETE". Should be max of |
| 840 |
context and natural. |
| 841 |
|
| 842 |
- Implement on-disk caching for conversions. This is important--it's quite |
| 843 |
frustrating to wait a few times too many. Do this now. |
| 844 |
|
| 845 |
- The code that auto-files statements needs to detect and de-dup files which |
| 846 |
have the same contents, because it is likely some files will be downloaded |
| 847 |
twice, it happens a lot. |
| 848 |
|
| 849 |
- When payee == narration, remove one of the two. This should be a generic and |
| 850 |
simple enough check to apply. This is a common occurrence. |
| 851 |
|
| 852 |
- There should be an automatic check that the accounts output by the |
| 853 |
extraction are all valid Beancount/Ledger account names. |
| 854 |
|
| 855 |
- Duplicate entries should cover all directive types (for balances). |
| 856 |
|
| 857 |
- Also, similarly, if one is entirely contained in the other, as happens often |
| 858 |
in OFX files, remove one. For example, here's what some OFX imports may |
| 859 |
look like with the current OFX importer: |
| 860 |
|
| 861 |
"DDA WITHDRAW MG21 MTL QC A / DDA WITHDRAW MG21 MTL QC ABM OPS MTL ABM O MONTREAL C AN" |
| 862 |
|
| 863 |
- Validation of directories (aka bean-doctor directories) should be |
| 864 |
automatically invoked by bean-file, and that would make sense. |
| 865 |
|
| 866 |
- Implement some hook to provide your own auto-categorization. |
| 867 |
- Provide some module that will attempt to categorize automatically, that can |
| 868 |
be inserted into this auto-categorization hook. |
| 869 |
|
| 870 |
- It would be super awesome if you could automate away the insertion of new |
| 871 |
transactions in the input file, following the previous transactions... |
| 872 |
we can find a heuristic to do this. That would be _really_ cool. |
| 873 |
|
| 874 |
- We will want to somehow "normalize" and merge payee names, because some of |
| 875 |
that differ very little are obvious for the same business... this would be |
| 876 |
useful. What kinds of tools will we need for that? |
| 877 |
|
| 878 |
Clean Import: The new importers should be able to strip the non-payee parts |
| 879 |
of the payee name, e.g. NEW YO, SAN FR, etc. Maybe we could let the user |
| 880 |
provide a filter function to sanitize the names of the payees, or maybe more |
| 881 |
generally just a filter on the entries before printing them out. This way |
| 882 |
you could provide your very own custom filter function that cleans up |
| 883 |
anything you don't like. |
| 884 |
|
| 885 |
- Importer should warn when not all the sections within have importers for it |
| 886 |
(R. OFX has many sections and one of the sections I needed - credit line - |
| 887 |
was missing in my importer config, so I discovered this). If we do this, |
| 888 |
this means that we may want to provide a "no-op" importer in order to |
| 889 |
silence that warning in case that's what's desired. |
| 890 |
|
| 891 |
- Write a generic import routine that will try to heuristically match |
| 892 |
partially completed transactions from an existing Ledger. Use some NLP or |
| 893 |
somesuch matching algorithm. |
| 894 |
|
| 895 |
Given some incomplete transactions, complete them heuristically based on |
| 896 |
previous contents of the ledger. This should make import a lot easier. This |
| 897 |
should be generic and work across all importers, a single function call. |
| 898 |
|
| 899 |
- Provide the previous ledger as input to extract(), some people may want to |
| 900 |
do per-account matching. See Filippo's request on this, whereby he wants to |
| 901 |
use the previous ledger's list of accounts to configure his importers. I |
| 902 |
suggested he load the previous file explicitly (taking advantage of the |
| 903 |
cache) in his configuration for now, but this is something I may want to |
| 904 |
revisit in the future. |
| 905 |
|
| 906 |
- In ingest, use /usr/bin/strings as a last resort if all other PDF converters |
| 907 |
fail. |
| 908 |
|
| 909 |
- When we import, if a file was not detected, don't spit out an org text |
| 910 |
line. Still doesn't work. |
| 911 |
|
| 912 |
- Deal with the problem of matching Google Wallet amounts directly... attempt |
| 913 |
to match a matching directive in the other account, and insert a link into |
| 914 |
the imported one. |
| 915 |
|
| 916 |
- Because one downloads all files manually, oftentimes the same file is |
| 917 |
downloaded twice. This should be detected and the duplicated identical file |
| 918 |
should be ignored entirely. |
| 919 |
|
| 920 |
- Transactions within the set of newly imported ones should never duplicate |
| 921 |
each other. Right now they do (see Transactions-Download-07-14-2016.csv). |
| 922 |
|
| 923 |
- It would be useful in many circumstances to rename the files but not to move |
| 924 |
them to their destination directory. For example, I'd rename the files and |
| 925 |
look at the filenames when processing PDFs manually to figure out what |
| 926 |
they're for. |
| 927 |
|
| 928 |
- A very interesting idea is for the CSV importers to cache already imported |
| 929 |
entries in a separate file, e.g., one signature for each row, and to use |
| 930 |
that to avoid double-importing. OTOH, it creates a potential problem whereby |
| 931 |
the result of an extraction is not stored in the Beancount input file and so |
| 932 |
further extractions ignore unseen transactions. An idea that is better than |
| 933 |
both of these would be to create a unique link made up of a short checksum |
| 934 |
for the import row and to cross-check this special link when considering the |
| 935 |
duplication, e.g. ^import-signature-c21c0fc8fe13 or something like that. |
| 936 |
That would work. |
| 937 |
|
| 938 |
** GnuCash |
| 939 |
|
| 940 |
- Write a converter of GnuCash XML files into Beancount. |
| 941 |
|
| 942 |
- Contact xentac@ for an example GnuCash input file with 2-3 years of data. |
| 943 |
Willing to share (see email). |
| 944 |
|
| 945 |
|
| 946 |
** Betterment |
| 947 |
|
| 948 |
- Process xentac's Betterment example PDF for the booking branch, that would |
| 949 |
be great input for a PDF converter, and figure out which lot identification |
| 950 |
method Betterment uses for tax-loss harvesting and rebalancing. |
| 951 |
|
| 952 |
|
| 953 |
* Make Commodity Directives Required |
| 954 |
{commodity-required} |
| 955 |
|
| 956 |
Zhuoyun Wei made a comment on a doc that account names are required to be |
| 957 |
declared by default while commodities don't. However, at this point they both |
| 958 |
have dedicated directives to declare them. Commodity directives are so far |
| 959 |
only used to hang metadata off of them. He suggests that Commodity directives |
| 960 |
should be required to be present by default. It would make the behavior |
| 961 |
similar as that of accounts. It would be more pedantic by default. Instead of |
| 962 |
a check_commodity plugin I could provide an auto_commodity plugin similar to |
| 963 |
auto_accounts, so you could use that in order to not bother. The stream of |
| 964 |
transactions would assured to always contain a Commodity directive if one |
| 965 |
appears, like for accounts. |
| 966 |
|
| 967 |
https://groups.google.com/d/msg/beancount/RHaV16bXlJs/Gyy5plujFgAJ |
| 968 |
|
| 969 |
- Do this. |
| 970 |
|
| 971 |
- OLD DESCRIPTION: options['commodities'] is currently where the list of all |
| 972 |
commodities seen from the parser lives. The |
| 973 |
beancount.core.getters.get_commodities_map() routine uses this to |
| 974 |
automatically generate a full list of directives. An alternative would be to |
| 975 |
implement a plugin that enforces the generation of these post-parsing so |
| 976 |
that they are always guaranteed to live within the flow of entries. This |
| 977 |
would allow us to keep all the data in that list of entries and to avoid |
| 978 |
depending on the options to store that output. |
| 979 |
|
| 980 |
This should probably be combined with a similar step that similarly |
| 981 |
enforces all unopened accounts to have an Open directive as well. |
| 982 |
|
| 983 |
- Make the onecommodity plugin skip accounts with multiple declared |
| 984 |
commodities. It should apply only to accounts which have no declared |
| 985 |
commodities. Then turn it on in my own file. |
| 986 |
|
| 987 |
|
| 988 |
* Booking |
| 989 |
|
| 990 |
The 'booking' branch is one of the biggest branches ongoing in Beancount: it |
| 991 |
implements the proposal at http://furius.ca/beancount/doc/proposal-booking. It |
| 992 |
essentially consists in three big changes: (1) it allows a lot more |
| 993 |
opportunities for interpolating missing input, and (2) it changes in how lots |
| 994 |
are applied to inventories. Input specified in reducing lots will be |
| 995 |
interpreted as a partial match specification against the inventory of the |
| 996 |
corresponding accounts. This should allow users to provide the minimal amount |
| 997 |
of information and produce a specific lot. Augmenting lots always inherit the |
| 998 |
date of their transaction which will allow us to report on trades correctly, |
| 999 |
including automatically determining short vs. long-term holding periods, and |
| 1000 |
finally (3) it introduces syntax to automatically merge lots together in order |
| 1001 |
to deal with average cost booking. These changes will also allow aumatically |
| 1002 |
resolution of ambiguous lots which will invoke a particular method chosen by |
| 1003 |
the user, e.g. FIFO booking. |
| 1004 |
|
| 1005 |
In order to carry on during the tax season for TY2015, I implemented a kludge |
| 1006 |
in the "carry_date_and_book_cost" branch. This will get removed. |
| 1007 |
|
| 1008 |
Tasks: |
| 1009 |
|
| 1010 |
- In the average cost method, add an option to determine whether explicit lot |
| 1011 |
information should just be lost silently or if it should trigger an explicit |
| 1012 |
error. |
| 1013 |
|
| 1014 |
- When lots are merged in AVERAGE booking, decide whether to keep the older or |
| 1015 |
youngest lot using an option (add an option for this). |
| 1016 |
|
| 1017 |
- Make the "reduction_method" (rename from "booking_method") per-account and |
| 1018 |
support the old method in the new code, as "FIFO". It really just is FIFO |
| 1019 |
but now there will be lot splits instead of single lots being merged; this |
| 1020 |
should work. Or you could call it "PRICEONLY". |
| 1021 |
|
| 1022 |
* Provide a global option "reduction_method" for its default value across |
| 1023 |
all accounts. Set the default to "PRICEONLY" so that no changes occur by |
| 1024 |
default. |
| 1025 |
|
| 1026 |
* Dispatch the new 'full' booking method to reduction_method "STRICT". |
| 1027 |
|
| 1028 |
* Support "NONE" and "AVCO" after that. |
| 1029 |
|
| 1030 |
* "AVDO" should be able to work even without the star marker. |
| 1031 |
|
| 1032 |
- Remove the horrible CARRY_DATE_AND_BOOK_COST kludge; do this by finishing |
| 1033 |
the 'booking' branch and making the lots conform exactly to those present in |
| 1034 |
the inventory balance, so that the inventory booking can proceed by |
| 1035 |
comparing the entire cost object precisely... |
| 1036 |
|
| 1037 |
- Complete testing incomplete output with CostSpec: |
| 1038 |
|
| 1039 |
- This causes a problem because a tag is parsed in '#9.95': |
| 1040 |
10 AAPL {45.23#9.95 USD} |
| 1041 |
|
| 1042 |
- Make sure parsing {3.00 # USD} does not produce the same CostSpec as {3.00 USD}. |
| 1043 |
|
| 1044 |
- Remove OLD comments from parser.py and update the description to use the |
| 1045 |
xposition class. |
| 1046 |
|
| 1047 |
- Remove the beancount.ops.documents plugin, or perhaps make the loader |
| 1048 |
operate in a raw mode, e.g. not running any plugins. |
| 1049 |
|
| 1050 |
egrep --include='*.py' -srn 'parse_(string|file)' /home/blais/p/beancount/src/python/beancount |
| 1051 |
|
| 1052 |
- Write test for beancount.parser.booking_full. |
| 1053 |
|
| 1054 |
- Merge beancount.core.interpolate into booking. |
| 1055 |
- Merge beancount.ops.validation.validate_inventory_booking() into booking. |
| 1056 |
|
| 1057 |
- This causes a problem because a tag is parsed in '#9.95': |
| 1058 |
10 AAPL {45.23#9.95 USD} |
| 1059 |
|
| 1060 |
- (Annoyance) Make interpolation.balance_incomplete_postings() return a new |
| 1061 |
object and not work destructively. No reason not to. |
| 1062 |
|
| 1063 |
- (Annoyance) All functions that return an (entries, errors, options_map) |
| 1064 |
triple really should return (entries, options_map, errors), in this order. |
| 1065 |
|
| 1066 |
- Improve the ability to detect a user-specific tolerance in |
| 1067 |
is_tolerance_user_specified(). This heuristic is not great, find some better |
| 1068 |
way. |
| 1069 |
|
| 1070 |
- Create a b.c.data.transactions_only() function to this common type of |
| 1071 |
filtering and grep/replace everywhere. This is just too common not to create |
| 1072 |
a utility. |
| 1073 |
|
| 1074 |
- Unref the constants in finalizer for module, here: {48414425cf78}. |
| 1075 |
|
| 1076 |
- Write a test to ensure that an auto-posting with no effect results in no |
| 1077 |
new posting getting inserted. |
| 1078 |
|
| 1079 |
- Implement an optional feature that disables the merging of inventory lots |
| 1080 |
for all lots except lots without cost. In other words, if there's a cost |
| 1081 |
object, don't even compare them or try to merge them together; only lots |
| 1082 |
without cost would automatically merge. |
| 1083 |
|
| 1084 |
I believe that this probably wouldn't cause any problems in selecting |
| 1085 |
reducing lots and could simplify the "rules" for how inventory booking |
| 1086 |
works. I'd want to test it out on my real file before committing to the |
| 1087 |
idea. Removing merging of lots-at-cost would make the merging logic simpler |
| 1088 |
and easier to understand. |
| 1089 |
|
| 1090 |
But what about something like this? Do we want multiple lots here? |
| 1091 |
|
| 1092 |
2005-12-29 * "Dividend on NB550" |
| 1093 |
Assets:CA:RRSP:NB550 1.340 NB550 {18.2348 CAD} |
| 1094 |
Assets:CA:RRSP:NB550 28.646 NB550 {18.2348 CAD} |
| 1095 |
Income:CA:RRSP:Dividends |
| 1096 |
|
| 1097 |
- Test a conversion of shares with lot-date, e.g.: |
| 1098 |
|
| 1099 |
2000-01-18 * Buy CRA |
| 1100 |
Assets:CA:RBC-Investing:Taxable-CAD:CRA 4 "CRA1" {232.00 USD / 2000-01-18} |
| 1101 |
Assets:CA:RBC-Investing:Taxable-CAD -1395.43 CAD @ 0.665027984206 USD ; cost |
| 1102 |
|
| 1103 |
2000-02-22 * CRA Stock Split 2:1 |
| 1104 |
Assets:CA:RBC-Investing:Taxable-CAD:CRA -4 "CRA1" {232.00 USD / 2000-01-18} |
| 1105 |
Assets:CA:RBC-Investing:Taxable-CAD:CRA 8 CRA {116.00 USD / 2000-01-18} |
| 1106 |
|
| 1107 |
- Create a command in bean-doctor which lists all of the lots and their |
| 1108 |
changes for a particular account. This is meant to be a debugging tool for |
| 1109 |
booking algorithms. The rendering should be clear and detailed. |
| 1110 |
|
| 1111 |
- TEST CASE: When a label is provided on a lot, make sure that the label is |
| 1112 |
unique throughout the entire file, not just on the inventory the lot is |
| 1113 |
being inserted into. |
| 1114 |
|
| 1115 |
- Rename beancount.core.interpolate to beancount.core.tolerances |
| 1116 |
|
| 1117 |
- An important question: on an empty inventory, does the following transaction |
| 1118 |
work? |
| 1119 |
|
| 1120 |
2016-04-23 * "Buy and sell on the same transaction" |
| 1121 |
Assets:Investments:HOOL 1 HOOL {100.00 USD} |
| 1122 |
Assets:Investments:HOOL -1 HOOL {} |
| 1123 |
|
| 1124 |
One way to handle this would be to process all account augmentations before |
| 1125 |
reductions. But that's not really possible, because the augmentation may |
| 1126 |
require interpolation first. Hmmm. Difficult question. {f89b5b01e568} |
| 1127 |
|
| 1128 |
[This is being handled in the "booking" branch.] |
| 1129 |
|
| 1130 |
- Add an option "merge_lots" whose default value is TRUE, and which can be set |
| 1131 |
to FALSE in order to avoid merging augmenting lots in the Inventory. It this |
| 1132 |
is false, there's the possibillity of an inventory owning two lots which |
| 1133 |
cannot be differentiated, and the only way for the user out of that |
| 1134 |
situation would be to insert unique labels (indicate this somehow). Write |
| 1135 |
unit tests for this. And try running it over my personal file to see if |
| 1136 |
there's any instance of it ever happening (I don't think so). |
| 1137 |
|
| 1138 |
- Consider building a fromstring() constructor for Cost and CostSpec. This may |
| 1139 |
make writing tests even easier and would complement what's there already. |
| 1140 |
|
| 1141 |
- Deal with all the FIXME cases in the new booking code. |
| 1142 |
|
| 1143 |
- Does the Inventory object require changes to make sure the dates are always |
| 1144 |
set? Would that not make sense? |
| 1145 |
|
| 1146 |
- Write scripts to compare with the new and old method, on my own large file: |
| 1147 |
|
| 1148 |
1. Compare balances at random points in time (many of them) |
| 1149 |
2. Compare transactions one-to-one. |
| 1150 |
|
| 1151 |
- There's a fair bit of sign change in the new booking code. Do test the case |
| 1152 |
of negative inventories! |
| 1153 |
|
| 1154 |
** Auto-Link Booking Transactions |
| 1155 |
|
| 1156 |
- Automatically create a link between transactions that book each other. |
| 1157 |
I'm not sure how I'm going to implement that - perhaps in the lot matching, |
| 1158 |
a hash to the original entry will be kept in the lot - but we should be |
| 1159 |
able to update the links to all the transactions that book together. |
| 1160 |
|
| 1161 |
This will be a great debugging tool as well... a very powerful idea that |
| 1162 |
can be implemented entirely in a plug-in. |
| 1163 |
|
| 1164 |
** Original Idea for this Branch |
| 1165 |
|
| 1166 |
- Lot improvement: the lot specification on a reducing posting is only present |
| 1167 |
to disambiguate which of the lots to reduce or match against. Maybe we |
| 1168 |
should provide a different syntax when an expected reduction takes place, |
| 1169 |
this would be allowed: |
| 1170 |
|
| 1171 |
(augment) |
| 1172 |
2014-06-17 * |
| 1173 |
Assets:US:Investing:HOOL 10 HOOL {523.45 USD / i-want-more} |
| 1174 |
|
| 1175 |
(reducing) All of the following should be allowed: |
| 1176 |
Assets:US:Investing:HOOL -7 HOOL ; possibly ambiguous |
| 1177 |
Assets:US:Investing:HOOL -7 HOOL [] ; possibly ambiguous |
| 1178 |
Assets:US:Investing:HOOL -7 HOOL [523.45 USD] |
| 1179 |
Assets:US:Investing:HOOL -7 HOOL [2014-06-17] |
| 1180 |
Assets:US:Investing:HOOL -7 HOOL [i-want-more] |
| 1181 |
|
| 1182 |
By enforcing a distinct syntax, the user is telling us that this leg is |
| 1183 |
expected to reduce an existing position. This information is useful, in |
| 1184 |
that it avoids possible mistakes. I like the explicitness of it. |
| 1185 |
|
| 1186 |
Sufficient debugging output should be provided from the "print" command to |
| 1187 |
be able to identify which lot is being matched against and why. We need to |
| 1188 |
provide more transparency into this. |
| 1189 |
|
| 1190 |
- FIFO or LIFO booking could be "enforced" simply by declaring the expected |
| 1191 |
booking method of an account, and then issuing an error when explicit |
| 1192 |
entries deviate from that method. This is an easy idea... would be very |
| 1193 |
useful. The automatic method would only be used to resolve ambiguity! This |
| 1194 |
is nice. |
| 1195 |
|
| 1196 |
** Old Notes |
| 1197 |
|
| 1198 |
- Make a temporary hack to disable strict checks on a per-account basis. This |
| 1199 |
will keep us going against average cost until the full inventory proposal |
| 1200 |
is implemented. |
| 1201 |
|
| 1202 |
"The inventory booking proposal for average booking won't be implemented in |
| 1203 |
the next few weeks... I'm tempted to think that maybe I should provide a way |
| 1204 |
to disable the strict balance checks in the interim. This way we could enter |
| 1205 |
the transactions without matching lots strictly... at least all the data |
| 1206 |
would be present and the balance checks would work. Would people think it's |
| 1207 |
a good idea? I would do this by extending the default value for the type of |
| 1208 |
booking is intended to take place (as in the inventory proposal) and add a |
| 1209 |
new value for it, i.e,. in addition to STRICT, FIFO, LIFO, AVERAGE, |
| 1210 |
AVERAGE_ONLY, I would add NONE. I would use the proposed syntax extension for |
| 1211 |
the Open directive, e.g. |
| 1212 |
|
| 1213 |
2014-08-84 open Assets:US:Vanguard:VIIPX VIIPX "NONE" |
| 1214 |
|
| 1215 |
This also means that you could setup all your accounts to remove all inventory |
| 1216 |
booking, which results in a booking method similar to Ledger (no checks and no |
| 1217 |
errors), by setting the default value for it, like this: |
| 1218 |
|
| 1219 |
option "booking_method" "NONE" |
| 1220 |
|
| 1221 |
This could appeal to those who would like less checks, like Ledger, or who are |
| 1222 |
converting their Ledger ledgers to Beancount. |
| 1223 |
|
| 1224 |
Down the road, the inventory booking would use that and implement all methods, |
| 1225 |
but for now, only the balance check would consult that value and disable the |
| 1226 |
check if the default booking method is "NONE". I think I could easily hack that |
| 1227 |
in a few hours." |
| 1228 |
|
| 1229 |
|
| 1230 |
|
| 1231 |
- Implement the proposal |
| 1232 |
|
| 1233 |
|
| 1234 |
- (design) New inventory booking: |
| 1235 |
1. for each posting, classify by currency |
| 1236 |
2. for each posting at cost, classify whether position augmentation or reduction |
| 1237 |
3. For position reductions, match against inventory |
| 1238 |
4. Within currency groups, process interpolation, including those in |
| 1239 |
position augmentations |
| 1240 |
|
| 1241 |
It should be possible to do something like this for cost basis adjustments: |
| 1242 |
Assets:Account -10 MSFT {34 USD} |
| 1243 |
Assets:Account 10 MSFT {USD} |
| 1244 |
Income:PnL 400 USD |
| 1245 |
|
| 1246 |
(See doc on Smarter Elision for a better version of this) |
| 1247 |
|
| 1248 |
|
| 1249 |
|
| 1250 |
- Separate inventory booking to be implemented in a plugin. It should do |
| 1251 |
three things: |
| 1252 |
|
| 1253 |
* Find matching lots and raise errors when not found |
| 1254 |
|
| 1255 |
* replace all partially specified lots to their fully specified versions |
| 1256 |
(they matched lots). For augmenting lots, this means insert the date. For |
| 1257 |
lot reductions, it means, find the matching lot and use that instead of |
| 1258 |
the partially specified one. |
| 1259 |
|
| 1260 |
* Insert links on matching lots, so that trades can be identified a |
| 1261 |
posteriori. |
| 1262 |
|
| 1263 |
This means, move beancount.ops.validation.validate_inventory_booking() to |
| 1264 |
its own file and make it do the three steps above. |
| 1265 |
|
| 1266 |
|
| 1267 |
|
| 1268 |
(avg cost idea) |
| 1269 |
|
| 1270 |
- Docs for inventory booking: Add {* 634.23 USD} idea for average cost |
| 1271 |
booking: there should be an optional amount, and the star just means "before |
| 1272 |
and after". Add this to B docs. |
| 1273 |
|
| 1274 |
- PROBLEM: You need be able to provide the cost with both and addition and a |
| 1275 |
reduction, e.g. |
| 1276 |
-2 HOOL {* 650 USD} ;; Should be possible even if current avg cost if 600 USD |
| 1277 |
2 HOOL {* 650 USD} ;; Means "add at this cost and then convert to avg |
| 1278 |
cost" |
| 1279 |
|
| 1280 |
This is nice! The "*" now always means "after applying this operation, |
| 1281 |
convert to avg cost.". |
| 1282 |
|
| 1283 |
|
| 1284 |
|
| 1285 |
- You should add tests to ensure that an Inventory() can never have positions |
| 1286 |
created with a cost of the same cost_currency as the currency. This should |
| 1287 |
be enforced in the Position object itself. |
| 1288 |
|
| 1289 |
- After it's done, merge back branch 'sanscost', and we should be able to |
| 1290 |
make this work using the total cost value on the lots. |
| 1291 |
|
| 1292 |
|
| 1293 |
|
| 1294 |
- Implement a report of Trades booked in the list of filtered transactions! |
| 1295 |
Trades should be automatically identified by the booking process, with |
| 1296 |
its own namespace of links. Then allow producing suitable reports for trades. |
| 1297 |
|
| 1298 |
- (reports) Bring back the trades report into the mainline version, using |
| 1299 |
inventory reductions. |
| 1300 |
|
| 1301 |
- (reports) We really do need to report on position reduction as TRADES. This |
| 1302 |
is an important report to generate! This should be done separately from the |
| 1303 |
improved inventory booking method. |
| 1304 |
|
| 1305 |
This report needs to include the long-term vs. short-term nature of those |
| 1306 |
trades! The right way to do this is to run a separate plug-in that will |
| 1307 |
add appropriate #long-term and #short-term tags or meta-data to those |
| 1308 |
transactions, based on their booking dates.. |
| 1309 |
|
| 1310 |
|
| 1311 |
- Add the acquisition date to each lot, so that short/long-term can be |
| 1312 |
calculated for the lot. The goal is to enable the automatic calculation and |
| 1313 |
reporting of long vs. short capital gains. |
| 1314 |
|
| 1315 |
|
| 1316 |
** Notes Copied from Full Booking Code |
| 1317 |
|
| 1318 |
- Testing: |
| 1319 |
|
| 1320 |
* FIXME: Come up with cases where we're able to infer an AUGMENTING leg |
| 1321 |
|
| 1322 |
* FIXME: Come up with a case that would be ambiguous if not for the fact |
| 1323 |
that one of the currencies already balances. |
| 1324 |
|
| 1325 |
|
| 1326 |
# You should be able to support inference of prices as per the sellgains plugin. |
| 1327 |
# Or should we instead have the sellgains plugin automatically insert the prices itself? |
| 1328 |
# (I like that better). |
| 1329 |
|
| 1330 |
# FIXME: When the other amounts balance, this should be doable. |
| 1331 |
# In this example, the first three postings in CAD balance each other. |
| 1332 |
# the 4th posting is USD and not completely balanced, and the last is |
| 1333 |
# unknown. We should look at the two groups of CAD and USD postings, |
| 1334 |
# realize that the first group is already balanced and that the second |
| 1335 |
# isn't, and automatically select the USD group. |
| 1336 |
""" |
| 1337 |
2010-05-28 * |
| 1338 |
Assets:Account1 100.00 CAD |
| 1339 |
Assets:Account2 -80.00 CAD |
| 1340 |
Assets:Account3 -20.00 CAD |
| 1341 |
Assets:Account4 20.00 USD |
| 1342 |
Assets:Account4 -100.00 CAD @ |
| 1343 |
""" |
| 1344 |
|
| 1345 |
|
| 1346 |
# FIXME: If there is only a single other group, we should be able infer the |
| 1347 |
# price is for CAD here. Currently this raises an error. |
| 1348 |
""" |
| 1349 |
2010-05-28 * |
| 1350 |
Assets:Account1 100.00 USD @ 1.2 |
| 1351 |
Assets:Account2 120.00 CAD |
| 1352 |
""" |
| 1353 |
|
| 1354 |
|
| 1355 |
- TODO: Conversion from CostSpec to Cost |
| 1356 |
|
| 1357 |
- Make interpolation work off of Cost instances, not just CostSpec. |
| 1358 |
|
| 1359 |
|
| 1360 |
- Notes: |
| 1361 |
|
| 1362 |
varieties: |
| 1363 |
|
| 1364 |
1. No cost, no price, with currency, e.g. |
| 1365 |
Assets:Something 213.45 USD |
| 1366 |
or |
| 1367 |
Assets:Something USD |
| 1368 |
This is obvious, it buckets into the units currency, i.e., USD. |
| 1369 |
|
| 1370 |
2. No cost, no price, no currency, e.g. |
| 1371 |
Assets:Something |
| 1372 |
This is an auto-posting. One of these should be replicated for every |
| 1373 |
currency present in the transaction. |
| 1374 |
|
| 1375 |
|
| 1376 |
Postings with a price define their currency: |
| 1377 |
|
| 1378 |
3. No cost with price: |
| 1379 |
Assets:Something 1000 JPY @ 120.0000 USD |
| 1380 |
or |
| 1381 |
Assets:Something 1000 JPY @ USD |
| 1382 |
We use the price currency, e.g. USD |
| 1383 |
|
| 1384 |
4. No cost and no price currency: |
| 1385 |
Assets:Something 1000 JPY @ |
| 1386 |
In this case, we must consult the other postings. We look |
| 1387 |
|
| 1388 |
|
| 1389 |
Then, we have postings with costs, which also come in two varieties: |
| 1390 |
|
| 1391 |
5. With an explicit cost currency, e.g. |
| 1392 |
Assets:Something 100 HOOL {12.23 USD} |
| 1393 |
Or with missing amounts, e.g., |
| 1394 |
Assets:Something 100 HOOL {USD} |
| 1395 |
This clearly goes into the USD bucket. |
| 1396 |
|
| 1397 |
6. With no explicit cost currency, e.g., |
| 1398 |
Assets:Something 100 HOOL {2014-09-30} |
| 1399 |
Assets:Something 100 HOOL {"1b24b1151261"} |
| 1400 |
Assets:Something 100 HOOL {} |
| 1401 |
These are uncategorized. |
| 1402 |
|
| 1403 |
In order to resolve these postings to a specific currency bucket, we |
| 1404 |
implement two heuristics: |
| 1405 |
|
| 1406 |
a) If all the other legs are of a single currency and there are no |
| 1407 |
other uncategorized legs, this posting must also book against those; |
| 1408 |
use that currency. |
| 1409 |
|
| 1410 |
b) Otherwise, look at the accumulated ante-inventory; if there is a |
| 1411 |
single currency for it, the posting must be in that currency. |
| 1412 |
|
| 1413 |
Finally, if we aren't able to resolve the currency of that posting |
| 1414 |
using (a) or (b), fail interpolation/booking and skip the transaction. |
| 1415 |
|
| 1416 |
With that algorithm, we should be able to automatically resolve stock splits |
| 1417 |
that look like this, as long as the ante-inventory contains only lots in |
| 1418 |
USD: |
| 1419 |
|
| 1420 |
2015-09-30 * "Split" |
| 1421 |
Assets:Investments:AAPL -40 AAPL {} |
| 1422 |
Assets:Investments:AAPL 80 AAPL {} |
| 1423 |
|
| 1424 |
Finally, note that postings with both a cost and a price must have a |
| 1425 |
currency that matches, as constrained by the parser. If only the price or |
| 1426 |
the cost is specified, we used that currency. Both a price and a cost may |
| 1427 |
not be missing--that would leave two DOF to fill in. |
| 1428 |
|
| 1429 |
|
| 1430 |
|
| 1431 |
** More Old Notes |
| 1432 |
|
| 1433 |
- IMPORTANT FEATURE: Implement Average Booking for 401k adjustments, |
| 1434 |
with associated tests and syntax in the parser. |
| 1435 |
|
| 1436 |
Update for inventory.py: |
| 1437 |
|
| 1438 |
def average(self): |
| 1439 |
"""Merge all lots of the same currency together at their average cost. |
| 1440 |
|
| 1441 |
Returns: |
| 1442 |
A new instance of Inventory, with all the positions of each currency |
| 1443 |
merged together at cost, bringing all these positions at average cost. |
| 1444 |
""" |
| 1445 |
logging.warn('FIXME: continue here, this will be needed to report positions') |
| 1446 |
# FIXME: This is ill-defined, the grouping must also take into account the cost currency. |
| 1447 |
|
| 1448 |
units_map = defaultdict(Decimal) |
| 1449 |
costs_map = defaultdict(Decimal) |
| 1450 |
for position in self.positions: |
| 1451 |
lot = position.lot |
| 1452 |
|
| 1453 |
cost_currency = lot.cost.currency if lot.cost else None |
| 1454 |
key = (lot.currency, cost_currency) |
| 1455 |
units_map[key] += position.number |
| 1456 |
pcosts_map[key] += position.get_cost().number |
| 1457 |
|
| 1458 |
inventory = Inventory() |
| 1459 |
for lotcost_currencies, units in units_map.items(): |
| 1460 |
lot_currency, cost_currency = lotcost_currencies |
| 1461 |
cost_number = costs_map[lotcost_currencies] |
| 1462 |
inventory.add(Amount(units, lot_currency), |
| 1463 |
Amount(cost_number, cost_currency), |
| 1464 |
allow_negative=True) |
| 1465 |
|
| 1466 |
return inventory |
| 1467 |
|
| 1468 |
|
| 1469 |
- Change booking to always have lot-date and list trades automatically. |
| 1470 |
- Report trades, all bookings should be findable after the fact using a link. |
| 1471 |
This can be added without doing full booking. |
| 1472 |
|
| 1473 |
** Link Trades |
| 1474 |
|
| 1475 |
- Create a plugin that will link together all reducing transactions |
| 1476 |
automatically. When a transaction reduces a position, both transactions |
| 1477 |
should have a common unique link. This should likely be done by default, by |
| 1478 |
the new booking method, because it already requires for the matching to |
| 1479 |
happen in order to book lots properly. This is an important new typ9e of |
| 1480 |
report to support! |
| 1481 |
|
| 1482 |
|
| 1483 |
* Short Sales |
| 1484 |
|
| 1485 |
Test short sales in-depth. (They work now, but I want more test cases.) |
| 1486 |
|
| 1487 |
- Allow short sales eventually. This should already work if all that you do is |
| 1488 |
selectively suppress the validation check that verifies that a position at |
| 1489 |
cost may not go negative. We could selectively suppress it by adding a flag |
| 1490 |
to the open directive associated with an account, or maybe adding some |
| 1491 |
special syntax in the cost specification that allows us to do this. |
| 1492 |
|
| 1493 |
- You can implement the sign check for positions held-at-cost only when there |
| 1494 |
are other of that same commodity held at cost in the inventory in the |
| 1495 |
opposite sign. This should allow holding short positions yet still retain |
| 1496 |
the benefit of the check for data entry errors. It also removes what for |
| 1497 |
most people will appear as a limitation from the docs (although with |
| 1498 |
experience you would realize that it is not much of a limitation at atll). |
| 1499 |
|
| 1500 |
- Add tests for holding short positions. |
| 1501 |
- Add tests for holding long and short positions in different commodities. |
| 1502 |
|
| 1503 |
- In order to relax the constraint that you may not add negative units at |
| 1504 |
cost, we could only disallow under certain circumstances: |
| 1505 |
|
| 1506 |
* An account has received units in the opposite direction |
| 1507 |
* If the posting cross the zero boundary. Maybe starting from zero in |
| 1508 |
either direction could be fine. |
| 1509 |
|
| 1510 |
- Idea: Relax checks for negative values: from docs |
| 1511 |
|
| 1512 |
"PLEASE NOTE! In a future version of Beancount, we will relax this constraint |
| 1513 |
somewhat. We will allow an account to hold a negative number of units of a |
| 1514 |
commodity if and only if there are no other units of that commodity held in the |
| 1515 |
account. Either that, or we will allow you to mark an account has having no |
| 1516 |
such constraints at all." |
| 1517 |
|
| 1518 |
* Cleanup, Deprecation, and Performance |
| 1519 |
|
| 1520 |
These are a number of pending tasks to tidy up the codebase in various ways. |
| 1521 |
Some of these are more impactful than others. |
| 1522 |
|
| 1523 |
** Core Cleanup |
| 1524 |
|
| 1525 |
- IMPORTANT: We need to test the return values of the Inventory.add_amount() |
| 1526 |
method! Review and do this now. |
| 1527 |
|
| 1528 |
- Inventory: Implement a test for Inventory.get_amounts() with multiple lots of the same |
| 1529 |
currency; they really should have been aggregated. |
| 1530 |
|
| 1531 |
- (Annoyance) All functions that return an (entries, errors, options_map) |
| 1532 |
triple really should return (entries, options_map, errors), in this order. |
| 1533 |
|
| 1534 |
- Define a C extension module to implement D(). |
| 1535 |
This function should catch useless errors from the cdecimal library: |
| 1536 |
Declined: [<class 'decimal.ConversionSyntax'>] |
| 1537 |
and always provide the input string so we can debug WTF happened. |
| 1538 |
|
| 1539 |
- Reconcile all usage of account regexps to beancount.core.account.ACCOUNT_RE |
| 1540 |
throughout the code (grep --include='*.py' -srn A-Z ~/p/beancount/src/python/beancount). |
| 1541 |
|
| 1542 |
- An easy way to remove the diff_amount exceptional field from Balance is to |
| 1543 |
move it to metadata, and this would be consistent with the goal of plugins |
| 1544 |
using metadata for their own goals: assertions of Balance can be see as a |
| 1545 |
feature of the plugins. |
| 1546 |
|
| 1547 |
- Rename test_util.TestCase.assertLines() to assertEqualNoWS(). |
| 1548 |
|
| 1549 |
- Review all the source code to use data.filter_txns() everywhere we can. The |
| 1550 |
data.filter_txns() function has been created but the code hasn't been |
| 1551 |
converted. |
| 1552 |
|
| 1553 |
- Amount and Inventory and other basic classes: You could eventually support |
| 1554 |
an implementation of __format__ which attempts to make sense of the |
| 1555 |
different components, e.g., apply the format specifier to the number |
| 1556 |
excluding the space required to render the currency. |
| 1557 |
|
| 1558 |
- (open directives) An invariant that we would love to have is to ensure that |
| 1559 |
after parsing, all accounts that are used in a list of entries should have a |
| 1560 |
corresponding Open directive for them. This would mean a variant of the |
| 1561 |
validation routine that automatically inserts missing directives. At the |
| 1562 |
moment, when an Open directive is missing, processing code that assumes they |
| 1563 |
are always present might fail. We cannot insert the missing directives in |
| 1564 |
the validation code simply because validation code is not allowed to modify |
| 1565 |
the list of entries. We could insert a "fixup" step after validation, that |
| 1566 |
does these kinds of automatic recoveries. Ponder this for a while. |
| 1567 |
|
| 1568 |
- (open directives) Do we need to insert Open entries for the equity accounts |
| 1569 |
described in options? I think we could safely plop that at the very |
| 1570 |
beginning of the entries list in the parser. |
| 1571 |
|
| 1572 |
- Document args of C functions in the same way as Python's, perhaps using the |
| 1573 |
new Python3 syntax definition thingamajig (I forget the name, there's a PEP). |
| 1574 |
|
| 1575 |
- entries_table() really should be called postings_table(). |
| 1576 |
|
| 1577 |
- Review all the code that is an effective switch/case on directive types and |
| 1578 |
add checks for unknown directives. Make sure Commodity is being handled |
| 1579 |
correctly. Grep for isinstance. Add else clause everywhere none was, e.g. |
| 1580 |
https://bitbucket.org/blais/beancount/src/0e3be569f32a80411df8396d42d5e5ac3487a68f/src/python/beancount/core/realization.py?at=default#cl-292 |
| 1581 |
|
| 1582 |
- Make _all_ plugins accept a configuration parameter, unconditionally. The |
| 1583 |
interface should be this regular. Right now, some of the plugin functions |
| 1584 |
accept configuration, some don't. This is easy and will make things more |
| 1585 |
consistent. |
| 1586 |
|
| 1587 |
** Realization Cleanup |
| 1588 |
|
| 1589 |
- You need to convert some of TestRealization to TestCheck. |
| 1590 |
|
| 1591 |
** Install Cleanup |
| 1592 |
|
| 1593 |
- Don't install all the _test.py files, make sure they're not installed. |
| 1594 |
|
| 1595 |
** More Testing |
| 1596 |
|
| 1597 |
- In the parser or in the validation, check that the price currency matches |
| 1598 |
that of the cost currency, if both are specified! |
| 1599 |
|
| 1600 |
2011-01-25 * "Transfer of Assets, 3467.90 USD" |
| 1601 |
* Assets:Investments:RothIRA:Vanguard:VTIVX 250.752 VTIVX {18.35 USD} @ 13.83 CAD |
| 1602 |
* Assets:Investments:RothIRA:DodgeCox:DODGX -30.892 DODGX {148.93 USD} @ 112.26 USD |
| 1603 |
|
| 1604 |
- Continue adding more of the pylint tests and make them pass. The codebase is |
| 1605 |
almost at a point where it has all the tests from the default configuration. |
| 1606 |
|
| 1607 |
- Add a lint check that ensures the non-test files are never importing any of |
| 1608 |
other test files. |
| 1609 |
|
| 1610 |
- You need to unit-test for multiline notes... do they work as expected? |
| 1611 |
|
| 1612 |
- Try to run the tests using 'watchr', 'sniffer', 'autonose' or other such tool. |
| 1613 |
|
| 1614 |
- Create special make target to run tests on my own large Ledger. |
| 1615 |
This should bean-check, bean-roundtrip, bean-bake / scrape. |
| 1616 |
|
| 1617 |
- Implement a "fuzzing" input generator, that will output a very large input |
| 1618 |
file with all possible kinds of combinations, to see where Beancount hits |
| 1619 |
its limits and perhaps bring up some bugs from input I haven't thought of. |
| 1620 |
This is easy and fruitful. |
| 1621 |
|
| 1622 |
** Total Price Syntax Work |
| 1623 |
|
| 1624 |
- Document the @@ and {{}} syntaxes (see Matthew Harris email), especially as |
| 1625 |
they relate to price. |
| 1626 |
|
| 1627 |
- You need to create a unit test for @@ price conversions. |
| 1628 |
|
| 1629 |
- As an aside, I see that the grammar supports @@ and {{}} syntaxes, but they |
| 1630 |
don't appear to be documented in the language manual. |
| 1631 |
|
| 1632 |
Oh I hadn't noticed... I will document those, thank you for reporting this |
| 1633 |
oversight. |
| 1634 |
|
| 1635 |
- When using @@ the signs should match; warn if they don't. |
| 1636 |
|
| 1637 |
- Make prices required to always be positive, including with @@, and err on |
| 1638 |
negative amounts for prices. This will match Ledger semantics and will |
| 1639 |
remove one degree of freedom that wasn't necessary. |
| 1640 |
|
| 1641 |
** Parser Cleanup & Improvements |
| 1642 |
|
| 1643 |
- You need to validate the account name options (empty, or no :, use regex to |
| 1644 |
constrain). |
| 1645 |
|
| 1646 |
- Make booking the cost on the same currency as the instrument impossible: |
| 1647 |
|
| 1648 |
<account> 1212.023 USD {100.00 USD} |
| 1649 |
|
| 1650 |
Ditto w/ the price. This should only be done after allowing zero cost. |
| 1651 |
|
| 1652 |
- Add support for triple-quoted strings, which may alleviate problems we're |
| 1653 |
seen with syntax highlighting (idea from aumayr@). |
| 1654 |
|
| 1655 |
- What happens if you specify the same plugin twice, with different |
| 1656 |
configuration strings? |
| 1657 |
|
| 1658 |
- KeyboardInterrupts (if you press it) in the parser will cause errors: |
| 1659 |
|
| 1660 |
$ bean-report $L exportpf > /tmp/export.ofx |
| 1661 |
blais.beancount:42041: KeyboardInterrupt: |
| 1662 |
|
| 1663 |
This is exceedinly rare but maybe worthwhile to catch regardless. |
| 1664 |
|
| 1665 |
- It would be very useful to have #ifdef syntax support. See if this could be |
| 1666 |
integrated with cpp by preprocessing the input. This would also take care of |
| 1667 |
#include, potentially, and I might be able to remove that feature from |
| 1668 |
Beancount itself. Just an idea. |
| 1669 |
|
| 1670 |
- (parser) Is it possible to specify no flag on a transaction?, e.g. just the date? |
| 1671 |
|
| 1672 |
2014-07-12 |
| 1673 |
.. |
| 1674 |
|
| 1675 |
Does this work? It would be nice if it did. Make it so. This is more |
| 1676 |
permissive and would ease the burden of conversion for users already |
| 1677 |
familiar with Ledger. We should change the grammar so that the flag is part |
| 1678 |
of the txn_fields. This is elegant: basically, instead of the flag taking |
| 1679 |
the place of the transaction, the 'txn' keyword just becomes optional. |
| 1680 |
That's it. DO THIS! |
| 1681 |
|
| 1682 |
- Add an option to the parser to not just ignore unparsed lines, more strict. |
| 1683 |
|
| 1684 |
- BUG: A transaction like this fails to parse; allow it: |
| 1685 |
2014-02-22 * "Payee" | |
| 1686 |
.. |
| 1687 |
|
| 1688 |
- BUG: This input file without currencies does not currently fail! This is due |
| 1689 |
to the parser accepting incomplete input. It should fail! |
| 1690 |
|
| 1691 |
2014-01-01 * "Buy Hooli" |
| 1692 |
Assets:US:Broker:HOOL 120.00 {1212.5100 USD} |
| 1693 |
Assets:US:Broker:Cash |
| 1694 |
|
| 1695 |
2014-04-08 * "HOOLI INC CL C SPINOFF ON" |
| 1696 |
Assets:US:Broker:HOOLA -120.00 {1212.5100 USD} |
| 1697 |
Assets:US:Broker:HOOLA 120.00 {1212.5100 * 0.4992 USD} |
| 1698 |
Assets:US:Broker:HOOL 120.00 {1212.5100 * 0.5008 USD} |
| 1699 |
|
| 1700 |
- When an error occurs while parsing a directive/transaction, add the ability |
| 1701 |
to let the parser skip until the next directive and ignore the parsed |
| 1702 |
transaction because of the error. Maybe this should be an exception |
| 1703 |
mechanism, or just storing a flag that gets reset when the directive is |
| 1704 |
completed. Not sure. This would be a more elegant way to deal with some |
| 1705 |
errors. |
| 1706 |
|
| 1707 |
** File Cleanup |
| 1708 |
|
| 1709 |
- Remove plugins from ops, remove algorithms from core: |
| 1710 |
|
| 1711 |
(Also remove "documents" option and move that as input to this plugin.) |
| 1712 |
b.ops.documents -> b.plugins.documents (not sure if breaks) |
| 1713 |
|
| 1714 |
b.core.getters -> b.ops.getters (does it add deps?) |
| 1715 |
b.core.realization -> b.ops.realization (does it add deps?) |
| 1716 |
|
| 1717 |
** Prices Cleanup |
| 1718 |
|
| 1719 |
- Make the code finding lists of commodities for holdings and price reports |
| 1720 |
use the same code as beancount.ops.find_prices. Also, this should really |
| 1721 |
just be renamed beancount.prices.find_commodities and perhaps be moved up to |
| 1722 |
beancount.ops. |
| 1723 |
|
| 1724 |
src/python/beancount/ops/holdings.py |
| 1725 |
src/python/beancount/reports/price_reports.py |
| 1726 |
|
| 1727 |
- Remove the final traces of the "quote" metadata field from holdings: |
| 1728 |
|
| 1729 |
/home/blais/p/beancount/src/python/beancount/ops/holdings.py:153: Commodity directive from its 'quote' metadata field. |
| 1730 |
/home/blais/p/beancount/src/python/beancount/ops/holdings.py:190: quote_currency = commodity_entry.meta.get('quote', None) |
| 1731 |
|
| 1732 |
Nothing else uses this anymore, this needs to go too. |
| 1733 |
|
| 1734 |
- Issue warnings when fetching prices with dates that are too far from the |
| 1735 |
requested dates. We need to find a way to issue a global tolerance for this, |
| 1736 |
that indicates to the user to fill in missing prices that are required to |
| 1737 |
carry out particular reporting tasks. |
| 1738 |
|
| 1739 |
- Price entries should have extra metadata to disambiguate between implicitly |
| 1740 |
created prices, linking to the original transaction that created them, and |
| 1741 |
explicitly created ones. |
| 1742 |
|
| 1743 |
** Example Files Cleanup |
| 1744 |
|
| 1745 |
- Convert example file to use beancount.plugins.ira_contribs plugin for mirror |
| 1746 |
accounting. |
| 1747 |
|
| 1748 |
** Revise Dependency Graph |
| 1749 |
|
| 1750 |
As I'm moving to a system with more plugins and less code in the core, and |
| 1751 |
with the intermediate reports stage instead of just the web interface, it's |
| 1752 |
becoming clearer where some files need to move. |
| 1753 |
|
| 1754 |
- Make various attempts to simplify depgraph, we want to ship with a really |
| 1755 |
lean dependency graph. |
| 1756 |
|
| 1757 |
- ops & plugins should not depend on parser... |
| 1758 |
|
| 1759 |
* Move beancount.parser.options to beancount.core.options |
| 1760 |
* Move beancount.parser.printer outside parser, ideally, or just factor the |
| 1761 |
dependencies separately. |
| 1762 |
|
| 1763 |
- If you want to be consistent with the script names, rename |
| 1764 |
beancount.reports to beancount.report. This way, bean-* matches a single |
| 1765 |
package name. Just saying. |
| 1766 |
|
| 1767 |
- Emerge a principle for where the following files should separate, or merge |
| 1768 |
the two modules: |
| 1769 |
|
| 1770 |
beancount.ops.* |
| 1771 |
beancount.plugins.* |
| 1772 |
|
| 1773 |
- beancount.core.realization: Look at deps for beancount.core.realization and |
| 1774 |
move it upstream where it makes sense, maybe ops. |
| 1775 |
|
| 1776 |
- beancount.core.getters: Should this move to ops as well? Check the |
| 1777 |
dependency tree, see if it makes sense. |
| 1778 |
|
| 1779 |
|
| 1780 |
** Improve Balance Checks |
| 1781 |
|
| 1782 |
- An important option exists around the behavior of balance checks: Should |
| 1783 |
balance checks bring their balance to the balance amount? In other words, |
| 1784 |
should a balance check imply an automatic, on-demand Pad behavior on |
| 1785 |
failure? This has an impact on following balance checks further in time. The |
| 1786 |
current behavior is not to pad a failure, so if there are multiple balance |
| 1787 |
checks, a single mistake before them would generate a number of errors. An |
| 1788 |
equally valid behavior would be to trigger only a single error, isolating |
| 1789 |
the periods between balance checks. Both semantics have advantages. You |
| 1790 |
should provide an option to ustomize this behavior, the user should be able |
| 1791 |
to choose. option "pad_failing_balances". |
| 1792 |
|
| 1793 |
** Tagged Strings |
| 1794 |
|
| 1795 |
- Make tags and payees output "tagged strings", with their own data types. You |
| 1796 |
can derive from str. These new objects should behave exactly like 'str' but |
| 1797 |
carry over their type. This would be in force for tags, account names, and |
| 1798 |
currencies. |
| 1799 |
|
| 1800 |
You need to write some careful testing to figure out what happens on |
| 1801 |
concatenation, etc. with these types. |
| 1802 |
|
| 1803 |
- If you do this, you can make the Custom directive not output pairs of |
| 1804 |
objects for its 'values' attribuet; instead, you'd use the data type of the |
| 1805 |
str object itself. |
| 1806 |
|
| 1807 |
** Improve Errors |
| 1808 |
|
| 1809 |
- Enhance error reporting! Make all errors possibly hold on to a list of |
| 1810 |
entries, not just one. Many, many errors will benefit from this. |
| 1811 |
|
| 1812 |
- The creation of exceptions should be made easier: each error class should |
| 1813 |
inherit from a base class that is able to accept an optional list of |
| 1814 |
entries, that would automatically render the fileloc of each of those |
| 1815 |
entries, and that would use the fileloc of the first entry in order to |
| 1816 |
render the location of the error. If no entries are specified, an OPTIONAL |
| 1817 |
fileloc= parameter should be provided to specify where the error occurs. |
| 1818 |
This will make creating errors a lot easier and nicer. |
| 1819 |
|
| 1820 |
As part of this, we should also somehow produce a list of all possible |
| 1821 |
errors with a lavish description. |
| 1822 |
|
| 1823 |
- Refine 'source' attribute on all directives: For .source, instead of '<...>' |
| 1824 |
for the filename, we should use a scheme:..., like file://..., and |
| 1825 |
plugin:beancount.... . This makes a lot more sense. The lineno still needs |
| 1826 |
to be separate, we need that for sorting and prefer not to have it part of |
| 1827 |
the string. |
| 1828 |
|
| 1829 |
** Errors as Directives |
| 1830 |
|
| 1831 |
- (architecture) Seriously consider merging entries and errors; errors are |
| 1832 |
just a special type of entry, and they have dates, and they get rendered in |
| 1833 |
journals. This could make a lot of sense. |
| 1834 |
|
| 1835 |
- Interesting idea: Maybe instead of returning errors, "errors" could simply |
| 1836 |
become "Error" directives and be inserted into the flow, and picked up by |
| 1837 |
the various rendering routines in different ways?!? I love this. One less |
| 1838 |
thing to return. Hmmm ponder it seriously. |
| 1839 |
|
| 1840 |
** Caching Improvements |
| 1841 |
|
| 1842 |
Caching is emerging as a key feature because adding more plugins increases |
| 1843 |
processing time. I'd like to eventually be able to cache as much processed |
| 1844 |
data as possible, per file. |
| 1845 |
|
| 1846 |
There are therre types of relevant caching: |
| 1847 |
|
| 1848 |
* Load cache: Caches the parsing and processing of a top-level Beancount file |
| 1849 |
to a pickle. |
| 1850 |
|
| 1851 |
* Price cache: Caches previously fetched prices from external price sources. |
| 1852 |
This allows us to re-run price fetching cheaply. |
| 1853 |
|
| 1854 |
* [Not Done] Document conversion cache: For importing new documents, some |
| 1855 |
conversions are very expensive, in particular conversions from PDF. When |
| 1856 |
there are problems, we end up having to re-run these slow conversions many |
| 1857 |
times. Even without problems, we run them at least twice: Once for |
| 1858 |
extraction and once for filing. We should build a conversion cache. |
| 1859 |
|
| 1860 |
These need to have consistent sets of related options and file locations. |
| 1861 |
|
| 1862 |
- Create a ~/.beancount-cache directory and store all the cache information in |
| 1863 |
there instead of in the different places they are now. |
| 1864 |
|
| 1865 |
- I really need a --no-cache and --clear-cache options across all the |
| 1866 |
programs, consistently defined. When developing a plugin, it would be so |
| 1867 |
much more convenient. |
| 1868 |
|
| 1869 |
- Add options to disable the cache in bean-check so that using -v would be |
| 1870 |
useful when you're trying to assess performance. I try this often enough I |
| 1871 |
want options for it. |
| 1872 |
|
| 1873 |
- Use the same option on all tools for showing the timings, --verbose timings, |
| 1874 |
maybe add it from the loader module. |
| 1875 |
|
| 1876 |
- (Performance) Great idea for performance: Implement the cache for each file |
| 1877 |
separately. I could split my big file and only the bits which get edited |
| 1878 |
would have to be recomputed. |
| 1879 |
|
| 1880 |
- All usage of environment variables should be removed by replacing them by |
| 1881 |
the standard command-line options. |
| 1882 |
|
| 1883 |
** Performance |
| 1884 |
|
| 1885 |
- (validation/performance) Optimize the performance of validations and bring |
| 1886 |
all the HARDCORE_VALIDATIONS in by default. |
| 1887 |
|
| 1888 |
- Maybe the builder should have a 'filename' state that only gets changed here |
| 1889 |
and there instead of getting that fileloc argument passed in every time on |
| 1890 |
every rule. Maybe we just always get the fileloc from the parser.c as in |
| 1891 |
NUMBER. I think it might make the parser more efficient too... try it out, |
| 1892 |
do timings, see how much it improves parsing performance. |
| 1893 |
|
| 1894 |
- See if you replace BUILD()'s PyObject_CallMethod to this how much faster it |
| 1895 |
gets: "Note that if you only pass PyObject * args, PyObject_CallMethodObjArgs() is a |
| 1896 |
faster alternative." |
| 1897 |
https://docs.python.org/3/c-api/object.html |
| 1898 |
|
| 1899 |
- (performance) Profile the web pages, if account_link() is high, provide an |
| 1900 |
explicit cache for each unique view. (We had to remove this when we |
| 1901 |
simplified the function using build_url for adding tests.) |
| 1902 |
|
| 1903 |
- (performance) Implement the stable hashing function in C and reinstall the |
| 1904 |
validate_hash test. |
| 1905 |
|
| 1906 |
- (performance) Implement inventories in C and reinstall the |
| 1907 |
validate_check_balances test. |
| 1908 |
|
| 1909 |
- (performance) Don't pass in the FILE_LINE_ARGS on function calls, these |
| 1910 |
should be part of the context of the parser, should be gettable only on |
| 1911 |
demand. |
| 1912 |
|
| 1913 |
- Can I use Py_RETURN_NONE in order to incref and assign, in the lexer, |
| 1914 |
instead of doing it in two steps? |
| 1915 |
|
| 1916 |
- Optimize the main update() routine that is called in display_context. |
| 1917 |
|
| 1918 |
*** Parser Performance |
| 1919 |
|
| 1920 |
- Implement "D" in C, it's worth it. This should make a substantial difference. |
| 1921 |
|
| 1922 |
- Test using the empty case of list parsing to create the initial empty lists |
| 1923 |
instead of the conditional in Parser.handle_list() and measure, to see if |
| 1924 |
there is a significant difference in parsing performance. |
| 1925 |
|
| 1926 |
- Parser performance: try not calling back to builder for simple types that |
| 1927 |
just return their value; measure the difference, it may be worth it, and we |
| 1928 |
wouldn't lose much of flexibility, especially for the lexer types, which are |
| 1929 |
aplenty. |
| 1930 |
|
| 1931 |
- Write the builder object in C... it won't change very much anymore, and |
| 1932 |
that's probably simple enough. |
| 1933 |
|
| 1934 |
- Check the performance of D(). I suspect improving this routine |
| 1935 |
could have a dramatic effect on performance. |
| 1936 |
|
| 1937 |
* Python Types & Namedtuple |
| 1938 |
** Typed Data Types |
| 1939 |
|
| 1940 |
- Install proto3 and try to represent all the data using it; measure the |
| 1941 |
difference in performance. |
| 1942 |
|
| 1943 |
** Hashing |
| 1944 |
|
| 1945 |
- See if we can remove Position's __hash__ method now that it's a namedtuple. |
| 1946 |
|
| 1947 |
- Also, look at all the objects in b.core.data, and see if you can override |
| 1948 |
the hash function on them automatically in order to ignore the entry in |
| 1949 |
postings, and the listness in entry.postings. It would be nice to be able |
| 1950 |
to hash every directive type. |
| 1951 |
|
| 1952 |
* Portfolio Management |
| 1953 |
|
| 1954 |
I'm somewhat automating the process of managing my own portfolio using |
| 1955 |
Beancount. I export the contents of my assets to Google Finance using a |
| 1956 |
script, and I have a way to upload my current list of holdings to a Google |
| 1957 |
Spreadsheet, though I haven't completely switched over to that. My plan is to |
| 1958 |
ditch the GFinance export in favor of a custom spreadsheet, particularly |
| 1959 |
because the latter can be entirely automated. My scripts will just update the |
| 1960 |
list of assets in the spreadsheet and I should be able to derive various |
| 1961 |
measures from that. |
| 1962 |
|
| 1963 |
- Complete the automation of uploading my portfolio to a spreadsheet and begin |
| 1964 |
using that (over the Google Finance solution). |
| 1965 |
|
| 1966 |
- "Computing portfolio returns using Beancount." Create a new document to |
| 1967 |
describe the process, to describe how to do that. |
| 1968 |
|
| 1969 |
- Make sure that the list of holdings computed by bean-query is the same as |
| 1970 |
that generated by the holdings report... Would it be possible to compute the |
| 1971 |
latter using the former? |
| 1972 |
|
| 1973 |
- You should be able to export to input files or APIs for websites that track |
| 1974 |
portfolios for you, such as Google Finance and Yahoo and others. Use the |
| 1975 |
list of holdings as input. This should perhaps just be another report name. |
| 1976 |
|
| 1977 |
- Move the current portfolio code hacks out of my private repo and make that |
| 1978 |
into the main repo. |
| 1979 |
|
| 1980 |
- Possibly create a 'beancount.portfolio' package and move all the there, |
| 1981 |
validated and all, if there's enough meat for it. |
| 1982 |
|
| 1983 |
- In holdings: create the concept of a "composition" which can be associated |
| 1984 |
to any holding, based on the (account, currency, cost-currency), and which |
| 1985 |
is a vector of proportions to be normalized and associated to the holding. |
| 1986 |
You should then be able to compute the sum total of all compositions. This |
| 1987 |
can be achieved with metadata, and it could be a generalized concept, with |
| 1988 |
the following applications: |
| 1989 |
|
| 1990 |
* Liquidity (how easy is it to get money out of this account?) |
| 1991 |
* Taxability (pre-tax, roth, after-tax, usually 0 or 100%) |
| 1992 |
* Sector, industry exposures |
| 1993 |
* Currency exposure |
| 1994 |
* ... |
| 1995 |
|
| 1996 |
Honestly, it would be even better if we don't have to even do that and if we |
| 1997 |
can do this by querying metadata and aggregating on the postings directly. |
| 1998 |
|
| 1999 |
- Compute pre-tax and post-tax net worth reports, based on a "tax" account |
| 2000 |
metadata field and some reasonable assumptions. |
| 2001 |
|
| 2002 |
- Fetch the CSV holdings of each Holding and compute the full list of stocks I |
| 2003 |
own from these ETFs in dollar value. Sort by larger to smaller. Also compute |
| 2004 |
the industry with that. You need to write Vanguard download (harder, need to |
| 2005 |
scrape), and iShares download (easier, CSV). |
| 2006 |
|
| 2007 |
- Implement the dashboard on the example file, take the code out of my |
| 2008 |
private code stash and share. |
| 2009 |
|
| 2010 |
- Replace the portfolio script by a bean-query command that will use metadata |
| 2011 |
on the commodities (!). This will simplify things a lot and be more |
| 2012 |
flexible. These are really just aggregations of a different kind. |
| 2013 |
|
| 2014 |
** Dashboard |
| 2015 |
|
| 2016 |
Add the following to the portfolio dashboard: |
| 2017 |
- PnL since yesterday, one week ago, two weeks ago, one month ago, three months ago |
| 2018 |
- Current portfolio breakdowns |
| 2019 |
- Cash report |
| 2020 |
- A listing of short-term lots vs. long-term lots |
| 2021 |
- Schedule of lots to become long-term in the near future |
| 2022 |
- Returns (computed correctly, over many periods) |
| 2023 |
|
| 2024 |
From email to fxt: |
| 2025 |
|
| 2026 |
I want to build an investment dashboard, that would contain: |
| 2027 |
|
| 2028 |
- List of holdings, with various rollups (see the different aggregations of |
| 2029 |
holdings reports) |
| 2030 |
- Rollups of holdings against various types (e.g., Stocks vs. Bonds) |
| 2031 |
- P/L since the morning or for the last day, over the last week, last two |
| 2032 |
weeks, last month, last quarter, last year. |
| 2033 |
- Report of uninvested cash and the detail of where it is |
| 2034 |
- A listing of short-term vs. long-term lots, and a schedule of which lots are |
| 2035 |
going to switch from short-term to long-term in the near future (to avoid |
| 2036 |
selecting those for sale) |
| 2037 |
- Returns, as computed by my prototype of our ideas during the bicycle trip |
| 2038 |
- Automatically refresh current prices if run intra-day |
| 2039 |
|
| 2040 |
This script would run every hour on a crontab and generate static HTML files |
| 2041 |
that I could access from my phone to make investment decisions and monitor |
| 2042 |
gains/losses during the day. I'm certain you would appreciate having such a |
| 2043 |
thing too. I want to integrate the code I already have out of |
| 2044 |
beancount/experiments and start moving all this stuff to the |
| 2045 |
beancount.dashboard.* and add unit tests and make it work on the tutorial file. |
| 2046 |
This should make it easy for others to use. |
| 2047 |
|
| 2048 |
* Removal of Holding Object |
| 2049 |
|
| 2050 |
At some point in Q4'2015 I overhauled the Posting object to rationalize its |
| 2051 |
attributes. The result is a much simpler object, and one which could readily |
| 2052 |
be used instead of the Holding objects I had defined in beancount.ops.holdings |
| 2053 |
and beancount.reports.holdings_reports. I'd like to remove the Holding class |
| 2054 |
to reduce complexity. This will make generating the reports for portfolios |
| 2055 |
more straightforward: the list of assets simply should be the list of Postings |
| 2056 |
accumulated at a particular point in time. |
| 2057 |
|
| 2058 |
- Remove Holding object everywhere and replace it by Posting. Convert all |
| 2059 |
aggregation routines to work on Posting instances instead. {holding} |
| 2060 |
|
| 2061 |
- Replace Holding by the new, flattened Position, it's a _lot_ more like it. |
| 2062 |
Makes a lot of sense now. Move the price_date to .meta, I don't think it's |
| 2063 |
actually used. |
| 2064 |
|
| 2065 |
- In doing so, it might be useful to enrich the Price field of a Posting |
| 2066 |
object with a date (number, currency, date). This would allow the creation |
| 2067 |
of holdings at different dates. I'm not entirely certain we need it. |
| 2068 |
|
| 2069 |
- When attempting a conversion in holdings, if the rate isn't available |
| 2070 |
directly, you should always attempt to value it indirectly via an |
| 2071 |
indirection through one of the operating currencies. |
| 2072 |
|
| 2073 |
- Add the acquisition date of each lot to each Holding, and it should be |
| 2074 |
output at that date by print_holdings as well. |
| 2075 |
|
| 2076 |
** Old Notes |
| 2077 |
|
| 2078 |
- I think there's a way to simplify holdings: you can probably remove the |
| 2079 |
"Holding" type and replace that with a Posting, which really, is much like a |
| 2080 |
Holding, it has an account and a position, and a price.... That would |
| 2081 |
normalize Holding quite a bit, even if it means we end up adding a few |
| 2082 |
unused slots to Posting. I'm happy to do that! Simplify simplify simplify... |
| 2083 |
always. |
| 2084 |
|
| 2085 |
- Along with the new inventory, you can make Holding -> Position. This makes |
| 2086 |
a lot of sense actually. Do do this! |
| 2087 |
|
| 2088 |
(work on holdings) |
| 2089 |
- Support output format "beancount" for holdings, use a single file instead of |
| 2090 |
a holdings I/O file (merge holdings.csv + prices.beancount -> holdings.beancount) |
| 2091 |
This would be much nicer. |
| 2092 |
|
| 2093 |
- Check holdings I/O by saving and reloading a list of holdings created from |
| 2094 |
a set of entries (with sales, just to make sure). |
| 2095 |
|
| 2096 |
- In add_unrealized_gains(), convert to use our holdings aggregator. |
| 2097 |
|
| 2098 |
- Build a new category to portfolio to identify accountings holding |
| 2099 |
"Uninvested Cash", which should be cash available to invest now. |
| 2100 |
|
| 2101 |
|
| 2102 |
|
| 2103 |
* Computing Asset Returns |
| 2104 |
|
| 2105 |
Another important task I've been trying to do is to process my investment |
| 2106 |
history in order to compute the actual, precise returns, including all fees |
| 2107 |
and taking into actual my particular cash transfers. Most brokers will provide |
| 2108 |
either the generic returns of a particular instrument regardless of your |
| 2109 |
exposure over time, or the difference between the current time and some past |
| 2110 |
time for your entire portfolio. Neither of these is sufficient to evaluate |
| 2111 |
your portfolio returns. I want to compute the returns of each instrument |
| 2112 |
separately, entirely from the Beancount input file, and then combining those |
| 2113 |
returns histories to compute portfolio returns. |
| 2114 |
|
| 2115 |
In order to do this right, the structure of each investment has to follow some |
| 2116 |
sort of pattern so that for each instrument we can identify external flows of |
| 2117 |
money, internal flows, and "value accounts" which contain the commodities |
| 2118 |
whose price fluctuates. I had a pretty good shot at this in the 'returns' |
| 2119 |
branch, which has been merged, and have found some shortcomings, so I wrote |
| 2120 |
the 'returns2' branch, but it is yet incomplete and I have to restart working |
| 2121 |
on this at some point. |
| 2122 |
|
| 2123 |
- I need to add detailed debugging information in order to troubleshoot the |
| 2124 |
cases where it does not work well. There are several corner cases and I've |
| 2125 |
been having a difficult time identifying exactly why it fails for some |
| 2126 |
commodities. Time to write some nice debugging output, this will be useful |
| 2127 |
later, and for others, and for others to share when asking questions if they |
| 2128 |
face similar difficulties. |
| 2129 |
|
| 2130 |
- In order to compute this properly, I will need to pull prices at various |
| 2131 |
points in time. I want to automate the process of figuring out the dates at |
| 2132 |
which prices are needed, i.e., when the prices in Beancount at too far from |
| 2133 |
the evaluation dates, and perhaps automate the fetching of all necessary prices. |
| 2134 |
|
| 2135 |
- Bring in all the generic functions from experiments/returns/returns.py into |
| 2136 |
core beancount. Bring in returns as a plugin. |
| 2137 |
|
| 2138 |
- Prices: Write a script to output the timeline of prices/rates missing & |
| 2139 |
required in order to compute all the returns correctly. Then use it to drive |
| 2140 |
fetching a historical table of monthly or perhaps weekly exchange rates for |
| 2141 |
USD/CAD, USD/AUD, EUR/USD since the beginning of my file. Make this script |
| 2142 |
reusable. |
| 2143 |
|
| 2144 |
- Fetch missing prices for my input file and recompute returns. |
| 2145 |
|
| 2146 |
- Returns calculation should spit out missing prices. |
| 2147 |
Automate returns calculation. |
| 2148 |
|
| 2149 |
- Fix FIXME in beancount.projects.returns, from DClemente issues. |
| 2150 |
|
| 2151 |
* Net Worth |
| 2152 |
|
| 2153 |
A complement to the portfolio management features is the ability to report on |
| 2154 |
the total "net worth" on the balance sheet, over time, and as pre- and post- |
| 2155 |
tax amounts. |
| 2156 |
|
| 2157 |
- Make the net-worth-over-time script output post-tax networth as well, using |
| 2158 |
metadata. In other words, the post-tax amount should represent the |
| 2159 |
liquidation value of the portfolio if all tax liabilities had to be incurred |
| 2160 |
(e.g., taking all the money out of tax-deferred retirement accounts). This |
| 2161 |
should use a percentage meta-data field in order to figure out the |
| 2162 |
approximate taxation rate, e.g., |
| 2163 |
|
| 2164 |
2014-01-29 open Assets:US:Vanguard:PreTax401k |
| 2165 |
tax: "pre" |
| 2166 |
|
| 2167 |
Allowable values should be: |
| 2168 |
|
| 2169 |
"pre" : For regular tax-deferred accounts, where the entire amount is |
| 2170 |
taxed on distribution. |
| 2171 |
"after" : For after-tax 401k accounts where only the gains are taxed on |
| 2172 |
distribution. |
| 2173 |
"roth" : For Roth accounts (not taxable on distribution). |
| 2174 |
None : For taxable accounts. |
| 2175 |
|
| 2176 |
- Make the net-worth script into an official project, don't just leave it |
| 2177 |
under experiments. Do this only _after_ the removal of the Holding object, |
| 2178 |
to minimize changes. |
| 2179 |
|
| 2180 |
* Standalone Tools |
| 2181 |
|
| 2182 |
In order to produce many of the reports, I've had many ideas of composable |
| 2183 |
command-line tools to build and provide for processing text with account |
| 2184 |
names. These are small standalone projects. |
| 2185 |
|
| 2186 |
- Build a function and command-line tool that can injest either a table of |
| 2187 |
results or a CSV file and infer that an entire column is of numbers and |
| 2188 |
pairs of numbers and can accordingly split the column into multiple columns |
| 2189 |
and put the currency in the header so you can import that up to a |
| 2190 |
spreadsheet. |
| 2191 |
|
| 2192 |
- Build an 'statement' tool that will render a treeified balance sheet in two |
| 2193 |
columns! Limit it to use the beginning of a line, and hard-code to use the |
| 2194 |
five known categories (optionally changeable). It's okay if the tool is a |
| 2195 |
bit more limited than treeify. It should optionally do the treeification. |
| 2196 |
It should also optionally sort the account names (or not). |
| 2197 |
|
| 2198 |
* Add a --title option to render at the top. |
| 2199 |
|
| 2200 |
(A two-column tool to convert one column into two columns (for text mode |
| 2201 |
balance sheet and income statement). The equivalent UNIX tool does not |
| 2202 |
exist. Select columns by regexp on prefix. |
| 2203 |
|
| 2204 |
- Build a simple 'colrneg' tool that just highlights numbers as green or red |
| 2205 |
depending on if positive or negative. |
| 2206 |
|
| 2207 |
- Perhaps should build a version of treeify for internal usage that works on |
| 2208 |
HTML columns, off of HTML text. Or BETTER: just a stateful tool that can |
| 2209 |
transform an account's name to indent it properly every time you feed it the |
| 2210 |
full account name! This could be used by the routine that want to render |
| 2211 |
columns as tree. Maybe 'treeify' should use that as well. That would make a |
| 2212 |
lot of sense. |
| 2213 |
|
| 2214 |
|
| 2215 |
* Streamline Commands |
| 2216 |
|
| 2217 |
As features grow, so do commands. I'd like to minimize the number of them, |
| 2218 |
where it makes sense. I find it's often possible to do that. |
| 2219 |
|
| 2220 |
- I plan to remove bean-example and fold that into a bean-doctor subcommand. |
| 2221 |
|
| 2222 |
- Maybe bean-bake could be folded into bean-web. |
| 2223 |
|
| 2224 |
- bean-sql is a bit of an experiment, I'm not sure we need it, but I want to |
| 2225 |
keep the functionality. Maybe this should only be a subcommand of the code |
| 2226 |
that provides Beancount postings as a a virtual SQLite3 table. |
| 2227 |
|
| 2228 |
|
| 2229 |
|
| 2230 |
* Debits & Credits Normalization |
| 2231 |
|
| 2232 |
One simple idea that might make at least some people happy is to make it |
| 2233 |
possible to input the great majority of numbers as positive numbers. This |
| 2234 |
can easily be done by considering the account type to which a number is |
| 2235 |
attached and invert the number, if necessary. For example, if this input mode |
| 2236 |
is enabled, you would input a posting to Income as a positive number, but it |
| 2237 |
would be interpreted as a negative number. |
| 2238 |
|
| 2239 |
- Allow sign normalization: |
| 2240 |
|
| 2241 |
* Add an option to the parser to allow signs to be entered with the "all |
| 2242 |
positive" convention, and actually invert the signs right at the output |
| 2243 |
of the parser. Balance errors should be enhanced to emphasize which of |
| 2244 |
the postings should be increased or decreased, based on the sign of the |
| 2245 |
balance error and the type of each account. |
| 2246 |
|
| 2247 |
* For display, in the shell, provide a SIGN(account) function that allows |
| 2248 |
the user to multiply the inventory by, or a NORM(inventory, account) |
| 2249 |
function that would do that itself on the inventory. |
| 2250 |
|
| 2251 |
This whole thing should be a minor version. This would be a valuable feature |
| 2252 |
IMO, allowing users to choose their favorite convention would be a plus. |
| 2253 |
|
| 2254 |
- Do support rendering options to invert the amounts of the minus accounts. |
| 2255 |
This is an important feature. |
| 2256 |
|
| 2257 |
- The new balance sheets should be able to invert the numbers (and then they |
| 2258 |
should get rendered differently). Basically, every number shown should be |
| 2259 |
either in signed or cr/dr format. We should be able to switch between the |
| 2260 |
two at render time. This should work across all number-rendering routines |
| 2261 |
everywhere--do this centrally. |
| 2262 |
|
| 2263 |
- In the balance sheet and income statement, we need to render the amounts |
| 2264 |
inverted (and in a slightly different style). |
| 2265 |
|
| 2266 |
|
| 2267 |
* Sanity Check For Conversions |
| 2268 |
|
| 2269 |
- Insert a validation check when transferring amounts to the balance sheet |
| 2270 |
that the implied rate of the conversion entries is within certain bounds of |
| 2271 |
the price, for each pair of commodities (find a way). These bounds should be |
| 2272 |
proportional to the variance of the price. This would just provide an extra |
| 2273 |
amount of good fuzzy feeling, knowing for sure that my solution to the |
| 2274 |
conversions problem is always meaningful and correct. |
| 2275 |
|
| 2276 |
* Add an "End Balance" Directive |
| 2277 |
|
| 2278 |
Some people are requesting and end balance directive. |
| 2279 |
|
| 2280 |
- Create one by fudging the date and storing a regular Balance directive. This |
| 2281 |
is an easy task. |
| 2282 |
https://bitbucket.org/blais/beancount/issues/118/create-a-balance_end-directive |
| 2283 |
|
| 2284 |
|
| 2285 |
* Improve the Include Directive |
| 2286 |
|
| 2287 |
- Support an include directive that is a URL, in order to fetch lists of |
| 2288 |
prices updated remotely, or via crontab. This way the dashboard does not |
| 2289 |
have to include code that fetches prices. |
| 2290 |
|
| 2291 |
- Idea: an include directive should have a "prefix" option, to add a prefix to |
| 2292 |
all accounts from the included file. |
| 2293 |
|
| 2294 |
|
| 2295 |
* Improvements to Price Fetching |
| 2296 |
|
| 2297 |
- Infer the rendering precision for inverted currencies from only the list of |
| 2298 |
previous prices. Run a DisplayContext on those and do similar |
| 2299 |
quantization/rounding automatically. This would make a lot of sense, |
| 2300 |
especially when inversion generates a very large number of digits. |
| 2301 |
|
| 2302 |
- Write a script that will iterate and fetch all the missing dates on Friday, |
| 2303 |
or last DOM for the required portfolio during the entire duration, or allow |
| 2304 |
providing a frequency string (does rrule have one?) and let bean-price do |
| 2305 |
this natively. This will work the API. |
| 2306 |
|
| 2307 |
- You have to deal with the case whereby two currencies provide incompatible |
| 2308 |
conversions of each other. This would potentially result in colliding |
| 2309 |
entries in the price database. Not sure how to deal with those yet. |
| 2310 |
|
| 2311 |
- Write a script that will automatically fetch the dates I held various |
| 2312 |
positions at cost for throughout the history and a list of weekly dates to |
| 2313 |
fetch rates for. |
| 2314 |
|
| 2315 |
** OANDA |
| 2316 |
|
| 2317 |
- Finish the implementation of my delayed rate fetcher from OANDA. |
| 2318 |
|
| 2319 |
|
| 2320 |
* Will & Legacy |
| 2321 |
|
| 2322 |
One of the tasks I'd like to Beancount to be able to do is to produce |
| 2323 |
documents which list the account details of assets and liabilities, including |
| 2324 |
account number, institutino address, phone numbers, contact persons, etc. in |
| 2325 |
order to encrypt and share with a trusted one, in case I pass away. |
| 2326 |
|
| 2327 |
- Create a new type of report that produces a readable document with the |
| 2328 |
entire list of accounts and descriptions and account numbers pulled from |
| 2329 |
metadata. This document should be attacheable to a will, to describe all the |
| 2330 |
accounts, institutions' phone numbers, account numbers, in a way that makes |
| 2331 |
it possible for someone executing a will to easily understand that full |
| 2332 |
nature of the assets and how to reach the relevant institutions to liquidate |
| 2333 |
the assets. |
| 2334 |
|
| 2335 |
- In order to have someone else be able to take care of your business, you |
| 2336 |
should be able to produce a list of the accounts open at the end of the |
| 2337 |
period, with the account ids and balances. This should be printable and |
| 2338 |
storable, for someone else to take care of your things in case you die. |
| 2339 |
|
| 2340 |
* Gains Sans Commissions |
| 2341 |
|
| 2342 |
How do I take into account the commissions and fees adjustment on the cost |
| 2343 |
basis for a position? You need to be able to accommodate commissions as not |
| 2344 |
being part of the gain. |
| 2345 |
|
| 2346 |
BRANCH: 'sanscost' |
| 2347 |
|
| 2348 |
- This work depends on the completion of the 'booking' branch. |
| 2349 |
|
| 2350 |
- Capital gains should not count commissions nor on the buy nor on the |
| 2351 |
sell side. How do we book them like this? Can we count this somehow |
| 2352 |
automatically? Misc accounts? Not sure. |
| 2353 |
|
| 2354 |
* Normalized Credit & Debits |
| 2355 |
|
| 2356 |
One idea is to allow the user to work in terms of credits and debits, using |
| 2357 |
all (largely) positive signs for all postings. |
| 2358 |
|
| 2359 |
- Make this possible in the input, switch the signs in the parser. |
| 2360 |
|
| 2361 |
- Also render the numbers with normalized, positive signs only. |
| 2362 |
|
| 2363 |
- Make it possible to render the credits and debit numbers separately, putting |
| 2364 |
them in the correct column based on their account type AND sign. |
| 2365 |
|
| 2366 |
- Rendering only: Color the background of numbers with an inverted sign (e.g. |
| 2367 |
payments in a liability account) differently! There should be modes to |
| 2368 |
rendering balance sheets and income statements with inverted amounts, and it |
| 2369 |
should all be done client-side. When amounts are rendered as credits/debits, |
| 2370 |
color their background distinctly, so that it's obvious what kind of sign |
| 2371 |
convention is in use. |
| 2372 |
|
| 2373 |
* Total Balance |
| 2374 |
|
| 2375 |
Currently, the Balance directive only asserts the currency of its attached |
| 2376 |
amount. Some users have requested a balance check that is exhaustive, that is, |
| 2377 |
which asserts that the inventory matches the contents of a directive. |
| 2378 |
|
| 2379 |
- Implement some parser-level, generic directive for specifying the contents |
| 2380 |
of an inventory (units only). |
| 2381 |
|
| 2382 |
- Implement a total balance assertion using the following syntax: |
| 2383 |
|
| 2384 |
YYYY-MM-DD balance |
| 2385 |
account amount |
| 2386 |
account amount |
| 2387 |
account amount |
| 2388 |
account amount |
| 2389 |
|
| 2390 |
The distinction is that it's on multiple lines. Maybe call it balance*. |
| 2391 |
|
| 2392 |
- A variant on this would be a balance directive which asserts the cost basis |
| 2393 |
of an account, either by currency, or total. Perhaps this could be useful, |
| 2394 |
and if anything, easy to implement. See past discussion with Eric Weigle on |
| 2395 |
the ledger-cli mailing-list. |
| 2396 |
|
| 2397 |
- When you will add cost basis to the balance assertions, make the padding |
| 2398 |
directive also able to fill in with some cost basis. This would be useful |
| 2399 |
for mharris (see discussion on Language Syntax document). |
| 2400 |
|
| 2401 |
- Create a new directive for balance that checks for the complete balance. |
| 2402 |
Ideas for syntax: |
| 2403 |
|
| 2404 |
2014-06-20 balance Assets:Some:Account 10 HOOL, 640.40 USD FULL |
| 2405 |
2014-06-20 balance Assets:Some:Account [10 HOOL, 640.40 USD] |
| 2406 |
2014-06-20 balance Assets:Some:Account <10 HOOL, 640.40 USD> |
| 2407 |
2014-06-20 balance* Assets:Some:Account 10 HOOL, 640.40 USD |
| 2408 |
2014-06-20 full_balance Assets:Some:Account 10 HOOL, 640.40 USD |
| 2409 |
|
| 2410 |
Maybe we should define a general syntax for input'ing an Inventory object, |
| 2411 |
that could be read at parsing time. |
| 2412 |
|
| 2413 |
* Wash Sales |
| 2414 |
|
| 2415 |
Right now [2016-04-20], there is an experimental plugin that's there to |
| 2416 |
remove the commissions from the P/L (experiemnts/washsales/commissions.py). |
| 2417 |
This is then used by two custom scripts |
| 2418 |
(experiemnts/washsales/list-wash-sales.py) which uses metadata from the |
| 2419 |
postings marked to be washed by the user, and all the "washing" takes place |
| 2420 |
somewhere in that script, not in Beancount. There is also another script |
| 2421 |
(experiemnts/washsales/list-lots.py) which is used to list the resulting |
| 2422 |
lots. |
| 2423 |
|
| 2424 |
- Document all cases of wash sales and support arbitrary washing of sales in |
| 2425 |
an official Beancount plugin. |
| 2426 |
|
| 2427 |
- You need to make the washing of the lots a part of regular Beancount, the |
| 2428 |
washing of the lots needs to occur within Beancount, not in |
| 2429 |
the list-wash-sales. |
| 2430 |
|
| 2431 |
For example, this transaction: |
| 2432 |
|
| 2433 |
2015-05-19 * "Sold some" ^c2fbec103d99 |
| 2434 |
ref: 036 |
| 2435 |
Assets:US:Broker:HOOL -X HOOL {538.6500 USD} @ 552.4460 USD |
| 2436 |
Assets:US:Broker:HOOL -X HOOL {577.5400 USD} @ 552.4460 USD |
| 2437 |
wash: TRUE |
| 2438 |
Expenses:Financial:Commissions 0.19 USD |
| 2439 |
Assets:US:Broker:Cash XXXX.XX USD |
| 2440 |
Income:US:Broker:HOOL:PnL |
| 2441 |
|
| 2442 |
Should be converted to this one automatically: |
| 2443 |
|
| 2444 |
2015-05-19 * "Sold some" ^c2fbec103d99 |
| 2445 |
ref: 036 |
| 2446 |
Assets:US:Broker:HOOL -X HOOL {538.6500 USD} @ 552.4460 USD |
| 2447 |
Assets:US:Broker:HOOL -X HOOL {577.5400 USD} @ 552.4460 USD |
| 2448 |
wash: TRUE |
| 2449 |
Expenses:Financial:Commissions 0.19 USD |
| 2450 |
Assets:US:Broker:Cash XXXX.XX USD |
| 2451 |
Income:US:Broker:HOOL:PnL |
| 2452 |
Income:US:Broker:HOOL:PnL YYY.YY USD |
| 2453 |
Income:US:Broker:HOOL:Adjustments -YYY.YY USD |
| 2454 |
|
| 2455 |
The list-wash-sales script ought to be a simple gathering of the already |
| 2456 |
washed sales. |
| 2457 |
|
| 2458 |
- Listing the lots in a particular account at a particular date should be |
| 2459 |
carried out not with a custom experiments/washsales/list-lots.py script, but |
| 2460 |
rather by writing a simple SQL query. This requires the 'booking' branch to |
| 2461 |
be completed, and the CSV output from bean-query to work as well. Do this. |
| 2462 |
|
| 2463 |
- Enumerate the various cases for wash sales, write a nice document for them, |
| 2464 |
and write example cases for each, to be referenced from the document. Solve |
| 2465 |
this completely, using metadata and a plugin. |
| 2466 |
|
| 2467 |
|
| 2468 |
I wrote a script to wash losses for entire lots. This still needs more work: |
| 2469 |
ideally, one should be able to insert an arbitrary cost basis adjustment for |
| 2470 |
each lot. Do this, and integrate with the wash-sales-tracker implemented by |
| 2471 |
bbreslauer. |
| 2472 |
|
| 2473 |
- It should be possible to produce input for the wash sales calculation, to |
| 2474 |
then insert metadata or some other set of postings on each lot, and to |
| 2475 |
produce output suitable to be printed and sent to the IRS. |
| 2476 |
|
| 2477 |
- There is already a plugin which allows the user to wash away the P/L of |
| 2478 |
entire lots under experiments/washsales. Enhance that to support arbitrary |
| 2479 |
adjustments and move that into 'beancount.plugins'. |
| 2480 |
|
| 2481 |
* Stock Splits |
| 2482 |
|
| 2483 |
Beancount currently does not deal with stock splits, but you can deal with it |
| 2484 |
yourself. Essentially, you have to write a single transaction which empties |
| 2485 |
out your positions and recreates them at their new cost basis. You process |
| 2486 |
could be automated, probably the best way to carry this out would be to write |
| 2487 |
a plugin that provides a new custom directive. |
| 2488 |
|
| 2489 |
- Find a way to automatically create multiple currencies to account for stock |
| 2490 |
splits. The user should not have to do this themselves: |
| 2491 |
|
| 2492 |
"One choice you have is whether you want to keep the same symbol pre and post |
| 2493 |
split. If you keep the same symbol the price database will show a drop in |
| 2494 |
price over time. If not, choose a new symbol for the post split period. So far |
| 2495 |
in my own file I use the same symbol but I think eventually I'd like to find a |
| 2496 |
way to differentiate them automatically and have a multiplier in the price |
| 2497 |
database, because doing it manually is not nice. In any case both methods |
| 2498 |
work." |
| 2499 |
|
| 2500 |
Perhaps a directive could be created to declare them that would |
| 2501 |
automatically insert converting transactions, but that makes it difficult to |
| 2502 |
deal with weird cases, like oddly unequal splits (e.g. Google A/C), or cases |
| 2503 |
with spinoffs, as below. Perhaps the splitting transaction should be |
| 2504 |
inserted automatically, but that the split directive would just create a new |
| 2505 |
currency name, internally. |
| 2506 |
|
| 2507 |
A currency would then be referred to by a pair of (name, date), and that |
| 2508 |
would resolve to a internal currency name. |
| 2509 |
|
| 2510 |
- (IDEA) In order to create suitable stock split entries that would look like |
| 2511 |
this: |
| 2512 |
|
| 2513 |
2013-04-01 * "split 4:1" |
| 2514 |
Assets:CA:ITrade:AAPL -40 AAPL {{5483.09 USD}} |
| 2515 |
Assets:CA:ITrade:AAPL 160 AAPL {{5483.09 USD}} |
| 2516 |
|
| 2517 |
You could easily add support for a directive that looks like this: |
| 2518 |
|
| 2519 |
2013-04-01 split Assets:CA:ITrade:AAPL 4:1 AAPL |
| 2520 |
|
| 2521 |
This would allow the user to do some processing specific to stock splits by |
| 2522 |
processing the explicit stock split entries. |
| 2523 |
|
| 2524 |
- Include this in the user examples, + stock splits: |
| 2525 |
|
| 2526 |
2013-04-01 * "name change" |
| 2527 |
|
| 2528 |
Assets:CA:ITrade:AAPL -40 AAPL {{5483.09 USD}} |
| 2529 |
Assets:CA:ITrade:NEWAAPL 40 NEWAAPL {{5483.09 USD}} |
| 2530 |
|
| 2531 |
2013-04-01 * "spinoff" |
| 2532 |
Assets:CA:ITrade:KRFT -100 KRFT {{20000 USD}} |
| 2533 |
Assets:CA:ITrade:KRFT 100 KRFT {{17000 USD}} |
| 2534 |
Assets:CA:ITrade:FOO 20 FOO {{ 3000 USD}} |
| 2535 |
|
| 2536 |
- Because of the way we currently deal with stock splits, allow a list of |
| 2537 |
commodity names on the commodity directive, so you can do this: |
| 2538 |
|
| 2539 |
1998-01-01 commodity CRA,CRA1 |
| 2540 |
name: "Celera Corporation" |
| 2541 |
asset-class: "Stock" |
| 2542 |
ticker: "CRA" |
| 2543 |
quote: USD |
| 2544 |
|
| 2545 |
* Sharing Expenses |
| 2546 |
** Producing Journals as Tables |
| 2547 |
|
| 2548 |
- Figure out some way to report the names of the other accounts of a |
| 2549 |
particular account. For example, render a journal as a detailed expense |
| 2550 |
report, for a set of accounts (e.g., Expenses:*) pulling out amounts in |
| 2551 |
various columns based on other expressions (e.g. Assets:Cash:Caroline). |
| 2552 |
|
| 2553 |
This would be an approximation: |
| 2554 |
|
| 2555 |
bean-query $L " |
| 2556 |
SELECT date, account, maxwidth(description, 25), convert(position, 'USD') |
| 2557 |
FROM has_account('Caroline') |
| 2558 |
WHERE (NOT account ~ 'Caroline') |
| 2559 |
AND (NOT account ~ 'Rounding') |
| 2560 |
AND account ~ 'Expenses:';" |
| 2561 |
|
| 2562 |
However it doesn't work so well. The description isn't good enough. |
| 2563 |
A better approach would be to just provide a special which lists all the |
| 2564 |
other accounts in a single string. |
| 2565 |
|
| 2566 |
* Book Unrealized Gains Correctly |
| 2567 |
|
| 2568 |
- IMPORTANT: Unrealized gains for opened periods should show only gains since |
| 2569 |
the openings. In other words, unrealized gains should be realized |
| 2570 |
marked-to-market at the time of open. |
| 2571 |
|
| 2572 |
- Unrealized gain when rendering for closed years does not appear. |
| 2573 |
Perhaps we should insert the unrealized gains during close operation. |
| 2574 |
|
| 2575 |
Idea: close realized gains along with close(), so that they don't show up for |
| 2576 |
the latest year. |
| 2577 |
|
| 2578 |
- Unrealized gains should be modified so that they replace the book value of |
| 2579 |
the positions that they adjust, and can be applied at multiple dates. Then, |
| 2580 |
the realization should automatically occur both at the beginning and end of |
| 2581 |
reporting periods. |
| 2582 |
|
| 2583 |
** Old Notes |
| 2584 |
|
| 2585 |
- Unrealized gains should not be added if the gain is zero. |
| 2586 |
|
| 2587 |
- There's a fundamental question about which date to be used for pricing |
| 2588 |
entries. This really would depend on the view. If this is a period view, the |
| 2589 |
date of the last entry is most appropriate. If it is any other kind of view, |
| 2590 |
the latest price is best. All the reports should be adjusted for this. |
| 2591 |
|
| 2592 |
** Old Notes |
| 2593 |
|
| 2594 |
- Unrealized capital gains could be inserted automatically into special |
| 2595 |
sub-accounts, based on the current price and the cost-basis of particular |
| 2596 |
accounts. This could be inserted automatically! e.g. |
| 2597 |
|
| 2598 |
DATE check Assets:US:Ameritrade:AAPL 10 AAPL {200 USD} |
| 2599 |
|
| 2600 |
DATE price AAPL 210 USD |
| 2601 |
|
| 2602 |
Assets:US:Ameritrade:AAPL 2000 USD |
| 2603 |
Assets:US:Ameritrade:AAPL:Gains 100 USD |
| 2604 |
|
| 2605 |
The "Gains" subaccount could be inserted automatically if the price differs |
| 2606 |
from the cost basis... this would be a clever way to represent this! We |
| 2607 |
could even do this by inserting a transaction automatically with an |
| 2608 |
offsetting account... actually this would be the RIGHT way to do this! |
| 2609 |
|
| 2610 |
We need an option to designate which subaccount leaf to create all |
| 2611 |
the new transactions for: |
| 2612 |
|
| 2613 |
%option account_unrealized "Unrealized" |
| 2614 |
|
| 2615 |
2013-05-23 'A "Booking unrealized gains for AAPL" |
| 2616 |
Assets:US:Ameritrade:AAPL:Unrealized 230.45 USD |
| 2617 |
Income:Unrealized -230.45 USD |
| 2618 |
|
| 2619 |
By doing this, the reporting does not have anything to do... it can choose |
| 2620 |
to report positions at cost or in held units, and whether the gains are |
| 2621 |
included or not entirely depends on whether these transactions have been |
| 2622 |
inserted in or not. |
| 2623 |
|
| 2624 |
|
| 2625 |
* Pivot Reports |
| 2626 |
|
| 2627 |
An interesting reporting idea which comes back again and again is the ability |
| 2628 |
to produce a year-on-year or month-by-month summary of income and expenses, as |
| 2629 |
a table. This is essentially a pivot table where the date (year or month) is |
| 2630 |
rendered as the X axis, and accounts used on the X axis. Account balances are |
| 2631 |
aggregated in the cells. |
| 2632 |
|
| 2633 |
- Implement PIVOT reports directly from the shell. These are oft-requested. |
| 2634 |
|
| 2635 |
- Including RSP contribs, like my big spreadsheet that I crafted manually? Can |
| 2636 |
I do that? That would be awesome! |
| 2637 |
|
| 2638 |
- 'csv-pivot': build this: a script that can accept a CSV file and render a |
| 2639 |
CSV pivot table from it. The reason we need support is in order to carry out |
| 2640 |
operations on columns of inventories. Maybe we should impleemnted some sort |
| 2641 |
of swiss-knife tool that is able to parse inventories from columns and |
| 2642 |
perform various operations on them, aggregations, etc. using Beancount's |
| 2643 |
Inventory() class. This could be a powerful tool! Make it possible to parse |
| 2644 |
and create Inventory objects from cells. |
| 2645 |
|
| 2646 |
- One kind of report that would be GREAT is a single grid with all income accounts |
| 2647 |
on the left with year by year on the horizontal. An overview of all the |
| 2648 |
years. Same with month-by-month report. |
| 2649 |
|
| 2650 |
** Use Metadata for Pivoting |
| 2651 |
|
| 2652 |
- One idea Ledger uses well is the ability to associate key-values meta-data |
| 2653 |
to transaction objects, a-la-Common Lisp. See the --pivot feature. It seems |
| 2654 |
a bit superfluous at the moment, but may be useful in order to provide the |
| 2655 |
ability to implement custom aggregations eventually, instead of using the |
| 2656 |
strings. Maybe the payee could be a special case of this, e.g payee="value" |
| 2657 |
|
| 2658 |
(From mailing-list): |
| 2659 |
|
| 2660 |
Take this example: |
| 2661 |
|
| 2662 |
2011-01-01 * Opening balance |
| 2663 |
Assets:Cash 25.00 GBP |
| 2664 |
Equity:Opening balance -25.00 GBP |
| 2665 |
|
| 2666 |
2011-02-01 * Sell to customer AAA |
| 2667 |
; Customer: AAA |
| 2668 |
; Invoice: 101 |
| 2669 |
Assets:Receivables 10.00 GBP |
| 2670 |
Income:Sale -10.00 GBP |
| 2671 |
|
| 2672 |
2011-02-02 * Sell to customer BBB |
| 2673 |
; Customer: BBB |
| 2674 |
; Invoice: 102 |
| 2675 |
Assets:Receivables 11.00 GBP |
| 2676 |
Income:Sale -11.00 GBP |
| 2677 |
|
| 2678 |
2011-02-03 * Sell to customer AAA |
| 2679 |
; Customer: AAA |
| 2680 |
; Invoice: 103 |
| 2681 |
Assets:Receivables 12.00 GBP |
| 2682 |
Income:Sale -12.00 GBP |
| 2683 |
|
| 2684 |
2011-02-03 * Money received from customer AAA for invoice 101 |
| 2685 |
; Customer: AAA |
| 2686 |
; Invoice: 101 |
| 2687 |
Assets:Cash 10.00 GBP |
| 2688 |
Assets:Receivables -10.00 GBP |
| 2689 |
|
| 2690 |
Now you can see how much each customer owes you: |
| 2691 |
|
| 2692 |
ledger -f d bal assets:receivables --pivot Customer |
| 2693 |
23.00 GBP Customer |
| 2694 |
12.00 GBP AAA:Assets:Receivables |
| 2695 |
11.00 GBP BBB:Assets:Receivables |
| 2696 |
-------------------- |
| 2697 |
23.00 GBP |
| 2698 |
|
| 2699 |
And you can see which invoices haven't been paid yet: |
| 2700 |
|
| 2701 |
ledger -f d bal assets:receivables --pivot Invoice |
| 2702 |
23.00 GBP Invoice |
| 2703 |
11.00 GBP 102:Assets:Receivables |
| 2704 |
12.00 GBP 103:Assets:Receivables |
| 2705 |
-------------------- |
| 2706 |
23.00 GBP |
| 2707 |
|
| 2708 |
* Reporting to Single Currency |
| 2709 |
|
| 2710 |
Another oft-requested feature is the ability to boil down all assets to a |
| 2711 |
single target currency, converting to cost, and then to the final currency. |
| 2712 |
The point is to show a single column of value which can be operated on. |
| 2713 |
|
| 2714 |
|
| 2715 |
* Plugins |
| 2716 |
|
| 2717 |
I've had various ideas for writing new plugins, some make sense, some don't, |
| 2718 |
but in any case, these accumulate here. |
| 2719 |
|
| 2720 |
- Would it make sense for every plugin to provide a validation function? We |
| 2721 |
could then move all the validation routines in their plugin file. I very |
| 2722 |
much like this idea: it creates more isolation for routines and less |
| 2723 |
dependencies. Open/Close, Balance checks, do seem to be able to fit in this |
| 2724 |
category. Those functions should return only a single list of errors, no |
| 2725 |
entries, and the calling function should perform a simple hash check to |
| 2726 |
ensure that the mutable portion of the entries hasn't been modified by the |
| 2727 |
user-provided validation functions. |
| 2728 |
'beancount.ops.documents' could benefit from this split. |
| 2729 |
|
| 2730 |
** Plugin: sellgains |
| 2731 |
|
| 2732 |
- This would probably benefit in being renamed to 'check_gains', a better |
| 2733 |
name. |
| 2734 |
|
| 2735 |
** Plugin: flagged_subset |
| 2736 |
|
| 2737 |
- Idea: Write two plugins... |
| 2738 |
|
| 2739 |
* One that check that all the postings with a particular flag on them |
| 2740 |
balance to zero. |
| 2741 |
|
| 2742 |
* One that forks out all postings with a particular flag to a separate |
| 2743 |
transaction. |
| 2744 |
|
| 2745 |
This is from an email thread with redstreet0 in Jan 2015: |
| 2746 |
|
| 2747 |
I said: " |
| 2748 |
|
| 2749 |
- Define yourself a special account under a common base, e.g. Equity:Extra:* |
| 2750 |
for all those special accounts. |
| 2751 |
- Write a plugin that will ensure that for all transactions that include at |
| 2752 |
least one posting on an Equity:Extra account, the sum of all the weights of |
| 2753 |
these postings is zero. |
| 2754 |
- If you want to automatically fill in missing postings these accounts, you can |
| 2755 |
also do that from a plugin. |
| 2756 |
- Your plugin should be configurable with the root account you want to make |
| 2757 |
special in that way, in this case "Equity:Extra". See other plugins for how |
| 2758 |
to pass in a configuration. |
| 2759 |
- You can optionally filter out all those Equity:Extra:* postings in the |
| 2760 |
reports using the FROM syntax. Otherwise the detail of the Equity:Extra |
| 2761 |
accounts in the balance sheet will be pretty harmless anyhow, but you could |
| 2762 |
remove it. |
| 2763 |
|
| 2764 |
Note that instead of identifying these special postings using a known root |
| 2765 |
account, you could instead trigger that capability by using posting flags. |
| 2766 |
|
| 2767 |
(Also, note that if all you care about is the balanced virtual accounts, that's |
| 2768 |
entirely equivalent to a second transaction on the same date. I could be |
| 2769 |
convinced to add that in, a special state for a subset of postings, as a |
| 2770 |
"shadow transaction" whereby the parser splits the single transaction into two |
| 2771 |
separate ones, perhaps adding a tag to the shadow one so that you can filter |
| 2772 |
them out at will. That could be implemented as a plugin, BTW, separating |
| 2773 |
postings that have a particular flag on them.) |
| 2774 |
|
| 2775 |
". This could be used to simulate balanced virtual postings. |
| 2776 |
|
| 2777 |
** Plugin: alt_date |
| 2778 |
|
| 2779 |
- Create a plugin that allows you to replace the date with some of the |
| 2780 |
metadata fields, e.g. to create alternative date histories. |
| 2781 |
|
| 2782 |
"Note that if you _really_ badly wanted alternative history, you could you could |
| 2783 |
easily enter alternative dates as metadata (Beancount will recognize and parse |
| 2784 |
a datetime.date type as a value for metadata) and you coudl write _very_ simple |
| 2785 |
plugin that converts all the transactions to use the alternative date where |
| 2786 |
present in the metadata (or otherwise leave the date as is). You could even |
| 2787 |
define yourself multiple different sets of alternative dates by using different |
| 2788 |
metadata fields... you can go crazy if you like and create multiple versions of |
| 2789 |
history that way. But that would be segregated to a plugin so I'm comfortable |
| 2790 |
with it, do whatever you like in plugins, they're perfect for experimentation." |
| 2791 |
|
| 2792 |
** Plugin: unverified |
| 2793 |
|
| 2794 |
- Idea! Allow the selection or reporting of all the postings since their |
| 2795 |
balance check in each account. These postings can be called "unverified" |
| 2796 |
and it should be possible to report just those. Maybe we can restrict |
| 2797 |
further to the list of those without a '*' flag, or maybe just those with a |
| 2798 |
'!' flag. "Show me all that's unverified right now." |
| 2799 |
|
| 2800 |
Can this be accomplished with the shell? I suppose a new plugin could be |
| 2801 |
created to flag unverified entries with meta-data and then filter on that. |
| 2802 |
That's probably the best way to do this. |
| 2803 |
|
| 2804 |
** Plugin: no_zero_amounts |
| 2805 |
|
| 2806 |
- Move the check for zero units ("Amount is zero" from the parser) to a |
| 2807 |
plugin, and make this selectively removable. |
| 2808 |
|
| 2809 |
** Plugin: no_unused_pad |
| 2810 |
|
| 2811 |
- The validation check that pushes an error on unused pad directives should |
| 2812 |
be moved to a plugin, that should be optional. There is rationale for |
| 2813 |
allowing to keep unused pad directives. Don't be so strict, Martin. |
| 2814 |
|
| 2815 |
|
| 2816 |
** Plugin: init_pad |
| 2817 |
|
| 2818 |
- Idea: a plugin that autopads all initial balance assertions! Do it for |
| 2819 |
demos, will be very useful for making demos easier, not having to be so |
| 2820 |
strict. |
| 2821 |
|
| 2822 |
- Write a plugin that automatically inserts a padding directive for accounts |
| 2823 |
with no open directive and with a balance check. |
| 2824 |
|
| 2825 |
** Plugin: multi_pad |
| 2826 |
|
| 2827 |
- New plugin type: a kind of spreaded Pad directive, that creates multiple |
| 2828 |
pads at regular intervals. This is to deal with smooth cash distributions or |
| 2829 |
work meals assignment. You should be able to specify the frequency and |
| 2830 |
have it automatically insert a number of entries to spread the expense |
| 2831 |
evenly. 'evenpad', 'multipad', 'distribution'? This should most definitely |
| 2832 |
be a plugin. |
| 2833 |
|
| 2834 |
** Plugin: cost_pad |
| 2835 |
|
| 2836 |
- (pad) Review the possibility of padding units held at cost: |
| 2837 |
|
| 2838 |
"The reason it fails is that there must have been units of those commodities |
| 2839 |
held at cost before the pad date, and it is an error to pad commodities at |
| 2840 |
cost, because Beancount has no way to know what the cost basis of those |
| 2841 |
commodities should be." |
| 2842 |
|
| 2843 |
** Plugin: auto_remove |
| 2844 |
|
| 2845 |
- Add a auto-remove-unused part of the auto_accounts plugin, |
| 2846 |
that automatically removes Open directives for unused accounts. This is |
| 2847 |
useful for demos and such. |
| 2848 |
|
| 2849 |
** Plugin: monotonic |
| 2850 |
|
| 2851 |
- Write a plugin that enables a check that all postings' amounts are of the |
| 2852 |
correctly allowed sign, e.g. Expenses should almost always be a positive |
| 2853 |
amount, Income a negative one, Assets can be both, also Liabilities. If an |
| 2854 |
amount is posted in the contra direction, this should trigger a warning, |
| 2855 |
unless the transaction is flag with a particular character, or some special |
| 2856 |
tag is present. |
| 2857 |
|
| 2858 |
|
| 2859 |
** Plugin: match_pending |
| 2860 |
|
| 2861 |
- Implement beancount.plugins.tag_pending as a general feature of links... |
| 2862 |
this ought to be built-in by default, this is a great idea. |
| 2863 |
|
| 2864 |
** Plugin: balance_constraint |
| 2865 |
|
| 2866 |
- Idea: You could add a further constraint property to an account name: that |
| 2867 |
the amounts may never be allowed to balance to a particular sign. This |
| 2868 |
could be useful to avoid data entry mistakes. You could even write a doc |
| 2869 |
just focused on all features designed to avoid data entry mistakes. |
| 2870 |
|
| 2871 |
- Create a verification plugin that verifies that the balance of an account |
| 2872 |
does not go under some negative threshold below/above zero. This way you |
| 2873 |
could check that account balances are of the expected size. (The plugin |
| 2874 |
should accept transient negative balances within the day though, as those |
| 2875 |
are order-dependent.) |
| 2876 |
|
| 2877 |
** Plugin: tip_calculator |
| 2878 |
|
| 2879 |
- Write another example plugin that splits "Expenses:Restaurant" legs into |
| 2880 |
two two postings: "Expenses:Restaurant x 83%" and "Expenses:Tips x 17%". |
| 2881 |
|
| 2882 |
** Plugin: gifi_reporting |
| 2883 |
|
| 2884 |
- You could write a script to automatically fill this form: |
| 2885 |
http://www.cra-arc.gc.ca/E/pub/tg/rc4088/rc4088-12e.pdf |
| 2886 |
|
| 2887 |
"With Beancount, one thing that would be doable _outside_ of Beancount, as |
| 2888 |
a separate script, is to associate a set of accounts to these GIFI codes and |
| 2889 |
automatically generate the forms." |
| 2890 |
|
| 2891 |
** Plugin: sans_cost |
| 2892 |
|
| 2893 |
Capital Gain Without Cost. |
| 2894 |
|
| 2895 |
- Implement the proposal for putting the capital gain in the cost as a plugin |
| 2896 |
that transforms the relevant transactions, those tagged as such. This will |
| 2897 |
require some loosening of the booking method in order to make it easier to |
| 2898 |
disambiguate a sale, and some good debugging tools as well. |
| 2899 |
|
| 2900 |
You could automatically look for the right amounts by looking at the signs. |
| 2901 |
I think you could automate a lot of it. |
| 2902 |
|
| 2903 |
- Compare with what I've done for wash sales for TY2015. |
| 2904 |
|
| 2905 |
** Plugin: avco_checker |
| 2906 |
|
| 2907 |
Strict Average Cost Inventory Booking Checker. |
| 2908 |
|
| 2909 |
- Build a plugin that will check that accounts with average cost inventory |
| 2910 |
booking method only have such reductions in them: |
| 2911 |
|
| 2912 |
https://docs.google.com/document/d/1F8IJ_7fMHZ75XFPocMokLxVZczAhrBRBVN9uMhQFCZ4/edit#heading=h.m74dwkjzqojh |
| 2913 |
|
| 2914 |
"Another approach would be to not enforce these aggregations, but to provide a |
| 2915 |
plugin that would check that for those accounts that are marked as using the |
| 2916 |
average cost inventory booking method by default, that only such bookings |
| 2917 |
actually take place." |
| 2918 |
|
| 2919 |
This is, of cource, to be implemented only after implementing support for |
| 2920 |
the average cost inventory booking method. |
| 2921 |
|
| 2922 |
** Plugin: match_pending |
| 2923 |
|
| 2924 |
- Write a plugin that will pair up (link) matching transactions posting to a common |
| 2925 |
account; this could be used to properly pair up the transactions to |
| 2926 |
Liabilities:AccountsPayable, which would be very useful. |
| 2927 |
|
| 2928 |
** Plugin: at_cost_only |
| 2929 |
|
| 2930 |
- Idea for one of those constraint plugins: Create a plugin whereby you |
| 2931 |
declare some currencies and assert that any units in them are always held at |
| 2932 |
cost. |
| 2933 |
|
| 2934 |
** Plugin: subset_balances |
| 2935 |
|
| 2936 |
- Create a plugin that filters out postings with a particular per-posting |
| 2937 |
flag, and that checks that they are balanced by themselves. |
| 2938 |
|
| 2939 |
|
| 2940 |
** Super-Plugins: Pedantic & Auto |
| 2941 |
|
| 2942 |
There are two groups of plugins which I use quite often, and would benefit |
| 2943 |
from it being possible to enable all at the same time: "auto everything" and |
| 2944 |
"super pedantic." Ideally the list of actual plugins being run would be |
| 2945 |
expanded in the loader. I think we ought to just make the loader support |
| 2946 |
modules in its __plugins__ attribute, and it would insert them this way in |
| 2947 |
options_map, and run them individually, or maybe use another module attribute, |
| 2948 |
e.g. __plugins_delegate__ or whatever.. |
| 2949 |
|
| 2950 |
- (pedantic) Create a new plugin-of-plugins which enables all the possible |
| 2951 |
constraining other plugins in order to make Beancount as tight as possible |
| 2952 |
by default. Making the hardcore validation into a plugin might be a good way |
| 2953 |
to provide a strict mode. You could build a "beancount.plugins.pedantic" |
| 2954 |
plugin-of-plugins. |
| 2955 |
|
| 2956 |
- (auto) Create a new plugin-of-plugins which enables all the auto-declaration |
| 2957 |
plugins in order to make crafting little test files as convenient as |
| 2958 |
possible. I do this all the time, I need this actually. You could build a |
| 2959 |
"beancount.plugins.auto" plugin-of-plugins. |
| 2960 |
|
| 2961 |
- Put all verification plugins, including nounused and noduplicates under |
| 2962 |
beancount.plugins.constraints.*. |
| 2963 |
|
| 2964 |
* Payees as Subaccounts |
| 2965 |
|
| 2966 |
Payees whose transactions always post to the same expense accounts may be |
| 2967 |
viewed as sub-accounts of those accounts, in some sense. I've been toying with |
| 2968 |
the idea of taking advantage of this in various ways. For example, one could |
| 2969 |
break down the balance of an account by payee, or conversely, use the leaf |
| 2970 |
account name as the payee itself (and remove it). I'm not sure if this useful. |
| 2971 |
This would also require some clean payee names. This section contains some |
| 2972 |
ideas about that. |
| 2973 |
|
| 2974 |
- Idea: Allow sub-account names to include a special character, e.g., '#', |
| 2975 |
(only one) that would indicate to the reporting facilities that, by default, |
| 2976 |
the aggregation should be reported to the parent account. A "detail" or |
| 2977 |
"verbose" switch could be used to trigger the detailing of subaccounts. For |
| 2978 |
example, |
| 2979 |
|
| 2980 |
Expenses:Health:Medical:#Claims |
| 2981 |
Expenses:Health:Medical:#PatientSavings |
| 2982 |
Expenses:Health:Medical:#ClaimsPayments |
| 2983 |
|
| 2984 |
would be reported as |
| 2985 |
|
| 2986 |
Expenses:Health:Medical |
| 2987 |
|
| 2988 |
by default, but with the detailed switch, would be reported as |
| 2989 |
|
| 2990 |
Expenses:Health:Medical:Claims |
| 2991 |
Expenses:Health:Medical:PatientSavings |
| 2992 |
Expenses:Health:Medical:ClaimsPayments |
| 2993 |
|
| 2994 |
This could be used for various subaccounts actually. It's a nice way to |
| 2995 |
guide reporting that does not complexify the semantics. |
| 2996 |
|
| 2997 |
- Idea: in the query language, provide a special Account:Payee field, in |
| 2998 |
order to play with the notion of payee-as-subacccount often discussed. |
| 2999 |
|
| 3000 |
- About the discrepancy between the concept of "Payee" and a superfluous lead |
| 3001 |
account, e.g. Internet:TimeWarner, which typically contains only |
| 3002 |
transactions from that payee: maybe we can elide the account name if it |
| 3003 |
contains only a single payee, or perhaps a warning may be issued? I don't |
| 3004 |
know. |
| 3005 |
|
| 3006 |
Basically, it would be nice to be able to have multiple payees in the same |
| 3007 |
category over time (e.g. Electricity, Internet) but to be able to separate |
| 3008 |
them somehow, without having to put the payee into the name. This is a |
| 3009 |
little fuzzy, and I'm not sure how to do it, because the imported payee |
| 3010 |
names are often not very clear and often truncated as well. |
| 3011 |
|
| 3012 |
Have you ever thought that Payees often end up functioning like an extra |
| 3013 |
subaccount? I've come to realize that for Payees that only ever touch a |
| 3014 |
single account, the line is really fuzzy there. I've been entertaining the |
| 3015 |
idea of automatically creating subaccounts for payees like that. |
| 3016 |
|
| 3017 |
- Write a script that will highlight some "payee vs tags vs subaccount" |
| 3018 |
invariants: |
| 3019 |
* Highlight payees that are always used with the same accounts |
| 3020 |
* Same with tags |
| 3021 |
|
| 3022 |
** Old Notes |
| 3023 |
|
| 3024 |
- Create a plugin that will define subaccounts for payees within accounts and |
| 3025 |
modify all the transactions accordingly. This would be a great way to kick |
| 3026 |
the tires on this idea without affecting the rest of the system. |
| 3027 |
|
| 3028 |
Expenses:Electricity:ConEdison |
| 3029 |
Expenses:Phone:TMobile |
| 3030 |
Expenses:Groceries:WholeFoodsMarket |
| 3031 |
Expenses:Groceries:UnionMarket |
| 3032 |
|
| 3033 |
- Should we define some notion of the default level for aggregation, per |
| 3034 |
account? For example, in Expenses:Electricity:ConEdison, the default level |
| 3035 |
of aggregation should be Expenses:Electricity. If we define that, using |
| 3036 |
subaccounts should not bother us much. |
| 3037 |
|
| 3038 |
* Budgets & Temporal Constraints |
| 3039 |
|
| 3040 |
The concept of "budgeting" should be implemented as a list of constraints on |
| 3041 |
top of what Beancount already offers. It could be segregated to a plugin, as |
| 3042 |
long as the input syntax is powerful enough to support it. Some people in the |
| 3043 |
'fava' team have already begun experimenting and that's why I added support |
| 3044 |
for a Custom directive. However, eventually this should be formalized a bit |
| 3045 |
more and unknown directives should be let to trickle through, and for plugins |
| 3046 |
to either register a validation function for the expected data types that were |
| 3047 |
seen (this wouldn't be grammar-level parsing, would have to be after the |
| 3048 |
grammar has run) or for them to validate their matching directives directly. |
| 3049 |
|
| 3050 |
- It would be useful to create a directive that checks that the balance |
| 3051 |
of an account in a time interval is lesser or greater than some specific |
| 3052 |
amount, e.g. |
| 3053 |
|
| 3054 |
Expenses:US:TY2014:SocSec <= 7254 USD ;; 6.2% of 117,000 USD |
| 3055 |
Expenses:US:TY2015:SocSec <= 7347 USD ;; 6.2% of 118,500 USD |
| 3056 |
|
| 3057 |
- "Envelope budgeting" is easily implemented like this: |
| 3058 |
|
| 3059 |
* A sub-account of a real assets account is market as special. |
| 3060 |
* Those sub-accounts are used to transfer funds from their parent account. |
| 3061 |
They are constrained to only ever transfer funds to and from that parent |
| 3062 |
account. |
| 3063 |
* Their transactions can simply be filtered out in order to remove the |
| 3064 |
budgeting aspect. |
| 3065 |
* You should be able to report balances on these accounts. In fact, since |
| 3066 |
they're marked as special, you should be able to gather all of them and |
| 3067 |
report the balances of all the envelopes. That's the summarization for the |
| 3068 |
budgeting function. |
| 3069 |
* Finally, some level of automation should be provided to automatically |
| 3070 |
replenish the enveloped at some set frequency (e.g. the beginning of each |
| 3071 |
month), including rolling unspent amounts. |
| 3072 |
|
| 3073 |
|
| 3074 |
** Plugin: budget |
| 3075 |
|
| 3076 |
- Implement a plugin that defines and enforces budget constraints. |
| 3077 |
|
| 3078 |
- Look at this syntax for an example of a recurring transaction specification: |
| 3079 |
https://www.roaringpenguin.com/products/remind |
| 3080 |
(Sumitted by user comment.) |
| 3081 |
|
| 3082 |
** Budgeting / Goals |
| 3083 |
|
| 3084 |
- We could easily add features for budgeting, e.g. somehow set goals and then |
| 3085 |
report on the difference between actual and the goal, and project in the |
| 3086 |
future according to rate, e.g.: |
| 3087 |
|
| 3088 |
;; Check that the total for this position between 2013-06-01 and 2013-12-31 < 800 USD |
| 3089 |
2013-12-31 goal Expenses:US:Restaurant 2013-06-01 < 800 USD |
| 3090 |
|
| 3091 |
;; Check that the balance of this account on 2013-12-31 is >= 1000 USD |
| 3092 |
2013-12-31 goal Assets:Savings >= 1000 USD |
| 3093 |
|
| 3094 |
* Filtering |
| 3095 |
** Views |
| 3096 |
|
| 3097 |
- Replace all views by filtering queries... the root page should still have |
| 3098 |
convenient links to various preset views, like the last five years, but |
| 3099 |
these links should be implemented using the filtering query feature! |
| 3100 |
Maybe it's worth allowing the user to specify common queries in the options |
| 3101 |
map, and provide links to them. Do this, and try removing some of my |
| 3102 |
subaccounts to simplify the accounts-trees somewhat. |
| 3103 |
|
| 3104 |
- The root page should feature a prominent input form that allows the user to |
| 3105 |
specify a query! This input needs live at the very root |
| 3106 |
|
| 3107 |
- (views) You should be able to filter to all transactions related to some |
| 3108 |
account, e.g. Immigration |
| 3109 |
|
| 3110 |
- IMPORTANT! Try to let through some of the non-transaction entries in the |
| 3111 |
view filtering. We obviously cannot let through balance entries, but |
| 3112 |
documents yes, depending on the type of filtering. We should do our best to |
| 3113 |
let all the entries carry through. |
| 3114 |
|
| 3115 |
** Custom dimensions |
| 3116 |
|
| 3117 |
- From discussion: |
| 3118 |
|
| 3119 |
| (digression not about virtual postings but answers auxiliary questions about |
| 3120 |
| them) |
| 3121 |
| |
| 3122 |
| Now this points to a more general idea that I've been pondering for a while: |
| 3123 |
| these "accounts" can often be seen as a set of flat dimensions, the fact that |
| 3124 |
| they have a hierarchy can get in the way. I tend to have accounts that look |
| 3125 |
| like this: |
| 3126 |
| |
| 3127 |
| TYPE:COUNTRY:INSTITUTION:ACCOUNT:SUBACCOUNT |
| 3128 |
| |
| 3129 |
| like this, for example: |
| 3130 |
| |
| 3131 |
| Assets:US:HSBC:Checking |
| 3132 |
| Assets:CA:RBC:Savings |
| 3133 |
| |
| 3134 |
| For these four dimensions, I actually like having most accounts (Assets, |
| 3135 |
| Liabilities and Income) specify them in this order. This does not always make |
| 3136 |
| sense though, especially for expense accounts; for those you wouldn't really |
| 3137 |
| want to have a COUNTRY dimension at the root. You want the general category |
| 3138 |
| only, so I'll have, for example: |
| 3139 |
| |
| 3140 |
| Expenses:Food:Restaurant |
| 3141 |
| Expenses:Food:Grocery |
| 3142 |
| |
| 3143 |
| but sometimes the dimensions get inverted too, like in my recent change about |
| 3144 |
| how to track taxation: |
| 3145 |
| |
| 3146 |
| Expenses:Taxes:US:TY2014:Employer:Federal |
| 3147 |
| Expenses:Taxes:US:TY2014:Employer:StateNY |
| 3148 |
| Expenses:Taxes:US:TY2014:Employer:CityNYC |
| 3149 |
| ... |
| 3150 |
| Here the "institution" is your employer, and shows deeper in the hierarchy. |
| 3151 |
| Finally, you often do want to have multiple types for the same or similar |
| 3152 |
| accounts, for instance, to track gains and dividends income from a particular |
| 3153 |
| investment account, you want a mirror of most of the dimensions except for the |
| 3154 |
| assets bit: |
| 3155 |
| |
| 3156 |
| Assets:US:ETrade:IRA -> Income:US:ETrade:IRA |
| 3157 |
| |
| 3158 |
| For instance: |
| 3159 |
| |
| 3160 |
| Assets:US:ETrade:IRA:Cash |
| 3161 |
| Income:US:ETrade:IRA:Dividends |
| 3162 |
| |
| 3163 |
| You see what I'm getting at... these components really operate more like a |
| 3164 |
| database table with values possibly NULL, e.g., |
| 3165 |
| |
| 3166 |
| type country institution account category |
| 3167 |
| -------- -------- ------------ --------- ----------- |
| 3168 |
| Assets US HSBC Checking NULL |
| 3169 |
| Assets CA RBC Savings NULL |
| 3170 |
| Assets US ETrade IRA Cash |
| 3171 |
| Income US ETrade IRA Dividends |
| 3172 |
| Expenses NULL NULL Food Restaurant |
| 3173 |
| Expenses NULL NULL Food Grocery |
| 3174 |
| |
| 3175 |
| Having to order your account components in a hierarchy forces you to |
| 3176 |
| decide how you want to report on them, a strict order of grouping from |
| 3177 |
| top to bottom. |
| 3178 |
| So I've been thinking about an experiment to rename all accounts according to |
| 3179 |
| dimensions, where the ordering of the components would not matter. These two |
| 3180 |
| would point to the same bucket, for example (changing the syntax slightly), |
| 3181 |
| |
| 3182 |
| Expenses|Taxes|US|TY2014|Employer|Federal |
| 3183 |
| Expenses|US|Employer|Taxes|TY2014|StateNY |
| 3184 |
| |
| 3185 |
| You could then display reports (again, the usual reports, balance sheet, |
| 3186 |
| income statement, journals) for "the subset of all transactions which has one |
| 3187 |
| posting in an account in <set>" where <set> is defined by values on a list of |
| 3188 |
| dimensions, a bit like a WHERE clause would do. |
| 3189 |
| |
| 3190 |
| Now, now, now... this would be a bit radical, now wouldn't it? Many of these |
| 3191 |
| accounts do point to real accounts whose postings have to be booked exactly, |
| 3192 |
| and I'm a bit worried about the looseness that this could introduce. One and |
| 3193 |
| only one account name for a particular account is a nice property to have. |
| 3194 |
| |
| 3195 |
| So what can we do to select across many dimensions while still keeping |
| 3196 |
| hierarchical account names? |
| 3197 |
| |
| 3198 |
| The first thing I did in Beancount is to create views for all unique account |
| 3199 |
| component names. For example, if the following account exists: |
| 3200 |
| |
| 3201 |
| Assets:US:ETrade:IRA |
| 3202 |
| |
| 3203 |
| You will see four "view" links at the root of the Beancount web page: |
| 3204 |
| |
| 3205 |
| Assets |
| 3206 |
| US |
| 3207 |
| ETrade |
| 3208 |
| IRA |
| 3209 |
| |
| 3210 |
| Clicking on the link selects all the transactions with a posting with an |
| 3211 |
| account where that component appears. (Views provide access to all the reports |
| 3212 |
| filtered by a subset of transactions.) You can click your way to any journal |
| 3213 |
| or report for that subset of transactions. This exists in HEAD today. You can |
| 3214 |
| draw all the reports where a particular component appears, e.g., "Employer", as |
| 3215 |
| in "Income:US:Employer:Salary" and "Expenses:Taxes:US:TY2014:Employer:Federal". |
| 3216 |
| |
| 3217 |
| But this does not define "dimensions." It would be nice to group values for |
| 3218 |
| these components by what kind of thing they are, e.g., a bank, an instution, a |
| 3219 |
| country, a tax year, etc, without regard for their location in the account |
| 3220 |
| name. A further experiment will consist in the following: again assuming |
| 3221 |
| unique "account component names" (which is not much of a constraint to |
| 3222 |
| require, BTW, at least not in my account names), allow the user to define |
| 3223 |
| dimensions by declaring a list of component names that form this dimension. |
| 3224 |
| Here's how this would look, with the previous examples (new syntax): |
| 3225 |
| |
| 3226 |
| dimension employer Microsoft,Autodesk,Apple |
| 3227 |
| dimension bank HSBC,RBC,ETrade |
| 3228 |
| dimension country US,CA,AU |
| 3229 |
| dimension taxyear TY2014,TY2013,TY2012,TY2011,TY2010 |
| 3230 |
| dimension type Assets,Liabilities,Equity,Income,Expenses (implicit?) |
| 3231 |
| |
| 3232 |
| You could then say something like "show me trial balance for all transactions |
| 3233 |
| with posting accounts where bank is not NULL group by bank" and you would |
| 3234 |
| obtain mini-hierarchies for each group of accounts (by bank, across all other |
| 3235 |
| dimensions). |
| 3236 |
| |
| 3237 |
| (With the state of my current system, I could probably code this as a |
| 3238 |
| prototype in a single day.) |
| 3239 |
| |
| 3240 |
| Addtionally, accounts have currency constraints and a history of postings |
| 3241 |
| which define a set o currencies used in them. More selection can be done with |
| 3242 |
| this (e.g., show me all transactions with postings that credit/debit CAD |
| 3243 |
| units). |
| 3244 |
| |
| 3245 |
| IMHO, all you're trying to do with these virtual accounts is aggregate with |
| 3246 |
| one less dimension, you want to remove the real account and group by community |
| 3247 |
| project. My claim is that there are ways to do that without giving up o the |
| 3248 |
| elegant balancing rules of the DE system. |
| 3249 |
|
| 3250 |
In relation to this... these "dimensions", could they just become other |
| 3251 |
dimensions in the filtering language? |
| 3252 |
|
| 3253 |
component:Microsoft |
| 3254 |
|
| 3255 |
employer:Microsoft |
| 3256 |
bank:RBC |
| 3257 |
country:US |
| 3258 |
|
| 3259 |
You can then break down by those, like a GROUP BY clause, and generate |
| 3260 |
reports that have those as root accounts, or separate breakdowns. |
| 3261 |
|
| 3262 |
** Tags used as dimensions |
| 3263 |
|
| 3264 |
- If you had tags as key-value pairs, those could be used as well: |
| 3265 |
|
| 3266 |
2014-05-21 * ... |
| 3267 |
#employer:Microsoft |
| 3268 |
|
| 3269 |
Searching for: |
| 3270 |
|
| 3271 |
tag:employer=Microsoft |
| 3272 |
|
| 3273 |
This is another dimension in the same filtering language. |
| 3274 |
|
| 3275 |
* Operations |
| 3276 |
** Validation |
| 3277 |
|
| 3278 |
- Write a dedicated routine to check the following invariant: |
| 3279 |
|
| 3280 |
# Handle sanity checks when the check is at the beginning of the day. |
| 3281 |
check_is_at_beginning_of_day = parser.SORT_ORDER[Check] < 0 |
| 3282 |
... |
| 3283 |
if check_is_at_beginning_of_day: |
| 3284 |
# Note: Check entries are assumed to have been sorted to be before any |
| 3285 |
# other entries with the same date. This is supposed to be done by the |
| 3286 |
# parser. Verify this invariant here. |
| 3287 |
if isinstance(entry, (Check, Open)): |
| 3288 |
assert entry.date > prev_date, ( |
| 3289 |
"Invalid entry order: Check or Open directive before transaction.", |
| 3290 |
(entry, prev_entry)) |
| 3291 |
else: |
| 3292 |
prev_entry = entry |
| 3293 |
prev_date = entry.date |
| 3294 |
|
| 3295 |
- Sanity check: Check that all postings of Transaction entries point to their |
| 3296 |
actual parent. |
| 3297 |
|
| 3298 |
- (validation) In addition to the Check/Open before-constraint, check that |
| 3299 |
the entries are always sorted. Add this sanity check. |
| 3300 |
|
| 3301 |
- The default validation should check the invariant that Open and Check |
| 3302 |
directives come before any Transaction. |
| 3303 |
|
| 3304 |
- Validation: Everywhere we have a filter of entries to entries, we should be |
| 3305 |
able to apply a check that the total balances before and the total balances |
| 3306 |
after should have the very same value. |
| 3307 |
|
| 3308 |
- In validate.py: differentiate between the case of an entry appearing too |
| 3309 |
early before an Open directive, and an entry appearing for an account that |
| 3310 |
simply just doesn't exist. |
| 3311 |
|
| 3312 |
- Auto-detect and warn on likely duplicate transactions within the file. |
| 3313 |
|
| 3314 |
** Padding |
| 3315 |
|
| 3316 |
- Idea: Padding entries could be extended a tiny bit in order to |
| 3317 |
automatically calculate the cash distribution entries, e.g., like this: |
| 3318 |
|
| 3319 |
2014-03-04 pad Asset:Cash Expenses:Restaurant 60% |
| 3320 |
2014-03-04 pad Asset:Cash Expenses:Alcohol 40% |
| 3321 |
|
| 3322 |
2014-04-04 pad Asset:Cash Expenses:Restaurant 70% |
| 3323 |
2014-04-04 pad Asset:Cash Expenses:Alcohol 30% |
| 3324 |
|
| 3325 |
2014-05-04 pad Asset:Cash Expenses:Restaurant 70% |
| 3326 |
2014-05-04 pad Asset:Cash Expenses:Alcohol 30% |
| 3327 |
|
| 3328 |
This is a great idea, is in line with the general meaning of pad entries |
| 3329 |
(implicit 100%) and would add a much desired feature. |
| 3330 |
|
| 3331 |
- Add tests for all the cases of realization padding. |
| 3332 |
|
| 3333 |
** Locations |
| 3334 |
|
| 3335 |
- @location really should just convert into a generic event "location", just |
| 3336 |
as address and school should; they're just events with forward fill... |
| 3337 |
Serve this at: |
| 3338 |
|
| 3339 |
http://localhost:8080/20120101/20130101/events/location/days |
| 3340 |
|
| 3341 |
- Add a "reason" field for @location, and display as trips, with |
| 3342 |
some sort of meaning to them. Ok, this contradicts the previous idea. |
| 3343 |
|
| 3344 |
|
| 3345 |
|
| 3346 |
* Parser |
| 3347 |
** Errors |
| 3348 |
|
| 3349 |
- Parsing an indented string results in some output... for example, this code |
| 3350 |
spits out a single Balance entry (the last one): |
| 3351 |
|
| 3352 |
balance_entries, _, __ = parser.parse_string(""" |
| 3353 |
2014-01-02 balance Liabilities:CreditCard 100.00 USD |
| 3354 |
2014-01-03 balance Liabilities:CreditCard 200.00 USD |
| 3355 |
""") |
| 3356 |
|
| 3357 |
It should not. It should output nothing, because these entries are indented. |
| 3358 |
I don't understand why it does. This is a parser bug which needs to be |
| 3359 |
traced and debugged. This has come up in writing tests here and there, |
| 3360 |
forgetting to insert dedent=True. |
| 3361 |
|
| 3362 |
- We need to gather errors in a single place and report them like the others; |
| 3363 |
right now I'm catching them in sum_to_date() and writing using the logging |
| 3364 |
module; but they really should be trickled up with the rest. |
| 3365 |
|
| 3366 |
- Syntax errors currently have no location... this is unacceptable. Write an |
| 3367 |
automated test, check for all kinds of errors, in the lexer, in the parser, |
| 3368 |
in the Python. (Just work with the line number, we don't really need |
| 3369 |
character position.) Test everything with automated tests. |
| 3370 |
|
| 3371 |
- 'lineno' is incorrect, it points to the next entry, not the previous one, |
| 3372 |
fix this bug! This is really annoying. |
| 3373 |
|
| 3374 |
- Set a correct filename in grammar.y |
| 3375 |
|
| 3376 |
- Errors from the parser and others should all be accumulated in one place, |
| 3377 |
so that we do all the reporting at the very top level. |
| 3378 |
|
| 3379 |
- Don't raise error exceptions anywhere; log everything to an error |
| 3380 |
handler/accumulator class instead, and skip to the next entry/declaration. |
| 3381 |
- Propagate exception from Python(?) |
| 3382 |
|
| 3383 |
- Problematic transactions (!) should spit something of color on stdout, they |
| 3384 |
should not be forgotten so easily. |
| 3385 |
|
| 3386 |
- Bug: Invalid account names should only be reported once. |
| 3387 |
|
| 3388 |
** Lexer Work |
| 3389 |
*** Errors in Flex Lexer |
| 3390 |
|
| 3391 |
- (parser) Support enabling flex debugging in beancount.core._parser.parse(), |
| 3392 |
using "yyset_debug(int bdebug)". |
| 3393 |
|
| 3394 |
- When an error occurs, skip the lexer to the next empty line and recommence. |
| 3395 |
|
| 3396 |
* Modify the lexer to emit EOF and add that in the grammar rules for empty_line. |
| 3397 |
|
| 3398 |
*** Write a New Lexer From Scratch |
| 3399 |
|
| 3400 |
Reasons to write your own lexer manually: |
| 3401 |
|
| 3402 |
- Should support UTF-8 encoding. |
| 3403 |
|
| 3404 |
- Should support SCHEDULE entries for org-mode (see email discussion). |
| 3405 |
- More flexible syntax (see "Is it possbile for beancount to ignore org-mode |
| 3406 |
SCHEDULED and DEADLINE?" thread). |
| 3407 |
|
| 3408 |
- Better error reporting |
| 3409 |
|
| 3410 |
- (performance) Write your own lexer manually and compare performance with |
| 3411 |
flex one. I think we can do a much better job at error reporting by writing |
| 3412 |
our own, but I'm unsure how the performance compares. |
| 3413 |
|
| 3414 |
- IMPORTANT LATENT ISSUE. You need to extend the lexer to parse A-Z for flags, |
| 3415 |
not just PSTCU! This is important, as I just realized that it could prevent |
| 3416 |
the correct parsing for entries in a round-trip, with postings produced with |
| 3417 |
unexpected flags. In fact, any character with whitespace on each side should |
| 3418 |
parse as a flag. This is very important. |
| 3419 |
|
| 3420 |
This manifests when adding a posting with letter 'M' right now. Replicate |
| 3421 |
this, fix the problem. |
| 3422 |
|
| 3423 |
** Make the Parser Reentrant |
| 3424 |
|
| 3425 |
- Make the parser reentrant [2014-08-02]. This is _not_ a difficult task. |
| 3426 |
|
| 3427 |
* Follow this: |
| 3428 |
https://www.lemoda.net/c/reentrant-parser/ |
| 3429 |
http://flex.sourceforge.net/manual/Extra-Data.html |
| 3430 |
to remove all globals from my lexer and make it truly reentrant and free of globals. |
| 3431 |
|
| 3432 |
* You need to add unit tests that check the correctness of line numbers on |
| 3433 |
parsed directives and errors. |
| 3434 |
|
| 3435 |
* You need to remove the get_yylineno and get_yyfilename accessors. |
| 3436 |
|
| 3437 |
* You need to make the parser reentrant, by add this directive to the grammar: |
| 3438 |
|
| 3439 |
%parse-param { PyObject* builder} |
| 3440 |
|
| 3441 |
You also need to redefine yyerror() accordingly. I've done it and it |
| 3442 |
works, it's simple, it's a 20 minute change: |
| 3443 |
https://www.gnu.org/software/bison/manual/html_node/Parser-Function.html |
| 3444 |
|
| 3445 |
* You also need to make the lexer reentrant: |
| 3446 |
http://flex.sourceforge.net/manual/Reentrant-Overview.html#Reentrant-Overview |
| 3447 |
|
| 3448 |
%option reentrant |
| 3449 |
|
| 3450 |
(I haven't tried this yet.) |
| 3451 |
|
| 3452 |
* Most of the "real" work involved is in removing the globals for lineno and |
| 3453 |
filename. |
| 3454 |
|
| 3455 |
* Make sure the performance does not degrade as a result of doing this. |
| 3456 |
|
| 3457 |
** Syntax |
| 3458 |
|
| 3459 |
- You should support a payee with no description! This generates a parser |
| 3460 |
error right now. |
| 3461 |
|
| 3462 |
- The syntax should support multiline strings naturally... |
| 3463 |
|
| 3464 |
- For Links vs. Tags: dont impose an order, parse as tags_or_links. |
| 3465 |
Right now the order is tags_list and links_list. |
| 3466 |
|
| 3467 |
- You should accept commas in the input; simply ignore their value. |
| 3468 |
|
| 3469 |
- Add 1/rate syntax for prices (and anything... really, why not). |
| 3470 |
Convert at parsing time. |
| 3471 |
|
| 3472 |
*** Sensible Syntax for Lots |
| 3473 |
|
| 3474 |
- Consider making the lot syntax like this: |
| 3475 |
|
| 3476 |
-4 {HOOL @ 790.83 USD} |
| 3477 |
|
| 3478 |
instead of: |
| 3479 |
|
| 3480 |
-4 HOOL {790.83 USD} |
| 3481 |
|
| 3482 |
It's actually a lot more accurate to what's going on... |
| 3483 |
|
| 3484 |
** Testing |
| 3485 |
|
| 3486 |
- Allow file objects to parse() and dump_lexer(). This should use fdopen() or |
| 3487 |
whatever else to get this job done at the parser level. |
| 3488 |
|
| 3489 |
- You need to clean up the memory of the strings created; call free() on each |
| 3490 |
string in the rules. |
| 3491 |
|
| 3492 |
- Add a unit test for pushtag/poptag errors. |
| 3493 |
- Add unittests for tags, pushtag/poptag |
| 3494 |
|
| 3495 |
* Reports |
| 3496 |
** Text Statements |
| 3497 |
|
| 3498 |
- Complete text-statements branch, printing out balance sheet and income |
| 3499 |
statement to text for bean-report and ELI, complete with --date on those |
| 3500 |
reports. |
| 3501 |
|
| 3502 |
- Using an intermediate data structure, produce text and csv / xls reports, |
| 3503 |
downloadable from the web front-end, or even generatable directly. All of |
| 3504 |
this reporting infrastructure should be reusable, ideally. |
| 3505 |
|
| 3506 |
- A text rendering of the balance sheet / income statement would be |
| 3507 |
_very_ useful for collaboration/communication with others. Add a link to |
| 3508 |
download a text version of any report. This would be made easy if we only |
| 3509 |
have a few distinct types of reports. |
| 3510 |
|
| 3511 |
** List of Unreconciled Transactions and Postings |
| 3512 |
|
| 3513 |
- Perhaps we want to produce a report of all transactions with a highlight on |
| 3514 |
them. |
| 3515 |
|
| 3516 |
** Balance Sheet |
| 3517 |
|
| 3518 |
- (web) We really need to reorder the accounts in a way that is more |
| 3519 |
sensible... it's annoying to see the accounts I care about at the top of |
| 3520 |
the page. Cash, Points, AU, should be at the bottom... I wonder if there's |
| 3521 |
a nice heuristic. Last updated date? I think that would be good enough. |
| 3522 |
|
| 3523 |
- We need to figure out how to order the accounts on the balsheet; I want the |
| 3524 |
most relevant near the top. Sorting accounts: compute a score made up of |
| 3525 |
|
| 3526 |
* nb. txns from the last 3 months |
| 3527 |
* nb. checks from the last 3 months (weighted more heavily) |
| 3528 |
* line-no of Open directive in the file. |
| 3529 |
* last updated date. |
| 3530 |
|
| 3531 |
** HTML Rendering |
| 3532 |
|
| 3533 |
- Rendering: When you collapse a parent account, its aggregate amount should |
| 3534 |
render, and disappear when not collapsed. |
| 3535 |
|
| 3536 |
- Numbers should align to the right. |
| 3537 |
|
| 3538 |
- USD and CAD should be aggregated in their own columns for balance sheet and |
| 3539 |
income statements. These should be specified from the command-line. |
| 3540 |
|
| 3541 |
- All entries should have collapsing a-la-JavaScript, along with |
| 3542 |
collapse/reveal all buttons. All JS. |
| 3543 |
|
| 3544 |
- If the software is finally fast enough in Go, render RESTful on the fly for |
| 3545 |
any date: |
| 3546 |
|
| 3547 |
* REST: /balsheet/20121231/ |
| 3548 |
* REST: /income/20121231/20131231/ |
| 3549 |
|
| 3550 |
This way, you could have any year on the same run. No need to restart, even |
| 3551 |
have a menu with all the years, and perhaps even some of the latest months. |
| 3552 |
|
| 3553 |
- It would be really nice to render the line numbers to the source in the HTML |
| 3554 |
|
| 3555 |
- (Performance) Implement buffered output for faster response using a separate |
| 3556 |
thread and an iterator that yields from app.write when the data buffer is |
| 3557 |
large enough. |
| 3558 |
|
| 3559 |
- Postings that have a "!" flag should have at least their |
| 3560 |
background red. |
| 3561 |
|
| 3562 |
- You should more explicitly state the beginning and ending period |
| 3563 |
on each statement pages (it is super important information). |
| 3564 |
Just below the title. |
| 3565 |
|
| 3566 |
|
| 3567 |
|
| 3568 |
** Excel Output |
| 3569 |
|
| 3570 |
- Find good ways to transfer data to an Excel spreadsheet. A link to download |
| 3571 |
a file should be supported. |
| 3572 |
|
| 3573 |
|
| 3574 |
** Links to Source |
| 3575 |
|
| 3576 |
- The new format code should keep and optionally render the source file/line |
| 3577 |
of any transaction, and allow clicking to get to the source line in the |
| 3578 |
rendering. |
| 3579 |
|
| 3580 |
- Maybe there should be a script that can take a report specification and |
| 3581 |
output a list of emacs-compatible links to the entries, interspersed with |
| 3582 |
the text format rendering! You could go "next-error" to go through the |
| 3583 |
entries in time order, emacs taking you there one-by-one. |
| 3584 |
|
| 3585 |
** Event Reports |
| 3586 |
|
| 3587 |
- We should be able to count the days of each event type. |
| 3588 |
|
| 3589 |
** Distribution of Expenses and Income |
| 3590 |
|
| 3591 |
- Add a pie chart to visualize the constitution of the Income Statement for |
| 3592 |
Expenses and Income. |
| 3593 |
|
| 3594 |
** Summary Reports |
| 3595 |
|
| 3596 |
- To create custom views, for example, weekly summaries, you could |
| 3597 |
convert the ledger into another ledger, where entries would have |
| 3598 |
been replaced by summary entries instead, and all the other |
| 3599 |
functionalities would still work. |
| 3600 |
|
| 3601 |
** Financial Ratio Analysis |
| 3602 |
|
| 3603 |
- Add these: https://www.csun.edu/~bjc20362/Controlling-2.pdf |
| 3604 |
|
| 3605 |
** Trades |
| 3606 |
|
| 3607 |
- You should be able to report on all booked trades during a period, |
| 3608 |
especially with the new booking algorithm, this will be useful. |
| 3609 |
Create a new report type for this. |
| 3610 |
|
| 3611 |
** Reports: Overview Stats |
| 3612 |
|
| 3613 |
- Add a simple overview 'stats' report with output like this: |
| 3614 |
|
| 3615 |
Files these postings came from: |
| 3616 |
... |
| 3617 |
|
| 3618 |
Unique payees: 2681 |
| 3619 |
Unique accounts: 151 |
| 3620 |
|
| 3621 |
Number of postings: 9026 (4.8 per day) |
| 3622 |
Uncleared postings: 126 |
| 3623 |
|
| 3624 |
Days since last post: -206 |
| 3625 |
Posts in last 7 days: 30 |
| 3626 |
Posts in last 30 days: 52 |
| 3627 |
Posts seen this month: 8 |
| 3628 |
|
| 3629 |
- This ought to replace the current stats reports, which are simply too small |
| 3630 |
and specialized. |
| 3631 |
|
| 3632 |
** Reports: Rendering Journals |
| 3633 |
|
| 3634 |
- Journals should render in either order. |
| 3635 |
|
| 3636 |
- Add an option for spacing in the revamped reports. |
| 3637 |
|
| 3638 |
- When multiple transactions occur in the same day, it makes sense not to |
| 3639 |
render the balance amount until the last one. Do this. This is important. |
| 3640 |
|
| 3641 |
- In rendering balance directives, don't render the amount in the "change" |
| 3642 |
column; that is too confusing for some users, keep the change column for |
| 3643 |
changes. |
| 3644 |
|
| 3645 |
- (easy) Don't render postings in the HTML interface by default. The detail |
| 3646 |
can be made available via bean-query now, and users can click on /context |
| 3647 |
link in order to get the full transaction detail. Journals should be |
| 3648 |
summaries. Add an optional argument to turn it on/off, but it should be off |
| 3649 |
by default. |
| 3650 |
|
| 3651 |
** Reports: Rendering Tables of Balances |
| 3652 |
|
| 3653 |
- tree rendering: If a parent account has only a single subaccount and the |
| 3654 |
parent account otherwise has no postings in its realization, render the |
| 3655 |
account on a single line instead of two, e.g. |
| 3656 |
|
| 3657 |
Expenses Expenses |
| 3658 |
Taxes Taxes |
| 3659 |
US US |
| 3660 |
TY2014 TY2014 |
| 3661 |
State State:Company |
| 3662 |
Company ... |
| 3663 |
... |
| 3664 |
|
| 3665 |
** Reports: Rendering Tables |
| 3666 |
|
| 3667 |
- For table rendering, move the actual formatting at rendering time. CSV files |
| 3668 |
should have fractional values for percentages, txt and html should have % |
| 3669 |
values. I need to figure out a good solution for this. Maybe the thing to do |
| 3670 |
is to move the field selection at rendering stage, or at least to have it at |
| 3671 |
both. |
| 3672 |
|
| 3673 |
** Reports: Accounts |
| 3674 |
|
| 3675 |
- bean-report accounts should produce a regular table that can be rendered |
| 3676 |
with CSV or TXT, not a custom output string. |
| 3677 |
|
| 3678 |
** Reports: Cash |
| 3679 |
|
| 3680 |
- Create a function to identify whether a Position/Inventory is cash... use |
| 3681 |
this to reproduce/replace the 'cash' report. Use the same rule from |
| 3682 |
bean-report. |
| 3683 |
|
| 3684 |
** Report: XML |
| 3685 |
|
| 3686 |
- Output to a structured XML format, some people are finding that useful to |
| 3687 |
build other visualizations. In order to test this completely, do a |
| 3688 |
round-trip test. The code should live in beancount.parser, parallel to the |
| 3689 |
existing code there. |
| 3690 |
|
| 3691 |
** Report: Events |
| 3692 |
|
| 3693 |
- Build a 'events' report that will print out the current value of all events. |
| 3694 |
|
| 3695 |
- Create a new report type: "days" that counts the days of any event in the |
| 3696 |
filtered log. |
| 3697 |
|
| 3698 |
* Price Freshness / Dated Prices |
| 3699 |
|
| 3700 |
- Issue warnings if the price date is too far from the requested market value |
| 3701 |
date. This will help with returns, a lot. You should likely do this in the |
| 3702 |
price_map object, in the lookup function, maybe, so that all modules benefit |
| 3703 |
from the feature. You could ideally provide a date and a tolerance, and |
| 3704 |
somehow issue warnings automatically. The tolerance for price freshness |
| 3705 |
should be provided as an option in the input file. |
| 3706 |
|
| 3707 |
- Add the capability to issue warnings when the price database is queried for |
| 3708 |
a specific date but the price point is too distant from the requested date. |
| 3709 |
|
| 3710 |
"One thing I want to do soon is to issue warnings when the price database is |
| 3711 |
looked up and the price point is too far from the requested date, so that the |
| 3712 |
user could go fill in the missing prices. I'd probably issue price entries with |
| 3713 |
the approximated price (approximated with a distant date) and then feed that |
| 3714 |
into another script that would fetch prices for those directives." |
| 3715 |
|
| 3716 |
* Review Design of Tags & Links |
| 3717 |
|
| 3718 |
- Consider removing the "links" attribute altogether and making that simply |
| 3719 |
just a tag. Do we really, truly need to distinguish between tags and links? |
| 3720 |
|
| 3721 |
- Try removing the 'tags' attribute of transactions by moving it to metadata |
| 3722 |
fields and making sure tools are available to perform the same aggregations |
| 3723 |
using bean-query and views using bean-web. |
| 3724 |
|
| 3725 |
- Make the Pad directive accept #tags and propagate those to the generated |
| 3726 |
transactions: |
| 3727 |
https://bitbucket.org/blais/beancount/issues/70/add-tag-to-the-pad-directive-and-propagate |
| 3728 |
|
| 3729 |
* Web Interface Improvements |
| 3730 |
|
| 3731 |
- (easy) Make b.w.web also 'app.options_map' instead of 'app.options'. |
| 3732 |
|
| 3733 |
- Make the web interface not render postings anymore by default. |
| 3734 |
|
| 3735 |
- web: Don't render the transaction detail anymore; instead, the full context |
| 3736 |
should come up in a tooltip that is computed on-demand. Rendering the basic |
| 3737 |
table should not have to render all the detail upfront, that is always |
| 3738 |
overkill. |
| 3739 |
|
| 3740 |
- web: Don't render the full Inventory'es; instead, already render at cost and |
| 3741 |
provide their full detail either by clicking on the transaction, which |
| 3742 |
should render the full detail of an inventory (for debugging), or in a |
| 3743 |
tooltip. |
| 3744 |
|
| 3745 |
- Highlight (e.g., in the color red) the postings to accounts that are in |
| 3746 |
contra value, e.g. a positive Income, or a negative Expenses posting. |
| 3747 |
(Maybe this is just something that lives in Fava actually) |
| 3748 |
|
| 3749 |
- In the web interface, it would be nice to have a fancy client-side |
| 3750 |
JavaScript overlay here, that automatically appears after parsing if there |
| 3751 |
are errors and that automatically smoothly fades out. All errors should be |
| 3752 |
displayed in an overlay; proper error handling and display for the web |
| 3753 |
interface is not optional, it's important. |
| 3754 |
|
| 3755 |
- Figure out how to disable googleapis fonts when on a very slow connection. |
| 3756 |
I'd like to enable the fonts, but if they cannot be fetched quickly, or |
| 3757 |
cached, this should be disabled. |
| 3758 |
|
| 3759 |
- Implement a little plug-ins system that allows a user to insert a new tab in |
| 3760 |
bean-web, to insert some custom display. |
| 3761 |
|
| 3762 |
- Instead of rendering inventories with the full contents in the journal, |
| 3763 |
render the cost, and place the full inventory in a tooltip! |
| 3764 |
|
| 3765 |
- A table of price entries should be rendered under the price graph in the |
| 3766 |
web interface. |
| 3767 |
|
| 3768 |
- The Trial Balance page could be a good place to put all the accounts on the |
| 3769 |
left and have two sets of columns: beginning of period -> end of period. |
| 3770 |
|
| 3771 |
- In order to implement .txt output, you will need to decouple the web |
| 3772 |
rendering and the generation of its included data. This will be |
| 3773 |
great--ability to cut-and-paste any page into txt. format=txt, and we could |
| 3774 |
still have the links clickable. Everything else would just be txt. A bit of |
| 3775 |
a crazy idea, but it might work well and be simple. Maybe. |
| 3776 |
|
| 3777 |
- Render tags on the HTML page |
| 3778 |
|
| 3779 |
- Replace gviz charts by some other library that does not require you to be |
| 3780 |
online in order for it to work. |
| 3781 |
|
| 3782 |
- Silence BrokenPipeError errors from bottle using wsgiref. You could use |
| 3783 |
CherryPy, which doesn't suffer from that, or just... fix it and silence |
| 3784 |
them. |
| 3785 |
|
| 3786 |
- In balance/aggregate reports, render the balances for parent accounts too, |
| 3787 |
in lighter gray. |
| 3788 |
|
| 3789 |
- Render the Conversions amount at the bottom of the Conversions page... |
| 3790 |
|
| 3791 |
** Visualizations |
| 3792 |
|
| 3793 |
- Move the TreeMaps experimental script for Expenses and Assets subtrees into |
| 3794 |
the bean-web codebase: |
| 3795 |
https://bost.ocks.org/mike/treemap/ |
| 3796 |
(Or maybe that would just be left for fava.) |
| 3797 |
|
| 3798 |
** Rendering Documents |
| 3799 |
|
| 3800 |
- Serving CSV files from the Documents page should not done be via download, |
| 3801 |
but rather they should rendered directly. Same with text files. As much as |
| 3802 |
possible files should be served directly. |
| 3803 |
|
| 3804 |
- The documents web page should render by-month + date, and by-account + date. |
| 3805 |
|
| 3806 |
** Update Activity Page |
| 3807 |
|
| 3808 |
- Update activity: Remove parent accounts with no child accounts. |
| 3809 |
- Update activity: This exhibits a bug in the table rendering, look for IVV, |
| 3810 |
see TODO(blais) in acctree.py |
| 3811 |
|
| 3812 |
** Bake Improvements |
| 3813 |
|
| 3814 |
- Move beancount.scripts.bake to beancount/web and adjust all the references |
| 3815 |
accordingly. |
| 3816 |
|
| 3817 |
- bake: Make bake support curl if wget is not available. It should work with either, |
| 3818 |
to relax dependencies. |
| 3819 |
|
| 3820 |
- Make the web scraper run in multiple threads... it's quite a bit too slow as |
| 3821 |
it is. I'm sure we can make it scrape in parallel using multiprocessing and |
| 3822 |
a work queue (this should be a fun little project and would make baking to |
| 3823 |
an archive a lot faster in many cases). |
| 3824 |
|
| 3825 |
** Programmable View |
| 3826 |
|
| 3827 |
- GREAT IDEA! Have a web form that you can input a view filtering expression, |
| 3828 |
e.g. year:2014 component:Microsoft |
| 3829 |
to have that year's transactions made with this component. Encode the |
| 3830 |
results in a unique string that you can decode and create a corresponding |
| 3831 |
view of the subset selected by the expression. You can then view any of the |
| 3832 |
reports for that subset! This means we can then get rid of many of the root |
| 3833 |
page's links automatically, yet still provide all the opportunities... this |
| 3834 |
is the way to go, and would best mirror the command-line capabilities. |
| 3835 |
|
| 3836 |
** Error reporting |
| 3837 |
|
| 3838 |
- We really need to list all the entries markes '!' somewhere; they should be |
| 3839 |
more annoying to the user. |
| 3840 |
|
| 3841 |
- In the balance sheet or trial balance, mark accounts that have errors in |
| 3842 |
red, or add a little red start next to them. |
| 3843 |
|
| 3844 |
- Implement basic error reporting page from the list of errors. |
| 3845 |
|
| 3846 |
** Links |
| 3847 |
|
| 3848 |
- (web) Render links to the right of descriptions, and the link href link |
| 3849 |
should actually render a page of the related linked entries. |
| 3850 |
|
| 3851 |
** Aesthetics |
| 3852 |
|
| 3853 |
- In the entries table HTML, highlight the relevant posting leg somehow, maybe |
| 3854 |
use a '>>' marker, or make it bold. Something. (Bold is too much, use >>.) |
| 3855 |
|
| 3856 |
- Render "as of YYYY-MM-DD" under the title for Balance Sheet, and "from |
| 3857 |
YYYY-MM-DD to YYYY-MM-DD" under the title for Income Statement |
| 3858 |
|
| 3859 |
- Answer to favicon.ico request. |
| 3860 |
|
| 3861 |
- Add an option to render the entries table upwards, not just downwards. |
| 3862 |
|
| 3863 |
- Use that beautiful new font (Roboto) from Tactile in the new rendering. |
| 3864 |
Totally worth it. Use the nice Lucida-like font for numbers, like in |
| 3865 |
TurboTax. |
| 3866 |
|
| 3867 |
*** JavaScript / Client-Side Interaction |
| 3868 |
|
| 3869 |
- Render balance sheet/ income statement cells with two numbers for parent |
| 3870 |
nodes, so that when you collapse a node, all the amounts of its children sum |
| 3871 |
up automatically and display in its cell. You should have a consistent |
| 3872 |
report regardless of whether nodes are collapsed or not. This will require |
| 3873 |
some JavaScript effort. |
| 3874 |
|
| 3875 |
- Implemented a JavaScript cursor in JS. J, K up down. SPC = toggle. |
| 3876 |
|
| 3877 |
- In Journal view, pressing 'C' should toggle displaying the checks on and off. |
| 3878 |
|
| 3879 |
** Trial Balance |
| 3880 |
|
| 3881 |
- We should have a nicer way to tell what accounts need to be updated. |
| 3882 |
Highlight them red if they haven't been updated in more a month |
| 3883 |
(configurable). |
| 3884 |
Put the last updated date in the balance sheet or perhaps the trial balance |
| 3885 |
page. Should be easy; we don't need a dedicated page for this. |
| 3886 |
|
| 3887 |
- Shove more information in the Trial Balance page, info about errors, documents, etc. |
| 3888 |
|
| 3889 |
** Source |
| 3890 |
|
| 3891 |
- The source page should take a special '?line=ddd' parameter that will |
| 3892 |
scroll the page to the transaction at that line. |
| 3893 |
|
| 3894 |
** Conversions |
| 3895 |
|
| 3896 |
|
| 3897 |
* Small Projects & Challenge Ideas |
| 3898 |
** Maximum Balance |
| 3899 |
|
| 3900 |
- Can I compute the maximum value of each account at the end of every year |
| 3901 |
(for foreign assets decl.) This would be useful for FBAR / FATCA |
| 3902 |
declarations. |
| 3903 |
|
| 3904 |
- Automatically compute the maximum account values of foreign accounts for |
| 3905 |
the FBAR filing. |
| 3906 |
|
| 3907 |
- You should report a trial-balance -like listing of the minimum and maximum |
| 3908 |
values of all the accounts. |
| 3909 |
|
| 3910 |
** Property Lifetime Return |
| 3911 |
|
| 3912 |
- Challenge: Can I compute IRR return on my condo purchase and sale, |
| 3913 |
accurately accounting for all the little expenses and cash flows along the |
| 3914 |
way? TODO: Add benefits received as an Income, as transactions. |
| 3915 |
|
| 3916 |
** Taxation Rate |
| 3917 |
|
| 3918 |
- Challenge: Can I automatically compute my taxation rate for every year? |
| 3919 |
|
| 3920 |
** Currency Exposure Report |
| 3921 |
|
| 3922 |
- For a particular balance sheet, report the total currency exposure of the |
| 3923 |
ledger. This should be a very simple report, probably in the form of a pie |
| 3924 |
chart. Maybe this pie chart should be located in the capital report |
| 3925 |
(possibly makes sense). |
| 3926 |
|
| 3927 |
** Inflation Adjusted Reporting |
| 3928 |
|
| 3929 |
- It would be AWESOME to look at a balance sheets from the past but |
| 3930 |
inflation-adjusted for any date... Answer this question easily: |
| 3931 |
|
| 3932 |
"What was I making in 2010 in today's dollar terms?" |
| 3933 |
|
| 3934 |
- How would I produce an inflation adjusted version of some charts. Maybe all |
| 3935 |
charts should have that option? |
| 3936 |
|
| 3937 |
- Look at average meal 10 years ago, average electricity, etc. things that |
| 3938 |
should be equal, and correct for the time-value-of-money, compare prices |
| 3939 |
today with prices then. Maybe come up with some kind of constant unit that |
| 3940 |
I can convert everything to. |
| 3941 |
|
| 3942 |
** Account Linkage Report |
| 3943 |
|
| 3944 |
- Generate a Graphviz link of all the inter-account transactions that are |
| 3945 |
larger than a certain amount. |
| 3946 |
|
| 3947 |
Generate a graph for the main kinds of account |
| 3948 |
interchanges, by looking at the most significant transactions |
| 3949 |
between the accounts. For example, ignore transactions which are |
| 3950 |
too small in absolute value, or whose total is too small a portion |
| 3951 |
of the total. |
| 3952 |
|
| 3953 |
Fun little project: Create a graphviz output from a Ledger, where |
| 3954 |
transactions above a certain amount would generate a link between |
| 3955 |
accounts. Note: the threshold could be either for single |
| 3956 |
transactions, or for aggregate amounts (absolute value). |
| 3957 |
|
| 3958 |
** Predict Vacation Cap Date |
| 3959 |
|
| 3960 |
- Make an plugin that computes the precise date at which my vacation will cap |
| 3961 |
(240 VACHR) base on an account. |
| 3962 |
|
| 3963 |
* Account Hiding Criterion |
| 3964 |
|
| 3965 |
- Set the closing criterion for empty accounts, implement in a single place, |
| 3966 |
and review all the code which renders balances to use it. |
| 3967 |
|
| 3968 |
"I used to have it so that accounts closed before the beginning of the exercise |
| 3969 |
(in the reports) would not appear. Accounts closed at the end of the period but |
| 3970 |
with some activity within the period would appear (so you can click on them and |
| 3971 |
see their journal). Opened accounts with a zero balance would, too. Closed |
| 3972 |
before begin + no activity = no show." |
| 3973 |
|
| 3974 |
2000-01-10 open Assets:Continuing |
| 3975 |
2000-01-10 open Assets:Empty |
| 3976 |
2000-01-10 open Assets:Terminated |
| 3977 |
|
| 3978 |
2000-01-10 open Equity:Whatever |
| 3979 |
|
| 3980 |
2014-03-10 * |
| 3981 |
Assets:Continuing 110 USD |
| 3982 |
Assets:Terminated 120 USD |
| 3983 |
Assets:Empty 130 USD |
| 3984 |
Equity:Whatever |
| 3985 |
|
| 3986 |
2014-03-30 * |
| 3987 |
Assets:Terminated -120 USD |
| 3988 |
Assets:Empty -130 USD |
| 3989 |
Equity:Whatever |
| 3990 |
|
| 3991 |
2014-05-15 close Assets:Terminated |
| 3992 |
|
| 3993 |
2015-01-10 * |
| 3994 |
Assets:Continuing 110 USD |
| 3995 |
Equity:Whatever |
| 3996 |
|
| 3997 |
- Whether an account shows up in a particular Ledger (realization) really only |
| 3998 |
should depend on whether the account was open during the period (we now have |
| 3999 |
account open/close dates... let's use them instead of a heuristic!). |
| 4000 |
Create a routine to figure out if an account was open during a specific |
| 4001 |
time period? |
| 4002 |
|
| 4003 |
- Related topics: |
| 4004 |
(ticket) https://bitbucket.org/blais/beancount/issues/36/balances-output-sometimes-outputs-000 |
| 4005 |
(fava) https://github.com/aumayr/fava/issues/292#issuecomment-219563582 |
| 4006 |
|
| 4007 |
- One question is whether we should display an account which has a non-zero |
| 4008 |
balance but when rounded for display rounds to a zero number? |
| 4009 |
|
| 4010 |
"the problem is not the sell, but the buy |
| 4011 |
that leaves -0.00120 USD in Assets:XYZ" |
| 4012 |
|
| 4013 |
* Rejected Ideas |
| 4014 |
|
| 4015 |
- Why aren't we using the price on the first leg of this transaction? This is |
| 4016 |
an interesting variation on the meaning of the price: it could mean either |
| 4017 |
(a) the price of the lot, or (b) the conversion price of the cost of the |
| 4018 |
lot. This would enable the following: |
| 4019 |
|
| 4020 |
2013-07-22 * "Bought some US investment in a CAD account" |
| 4021 |
Assets:Investment:HOOL 50 HOOL {700 USD} @ 1.01 CAD ;; 35350 CAD |
| 4022 |
Assets:Investment:Cash -35359.95 CAD |
| 4023 |
Expenses:Commissions 9.95 CAD |
| 4024 |
|
| 4025 |
- Add a --auto-everything option to bean-check that automatically inserts a |
| 4026 |
beancount.plugins.auto_accounts directive and more. |
| 4027 |
|
| 4028 |
* To Be Categorized |
| 4029 |
** Reporting Plugin Errors |
| 4030 |
|
| 4031 |
- Build a utility function to parse plugin configs using ast.literal_eval() |
| 4032 |
and catch and produce a consistent error message when an invalid Python |
| 4033 |
expression is provided. Convert all the plugins to use it. |
| 4034 |
|
| 4035 |
- When rendering errors, render the data type so the error tells you which |
| 4036 |
component or plugin generated it. |
| 4037 |
|
| 4038 |
- Parse and save the line no for "plugin" directives in order to improve their |
| 4039 |
error reporting. |
| 4040 |
|
| 4041 |
** doctor / tools |
| 4042 |
|
| 4043 |
- Add a list of posted balances by account to "bean-doctor context". "linked" |
| 4044 |
always links all the transactions, so it's not good enough. Just add this by |
| 4045 |
default to the context command. |
| 4046 |
|
| 4047 |
- Great idea: Make the printer able to (1) output "incomplete" entries and (2) |
| 4048 |
print out the entries in the order of (filename, line-no) in which they were |
| 4049 |
parsed, to produce a file that is as close as possible to output. (bw3443 |
| 4050 |
asked for this in order to make modifications to his input and push that |
| 4051 |
back out to a file, this could be useful.) |
| 4052 |
|
| 4053 |
** Improvements to Emacs Support |
| 4054 |
|
| 4055 |
- Investigate indent-region and see if it wouldn't make sense to override this |
| 4056 |
in order to invoke beancount-align / beancount-format. |
| 4057 |
|
| 4058 |
- Add an Emacs mode command to compute a command at the date of the |
| 4059 |
transaction preceding or at the cursor line (with C-u). Without a C-u |
| 4060 |
prefix, compute the balances at the latest date. The point is that the user |
| 4061 |
shouldn't have to type in the bean-query <filename>, other than perhaps |
| 4062 |
having to type "balances". To work quickly on smaller files. |
| 4063 |
|
| 4064 |
*** Transaction Lists which can be Explored with Emacs |
| 4065 |
|
| 4066 |
- Add a "lineno" format for transactions that render in "Emacs errors" |
| 4067 |
compatible format, so we can easily jump in time throughout the input file |
| 4068 |
instead of rendering a journal. Offer the option to list in reverse to. This |
| 4069 |
should be invokable from the SQL shell. |
| 4070 |
|
| 4071 |
- Register (with filter) should have "print" mode that also includes |
| 4072 |
file:lineno so that we can make Emacs "jump" between the transactions in |
| 4073 |
the order they appear. |
| 4074 |
|
| 4075 |
** Trading |
| 4076 |
|
| 4077 |
- Produce example transactions for each of the cases provided by Filippo's |
| 4078 |
sample transactions. |
| 4079 |
|
| 4080 |
** Tools: Formatting |
| 4081 |
|
| 4082 |
- BUG: There is a bug in bean-format; on |
| 4083 |
/home/blais/sharing-with-roommate/liabilities-account-solution.beancount, it |
| 4084 |
fails with an assertion. I highly suspect that it's because of postings like this: |
| 4085 |
Expenses:Electricity 45.34/2 USD |
| 4086 |
Liabilities:Alice 45.34/2 USD |
| 4087 |
|
| 4088 |
* Crypto |
| 4089 |
|
| 4090 |
Start thinking about some features for crypto users. |
| 4091 |
|
| 4092 |
- Make it possible to transfer lots with cost between accounts without having |
| 4093 |
to specify the full detail (use matching). |
| 4094 |
|
| 4095 |
* Misc Grab Bag of Ideas |
| 4096 |
|
| 4097 |
Here follows a grab bag of ideas. When I have a new idea coming to me, I don't |
| 4098 |
have time to think about where to put it, I just come here at the end and jot |
| 4099 |
it down. Every couple of years I clean this mess up and put it in the sections |
| 4100 |
above. |
| 4101 |
|
| 4102 |
- Add HIGHEST_COST booking method. |
| 4103 |
|
| 4104 |
- Make queries with group by order by unaggregated columns by default (output |
| 4105 |
should be stable even without ORDER BY clause. |
| 4106 |
|
| 4107 |
- IDEA: In linked and context commands, output the sum of all positive and all |
| 4108 |
negatives numbers (like "Net Income" sum in 'linked'). |
| 4109 |
|
| 4110 |
- IDEA: For ugly transactions like this, it's convenient to repeat account |
| 4111 |
names and amounts, like this: |
| 4112 |
|
| 4113 |
2020-08-09 * "Delta Dental" "Processing claim" ^deltadental-XXXXXXXXXXXx |
| 4114 |
service: 2020-08-07 |
| 4115 |
Expenses:Health:Dental:NonEligible 295.00 USD |
| 4116 |
Expenses:Health:Dental:NonEligible -50.00 USD |
| 4117 |
Expenses:Health:Dental:Deductible 50.00 USD |
| 4118 |
Expenses:Health:Dental:NonEligible 0.20 * -202.00 USD |
| 4119 |
Expenses:Health:Dental:Coinsurance 0.20 * 202.00 USD |
| 4120 |
Expenses:Health:Dental:NonEligible 0.80 * -202.00 USD |
| 4121 |
Expenses:Health:Dental:Allowed 0.80 * 202.00 USD |
| 4122 |
Expenses:Health:Dental:Reimbursement -161.60 USD |
| 4123 |
Assets:AccountsReceivable:Anthem:Dental |
| 4124 |
|
| 4125 |
But we don't want them applied as such. It would be nice to have those |
| 4126 |
automatically turned into: |
| 4127 |
|
| 4128 |
2020-08-09 * "Delta Dental" "Processing claim" ^deltadental-XXXXXXXXXXXx |
| 4129 |
service: 2020-08-07 |
| 4130 |
Expenses:Health:Dental:NonEligible 43.00 USD <--- here. |
| 4131 |
Expenses:Health:Dental:Deductible 50.00 USD |
| 4132 |
Expenses:Health:Dental:Coinsurance 40.40 USD |
| 4133 |
Expenses:Health:Dental:Allowed 161.60 USD |
| 4134 |
Expenses:Health:Dental:Reimbursement -161.60 USD |
| 4135 |
Assets:AccountsReceivable:Anthem:Dental |
| 4136 |
|
| 4137 |
It's fine if this is done only for postings with the same currency and no |
| 4138 |
cost basis, or postings with a particular flag on, or just for some subset |
| 4139 |
of accounts. "automeld"? This would be nice in v3, as the original parsed |
| 4140 |
transaction can keep all the original detail while the reduced one only |
| 4141 |
appears in the finaly flow. |
| 4142 |
|
| 4143 |
Or maybe... this shoule be global and automatic? Impelment it, and print |
| 4144 |
out which transactions would be affected to find out. |
| 4145 |
|
| 4146 |
- `bean-doctor linked` command should render the balances after each |
| 4147 |
transaction. Either horizontally (new columns), or a dedicated tree right |
| 4148 |
after each. Add an option. This would be nice for debugging. |
| 4149 |
|
| 4150 |
- `bean-doctor linked`: The account types aren't in the correct order. It |
| 4151 |
shows Assets, Expenses, Liabilities... put all the balance statemnet |
| 4152 |
accounts first, then income statement accounts, finally, equity. |
| 4153 |
|
| 4154 |
- Plugin idea: A plugin that ensures that there is no residual commodity in an |
| 4155 |
account as of its closing. |
| 4156 |
|
| 4157 |
- For Vanguard RothIRA, I need a balance check that applies only to a subset |
| 4158 |
of linked transactions. I'm being provided with this number in the imported |
| 4159 |
file but I have to split the transactions themselves. |
| 4160 |
|
| 4161 |
- Turn all FIXME into TODO(blais) and NOTE(blais). |
| 4162 |
|
| 4163 |
- "find $PWD | treeify -F" is broken; used to work. Update and fix this. |
| 4164 |
|
| 4165 |
- Make the spreadsheets <-> beancount upload/download conversion scripts more |
| 4166 |
general and flexible and provide them to the general public. These are |
| 4167 |
really powerful. |
| 4168 |
|
| 4169 |
- When env var L is set to a directory, failure just says that the Lex scanner |
| 4170 |
fails; this should mention the name of the file, so it's clear. Sometimes I |
| 4171 |
override "L". |
| 4172 |
|
| 4173 |
- In order to render all linked transactions, support pulling the referenced |
| 4174 |
link or tag name under the cursor (in Emacs). |
| 4175 |
|
| 4176 |
- In beancount.plugins.auto_accounts: It would be really nice to constraint |
| 4177 |
which types accounts can be auto-created, for example, don't auto-create |
| 4178 |
Assets/Income accounts. This would be helpful in trip files. |
| 4179 |
|
| 4180 |
- Idea! Add original conversion rate on an augmenting leg with cost basis, in |
| 4181 |
order to be able to partition profits due to appreciate vs. currency drift. |
| 4182 |
See https://groups.google.com/d/msgid/beancount/939fe47e-382a-4272-94e6-dd29f660d519%40googlegroups.com?utm_medium=email&utm_source=footer |
| 4183 |
|
| 4184 |
"This brings up an interesting point, one which I had never given much |
| 4185 |
though before: if we wanted to solve this problem - and I think it may be |
| 4186 |
worthwhile to do so - couldn't we just (optionally) store the original |
| 4187 |
exchange rate at the time the lot was converted, with the lot (i.e., |
| 4188 |
Position object) itself? That is, each lot would store: |
| 4189 |
- units (amount, currency) |
| 4190 |
- cost (amount, currency, acquistion-date, label, rate*) |
| 4191 |
(*) This being the new bit. |
| 4192 |
|
| 4193 |
Given those rates, we should be able to compute the current value of the |
| 4194 |
cost basis in the local currency, and that against how much it cost us |
| 4195 |
originally, should tell us the proportion of gain/loss due solely to |
| 4196 |
currency appreciation/depreciation (ignore the effect relative interest |
| 4197 |
differences between the two currencies)." |
| 4198 |
|
| 4199 |
- Three interesting ideas for extending booking further here: |
| 4200 |
https://groups.google.com/d/msgid/beancount/9c9dcc5f-72bf-44b2-aaf9-4e0c07cbff77%40googlegroups.com?utm_medium=email&utm_source=footer |
| 4201 |
|
| 4202 |
1. When you apply the partial booking specification, it could be applied |
| 4203 |
against the booked legs of the transaction in order to select cost bases. |
| 4204 |
I'm not sure if this generalizes. |
| 4205 |
|
| 4206 |
"Finally, the partial specification, say, just specifying the date, is |
| 4207 |
used to narrow down the lot against the list of possible lots in the |
| 4208 |
Inventory of the account before applying the transaction, but NOT against |
| 4209 |
the list of other postings. That would be an interesting power to add to |
| 4210 |
the booking system, as it could disambiguate this case." |
| 4211 |
|
| 4212 |
2. One could assume a single currency group in each transaction when there's |
| 4213 |
at least one posting at cost. |
| 4214 |
|
| 4215 |
3. One could also assume that in that account a commodity is never priced in |
| 4216 |
terms of two different currencies. |
| 4217 |
|
| 4218 |
- Allow plugins to run before and after booking; this would make it possible |
| 4219 |
for plugins to run on CostSpec and fill in more information. In fact, maybe |
| 4220 |
the booking process itself could be moved to a plugin. This coudl be a |
| 4221 |
powerful idea, in that it would clarify the distinction between the two |
| 4222 |
streams of transactions. |
| 4223 |
|
| 4224 |
- Add support for this data source: https://www.alphavantage.co/documentation/ |
| 4225 |
|
| 4226 |
|
| 4227 |
- Sometimes it might be useful to end the stream of useful transactions at a |
| 4228 |
particular point in the input file. Normally this is best done by filtering |
| 4229 |
in the queries themselves, but there are times where having an End |
| 4230 |
directives specified temporarily in the input file would have been useful |
| 4231 |
(e.g. when traveling and running temporary balances while editing the input |
| 4232 |
file). Consider adding this facility, it might be a convenience, especially |
| 4233 |
to get around some of the absence of time issues. |
| 4234 |
|
| 4235 |
- In the new SQL shell, allow the plugins to define new subsets of postings |
| 4236 |
(transactions), so that they can be queries separately. For instance, when |
| 4237 |
I'm traveling, it should be possible to query the set of transactions before |
| 4238 |
or after the split_expenses plugin ran. This would actually have been useful |
| 4239 |
while traveling, because the split_expenses plugin doubles up a lot of the |
| 4240 |
postings (that's what it does...). |
| 4241 |
|
| 4242 |
- Document the "{ <num> # <num> <ccy> }" syntax properly, in a dedicated place. |
| 4243 |
|
| 4244 |
- New currency sources: |
| 4245 |
https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html |
| 4246 |
https://news.ycombinator.com/item?id=15616880 |
| 4247 |
|
| 4248 |
- Idea: Add "contra" as a new column, when the sign posted in the wrong |
| 4249 |
direction based on the account type. Or add a boolean "contra" virtual |
| 4250 |
column (or function, from account name). |
| 4251 |
|
| 4252 |
- Here's another way to implement an intra-day balance: define a new balance |
| 4253 |
directive type, whose semantic is tp sort all the entries, but the entries |
| 4254 |
on the same day of the balance are sorted in file order. I think this would |
| 4255 |
handle the most common use case. Try it (experiment). |
| 4256 |
|
| 4257 |
- It might be interesting to support some sort of transfer syntax that would |
| 4258 |
allow the movement of Position's across accounts, without converting to the |
| 4259 |
cost, something like this: |
| 4260 |
|
| 4261 |
2000-01-01 * "Transfer shares from BrokerOne to BrokerTwo to sell at BrokerTwo" |
| 4262 |
Assets:BrokerOne -10 HOOL {} |
| 4263 |
Assets:BrokerTwo |
| 4264 |
|
| 4265 |
While this example is simple enough, a fully general version of this might |
| 4266 |
not be, but it's worth prototyping. This would require some sort of new |
| 4267 |
syntax for these "transfers." |
| 4268 |
|
| 4269 |
- Rationalize the strategy for reporting errors. |
| 4270 |
|
| 4271 |
- Rendering idea: If a posting moved the balance in the unusual direction |
| 4272 |
(positive for Income, negative for Expenses), it could be rendered with a |
| 4273 |
highlight or a different color. These are rare and unusualy. One could also |
| 4274 |
do the same for Assets (when the amount moves up) or Liabilities (when it |
| 4275 |
moves down). |
| 4276 |
|
| 4277 |
- Create a new "AssertQuery" directive to assert that the result of a |
| 4278 |
particular query produces a particular Inventory. For example, you could |
| 4279 |
check your total contributions to an account over a period of time like |
| 4280 |
this: |
| 4281 |
|
| 4282 |
2018-03-11 assert_query " |
| 4283 |
select sum(position) |
| 4284 |
where year = 2018 |
| 4285 |
and account ~ 'Assets:US:Vanguard:Retire:AfterTax:Cash' |
| 4286 |
and number > 0" == 27250 USD |
| 4287 |
|
| 4288 |
- In the account name completion function in Emacs, don't include the name of |
| 4289 |
closed accounts. |
| 4290 |
|
| 4291 |
- Ingest should sort the transaction using a secondary "txndate:" metadata |
| 4292 |
field and document this somewhere. |
| 4293 |
|
| 4294 |
- Idea: Upon an irrecoverable error in the postings, instead of skipping a |
| 4295 |
transaction, record it without any postings. This will allow "bean-doctor |
| 4296 |
context" to at least find the offending transaction. |
| 4297 |
|
| 4298 |
- Idea: Limit the absolute value that can be posted to rounding accounts. The |
| 4299 |
limits could be automatically derived from the tolerance values. |
| 4300 |
|
| 4301 |
- Integrate the docs from here: https://bitbucket.org/aumayr/beancount |
| 4302 |
|
| 4303 |
- Idea to deal with #145: Add all augmenting postings, THEN book all reducing |
| 4304 |
ones against that. |
| 4305 |
|
| 4306 |
- Full booking: We need an example of two reducing bookings competing for the |
| 4307 |
same lot. |
| 4308 |
|
| 4309 |
- Implement IPython/Jupyter notebook support for directly viewing the results |
| 4310 |
of queries. |
| 4311 |
|
| 4312 |
- "bean-doctor linked" should list the list of links that were followed. That |
| 4313 |
would go some of the way to explain some of the sometimes surprising |
| 4314 |
results. |
| 4315 |
|
| 4316 |
- SQL: OpenMeta is different than Meta; it returns a dict. That's bad. Provide |
| 4317 |
a direct lookup, like Meta. |
| 4318 |
|
| 4319 |
- Complete tests for csv importer; it should be tested frantically, and a |
| 4320 |
decent sniffer should be implemented, specifically with credit/debit support |
| 4321 |
and balance vs. posting amount support, as well as detecting fees. |
| 4322 |
|
| 4323 |
- Add an AVERAGE function to the SQL shell. |
| 4324 |
See related discussion, I would like to compute this for myself too: |
| 4325 |
https://groups.google.com/d/msg/ledger-cli/dWuWysV6qZU/cyYNzleTCAAJ |
| 4326 |
|
| 4327 |
- There ought to be some unit tests for all the custom metadata added to |
| 4328 |
Posting instances. I think this is undertested at the moment. |
| 4329 |
|
| 4330 |
- Implement a new plugin to convert metadata-fields to Document directives. |
| 4331 |
|
| 4332 |
Scan all transactions that have the invoice-metadata field (or any other |
| 4333 |
suiting field-name of your choice), and create a Document directive for |
| 4334 |
each, with a link to the transaction it comes from. |
| 4335 |
|
| 4336 |
In doing so, add support for "fuzzy-matching": When only a relative |
| 4337 |
filename is specified in the metadata-field (and Document directive), search |
| 4338 |
different locations based on the Account this is on/in. |
| 4339 |
|
| 4340 |
See https://github.com/aumayr/fava/issues/386#issuecomment-256895713. |
| 4341 |
|
| 4342 |
|
| 4343 |
- Core: Some problems occur (with the new method) if you mix at-cost and |
| 4344 |
without-cost for the same currency, like this: |
| 4345 |
|
| 4346 |
2015-09-15 * "Buy" |
| 4347 |
Assets:Investments:HOOL 50.795 HOOL {14.63 USD} @ 14.63 USD |
| 4348 |
Assets:Investments:Cash -743.13 USD |
| 4349 |
Equity:Vanguard:Rounding |
| 4350 |
|
| 4351 |
2015-09-24 * "Dividend Received" |
| 4352 |
Assets:Investments:HOOL 0.252 HOOL {14.11 USD} @ 14.11 USD |
| 4353 |
Income:Vanguard:Retire:AfterTax:HOOL:Dividend -3.56 USD |
| 4354 |
Equity:Vanguard:Rounding |
| 4355 |
|
| 4356 |
2016-05-09 * "Conversion From" |
| 4357 |
Assets:Investments:HOOL -51.047 HOOL @ 14.33 USD |
| 4358 |
Assets:Investments:Cash 731.50 USD |
| 4359 |
Income:Vanguard:Retire:AfterTax:HOOL:Pnl |
| 4360 |
|
| 4361 |
2016-05-10 balance Assets:Investments:HOOL 0 HOOL |
| 4362 |
|
| 4363 |
2016-05-10 * "Buy" |
| 4364 |
Assets:Investments:HOOL 292.285 HOOL {14.33 USD} @ 14.33 USD |
| 4365 |
Assets:Investments:Cash -4188.44 USD |
| 4366 |
Equity:Vanguard:Rounding |
| 4367 |
|
| 4368 |
The better way to deal with this would be not to allow it to happen. Because |
| 4369 |
this needs to be applied during matching, we cannot implement this in a |
| 4370 |
plugin, this needs to become an option (to allow it, and to make it |
| 4371 |
disallowed by default) in the parser itself. |
| 4372 |
|
| 4373 |
- The Beancount loader cache should be automatically invalidated if the |
| 4374 |
revision of Beancount has been updated. This could avoid some potentially |
| 4375 |
confusing user interpretation of errors. |
| 4376 |
|
| 4377 |
- Idea to deal with #145: Add all augmenting postings, THEN book all reducing |
| 4378 |
ones against that. |
| 4379 |
|
| 4380 |
- Full booking: We need an example of two reducing bookings competing for the |
| 4381 |
same lot. |
| 4382 |
|
| 4383 |
- Implement IPython/Jupyter notebook support for directly viewing the results |
| 4384 |
of queries. |
| 4385 |
|
| 4386 |
- "bean-doctor linked" should list the list of links that were followed. That |
| 4387 |
would go some of the way to explain some of the sometimes surprising |
| 4388 |
results. |
| 4389 |
|
| 4390 |
- SQL: OpenMeta is different than Meta; it returns a dict. That's bad. Provide |
| 4391 |
a direct lookup, like Meta. |
| 4392 |
|
| 4393 |
- Implement beancount.plugins.auto and beancount.plugins.pedantic finally. |
| 4394 |
|
| 4395 |
- You need to add options to provide the precision to use for prices, |
| 4396 |
otherwise something like this: |
| 4397 |
|
| 4398 |
2016-07-15 * "Resto" "Nice dinner near Storm Hotel" ^b4cd7330bc3d |
| 4399 |
Expenses:Food:Restaurants 12500 ISK |
| 4400 |
Income:Martin:CreditCard -103.18 USD @ ISK |
| 4401 |
|
| 4402 |
will render as |
| 4403 |
|
| 4404 |
2016-07-15 * "Resto" | "Nice dinner near Storm Hotel" ^b4cd7330bc3d |
| 4405 |
Expenses:Food:Restaurants:Martin 6250 ISK ; 6250 ISK |
| 4406 |
Expenses:Food:Restaurants:Caroline 6250 ISK ; 6250 ISK |
| 4407 |
Income:Martin:CreditCard -103.18 USD @ 121 ISK ; -12499.99999999999999999999999 ISK |
| 4408 |
|
| 4409 |
instead of |
| 4410 |
|
| 4411 |
2016-07-15 * "Resto" | "Nice dinner near Storm Hotel" ^b4cd7330bc3d |
| 4412 |
Expenses:Food:Restaurants:Martin 6250 ISK ; 6250 ISK |
| 4413 |
Expenses:Food:Restaurants:Caroline 6250 ISK ; 6250 ISK |
| 4414 |
Income:Martin:CreditCard -103.18 USD @ 121.148 ISK ; -12499.99999999999999999999999 ISK |
| 4415 |
|
| 4416 |
Right now, the only solution is to provide at least one price with a |
| 4417 |
suitable precision. |
| 4418 |
|
| 4419 |
Another solution, instead of letting the user select the precision, for |
| 4420 |
inferred prices, would be to infer maximum precision by default if a digit |
| 4421 |
of precision hasn't been seen yet. Round prices shouldn't imply 0 digits of |
| 4422 |
precision when it comes to inferred prices, for rendering. |
| 4423 |
|
| 4424 |
Note that the actual numbers derived are correct, the only problem is how |
| 4425 |
they get rendered by default. |
| 4426 |
|
| 4427 |
- Try to modify b.l._parse_recursive() to reuse the DisplayContext object |
| 4428 |
across all the parsed files, in order to accumulate its full state. Some |
| 4429 |
users (from fava, e.g. Daniel Bos, see thread on mailing-list) are defining |
| 4430 |
a single top-level file with only includes, and this breaks the rendering of |
| 4431 |
the fractional digits in the web interface in a severe way. |
| 4432 |
|
| 4433 |
- Investigate using PrettyTable over my custom one. Is there any point to that? |
| 4434 |
|
| 4435 |
- Put all the contents of experiments/ under their own directories and add |
| 4436 |
decent README files for each of these. |
| 4437 |
|
| 4438 |
- Write a new plugin to spread cash transactions over multiple dates. Use a |
| 4439 |
template transaction in the input file as input. |
| 4440 |
|
| 4441 |
- Setup continuous integration that would push build status for each commit to |
| 4442 |
bitbucket's build status API. Buildbot already has a plugin for this. |
| 4443 |
|
| 4444 |
- In upload_assets.py, add the export date somewhere very visible. |
| 4445 |
|
| 4446 |
- Convert the upload.py script to use the Sheets v4 API instead of gspread. |
| 4447 |
|
| 4448 |
- Produce pivot on monthly expenses as a custom report, the need for this |
| 4449 |
occurs too often to wait for the SQL shell to support it. |
| 4450 |
|
| 4451 |
- The Beancount presentation should include the table's implicit join, |
| 4452 |
graphically, and then explain select/filter/aggregate. Include a section in |
| 4453 |
the design doc about this, or perhaps even in its own doc. |
| 4454 |
|
| 4455 |
- Add support for the ABC's for the pure interfaces, e.g. |
| 4456 |
beancount.prices.sources, beancount.ingest.importers, etc. |
| 4457 |
|
| 4458 |
- Start accumulating test cases from real data for similarity classification, |
| 4459 |
and rewrite this function from scratch, it just doesn't work well at all. |
| 4460 |
|
| 4461 |
- Port all my wash sales scripts to use the new booking method. This ought to |
| 4462 |
be working now, with the new booking method. |
| 4463 |
|
| 4464 |
- Create an explicit license for my documentation, one that is compatible to |
| 4465 |
publishing this as a book later on. |
| 4466 |
|
| 4467 |
- BUG: The "bean-doctor context" command does not provide any useful |
| 4468 |
information if there was an error on the transaction at context and its |
| 4469 |
postings are empty. If we're looking to get the set of lots before and |
| 4470 |
after, it's not obvious. |
| 4471 |
|
| 4472 |
- Compute and render the difference on a sellgains error. In order to make |
| 4473 |
this work, you'll have to implement a difference between inventories. |
| 4474 |
|
| 4475 |
- This will fail because of an unfortunate ordering in the transactions on |
| 4476 |
the same date: |
| 4477 |
|
| 4478 |
2014-08-11 * "Google Massage - 60 minute Table Massage" | "Online purchase" |
| 4479 |
Assets:US:GoogleInc:Wallet -60.00 USD |
| 4480 |
Assets:US:GoogleInc:Massage 120 RUB {0.50 USD} |
| 4481 |
|
| 4482 |
2014-08-11 * "Table Massage 60 mins - GB" ^7430817d565c |
| 4483 |
Assets:US:GoogleInc:Massage -60 RUB {0.50 USD} |
| 4484 |
Expenses:Health:Healing:Massage |
| 4485 |
|
| 4486 |
This is normally fixed by fudging the date on the second transaction to 8/12. |
| 4487 |
The thing is, we could either |
| 4488 |
|
| 4489 |
* Make the check allow a temporary negative balance if on the same date, or |
| 4490 |
* Reorder the transactions so that the positive amounts always occur first. |
| 4491 |
(I'm not sure that's always possible, imaging a combo of postings that |
| 4492 |
requires the opposite order in order for this to work). |
| 4493 |
|
| 4494 |
This problem occurs rarely, but when it does, it's annoying to deal with |
| 4495 |
because the error removes the transaction and it cascades to more errors. |
| 4496 |
Fixing this would help usability a fair amount. |
| 4497 |
|
| 4498 |
- This type of interpolation with per-account currency constraints should just work: |
| 4499 |
|
| 4500 |
YYYY-MM-DD open Expenses:Communications:Internet USD |
| 4501 |
YYYY-MM-DD open Assets:US:Points:Verizon VERIPTS |
| 4502 |
|
| 4503 |
2017-03-12 * "VERIZON ONETIMEPAY VERIZON.COM FL" "PHONE SRV" |
| 4504 |
Liabilities:US:CreditCard -178.37 USD |
| 4505 |
Expenses:Communications:Internet |
| 4506 |
Income:US:Rewards -650 VERIPTS |
| 4507 |
Assets:US:Points:Verizon |
| 4508 |
|
| 4509 |
- You should definitely do some anomaly detection on the list of prices, when |
| 4510 |
prices go out of whack with the rest of the time series. I had this happen |
| 4511 |
with a rewritten and buggy new price source. This could be done in a plugin |
| 4512 |
and would be useful, as invalid prices can manifest in some wildly incorrect |
| 4513 |
totals, and this is a common error. Easy with good payoff on correctness. |
| 4514 |
Make this part of the pedantic list as well. |
| 4515 |
|
| 4516 |
|
| 4517 |
** Google Keep Tickets |
| 4518 |
|
| 4519 |
- Unicode support: add a basic filter with 'ignore' to a temp file, before I |
| 4520 |
finish having a proper lexer. Kick the tires off a lexer anyhow. |
| 4521 |
|
| 4522 |
- Idea: select * from transactions, but you have to find a way to |
| 4523 |
open/close/clear either before filtering or after. |
| 4524 |
|
| 4525 |
- Print out metadata from the C-c x bean-doctor context command |
| 4526 |
|
| 4527 |
- Get to a point where you can compute long term vs short term |
| 4528 |
|
| 4529 |
- For testing decimal, work the renderers from a given dictionary, either |
| 4530 |
computed or given glabally. A maximum should be enforced too. |
| 4531 |
|
| 4532 |
- Testing for rendering Needs to test with numbers under prec, over prec, |
| 4533 |
integers, with wild prec (enforce max). |
| 4534 |
|
| 4535 |
- Add a display_precision option yo allow the user to override it. |
| 4536 |
|
| 4537 |
- Add warning on repeated metadata value key |
| 4538 |
|
| 4539 |
- Returns: identify entries with intflows + extflows on one transaction, |
| 4540 |
without assets, they should be printed out for review in dates after all |
| 4541 |
assets accounts are opened |
| 4542 |
|
| 4543 |
- Preso: offer an estimate of data size for a ledger and show how its really |
| 4544 |
small. |
| 4545 |
|
| 4546 |
- Finish prior to spreadsheet replicating g finance |
| 4547 |
|
| 4548 |
- Add change from trailing day, week, month, helps making decision based on |
| 4549 |
recent trends |
| 4550 |
|
| 4551 |
- Idea: introduce balance checks on preso, immediately motivates the de |
| 4552 |
method! Highlight errors |
| 4553 |
|
| 4554 |
- If I sell my entire position of multiple lots the booking should be able to |
| 4555 |
infer that this is umambiguous |
| 4556 |
|
| 4557 |
- Don't allow negative units by default--modify STRICT method to disallow |
| 4558 |
that. |
| 4559 |
|
| 4560 |
- Idea: stock split could be its own directive with a corresponding stream |
| 4561 |
transformation, all defined in a plugin |
| 4562 |
|
| 4563 |
- Idea: wash adjusents to adjutsment account and zero balance in 2015, instead |
| 4564 |
of washing to pnl account. Do this now. |
| 4565 |
|
| 4566 |
- Beancount: Review terminology used in documents, use "Clearing" instead of |
| 4567 |
"Transfer." |
| 4568 |
|
| 4569 |
- Idea: report only on last posting of a transaction! |
| 4570 |
|
| 4571 |
- In reading example of stock split, add one that maintains the original |
| 4572 |
purchase date |
| 4573 |
|
| 4574 |
*** Sqltool why interesting ? |
| 4575 |
|
| 4576 |
- Automatic schemas |
| 4577 |
- Typed calculations |
| 4578 |
- Single line |
| 4579 |
- Basic operations |
| 4580 |
- Running commands |
| 4581 |
|
| 4582 |
- Broadcast concept, for inventories |
| 4583 |
- Data (..., "html", 1), Html(...) |
| 4584 |
- Sources: Beancount, ledger, hledger, CSV, dbm, Xls, xml, etc. |
| 4585 |
|
| 4586 |
*** Taxes & Finance |
| 4587 |
|
| 4588 |
- In Canada, all trading is carried out at average lot! Since when? Adjust my Beancount file. |
| 4589 |
- When in foreign land, how much is the base deduction (-93k?) and are you only subject to federal tax rate when you're not there? |
| 4590 |
- Q: Can you convert short term gains into long ones via a wash sale? |
| 4591 |
|
| 4592 |
** File Entries from TODO file |
| 4593 |
*** Urgent-ish |
| 4594 |
|
| 4595 |
- Unify bean-doctor linked and bean-doctor context; make it one, and C-u |
| 4596 |
prefix triggers links, perhaps ask for which link |
| 4597 |
|
| 4598 |
- Create a demo video about ?context? and ?linked? command-line tools. |
| 4599 |
|
| 4600 |
- Add a function to fetch a particular subset of tags with a regular |
| 4601 |
expression, e.g. FIRST_REGEXP('award'). Use this on the imported |
| 4602 |
stockstatement transactions. This can be used to create a column out of a |
| 4603 |
set of tags. |
| 4604 |
|
| 4605 |
*** Documentation / Process |
| 4606 |
|
| 4607 |
- Complete the CA and handle all remaining pull requests and minor bugs. |
| 4608 |
|
| 4609 |
- Improve the Lang Syn doc right before the Unused Pad Directives by adding an |
| 4610 |
intervening transaction instead of explaining how it works. It would be much |
| 4611 |
clearer. |
| 4612 |
|
| 4613 |
- Write a doc (video) that explains how to debug issues, context, linked, print, etc. |
| 4614 |
|
| 4615 |
*** Branches |
| 4616 |
|
| 4617 |
- Finish work on booking branch |
| 4618 |
|
| 4619 |
- SQL tool really ought to be extracted away from Beancount, extract as a |
| 4620 |
separate project. |
| 4621 |
|
| 4622 |
*** Small Tasks |
| 4623 |
|
| 4624 |
- A large imbalance will appear as a RoundingError, which it shouldn?t! |
| 4625 |
RoundingError?s should only be inserted when a transaction balances! Run a |
| 4626 |
context on a non-balancing transaction and you?ll see what I mean. |
| 4627 |
|
| 4628 |
- Build a script that can list all my cap. gains for tax-loss harvesting. |
| 4629 |
|
| 4630 |
- Modify networth script to list post-tax worth, basis + pre-tax value = |
| 4631 |
post-tax value, segment based on accounts. |
| 4632 |
|
| 4633 |
- Finish that Health Care tracking document. |
| 4634 |
|
| 4635 |
- Move over the updating process to Google Spreadsheets solution. |
| 4636 |
|
| 4637 |
- Remove all double descriptions in importers in ledgerhub (when payee == |
| 4638 |
narration). |
| 4639 |
|
| 4640 |
- beancount-linked is broken, missing line number, and an exception is raised: |
| 4641 |
bean-doctor linked blais.beancount 57660; fix this now, rename as |
| 4642 |
beancount-context-linked and add a better binding. Use this a lot more. |
| 4643 |
|
| 4644 |
- Booking: generate all combinations for just currencies, missing or not, in |
| 4645 |
order to complete categorize implementation; (1) apply cost-currency = |
| 4646 |
price-currency constraint, (2) infer currency from other legs, (3) infer |
| 4647 |
currency from inventory. |
| 4648 |
|
| 4649 |
- Define a way to specify output format for rendering many queries, and |
| 4650 |
perhaps that should include a Google doc directly that makes an upload, even |
| 4651 |
if that has to call out to a Python2 subprocess (that?s fine). Use that |
| 4652 |
everywhere. |
| 4653 |
|
| 4654 |
- Add ?display_tolerances? rendering override to fix bug with rendering HKD in |
| 4655 |
trips, should be mirroring tolerances input syntax. Bug with Beancount: |
| 4656 |
journal ?Assets:Caroline:Octopus? does not render with correct precision. |
| 4657 |
|
| 4658 |
- Remove unused auto-postings, they distract from the reporting. |
| 4659 |
|
| 4660 |
- Deal with flattening now (default should be never to flatten, never render |
| 4661 |
empty fields on a continuation line for an inventory) and THEN implement CSV |
| 4662 |
rendering. |
| 4663 |
|
| 4664 |
- Implement implicit GROUP-BY now. |
| 4665 |
|
| 4666 |
- Move ?bean-doctor missing-open? to ?bean-reports missing-open?, this really |
| 4667 |
is a report type. |
| 4668 |
|
| 4669 |
- Merge 3 newer monnier beancount.el patches. |
| 4670 |
|
| 4671 |
- Bug: an unbalanced tag should output a correct line number in the error. |
| 4672 |
Right now mistaking push/pop as push/push outputs an error with a zero line |
| 4673 |
number, not useful. Need this. Fix this. |
| 4674 |
|
| 4675 |
- Complete ultipro tables from PDF parser. |
| 4676 |
|
| 4677 |
- payees: train a little model on my payee names to convert them to nice, |
| 4678 |
clean payee names. Extract the data now. |
| 4679 |
|
| 4680 |
- returns2: Returns revamp + web reports. |
| 4681 |
|
| 4682 |
- booking: Implement booking proposal. |
| 4683 |
|
| 4684 |
- export: Export to spreadsheets. |
| 4685 |
|
| 4686 |
- Document arithmetic operations support |
| 4687 |
|
| 4688 |
- Export to Google Spreadsheets: Complete and document how to upload to a Trix |
| 4689 |
|
| 4690 |
- Doc on exportpf |
| 4691 |
|
| 4692 |
- Conversions: Document how open close clear works. This is really important. |
| 4693 |
Use as an important the desire to pre-enter transactions from the future |
| 4694 |
(e.g., Jon Stahl?s vesting events). |
| 4695 |
|
| 4696 |
- Write Intro with an explanation of open/close/clear. |
| 4697 |
|
| 4698 |
- Finish parser cleanup for Unicode. |
| 4699 |
|
| 4700 |
- Store residual in metadata, print it out in context |
| 4701 |
|
| 4702 |
- ?Transaction does not balance? message should include the tolerance value |
| 4703 |
allowed. |
| 4704 |
|
| 4705 |
- Complete ?legacy? doc generation (merge assets.asc into that doc, we |
| 4706 |
shouldn?t need assets.asc once that?s done, and schematize its contents) And |
| 4707 |
start using this. |
| 4708 |
|
| 4709 |
- Plugins doc: Add documentation for sellgains plugin in the rest of the docs |
| 4710 |
(and of all other plugins). |
| 4711 |
|
| 4712 |
- Add a section about Options in the Trading document, with these contents. |
| 4713 |
|
| 4714 |
- Implement year close via command-line. |
| 4715 |
|
| 4716 |
- Convert dividends to per-stock returns. |
| 4717 |
|
| 4718 |
- Wrap up docs? Use the framedocs script? |
| 4719 |
|
| 4720 |
- This should be the goto/ project, it should be able to do that. |
| 4721 |
|
| 4722 |
- Definitely make a teaching video? this will be useful for applications to |
| 4723 |
other things! |
| 4724 |
|
| 4725 |
- Write a doc specifically on handling the vesting of shares, including the |
| 4726 |
tracking of unvested shares. |
| 4727 |
|
| 4728 |
- Write doc on booking taxes NOW. |
| 4729 |
|
| 4730 |
- Complete unfinished doc on health care. |
| 4731 |
|
| 4732 |
- Convert blais.portfolio to a number of SQL scripts. |
| 4733 |
|
| 4734 |
- Why doesn?t ^c2fbec103d99 generate an error?!? |
| 4735 |
Ha! It?s because it?s NOT a mixed result? only negatives. Maybe allow only |
| 4736 |
positive totals with a different mode, somehow. A constraint on |
| 4737 |
dictionaries, another booking method. Maybe that should be the default: |
| 4738 |
don?t allow negatives at all. |
| 4739 |
|
| 4740 |
*** Accounting |
| 4741 |
|
| 4742 |
- Measure time taken to find and process documents in ingest and only cache it |
| 4743 |
if very long. |
| 4744 |
|
| 4745 |
- Document the idea of implementing a virtual SQLite table for Beancount |
| 4746 |
|
| 4747 |
- Plan is to support smart sniffers |
| 4748 |
|
| 4749 |
- Convert to schema automatically |
| 4750 |
|
| 4751 |
- Load them into SQLite tables, or make sources as adapters to virtual tables |
| 4752 |
|
| 4753 |
- Add a first step that?s a conversion |
| 4754 |
|
| 4755 |
*** SQLite |
| 4756 |
|
| 4757 |
- Q. Can we invoke arbitrary Python functions from SQLite? |
| 4758 |
|
| 4759 |
- Look at termsql & sqlparse |
| 4760 |
|
| 4761 |
*** Idea for talk |
| 4762 |
|
| 4763 |
- Start with a description of all the desired processes and their outputs |
| 4764 |
|
| 4765 |
- Then put down the realization: (work to do all of these separately) >>> |
| 4766 |
(work to represent all inputs) |
| 4767 |
|
| 4768 |
- Black box in the middle of >>>, *THAT*?s what Beancount does |
| 4769 |
|
| 4770 |
*** Contributor agreement |
| 4771 |
|
| 4772 |
- Add this to Beancount contributor agreement notes: CLA: |
| 4773 |
https://cla.developers.google.com/about/google-corporate |
| 4774 |
|
| 4775 |
*** Idea |
| 4776 |
|
| 4777 |
- Implement a feature that generates a closing + opening transaction to be |
| 4778 |
able to split one?s file to multiple files. This should include the currency |
| 4779 |
conversions as well. |
| 4780 |
|
| 4781 |
- Create a script that splits up a file at a particular date and output two |
| 4782 |
files! You should be able to split by date interval, and by tag (to extract |
| 4783 |
all the transactions with a particular tag to a separate file). |
| 4784 |
|
| 4785 |
- Provide a plugin that summarizes all the balances from transactions marked |
| 4786 |
with a particular tag, and replaces those with a single transaction. If all |
| 4787 |
the balances are zero, don?t output anything. This could be used to remove |
| 4788 |
the opening + closing transactions when including multiple files! |
| 4789 |
|
| 4790 |
*** Annuities |
| 4791 |
|
| 4792 |
- Annuities w/ numpy |
| 4793 |
** Starred Email - TODO |
| 4794 |
|
| 4795 |
- Omitting all currencies in a transaction does not raise an error. |
| 4796 |
https://bitbucket.org/blais/beancount/issues/125/omitting-all-currencies-in-a-transaction |
| 4797 |
|
| 4798 |
- Option to disable pickle cache |
| 4799 |
https://bitbucket.org/blais/beancount/issues/123/option-to-disable-pickle-cache |
| 4800 |
|
| 4801 |
- pickle cache prevents document folder from being scanned |
| 4802 |
https://bitbucket.org/blais/beancount/issues/122/pickle-cache-prevents-document-folder-from |
| 4803 |
|
| 4804 |
- If beancount file is encrypted relative document paths behave differently |
| 4805 |
https://bitbucket.org/blais/beancount/issues/119/if-beancount-file-is-encrypted-relative |
| 4806 |
|
| 4807 |
- Create a balance_end directive |
| 4808 |
https://bitbucket.org/blais/beancount/issues/118/create-a-balance_end-directive |
| 4809 |
https://groups.google.com/d/msgid/beancount/CALkVjQbGAgJiGFb0aT9rUUYtiWOYOWvJGUgKqgGsuSE7%3DrodCQ%40mail.gmail.com?utm_medium=email&utm_source=footer |
| 4810 |
|
| 4811 |
- Allow arithmetic operations on dates |
| 4812 |
https://bitbucket.org/blais/beancount/issues/115/allow-arithmetic-operations-on-dates |
| 4813 |
|
| 4814 |
- Missing account from bean-report balances |
| 4815 |
https://bitbucket.org/blais/beancount/issues/116/missing-account-from-bean-report-balances |
| 4816 |
|
| 4817 |
That's odd indeed. There's some background to this issue; some facts: - |
| 4818 |
There are multiple different types of balance reports, they all use a |
| 4819 |
different method to determine whether an empty balance account should be |
| 4820 |
rendered or not - Some of the criteria include: empty account has had |
| 4821 |
entries posted to it during the reporting period, empty account is open, |
| 4822 |
empty account has children - I need to review all of those and make them |
| 4823 |
consistent. |
| 4824 |
|
| 4825 |
I'll leave this ticket open for now and address this in time for your specific |
| 4826 |
case. (It's tax-time, so I have a few other features I'm focusing right now |
| 4827 |
which I need immediately, will work on this later.) |
| 4828 |
|
| 4829 |
- Documents directive with a trailing slash fails; relative path is undocumented |
| 4830 |
https://bitbucket.org/blais/beancount/issues/120/documents-directive-with-a-trailing-slash |
| 4831 |
|
| 4832 |
- Implement a HAVING clause |
| 4833 |
https://bitbucket.org/blais/beancount/issues/114/implement-having |
| 4834 |
|
| 4835 |
|
| 4836 |
|
| 4837 |
- A lot of decimal digits if using total price |
| 4838 |
https://bitbucket.org/blais/beancount/issues/109/a-lot-of-decimal-digits-if-using-total |
| 4839 |
|
| 4840 |
This is an interesting idea I hadn't thought about, basically for the completion |
| 4841 |
to round from the most precise until the tolerance fails. I like this. Will |
| 4842 |
definitely consider this and implement eventually. |
| 4843 |
|
| 4844 |
- Review all codes that renders units, costs and prices for precision using |
| 4845 |
display context. |
| 4846 |
https://bitbucket.org/blais/beancount/issues/107/review-all-codes-that-renders-units-costs |
| 4847 |
|
| 4848 |
- New issue 65: Context should render with natural precision |
| 4849 |
https://bitbucket.org/blais/beancount/issues/65/context-should-render-with-natural |
| 4850 |
|
| 4851 |
- New issue 60: Rendering precision for reports is inconsistent. |
| 4852 |
https://bitbucket.org/blais/beancount/issue/60/rendering-precision-for-reports-is |
| 4853 |
|
| 4854 |
|
| 4855 |
|
| 4856 |
|
| 4857 |
- Make the balance sheet and income statement reports support conversion to a |
| 4858 |
single currency |
| 4859 |
https://bitbucket.org/blais/beancount/issues/103/make-the-balance-sheet-and-income |
| 4860 |
https://groups.google.com/d/msg/beancount/5JE9vntz54o/Xrh4w74rEQAJ |
| 4861 |
|
| 4862 |
- Create a balance assertion that applies only to tagged or linked transactions. |
| 4863 |
https://bitbucket.org/blais/beancount/issues/102/create-a-balance-assertion-that-applies |
| 4864 |
|
| 4865 |
|
| 4866 |
- Integrate aumayr's beancount-docs into beancount/doc |
| 4867 |
https://bitbucket.org/blais/beancount/issues/101/integrate-aumayrs-beancount-docs-into |
| 4868 |
|
| 4869 |
- New issue 100: Provide an external registration mechanism to build new |
| 4870 |
reports, for fava |
| 4871 |
https://bitbucket.org/blais/beancount/issues/100/provide-an-external-registration-mechanism |
| 4872 |
|
| 4873 |
- New issue 74: Make the printer not output | separator anymore |
| 4874 |
https://bitbucket.org/blais/beancount/issues/74/make-the-printer-not-output-separator |
| 4875 |
|
| 4876 |
- New issue 99: multi-line syntax for tags and links |
| 4877 |
https://bitbucket.org/blais/beancount/issues/99/multi-line-syntax-for-tags-and-links |
| 4878 |
|
| 4879 |
- New issue 66: Change active years in bean-web to be calculated using the |
| 4880 |
correct year month boundary |
| 4881 |
https://bitbucket.org/blais/beancount/issues/66/change-active-years-in-bean-web-to-be |
| 4882 |
|
| 4883 |
- New issue 61: Implement pivot table tool & make sure it works to produce monthly |
| 4884 |
aggregations |
| 4885 |
https://bitbucket.org/blais/beancount/issue/61/implement-pivot-table-tool-make-sure-it |
| 4886 |
|
| 4887 |
|
| 4888 |
- Integrate Jon Stahl's doc contribution into the main doc about vesting; from here: |
| 4889 |
https://docs.google.com/document/d/1BnPgPGUEcCsWWadlDCvOUxVXVI1W26ysJPqL_aG-5JQ/edit |
| 4890 |
He added a section about options a long while ago. Review and complete this. |
| 4891 |
|
| 4892 |
- New issue 55: Make it easy to filter out transactions in the future |
| 4893 |
https://bitbucket.org/blais/beancount/issue/55/make-it-easy-to-filter-out-transactions-in |
| 4894 |
|
| 4895 |
- Provide some better built-in way to associate a particular document with a |
| 4896 |
transaction, see discussion here: |
| 4897 |
https://groups.google.com/d/msg/beancount/xGMbpfgb220/WPAjxkr8BQAJ |
| 4898 |
|
| 4899 |
- Add #tag to the Pad directive and propagate the tags to the generated |
| 4900 |
transactions |
| 4901 |
https://bitbucket.org/blais/beancount/issues/70/add-tag-to-the-pad-directive-and-propagate |
| 4902 |
|
| 4903 |
|
| 4904 |
|
| 4905 |
*** Emacs Support |
| 4906 |
|
| 4907 |
- Continue patching beancount.el from Stefan's submitted patches: |
| 4908 |
https://mail.google.com/mail/u/0/#inbox/14fdc82a04d90565 |
| 4909 |
|
| 4910 |
- Try it outline-minor-mode to see if I could make Beancount be a major mode |
| 4911 |
instead of a minor mode. |
| 4912 |
https://mail.google.com/mail/u/0/#inbox/149d363077404909 |
| 4913 |
|
| 4914 |
From Stefan: "Hmm... so basically as a glorified outline-minor-mode. |
| 4915 |
Could you try out outline-minor-mode and tell me what irks you most?" |
| 4916 |
|
| 4917 |
- Look into TAB problem: |
| 4918 |
https://mail.google.com/mail/u/0/#inbox/14fdc82a04d90565 |
| 4919 |
|
| 4920 |
"Ben, en fait j'attendais de r?soudre le probl?me du TAB, et pour ?a j'ai |
| 4921 |
besoin d'un "recipe" vu que ce que j'ai essay? fonctionne." |
| 4922 |
|
| 4923 |
- Make it possible to bean-doctor context on a specific link or tag |
| 4924 |
(thing-at-point). |
| 4925 |
|
| 4926 |
- Fix amounts alignment function, it always seems to pick up stuff from the |
| 4927 |
narration. Make it a fixed column! |
| 4928 |
|
| 4929 |
** Open Tickets - TODO |
| 4930 |
|
| 4931 |
- Issue #130: Padding involving the same account doesn't work incrementally (blais/beancount) |
| 4932 |
|
| 4933 |
- Issue #131: Aggregate the state of DisplayContext across all parsed files. |
| 4934 |
|
| 4935 |
- Issue #128: bean-report holdings market value incorrect if no price given |
| 4936 |
initially (blais/beancount) |
| 4937 |
|
| 4938 |
** TaxMin Reporting |
| 4939 |
|
| 4940 |
- Read about TaxMin loss harvesting and see if I couldn't implement a similar |
| 4941 |
thing in Beancount: |
| 4942 |
|
| 4943 |
"Thank you for taking the time to write in and follow up. At this time, there is |
| 4944 |
no way to view the full cost basis of all of your holdings at once at |
| 4945 |
Betterment. |
| 4946 |
|
| 4947 |
Betterment uses a unique algorithm to optimize the tax-efficiency when selling |
| 4948 |
shares. You can learn more about our cost basis method for sales here: |
| 4949 |
https://www.betterment.com/resources/investment-strategy/taxes/lowering-your-tax-bill-by-improving-our-cost-basis-accounting-methods/ |
| 4950 |
|
| 4951 |
The same data available on our PDF statements is available for download in CSV |
| 4952 |
format. At this time, there is no way to provide more digits of precision in |
| 4953 |
that PDF report. If you do transfer funds out of Betterment into another |
| 4954 |
brokerage service, your cost basis information will be provided in full to your |
| 4955 |
new financial institution upon completion of your transfer." |
| 4956 |
|
| 4957 |
-- |
| 4958 |
|
| 4959 |
"Thank you for writing in about tax loss harvesting. To avoid wash sales, |
| 4960 |
Betterment uses a proprietary Parallel Position Management system that utilizes |
| 4961 |
secondary securities as a safe harbor to minimize wash sales. Sales will also be |
| 4962 |
delayed if recent deposits are made until they are clear of the 30 day wash sale |
| 4963 |
window. |
| 4964 |
|
| 4965 |
You can find much more information in both our White Paper (see ?Parallel |
| 4966 |
Position Management?) and FAQ below: |
| 4967 |
|
| 4968 |
TLH White Paper: |
| 4969 |
https://www.betterment.com/resources/tax-loss-harvesting-white-paper/ |
| 4970 |
TLH FAQ: |
| 4971 |
http://support.betterment.com/customer/portal/topics/670337-tax-loss-harvesting |
| 4972 |
|
| 4973 |
In general, you?ll want to avoid investing in any passive ETFs or mutual funds |
| 4974 |
that track the same index as the funds in our portfolios. You can check the |
| 4975 |
indexes of our investments here. |
| 4976 |
|
| 4977 |
TLH+ will automatically manage your purchases when they are made inside your |
| 4978 |
Betterment taxable account, as well as your Betterment IRA. |
| 4979 |
|
| 4980 |
Target date funds, actively managed funds and individual stocks are generally |
| 4981 |
not problematic to use alongside our TLH+ algorithm. To read more about using |
| 4982 |
TLH+ with external accounts, please see our guide here. |
| 4983 |
|
| 4984 |
Thank you for the feedback regarding exporting data to CSV format, your friend |
| 4985 |
is correct. My apologies for the earlier miscommunication; I?ll certainly pass |
| 4986 |
your suggestion to our product team. |
| 4987 |
|
| 4988 |
Please let us know if you have any additional questions or if we can be of any |
| 4989 |
further assistance. Thank you for being a Betterment customer, have a wonderful |
| 4990 |
day." |
| 4991 |
|
| 4992 |
** Adding Types |
| 4993 |
|
| 4994 |
Comments from YYing re. adding types: |
| 4995 |
https://bitbucket.org/blais/beancount/issues/140/add-type-annotation-to-beancount-codebase |
| 4996 |
|
| 4997 |
- Some bad design choice is more obvious when adding type annotation. E.g. |
| 4998 |
https://github.com/yegle/beancount-type-stubs/blob/master/beancount/core/data.pyi#L67 |
| 4999 |
the tags field of Transcation type is an Optional[Set[str]]. I think it should |
| 5000 |
be a Set[str] since an empty set should be sufficient to express "there's no |
| 5001 |
tags for this transaction". I'm not sure if there's any difference in turns of |
| 5002 |
performance |
| 5003 |
|
| 5004 |
- mypy has very limited ability to infer function return types. E.g. functions |
| 5005 |
like is_balance_sheet_account in beancount/core/account_types.py, which |
| 5006 |
returns foo in bar, mypy is unable to infer that the return type is a bool. |
| 5007 |
I think pytype from Google have better type inference but it's written in |
| 5008 |
Python2 and I haven't figure out how to run it against python3 code. |
| 5009 |
|
| 5010 |
** V3-Specific |
| 5011 |
|
| 5012 |
- Build RE/flex with Boost or PCRE2 with JIT-optimized regexps; see how much of |
| 5013 |
a difference it makes; right now it's using the default, which is claimed to |
| 5014 |
be faster. |