<!--
      (Do not remove this comment block.)
  Originally designed by Carol Champagne.
  Version: 2.0.0
  Last modified: July 9th 2006
  Maintainers: 
               Chris Lyttle <chris@wilddev.net>
  Author:
  		Jon Lapham <lapham@extracta.com.br>
        updated Patrick Schweiger <pks@spiffykitty.com>
  Translators:
               (translators put your name and email here)
-->
 <chapter id="chapter13">
 <title>Accounts Payable</title>
 <para>Accounts Payable (or A/P) refers to the accounting of products or services which a company has bought and needs to pay off.</para>

  <sect1 id="bus-ap-concepts1">
  <title>Basic Concepts</title>
  <para>This chapter focuses on Accounts Payable (or A/P).  A/P refers to the accounting of products or services that your company has bought, for which payment needs to be scheduled.</para>
   </sect1>

  <sect1 id="bus-ap-setup1">
  <title>Initial Setup</title>
  <para>To set up GnuCash to handle accounts payable for a company, two preliminary things must be done.  The first is to build an appropriate Account Hierarchy and the second is to register the company in GnuCash.</para>

  <sect2 id="bus-ap-setupacct2">
  <title>Account Setup</title>

      <para>There are many different ways to set up a business account
      hierarchy. You can start with the Business Accounts setup which is
      available from the New Account Hierarchy druid, or you could build one
      manually. To access the prebuilt Business Accounts, start GnuCash and
      click on <guimenu>File</guimenu> -&gt; <guimenu>New File</guimenu> and
      proceed until you see the list of available accounts, select Business
      Accounts.</para>

      <para>The prebuilt Business Account hierarchy will not meet your needs
      exactly. You will need make adjustments for the hierarchy to function
      well with your particular situation. It should be close enough that it
      is recommended you begin with it.</para>

      <para>Accounts Payable (or A/P) refers to products or services bought by your company for which payment has not yet been sent.  This is represented on the balance sheet as a liability because you will have to pay for them.  To use GnuCash's integrated accounts payable system, you must first setup an account of the <emphasis>A/Payable</emphasis> type.  The <emphasis>A/Payable</emphasis> account is usually a sub-account under Liabilities.  It is within this account that the integrated A/P system places transactions.</para>
  <literallayout>
Basic A/P Account Hierarchy:

-Assets
   -Bank
-Liabilities
   -Accounts Payable
