Remove the "Compute unrealized gains and losses" option from the balance sheet

report.  Instead compute unrealized gains and losses only if the current book
does not use trading accounts.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18552 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Mike Alexander
2010-01-09 04:54:02 +00:00
parent 56e67d882e
commit 6085758a8b
3 changed files with 13 additions and 10 deletions

View File

@@ -116,6 +116,7 @@ SplitList * qof_query_run (QofQuery *q);
%include <qofquery.h>
%include <qofquerycore.h>
%include <qofbookslots.h>
%include <qofbook.h>
gnc_numeric gnc_numeric_create(gint64 num, gint64 denom);
gnc_numeric gnc_numeric_zero(void);

View File

@@ -40,6 +40,9 @@
#ifndef QOF_BOOK_H
#define QOF_BOOK_H
/* We only want a few things exported to Guile */
#ifndef SWIG
typedef struct _QofBookClass QofBookClass;
#include "qofid.h"
@@ -213,6 +216,8 @@ void qof_book_set_data_fin (QofBook *book, const gchar *key, gpointer data,
/** Retrieves arbitrary pointers to structs stored by qof_book_set_data. */
gpointer qof_book_get_data (const QofBook *book, const gchar *key);
#endif /* SWIG */
/** Returns flag indicating whether this book uses trading accounts */
gboolean qof_book_use_trading_accounts (const QofBook *book);
@@ -229,6 +234,9 @@ gboolean qof_book_shutting_down (const QofBook *book);
*/
gboolean qof_book_not_saved (const QofBook *book);
/* The following functions are not useful in scripting languages */
#ifndef SWIG
/** The qof_book_mark_saved() routine marks the book as having been
* saved (to a file, to a database). Used by backends to mark the
* notsaved flag as FALSE just after loading. Can also be used
@@ -273,6 +281,8 @@ gint64 qof_book_get_counter (const QofBook *book, const char *counter_name);
/** deprecated */
#define qof_book_get_guid(X) qof_entity_get_guid (QOF_INSTANCE(X))
#endif /* SWIG */
#endif /* QOF_BOOK_H */
/** @} */
/** @} */

View File

@@ -139,9 +139,6 @@
(N_ "Display any foreign currency amount in an account"))
(define optname-show-rates (N_ "Show Exchange Rates"))
(define opthelp-show-rates (N_ "Show the exchange rates used"))
(define optname-unrealized-gains (N_ "Compute unrealized gains and losses"))
(define opthelp-unrealized-gains
(N_ "Include unrealized gains and losses in the computation. Will produce incorrect results if the current file uses commodity trading accounts"))
;; options generator
@@ -172,11 +169,6 @@
gnc:pagename-general optname-report-form
"d" opthelp-report-form #t))
(add-option
(gnc:make-simple-boolean-option
gnc:pagename-general optname-unrealized-gains
"e" opthelp-unrealized-gains #t))
;; accounts to work on
(add-option
(gnc:make-account-list-option
@@ -302,8 +294,8 @@
optname-date))))
(report-form? (get-option gnc:pagename-general
optname-report-form))
(compute-unrealized-gains? (get-option gnc:pagename-general
optname-unrealized-gains))
(compute-unrealized-gains? (not (qof-book-use-trading-accounts
(gnc-get-current-book))))
(accounts (get-option gnc:pagename-accounts
optname-accounts))
(depth-limit (get-option gnc:pagename-accounts