inventtrans link to ledger tables

  • inventtrans link to ledger tables

    Posted by DSC Communities on June 26, 2020 at 11:59 am
    • Luke Smith

      Member

      June 26, 2020 at 11:59 AM

      I have created SQL queries the give me all ledger transactions for all accounts for a defined time frame down to the voucher level of detail.Ā  IĀ use the SQL code in Power Pivot with a connection to the database to provide basic transnational analysis and trendĀ analysis within Excel.Ā  All of this data ties to the trial balance.

      Now I want to enhance this data to provide drill down capability related to inventory transactions.Ā  Ā I want to be able to look into inventory related accounts (PPV, Warranty, Scrap, etc…) and drill down to see exactly what part numbers, quantities and dollar amounts make up the ledger transactions.

      I am new to AX (8 months) and there is no one at my company with this knowledge; so far, I am self-taught.Ā  I have hadĀ someĀ success with this, but the queries run slow.Ā  Also, I do not feel that I have a good understanding of the distinction between Physical and Non-physical transactions and the required table relationships.

      As I currently understand,Ā theĀ physical transaction is related to a physical movement of inventory, such as an inventoryĀ receipt, and this would have a physical voucher number. The processing of the vendor invoice for the inventory receipt, I believe, would be a purely financial transaction, and so a non-physical voucher.Ā 

      Also, (very important) where can I get the level below the Voucher?Ā  For example, if we receive multiple different part numbers on one voucher, I would like to see the dollar ledger impact (along with the quantities) for each part number.

      #Technical #finance

      ??

      ——————————
      Luke Smith
      Cost Accountant
      Forney Industries, Inc.
      Fort Collins CO
      ——————————

    • Barclay Hershey

      Member

      June 29, 2020 at 9:21 AM

      HI Luke,

      Roughly you need to get the Trans table for each module.Ā  Let’s look at customer invoices as an example.Ā  The CustInvoiceJour table has your voucher.Ā  From there you link to CustInvoiceTrans where you find the InventTransId, and with the InventTransId you can link to InventTransOrigin and from InventTransOrigin you link to InventTrans
      One issue you will probably encounter is that in most setups the ledger has 1 line which will link to many underlying transactions ( such as an receipt or invoice having more than 1 line ).

      For example, let’s say you want to see the cost of sales for the voucherĀ ARSI-000104156:

      Select CIJ.Partition, CIJ.DataAreaId, CIJ.LedgerVoucher, CIJ.InvoiceAccount,

      Ā Ā Ā Ā Ā Ā  CIT.InvoiceDate, CIT.InvoiceId, CIT.InventTransId,Ā  CIT.Linenum, CIT.ItemId,

      Ā Ā Ā Ā Ā Ā  IT1.CostExt

      From CustInvoiceJour As CIJ

      Left Join CustInvoiceTrans As CIT On CIJ.Partition = CIT.Partition

      Ā Ā Ā Ā Ā Ā  And CIJ.DataAreaId = CIT.DataAreaId

      Ā Ā Ā Ā Ā Ā  And CIJ.NumberSequenceGroup = CIT.NumberSequenceGroup

      Ā Ā Ā Ā Ā Ā  And CIJ.InvoiceDate = CIT.InvoiceDate

      Ā Ā Ā Ā Ā Ā  And CIJ.SalesId = CIT.SalesId

      Ā Ā Ā Ā Ā Ā  And CIJ.InvoiceId = CIT.InvoiceId

      Left Join (

      Ā Ā Ā Ā Ā Ā  Select ITO.Partition, ITO.DataAreaId, ITO.InventTransId,

      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  IT.InvoiceId, IT.DateFinancial,

      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  -( Sum(IT.CostAmountPosted + IT.CostAmountAdjustment) ) As CostExt

      Ā Ā Ā Ā Ā Ā  From InventTransOrigin As ITO

      Ā Ā Ā Ā Ā Ā  Inner Join InventTrans As IT On ITO.Partition = IT.Partition

      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  And ITO.DataAreaId = IT.DataAreaId

      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  And ITO.RecId = IT.InventTransOrigin

      Ā Ā Ā Ā Ā Ā  Group By ITO.Partition, ITO.DataAreaId, ITO.InventTransId, IT.InvoiceId, IT.DateFinancial

      ) As IT1 On CIT.Partition = IT1.Partition

      Ā Ā Ā Ā Ā Ā  And CIT.DataAreaId = IT1.DataAreaId

      Ā Ā Ā Ā Ā Ā  And CIT.InventTransId = IT1.InventTransId

      Ā Ā Ā Ā Ā Ā  And CIT.InvoiceId = IT1.InvoiceId

      Ā Ā Ā Ā Ā Ā  And CIT.InvoiceDate = IT1.DateFinancial

      Where CIJ.LedgerVoucher In ( ‘ARSI-000104156’ )

      ——————————
      Barclay Hershey
      Financial Analyst
      Sugar Creek Packing Co
      Cincinnati OH
      ——————————
      ——————————————-

    • Luke Smith

      Member

      July 30, 2020 at 5:44 PM

      Hi Barclay,

      This response is much appreciated!

      I just got back to working on this again and saw your post.Ā  I will have a look at this, and I am sure to have some questions.Ā  I am heading into the month-end close, so it may be a week or so.

      I do have one basic question, however.Ā  I am new to this site and I posted the question that you responded to, but I do not know how to get back to my posting to see the responses (like yours); I just happened to find this in another search.Ā  Any help would be appreciated.

      Thanks again.

      ——————————
      Luke Smith
      Cost Accountant
      Forney Industries, Inc.
      Fort Collins CO
      ——————————
      ——————————————-

    • Mark Yankovich

      Member

      July 31, 2020 at 8:14 AM

      Luke,

      We see responses to our posts come via e-mail with a link right back to the original message.Ā  ‘Search’ also works well.Ā  If looking for an older post and responses of yours enter your first and last name (in quotes) as search criteria.Ā  This has worked for me.

      ——————————
      Mark Yankovich
      Allegheny Bradford Corporation
      PA
      ——————————
      ——————————————-

    DSC Communities replied 5 years, 9 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘inventtrans link to ledger tables’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!