////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

= Help for Purchase Invoice default account
The Purchase Invoice sub menu is used to specify the default account to be used for the individual line items that appear
 on a Purchase Invoice.

The items are identified by a line description which can be mapped to a specific general ledger account.

Purchase invoices can be made up of a variety of items as well as the product that is being bought
(eg discounts, promotions, work effort or labour costs etc). The majority of businesses will want to track these type of items
separately in the general ledger and this screen will allow this type of setup.

This setup will translate to one side of the journal entry only.

IMPORTANT: This screen is one of the screens where the default entries that are displayed here are entered via
           the Global GL Settings under the sub menu 'Invoice Item Type'.
           This screen allows users to override the global settings for the Purchase Invoice item type. +
           An example of why this could be necessary could be that a company many want to isolate the sales reporting of
           a specific department or business unit separately (eg subledgers etc) but still have the option of a 'catch all'
           global general ledger account.

IMPORTANT: TO CHECK: Need to do more investigation but the it looks like these Purchase Invoice mappings dont work when
           used as part of the Purchase Order to Purchase Invoice Process.
           (Have been doing some tests to try and get it to post to a different account than 'Uninvoiced Shipment Receipts'
            and 'Inventory' but hasnt worked so far.) We need to be able to specify things such as Sales Tax, Freight and
            any Purchase Order adjustments.

These override mappings do work if there is no Purchase Order just a Purchase Invoice as shown in the simple process below.

How the Purchase Invoice mappings are used is best shown by an example.

A very simple description of a Purchase Invoice Process could be as follows:

. You have ordered something from a supplier (eg indirect purchasing such as stationery etc via phone)
. The Supplier ships the products to you +
   (NOTE: as they are not stored in the Warehouse but in your offices - so dont need an Inventory Receive.....????)
. You receive the product and an invoice from the Supplier (Purchase Invoice)
. You enter the Purchase Invoice pay the Supplier the amount invoiced

Let's focus on step of 4 in more detail.

* You have received the product from the supplier with an invoice
* In OFBiz you enter the Purchase Invoice using 'Create New' in the 'Invoices' menu of Accounting Manager
* Using the 'Items' sub menu you can create individual items on the Purchase Invoice
  (eg Paper, Pens, Sales Tax etc and they dont need to have a Product Id associated with them)
* When you add a new invoice item to the Purchase Invoice it is the 'Invoice Item Type' that is affected
   by the Purchase Invoice override mappings
* The Purchase Invoice can then be moved to various statuses (Approved, Received, Ready or Cancelled)
* When the status is moved to 'Ready' this is a trigger for an 'automatic' accounting transaction
* The transaction type generated is called 'Purchase Invoice' and it uses the Purchase Invoice override mappings

Transaction Type: Purchase Invoice, DR 516100 Purchase Order Adjustments , DR ????? Sales Tax, CR 210000 Accounts Payable

== How do I add a new Purchase Invoice override mapping?
By default there are no Purchase Invoice override mappings that are configured as part of the OFBiz demo data.

. Select the 'Invoice Purchase Item Type' from the drop down list
. Select the ' Invoice Override Expense GL Account Id' to map it to from the drop down list
. Press the 'Save' button
. The new mapping will be displayed in the 'Invoice Override Expense GL Account' column in the list at the bottom of the screen

== How do I update a Purchase Invoice override mapping?
An existing Purchase Invoice override mapping cannot be updated but needs to be removed and a new mapping added.
If you try to add an override to an item that already has an override you will get a duplicate record error message.

== How do I remove a Purchase Invoice override mapping?
NOTE: Only the override mapping can be deleted.
      The default mapping record cannot be deleted here (even though the Remove button is displayed next to it!)

. Locate the entry that needs the override deleted in the list of Purchase Invoice override mappings
. Press the 'Remove' button next to the entry
. The override mapping will be removed from the 'Invoice Override Expense GL Account' column of the entry
