Skip to content

Commit

Permalink
[import-main-matcher.cpp] warning if recn_date < trans_date
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Mar 30, 2024
1 parent 364af37 commit 9bf0f5f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions gnucash/import-export/import-main-matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,20 @@ get_peer_acct_names (Split *split)
return retval;
}

static bool
acct_recndate_warning (time64 trans_date, const Account* acc)
{
time64 recn_date;
if (xaccAccountGetReconcileLastDate (acc, &recn_date))
return trans_date > recn_date;

return false;
}

const char* recn_date_warning = N_("The import date is earlier than reconcile date. \
Further reconciliation may be difficult");


static void
refresh_model_row (GNCImportMainMatcher *gui,
GtkTreeModel *model,
Expand Down Expand Up @@ -2028,6 +2042,12 @@ refresh_model_row (GNCImportMainMatcher *gui,
imbalance, acct_full_name);

}
if (acct_recndate_warning (date, dest_acc))
{
auto newtext = g_strdup_printf ("%s %s", text, _(recn_date_warning));
g_free (text);
text = newtext;
}

g_free (acct_full_name);
}
Expand Down

0 comments on commit 9bf0f5f

Please sign in to comment.