You basically have two options:
1) Use the line level detail (Item Ledger Entries, Resource Ledger Entries, G/L, etc.) which has the Location Code on the entry.
2) Use the Vendor Ledger Entry to identify the Posted Purchase Invoice, then use the Location Code from the Posted Invoice Header. Just be aware if your Purchase was split to multiple Locations across the lines, the Header will only contain one Location Code.