-Expenses
   -AP Expenses
  </literallayout>

 
 <para>You need to add additional asset accounts and real expense accounts to make this hierarchy useful.  The important aspects of this hierarchy are that you need an expense account and an Accounts Payable account, with account type set to <emphasis>A/Payable</emphasis>.</para>
  </sect2>

  <sect2 id="bus-ap-setupcname2">
  <title>Company Registration</title>

      <para>After you have built the account structure, register the GnuCash
      file as belonging to your company. To register your company, select
      <guimenu>File</guimenu> -&gt; <guimenu>Properties</guimenu>:</para>

      <itemizedlist>
        <listitem>
          <para>Enter the name of your company along with contact information
          such as your phone number, fax number, e-mail address and website
          URL.</para>
        </listitem>

        <listitem>
          <para>Enter your company's tax payer id number in the
          <guilabel>Company ID</guilabel> field.</para>
        </listitem>

       </itemizedlist>
  </sect2>
  </sect1>

  <sect1 id="bus-ap-components1">
  <title>System Components</title>
  <para>GnuCash has an integrated accounts payable system.  The transactions generated by the A/P system are placed within the Accounts Payable account, as a record of what occurs.  Generally you do not directly work with this account but use the four integrated GnuCash A/P application components.  The A/P components are available from the<guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> sub-menu.  These A/P components are:</para>

  <itemizedlist>
  <listitem>
  <para><guilabel>Vendors</guilabel> are people or companies from which you buy products or services on credit.</para>
  </listitem>
  <listitem>
  <para><guilabel>Bills</guilabel> represent the physical bills vendors send to request payment from you.  A bill contains an itemized list of things you purchased.</para>
  </listitem>
  <listitem>
  <para><guilabel>Jobs</guilabel> (optional) is where you register Vendor Jobs.  Jobs are mechanism by which you can group multiple bills from a particular vendor.</para>
  </listitem>
  <listitem>
  <para><guilabel>Process Payments</guilabel> is where you register payments to a vendor to whom you owe money.</para>
  </listitem>
  </itemizedlist>

  <para>The following sections introduce the individual Accounts Payable application components.</para>
 </sect1>

  <sect1 id="bus-ap-vendors1">
  <title>Vendors</title>
 <para>A vendor is a company or person from whom you purchase goods or services.  Vendors must be registered within the A/P system.</para>
 
  <sect2 id="bus-ap-vendornew2">
  <title>New</title>
 <para>To register a new vendor, select the <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt; <guimenu>New Vendor</guimenu> menu item.  Fill in general information about the vendor, such as Company Name, Address, Phone, Fax, etc.  Below is a list of the other options: </para>

 <itemizedlist>
 <listitem>
 <para><guilabel>Identification - Vendor Number</guilabel> - can be any number by which you would like to refer to this vendor.  You may leave it blank and a number will be chosen automatically.</para>
 </listitem>
 <listitem>
 <para><guilabel>Identification - Active</guilabel> - differentiates active vendors from inactive ones. This is useful when you have many past vendors, and you want to see only those marked active</para>
 </listitem>
 <listitem>
 <para><guilabel>Payment Address - Name</guilabel> - is the contact name of the person to receive payments you make.</para>
 </listitem>
 <listitem>
 <para><guilabel>Notes</guilabel> - records any additional comments about the vendor.  Use it to track names of contact people within the vendor's company, for example.</para>
 </listitem>
 <listitem>
 <para><guilabel>Payment Information - Currency</guilabel> - specifies the default payment currency.</para>
 </listitem>
 <listitem>
 <para><guilabel>Payment Information - Terms</guilabel> - specifies the default payment terms for this vendor.  Payment terms must be preregistered using <guimenu>Business</guimenu> -&gt; <guimenu>Billing Terms</guimenu>.</para>
 </listitem>

 <listitem>
 <para><guilabel>Payment Information - Tax Included</guilabel> - specifies if tax is included in bills from this vendor.  You can choose <guilabel>Yes</guilabel>, <guilabel>No</guilabel>, or <guilabel>Use Global</guilabel>.
          <itemizedlist>
              <listitem>
                <para><guilabel>Yes</guilabel> means that tax is already
                included in amounts on bills.</para>
              </listitem>

              <listitem>
                <para><guilabel>No</guilabel> means tax is not included.</para>
              </listitem>

              <listitem>
                <para><guilabel>Use Global</guilabel> means to use the setting
                made in the global preferences accessible through
                <guimenu>Edit</guimenu> -&gt;
                <guimenu>Preferences</guimenu>.</para>
              </listitem>
            </itemizedlist></para>
 </listitem>
 <listitem>
 <para><guilabel>Payment Information - Tax Table</guilabel> - specifies a default tax table to apply to bills from this vendor.  Tax tables must be registered using the <guimenu>Business</guimenu> -&gt; <guimenu>Tax Table</guimenu> menu item.</para>
 </listitem>
 </itemizedlist>

  <para>This is what the New Vendor registration window looks like:</para>
	<screenshot id="bus-ap-vendornew">
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="figures/bus_ap_vendornew.png" 
	      srccredit="Patrick Schweiger" format="PNG"/>
            </imageobject>
	    <textobject>
	        <phrase>New Vendor Registration Window</phrase>
	    </textobject>
	    <caption>
	       <para>New Vendor Registration Window
	       </para>
	    </caption>
          </mediaobject>
        </screenshot>

  </sect2>
  <sect2 id="bus-ap-vendorfind2">
  <title>Find and Edit</title>

 <para>To search for an existing vendor, use the <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt; <guimenu>Find Vendor</guimenu> window.  You select a vendor to <guibutton>View/Edit</guibutton> from the results of the search.  This window is also used to look up a vendor when entering bills and processing payments.</para>
	<screenshot id="bus-ar-vendorfind">
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="figures/bus_ap_vendorfind.png" 
	      srccredit="Patrick Schweiger" format="PNG"/>
            </imageobject>
	    <textobject>
	        <phrase>Find Vendor Window</phrase>
	    </textobject>
	    <caption>
	       <para>Find Vendor Window
	       </para>
	    </caption>
          </mediaobject>
        </screenshot>

      <para>If many vendors match the search criteria you provide, the
      search can be refined by running an additional search within the current
      results. The current result set is searched when the <guilabel>Refine
      Current Search</guilabel> radio button is selected. In fact, GnuCash
      selects this option for you after you run the initial search.</para>

      <para>If the vendor you are searching for does not match the supplied
      search criteria, change the search criteria, click the <guilabel>New
      Search</guilabel> radio button and then the <guibutton>Find</guibutton>
      button. The relevant step is the <guilabel>New Search</guilabel>
      selection. If the vendor is not in the result of the original search,
      and you only search within this set, the vendor cannot be found,
      regardless of new search criteria.</para>

 <note>
 <para>To return a list of all registered active vendors, set the search criterion to "matches regex", and place a single dot "." in the text field area.  Make sure <guilabel>Search only active data</guilabel> is checked, then click <guibutton>Find</guibutton>.  The regular expression "." means to match anything.</para>
 </note>

  </sect2>
  </sect1>

  <sect1 id="bus-ap-bills1">
  <title>Bills</title>
 <para>A bill is a request for payment you receive from a vendor.  GnuCash can track bills.</para>
  <sect2 id="bus-ap-billnew2">
  <title>New</title>
 <para>When you receive a bill from a vendor and want to enter it into GnuCash, you must create a new bill.  To create a new bill use the <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt; <guimenu>New Bill</guimenu> menu item, and fill in the resulting window appropriately.</para>
  <itemizedlist>
  <listitem>
  <para><guilabel>Invoice Info - Invoice ID</guilabel> (optional) - the identification number of the invoice as emitted by the vendor (IE: the vendor's internal number for this invoice).</para>
  </listitem>
  <listitem>
  <para><guilabel>Invoice Info - Date Opened</guilabel> - the date the Invoice was emitted by the vendor.</para>
  </listitem>
  <listitem>
  <para><guilabel>Billing Info - Vendor</guilabel> - the issuing vendor.</para>
  </listitem>
  <listitem>
  <para><guilabel>Billing Info - Job</guilabel> (optional) - associates a vendor job with this bill.  Vendor jobs are described in the following section.</para>
  </listitem>
  <listitem>
  <para><guilabel>Billing Info - Billing ID</guilabel> (optional) - the vendor's ID for the bill (e.g.: their invoice #).</para>
  </listitem>
  <listitem>
  <para><guilabel>Billing Info - Terms</guilabel> - the pay back terms agreement for this bill. A list of registered terms is available within the pop up menu.  If you specified a a default value for the selected vendor, this field is initialized with the default.</para>
  </listitem>
  <listitem>
  <para><guilabel>Chargeback Project - Customer</guilabel> (optional) - the customer to associate with this bill.  This is used to charge your customer later.</para>
  </listitem>
  <listitem>
  <para><guilabel>Chargeback Project - Job</guilabel> (optional) - the customer job to associate with this bill.</para>
  </listitem>
  </itemizedlist>

	<screenshot id="bus-ap-billnew">
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="figures/bus_ap_billnew.png" 
	      srccredit="Patrick Schweiger" format="PNG"/>
            </imageobject>
	    <textobject>
	        <phrase>New Bill Registration Window</phrase>
	    </textobject>
	    <caption>
	       <para>New Bill Registration Window
	       </para>
	    </caption>
          </mediaobject>
        </screenshot>


  <para>When you click the <guibutton>OK</guibutton> the <guilabel>Edit Bill</guilabel> opens.</para>
  </sect2>
  <sect2 id="bus-ap-billedit2">
  <title>Edit</title>    
  <para>From the Edit Bill window you can enter an itemized list of things purchased, in a manner similar to how the account register works.</para>  
  	<screenshot id="bus-ap-billedit">
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="figures/bus_ap_billedit.png" 
	      srccredit="Patrick Schweiger" format="PNG"/>
            </imageobject>
	    <textobject>
	        <phrase>Edit Bill Window</phrase>
	    </textobject>
	    <caption>
	       <para>Edit Bill Window</para>
	    </caption>
          </mediaobject>
        </screenshot>

  <para>There are 12 columns in the Invoice Entries area:</para>
  <itemizedlist>
  <listitem>
  <para><guilabel>Date</guilabel> - The date this item was sold.</para>
  </listitem>
  <listitem>
  <para><guilabel>Invoiced?</guilabel> - <guilabel>X</guilabel>  means the item is attached to this invoice, an empty box means the item is not attached to this invoice.  If the box is empty you can attach the item to the invoice by first selecting the item row and then clicking in this box.</para>
  </listitem>
  <listitem>
  <para><guilabel>Description</guilabel> (optional) - is what the item or service is called.</para>
  </listitem>
  <listitem>
  <para><guilabel>Action</guilabel> (optional) - is a user defined field.  You can place Cost Center information here, or use one of the 3 predefined actions, Hours, Material, or Project.</para>
  </listitem>
  <listitem>
  <para><guilabel>Expense Account</guilabel> - selects the expense account to change for this item.</para>
  </listitem>
  <listitem>
  <para><guilabel>Quantity</guilabel> - tracks how many of the items you bought.</para>
  </listitem>
  <listitem>
  <para><guilabel>Unit Price</guilabel> - is the unit price of the item.</para>
  </listitem>
  <listitem>
  <para><guilabel>Taxable?</guilabel> - is this item taxable?  <guilabel>X</guilabel> means yes, a blank field means no. You can click the field to toggle the setting.</para>
  </listitem>
  <listitem>
  <para><guilabel>Tax Included?</guilabel> - has the tax already been included in the unit price?  <guilabel>X</guilabel> means yes, a blank field means no.</para>
  </listitem>
  <listitem>
  <para><guilabel>Tax Table</guilabel> (optional) - this is a pop up menu of all the available tax tables.  If the item is taxable and tax has not been included in the unit price, then this tax table is used to compute the amount of tax.</para>
  </listitem>
  <listitem>
  <para><guilabel>Subtotal</guilabel> (uneditable) - computed subtotal for this item (less tax)</para>
  </listitem>
  <listitem>
  <para><guilabel>Billable</guilabel> - is this item billable to the chargeback customer/job?</para>
  </listitem>
  </itemizedlist>

  <para>When you have finished entering all the items, <guilabel>Post</guilabel> the bill. </para>
  </sect2>

  <sect2 id="bus-ap-billpost2">
  <title>Post</title>
  <para>When you finish editing a bill, you should <guilabel>Post</guilabel> the bill.  You do not have to post the bill, you can close it and return to it later. You have to post the bill eventually.  Posting a bill places its transactions into an accounts payable account.  The Post Bill window appears and asks you to enter information:</para>

  	<screenshot id="bus-ap-billpost">
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="figures/bus_ap_billpost.png" 
	      srccredit="Patrick Schweiger" format="PNG"/>
            </imageobject>
	    <textobject>
	        <phrase>Post Bill Window</phrase>
	    </textobject>
	    <caption>
	       <para>Post Bill Window
	       </para>
	    </caption>
          </mediaobject>
        </screenshot>

  <itemizedlist>
    <listitem>
      <para><guilabel>Post Date</guilabel> - specifies the date for the transactions entered into the accounts payable account.</para>
    </listitem>
    <listitem>
      <para><guilabel>Due Date</guilabel> - is the date on which payment for the bill is expected.</para>
          
          <itemizedlist>
            <listitem>
              <para>If you specified payment terms when you created the bill,
              the date is calculated according to selected terms, and
              the entry field is insensitive.</para>
            </listitem>

            <listitem>
              <para>If you did not specify payment terms, enter the expected
              payment due date here.</para>
            </listitem>
          </itemizedlist>
    </listitem>

    <listitem>
       <para><guilabel>Description</guilabel> - is an arbitrary
       description. When bill transactions are placed in the accounts
       payable account, this description is entered in the memo field of
       those transactions.</para>
    </listitem>

    <listitem>
       <para><guilabel>Post To Account</guilabel> - selects the accounts
        payable account in which bill transactions are posted. You can
        select the account from a list of existing A/Payable
        accounts.</para>
     </listitem>


        <listitem>
          <para><guilabel>Accumulate Splits</guilabel> - determines if bill
          items which transfer to the same account are combined into a single
          split for that account or entered individually. For the sample
          bill for Letterhead and Envelopes, the setting affects post
          results as follows:</para>

          <itemizedlist>
            <listitem>
              <para>Checked (splits are accumulated) - a single transfer of
              $100.00 to the Expenses:Office Supplies account is recorded.</para>
            </listitem>

            <listitem>
              <para>Not checked - the transaction created in the A/Payable
              account, shows two transfers to Expenses:Office Supplies account
              $75.00 and $25.00.  The memo fields in the splits indicate the
              purchase of Letterhead and Envelopes (the item descriptions
              entered on the bill) respectively.</para>
            </listitem>
          </itemizedlist>
        </listitem>
  </itemizedlist>
  </sect2>

  <sect2 id="bus-ap-billfind2">
  <title>Find</title>
  <para>To find an existing bill, use the <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt; <guimenu>Find Bill</guimenu> application.  From the results of the search, you can select a bill to edit, or view.</para>
  <note>
  <para>Before you can edit a posted bill, you will need to <guilabel>Unpost</guilabel> it.</para>
  </note>

  <note>
  <para>There are other ways to access an existing bill.  These are similar to accessing invoices for your customers.  See the section on finding invoices in the accounts receivable chapter for more information.</para>
  </note>

  </sect2>
  </sect1>

  <sect1 id="bus-ap-jobs1">
  <title>Vendor Jobs</title>
  <para>Vendor Jobs are used to group multiple bills from a single vendor.  Use of the vendor jobs feature is optional.  The feature is useful when you have multiple "jobs" for the same vendor, and would like to view all the bills for a single job.</para>
  <para>To use vendor jobs, you must create them using the <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt; <guimenu>New Job</guimenu> application.  You will see the <guilabel>New Job</guilabel> window.  The editable fields are:</para>


    <itemizedlist>
      <listitem>
        <para><guilabel>Job Info - Job Number</guilabel> (optional) - enter
        the number for this job. If left blank, a number will be chosen for
        you.</para>
      </listitem>

      <listitem>
        <para><guilabel>Job Info - Job Name</guilabel> - the name you want to
        assign to the new job.</para>
      </listitem>

      <listitem>
        <para><guilabel>Owner Info - Vendor</guilabel> - the vendor for
        whom the job is created.</para>
      </listitem>

      <listitem>
        <para><guilabel>Owner Info - Billing ID</guilabel> - the vendor's
        reference to this job (e.g. their PO Number).</para>
      </listitem>

      <listitem>
        <para><guilabel>Job Active</guilabel> - toggles this job being active
        or not. This is useful when you have many inactive jobs, since it is
        easier to search only among jobs that are marked active.</para>
      </listitem>
    </itemizedlist>

  	<screenshot id="bus-ap-jobnew">
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="figures/bus_ap_jobnew.png" 
	      srccredit="Jon Lapham" format="PNG"/>
            </imageobject>
	    <textobject>
	        <phrase>New Vendor Job</phrase>
	    </textobject>
	    <caption>
	       <para>New Vendor Job</para>
	    </caption>
          </mediaobject>
        </screenshot>


    <para>To edit an existing vendor job, use the
    <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt;
    <guimenu>Find Job</guimenu> application. Select the desired job in the
    search results, and click the <guilabel>View/Edit Job</guilabel>
    button.</para>

    <para>To select from the bills associated with a given job, use
    <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt;
    <guimenu>Find Job</guimenu> application. Select the desired job in the
    search results and click the <guilabel>View Invoices</guilabel> button. A
    window listing bills associated with this job appears. Select a
    bill and click the <guilabel>View Invoice</guilabel> button to open a
    bill editor in the main application window.</para>
  </sect1>

  <sect1 id="bus-ap-payment1">
  <title>Process Payment</title>
  <para>Eventually, you need to pay your bills.  To do so, use the Process Payment application found in <guimenu>Business</guimenu> -&gt; <guimenu>Vendor</guimenu> -&gt; <guimenu>Process Payment</guimenu>.</para>
  <para>The Process Payment application consists of:</para>
  <itemizedlist>
  <listitem>
  <para><guilabel>Payment Information - Vendor</guilabel> - the vendor you wish to pay.</para>
  </listitem>
  <listitem>
  <para><guilabel>Payment Information - Bill</guilabel> - the bill you wish to pay.</para>
  </listitem>
  <listitem>
  <para><guilabel>Payment Information - Date</guilabel> - the date you wish to make the payment, normally the current date.</para>
  </listitem>
  <listitem>
  <para><guilabel>Payment Information - Amount</guilabel> - the amount of money to transfer in this payment.</para>
  </listitem>
  <listitem>
  <para><guilabel>Payment Information - Num</guilabel> - the check number.</para>
  </listitem>
  <listitem>
  <para><guilabel>Payment Information - Memo</guilabel> - any comments about this payment.</para>
  </listitem>
  <listitem>
  <para><guilabel>Post To</guilabel> - the A/Payable account to post this transaction.</para>
  </listitem>
  <listitem>
  <para><guilabel>Transfer Account</guilabel> - the account from which money for the payments comes from, such as a checking account.</para>
  </listitem>
  </itemizedlist>
    <para>Below is the GnuCash Accounts Receivable payment window.</para>
  	<screenshot id="bus-ap-payment">
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="figures/bus_ap_payment.png" 
	      srccredit="Patrick Schweiger" format="PNG"/>
            </imageobject>
	    <textobject>
	        <phrase>Process Payment</phrase>
	    </textobject>
	    <caption>
	       <para>Process Payment Window
	       </para>
	    </caption>
          </mediaobject>
        </screenshot>

 </sect1>

 </chapter>
