Skip to content

Commit

Permalink
^ add debugging output
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Apr 3, 2023
1 parent 672288b commit afd1a0f
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions gnucash/import-export/csv-exp/csv-transactions-export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ static QofLogModule log_module = GNC_MOD_ASSISTANT;

/*******************************************************************/

static void print (const std::string_view& v)
{
printf ("%s, ", v.data());
}

static void print_line (StringVec& vec)
{
for (const auto& v : vec)
print (v);
printf ("\n");
}

/******************** Helper functions *********************/

static std::string
Expand Down Expand Up @@ -223,7 +235,7 @@ static StringVec
make_simple_trans_line (Transaction *trans, Split *split)
{
bool t_void = xaccTransGetVoidStatus (trans);
return {
StringVec rv = {
get_date (trans),
get_account_name (split, true),
get_number (trans),
Expand All @@ -236,13 +248,15 @@ make_simple_trans_line (Transaction *trans, Split *split)
get_value (split, t_void, false),
get_rate (split, t_void)
};
print_line (rv);
return rv;
}

static StringVec
make_complex_trans_line (Transaction *trans, Split *split)
{
bool t_void = xaccTransGetVoidStatus (trans);
return {
StringVec rv = {
get_date (trans),
get_guid (trans),
get_number (trans),
Expand All @@ -262,6 +276,8 @@ make_complex_trans_line (Transaction *trans, Split *split)
get_reconcile_date (split),
get_price (split, t_void)
};
print_line (rv);
return rv;
}

using TransSet = std::unordered_set<Transaction*>;
Expand Down

0 comments on commit afd1a0f

Please sign in to comment.