How the Est.Gross profit is calculated for the below-mentioned quote record?

Solution:
Gross Profit = Sales – Discount – Est. Extended Cost
You have a header discount of $1000 that applies to both line #1 & Line #2 and
also line discount of $500 which applies to line #2 item only.
The header discount of $1000 is allocated based on item sales / total sales i.e
Line #1 Discount = 2000 / (2000 + 17500) X 1000 = 102.56
Line #2 Discount = 17500/ (2000 + 17500) X 1000 = 897.44
Gross Profit Calculation:-
Line #1 GP = 2000 – 102.56 – 1500 = 397.44
Line #2 GP = 17500 – 897.44 – 13500 = 3102.56