[csv-transactions-export] fix category in export with simple layout

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.
This commit is contained in:
Christopher Lam 2023-04-07 20:41:11 +08:00
parent 229efb52ed
commit 5dc0b8271a

View File

@ -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