Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

failure posting intercompany purchase order through Code

Posted on by 1,330

Hi,

It's all in x++ customization. user imports a list of orders.

I have created  purchase order which in turn creates intercompany sales order

then i m posting sales order invoice and finally i am trying to post the purchase order which throws me below error

Customer tax invoice in company XYZ= 0.00, purchase is updated with 13,080.35.

This error is located in Class PurchInvoiceJournalCreate. I am not sure why CustINvoiceJourLocal.InvoiceAmount is 0.  When i posted sales order , it must have the amount picked up from the corresponding purchase order and used the same in the sales invoice created in CustInvoiceJournal table.

Any help would be appreciated. 

*This post is locked for comments

  • mail2vd Profile Picture
    mail2vd 1,330 on at
    RE: failure posting intercompany purchase order through Code

    what if i have "FREE" TaxGroup in both Company A and B, now how  and where intercompany SO/PO creation process matches them and pick them in the lines?

    I mean how do I resolve my issue then.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: failure posting intercompany purchase order through Code

    When you select item in SO line it will take TaxItemGroupId from item. TaxGroup AX inits base on SO header fields. As a user you can change it them manually.

    However they are company specific so if in company A you have group "free' you may not have this group in company B so you cannot simply change code to set same group through intercompany chain

  • mail2vd Profile Picture
    mail2vd 1,330 on at
    RE: failure posting intercompany purchase order through Code

    but when i create PO from the AX client,   I select GST myself for a purch line. so that wouldn't be item or company specific. it's as per user's wish. isn't it?

    So when it creates sales order line in intercompany for that PO, it is expected that it follows what's in there for purch line.

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: failure posting intercompany purchase order through Code

    Just be aware that tax group is company specific so you have to have same group in both companies if you going to change code.

    I think AX takes GST group from item and customer (functional guys will correct me if i'm wrong) so you can change setup instead of changing code.

  • mail2vd Profile Picture
    mail2vd 1,330 on at
    RE: failure posting intercompany purchase order through Code

    what i found is that, when it creates purchase order, it has a line with GST Group as 'FREE' and it means there won't be any sales tax on it.

    but while creating corresponding sales order (standard AX Code), it doesn't keep the same GST Group for the sales Line. and hence the difference in the amount

    I tried to create from AX Client and it has the same behaviour.

    I feel i need to modify the standard ax code which will force ax to use the same GST  between those purchline and salesline.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: failure posting intercompany purchase order through Code

    When you try to invoice PO it checks if intercompany SO invoice has same value. In your case value is 0 and PO invoice is 13,080.35

    As you said you invoice SO first so why did you post it for 0 ? 

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,902 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,316 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans