2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
/********************************************************************
|
|
|
|
* gnc-schedxactions-xml-v2.c -- xml routines for transactions *
|
2007-02-18 11:39:54 -06:00
|
|
|
* Copyright (C) 2001,2007 Joshua Sled <jsled@asynchronous.org> *
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 2 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License*
|
|
|
|
* along with this program; if not, contact: *
|
|
|
|
* *
|
|
|
|
* Free Software Foundation Voice: +1-617-542-5942 *
|
2005-11-16 23:35:02 -06:00
|
|
|
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
|
|
|
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
* *
|
|
|
|
*******************************************************************/
|
2015-11-29 19:11:29 -06:00
|
|
|
extern "C"
|
|
|
|
{
|
2017-10-26 04:14:21 -05:00
|
|
|
#include <config.h>
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2003-06-10 12:32:10 -05:00
|
|
|
#include "SX-book.h"
|
2015-11-29 19:11:29 -06:00
|
|
|
}
|
2001-11-24 06:10:42 -06:00
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
#include "gnc-xml-helper.h"
|
|
|
|
#include "sixtp.h"
|
|
|
|
#include "sixtp-utils.h"
|
|
|
|
#include "sixtp-parsers.h"
|
|
|
|
#include "sixtp-utils.h"
|
|
|
|
#include "sixtp-dom-parsers.h"
|
|
|
|
#include "sixtp-dom-generators.h"
|
|
|
|
|
|
|
|
#include "gnc-xml.h"
|
|
|
|
|
|
|
|
#include "io-gncxml-v2.h"
|
|
|
|
#include "io-gncxml-gen.h"
|
|
|
|
|
|
|
|
#include "sixtp-dom-parsers.h"
|
|
|
|
|
2007-02-18 11:39:54 -06:00
|
|
|
#undef G_LOG_DOMAIN
|
2007-03-07 17:46:16 -06:00
|
|
|
#define G_LOG_DOMAIN "gnc.backend.file.sx"
|
2001-07-30 03:32:02 -05:00
|
|
|
|
2001-07-28 01:13:21 -05:00
|
|
|
#define SX_ID "sx:id"
|
|
|
|
#define SX_NAME "sx:name"
|
2007-01-31 21:30:21 -06:00
|
|
|
#define SX_ENABLED "sx:enabled"
|
2001-07-28 01:13:21 -05:00
|
|
|
#define SX_AUTOCREATE "sx:autoCreate"
|
|
|
|
#define SX_AUTOCREATE_NOTIFY "sx:autoCreateNotify"
|
|
|
|
#define SX_ADVANCE_CREATE_DAYS "sx:advanceCreateDays"
|
|
|
|
#define SX_ADVANCE_REMIND_DAYS "sx:advanceRemindDays"
|
2002-07-24 17:04:57 -05:00
|
|
|
#define SX_INSTANCE_COUNT "sx:instanceCount"
|
2001-07-28 01:13:21 -05:00
|
|
|
#define SX_START "sx:start"
|
|
|
|
#define SX_LAST "sx:last"
|
|
|
|
#define SX_NUM_OCCUR "sx:num-occur"
|
|
|
|
#define SX_REM_OCCUR "sx:rem-occur"
|
|
|
|
#define SX_END "sx:end"
|
2009-12-29 14:12:48 -06:00
|
|
|
#define SX_TEMPL_ACCT "sx:templ-acct"
|
2001-07-28 01:13:21 -05:00
|
|
|
#define SX_FREQSPEC "sx:freqspec"
|
2007-02-18 11:39:54 -06:00
|
|
|
#define SX_SCHEDULE "sx:schedule"
|
2001-07-28 01:13:21 -05:00
|
|
|
#define SX_SLOTS "sx:slots"
|
2002-09-29 15:44:54 -05:00
|
|
|
#define SX_DEFER_INSTANCE "sx:deferredInstance"
|
2001-07-28 01:13:21 -05:00
|
|
|
|
2001-08-01 22:31:15 -05:00
|
|
|
/*
|
|
|
|
* FIXME: These should be defined in a header somewhere
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GNC_ACCOUNT_TAG "gnc:account"
|
|
|
|
#define GNC_TRANSACTION_TAG "gnc:transaction"
|
|
|
|
#define GNC_SCHEDXACTION_TAG "gnc:schedxaction"
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
const gchar* schedxaction_version_string = "1.0.0";
|
|
|
|
const gchar* schedxaction_version2_string = "2.0.0";
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
|
|
|
xmlNodePtr
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_schedXaction_dom_tree_create (SchedXaction* sx)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlNodePtr ret;
|
|
|
|
const GDate* date;
|
2002-07-24 17:04:57 -05:00
|
|
|
gint instCount;
|
2016-03-12 16:04:40 -06:00
|
|
|
const GncGUID* templ_acc_guid;
|
2007-06-30 08:36:02 -05:00
|
|
|
gboolean allow_2_2_incompat = TRUE;
|
2016-03-12 16:04:40 -06:00
|
|
|
gchar* name = g_strdup (xaccSchedXactionGetName (sx));
|
2001-07-28 01:13:21 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
templ_acc_guid = xaccAccountGetGUID (sx->template_acct);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2001-06-18 05:23:46 -05:00
|
|
|
/* FIXME: this should be the same as the def in io-gncxml-v2.c */
|
2013-12-22 16:32:04 -06:00
|
|
|
ret = xmlNewNode (NULL, BAD_CAST GNC_SCHEDXACTION_TAG);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2007-06-30 08:36:02 -05:00
|
|
|
if (allow_2_2_incompat)
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlSetProp (ret, BAD_CAST "version", BAD_CAST schedxaction_version2_string);
|
2007-02-18 17:16:05 -06:00
|
|
|
else
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlSetProp (ret, BAD_CAST "version", BAD_CAST schedxaction_version_string);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret,
|
|
|
|
guid_to_dom_tree (SX_ID,
|
|
|
|
xaccSchedXactionGetGUID (sx)));
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlNewTextChild (ret, NULL, BAD_CAST SX_NAME, checked_char_cast (name));
|
2013-12-22 16:32:04 -06:00
|
|
|
g_free (name);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2007-06-30 08:36:02 -05:00
|
|
|
if (allow_2_2_incompat)
|
2007-02-18 17:16:05 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlNewTextChild (ret, NULL, BAD_CAST SX_ENABLED,
|
|
|
|
BAD_CAST (sx->enabled ? "y" : "n"));
|
2007-02-18 17:16:05 -06:00
|
|
|
}
|
2007-01-31 21:30:21 -06:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlNewTextChild (ret, NULL, BAD_CAST SX_AUTOCREATE,
|
|
|
|
BAD_CAST (sx->autoCreateOption ? "y" : "n"));
|
|
|
|
xmlNewTextChild (ret, NULL, BAD_CAST SX_AUTOCREATE_NOTIFY,
|
|
|
|
BAD_CAST (sx->autoCreateNotify ? "y" : "n"));
|
|
|
|
xmlAddChild (ret, int_to_dom_tree (SX_ADVANCE_CREATE_DAYS,
|
|
|
|
sx->advanceCreateDays));
|
|
|
|
xmlAddChild (ret, int_to_dom_tree (SX_ADVANCE_REMIND_DAYS,
|
|
|
|
sx->advanceRemindDays));
|
2001-07-06 02:31:31 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
instCount = gnc_sx_get_instance_count (sx, NULL);
|
|
|
|
xmlAddChild (ret, int_to_dom_tree (SX_INSTANCE_COUNT,
|
|
|
|
instCount));
|
2002-07-24 17:04:57 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret,
|
|
|
|
gdate_to_dom_tree (SX_START,
|
|
|
|
xaccSchedXactionGetStartDate (sx)));
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
date = xaccSchedXactionGetLastOccurDate (sx);
|
|
|
|
if (g_date_valid (date))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret, gdate_to_dom_tree (SX_LAST, date));
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (xaccSchedXactionHasOccurDef (sx))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2001-07-28 01:13:21 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret, int_to_dom_tree (SX_NUM_OCCUR,
|
|
|
|
xaccSchedXactionGetNumOccur (sx)));
|
|
|
|
xmlAddChild (ret, int_to_dom_tree (SX_REM_OCCUR,
|
|
|
|
xaccSchedXactionGetRemOccur (sx)));
|
2001-07-28 01:13:21 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
2016-03-12 16:04:40 -06:00
|
|
|
else if (xaccSchedXactionHasEndDate (sx))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret,
|
|
|
|
gdate_to_dom_tree (SX_END,
|
|
|
|
xaccSchedXactionGetEndDate (sx)));
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
2010-03-27 16:01:21 -05:00
|
|
|
/* output template account GncGUID */
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret,
|
|
|
|
guid_to_dom_tree (SX_TEMPL_ACCT,
|
|
|
|
templ_acc_guid));
|
2007-02-18 17:16:05 -06:00
|
|
|
|
2007-06-30 08:36:02 -05:00
|
|
|
if (allow_2_2_incompat)
|
2007-02-18 17:16:05 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlNodePtr schedule_node = xmlNewNode (NULL,
|
|
|
|
BAD_CAST "sx:schedule");
|
|
|
|
GList* schedule = gnc_sx_get_schedule (sx);
|
2007-02-18 17:16:05 -06:00
|
|
|
for (; schedule != NULL; schedule = schedule->next)
|
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (schedule_node, recurrence_to_dom_tree ("gnc:recurrence",
|
|
|
|
(Recurrence*)schedule->data));
|
2007-02-18 17:16:05 -06:00
|
|
|
}
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret, schedule_node);
|
2007-02-18 17:16:05 -06:00
|
|
|
}
|
2009-12-29 14:12:48 -06:00
|
|
|
|
2002-09-29 15:44:54 -05:00
|
|
|
/* Output deferred-instance list. */
|
|
|
|
{
|
2009-12-29 14:12:48 -06:00
|
|
|
xmlNodePtr instNode;
|
2016-03-12 16:04:40 -06:00
|
|
|
SXTmpStateData* tsd;
|
|
|
|
GList* l;
|
2009-12-29 14:12:48 -06:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
for (l = gnc_sx_get_defer_instances (sx); l; l = l->next)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2010-08-21 15:57:19 -05:00
|
|
|
tsd = (SXTmpStateData*)l->data;
|
2009-12-29 14:12:48 -06:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
instNode = xmlNewNode (NULL, BAD_CAST SX_DEFER_INSTANCE);
|
|
|
|
if (g_date_valid (&tsd->last_date))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (instNode, gdate_to_dom_tree (SX_LAST,
|
|
|
|
&tsd->last_date));
|
2002-09-29 15:44:54 -05:00
|
|
|
}
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (instNode, int_to_dom_tree (SX_REM_OCCUR,
|
|
|
|
tsd->num_occur_rem));
|
|
|
|
xmlAddChild (instNode, int_to_dom_tree (SX_INSTANCE_COUNT,
|
|
|
|
tsd->num_inst));
|
|
|
|
xmlAddChild (ret, instNode);
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
2002-09-29 15:44:54 -05:00
|
|
|
}
|
2009-12-29 14:12:48 -06:00
|
|
|
|
2015-06-13 19:28:11 -05:00
|
|
|
/* xmlAddChild won't do anything with a NULL, so tests are superfluous. */
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlAddChild (ret, qof_instance_slots_to_dom_tree (SX_SLOTS,
|
|
|
|
QOF_INSTANCE (sx)));
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2001-10-06 03:12:55 -05:00
|
|
|
struct sx_pdata
|
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
SchedXaction* sx;
|
|
|
|
QofBook* book;
|
2009-12-29 14:12:48 -06:00
|
|
|
gboolean saw_freqspec;
|
|
|
|
gboolean saw_recurrence;
|
2001-10-06 03:12:55 -05:00
|
|
|
};
|
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_id_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
GncGUID* tmp = dom_tree_to_guid (node);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_return_val_if_fail (tmp, FALSE);
|
|
|
|
xaccSchedXactionSetGUID (sx, tmp);
|
|
|
|
g_free (tmp);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_name_handler (xmlNodePtr node, gpointer sx_pdata)
|
|
|
|
{
|
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
gchar* tmp = dom_tree_to_text (node);
|
|
|
|
g_debug ("sx named [%s]", tmp);
|
|
|
|
g_return_val_if_fail (tmp, FALSE);
|
|
|
|
xaccSchedXactionSetName (sx, tmp);
|
|
|
|
g_free (tmp);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-01-31 21:30:21 -06:00
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_enabled_handler (xmlNodePtr node, gpointer sx_pdata)
|
2007-01-31 21:30:21 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
gchar* tmp = dom_tree_to_text (node);
|
2007-01-31 21:30:21 -06:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
sx->enabled = (g_strcmp0 (tmp, "y") == 0 ? TRUE : FALSE);
|
2007-01-31 21:30:21 -06:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-07-06 02:31:31 -05:00
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_autoCreate_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-07-06 02:31:31 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
gchar* tmp = dom_tree_to_text (node);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
sx->autoCreateOption = (g_strcmp0 (tmp, "y") == 0 ? TRUE : FALSE);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
|
|
|
return TRUE;
|
2001-07-06 02:31:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_notify_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-07-06 02:31:31 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
gchar* tmp = dom_tree_to_text (node);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
sx->autoCreateNotify = (g_strcmp0 (tmp, "y") == 0 ? TRUE : FALSE);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
|
|
|
return TRUE;
|
2001-07-06 02:31:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_advCreate_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-07-06 02:31:31 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
gint64 advCreate;
|
2001-07-06 02:31:31 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (! dom_tree_to_integer (node, &advCreate))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
2001-10-06 03:12:55 -05:00
|
|
|
}
|
2001-07-06 02:31:31 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xaccSchedXactionSetAdvanceCreation (sx, advCreate);
|
2001-10-06 03:12:55 -05:00
|
|
|
return TRUE;
|
2001-07-06 02:31:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_advRemind_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-07-06 02:31:31 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
gint64 advRemind;
|
2001-07-06 02:31:31 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (! dom_tree_to_integer (node, &advRemind))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
2001-10-06 03:12:55 -05:00
|
|
|
}
|
2001-07-06 02:31:31 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xaccSchedXactionSetAdvanceReminder (sx, advRemind);
|
2001-10-06 03:12:55 -05:00
|
|
|
return TRUE;
|
2001-07-06 02:31:31 -05:00
|
|
|
}
|
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_set_date (xmlNodePtr node, SchedXaction* sx,
|
|
|
|
void (*settor) (SchedXaction* sx, const GDate* d))
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
GDate* date;
|
|
|
|
date = dom_tree_to_gdate (node);
|
|
|
|
g_return_val_if_fail (date, FALSE);
|
|
|
|
(*settor) (sx, date);
|
|
|
|
g_date_free (date);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-07-24 17:04:57 -05:00
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_instcount_handler (xmlNodePtr node, gpointer sx_pdata)
|
2002-07-24 17:04:57 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2009-12-29 14:12:48 -06:00
|
|
|
gint64 instanceNum;
|
2002-07-24 17:04:57 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (! dom_tree_to_integer (node, &instanceNum))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2002-07-24 17:04:57 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_sx_set_instance_count (sx, instanceNum);
|
2009-12-29 14:12:48 -06:00
|
|
|
return TRUE;
|
2002-07-24 17:04:57 -05:00
|
|
|
}
|
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_start_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
return sx_set_date (node, sx, xaccSchedXactionSetStartDate);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_last_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
return sx_set_date (node, sx, xaccSchedXactionSetLastOccurDate);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_end_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
return sx_set_date (node, sx, xaccSchedXactionSetEndDate);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
2007-03-14 21:41:20 -05:00
|
|
|
static void
|
2016-03-12 16:04:40 -06:00
|
|
|
_fixup_recurrence_start_dates (const GDate* sx_start_date, GList* schedule)
|
2007-03-14 21:41:20 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
GList* iter;
|
2009-12-29 14:12:48 -06:00
|
|
|
for (iter = schedule; iter != NULL; iter = iter->next)
|
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
Recurrence* r;
|
2007-03-14 21:41:20 -05:00
|
|
|
GDate start, next;
|
|
|
|
|
|
|
|
r = (Recurrence*)iter->data;
|
|
|
|
|
|
|
|
start = *sx_start_date;
|
2016-03-12 16:04:40 -06:00
|
|
|
g_date_subtract_days (&start, 1);
|
2007-03-14 21:41:20 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_date_clear (&next, 1);
|
2007-03-14 21:41:20 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
recurrenceNextInstance (r, &start, &next);
|
|
|
|
g_return_if_fail (g_date_valid (&next));
|
2007-03-14 21:41:20 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
gchar date_str[128];
|
2016-03-12 16:04:40 -06:00
|
|
|
gchar* sched_str;
|
2007-03-14 21:41:20 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_date_strftime (date_str, 127, "%x", &next);
|
|
|
|
sched_str = recurrenceToString (r);
|
|
|
|
g_debug ("setting recurrence [%s] start date to [%s]",
|
|
|
|
sched_str, date_str);
|
|
|
|
g_free (sched_str);
|
2007-03-14 21:41:20 -05:00
|
|
|
}
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
recurrenceSet (r,
|
|
|
|
recurrenceGetMultiplier (r),
|
|
|
|
recurrenceGetPeriodType (r),
|
|
|
|
&next,
|
|
|
|
recurrenceGetWeekendAdjust (r));
|
2007-03-14 21:41:20 -05:00
|
|
|
}
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (g_list_length (schedule) == 1
|
|
|
|
&& recurrenceGetPeriodType ((Recurrence*)g_list_nth_data (schedule,
|
|
|
|
0)) == PERIOD_ONCE)
|
2007-03-14 21:41:20 -05:00
|
|
|
{
|
|
|
|
char date_buf[128];
|
2016-03-12 16:04:40 -06:00
|
|
|
Recurrence* fixup = (Recurrence*)g_list_nth_data (schedule, 0);
|
|
|
|
g_date_strftime (date_buf, 127, "%x", sx_start_date);
|
|
|
|
recurrenceSet (fixup, 1, PERIOD_ONCE, sx_start_date, WEEKEND_ADJ_NONE);
|
|
|
|
g_debug ("fixed up period=ONCE Recurrence to date [%s]", date_buf);
|
2007-03-14 21:41:20 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-18 11:39:54 -06:00
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_freqspec_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
GList* schedule;
|
2009-12-29 14:12:48 -06:00
|
|
|
gchar* debug_str;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_return_val_if_fail (node, FALSE);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
schedule = dom_tree_freqSpec_to_recurrences (node, pdata->book);
|
|
|
|
gnc_sx_set_schedule (sx, schedule);
|
|
|
|
debug_str = recurrenceListToString (schedule);
|
|
|
|
g_debug ("parsed from freqspec [%s]", debug_str);
|
|
|
|
g_free (debug_str);
|
2007-02-18 13:32:07 -06:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
_fixup_recurrence_start_dates (xaccSchedXactionGetStartDate (sx), schedule);
|
2007-02-18 11:39:54 -06:00
|
|
|
pdata->saw_freqspec = TRUE;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-02-18 11:39:54 -06:00
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_schedule_recurrence_handler (xmlNodePtr node, gpointer parsing_data)
|
2007-02-18 11:39:54 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
GList** schedule = (GList**)parsing_data;
|
2009-12-29 14:12:48 -06:00
|
|
|
gchar* sched_str;
|
2016-03-12 16:04:40 -06:00
|
|
|
Recurrence* r = dom_tree_to_recurrence (node);
|
|
|
|
g_return_val_if_fail (r, FALSE);
|
|
|
|
sched_str = recurrenceToString (r);
|
|
|
|
g_debug ("parsed recurrence [%s]", sched_str);
|
|
|
|
g_free (sched_str);
|
|
|
|
*schedule = g_list_append (*schedule, r);
|
2007-02-18 17:16:05 -06:00
|
|
|
return TRUE;
|
|
|
|
}
|
2007-02-18 11:39:54 -06:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
struct dom_tree_handler sx_recurrence_list_handlers[] =
|
|
|
|
{
|
2007-02-18 17:16:05 -06:00
|
|
|
{ "gnc:recurrence", sx_schedule_recurrence_handler, 0, 0 },
|
|
|
|
{ NULL, NULL, 0, 0 }
|
|
|
|
};
|
2007-02-18 11:39:54 -06:00
|
|
|
|
2007-02-18 17:16:05 -06:00
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_recurrence_handler (xmlNodePtr node, gpointer _pdata)
|
2007-02-18 17:16:05 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* parsing_data = static_cast<decltype (parsing_data)> (_pdata);
|
|
|
|
GList* schedule = NULL;
|
2009-12-29 14:12:48 -06:00
|
|
|
gchar* debug_str;
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_return_val_if_fail (node, FALSE);
|
2007-02-18 17:16:05 -06:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (!dom_tree_generic_parse (node, sx_recurrence_list_handlers, &schedule))
|
2007-02-18 17:16:05 -06:00
|
|
|
return FALSE;
|
2007-06-18 22:02:36 -05:00
|
|
|
// g_return_val_if_fail(schedule, FALSE);
|
2016-03-12 16:04:40 -06:00
|
|
|
debug_str = recurrenceListToString (schedule);
|
|
|
|
g_debug ("setting freshly-parsed schedule: [%s]", debug_str);
|
|
|
|
g_free (debug_str);
|
|
|
|
gnc_sx_set_schedule (parsing_data->sx, schedule);
|
2007-02-18 17:16:05 -06:00
|
|
|
parsing_data->saw_recurrence = TRUE;
|
|
|
|
return TRUE;
|
2007-02-18 11:39:54 -06:00
|
|
|
}
|
|
|
|
|
2002-09-29 15:44:54 -05:00
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_defer_last_handler (xmlNodePtr node, gpointer gpTSD)
|
2002-09-29 15:44:54 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
GDate* gd;
|
|
|
|
SXTmpStateData* tsd = (SXTmpStateData*)gpTSD;
|
2002-09-29 15:44:54 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_return_val_if_fail (node, FALSE);
|
|
|
|
gd = dom_tree_to_gdate (node);
|
|
|
|
g_return_val_if_fail (gd, FALSE);
|
2009-12-29 14:12:48 -06:00
|
|
|
tsd->last_date = *gd;
|
2016-03-12 16:04:40 -06:00
|
|
|
g_date_free (gd);
|
2009-12-29 14:12:48 -06:00
|
|
|
return TRUE;
|
2002-09-29 15:44:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_defer_rem_occur_handler (xmlNodePtr node, gpointer gpTSD)
|
2002-09-29 15:44:54 -05:00
|
|
|
{
|
2009-12-29 14:12:48 -06:00
|
|
|
gint64 remOccur;
|
2016-03-12 16:04:40 -06:00
|
|
|
SXTmpStateData* tsd = (SXTmpStateData*)gpTSD;
|
|
|
|
g_return_val_if_fail (node, FALSE);
|
2002-09-29 15:44:54 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (! dom_tree_to_integer (node, &remOccur))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
tsd->num_occur_rem = remOccur;
|
|
|
|
return TRUE;
|
2002-09-29 15:44:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_defer_inst_count_handler (xmlNodePtr node, gpointer gpTSD)
|
2002-09-29 15:44:54 -05:00
|
|
|
{
|
2009-12-29 14:12:48 -06:00
|
|
|
gint64 instCount;
|
2016-03-12 16:04:40 -06:00
|
|
|
SXTmpStateData* tsd = (SXTmpStateData*)gpTSD;
|
|
|
|
g_return_val_if_fail (node, FALSE);
|
2002-09-29 15:44:54 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (! dom_tree_to_integer (node, &instCount))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
tsd->num_inst = instCount;
|
|
|
|
return TRUE;
|
2002-09-29 15:44:54 -05:00
|
|
|
}
|
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
struct dom_tree_handler sx_defer_dom_handlers[] =
|
|
|
|
{
|
|
|
|
/* tag name, handler, opt, ? */
|
|
|
|
{ SX_LAST, sx_defer_last_handler, 1, 0 },
|
|
|
|
{ SX_REM_OCCUR, sx_defer_rem_occur_handler, 1, 0 },
|
|
|
|
{ SX_INSTANCE_COUNT, sx_defer_inst_count_handler, 1, 0 },
|
|
|
|
{ NULL, NULL, 0, 0 }
|
2002-09-29 15:44:54 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_defer_inst_handler (xmlNodePtr node, gpointer sx_pdata)
|
2002-09-29 15:44:54 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
SXTmpStateData* tsd;
|
2002-09-29 15:44:54 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_return_val_if_fail (node, FALSE);
|
2002-09-29 15:44:54 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
tsd = g_new0 (SXTmpStateData, 1);
|
|
|
|
g_assert (sx_defer_dom_handlers != NULL);
|
|
|
|
if (!dom_tree_generic_parse (node,
|
|
|
|
sx_defer_dom_handlers,
|
|
|
|
tsd))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlElemDump (stdout, NULL, node);
|
|
|
|
g_free (tsd);
|
2009-12-29 14:12:48 -06:00
|
|
|
tsd = NULL;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We assume they were serialized in sorted order, here. */
|
2016-03-12 16:04:40 -06:00
|
|
|
sx->deferredList = g_list_append (sx->deferredList, tsd);
|
2009-12-29 14:12:48 -06:00
|
|
|
return TRUE;
|
2002-09-29 15:44:54 -05:00
|
|
|
}
|
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_numOccur_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
gint64 numOccur;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (! dom_tree_to_integer (node, &numOccur))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xaccSchedXactionSetNumOccur (sx, numOccur);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-07-28 01:13:21 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
static
|
2001-07-28 01:13:21 -05:00
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_templ_acct_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-07-28 01:13:21 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
|
|
|
GncGUID* templ_acct_guid = dom_tree_to_guid (node);
|
|
|
|
Account* account;
|
2001-07-28 01:13:21 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
if (!templ_acct_guid)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2001-07-28 01:13:21 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
account = xaccAccountLookup (templ_acct_guid, pdata->book);
|
|
|
|
sx_set_template_account (sx, account);
|
2019-11-16 17:17:27 -06:00
|
|
|
guid_free (templ_acct_guid);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
return TRUE;
|
2001-07-28 01:13:21 -05:00
|
|
|
}
|
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_remOccur_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2009-12-29 14:12:48 -06:00
|
|
|
gint64 remOccur;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (! dom_tree_to_integer (node, &remOccur))
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xaccSchedXactionSetRemOccur (sx, remOccur);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
return TRUE;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_slots_handler (xmlNodePtr node, gpointer sx_pdata)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
|
|
|
SchedXaction* sx = pdata->sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
return dom_tree_create_instance_slots (node, QOF_INSTANCE (sx));
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
struct dom_tree_handler sx_dom_handlers[] =
|
|
|
|
{
|
2001-07-28 01:13:21 -05:00
|
|
|
{ SX_ID, sx_id_handler, 1, 0 },
|
|
|
|
{ SX_NAME, sx_name_handler, 1, 0 },
|
2009-12-29 14:12:48 -06:00
|
|
|
{ SX_ENABLED, sx_enabled_handler, 0, 0 },
|
2001-07-28 01:13:21 -05:00
|
|
|
{ SX_AUTOCREATE, sx_autoCreate_handler, 1, 0 },
|
|
|
|
{ SX_AUTOCREATE_NOTIFY, sx_notify_handler, 1, 0 },
|
|
|
|
{ SX_ADVANCE_CREATE_DAYS, sx_advCreate_handler, 1, 0 },
|
|
|
|
{ SX_ADVANCE_REMIND_DAYS, sx_advRemind_handler, 1, 0 },
|
2002-07-24 17:04:57 -05:00
|
|
|
{ SX_INSTANCE_COUNT, sx_instcount_handler, 0, 0 },
|
2001-07-28 01:13:21 -05:00
|
|
|
{ SX_START, sx_start_handler, 1, 0 },
|
|
|
|
{ SX_LAST, sx_last_handler, 0, 0 },
|
|
|
|
{ SX_NUM_OCCUR, sx_numOccur_handler, 0, 0 },
|
|
|
|
{ SX_REM_OCCUR, sx_remOccur_handler, 0, 0 },
|
|
|
|
{ SX_END, sx_end_handler, 0, 0 },
|
2001-07-30 03:32:02 -05:00
|
|
|
{ SX_TEMPL_ACCT, sx_templ_acct_handler, 0, 0 },
|
2007-02-18 11:39:54 -06:00
|
|
|
{ SX_FREQSPEC, sx_freqspec_handler, 0, 0 },
|
|
|
|
{ SX_SCHEDULE, sx_recurrence_handler, 0, 0 },
|
2002-09-29 15:44:54 -05:00
|
|
|
{ SX_DEFER_INSTANCE, sx_defer_inst_handler, 0, 0 },
|
2001-07-28 01:13:21 -05:00
|
|
|
{ SX_SLOTS, sx_slots_handler, 0, 0 },
|
2002-09-29 15:44:54 -05:00
|
|
|
{ NULL, NULL, 0, 0 }
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_schedXaction_end_handler (gpointer data_for_children,
|
|
|
|
GSList* data_from_children, GSList* sibling_data,
|
|
|
|
gpointer parent_data, gpointer global_data,
|
|
|
|
gpointer* result, const gchar* tag)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
SchedXaction* sx;
|
2001-10-06 03:12:55 -05:00
|
|
|
gboolean successful = FALSE;
|
|
|
|
xmlNodePtr tree = (xmlNodePtr)data_for_children;
|
2016-03-12 16:04:40 -06:00
|
|
|
gxpf_data* gdata = (gxpf_data*)global_data;
|
2001-10-06 03:12:55 -05:00
|
|
|
struct sx_pdata sx_pdata;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (parent_data)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (!tag)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_return_val_if_fail (tree, FALSE);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
sx = xaccSchedXactionMalloc (static_cast<QofBook*> (gdata->bookdata));
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
memset (&sx_pdata, 0, sizeof (sx_pdata));
|
2001-10-06 03:12:55 -05:00
|
|
|
sx_pdata.sx = sx;
|
2016-03-12 16:04:40 -06:00
|
|
|
sx_pdata.book = static_cast<decltype (sx_pdata.book)> (gdata->bookdata);
|
2001-10-06 03:12:55 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_assert (sx_dom_handlers != NULL);
|
2002-09-29 15:44:54 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
successful = dom_tree_generic_parse (tree, sx_dom_handlers, &sx_pdata);
|
2009-12-29 14:12:48 -06:00
|
|
|
if (!successful)
|
2001-12-30 16:09:50 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
g_critical ("failed to parse scheduled xaction");
|
|
|
|
xmlElemDump (stdout, NULL, tree);
|
|
|
|
gnc_sx_begin_edit (sx);
|
|
|
|
xaccSchedXactionDestroy (sx);
|
2009-12-29 14:12:48 -06:00
|
|
|
goto done;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
2007-02-18 11:39:54 -06:00
|
|
|
if (tree->properties)
|
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
gchar* sx_name = xaccSchedXactionGetName (sx);
|
|
|
|
xmlAttr* attr;
|
2009-12-29 14:12:48 -06:00
|
|
|
for (attr = tree->properties; attr != NULL; attr = attr->next)
|
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlChar* attr_value = attr->children->content;
|
|
|
|
g_debug ("sx attribute name[%s] value[%s]", attr->name, attr_value);
|
|
|
|
if (strcmp ((const char*)attr->name, "version") != 0)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
g_warning ("unknown sx attribute [%s]", attr->name);
|
2009-12-29 14:12:48 -06:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// if version == 1.0.0: ensure freqspec, no recurrence
|
|
|
|
// if version == 2.0.0: ensure recurrence, no freqspec.
|
2016-03-12 16:04:40 -06:00
|
|
|
if (strcmp ((const char*)attr_value,
|
|
|
|
schedxaction_version_string) == 0)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
if (!sx_pdata.saw_freqspec)
|
2016-03-12 16:04:40 -06:00
|
|
|
g_critical ("did not see freqspec in version 1 sx [%s]", sx_name);
|
2009-12-29 14:12:48 -06:00
|
|
|
if (sx_pdata.saw_recurrence)
|
2016-03-12 16:04:40 -06:00
|
|
|
g_warning ("saw recurrence in supposedly version 1 sx [%s]", sx_name);
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (strcmp ((const char*)attr_value,
|
|
|
|
schedxaction_version2_string) == 0)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
if (sx_pdata.saw_freqspec)
|
2016-03-12 16:04:40 -06:00
|
|
|
g_warning ("saw freqspec in version 2 sx [%s]", sx_name);
|
2009-12-29 14:12:48 -06:00
|
|
|
if (!sx_pdata.saw_recurrence)
|
2016-03-12 16:04:40 -06:00
|
|
|
g_critical ("did not find recurrence in version 2 sx [%s]", sx_name);
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
|
|
|
}
|
2007-02-18 11:39:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// generic_callback -> book_callback: insert the SX in the book
|
2016-03-12 16:04:40 -06:00
|
|
|
gdata->cb (tag, gdata->parsedata, sx);
|
2007-02-18 11:39:54 -06:00
|
|
|
|
2001-07-30 03:32:02 -05:00
|
|
|
/* FIXME: this should be removed somewhere near 1.8 release time. */
|
2016-03-12 16:04:40 -06:00
|
|
|
if (sx->template_acct == NULL)
|
2001-07-30 03:32:02 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
Account* ra = NULL;
|
|
|
|
Account* acct = NULL;
|
|
|
|
sixtp_gdv2* sixdata = static_cast<decltype (sixdata)> (gdata->parsedata);
|
|
|
|
QofBook* book;
|
|
|
|
gchar guidstr[GUID_ENCODING_LENGTH + 1];
|
2009-12-29 14:12:48 -06:00
|
|
|
|
|
|
|
book = sixdata->book;
|
|
|
|
|
|
|
|
/* We're dealing with a pre-200107<near-end-of-month> rgmerk
|
|
|
|
change re: storing template accounts. */
|
2010-03-27 16:01:21 -05:00
|
|
|
/* Fix: get account with name of our GncGUID from the template
|
2009-12-29 14:12:48 -06:00
|
|
|
accounts. Make that our template_acct pointer. */
|
2016-03-12 16:04:40 -06:00
|
|
|
guid_to_string_buff (xaccSchedXactionGetGUID (sx), guidstr);
|
|
|
|
ra = gnc_book_get_template_root (book);
|
|
|
|
if (ra == NULL)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
g_warning ("Error getting template root account from being-parsed Book.");
|
|
|
|
xmlFreeNode (tree);
|
2009-12-29 14:12:48 -06:00
|
|
|
return FALSE;
|
|
|
|
}
|
2016-03-12 16:04:40 -06:00
|
|
|
acct = gnc_account_lookup_by_name (ra, guidstr);
|
|
|
|
if (acct == NULL)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
g_warning ("no template account with name [%s]", guidstr);
|
|
|
|
xmlFreeNode (tree);
|
2009-12-29 14:12:48 -06:00
|
|
|
return FALSE;
|
|
|
|
}
|
2016-03-12 16:04:40 -06:00
|
|
|
g_debug ("template account name [%s] for SX with GncGUID [%s]",
|
|
|
|
xaccAccountGetName (acct), guidstr);
|
2001-10-04 03:17:14 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
/* FIXME: free existing template account.
|
|
|
|
* HUH????? We only execute this if there isn't
|
|
|
|
* currently an existing template account, don't we?
|
|
|
|
* <rgmerk>
|
|
|
|
*/
|
2001-08-01 22:31:15 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
sx->template_acct = acct;
|
2001-07-30 03:32:02 -05:00
|
|
|
}
|
2007-02-18 11:39:54 -06:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
done:
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlFreeNode (tree);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
|
|
|
return successful;
|
|
|
|
}
|
|
|
|
|
|
|
|
sixtp*
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_schedXaction_sixtp_parser_create (void)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
return sixtp_dom_parser_new (gnc_schedXaction_end_handler, NULL, NULL);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
tt_act_handler (xmlNodePtr node, gpointer data)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_template_xaction_data* txd = static_cast<decltype (txd)> (data);
|
|
|
|
Account* acc;
|
|
|
|
gnc_commodity* com;
|
2001-07-30 03:32:02 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
acc = dom_tree_to_account (node, txd->book);
|
2001-07-30 03:32:02 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (acc == NULL)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xaccAccountBeginEdit (acc);
|
2001-09-14 04:31:23 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
/* Check for the lack of a commodity [signifying that the
|
|
|
|
pre-7/11/2001-CIT-change SX template Account was parsed [but
|
|
|
|
incorrectly]. */
|
2016-03-12 16:04:40 -06:00
|
|
|
if (xaccAccountGetCommodity (acc) == NULL)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2008-08-01 11:02:07 -05:00
|
|
|
#if 1
|
2009-12-29 14:12:48 -06:00
|
|
|
gnc_commodity_table* table;
|
2008-08-01 11:02:07 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
table = gnc_commodity_table_get_table (txd->book);
|
|
|
|
com = gnc_commodity_table_lookup (table,
|
2017-06-20 15:35:57 -05:00
|
|
|
GNC_COMMODITY_NS_TEMPLATE, "template");
|
2008-08-01 11:02:07 -05:00
|
|
|
#else
|
2009-12-29 14:12:48 -06:00
|
|
|
/* FIXME: This should first look in the table of the
|
|
|
|
book, maybe? The right thing happens [WRT file
|
|
|
|
load/save] if we just _new all the time, but it
|
|
|
|
doesn't seem right. This whole block should go
|
|
|
|
away at some point, but the same concern still
|
|
|
|
applies for
|
|
|
|
SchedXaction.c:xaccSchedXactionInit... */
|
2016-03-12 16:04:40 -06:00
|
|
|
com = gnc_commodity_new (txd->book,
|
2017-06-20 15:35:57 -05:00
|
|
|
"template", GNC_COMMODITY_NS_TEMPLATE,
|
2009-12-29 14:12:48 -06:00
|
|
|
"template", "template",
|
2016-03-12 16:04:40 -06:00
|
|
|
1);
|
2008-08-01 11:02:07 -05:00
|
|
|
#endif
|
2016-03-12 16:04:40 -06:00
|
|
|
xaccAccountSetCommodity (acc, com);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
2001-09-14 04:31:23 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
txd->accts = g_list_append (txd->accts, acc);
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
tt_trn_handler (xmlNodePtr node, gpointer data)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_template_xaction_data* txd = static_cast<decltype (txd)> (data);
|
|
|
|
Transaction* trn;
|
2001-10-04 03:17:14 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
trn = dom_tree_to_transaction (node, txd->book);
|
2001-10-04 03:17:14 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (trn == NULL)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
txd->transactions = g_list_append (txd->transactions, trn);
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
2001-10-04 03:17:14 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
return TRUE;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
struct dom_tree_handler tt_dom_handlers[] =
|
|
|
|
{
|
|
|
|
{ GNC_ACCOUNT_TAG, tt_act_handler, 0, 0 },
|
|
|
|
{ GNC_TRANSACTION_TAG, tt_trn_handler, 0, 0 },
|
|
|
|
{ NULL, NULL, 0, 0 },
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
static gboolean
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_template_transaction_end_handler (gpointer data_for_children,
|
|
|
|
GSList* data_from_children,
|
|
|
|
GSList* sibling_data,
|
|
|
|
gpointer parent_data,
|
|
|
|
gpointer global_data,
|
|
|
|
gpointer* result,
|
|
|
|
const gchar* tag)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2009-12-29 14:12:48 -06:00
|
|
|
gboolean successful = FALSE;
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlNodePtr tree = static_cast<decltype (tree)> (data_for_children);
|
|
|
|
gxpf_data* gdata = static_cast<decltype (gdata)> (global_data);
|
|
|
|
QofBook* book = static_cast<decltype (book)> (gdata->bookdata);
|
|
|
|
GList* n;
|
2009-12-29 14:12:48 -06:00
|
|
|
gnc_template_xaction_data txd;
|
2001-10-03 05:07:45 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
txd.book = book;
|
|
|
|
txd.accts = NULL;
|
|
|
|
txd.transactions = NULL;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
/* the DOM tree will have an account tree [the template
|
|
|
|
accounts] and a list of transactions [which will be members
|
|
|
|
of the template account].
|
2001-10-04 03:17:14 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
we want to parse through the dom trees for each, placing
|
|
|
|
the null-parent account in the book's template-group slot,
|
|
|
|
the others under it, and the transactions as normal. */
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (parent_data)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (!tag)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
g_return_val_if_fail (tree, FALSE);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
successful = dom_tree_generic_parse (tree, tt_dom_handlers, &txd);
|
2001-10-04 03:17:14 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
if (successful)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
gdata->cb (tag, gdata->parsedata, &txd);
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
g_warning ("failed to parse template transaction");
|
|
|
|
xmlElemDump (stdout, NULL, tree);
|
2009-12-29 14:12:48 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/* cleanup */
|
2016-03-12 16:04:40 -06:00
|
|
|
for (n = txd.accts; n; n = n->next)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
n->data = NULL;
|
|
|
|
}
|
2016-03-12 16:04:40 -06:00
|
|
|
for (n = txd.transactions; n; n = n->next)
|
2009-12-29 14:12:48 -06:00
|
|
|
{
|
|
|
|
n->data = NULL;
|
|
|
|
}
|
2016-03-12 16:04:40 -06:00
|
|
|
g_list_free (txd.accts);
|
|
|
|
g_list_free (txd.transactions);
|
2001-10-04 03:17:14 -05:00
|
|
|
|
2016-03-12 16:04:40 -06:00
|
|
|
xmlFreeNode (tree);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
|
2009-12-29 14:12:48 -06:00
|
|
|
return successful;
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sixtp*
|
2016-03-12 16:04:40 -06:00
|
|
|
gnc_template_transaction_sixtp_parser_create (void)
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
{
|
2016-03-12 16:04:40 -06:00
|
|
|
return sixtp_dom_parser_new (gnc_template_transaction_end_handler,
|
|
|
|
NULL, NULL);
|
2001-06-17 Joshua Sled <jsled@asynchronous.org>
* src/engine/gnc-account-xml-v2.c (dom_tree_to_account): Added.
* src/engine/gnc-transaction-xml-v2.c (dom_tree_to_transaction):
Added.
* src/FileDialog.c: Added support for copying
scheduled-transaction-related GNCBook fields.
src/engine/
* src/engine/FreqSpec.{h,c}: Added.
* src/engine/SchedXaction.{h,c}: Added.
* src/engine/gnc-{freqspec,schedxaction}-xml-v2.c: Added
* src/engine/gnc-book.c: Added the template group [template
transaction belong to the template group] and the Scheduled
Trasnaction list.
* src/gnome/glade/sched_xact.glade: Added.
* src/gnome/dialog-nextrun.{h,c}: Added.
* src/gnome/dialog-scheduledxaction.{h,c}: Added.
* src/gnome/gnc-frequency.{h,c}: Added.
* src/SplitLedger.c, src/MultiLedger.c: Added support for a
Template Ledger.
* src/guile/gnc.gwp: Added wrapping for
dialog-{scheduledxactions,nextrun}-creation functions.
* src/register/splitreg.c: Added formula credit and debit cells,
and flags for template-register support.
* src/register/formulacell.h: Added.
* src/gnome/gnc-dateedit.h: Added explanatory comment from dave_p
in IRC.
* src/gnome/query-user.h: Added prototype of
gnc_verify_dialog_parented(...), so I could use it the SX UI
stuff.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4725 57a11ea4-9604-0410-9ed3-97b8803252fd
2001-06-18 03:25:46 -05:00
|
|
|
}
|