Where is the table that holds the contract information being used for a line item on the sales order/invoice?
There is no table that actually stores the pricing because it is calculated on the fly by using the rules defined on the Contract. However, there is a SQL API that comes with the product download that can be used in development. Note that if you are just trying to show the Contract that is being used on each line item, then you can use the Alternate SOP Entry window that is in the Omni Price dictionary. The purpose for providing this window is to show the Contract ID used in the bottom of the expanded line item.