Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Intercompany PO - SO confirmation

(0) ShareShare
ReportReport
Posted on by 781

Hi,

I have an intercompany PO _ SO.

I raised a PO for 2 items for which a Sale Order raised. Later in the PO I have added another 2 items and confirmed as the initial 2 items are not available.

Now I have made the invoice for the newly added 2 items and sale order in in OPEN ORDER Status as there is pending qty to deliver

I deleted the first 2items in the PO and the sale order status changed to INVOICED

Now when I try to confrim the PO, i receive the error as " Division by zero. - (C)\Classes\TW_TaxDocuments\Purchase......"

Refer below the image for details

pastedimage1589452175742v1.png

  • AshokKumarGuptaEga Profile Picture
    on at
    RE: Intercompany PO - SO confirmation

    Hi,

    I checked in our internal knowledge base and observed that similar issue was reported in AX2012+R3 version for project transaction scenario but didn't come across specific inter company PO-SO scenario.  May be you can check the below link for more information:

    "Division by zero" error with posted project transactions list page after upgrading

    Product and version: AX 2012 R3

    KB number: 4011468

    Fix type: Application update

    LCS Link: fix.lcs.dynamics.com/.../Details

    Also next time; please share your AX build information to check further.  

    Best Regards

    Ashok Kumar Gupta Ega

    Sr. T.A, Microsoft

  • Suggested answer
    guk1964 Profile Picture
    10,877 on at
    RE: Intercompany PO - SO confirmation

    I have seen this sort of error previosuly for example  there is an unhandled exception in the line of code for \classes\SalesInvoiceDP\insertIntoSalesInvoiceTmp method 

    Line 122 of the method :

    salesInvoiceTmp.SalesPrice =   _custInvoiceTrans.SalesPrice / (_custInvoiceTrans.LineAmount +_custInvoiceTrans.LineAmountTax) * _custInvoiceTrans.LineAmount;

    Changing that line of code like this  resolves the issue

    // changes made to avoid division by zero error.
    if((_custInvoiceTrans.LineAmount +_custInvoiceTrans.LineAmountTax) * _custInvoiceTrans.LineAmount == 0)
         salesInvoiceTmp.SalesPrice = 0 ;
    else
         salesInvoiceTmp.SalesPrice =   _custInvoiceTrans.SalesPrice / (_custInvoiceTrans.LineAmount +_custInvoiceTrans.LineAmountTax) * _custInvoiceTrans.LineAmount;

     It looks like this issue is similar.

  • AshokKumarGuptaEga Profile Picture
    on at
    RE: Intercompany PO - SO confirmation

    Hi Sriram,

    The object looks like a customization object for me.  Can you please check and confirm back.  If the object is customized object you may have to troubleshoot the issue from your side or raise a support incident with MS.

    Best Regards

    Ashok Kumar Gupta Ega

    Sr. T.A, Microsoft

  • sriram Profile Picture
    781 on at
    RE: Intercompany PO - SO confirmation

    Hi All,

    Please suggest

  • sriram Profile Picture
    781 on at
    RE: Intercompany PO - SO confirmation

    Hi,

    This is for a specific PO

  • Michal Krejza Profile Picture
    on at
    RE: Intercompany PO - SO confirmation

    Hello Sriram,

    Are you able to reproduce the issue on demand, or only for this specific PO ?

  • sriram Profile Picture
    781 on at
    RE: Intercompany PO - SO confirmation

    HI,

    Any suggestions please

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,255 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,984 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans