Add the values of one Parent filed and on Child field and store the sum in another Parent field

Add the values of one Parent filed and on Child field and store the sum in another Parent field

The required information is given below :

Parent doctype :

Child Doctype :

Entries to the Parent doctype :

Now I want to add Net Salary and in Incentives list the highest incentive i.e
2000 and store the value in Total Salary

Please help me out with this.