summaryrefslogtreecommitdiff
path: root/src/report.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-18 02:26:50 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-18 02:28:12 -0400
commit5da1e7756d2a4eb04753b8a97bc00063b4d3f687 (patch)
tree66798448f6a0cde13b434a28465c734d39a7a6cd /src/report.h
parent7e2547b1e4c5b6e940506ddff80e8871ada029ea (diff)
downloadfork-ledger-5da1e7756d2a4eb04753b8a97bc00063b4d3f687.tar.gz
fork-ledger-5da1e7756d2a4eb04753b8a97bc00063b4d3f687.tar.bz2
fork-ledger-5da1e7756d2a4eb04753b8a97bc00063b4d3f687.zip
Added new option --inject=KEY[,KEY...]
If you have a typed metadata key which contains an amount, you can use --inject=KEY to inject a posting with that amount wherever a match occurs. There are two main forms of usage: 2010-06-18 Sample ; Key:: $100 Expenses:Food $100.00 Assets:Checking The command would be: ledger reg --inject=Key In the above, transactional form, a posting under the account "Key" will be injected before the first posting reported for this transaction. It's amount will be $100. This only happens once for the whole transaction. It is also possible to associate the key with a posting: 2010-06-18 Sample Expenses:Food $100.00 ; Key:: $100 Assets:Checking Now the injected posting is generated whenever that particular post is reported.
Diffstat (limited to 'src/report.h')
-rw-r--r--src/report.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/report.h b/src/report.h
index a453d351..7d725b8c 100644
--- a/src/report.h
+++ b/src/report.h
@@ -260,6 +260,7 @@ public:
HANDLER(group_by_).report(out);
HANDLER(group_title_format_).report(out);
HANDLER(head_).report(out);
+ HANDLER(inject_).report(out);
HANDLER(invert).report(out);
HANDLER(limit_).report(out);
HANDLER(lot_dates).report(out);
@@ -616,6 +617,7 @@ public:
});
OPTION(report_t, head_);
+ OPTION(report_t, inject_);
OPTION_(report_t, invert, DO() {
parent->HANDLER(amount_).set_expr(string("--invert"), "-amount");