Defining Algorithm Groups

This topic provides overviews of algorithm groups, Payment Predictor modes, and sample algorithm groups, and discusses how to:

  • View algorithm groups.

  • Deactivate an algorithm in an algorithm group.

  • Add an algorithm group.

  • Use #DETAIL and #DTL_TLR for partial payments and deductions.

  • Use the #OVERDUE algorithm group.

  • Review Payment Predictor and special conditions.

Before you can use Payment Predictor to apply payments automatically, you must select and refine the algorithms that determine how Payment Predictor handles specific payment situations.

An algorithm group is a collection of related algorithms. An algorithm group represents a section in the Payment Predictor process and each algorithm in the group represents a step in the section. Each algorithm has at least three statements:

  • A statement that names the algorithm within the group.

  • An insert statement that populates the PS_PP_MATCH_TAO temporary table.

    This step is usually named for the algorithm within the group, but it can be named anything.

  • A statement that performs the post-match processing.

PeopleSoft Receivables has sample algorithm groups that you can use to set up Payment Predictor. You can use an algorithm group as delivered. You can deactivate the algorithms in the group that you do not want to use, copy the same algorithm group to another method, and then deactivate different algorithms. You can create new algorithm groups as needed by copying algorithms from other algorithm groups and then modifying the algorithms to suit your particular needs.

Algorithm groups have instructions for processing payments. The instructions are based on the type of reference information that was used to match payments to customers. This table lists the type of reference information:

Type

Description

Customer reference information

Information such as the MICR ID or customer ID that is supplied with a payment. If a customer reference is not found, Payment Predictor uses item summary reference information or detail reference information to identify the customer.

Item summary reference information

Reference information that does not include the amount, for example, an item ID and reference qualifier code of I on payment entry.

Item detail reference information

Reference information that includes the amount, for example, item ID and item amount on payment entry.

The following table describes payment predictor modes:

Payment Predictor Mode

Description

Payment Predictor Result

Payments with customer identified and no item reference information provided.

Selects processing method for payments that are missing reference information.

If a payment is missing reference information, Payment Predictor places all open items for all of the customers identified by the payment into a temporary table called PS_PP_ITEM_TAO.

Note: If the deposit in a Payment Predictor run has more than one payment with the same customer ID and business unit, the process processes only the first payment when you are using one of these algorithm groups: #BALANCE, #COMBOS, #OLDEST1, #OLDESTC, #OVERDUE, or #PASTDUE. For example, the deposit has three payments:

Payment 1: References customer USA01 and business unit US001.

Payment 2: References customer USA05 and business unit US001.

Payment 3: References customer USA05 and business unit US001.

The algorithm group would process only payments 1 and 2.

Payments with item summary reference information and the customer identified does not matter.

Selects a processing method for payments with summary reference information. (Summary reference information does not include the amount. Example: item ID with no item amount.)

Payment Predictor places all matched open items for all of the customers identified by the payment into a temporary table called PS_PP_ITEM_TAO.

Payments with item detail reference information and the customer identified does not matter.

Selects a processing method for payments with detail reference information (includes amount), for example, item ID and item amount.

Detail reference information enables you to use Payment Predictor to process deductions that are associated with a payment. For example, a deduction for prior freight damages of 100.00 CAD can be processed with a payment of 900.00 CAD to pay an open item of 1,000.00 CAD. The sum of the detail reference items less the sum of the deductions should equal the payment amount.

The following table lists the sample algorithm groups that come with PeopleSoft Receivables. As you review the samples, consider the automatic cash application capabilities of your current system and your customers' remittance patterns.

Algorithm Group

SECTION

Selects These Open Items

Use For

Algorithms in Group

STEPS

#BALANCE

Selects all open items for identified customers, only if the payment amount exactly matches the open items total.

Payments without item references only and customer identified.

BALGR: Selects all open items.

BALNET: Selects all open items minus earned discounts.

#COMBOS

Selects all open items for identified customers only if the payment amount matches an item amount, an item amount with discount, or the total amount of any two items. The algorithm selects an item only if only one item matches the payment amount or if only two items match the payment amount. For example, if the payment amount is 200.00 EUR and one item for 200.00 EUR exists, it selects that item. However, if the payment amount is 200.00 EUR and two items exist, each for 200.00 EUR, it does not select any items.

Payments without item references only and customer identified.

DEBITGR: Selects a single unique open item.

DEBITNT: Selects a single unique open item minus earned discount.

ANY2GR: Selects any two unique open item balances combined.

#OLDEST1

Selects items with oldest due dates first until the remaining payment amount is less than the next item.

Payments without item references only and customer identified.

OLDEST: Selects open items in oldest first order by due date. Creates a partial payment for the next item.

#OLDESTC

