From 33187220891dd8826ff4d5a53b724b0058f6fef9 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 5 Mar 2010 22:12:32 -0500 Subject: Added new "payee" and "capture" directives The payee directive allows for transformation of payee names during the parsing of a Ledger file. This means you can record the payee name in one form, but always have it reported in another form. The syntax is (and will be): payee PAYEE_NAME REGEXP or payee PAYEE_NAME REGEXP1 REGEXP2 ... The account directive sets the account automatically based on the payee iff the base account name is Unknown. For example, if you have a bunch of transaction in Expenses:Unknown, you can assign accounts for several automatically using: account ACCOUNT_NAME PAYEE_REGEXP or account ACCOUNT_NAME PAYEE_REGEXP1 PAYEE_REGEXP2 ... --- src/journal.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/journal.h') diff --git a/src/journal.h b/src/journal.h index 2711c3b5..e54814aa 100644 --- a/src/journal.h +++ b/src/journal.h @@ -44,6 +44,7 @@ #include "utils.h" #include "times.h" +#include "mask.h" namespace ledger { @@ -58,6 +59,11 @@ typedef std::list xacts_list; typedef std::list auto_xacts_list; typedef std::list period_xacts_list; +typedef std::pair payee_mapping_t; +typedef std::list payee_mappings_t; +typedef std::pair account_mapping_t; +typedef std::list account_mappings_t; + class journal_t : public noncopyable { public: @@ -110,6 +116,8 @@ public: period_xacts_list period_xacts; std::list sources; bool was_loaded; + payee_mappings_t payee_mappings; + account_mappings_t account_mappings; journal_t(); journal_t(const path& pathname); -- cgit v1.2.3