summaryrefslogtreecommitdiff
path: root/src/post.cc
Commit message (Collapse)AuthorAgeFilesLines
* Restore expr context after calc, #2330 #2343Tavis Ormandy2024-07-081-2/+3
| | | | | | | Part of the expr_t::compile() process is to store the current scope, but In post_t::add_to_value that scope is temporary and on the stack. Restore the original context after that process is complete.
* When a post has no date at all, default to the current dateJohn Wiegley2023-02-061-2/+4
|
* Update copyright yearAlexis Hildebrandt2023-02-021-1/+1
| | | | [skip ci]
* Initial fix for #2147WY2023-01-201-1/+1
|
* xml: Include posting-specific payee in outputGwyneth Morgan2022-10-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `ledger xml` export, include the `<posting>`-specific payee (from the `Payee:` tag) as `<payee>`. This data is already included under `<metadata>` as `<value key="Payee">`, but that is more specific to Ledger's implementation; if in the future there is another way to set the payee (or perhaps an option to have the Payee tag in one's own language), that field wouldn't be a reliable method of getting this info. Example: 2022-01-01 Transaction-level payee a 10 b ; Payee: Posting-level payee Relevant XML output: <transaction> <date>2022-01-01</date> <payee>Transaction-level payee</payee> <postings> <posting> <account ref="0000558defd6f260"> <name>a</name> </account> <post-amount> <amount> <quantity>10</quantity> </amount> </post-amount> <total> <amount> <quantity>10</quantity> </amount> </total> </posting> <posting> <payee>Posting-level payee</payee> <account ref="0000558defd6f960"> <name>b</name> </account> <post-amount> <amount> <quantity>-10</quantity> </amount> </post-amount> <note> Payee: Posting-level payee</note> <metadata> <value key="Payee"> <string>Posting-level payee</string> </value> </metadata> <total> <amount> <quantity>0</quantity> </amount> </total> </posting> </postings> </transaction>
* 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-1/+1
| | | | Fixes #1905
* Fix issues related to payees declared on posting's metadataDiogo Trentini2021-02-021-2/+12
| | | | | Payees declared on posting's metadata are now validated with `--check-payees` option. Also, their aliases are now considered on reports as well.
* [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-28/+15
| | | | | | | | | | | | 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
|
* Switched to Boost.PropertyTree for XML generationJohn Wiegley2012-05-181-59/+34
|
* Switch to using Boost.FormatJohn Wiegley2012-05-141-3/+3
|
* Whitespace fixJohn Wiegley2012-04-041-16/+13
|
* Never output calculate commodity valuation expressionsJohn Wiegley2012-03-201-0/+1
|
* Access to checkin/checkout of timelog entriesJohn Wiegley2012-03-131-1/+12
|
* Added "price" value expression for postsJohn Wiegley2012-03-071-0/+11
|
* Added parsing support for the many value directivesJohn Wiegley2012-03-071-0/+38
|
* Guarded a call to add_or_set_valueJohn Wiegley2012-03-051-1/+2
|
* Increased file copyrights to 2012John Wiegley2012-02-291-1/+1
|
* Renamed actual/effective dates to primary/auxiliaryJohn Wiegley2012-02-281-12/+12
|
* The "id" of an item now maps to its UUIDJohn Wiegley2012-02-271-10/+0
|
* Fixed many Clang type conversion warnings with static_castJohn Wiegley2012-02-171-3/+3
|
* Fixes for variable shadowing (21/28)John Wiegley2012-02-171-2/+2
|
* Fixes for variable shadowing (20/28)John Wiegley2012-02-171-3/+3
|
* Do not evaluate strings as booleansJohn Wiegley2012-02-111-2/+2
|
* Cleanup whitespaceJohn Wiegley2011-08-181-2/+2
|
* Whitespace correctionsJohn Wiegley2011-02-101-5/+5
|
* has_tag and get_tag now take an 'inherit' parameterJohn Wiegley2010-06-181-8/+10
|
* Individual postings may each have their own payeeJohn Wiegley2010-06-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+8
|
* Completely reworked argument passing in expressionsJohn Wiegley2010-06-131-53/+45
|
* Expression evaluations now have a "type context"John Wiegley2010-06-131-28/+12
| | | | | | | | | 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-2/+2
|
* account(NAME) function can lookup account objectsJohn Wiegley2010-06-131-1/+16
| | | | | | 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.
* Improved value expression function 'commodity'John Wiegley2010-06-121-8/+15
| | | | | | Without arguments -- and in a posting -- it is equivalent to "commodity(amount)". Otherwise, it returns the commodity symbol of its argument.
* Store metadata values as value_t instead of stringJohn Wiegley2010-06-121-6/+6
|
* Untabified all source filesJohn Wiegley2010-06-111-68/+68
|
* Fixed interaction with -V/X and grouped postingsJohn Wiegley2010-06-091-0/+17
| | | | | | | | | | With -s, -M/Y/D, -n, and a few other flags, postings get "grouped" into meta-transactions that contain more postings than before. In all these cases, -V use the date of the *earliest* posting in that group, which makes little sense and caused breakages with -J. It now uses the latest date. Fixes #197 / 68EAF363-D0FE-4127-866E-A5AEBACB65D6
* Empty notes and tags now return null valuesJohn Wiegley2010-05-301-4/+8
|
* Created new valexpr variable display_accountJohn Wiegley2010-05-221-8/+24
| | | | | | | | | Where display_account might be '(Expenses:Food)', account will always be 'Expenses:Food'. account is now used by all matching and query operations, while display_account is used in the various report outputs (besides balance, which never distinguished virtual accounts). Fixes F2832452-4521-49A3-B854-F4E12CC4D82E
* Changed the report generated by the csv commandJohn Wiegley2010-05-221-2/+12
| | | | | | | | | | | Fields are now: Date,Code,Payee,Account,Commodity,Total,State,Note Instead of outputting amounts potentially as $1,000.00 (which was an error anyway), the output is now: $,1000.00. This makes the commodity available in a separate field, and removes display of thousands markers. Also, european formatting is always off.
* Added account_id and xact_id valexpr vars for postsJohn Wiegley2010-05-181-0/+36
| | | | | account_id is the "whicheth" number for that posting within its account. The xact_id is within its transaction.
* Added any() and all() value expression macrosJohn Wiegley2010-05-081-0/+48
| | | | | | | | | | | | | | | | | | | | 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'.
* Rewrite the "print" command as a custom functionJohn Wiegley2010-03-081-2/+2
| | | | | There ended up being too many corner cases for the generalized formatter to handle.