Adds all items with credit balances to the payment amount. Then selects items with debit balances in oldest due dates order until the remaining payment amount is less than the next item.

Payments without item references only and customer identified.

CREDITS: First adds all credits to the payment amount. Then selects open items in oldest first order by due date. Creates a partial payment for the next item.

#OVERDUE

Selects all overdue items for payment matching using the sequence of the entry reasons associated with overdue charges.

Payments without item references only and customer identified.

OVERDUE: Selects the items to apply to the payment. First uses the sequence of overdue entry reasons.

Then selects open items in oldest first order by due date. Creates a partial payment for the next item.

#PASTDUE

Selects all past-due items for the customers identified only if the payment amount exactly matches the total of the past-due items.

Payments without item references only and customer identified.

PASTGR: Selects all past-due open items.

PASTNET: Selects all past-due open items minus earned discounts.

#REFS

Selects open items that exactly match the references supplied with a payment.

Payments with item summary references only and customer identified does not matter.

ITEMREF:

Selects all open items identified by the references regardless of customer identification. Enables you to add a unique debit or credit item for an underpayment or overpayment that completes the application.

If a customer reference is provided, Payment Predictor selects the items where the item ID matches the item summary reference and customer ID matches the customer reference. If a customer reference is not provided, and only an item summary reference is provided, Payment Predictor selects the items where the item ID matches the item summary reference.

MULPAY:

Payment Predictor selects the payments with matching reference values and payment currency, then applies multiple payments to the same item.

#REF_ONE

Selects only open items that exactly match the references supplied with a payment.

Payments with item summary references only and customer identified.

ONECUST: Selects all open items identified by the references limited to the customer whose MICR ID or customer ID is supplied with the payment. Enables you to add a unique debit or credit item that completes the application.

#REFS_NG

Uses reference information that does not exactly match to select items.

Payments with item summary references only and customer identified does not matter.

PeopleSoft Receivables includes these algorithms as samples of possible ways for dealing with bad references. They are platform-specific and you can take advantage of any functions that your database allows.

FIRST8: Selects all open items identified by the first eight characters of the references.

MIDDLE7: Selects all open items identified by the seven characters after the first three characters in the references.

#DETAIL

Selects only open items that exactly match the references supplied with a payment.

Payments with item detail references only and customer identified does not matter. Created adjustments only adjust remaining overpayment or underpayment.

DETAIL: Selects all open items identified by matched references. Also accepts WS-08 deduction references. Payments with detail references should balance, but if not, the #DETAIL algorithm creates an Adjust Remaining Underpayment item for underpayments or an Adjust Remaining Overpayment item for overpayments.

#DTL_TLR

Selects only open items that exactly match the references supplied with a payment.

Payments with item detail references only and customer identified does not matter.

DTL_TLR

Selects all open items identified by matched references. Closes items that match the payment amount. If an underpayment exceeds the tolerances, it looks at the bill to customer to determine whether partial payments are allowed. If they are allowed, it creates a partial payment on the item. The actions taken are based on the selections on the Receivables Options - Predictor Detail Options page.

#DTL_PM

Selects only open items that exactly or approximately match the detail references supplied with a payment.

Payments with item detail references. Identified customer does not matter.

#DTL_PM:

  • First Pass:

    Selects all open items identified by matched references, including deduction references (WS-08).

  • Second Pass:

    Whenever an overpayment is about to be created and there are unmatched items referenced in the payment, this algorithm serves as an example of how to deal with bad references. You can easily modify the algorithm to adapt to your organization's needs for matching open items.

    • FIRST8

      Selects all open items identified by the first eight characters of the reference.

    • MIDDLE7

      Selects all open items identified by the seven characters after the first three characters in the reference.

Payments handled by this algorithm method should balance. If any of the payments do not balance, the #DTL_PM algorithm creates an Adjust Remaining Underpayment item (WS-07) for underpayments or an Adjust Remaining Overpayment item (WS-06) for overpayments.

If the customer cannot be identified for the new item, the algorithm applies the payment item based on the value selected (First, Last, Specify) for the Control Customer and Business Unit field on the Receivables Options > Predictor Details Options page.

#DTL_TPM

Selects open items that exactly or approximately match the detail reference item supplied with the payment.

Payments with item detail references only and customer identified does not matter.

#DTL_TPM:

  • First Pass:

    Selects all open items identified by exactly matched references.

  • Second Pass:

    Whenever an overpayment is about to be created, and there are unmatched items referenced in the payment, this algorithm serves as an example of how to deal with bad references. You can easily modify the algorithm to adapt to your organization's needs for matching open items.

    • FIRST8

      Selects all open items identified by the first eight characters of the reference.

    • MIDDLE7

      Selects all open items identified by the seven characters after the first three characters in the reference.

