The calculation of Gross Profit on the Sales Order Item does not re-run when you update the item Quantity via ‘Update Items’ button at top of Sales Order
Details:
Item Sell Price: $10
Item Cost: $5
Initially:
Quantity Ordered: 10 Units
Sale Price: $10/Unit
Total Sale: $100
Per Unit Cost: $5
Total Cost: $50
Gross Profit: $50
Update Quantity
Quantity Ordered: 5 Units
Sale Price: $10/Unit
Total Sale: $50
Per Unit Cost: $5
Total Cost: $50
Gross Profit: Should be $0 (But stays at $50)
GitHub Issue Link: Gross Profit is not recalculated on Sales Order Quantity Update · Issue #18723 · frappe/erpnext · GitHub