GnuCash
5.6-150-g038405b370+
|
Scheduled Transactions provide a framework for remembering information about a transactions that are set to occur in the future, either once or periodically.
More...
Files | |
file | FreqSpec.h |
Period / Date Frequency Specification. | |
file | SchedXaction.h |
Scheduled Transactions public handling routines. | |
file | SX-book.h |
Anchor Scheduled Transaction info in a book. | |
Data Structures | |
struct | SchedXaction |
A single scheduled transaction. More... | |
struct | SchedXactionClass |
struct | SXTmpStateData |
Just the variable temporal bits from the SX structure. More... | |
struct | SchedXactions |
struct | SchedXactionsClass |
Macros | |
#define | ENUM_LIST_TYPE(_) |
#define | ENUM_LIST_UI(_) |
#define | GNC_TYPE_SCHEDXACTION (gnc_schedxaction_get_type ()) |
#define | GNC_SCHEDXACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SCHEDXACTION, SchedXaction)) |
#define | GNC_SCHEDXACTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_SCHEDXACTION, SchedXactionClass)) |
#define | GNC_IS_SCHEDXACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SCHEDXACTION)) |
#define | GNC_IS_SCHEDXACTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_SCHEDXACTION)) |
#define | GNC_SCHEDXACTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SCHEDXACTION, SchedXactionClass)) |
#define | GNC_IS_SX(obj) GNC_IS_SCHEDXACTION(obj) |
#define | GNC_SX(obj) GNC_SCHEDXACTION(obj) |
#define | xaccSchedXactionSetGUID(X, G) qof_instance_set_guid(QOF_INSTANCE(X),(G)) |
#define | GNC_SX_SHARES "shares" |
#define | GNC_SX_FREQ_SPEC "scheduled-frequency" |
#define | GNC_SX_NAME "sched-xname" |
#define | GNC_SX_START_DATE "sched-start-date" |
#define | GNC_SX_LAST_DATE "sched-last-date" |
#define | GNC_SX_NUM_OCCUR "sx-total-number" |
#define | GNC_SX_REM_OCCUR "sx-remaining-num" |
#define | xaccSchedXactionIsDirty(X) qof_instance_is_dirty (QOF_INSTANCE(X)) |
#define | xaccSchedXactionGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X)) |
#define | GNC_TYPE_SCHEDXACTIONS (gnc_schedxactions_get_type ()) |
#define | GNC_SCHEDXACTIONS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SCHEDXACTIONS, SchedXactions)) |
#define | GNC_SCHEDXACTIONS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_SCHEDXACTIONS, SchedXactionsClass)) |
#define | GNC_IS_SCHEDXACTIONS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SCHEDXACTIONS)) |
#define | GNC_IS_SCHEDXACTIONS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_SCHEDXACTIONS)) |
#define | GNC_SCHEDXACTIONS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SCHEDXACTIONS, SchedXactionsClass)) |
#define | GNC_IS_SXES(obj) GNC_IS_SCHEDXACTIONS(obj) |
#define | GNC_SXES(obj) GNC_SCHEDXACTIONS(obj) |
Enumerations | |
enum | FreqType { INVALID, ONCE, DAILY, WEEKLY, MONTHLY, MONTH_RELATIVE, COMPOSITE } |
Frequency specification. More... | |
enum | UIFreqType { UIFREQ_NONE, UIFREQ_ONCE, UIFREQ_DAILY, UIFREQ_DAILY_MF, UIFREQ_WEEKLY, UIFREQ_BI_WEEKLY, UIFREQ_SEMI_MONTHLY, UIFREQ_MONTHLY, UIFREQ_QUARTERLY, UIFREQ_TRI_ANUALLY, UIFREQ_SEMI_YEARLY, UIFREQ_YEARLY, UIFREQ_NUM_UI_FREQSPECS } |
The user's conception of the frequency. More... | |
Functions | |
GType | gnc_schedxaction_get_type (void) |
SchedXaction * | xaccSchedXactionMalloc (QofBook *book) |
Creates and initializes a scheduled transaction. | |
void | sx_set_template_account (SchedXaction *sx, Account *account) |
void | xaccSchedXactionDestroy (SchedXaction *sx) |
Cleans up and frees a SchedXaction and its associated data. | |
void | gnc_sx_begin_edit (SchedXaction *sx) |
void | gnc_sx_commit_edit (SchedXaction *sx) |
GList * | gnc_sx_get_schedule (const SchedXaction *sx) |
void | gnc_sx_set_schedule (SchedXaction *sx, GList *schedule) |
gchar * | xaccSchedXactionGetName (const SchedXaction *sx) |
void | xaccSchedXactionSetName (SchedXaction *sx, const gchar *newName) |
A copy of the name is made. | |
const GDate * | xaccSchedXactionGetStartDate (const SchedXaction *sx) |
time64 | xaccSchedXactionGetStartDateTT (const SchedXaction *sx) |
void | xaccSchedXactionSetStartDate (SchedXaction *sx, const GDate *newStart) |
void | xaccSchedXactionSetStartDateTT (SchedXaction *sx, const time64 newStart) |
int | xaccSchedXactionHasEndDate (const SchedXaction *sx) |
const GDate * | xaccSchedXactionGetEndDate (const SchedXaction *sx) |
Returns invalid date when there is no end-date specified. | |
void | xaccSchedXactionSetEndDate (SchedXaction *sx, const GDate *newEnd) |
Set to an invalid GDate to turn off 'end-date' definition. | |
const GDate * | xaccSchedXactionGetLastOccurDate (const SchedXaction *sx) |
time64 | xaccSchedXactionGetLastOccurDateTT (const SchedXaction *sx) |
void | xaccSchedXactionSetLastOccurDate (SchedXaction *sx, const GDate *newLastOccur) |
void | xaccSchedXactionSetLastOccurDateTT (SchedXaction *sx, const time64 newLastOccur) |
gboolean | xaccSchedXactionHasOccurDef (const SchedXaction *sx) |
Returns true if the scheduled transaction has a defined number of occurrences, false if not. | |
gint | xaccSchedXactionGetNumOccur (const SchedXaction *sx) |
void | xaccSchedXactionSetNumOccur (SchedXaction *sx, gint numNum) |
Set to '0' to turn off number-of-occurrences definition. | |
gint | xaccSchedXactionGetRemOccur (const SchedXaction *sx) |
void | xaccSchedXactionSetRemOccur (SchedXaction *sx, gint numRemain) |
gint | gnc_sx_get_num_occur_daterange (const SchedXaction *sx, const GDate *start_date, const GDate *end_date) |
Calculates and returns the number of occurrences of the given SX in the given date range (inclusive). More... | |
gint | gnc_sx_get_instance_count (const SchedXaction *sx, SXTmpStateData *stateData) |
Get the instance count. More... | |
void | gnc_sx_set_instance_count (SchedXaction *sx, gint instanceNum) |
Sets the instance count to something other than the default. More... | |
GList * | xaccSchedXactionGetSplits (const SchedXaction *sx) |
void | xaccSchedXactionSetSplits (SchedXaction *sx, GList *newSplits) |
gboolean | xaccSchedXactionGetEnabled (const SchedXaction *sx) |
void | xaccSchedXactionSetEnabled (SchedXaction *sx, gboolean newEnabled) |
void | xaccSchedXactionGetAutoCreate (const SchedXaction *sx, gboolean *outAutoCreate, gboolean *outNotify) |
void | xaccSchedXactionSetAutoCreate (SchedXaction *sx, gboolean newAutoCreate, gboolean newNotify) |
gint | xaccSchedXactionGetAdvanceCreation (const SchedXaction *sx) |
void | xaccSchedXactionSetAdvanceCreation (SchedXaction *sx, gint createDays) |
gint | xaccSchedXactionGetAdvanceReminder (const SchedXaction *sx) |
void | xaccSchedXactionSetAdvanceReminder (SchedXaction *sx, gint reminderDays) |
GDate | xaccSchedXactionGetNextInstance (const SchedXaction *sx, SXTmpStateData *stateData) |
Returns the next occurrence of a scheduled transaction. More... | |
void | gnc_sx_add_defer_instance (SchedXaction *sx, void *deferStateData) |
Adds an instance to the deferred list of the SX. More... | |
void | gnc_sx_remove_defer_instance (SchedXaction *sx, void *deferStateData) |
Removes an instance from the deferred list. More... | |
GList * | gnc_sx_get_defer_instances (SchedXaction *sx) |
Returns the defer list from the SX. More... | |
gboolean | SXRegister (void) |
QOF registration. More... | |
GType | gnc_schedxactions_get_type (void) |
SchedXactions * | gnc_book_get_schedxactions (QofBook *book) |
void | gnc_sxes_add_sx (SchedXactions *sxes, SchedXaction *sx) |
void | gnc_sxes_del_sx (SchedXactions *sxes, SchedXaction *sx) |
Account * | gnc_book_get_template_root (const QofBook *book) |
Returns the template group from the book. More... | |
GList * | gnc_sx_get_sxes_referencing_account (QofBook *book, Account *acct) |
Temporal state data. | |
This is used by the "since-last-run" dialog to store the initial state of SXes before modification ... if it later becomes necessary to revert an entire set of changes, we can 'revert' the SX without having to rollback all the individual state changes. | |
SXTmpStateData * | gnc_sx_create_temporal_state (const SchedXaction *sx) |
Allocates a new SXTmpStateData object and fills it with the current state of the given sx. | |
void | gnc_sx_incr_temporal_state (const SchedXaction *sx, SXTmpStateData *stateData) |
Calculates the next occurrence of the given SX and stores that occurrence in the remporalStateDate. More... | |
void | gnc_sx_destroy_temporal_state (SXTmpStateData *stateData) |
Frees the given stateDate object. More... | |
SXTmpStateData * | gnc_sx_clone_temporal_state (SXTmpStateData *stateData) |
Allocates and returns a one-by-one copy of the given temporal state. More... | |
Scheduled Transactions provide a framework for remembering information about a transactions that are set to occur in the future, either once or periodically.
#define ENUM_LIST_TYPE | ( | _ | ) |
Definition at line 34 of file FreqSpec.h.
#define ENUM_LIST_UI | ( | _ | ) |
Definition at line 53 of file FreqSpec.h.
#define xaccSchedXactionGetGUID | ( | X | ) | qof_entity_get_guid(QOF_INSTANCE(X)) |
Definition at line 319 of file SchedXaction.h.
#define xaccSchedXactionIsDirty | ( | X | ) | qof_instance_is_dirty (QOF_INSTANCE(X)) |
Definition at line 317 of file SchedXaction.h.
enum FreqType |
Frequency specification.
For BI_WEEKLY, use weekly[2] SEMI_MONTHLY, use composite YEARLY, monthly[12]
Enumerator | |
---|---|
WEEKLY | Hmmm... This is sort of DAILY[7]... |
Definition at line 43 of file FreqSpec.h.
enum UIFreqType |
The user's conception of the frequency.
It is expected that this list will grow, while the former FreqType will not.
Definition at line 68 of file FreqSpec.h.
Account* gnc_book_get_template_root | ( | const QofBook * | book | ) |
Returns the template group from the book.
Definition at line 65 of file SX-book.cpp.
void gnc_sx_add_defer_instance | ( | SchedXaction * | sx, |
void * | deferStateData | ||
) |
Adds an instance to the deferred list of the SX.
Added instances are added in date-sorted order.
Added instances are added in (date-)sorted order.
Definition at line 1099 of file SchedXaction.cpp.
SXTmpStateData* gnc_sx_clone_temporal_state | ( | SXTmpStateData * | stateData | ) |
Allocates and returns a one-by-one copy of the given temporal state.
The caller must destroy the returned object with gnc_sx_destroy_temporal_state() after usage.
Definition at line 1063 of file SchedXaction.cpp.
void gnc_sx_destroy_temporal_state | ( | SXTmpStateData * | stateData | ) |
Frees the given stateDate object.
Definition at line 1057 of file SchedXaction.cpp.
GList* gnc_sx_get_defer_instances | ( | SchedXaction * | sx | ) |
Returns the defer list from the SX.
This is a date-sorted state-data instance list. The list should not be modified by the caller; use the gnc_sx_{add,remove}_defer_instance() functions to modify the list.
Returns the defer list from the SX.
The list should not be modified by the caller; use the gnc_sx_{add,remove}_defer_instance() functions to modify the list.
sx | Scheduled transaction |
Definition at line 1137 of file SchedXaction.cpp.
gint gnc_sx_get_instance_count | ( | const SchedXaction * | sx, |
SXTmpStateData * | stateData | ||
) |
Get the instance count.
This is incremented by one for every created instance of the SX. Returns the instance num of the SX unless stateData is non-null, in which case it returns the instance num from the state data.
sx | The instance whose state should be retrieved. |
stateData | may be NULL. |
Definition at line 929 of file SchedXaction.cpp.
gint gnc_sx_get_num_occur_daterange | ( | const SchedXaction * | sx, |
const GDate * | start_date, | ||
const GDate * | end_date | ||
) |
Calculates and returns the number of occurrences of the given SX in the given date range (inclusive).
Definition at line 739 of file SchedXaction.cpp.
GList* gnc_sx_get_schedule | ( | const SchedXaction * | sx | ) |
Definition at line 524 of file SchedXaction.cpp.
GList* gnc_sx_get_sxes_referencing_account | ( | QofBook * | book, |
Account * | acct | ||
) |
Definition at line 365 of file SX-book.cpp.
void gnc_sx_incr_temporal_state | ( | const SchedXaction * | sx, |
SXTmpStateData * | stateData | ||
) |
Calculates the next occurrence of the given SX and stores that occurrence in the remporalStateDate.
The SX is unchanged.
Definition at line 1045 of file SchedXaction.cpp.
void gnc_sx_remove_defer_instance | ( | SchedXaction * | sx, |
void * | deferStateData | ||
) |
Removes an instance from the deferred list.
If the instance is no longer useful; gnc_sx_destroy_temporal_state() it.
The saved SXTmpStateData existed for comparison only, so destroy it.
Definition at line 1111 of file SchedXaction.cpp.
void gnc_sx_set_instance_count | ( | SchedXaction * | sx, |
gint | instanceNum | ||
) |
Sets the instance count to something other than the default.
As the default is the incorrect value '0', callers should DTRT here.
Definition at line 948 of file SchedXaction.cpp.
void gnc_sx_set_schedule | ( | SchedXaction * | sx, |
GList * | schedule | ||
) |
[in] | schedule | A GList<Recurrence*> |
Definition at line 530 of file SchedXaction.cpp.
gboolean SXRegister | ( | void | ) |
QOF registration.
Definition at line 1191 of file SchedXaction.cpp.
GDate xaccSchedXactionGetNextInstance | ( | const SchedXaction * | sx, |
SXTmpStateData * | stateData | ||
) |
Returns the next occurrence of a scheduled transaction.
If the transaction hasn't occurred, then it's based off the start date. Otherwise, it's based off the last-occurrence date.
If state data is NULL, the current value of the SX is used for computation. Otherwise, the values in the state data are used. This allows the caller to correctly create a set of instances into the future for possible action without modifying the SX state until action is actually taken.
Definition at line 886 of file SchedXaction.cpp.