mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-29 12:14:31 -06:00
Use "template-account" property to get/set template account.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18808 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
2eaa8345a9
commit
4054482bf8
@ -55,9 +55,6 @@
|
||||
|
||||
#define SX_MAX_NAME_LEN 2048
|
||||
|
||||
static /*@ null @*/ gpointer get_template_acct( gpointer pObject );
|
||||
static void set_template_acct( gpointer pObject, /*@ null @*/ gpointer pValue );
|
||||
|
||||
static const GncSqlColumnTableEntry col_table[] =
|
||||
{
|
||||
/*@ -full_init_block @*/
|
||||
@ -74,40 +71,11 @@ static const GncSqlColumnTableEntry col_table[] =
|
||||
{ "adv_creation", CT_INT, 0, COL_NNUL, "advance-creation-days" },
|
||||
{ "adv_notify", CT_INT, 0, COL_NNUL, "advance-reminder-days" },
|
||||
{ "instance_count", CT_INT, 0, COL_NNUL, "instance-count" },
|
||||
{ "template_act_guid", CT_ACCOUNTREF, 0, COL_NNUL, NULL, NULL,
|
||||
(QofAccessFunc)get_template_acct, set_template_acct },
|
||||
{ "template_act_guid", CT_ACCOUNTREF, 0, COL_NNUL, "template-account" },
|
||||
{ NULL }
|
||||
/*@ +full_init_block @*/
|
||||
};
|
||||
|
||||
/* ================================================================= */
|
||||
|
||||
static gpointer
|
||||
get_template_acct( gpointer pObject )
|
||||
{
|
||||
const SchedXaction* pSx;
|
||||
|
||||
g_return_val_if_fail( pObject != NULL, NULL );
|
||||
g_return_val_if_fail( GNC_IS_SX(pObject), NULL );
|
||||
|
||||
pSx = GNC_SX(pObject);
|
||||
return pSx->template_acct;
|
||||
}
|
||||
|
||||
static void
|
||||
set_template_acct( gpointer pObject, gpointer pValue )
|
||||
{
|
||||
SchedXaction* pSx;
|
||||
Account* pAcct;
|
||||
|
||||
g_return_if_fail( pObject != NULL && GNC_IS_SX(pObject) );
|
||||
g_return_if_fail( pValue != NULL && GNC_IS_ACCOUNT(pValue) );
|
||||
|
||||
pSx = GNC_SX(pObject);
|
||||
pAcct = GNC_ACCOUNT(pValue);
|
||||
sx_set_template_account( pSx, pAcct );
|
||||
}
|
||||
|
||||
/* ================================================================= */
|
||||
static /*@ null @*/ SchedXaction*
|
||||
load_single_sx( GncSqlBackend* be, GncSqlRow* row )
|
||||
|
Loading…
Reference in New Issue
Block a user