Something like this should get you close:
public SelectFrom<ARInvoice>.
InnerJoin<ARTran>.
On<ARTran.tranType.IsEqual<ARInvoice.docType>.
And<ARTran.refNbr.IsEqual<ARInvoice.refNbr>>>.
InnerJoin<InventoryItem>.
On<InventoryItem.inventoryID.IsEqual<ARTran.inventoryID>>.
InnerJoin<INItemXRef>.
On<INItemXRef.inventoryID.IsEqual<InventoryItem.inventoryID>>.
Where<ARInvoice.customerID.IsEqual<SOOrder.customerID.FromCurrent>.
And<InventoryItem.inventoryID.IsEqual<TestInventory.inventoryId.FromCurrent>.
Or<INItemXRef.alternateID.IsEqual<TestInventory.alterateId.FromCurrent>>>>.View Invview;
Assuming your class TestInventory
has a field AlternateId
.