If an underpayment exceeds the tolerances specified on the Receivables Options > Predictor Detail Options page. The system looks at the Bill To customer to see whether partial payments are allowed. If partial payments are allowed, it creates a partial payment on the item.

If the customer cannot be identified for the new item, the algorithm applies the payment item based on the value selected (First, Last, Specify) for the Control Customer and Business Unit field on the Receivables Options > Predictor Details Options page.

#STATMNT

Selects items from the most recent customer statement.

Payments without item detail references and customer identified.

STMTALL: Selects items from the most recent statement. The payment amount must exactly match the total amount of the items on the statement.

This section explains how to view the contents of an algorithm group.

To view an algorithm group:

  1. Open the AR_PREDICT2 Application Engine program in Application Designer.

  2. Locate the name of the algorithm group in the sections.

    Algorithm groups have names that start with # and appear first in the list.

  3. To view details about the algorithms (steps), expand the algorithm group.

    Some algorithm groups, such as #BALANCE and #REFS, may have steps in a repeating pattern. More details about this pattern are in the example that follows this procedure.

  4. To view the SQL statement, double-click the SQL folder for the algorithm.

Example: #BALANCE

To understand how a customer-based algorithm group works, examine #BALANCE. This algorithm group compares the amount of the payment to the total of all items for the customer. When you scroll through the steps, you might notice that the steps have a pattern: ALGO_1, BALGR, ALGO_X1, then ALGO_2, BALNET, ALGO_X2.

Payment Predictor evaluates overpayments and underpayments based on the information in the PS_PP_MATCH_TAO. As long as an item has not been selected by another payment, it either fully applies a payment (if it matches the balance of all open items) or it does not apply it at all. An overpayment or underpayment condition cannot exist.

In one case, however, an overpayment condition can exist. Payment Predictor processes two payments together for the same customer, and the first payment pays one item while the second payment pays the entire customer balance including that same item. This situation might occur if the customer forgets that the first payment has already been made when they create the second payment. In this case, Payment Predictor determines that the sum of the open items matches the amount of the payment. It inserts rows only for items that are not already selected by another payment into the PS_MATCH_TAO temporary table. In this limited case, Payment Predictor detects and evaluates an overpayment condition.

If in your business environment applying a tolerance to the evaluation of a balance makes sense, modify the algorithm to include a tolerance calculation. This modification directs Payment Predictor to insert into PS_PP_MATCH_TAO item rows for which the total nearly, but not exactly, matches the amount of the payment. This tolerance calculation then enables Payment Predictor to recognize an overpayment or underpayment condition and then to take the appropriate action. This table describes the steps in the #BALANCE algorithm group:

Step

Description

ALGO_1

Sets the name of the algorithm within the group. It updates the payment for any payments applied by this algorithm.

Type: Select

Statement:

%SelectInit(ALGORITHM )
SELECT 'BALGR'
FROM PS_INSTALLATION
WHERE 1 = 1

"THE INSERT"

Populates PS_PP_MATCH_TAO. This step is usually named for the algorithm within the group but can be called anything. In this algorithm, the name of the first algorithm is BALGR.

Type: Update/Insert/Delete

Statement:

%Sql(ARPREDICT$CLAUSESCUSTIDU)
AND P.PAYMENT_AMT = 
( SELECT SUM(PAY_AMT) 
FROM %Table(PP_ITEM_TAO)
WHERE PROCESS_INSTANCE = P.PROCESS_INSTANCE 
AND DEPOSIT_BU = P.DEPOSIT_BU
AND DEPOSIT_ID = P.DEPOSIT_ID
AND PAYMENT_SEQ_NUM = P.PAYMENT_SEQ_NUM )

ALGO_X1

If the system works after the process populates PS_PP_MATCH_TAO, it removes invalid items from PS_PP_MATCH_TAO and classifies the payment as either fully applied, over-applied, or under-applied. Runs a section called ALGRDONE.

Type: Do When

Statement:

%SelectInit(AE_EXISTS)
SELECT 'X'
FROM %Table(PP_MATCH_TAO)
WHERE PROCESS_INSTANCE = 
%Bind(PROCESS_INSTANCE)
AND PP_PROC_FLAG = '0'

ALGO_2

The name of the second algorithm in the group if more than one exists.

Type: Select

Statement:

%SelectInit(ALGORITHM )
SELECT 'BALNET'
FROM PS_INSTALLATIONWHERE 1 = 1

"THE INSERT"

Populates PS_PP_MATCH_TAO. This step is usually named for the algorithm within the group, but can be called anything. In this algorithm, the name of the second algorithm is BALNET.

Type: Update/Insert/Delete

Statement:

