NPE when allocate has both AR and AP invoice

Description

  1. create and complete AR Invoice

  2. create and complete AP Invoice

  3. Create Allocation and add 2 invoice to lines

  4. complete Allocation then posting get error NPE (Posting Error (java.lang.NullPointerException))

reference example:

or add bellow unit test to AllocationTest and run it

Reason:

  1. Doc_AllocationHdr.createFacts

    1. bpAcct is ACCTTYPE_C_Receivable in case AR invoice

    2. bpAcct is ACCTTYPE_V_Liability in case AP invoice

  2. Doc_AllocationHdr.createInvoiceRoundingCorrection

    1. it query posting of invoice use bpAcct, but value of bpAcct depend on kind of invoice on last allocation line

    2. so in case last allocation line is AR Invoice then Doc_AllocationHdr.createInvoiceRoundingCorrection for AP invoice get NPE and vice versa

Environment

None

Attachments

1

Activity

Show:

GauravS May 16, 2023 at 9:01 AM

Hi here is the patch for the NPE on the view allocation if you allocate AP Invoice to AR Invoice.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created May 16, 2023 at 8:59 AM
Updated August 1, 2023 at 5:26 PM
Resolved June 5, 2023 at 1:09 PM