Incorrect default start date for General Ledger

The default for the general ledger is 30 days so use a time64 and
subtract from that instead of subtracting from tm.tm_mon.
This commit is contained in:
Robert Fewell 2024-06-17 14:41:12 +01:00
parent 8bd7deb3dc
commit 3a562e5dbb

View File

@ -445,7 +445,6 @@ gnc_ledger_display_gl (void)
{
Query* query;
time64 start;
struct tm tm;
GNCLedgerDisplay* ld;
GHashTable *exclude_template_accounts_hash;
@ -464,11 +463,12 @@ gnc_ledger_display_gl (void)
* See Gnome Bug 86302.
* -- jsled */
// Exclude any template accounts for search register and gl
exclude_template_accounts (query, exclude_template_accounts_hash);
exclude_template_accounts (query, exclude_template_accounts_hash);
// the default is to show last 30 days
static const time64 secs_per_thirty_days = 2592000;
start = gnc_time64_get_today_start () - secs_per_thirty_days;
gnc_tm_get_today_start (&tm);
tm.tm_mon--; /* Default the register to the last month's worth of transactions. */
start = gnc_mktime (&tm);
xaccQueryAddDateMatchTT (query,
TRUE, start,
FALSE, 0,