Hi Ali,
From the D365 F & O point of view, you may need to look at the below changes to maintain Order account and to query the aging data.
Need child classes for the below classes
1. CustBalanceList
2. CustAgingCalculation
3. CustBalanceListDocumentDate
4. CustBalanceListTransactionDate
Need extensions to the below tables
1. CustAgingReportTmp
2. CustTmpAccountSum
3. CustVendAgingCalculatedTmp
4. CustVendAgingProcessTmp
Finally, new Controller and DP classes and new report to call the customized logic from child classes and tables to accomplish the customization.
I forgot to mention in last reply that, we have already done this in D365 F & O as well based on our original version from AX2012.
Hope this helps. Thank you.