mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix bugs.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3627 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
fc35747a45
commit
990f692e74
@ -763,9 +763,9 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
|
||||
xaccSplitSetMemo(from_split, string);
|
||||
|
||||
/* finish transaction */
|
||||
xaccTransCommitEdit(trans);
|
||||
xaccAccountCommitEdit(from);
|
||||
xaccAccountCommitEdit(curr);
|
||||
xaccTransCommitEdit(trans);
|
||||
|
||||
/* curr -> to transaction */
|
||||
/* Create the transaction */
|
||||
@ -803,9 +803,9 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
|
||||
xaccSplitSetMemo(to_split, string);
|
||||
|
||||
/* finish transaction */
|
||||
xaccTransCommitEdit(trans);
|
||||
xaccAccountCommitEdit(curr);
|
||||
xaccAccountCommitEdit(to);
|
||||
xaccTransCommitEdit(trans);
|
||||
|
||||
/* Refresh everything */
|
||||
gnc_resume_gui_refresh ();
|
||||
@ -842,12 +842,10 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
|
||||
/* Now do the 'to' account */
|
||||
xaccAccountBeginEdit(to);
|
||||
xaccAccountInsertSplit(to, to_split);
|
||||
xaccAccountCommitEdit(to);
|
||||
|
||||
/* Now do the 'from' account */
|
||||
xaccAccountBeginEdit(from);
|
||||
xaccAccountInsertSplit(from, from_split);
|
||||
xaccAccountCommitEdit(from);
|
||||
|
||||
/* do this after they go into their accounts */
|
||||
xaccSplitSetBaseValue (to_split, amount, to_currency);
|
||||
@ -856,6 +854,8 @@ gnc_xfer_dialog_ok_cb(GtkWidget * widget, gpointer data)
|
||||
|
||||
/* finish transaction */
|
||||
xaccTransCommitEdit(trans);
|
||||
xaccAccountCommitEdit(to);
|
||||
xaccAccountCommitEdit(from);
|
||||
|
||||
/* Refresh everything */
|
||||
gnc_resume_gui_refresh ();
|
||||
|
@ -339,6 +339,9 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
gpointer user_data)
|
||||
{
|
||||
StockSplitInfo *info = user_data;
|
||||
GList *account_commits;
|
||||
GList *node;
|
||||
|
||||
gnc_numeric amount;
|
||||
Transaction *trans;
|
||||
Account *account;
|
||||
@ -373,11 +376,12 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
|
||||
split = xaccMallocSplit ();
|
||||
|
||||
xaccAccountBeginEdit (account);
|
||||
account_commits = g_list_prepend (NULL, account);
|
||||
|
||||
xaccTransAppendSplit (trans, split);
|
||||
|
||||
xaccAccountBeginEdit (account);
|
||||
xaccAccountInsertSplit (account, split);
|
||||
xaccAccountCommitEdit (account);
|
||||
|
||||
xaccSplitSetShareAmount (split, amount);
|
||||
xaccSplitMakeStockSplit (split);
|
||||
@ -397,6 +401,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
|
||||
memo = gtk_entry_get_text (GTK_ENTRY (info->memo_entry));
|
||||
|
||||
|
||||
/* asset split */
|
||||
account = gnc_account_tree_get_current_account
|
||||
(GNC_ACCOUNT_TREE (info->asset_tree));
|
||||
@ -404,8 +409,9 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
split = xaccMallocSplit ();
|
||||
|
||||
xaccAccountBeginEdit (account);
|
||||
account_commits = g_list_prepend (account_commits, account);
|
||||
|
||||
xaccAccountInsertSplit (account, split);
|
||||
xaccAccountCommitEdit (account);
|
||||
|
||||
xaccTransAppendSplit (trans, split);
|
||||
|
||||
@ -414,6 +420,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
|
||||
xaccSplitSetMemo (split, memo);
|
||||
|
||||
|
||||
/* income split */
|
||||
account = gnc_account_tree_get_current_account
|
||||
(GNC_ACCOUNT_TREE (info->income_tree));
|
||||
@ -421,8 +428,9 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
split = xaccMallocSplit ();
|
||||
|
||||
xaccAccountBeginEdit (account);
|
||||
account_commits = g_list_prepend (account_commits, account);
|
||||
|
||||
xaccAccountInsertSplit (account, split);
|
||||
xaccAccountCommitEdit (account);
|
||||
|
||||
xaccTransAppendSplit (trans, split);
|
||||
|
||||
@ -434,6 +442,10 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
||||
|
||||
xaccTransCommitEdit (trans);
|
||||
|
||||
for (node = account_commits; node; node = node->next)
|
||||
xaccAccountCommitEdit (node->data);
|
||||
g_list_free (account_commits);
|
||||
|
||||
gnc_resume_gui_refresh ();
|
||||
|
||||
gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
|
||||
|
Loading…
Reference in New Issue
Block a user