summaryrefslogtreecommitdiff
path: root/src/account.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
|
* Create consistent buffer size.Daniel Coonce2021-02-021-1/+1
|
* Fix build for x86_64-w64-mingw32Daniel Coonce2021-02-021-2/+2
| | | | Fixes #1905
* fix: Fix #543 by tracking an account's real balanceDaraul2020-04-051-3/+17
| | | | | | | | | | | | | | 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.
* [misc] Update year in copyright notice to 2017Alexis Hildebrandt2018-01-271-1/+1
| | | | [ci skip]
* account to return the depth of its last displayed parentJakob Demler2017-11-021-0/+16
|
* Fix bug where .total used in value exprs breaks totalsJohn Lee2017-10-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | * Re-initialize (to VOID) totals for the account and its ancestors on adding postings. Otherwise the cache intended for use by recursive calls of C++ function total() in computing family (i.e. account hierarchy) totals is incorrectly retained from one top-level call to the next, causing inconsistent and broken behaviour. * Re-initialize (to false) calculated and gathered. Otherwise we won't e.g. recalculate stale totals for ancestor accounts (e.g. won't recalculate Assets:Savings total if Assets:Savings changes via a posting). Although the value expression total function is used by ledger itself in computing totals, this bug would only appear on use of .total in user-supplied value expressions computed *during parsing* of ledger files, rather than after parsing (I believe ledger only ever calls it for internal purposes after parsing is complete). It is possible this bug also affected other functions than total (perhaps even in circumstances other than analagous to that described in the preceding paragraph). I have not checked that.
* [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}/"
* Apply any outstanding deferred postings at the end of parsingJohn Wiegley2014-04-141-0/+15
|
* Add the concept of "deferred postings"John Wiegley2014-04-131-0/+15
| | | | | This is pretty much exclusively for allowing one to use balance assertions with replicated transactions across multiple files.
* Bump copyright information to 2014Alexis Hildebrandt2014-02-021-1/+1
|
* Fix #784John Wiegley2013-05-231-3/+1
|
* fix ledger xml output, remove ledger json commandJohann Klähn2013-03-081-12/+7
| | | | | | | | | | | | 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
|
* Resolve account.date to latest post in the accountJohn Wiegley2012-08-091-1/+3
|
* Converted the Ledger build system to use CMakeJohn Wiegley2012-05-201-2/+2
|
* Switched to Boost.PropertyTree for XML generationJohn Wiegley2012-05-181-0/+32
|
* Added "last_checkout_cleared" valexpr variableJohn Wiegley2012-05-071-1/+9
|
* Account valexprs: earliest_checkin, latest_checkoutJohn Wiegley2012-03-131-3/+42
| | | | | Lets you access the earliest/latest checkin/checkout times for timelog entries in an account. Will be NULL if the account doesn't contain any.
* Added some missing DEBUG #if'sJohn Wiegley2012-03-071-0/+2
|
* Corrected several compile and link problemsJohn Wiegley2012-03-061-2/+4
|
* Removed an invalid assertionJohn Wiegley2012-03-051-1/+4
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Add "note" valexpr function to accountsJohn Wiegley2012-02-271-0/+6
|
* Fixes for variable shadowing (2/28)John Wiegley2012-02-171-24/+24
|
* Fixes for variable shadowing (1/28)John Wiegley2012-02-171-6/+6
|
* Cleanup whitespaceJohn Wiegley2011-08-181-1/+1
|
* Individual postings may each have their own payeeJohn Wiegley2010-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a posting has the metadata field "Payee" set to a string, that will be used as the payee name for that posting. This affects the register report, the payees report, and the --by-payee option. This is useful because sometimes I send, say, 4 checks at a time to my bank. So on my bank statement, this is all just one amount: 2010-06-17 Sample Assets:Bank $400.00 Income:Check1 $-100.00 Income:Check2 $-100.00 Income:Check3 $-100.00 Income:Check4 $-100.00 Though it's important that the Assets:Bank posting be a single posting of $400 value, I'd like for income reports to show whom each check came from. Now I can say: 2010-06-17 Sample Assets:Bank $400.00 Income:Check1 $-100.00 ; Payee: Person One Income:Check2 $-100.00 ; Payee: Person Two Income:Check3 $-100.00 ; Payee: Person Three Income:Check4 $-100.00 ; Payee: Person Four When I report this, it appears as: 10-Jun-17 Sample Assets:Bank $400.00 $400.00 Person One Income:Check1 $-100.00 $300.00 Person Two Income:Check2 $-100.00 $200.00 Person Three Income:Check3 $-100.00 $100.00 Person Four Income:Check4 $-100.00 0 This shows that they are all in the same transaction (which is why the date is not repeated), but they have different payees.
* Report error context in expressions more preciselyJohn Wiegley2010-06-131-2/+2
|
* Completely reworked argument passing in expressionsJohn Wiegley2010-06-131-28/+22
|
* Expression evaluations now have a "type context"John Wiegley2010-06-131-1/+5
| | | | | | | | | Thus, an expression can know if the context in which it's being evaluated requires a string, and if so, determine it's output accordingly. For example: account ; returns the full name of the posting's account account.total ; here the context is SCOPE, so account is an obj
* Added a new scope_value() inline helper functionJohn Wiegley2010-06-131-5/+3
|
* account_t::add_post resets family_details.gatheredJohn Wiegley2010-06-131-0/+14
|
* account(NAME) function can lookup account objectsJohn Wiegley2010-06-131-3/+18
| | | | | | For example, just the word "account" returns the name of the current posting's account, but account("Expenses:Food") returns the actual account object, so that it's total may be accessed.
* Untabified all source filesJohn Wiegley2010-06-111-35/+35
|
* Made lookup of an account's "cost" a calc errorJohn Wiegley2010-06-061-0/+6
|
* Added new "addr" value expression functionJohn Wiegley2010-06-031-0/+6
| | | | | It returns the address of the given object as an integer. This can be used to uniquely compare entities.
* Fixed two memory reference errorsJohn Wiegley2010-06-021-8/+3
|
* Temporary accounts were referenced after deletionJohn Wiegley2010-05-221-1/+17
| | | | Fixes D53C98E5-506D-4CE5-91A3-7666FD33B65B
* Added any() and all() value expression macrosJohn Wiegley2010-05-081-0/+34
| | | | | | | | | | | | | | | | | | | | any() matches an expression against every post in a transaction or account, and returns true if any of them are true. all() tests if all are true. For example: ledger -l 'account =~ /Expense/ & any(account =~ /MasterCard/)' reg This reports every posting affecting an Expense account (regex match), but only if some other posting in the same transaction affects the MasterCard account. Both functions also take a second boolean argument. If it is false, the "source" posting is not considered. For example: ledger -l 'any(/x/, false)' This matches any posting where a *different* posting in the same transaction contains the letter 'x'.
* Updated copyrights to 2003-2010John Wiegley2010-03-051-1/+1
|
* Fixed assertion failure in -M -A bal reportJohn Wiegley2010-01-211-1/+1
|
* Added historical support for single-letter valexprsJohn Wiegley2009-11-141-1/+20
|
* Added has_xdata() methods for journal_t and xact_tJohn Wiegley2009-11-121-2/+11
|
* account.amount and .total return simplified valuesJohn Wiegley2009-11-101-2/+2
|
* Moved xdata clearing code into each type properJohn Wiegley2009-11-051-0/+9
|
* Segregated symbols into 5 separate namespacesJohn Wiegley2009-11-041-1/+5
| | | | | | | | | | | | | | | | | | | | | The different namespaces are: Function Value expression functions, which receive a "context" Option Command-line options Precommand Commands which are invoked before reading the journal Command Commands which are invoked after reading the journal Directive Directives that occur at column 0 in a data file This greatly eases the ability for Python uses to add intercept hooks to change how the basic Ledger module functions. An example of what should be possible soon: import ledger def my_foo_handler(value): print "--foo received:", value ledger.add_handler(ledger.Option, "foo=", my_foo_handler)