summaryrefslogtreecommitdiff
path: root/src/post.h
diff options
context:
space:
mode:
authorDiogo Trentini <diogotrentini@gmail.com>2020-09-16 22:38:01 -0300
committerMartin Michlmayr <tbm@cyrius.com>2021-02-02 17:45:10 +0800
commit5560b0c40f3986704df25095fcc485bcc1de9e5b (patch)
treef61df53eea9a57da82717409c89b1309f09ecd32 /src/post.h
parentebd2d8dd0865ef41d1931c5304cb42ee1b312cb7 (diff)
downloadfork-ledger-5560b0c40f3986704df25095fcc485bcc1de9e5b.tar.gz
fork-ledger-5560b0c40f3986704df25095fcc485bcc1de9e5b.tar.bz2
fork-ledger-5560b0c40f3986704df25095fcc485bcc1de9e5b.zip
Fix issues related to payees declared on posting's metadata
Payees declared on posting's metadata are now validated with `--check-payees` option. Also, their aliases are now considered on reports as well.
Diffstat (limited to 'src/post.h')
-rw-r--r--src/post.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/post.h b/src/post.h
index aaf7ec64..a724f903 100644
--- a/src/post.h
+++ b/src/post.h
@@ -73,6 +73,12 @@ public:
optional<datetime_t> checkin;
optional<datetime_t> checkout;
+private:
+
+ optional<string> _payee;
+
+public:
+
post_t(account_t * _account = NULL,
flags_t _flags = ITEM_NORMAL)
: item_t(_flags), xact(NULL), account(_account)
@@ -132,7 +138,11 @@ public:
virtual date_t primary_date() const;
virtual optional<date_t> aux_date() const;
+ string payee_from_tag() const;
string payee() const;
+ void set_payee(const string& payee) {
+ _payee = payee;
+ }
bool must_balance() const {
return ! has_flags(POST_VIRTUAL) || has_flags(POST_MUST_BALANCE);