Also can you help me to get a little bit understanding of discounts in pi_mstr, pid_det and pih_hist? Generaly i would like to obtain all contracted discounts and do not know what exactly is in these tables. Is pi_mstr just a list of all contracted discounts (trade deals)? But also how it works with price lists (it stands for discount percentage from the invoice or just amount of discount provided)? Generally what I want is to link somehow these concluded deals (value) to a customer/vendor.