static time64
lookup_start_date_option(const gchar *section,
                         const gchar *key_choice,
                         const gchar *key_absolute,
                         const gchar *key_relative,
                         GDate *fy_end)
{
    gchar *choice;
    time64 time;
    int which;

    choice = gnc_gconf_get_string(section, key_choice, NULL);
    if (choice && strcmp(choice, "absolute") == 0)
    {
        time = gnc_gconf_get_int(section, key_absolute, NULL);
    }
    else
    {
        which = gnc_gconf_get_int(section, key_relative, NULL);
        time = gnc_accounting_period_start_time64(which, fy_end, NULL);
    }
    g_free(choice);
    /* we will need the balance of the last transaction before the start
       date, so subtract 1 from start date */
    /* CAS: we don't actually do what this comment says.  I think that's
       because a bug in the engine has been fixed. */
    return time;
}
Пример #2
0
static time64
lookup_start_date_option(GDate *fy_end)
{
    gchar *choice;
    time64 time;
    int which;


    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_CHOICE_ABS))
        time = gnc_prefs_get_int64 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE);
    else
    {
        which = gnc_prefs_get_int(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_PERIOD);
        time = gnc_accounting_period_start_time64(which, fy_end, NULL);
    }
    /* we will need the balance of the last transaction before the start
       date, so subtract 1 from start date */
    /* CAS: we don't actually do what this comment says.  I think that's
       because a bug in the engine has been fixed. */
    return time;
}