voucher to Purchase order

   //inserting Records

        insert_recordset    DAK_VoucherTransactionTmpLoc(SubledgerVoucherDataAreaId, SubledgerVoucher, AccountingDate, SubledgerJournalEntry,PurchId,PurchStatus,DocumentState)

            select SubledgerVoucherDataAreaId, SubledgerVoucher, AccountingDate, SubledgerJournalEntry from GeneralJournalEntryLoc

            join subledgerVoucherGeneralJournalEntryLoc

            where subledgerVoucherGeneralJournalEntryLoc.GeneralJournalEntry   ==  GeneralJournalEntryLoc.RecId

            join vendInvoiceJour

                where vendInvoiceJour.CostLedgerVoucher == subledgerVoucherGeneralJournalEntryLoc.Voucher

                   && vendInvoiceJour.InvoiceDate == subledgerVoucherGeneralJournalEntryLoc.AccountingDate

              join vendInvoicePurchLink

                where vendInvoiceJour.InternalInvoiceId == vendInvoicePurchLink.internalInvoiceId

                   && vendInvoiceJour.PurchId == vendInvoicePurchLink.PurchId

                   && vendInvoiceJour.InvoiceId == vendInvoicePurchLink.InvoiceId

                   && vendInvoiceJour.InvoiceDate == vendInvoicePurchLink.InvoiceDate

             join PurchId,PurchStatus,DocumentState from PurchTableLoc

            where PurchTableLoc.PurchId == vendInvoicePurchLink.origPurchId;

Comments

Popular posts from this blog

How to Bypass Next in COC in D365 X++

create movement journal through code in d365 FO x++