Make --anon work with the print command
Fixes #226 / C1C1E731-D991-40ED-BE43-8ED55585386C
This commit is contained in:
parent
653d2bd99a
commit
63c7ba0322
3 changed files with 8 additions and 5 deletions
|
|
@ -256,6 +256,7 @@ void anonymize_posts::operator()(post_t& post)
|
||||||
create_temp_account_from_path(account_names, temps, xact.journal->master);
|
create_temp_account_from_path(account_names, temps, xact.journal->master);
|
||||||
post_t& temp = temps.copy_post(post, xact, new_account);
|
post_t& temp = temps.copy_post(post, xact, new_account);
|
||||||
temp.note = none;
|
temp.note = none;
|
||||||
|
temp.add_flags(POST_ANONYMIZED);
|
||||||
|
|
||||||
(*handler)(temp);
|
(*handler)(temp);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
src/post.h
11
src/post.h
|
|
@ -52,11 +52,12 @@ class account_t;
|
||||||
class post_t : public item_t
|
class post_t : public item_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#define POST_VIRTUAL 0x08 // the account was specified with (parens)
|
#define POST_VIRTUAL 0x04 // the account was specified with (parens)
|
||||||
#define POST_MUST_BALANCE 0x10 // posting must balance in the transaction
|
#define POST_MUST_BALANCE 0x08 // posting must balance in the transaction
|
||||||
#define POST_CALCULATED 0x20 // posting's amount was calculated
|
#define POST_CALCULATED 0x10 // posting's amount was calculated
|
||||||
#define POST_COST_CALCULATED 0x40 // posting's cost was calculated
|
#define POST_COST_CALCULATED 0x20 // posting's cost was calculated
|
||||||
#define POST_COST_IN_FULL 0x80 // cost specified using @@
|
#define POST_COST_IN_FULL 0x40 // cost specified using @@
|
||||||
|
#define POST_ANONYMIZED 0x80 // a temporary, anonymous posting
|
||||||
|
|
||||||
xact_t * xact; // only set for posts of regular xacts
|
xact_t * xact; // only set for posts of regular xacts
|
||||||
account_t * account;
|
account_t * account;
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ namespace {
|
||||||
|
|
||||||
foreach (post_t * post, xact.posts) {
|
foreach (post_t * post, xact.posts) {
|
||||||
if (post->has_flags(ITEM_TEMP | ITEM_GENERATED) &&
|
if (post->has_flags(ITEM_TEMP | ITEM_GENERATED) &&
|
||||||
|
! post->has_flags(POST_ANONYMIZED) &&
|
||||||
! report.HANDLED(print_virtual))
|
! report.HANDLED(print_virtual))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue