Product receipt through x++ from item arrival journal

Hi Team,

We need to post product receipt form item arrival journal with having reference as purchase order in AX 2012

Process: Inventory warehouse management → Journals → Item arrival → Item arrival

select Purchase order as reference and enter product receipt number in the header. after posting arrival journal. In the header go to Function → product receipt and do posting

Please share code if anyone come across this posting product receipt for item arrival journal for purchase order reference… Find below screenshots for reference.