Hi,
NAV 2009 Standard Structure (and 2013)
ON "Purch. Rcpt. Line"
"Item Rcpt. Entry No." > link to item ledger entry no. ex Entry No 323
ON "Item ledger entry"
Entry NO. > linked to Purch Rcpt Line ex Entey No 323
Document Type > Purchase Receipt
Entry Type > Purchase
Source No "10000"
Document No 107031
Document Line No. "20000" > purchase receipt line > lookup for header No.
ON "Value entry"
item ledger entry No > "Linked to item ledger entry No." (order line no.)
Purchase Invoice Number e line
> Document Type "Purchase Invoice"
> Document Line No. "line Number ex 20000"
Purchase Invoice Number e line
> Document Type "Purchase Invoice"
> Document No. > posted pruch invoice no.
> Document Line No. "line Number ex 20000" > lookup for posted pruch inv. header No.
SQL VIEW (with same structure)
You can add this view using NAV Linked Tables
SELECT DISTINCT [Purch_ Rcpt_ Line].[Document No_], [Purch_ Inv_ Line].[Document No_]
FROM (([Purch_ Inv_ Line] INNER JOIN [Value Entry] ON ([Value Entry].[Document Line No_] = [Purch_ Inv_ Line].[Line No_]) AND ([Purch_ Inv_ Line].[Document No_] = [Value Entry].[Document No_])) INNER JOIN [Item Ledger Entry] ON [Value Entry].[Item Ledger Entry No_] = [Item Ledger Entry].[Entry No_]) INNER JOIN [Purch_ Rcpt_ Line] ON ([Purch_ Rcpt_ Line].[Line No_] = [Item Ledger Entry].[Document Line No_]) AND ([Item Ledger Entry].[Document No_] = [Purch_ Rcpt_ Line].[Document No_])
WHERE ((([Value Entry].[Document Type])=6) AND (([Value Entry].[Invoiced Quantity])<>"0") AND (([Item Ledger Entry].[Document Type])=5))