%Sql(ARPREDICT$CLAUSESCUSTIDU)
AND P.PAYMENT_AMT = 
( SELECT SUM(PAY_AMT - DISC_PAY)
FROM %Table(PP_ITEM_TAO)
WHERE PROCESS_INSTANCE = P.PROCESS_INSTANCE 
AND DEPOSIT_BU = P.DEPOSIT_BU
AND DEPOSIT_ID = P.DEPOSIT_ID
AND PAYMENT_SEQ_NUM = P.PAYMENT_SEQ_NUM )

ALGO_X2

If the system works for the second algorithm after the process populates PS_PP_MATCH_TAO, it removes invalid items from PS_PP_MATCH_TAO and classifies the payment as either fully applied, over-applied, or under-applied. Runs a section called ALGRDONE.

Type: Do When

Statement:

%SelectInit(AE_EXISTS)
SELECT 'X'
FROM %Table(PP_MATCH_TAO)
WHERE PROCESS_INSTANCE = 
%Bind(PROCESS_INSTANCE)
AND PP_PROC_FLAG = '0'

Example: #REFS

To understand how an item-summary-reference-based algorithm group works, examine #REFS. This algorithm group has one algorithm that selects only open items that exactly match the references supplied with a payment. When you scroll through the steps, you may notice that the steps have a pattern.

To help you understand how #REFS works, this table describes the steps.

Step

Description

ALGO_1

Sets the name of the algorithm within the group and updates the payment for any payments applied by this algorithm.

MATCHTMP2

Clears the PS_PP_MATCH2_TAO table.

ITEMREF

Populates PS_PP_MATCH2_TAO. It is done once for each unique reference qualifier that is used by the payments to be applied. If a payment is in both PS_PP_MATCH2_TAO and PS_PP_MATCH_TAO, it removes it from PS_PP_MATCH2_TAO. Then it copies the data from PS_PP_MATCH2_TAO to PS_PP_MATCH_TAO.

ALGR_A1

Removes invalid items from PS_PP_MATCH_TAO.

ALGR_B1

Processes matches.

ALGR_C1

Updates payment status.

ALGO_D1

Retrieves counts.

ALGO_E1

Sets PP_PROC_FLAG to 1 and ends the matching process.

Example: #REFS_NG

The #REFS_NG algorithm group has algorithms that you can modify to handle references that do not match items exactly. They are platform-specific and you should feel free to take advantage of any functions that your database allows. Because this algorithm group compares a partial ID and returns any possible matches, the processing time for this algorithm group is longer than for other algorithm groups. Use this algorithm group only when no other way is available to create matches, and always set up the payment predictor method to generate a worksheet, where you review and finalize the payment.

The following table describes the two algorithms in the #REFS_NG algorithm group:

Algorithm

Description

FIRST8

Matches the first eight characters in the reference information to the first eight characters of the specified fields on the item in the database.

You can change the parameters in the %substring from either side of the equation, depending on how you want to match.

%Substring(I.%Bind(FIELDNAME, NOQUOTES), 1, 8) = %Substring(%Sql(ARCASTCHAR, 
%Bind(REF_VALUE), 30), 1, 8)

MIDDLE7

Skips the first three characters and matches the middle seven characters in the reference information to the middle seven characters of the specified fields on the item in the database.

%Substring(I.%Bind(FIELDNAME, NOQUOTES), 3, 7) = %Substring(%Sql(ARCASTCHAR, 
%Bind(REF_VALUE), 30), 1, 7))

This section explains how to deactivate algorithms in an algorithm group that you do not want to use. For example, the #BALANCE algorithm group has two algorithms that are similar, but you need only one of them.

To deactivate an algorithm:

  1. Open the AR_PREDICT2 Application Engine program in Application Designer.

  2. Locate the name of the algorithm group in the sections.

    Algorithm groups have names that start with # and appear first in the list.

  3. Expand the algorithm group and locate the step (algorithm) that you want to deactivate.

  4. Deselect the Active check box to deactivate the algorithm.

You can add an algorithm group by copying algorithms from an existing algorithm group. Oracle recommens copying whenever possible. However, if copying is not permitted on the platform that you are using, you can write one yourself.

To add a new algorithm group:

  1. Open the AR_PREDICT2 Application Engine program in Application Designer.

  2. Select Insert, Section.

    A new section titled Section1 appears in the list.

  3. Type over the name of Section1 algorithm group.

    The new name must start with #. For example: #NEW.

  4. Save your work.

  5. Copy algorithms from existing algorithm groups and paste them into the new algorithm group.

    Each algorithm requires a minimum of three statements: name, insert, and post match system processing.

    If the algorithm is customer-based, copy an existing algorithm that is most similar to the one that you want to create.

    If the algorithm is reference-based, copy #REFS.

    To copy, right-click the section that you want to copy and select Copy.

    To paste, right-click the section where you want to insert the new section and select Paste.

  6. Copy and paste the SQL statements for each step.

    To copy, right-click the appropriate action and select View SQL.

    To paste, right-click the appropriate action folder in the new section and select Paste.

  7. Modify the SQL as needed.

