50 #include "gnc-session.h" 55 const GDate *contains);
58 const GDate *contains);
61 lookup_start_date_option (GDate *fy_end)
68 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE));
72 time = gnc_accounting_period_start_time64 (which, fy_end, NULL);
82 lookup_end_date_option (GDate *fy_end)
89 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_DATE));
93 time = gnc_accounting_period_end_time64 (which, fy_end, NULL);
112 gnc_accounting_period_fiscal_start (
void)
115 GDate *fy_end = get_fy_end();
116 t = lookup_start_date_option (fy_end);
118 g_date_free (fy_end);
123 gnc_accounting_period_fiscal_end (
void)
126 GDate *fy_end = get_fy_end();
128 t = lookup_end_date_option (fy_end);
130 g_date_free (fy_end);
137 const GDate *contains)
143 date = g_date_new_dmy (g_date_get_day (contains),
144 g_date_get_month (contains),
145 g_date_get_year (contains));
149 date = g_date_new ();
156 PINFO (
"Undefined relative time constant %d", which);
160 case GNC_ACCOUNTING_PERIOD_TODAY:
164 case GNC_ACCOUNTING_PERIOD_MONTH:
168 case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
172 case GNC_ACCOUNTING_PERIOD_QUARTER:
176 case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
180 case GNC_ACCOUNTING_PERIOD_CYEAR:
184 case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
188 case GNC_ACCOUNTING_PERIOD_FYEAR:
191 PINFO (
"Request for fisal year value but no fiscal year end value provided.");
198 case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
201 PINFO (
"Request for fisal year value but no fiscal year end value provided.");
214 const GDate *contains)
231 const GDate *contains)
237 date = g_date_new_dmy (g_date_get_day (contains),
238 g_date_get_month (contains),
239 g_date_get_year (contains));
243 date = g_date_new ();
250 PINFO (
"Undefined relative time constant %d", which);
254 case GNC_ACCOUNTING_PERIOD_TODAY:
258 case GNC_ACCOUNTING_PERIOD_MONTH:
262 case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
266 case GNC_ACCOUNTING_PERIOD_QUARTER:
270 case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
274 case GNC_ACCOUNTING_PERIOD_CYEAR:
278 case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
282 case GNC_ACCOUNTING_PERIOD_FYEAR:
285 PINFO (
"Request for fisal year value but no fiscal year end value provided.");
292 case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
295 PINFO (
"Request for fisal year value but no fiscal year end value provided.");
309 const GDate *contains)
void qof_instance_get(const QofInstance *inst, const gchar *first_prop,...)
Wrapper for g_object_get.
Date and Time handling routines.
void gnc_gdate_set_fiscal_year_end(GDate *date, const GDate *year_end)
This function modifies a GDate to set it to the last day of the fiscal year in which it falls...
#define G_LOG_DOMAIN
Functions providing the SX List as a plugin page.
#define PINFO(format, args...)
Print an informational note.
void gnc_gdate_set_quarter_start(GDate *date)
This function modifies a GDate to set it to the first day of the quarter in which it falls...
void gnc_gdate_set_today(GDate *gd)
Set a GDate to the current day.
void gnc_gdate_set_prev_month_end(GDate *date)
This function modifies a GDate to set it to the last day of the month prior to the one in which it fa...
gint64 gnc_prefs_get_int64(const gchar *group, const gchar *pref_name)
Get an 64 bit integer value from the preferences backend.
gint gnc_prefs_get_int(const gchar *group, const gchar *pref_name)
Get an integer value from the preferences backend.
QofBook * qof_session_get_book(const QofSession *session)
Returns the QofBook of this session.
void gnc_gdate_set_prev_year_end(GDate *date)
This function modifies a GDate to set it to the last day of the year prior to the one in which it fal...
void gnc_gdate_set_prev_year_start(GDate *date)
This function modifies a GDate to set it to the first day of the year prior to the one in which it fa...
General utilities for dealing with accounting periods.
time64 gnc_time64_get_day_start(time64 time_val)
The gnc_time64_get_day_start() routine will take the given time in seconds and adjust it to the first...
GncAccountingPeriod
This specifies a time interval.
void gnc_gdate_set_month_start(GDate *date)
This function modifies a GDate to set it to the first day of the month in which it falls...
void gnc_gdate_set_prev_fiscal_year_end(GDate *date, const GDate *year_end)
This function modifies a GDate to set it to the last day of the fiscal year prior to the one in which...
Generic api to store and retrieve preferences.
void gnc_gdate_set_fiscal_year_start(GDate *date, const GDate *year_end)
This function modifies a GDate to set it to the first day of the fiscal year in which it falls...
GDate * gnc_accounting_period_end_gdate(GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
This function returns the ending date for an accounting period.
GDate * gnc_accounting_period_start_gdate(GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
This function returns the starting date for an accounting period.
void gnc_gdate_set_year_end(GDate *date)
This function modifies a GDate to set it to the last day of the year in which it falls.
void gnc_gdate_set_month_end(GDate *date)
This function modifies a GDate to set it to the last day of the month in which it falls...
time64 gnc_time64_get_day_end_gdate(const GDate *date)
The gnc_time64_get_day_end() routine will take the given time in GLib GDate format and adjust it to t...
void gnc_gdate_set_prev_fiscal_year_start(GDate *date, const GDate *year_end)
This function modifies a GDate to set it to the first day of the fiscal year prior to the one in whic...
void gnc_gdate_set_quarter_end(GDate *date)
This function modifies a GDate to set it to the last day of the quarter in which it falls...
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
Get a boolean value from the preferences backend.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
void gnc_gdate_set_prev_quarter_end(GDate *date)
This function modifies a GDate to set it to the last day of the quarter prior to the one in which it ...
time64 gnc_time64_get_day_end(time64 time_val)
The gnc_time64_get_day_end() routine will take the given time in seconds and adjust it to the last se...
time64 gnc_time64_get_day_start_gdate(const GDate *date)
The gnc_time64_get_day_start() routine will take the given time in GLib GDate format and adjust it to...
void gnc_gdate_set_prev_quarter_start(GDate *date)
This function modifies a GDate to set it to the first day of the quarter prior to the one in which it...
void gnc_gdate_set_year_start(GDate *date)
This function modifies a GDate to set it to the first day of the year in which it falls...
void gnc_gdate_set_prev_month_start(GDate *date)
This function modifies a GDate to set it to the first day of the month prior to the one in which it f...