<!--
      (Do not remove this comment block.)
  Version: 2.0.0
  Last modified: December 7th 2009
       modified: January 10th 2007
       modified: July 9th 2006
  Maintainers: 
               Alex Aycinena <alex.aycinena@gmail.com>
               Chris Lyttle <chris@wilddev.net>
  Author:
  		Jon Lapham <lapham@extracta.com.br>
  	Updated	Dave Herman <dvherman@bigfoot.com>
  Originally designed by Carol Champagne.
  Translators:
               (translators put your name and email here)
-->
<chapter id="chapter_invest">
  <title>Investments</title>

  <para>This chapter explains how to manage your investments with <application>&app;</application>.
  Most people have an investment plan, whether its just putting money into a
  CD account, investing through a company sponsored plan at your workplace or
  buying and selling stocks and bonds through a brokerage. <application>&app;</application> gives you
  tools to help you manage these investments such as the <emphasis>Price
  Editor </emphasis> which allows you to record changes in the prices of
  stocks you own.</para>

  <sect1 id="invest_concepts1">
    <title>Basic Concepts</title>

    <para>An investment is something that you purchase in the hopes of
    generating income, or that you hope to sell in the future for more than
    you paid. Using this simple definition, many things could be considered
    investments: the house you live in, a valuable painting, stocks in
    publicly traded companies, your savings account at the bank, or a
    certificate of deposit. These many types of investments will be discussed
    in this chapter in terms of how to track them using <application>&app;</application>.</para>

    <sect2 id="invest_terms2">
      <title>Terminology</title>

      <para>Before discussing investments specifically, it will be helpful to
      present a glossary of investment terminology. The terms presented below
      represent some of the basic concepts of investing. It is a good idea to
      become familiar with these terms, or at least, refer back to this list
      if you encounter an unfamiliar word in the later sections.</para>

    <variablelist>
      <varlistentry>
        <term><emphasis>Capital gains</emphasis></term>
        <listitem>
          <para>It is the difference between
          the purchase and selling prices of an investment. If the selling
          price is lower than the purchase price, this is called a
          <emphasis>capital loss</emphasis>. Also known as <emphasis>realized
          gain/loss</emphasis>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Commission</emphasis></term>
        <listitem>
          <para>It is the fee you pay to a broker
          to buy or sell securities.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Common stock</emphasis></term>
        <listitem>
          <para>It is a security that
          represents a certain fractional ownership of a company. This is what
          you buy when you <quote>buy stock</quote> in a company on the open market. This
          is also sometimes known as <emphasis>capital
          stock</emphasis>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Compounding</emphasis></term>
        <listitem>
          <para>It is the concept that the
          reinvested interest can later earn interest of its own (interest on
          interest). This is often referred to as <emphasis>compound
          interest</emphasis>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Dividens</emphasis></term>
        <listitem>
          <para>Dividends are cash payments a company
          makes to shareholders. The amount of this payment is usually
          determined as some amount of the profits of the company. Note that
          not all common stocks give dividends.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Equities</emphasis></term>
        <listitem>
          <para>Equities are investments in which the
          investor becomes part (or whole) owner in something. This includes
          common stock in a company, or real estate.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Interest</emphasis></term>
        <listitem>
          <para>It is what a borrower pays a lender
          for the use of their money. Normally, this is expressed in terms of
          a percentage of the principal per year. For example, a savings
          account with 1% interest (you are the lender, the bank is the
          borrower) will pay you $1 for every $100 you keep there per
          year.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Liquidity</emphasis></term>
        <listitem>
          <para>It is a measure of how easily
          convertible an investment is to cash. Money in a savings account is
          very liquid, while money invested in a house has low liquidity
          because it takes time to sell a house.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Principal</emphasis></term>
        <listitem>
          <para>It is the original amount of money
          invested or borrowed.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Realized vs Unrealized Gain/Loss</emphasis></term>
        <listitem>
          <para>Unrealized gain or loss occurs when you&rsquo;ve got a change in price of
          an asset. You realize the gain/loss when you actually sell the
          asset. See also <emphasis>capital gain/loss</emphasis>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Return</emphasis></term>
        <listitem>
          <para>It is the total income plus capital
          gains or losses of an investment. See also
          <emphasis>Yield</emphasis>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Risk</emphasis></term>
        <listitem>
          <para>It is the probability that the return
          on investment is different from what was expected. Investments are
          often grouped on a scale from low risk (savings account, government
          bonds) to high risk (common stock, junk bonds). As a general rule of
          thumb, the higher the risk the higher the possible return.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Shareholder</emphasis></term>
        <listitem>
          <para>Shareholder is a person who holds common
          stock in a company.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Stock split</emphasis></term>
        <listitem>
          <para>It occurs when a company offers
          to issue some additional multiple of shares for each existing stock.
          For example, a <quote>2 for 1</quote> stock split means that if you own 100
          shares of a stock, you will receive an additional 100 at no cost to
          you. The unit price of the shares will be adjusted so there is no
          net change in the value, so in this example the price per share will
          be halved.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Valutation</emphasis></term>
        <listitem>
          <para>It is the process of determining
          the market value or the price the investment would sell at in a
          <quote>reasonable time frame</quote>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><emphasis>Yield</emphasis></term>
        <listitem>
          <para>It is a measure of the amount of money
          you earn from an investment (IE: how much income you receive from
          the investment). Typically this is reported as a percentage of the
          principal amount. Yield does not include capital gains or loses (see
          Return). Eg: A stock sells for $100 and gives $2 in dividends per
          year has a yield of 2%.</para>
        </listitem>
      </varlistentry>
    </variablelist>
    </sect2>

    <sect2 id="invest_types2">
      <title>Types of Investments</title>

      <para>Below is presented some of the broad types of investments
      available, and examples of each type.</para>

      <itemizedlist>
        <listitem>
          <para><emphasis>Interest-bearing account or
          instrument</emphasis></para>

          <para>This type of investment usually allows you immediate access to
          your money, and will typically pay you interest every month based on
          the amount of money you have deposited. Examples are bank savings
          accounts (and some interest bearing checking accounts) and cash
          accounts at your brokerage. This is a very low risk investment, in
          the US these accounts are often insured against loss, to a specified
          limit.</para>

          <para>Sometimes an interest bearing investment is
          <emphasis>time-locked</emphasis>. This type of investment requires
          you to commit your money to be invested for a given period of time
          for which you receive a set rate of return. Usually, the longer you
          commit the higher the interest rates. If you withdraw your money
          before the maturity date, you will usually have to pay an early
          withdrawal penalty. This is a relatively lower risk investment.
          Examples are certificates of deposit or some government bonds. Other
          types of Bonds may have higher yields based on the higher risks from
          the quality of the issuer&rsquo;s <quote>credit rating</quote>.</para>
        </listitem>

        <listitem>
          <para><emphasis>Stocks and Mutual Funds</emphasis></para>

          <para>This is an investment you make in a company, in which you
          effectively become a part owner. There is usually no time lock on
          publicly traded stock, however there may be changes in the tax rates
          you pay on capital gains depending on how long you hold the stock.
          Thus, stocks are typically quite liquid, you can access your money
          relatively quickly. This investment is a higher risk, as you have no
          guarantee on the future price of a stock.</para>

          <para>A mutual fund is a group investment mechanism in which you can
          buy into many stocks simultaneously. For example, a "S&amp;P 500
          index fund" is a fund which purchases all 500 stocks listed in the
          Standard and Poor&rsquo;s index. When you buy a share of this fund, you
          are really buying a small amount of each of the 500 stocks contained
          within the fund. Mutual funds are treated exactly like a single
          stock, both for tax purposes and in accounting.</para>
        </listitem>

        <listitem>
          <para><emphasis>Fixed Assets</emphasis></para>

          <para>Assets that increase in value over time are another form of
          investment. Examples include a house, a plot of land, or a valuable
          painting. This type of investment is very difficult to determine the
          value of until you sell it. The tax implications of selling these
          items is varied, depending on the item. For example, you may have
          tax relief from selling a house if it is your primary residence, but
          may would not receive this tax break on an expensive
          painting.</para>

          <para>Fixed asset investments are discussed in <xref linkend="chapter_capgain" /> and 
          <xref linkend="chapter_dep" />. Typically, there is not much to do
          in terms of accounting for fixed asset investments except recording
          the buying and selling transactions.</para>
        </listitem>
      </itemizedlist>
    </sect2>
  </sect1>

  <sect1 id="invest_accounts1">
    <title>Setting Up Accounts</title>

    <para>To setup investment accounts in <application>&app;</application> you can either use the
    predefined investment account hierarchy or create your own. The minimum
    you need to do to track investments is to setup an asset account for each
    type of investment you own. However, as we have seen in previous chapters,
    it is usually more logical to create a structured account hierarchy,
    grouping related investments together. For example, you may want to group
    all your publicly traded stocks under a parent account named after the
    brokerage firm you used to buy the stocks.</para>

    <note>
    <para>Regardless of how you setup your account hierarchy, remember that
    you can always move accounts around later (without losing the work you&rsquo;ve
    put into them), so your initial account hierarchy does not have to be
    perfect.</para>
    </note>

    <sect2 id="invest_predefined2">
      <title>Using Predefined Investment Accounts</title>

      <para>The <guilabel>Investment Accounts</guilabel> option of the
      <guilabel>New Account Hierarchy Setup</guilabel> assistant will
      automatically create a basic investment account hierarchy for you. To
      access the predefined investment accounts hierarchy, you must make
      sure your <application>&app;</application> file is open, switch to the
      <guilabel>Accounts</guilabel> tab, and choose
      <menuchoice><guimenu>Actions</guimenu><guimenuitem>New Account
      Hierarchy</guimenuitem></menuchoice>. This will run the <guilabel>New
      Account Hierarchy Setup</guilabel> assistant and allow you to select
      additional accounts to add to your account hierarchy. Choose the
      <guilabel>Investment Accounts</guilabel> option (along with any
      others you are interested in). Assuming only investment accounts were
      selected, this will create an account hierarchy as shown
      below.</para>

      <tip>
        <para>You can also run the <guilabel>New Account Hierarchy
        Setup</guilabel> assistant by creating a new <application>&app;</application> file.</para>
      </tip>

      <screenshot id="invest_accountspredef">
        <mediaobject>
	   <imageobject role="html">
             <imagedata fileref="figures/invest_AccountsPredef.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_AccountsPredef.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Interest Investment</phrase>
          </textobject>

          <caption><para>This is an screen image of the <guilabel>Accounts</guilabel> tab after
          creating a new file and selecting only the default investment
          accounts. </para></caption>
        </mediaobject>
      </screenshot>

      <para>You will probably at least want to add a <emphasis>Bank</emphasis>
      account to the Assets and probably an <emphasis>Equity:Opening Balances</emphasis>
      account, as we have done in previous chapters. Don&rsquo;t
      forget to save your new account file with a relevant name!</para>
    </sect2>

    <sect2 id="invest_creating2">
      <title>Creating Investment Accounts Manually</title>

      <para>If you want to set up your own investment accounts hierarchy,
      you may of course do so. Investments usually have a number of
      associated accounts that need to be created: an asset account to
      track the investment itself; an income account to track dividend
      transactions; and expense accounts to track investment fees and
      commissions.</para>
    </sect2>

    <sect2 id="invest_custom2">
      <title>Custom Accounts Example</title>

      <para>The following is a somewhat more complicated example of setting up
      <application>&app;</application> to track your investments, which has the advantage that it
      groups each different investment under the brokerage that deals with the
      investments. This way it is easier to compare the statements you get
      from your brokerage with the accounts you have in <application>&app;</application> and spot where
      <application>&app;</application> differs from the statement. <literallayout>
 Assets
    Investments
       Brokerage Accounts
          I*Trade
             Stocks
                ACME Corp
             Money Market Funds
                I*Trade Municipal Fund
             Cash
          My Stockbroker
             Money Market Funds
                Active Assets Fund
             Government Securities
                Treas Bond xxx
                Treas Note yyy
             Mutual Funds
                Fund A
                Fund B
             Cash
 Income
    Investments
       Brokerage Accounts
          Capital Gains
             I*Trade
             My Stockbroker
          Dividends
             I*Trade
                Taxable
                Non-taxable
             My Stockbroker
                Taxable
                Non-taxable
          Interest Income
             I*Trade
                Taxable
                Non-taxable
             My Stockbroker
                Taxable
                Non-taxable
 Expenses
    Investment Expenses
       Commissions
          I*Trade
          My Stockbroker
       Management Fees
          I*Trade
          My Stockbroker
 </literallayout></para>

      <tip>
      <para>There really is no standard way to set up your investment account
      hierarchy. Play around, try different layouts until you find something
      which divides your investment accounts into logical groups which make
      sense to you.</para>
      </tip>
    </sect2>
  </sect1>

  <sect1 id="invest_int1">
    <title>Interest Bearing Accounts</title>

    <para>Investments which have a fixed or variable rate of interest are one
    of the simplest and most common form of investments available. Interest
    bearing investments include your bank account, a certificate of deposit,
    or any other kind of investment in which you receive interest from the
    principal. This section will describe how to handle these kinds of
    investments in <application>&app;</application>.</para>

    <sect2 id="invest_intacct2">
      <title>Account Setup</title>

      <para>When you purchase the interest bearing investment, you must create
      an asset account to record the purchase of the investment, an income
      account to record earnings from interest, and an expense account to
      record bank charges. Below is an account layout example, in which you
      have an interest bearing savings account and a certificate of deposit at
      your bank.</para>

      <literallayout>
