mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-07-30 08:08:15 -05:00
* src/engine/Account.c:
- updated implementation of qofAccountSetParent(). git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10443 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
compatible with QSF: using false instead of FALSE in string
|
||||
output and using the QSF_XSD_TIME for the datestrings.
|
||||
|
||||
* src/engine/Account.c:
|
||||
- updated implementation of qofAccountSetParent().
|
||||
|
||||
2005-01-29 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
David Montenegro's patch for bugs #95551, #124367.
|
||||
|
||||
+8
-14
@@ -1258,23 +1258,17 @@ xaccAccountSetDescription (Account *acc, const char *str)
|
||||
static void
|
||||
qofAccountSetParent (Account *acc, QofEntity *parent)
|
||||
{
|
||||
AccountGroup *ag;
|
||||
if((!acc)||(!parent)) return;
|
||||
if(acc->parent) return;
|
||||
Account *parent_acc;
|
||||
|
||||
if((!acc)||(!parent)) { return; }
|
||||
parent_acc = (Account*)parent;
|
||||
xaccAccountBeginEdit(acc);
|
||||
g_message("qofAccountSetParent start");
|
||||
ag = xaccAccountGetParent((Account*)parent);
|
||||
acc->parent = ag;
|
||||
/* FIXME: acc->parent is type AccountGroup but AccountGroup is not a true QOF object
|
||||
so can't set AccountGroup in the target book because the GUID of any new AccountGroups
|
||||
is not found. Workaround uses Account as the reference type.
|
||||
*/
|
||||
if(!acc->parent) {
|
||||
g_message("qofAccountSetParent failed.");
|
||||
}
|
||||
xaccAccountBeginEdit(parent_acc);
|
||||
xaccAccountInsertSubAccount(parent_acc, acc);
|
||||
mark_account (parent_acc);
|
||||
mark_account (acc);
|
||||
acc->inst.dirty = TRUE;
|
||||
xaccAccountCommitEdit(acc);
|
||||
xaccAccountCommitEdit(parent_acc);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user