The MULPAY algorithm in the #REFS algorithm group applies multiple payments to a single item, in a single run.

The MULPAY algorithm works by selecting payments with matching reference values and payment currency, then applies multiple payments to the same item.

Prerequisites

These prerequisites must be met in order to use the MULPAY algorithm to apply multiple payments to the same item:

  • Deselect the No Mult Pending Item Selection (no multiple pending item selection) check box on the Installation Options - Receivables Page.

  • Select the Multiple Payments for One Item check box on the Installation Options - Receivables Page.

  • All payments that are associated with the paying item must have matching summary references.

  • Payment currency must match the balance currency of the item.

  • Multiple Payments must be for the same item.

  • Add the #REFS algorithm group to the payment predictor method using the Predictor Method Page.

Processing Multiple Payments with the MULPAY Algorithm

The MULPAY algorithm processes multiple payments in this manner:

  1. If the first payment amount is less than the item pay amount (balance amount), Payment Predictor selects the next payment and compares the payment amount to the item remaining balance. The same process continues until the item remaining balance is zero or there are no remaining payments.

  2. For the last applied payment:

    1. If the payment amount is greater than the remaining item balance, an adjustment item is created based on the overpayment condition defined for the #REFS group algorithm in the Predictor Method Page.

    2. if the payment amount is less than the remaining item balance, the item remains open.

This section provides tips for using the #DETAIL or #DTL_TLR algorithm group. You must select one of these algorithm groups to process detail reference information that includes the amount of the item, as well as an item ID.

Typically, you use the #DETAIL algorithm group for payment-level adjustments and the #DTL_TLR group for partial payments and discounts.

The #DETAIL algorithm group handles exceptions as either an overpayment adjustment (AO) or an underpayment adjustment (AU), unless a create a deduction (WS-08) transaction or a write-off an item (WS-09) transaction is entered on the Detail Reference Information page for the payment (PAYMENT_ID_ITEM record). The #DETAIL algorithm group can assign only AO or AU entry types. Because the entry types assigned by the #DETAIL algorithm group are predefined by the system, you do not need to define more steps when using this algorithm group to create a payment method.

The #DTL_TLR algorithm group enables you to specify the desired entry type and entry reason for handling exceptions. When you are using the #DTL_TLR algorithm group, the action that Payment Predictor takes for underpayments, overpayments, and discounts is based on the options specified on the Receivables Options - Predictor Detail Options page. Because you specify the adjustments assigned by the #DTL_TLR algorithm group, you do not need to define more steps when using this algorithm group to create a payment method.

Detail reference information for a particular payment is stored in the following fields of the PS_PAYMENT_ID_ITEM table:

Field

Description

ITEM_AMT

The gross amount of the item selected to be paid.

PAY_AMT

The net amount of the item selected to be paid.

DISC_TAKEN

The discount amount applied to the item.

Either PAY_AMT or else both ITEM_AMT and DISC_TAKEN must be positive numbers. If all these amounts are provided, Payment Predictor uses only PAY_AMT.

Using #DETAIL for Deductions

The #DETAIL algorithm group enables you to take deductions. For a deduction to occur, in the PAYMENT_ID_ITEM record, the ENTRY_USE_ID must be WS-08 (create a deduction). The record should also contain item reference information, including the business unit, customer ID, and item ID. For existing items, the deduction must be for the open item that is selected for the current payment. In addition, the sum of the payment amount and the deduction amount must equal the item balance. For example, if your customer wants to take a deduction for 50 USD on an item balance of 1,000 USD, then the payment amount must be 950 USD.

Using #DETAIL for Write-offs

The #DETAIL algorithm group enables you to deduct a write-off at the item level. For a write-off to occur, the ENTRY_USE_ID must be WS-09 (Write-Off) in the PAYMENT_ID_ITEM record. The record should also contain item reference information, including the business unit, customer ID, and item ID. To process a write-off using #DETAIL, you must also have a payment (PY) transaction for the same item in the PAYMENT_ID_ITEM record, and you must select the Partial Payment Switch field on the Bill To Options page for the customer. In addition, the detail references must equal the item amount. For example, if you have an item for 1,000 USD and you want to eliminate a 50 USD write-off from that balance, then the payment amount must be 950 USD. In this example, the Pay Amt field in the PAYMENT_ID_ITEM record must also be 950 USD.

Using #DTL_TLR for Partial Payments and Discounts

If Payment Predictor runs a payment predictor method that contains the #DTL_TLR algorithm group, the processing of partial payments differs depending on how you set up the tolerances on the Receivables Options - Predictor Detail Options page and whether you selected the Partial Payment Switch field on the Bill To Options page for the customer.