Assets
   Bank ABC
      CD
      Savings
Expenses
   Bank ABC
      Charges
Income
   Interest Income
      CD
      Savings
  </literallayout>

      <para>As usual, this account hierarchy is simply presented as an
      example, you should create your accounts in a form which best matches
      your actual situation.</para>
    </sect2>

    <sect2 id="invest-intex2">
      <title>Example</title>

      <para>Now let&rsquo;s populate these accounts with real numbers. Let&rsquo;s assume
      that you start with $10000 in your bank account, which pays 1% interest
      and you buy a $5000 certificate of deposit with a 6 month maturity date
      and a 2% yield. Clearly, it is much better to keep your money in the CD
      than in the savings account. After the initial purchase, your accounts
      should look something like this:</para>

      <screenshot id="invest-int">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_int1.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_int1.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Interest Investment</phrase>
          </textobject>

          <caption><para>This is an image of the account register after the
          creation and investing in a CD investment. </para></caption>
        </mediaobject>
      </screenshot>

      <para>Now, during the course of the next 6 month, you receive monthly
      bank statements which describe the activity of your account. In our
      fictional example, we do nothing with the money at this bank, so the
      only activity is income from interest and bank charges. The monthly bank
      charges are $2. After 6 months, the register window for the CD and for the savings 
      account should look like these:</para>

      <screenshot id="invest-int2">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_int2.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_int2.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Interest Investment</phrase>
          </textobject>

          <caption><para>This is an image of the register of the CD account
          after 6 months. </para></caption>
        </mediaobject>
      </screenshot>

      <screenshot id="invest-int2-1">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_int2-1.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_int2-1.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Interest Investment</phrase>
          </textobject>

          <caption><para>This is an image of the register of the Savings account
          after 6 months. </para></caption>
        </mediaobject>
      </screenshot>

      <para>And this is the main <application>&app;</application> account window:</para>

      <screenshot id="invest-int3">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_int3.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_int3.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Interest Investment</phrase>
          </textobject>

          <caption><para>This a screen capture of the accounts after 6 months.
          </para></caption>
        </mediaobject>
      </screenshot>

      <para>From the above image of the main <application>&app;</application> account window you see a
      nice summary of what happened to these investments over the 6 months.
      While the yield on the CD is double that of the savings account, the
      return on the CD was $50.21 versus $13.03 for the savings account, or
      almost 4 times more. Why? Because of the pesky $2 bank charges that hit
      the savings account (which counted for $12 over 6 months).</para>

      <para>After this 6 month period, the CD has reached maturity which means
      you may sell it with no early withdrawal penalty. To do so, simply
      transfer the $5050.21 from the CD account into the savings
      account.</para>
    </sect2>
  </sect1>

  <sect1 id="invest-setup1">
    <title>Setup Investment Portfolio</title>

    <para>Now that you have built an account hierarchy in the previous
    section, this section will show you how to create and populate the accounts with your
    investment portfolio. After this initial setup of your portfolio, you may have
    shares of stock purchased from before you started using <application>&app;</application>. For these stocks,
    follow the instructions in the <link linkend="invest-buy-stock2"><emphasis>Entering
    Preexisting Shares</emphasis></link> section below. If you have just purchased your stocks,
    then use the <link linkend="invest-buy-new2"><emphasis>Buying New Shares</emphasis>
    </link> section.</para>

    <sect2 id="invest-setup-stockaccounts2">
      <title>Setup Accounts for Stocks and Mutual Funds</title>

      <para>This section will show you how to add stocks and mutual fund
      accounts to <application>&app;</application>. In this section, we will assume you are using the
      basic account setup introduced in the previous section, but
      the principles can be applied to any account hierarchy.</para>

      <para>You should have within the top level <guilabel>Asset</guilabel>
      account, a few levels down, an account entitled
      <guilabel>Stock</guilabel>. Open the account tree to this level by
      clicking on the <quote>right facing triangle marker</quote> signs next
      to the account names until the tree is opened to the depth of the new
      account. You will need to create a sub-account (of type
      <emphasis>stock</emphasis>) under the Stock account for every stock you
      own. Every stock is a separate account. The naming of these stock
      accounts is usually done using the stock ticker abbreviation, though account
      names may be anything that is clear to you and other users. So, for
      example, you could name your accounts <emphasis>AMZN</emphasis>,
      <emphasis>IBM</emphasis> and <emphasis>NST</emphasis> for your Amazon,
      IBM and NSTAR stocks respectively. Below is a schematic model of the
      layout (only showing the Assets sub-accounts).</para>

      <literallayout>
 Assets
    Investments
       Brokerage Accounts
          Bond
          Mutual Funds
          Market Index
          Stock
             AMZN
             IBM
             NST
 </literallayout>

      <note>
        <para>If you want to track income (dividends/interest/capital gains)
        on a per-stock or fund basis, you will need to create an
        <emphasis>Income:Dividends:STOCKSYMBOL</emphasis>,
        <emphasis>Income:Cap Gain (Long):STOCKSYMBOL</emphasis>,
        <emphasis>Income:Cap Gain (Short):STOCKSYMBOL</emphasis>
        and <emphasis>Income:Interest:STOCKSYMBOL</emphasis>
        account for each stock you own that pays dividends or interest.</para>
      </note>
    </sect2>

    <sect2 id="invest-setup-example2">
      <title>Example Stock Account</title>

      <para>As an example, let&rsquo;s assume that you currently own 100 shares of
      Amazon stock. First, create the stock account AMZN by selecting the
      <guilabel>Stock</guilabel> account and click on the menu <menuchoice>
      <guimenu>Actions</guimenu><guimenu>New Account...</guimenu></menuchoice>. The New
      Account dialog will appear, follow the steps, in the sequence below to
      setup your new stock account.</para>

      <screenshot id="invest-newaccount">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_newaccount.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_newaccount.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>New Account Window</phrase>
          </textobject>

          <caption><para>New Account Window </para></caption>
        </mediaobject>
      </screenshot>

      <orderedlist>
        <listitem>
          <para><emphasis>Account Name</emphasis> - Usually, use the stock
          ticker abbreviation, IE: <quote>AMZN</quote></para>
        </listitem>

        <listitem>
          <para><emphasis>Account Code</emphasis> - Optional field, use CUSIP,
          the newspaper listing symbol, mutual fund family ID or code of your
          own choosing.</para>
        </listitem>

        <listitem>
          <para><emphasis>Description</emphasis> - Optional field for detailed
          description of the commodity/stock. Note this field by default is
          displayed in the <guilabel>Account</guilabel> tab tree.</para>
        </listitem>

        <listitem>
          <para><emphasis>Account Type</emphasis> - Select the type of account
          you are creating from the lower left-hand list.</para>
        </listitem>

        <listitem>
          <para><emphasis>Parent Account</emphasis> - Select the parent
          account for the new account from the right hand listing. Expand list
          of accounts if necessary.</para>
        </listitem>

        <listitem>
          <para><emphasis>Create the New Security</emphasis> - To use a new
          stock, you must create the stock as a new commodity</para>

          <itemizedlist>
            <listitem>
              <para><emphasis>Select Security/Currency</emphasis> - Click on
              the <guibutton>Select ...</guibutton> button next to the
              <guilabel>security/currency</guilabel> line. We must change the
              security from the default (your default currency) to this
              specific stock. This will bring up the 
              <guilabel>Select Security</guilabel> dialog.</para>
            </listitem>

            <listitem>
              <para><emphasis>Type</emphasis> - Change the
              <guilabel>type</guilabel> from current to the exchange where the
              security/commodity is traded (in this example NASDAQ).</para>

              <para>Select the <guibutton>New</guibutton> button to open the
              <guilabel>New Security</guilabel> window.</para>

              <screenshot id="invest-selectsecurity">
                <mediaobject>
                   <imageobject role="html">
                     <imagedata fileref="figures/invest_selectsecurity.png" format="PNG"
                                srccredit="Cristian Marchi"></imagedata>
                   </imageobject>
                   <imageobject role="fo">
                     <imagedata fileref="figures/invest_selectsecurity.png" format="PNG"
                                srccredit="Cristian Marchi"></imagedata>
                   </imageobject>

                  <textobject>
                    <phrase>Select Security Window</phrase>
                  </textobject>

                  <caption><para>Select Security Window </para></caption>
                </mediaobject>
              </screenshot>
            </listitem>

            <listitem>
              <para><emphasis>Create the Security</emphasis> - Click on the
              <guibutton>New...</guibutton> button and enter the appropriate
              information for this stock on the new form <guilabel>New Security</guilabel>.</para>

              <!--  Open inter most loop (#3)
-->

              <itemizedlist>
                <listitem>
                  <para>The <guilabel>Full name:</guilabel> is
                  <quote>Amazon.com</quote>.</para>
                </listitem>

                <listitem>
                  <para>The <guilabel>Symbol/abbreviation:</guilabel> is
                  <quote>AMZN</quote>. The symbol is the stock ticket used in your
                  quote source several lines down on the form. Note that different
                  symbols will be utilized on different price sources for the same stock,
                  an example is Ericsson on the Stockholm Exchange is ERIC-B while
                  on Yahoo it is ERRICB.ST</para>
                </listitem>

                <listitem>
                  <para>The <guilabel>Type:</guilabel> should already be
                  <guilabel>NASDAQ</guilabel>, because this is what was selected in the security selector, but you can change it here, including adding more categories. More information about this can be found in the Help Manual in section 7.7, <quote>Security Editor</quote>.</para>
                </listitem>

                <listitem>
                  <para>The <guilabel>ISIN, CUSIP or other code</guilabel> is where
                  you can enter some other coding number or text (leave it
                  blank in this example).</para>
                </listitem>

                <listitem>
                  <para>The <guilabel>Fraction traded</guilabel> should be
                  adjusted to the smallest fraction of this security which can
                  be traded, usually 1/100 or 1/10000.</para>
                </listitem>

                <listitem>
                  <para>The checkbox <quote>Get Online Quotes</quote>, the
                  quote source and the timezone should be selected to define
                  the sources for updating prices on-line. See Also
                  <link linkend="invest-stockprice-auto2">
                    <quote>Setting Stock Price Automatically</quote></link>.</para>

		<note>
                  <para>If the <guibutton>Get Online Quotes</guibutton> button is not highlighted, and it
                  is not tickable, then the <application>Finance::Quote</application> package is not installed.
                  See the section on
                   <link linkend="invest-stockprice-auto-install3">
                    <quote>Installing <application>Finance::Quote</application></quote></link>.</para>
		</note>

                  <para>Below is what this window should look like when
                  finished: <screenshot id="invest-newsecurity">
                      <mediaobject>
                        <imageobject role="html">
                          <imagedata fileref="figures/invest_newsecurity.png" format="PNG"
                                     srccredit="Cristian Marchi" width="510px"></imagedata>
                        </imageobject>
                        <imageobject role="fo">
                          <imagedata fileref="figures/invest_newsecurity.png" format="PNG"
                                     srccredit="Cristian Marchi"></imagedata>
                        </imageobject>

                        <textobject>
                          <phrase>New Security Window</phrase>
                        </textobject>

                        <caption><para>New Security Window </para></caption>
                      </mediaobject>
                    </screenshot></para>
                </listitem>

                <listitem>
                  <para><emphasis>Save Security</emphasis> - Click on the
                  <guibutton>OK</guibutton> button to save this new security,
                  this will close the <guilabel>New Security</guilabel> window and
                  return to the <guilabel>New Account</guilabel> window.</para>
                </listitem>
              </itemizedlist>

              <!--  Close inter most loop
-->
            </listitem>

            <!--  Close loop #2
-->
          </itemizedlist>
        </listitem>

        <listitem>
          <para><emphasis>Select the Security</emphasis> - you should now see
          the newly created security available in the pull down menu for
          <guilabel>Security/Currency</guilabel>. Select it (it is probably
          already selected) and click on <guibutton>OK</guibutton>.</para>
        </listitem>

        <listitem>
          <para><emphasis>Smallest Fraction</emphasis> - Specify the smallest
          fraction of the security/commodity that is traded.</para>
        </listitem>

        <listitem>
          <para><emphasis>Notes</emphasis> - Enter any notes or messages
          related to this security/commodity.</para>
        </listitem>

        <listitem>
          <para><emphasis>Tax Related</emphasis> - Go to <menuchoice><guimenu>Edit</guimenu>
          <guimenuitem>Tax Report Options</guimenuitem></menuchoice> to check this box if this 
          account&rsquo;s transactions will relate to Income Taxes.</para>
        </listitem>

        <listitem>
          <para><emphasis>Placeholder</emphasis> - Check box if this account
          is a <quote>Placeholder</quote>, that is it will contain no
          transactions.</para>
        </listitem>

        <listitem>
          <para><emphasis>Finished</emphasis> - You should now have been
          automatically returned to the New Account dialog, with the
          <guilabel>symbol/abbreviation:</guilabel> line set to <quote>AMZN
          (Amazon.com)</quote>. Click on <guibutton>OK</guibutton> to save
          this new stock account.</para>
        </listitem>

        <!--
                    Outer list can now be closed
-->
      </orderedlist>

      <para>You have now created the Amazon stock account, your main account
      should look something like this (notice that there are a few extra
      accounts here, a bank account, and an equity account):</para>

      <screenshot id="invest-setup-current">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_setup_current.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_setup_current.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Current Portfolio</phrase>
          </textobject>

          <caption><para>This image is after the creation of the first stock
          account (AMZN)</para></caption>
        </mediaobject>
      </screenshot>

      <para>Open the account register window for this AMZN stock account
      (double click on it). Here you see the <emphasis
      role="strong">Commodity</emphasis> view. This gives you an overview of
      the transactions in this commodity including the number of units (shares for a stock or mutual fund) bought or sold, the net price per unit, and the total amount.
      Obviously, we have not bought or sold any shares of AMZN yet, so the register should not contain any transactions.</para>
    </sect2>
  </sect1>

  <sect1 id="invest-buy-stock1">
    <title>Buying Shares</title>

    <sect2 id="invest-buy-stock2">
      <title>Entering Preexisting Shares</title>

      <para>To register the initial 100 shares of this stock that you
      purchased previously, on the first transaction line, enter the date of
      the purchase (eg: Jan. 1 2005), a description (eg: Initial Purchase),
      transfer from <emphasis>Equity:Opening Balances</emphasis>, Shares (eg:
      100), and Price (eg: $20). You do not need to fill in the
      <guilabel>Buy</guilabel> column, as it will be calculated for you. This example 
      assumed there was no commission on this transaction to simplify the example. Your
      AMZN Commodity view should now appear like this:</para>

      <screenshot id="invest-setup-portfolio1">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_setup_portfolio1.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_setup_portfolio1.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Current Portfolio</phrase>
          </textobject>

          <caption><para>This image is of the transaction register of the AMZN account
          after the first stock account <quote>purchase</quote>.</para></caption>
        </mediaobject>
      </screenshot>

      <para>Notice that the <guilabel>Balance</guilabel> is in the units of
      the commodity (AMZN shares) not in currency units. Thus, the balance is
      100 (AMZN units) rather than $2000. This is how it should be.</para>
    </sect2>

    <sect2 id="invest-buy-new2">
      <title>Buying New Shares</title>

      <para>The only difference between setting up a new stock purchase
      versus the setup for preexisting stocks as described in the previous
      section is that instead of transferring the money used to purchase the
      stock from the <emphasis>Equity:Opening Balances</emphasis> account, you use your 
      <emphasis>Assets:Bank ABC</emphasis> account.</para>

      <para>Now you will purchase $5000 of IBM stock, with a commission of $100. First 
      step will be to create the stock account for IBM. The existing <emphasis>Expenses:Commissions</emphasis>
      account will be used. If you wish to track commissions to the individual stock
      an additional sub-account would be necessary.</para>

      <para>Now for the transaction, on the first transaction line, enter the date of
      the purchase (eg: Jan. 3 2005), a description (eg: Initial IBM Purchase),
      Shares will be skipped (to be calculated), Price (eg: $96.60), and Buy ($5000).
      You do not need to fill in the <guilabel>Shares</guilabel> column, as it will be
      calculated for you. The next line in the split transaction will be 
      <emphasis>Expenses:Commissions</emphasis> and fill in Buy ($100).
      The third line will be to transfer from <emphasis>Assets:Bank ABC:Savings</emphasis>,
      $5100 to balance the transaction.
      Your IBM Commodity view should now appear like this:</para>

      <screenshot id="invest-setup-portfolio2">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_SetupPortfolio2.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_SetupPortfolio2.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Setup Current Portfolio</phrase>
          </textobject>

          <caption><para>This image is of the transaction register of the IBM account
          after the first stock account <quote>purchase</quote> with a commission.</para>
          </caption>
        </mediaobject>
      </screenshot>

    </sect2>
  </sect1>

  <sect1 id="invest-stockprice1">
    <title>Setting Share Price</title>

    <para>The value of a commodity, such as a stock, must be explicitly set.
    The stock accounts track the quantity of stocks you own, but the value of
    the stock is stored in the <emphasis>Price Editor</emphasis>. The values
    set in the <guilabel>Price Editor</guilabel> can be updated manually or automatically.</para>

    <sect2 id="invest-stockprice-initial2">
      <title>Initial Price Editor Setup</title>

      <para>To use the <guilabel>Price Editor</guilabel> to track a stock value, you must initially
      insert the stock. To do so, open the <guilabel>Price Editor</guilabel>
      (<menuchoice><guimenu>Tools</guimenu><guimenuitem>Price Editor</guimenuitem></menuchoice>) and
      click on <guibutton>Add</guibutton> button. The first time a
      Commodity/Stock is entered this window will be blank except for the
      control buttons on the bottom. Select the appropriate Commodity you want
      to insert into the <guilabel>Price Editor</guilabel>. At this point, you can input the price
      of the commodity manually. There are 6 fields in the New Commodity
      window:</para>

	<variablelist>
	  <varlistentry>
            <term><guilabel>Namespace</guilabel></term>
	    <listitem>
              <para>The exchange market where the security/commodity
              is traded (in this example NASDAQ)</para>
            </listitem>
	  </varlistentry>

	  <varlistentry>
            <term><guilabel>Security</guilabel></term> 
            <listitem>
              <para>The name of the commodity,
              must be chosen from the <guibutton>Select...</guibutton> list</para>
            </listitem>
	  </varlistentry>

	  <varlistentry>
            <term><guilabel>Currency</guilabel></term>
            <listitem>
              <para>The currency in which the
              Price is expressed.</para>
            </listitem>
	  </varlistentry>

	  <varlistentry>
            <term><guilabel>Date</guilabel></term>
            <listitem>
              <para>Date that the price is
              valid</para>
            </listitem>
	  </varlistentry>

	  <varlistentry>
            <term><guilabel>Type</guilabel></term>
            <listitem>
              <para>One of: <guilabel>Bid</guilabel>
              (the market buying price), <guilabel>Ask</guilabel> (the market
              selling price), <guilabel>Last</guilabel> (the last transaction
              price), <guilabel>Net Asset Value</guilabel> (mutual fund price per
              share), or <guilabel>Unknown</guilabel>. Stocks and currencies will
              usually give their quotes as one of bid, ask or last. Mutual funds
              are often given as net asset value. For other commodities, simply
              choose <guilabel>Unknown</guilabel>. This option is for informational purposes only, it
              is not used by <application>&app;</application>.</para>
            </listitem>
	  </varlistentry>

	  <varlistentry>
            <term><guilabel>Price</guilabel></term>
            <listitem>
              <para>The price of one unit of this
              commodity.</para>
            </listitem>
	  </varlistentry>
	</variablelist>

      <para>As an example of adding the AMZN commodity to the price editor,
      with an initial value of $40.50 per share.</para>

      <screenshot id="invest-peditor">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_peditor.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_peditor.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Price Editor</phrase>
          </textobject>

          <caption><para>Adding the AMZN commodity to the price editor, with
          an initial value of $40.50 per share.</para></caption>
        </mediaobject>
      </screenshot>

      <para>Click <guibutton>OK</guibutton> when finished. Once you have
      performed this initial placement of the commodity into the <guilabel>Price Editor</guilabel>,
      you will not have to do it again, even if you use the same commodity in
      another account.</para>

      <note>
        <para>If you have online retrieval of quotes activated (see <xref
        linkend="invest-stockprice-auto2"></xref>), you can initialize a
        commodity without manually making an entry. When you initially add
        the security in the <guilabel>Security Editor</guilabel>, check
        <guibutton>Get Online Quotes</guibutton> and save the security.
        Then, in the <guilabel>Price Editor</guilabel>, click
        <guibutton>Get Quotes</guibutton>, and the new security will be
        inserted into the price list with the retrieved price.</para>
      </note>
    </sect2>

    <sect2 id="invest-stockprice-manual2">
      <title>Setting Stock Price Manually</title>

      <para>If the value of the commodity (stock) changes, you can adjust the
      value by entering the <guilabel>Price Editor</guilabel>, selecting the commodity, clicking on
      <guibutton>Edit</guibutton> and entering the new price.</para>

      <screenshot id="invest-peditor2">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_peditor2.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_peditor2.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Price Editor</phrase>
          </textobject>

          <caption><para>The main price editor window, showing the list of all
          known commodities.</para></caption>
        </mediaobject>
      </screenshot>
    </sect2>

    <sect2 id="invest-stockprice-auto2">
      <title>Configuring for Automatic Retrieval of Quotes</title>

      <para>If you have more than a couple of commodities, you will tire of
      having to update their prices constantly. <application>&app;</application> has the ability to
      automatically download the most recent price for your commodities using
      the Internet. This is accomplished through the <application>Perl</application> module
      <application>Finance::Quote</application>, which must be installed in order to activate this
      feature.</para>

      <para>To determine if the <application>Perl</application> module <application>Finance::Quote</application> is already
      installed on your system, type <command>perldoc Finance::Quote</command> in
      a terminal window and check to see if there is any documentation
      available. If you see the documentation, then the module is installed,
      if you do not see the documentation, then it has not been
      installed.</para>

      <sect3 id="invest-stockprice-auto-install3">
        <title>Installing <application>Finance::Quote</application></title>
	<para><emphasis role="strong">Microsoft Windows:</emphasis>
	<itemizedlist>
	  <listitem>
            <para>Close <application>&app;</application>.</para>
          </listitem>
	  <listitem>
            <para>You need to have installed <ulink 
            url="http://www.activestate.com/store/activeperl">ActivePerl</ulink>
            </para> 
          </listitem>
	  <listitem>
            <para>Run <emphasis role="strong">Install Online Price
	    Retrieval</emphasis> in the <application>&app;</application>
	    <quote>Start</quote> menu entry.</para>
          </listitem>
	</itemizedlist>
        </para>

	<para><emphasis role="strong">Mac OS X:</emphasis> You need to
	have XCode installed. XCode is an optional item from your OS X
	distribution DVD. Run the <emphasis role="strong">Update
	Finance Quote</emphasis> app in the
	<application>&app;</application> dmg. You can run it from the
	dmg or copy it to the same folder to which you copied
	<application>&app;</application>. It will open a Terminal
	window and run a script for you which will ask lots of
	questions. Accept the default for each unless you know what
	you&rsquo;re doing.</para>
        
        <para><emphasis role="strong">Linux:</emphasis> 
	<itemizedlist>
	  <listitem>
            <para>Close any running <application>&app;</application> instances.</para>
          </listitem>
	  <listitem>
            <para>Locate the folder where <application>&app;</application> 
            is installed by searching for <application>gnc-fq-update</application></para>
          </listitem>
	  <listitem>
            <para>Change to that directory, open a root shell</para>
          </listitem>
	  <listitem>
            <para>Run the command <command>gnc-fq-update</command></para>
          </listitem>
	</itemizedlist>

	This will launch a <application>Perl</application> CPAN update session that will go out
	onto the internet and install the <application>Finance::Quote</application> module on
	your system. The gnc-fq-update program is interactive,
	however, with most systems you should be able to answer
	<quote>no</quote> to the first question: <quote>Are you ready
	for manual configuration? [yes]</quote> and the update will
	continue automatically from that point.</para>

        <para>After installation is complete, you should run the <quote>gnc-fq-dump</quote>
        test program, in the same directory, distributed with <application>&app;</application> to test
        if <application>Finance::Quote</application> is installed and working properly.</para>

        <note>
          <para>If you feel uncomfortable about performing any of these steps,
          please either email the <application>&app;</application>-user mailing list
          (<email>gnucash-user@gnucash.org</email>) for help or come to the <application>&app;</application> IRC
          channel on irc.gnome.org. You can also leave out this step and
          manually update your stock prices.</para>
        </note>
      </sect3>

      <sect3 id="invest-stockprice-auto-configure3">
        <title>Configuring Securities for Online Quotes</title>

        <para>With <application>Finance::Quote</application> installed and functioning correctly, you
        must configure your <application>&app;</application> securities to use this feature to
        obtain updated price information automatically. Whether creating new securities or modifying securities
        that have already been setup, use the <menuchoice><guimenu>Tools</guimenu><guimenuitem>Security Editor</guimenuitem>
        </menuchoice>, to edit the
        security and check the <guilabel>Get Online Quotes</guilabel> box. You will
        now be able to modify the radio buttons for <guilabel>Type of quote source</guilabel>, the pull-down menus 
        to specify the specific source(s) and <guilabel>The timezone for these
        quotes</guilabel>. When finished editing, <guilabel>Close</guilabel> the Security Editor to return to
        the <guilabel>Price Editor</guilabel> and click on the <guibutton>Get Quotes</guibutton>
        button to update your stock prices on the Internet.</para>

        <para>The command <command>gnucash --add-price-quotes $HOME/gnucash-filename</command>
        can be used to fetch the current prices of your stocks.  The file specified
        <filename class="directory">$HOME/gnucash-filename</filename> will depend on the name and location of your
        data file.
        This can be determined by the name displayed in the top frame of the <application>&app;</application> window,
        before the <quote>-</quote>.  The file name can also be found under <guimenu>File</guimenu>
        in the recently opened file list; the first item, numbered 1, is the name of the currently
        open file.</para>

        <para>This can be automated by creating a <application>crontab</application> entry. For example,
        to update your file every Friday evening (16:00) after the relevant exchange
        markets close (modify the time accordingly for your time zone), you could add
        the following to your personal <application>crontab</application>:</para>

        <para>0 16 * * 5 gnucash --add-price-quotes $HOME/gnucash-filename &gt;
        /dev/null 2&gt;&amp;1</para>

        <para>Remember that Mutual Fund <quote>prices</quote> are really <quote>Net Asset
        Value</quote> and require several hours after the exchange closes before being
        available. If <acronym>NAV</acronym>s are downloaded before the current days <acronym>NAV</acronym>s are
        determined, yesterday&rsquo;s <acronym>NAV</acronym>s are retrieved.</para>
      </sect3>
    </sect2>

    <sect2 id="invest-stockprice-view2">
      <title>Displaying Share Value</title>

      <para>The main account window, by default, only shows the quantity of
      each commodity that you own, under the column heading
      <guilabel>Total</guilabel>. In the case of stocks, this commodity is the
      number of shares. Often, however, you will want to see the value of your
      stocks expressed in terms of some monetary unit. This is easily
      accomplished by entering the main window, selecting the <guilabel>Accounts</guilabel> tab,
      by clicking on the <emphasis>Titlebar</emphasis> <guibutton>Options</guibutton> button (the small
      down pointing arrow on the right side of the main account window titles bar), and
      selecting the option to display the account total field <quote>Total
      (USD)</quote>. You will see a new column in the main window entitled
      <guilabel>Total (USD)</guilabel> that will express the value of all
      commodities in the report currency.</para>

      <screenshot id="invest-stockvalue">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_stockvalue.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_stockvalue.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Viewing Stock Value</phrase>
          </textobject>

          <caption><para>Viewing the value of a stock commodity in the main
          window using the Total in Report Currency option.</para></caption>
        </mediaobject>
      </screenshot>
    </sect2>

    <sect2 id="invest-stockprice-report">
      <title>Selecting <quote>Price Source</quote> in Stock Value Reports</title>

      <para>Most <application>&app;</application> Asset reports have options to set/modify a number of parameters for the report.  The
       Options windows is displayed by selecting the report tab then clicking on either the <guibutton>Options</guibutton>
       icon in the <emphasis>Menubar</emphasis> or selecting <menuchoice><guimenu>Edit</guimenu><guimenuitem>Report Options</guimenuitem></menuchoice>.  
       The <guilabel>General</guilabel> tab in the
       resulting window contains various parameters for the report.  One of these is <quote>Price Source</quote> which of offers
       three alternatives to determine stock prices in reports:</para>
       <note>
         <para>In the example below, the report is a customization of
         the <emphasis role="strong">Average Balance</emphasis> report
         in the Assets &amp; Liabilities reports submenu.</para>
       </note>
      <screenshot id="invest-stockvalue-report-options">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_stockvalue_report_options.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>Determining Stock Price Source in Reports</phrase>
          </textobject>

          <caption><para>Determining the value of a stock commodity in a
          report by setting the Price Source option.</para></caption>
        </mediaobject>
      </screenshot>

      <itemizedlist>
        <listitem>
          <para><guilabel>Weighted Average</guilabel> - gives you a graph of
          the weighted price of all <emphasis>transactions</emphasis>. It will
          <emphasis>not</emphasis> take into account prices defined in the
          price editor.</para>
        </listitem>

        <listitem>
          <para><guilabel>Most recent</guilabel> - displays the changing value
          of your stocks based solely on <emphasis>the most recent</emphasis>
          price available from the price editor. The price figuring in your
          stock transactions is <emphasis>not</emphasis> considered.</para>
        </listitem>

        <listitem>
          <para><guilabel>Nearest in time</guilabel> - the graph is
          exclusively based on the prices available from the price editor. The
          value of your stock at each step and point in time is calculated
          based on the nearest available price in the price editor.</para>
        </listitem>
      </itemizedlist>

      <screenshot id="invest-stockvalue-report">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_stockvalue_report.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>An Asset Barchart Report based on the <guilabel>Nearest in
            time</guilabel> Price Source.</phrase>
          </textobject>

          <caption><para>Tracking what value your stocks would&rsquo;ve had on the
          stock exchanges.</para></caption>
        </mediaobject>
      </screenshot>
    </sect2>
  </sect1>

  <sect1 id="invest-sell1">
    <title>Selling Shares</title>

    <para>Entering an investment you are selling is done in the same way as
    buying one (see <xref linkend="invest-buy-new2" />) except the total cost 
    of the transaction is entered in the
    <emphasis>Sell</emphasis> column and the <emphasis>Shares</emphasis>
    column is entered as a negative amount. The net proceeds from the sale
    should be transferred from the stock account to your bank or brokerage
    account.</para>

    <para>The proper recording of the stock sale *must* be done using a split
    transaction. In the split transaction, you must account for the profit (or
    loss) as coming from an <emphasis>Income:Capital Gains</emphasis> account 
    (or <emphasis>Expenses:Capital Loss</emphasis>). To balance this income,
    you will need to enter the stock asset
    twice in the split. Once to record the actual sale (using the correct
    number of shares and correct price per share) and once to balance the
    income profit (setting the number of shares to 0 and price per share to
    0).</para>

    <note>
      <para>In order to get <application>&app;</application> to commit this
      zero-share, zero-price split to the transaction, you *must* 
      <keycap>Tab</keycap> out of the split. If you use the 
      <keycap function="enter">Enter</keycap> key, <application>&app;</application>
      will convert the split into shares of the commodity.</para>
    </note>

    <para>In the split transaction scheme presented below, the symbol
    NUM_SHARES is the number of shares you are selling, SELL_PRICE is the
    price for which you sold the shares, GROSS_SALE is the total price for
    which you sold shares, equal to NUM_SHARES*SELL_PRICE. PROFIT is the
    amount of money you made on the sale. COMMISSIONS are the brokerage
    commissions. NET_SALE is the net amount of money received from the sale,
    equal to GROSS_SALE - COMMISSIONS.</para>

    <table>
      <title>Selling Stock using Split Transaction Scheme</title>

      <tgroup cols="5">
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="2*"/>
        <tbody>
          <row>
            <entry><emphasis>Account</emphasis></entry>

            <entry><emphasis>Number of Shares</emphasis></entry>

            <entry><emphasis>Share Price</emphasis></entry>

            <entry><emphasis>Total Buy</emphasis></entry>

            <entry><emphasis>Total Sell</emphasis></entry>
          </row>

          <row>
            <entry>Assets:Bank ABC</entry>

            <entry></entry>

            <entry></entry>

            <entry>NET_SALE</entry>

            <entry></entry>
          </row>

          <row>
            <entry>Assets:Stock:SYMBOL</entry>

            <entry>0</entry>

            <entry>0</entry>

            <entry>PROFIT</entry>

            <entry>(Loss)</entry>
          </row>

          <row>
            <entry>Expenses:Commissions</entry>

            <entry></entry>

            <entry></entry>

            <entry>COMMISSION</entry>

            <entry></entry>
          </row>

          <row>
            <entry>Assets:Stock:SYMBOL</entry>

            <entry>-NUM_SHARES</entry>

            <entry>SELL_PRICE</entry>

            <entry></entry>

            <entry>GROSS_SALE</entry>
          </row>

          <row>
            <entry>Income:Capital Gains</entry>

            <entry></entry>

            <entry></entry>

            <entry>(Loss)</entry>

            <entry>PROFIT</entry>
          </row>

        </tbody>
      </tgroup>
    </table>

    <para>If you will be recording the sale of the stock as a capital gain (or
    loss), please see <xref linkend="chapter_capgain" /> and <xref linkend="chapter_dep" />
    for more information on this topic.</para>

    <sect2 id="invest-sellexample2">
      <title>Example - Sale of stock with profit</title>

      <para>As an example we will use the AMZN account created in the previous section.
      So you bought 100 shares of AMZN for $20 per
      share, then later sell them all for $36 per share with a commission of $75. In the split
      transaction scheme above, PRICEBUY is $20 (the original buying price),
      NUM_SHARES is 100, TOTALBUY is $2000 (the original buying cost),
      GROSS_SALE is $3600, and finally PROFIT is $1525
      (GROSS_SALE-TOTALBUY-COMMISSION).</para>

      <table>
        <title>Selling Stock Split Transaction Scheme</title>

        <?dbfo table-width="70%" ?>

        <tgroup cols="5">
		<colspec colnum="1" colwidth="4*"/>
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="1*"/>
		<colspec colnum="1" colwidth="1*"/>
          <tbody>
            <row>
              <entry><emphasis>Account</emphasis></entry>

              <entry><emphasis>Shares</emphasis></entry>

              <entry><emphasis>Price</emphasis></entry>

              <entry><emphasis>Buy</emphasis></entry>

              <entry><emphasis>Sell</emphasis></entry>
            </row>

            <row>
              <entry>Assets:Bank ABC</entry>

              <entry></entry>

              <entry></entry>

              <entry>3525.00</entry>

              <entry></entry>
            </row>

            <row>
              <entry>Assets:Brokerage Account:Stock:AMZN</entry>

              <entry>0</entry>

              <entry>0</entry>

              <entry>1600.00</entry>

              <entry></entry>
            </row>

            <row>
              <entry>Expenses:Commissions</entry>

              <entry></entry>

              <entry></entry>

              <entry>75.00</entry>

              <entry></entry>
            </row>

            <row>
              <entry>Assets:Brokerage Account:Stock:AMZN</entry>

              <entry>-100</entry>

              <entry>36.00</entry>

              <entry></entry>

              <entry>3600.00</entry>
            </row>

            <row>
              <entry>Income:Cap Gain (Long):AMZN</entry>

              <entry></entry>

              <entry></entry>

              <entry></entry>

              <entry>1600.00</entry>
            </row>
          </tbody>
        </tgroup>
      </table>

      <screenshot id="invest-sellstock">
        <mediaobject>
           <imageobject role="html">
             <imagedata fileref="figures/invest_sellstock.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_sellstock.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Selling Stock Example</phrase>
          </textobject>

          <caption><para>An example of selling stock for gain. You bought 100
          shares of AMZN for $20 per share, and sold for $36.</para></caption>
        </mediaobject>
      </screenshot>

      <screenshot id="invest-sellstock2">
        <mediaobject>
          <imageobject role="html">
             <imagedata fileref="figures/invest_sellstock2.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_sellstock2.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Selling Stock Example</phrase>
          </textobject>

          <caption><para>An image of the account tree after the example of
          selling stock for gain. </para></caption>
        </mediaobject>
      </screenshot>
    </sect2>

    <sect2 id="invest-sellexampleloss">
      <title>Example - Sale of stock with loss</title>

      <para>As an example we will use the IBM account created in the previous section.
      You then have bought 51.7598 shares of IBM for $96.6001
      per share, then later sell them all for $90 per share. In the split
      transaction scheme below, PRICEBUY is $96.6001 (the original buying price),
      NUM_SHARES is 51.7598, TOTAL_BUY is $5,000 (the original buying price),
      (Loss) is $341.62, and finally GROSS_SALE is $4658.38. Assume the commission
      was $100.00.</para>

      <table>
        <title>Selling Shares at loss Split Transaction Scheme</title>

        <?dbfo table-width="70%" ?>

        <tgroup cols="5">
		<colspec colnum="1" colwidth="4*"/>
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="2*"/>
		<colspec colnum="1" colwidth="1*"/>
		<colspec colnum="1" colwidth="1*"/>
          <tbody>
            <row>
              <entry><emphasis>Account</emphasis></entry>

              <entry><emphasis>Shares</emphasis></entry>

              <entry><emphasis>Price</emphasis></entry>

              <entry><emphasis>Buy</emphasis></entry>

              <entry><emphasis>Sell</emphasis></entry>
            </row>

            <row>
              <entry>Assets:Bank ABC</entry>

              <entry></entry>

              <entry></entry>

              <entry>4558.38</entry>

              <entry></entry>
            </row>

            <row>
              <entry>Assets:Brokerage Account:Stock:IBM</entry>

              <entry>0</entry>

              <entry>0</entry>

              <entry></entry>

              <entry>341.62</entry>
            </row>

            <row>
              <entry>Expenses:Commissions</entry>

              <entry></entry>

              <entry></entry>

              <entry>100</entry>

              <entry></entry>
            </row>

            <row>
              <entry>Assets:Brokerage Account:Stock:IBM</entry>

              <entry>-51.7598</entry>

              <entry>90.00</entry>

              <entry></entry>

              <entry>4658.38</entry>
            </row>

            <row>
              <entry>Income:Cap Gain (Long):IBM</entry>

              <entry></entry>

              <entry></entry>

              <entry>341.62</entry>

              <entry>0</entry>
            </row>

          </tbody>
        </tgroup>
      </table>

      <note>	
      <para>You may either enter the loss as a positive number in the
      <quote>buy</quote> column or as a negative number in the <quote>sell</quote>
      column, <application>&app;</application> will move the <quote>negative profit</quote>
      to the other column.</para>
      </note>

      <screenshot id="invest-sellstockLoss">
        <mediaobject>
          <imageobject role="html">
             <imagedata fileref="figures/invest_sellstockLoss.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_sellstockLoss.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Selling Stock at loss Example</phrase>
          </textobject>

          <caption><para>Above is a screenshot of the example of selling
          stock. You bought $5000 worth of IBM shares with a stock value of
	  $96.6001, and sold for $90.</para></caption>
        </mediaobject>
      </screenshot>

      <screenshot id="invest-sellstockLoss2">
        <mediaobject>
          <imageobject role="html">
             <imagedata fileref="figures/invest_sellstockLoss2.png" format="PNG"
                        srccredit="Cristian Marchi" width="510px"></imagedata>
           </imageobject>
           <imageobject role="fo">
             <imagedata fileref="figures/invest_sellstockLoss2.png" format="PNG"
                        srccredit="Cristian Marchi"></imagedata>
           </imageobject>

          <textobject>
            <phrase>Selling Stock at loss Example</phrase>
          </textobject>

          <caption><para>An image of the account tree after the example of
          selling stock for loss. </para></caption>
        </mediaobject>
      </screenshot>
    </sect2>
  </sect1>

  <sect1 id="invest-dividends1">
    <title>Dividends</title>

    <para>Some companies or mutual funds pay periodic dividends to
    shareholders. Dividends are typically given in one of two ways, either
    they are automatically reinvested into the commodity or they are given as
    cash. Mutual funds are often setup to automatically reinvest the dividend,
    while common stock dividends usually pay cash.</para>

      <sect2 id="invest-dividendcash">
        <title>Dividends in Cash</title>

      <para>If the dividend is presented as cash, you should record the
      transaction directly in the asset account that received the money, as
      income from <emphasis>Income:Dividends</emphasis> with a note mentioning from which
      commodity it was derived. There is no simple way to show this transaction
      from within the stock or mutual fund account itself.</para>

      <para>As an example consider the following; a purchase of IBM stock with the dividends
      deposited as cash into the <emphasis>Broker</emphasis> Account.</para>

      <screenshot id="invest-dividendcash1">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_dividendcash.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>Example of cash dividend transactions</phrase>
          </textobject>

          <caption><para>An image of the <emphasis>Brokerage</emphasis> Account register after a series of cash
          dividends. </para></caption>
        </mediaobject>
      </screenshot>

    <note>
      <para>If you want to track dividends on a per-stock basis, you would
      need to create an <emphasis>Income:Dividends:STOCKSYMBOL</emphasis> account for each stock
      you own that pays dividends.</para>
    </note>

    </sect2>

    <sect2 id="invest-dividendreinvest">
      <title>Dividends Re-Invested</title>

      <para>If you receive the dividend in the form of an automatic
      reinvestment, the transaction for this should be handled within
      the stock or mutual fund account as income from <quote>Income:Dividend</quote> for the
      appropriate number of reinvested shares.  This type of reinvest account is often referred
      to as a DRIP (Dividend Re-Investment Program).</para>

      <para>As an example consider the following; purchase of NSTAR (NST) stock with the
      dividends reinvested into a DRIP Account.  Mutual fund re-investments would be the same.
      </para>

      <para>Starting with the purchase of 100 shares on Jan. 3, 2005, all dividends will be
      reinvested and an account is created to track the dividend to the specific stock.  <application>&app;</application>
      simplifies the entry by allowing calculations within the cells of the transaction.  If the
      first dividend is $.29/share, enter $53.38 in the share price and 100*.29 in the Buy cell.
      </para>

      <screenshot id="invest-dividendreinvest1">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_dividendreinvest1.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>Example of dividend reinvestment transactions</phrase>
          </textobject>

          <caption><para>An image of the Stock Account register after a series of
          dividends reinvestment. </para></caption>
        </mediaobject>
      </screenshot>

      <screenshot id="invest-dividendreinvest2">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_dividendreinvest2.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>Example of dividend reinvestment transactions</phrase>
          </textobject>

          <caption><para>An image of the Accounts tree after a series of
          dividends reinvestment. </para></caption>
        </mediaobject>
      </screenshot>

    </sect2>

  </sect1>

<!--  Stock Splits - Simple

-->

  <sect1 id="invest-splitsnmergers1">
    <title>Splits and Mergers</title>

    <para>Companies may split their stock for many reasons but the most common
    is that the price has risen higher than management thinks is a reasonable price for
    many investors. Some of these splits are simple exchanges (eg 2 for 1 or 3 for 2)
    and some are complex exchanges with cash distributions.  Splits may also result in
    fewer shares if the exchange rate is a reverse split (1 for 3 or .75 for 1).

    </para>

      <sect2 id="invest-simplesplit">
        <title>Simple Stock Split</title>

      <para>As an example, our holding of NST stock declared a 2 for 1 stock split effective
      June 6, 2005.  The process for entering this transaction is; select 
      <menuchoice><guimenu>Actions</guimenu><guimenuitem>Stock Split</guimenuitem></menuchoice> to start
      the assistant.</para>

      <screenshot id="invest-split1">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_split1.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>An image of the stock split assistant at step 1. </phrase>
          </textobject>

          <caption><para>An image of the selection of the stock split assistant. </para></caption>
        </mediaobject>
      </screenshot>

      <para>The first screen is an Introduction, select <guibutton>Forward</guibutton> to
      display the selection of the account and stock for the split.  You will need to
      create an entry for each <emphasis>Account:Stock</emphasis> combination you hold.</para>

      <screenshot id="invest-split2">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_split2.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>An image of the stock split assistant at step 2 - Selection of Account/Stock.
            </phrase>
          </textobject>

          <caption><para>An image of the stock split assistant at step 2 - Selection of
           Account/Stock.</para></caption>
        </mediaobject>
      </screenshot>


      <para>Select the <emphasis>Assets:Investments:DRIPs:NST</emphasis> and click on
      <guibutton>Forward</guibutton>.</para>

      <para>The next screen presents 5 fields in the Stock Splits Details window:</para>

      <itemizedlist>
        <listitem>
          <para><guilabel>Date</guilabel> - Enter the date of the split.</para>
        </listitem>

        <listitem>
          <para><guilabel>Shares</guilabel> -  The number of shares increased (or decreased)
          in the transaction.</para>
          <para>In our example it is a 2 for 1 split so the number of additional shares
          is the number of shares currently in the register.</para>
        </listitem>

        <listitem>
          <para><guilabel>Description</guilabel> - The Description should give a brief
          explanation of the transaction.</para>
        </listitem>

        <listitem>
          <para><guilabel>New Price</guilabel> - If desired the new price of the stock,
          after the split, may be entered.</para>
        </listitem>

        <listitem>
          <para><guilabel>Currency</guilabel> - The currency of the transaction
          is required.  This should be the same as the stock purchase currency.</para>
        </listitem>

      </itemizedlist>
            
      <para>Click on the <guibutton>Forward</guibutton> button.</para>

      <screenshot id="invest-split3">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_split3.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>An image of the stock split assistant at step 3 - Split Details. </phrase>
          </textobject>

          <caption><para>An image of the stock split assistant at step 3 - Split Details. </para>
          </caption>
        </mediaobject>
      </screenshot>


      <para>The next screen will be skipped in this example as there was no
      <quote>Cash in Lieu</quote>.
      </para>

      <screenshot id="invest-split4">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_split4.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>An image of the stock split assistant at step 4 - Cash in Lieu. </phrase>
          </textobject>

          <caption><para>An image of the stock split assistant at step 4 - Cash in Lieu. </para>
          </caption>
        </mediaobject>
      </screenshot>

      <para>A final <guilabel>Finish</guilabel> screen will give a last option to;
       <guibutton>Cancel</guibutton>, <guibutton>Back</guibutton> to modify any data entered or
       <guibutton>Apply</guibutton> to complete the stock split with the data entered. </para>

      <screenshot id="invest-simplesplit1">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_simplesplit1.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>Example of simple stock split transaction in the stock&rsquo;s register</phrase>
          </textobject>

          <caption><para>An image of the <emphasis>Assets:Investments:DRIPs:NST</emphasis>
          register after a simple stock split transaction. </para></caption>
        </mediaobject>
      </screenshot>

    </sect2>

<!--  Moderately Complex Stock Merger

-->

      <sect2 id="invest-merger1">
        <title>Moderately Complex Stock Merger</title>

      <para>As an example, assume you held AT&amp;T stock during the Nov. 18, 2005 merger of SBC
      with AT&amp;T. For this example you will have purchased AT&amp;T on April 1, 2005, any
      dividends will have been paid in cash, therefore not entered into the AT&amp;T
      stock register. </para>

      <para> The conditions of the merger were .77942 share of SBC stock were exchanged for
      each share of AT&amp;T stock.  The merged company continued to use the symbol
      <quote>T</quote> from AT&amp;T.</para>

      <para>AT&amp;T paid a <quote>dividend</quote> of $1.20/share on the transaction date,
      however this will not appear in the stock account as it was a cash distribution.</para>

      <para>The process for entering this transaction is identical to the simple split until
      the <quote>Details</quote> screen.  You will need to create an split entry in each
      <emphasis>Investment Account:Stock</emphasis> account combination that has shares
      splitting.</para>

      <screenshot id="invest-merge2">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_merge2.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>An image of the stock split assistant at step 2. </phrase>
          </textobject>

          <caption><para>An image of the stock split assistant at step 2 - Selection of
           Account/Stock (<emphasis>Investment Account:T</emphasis>).</para></caption>
        </mediaobject>
      </screenshot>


      <para>Select the <emphasis>Assets:Investments:Brokerage Account:Stock:T</emphasis> and click on
      <guibutton>Forward</guibutton>.</para>

      <para>The next screen presents 5 fields in the Stock Splits Details window:</para>

      <itemizedlist>
        <listitem>
          <para><guilabel>Date</guilabel> - Enter the date of the split.  Here we&rsquo;ll enter
           November 18, 2005.</para>
        </listitem>

        <listitem>
          <para><guilabel>Shares</guilabel> -  The number of shares increased (or decreased)
          in the transaction.</para>
          <para>In our example it is a .77942 for 1 split so the number of shares will
          decrease from the number of shares currently in the register.  You may use <application>&app;</application>&rsquo;s
          ability to preform calculations on an entry form by entering data directly
          (E.g. <quote>(.77942*100)-100</quote>) to calculate the decrease in shares
          from the split.</para>
        </listitem>

        <listitem>
          <para><guilabel>Description</guilabel> - The Description should give a brief
          explanation of the transaction.</para>
        </listitem>

        <listitem>
          <para><guilabel>New Price</guilabel> - If desired the new price of the stock,
          after the split, may be entered.</para>
        </listitem>

        <listitem>
          <para><guilabel>Currency</guilabel> - The currency of the transaction
          is required.  This should be the same as the stock purchase currency.</para>
        </listitem>

      </itemizedlist>
            
      <para>Click on the <guibutton>Forward</guibutton> button.</para>

      <screenshot id="invest-merge3">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_merge3.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>An image of the stock split assistant at step 3. </phrase>
          </textobject>

          <caption><para>An image of the stock split assistant at step 3 - Split Details. </para></caption>
        </mediaobject>
      </screenshot>

      <para>The next screen will be skipped in this example as there was no
      <quote>Cash in Lieu</quote>.
      </para>

      <para>A final <quote>Finish</quote> screen will give a last option to
      <guimenu>Back</guimenu> to modify any data entered or <guimenu>Apply</guimenu>
      to complete the stock split with the data entered. </para>

      <screenshot id="invest-stockmerge1">
        <mediaobject>
          <imageobject>
            <imagedata fileref="figures/invest_stockmerge1.png"
                       format="PNG" srccredit="Dave Herman" ></imagedata>
          </imageobject>

          <textobject>
            <phrase>Example of moderate stock split transaction in the stock&rsquo;s register</phrase>
          </textobject>

          <caption><para>An image of the <emphasis>Investment Account:T</emphasis> register after a
           stock split transaction that decreases the shares. </para></caption>
        </mediaobject>
      </screenshot>

    </sect2>

  </sect1>


<!--  Working Location  !!!!!!!!!!!!
  <sect1 id="invest-todo1">
    <title>To-do</title>

    <para>These are the remaining documentation sections that originally
    appeared in the 1.8.4 documentation which require being written up.</para>

    <itemizedlist>



-->

<!--
      <listitem>
        <para>Recording Stock Splits and Mergers (How-To)</para>
      </listitem>
      <listitem>
        <para>Reconciling with the Brokerage Statement (How-To)</para>
      </listitem>

      <listitem>
        <para>Recording Employee Stock Plans (Discussion)</para>
      </listitem>

      <listitem>
        <para>Stock Options (How-To)</para>
      </listitem>

    </itemizedlist>
  </sect1>
-->
</chapter>
