summaryrefslogtreecommitdiff
path: root/src/textual.cc
Commit message (Collapse)AuthorAgeFilesLines
* also follow precision from balance assignmentHEADmasterKuang-che Wu2024-10-111-1/+1
| | | | Fixes #2129
* Avoid ctype abuse.Taylor R Campbell2024-08-061-14/+22
| | | | | fix https://github.com/ledger/ledger/issues/2338 fix https://github.com/ledger/ledger/issues/2340
* Add support for --hashes=sha512_256 as another algorithmJohn Wiegley2024-08-051-8/+10
|
* Make xact hashes independent of posting orderJohn Wiegley2024-08-051-2/+4
| | | | | Also, support matching provided hashes against a prefixed of the generated hash.
* Add support for hash chaining to detect modifications in postingsJohn Wiegley2024-08-051-17/+48
| | | | | | | | | | | | | | | | | | | The following details of a posting contribute to its hash: fullname of account string representation of amount Each posting hashes contributes to the transaction hash, which is compromised of: previous transaction’s hash (as encountered in parsing order) actual date optional auxiliary date optional code payee hashes of all postings Note that this means that changes in the “code” or any of the comments
* Use #cmakedefine01 for system capability checksAlexis Hildebrandt2023-04-151-6/+6
| | | | and reply #ifdev HAVE_ with #if HAVE_
* Refactor python related types into ledger::python namespaceAlexis Hildebrandt2023-04-121-1/+1
|
* Do not perform commodity reduction when parsing a format directiveJohn Wiegley2023-03-031-3/+5
|
* Update copyright yearAlexis Hildebrandt2023-02-021-1/+1
| | | | [skip ci]
* Update copyright statement for 2022Alexis Hildebrandt2022-07-021-1/+1
|
* When calculating balance assignments, strip away lot annotationsJohn Wiegley2022-05-031-12/+15
|
* Ensure absolute path for includeKunht Kun2022-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure the path of file to include in `instance_t::include_directive` is always an absolute path. Previously when the journal file is given through stdin, we prepend a "./" to the filename to include. However, in Boost >= 1.77, `path::normalize` strips the leading "./" [1]. Our `resolve_path` function calls `normalize` and thus now it returns "file" for "./file" instead of the previous "./file". This change causes a failing test regress/BF3C1F82-2 [2], and also breaks the `include` directive for stdin input: $ touch file-to-include $ echo "include file-to-include" | ledger -f - reg gives While parsing file "", line 1: Error: File to include was not found: "file-to-include" Therefore, we change to prepend the `context.current_directory` to make the filename absolute in this case as well. The test regress/BF3C1F82-2 is also updated to match the new output. Fixes #2075. [1] https://github.com/boostorg/filesystem/commit/16bd89b7c0398d0dc5904148a865ef3fc3ece7ec [2] https://github.com/ledger/ledger/issues/2075
* check that commodity format uses correct symbolChristopher Zimmermann2022-02-031-1/+4
| | | | closes 1948
* Fix silent errors when reading lines from input files.Austin Wise2021-08-241-2/+12
| | | | | | | | Handle files that don't end with a new line. Throw an error when the buffer size is exceeded. Fixes #516 Contributes to #1149
* Fix issues related to payees declared on posting's metadataDiogo Trentini2021-02-021-2/+6
| | | | | Payees declared on posting's metadata are now validated with `--check-payees` option. Also, their aliases are now considered on reports as well.
* Do not treat balance assignments with 0 diff as a null postingDaraul Harris2020-12-051-1/+5
| | | | | | | | | | | Ledger is treating balance assignments that have a 0 diff as having a null posting, leading to the posting being auto-balanced and therefore causing incorrect values to be returned for the transaction. I fixed this by just making the posting equal to amt - amt (0 in the right commodity). Fixes #1942
* Fix whitespace/tabsEmin Martinian2020-08-131-6/+6
|
* Make it so that the include directive sorts when using wildcards.Emin Martinian2020-08-131-4/+12
| | | | | | | | Before this commit, doing something like 'include data/*.dat' would produce undesired behaviour because the matches for 'data/*.dat' would not be sorted correctly. See https://github.com/ledger/ledger/issues/1659 for details.
* Fix typos in commentsMartin Michlmayr2020-05-211-1/+1
|
* Improve conditional for exclusive optionsMartin Michlmayr2020-05-071-1/+1
|
* Ensure that apply directives have an argumentMartin Michlmayr2020-04-271-0/+2
| | | | | | | | The directive `apply account` and similar directives (fixed, year...) require an argument. Ensure that an argument is given. Fixes #553 Fixes #1854
* fix: Fix #543 by tracking an account's real balanceDaraul2020-04-051-2/+2
| | | | | | | | | | | | | | Without these changes, whether an account's balance is virtual or real is not considered when asserting it's balance. This lead to situations where the user must consider their virtual postings when attemping to assert the real balance of the account. See test/regress/543_a.test for that testcase, taken from the original issue. This commit also includes other, fringe, situations that I noticed while working on the fix. It essentially just adds a separate attribute to the account class(?) that hold's the account's "real" balance, which is only updated when the user attempts an assertion on a real account. The virtual account's balance is updated the way it always was.
* Switch from using utf8::is_bom to utf8::starts_with_bomJohn Wiegley2019-08-181-1/+3
| | | | Fixes #1816
* Reject postings with comment after flagMichael Budde2019-03-301-1/+1
| | | | Fixes #1753
* Merge pull request #1736 from scfc/drop-conditionals-for-boost-earlier-than-1-49John Wiegley2019-01-251-21/+0
|\ | | | | | | | | Drop conditionals for Boost earlier than 1.49
| * Drop conditionals for Boost earlier than 1.49Tim Landscheidt2019-01-171-22/+1
| | | | | | | | | | | | | | Ledger requires Boost 1.49 or later and enforces this in CMakeLists.txt. This means BOOST_VERSION will always be 104900 or higher. Also, since Boost 1.46, BOOST_FILESYSTEM_VERSION is 3.
* | Drop support for gcc 2 and earlierTim Landscheidt2019-01-251-5/+5
|/
* Merge remote-tracking branch 'origin/master' into nextJohn Wiegley2018-07-191-1/+6
|\
| * Ensure that parse errors produce useful RuntimeErrors for Python code.Manuel Amador (Rudd-O)2016-02-061-1/+6
| |
* | fix regression of test 1147_aPascal Fleury2018-07-171-17/+18
| |
* | amount_t -> balance_t.Pascal Fleury2018-07-171-13/+30
| |
* | [misc] Update year in copyright notice to 2017Alexis Hildebrandt2018-01-271-1/+1
| | | | | | | | [ci skip]
* | The "format" directive for commodities now disables "style observation"John Wiegley2018-01-011-0/+1
| |
* | Merge pull request #484 from mk12/bug-1182-ptrJohn Wiegley2017-10-261-0/+3
|\ \ | | | | | | Fix Bug 1182: Error message for parse failure after '='
| * | Print error message if parsing predicate after '='Mitchell Kember2016-12-201-0/+3
| | |
* | | [misc] Update year in copyright notice to 2017Alexis Hildebrandt2017-01-051-1/+1
|/ / | | | | | | [ci skip]
* | Fix bug 1187: Allow balance assertions with multiple posts to same accountMitchell Kember2016-10-071-1/+12
| |
* | Use boost parent_path() method instead of manual computationEvan Mallory2016-10-021-8/+5
| | | | | | | | This fixes error-in-include.test, dir-apply.test, 6188B0EC.test, and 89233B6D.test when running under msys2 on Windows. The manual computation is incorrect when there are both forward slash and backward slash characters in the path.
* | Fix Bug 1147: Check balance assertions against the amount AFTERMitchell Kember2016-03-221-10/+12
|/
* [misc] Update year in copyright notice to 2016Alexis Hildebrandt2016-01-021-1/+1
| | | | [ci skip]
* Bugfix 1038: empty reg report for this month periodAlexis Hildebrandt2014-12-291-0/+5
| | | | | when year was specified with literal Y or year directive, but not when using apply year.
* Improve error handling when parsing year directivesAlexis Hildebrandt2014-12-281-9/+14
| | | | | | | A literal Y directive or ‘year’ directive with an empty or invalid argument, e.g. ‘2o14’ (that is a small letter ‘oh’ instead of a zero) would fail with the following rather unhelpful error message: Error: bad lexical cast: source type value could not be interpreted as target
* Fix plain year directiveAlexis Hildebrandt2014-12-281-0/+7
| | | | Only Y2014 or apply year 2014 would actually set the year for the following transactions; year 2014 would silently do nothing.
* Bump copyright notice to 2015Alexis Hildebrandt2014-12-271-1/+1
| | | | | | The following script makes it a no-brainer: % NEXT_YEAR=2015; ag -l 'Copyright.*Wiegley' \ | xargs sed -i '' -e "s/\(Copyright.*\)-20[0-9]\{2\}/\1-${NEXT_YEAR}/"
* Correct no-python error messagesAlexis Hildebrandt2014-12-251-2/+2
| | | | [ci skip]
* Fix off by one error in textual.ccAdrian Lang2014-12-111-1/+1
| | | This fixes parsing of transactions with single-character payees and comments.
* Preserve the given cost for printMartin Michlmayr2014-07-141-0/+2
| | | | Patch from John Wiegley
* When a status flag (! or *) is explicitly specified for an individual ↵Max Satula2014-06-301-2/+1
| | | | posting, it always has a priority over entire transaction status.
* Don't lose commodity when cost is not separated by whitespaceMartin Michlmayr2014-06-051-3/+2
| | | | | | | | When a cost was specified without a whitespace after the @ symbol, as in @$5.01, this was incorrectly parsed as 5.01 (losing the commodity) rather than $5.01. Bug fix for #1050
* Fix bug introduced by commit AA2FF2Bthdox2014-05-171-4/+3
| | | | Correction is to not use uninitialized amount