GnuCash Daily Diff
Dave Peticolas
peticolas@linas.org
Tue, 15 May 2001 13:03:28 +0000 (/etc/localtime)
Index: gnucash/ChangeLog
diff -u gnucash/ChangeLog:1.468 gnucash/ChangeLog:1.474
--- gnucash/ChangeLog:1.468 Mon May 14 05:30:42 2001
+++ gnucash/ChangeLog Tue May 15 07:22:03 2001
@@ -1,4 +1,35 @@
+2001-05-15 Robert Graham Merkel <rgmerk@mira.net>
+
+ * doc/sgml/C/xacc-reports.sgml, xacc-about.sgml, xacc-dateinput.sgml,
+ xacc-account-summary.sgml, xacc-balancesheet.sgml, xacc-common-report-options.sgml
+ xacc-mainwin.sgml: update documentation for new features.
+
+ * doc/sgml/C/xacc-asset-liability-barcharts.sgml: new file. Placeholder
+ at this stage.
+
+ * doc/sgml/C/xacc-asset-liability-piecharts.sgml, xacc-gnome-mdi.sgml,
+ xacc-income-expense-barcharts.sgml, xacc-income-expense-piecharts.sgml,
+ xacc-multicolumn-view-reports.sgml: ditto.
+
+2001-05-15 Dave Peticolas <dave@krondo.com>
+
+ * src/doc/design/engine.texinfo: update docs
+
+2001-05-15 Christian Stimming <stimming@tuhh.de>
+
+ * src/scm/commodity-utilities.scm, report/portfolio.scm: major
+ code cleanup. (gnc:pricealist-lookup-nearest-in-time) code moved
+ from report/portfolio.scm to commodity-utilities.scm.
+
+2001-05-14 Christian Stimming <stimming@tuhh.de>
+
+ * src/scm/report/category-barchart.scm: fix bug.
+
2001-05-14 Dave Peticolas <dave@krondo.com>
+
+ * src/gnome/druid-qif-import.c: fix bug
+
+ * src/engine/Account.c (xaccAccountGetChildren): fix bug
* src/engine/sixtp-dom-generators.c (add_kvp_value_node): use
xmlNewTextChild.
Index: gnucash/doc/sgml/C/Makefile.am
diff -u gnucash/doc/sgml/C/Makefile.am:1.16 gnucash/doc/sgml/C/Makefile.am:1.17
--- gnucash/doc/sgml/C/Makefile.am:1.16 Sun Apr 29 20:58:13 2001
+++ gnucash/doc/sgml/C/Makefile.am Tue May 15 07:22:05 2001
@@ -10,20 +10,28 @@
xacc-acctypes.sgml \
xacc-adjbalwin.sgml \
xacc-apar.sgml \
+ xacc-asset-liability-barcharts.sgml \
+ xacc-asset-liability-piecharts.sgml \
xacc-balancereport.sgml \
xacc-balancesheet.sgml \
xacc-chartofaccts.sgml \
xacc-commodity.sgml \
+ xacc-common-report-options.sgml \
xacc-currencyhandling.sgml \
xacc-dateinput.sgml \
xacc-depreciation.sgml \
xacc-dochack.sgml \
xacc-doubleentry.sgml \
xacc-euro.sgml \
+ xacc-gnome-mdi.sgml \
xacc-gpl.sgml \
xacc-incomeexpense.sgml \
+ xacc-income-expense-barcharts.sgml \
+ xacc-income-expense-piecharts.sgml \
xacc-locatingtxns.sgml \
xacc-mainwin.sgml \
+ xacc-multicolumn-view-reports.sgml \
+ xacc-net-worth-barchart.sgml \
xacc-newacctwin.sgml \
xacc-pnl.sgml \
xacc-portfolio-report.sgml \
Index: gnucash/doc/sgml/C/gnucash.sgml
diff -u gnucash/doc/sgml/C/gnucash.sgml:1.9 gnucash/doc/sgml/C/gnucash.sgml:1.10
--- gnucash/doc/sgml/C/gnucash.sgml:1.9 Sun Apr 29 20:58:13 2001
+++ gnucash/doc/sgml/C/gnucash.sgml Tue May 15 07:22:05 2001
@@ -4,8 +4,11 @@
<!entity xaccacctypes system "xacc-acctypes.sgml">
<!entity xaccnewacctwin system "xacc-newacctwin.sgml">
<!entity xaccadjbalwin system "xacc-adjbalwin.sgml">
+<!entity xaccassetbarcharts "xacc-asset-liability-barcharts.sgml">
+<!entity xaccassetpiecharts "xacc-asset-liability-piecharts.sgml">
<!entity xaccapar system "xacc-apar.sgml">
<!entity xacccommodity system "xacc-commodity.sgml">
+<!entity xacccommonreportoptions system "xacc-common-report-options.sgml">
<!entity xaccdepreciation system "xacc-depreciation.sgml">
<!entity xaccbalancereport system "xacc-balancereport.sgml">
<!entity xaccbalancesheet system "xacc-balancesheet.sgml">
@@ -13,12 +16,17 @@
<!entity xaccdoubleentry system "xacc-doubleentry.sgml">
<!entity xacceuro system "xacc-euro.sgml">
<!entity xaccdateinput system "xacc-dateinput.sgml">
+<!entity xaccgnomemdi system "xacc-gnome-mdi.sgml">
<!entity xaccincomeexpense system "xacc-incomeexpense.sgml">
+<!entity xaccincomeexpensebarcharts system "xacc-income-expense-barcharts.sgml">
+<!entity xaccincomeexpensepiecharts system "xacc-income-expense-piecharts.sgml">
<!entity xacclocatingtxns system "xacc-locatingtxns.sgml">
+<!entity xaccmulticolumnviewreports system "xacc-multicolumn-view-reports.sgml">
<!entity xaccpreferences system "xacc-preferences.sgml">
<!entity xaccchartofaccts system "xacc-chartofaccts.sgml">
<!entity xaccuserdocs system "xacc-userdocs.sgml">
<!entity xaccmainwin system "xacc-mainwin.sgml">
+<!entity xaccnetworthbarchart system "xacc-net-worth-barchart.sgml">
<!entity xaccpnl system "xacc-pnl.sgml">
<!entity xaccportfolioreport system "xacc-portfolio-report.sgml">
<!entity xaccprintcheck system "xacc-print-check.sgml">
@@ -42,13 +50,14 @@
<!entity xaccgpl system "xacc-gpl.sgml">
<!entity bofamym system "bofa-mym.sgml">
]>
-
<BOOK ID="index">
<TITLE>GnuCash User Manual</TITLE>
&xaccabout;
&xaccaccountedit;
&xaccacctypes;
+&xaccassetbarcharts;
+&xaccassetpiecharts;
&xaccnewacctwin;
&xaccadjbalwin;
&xaccapar;
@@ -56,16 +65,21 @@
&xaccbalancereport;
&xaccbalancesheet;
&xacccommodity;
+&xacccommonreportoptions;
&xacccurrencyhandling;
&xaccdoubleentry;
&xacceuro;
&xaccdateinput;
&xaccincomeexpense;
+&xaccincomeexpensebarcharts;
+&xaccincomeexpensepiecharts;
&xacclocatingtxns;
&xaccpreferences;
&xaccchartofaccts;
&xaccuserdocs;
&xaccmainwin;
+&xaccmulticolumnviewreports;
+&xaccnetworthbarchart;
&xaccpnl;
&xaccportfolioreport;
&xaccprintcheck;
Index: gnucash/doc/sgml/C/xacc-about.sgml
diff -u gnucash/doc/sgml/C/xacc-about.sgml:1.37 gnucash/doc/sgml/C/xacc-about.sgml:1.38
--- gnucash/doc/sgml/C/xacc-about.sgml:1.37 Fri May 4 03:16:35 2001
+++ gnucash/doc/sgml/C/xacc-about.sgml Tue May 15 07:22:05 2001
@@ -79,10 +79,27 @@
</listitem>
<listitem>
-<para><emphasis><link linkend="xacc-reports">Reports</link>.</emphasis> Display
- or output as HTML Balance, Transaction, and Profit/Loss
- reports, as well as graphical account balance tracking.
+<para><emphasis>Gnome MDI Interface</emphasis></para>
+<para>Have multiple views of your financial data, arranged how you want
+them, in one or more windows that stay around through GnuCash sessions.
+</para>
+</listitem>
+
+<listitem>
+<para><emphasis><link linkend="xacc-reports">Reports</link>.</emphasis> Display,
+export as HTML, or print a variety of reports, including Balance Sheet, Account
+Summary, Profit and Loss, Stock Portfolios, and Transaction Reports. Reports
+are saved from session to session, and rolling reports are possible with
+relative dates. GnuCash also supports a variety of customizable, printable,
+bar and pie charts.
</para>
+</listitem>
+
+<listitem>
+<para><emphasis>Gnome MDI Interface</emphasis></para>
+<para>Have multiple views of your financial data, arranged how you want
+them, in one or more windows that stay around through GnuCash sessions.
+</para>
</listitem>
</itemizedlist>
Index: gnucash/doc/sgml/C/xacc-asset-liability-barcharts.sgml
diff -u /dev/null gnucash/doc/sgml/C/xacc-asset-liability-barcharts.sgml:1.1
--- /dev/null Tue May 15 08:01:36 2001
+++ gnucash/doc/sgml/C/xacc-asset-liability-barcharts.sgml Tue May 15 07:22:06 2001
@@ -0,0 +1,15 @@
+<article id="xacc-asset-liability-barcharts">
+<artheader>
+<title>Asset and Liability Barcharts</title>
+</artheader>
+<sect1>
+<title>Asset and Liability Barcharts</title>
+<para><emphasis>PICTURES NEEDED!!!!</emphasis>
+</para>
+<para>This is not yet documented.</para>
+</sect1>
+</article>
+
+<!-- Local variables: -->
+<!-- sgml-parent-document: "gnucash.sgml" -->
+<!-- End: -->
Index: gnucash/doc/sgml/C/xacc-asset-liability-piecharts.sgml
diff -u /dev/null gnucash/doc/sgml/C/xacc-asset-liability-piecharts.sgml:1.1
--- /dev/null Tue May 15 08:01:36 2001
+++ gnucash/doc/sgml/C/xacc-asset-liability-piecharts.sgml Tue May 15 07:22:06 2001
@@ -0,0 +1,15 @@
+<article id="xacc-asset-liability-piecharts">
+<artheader>
+<title>Asset and Liability Piecharts</title>
+</artheader>
+<sect1>
+<title>Asset and Liability Piecharts</title>
+<para><emphasis>PICTURES NEEDED!!!!</emphasis>
+</para>
+<para>This is not yet documented.</para>
+</sect1>
+</article>
+
+<!-- Local variables: -->
+<!-- sgml-parent-document: "gnucash.sgml" -->
+<!-- End: -->
Index: gnucash/doc/sgml/C/xacc-balancesheet.sgml
diff -u gnucash/doc/sgml/C/xacc-balancesheet.sgml:1.3 gnucash/doc/sgml/C/xacc-balancesheet.sgml:1.4
--- gnucash/doc/sgml/C/xacc-balancesheet.sgml:1.3 Mon Dec 11 02:08:50 2000
+++ gnucash/doc/sgml/C/xacc-balancesheet.sgml Tue May 15 07:22:06 2001
@@ -13,13 +13,21 @@
</PARA>
<PARA>This report summarizes your assets, liabilities, and
- equity.
+ equity. According to the accounting equation, your assets
+should equal the sum of your liabilities and equity. If that
+is not the case, there is some kind of internal imbalance in
+your accounts.
</PARA>
<PARA>You can select the date for which the balance sheet is to be
calculated up to using the "preferences" toolbar button. The
default is today.
+</PARA>
+<PARA>Note that while you <EMPHASIS>can</EMPHASIS> select specific
+accounts for this report, unless you know exactly what you are
+doing it is unwise and highly likely to give you misleading and
+incorrect figures.
</PARA>
</SECT1>
</ARTICLE>
Index: gnucash/doc/sgml/C/xacc-dateinput.sgml
diff -u gnucash/doc/sgml/C/xacc-dateinput.sgml:1.4 gnucash/doc/sgml/C/xacc-dateinput.sgml:1.5
--- gnucash/doc/sgml/C/xacc-dateinput.sgml:1.4 Mon Dec 11 02:08:50 2000
+++ gnucash/doc/sgml/C/xacc-dateinput.sgml Tue May 15 07:22:06 2001
@@ -1,10 +1,10 @@
<ARTICLE ID="XACC-DATEINPUT">
<ARTHEADER>
-<TITLE>Date Data Input</TITLE>
+<TITLE>Date Accelerator Keys</TITLE>
</ARTHEADER>
<SECT1>
-<TITLE> Date Input</TITLE>
+<TITLE> Date Accelerator Keys</TITLE>
<PARA> The date cell handles the following accelerator keys:
<ITEMIZEDLIST>
Index: gnucash/doc/sgml/C/xacc-gnome-mdi.sgml
diff -u /dev/null gnucash/doc/sgml/C/xacc-gnome-mdi.sgml:1.1
--- /dev/null Tue May 15 08:01:37 2001
+++ gnucash/doc/sgml/C/xacc-gnome-mdi.sgml Tue May 15 07:22:06 2001
@@ -0,0 +1,15 @@
+<article id="xacc-gnome-mdi">
+<artheader>
+<title>The Gnome MDI</title>
+</artheader>
+<sect1>
+<title>The Gnome MDI</title>
+<para><emphasis>PICTURES NEEDED!!!!</emphasis>
+</para>
+<para>This is not yet documented.</para>
+</sect1>
+</article>
+
+<!-- Local variables: -->
+<!-- sgml-parent-document: "gnucash.sgml" -->
+<!-- End: -->
Index: gnucash/doc/sgml/C/xacc-income-expense-barcharts.sgml
diff -u /dev/null gnucash/doc/sgml/C/xacc-income-expense-barcharts.sgml:1.1
--- /dev/null Tue May 15 08:01:37 2001
+++ gnucash/doc/sgml/C/xacc-income-expense-barcharts.sgml Tue May 15 07:22:06 2001
@@ -0,0 +1,15 @@
+<article id="xacc-income-expense-barcharts">
+<artheader>
+<title>Income & Expense Barcharts</title>
+</artheader>
+<sect1>
+<title>Income & Expense Barcharts</title>
+<para><emphasis>PICTURES NEEDED!!!!</emphasis>
+</para>
+<para>This is not yet documented.</para>
+</sect1>
+</article>
+
+<!-- Local variables: -->
+<!-- sgml-parent-document: "gnucash.sgml" -->
+<!-- End: -->
Index: gnucash/doc/sgml/C/xacc-income-expense-piecharts.sgml
diff -u /dev/null gnucash/doc/sgml/C/xacc-income-expense-piecharts.sgml:1.1
--- /dev/null Tue May 15 08:01:37 2001
+++ gnucash/doc/sgml/C/xacc-income-expense-piecharts.sgml Tue May 15 07:22:06 2001
@@ -0,0 +1,15 @@
+<article id="xacc-income-expense-piecharts">
+<artheader>
+<title>Income & Expense Piecharts</title>
+</artheader>
+<sect1>
+<title>Income & Expense Piecharts</title>
+<para><emphasis>PICTURES NEEDED!!!!</emphasis>
+</para>
+<para>This is not yet documented.</para>
+</sect1>
+</article>
+
+<!-- Local variables: -->
+<!-- sgml-parent-document: "gnucash.sgml" -->
+<!-- End: -->
Index: gnucash/doc/sgml/C/xacc-mainwin.sgml
diff -u gnucash/doc/sgml/C/xacc-mainwin.sgml:1.3 gnucash/doc/sgml/C/xacc-mainwin.sgml:1.4
--- gnucash/doc/sgml/C/xacc-mainwin.sgml:1.3 Mon Dec 11 02:08:50 2000
+++ gnucash/doc/sgml/C/xacc-mainwin.sgml Tue May 15 07:22:06 2001
@@ -1,14 +1,14 @@
<ARTICLE ID="XACC-MAINWIN">
<ARTHEADER>
-<TITLE>Main Window</TITLE>
+<TITLE>Account Window</TITLE>
</ARTHEADER>
-<PARA>This is the main account window. You control your set of
+<PARA>This is an account window. You control your set of
accounts from here.
</PARA>
-<PARA>Below is a picture of the main window, with only the main
+<PARA>Below is a picture of an account window, with only the main
accounts shown. Note how <EMPHASIS>Business Expenses</EMPHASIS> has been
selected by highlighting. The box with a cross in it,
immediately to its left, shows that it has one or more detail
Index: gnucash/doc/sgml/C/xacc-multicolumn-view-reports.sgml
diff -u /dev/null gnucash/doc/sgml/C/xacc-multicolumn-view-reports.sgml:1.1
--- /dev/null Tue May 15 08:01:37 2001
+++ gnucash/doc/sgml/C/xacc-multicolumn-view-reports.sgml Tue May 15 07:22:07 2001
@@ -0,0 +1,15 @@
+<article id="xacc-multicolumn-view-reports">
+<artheader>
+<title>Multicolumn Views</title>
+</artheader>
+<sect1>
+<title>Multicolumn Views</title>
+<para><emphasis>PICTURES NEEDED!!!!</emphasis>
+</para>
+<para>This is not yet documented.</para>
+</sect1>
+</article>
+
+<!-- Local variables: -->
+<!-- sgml-parent-document: "gnucash.sgml" -->
+<!-- End: -->
Index: gnucash/doc/sgml/C/xacc-portfolio-report.sgml
diff -u gnucash/doc/sgml/C/xacc-portfolio-report.sgml:1.3 gnucash/doc/sgml/C/xacc-portfolio-report.sgml:1.4
--- gnucash/doc/sgml/C/xacc-portfolio-report.sgml:1.3 Mon Dec 11 02:08:51 2000
+++ gnucash/doc/sgml/C/xacc-portfolio-report.sgml Tue May 15 07:22:07 2001
@@ -1,26 +1,37 @@
-
-<ARTICLE ID="XACC-PORTFOLIO-REPORT">
-<ARTHEADER>
-<TITLE>Stock Portfolio Report</TITLE>
-</ARTHEADER>
-<SECT1>
-<TITLE> Stock Portfolio Report</TITLE>
-<PARA> <INLINEMEDIAOBJECT>
-<IMAGEOBJECT>
-<IMAGEDATA FILEREF="image/report-folio.png">
-</IMAGEOBJECT>
-</INLINEMEDIAOBJECT>
-
- </PARA>
-<PARA>This report summarizes the value of the stocks in your
+<article id="XACC-PORTFOLIO-REPORT">
+<artheader>
+<title>Stock Portfolio Report</title>
+</artheader>
+<sect1>
+<title> Stock Portfolio Report</title>
+<para> <inlinemediaobject>
+<imageobject>
+<imagedata fileref="image/report-folio.png">
+</imageobject>
+</inlinemediaobject>
+</para>
+<para>This report summarizes the value of the stocks in your
current portfolio.
-
- </PARA>
-<PARA>There are currently no options for this report.
-</PARA>
-</SECT1>
-</ARTICLE>
+ </para>
+<para>Options supported by this report include the following:
+<itemizedlist>
+<listitem><para><emphasis><link linkend="xacc-options-accounts">
+ Accounts</link></emphasis></para></listitem>
+<listitem><para><emphasis><link linkend="xacc-options-report-title">
+ Report Title</link></emphasis></para></listitem>
+<listitem><para><emphasis><link linkend="xacc-options-style-sheet">
+ Stylesheet</link></emphasis></para></listitem>
+<listitem><para><emphasis><link linkend="xacc-options-date">
+ Date</link></emphasis></para></listitem>
+<listitem><para><emphasis><link linkend="xacc-options-report-currency">
+ Report Currency</link></emphasis></para></listitem>
+<listitem><para><emphasis<link linkend="xacc-options-price-source">
+ Price Source</link></emphasis></para></listitem>
+</itemizedlist>
+</para>
+</sect1>
+</article>
<!-- Local variables: -->
<!-- sgml-parent-document: "gnucash.sgml" -->
Index: gnucash/doc/sgml/C/xacc-reports.sgml
diff -u gnucash/doc/sgml/C/xacc-reports.sgml:1.9 gnucash/doc/sgml/C/xacc-reports.sgml:1.10
--- gnucash/doc/sgml/C/xacc-reports.sgml:1.9 Sun Apr 29 20:58:13 2001
+++ gnucash/doc/sgml/C/xacc-reports.sgml Tue May 15 07:22:07 2001
@@ -11,10 +11,18 @@
<itemizedlist>
<listitem><para><link linkend="xacc-balancesheet"> Balance Sheet:
-</link> shows Assets, Liabilities and Equity. </para> </listitem>
+</link> shows Assets, Liabilities and Equity. </para>
+<para><link linkend="xacc-net-worth-barchart">Net Worth
+Barchart</link>shows your net worth in a graphical environment.
+If you examine just assets or liabilities, <link linkend="xacc-asset-liability-barcharts">
+barcharts</link> showing data over time are available, as are
+<link linkend="xacc-asset-liability-piecharts">piecharts</link>.
<listitem><para><link linkend="xacc-pnl"> Profit And Loss State:
-</link> shows Income and expenses over a selectable period. </para>
+</link> shows Income and/or Expenses over a selectable period. </para>
+<para>
+There are also <link linkend="xacc-income-expense-barcharts">bar</link>
+and <link linkend="xacc-income-expense-piecharts">pie</link> charts.</para>
</listitem>
<listitem> <para><link linkend="xacc-trans-report"> Transaction Report
@@ -31,11 +39,9 @@
to TaxCut or TurboTax. </para>
</listitem>
-<listitem> <para><application>Balance Tracker</application> tracks the
-balance of one or more accounts over time, and supports graphical
-output (if you have <application>gnuplot</application> installed).
-</para> </listitem>
-
+<listitem> <para><link linkend="xacc-balancereport">Balance
+Tracker</link> tracks the balance of one or more accounts over time,
+with the option of displaying both tables and a bar chart.</para>
</itemizedlist>
</para>
@@ -43,7 +49,11 @@
<sect1 id="xacc-reportwindow">
<title> The Report Window</title>
-<para> Once you select a report, a report window will appear: </para>
+<para> Once you select a report, a report will appear. This
+may appear as a seperate top-level window, as a notebook tab,
+or in the main window, selectable for viewing through the "Window"
+menu. This is controllable <link linkend="xacc-gnome-mdi">using
+the MDI interface.</link></para>
<para><inlinemediaobject>
<imageobject>
@@ -62,7 +72,7 @@
</emphasis> allow you to view the previous contents of the window,
just like a web browser </para> </listitem>
-<listitem> <para> <emphasis>Parameters</emphasis> pops up a dialog box
+<listitem> <para> <emphasis>Options</emphasis> pops up a dialog box
allowing you to change the information presented in the report:
</para>
@@ -85,9 +95,15 @@
</itemizedlist>
-</para>
</sect1>
+<sect1 id="xacc-multiple-reports">
+<title> Multiple Reports In A Window</title> <para>GnuCash allows you
+to place multiple reports into a single report window, allowing you to
+examine a set of financial information at a glance. This functionality
+is provided with the <link linkend="xacc-multicolumn-view-report">
+Multicolumn View</link> special report.</para></sect1>
+
<sect1 id="xacc-customreports">
<title> Constructing custom reports</title>
@@ -111,11 +127,13 @@
</filename> for an indication of how they are used.
</para>
-<para>At present, reports are produced by internally creating HTML and
-rendering this with a HTML widget. (Future versions of GnuCash will
-hopefully support a more flexible system). </para>
+<para>At present, reports are produced by calling a HTML-generation API,
+which outputs a dialect of HTML and rendering this with a HTML widget. This
+has limitations (particularly when trying to align objects precisely,
+as might be necessary for printing onto pre-printed invoices for example),
+so in the future an additional report generation interface may be needed.</para>
-</sect1>
+</sect1>
</article>
<!-- Local variables: -->
<!-- sgml-parent-document: "gnucash.sgml" -->
Index: gnucash/po/de.po
diff -u gnucash/po/de.po:1.72 gnucash/po/de.po:1.73
--- gnucash/po/de.po:1.72 Sun May 13 19:51:05 2001
+++ gnucash/po/de.po Mon May 14 17:42:29 2001
@@ -367,7 +367,7 @@
#: src/SplitLedger.c:4021 src/gnome/reconcile-list.c:151
#: src/register/splitreg.c:96
msgid "Reconciled:R"
-msgstr "Ausgeglichen:A"
+msgstr "Reconciled:A"
#: src/SplitLedger.c:4024 src/SplitLedger.c:4097
msgid "Share Balance"
Index: gnucash/src/doc/design/engine.texinfo
diff -u gnucash/src/doc/design/engine.texinfo:1.32 gnucash/src/doc/design/engine.texinfo:1.33
--- gnucash/src/doc/design/engine.texinfo:1.32 Fri May 11 05:48:01 2001
+++ gnucash/src/doc/design/engine.texinfo Tue May 15 04:39:13 2001
@@ -1685,6 +1685,36 @@
@section Accounts
@tindex Account
+An Account is the Engine abstraction of an, well, an account. Accounts
+contain the following pieces of information:
+
+@table @asis
+
+@item A list of Ledger Entries, or Splits
+The list of debits and credits which apply to the Account. The sum of
+all debits and credits is the account balance.
+
+@item A name
+The name of the Account.
+
+@item A description
+A textual description of the Account.
+
+@item A currency
+The commodity that Splits in the account are valued in, i.e., the
+denomination of the 'value' member of Splits in the account.
+
+@item A security
+For Accounts which may contain shares (such as stock accounts),
+the denomination of the 'share quantity' member of Splits in
+the accounts. For accounts which do not contain shares, the
+security is blank, and the share quantities are denominated
+in the Account currency.
+
+@end table
+
+In addition to the above, Accounts contain a key-value pair frame.
+
@node Account Groups, GNCBooks, Accounts, Engine
@section Account Groups
Index: gnucash/src/engine/Account.c
diff -u gnucash/src/engine/Account.c:1.147 gnucash/src/engine/Account.c:1.148
--- gnucash/src/engine/Account.c:1.147 Sun May 13 17:05:38 2001
+++ gnucash/src/engine/Account.c Mon May 14 16:31:49 2001
@@ -1296,7 +1296,7 @@
{
if (!acc) return NULL;
if (acc->children == NULL)
- acc->children = xaccMallocAccountGroup ();
+ xaccAccountInsertSubAccount (acc, NULL);
return (acc->children);
}
Index: gnucash/src/gnome/druid-qif-import.c
diff -u gnucash/src/gnome/druid-qif-import.c:1.32 gnucash/src/gnome/druid-qif-import.c:1.33
--- gnucash/src/gnome/druid-qif-import.c:1.32 Thu May 3 02:56:38 2001
+++ gnucash/src/gnome/druid-qif-import.c Mon May 14 17:16:43 2001
@@ -202,8 +202,8 @@
retval->commodity_pages = NULL;
retval->show_doc_pages =
- gnc_lookup_boolean_option(_("QIF Import"),
- _("Verbose documentation"),
+ gnc_lookup_boolean_option("QIF Import",
+ "Verbose documentation",
TRUE);
for(i=0; i < NUM_PRE_PAGES; i++) {
Index: gnucash/src/scm/commodity-utilities.scm
diff -u gnucash/src/scm/commodity-utilities.scm:1.18 gnucash/src/scm/commodity-utilities.scm:1.19
--- gnucash/src/scm/commodity-utilities.scm:1.18 Sun May 13 19:39:36 2001
+++ gnucash/src/scm/commodity-utilities.scm Tue May 15 02:34:14 2001
@@ -29,10 +29,11 @@
(equal? GNC_COMMODITY_NS_ISO
(gnc:commodity-get-namespace comm)))
-;; All the functions below up to gnc:make-exchange-fn are calculating
-;; the exchange rate for different commodities by determining the
-;; weighted average of all currency transactions.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Functions to get splits with interesting data from accounts.
+
+
;; Returns a list of all splits in the 'currency-accounts' up to
;; 'end-date-tp' which have two different commodities involved, one of
;; which is equivalent to 'commodity' (the latter constraint only if
@@ -96,6 +97,16 @@
(gnc:get-match-commodity-splits currency-accounts end-date-tp #f))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Functions to create some list of prices from data in transactions.
+
+
+;; Helper for warnings below.
+(define (gnc:commodity-numeric->string commodity numeric)
+ (gnc:monetary->string
+ (gnc:make-gnc-monetary commodity numeric)))
+
;; Create a list of all prices of 'price-commodity' measured in the
;; currency 'report-currency'. The prices are taken from all splits in
;; 'currency-accounts' up until the date 'end-date-tp'. Returns a list
@@ -126,10 +137,10 @@
value-amount share-amount))))
;; (warn "gnc:get-commodity-totalavg-prices: value "
- ;; (commodity-numeric->string
+ ;; (gnc:commodity-numeric->string
;; (first foreignlist) (second foreignlist))
;; " bought shares "
- ;; (commodity-numeric->string
+ ;; (gnc:commodity-numeric->string
;; price-commodity (third foreignlist)))
(list
@@ -139,13 +150,13 @@
(begin
(warn "gnc:get-commodity-totalavg-prices: "
"Sorry, currency exchange not yet implemented:"
- (commodity-numeric->string
+ (gnc:commodity-numeric->string
(first foreignlist) (second foreignlist))
" (buying "
- (commodity-numeric->string
+ (gnc:commodity-numeric->string
price-commodity (third foreignlist))
") =? "
- (commodity-numeric->string
+ (gnc:commodity-numeric->string
report-currency (gnc:numeric-zero)))
(gnc:numeric-zero))
(begin
@@ -181,11 +192,6 @@
currency-accounts end-date-tp c report-currency)))
commodity-list)))
-;; Helper for warnings below.
-(define (commodity-numeric->string commodity numeric)
- (gnc:monetary->string
- (gnc:make-gnc-monetary commodity numeric)))
-
;; Get the instantaneous prices for the 'price-commodity', measured in
;; amounts of the 'report-currency'. The prices are taken from all
;; splits in 'currency-accounts' up until the date
@@ -215,10 +221,10 @@
value-amount share-amount))))
;;(warn "get-commodity-inst-prices: value "
- ;; (commodity-numeric->string
+ ;; (gnc:commodity-numeric->string
;; (first foreignlist) (second foreignlist))
;; " bought shares "
- ;;(commodity-numeric->string
+ ;;(gnc:commodity-numeric->string
;; price-commodity (third foreignlist)))
(list
@@ -228,13 +234,13 @@
(begin
(warn "get-commodity-inst-prices: "
"Sorry, currency exchange not yet implemented:"
- (commodity-numeric->string
+ (gnc:commodity-numeric->string
(first foreignlist) (second foreignlist))
" (buying "
- (commodity-numeric->string
+ (gnc:commodity-numeric->string
price-commodity (third foreignlist))
") =? "
- (commodity-numeric->string
+ (gnc:commodity-numeric->string
report-currency (gnc:numeric-zero)))
(gnc:numeric-zero))
(gnc:numeric-div
@@ -265,6 +271,61 @@
commodity-list)))
+;; Find the price in 'pricelist' that's nearest to 'date'. The
+;; pricelist comes from
+;; e.g. gnc:get-commodity-totalavg-prices. Returns a <gnc-numeric> or,
+;; if pricelist was empty, #f.
+(define (gnc:pricelist-price-find-nearest
+ pricelist date)
+ (let* ((later (find (lambda (p)
+ (gnc:timepair-lt date (first p)))
+ pricelist))
+ (earlierlist (take-while
+ (lambda (p)
+ (gnc:timepair-ge date (first p)))
+ pricelist))
+ (earlier (and (not (null? earlierlist))
+ (last earlierlist))))
+ ;; (if earlier
+ ;; (warn "earlier"
+ ;; (gnc:timepair-to-datestring (first earlier))
+ ;; (gnc:numeric-to-double (second earlier))))
+ ;; (if later
+ ;; (warn "later"
+ ;; (gnc:timepair-to-datestring (first later))
+ ;; (gnc:numeric-to-double (second later))))
+
+ (if (and earlier later)
+ (if (< (abs (gnc:timepair-delta date (first earlier)))
+ (abs (gnc:timepair-delta date (first later))))
+ (second earlier)
+ (second later))
+ (or
+ (and earlier (second earlier))
+ (and later (second later))))))
+
+
+;; Find the price of the 'commodity' in the 'pricealist' that is
+;; nearest to the 'date'.
+(define (gnc:pricealist-lookup-nearest-in-time
+ pricealist commodity date)
+ (let ((plist (assoc-ref pricealist commodity)))
+ (if (and plist (not (null? plist)))
+ (let ((price
+ (gnc:pricelist-price-find-nearest
+ plist date)))
+ (if price
+ price
+ (gnc:numeric-zero)))
+ (gnc:numeric-zero))))
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Functions to get one price at a given time (i.e. not time-variant).
+
+
;; Go through all toplevel non-'report-commodity' balances in
;; 'sumlist' and add them to 'report-commodity', if possible. This
;; function takes a sumlist (described in gnc:get-exchange-totals) and
@@ -369,7 +430,6 @@
;; this functions to use some kind of recursiveness.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Calculate the weighted average exchange rate between all
;; commodities and the 'report-commodity'. Uses all currency
;; transactions up until the 'end-date'. Returns an alist, see
@@ -473,6 +533,14 @@
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)))))
(gnc:get-exchange-totals report-commodity end-date)))
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Actual functions for exchanging amounts.
+
+
;; This one returns the ready-to-use function for calculation of the
;; exchange rates. The returned function takes a <gnc-monetary> and
;; the domestic-commodity, exchanges the amount into the domestic
@@ -493,9 +561,32 @@
GNC-RND-ROUND))))
#f))))
+;; Helper for the gnc:exchange-by-pricalist* below. Exchange the
+;; <gnc:monetary> 'foreign' into the <gnc:commodity*> 'domestic' by
+;; the <gnc:numeric> 'price-value'. Returns a <gnc:monetary>.
+(define (gnc:exchange-by-pricevalue-helper
+ foreign domestic price-value)
+ (if (gnc:gnc-monetary? foreign)
+ (gnc:make-gnc-monetary
+ domestic
+ (if price-value
+ (gnc:numeric-mul (gnc:gnc-monetary-amount foreign)
+ price-value
+ (gnc:commodity-get-fraction domestic)
+ GNC-RND-ROUND)
+ (begin
+ (warn "gnc:exchange-by-pricevalue-helper: No price found for "
+ (gnc:monetary->string foreign) " into "
+ (gnc:monetary->string
+ (gnc:make-gnc-monetary domestic (gnc:numeric-zero))))
+ (gnc:numeric-zero))))
+ #f))
+
;; Helper for gnc:exchange-by-pricedb-* below. 'price' gets tested for
-;; #f here, and gets unref'd here too. Returns a <gnc:monetary>.
-(define (gnc:exchange-by-price-helper
+;; #f here, and gets unref'd here too. Exchange the <gnc:monetary>
+;; 'foreign' into the <gnc:commodity*> 'domestic' by the <gnc:Price>
+;; 'price'. Returns a <gnc:monetary>.
+(define (gnc:exchange-by-pricedb-helper
foreign domestic price)
(if (gnc:gnc-monetary? foreign)
(gnc:make-gnc-monetary
@@ -509,7 +600,7 @@
(gnc:price-unref price)
result)
(begin
- (warn "gnc:exchange-by-price-helper: No price found for "
+ (warn "gnc:exchange-by-pricedb-helper: No price found for "
(gnc:monetary->string foreign) " into "
(gnc:monetary->string
(gnc:make-gnc-monetary domestic (gnc:numeric-zero))))
@@ -526,7 +617,7 @@
(define (gnc:exchange-by-pricedb-latest
foreign domestic)
(if (and (record? foreign) (gnc:gnc-monetary? foreign))
- (gnc:exchange-by-price-helper
+ (gnc:exchange-by-pricedb-helper
foreign domestic
(gnc:pricedb-lookup-latest
(gnc:book-get-pricedb (gnc:get-current-book))
@@ -546,7 +637,7 @@
foreign domestic date)
(if (and (record? foreign) (gnc:gnc-monetary? foreign)
date)
- (gnc:exchange-by-price-helper
+ (gnc:exchange-by-pricedb-helper
foreign domestic
(gnc:pricedb-lookup-nearest-in-time
(gnc:book-get-pricedb (gnc:get-current-book))
@@ -554,87 +645,22 @@
domestic date))
#f))
-;; Find the price in 'pricelist' that's nearest to 'date'. The
-;; pricelist comes from
-;; e.g. gnc:get-commodity-totalavg-prices. Returns a <gnc-numeric> or,
-;; if pricelist was empty, #f.
-(define (gnc:pricelist-price-find-nearest
- pricelist date)
- (let* ((later (find (lambda (p)
- (gnc:timepair-lt date (first p)))
- pricelist))
- (earlierlist (take-while
- (lambda (p)
- (gnc:timepair-ge date (first p)))
- pricelist))
- (earlier (and (not (null? earlierlist))
- (last earlierlist))))
- ;; (if earlier
- ;; (warn "earlier"
- ;; (gnc:timepair-to-datestring (first earlier))
- ;; (gnc:numeric-to-double (second earlier))))
- ;; (if later
- ;; (warn "later"
- ;; (gnc:timepair-to-datestring (first later))
- ;; (gnc:numeric-to-double (second later))))
-
- (if (and earlier later)
- (if (< (abs (gnc:timepair-delta date (first earlier)))
- (abs (gnc:timepair-delta date (first later))))
- (second earlier)
- (second later))
- (or
- (and earlier (second earlier))
- (and later (second later))))))
-
;; Exchange by the nearest price from pricelist. This function takes
;; the <gnc-monetary> 'foreign' amount, the <gnc:commodity*>
;; 'domestic' commodity, a <gnc:time-pair> 'date' and the
;; 'pricelist'. It exchanges the amount into the domestic currency,
;; using the price nearest to 'data' found in the pricelist. The
;; function returns a <gnc-monetary>.
-(define (gnc:exchange-by-pricelist-nearest
- pricelist foreign domestic date)
+(define (gnc:exchange-by-pricealist-nearest
+ pricealist foreign domestic date)
(if (and (record? foreign) (gnc:gnc-monetary? foreign)
- date (not (null? pricelist)))
- (gnc:make-gnc-monetary
- domestic
- (let ((price (gnc:pricelist-price-find-nearest pricelist date)))
- (if price
- (gnc:numeric-mul (gnc:gnc-monetary-amount foreign)
- price
- (gnc:commodity-get-fraction domestic)
- GNC-RND-ROUND)
- (begin
- (warn "gnc:exchange-by-pricelist-nearest: No price found for "
- (gnc:monetary->string foreign) " into "
- (gnc:monetary->string
- (gnc:make-gnc-monetary domestic (gnc:numeric-zero)))
- " at date " (gnc:timepair-to-datestring date))
- (gnc:numeric-zero)))))
+ date (not (null? pricealist)))
+ (gnc:exchange-by-pricevalue-helper
+ foreign domestic
+ (gnc:pricealist-lookup-nearest-in-time
+ pricealist (gnc:gnc-monetary-commodity foreign) date))
#f))
-;; Create a ready-to-use function for calculation of the exchange
-;; rates at different times. (This is the glorious generalization of
-;; gnc:make-exchange-function, woohoo!) The prices over time are
-;; stored in 'pricealist' which comes from
-;; e.g. gnc:get-commoditylist-totalavg-prices. The returned function
-;; takes the <gnc-monetary> 'foreign' amount, the <gnc:commodity*>
-;; 'domestic', and the <gnc:timepair> 'date'. It exchanges the amount
-;; into the domestic currency according to the nearest price found in
-;; the 'pricealist'. It will return a <gnc-monetary>.
-(define (gnc:make-exchange-nearest-function pricealist)
- (lambda (foreign domestic date)
- (let ((plist (assoc-ref pricealist
- (gnc:gnc-monetary-commodity foreign))))
- (if (and plist (not (null? plist)))
- (gnc:exchange-by-pricelist-nearest
- plist foreign domestic date)
- (warn "gnc:make-exchange-nearest-fn: No pricelist found for "
- (gnc:monetary->string foreign) " into "
- (gnc:monetary->string
- (gnc:make-gnc-monetary domestic (gnc:numeric-zero))))))))
-
;; Return a ready-to-use function. Which one to use is determined by
;; the value of 'source-option', whose possible values are set in
;; gnc:options-add-price-source!.
@@ -656,9 +682,12 @@
(define (gnc:case-exchange-time-fn
source-option report-currency commodity-list to-date-tp)
(case source-option
- ('weighted-average (gnc:make-exchange-nearest-function
- (gnc:get-commoditylist-totalavg-prices
- commodity-list report-currency to-date-tp)))
+ ('weighted-average (let ((pricealist
+ (gnc:get-commoditylist-totalavg-prices
+ commodity-list report-currency to-date-tp)))
+ (lambda (foreign domestic date)
+ (gnc:exchange-by-pricealist-nearest
+ pricealist foreign domestic date))))
('pricedb-latest (lambda (foreign domestic date)
(gnc:exchange-by-pricedb-latest foreign domestic)))
('pricedb-nearest gnc:exchange-by-pricedb-nearest)
Index: gnucash/src/scm/report/category-barchart.scm
diff -u gnucash/src/scm/report/category-barchart.scm:1.25 gnucash/src/scm/report/category-barchart.scm:1.26
--- gnucash/src/scm/report/category-barchart.scm:1.25 Sat May 12 18:03:13 2001
+++ gnucash/src/scm/report/category-barchart.scm Tue May 15 01:27:15 2001
@@ -330,148 +330,152 @@
;;(gnc:warn "all-data" all-data)
-
- (let ((all-data-amounts (map cadr all-data)))
- (if
- (and (not (null? all-data-amounts))
- (gnc:not-all-zeros all-data-amounts))
- ;; Set chart title, subtitle etc.
- (begin
- (gnc:html-barchart-set-title! chart report-title)
- (gnc:html-barchart-set-subtitle!
- chart (sprintf #f
- (if do-intervals?
- (_ "%s to %s")
- (_ "Balances %s to %s"))
- (gnc:timepair-to-datestring from-date-tp)
- (gnc:timepair-to-datestring to-date-tp)))
- (gnc:html-barchart-set-width! chart width)
- (gnc:html-barchart-set-height! chart height)
-
- ;; row labels etc.
- (gnc:html-barchart-set-row-labels! chart date-string-list)
- ;; FIXME: why doesn't the y-axis label get printed?!?
- (gnc:html-barchart-set-y-axis-label!
- chart (gnc:commodity-get-mnemonic report-currency))
- (gnc:html-barchart-set-row-labels-rotated?! chart #t)
- (gnc:html-barchart-set-stacked?! chart stacked?)
- ;; If this is a stacked barchart, then reverse the legend.
- (gnc:html-barchart-set-legend-reversed?! chart stacked?)
-
- ;; If we have too many categories, we sum them into a new
- ;; 'other' category and add a link to a new report with just
- ;; those accounts.
- (if (> (length all-data) max-slices)
- (let* ((start (take all-data (- max-slices 1)))
- (finish (drop all-data (- max-slices 1)))
- (other-sum (map
- (lambda (l) (apply + l))
- (apply zip (map cadr finish)))))
- (set! all-data
- (append start
- (list (list (_ "Other") other-sum))))
- (let* ((options (gnc:make-report-options reportname))
- (id #f))
- ;; now copy all the options
- (gnc:options-copy-values
- (gnc:report-options report-obj) options)
- ;; and set the destination accounts
- (gnc:option-set-value
- (gnc:lookup-option options gnc:pagename-accounts
- optname-accounts)
- (map car finish))
- ;; Set the URL to point to this report.
- (set! id (gnc:make-report reportname options))
- (set! other-anchor (gnc:report-anchor-text id)))))
-
-
- ;; This adds the data. Note the apply-zip stuff: This
- ;; transposes the data, i.e. swaps rows and columns. Pretty
- ;; cool, eh? Courtesy of dave_p.
- (if (not (null? all-data))
- (gnc:html-barchart-set-data! chart
- (apply zip all-data-amounts)))
-
- ;; Labels and colors
- (gnc:html-barchart-set-col-labels!
- chart (map (lambda (pair)
- (if (string? (car pair))
- (car pair)
- ((if show-fullname?
- gnc:account-get-full-name
- gnc:account-get-name) (car pair))))
- all-data))
- (gnc:html-barchart-set-col-colors!
- chart
- (gnc:assign-colors (length all-data)))
-
- ;; set the URLs; the slices are links to other reports
- (let ((urls
- (map
- (lambda (pair)
- (if (string? (car pair))
- other-anchor
- (let* ((acct (car pair))
- (subaccts
- (gnc:account-get-immediate-subaccounts acct)))
- (if (null? subaccts)
- ;; if leaf-account, make this an anchor
- ;; to the register.
- (gnc:account-anchor-text acct)
- ;; if non-leaf account, make this a link
- ;; to another report which is run on the
- ;; immediate subaccounts of this account
- ;; (and including this account).
- (gnc:make-report-anchor
- reportname
- report-obj
- (list
- (list gnc:pagename-accounts optname-accounts
- (cons acct subaccts))
- (list gnc:pagename-accounts optname-levels
- (+ 1 tree-depth))
- (list gnc:pagename-general
- gnc:optname-reportname
- ((if show-fullname?
- gnc:account-get-full-name
- gnc:account-get-name) acct))))))))
- all-data)))
- (gnc:html-barchart-set-button-1-bar-urls! chart (append urls urls))
- ;; The legend urls do the same thing.
- (gnc:html-barchart-set-button-1-legend-urls! chart
- (append urls urls)))
-
- (gnc:html-document-add-object! document chart)
-
- (if (gnc:option-value
- (gnc:lookup-global-option "General"
- "Display \"Tip of the Day\""))
- (gnc:html-document-add-object!
- document
- (gnc:make-html-text
- (gnc:html-markup-p
- "If you don't see a stacked barchart i.e. you only see \
+
+ ;; Proceed if the data is non-zeros
+ (if
+ (and (not (null? all-data))
+ (gnc:not-all-zeros (map cadr all-data)))
+ (begin
+ ;; Set chart title, subtitle etc.
+ (gnc:html-barchart-set-title! chart report-title)
+ (gnc:html-barchart-set-subtitle!
+ chart (sprintf #f
+ (if do-intervals?
+ (_ "%s to %s")
+ (_ "Balances %s to %s"))
+ (gnc:timepair-to-datestring from-date-tp)
+ (gnc:timepair-to-datestring to-date-tp)))
+ (gnc:html-barchart-set-width! chart width)
+ (gnc:html-barchart-set-height! chart height)
+
+ ;; row labels etc.
+ (gnc:html-barchart-set-row-labels! chart date-string-list)
+ ;; FIXME: axis labels are not yet supported by
+ ;; libguppitank.
+ (gnc:html-barchart-set-y-axis-label!
+ chart (gnc:commodity-get-mnemonic report-currency))
+ (gnc:html-barchart-set-row-labels-rotated?! chart #t)
+ (gnc:html-barchart-set-stacked?! chart stacked?)
+ ;; If this is a stacked barchart, then reverse the legend.
+ (gnc:html-barchart-set-legend-reversed?! chart stacked?)
+
+ ;; If we have too many categories, we sum them into a new
+ ;; 'other' category and add a link to a new report with just
+ ;; those accounts.
+ (if (> (length all-data) max-slices)
+ (let* ((start (take all-data (- max-slices 1)))
+ (finish (drop all-data (- max-slices 1)))
+ (other-sum (map
+ (lambda (l) (apply + l))
+ (apply zip (map cadr finish)))))
+ (set! all-data
+ (append start
+ (list (list (_ "Other") other-sum))))
+ (let* ((options (gnc:make-report-options reportname))
+ (id #f))
+ ;; now copy all the options
+ (gnc:options-copy-values
+ (gnc:report-options report-obj) options)
+ ;; and set the destination accounts
+ (gnc:option-set-value
+ (gnc:lookup-option options gnc:pagename-accounts
+ optname-accounts)
+ (map car finish))
+ ;; Set the URL to point to this report.
+ (set! id (gnc:make-report reportname options))
+ (set! other-anchor (gnc:report-anchor-text id)))))
+
+
+ ;; This adds the data. Note the apply-zip stuff: This
+ ;; transposes the data, i.e. swaps rows and columns. Pretty
+ ;; cool, eh? Courtesy of dave_p.
+ (if (not (null? all-data))
+ (gnc:html-barchart-set-data!
+ chart
+ (apply zip (map cadr all-data))))
+
+ ;; Labels and colors
+ (gnc:html-barchart-set-col-labels!
+ chart (map (lambda (pair)
+ (if (string? (car pair))
+ (car pair)
+ ((if show-fullname?
+ gnc:account-get-full-name
+ gnc:account-get-name) (car pair))))
+ all-data))
+ (gnc:html-barchart-set-col-colors!
+ chart
+ (gnc:assign-colors (length all-data)))
+
+ ;; set the URLs; the slices are links to other reports
+ (let
+ ((urls
+ (map
+ (lambda (pair)
+ (if
+ (string? (car pair))
+ other-anchor
+ (let* ((acct (car pair))
+ (subaccts
+ (gnc:account-get-immediate-subaccounts acct)))
+ (if (null? subaccts)
+ ;; if leaf-account, make this an anchor
+ ;; to the register.
+ (gnc:account-anchor-text acct)
+ ;; if non-leaf account, make this a link
+ ;; to another report which is run on the
+ ;; immediate subaccounts of this account
+ ;; (and including this account).
+ (gnc:make-report-anchor
+ reportname
+ report-obj
+ (list
+ (list gnc:pagename-accounts optname-accounts
+ (cons acct subaccts))
+ (list gnc:pagename-accounts optname-levels
+ (+ 1 tree-depth))
+ (list gnc:pagename-general
+ gnc:optname-reportname
+ ((if show-fullname?
+ gnc:account-get-full-name
+ gnc:account-get-name) acct))))))))
+ all-data)))
+ (gnc:html-barchart-set-button-1-bar-urls!
+ chart (append urls urls))
+ ;; The legend urls do the same thing.
+ (gnc:html-barchart-set-button-1-legend-urls!
+ chart (append urls urls)))
+
+ (gnc:html-document-add-object! document chart)
+
+ (if (gnc:option-value
+ (gnc:lookup-global-option "General"
+ "Display \"Tip of the Day\""))
+ (gnc:html-document-add-object!
+ document
+ (gnc:make-html-text
+ (gnc:html-markup-p
+ "If you don't see a stacked barchart i.e. you only see \
lots of thin bars next to each other for each date, then you \
should upgrade Guppi to version 0.35.5.")
- (gnc:html-markup-p
- "Double-click on any legend box or any bar opens \
+ (gnc:html-markup-p
+ "Double-click on any legend box or any bar opens \
another barchart report with the subaccounts of that account or, \
if that account doesn't have subaccounts, the register for the account.")
- (gnc:html-markup-p "Remove this text by disabling \
+ (gnc:html-markup-p "Remove this text by disabling \
the global Preference \"Display Tip of the Day\".")))))
- ;; else if empty data
- (gnc:html-document-add-object!
- document
- (gnc:html-make-empty-data-warning)))))
+ ;; else if empty data
+ (gnc:html-document-add-object!
+ document
+ (gnc:html-make-empty-data-warning))))
;; else if no accounts selected
(gnc:html-document-add-object!
document
(gnc:html-make-no-account-warning)))
-
- document))
+ document))
(for-each
(lambda (l)
Index: gnucash/src/scm/report/portfolio.scm
diff -u gnucash/src/scm/report/portfolio.scm:1.13 gnucash/src/scm/report/portfolio.scm:1.14
--- gnucash/src/scm/report/portfolio.scm:1.13 Sun May 13 19:39:37 2001
+++ gnucash/src/scm/report/portfolio.scm Tue May 15 02:34:15 2001
@@ -157,16 +157,8 @@
(gnc:get-commoditylist-totalavg-prices
commodity-list currency to-date)))
(lambda (foreign domestic date)
- (let ((plist
- (assoc-ref pricealist foreign)))
- (if (and plist (not (null? plist)))
- (let ((price
- (gnc:pricelist-price-find-nearest
- plist date)))
- (if price
- price
- (gnc:numeric-zero)))
- (gnc:numeric-zero))))))
+ (gnc:pricealist-lookup-nearest-in-time
+ pricealist foreign date))))
('pricedb-latest
(lambda (foreign domestic date)
(let ((price