IBM Support

IJ35153: UN-INVOICED QTY AND COST BEING CALCULATED AS 0

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • Intermittently, In the Invoices Application, the Unvoiced
    Quantity is not properly calculated when there is still some
    quantity left to be invoiced.
    Using a debug class provided by Dev, Support was able to narrow
    down the specific scenario and even able to replicate this
    in-house.
    Before the steps, some background is needed.
    1) In the invoices application, there is a calculated field
    called UninvoicedTotal, that displays the item (or other line
    type ) quantity still to be invoiced. Lets say there is a PO
    with a POLINE where quantity is 20.  An invoice is created and
    approved, invoicing only 10 items. Next time an invoice is
    created for this same PO, the Unvoiced Quantity is 10.  If there
    is nothing left, the code returns zero ?0.0?.
    This calculation is performed by
    invoice.calculateUnInvoicedTotal();
    In this method, the code returns zero when the session is not
    interactive. This is actually right, since when there not an
    actual person interacting, such calculation is irrelevant, such
    as MIF integrations, etc. But should never be executed when an
    actual user is adding new invoices in the Maximo UI.
    		if(!getUserInfo().isInteractive()){
    			return 0.0; 		//IJ14507
    		}
    2) Customer has a simple workflow to Change the Invoice Status
    from Entered to Approved.
    3) If there is an Invoice Line where the Quantity is Zero, the
    WF will throw the error below, which is as well expected:
    	BMXAA2013E - Could not change invoice 10031582 status to APPR.
    	BMXAA1977E - Cannot approve invoice 10031582. Quantity on
    invoice line 1 is 0.
    psdi.util.MXApplicationException: BMXAA4407E - A nested
    exception caused the workflow process to fail.
    	BMXAA2013E - Could not change invoice 10031582 status to APPR.
    4) Because the workflow is actually calling an action to Change
    the Invoice Status, the Action.class code is actually setting
    the UI Session isInteractive to FALSE.
    FROM DEBUG CLASSES:
    [8/17/21 16:11:26:937 EDT] 000001a9 SystemErr     R
    java.lang.Exception
    [8/17/21 16:11:26:938 EDT] 000001a9 SystemErr     R 	at
    psdi.security.UserInfo.setInteractive(UserInfo.java:544)
    [8/17/21 16:11:26:938 EDT] 000001a9 SystemErr     R 	at
    psdi.common.action.Action.executeChangeStatus(Action.java:533)
    5) It turns out, because of the error outlined on 3) the UI
    session is never going back to isInteractive = TRUE.
    This is the code: (Action.java:553)
    		// If trying to change to the same status, skip the record
    		if (!currentStatus.equals(newStatus))
    		{
    			// issue 74153 (and others) - passing null as the date of the
    status change will cause the current date to be used
    			// new Date() should not be used - use
    MXServer.getMXServer().getDate() instead
    			// the MXServer keeps the date sync?ed with the database
    			// 10-15143 - begin: executing an action is not interactive
    
       psdi.security.UserInfo ui = getUserInfo() ;
    
       boolean oldSetting = ui.isInteractive() ;
    
       ui.setInteractive(false) ;
    
       //10-15143:end
    			((StatefulMboRemote)mbo).changeStatus(newStatus, null, memo,
    NOACCESSCHECK);
    			//10-15143: set the userInfo back
    			ui.setInteractive(oldSetting) ;
    		}
    5) If the Invoice Status is changed manually, this problem does
    not happen since the action code is not called.
    6) If the user logs out, and login back, the session is
    re-created as interactive and the problem cannot be observed
    anymore.
    To summarize, the Action code is failing at not turning the
    session isInteractive flag to what it was before, making an
    actual user UI session to behave an NOT interactive, causing the
    quantity calculation problem.
    
    Steps to replicate:
    
    1) Go to Maximo server
    http://mxtest03-iot.fyre.ibm.com:9082/maximo
    IMPORTANT:  Login as wilson/wilson
    This server already has a simple WorkFlow configured, it
    basically starts, run an action and stops. Action is INV APPR (
    OOTB ), that changes the Invoice Status to Approved.
    2) Go to Invoices, pick up invoice MPC6, switch to POLINEs.
    Click the Copy POLines button
    Mind the Unvoiced Quantity = 10.00 and Uninvoiced Cost is 100.00
    
    This is correct.
    3) Pick up another invoice = ERROR,
    This Invoice has an line where the Quantity is ZERO.
    Click the Route WorkFlow button, as expected the error is
    thrown:
    BMXAA4407E - A nested exception caused the workflow process to
    fail.
    BMXAA2013E - Could not change invoice ERROR status to APPR.
    BMXAA1977E - Cannot approve invoice ERROR. Quantity on invoice
    line 1 is 0.
    4) Go back to Invoice MPC6, switch to POLINEs.  Click the Copy
    POLines button
    
    Now because the UI session is still incorrectly set as Non
    Interactive, both Uninvoiced Quantity and Uninvoiced Cost are
    blank.
    
    The Action.java must be able to recover from errors and still
    revert the isInteractive flag to the prior status.
    
    Environment:
    
    
    Version of Maximo:
    7612
    
    
    From Dev:
    "Fix should be implemented inside Action.java,
    executeChangeStatus(). The changeStatus() should be inside a
    try/catch block and the catch block should set the interactive
    back to the old setting before re-throwing the error."
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * MAXIMO                                                       *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * When an exception takes place during invoice approval        *
    * invoked by an inactive process (e.g. workwflow), the user    *
    * session is marked inactive and remains inactive.             *
    ****************************************************************
    

Problem conclusion

  • The fix for this APAR is contained in the following maintenance
    package: release\fix pack for Release 7.6.1.3 Product and
    Release 7612 IFIX
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ35153

  • Reported component name

    SYSTEM CONFIG

  • Reported component ID

    5724R46S1

  • Reported release

    761

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2021-09-24

  • Closed date

    2021-10-26

  • Last modified date

    2021-10-26

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    SYSTEM CONFIG

  • Fixed component ID

    5724R46S1

Applicable component levels

[{"Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"761"}]

Document Information

Modified date:
27 October 2021