GnuCash  5.6-150-g038405b370+
Data Structures | Macros | Functions

Scheduled Transactions public handling routines. More...

#include <time.h>
#include <glib.h>
#include "qof.h"
#include "Recurrence.h"
#include "gnc-engine.h"

Go to the source code of this file.

Data Structures

struct  SchedXaction
 A single scheduled transaction. More...
 
struct  SchedXactionClass
 
struct  SXTmpStateData
 Just the variable temporal bits from the SX structure. More...
 

Macros

#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))
 

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...
 
Temporal state data.


These functions allow us to opaquely save the entire temporal state of ScheduledTransactions.

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.

SXTmpStateDatagnc_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...
 
SXTmpStateDatagnc_sx_clone_temporal_state (SXTmpStateData *stateData)
 Allocates and returns a one-by-one copy of the given temporal state. More...
 

Detailed Description

Scheduled Transactions public handling routines.

Author
Copyright (C) 2001 Joshua Sled jsled.nosp@m.@asy.nosp@m.nchro.nosp@m.nous.nosp@m..org

Definition in file SchedXaction.h.