| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
[skip ci]
|
| |
|
| |
|
|
|
|
| |
Fixes #1905
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
[ci skip]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
[ci skip]
|
|
|
|
| |
[ci skip]
|
|
|
|
|
|
| |
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}/"
|
| |
|
|
|
|
|
| |
This is pretty much exclusively for allowing one to use balance
assertions with replicated transactions across multiple files.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
It returns the address of the given object as an integer. This can be
used to uniquely compare entities.
|
| |
|
|
|
|
| |
Fixes D53C98E5-506D-4CE5-91A3-7666FD33B65B
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|