55 const GDate *contains);
58 const GDate *contains);
61 lookup_start_date_option(GDate *fy_end)
73 time = gnc_accounting_period_start_time64(which, fy_end, NULL);
83 lookup_end_date_option(GDate *fy_end)
93 time = gnc_accounting_period_end_time64(which, fy_end, NULL);
107 book = gnc_get_current_book();
115 gnc_accounting_period_fiscal_start(
void)
118 GDate *fy_end = get_fy_end();
119 t = lookup_start_date_option(fy_end);
126 gnc_accounting_period_fiscal_end(
void)
129 GDate *fy_end = get_fy_end();
131 t = lookup_end_date_option(fy_end);
140 const GDate *contains)
146 date = g_date_new_dmy(g_date_get_day(contains),
147 g_date_get_month(contains),
148 g_date_get_year(contains));
152 date = g_date_new ();
159 g_message(
"Undefined relative time constant %d", which);
163 case GNC_ACCOUNTING_PERIOD_TODAY:
167 case GNC_ACCOUNTING_PERIOD_MONTH:
171 case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
175 case GNC_ACCOUNTING_PERIOD_QUARTER:
179 case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
183 case GNC_ACCOUNTING_PERIOD_CYEAR:
187 case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
191 case GNC_ACCOUNTING_PERIOD_FYEAR:
194 g_message(
"Request for fisal year value but no fiscal year end value provided.");
201 case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
204 g_message(
"Request for fisal year value but no fiscal year end value provided.");
217 const GDate *contains)
234 const GDate *contains)
240 date = g_date_new_dmy(g_date_get_day(contains),
241 g_date_get_month(contains),
242 g_date_get_year(contains));
246 date = g_date_new ();
253 g_message(
"Undefined relative time constant %d", which);
257 case GNC_ACCOUNTING_PERIOD_TODAY:
261 case GNC_ACCOUNTING_PERIOD_MONTH:
265 case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
269 case GNC_ACCOUNTING_PERIOD_QUARTER:
273 case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
277 case GNC_ACCOUNTING_PERIOD_CYEAR:
281 case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
285 case GNC_ACCOUNTING_PERIOD_FYEAR:
288 g_message(
"Request for fisal year value but no fiscal year end value provided.");
295 case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
298 g_message(
"Request for fisal year value but no fiscal year end value provided.");
312 const GDate *contains)
void gnc_gdate_set_today(GDate *gd)
void gnc_gdate_set_prev_quarter_start(GDate *date)
void gnc_gdate_set_prev_fiscal_year_end(GDate *date, const GDate *fy_end)
void qof_instance_get(const QofInstance *inst, const gchar *first_param,...)
Wrapper for g_object_get.
Date and Time handling routines.
utility functions for the GnuCash UI
void gnc_gdate_set_month_end(GDate *date)
time64 gnc_time64_get_day_start_gdate(const GDate *date)
void gnc_gdate_set_prev_year_end(GDate *date)
time64 gnc_time64_get_day_end_gdate(const GDate *date)
gint64 gnc_prefs_get_int64(const gchar *group, const gchar *pref_name)
gint gnc_prefs_get_int(const gchar *group, const gchar *pref_name)
void gnc_gdate_set_prev_quarter_end(GDate *date)
void gnc_gdate_set_month_start(GDate *date)
void gnc_gdate_set_quarter_end(GDate *date)
General utilities for dealing with accounting periods.
void gnc_gdate_set_quarter_start(GDate *date)
void gnc_gdate_set_prev_year_start(GDate *date)
void gnc_gdate_set_fiscal_year_start(GDate *date, const GDate *fy_end)
void gnc_gdate_set_year_start(GDate *date)
Generic api to store and retrieve preferences.
GDate * gnc_accounting_period_end_gdate(GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
GDate * gnc_accounting_period_start_gdate(GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
struct KvpFrameImpl KvpFrame
void gnc_gdate_set_year_end(GDate *date)
void gnc_gdate_set_prev_month_end(GDate *date)
void gnc_gdate_set_prev_month_start(GDate *date)
void gnc_gdate_set_fiscal_year_end(GDate *date, const GDate *fy_end)
void gnc_gdate_set_prev_fiscal_year_start(GDate *date, const GDate *fy_end)