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
Post a Comment