<!--
      (Do not remove this comment block.)
  Version: 1.0.0
  Last modified: Sep 19th 2015
  Maintainers: 
               Chris Good <chris.good@ozemail.com.au>
  Author:
  		Chris Good <chris.good@ozemail.com.au>
	updated [FirstName LastName] <name@company.com>
  Translators:
               (translators put your name and email here)
-->

<chapter id="chapter_bus_setup">
    <title>Business  Setup</title>
  
    <para>To set up <application>&app;</application> to handle accounts receivable or accounts payable
      for a company, these preliminary steps must be done.
      <itemizedlist>
        <listitem><para>Build an appropriate Account Hierarchy.</para></listitem>
        <listitem><para>Set up Tax Tables.</para></listitem>
        <listitem><para>Register the company in <application>&app;</application>.</para></listitem>
        <listitem><para>Set Business Preferences.</para></listitem>
        <listitem><para>Set up Billing Terms.</para></listitem>
      </itemizedlist>
    </para>

    <sect1 id="bus-setupacct">
      <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 assistant, or you could build one
      manually. To access the prebuilt Business Accounts, start <application>&app;</application> and
      click on <menuchoice><guimenu>File</guimenu><guimenuitem>New File</guimenuitem></menuchoice> 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>To use <application>&app;</application>&rsquo;s integrated accounts
        receivable system, you must first set up an account (usually a
        sub-account under Assets) defined with account type
        <emphasis>A/Receivable</emphasis>. It is within this account that the
        integrated A/R system will place transactions.
      </para>

      <para>To use <application>&app;</application>&rsquo;s integrated accounts
        payable system, you must first set up an account (usually a
        sub-account under Liabilities) defined with account type
        <emphasis>A/Payable</emphasis>. It is within this account that the
        integrated A/P system will place transactions.
      </para>

      <literallayout>
Basic A/R and A/P Account Hierarchy:

-Assets
   -Accounts Receivable
   -Checking
-Expenses
  ...(as required)
-Income
   -Sales
-Liabilities
  -Accounts Payable
  -Tax
      -Tax on Purchases
      -Tax on Sales
  </literallayout>

      <para>You need to add additional accounts to this hierarchy for it to be useful.</para>

      <note>
        <para>You do not need to create an individual A/R account for each
          customer. <application>&app;</application> keeps track of customers internally and provides
          per-customer reports based on the internal tracking. The same applies to A/P and vendors.
        </para>
        
        <para>
          If you deal with customers in more than one currency you will need a separate 
          <emphasis>Accounts Receivable</emphasis> account for each currency.
        </para>

        <para>
          If you deal with vendors in more than one currency you will need a separate 
          <emphasis>Accounts Payable</emphasis> account for each currency.
        </para>
        
        <para>Transactions involving an Accounts Receivable or Accounts Payable account should not be
          added, changed or deleted in any way other than by using
          <itemizedlist>
            <listitem><para>post/unpost bill/invoice/voucher or</para></listitem>
	    <listitem><para>process payment</para></listitem>
	  </itemizedlist>
	</para>
        
      </note>
    </sect1>
     
    <sect1 id="bus-setuptaxtables">
      <title>Tax Tables</title>

      <para>Tax Tables can used to determine the tax for customer invoices (or vendor bills).
      </para>
        
      <para> A tax table can be assigned to an invoice line or bill line.</para>
      
      <para>Set up distinct tax tables for customers and vendors.</para>

      <para> The default invoice line tax table can be assigned to each customer and the default bill 
        line tax table can be assigned to each vendor.
      </para>

      <para>The default tax table for new customers or new vendors can  be specified in the <emphasis>Book Options </emphasis>
        window which can be accessed by
        <menuchoice><guimenu>File</guimenu>
          <guisubmenu>Properties</guisubmenu>
          <guimenuitem>Business tab.</guimenuitem>
        </menuchoice>
      </para>

      <para>Tax Tables are maintained using the <emphasis>Sales Tax Table</emphasis> editor which is accessed via menu 
        <menuchoice><guimenu>Business</guimenu><guimenuitem>Sales Tax Table</guimenuitem></menuchoice>.
      </para>
      
      <figure pgwide="1">
        <title>Tax Tables</title>
        <screenshot id="bus-taxmain">
          <mediaobject>
            <imageobject role="html">
              <imagedata fileref="figures/bus_tax_main.png" format="PNG"
                         srccredit="Chris Good" width="510px" />
            </imageobject>
            <imageobject role="fo">
              <imagedata fileref="figures/bus_tax_main.png" format="PNG"
                        srccredit="Chris Good" />
            </imageobject>

            <textobject>
              <phrase>Sales Tax Tables Editor</phrase>
            </textobject>

          </mediaobject>
        </screenshot>
      </figure>
      
      <figure pgwide="1">
        <title>New Sales Tax Table</title>
        <screenshot id="bus-taxnew">
          <mediaobject>
            <imageobject role="html">
              <imagedata fileref="figures/bus_tax_new.png" format="PNG"
                         srccredit="Chris Good" />
            </imageobject>
            <imageobject role="fo">
              <imagedata fileref="figures/bus_tax_new.png" format="PNG"
                         srccredit="Chris Good" />
            </imageobject>

            <textobject>
              <phrase>New Sales Tax Table</phrase>
            </textobject>

          </mediaobject>
        </screenshot>
      </figure>
      
      <itemizedlist>
        <listitem>
          <para><guilabel>Name</guilabel> This is the tax table name.</para>
        </listitem>
        <listitem>
          <para><guilabel>Type</guilabel> Either <guilabel>Percent %</guilabel>
 or <guilabel>Value $
