Summary total Purchase orders

Summary total Purchase orders

Hi, I am looking to see if there is a way that I can create a custom function that adds add the total value for a deal that has mulitple purchase orders raise on the one record.  For a example fulfil the sale, we may need to order stock from 2 different suppliers to complete the job.  I would like to create a custom function that will add up the total values to complete a cost analysis.