<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<section xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5.0"
    xmlns:xl="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"
    xsi:schemaLocation="http://docbook.org/ns/docbook ../../../content/dtd/docbook.xsd"
    xmlns="http://docbook.org/ns/docbook">
    <title>The Edit Invoice Applications screen.</title>
    <para>The Invoice Applications sub menu is where payments that have been made (or received) can
        be linked or allocated to an invoice. The phrase 'applying' an amount to an invoice is often
        used to describe this. The screen is divided into 3 main areas as follows.</para>
    <itemizedlist>
        <listitem>
            <para>Payments Applied (which shows details of the total amount 'Applied' and the total
                amount 'Open'. Note that 'Open' here means outstanding)</para>
        </listitem>
        <listitem>
            <para>Possible Payments to Apply (which shows all the payments that have been sent from
                the same party id as the invoice - for a sales invoice this would be the customer
                party id)</para>
        </listitem>
        <listitem>
            <para>Assign Payment to Invoice (which allows you to manually assign a specific payment
                id to this invoice)</para>
        </listitem>
    </itemizedlist>
    <para>GENERAL NOTE: General Ledger accounting transactions are generated during the payment
        application process but unless your GL is setup with Unapplied Cash and Applied Cash
        accounts - I'm not sure that there will be any true accounting impact. In the Sales Order
        process the accounting transaction generated the following GL Accounting transaction is
        generated for 'Payment Applied' o add some text here.</para>
    <para>DR 120000 Accounts Receivable / CR 120000 Accounts Receivable - This transaction doesnt
        really do anything! </para>
    <para>It is used to link payments to invoices. It is also used to allocate which part of a
        payment is allocated or applied to a specific invoice. This is extremely useful if your
        customers pay multiple invoices with a single payment.</para>
    <para>Example:</para>
    <para>
        <itemizedlist>
            <listitem>
                <para>A customer could send a single payment of $1000 that can be used to pay for
                    two invoices (eg $400 and $600)</para>
            </listitem>
            <listitem>
                <para>Using this applications sub menu allows you to allocate part of the $400 to
                    one invoice and the balance ($600) to the other invoice </para>
            </listitem>
        </itemizedlist>
    </para>
    <para>By default all 'unapplied' payments that have been entered into OFBiz from the customer
        will be available for selection even if they have not yet been flagged as formally
        'Received'. This means that these are payments that have not already been linked to another
        invoice. If only part of a payment amount has been linked to an invoice then the remaining
        amount is left available to be allocated to another invoice. Also note that a single invoice
        could be paid by multiple payments being applied to it.</para>
    <section>
        <title>How do I apply a payment (or payments) to an invoice?</title>
        <orderedlist>
            <listitem>
                <para>Select the 'Applications' sub menu for the invoice</para>
            </listitem>
            <listitem>
                <para>A list of unapplied payments for the party id will be displayed </para>
            </listitem>
            <listitem>
                <para>Press the 'Apply' button next to the entry that needs to be applied to the
                    invoice (NOTE: More than one entry may be used. Also only part of a larger
                    amount may be used)The Payments Applied total at the top of the screen will be
                    updated with the amount selected. Also the Amount Open will be reduced by the
                    amount selected.</para>
            </listitem>
            <listitem>
                <para> Once the total invoice amount has been selected a message will be displayed
                    and only the first part of the screen will be displayed </para>
            </listitem>
            <listitem>
                <para>The top part of the screen will now be updated to show the 'Payments Applied'
                    total is equal to the invoice total and the 'Amount Open' is zero. </para>
            </listitem>
        </orderedlist>
    </section>
    <section>
        <title>How do I update an applied payment for an invoice?</title>
        <orderedlist>
            <listitem>
                <para>Payments that have been applied to an invoice can be updated. This means that
                    you can change the details of the payment transaction or adjust the amount that
                    was applied to the invoice.</para>
            </listitem>
            <listitem>
                <para>Select the 'Applications' sub menu for the invoice</para>
            </listitem>
            <listitem>
                <para>A list of payments already applied to the invoice will be displayed in the top
                    part of the screen</para>
            </listitem>
            <listitem>
                <para>Enter or use the lookup to change the 'Payment Id' if required </para>
            </listitem>
            <listitem>
                <para>Enter the updated amount in the 'Amount to Apply' field if required</para>
            </listitem>
            <listitem>
                <para>Press the 'Update' button</para>
            </listitem>
        </orderedlist>
    </section>
    <section>
        <title>How do I remove an applied payment (or payments) from an invoice?</title>
        <para>NOTE TO CHECK: It can be done before transaction has been posted to GL but also need
            to check if its can be done if the transaction has been posted. </para>
        <orderedlist>
            <listitem>
                <para>Select the 'Applications' sub menu for the invoice</para>
            </listitem>
            <listitem>
                <para>A list of payments already applied to the invoice will be displayed in the top
                    part of the screen</para>
            </listitem>
            <listitem>
                <para>Press the 'Remove' button next to the payment entry that needs to be
                    removed</para>
            </listitem>
            <listitem>
                <para>The entry will be removed and the top part of the screen will be update the
                    'Payments Applied' total and 'Amount Open'</para>
            </listitem>
        </orderedlist>
    </section>
</section>
