summaryrefslogtreecommitdiff
path: root/src/commodity.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearAlexis Hildebrandt2023-02-021-1/+1
| | | | [skip ci]
* Update copyright statement for 2022Alexis Hildebrandt2022-07-021-1/+1
|
* Remove some UTF-8 code that was having no effectkanreki2022-04-141-38/+5
| | | | Fixes #2061.
* Use correct int return type for stream input operationskanreki2021-12-081-15/+14
| | | | | | | | This makes it safe to compare results to -1 to indicate EOF, regardless of whether char is considered signed or unsigned; and so eliminates compiler warnings on platforms such as ARM. Fixes bug #2058.
* compare_by_commodity: Always return the result of the recursive callChristoph Dittmann2021-01-301-6/+11
| | | | | | | | | | | | | | | | | | | | | | | Commit 501fbc08ae5493db77bb34f4c4fbe1f3a3bc14e3 changed the behavior of this function to not return the "equal" result (==0) from the recursive call. Previously, the function returned the result of the recursive call unconditionally. The current behavior causes an assertion error for certain postings. The regression test added in this commit shows such a posting. I found through Travis CI that the old behavior was incomplete and caused unstable orderings, so reverting to the old behavior doesn't work. Instead, this change adds a fallback: If the recursive call that compares the prices numerically returns "equal", then compare the prices with their original commodity as a tie breaker. This commit does not change any existing ordering, it only adds deterministic ordering in a case that currently triggers an assertion error. This fixes issue #1998.
* Change compare_by_commodity to return an integerJohn Wiegley2019-03-151-76/+101
|
* Further improvements to commodity sortingJohn Wiegley2019-03-151-4/+6
|
* Add more debugging information to compare_by_commodityJohn Wiegley2019-03-151-13/+41
|
* Drop support for gcc 2 and earlierTim Landscheidt2019-01-251-2/+2
|
* [misc] Update year in copyright notice to 2017Alexis Hildebrandt2018-01-271-1/+1
| | | | [ci skip]
* [misc] Update year in copyright notice to 2017Alexis Hildebrandt2017-01-051-1/+1
| | | | [ci skip]
* [misc] Update year in copyright notice to 2016Alexis Hildebrandt2016-01-021-1/+1
| | | | [ci skip]
* 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}/"
* Bump copyright information to 2014Alexis Hildebrandt2014-02-021-1/+1
|
* fix ledger xml output, remove ledger json commandJohann Klähn2013-03-081-4/+2
| | | | | | | | | | | | As the format used by property trees to represent valid JSON and that for valid XML is too different and given that there are more requests for valid XML output I decided to pursue a quick fix and remove the json command in favor of a working xml command. See bug #782, #909, recent discussion on mailing list. JSON support is postponed until I or someone else finds time to work on this or the python bindings are more stable.
* Bump copyright information to 2013John Wiegley2013-02-181-1/+1
|
* Add --time-colon optionAlexis Hildebrandt2012-11-101-0/+1
| | | | | | | | | The --time-colon option will display the value for a seconds based commodity as real hours and minutes. For example 8100 seconds by default will be displayed as 2.25 whereas with the --time-colon option they will be displayed as 2:15.
* Converted the Ledger build system to use CMakeJohn Wiegley2012-05-201-1/+1
|
* Switched to Boost.PropertyTree for XML generationJohn Wiegley2012-05-181-19/+12
|
* Never price commodities using annotated commoditiesJohn Wiegley2012-03-301-9/+8
|
* Improved some error messagesJohn Wiegley2012-03-291-1/+1
|
* Fix problems with <Adjustment> postingsJohn Wiegley2012-03-201-0/+2
|
* Extend commodity_t::compare_by_commodity::operator()John Wiegley2012-03-191-0/+9
|
* Don't map_prices if price commodity matches sourceJohn Wiegley2012-03-151-2/+4
| | | | Fixes #680
* Tighten up argument passing related to fn_market()John Wiegley2012-03-111-40/+38
|
* Use Boost.TupleJohn Wiegley2012-03-091-7/+7
|
* Added nail_down() for pinning market value exprsJohn Wiegley2012-03-081-0/+9
|
* Corrected calculation of market valuation expressionsJohn Wiegley2012-03-081-6/+12
|
* Added "value" sub-directive for commodity directiveJohn Wiegley2012-03-061-0/+26
|
* Changed the category of a few DEBUG statementsJohn Wiegley2012-03-061-2/+4
|
* All tests are working again but oneJohn Wiegley2012-03-051-13/+41
|
* Implemented first cut at price conversion logicJohn Wiegley2012-03-051-1/+3
|
* Changes to get all the code to compileJohn Wiegley2012-03-051-22/+32
|
* Switched to using Boost.Graph for commodity pricingJohn Wiegley2012-03-051-403/+39
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Fixed many Clang type conversion warnings with static_castJohn Wiegley2012-02-171-2/+2
|
* Fixes for variable shadowing (6/28)John Wiegley2012-02-171-1/+1
|
* Cleanup whitespaceJohn Wiegley2011-08-181-2/+2
|
* Fixes for compilation as C++0x codeJohn Wiegley2011-02-041-1/+0
|
* Based symbol_needs_quotes an invalid_chars (#386)John Wiegley2010-07-291-32/+32
|
* Don't elide quotes for all-digit commoditiesJohn Wiegley2010-06-141-3/+7
|
* Untabified all source filesJohn Wiegley2010-06-111-161/+161
|
* New display flag AMOUNT_PRINT_ELIDE_COMMODITY_QUOTESJohn Wiegley2010-06-091-0/+11
| | | | | | | | This is used by reports like register and balance so that separated commodities without spaces in them needed be surrounded by quotes. It will still occur in most other places. Fixes #200 / F82CF11F-BFD9-4512-A562-202B04B68051
* A further simplification of -V and -XJohn Wiegley2010-06-071-6/+1
| | | | | | | | With -X COMM, all values are computed in terms of COMM, regardless. With -V, only secondary commodities will ever be computed, never primaries. Further, if a secondary commodities has an associated price, the valuation is done in terms of that price's commodity.
* Corrected a verification testJohn Wiegley2010-06-051-1/+3
|
* commodity_t::find_price now uses memoizationJohn Wiegley2010-06-041-11/+100
| | | | | This reduces the slowdown of using -V and -X from 36x in some cases down to around 4-5x (for a debug build).
* any and all do not need to be reserved tokensJohn Wiegley2010-06-041-3/+1
|
* More debug code cleanupJohn Wiegley2010-06-041-25/+25
|
* Made the behavior of -V a bit more rationalJohn Wiegley2010-06-041-0/+4
| | | | It now only values non-primary commodities in terms of primary ones.
* Reorganized some debug codeJohn Wiegley2010-06-041-17/+20
|