If you select the Partial Payment Switch check box, the process performs one of the following actions:

  • If the payment amount is less than the open balance amount minus the earned discount amount, the process performs one of the following actions:

    • If the remaining amount is within the tolerances on the Receivables Options - Predictor Details Options page, it closes the item and creates a write-off or adjustment based on the setup.

    • If the remaining amount is greater than the tolerances on the Receivables Options - Predictor Details Options page, it makes a partial payment and leaves the remaining amount open on the item.

  • If the payment amount is greater than the open balance amount minus the earned discount amount, the process pays the item in full and uses the values that you entered on the Receivables Options - Predictor Details Options page to determine whether to eliminate as a write-off or adjust an overpayment.

If you deselect the Partial Payment Switch check box, the process uses the values that you entered on the Receivables Options - Predictor Details page to determine whether to eliminate as a write-off or adjust an underpayment or overpayment.

For example, suppose that the tolerance amount is set at 50.00 USD and the percentage is set at 10 percent. If a payment of 90.00 USD is received after the payment term for the discount has expired for a 100.00 USD item, the payment will be within tolerance because the 10.00 USD short pay is less than the fixed tolerance amount of 50.00 USD and the calculated amount of 10 percent using 100 × 0.10. Therefore, the 10.00 USD of the short pay amount is adjusted or eliminated as a write-off based on what is specified using the Payment Predictor detail options.

A condition exceeds tolerance if it either exceeds the fixed tolerance amount or exceeds the tolerance percentage. In that case, you can set up Payment Predictor to take a different action for overpayments and underpayments.

Note: If an item does not qualify for an earned discount but the Disc (discount) field is selected for the item on the Detail Reference Information page and a discount amount is entered, the process takes the unearned discount. The process takes the unearned discount regardless of the setting of the Partial Payment Switch field.

To set up your system to use tolerances for partial payments and discounts, you must perform the following tasks:

  • Assign the #DTL_TLR algorithm group to payment predictor methods.

  • Select or deselect the Partial Payment Switch check box for customers for whom you want to apply payments using the #DTL_TLR algorithm group on the Bill To Options page.

  • Assign a payment predictor method that runs the #DTL_TLR algorithm group to customers on the Bill To Options page or to business units on the Receivables Options - Payment Options page.

  • Assign the entry types and reasons for the #DTL_TLR algorithm group to the appropriate automatic entry types on the Automatic Entry Type - Selection page.

  • Select the Disc (discount) check box and enter a discount amount on the Detail Reference Information page.

  • Define the discount tolerances and write-off limits for underpayments and overpayments on the Receivable Options - Predictor Detail Options page.

  • (Optional) Override the default system function to use for underpayments and overpayments and unearned discounts on the Receivables Options - Predictor Detail Options page.

This table represents various scenarios and how Payment Predictor handles payments, earned discounts, and unearned discounts. All amounts are in USD.

Scenario

Original Balance Amount

Payment Amount

Entered Discount

Discount Check Box Selected

Calculated Earned Discount

Calculated Unearned Discount

1

1000

980

0

Y

20

0

2

1000

1000

0

N

0

0

3

1000

990

10

Y

0

10

4

1000

960

40

Y

0

40

5

1000

960

40

Y

0

40

6

1000

980

10

Y

0

10

7

1000

1010

0

N

0

0

8

1000

1010

0

Y

20

0

9

1000

490

10

Y

0

10

10

1000

490

10

Y

0

10

The Results column shows the results after running Payment Predictor and the Receivables Update process.

Scenario

Action Item

Partial Payment Allowed

Results ª

Item Status

Closing Balance

1

0

Yes or No

20 USD earned discount is taken.

Closed

0

2

0

Yes or No

Apply payment in full and close the item.

Closed

0

3

0

Yes or No

10 USD unearned discount is taken (within the tolerance specified).

Closed

0

4

0

No

40 USD deduction item is created (the discount is not within the tolerance amount, a partial payment is not allowed, and the underpayment is not within the specified tolerance).

Closed

0

5

0

Yes

Process a partial payment (the discount is not within the specified tolerance amount).

Open

40

6

10 (WAU)

Yes or No

10 USD underpayment is written off (the discount is within the specified tolerance amount and the underpayment is within the specified invoice tolerance percent or amount).

Closed

0

7

10 (WAO)

Yes or No

10 USD overpayment is written off (the overpayment is within the specified invoice tolerance percent or amount).

Closed

0

8

30 (OA)

Yes or No

New on-account item is created (the overpayment is above the specified invoice tolerance percent or amount).

Closed

0

9

0

Yes

Process the partial payment (the discount is not within the specified tolerance percentage).

Open

510

10

0

No

510 USD deduction item is created (the discount is not within the specified tolerance amount and a partial payment is not allowed).

Closed

0

Note: ª The Results column shows the results after running Payment Predictor and the Receivables Update process.