</guilabel>.</para>
        </listitem>
        <listitem>
          <para><guilabel>Value
</guilabel>This is the percentage or value depending on <guilabel>Type</guilabel>.</para>
        </listitem>
        <listitem>
          <para><guilabel>Account</guilabel> This is the account to which tax will be posted.
            For tax collected from customers, this should probably be a Liability account as it must be payed to the government.
            For tax paid to vendors, if tax laws allow tax paid to vendors to offset tax collected from customers, this should probably
            also be a Liability account (even though it will usually have a debit balance)
            so that the net tax owed to the government can be easily observed.
          </para>
          <para>If you set up Tax on Purchases and Tax on Sales as subaccounts of Liabilities:Tax then the net tax will be rolled up
            and can be seen in the  <application>&app;</application> Accounts tab.
          </para>
          <para><emphasis>If unsure about tax law requirements, get professional advise. </emphasis></para>
        </listitem>
      </itemizedlist>
    </sect1>
    
    <sect1 id="bus-setupcname">
      <title>Company Registration</title>

      <para>After you have built the account structure and defined your tax tables, register the <application>&app;</application>
      file as belonging to your company. To register your company, select the <guilabel>Business</guilabel> tab
      in the <guilabel>Book Options</guilabel> window accessible by selecting 
      <menuchoice><guimenu>File</guimenu><guimenuitem>Properties</guimenuitem>
      </menuchoice>.
      </para>
      
      <figure pgwide="1">
        <title>Company Registration</title>
        <screenshot id="bus-co-reg">
          <mediaobject>
            <imageobject role="html">
              <imagedata fileref="figures/bus_co_reg.png" format="PNG"
                         srccredit="Chris Good" width="510px" />
            </imageobject>
            <imageobject role="fo">
              <imagedata fileref="figures/bus_co_reg.png" format="PNG"
                        srccredit="Chris Good" />
            </imageobject>

            <textobject>
              <phrase>Company Registration</phrase>
            </textobject>

          </mediaobject>
        </screenshot>
      </figure>
      
      <para>Here you can:</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&rsquo;s tax payer id number in the
          <guilabel>Company ID</guilabel> field.</para>
        </listitem>

        <listitem>
          <para>Select default tax tables applicable to your most common
          customers and vendors.</para>
        </listitem>
      </itemizedlist>
      
    </sect1>
    
    <sect1 id="bus_setup_pref">
      <title>Business Preferences</title>
      <para>Set options on the Business tab of the <application>&app;</application> preferences, which is
        accessed via <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice>
    (<menuchoice><guimenu>GnuCash</guimenu><guimenuitem>Preferences</guimenuitem></menuchoice> on MacOS).
        See Help manual chapter 10.3.3 Business Book Options Tab.
      </para>
          
    </sect1>
    
    <sect1 id="bus-setupterms">
      <title>Billing Terms</title>

      <para>Billing Terms can be used to determine the payment due date  and be a
        guide for determining discount for early payment of invoices (or vendor bills).
      </para>

        <note>
        <para>As of <application>&app;</application> 2.6.7, Billing Terms are only 
          partially supported. Date due is calculated using the Billing Terms
          but discount amount is not.
        </para>
        <para>
          Discount for early invoice payment is not implemented. There are 2 ways this may be done, although neither is recommended, and 
          professional advise should be used to confirm that regulations are being complied with:
          <itemizedlist>
            <listitem>
              <para>After creating and posting a payment which pays the invoice in full, manually edit the payment transaction (usually strongly discouraged)
                and split the payment to reduce it by the amount of the discount and a create a compensating split in an income (discount) account.
              </para>
            </listitem>
            
            <listitem>
              <para>Alternatively, after creating and posting a payment for the discounted amount, create a credit note for the discount using a specific negative 
                sales income (discount) account for the transfer account. 
              </para>
            </listitem>
            </itemizedlist>
        </para>
      </note>

      <para>You can specify the billing terms on each invoice/bill.
        Invoice billing terms will default from the customer billing terms.
        Bill billing terms will default from the vendor billing terms.
      </para>
  
      <para>Billing Terms are maintained using the Billing Terms Editor which is accessed via menu 
        <menuchoice><guimenu>Business</guimenu><guimenuitem>Billing Terms Editor</guimenuitem></menuchoice>.
      </para>
      
      <figure pgwide="1">
        <title>Billing Terms Editor</title>
        <screenshot id="bus-termsmain">
          <mediaobject>
            <imageobject role="html">
              <imagedata fileref="figures/bus_terms_main.png" format="PNG"
                         srccredit="Chris Good" width="510px" />
            </imageobject>
            <imageobject role="fo">
              <imagedata fileref="figures/bus_terms_main.png" format="PNG"
                        srccredit="Chris Good" />
            </imageobject>

            <textobject>
              <phrase>Billing Terms Editor</phrase>
            </textobject>

          </mediaobject>
        </screenshot>
      </figure>
      
      <figure pgwide="1">
        <title>New Billing Term</title>
        <screenshot id="bus-termsnew">
          <mediaobject>
            <imageobject role="html">
              <imagedata fileref="figures/bus_terms_new.png" format="PNG"
                         srccredit="Chris Good" />
            </imageobject>
            <imageobject role="fo">
              <imagedata fileref="figures/bus_terms_new.png" format="PNG"
                         srccredit="Chris Good" />
            </imageobject>

            <textobject>
              <phrase>New Billing Term</phrase>
            </textobject>

          </mediaobject>
        </screenshot>
      </figure>
      
      <itemizedlist>
        <listitem>
          <para><guilabel>Name</guilabel> The internal name of the billing term. For some examples of billing term names and descriptions see
             <ulink url="http://wiki.gnucash.org/wiki/Terms" />.
          </para>
        </listitem>
        <listitem>
          <para><guilabel>Description</guilabel> The description of the billing term, printed on invoices</para>
        </listitem>
        <listitem>
          <para>There are 2 types of billing terms, with different information to be entered</para>
          <itemizedlist>
            <listitem>
              <para>Type Days</para>
              <itemizedlist>
                <listitem>
                  <para><guilabel>Due Days</guilabel> The invoice or bill is due to be paid within this number of days after the post date</para>
                </listitem>
                <listitem>
                  <para><guilabel>Discount Days</guilabel> The number of days after the post date during which a discount will
                    be applied for early payment
                  </para>
                </listitem>
                <listitem>
                  <para><guilabel>Discount %</guilabel> The percentage discount applied for early payment</para>
                </listitem>
              </itemizedlist>
            </listitem>
            <listitem>
              <para>Type Proximo</para>
              <itemizedlist>
                <listitem>
                  <para><guilabel>Due Day</guilabel> The day of the month bills are due</para>
                </listitem>
                <listitem>
                  <para><guilabel>Discount Day</guilabel> The last day of the month for the early payment discount</para>
                </listitem>
                <listitem>
                  <para><guilabel>Discount %</guilabel> The discount percentage applied if paid early</para>
                </listitem>
                <listitem>
                  <para><guilabel>Cutoff Day</guilabel> The cutoff day for applying bills to the next month. After the
                    cutoff, bills are applied to the following month. Negative values
                    count backwards from the end of the month.
                  </para>
                </listitem>
              </itemizedlist>
            </listitem>
          </itemizedlist>
        </listitem>  
      </itemizedlist>
    </sect1>
  
</chapter>
