Whenever i make a purchase invoice

whenever i make a purchase invoice select a supplier after selecting a supplier his previous record must be show…how much i have paid him & how much i have to still pay please change the module after select the supplier his previous history also show with total of his amount