code:-
sql:-
select DISTINCT vendPackingSlipTrans.PACKINGSLIPID from vendInvoiceTrans
inner join vendInvoiceJour
on vendInvoiceTrans.PurchID = vendInvoiceJour.PurchId and
vendInvoiceTrans.InvoiceId = vendInvoiceJour.InvoiceId and
vendInvoiceTrans.InvoiceDate = vendInvoiceJour.InvoiceDate and
vendInvoiceTrans.NumberSequenceGroup = vendInvoiceJour.NumberSequenceGroup and
vendInvoiceTrans.InternalInvoiceId = vendInvoiceJour.InternalInvoiceId
inner join vendInvoicePackingSlipQuantityMatch
on vendInvoicePackingSlipQuantityMatch.InvoiceSourceDocumentLIne = vendInvoiceTrans.SourceDocumentLine
inner join vendPackingSlipTrans
on vendPackingSlipTrans.SourceDocumentLine = vendInvoicePackingSlipQuantityMatch.PackingSlipSourceDocumentLine
and vendInvoiceJour.LEDGERVOUCHER='pass your journal vocuher'