[Gnucash-changes] r13424 - gnucash/trunk/src/register/ledger-core - Make register use engine-provided xaccTransGetAccountAmount() instead of

Chris Shoemaker chris at cvs.gnucash.org
Tue Feb 28 14:38:30 EST 2006


Author: chris
Date: 2006-02-28 14:38:29 -0500 (Tue, 28 Feb 2006)
New Revision: 13424
Trac: http://svn.gnucash.org/trac/changeset/13424

Modified:
   gnucash/trunk/src/register/ledger-core/split-register-model.c
Log:
   Make register use engine-provided xaccTransGetAccountAmount() instead of 
   writing its own.


Modified: gnucash/trunk/src/register/ledger-core/split-register-model.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-model.c	2006-02-28 19:34:42 UTC (rev 13423)
+++ gnucash/trunk/src/register/ledger-core/split-register-model.c	2006-02-28 19:38:29 UTC (rev 13424)
@@ -337,29 +337,8 @@
 static gnc_numeric
 get_trans_total_amount (SplitRegister *reg, Transaction *trans)
 {
-  GList *node;
-  Account *account;
-  gnc_numeric total = gnc_numeric_zero ();
-
-  account = gnc_split_register_get_default_account (reg);
-
-  if (!account)
-    return total;
-
-  total = gnc_numeric_convert (total, xaccAccountGetCommoditySCU (account),
-                               GNC_RND_ROUND);
-
-  for (node = xaccTransGetSplitList (trans); node; node = node->next)
-  {
-    Split *split = node->data;
-
-    if (xaccSplitGetAccount (split) != account)
-      continue;
-
-    total = gnc_numeric_add_fixed (total, xaccSplitGetAmount (split));
-  }
-
-  return total;
+  Account *account = gnc_split_register_get_default_account (reg);
+  return xaccTransGetAccountAmount(trans, account);
 }
 
 static Split *



More information about the gnucash-changes mailing list