Skip to content

Commit

Permalink
[csv-transactions-export] fix category in export with simple layout
Browse files Browse the repository at this point in the history
If Trading accounts is enabled, and the transaction is a transfer
between two accounts of differing commodities, the CSV simple-layout
export would incorrectly show "--Split Transaction--" as the
category.

This commit changes the algorithm to ignore the trading splits when
determining the other split account, thereby returning a more useful
other account name.
  • Loading branch information
christopherlam committed Apr 7, 2023
1 parent 229efb5 commit 5dc0b82
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions gnucash/import-export/csv-exp/csv-transactions-export.cpp
Expand Up @@ -130,15 +130,8 @@ get_memo (Split *split)
static std::string
get_category (Split *split, bool full)
{
if (full)
{
auto cat{xaccSplitGetCorrAccountFullName (split)};
auto rv{std::string (cat)};
g_free (cat);
return rv;
}
else
return xaccSplitGetCorrAccountName (split);
auto other{xaccSplitGetOtherSplit(split)};
return other ? get_account_name (other, full) : _("-- Split Transaction --");
}

// Action
Expand Down

0 comments on commit 5dc0b82

Please sign in to comment.