When the Payment Predictor process (ARPREDCT) runs, the PeopleSoft Receivables #DETAIL algorithm processes every item that gets matched with payment lines. If a payment has ten item detail references and nine of them match exactly and one remains unmatched, the nine matched item detail references are processed, while the unmatched item detail reference is not processed and remains untouched. In this case, an overpayment is usually created and the detail reference is lost.

When the payments and their item references get loaded from an external system, the system usually does not verify that the items exist. These unmatched items are usually off by a letter or two, which prevents the payments from being applied.

Before these processes can create these new items, you must access the Receivables Options – Predictor Detail Options page and select one of these values for the new Control Bus Unit and Customer field:

The #DTL_PM (partial match) and #DTL_TPM (tolerance partial match) algorithms identify items to be matched with a payment using the detail reference information in the first pass, just like the #DETAIL algorithm. The referenced customer does not matter. If, after this initial pass, the entire payment was not applied and an underpayment item must be created, and items were referenced in the payment that the #DETAIL algorithm method did not match, then a second payment predictor pass tries to match any unmatched items. In the second pass, the remaining payment amount from the first pass is considered, and a LIKE construct searches for the items that were not matched in the first pass. The referenced customer does not matter. The algorithm only uses the item as a reference. All of the items that are matched in the second pass are added to the ones found in the first pass, and from that point on these items will be treated as if they were all found in a single pass. Payments handled by this algorithm method should balance. However, if they do not balance, the #DTL_PM method creates an Adjust Remaining Underpayment item (WS-07) for underpayments or an Adjust Remaining Overpayment item (WS-06) for overpayments.

For example, there are ten payment lines with detail reference information. However, an item ID of one of the payment lines is off by a letter. The algorithm matches, but does not close, the first nine payment lines, and tries to match the tenth payment line by approximation using the FIRST8 or MIDDLE7 methods. If the match is successful, then the ten items will be in the same location, and all ten of the items will be processed and closed.

However, if the algorithm is unable to match the tenth item, the algorithm closes the nine items, and the tenth item remains outstanding. The algorithm creates an adjustment payment item (underpayment or overpayment) for the remaining payment amount. The system places this adjustment item either on a worksheet or on a customer account, depending on the setup.

The #DTL_TPM algorithm processes just like the #DTL_PM during the first and second passes through Payment Predictor. However, if an underpayment exists, #DTL_PM checks the tolerances and rules set up on the Receivable Options > Predictor Detail Options page. If an underpayment exceeds these tolerances, the system checks whether the Bill To customer allows partial payments. If partial payments are allowed, the system creates a partial payment of the item.

Important! Before the #DTL_PM and #DTL_TPM algorithms can create these new items, you must access the Receivables Options > Predictor Detail Options page and select a value in the Control Bus Unit and Customer field:

See Receivable Options - Predictor Detail Options Page.

The #OVERDUE algorithm group handles payments for overdue charge line items. If you use the option to create overdue charges by item line, you can create payment predictor methods that use this algorithm group. You assign a sequence number to each entry reason for the overdue charge (FC-01) item entry type on the Item Entry Type - Selection page. Payment Predictor uses this sequence number to determine the order in which to pay the overdue charge line items. The #OVERDUE algorithm group handles payments based on certain conditions:

  • Payment Predictor applies payments and any credit amount available to all overdue charges first before the remaining amount is disbursed to the principal amount.

  • Payment Predictor applies a partial payment to the first item after the last fully paid item in the sequence if insufficient funds are available to pay for remaining open overdue charge line items.

    The sequence is determined by due date in ascending order. If any credit amount is available, Payment Predictor applies it as part of the payment.

To set up your system to use the #OVERDUE algorithm group, perform these tasks:

  1. Set up the sequence number for each entry reason for the overdue charge item entry type.

  2. Set up a payment predictor method containing the #OVERDUE algorithm group.

  3. Assign a payment predictor method that contains the #OVERDUE algorithm group to customers.

Example: #OVERDUE Algorithm Group

This section provides an example of how payment predictor applies payments to overdue charge line items.

This table lists the sequence numbers that are assigned to the entry reasons for the automatic entry type for finance charges for this example:

Entry Reason

Sequence Number

ADMIN

1

PNLTY

2

This table lists items and finance charge line items that are open for a customer:

Item

Line Number

Due Date

Entry Type

Entry Reason

Balance Amount

IT_OC1

1

March 17, 2002

OC

ADMIN

16.16 USD

IT_OC2

1

March 17, 2002

OC

ADMIN

32.32 USD

IT_OC2

2

March 17, 2002

OC

FIN

32.32 USD

IT_OC1

2

March 17, 2002

OC

FIN

16.16 USD

IC_OC1

3

March 17, 2002

OC

PNLTY

16.16 USD

