RE: How to get all Purchase Orders, invoices, prepayments, settled or open for a vendor in a Query? AX 2012 R2
Hi Rana,
As per my understanding, you want to fetch data for all invoiced PO's for a given vendor.
On UI, it's visible on vendor transactions form:
Settled transactions will have balance column zero value and unsettled transactions will show some value(generally negative).
For a selected transaction, when clicked on history button, vendor settlement form gets opened with details on settlement tab and transactions tab.
Tables that can be joined to get the data:
VENDTRANS & VENDSETTLEMENT:
vendTrans.Voucher is the settlment voucher
vendSettlement.OffsetTransVoucher is the invoice voucher
VendTrans.Invoice -- invoice number
vendTrans.dataAreaId == vendSettlement.TransCompany
vendTrans.RecId == vendSettlement.TransRecId
VendTrans.AccountNum == VendSettlement.AccountNum
VendTrans.Transtype == payment
GENERAL JOURNAL POSTINGS:
SubledgerVoucherGeneralJournalEntry.AccountIngDate == vendTrans.TransDate
SubledgerVoucherGeneralJournalEntry.Voucher == vendTrans.voucher
SubledgerVoucherGeneralJournalEntry.VoucherDataAreaId == vendTrans.dataAreaId SubledgerVoucherGeneralJournalEntry.GeneralJournalEntry == GeneralJournalEntry.RecId
GeneralJournalAccountEntry.GeneralJournalEntry == GeneralJournalEntry.RecId
Hope this information is useful.
Thanks,
Chaitanya Golla