fix: include credit notes in project gross margin calculation

(cherry picked from commit a378fee8e0)
This commit is contained in:
ravibharathi656
2026-01-20 08:46:33 +05:30
committed by Mergify
parent e1c71e0b8f
commit d9d48da505

View File

@@ -308,6 +308,8 @@ class Project(Document):
self.gross_margin = flt(self.total_billed_amount) - expense_amount self.gross_margin = flt(self.total_billed_amount) - expense_amount
if self.total_billed_amount: if self.total_billed_amount:
self.per_gross_margin = (self.gross_margin / flt(self.total_billed_amount)) * 100 self.per_gross_margin = (self.gross_margin / flt(self.total_billed_amount)) * 100
else:
self.per_gross_margin = 0
def update_purchase_costing(self): def update_purchase_costing(self):
total_purchase_cost = calculate_total_purchase_cost(self.name) total_purchase_cost = calculate_total_purchase_cost(self.name)