IC_OC2

3

March 17, 2002

OC

PNLTY

32.32 USD

IT_OC1

0

March 3, 2002

IN

Not Applicable 

1000.00 USD

IT_OC2

0

March 3, 2002

IN

Not Applicable 

2000.00 USD

This table lists the sequence numbers that Payment Predictor would apply to the items to determine the payment order:

Item

Line Number

Due Date

Overdue Charge Sequence Number

IT-OC1

1

March 17, 2002

1

IT_OC2

1

March 17, 2002

1

IT_OC1

3

March 17, 2002

2

IT_OC2

3

March 17, 2002

2

IT_OC1

0

March 3, 2002

9

IT_OC2

0

March 3, 2002

9

IT_OC1

2

March 17, 2002

9

IT_OC2

2

March 17, 2002

9

This table shows what the results would be if you applied a 50.00 payment to the customer.

Payment Amount

ITEM ID

ITEM Line

TYPE

16.16 USD

IT_OC1

1

PY

32.32 USD

IT_OC2

1

PY

1.52 USD

IC_OC1

3

PY

This section provides background information about how algorithms handle special conditions.

To handle special conditions, Payment Predictor uses statements that run within the algorithm group or within sections that are done from the algorithm group. This functionality enables Payment Predictor to segment processing so that the answer set can be modified between segments. Payment Predictor uses a DO SELECT statement that is driven by the same SQL statement to run the statements.

Reference-Based Algorithms

To process a reference-based algorithm, Payment Predictor builds a list of references for all payments in the run. Then, for each type of reference used, it modifies and processes the algorithm dynamically. For example, if any payments in the run have ITEM references, it modifies the SQL to "AND I.ITEM = D.REF_VALUE AND D.REF_QUALIFIER_CODE = 'I'." Oracle recommends that you use an index based over PS_ITEM for each type of reference that you use regularly.

In the ID_ITEM section, Payment Predictor uses the reference to identify a customer by using the item. In the ITEM_REF algorithm, a DO SELECT drives a DO of the section RLOOP. This action populates the PS_PP_MATCH_TAO temporary table using the same two lines and %BIND variables concatenated at the end of the basic insert that joins the payment, items, and item references.

AND X.REF_QUALIFIER_CODE = %BIND(REF_QUALIFIER_CODE) 
AND X.REF_VALUE = I.%BIND(FIELDNAME, NOQUOTES)

Limiting Items Applied by References to Customer-Identified Items

Normally, a payment with an item reference pays items regardless of the item's customer ID. In cases in which you receive both reference information and customer identification, Payment Predictor restricts the items applied by references to the customers identified through the use of an algorithm group called #REFS_ONE. The #REFS_ONE algorithm group contains a section, ONE_CUST, that deletes from the PS_PP_MATCH_TAO record those rows in which the customer is not part of the remit from group associated with the MICR ID or the customer. This statement has no effect if the MICR ID or customer ID is invalid.

Ordering by Oldest Due Date First

Payment Predictor loads all the customer items into the PS_PP_MATCH_TAO record to perform oldest first processing (ordering items with the oldest item first). It loops through the items, record by record, in oldest due date first order and then deletes any unused records. Payment Predictor uses two algorithm groups that accomplish the same result in the same manner. They selectively eliminate items from the PS_PP_MATCH_TAO record with an ordering option. The two algorithms are:

  • #OLDEST1: Orders open items from oldest to latest due date, including credit items.

  • #OLDESTC: Includes all credits as part of the payment first, then applies payments.

    Orders the remaining items from oldest to latest due date.

Allowing Partial Payments

If you are using the #OLDEST or #OLDESTC algorithm, Payment Predictor always makes partial payments on the last item that depletes the remainder payment amount for bill to customers when the payment amount does not exactly match the sum of the matched items. If you are using DTL_TLR (detail with tolerance algorithm), Payment Predictor makes partial payments when the payment amount does not exactly match the item balance amount and if the customer has been set up for partial payments on the Bill To Options page.

See Using #DETAIL and #DTL_TLR for Partial Payments and Deductions.

Setting Up for Prepayments

If your organization receives payments that are prepayments for specific invoices that you created in your billing application, you can set up Payment Predictor to create Prepay Items (WS-04). To take advantage of this feature, you must receive the invoice number in the ITEM field on the PS_PAYMENT_ID_ITEM record. You must also activate the NOTFOUND step (algorithm) in the DETAIL section (algorithm group) of the AR_PREDICT1 Application Engine process. You must also use a payment predictor method that uses detail references.

Using this feature is the same as creating a prepayment item on the payment worksheet. Payment Predictor applies the prepayment to an item later—after you enter an item in PeopleSoft Receivables that has an item ID that matches the value that you received in the ITEM field in the PAYMENT_ID_ITEM record.